From 6f28a1199f654897cbe7e62d4f838fe36b99c66a Mon Sep 17 00:00:00 2001
From: andy <a.heather@opencfd.co.uk>
Date: Tue, 21 Jul 2009 19:10:19 +0100
Subject: [PATCH] further updates to turbulence models

---
 .../DeardorffDiffStress/DeardorffDiffStress.C |  2 +-
 .../LES/GenEddyVisc/GenEddyVisc.C             | 11 +++
 .../LES/GenEddyVisc/GenEddyVisc.H             |  6 ++
 .../LES/GenSGSStress/GenSGSStress.C           | 10 +++
 .../LES/GenSGSStress/GenSGSStress.H           |  5 ++
 .../compressible/LES/LESModel/LESModel.C      | 50 +-----------
 .../compressible/LES/LESModel/LESModel.H      | 80 ++++++-------------
 .../LES/Smagorinsky/Smagorinsky.C             |  2 +-
 .../LES/SpalartAllmaras/SpalartAllmaras.C     | 28 ++++---
 .../LES/SpalartAllmaras/SpalartAllmaras.H     | 38 +++++----
 ...ayatillekeWallFunctionFvPatchScalarField.C | 72 ++++++++++-------
 ...ayatillekeWallFunctionFvPatchScalarField.H | 30 +++++--
 .../alphaSgsWallFunctionFvPatchScalarField.C  | 26 +++---
 .../alphaSgsWallFunctionFvPatchScalarField.H  |  6 ++
 .../muSgsWallFunctionFvPatchScalarField.C     | 33 +++++---
 .../muSgsWallFunctionFvPatchScalarField.H     |  6 ++
 .../LES/dynOneEqEddy/dynOneEqEddy.C           |  2 +-
 .../LES/lowReOneEqEddy/lowReOneEqEddy.C       |  2 +-
 .../compressible/LES/oneEqEddy/oneEqEddy.C    |  2 +-
 .../compressible/RAS/LRR/LRR.H                |  2 +-
 .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H |  2 +-
 .../RAS/LaunderSharmaKE/LaunderSharmaKE.H     |  2 +-
 .../RAS/RNGkEpsilon/RNGkEpsilon.H             |  2 +-
 .../RAS/SpalartAllmaras/SpalartAllmaras.H     |  2 +-
 .../compressible/RAS/kEpsilon/kEpsilon.H      |  2 +-
 .../compressible/RAS/kOmegaSST/kOmegaSST.H    |  2 +-
 .../RAS/realizableKE/realizableKE.H           |  2 +-
 .../nuSgsWallFunctionFvPatchScalarField.C     | 38 ++++-----
 .../nuSgsWallFunctionFvPatchScalarField.H     |  6 ++
 29 files changed, 250 insertions(+), 221 deletions(-)

diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C
index 73c0d2397a3..41063cd2cd9 100644
--- a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C
+++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C
@@ -49,7 +49,7 @@ void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
     muSgs_ = ck_*rho()*sqrt(K)*delta();
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C
index 150e7f10cf9..055c76214e8 100644
--- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C
+++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C
@@ -60,6 +60,16 @@ GenEddyVisc::GenEddyVisc
         )
     ),
 
+    Prt_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "Prt",
+            coeffDict_,
+            1.0
+        )
+    ),
+
     k_
     (
         IOobject
@@ -135,6 +145,7 @@ bool GenEddyVisc::read()
     if (LESModel::read())
     {
         ce_.readIfPresent(coeffDict());
+        Prt_.readIfPresent(coeffDict());
 
         return true;
     }
diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H
index 41fd37066cd..440ec71c5c9 100644
--- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H
+++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H
@@ -68,7 +68,13 @@ class GenEddyVisc
 
 protected:
 
+    // Model coefficients
+
         dimensionedScalar ce_;
+        dimensionedScalar Prt_;
+
+
+    // Fields
 
         volScalarField k_;
         volScalarField muSgs_;
diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C
index 8c6ea7afea6..1f4e5755273 100644
--- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C
+++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C
@@ -64,6 +64,16 @@ GenSGSStress::GenSGSStress
         )
     ),
 
