From 49a300b82b577426b46537b4f891cf1cf35b9fe9 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Tue, 9 Feb 2016 13:42:39 +0000
Subject: [PATCH] porousBlockage: New pisoFoam tutorial to demonstrate the
 porosity source fvOption

To see the different behavior of flow through and around the blockage
change D in constant/fvOptions:

        // D 100;  // Very little blockage
        // D 200;  // Some blockage but steady flow
        // D 500;  // Slight waviness in the far wake
        D 1000; // Fully shedding behavior
---
 .../pisoFoam/laminar/porousBlockage/0/U       | 39 +++++++++
 .../pisoFoam/laminar/porousBlockage/0/p       | 38 ++++++++
 .../pisoFoam/laminar/porousBlockage/Allrun    | 15 ++++
 .../laminar/porousBlockage/constant/fvOptions | 56 ++++++++++++
 .../constant/transportProperties              | 22 +++++
 .../constant/turbulenceProperties             | 20 +++++
 .../porousBlockage/system/blockMeshDict       | 86 +++++++++++++++++++
 .../laminar/porousBlockage/system/controlDict | 49 +++++++++++
 .../laminar/porousBlockage/system/fvSchemes   | 51 +++++++++++
 .../laminar/porousBlockage/system/fvSolution  | 59 +++++++++++++
 .../laminar/porousBlockage/system/topoSetDict | 43 ++++++++++
 11 files changed, 478 insertions(+)
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/U
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/p
 create mode 100755 tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/fvOptions
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/transportProperties
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/turbulenceProperties
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/controlDict
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSchemes
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSolution
 create mode 100644 tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/topoSetDict

diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/U b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/U
new file mode 100644
index 0000000000..73b9ed5aee
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/U
@@ -0,0 +1,39 @@
+/*--------------------------------*- 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       volVectorField;
+    object      U;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 1 -1 0 0 0 0];
+
+internalField   uniform (1 0 0);
+
+boundaryField
+{
+    //- Set patchGroups for constraint patches
+    #includeEtc "caseDicts/setConstraintTypes"
+
+    inlet
+    {
+        type            fixedValue;
+        value           $internalField;
+    }
+
+    outlet
+    {
+        type            pressureInletOutletVelocity;
+        value           $internalField;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/p b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/p
new file mode 100644
index 0000000000..723c5f95a0
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/0/p
@@ -0,0 +1,38 @@
+/*--------------------------------*- 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       volScalarField;
+    object      p;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -2 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    //- Set patchGroups for constraint patches
+    #includeEtc "caseDicts/setConstraintTypes"
+
+    inlet
+    {
+        type            zeroGradient;
+    }
+
+    outlet
+    {
+        type            fixedValue;
+        value           $internalField;
+    }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun
new file mode 100755
index 0000000000..a72c18a9dd
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/Allrun
@@ -0,0 +1,15 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # Run from this directory
+
+# Source tutorial run functions
+. $WM_PROJECT_DIR/bin/tools/RunFunctions
+
+application=`getApplication`
+
+runApplication blockMesh
+
+runApplication topoSet
+
+runApplication $application
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/fvOptions b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/fvOptions
new file mode 100644
index 0000000000..fcba4b2188
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/fvOptions
@@ -0,0 +1,56 @@
+/*--------------------------------*- 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;
+    location    "constant";
+    object      fvOptions;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+porosity1
+{
+    type            explicitPorositySource;
+    active          yes;
+
+    explicitPorositySourceCoeffs
+    {
+        selectionMode   cellZone;
+        cellZone        porousBlockage;
+
+        type            DarcyForchheimer;
+
+        // D 100;  // Very little blockage
+        // D 200;  // Some blockage but steady flow
+        // D 500;  // Slight waviness in the far wake
+        D 1000; // Fully shedding behavior
+
+        DarcyForchheimerCoeffs
+        {
+            d   ($D $D $D);
+            f   (0 0 0);
+
+            coordinateSystem
+            {
+                type    cartesian;
+                origin  (0 0 0);
+                coordinateRotation
+                {
+                    type    axesRotation;
+                    e1  (1 0 0);
+                    e2  (0 1 0);
+                }
+            }
+        }
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/transportProperties b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/transportProperties
new file mode 100644
index 0000000000..e277198874
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/transportProperties
@@ -0,0 +1,22 @@
+/*--------------------------------*- 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;
+    location    "constant";
+    object      transportProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+transportModel  Newtonian;
+
+nu              [0 2 -1 0 0 0 0] 5e-3; // Re_blockage = 200
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/turbulenceProperties b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/turbulenceProperties
new file mode 100644
index 0000000000..e26b4d516f
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/constant/turbulenceProperties
@@ -0,0 +1,20 @@
+/*--------------------------------*- 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;
+    location    "constant";
+    object      turbulenceProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+simulationType laminar;
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
new file mode 100644
index 0000000000..2b3aa69023
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
@@ -0,0 +1,86 @@
+/*--------------------------------*- 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      blockMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+convertToMeters 1;
+
+vertices
+(
+    (-2 -2 -0.1)
+    (6  -2 -0.1)
+    (6   2 -0.1)
+    (-2  2 -0.1)
+    (-2 -2  0.1)
+    (6  -2  0.1)
+    (6   2  0.1)
+    (-2  2  0.1)
+);
+
+blocks
+(
+    hex (0 1 2 3 4 5 6 7) (64 32 1) simpleGrading (1 1 1)
+);
+
+boundary
+(
+    inlet
+    {
+        type patch;
+        faces
+        (
+            (0 4 7 3)
+        );
+    }
+
+    outlet
+    {
+        type patch;
+        faces
+        (
+            (2 6 5 1)
+        );
+    }
+
+    top
+    {
+        type symmetryPlane;
+        faces
+        (
+            (3 7 6 2)
+        );
+    }
+
+    bottom
+    {
+        type symmetryPlane;
+        faces
+        (
+
+            (1 5 4 0)
+        );
+    }
+
+    frontAndBack
+    {
+        type empty;
+        faces
+        (
+            (0 3 2 1)
+            (4 5 6 7)
+        );
+    }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/controlDict b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/controlDict
new file mode 100644
index 0000000000..ddc096b19d
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/controlDict
@@ -0,0 +1,49 @@
+/*--------------------------------*- 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;
+    location    "system";
+    object      controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application     pisoFoam;
+
+startFrom       startTime;
+
+startTime       0;
+
+stopAt          endTime;
+
+endTime         100;
+
+deltaT          0.05;
+
+writeControl    runTime;
+
+writeInterval   1;
+
+purgeWrite      0;
+
+writeFormat     ascii;
+
+writePrecision  6;
+
+writeCompression off;
+
+timeFormat      general;
+
+timePrecision   6;
+
+runTimeModifiable true;
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSchemes b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSchemes
new file mode 100644
index 0000000000..131fe0b498
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSchemes
@@ -0,0 +1,51 @@
+/*--------------------------------*- 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;
+    location    "system";
+    object      fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{
+    default         Euler;
+}
+
+gradSchemes
+{
+    default         Gauss linear;
+}
+
+divSchemes
+{
+    default         none;
+    div(phi,U)      Gauss LUST grad(U);
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
+}
+
+laplacianSchemes
+{
+    default         Gauss linear uncorrected;
+}
+
+interpolationSchemes
+{
+    default         linear;
+}
+
+snGradSchemes
+{
+    default         uncorrected;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSolution b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSolution
new file mode 100644
index 0000000000..7342e01ebe
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/fvSolution
@@ -0,0 +1,59 @@
+/*--------------------------------*- 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;
+    location    "system";
+    object      fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+solvers
+{
+    p
+    {
+        solver          GAMG;
+        tolerance       1e-06;
+        relTol          0.1;
+        smoother        GaussSeidel;
+        nPreSweeps      0;
+        nPostSweeps     2;
+        cacheAgglomeration on;
+        agglomerator    faceAreaPair;
+        nCellsInCoarsestLevel 10;
+        mergeLevels     1;
+    }
+
+    pFinal
+    {
+        $p;
+        tolerance       1e-06;
+        relTol          0;
+    }
+
+    "(U|k|epsilon|omega|R|nuTilda)"
+    {
+        solver          smoothSolver;
+        smoother        GaussSeidel;
+        tolerance       1e-05;
+        relTol          0;
+    }
+}
+
+PISO
+{
+    nCorrectors     2;
+    nNonOrthogonalCorrectors 0;
+    pRefCell        0;
+    pRefValue       0;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/topoSetDict b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/topoSetDict
new file mode 100644
index 0000000000..1102b49108
--- /dev/null
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/topoSetDict
@@ -0,0 +1,43 @@
+/*--------------------------------*- 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
+(
+    // porousBlockage
+    {
+        name    porousBlockageCellSet;
+        type    cellSet;
+        action  new;
+        source  boxToCell;
+        sourceInfo
+        {
+            box (-0.5 -0.5 -1) (0.5 0.5 1);
+        }
+    }
+    {
+        name    porousBlockage;
+        type    cellZoneSet;
+        action  new;
+        source  setToCellZone;
+        sourceInfo
+        {
+            set porousBlockageCellSet;
+        }
+    }
+);
+
+// ************************************************************************* //
-- 
GitLab