From 189b8a4e84403b2a1c66e13a7b187ea832b6a6ef Mon Sep 17 00:00:00 2001
From: Chris Greenshields <http://cfd.direct>
Date: Mon, 6 Jul 2015 10:23:40 +0100
Subject: [PATCH] Updated template cases for new turbulenceProperties file,
 fvSchemes syntax and MRFProperties.

With contribution from Richard Jones
---
 .../constant/turbulenceProperties             | 34 ++++++++++++++++++-
 .../axisymmetricJet/system/fvSchemes          |  9 +++--
 .../constant/turbulenceProperties             | 34 ++++++++++++++++++-
 etc/templates/closedVolume/system/fvSchemes   |  9 +++--
 etc/templates/closedVolumeRotating/README     |  2 +-
 .../constant/MRFProperties}                   | 13 ++++---
 .../constant/RASProperties                    | 23 -------------
 .../constant/turbulenceProperties             | 34 ++++++++++++++++++-
 .../closedVolumeRotating/system/fvOptions     | 30 ----------------
 .../closedVolumeRotating/system/fvSchemes     |  7 +++-
 .../inflowOutflow/constant/RASProperties      | 23 -------------
 .../constant/turbulenceProperties             | 34 ++++++++++++++++++-
 etc/templates/inflowOutflow/system/fvSchemes  |  7 +++-
 .../constant/MRFProperties}                   | 13 ++++---
 .../constant/RASProperties                    | 23 -------------
 .../constant/turbulenceProperties             | 34 ++++++++++++++++++-
 .../inflowOutflowRotating/system/fvOptions    | 30 ----------------
 .../inflowOutflowRotating/system/fvSchemes    |  7 +++-
 18 files changed, 214 insertions(+), 152 deletions(-)
 rename etc/templates/{axisymmetricJet/constant/RASProperties => closedVolumeRotating/constant/MRFProperties} (83%)
 delete mode 100644 etc/templates/closedVolumeRotating/constant/RASProperties
 delete mode 100644 etc/templates/closedVolumeRotating/system/fvOptions
 delete mode 100644 etc/templates/inflowOutflow/constant/RASProperties
 rename etc/templates/{closedVolume/constant/RASProperties => inflowOutflowRotating/constant/MRFProperties} (83%)
 delete mode 100644 etc/templates/inflowOutflowRotating/constant/RASProperties
 delete mode 100644 etc/templates/inflowOutflowRotating/system/fvOptions

diff --git a/etc/templates/axisymmetricJet/constant/turbulenceProperties b/etc/templates/axisymmetricJet/constant/turbulenceProperties
index dc0e00cc54f..f0add28ce4e 100644
--- a/etc/templates/axisymmetricJet/constant/turbulenceProperties
+++ b/etc/templates/axisymmetricJet/constant/turbulenceProperties
@@ -14,6 +14,38 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-simulationType RASModel;
+simulationType RAS;
+
+RAS
+{
+    RASModel            kOmegaSST;
+
+    turbulence          on;
+    printCoeffs         on;
+}
+
+LES
+{
+    LESModel            SpalartAllmarasDDES;
+    delta               cubeRootVol;
+
+    turbulence          on;
+    printCoeffs         on;
+
+    cubeRootVolCoeffs
+    {
+        deltaCoeff      1;
+    }
+
+    smoothCoeffs
+    {
+        delta           cubeRootVol;
+        cubeRootVolCoeffs
+        {
+            deltaCoeff      1;
+        }
+        maxDeltaRatio   1.1;
+    }
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/axisymmetricJet/system/fvSchemes b/etc/templates/axisymmetricJet/system/fvSchemes
index ddcdf027dc5..81fab71cd52 100644
--- a/etc/templates/axisymmetricJet/system/fvSchemes
+++ b/etc/templates/axisymmetricJet/system/fvSchemes
@@ -39,8 +39,7 @@ divSchemes
     div(phi,k)      $turbulence;
     div(phi,omega)  $turbulence;
     div(phi,epsilon) $turbulence;
-
-    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
 }
 
 laplacianSchemes
@@ -62,6 +61,12 @@ fluxRequired
 {
     default         no;
     p               ;
+    p_rgh           ;
+}
+
+wallDist
+{
+    method meshWave;
 }
 
 // ************************************************************************* //
