From ee6f15b7a97583329fbb57f013d8a7a3138d87de Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Tue, 4 Dec 2012 15:00:45 +0000
Subject: [PATCH] kOmegaSST: F3 is now optional on a switch "F3", default:
 false

---
 .../compressible/RAS/kOmegaSST/kOmegaSST.C    | 27 +++++++++++++++++--
 .../compressible/RAS/kOmegaSST/kOmegaSST.H    |  6 ++++-
 .../incompressible/RAS/kOmegaSST/kOmegaSST.C  | 27 +++++++++++++++++--
 .../incompressible/RAS/kOmegaSST/kOmegaSST.H  |  7 ++++-
 4 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C
index ddde795545d..321c07443b1 100644
--- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C
+++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C
@@ -97,6 +97,19 @@ tmp<volScalarField> kOmegaSST::F3() const
 }
 
 
+tmp<volScalarField> kOmegaSST::F23() const
+{
+    tmp<volScalarField> f23(F2());
+
+    if (F3_)
+    {
+        f23() *= F3();
+    }
+
+    return f23;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 kOmegaSST::kOmegaSST
@@ -228,6 +241,15 @@ kOmegaSST::kOmegaSST
             10.0
         )
     ),
+    F3_
+    (
+        Switch::lookupOrAddToDict
+        (
+            "F3",
+            coeffDict_,
+            false
+        )
+    ),
 
     y_(mesh_),
 
@@ -289,7 +311,7 @@ kOmegaSST::kOmegaSST
       / max
         (
             a1_*omega_,
-            b1_*F2()*F3()*sqrt(2.0)*mag(symm(fvc::grad(U_)))
+            b1_*F23()*sqrt(2.0)*mag(symm(fvc::grad(U_)))
         )
     );
     mut_.correctBoundaryConditions();
@@ -370,6 +392,7 @@ bool kOmegaSST::read()
         a1_.readIfPresent(coeffDict());
         b1_.readIfPresent(coeffDict());
         c1_.readIfPresent(coeffDict());
+        F3_.readIfPresent("F3", coeffDict());
 
         return true;
     }
@@ -470,7 +493,7 @@ void kOmegaSST::correct()
 
 
     // Re-calculate viscosity
-    mut_ = a1_*rho_*k_/max(a1_*omega_, b1_*F2()*F3()*sqrt(S2));
+    mut_ = a1_*rho_*k_/max(a1_*omega_, b1_*F23()*sqrt(S2));
     mut_.correctBoundaryConditions();
 
     // Re-calculate thermal diffusivity
diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
index 6cc40f6b683..222242a74cb 100644
--- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
+++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
@@ -38,7 +38,7 @@ Description
         Nov. 2001
     \endverbatim
 
-    with the addition of the F3 term for rough walls from
+    with the addition of the optional F3 term for rough walls from
     \verbatim
         Hellsten, A.
         "Some Improvements in Menter’s k-omega-SST turbulence model"
@@ -80,6 +80,7 @@ Description
             a1          0.31;
             b1          1.0;
             c1          10.0;
+            F3          no;
         }
     \endverbatim
 
@@ -138,6 +139,8 @@ protected:
             dimensionedScalar b1_;
             dimensionedScalar c1_;
 
+            Switch F3_;
+
 
         //- Wall distance
         //  Note: different to wall distance in parent RASModel
@@ -156,6 +159,7 @@ protected:
         tmp<volScalarField> F1(const volScalarField& CDkOmega) const;
         tmp<volScalarField> F2() const;
         tmp<volScalarField> F3() const;
+        tmp<volScalarField> F23() const;
 
         tmp<volScalarField> blend
         (
diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
index cff0d481460..290a4c73a86 100644
--- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
+++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
@@ -98,6 +98,19 @@ tmp<volScalarField> kOmegaSST::F3() const
 }
 
 
+tmp<volScalarField> kOmegaSST::F23() const
+{
+    tmp<volScalarField> f23(F2());
+
+    if (F3_)
+    {
+        f23() *= F3();
+    }
+
+    return f23;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 kOmegaSST::kOmegaSST
@@ -219,6 +232,15 @@ kOmegaSST::kOmegaSST
             10.0
         )
     ),
+    F3_
+    (
+        Switch::lookupOrAddToDict
+        (
+            "F3",
+            coeffDict_,
+            false
+        )
+    ),
 
     y_(mesh_),
 
@@ -268,7 +290,7 @@ kOmegaSST::kOmegaSST
       / max
         (
             a1_*omega_,
-            b1_*F2()*F3()*sqrt(2.0)*mag(symm(fvc::grad(U_)))
+            b1_*F23()*sqrt(2.0)*mag(symm(fvc::grad(U_)))
         )
     );
     nut_.correctBoundaryConditions();
@@ -362,6 +384,7 @@ bool kOmegaSST::read()
         a1_.readIfPresent(coeffDict());
         b1_.readIfPresent(coeffDict());
         c1_.readIfPresent(coeffDict());
+        F3_.readIfPresent("F3", coeffDict());
 
         return true;
     }
@@ -439,7 +462,7 @@ void kOmegaSST::correct()
 
 
     // Re-calculate viscosity
-    nut_ = a1_*k_/max(a1_*omega_, b1_*F2()*F3()*sqrt(S2));
+    nut_ = a1_*k_/max(a1_*omega_, b1_*F23()*sqrt(S2));
     nut_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H
index 88feb733bc1..07d16d27321 100644
--- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H
+++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H
@@ -36,7 +36,7 @@ Description
         Nov. 2001.
     \endverbatim
 
-    with the addition of the F3 term for rough walls from
+    with the addition of the optional F3 term for rough walls from
     \verbatim
         Hellsten, A.
         "Some Improvements in Menter’s k-omega-SST turbulence model"
@@ -77,6 +77,7 @@ Description
             a1          0.31;
             b1          1.0;
             c1          10.0;
+            F3          no;
         }
     \endverbatim
 
@@ -132,6 +133,9 @@ protected:
             dimensionedScalar b1_;
             dimensionedScalar c1_;
 
+            Switch F3_;
+
+
         //- Wall distance field
         //  Note: different to wall distance in parent RASModel
         wallDist y_;
@@ -148,6 +152,7 @@ protected:
         tmp<volScalarField> F1(const volScalarField& CDkOmega) const;
         tmp<volScalarField> F2() const;
         tmp<volScalarField> F3() const;
+        tmp<volScalarField> F23() const;
 
         tmp<volScalarField> blend
         (
-- 
GitLab