+    Prt_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "Prt",
+            coeffDict_,
+            1.0
+        )
+    ),
+
     B_
     (
         IOobject
diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H
index 07ca666a2f2..ff71c80b798 100644
--- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H
+++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H
@@ -69,7 +69,12 @@ class GenSGSStress
 
 protected:
 
+    // Model coefficients
+
         dimensionedScalar ce_;
+        dimensionedScalar Prt_;
+
+    // Fields
 
         volSymmTensorField B_;
         volScalarField muSgs_;
diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
index 7301318b160..5602e44d7f8 100644
--- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
+++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
@@ -81,45 +81,7 @@ LESModel::LESModel
 
     k0_("k0", dimVelocity*dimVelocity, SMALL),
 
-    delta_(LESdelta::New("delta", U.mesh(), *this)),
-
-    wallFunctionDict_(subDictPtr("wallFunctionCoeffs")),
-    kappa_
-    (
-        dimensioned<scalar>::lookupOrAddToDict
-        (
-            "kappa",
-            wallFunctionDict_,
-            0.4187
-        )
-    ),
-    E_
-    (
-        dimensioned<scalar>::lookupOrAddToDict
-        (
-            "E",
-            wallFunctionDict_,
-            9.0
-        )
-    ),
-    Cmu_
-    (
-        dimensioned<scalar>::lookupOrAddToDict
-        (
-            "Cmu",
-            wallFunctionDict_,
-            0.07
-        )
-    ),
-    Prt_
-    (
-        dimensioned<scalar>::lookupOrAddToDict
-        (
-            "Prt",
-            wallFunctionDict_,
-            0.85
-        )
-    )
+    delta_(LESdelta::New("delta", U.mesh(), *this))
 {
     readIfPresent("k0", k0_);
 }
@@ -201,20 +163,10 @@ bool LESModel::read()
             coeffDict_ <<= *dictPtr;
         }
 
-        if (const dictionary* dictPtr = subDictPtr("wallFunctionCoeffs"))
-        {
-            wallFunctionDict_ <<= *dictPtr;
-        }
-
         readIfPresent("k0", k0_);
 
         delta_().read(*this);
 
-        kappa_.readIfPresent(wallFunctionDict_);
-        E_.readIfPresent(wallFunctionDict_);
-        Cmu_.readIfPresent(wallFunctionDict_);
-        Prt_.readIfPresent(wallFunctionDict_);
-
         return true;
     }
     else
diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H
index 3012b4124ac..cf019ea9a8a 100644
--- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H
+++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H
@@ -87,19 +87,6 @@ protected:
 
         autoPtr<LESdelta> delta_;
 
-        // Wall function properties
-
-            //- Wall function dictionary
-            dictionary wallFunctionDict_;
-
-            dimensionedScalar kappa_;
-
-            dimensionedScalar E_;
-
-            dimensionedScalar Cmu_;
-
-            dimensionedScalar Prt_;
-
 
     // Protected Member Functions
 
@@ -173,55 +160,34 @@ public:
 
     // Member Functions
 
-        //- 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
-        {
-            return coeffDict_;
-        }
-
-        //- Return the value of k0 which k is not allowed to be less than
-        const dimensionedScalar& k0() const
-        {
-            return k0_;
-        }
-
-        //- Allow k0 to be changed
-        dimensionedScalar& k0()
-        {
-            return k0_;
-        }
+        // Access
 
-        //- Access function to filter width
-        inline const volScalarField& delta() const
-        {
-            return delta_();
-        }
+            //- 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
+            {
+                return coeffDict_;
+            }
 
-        //- Return kappa for use in wall-functions
-        dimensionedScalar kappa() const
-        {
-            return kappa_;
-        }
+            //- Return the value of k0 which k is not allowed to be less than
+            const dimensionedScalar& k0() const
+            {
+                return k0_;
+            }
 
