From 74aec19f79800b49808995406b771316a5157e05 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Tue, 27 Nov 2012 17:11:01 +0000
Subject: [PATCH] ENH: Updated incompressible turbulence models

---
 .../incompressible/LES/LESModel/LESModel.H         |  2 +-
 .../incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C |  2 +-
 src/turbulenceModels/incompressible/RAS/LRR/LRR.C  |  2 +-
 .../RAS/LamBremhorstKE/LamBremhorstKE.C            |  2 +-
 .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C      |  2 +-
 .../RAS/LaunderSharmaKE/LaunderSharmaKE.C          |  2 +-
 .../incompressible/RAS/LienCubicKE/LienCubicKE.C   |  2 +-
 .../RAS/LienCubicKELowRe/LienCubicKELowRe.C        |  2 +-
 .../RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C  |  2 +-
 .../RAS/NonlinearKEShih/NonlinearKEShih.C          |  5 ++---
 .../incompressible/RAS/RASModel/RASModel.H         |  2 +-
 .../incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C   |  2 +-
 .../backwardsCompatibilityWallFunctions.C          | 14 +++++++-------
 .../incompressible/RAS/kEpsilon/kEpsilon.C         |  2 +-
 .../incompressible/RAS/kOmega/kOmega.C             |  2 +-
 .../incompressible/RAS/kOmegaSST/kOmegaSST.C       |  2 +-
 .../incompressible/RAS/qZeta/qZeta.C               |  2 +-
 .../incompressible/RAS/realizableKE/realizableKE.C |  2 +-
 src/turbulenceModels/incompressible/RAS/v2f/v2f.C  |  4 ++--
 .../turbulenceModel/laminar/laminar.C              |  6 ++++++
 .../turbulenceModel/laminar/laminar.H              |  3 +++
 .../turbulenceModel/turbulenceModel.H              |  3 +++
 22 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H
index c790bb58719..d08086234b8 100644
--- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H
+++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H
@@ -166,7 +166,7 @@ public:
             //- Const access to the coefficients dictionary,
             //  which provides info. about choice of models,
             //  and all related data (particularly model coefficients).
-            inline const dictionary& coeffDict() const
+            virtual const dictionary& coeffDict() const
             {
                 return coeffDict_;
             }
diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C
index 2b54d0ef092..acb34537c7f 100644
--- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C
+++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C
@@ -353,7 +353,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
     volScalarField L(sqrt(k_)/(pow025(Cmu_)*omega_));
     volScalarField CDkOmega((2.0*alphaOmega2_)*(gradK & gradOmega)/omega_);
     volScalarField F1(this->F1(CDkOmega));
-    volScalarField G(nuSgs_*S2);
+    volScalarField G(type() + ".G", nuSgs_*S2);
 
     // Turbulent kinetic energy equation
     {
diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C
index 68f0d2b2b09..49b0bd0a17b 100644
--- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C
+++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C
@@ -339,7 +339,7 @@ void LRR::correct()
     }
 
     volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_)));
-    volScalarField G("RASModel.G", 0.5*mag(tr(P)));
+    volScalarField G(type() + ".G", 0.5*mag(tr(P)));
 
     // Update epsilon and G at the wall
     epsilon_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C
index 17d9157c905..576d8304219 100644
--- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C
+++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C
@@ -252,7 +252,7 @@ void LamBremhorstKE::correct()
         y_.correct();
     }
 
-    volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_))));
+    volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_))));
 
 
     // Calculate parameters and coefficients for low-Reynolds number model
diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C
index c6ee7a7d448..2f8ff3b7ea0 100644
--- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C
+++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C
@@ -386,7 +386,7 @@ void LaunderGibsonRSTM::correct()
     }
 
     volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_)));
-    volScalarField G("RASModel.G", 0.5*mag(tr(P)));
+    volScalarField G(type() + ".G", 0.5*mag(tr(P)));
 
     // Update epsilon and G at the wall
     epsilon_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C
index 53cc490f297..c6854e7cba2 100644
--- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C
+++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C
@@ -255,7 +255,7 @@ void LaunderSharmaKE::correct()
 
     tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_)));
 
-    volScalarField G("RASModel.G", nut_*S2);
+    volScalarField G(type() + ".G", nut_*S2);
 
     const volScalarField E(2.0*nu()*nut_*fvc::magSqrGradGrad(U_));
     const volScalarField D(2.0*nu()*magSqr(fvc::grad(sqrt(k_))));
diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C
index 8eb972dcfbd..dbecdb2dc83 100644
--- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C
+++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C
@@ -356,7 +356,7 @@ void LienCubicKE::correct()
 
     volScalarField G
     (
-        "RASModel.G",
+        type() + ".G",
         Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU)
     );
 
diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C
index 5162fa78bda..9c5d561998d 100644
--- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C
+++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C
@@ -446,7 +446,7 @@ void LienCubicKELowRe::correct()
 
     volScalarField G
     (
-        "RASModel.G",
+        type() + ".G",
         Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU)
     );
 
diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C
index 6daecaae6ba..faf5c125e4f 100644
--- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C
+++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C
@@ -319,7 +319,7 @@ void LienLeschzinerLowRe::correct()
 
     const volScalarField f2(scalar(1) - 0.3*exp(-sqr(Rt)));
 
-    volScalarField G("RASModel.G", Cmu_*fMu*sqr(k_)/epsilon_*S2);
+    volScalarField G(type() + ".G", Cmu_*fMu*sqr(k_)/epsilon_*S2);
 
 
     // Dissipation equation
diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C
index 750a4dc15b5..b33c0cd3a86 100644
--- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C
+++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C
@@ -348,9 +348,8 @@ void NonlinearKEShih::correct()
 
     volScalarField G
     (
-        "RASModel.G",
-        Cmu_*sqr(k_)/epsilon_*S2
-      - (nonlinearStress_ && gradU)
+        type() + ".G",
+        Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU)
     );
 
     #include "nonLinearWallFunctionsI.H"
diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H
index b1a97681c28..4e890bb2051 100644
--- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H
+++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H
@@ -208,7 +208,7 @@ public:
             }
 
             //- Const access to the coefficients dictionary
-            const dictionary& coeffDict() const
+            virtual const dictionary& coeffDict() const
             {
                 return coeffDict_;
             }
diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C
index 20ed988ca7e..b82719f2218 100644
--- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C
+++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C
@@ -267,7 +267,7 @@ void RNGkEpsilon::correct()
     }
 
     const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
-    volScalarField G("RASModel.G", nut_*S2);
+    volScalarField G(type() + ".G", nut_*S2);
 
     const volScalarField eta(sqrt(S2)*k_/epsilon_);
     volScalarField R
diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
index 3940b067a45..e76ab693998 100644
--- a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
+++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
@@ -75,7 +75,7 @@ tmp<volScalarField> autoCreateNut
             if (isA<wallFvPatch>(bm[patchI]))
             {
                 nutBoundaryTypes[patchI] =
-                    RASModels::nutkWallFunctionFvPatchScalarField::typeName;
+                    nutkWallFunctionFvPatchScalarField::typeName;
             }
             else
             {
@@ -145,7 +145,7 @@ tmp<volScalarField> autoCreateLowReNut
             if (isA<wallFvPatch>(bm[patchI]))
             {
                 nutBoundaryTypes[patchI] =
-                    RASModels::nutLowReWallFunctionFvPatchScalarField::typeName;
+                    nutLowReWallFunctionFvPatchScalarField::typeName;
             }
             else
             {
@@ -191,7 +191,7 @@ tmp<volScalarField> autoCreateEpsilon
         autoCreateWallFunctionField
         <
             scalar,
-            RASModels::epsilonWallFunctionFvPatchScalarField
+            epsilonWallFunctionFvPatchScalarField
         >
         (
             fieldName,
@@ -210,7 +210,7 @@ tmp<volScalarField> autoCreateOmega
         autoCreateWallFunctionField
         <
             scalar,
-            RASModels::omegaWallFunctionFvPatchScalarField
+            omegaWallFunctionFvPatchScalarField
         >
         (
             fieldName,
@@ -229,7 +229,7 @@ tmp<volScalarField> autoCreateK
         autoCreateWallFunctionField
         <
             scalar,
-            RASModels::kqRWallFunctionFvPatchField<scalar>
+            kqRWallFunctionFvPatchField<scalar>
         >
         (
             fieldName,
@@ -248,7 +248,7 @@ tmp<volScalarField> autoCreateQ
         autoCreateWallFunctionField
         <
             scalar,
-            RASModels::kqRWallFunctionFvPatchField<scalar>
+            kqRWallFunctionFvPatchField<scalar>
         >
         (
             fieldName,
@@ -267,7 +267,7 @@ tmp<volSymmTensorField> autoCreateR
         autoCreateWallFunctionField
         <
             symmTensor,
-            RASModels::kqRWallFunctionFvPatchField<symmTensor>
+            kqRWallFunctionFvPatchField<symmTensor>
         >
         (
             fieldName,
diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C
index c12783bcdbb..48ccd699c74 100644
--- a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C
+++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C
@@ -235,7 +235,7 @@ void kEpsilon::correct()
         return;
     }
 
-    volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_))));
+    volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_))));
 
     // Update epsilon and G at the wall
     epsilon_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C
