From 39b12cd9aba8569956c5b982c25af438ca02fd1a Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Wed, 25 Jul 2012 16:54:10 +0100
Subject: [PATCH] simpleFoam/turbineSiting: Simplified case to mesh in parallel
 but avoid the need for redistribution

---
 .../simpleFoam/motorBike/Allrun               |   4 +
 .../simpleFoam/turbineSiting/{0 => 0.org}/U   |   0
 .../turbineSiting/{0 => 0.org}/epsilon        |   0
 .../{0 => 0.org}/include/ABLConditions        |   0
 .../{0 => 0.org}/include/fixedInlet           |   0
 .../{0 => 0.org}/include/initialConditions    |   0
 .../{0 => 0.org}/include/sideAndTopPatches    |   5 +
 .../simpleFoam/turbineSiting/{0 => 0.org}/k   |   0
 .../simpleFoam/turbineSiting/{0 => 0.org}/nut |   0
 .../simpleFoam/turbineSiting/{0 => 0.org}/p   |   0
 .../simpleFoam/turbineSiting/Allclean         |  19 +-
 .../simpleFoam/turbineSiting/Allrun           |  37 +---
 .../turbineSiting/constant/polyMesh/boundary  |  28 ++-
 .../turbineSiting/system/changeDictionaryDict | 200 ------------------
 .../system/decomposeParDict-nonPar            |  29 ---
 .../turbineSiting/system/decomposeParDict-par |  22 --
 ...eParDict => decomposeParDict.hierarchical} |   4 +-
 ...arDict-4proc => decomposeParDict.ptscotch} |   0
 18 files changed, 42 insertions(+), 306 deletions(-)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/U (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/epsilon (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/include/ABLConditions (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/include/fixedInlet (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/include/initialConditions (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/include/sideAndTopPatches (93%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/k (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/nut (100%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/{0 => 0.org}/p (100%)
 delete mode 100644 tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict
 delete mode 100644 tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar
 delete mode 100644 tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par
 rename tutorials/incompressible/simpleFoam/turbineSiting/system/{decomposeParDict => decomposeParDict.hierarchical} (95%)
 rename tutorials/incompressible/simpleFoam/turbineSiting/system/{decomposeParDict-4proc => decomposeParDict.ptscotch} (100%)

diff --git a/tutorials/incompressible/simpleFoam/motorBike/Allrun b/tutorials/incompressible/simpleFoam/motorBike/Allrun
index cb5a66db11d..d8fdb9d007a 100755
--- a/tutorials/incompressible/simpleFoam/motorBike/Allrun
+++ b/tutorials/incompressible/simpleFoam/motorBike/Allrun
@@ -1,4 +1,6 @@
 #!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
 # Source tutorial run functions
 . $WM_PROJECT_DIR/bin/tools/RunFunctions
 
@@ -12,3 +14,5 @@ runApplication snappyHexMesh -overwrite
 
 runApplication potentialFoam -noFunctionObjects -writep
 runApplication `getApplication`
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/U b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/U
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/U
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/fixedInlet
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/fixedInlet
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/initialConditions
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/initialConditions
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches
similarity index 93%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches
index 96611f16ffa..bddc17121fe 100644
--- a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches
@@ -16,4 +16,9 @@ sides
     type slip;
 }
 
+"proc.*"
+{
+    type            processor;
+}
+
 // ************************************************************************* //
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/k b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/k
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/k
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/k
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/nut b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/nut
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/nut
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/nut
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/p b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/p
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/0/p
rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/p
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
index 2e2bcf8132e..dad1f81a5fe 100755
--- a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean
@@ -4,22 +4,11 @@ cd ${0%/*} || exit 1    # run from this directory
 # Source tutorial clean functions
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
+rm -rf 0 > /dev/null 2>&1
+
 cleanCase
-rm -rf VTK
-#rm -rf constant/cellToRegion constant/polyMesh/sets
-rm -rf constant/polyMesh/sets
-#rm -rf constant/cellLevel
-#rm -rf constant/cellZones
-#rm -rf constant/faceZones
-#rm -rf constant/faces
-#rm -rf constant/neighbour
-#rm -rf constant/owner
-#rm -rf constant/pointZones
-#rm -rf constant/points
-#rm -rf constant/refinementHistory
-#rm -rf constant/surfaceIndex
 
-# Reset decomposeParDict
-cp system/decomposeParDict-nonPar system/decomposeParDict
+# Remove decomposeParDict
+rm -f system/decomposeParDict
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun
index 81d296213c4..9852cc1cf9c 100755
--- a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun
@@ -4,36 +4,19 @@ cd ${0%/*} || exit 1    # run from this directory
 # Source tutorial run functions
 . $WM_PROJECT_DIR/bin/tools/RunFunctions
 
+# Make dummy 0 directory
+mkdir 0
+
 runApplication blockMesh
-cp system/decomposeParDict-nonPar system/decomposeParDict
+cp system/decomposeParDict.hierarchical system/decomposeParDict
 runApplication decomposePar
 
-#runApplication snappyHexMesh -overwrite
-#runApplication setSet -batch makeZones
-#runApplication setsToZones -noFlipMap
-#runApplication `getApplication`
-
-cp system/decomposeParDict-par system/decomposeParDict
-runParallel snappyHexMesh 2 -overwrite
-# *ProcAddressing files written by decomposePar no longer valid
-rm -f processor*/constant/polyMesh/*ProcAddressing
-
-# Add wildcard entries for meshed patches since not preserved
-# by decomposePar. Notice -literalRE option to add wildcard itself
-# without evaluation.
-runParallel changeDictionary 2 -literalRE -enableFunctionEntries
-
-cp system/decomposeParDict-4proc system/decomposeParDict
-# Unset floating point trapping since creating processor directories
-unset FOAM_SIGFPE
-unset FOAM_SETNAN
-runParallel redistributePar 4 -overwrite
-runParallel renumberMesh 4 -overwrite
-
-# Add wildcard entries for meshes patches since not preserved
-# by decomposePar. Notice -literalRE option to add wildcard itself
-# without evaluation.
-#runParallel changeDictionary 4 -literalRE
+cp system/decomposeParDict.ptscotch system/decomposeParDict
+runParallel snappyHexMesh 4 -overwrite
+
+find . -type f -iname "*level*" -exec rm {} \;
+
+ls -d processor* | xargs -i cp -r 0.org/* ./{}/0/ $1
 
 runParallel topoSet 4
 runParallel `getApplication` 4
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary
index 7b72e85f595..c3da61bd8cc 100644
--- a/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary
@@ -8,44 +8,50 @@
 FoamFile
 {
     version     2.0;
-    format      ascii;
+    format      binary;
     class       polyBoundaryMesh;
     location    "constant/polyMesh";
     object      boundary;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-5
+6
 (
     outlet
     {
         type            patch;
-        nFaces          600;
-        startFace       51900;
+        nFaces          922;
+        startFace       364825;
     }
     sides
     {
         type            patch;
-        nFaces          1200;
-        startFace       52500;
+        nFaces          1834;
+        startFace       365747;
     }
     inlet
     {
         type            patch;
-        nFaces          600;
-        startFace       53700;
+        nFaces          923;
+        startFace       367581;
     }
     ground
     {
         type            wall;
-        nFaces          900;
-        startFace       54300;
+        nFaces          0;
+        startFace       368504;
     }
     top
     {
         type            patch;
         nFaces          900;
-        startFace       55200;
+        startFace       368504;
+    }
+    terrain_patch0
+    {
+        type            wall;
+        nFaces          14400;
+        startFace       369404;
     }
 )
 
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict
deleted file mode 100644
index f0dc0c34f6c..00000000000
--- a/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict
+++ /dev/null
@@ -1,200 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      changeDictionaryDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#include        "$FOAM_CASE/0/include/initialConditions"
-#include        "$FOAM_CASE/0/include/ABLConditions"
-
-dictionaryReplacement
-{
-
-    // Specify
-    // - all fvPatchFields with potential non-uniform values
-    // - all fvPatchFields originating from meshing
-    // - all fvPatchFields originating from mesh-redistribution
-
-    p
-    {
-        boundaryField
-        {
-            outlet
-            {
-                type            uniformFixedValue;
-                uniformValue    constant $pressure;
-            }
-            inlet
-            {
-                type            zeroGradient;
-            }
-            "terrain_.*"
-            {
-                type            zeroGradient;
-            }
-            ground
-            {
-                type            zeroGradient;
-            }
-            #include "$FOAM_CASE/0/include/sideAndTopPatches"
-            "procBoundary.*"
-            {
-                type            processor;
-            }
-        }
-    }
-
-    k
-    {
-        boundaryField
-        {
-            outlet
-            {
-                type            inletOutlet;
-                inletValue      uniform 0.0;
-                value           uniform $turbulentKE;
-            }
-            inlet
-            {
-                type            uniformFixedValue;
-                uniformValue    constant $turbulentKE;
-            }
-            "terrain_.*"
-            {
-                type            kqRWallFunction;
-                value           uniform 0.0;
-            }
-            ground
-            {
-                type            zeroGradient;
-            }
-            #include "$FOAM_CASE/0/include/sideAndTopPatches"
-            "procBoundary.*"
-            {
-                type            processor;
-            }
-        }
-    }
-
-    U
-    {
-        boundaryField
-        {
-            outlet
-            {
-                type            inletOutlet;
-                inletValue      uniform (0 0 0);
-                value           uniform $flowVelocity;
-            }
-            inlet
-            {
-                type            atmBoundaryLayerInletVelocity;
-                Uref            $Uref;
-                Href            $Href;
-                n               $windDirection;
-                z               $zDirection;
-                z0              $z0;
-                zGround         $zGround;
-                value           uniform $flowVelocity;
-            }
-            "terrain_.*"
-            {
-                type            uniformFixedValue;
-                uniformValue    constant $flowVelocity;
-            }
-            ground
-            {
-                type            uniformFixedValue;
-                uniformValue    constant $flowVelocity;
-            }
-            #include "$FOAM_CASE/0/include/sideAndTopPatches"
-            "procBoundary.*"
-            {
-                type            processor;
-            }
-        }
-    }
-
-    nut
-    {
-        boundaryField
-        {
-            outlet
-            {
-                type            calculated;
-                value           uniform 0;
-            }
-            inlet
-            {
-                type            calculated;
-                value           uniform 0;
-            }
-            "terrain_.*"
-            {
-                type            nutkAtmRoughWallFunction;
-                z0              $z0;
-                value           uniform 0.0;
-            }
-            ground
-            {
-                type            calculated;
-                value           uniform 0;
-            }
-            #include "$FOAM_CASE/0/include/sideAndTopPatches"
-            "procBoundary.*"
-            {
-                type            processor;
-            }
-        }
-    }
-
-    epsilon
-    {
-        boundaryField
-        {
-            outlet
-            {
-                type            zeroGradient;
-            }
-            inlet
-            {
-                type            atmBoundaryLayerInletEpsilon;
-                z               $zDirection;
-                z0              $z0;
-                zGround         $zGround;
-                Uref            $Uref;
-                Href            $Href;
-                value           uniform $turbulentEpsilon;
-            }
-            "terrain_.*"
-            {
-                type            epsilonWallFunction;
-                Cmu             0.09;
-                kappa           0.4;
-                E               9.8;
-                value           uniform $turbulentEpsilon;
-            }
-            ground
-            {
-                type            zeroGradient;
-            }
-            #include "$FOAM_CASE/0/include/sideAndTopPatches"
-            "procBoundary.*"
-            {
-                type            processor;
-            }
-        }
-    }
-}
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar
deleted file mode 100644
index 42f1606ec97..00000000000
--- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar
+++ /dev/null
@@ -1,29 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      decomposeParDict;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-numberOfSubdomains 2;
-
-method          hierarchical;
-
-hierarchicalCoeffs
-{
-    n           (2 1 1);
-    delta       0.001;
-    order       xyz;
-}
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par
deleted file mode 100644
index ded6aceec01..00000000000
--- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par
+++ /dev/null
@@ -1,22 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      decomposeParDict;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-numberOfSubdomains 2;
-
-method          ptscotch;
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical
similarity index 95%
rename from tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict
rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical
index 42f1606ec97..541de112df4 100644
--- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical
@@ -15,13 +15,13 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-numberOfSubdomains 2;
+numberOfSubdomains 4;
 
 method          hierarchical;
 
 hierarchicalCoeffs
 {
-    n           (2 1 1);
+    n           (2 2 1);
     delta       0.001;
     order       xyz;
 }
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.ptscotch
similarity index 100%
rename from tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc
rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.ptscotch
-- 
GitLab