-        //- Return E for use in wall-functions
-        dimensionedScalar E() const
-        {
-            return E_;
-        }
+            //- Allow k0 to be changed
+            dimensionedScalar& k0()
+            {
+                return k0_;
+            }
 
-        //- Return Cmu for use in wall-functions
-        dimensionedScalar Cmu() const
-        {
-            return Cmu_;
-        }
+            //- Access function to filter width
+            inline const volScalarField& delta() const
+            {
+                return delta_();
+            }
 
-        //- Return turbulent Prandtl number for use in wall-functions
-        dimensionedScalar Prt() const
-        {
-            return Prt_;
-        }
 
         //- Return the SGS turbulent kinetic energy.
         virtual tmp<volScalarField> k() const = 0;
diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C
index e5787ab8163..514ad301fff 100644
--- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C
+++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C
@@ -57,7 +57,7 @@ void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU)
     muSgs_ = ck_*rho()*delta()*sqrt(k_);
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C
index a3b75dc5290..bb74a41f8cf 100644
--- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C
+++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C
@@ -50,7 +50,7 @@ void SpalartAllmaras::updateSubGridScaleFields()
     muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField();
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
@@ -112,13 +112,22 @@ SpalartAllmaras::SpalartAllmaras
 :
     LESModel(typeName, rho, U, phi, thermoPhysicalModel),
 
-    alphaNut_
+    sigmaNut_
     (
         dimensioned<scalar>::lookupOrAddToDict
         (
-            "alphaNut",
+            "sigmaNut",
             coeffDict_,
-            1.5
+            0.66666
+        )
+    ),
+    Prt_
+    (
+        dimensioned<scalar>::lookupOrAddToDict
+        (
+            "Prt",
+            coeffDict_,
+            1.0
         )
     ),
 
@@ -185,7 +194,7 @@ SpalartAllmaras::SpalartAllmaras
             0.4187
         )
     ),
-    Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)),
+    Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_),
     Cw2_
     (
         dimensioned<scalar>::lookupOrAddToDict
@@ -299,11 +308,11 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU)
       + fvm::div(phi(), nuTilda_)
       - fvm::laplacian
         (
-            alphaNut_*(nuTilda_*rho() + mu()),
+            (nuTilda_*rho() + mu())/sigmaNut_,
             nuTilda_,
             "laplacian(DnuTildaEff,nuTilda)"
         )
-      - alphaNut_*rho()*Cb2_*magSqr(fvc::grad(nuTilda_))
+      - rho()*Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_))
      ==
         rho()*Cb1_*Stilda*nuTilda_
       - fvm::Sp(rho()*Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_)