diff --git a/etc/templates/closedVolume/constant/turbulenceProperties b/etc/templates/closedVolume/constant/turbulenceProperties
index dc0e00cc54f..dbb800fa40a 100644
--- a/etc/templates/closedVolume/constant/turbulenceProperties
+++ b/etc/templates/closedVolume/constant/turbulenceProperties
@@ -14,6 +14,38 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-simulationType RASModel;
+simulationType RAS;
+
+RAS
+{
+    RASModel            kEpsilon;
+
+    turbulence          on;
+    printCoeffs         on;
+}
+
+LES
+{
+    LESModel            SpalartAllmarasDDES;
+    delta               cubeRootVol;
+
+    turbulence          on;
+    printCoeffs         on;
+
+    cubeRootVolCoeffs
+    {
+        deltaCoeff      1;
+    }
+
+    smoothCoeffs
+    {
+        delta           cubeRootVol;
+        cubeRootVolCoeffs
+        {
+            deltaCoeff      1;
+        }
+        maxDeltaRatio   1.1;
+    }
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/closedVolume/system/fvSchemes b/etc/templates/closedVolume/system/fvSchemes
index bd2779fb8ba..99b68a83fe7 100644
--- a/etc/templates/closedVolume/system/fvSchemes
+++ b/etc/templates/closedVolume/system/fvSchemes
@@ -42,7 +42,7 @@ divSchemes
 
     div(phi,T)      $turbulence;
 
-    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
 }
 
 laplacianSchemes
@@ -63,7 +63,12 @@ snGradSchemes
 fluxRequired
 {
     default         no;
-    p_rgh             ;
+    p_rgh           ;
+}
+
+wallDist
+{
+    method meshWave;
 }
 
 // ************************************************************************* //
diff --git a/etc/templates/closedVolumeRotating/README b/etc/templates/closedVolumeRotating/README
index d238875658b..693cee7bd9d 100644
--- a/etc/templates/closedVolumeRotating/README
+++ b/etc/templates/closedVolumeRotating/README
@@ -4,4 +4,4 @@ Overview
 + Can be used for MRF or AMI simulations
 + Setup to run the simpleFoam solver
 + Set up is like inflowOutflowRotating but without inlet and outlet
-+ See $FOAM_ETC/templates/closedVolumeRotating/README for details of use
++ See $FOAM_ETC/templates/closedVolume/README for details of use
\ No newline at end of file
diff --git a/etc/templates/axisymmetricJet/constant/RASProperties b/etc/templates/closedVolumeRotating/constant/MRFProperties
similarity index 83%
rename from etc/templates/axisymmetricJet/constant/RASProperties
rename to etc/templates/closedVolumeRotating/constant/MRFProperties
index fefd567bebe..34fef0cc717 100644
--- a/etc/templates/axisymmetricJet/constant/RASProperties
+++ b/etc/templates/closedVolumeRotating/constant/MRFProperties
@@ -10,14 +10,17 @@ FoamFile
     version     2.0;
     format      ascii;
     class       dictionary;
