From a0a13075c0f56dd9ce7bd7d6433e168d5ffcd082 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Wed, 22 Jan 2014 17:35:45 +0000
Subject: [PATCH] ENH: propeller: updated for new snappyHexMesh faceType
 capability

---
 .../pimpleDyMFoam/propeller/0.org/U           |   5 +-
 .../pimpleDyMFoam/propeller/0.org/epsilon     |  11 +-
 .../pimpleDyMFoam/propeller/0.org/k           |  11 +-
 .../pimpleDyMFoam/propeller/0.org/nut         |  11 +-
 .../pimpleDyMFoam/propeller/0.org/p           |  10 +-
 .../pimpleDyMFoam/propeller/Allrun.pre        |  25 +---
 .../propeller/system/controlDict              |   7 +-
 .../system/createAMIFaces.topoSetDict         | 110 ------------------
 .../propeller/system/createBafflesDict        |  58 ---------
 .../system/createInletOutletSets.topoSetDict  |   2 +-
 .../propeller/system/createPatchDict          |  35 +++++-
 .../system/removeRedundantZones.topoSetDict   |  32 -----
 .../propeller/system/snappyHexMeshDict        |  36 +++---
 13 files changed, 80 insertions(+), 273 deletions(-)
 delete mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/createAMIFaces.topoSetDict
 delete mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/createBafflesDict
 delete mode 100644 tutorials/incompressible/pimpleDyMFoam/propeller/system/removeRedundantZones.topoSetDict

diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/U b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/U
index c78eec59c1a..69ad1d5c6f4 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/U
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/U
@@ -21,6 +21,9 @@ internalField   uniform (0 0 0);
 
 boundaryField
 {
+    //- Set patchGroups for constraint patches
+    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
+
     inlet
     {
         type            fixedValue;
@@ -34,7 +37,7 @@ boundaryField
         value           uniform (0 0 0);
     }
 
-    outerCylinder
+    innerCylinder
     {
         type            fixedValue;
         value           uniform (0 0 0);
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/epsilon b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/epsilon
index c8a9ab3e885..9053f852183 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/epsilon
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/epsilon
@@ -21,6 +21,9 @@ internalField   uniform 0.0495;
 
 boundaryField
 {
+    //- Set patchGroups for constraint patches
+    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
+
     inlet
     {
         type            fixedValue;
@@ -34,13 +37,7 @@ boundaryField
         value           $internalField;
     }
 
-    outerCylinder
-    {
-        type            epsilonWallFunction;
-        value           $internalField;
-    }
-
-    "propeller.*"
+    wall
     {
         type            epsilonWallFunction;
         value           $internalField;
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/k b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/k
index fa184b506d4..83b933726fc 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/k
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/k
@@ -21,6 +21,9 @@ internalField   uniform 0.06;
 
 boundaryField
 {
+    //- Set patchGroups for constraint patches
+    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
+
     inlet
     {
         type            fixedValue;
@@ -34,13 +37,7 @@ boundaryField
         value           $internalField;
     }
 
-    outerCylinder
-    {
-        type            kqRWallFunction;
-        value           $internalField;
-    }
-
-    "propeller.*"
+    wall
     {
         type            kqRWallFunction;
         value           $internalField;
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/nut b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/nut
index 0c696194233..4918acab132 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/nut
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/nut
@@ -21,6 +21,9 @@ internalField   uniform 0;
 
 boundaryField
 {
+    //- Set patchGroups for constraint patches
+    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
+
     inlet
     {
         type            calculated;
@@ -33,13 +36,7 @@ boundaryField
         value           uniform 0;
     }
 
-    outerCylinder
-    {
-        type            nutkWallFunction;
-        value           uniform 0;
-    }
-
-    "propeller.*"
+    wall
     {
         type            nutkWallFunction;
         value           uniform 0;
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/p b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/p
index 98504cb29b2..4faf52a108b 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/p
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/0.org/p
@@ -21,6 +21,9 @@ internalField   uniform 0;
 
 boundaryField
 {
+    //- Set patchGroups for constraint patches
+    #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes"
+
     inlet
     {
         type            zeroGradient;
@@ -32,12 +35,7 @@ boundaryField
         value           uniform 0;
     }
 
-    outerCylinder
-    {
-        type            zeroGradient;
-    }
-
-    "propeller.*"
+    wall
     {
         type            zeroGradient;
     }
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre
index 2abd5b41e17..e3b951232b2 100755
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre
@@ -22,34 +22,21 @@ cp -rf 0.org 0
 
 # - generate face/cell sets and zones
 
-#runApplication setSet -batch removeRedundantZones.setSet
-#mv log.setSet log.removeRedundantZones.setSet
-runApplication topoSet -dict system/removeRedundantZones.topoSetDict
-mv log.topoSet log.removeRedundantZones.topoSet
-
 #runApplication setSet -batch createInletOutletSets.setSet
 #mv log.setSet log.createInletOutletSets.setSet
 runApplication topoSet -dict system/createInletOutletSets.topoSetDict
-mv log.topoSet log.createInletOutletSets.topoSet
-
-#runApplication setSet -batch createAMIFaces.setSet
-#mv log.setSet log.createAMIFaces.setSet
-runApplication topoSet -dict system/createAMIFaces.topoSetDict
-mv log.topoSet log.createAMIFaces.topoSet
+#mv log.topoSet log.createInletOutletSets.topoSet
 
 
-# - create the inlet/outlet patches
+# - create the inlet/outlet and AMI patches
 
 runApplication createPatch -overwrite
 
 
-# - apply the initial fields
-
-cp -rf 0.org 0
-
+# - test by running moveDynamicMes
+#runApplication moveDynamicMesh -checkAMI
 
-# - create the AMI faces by creating baffles, and then splitting the mesh
 
-runApplication createBaffles -overwrite
+# - apply the initial fields
 
-runApplication mergeOrSplitBaffles -split -overwrite
+cp -rf 0.org 0
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict
index 96dc9e9cfd0..2dd542c3d5a 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict
@@ -32,11 +32,14 @@ stopAt          endTime;
 endTime         0.1;
 
 deltaT          1e-5;
-
 writeControl    adjustableRunTime;
-
 writeInterval   0.001;
 
+////- For testing with moveDynamicMesh
+//deltaT          0.01;
+//writeControl    timeStep;
+//writeInterval   1;
+
 purgeWrite      0;
 
 writeFormat     binary;
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createAMIFaces.topoSetDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createAMIFaces.topoSetDict
deleted file mode 100644
index aafbfb67999..00000000000
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createAMIFaces.topoSetDict
+++ /dev/null
@@ -1,110 +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      topoSetDict;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-actions
-(
-    {
-        name    innerCylinderSmall;
-        type    cellSet;
-        action  new;
-        source  cylinderToCell;
-        sourceInfo
-        {
-            p1      (0 -0.08 0);
-            p2      (0 0.06 0);
-            radius  0.12;
-        }
-    }
-    {
-        name    outerCells;
-        type    cellSet;
-        action  new;
-        source  cellToCell;
-        sourceInfo
-        {
-            set innerCylinderSmall;
-        }
-    }
-    {
-        name    outerCells;
-        type    cellSet;
-        action  invert;
-    }
-
-    {
-        name    innerCylinderSmall;
-        type    cellZoneSet;
-        action  new;
-        source  setToCellZone;
-        sourceInfo
-        {
-            set     innerCylinderSmall;
-        }
-    }
-
-
-
-    {
-        name    innerCylinderSmallFace;
-        type    faceSet;
-        action  new;
-        source  cellToFace;
-        sourceInfo
-        {
-            set     innerCylinderSmall;
-            option  all;
-        }
-    }
-    {
-        name    innerCylinderSmallFace;
-        type    faceSet;
-        action  subset;
-        source  cellToFace;
-        sourceInfo
-        {
-            set     outerCells;
-            option  all;
-        }
-    }
-    {
-        name    innerCylinderSmall;
-        type    faceZoneSet;
-        action  new;
-        source  setsToFaceZone;
-        sourceInfo
-        {
-            faceSet     innerCylinderSmallFace;
-            cellSet     innerCylinderSmall;
-        }
-    }
-
-
-    // Dummy faceSet for creating initial patches
-    {
-        name    dummyFaces;
-        type    faceSet;
-        action  new;
-        source  labelToFace;
-        sourceInfo
-        {
-            value ();
-        }
-    }
-
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createBafflesDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createBafflesDict
deleted file mode 100644
index f3a7eadc973..00000000000
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createBafflesDict
+++ /dev/null
@@ -1,58 +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      createBafflesDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-// Whether to convert internal faces only (so leave boundary faces intact).
-// This is only relevant if your face selection type can pick up boundary
-// faces.
-internalFacesOnly true;
-
-
-// Baffles to create.
-baffles
-{
-    baffleFaces
-    {
-        //- Use predefined faceZone to select faces and orientation.
-        type        faceZone;
-        zoneName    innerCylinderSmall;
-
-
-        patches
-        {
-            master
-            {
-                //- Master side patch
-                name            AMI1;
-                type            cyclicAMI;
-                matchTolerance  0.0001;
-                neighbourPatch  AMI2;
-                transform       noOrdering;
-            }
-            slave
-            {
-                //- Slave side patch
-                name            AMI2;
-                type            cyclicAMI;
-                matchTolerance  0.0001;
-                neighbourPatch  AMI1;
-                transform       noOrdering;
-            }
-        }
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createInletOutletSets.topoSetDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createInletOutletSets.topoSetDict
index ad10b2e643c..4291261dbc8 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createInletOutletSets.topoSetDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createInletOutletSets.topoSetDict
@@ -24,7 +24,7 @@ actions
         source  patchToFace;
         sourceInfo
         {
-            name outerCylinder;
+            name innerCylinder;
         }
     }
 
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createPatchDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createPatchDict
index 1559be08ddd..d83f0bc7c34 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/createPatchDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/createPatchDict
@@ -23,27 +23,50 @@ pointSync false;
 patches
 (
     {
-        name inlet;
+        //- Master side patch
+        name            AMI1;
+        patchInfo
+        {
+            type            cyclicAMI;
+            matchTolerance  0.0001;
+            neighbourPatch  AMI2;
+            transform       noOrdering;
+        }
+        constructFrom patches;
+        patches (innerCylinderSmall);
+    }
 
+    {
+        //- Slave side patch
+        name            AMI2;
         patchInfo
         {
-            type            patch;
+            type            cyclicAMI;
+            matchTolerance  0.0001;
+            neighbourPatch  AMI1;
+            transform       noOrdering;
         }
+        constructFrom patches;
+        patches (innerCylinderSmall_slave);
+    }
 
-        constructFrom set;
 
+    {
+        name inlet;
+        patchInfo
+        {
+            type            patch;
+        }
+        constructFrom set;
         set inletFaces;
     }
     {
         name outlet;
-
         patchInfo
         {
             type            patch;
         }
-
         constructFrom set;
-
         set outletFaces;
     }
 );
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/removeRedundantZones.topoSetDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/removeRedundantZones.topoSetDict
deleted file mode 100644
index 5def0de3692..00000000000
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/removeRedundantZones.topoSetDict
+++ /dev/null
@@ -1,32 +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      topoSetDict;
-}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-actions
-(
-    {
-        name    innerCylinder;
-        type    cellZoneSet;
-        action  remove;
-    }
-    {
-        name    innerCylinderSmall;
-        type    cellZoneSet;
-        action  remove;
-    }
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict
index d060b73f934..a426274ed5b 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict
@@ -204,13 +204,12 @@ castellatedMeshControls
         innerCylinder
         {
             level       (2 3);
-            cellZone    innerCylinder;
-            faceZone    innerCylinder;
-            cellZoneInside  inside;
         }
         innerCylinderSmall
         {
             level       (4 4);
+
+            faceType    boundary;
             cellZone    innerCylinderSmall;
             faceZone    innerCylinderSmall;
             cellZoneInside  inside;
@@ -288,7 +287,7 @@ castellatedMeshControls
     // Whether any faceZones (as specified in the refinementSurfaces)
     // are only on the boundary of corresponding cellZones or also allow
     // free-standing zone faces. Not used if there are no faceZones.
-    allowFreeStandingZoneFaces true;
+    allowFreeStandingZoneFaces false;
 }
 
 
@@ -312,10 +311,22 @@ snapControls
     //  before upon reaching a correct mesh.
     nRelaxIter 5;
 
-    //- Highly experimental and wip: number of feature edge snapping
-    //  iterations. Leave out altogether to disable.
-    //  Do not use here since mesh resolution too low and baffles present
-    nFeatureSnapIter 20;
+    // Feature snapping
+
+        // Number of feature edge snapping iterations.
+        // Leave out altogether to disable.
+        nFeatureSnapIter 10;
+
+        // Detect (geometric only) features by sampling the surface
+        // (default=false).
+        implicitFeatureSnap true;
+
+        // Use castellatedMeshControls::features (default = true)
+        explicitFeatureSnap false;
+
+        // Detect features between multiple surfaces
+        // (only for explicitFeatureSnap, default = false)
+        multiRegionFeatureSnap true;
 }
 
 
@@ -466,15 +477,6 @@ meshQualityControls
 }
 
 
-// Advanced
-
-// Flags for optional output
-// 0 : only write final meshes
-// 1 : write intermediate meshes
-// 2 : write volScalarField with cellLevel for postprocessing
-// 4 : write current intersections as .obj files
-debug 0;
-
 
 // Merge tolerance. Is fraction of overall bounding box of initial mesh.
 // Note: the write tolerance needs to be higher than this.
-- 
GitLab