@@ -320,10 +329,11 @@ bool SpalartAllmaras::read()
 {
     if (LESModel::read())
     {
-        alphaNut_.readIfPresent(coeffDict());
+        sigmaNut_.readIfPresent(coeffDict());
+        Prt_.readIfPresent(coeffDict());
         Cb1_.readIfPresent(coeffDict());
         Cb2_.readIfPresent(coeffDict());
-        Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_);
+        Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_;
         Cw2_.readIfPresent(coeffDict());
         Cw3_.readIfPresent(coeffDict());
         Cv1_.readIfPresent(coeffDict());
diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H
index 9d5fa78d642..e6239ec91bc 100644
--- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H
+++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H
@@ -58,18 +58,29 @@ class SpalartAllmaras
 {
     // Private data
 
-        dimensionedScalar alphaNut_;
+        // Model coefficients
 
-        dimensionedScalar Cb1_;
-        dimensionedScalar Cb2_;
-        dimensionedScalar Cv1_;
-        dimensionedScalar Cv2_;
-        dimensionedScalar CDES_;
-        dimensionedScalar ck_;
-        dimensionedScalar kappa_;
-        dimensionedScalar Cw1_;
-        dimensionedScalar Cw2_;
-        dimensionedScalar Cw3_;
+            dimensionedScalar sigmaNut_;
+            dimensionedScalar Prt_;
+
+            dimensionedScalar Cb1_;
+            dimensionedScalar Cb2_;
+            dimensionedScalar Cv1_;
+            dimensionedScalar Cv2_;
+            dimensionedScalar CDES_;
+            dimensionedScalar ck_;
+            dimensionedScalar kappa_;
+            dimensionedScalar Cw1_;
+            dimensionedScalar Cw2_;
+            dimensionedScalar Cw3_;
+
+
+    // Fields
+
+        volScalarField nuTilda_;
+        volScalarField dTilda_;
+        volScalarField muSgs_;
+        volScalarField alphaSgs_;
 
 
     // Private member functions
@@ -86,11 +97,6 @@ class SpalartAllmaras
         SpalartAllmaras(const SpalartAllmaras&);
         SpalartAllmaras& operator=(const SpalartAllmaras&);
 
-        volScalarField nuTilda_;
-        volScalarField dTilda_;
-        volScalarField muSgs_;
-        volScalarField alphaSgs_;
-
 
 public:
 
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
index b868d8baa50..61a1f642883 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -75,17 +75,15 @@ scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::Psmooth
 scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
 (
     const scalar P,
-    const scalar Prat,
-    const scalar E,
-    const scalar kappa
+    const scalar Prat
 ) const
 {
     scalar ypt = 11.0;
 
     for (int i=0; i<maxIters_; i++)
     {
-        scalar f = ypt - (log(E*ypt)/kappa + P)/Prat;
-        scalar df = 1.0 - 1.0/(ypt*kappa*Prat);
+        scalar f = ypt - (log(E_*ypt)/kappa_ + P)/Prat;
+        scalar df = 1.0 - 1.0/(ypt*kappa_*Prat);
         scalar yptNew = ypt - f/df;
 
         if (yptNew < VSMALL)
@@ -115,7 +113,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(p, iF)
+    fixedValueFvPatchScalarField(p, iF),
+    Prt_(0.85),
+    kappa_(0.41),
+    E_(9.0)
 {
     checkType();
 }
@@ -130,7 +131,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper)
+    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
+    Prt_(ptf.Prt_),
+    kappa_(ptf.kappa_),
+    E_(ptf.E_)
 {}
 
 
@@ -142,7 +146,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    fixedValueFvPatchScalarField(p, iF, dict)
+    fixedValueFvPatchScalarField(p, iF, dict),
+    Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)),
+    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
+    E_(dict.lookupOrDefault<scalar>("E", 9.0))
 {
     checkType();
 }
@@ -151,10 +158,13 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField
 alphaSgsJayatillekeWallFunctionFvPatchScalarField::
 alphaSgsJayatillekeWallFunctionFvPatchScalarField
 (
-    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& tppsf
+    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf
 )
 :
-    fixedValueFvPatchScalarField(tppsf)
+    fixedValueFvPatchScalarField(awfpsf),
+    Prt_(awfpsf.Prt_),
+    kappa_(awfpsf.kappa_),
+    E_(awfpsf.E_)
 {
     checkType();
 }
@@ -163,11 +173,14 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField
 alphaSgsJayatillekeWallFunctionFvPatchScalarField::
 alphaSgsJayatillekeWallFunctionFvPatchScalarField
 (
-    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& tppsf,
+    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf,
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(tppsf, iF)
+    fixedValueFvPatchScalarField(awfpsf, iF),
+    Prt_(awfpsf.Prt_),
+    kappa_(awfpsf.kappa_),
+    E_(awfpsf.E_)
 {
     checkType();
 }
@@ -182,11 +195,6 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
 {
     const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
 
-    // Wall function constants
-    const scalar E = lesModel.E().value();
-    const scalar kappa = lesModel.kappa().value();
-    const scalar Prt = lesModel.Prt().value();
-
     // Field data
     const label patchI = patch().index();
 
@@ -223,18 +231,18 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
 
             do
             {
-                scalar kUu = min(kappa*magUp[faceI]/uTau, maxExp_);
+                scalar kUu = min(kappa_*magUp[faceI]/uTau, maxExp_);
                 scalar fkUu = exp(kUu) - 1.0 - kUu*(1.0 + 0.5*kUu);
 
                 scalar f =
                     - uTau/(ry[faceI]*muw[faceI]/rhow[faceI])
                     + magUp[faceI]/uTau
-                    + 1.0/E*(fkUu - 1.0/6.0*kUu*sqr(kUu));
+                    + 1.0/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
 
                 scalar df =
                     - 1.0/(ry[faceI]*muw[faceI]/rhow[faceI])
                     - magUp[faceI]/sqr(uTau)
-                    - 1.0/E*kUu*fkUu/uTau;
+                    - 1.0/E_*kUu*fkUu/uTau;
 
                 scalar uTauNew = uTau - f/df;
                 err = mag((uTau - uTauNew)/uTau);
@@ -248,11 +256,11 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
             scalar Pr = muw[faceI]/alphaw[faceI];
 
             // Molecular-to-turbulenbt Prandtl number ratio
-            scalar Prat = Pr/Prt;
+            scalar Prat = Pr/Prt_;
 
             // Thermal sublayer thickness
             scalar P = Psmooth(Prat);
-            scalar yPlusTherm = this->yPlusTherm(P, Prat, E, kappa);
+            scalar yPlusTherm = this->yPlusTherm(P, Prat);
 
             // Evaluate new effective thermal diffusivity
             scalar alphaEff = 0.0;
@@ -266,11 +274,11 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
             else
             {
                 scalar A = qDot[faceI]*rhow[faceI]*uTau/ry[faceI];
-                scalar B = qDot[faceI]*Prt*(1.0/kappa*log(E*yPlus) + P);
-                scalar magUc = uTau/kappa*log(E*yPlusTherm) - mag(Uw[faceI]);
+                scalar B = qDot[faceI]*Prt_*(1.0/kappa_*log(E_*yPlus) + P);
+                scalar magUc = uTau/kappa_*log(E_*yPlusTherm) - mag(Uw[faceI]);
                 scalar C =
                     0.5*rhow[faceI]*uTau
-                   *(Prt*sqr(magUp[faceI]) + (Pr - Prt)*sqr(magUc));
+                   *(Prt_*sqr(magUp[faceI]) + (Pr - Prt_)*sqr(magUc));
                 alphaEff = A/(B + C + VSMALL);
             }
 
@@ -281,7 +289,7 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
             {
                 Info<< "    uTau           = " << uTau << nl
                     << "    Pr             = " << Pr << nl
-                    << "    Prt            = " << Prt << nl
+                    << "    Prt            = " << Prt_ << nl
                     << "    qDot           = " << qDot[faceI] << nl
                     << "    yPlus          = " << yPlus << nl
                     << "    yPlusTherm     = " << yPlusTherm << nl
@@ -299,6 +307,16 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
 }
 
 
+void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+    fvPatchField<scalar>::write(os);
+    os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
+    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+    writeEntry("value", os);
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 makePatchTypeField
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H
index 09bb27059e1..e7f6184d814 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -58,9 +58,21 @@ class alphaSgsJayatillekeWallFunctionFvPatchScalarField
 {
     // Private data
 
-        static scalar maxExp_;
-        static scalar tolerance_;
-        static label maxIters_;
+        //- Turbulent Prandtl number
+        scalar Prt_;
+
+        //- Von Karman constant
+        scalar kappa_;
+
+        //- E coefficient
+        scalar E_;
+
+
+        // Solution parameters
+
+            static scalar maxExp_;
+            static scalar tolerance_;
+            static label maxIters_;
 
 
     // Private member functions
@@ -75,9 +87,7 @@ class alphaSgsJayatillekeWallFunctionFvPatchScalarField
         scalar yPlusTherm
         (
             const scalar P,
-            const scalar Prat,
-            const scalar E,
-            const scalar kappa
+            const scalar Prat
         ) const;
 
 
@@ -163,6 +173,12 @@ public:
             (
                 const Pstream::commsTypes commsType=Pstream::Pstream::blocking
             );
+
+
+        // I-O
+
+            //- Write
+            void write(Ostream&) const;
 };
 
 
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
index 5d59e7f6d77..f2c944220a2 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
@@ -66,7 +66,8 @@ alphaSgsWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(p, iF)
+    fixedValueFvPatchScalarField(p, iF),
+    Prt_(0.85)
 {
     checkType();
 }
@@ -81,7 +82,8 @@ alphaSgsWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper)
+    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
+    Prt_(ptf.Prt_)
 {}
 
 
@@ -93,7 +95,8 @@ alphaSgsWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    fixedValueFvPatchScalarField(p, iF, dict)
+    fixedValueFvPatchScalarField(p, iF, dict),
+    Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
 {
     checkType();
 }
@@ -102,10 +105,11 @@ alphaSgsWallFunctionFvPatchScalarField
 alphaSgsWallFunctionFvPatchScalarField::
 alphaSgsWallFunctionFvPatchScalarField
 (
-    const alphaSgsWallFunctionFvPatchScalarField& tppsf
+    const alphaSgsWallFunctionFvPatchScalarField& awfpsf
 )
 :
-    fixedValueFvPatchScalarField(tppsf)
+    fixedValueFvPatchScalarField(awfpsf),
+    Prt_(awfpsf.Prt_)
 {
     checkType();
 }
@@ -114,11 +118,13 @@ alphaSgsWallFunctionFvPatchScalarField
 alphaSgsWallFunctionFvPatchScalarField::
 alphaSgsWallFunctionFvPatchScalarField
 (
-    const alphaSgsWallFunctionFvPatchScalarField& tppsf,
+    const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(tppsf, iF)
+    fixedValueFvPatchScalarField(awfpsf, iF),
+    Prt_(awfpsf.Prt_)
+
 {
     checkType();
 }
@@ -133,14 +139,10 @@ void alphaSgsWallFunctionFvPatchScalarField::evaluate
 {
     const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
 
-    // Turbulent Prandtl number
-    const scalar Prt = lesModel.Prt().value();
-
-    // Get the turbulent viscosity at the wall
     const scalarField muSgsw =
         lesModel.muSgs()().boundaryField()[patch().index()];
 
-    operator==(muSgsw/Prt);
+    operator==(muSgsw/Prt_);
 }
 
 
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H
index e5e200d2b51..fb738498e75 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H
@@ -56,6 +56,12 @@ class alphaSgsWallFunctionFvPatchScalarField
 :
     public fixedValueFvPatchScalarField
 {
+    // Private data
+
+        //- Turbulent Prandtl number
+        scalar Prt_;
+
+
     // Private member functions
 
         //- Check the type of the patch
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C
index a0268ea59f8..143b989ede2 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C
@@ -50,7 +50,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF),
     UName_("U"),
     rhoName_("rho"),
-    muName_("mu")
+    muName_("mu"),
+    kappa_(0.41),
+    E_(9.0)
 {}
 
 
@@ -65,7 +67,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
     UName_(ptf.UName_),
     rhoName_(ptf.rhoName_),
-    muName_(ptf.muName_)
+    muName_(ptf.muName_),
+    kappa_(ptf.kappa_),
+    E_(ptf.E_)
 {}
 
 
@@ -79,7 +83,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF, dict),
     UName_(dict.lookupOrDefault<word>("U", "U")),
     rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
-    muName_(dict.lookupOrDefault<word>("mu", "mu"))
+    muName_(dict.lookupOrDefault<word>("mu", "mu")),
+    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
+    E_(dict.lookupOrDefault<scalar>("E", 9.0))
 {}
 
 
@@ -91,7 +97,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
     fixedValueFvPatchScalarField(mwfpsf),
     UName_(mwfpsf.UName_),
     rhoName_(mwfpsf.rhoName_),
-    muName_(mwfpsf.muName_)
+    muName_(mwfpsf.muName_),
+    kappa_(mwfpsf.kappa_),
+    E_(mwfpsf.E_)
 {}
 
 
@@ -104,7 +112,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
     fixedValueFvPatchScalarField(mwfpsf, iF),
     UName_(mwfpsf.UName_),
     rhoName_(mwfpsf.rhoName_),
-    muName_(mwfpsf.muName_)
+    muName_(mwfpsf.muName_),
+    kappa_(mwfpsf.kappa_),
+    E_(mwfpsf.E_)
 {}
 
 
@@ -115,11 +125,6 @@ void muSgsWallFunctionFvPatchScalarField::evaluate
     const Pstream::commsTypes
 )
 {
-    const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
-
-    const scalar kappa = lesModel.kappa().value();
-    const scalar E = lesModel.E().value();
-
     const scalarField& ry = patch().deltaCoeffs();
 
     const fvPatchVectorField& U =
@@ -151,18 +156,18 @@ void muSgsWallFunctionFvPatchScalarField::evaluate
 
             do
             {
-                scalar kUu = kappa*magUpara/utau;
+                scalar kUu = kappa_*magUpara/utau;
                 scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu);
 
                 scalar f =
                     - utau/(ry[facei]*muw[facei]/rhow[facei])
                     + magUpara/utau
-                    + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu));
+                    + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
 
                 scalar df =
                     - 1.0/(ry[facei]*muw[facei]/rhow[facei])
                     - magUpara/sqr(utau)
-                    - 1/E*kUu*fkUu/utau;
+                    - 1/E_*kUu*fkUu/utau;
 
                 scalar utauNew = utau - f/df;
                 err = mag((utau - utauNew)/utau);
@@ -191,6 +196,8 @@ void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
     writeEntryIfDifferent<word>(os, "U", "U", UName_);
     writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
     writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
+    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
     writeEntry("value", os);
 }
 
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H
index 0f55216d511..38f20535d33 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H
@@ -67,6 +67,12 @@ class muSgsWallFunctionFvPatchScalarField
         //- Name of laminar viscosity field
         word muName_;
 