-    object      RASProperties;
+    location    "constant";
+    object      MRFProperties;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-RASModel        kOmegaSST;
-
-turbulence      on;
+MRF1
+{
+    cellZone    rotatingZone;
+    active      yes;
 
-printCoeffs     on;
+    #include "rotatingZoneProperties"
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/closedVolumeRotating/constant/RASProperties b/etc/templates/closedVolumeRotating/constant/RASProperties
deleted file mode 100644
index fefd567bebe..00000000000
--- a/etc/templates/closedVolumeRotating/constant/RASProperties
+++ /dev/null
@@ -1,23 +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      RASProperties;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-RASModel        kOmegaSST;
-
-turbulence      on;
-
-printCoeffs     on;
-
-// ************************************************************************* //
diff --git a/etc/templates/closedVolumeRotating/constant/turbulenceProperties b/etc/templates/closedVolumeRotating/constant/turbulenceProperties
index dc0e00cc54f..f0add28ce4e 100644
--- a/etc/templates/closedVolumeRotating/constant/turbulenceProperties
+++ b/etc/templates/closedVolumeRotating/constant/turbulenceProperties
@@ -14,6 +14,38 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-simulationType RASModel;
+simulationType RAS;
+
+RAS
+{
+    RASModel            kOmegaSST;
+
+    turbulence          on;
+    printCoeffs         on;
+}
+
+LES
+{
+    LESModel            SpalartAllmarasDDES;
+    delta               cubeRootVol;
+
+    turbulence          on;
+    printCoeffs         on;
+
+    cubeRootVolCoeffs
+    {
+        deltaCoeff      1;
+    }
+
+    smoothCoeffs
+    {
+        delta           cubeRootVol;
+        cubeRootVolCoeffs
+        {
+            deltaCoeff      1;
+        }
+        maxDeltaRatio   1.1;
+    }
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/closedVolumeRotating/system/fvOptions b/etc/templates/closedVolumeRotating/system/fvOptions
deleted file mode 100644
index 2d6dfa8e564..00000000000
--- a/etc/templates/closedVolumeRotating/system/fvOptions
+++ /dev/null
@@ -1,30 +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      fvOptions;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-MRF1
-{
-    type            MRFSource;
-    selectionMode   cellZone;
-    cellZone        rotatingZone;
-    active          yes;
-
-    MRFSourceCoeffs
-    {
-        #include "${FOAM_CASE}/constant/rotatingZoneProperties"
-    }
-}
-
-// ************************************************************************* //
diff --git a/etc/templates/closedVolumeRotating/system/fvSchemes b/etc/templates/closedVolumeRotating/system/fvSchemes
index ddcdf027dc5..89a953f42fb 100644
--- a/etc/templates/closedVolumeRotating/system/fvSchemes
+++ b/etc/templates/closedVolumeRotating/system/fvSchemes
@@ -40,7 +40,7 @@ divSchemes
     div(phi,omega)  $turbulence;
     div(phi,epsilon) $turbulence;
 
-    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
 }
 
 laplacianSchemes
@@ -64,4 +64,9 @@ fluxRequired
     p               ;
 }
 
+wallDist
+{
+    method meshWave;
+}
+
 // ************************************************************************* //
diff --git a/etc/templates/inflowOutflow/constant/RASProperties b/etc/templates/inflowOutflow/constant/RASProperties
deleted file mode 100644
index fefd567bebe..00000000000
--- a/etc/templates/inflowOutflow/constant/RASProperties
+++ /dev/null
@@ -1,23 +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      RASProperties;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-RASModel        kOmegaSST;
-
-turbulence      on;
-
-printCoeffs     on;
-
-// ************************************************************************* //
diff --git a/etc/templates/inflowOutflow/constant/turbulenceProperties b/etc/templates/inflowOutflow/constant/turbulenceProperties
index dc0e00cc54f..f0add28ce4e 100644
--- a/etc/templates/inflowOutflow/constant/turbulenceProperties
+++ b/etc/templates/inflowOutflow/constant/turbulenceProperties
@@ -14,6 +14,38 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-simulationType RASModel;
+simulationType RAS;
+
+RAS
+{
+    RASModel            kOmegaSST;
+
+    turbulence          on;
+    printCoeffs         on;
+}
+
+LES
+{
+    LESModel            SpalartAllmarasDDES;
+    delta               cubeRootVol;
+
+    turbulence          on;
+    printCoeffs         on;
+
+    cubeRootVolCoeffs
+    {
+        deltaCoeff      1;
+    }
+
+    smoothCoeffs
+    {
+        delta           cubeRootVol;
+        cubeRootVolCoeffs
+        {
+            deltaCoeff      1;
+        }
+        maxDeltaRatio   1.1;
+    }
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/inflowOutflow/system/fvSchemes b/etc/templates/inflowOutflow/system/fvSchemes
index ddcdf027dc5..89a953f42fb 100644
--- a/etc/templates/inflowOutflow/system/fvSchemes
+++ b/etc/templates/inflowOutflow/system/fvSchemes
@@ -40,7 +40,7 @@ divSchemes
     div(phi,omega)  $turbulence;
     div(phi,epsilon) $turbulence;
 
-    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
 }
 
 laplacianSchemes
