From 4b81f443781b3384ca6827dfe07bed61a3a6bec4 Mon Sep 17 00:00:00 2001
From: andy <a.heather@opencfd.co.uk>
Date: Fri, 13 Feb 2009 17:03:05 +0000
Subject: [PATCH] more updates...

---
 .../movingCone/0/U                            |  0
 .../movingCone/0/cellMotionUx                 |  0
 .../movingCone/0/p                            |  0
 .../movingCone/0/pointMotionUx                |  0
 .../movingCone/constant/dynamicMeshDict       |  0
 .../constant/polyMesh/blockMeshDict           |  0
 .../movingCone/constant/polyMesh/boundary     |  5 +-
 .../movingCone/constant/transportProperties   | 39 ++++++++++++++
 .../movingCone/constant/turbulenceProperties} |  6 +--
 .../movingCone/system/controlDict             |  0
 .../movingCone/system/fvSchemes               |  2 +
 .../movingCone/system/fvSolution              |  0
 .../movingCone/system/tetFemSolution          |  0
 .../simpleSRFFoam/mixer/0/epsilon             |  8 ++-
 .../incompressible/simpleSRFFoam/mixer/0/k    | 17 +++---
 .../incompressible/simpleSRFFoam/mixer/0/nut  | 54 +++++++++++++++++++
 .../simpleSRFFoam/mixer/0/omega               | 19 ++++---
 .../simpleSRFFoam/simpleSRFFoam/Make/options  |  6 ++-
 .../simpleSRFFoam/simpleSRFFoam/UEqn.H        | 16 ++++++
 .../simpleSRFFoam/convergenceCheck.H          |  9 ++++
 .../simpleSRFFoam/initConvergenceCheck.H      |  7 +++
 .../simpleSRFFoam/simpleSRFFoam/pEqn.H        | 34 ++++++++++++
 .../simpleSRFFoam/simpleSRFFoam.C             | 54 +++----------------
 23 files changed, 204 insertions(+), 72 deletions(-)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/0/U (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/0/cellMotionUx (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/0/p (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/0/pointMotionUx (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/constant/dynamicMeshDict (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/constant/polyMesh/blockMeshDict (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/constant/polyMesh/boundary (90%)
 create mode 100644 tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties
 rename tutorials/incompressible/{icoDyMFoam/movingCone/constant/transportProperties => pimpleDyMFoam/movingCone/constant/turbulenceProperties} (88%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/system/controlDict (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/system/fvSchemes (94%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/system/fvSolution (100%)
 rename tutorials/incompressible/{icoDyMFoam => pimpleDyMFoam}/movingCone/system/tetFemSolution (100%)
 create mode 100644 tutorials/incompressible/simpleSRFFoam/mixer/0/nut
 create mode 100644 tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H
 create mode 100644 tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H
 create mode 100644 tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H
 create mode 100644 tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H

diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/U b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/U
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/0/U
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/U
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/cellMotionUx b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/cellMotionUx
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/0/cellMotionUx
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/cellMotionUx
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/p b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/0/p
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/p
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/pointMotionUx b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/pointMotionUx
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/0/pointMotionUx
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/pointMotionUx
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/dynamicMeshDict
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/dynamicMeshDict
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/dynamicMeshDict
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/blockMeshDict
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/blockMeshDict
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/blockMeshDict
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary
similarity index 90%
rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary
index f272243696f..bf656b10e37 100644
--- a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary
@@ -1,8 +1,8 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.5                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -10,6 +10,7 @@ FoamFile
     version     2.0;
     format      binary;
     class       polyBoundaryMesh;
+    location    "constant/polyMesh";
     object      boundary;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties
new file mode 100644
index 00000000000..aad34b40df2
--- /dev/null
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties
@@ -0,0 +1,39 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  1.5                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    location    "constant";
+    object      transportProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+transportModel  Newtonian;
+
+nu              nu [ 0 2 -1 0 0 0 0 ] 1e-05;
+
+CrossPowerLawCoeffs
+{
+    nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
+    nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
+    m               m [ 0 0 1 0 0 0 0 ] 1;
+    n               n [ 0 0 0 0 0 0 0 ] 1;
+}
+
+BirdCarreauCoeffs
+{
+    nu0             nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
+    nuInf           nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
+    k               k [ 0 0 1 0 0 0 0 ] 0;
+    n               n [ 0 0 0 0 0 0 0 ] 1;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties
similarity index 88%
rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties
index cdd96395a83..886d34bdef1 100644
--- a/tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties
@@ -8,14 +8,14 @@
 FoamFile
 {
     version     2.0;
-    format      binary;
+    format      ascii;
     class       dictionary;
     location    "constant";
-    object      transportProperties;
+    object      turbulenceProperties;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-nu              nu [ 0 2 -1 0 0 0 0 ] 1e-05;
+simulationType  laminar;
 
 
 // ************************************************************************* //
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/system/controlDict
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes
similarity index 94%
rename from tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes
index 092fc762b36..c7c76eb965b 100644
--- a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes
@@ -30,6 +30,7 @@ divSchemes
 {
     default         none;
     div(phi,U)      Gauss linear;
+    div((nuEff*dev(grad(U).T()))) Gauss linear;
 }
 
 laplacianSchemes
@@ -39,6 +40,7 @@ laplacianSchemes
     laplacian(rAU,pcorr) Gauss linear corrected;
     laplacian(rAU,p) Gauss linear corrected;
     laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
+    laplacian(nuEff,U) Gauss linear uncorrected;
 }
 
 interpolationSchemes
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/system/fvSolution
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution
diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/tetFemSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/tetFemSolution
similarity index 100%
rename from tutorials/incompressible/icoDyMFoam/movingCone/system/tetFemSolution
rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/tetFemSolution
diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon b/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon
index b2de5276310..680983af0a0 100644
--- a/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon
+++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon
@@ -33,12 +33,16 @@ boundaryField
 
     innerWall       
     {
-        type            zeroGradient;
+        type            epsilonWallFunction;
+        U               Urel;
+        value           uniform 14.855;
     }
 
     outerWall       
     {
-        type            zeroGradient;
+        type            epsilonWallFunction;
+        U               Urel;
+        value           uniform 14.855;
     }
 
     cyclic    
diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/k b/tutorials/incompressible/simpleSRFFoam/mixer/0/k
index 0b8345b26ef..59c1b73fc34 100644
--- a/tutorials/incompressible/simpleSRFFoam/mixer/0/k
+++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/k
@@ -1,8 +1,8 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.5                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -10,6 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
+    location    "0";
     object      k;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -25,26 +26,26 @@ boundaryField
         type            fixedValue;
         value           uniform 0.375;
     }
-
     outlet
     {
         type            zeroGradient;
     }
-
     innerWall
     {
-        type            zeroGradient;
+        type            kQRWallFunction;
+        value           uniform 0.375;
     }
-
     outerWall
     {
-        type            zeroGradient;
+        type            kQRWallFunction;
+        value           uniform 0.375;
     }
-
     cyclic
     {
         type            cyclic;
+        value           uniform 0.375;
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/nut b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut
new file mode 100644
index 00000000000..3bc0c6bc016
--- /dev/null
+++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut
@@ -0,0 +1,54 @@
+/*--------------------------------*- 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;
+    location    "0";
+    object      nut;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions      [0 2 -1 0 0 0 0];
+
+internalField   uniform 0;
+
+boundaryField
+{
+    inlet
+    {
+        type            calculated;
+        value           uniform 0;
+    }
+    outlet
+    {
+        type            calculated;
+        value           uniform 0;
+    }
+    innerWall
+    {
+        type            nutWallFunction;
+        U               Urel;
+        value           uniform 0;
+    }
+    outerWall
+    {
+        type            nutWallFunction;
+        U               Urel;
+        value           uniform 0;
+    }
+    cyclic
+    {
+        type            cyclic;
+        value           uniform 0;
+    }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/omega b/tutorials/incompressible/simpleSRFFoam/mixer/0/omega
index c5c54bbe2d5..ac3556f3d24 100644
--- a/tutorials/incompressible/simpleSRFFoam/mixer/0/omega
+++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/omega
@@ -1,8 +1,8 @@
 /*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  1.5                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -10,6 +10,7 @@ FoamFile
     version     2.0;
     format      ascii;
     class       volScalarField;
+    location    "0";
     object      omega;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -25,26 +26,28 @@ boundaryField
         type            fixedValue;
         value           uniform 3.5;
     }
-
     outlet
     {
         type            zeroGradient;
     }
-
     innerWall
     {
-        type            zeroGradient;
+        type            omegaWallFunction;
+        U               Urel;
+        value           uniform 3.5;
     }
-
     outerWall
     {
-        type            zeroGradient;
+        type            omegaWallFunction;
+        U               Urel;
+        value           uniform 3.5;
     }
-
     cyclic
     {
         type            cyclic;
+        value           uniform 3.5;
     }
 }
 
+
 // ************************************************************************* //
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options
index 8a31f7e5abb..cc3cd5e731e 100644
--- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options
@@ -1,7 +1,9 @@
 EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
-    -I$(LIB_SRC)/turbulenceModels/RAS \
-    -I$(LIB_SRC)/transportModels
+    -I$(LIB_SRC)/turbulenceModels \
+    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+    -I$(LIB_SRC)/transportModels \
+    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
 
 EXE_LIBS = \
     -lincompressibleRASModels \
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H
new file mode 100644
index 00000000000..72f3ea65439
--- /dev/null
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H
@@ -0,0 +1,16 @@
+    // Momentum predictor
+    tmp<fvVectorMatrix> UrelEqn
+    (
+        fvm::div(phi, Urel)
+        + turbulence->divDevReff(Urel)
+        + SRF->Su()
+    );
+
+    UrelEqn().relax();
+
+    eqnResidual = solve
+    (
+        UrelEqn() == -fvc::grad(p)
+    ).initialResidual();
+
+    maxResidual = max(eqnResidual, maxResidual);
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H
new file mode 100644
index 00000000000..8958063193a
--- /dev/null
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H
@@ -0,0 +1,9 @@
+// check convergence
+
+if (maxResidual < convergenceCriterion)
+{
+    Info<< "reached convergence criterion: " << convergenceCriterion << endl;
+    runTime.writeAndEnd();
+    Info<< "latestTime = " << runTime.timeName() << endl;
+}
+
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H
new file mode 100644
index 00000000000..b56197f22a5
--- /dev/null
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H
@@ -0,0 +1,7 @@
+// initialize values for convergence checks
+
+    scalar eqnResidual = 1, maxResidual = 0;
+    scalar convergenceCriterion = 0;
+
+    simple.readIfPresent("convergence", convergenceCriterion);
+
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H
new file mode 100644
index 00000000000..b2bc37fd5db
--- /dev/null
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H
@@ -0,0 +1,34 @@
+{
+    p.boundaryField().updateCoeffs();
+    volScalarField AUrel = UrelEqn().A();
+    Urel = UrelEqn().H()/AUrel;
+    UrelEqn.clear();
+    phi = fvc::interpolate(Urel) & mesh.Sf();
+    adjustPhi(phi, Urel, p);
+
+    // Non-orthogonal pressure corrector loop
+    for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+    {
+        fvScalarMatrix pEqn
+        (
+            fvm::laplacian(1.0/AUrel, p) == fvc::div(phi)
+        );
+
+        pEqn.setReference(pRefCell, pRefValue);
+        pEqn.solve();
+
+        if (nonOrth == nNonOrthCorr)
+        {
+            phi -= pEqn.flux();
+       }
+    }
+
+#   include "continuityErrs.H"
+
+    // Explicitly relax pressure for momentum corrector
+    p.relax();
+
+    // Momentum corrector
+    Urel -= fvc::grad(p)/AUrel;
+    Urel.correctBoundaryConditions();
+}
diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C
index 9098e63bc59..f0ce70e6935 100644
--- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C
+++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C
@@ -32,8 +32,8 @@ Description
 \*---------------------------------------------------------------------------*/
 
 #include "fvCFD.H"
-#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "singlePhaseTransportModel.H"
+#include "RASModel.H"
 #include "SRFModel.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -42,7 +42,6 @@ int main(int argc, char *argv[])
 {
 
 #   include "setRootCase.H"
-
 #   include "createTime.H"
 #   include "createMesh.H"
 #   include "createFields.H"
@@ -59,55 +58,14 @@ int main(int argc, char *argv[])
         Info<< "Time = " << runTime.timeName() << nl << endl;
 
 #       include "readSIMPLEControls.H"
+#       include "initConvergenceCheck.H"
 
         p.storePrevIter();
 
         // Pressure-velocity SIMPLE corrector
         {
-            // Momentum predictor
-            tmp<fvVectorMatrix> UrelEqn
-            (
-                fvm::div(phi, Urel)
-              + turbulence->divDevReff(Urel)
-              + SRF->Su()
-            );
-
-            UrelEqn().relax();
-
-            solve(UrelEqn() == -fvc::grad(p));
-
-            p.boundaryField().updateCoeffs();
-            volScalarField AUrel = UrelEqn().A();
-            Urel = UrelEqn().H()/AUrel;
-            UrelEqn.clear();
-            phi = fvc::interpolate(Urel) & mesh.Sf();
-            adjustPhi(phi, Urel, p);
-
-            // Non-orthogonal pressure corrector loop
-            for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
-            {
-                fvScalarMatrix pEqn
-                (
-                    fvm::laplacian(1.0/AUrel, p) == fvc::div(phi)
-                );
-
-                pEqn.setReference(pRefCell, pRefValue);
-                pEqn.solve();
-
-                if (nonOrth == nNonOrthCorr)
-                {
-                    phi -= pEqn.flux();
-                }
-            }
-
-#           include "continuityErrs.H"
-
-            // Explicitly relax pressure for momentum corrector
-            p.relax();
-
-            // Momentum corrector
-            Urel -= fvc::grad(p)/AUrel;
-            Urel.correctBoundaryConditions();
+#           include "UEqn.H"
+#           include "pEqn.H"
         }
 
         turbulence->correct();
@@ -134,6 +92,8 @@ int main(int argc, char *argv[])
         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
             << nl << endl;
+
+#       include "convergenceCheck.H"
     }
 
     Info<< "End\n" << endl;
-- 
GitLab