+        //- Von Karman constant
+        scalar kappa_;
+
+        //- E coefficient
+        scalar E_;
+
 
 public:
 
diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C
index 4736499b4f7..edd0f4bcf07 100644
--- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C
+++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C
@@ -48,7 +48,7 @@ void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
     muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C
index 3bf3dd2cf21..77b12af60e9 100644
--- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C
+++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C
@@ -52,7 +52,7 @@ void lowReOneEqEddy::updateSubGridScaleFields()
     muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C
index bb2759dae3f..c6212dd74c2 100644
--- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C
+++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C
@@ -48,7 +48,7 @@ void oneEqEddy::updateSubGridScaleFields()
     muSgs_ = ck_*rho()*sqrt(k_)*delta();
     muSgs_.correctBoundaryConditions();
 
-    alphaSgs_ = muSgs_/Prt();
+    alphaSgs_ = muSgs_/Prt_;
     alphaSgs_.correctBoundaryConditions();
 }
 
diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H
index 189caafc96a..445faebd39e 100644
--- a/src/turbulenceModels/compressible/RAS/LRR/LRR.H
+++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H
@@ -158,7 +158,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H
index 4f466d43c3a..00db2c304f9 100644
--- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H
+++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H
@@ -167,7 +167,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H
index 1fa2c2fa432..b7c972a662c 100644
--- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H
+++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H
@@ -151,7 +151,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H
index 49aa946f6c6..1e4301adcd2 100644
--- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H
+++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H
@@ -147,7 +147,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H
index ada7094e172..39e70c49224 100644
--- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H
+++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H
@@ -183,7 +183,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H
index 929d761e467..865120d8c6c 100644
--- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H
+++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H
@@ -143,7 +143,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
index 76d39ffe460..a563557f764 100644
--- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
+++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H
@@ -227,7 +227,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H
index 68a95485a3b..222ee733a32 100644
--- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H
+++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H
@@ -164,7 +164,7 @@ public:
         {
             return tmp<volScalarField>
             (
-                new volScalarField("alphaEff", alphat_/Prt_ + alpha())
+                new volScalarField("alphaEff", alphat_ + alpha())
             );
         }
 
diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C
index b5d7b80c6e3..7d49a7055c7 100644
--- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C
@@ -25,7 +25,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "nuSgsWallFunctionFvPatchScalarField.H"
-#include "LESModel.H"
 #include "fvPatchFieldMapper.H"
 #include "volFields.H"
 #include "addToRunTimeSelectionTable.H"
@@ -50,7 +49,9 @@ nuSgsWallFunctionFvPatchScalarField
 :
     fixedValueFvPatchScalarField(p, iF),
     UName_("U"),
-    nuName_("nu")
+    nuName_("nu"),
+    kappa_(0.41),
+    E_(9.0)
 {}
 
 
@@ -65,7 +66,9 @@ nuSgsWallFunctionFvPatchScalarField
 :
     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
     UName_(ptf.UName_),
-    nuName_(ptf.nuName_)
+    nuName_(ptf.nuName_),
+    kappa_(ptf.kappa_),
+    E_(ptf.E_)
 {}
 
 
@@ -79,7 +82,9 @@ nuSgsWallFunctionFvPatchScalarField
 :
     fixedValueFvPatchScalarField(p, iF, dict),
     UName_(dict.lookupOrDefault<word>("U", "U")),
-    nuName_(dict.lookupOrDefault<word>("nu", "nu"))
+    nuName_(dict.lookupOrDefault<word>("nu", "nu")),
+    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
+    E_(dict.lookupOrDefault<scalar>("E", 9.0))
 {}
 
 