@@ -64,4 +64,9 @@ fluxRequired
     p               ;
 }
 
+wallDist
+{
+    method meshWave;
+}
+
 // ************************************************************************* //
diff --git a/etc/templates/closedVolume/constant/RASProperties b/etc/templates/inflowOutflowRotating/constant/MRFProperties
similarity index 83%
rename from etc/templates/closedVolume/constant/RASProperties
rename to etc/templates/inflowOutflowRotating/constant/MRFProperties
index 496ee3b41cc..34fef0cc717 100644
--- a/etc/templates/closedVolume/constant/RASProperties
+++ b/etc/templates/inflowOutflowRotating/constant/MRFProperties
@@ -10,14 +10,17 @@ FoamFile
     version     2.0;
     format      ascii;
     class       dictionary;
-    object      RASProperties;
+    location    "constant";
+    object      MRFProperties;
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-RASModel        kEpsilon;
-
-turbulence      on;
+MRF1
+{
+    cellZone    rotatingZone;
+    active      yes;
 
-printCoeffs     on;
+    #include "rotatingZoneProperties"
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/inflowOutflowRotating/constant/RASProperties b/etc/templates/inflowOutflowRotating/constant/RASProperties
deleted file mode 100644
index fefd567bebe..00000000000
--- a/etc/templates/inflowOutflowRotating/constant/RASProperties
+++ /dev/null
@@ -1,23 +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      RASProperties;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-RASModel        kOmegaSST;
-
-turbulence      on;
-
-printCoeffs     on;
-
-// ************************************************************************* //
diff --git a/etc/templates/inflowOutflowRotating/constant/turbulenceProperties b/etc/templates/inflowOutflowRotating/constant/turbulenceProperties
index dc0e00cc54f..f0add28ce4e 100644
--- a/etc/templates/inflowOutflowRotating/constant/turbulenceProperties
+++ b/etc/templates/inflowOutflowRotating/constant/turbulenceProperties
@@ -14,6 +14,38 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-simulationType RASModel;
+simulationType RAS;
+
+RAS
+{
+    RASModel            kOmegaSST;
+
+    turbulence          on;
+    printCoeffs         on;
+}
+
+LES
+{
+    LESModel            SpalartAllmarasDDES;
+    delta               cubeRootVol;
+
+    turbulence          on;
+    printCoeffs         on;
+
+    cubeRootVolCoeffs
+    {
+        deltaCoeff      1;
+    }
+
+    smoothCoeffs
+    {
+        delta           cubeRootVol;
+        cubeRootVolCoeffs
+        {
+            deltaCoeff      1;
+        }
+        maxDeltaRatio   1.1;
+    }
+}
 
 // ************************************************************************* //
diff --git a/etc/templates/inflowOutflowRotating/system/fvOptions b/etc/templates/inflowOutflowRotating/system/fvOptions
deleted file mode 100644
index 2d6dfa8e564..00000000000
--- a/etc/templates/inflowOutflowRotating/system/fvOptions
+++ /dev/null
@@ -1,30 +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      fvOptions;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-MRF1
-{
-    type            MRFSource;
-    selectionMode   cellZone;
-    cellZone        rotatingZone;
-    active          yes;
-
-    MRFSourceCoeffs
-    {
-        #include "${FOAM_CASE}/constant/rotatingZoneProperties"
-    }
-}
-
-// ************************************************************************* //
diff --git a/etc/templates/inflowOutflowRotating/system/fvSchemes b/etc/templates/inflowOutflowRotating/system/fvSchemes
index ddcdf027dc5..89a953f42fb 100644
--- a/etc/templates/inflowOutflowRotating/system/fvSchemes
+++ b/etc/templates/inflowOutflowRotating/system/fvSchemes
@@ -40,7 +40,7 @@ divSchemes
     div(phi,omega)  $turbulence;
     div(phi,epsilon) $turbulence;
 
-    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div((nuEff*dev2(T(grad(U))))) Gauss linear;
 }
 
 laplacianSchemes
@@ -64,4 +64,9 @@ fluxRequired
     p               ;
 }
 
+wallDist
+{
+    method meshWave;
+}
+
 // ************************************************************************* //
-- 
GitLab