index f2faf19966b..497fbed7c69 100644
--- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C
+++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C
@@ -244,7 +244,7 @@ void kOmega::correct()
         return;
     }
 
-    volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_))));
+    volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_))));
 
     // Update omega and G at the wall
     omega_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
index 02899ec4c9b..3758a1e9078 100644
--- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
+++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
@@ -364,7 +364,7 @@ void kOmegaSST::correct()
     }
 
     const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
-    volScalarField G("RASModel.G", nut_*S2);
+    volScalarField G(type() + ".G", nut_*S2);
 
     // Update omega and G at the wall
     omega_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C
index 03a3b8a5a6e..8803807bbee 100644
--- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C
+++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C
@@ -311,7 +311,7 @@ void qZeta::correct()
 
     tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_)));
 
-    volScalarField G("RASModel.G", nut_/(2.0*q_)*S2);
+    volScalarField G(type() + ".G", nut_/(2.0*q_)*S2);
     const volScalarField E(nu()*nut_/q_*fvc::magSqrGradGrad(U_));
 
 
diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C
index 3161d16371a..d1061801420 100644
--- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C
+++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C
@@ -297,7 +297,7 @@ void realizableKE::correct()
     const volScalarField eta(magS*k_/epsilon_);
     tmp<volScalarField> C1 = max(eta/(scalar(5) + eta), scalar(0.43));
 
-    volScalarField G("RASModel.G", nut_*S2);
+    volScalarField G(type() + ".G", nut_*S2);
 
     // Update epsilon and G at the wall
     epsilon_.boundaryField().updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/v2f/v2f.C b/src/turbulenceModels/incompressible/RAS/v2f/v2f.C
index d7304617ac2..b8d20d26243 100644
--- a/src/turbulenceModels/incompressible/RAS/v2f/v2f.C
+++ b/src/turbulenceModels/incompressible/RAS/v2f/v2f.C
@@ -364,9 +364,9 @@ void v2f::correct()
     const volTensorField gradU(fvc::grad(U_));
     const volScalarField S2(2*magSqr(dev(symm(gradU))));
 
-    const volScalarField G("RASModel.G", nut_*S2);
+    const volScalarField G(type() + ".G", nut_*S2);
     const volScalarField T(Ts());
-    const volScalarField L2("v2f.L2", sqr(Ls()));
+    const volScalarField L2(type() + ".L2", sqr(Ls()));
     const volScalarField alpha
     (
         "v2f::alpha",
diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C
index a633c7a70e3..65a6e2e6850 100644
--- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C
+++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C
@@ -77,6 +77,12 @@ autoPtr<laminar> laminar::New
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+const dictionary& laminar::coeffDict() const
+{
+    return dictionary::null;
+}
+
+
 tmp<volScalarField> laminar::nut() const
 {
     return tmp<volScalarField>
diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H
index 5b79ecd4853..9c8588015f0 100644
--- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H
+++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H
@@ -89,6 +89,9 @@ public:
 
     // Member Functions
 
+        //- Const access to the coefficients dictionary
+        virtual const dictionary& coeffDict() const;
+
         //- Return the turbulence viscosity, i.e. 0 for laminar flow
         virtual tmp<volScalarField> nut() const;
 
diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H
index c2eacdaf392..91eef14ad78 100644
--- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H
+++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H
@@ -153,6 +153,9 @@ public:
 
     // Member Functions
 
+        //- Const access to the coefficients dictionary
+        virtual const dictionary& coeffDict() const = 0;
+
         //- Access function to velocity field
         inline const volVectorField& U() const
         {
-- 
GitLab