@@ -91,7 +96,9 @@ nuSgsWallFunctionFvPatchScalarField
 :
     fixedValueFvPatchScalarField(nwfpsf),
     UName_(nwfpsf.UName_),
-    nuName_(nwfpsf.nuName_)
+    nuName_(nwfpsf.nuName_),
+    kappa_(nwfpsf.kappa_),
+    E_(nwfpsf.E_)
 {}
 
 
@@ -104,7 +111,9 @@ nuSgsWallFunctionFvPatchScalarField
 :
     fixedValueFvPatchScalarField(nwfpsf, iF),
     UName_(nwfpsf.UName_),
-    nuName_(nwfpsf.nuName_)
+    nuName_(nwfpsf.nuName_),
+    kappa_(nwfpsf.kappa_),
+    E_(nwfpsf.E_)
 {}
 
 
@@ -115,15 +124,6 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate
     const Pstream::commsTypes
 )
 {
-    const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
-
-    // TODO: make these lookups optional (or more robust)?
-    const scalar kappa = readScalar(lesModel.lookup("kappa"));
-    const scalar E = readScalar
-    (
-        lesModel.subDict("wallFunctionCoeffs").lookup("E")
-    );
-
     const scalarField& ry = patch().deltaCoeffs();
 
     const fvPatchVectorField& U =
@@ -151,18 +151,18 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate
 
             do
             {
-                scalar kUu = min(kappa*magUpara/utau, 50);
+                scalar kUu = min(kappa_*magUpara/utau, 50);
                 scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu);
 
                 scalar f =
                     - utau/(ry[facei]*nuw[facei])
                     + magUpara/utau
-                    + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu));
+                    + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
 
                 scalar df =
                     - 1.0/(ry[facei]*nuw[facei])
                     - magUpara/sqr(utau)
-                    - 1/E*kUu*fkUu/utau;
+                    - 1/E_*kUu*fkUu/utau;
 
                 scalar utauNew = utau - f/df;
                 err = mag((utau - utauNew)/utau);
@@ -186,6 +186,8 @@ void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
     fvPatchField<scalar>::write(os);
     writeEntryIfDifferent<word>(os, "U", "U", UName_);
     writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
+    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
     writeEntry("value", os);
 }
 
diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H
index 9db775556ee..d1dbeb5fc94 100644
--- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H
@@ -64,6 +64,12 @@ class nuSgsWallFunctionFvPatchScalarField
         //- Name of laminar viscosity field
         word nuName_;
 
+        //- Von Karman constant
+        scalar kappa_;
+
+        //- E constant
+        scalar E_;
+
 
 public:
 
-- 
GitLab