diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H b/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H
index c845710399bd7dd773c2c81221efffb6fdfbe6fb..712dd510508d71650a945138d6667d0798f18b90 100644
--- a/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/createFields.H
@@ -1,6 +1,6 @@
-autoPtr<basicSolidThermo> thermo
+autoPtr<solidThermo> thermo
 (
-    basicSolidThermo::New(mesh)
+    solidThermo::New(mesh)
 );
 
 volScalarField& T = thermo->T();
diff --git a/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C b/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C
index 281107856e3144cca1086a3fdb8ccbe3fea4a651..2ac074a5bafbf5932a1536a7fac9e52b8a0c8128 100644
--- a/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C
+++ b/applications/utilities/postProcessing/wall/solidWallHeatFlux/solidWallHeatFlux.C
@@ -33,7 +33,7 @@ Description
 
 #include "fvCFD.H"
 #include "wallFvPatch.H"
-#include "basicSolidThermo.H"
+#include "solidThermo.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
index 888f9e440ef43053a0a3ec5379dcbec8dd1b42a7..55e668ee86e711cc6285fe687a0f8c83570dad79 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
@@ -2,8 +2,8 @@ EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/turbulenceModels \
-    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
     -I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
+    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
     -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
index 7af0a901af9b620e123846614459e65eed925757..5b0c4b4957f524850a499ac24c2cd1c1c21cfd15 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
@@ -37,11 +37,11 @@ Description
 
 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
 #include "incompressible/RAS/RASModel/RASModel.H"
-#include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H"
+#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
 
 #include "basicThermo.H"
 #include "compressible/RAS/RASModel/RASModel.H"
-#include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
 
 #include "wallDist.H"
 
@@ -55,7 +55,7 @@ void calcIncompressibleYPlus
     volScalarField& yPlus
 )
 {
-    typedef incompressible::RASModels::nutkWallFunctionFvPatchScalarField
+    typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
         wallFunctionPatchField;
 
     #include "createPhi.H"
@@ -107,7 +107,7 @@ void calcCompressibleYPlus
     volScalarField& yPlus
 )
 {
-    typedef compressible::RASModels::mutkWallFunctionFvPatchScalarField
+    typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
         wallFunctionPatchField;
 
     IOobject rhoHeader
diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C
index 81bb1df7ec5c15fd0ca5bc2e8fbb5d69b3a3c44a..104a6f58e5e3ef8b9e7fc23a7bf5168253292b7b 100644
--- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C
+++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C
@@ -27,10 +27,10 @@ License
 #include "volFields.H"
 
 #include "incompressible/RAS/RASModel/RASModel.H"
-#include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H"
+#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
 
 #include "compressible/RAS/RASModel/RASModel.H"
-#include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
 
 #include "wallDist.H"
 
@@ -92,7 +92,7 @@ void Foam::yPlusRAS::calcIncompressibleYPlus
     volScalarField& yPlus
 )
 {
-    typedef incompressible::RASModels::nutkWallFunctionFvPatchScalarField
+    typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
         wallFunctionPatchField;
 
     const incompressible::RASModel& model =
@@ -150,7 +150,7 @@ void Foam::yPlusRAS::calcCompressibleYPlus
     volScalarField& yPlus
 )
 {
-    typedef compressible::RASModels::mutkWallFunctionFvPatchScalarField
+    typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
         wallFunctionPatchField;
 
     const compressible::RASModel& model =
diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
index 3e68d95ada8813d96e5298ff5cd3a9cf14376714..7f7b86d1bb25b76a33313231d5841e38f7dfd28c 100644
--- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
+++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -155,6 +155,7 @@ autoPtr<LESModel> LESModel::New
 
 void LESModel::correct(const tmp<volTensorField>&)
 {
+    turbulenceModel::correct();
     delta_().correct();
 }
 
diff --git a/src/turbulenceModels/compressible/LES/Make/files b/src/turbulenceModels/compressible/LES/Make/files
index 653eb2b28f1d8c7a5888f2e42bd3e6d8fac67d06..cc52d88433d2bc58b9549e147c01ed4bbfb5b098 100644
--- a/src/turbulenceModels/compressible/LES/Make/files
+++ b/src/turbulenceModels/compressible/LES/Make/files
@@ -11,14 +11,4 @@ SpalartAllmaras/SpalartAllmaras.C
 
 vanDriestDelta/vanDriestDelta.C
 
-/* Wall functions */
-wallFunctions=derivedFvPatchFields/wallFunctions
-
-muSgsWallFunctions=$(wallFunctions)/muSgsWallFunctions
-$(muSgsWallFunctions)/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
-
-alphaSgsWallFunctions=$(wallFunctions)/alphaSgsWallFunctions
-$(alphaSgsWallFunctions)/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
-$(alphaSgsWallFunctions)/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
-
 LIB = $(FOAM_LIBBIN)/libcompressibleLESModels
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
deleted file mode 100644
index 44ac46edc542130acdcfb502c6f94a86dfdf151f..0000000000000000000000000000000000000000
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,341 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "alphaSgsJayatillekeWallFunctionFvPatchScalarField.H"
-#include "LESModel.H"
-#include "fvPatchFieldMapper.H"
-#include "volFields.H"
-#include "addToRunTimeSelectionTable.H"
-#include "wallFvPatch.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-namespace LESModels
-{
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0;
-scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
-label alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-void alphaSgsJayatillekeWallFunctionFvPatchScalarField::checkType()
-{
-    if (!isA<wallFvPatch>(patch()))
-    {
-        FatalErrorIn
-        (
-            "alphaSgsJayatillekeWallFunctionFvPatchScalarField::checkType()"
-        )
-            << "Patch type for patch " << patch().name() << " must be wall\n"
-            << "Current patch type is " << patch().type() << nl
-            << exit(FatalError);
-    }
-}
-
-
-scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::Psmooth
-(
-    const scalar Prat
-) const
-{
-    return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat));
-}
-
-
-scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
-(
-    const scalar P,
-    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 yptNew = ypt - f/df;
-
-        if (yptNew < VSMALL)
-        {
-            return 0;
-        }
-        else if (mag(yptNew - ypt) < tolerance_)
-        {
-            return yptNew;
-        }
-        else
-        {
-            ypt = yptNew;
-        }
-     }
-
-    return ypt;
-}
-
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-alphaSgsJayatillekeWallFunctionFvPatchScalarField::
-alphaSgsJayatillekeWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(p, iF),
-    Prt_(0.85),
-    kappa_(0.41),
-    E_(9.8),
-    heName_("he")
-
-{
-    checkType();
-}
-
-
-alphaSgsJayatillekeWallFunctionFvPatchScalarField::
-alphaSgsJayatillekeWallFunctionFvPatchScalarField
-(
-    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& ptf,
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const fvPatchFieldMapper& mapper
-)
-:
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
-    Prt_(ptf.Prt_),
-    kappa_(ptf.kappa_),
-    E_(ptf.E_),
-    heName_(ptf.heName_)
-
-{}
-
-
-alphaSgsJayatillekeWallFunctionFvPatchScalarField::
-alphaSgsJayatillekeWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const dictionary& 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.8)),
-    heName_(dict.lookupOrDefault<word>("he", "he"))
-{
-    checkType();
-}
-
-
-alphaSgsJayatillekeWallFunctionFvPatchScalarField::
-alphaSgsJayatillekeWallFunctionFvPatchScalarField
-(
-    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf
-)
-:
-    fixedValueFvPatchScalarField(awfpsf),
-    Prt_(awfpsf.Prt_),
-    kappa_(awfpsf.kappa_),
-    E_(awfpsf.E_),
-    heName_(awfpsf.heName_)
-{
-    checkType();
-}
-
-
-alphaSgsJayatillekeWallFunctionFvPatchScalarField::
-alphaSgsJayatillekeWallFunctionFvPatchScalarField
-(
-    const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(awfpsf, iF),
-    Prt_(awfpsf.Prt_),
-    kappa_(awfpsf.kappa_),
-    E_(awfpsf.E_),
-    heName_(awfpsf.heName_)
-{
-    checkType();
-}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
-(
-    const Pstream::commsTypes
-)
-{
-    const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
-
-    // Field data
-    const label patchI = patch().index();
-
-    const scalarField& muw = lesModel.mu().boundaryField()[patchI];
-    const scalarField muSgsw(lesModel.muSgs()().boundaryField()[patchI]);
-
-    const scalarField& alphaw = lesModel.alpha().boundaryField()[patchI];
-    scalarField& alphaSgsw = *this;
-
-    const fvPatchVectorField& Uw = lesModel.U().boundaryField()[patchI];
-    const scalarField magUp(mag(Uw.patchInternalField() - Uw));
-    const scalarField magGradUw(mag(Uw.snGrad()));
-
-    const scalarField& rhow = lesModel.rho().boundaryField()[patchI];
-    const fvPatchScalarField& hw =
-        patch().lookupPatchField<volScalarField, scalar>(heName_);
-
-    const scalarField& ry = patch().deltaCoeffs();
-
-    // Heat flux [W/m2] - lagging alphaSgsw
-    const scalarField qDot((alphaw + alphaSgsw)*hw.snGrad());
-
-    // Populate boundary values
-    forAll(alphaSgsw, faceI)
-    {
-        // Calculate uTau using Newton-Raphson iteration
-        scalar uTau =
-            sqrt((muSgsw[faceI] + muw[faceI])/rhow[faceI]*magGradUw[faceI]);
-
-        if (uTau > ROOTVSMALL)
-        {
-            label iter = 0;
-            scalar err = GREAT;
-
-            do
-            {
-                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));
-
-                scalar df =
-                    - 1.0/(ry[faceI]*muw[faceI]/rhow[faceI])
-                    - magUp[faceI]/sqr(uTau)
-                    - 1.0/E_*kUu*fkUu/uTau;
-
-                scalar uTauNew = uTau - f/df;
-                err = mag((uTau - uTauNew)/uTau);
-                uTau = uTauNew;
-
-            } while (uTau>VSMALL && err>tolerance_ && ++iter<maxIters_);
-
-            scalar yPlus = uTau/ry[faceI]/(muw[faceI]/rhow[faceI]);
-
-            // Molecular Prandtl number
-            scalar Pr = muw[faceI]/alphaw[faceI];
-
-            // Molecular-to-turbulenbt Prandtl number ratio
-            scalar Prat = Pr/Prt_;
-
-            // Thermal sublayer thickness
-            scalar P = Psmooth(Prat);
-            scalar yPlusTherm = this->yPlusTherm(P, Prat);
-
-            // Evaluate new effective thermal diffusivity
-            scalar alphaEff = 0.0;
-            if (yPlus < yPlusTherm)
-            {
-                scalar A = qDot[faceI]*rhow[faceI]*uTau/ry[faceI];
-                scalar B = qDot[faceI]*Pr*yPlus;
-                scalar C = Pr*0.5*rhow[faceI]*uTau*sqr(magUp[faceI]);
-                alphaEff = A/(B + C + VSMALL);
-            }
-            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 C =
-                    0.5*rhow[faceI]*uTau
-                   *(Prt_*sqr(magUp[faceI]) + (Pr - Prt_)*sqr(magUc));
-                alphaEff = A/(B + C + VSMALL);
-            }
-
-            // Update turbulent thermal diffusivity
-            alphaSgsw[faceI] = max(0.0, alphaEff - alphaw[faceI]);
-
-            if (debug)
-            {
-                Info<< "    uTau           = " << uTau << nl
-                    << "    Pr             = " << Pr << nl
-                    << "    Prt            = " << Prt_ << nl
-                    << "    qDot           = " << qDot[faceI] << nl
-                    << "    yPlus          = " << yPlus << nl
-                    << "    yPlusTherm     = " << yPlusTherm << nl
-                    << "    alphaEff       = " << alphaEff << nl
-                    << "    alphaw         = " << alphaw[faceI] << nl
-                    << "    alphaSgsw      = " << alphaSgsw[faceI] << nl
-                    << endl;
-            }
-        }
-        else
-        {
-            alphaSgsw[faceI] = 0.0;
-        }
-    }
-}
-
-
-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;
-    os.writeKeyword("he") << heName_ << token::END_STATEMENT << nl;
-    writeEntry("value", os);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
-    fvPatchScalarField,
-    alphaSgsJayatillekeWallFunctionFvPatchScalarField
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace compressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H
deleted file mode 100644
index c5d4d70241d76fba1ad16406f01edcbe4b8c61e3..0000000000000000000000000000000000000000
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H
+++ /dev/null
@@ -1,197 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-Class
-    alphaSgsJayatillekeWallFunctionFvPatchScalarField
-
-Description
-    Thermal wall function for turbulent thermal diffusivity based on the
-    Jayatilleke thermal wall function
-
-SourceFiles
-    alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef alphaSgsJayatillekeWallFunctionFvPatchScalarField_H
-#define alphaSgsJayatillekeWallFunctionFvPatchScalarField_H
-
-#include "fixedValueFvPatchFields.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-namespace LESModels
-{
-
-/*---------------------------------------------------------------------------*\
-     Class alphaSgsJayatillekeWallFunctionFvPatchScalarField Declaration
-\*---------------------------------------------------------------------------*/
-
-class alphaSgsJayatillekeWallFunctionFvPatchScalarField
-:
-    public fixedValueFvPatchScalarField
-{
-    // Private data
-
-        //- Turbulent Prandtl number
-        scalar Prt_;
-
-        //- Von Karman constant
-        scalar kappa_;
-
-        //- E coefficient
-        scalar E_;
-
-        //- Name of (sensible/total) enthalpy field
-        word heName_;
-
-
-        // Solution parameters
-
-            static scalar maxExp_;
-            static scalar tolerance_;
-            static label maxIters_;
-
-
-    // Private Member Functions
-
-        //- Check the type of the patch
-        void checkType();
-
-        //- `P' function
-        scalar Psmooth(const scalar Prat) const;
-
-        //- Calculate y+ at the edge of the thermal laminar sublayer
-        scalar yPlusTherm
-        (
-            const scalar P,
-            const scalar Prat
-        ) const;
-
-
-public:
-
-    //- Runtime type information
-    TypeName("alphaSgsJayatillekeWallFunction");
-
-
-    // Constructors
-
-        //- Construct from patch and internal field
-        alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        (
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&
-        );
-
-        //- Construct from patch, internal field and dictionary
-        alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        (
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&,
-            const dictionary&
-        );
-
-        //- Construct by mapping given an
-        //  alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        //  onto a new patch
-        alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        (
-            const alphaSgsJayatillekeWallFunctionFvPatchScalarField&,
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&,
-            const fvPatchFieldMapper&
-        );
-
-        //- Construct as copy
-        alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        (
-            const alphaSgsJayatillekeWallFunctionFvPatchScalarField&
-        );
-
-        //- Construct and return a clone
-        virtual tmp<fvPatchScalarField> clone() const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new alphaSgsJayatillekeWallFunctionFvPatchScalarField(*this)
-            );
-        }
-
-        //- Construct as copy setting internal field reference
-        alphaSgsJayatillekeWallFunctionFvPatchScalarField
-        (
-            const alphaSgsJayatillekeWallFunctionFvPatchScalarField&,
-            const DimensionedField<scalar, volMesh>&
-        );
-
-        //- Construct and return a clone setting internal field reference
-        virtual tmp<fvPatchScalarField> clone
-        (
-            const DimensionedField<scalar, volMesh>& iF
-        ) const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new alphaSgsJayatillekeWallFunctionFvPatchScalarField
-                (
-                    *this,
-                    iF
-                )
-            );
-        }
-
-
-    // Member functions
-
-        // Evaluation functions
-
-            //- Evaluate the patchField
-            virtual void evaluate
-            (
-                const Pstream::commsTypes commsType=Pstream::Pstream::blocking
-            );
-
-
-        // I-O
-
-            //- Write
-            void write(Ostream&) const;
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace compressible
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
deleted file mode 100644
index 181c8022a73e34d85704552dbba7f5c3599f783b..0000000000000000000000000000000000000000
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,164 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "alphaSgsWallFunctionFvPatchScalarField.H"
-#include "LESModel.H"
-#include "fvPatchFieldMapper.H"
-#include "volFields.H"
-#include "addToRunTimeSelectionTable.H"
-#include "wallFvPatch.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-namespace LESModels
-{
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-void alphaSgsWallFunctionFvPatchScalarField::checkType()
-{
-    if (!isA<wallFvPatch>(patch()))
-    {
-        FatalErrorIn
-        (
-            "alphaSgsWallFunctionFvPatchScalarField::checkType()"
-        )
-            << "Patch type for patch " << patch().name() << " must be wall\n"
-            << "Current patch type is " << patch().type() << nl
-            << exit(FatalError);
-    }
-}
-
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-alphaSgsWallFunctionFvPatchScalarField::
-alphaSgsWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(p, iF),
-    Prt_(0.85)
-{
-    checkType();
-}
-
-
-alphaSgsWallFunctionFvPatchScalarField::
-alphaSgsWallFunctionFvPatchScalarField
-(
-    const alphaSgsWallFunctionFvPatchScalarField& ptf,
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const fvPatchFieldMapper& mapper
-)
-:
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
-    Prt_(ptf.Prt_)
-{}
-
-
-alphaSgsWallFunctionFvPatchScalarField::
-alphaSgsWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const dictionary& dict
-)
-:
-    fixedValueFvPatchScalarField(p, iF, dict),
-    Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
-{
-    checkType();
-}
-
-
-alphaSgsWallFunctionFvPatchScalarField::
-alphaSgsWallFunctionFvPatchScalarField
-(
-    const alphaSgsWallFunctionFvPatchScalarField& awfpsf
-)
-:
-    fixedValueFvPatchScalarField(awfpsf),
-    Prt_(awfpsf.Prt_)
-{
-    checkType();
-}
-
-
-alphaSgsWallFunctionFvPatchScalarField::
-alphaSgsWallFunctionFvPatchScalarField
-(
-    const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(awfpsf, iF),
-    Prt_(awfpsf.Prt_)
-
-{
-    checkType();
-}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-void alphaSgsWallFunctionFvPatchScalarField::evaluate
-(
-    const Pstream::commsTypes
-)
-{
-    const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
-
-    const scalarField muSgsw
-    (
-        lesModel.muSgs()().boundaryField()[patch().index()]
-    );
-
-    operator==(muSgsw/Prt_);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
-    fvPatchScalarField,
-    alphaSgsWallFunctionFvPatchScalarField
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace compressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
deleted file mode 100644
index e6de9e18132526e8d3f5871a3fdb8d7ae91e3ab2..0000000000000000000000000000000000000000
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,223 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "muSgsUSpaldingWallFunctionFvPatchScalarField.H"
-#include "LESModel.H"
-#include "fvPatchFieldMapper.H"
-#include "volFields.H"
-#include "addToRunTimeSelectionTable.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-namespace LESModels
-{
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-muSgsUSpaldingWallFunctionFvPatchScalarField::
-muSgsUSpaldingWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(p, iF),
-    UName_("U"),
-    rhoName_("rho"),
-    muName_("mu"),
-    kappa_(0.41),
-    E_(9.8)
-{}
-
-
-muSgsUSpaldingWallFunctionFvPatchScalarField::
-muSgsUSpaldingWallFunctionFvPatchScalarField
-(
-    const muSgsUSpaldingWallFunctionFvPatchScalarField& ptf,
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const fvPatchFieldMapper& mapper
-)
-:
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
-    UName_(ptf.UName_),
-    rhoName_(ptf.rhoName_),
-    muName_(ptf.muName_),
-    kappa_(ptf.kappa_),
-    E_(ptf.E_)
-{}
-
-
-muSgsUSpaldingWallFunctionFvPatchScalarField::
-muSgsUSpaldingWallFunctionFvPatchScalarField
-(
-    const fvPatch& p,
-    const DimensionedField<scalar, volMesh>& iF,
-    const dictionary& dict
-)
-:
-    fixedValueFvPatchScalarField(p, iF, dict),
-    UName_(dict.lookupOrDefault<word>("U", "U")),
-    rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
-    muName_(dict.lookupOrDefault<word>("mu", "mu")),
-    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
-    E_(dict.lookupOrDefault<scalar>("E", 9.8))
-{}
-
-
-muSgsUSpaldingWallFunctionFvPatchScalarField::
-muSgsUSpaldingWallFunctionFvPatchScalarField
-(
-    const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf
-)
-:
-    fixedValueFvPatchScalarField(mwfpsf),
-    UName_(mwfpsf.UName_),
-    rhoName_(mwfpsf.rhoName_),
-    muName_(mwfpsf.muName_),
-    kappa_(mwfpsf.kappa_),
-    E_(mwfpsf.E_)
-{}
-
-
-muSgsUSpaldingWallFunctionFvPatchScalarField::
-muSgsUSpaldingWallFunctionFvPatchScalarField
-(
-    const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf,
-    const DimensionedField<scalar, volMesh>& iF
-)
-:
-    fixedValueFvPatchScalarField(mwfpsf, iF),
-    UName_(mwfpsf.UName_),
-    rhoName_(mwfpsf.rhoName_),
-    muName_(mwfpsf.muName_),
-    kappa_(mwfpsf.kappa_),
-    E_(mwfpsf.E_)
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
-(
-    const Pstream::commsTypes
-)
-{
-    const scalarField& ry = patch().deltaCoeffs();
-
-    const fvPatchVectorField& U =
-        patch().lookupPatchField<volVectorField, vector>(UName_);
-
-    const scalarField magUp(mag(U.patchInternalField() - U));
-
-    const scalarField& muw =
-        patch().lookupPatchField<volScalarField, scalar>(muName_);
-
-    const scalarField& rhow =
-        patch().lookupPatchField<volScalarField, scalar>(rhoName_);
-
-    scalarField& muSgsw = *this;
-
-    const scalarField magFaceGradU(mag(U.snGrad()));
-
-    forAll(muSgsw, facei)
-    {
-        scalar magUpara = magUp[facei];
-
-        scalar utau =
-            sqrt((muSgsw[facei] + muw[facei])*magFaceGradU[facei]/rhow[facei]);
-
-        if (utau > 0)
-        {
-            int iter = 0;
-            scalar err = GREAT;
-
-            do
-            {
-                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));
-
-                scalar df =
-                    - 1.0/(ry[facei]*muw[facei]/rhow[facei])
-                    - magUpara/sqr(utau)
-                    - 1/E_*kUu*fkUu/utau;
-
-                scalar utauNew = utau - f/df;
-                err = mag((utau - utauNew)/utau);
-                utau = utauNew;
-
-            } while (utau > VSMALL && err > 0.01 && ++iter < 10);
-
-            muSgsw[facei] =
-                max
-                (
-                    rhow[facei]*sqr(utau)/magFaceGradU[facei] - muw[facei],
-                    0.0
-                );
-        }
-        else
-        {
-            muSgsw[facei] = 0;
-        }
-    }
-}
-
-
-void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
-{
-    fvPatchField<scalar>::write(os);
-    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);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
-    fvPatchScalarField,
-    muSgsUSpaldingWallFunctionFvPatchScalarField
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace compressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H
deleted file mode 100644
index 9d8adf869c31115e21e1552aafe001ea1df798d2..0000000000000000000000000000000000000000
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H
+++ /dev/null
@@ -1,173 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-Class
-    Foam::compressible::LESModels::
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-
-Description
-    Wall function boundary condition for walls, based on velocity, using
-    Spaldings law to give a continuous muSgs profile to the wall (y+ = 0).
-
-SourceFiles
-    muSgsUSpaldingWallFunctionFvPatchScalarField.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef muSgsUSpaldingWallFunctionFvPatchScalarField_H
-#define muSgsUSpaldingWallFunctionFvPatchScalarField_H
-
-#include "fixedValueFvPatchFields.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace compressible
-{
-namespace LESModels
-{
-
-/*---------------------------------------------------------------------------*\
-       Class muSgsUSpaldingWallFunctionFvPatchScalarField Declaration
-\*---------------------------------------------------------------------------*/
-
-class muSgsUSpaldingWallFunctionFvPatchScalarField
-:
-    public fixedValueFvPatchScalarField
-{
-    // Private data
-
-        //- Name of velocity field
-        word UName_;
-
-        //- Name of density field
-        word rhoName_;
-
-        //- Name of laminar viscosity field
-        word muName_;
-
-        //- Von Karman constant
-        scalar kappa_;
-
-        //- E coefficient
-        scalar E_;
-
-
-public:
-
-    //- Runtime type information
-    TypeName("muSgsUSpaldingWallFunction");
-
-
-    // Constructors
-
-        //- Construct from patch and internal field
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-        (
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&
-        );
-
-        //- Construct from patch, internal field and dictionary
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-        (
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&,
-            const dictionary&
-        );
-
-        //- Construct by mapping given
-        //  muSgsUSpaldingWallFunctionFvPatchScalarField
-        //  onto a new patch
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-        (
-            const muSgsUSpaldingWallFunctionFvPatchScalarField&,
-            const fvPatch&,
-            const DimensionedField<scalar, volMesh>&,
-            const fvPatchFieldMapper&
-        );
-
-        //- Construct as copy
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-        (
-            const muSgsUSpaldingWallFunctionFvPatchScalarField&
-        );
-
-        //- Construct and return a clone
-        virtual tmp<fvPatchScalarField> clone() const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new muSgsUSpaldingWallFunctionFvPatchScalarField(*this)
-            );
-        }
-
-        //- Construct as copy setting internal field reference
-        muSgsUSpaldingWallFunctionFvPatchScalarField
-        (
-            const muSgsUSpaldingWallFunctionFvPatchScalarField&,
-            const DimensionedField<scalar, volMesh>&
-        );
-
-        //- Construct and return a clone setting internal field reference
-        virtual tmp<fvPatchScalarField> clone
-        (
-            const DimensionedField<scalar, volMesh>& iF
-        ) const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new muSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF)
-            );
-        }
-
-
-    // Member functions
-
-        // Evaluation functions
-
-            //- Evaluate the patchField
-            virtual void evaluate
-            (
-                const Pstream::commsTypes commsType=Pstream::blocking
-            );
-
-        // I-O
-
-            //- Write
-            void write(Ostream&) const;
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace compressible
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files
index a6ae97b5a8234cc7c2de40fc20d687fab02576f3..524f89b653b19e0b5f66cd04b8c5f56878ce8840 100644
--- a/src/turbulenceModels/compressible/RAS/Make/files
+++ b/src/turbulenceModels/compressible/RAS/Make/files
@@ -18,11 +18,14 @@ $(alphatWallFunctions)/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C
 $(alphatWallFunctions)/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
 
 mutWallFunctions = $(wallFunctions)/mutWallFunctions
-$(mutWallFunctions)/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
+$(mutWallFunctions)/mutWallFunction/mutWallFunctionFvPatchScalarField.C
+
 $(mutWallFunctions)/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
+$(mutWallFunctions)/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
+
+$(mutWallFunctions)/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
 $(mutWallFunctions)/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
 $(mutWallFunctions)/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
-$(mutWallFunctions)/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
 $(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
 
 epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
@@ -35,7 +38,7 @@ kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
 $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
 
 /* Patch fields */
-derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
+derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
 derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
 derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
 backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C
index a3e7d7281cadf81de63e42635eddfdfcc6743fc0..26878b8bc603ef32fba13d1b0f34a3fb0ea29357 100644
--- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C
+++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -83,9 +83,7 @@ RASModel::RASModel
 
     kMin_("kMin", sqr(dimVelocity), SMALL),
     epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
-    omegaMin_("omegaMin", dimless/dimTime, SMALL),
-
-    y_(mesh_)
+    omegaMin_("omegaMin", dimless/dimTime, SMALL)
 {
     kMin_.readIfPresent(*this);
     epsilonMin_.readIfPresent(*this);
@@ -159,57 +157,9 @@ autoPtr<RASModel> RASModel::New
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
-{
-    scalar ypl = 11.0;
-
-    for (int i=0; i<10; i++)
-    {
-        ypl = log(max(E*ypl, 1))/kappa;
-    }
-
-    return ypl;
-}
-
-
-tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
-{
-    const fvPatch& curPatch = mesh_.boundary()[patchNo];
-
-    tmp<scalarField> tYp(new scalarField(curPatch.size()));
-    scalarField& Yp = tYp();
-
-    if (isA<wallFvPatch>(curPatch))
-    {
-        Yp = pow025(Cmu)
-            *y_[patchNo]
-            *sqrt(k()().boundaryField()[patchNo].patchInternalField())
-           /(
-                mu().boundaryField()[patchNo].patchInternalField()
-               /rho_.boundaryField()[patchNo]
-            );
-    }
-    else
-    {
-        WarningIn
-        (
-            "tmp<scalarField> RASModel::yPlus(const label patchNo) const"
-        )   << "Patch " << patchNo << " is not a wall. Returning null field"
-            << nl << endl;
-
-        Yp.setSize(0);
-    }
-
-    return tYp;
-}
-
-
 void RASModel::correct()
 {
-    if (mesh_.changing())
-    {
-        y_.correct();
-    }
+    turbulenceModel::correct();
 }
 
 
diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H
index 6251da74fee5ce769489ea86130cb04bd23ee92c..1a24cb78ee5e257b6d3e318d76733519feee806f 100644
--- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H
+++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H
@@ -46,7 +46,6 @@ SourceFiles
 #include "compressible/turbulenceModel/turbulenceModel.H"
 #include "volFields.H"
 #include "surfaceFields.H"
-#include "nearWallDist.H"
 #include "fvm.H"
 #include "fvc.H"
 #include "fvMatrices.H"
@@ -96,9 +95,6 @@ protected:
         //- Lower limit for omega
         dimensionedScalar omegaMin_;
 
-        //- Near wall distance boundary field
-        nearWallDist y_;
-
 
     // Protected Member Functions
 
@@ -213,15 +209,6 @@ public:
                 return omegaMin_;
             }
 
-            //- Return the near wall distances
-            const nearWallDist& y() const
-            {
-                return y_;
-            }
-
-            //- Calculate y+ at the edge of the laminar sublayer
-            scalar yPlusLam(const scalar kappa, const scalar E) const;
-
             //- Const access to the coefficients dictionary
             const dictionary& coeffDict() const
             {
@@ -264,13 +251,6 @@ public:
                 thermo().alphaEff(alphat()().boundaryField()[patchI], patchI);
         }
 
-        //- Return yPlus for the given patch
-        virtual tmp<scalarField> yPlus
-        (
-            const label patchI,
-            const scalar Cmu
-        ) const;
-
         //- Solve the turbulence equations and correct the turbulence viscosity
         virtual void correct();
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
similarity index 69%
rename from src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
rename to src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
index 0a427a3f1ac79cbb574c32de197f608f63df1696..c747a97b84ed39d242c33e4e832f2999287f38a3 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
@@ -23,7 +23,7 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "htcConvFvPatchScalarField.H"
+#include "convectiveHeatTransferFvPatchScalarField.H"
 #include "RASModel.H"
 #include "fvPatchFieldMapper.H"
 #include "addToRunTimeSelectionTable.H"
@@ -39,7 +39,8 @@ namespace RASModels
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-htcConvFvPatchScalarField::htcConvFvPatchScalarField
+convectiveHeatTransferFvPatchScalarField::
+convectiveHeatTransferFvPatchScalarField
 (
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF
@@ -50,9 +51,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
 {}
 
 
-htcConvFvPatchScalarField::htcConvFvPatchScalarField
+convectiveHeatTransferFvPatchScalarField::
+convectiveHeatTransferFvPatchScalarField
 (
-    const htcConvFvPatchScalarField& ptf,
+    const convectiveHeatTransferFvPatchScalarField& ptf,
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF,
     const fvPatchFieldMapper& mapper
@@ -63,7 +65,8 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
 {}
 
 
-htcConvFvPatchScalarField::htcConvFvPatchScalarField
+convectiveHeatTransferFvPatchScalarField::
+convectiveHeatTransferFvPatchScalarField
 (
     const fvPatch& p,
     const DimensionedField<scalar, volMesh>& iF,
@@ -75,9 +78,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
 {}
 
 
-htcConvFvPatchScalarField::htcConvFvPatchScalarField
+convectiveHeatTransferFvPatchScalarField::
+convectiveHeatTransferFvPatchScalarField
 (
-    const htcConvFvPatchScalarField& htcpsf
+    const convectiveHeatTransferFvPatchScalarField& htcpsf
 )
 :
     fixedValueFvPatchScalarField(htcpsf),
@@ -85,9 +89,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
 {}
 
 
-htcConvFvPatchScalarField::htcConvFvPatchScalarField
+convectiveHeatTransferFvPatchScalarField::
+convectiveHeatTransferFvPatchScalarField
 (
-    const htcConvFvPatchScalarField& htcpsf,
+    const convectiveHeatTransferFvPatchScalarField& htcpsf,
     const DimensionedField<scalar, volMesh>& iF
 )
 :
@@ -98,24 +103,25 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void htcConvFvPatchScalarField::updateCoeffs()
+void convectiveHeatTransferFvPatchScalarField::updateCoeffs()
 {
     if (updated())
     {
         return;
     }
 
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField alphaEffw(rasModel.alphaEff(patchI));
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const vectorField& Uc = rasModel.U();
-    const vectorField& Uw = rasModel.U().boundaryField()[patchI];
-    const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI];
-    const scalarField& pw = rasModel.thermo().p().boundaryField()[patchI];
-    const scalarField Cpw(rasModel.thermo().Cp(pw, Tw, patchI));
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const scalarField alphaEffw(turbModel.alphaEff(patchi));
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const vectorField& Uc = turbModel.U();
+    const vectorField& Uw = turbModel.U().boundaryField()[patchi];
+    const scalarField& Tw = turbModel.thermo().T().boundaryField()[patchi];
+    const scalarField& pw = turbModel.thermo().p().boundaryField()[patchi];
+    const scalarField Cpw(turbModel.thermo().Cp(pw, Tw, patchi));
 
     const scalarField kappaw(Cpw*alphaEffw);
     const scalarField Pr(muw*Cpw/kappaw);
@@ -141,7 +147,7 @@ void htcConvFvPatchScalarField::updateCoeffs()
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void htcConvFvPatchScalarField::write(Ostream& os) const
+void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const
 {
     fvPatchField<scalar>::write(os);
     os.writeKeyword("L") << L_ << token::END_STATEMENT << nl;
@@ -154,7 +160,7 @@ void htcConvFvPatchScalarField::write(Ostream& os) const
 makePatchTypeField
 (
     fvPatchScalarField,
-    htcConvFvPatchScalarField
+    convectiveHeatTransferFvPatchScalarField
 );
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H
similarity index 79%
rename from src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H
rename to src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H
index 0b5a4d228c692e7bd90dec60aec7c61f94f09947..8731d01a6e7aeaf28c53628aea09dbce675eadd7 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,13 +22,13 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::compressible::RASModels::htcConvFvPatchScalarField
+    Foam::compressible::RASModels::convectiveHeatTransferFvPatchScalarField
 
 Description
     Convective heat transfer boundary condition
 
 SourceFiles
-    htcConvFvPatchScalarField.C
+    convectiveHeatTransferFvPatchScalarField.C
 
 \*---------------------------------------------------------------------------*/
 
@@ -47,10 +47,10 @@ namespace RASModels
 {
 
 /*---------------------------------------------------------------------------*\
-                 Class htcConvFvPatchScalarField Declaration
+           Class convectiveHeatTransferFvPatchScalarField Declaration
 \*---------------------------------------------------------------------------*/
 
-class htcConvFvPatchScalarField
+class convectiveHeatTransferFvPatchScalarField
 :
     public fixedValueFvPatchScalarField
 {
@@ -65,20 +65,20 @@ protected:
 public:
 
     //- Runtime type information
-    TypeName("htcConvection");
+    TypeName("convectiveHeatTransfer");
 
 
     // Constructors
 
         //- Construct from patch and internal field
-        htcConvFvPatchScalarField
+        convectiveHeatTransferFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&
         );
 
         //- Construct from patch, internal field and dictionary
-        htcConvFvPatchScalarField
+        convectiveHeatTransferFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
@@ -86,20 +86,20 @@ public:
         );
 
         //- Construct by mapping given
-        //  htcConvFvPatchScalarField
+        //  convectiveHeatTransferFvPatchScalarField
         //  onto a new patch
-        htcConvFvPatchScalarField
+        convectiveHeatTransferFvPatchScalarField
         (
-            const htcConvFvPatchScalarField&,
+            const convectiveHeatTransferFvPatchScalarField&,
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
             const fvPatchFieldMapper&
         );
 
         //- Construct as copy
-        htcConvFvPatchScalarField
+        convectiveHeatTransferFvPatchScalarField
         (
-            const htcConvFvPatchScalarField&
+            const convectiveHeatTransferFvPatchScalarField&
         );
 
         //- Construct and return a clone
@@ -107,14 +107,14 @@ public:
         {
             return tmp<fvPatchScalarField>
             (
-                new htcConvFvPatchScalarField(*this)
+                new convectiveHeatTransferFvPatchScalarField(*this)
             );
         }
 
         //- Construct as copy setting internal field reference
-        htcConvFvPatchScalarField
+        convectiveHeatTransferFvPatchScalarField
         (
-            const htcConvFvPatchScalarField&,
+            const convectiveHeatTransferFvPatchScalarField&,
             const DimensionedField<scalar, volMesh>&
         );
 
@@ -126,7 +126,7 @@ public:
         {
             return tmp<fvPatchScalarField>
             (
-                new htcConvFvPatchScalarField(*this, iF)
+                new convectiveHeatTransferFvPatchScalarField(*this, iF)
             );
         }
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
index b4820095ccc21b844cc322988b93215413fdccee..5db232e85eae14d90291788034448a1a523f3b06 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
@@ -199,34 +199,35 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
         return;
     }
 
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
     const scalar Cmu25 = pow025(Cmu_);
 
-    const scalarField& y = rasModel.y()[patchI];
+    const scalarField& y = turbModel.y()[patchi];
 
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
 
-    const scalarField& alphaw = rasModel.alpha().boundaryField()[patchI];
+    const scalarField& alphaw = turbModel.alpha().boundaryField()[patchi];
     scalarField& alphatw = *this;
 
-    const tmp<volScalarField> tk = rasModel.k();
+    const tmp<volScalarField> tk = turbModel.k();
     const volScalarField& k = tk();
 
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
     const scalarField magUp(mag(Uw.patchInternalField() - Uw));
     const scalarField magGradUw(mag(Uw.snGrad()));
 
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
     const fvPatchScalarField& hew =
-        rasModel.thermo().he().boundaryField()[patchI];
+        turbModel.thermo().he().boundaryField()[patchi];
 
     // Heat flux [W/m2] - lagging alphatw
     const scalarField qDot
     (
-        rasModel.thermo().alphaEff(alphatw, patchI)*hew.snGrad()
+        turbModel.thermo().alphaEff(alphatw, patchi)*hew.snGrad()
     );
 
     // Populate boundary values
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index 1c0e11d7893d2503e3858764017303da73b62015..edd4dea76385cdd27d3e01e0732288d59c82a0ed 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -28,6 +28,7 @@ License
 #include "fvPatchFieldMapper.H"
 #include "volFields.H"
 #include "addToRunTimeSelectionTable.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 #include "wallFvPatch.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -55,23 +56,6 @@ void epsilonWallFunctionFvPatchScalarField::checkType()
 }
 
 
-scalar epsilonWallFunctionFvPatchScalarField::calcYPlusLam
-(
-    const scalar kappa,
-    const scalar E
-) const
-{
-    scalar ypl = 11.0;
-
-    for (int i=0; i<10; i++)
-    {
-        ypl = log(E*ypl)/kappa;
-    }
-
-    return ypl;
-}
-
-
 void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
 {
     writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
@@ -94,7 +78,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
     Cmu_(0.09),
     kappa_(0.41),
     E_(9.8),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
 
 
 {
@@ -134,7 +118,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
     Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
     kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
     E_(dict.lookupOrDefault<scalar>("E", 9.8)),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
 
 {
     checkType();
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H
index ff7447a2e5b81984eef6d1c1465d20e262129ebc..d523c8d38f5905615ba4f2356e70bf38f31292ea 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -81,9 +81,6 @@ protected:
         //- Check the type of the patch
         virtual void checkType();
 
-        //- Calculate the Y+ at the edge of the laminar sublayer
-        virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
-
         //- Write local wall function variables
         virtual void writeLocalEntries(Ostream&) const;
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
index 770fd54a81b65f350f301f5e2e3b553b80ac199f..5eee5c270289d210b489b5497a9d8a7c100be7d1 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -54,7 +54,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF)
+    mutWallFunctionFvPatchScalarField(p, iF)
 {}
 
 
@@ -66,7 +66,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
+    mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
 {}
 
 
@@ -77,7 +77,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF, dict)
+    mutWallFunctionFvPatchScalarField(p, iF, dict)
 {}
 
 
@@ -86,7 +86,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
     const mutLowReWallFunctionFvPatchScalarField& mlrwfpsf
 )
 :
-    mutkWallFunctionFvPatchScalarField(mlrwfpsf)
+    mutWallFunctionFvPatchScalarField(mlrwfpsf)
 {}
 
 
@@ -96,10 +96,29 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(mlrwfpsf, iF)
+    mutWallFunctionFvPatchScalarField(mlrwfpsf, iF)
 {}
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+tmp<scalarField> mutLowReWallFunctionFvPatchScalarField::yPlus() const
+{
+    const label patchi = patch().index();
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const scalarField& y = turbModel.y()[patchi];
+    const scalarField nuw
+    (
+        turbModel.mu().boundaryField()[patchi]
+       /turbModel.rho().boundaryField()[patchi]
+    );
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
+
+    return y*sqrt(nuw*mag(Uw.snGrad()))/nuw;
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 makePatchTypeField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H
index cffec80fb30c200bdf5f706db52cb5df11270992..bbed4a8bbf80f4ed47b289a3f5b1607839450f80 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,7 +38,7 @@ SourceFiles
 #ifndef compressibleMutLowReWallFunctionFvPatchScalarField_H
 #define compressibleMutLowReWallFunctionFvPatchScalarField_H
 
-#include "mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -55,7 +55,7 @@ namespace RASModels
 
 class mutLowReWallFunctionFvPatchScalarField
 :
-    public mutkWallFunctionFvPatchScalarField
+    public mutWallFunctionFvPatchScalarField
 {
 protected:
 
@@ -132,6 +132,14 @@ public:
                 new mutLowReWallFunctionFvPatchScalarField(*this, iF)
             );
         }
+
+
+    // Member functions
+
+        // Evaluation functions
+
+            //- Calculate and return the yPlus at the boundary
+            virtual tmp<scalarField> yPlus() const;
 };
 
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
index a90cf4868635e94104e3ebf3fc79bbae0893f940..f5571451a1fb4d9f20dd4350a8e5d355825c9eff 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -45,12 +45,14 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus
     const scalarField& magUp
 ) const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
-    const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+
+    const scalarField& y = turbModel.y()[patchi];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
+    const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchi];
 
     tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
     scalarField& yPlus = tyPlus();
@@ -170,13 +172,15 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus
 
 tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcMut() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
+
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
-    const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
+    const scalarField& y = turbModel.y()[patchi];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
+    const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchi];
 
     scalarField magUp(mag(Uw.patchInternalField() - Uw));
 
@@ -208,7 +212,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF),
+    mutWallFunctionFvPatchScalarField(p, iF),
     roughnessHeight_(pTraits<scalar>::zero),
     roughnessConstant_(pTraits<scalar>::zero),
     roughnessFactor_(pTraits<scalar>::zero)
@@ -223,7 +227,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
+    mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
     roughnessHeight_(ptf.roughnessHeight_),
     roughnessConstant_(ptf.roughnessConstant_),
     roughnessFactor_(ptf.roughnessFactor_)
@@ -237,7 +241,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF, dict),
+    mutWallFunctionFvPatchScalarField(p, iF, dict),
     roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))),
     roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))),
     roughnessFactor_(readScalar(dict.lookup("roughnessFactor")))
@@ -249,7 +253,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
     const mutURoughWallFunctionFvPatchScalarField& rwfpsf
 )
 :
-    mutkWallFunctionFvPatchScalarField(rwfpsf),
+    mutWallFunctionFvPatchScalarField(rwfpsf),
     roughnessHeight_(rwfpsf.roughnessHeight_),
     roughnessConstant_(rwfpsf.roughnessConstant_),
     roughnessFactor_(rwfpsf.roughnessFactor_)
@@ -262,7 +266,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(rwfpsf, iF),
+    mutWallFunctionFvPatchScalarField(rwfpsf, iF),
     roughnessHeight_(rwfpsf.roughnessHeight_),
     roughnessConstant_(rwfpsf.roughnessConstant_),
     roughnessFactor_(rwfpsf.roughnessFactor_)
@@ -273,10 +277,11 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
 
 tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::yPlus() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
     const scalarField magUp(mag(Uw.patchInternalField() - Uw));
 
     return calcYPlus(magUp);
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H
index 74596ff781a4510246149ed6b717be5d52c71964..05f82c57f6bb001709bbfdb03a48f16d233ad226 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -35,7 +35,7 @@ SourceFiles
 #ifndef compressibleMutURoughWallFunctionFvPatchScalarField_H
 #define compressibleMutURoughWallFunctionFvPatchScalarField_H
 
-#include "mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -52,7 +52,7 @@ namespace RASModels
 
 class mutURoughWallFunctionFvPatchScalarField
 :
-    public mutkWallFunctionFvPatchScalarField
+    public mutWallFunctionFvPatchScalarField
 {
 protected:
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
index 4e24d39e06ebb1339abebf7ad18acb5911664d49..4a4691c12c98254e27b567d19f985a349da1cffd 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -45,19 +45,21 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau
     const scalarField& magGradU
 ) const
 {
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patch().index()];
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+
+    const scalarField& y = turbModel.y()[patch().index()];
 
     const fvPatchVectorField& Uw =
-        rasModel.U().boundaryField()[patch().index()];
+        turbModel.U().boundaryField()[patch().index()];
 
     scalarField magUp(mag(Uw.patchInternalField() - Uw));
 
     const fvPatchScalarField& rhow =
-        rasModel.rho().boundaryField()[patch().index()];
+        turbModel.rho().boundaryField()[patch().index()];
 
     const fvPatchScalarField& muw =
-        rasModel.mu().boundaryField()[patch().index()];
+        turbModel.mu().boundaryField()[patch().index()];
     const scalarField& mutw = *this;
 
     tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));
@@ -104,13 +106,15 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau
 
 tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
+
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
     const scalarField magGradU(mag(Uw.snGrad()));
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     return max
     (
@@ -129,7 +133,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF)
+    mutWallFunctionFvPatchScalarField(p, iF)
 {}
 
 
@@ -142,7 +146,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
+    mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
 {}
 
 
@@ -154,7 +158,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF, dict)
+    mutWallFunctionFvPatchScalarField(p, iF, dict)
 {}
 
 
@@ -164,7 +168,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
     const mutUSpaldingWallFunctionFvPatchScalarField& wfpsf
 )
 :
-    mutkWallFunctionFvPatchScalarField(wfpsf)
+    mutWallFunctionFvPatchScalarField(wfpsf)
 {}
 
 
@@ -175,7 +179,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(wfpsf, iF)
+    mutWallFunctionFvPatchScalarField(wfpsf, iF)
 {}
 
 
@@ -183,13 +187,15 @@ mutUSpaldingWallFunctionFvPatchScalarField
 
 tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::yPlus() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
+
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const scalarField& y = turbModel.y()[patchi];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow);
 }
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H
index 4070203552392c93970ebd278686965e6b45e136..4157f384a15378c5df0c1b20a90dd1e35a02dece 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -35,7 +35,7 @@ SourceFiles
 #ifndef compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
 #define compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
 
-#include "mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -52,7 +52,7 @@ namespace RASModels
 
 class mutUSpaldingWallFunctionFvPatchScalarField
 :
-    public mutkWallFunctionFvPatchScalarField
+    public mutWallFunctionFvPatchScalarField
 {
 protected:
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
index 725c7794a50dc0959e66c95b03fbe78b18ec8b72..85efec0327fd244601701cabdb2980bc21909d1b 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -45,12 +45,14 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcYPlus
     const scalarField& magUp
 ) const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+
+    const scalarField& y = turbModel.y()[patchi];
+    const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
     scalarField& yPlus = tyPlus();
@@ -81,12 +83,14 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcYPlus
 
 tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcMut() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
+
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
     const scalarField magUp(mag(Uw.patchInternalField() - Uw));
-    const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     tmp<scalarField> tyPlus = calcYPlus(magUp);
     scalarField& yPlus = tyPlus();
@@ -115,7 +119,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF)
+    mutWallFunctionFvPatchScalarField(p, iF)
 {}
 
 
@@ -127,7 +131,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
+    mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
 {}
 
 
@@ -138,7 +142,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    mutkWallFunctionFvPatchScalarField(p, iF, dict)
+    mutWallFunctionFvPatchScalarField(p, iF, dict)
 {}
 
 
@@ -147,7 +151,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
     const mutUWallFunctionFvPatchScalarField& sawfpsf
 )
 :
-    mutkWallFunctionFvPatchScalarField(sawfpsf)
+    mutWallFunctionFvPatchScalarField(sawfpsf)
 {}
 
 
@@ -157,7 +161,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    mutkWallFunctionFvPatchScalarField(sawfpsf, iF)
+    mutWallFunctionFvPatchScalarField(sawfpsf, iF)
 {}
 
 
@@ -165,9 +169,10 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
 
 tmp<scalarField> mutUWallFunctionFvPatchScalarField::yPlus() const
 {
-    const label patchI = patch().index();
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const label patchi = patch().index();
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
     const scalarField magUp(mag(Uw.patchInternalField() - Uw));
 
     return calcYPlus(magUp);
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H
index 882725186bfbb4103d699811b0b15e15eb358e1b..6071a32128c9406af282d7432a641bced807beb1 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -35,7 +35,7 @@ SourceFiles
 #ifndef compressibleMutUWallFunctionFvPatchScalarField_H
 #define compressibleMutUWallFunctionFvPatchScalarField_H
 
-#include "mutkWallFunctionFvPatchScalarField.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -52,7 +52,7 @@ namespace RASModels
 
 class mutUWallFunctionFvPatchScalarField
 :
-    public mutkWallFunctionFvPatchScalarField
+    public mutWallFunctionFvPatchScalarField
 {
 protected:
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000000000000000000000000000000000..6f0dbb1a9fea14a6301e90b90419d237a68f7177
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C
@@ -0,0 +1,191 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "mutWallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "wallFvPatch.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(mutWallFunctionFvPatchScalarField, 0);
+
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+void mutWallFunctionFvPatchScalarField::checkType()
+{
+    if (!isA<wallFvPatch>(patch()))
+    {
+        FatalErrorIn("mutWallFunctionFvPatchScalarField::checkType()")
+            << "Invalid wall function specification" << nl
+            << "    Patch type for patch " << patch().name()
+            << " must be wall" << nl
+            << "    Current patch type is " << patch().type() << nl << endl
+            << abort(FatalError);
+    }
+}
+
+
+void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
+{
+    os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
+    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchScalarField(p, iF),
+    Cmu_(0.09),
+    kappa_(0.41),
+    E_(9.8),
+    yPlusLam_(yPlusLam(kappa_, E_))
+{}
+
+
+mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
+(
+    const mutWallFunctionFvPatchScalarField& ptf,
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const fvPatchFieldMapper& mapper
+)
+:
+    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
+    Cmu_(ptf.Cmu_),
+    kappa_(ptf.kappa_),
+    E_(ptf.E_),
+    yPlusLam_(ptf.yPlusLam_)
+{}
+
+
+mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const dictionary& dict
+)
+:
+    fixedValueFvPatchScalarField(p, iF, dict),
+    Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
+    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
+    E_(dict.lookupOrDefault<scalar>("E", 9.8)),
+    yPlusLam_(yPlusLam(kappa_, E_))
+{}
+
+
+mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
+(
+    const mutWallFunctionFvPatchScalarField& wfpsf
+)
+:
+    fixedValueFvPatchScalarField(wfpsf),
+    Cmu_(wfpsf.Cmu_),
+    kappa_(wfpsf.kappa_),
+    E_(wfpsf.E_),
+    yPlusLam_(wfpsf.yPlusLam_)
+{}
+
+
+mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
+(
+    const mutWallFunctionFvPatchScalarField& wfpsf,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchScalarField(wfpsf, iF),
+    Cmu_(wfpsf.Cmu_),
+    kappa_(wfpsf.kappa_),
+    E_(wfpsf.E_),
+    yPlusLam_(wfpsf.yPlusLam_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+scalar mutWallFunctionFvPatchScalarField::yPlusLam
+(
+    const scalar kappa,
+    const scalar E
+)
+{
+    scalar ypl = 11.0;
+
+    for (int i=0; i<10; i++)
+    {
+        ypl = log(max(E*ypl, 1))/kappa;
+    }
+
+    return ypl;
+}
+
+
+void mutWallFunctionFvPatchScalarField::updateCoeffs()
+{
+    if (updated())
+    {
+        return;
+    }
+
+    operator==(calcMut());
+
+    fixedValueFvPatchScalarField::updateCoeffs();
+}
+
+
+void mutWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+    fvPatchField<scalar>::write(os);
+    writeLocalEntries(os);
+    writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H
similarity index 57%
rename from src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H
rename to src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H
index 95de3d023052554435a3669f01f26fa6ee6ddc8f..ab0478508ff7bacc99b7fe7f67df1a1c2078485a 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -22,19 +22,20 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    alphaSgsWallFunctionFvPatchScalarField
+    Foam::compressible::RASModels::mutWallFunctionFvPatchScalarField
 
 Description
-    Boundary condition for thermal diffusivity when using wall functions
+    Boundary condition for turbulent (kinematic) viscosity when using wall
+    functions, based on turbulence kinetic energy.
     - replicates OpenFOAM v1.5 (and earlier) behaviour
 
 SourceFiles
-    alphaSgsWallFunctionFvPatchScalarField.C
+    mutWallFunctionFvPatchScalarField.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef alphaSgsWallFunctionFvPatchScalarField_H
-#define alphaSgsWallFunctionFvPatchScalarField_H
+#ifndef compressibleMutWallFunctionFvPatchScalarField_H
+#define compressibleMutWallFunctionFvPatchScalarField_H
 
 #include "fixedValueFvPatchFields.H"
 
@@ -44,112 +45,119 @@ namespace Foam
 {
 namespace compressible
 {
-namespace LESModels
+namespace RASModels
 {
 
 /*---------------------------------------------------------------------------*\
-           Class alphaSgsWallFunctionFvPatchScalarField Declaration
+             Class mutWallFunctionFvPatchScalarField Declaration
 \*---------------------------------------------------------------------------*/
 
-class alphaSgsWallFunctionFvPatchScalarField
+class mutWallFunctionFvPatchScalarField
 :
     public fixedValueFvPatchScalarField
 {
-    // Private data
+protected:
 
-        //- Turbulent Prandtl number
-        scalar Prt_;
+    // Protected data
 
+        //- Cmu coefficient
+        scalar Cmu_;
 
-    // Private Member Functions
+        //- Von Karman constant
+        scalar kappa_;
+
+        //- E coefficient
+        scalar E_;
+
+        //- Y+ at the edge of the laminar sublayer
+        scalar yPlusLam_;
+
+
+    // Protected Member Functions
 
         //- Check the type of the patch
-        void checkType();
+        virtual void checkType();
+
+        //- Calculate the turbulence viscosity
+        virtual tmp<scalarField> calcMut() const = 0;
+
+        //- Write local wall function variables
+        virtual void writeLocalEntries(Ostream&) const;
 
 
 public:
 
     //- Runtime type information
-    TypeName("alphaSgsWallFunction");
+    TypeName("mutWallFunction");
 
 
     // Constructors
 
         //- Construct from patch and internal field
-        alphaSgsWallFunctionFvPatchScalarField
+        mutWallFunctionFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&
         );
 
         //- Construct from patch, internal field and dictionary
-        alphaSgsWallFunctionFvPatchScalarField
+        mutWallFunctionFvPatchScalarField
         (
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
             const dictionary&
         );
 
-        //- Construct by mapping given alphaSgsWallFunctionFvPatchScalarField
+        //- Construct by mapping given
+        //  mutWallFunctionFvPatchScalarField
         //  onto a new patch
-        alphaSgsWallFunctionFvPatchScalarField
+        mutWallFunctionFvPatchScalarField
         (
-            const alphaSgsWallFunctionFvPatchScalarField&,
+            const mutWallFunctionFvPatchScalarField&,
             const fvPatch&,
             const DimensionedField<scalar, volMesh>&,
             const fvPatchFieldMapper&
         );
 
         //- Construct as copy
-        alphaSgsWallFunctionFvPatchScalarField
+        mutWallFunctionFvPatchScalarField
         (
-            const alphaSgsWallFunctionFvPatchScalarField&
+            const mutWallFunctionFvPatchScalarField&
         );
 
-        //- Construct and return a clone
-        virtual tmp<fvPatchScalarField> clone() const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new alphaSgsWallFunctionFvPatchScalarField(*this)
-            );
-        }
-
         //- Construct as copy setting internal field reference
-        alphaSgsWallFunctionFvPatchScalarField
+        mutWallFunctionFvPatchScalarField
         (
-            const alphaSgsWallFunctionFvPatchScalarField&,
+            const mutWallFunctionFvPatchScalarField&,
             const DimensionedField<scalar, volMesh>&
         );
 
-        //- Construct and return a clone setting internal field reference
-        virtual tmp<fvPatchScalarField> clone
-        (
-            const DimensionedField<scalar, volMesh>& iF
-        ) const
-        {
-            return tmp<fvPatchScalarField>
-            (
-                new alphaSgsWallFunctionFvPatchScalarField(*this, iF)
-            );
-        }
-
 
     // Member functions
 
+        //- Calculate the Y+ at the edge of the laminar sublayer
+        static scalar yPlusLam(const scalar kappa, const scalar E);
+
+        //- Calculate and return the yPlus at the boundary
+        virtual tmp<scalarField> yPlus() const = 0;
+
+
         // Evaluation functions
 
-            //- Evaluate the patchField
-            virtual void evaluate
-            (
-                const Pstream::commsTypes commsType=Pstream::Pstream::blocking
-            );
+            //- Update the coefficients associated with the patch field
+            virtual void updateCoeffs();
+
+
+        // I-O
+
+            //- Write
+            virtual void write(Ostream&) const;
 };
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-} // End namespace LESModels
+} // End namespace RASModels
 } // End namespace compressible
 } // End namespace Foam
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
index 62458f329b7b643db5901a0ec304f661f8829ce0..cc04471f4fc4ca692f9ccb8d98d0012ab42cb8c7 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,14 +65,16 @@ scalar mutkRoughWallFunctionFvPatchScalarField::fnRough
 
 tmp<scalarField> mutkRoughWallFunctionFvPatchScalarField::calcMut() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const tmp<volScalarField> tk = rasModel.k();
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+
+    const scalarField& y = turbModel.y()[patchi];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const tmp<volScalarField> tk = turbModel.k();
     const volScalarField& k = tk();
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     const scalar Cmu25 = pow025(Cmu_);
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
index 5f303b07218afbd3784cdcba7351264497ac29a9..9aeb96b297e2720547fad2a1f13f246d8d13a34f 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -41,46 +41,16 @@ namespace RASModels
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
-void mutkWallFunctionFvPatchScalarField::checkType()
-{
-    if (!isA<wallFvPatch>(patch()))
-    {
-        FatalErrorIn("mutkWallFunctionFvPatchScalarField::checkType()")
-            << "Invalid wall function specification" << nl
-            << "    Patch type for patch " << patch().name()
-            << " must be wall" << nl
-            << "    Current patch type is " << patch().type() << nl << endl
-            << abort(FatalError);
-    }
-}
-
-
-scalar mutkWallFunctionFvPatchScalarField::calcYPlusLam
-(
-    const scalar kappa,
-    const scalar E
-) const
-{
-    scalar ypl = 11.0;
-
-    for (int i=0; i<10; i++)
-    {
-        ypl = log(E*ypl)/kappa;
-    }
-
-    return ypl;
-}
-
-
 tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
 {
-    const label patchI = patch().index();
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
-    const tmp<volScalarField> tk = rasModel.k();
+    const label patchi = patch().index();
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const scalarField& y = turbModel.y()[patchi];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
+    const tmp<volScalarField> tk = turbModel.k();
     const volScalarField& k = tk();
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
 
     const scalar Cmu25 = pow025(Cmu_);
 
@@ -104,14 +74,6 @@ tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
 }
 
 
-void mutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
-{
-    os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
-    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
-    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
-}
-
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
@@ -120,11 +82,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(p, iF),
-    Cmu_(0.09),
-    kappa_(0.41),
-    E_(9.8),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    mutWallFunctionFvPatchScalarField(p, iF)
 {}
 
 
@@ -136,11 +94,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
-    Cmu_(ptf.Cmu_),
-    kappa_(ptf.kappa_),
-    E_(ptf.E_),
-    yPlusLam_(ptf.yPlusLam_)
+    mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
 {}
 
 
@@ -151,11 +105,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    fixedValueFvPatchScalarField(p, iF, dict),
-    Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
-    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
-    E_(dict.lookupOrDefault<scalar>("E", 9.8)),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    mutWallFunctionFvPatchScalarField(p, iF, dict)
 {}
 
 
@@ -164,11 +114,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
     const mutkWallFunctionFvPatchScalarField& wfpsf
 )
 :
-    fixedValueFvPatchScalarField(wfpsf),
-    Cmu_(wfpsf.Cmu_),
-    kappa_(wfpsf.kappa_),
-    E_(wfpsf.E_),
-    yPlusLam_(wfpsf.yPlusLam_)
+    mutWallFunctionFvPatchScalarField(wfpsf)
 {}
 
 
@@ -178,54 +124,30 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(wfpsf, iF),
-    Cmu_(wfpsf.Cmu_),
-    kappa_(wfpsf.kappa_),
-    E_(wfpsf.E_),
-    yPlusLam_(wfpsf.yPlusLam_)
+    mutWallFunctionFvPatchScalarField(wfpsf, iF)
 {}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-void mutkWallFunctionFvPatchScalarField::updateCoeffs()
-{
-    if (updated())
-    {
-        return;
-    }
-
-    operator==(calcMut());
-
-    fixedValueFvPatchScalarField::updateCoeffs();
-}
-
-
 tmp<scalarField> mutkWallFunctionFvPatchScalarField::yPlus() const
 {
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
-    const scalarField& y = rasModel.y()[patchI];
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
+    const scalarField& y = turbModel.y()[patchi];
 
-    const tmp<volScalarField> tk = rasModel.k();
+    const tmp<volScalarField> tk = turbModel.k();
     const volScalarField& k = tk();
-    const scalarField kwc(k.boundaryField()[patchI].patchInternalField());
-    const scalarField& muw = rasModel.mu().boundaryField()[patchI];
-    const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
+    const scalarField kwc(k.boundaryField()[patchi].patchInternalField());
+    const scalarField& muw = turbModel.mu().boundaryField()[patchi];
+    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
 
     return pow025(Cmu_)*y*sqrt(kwc)/(muw/rhow);
 }
 
 
-void mutkWallFunctionFvPatchScalarField::write(Ostream& os) const
-{
-    fvPatchField<scalar>::write(os);
-    writeLocalEntries(os);
-    writeEntry("value", os);
-}
-
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 makePatchTypeField
@@ -234,6 +156,7 @@ makePatchTypeField
     mutkWallFunctionFvPatchScalarField
 );
 
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace RASModels
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H
index 9a686f8ad617b5d94767cbd300043eb930f97be8..0aa935d59b56bcaddda51cf47c9b35a71eef966f 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -37,7 +37,7 @@ SourceFiles
 #ifndef compressibleMutkWallFunctionFvPatchScalarField_H
 #define compressibleMutkWallFunctionFvPatchScalarField_H
 
-#include "fixedValueFvPatchFields.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -54,39 +54,15 @@ namespace RASModels
 
 class mutkWallFunctionFvPatchScalarField
 :
-    public fixedValueFvPatchScalarField
+    public mutWallFunctionFvPatchScalarField
 {
 protected:
 
-    // Protected data
-
-        //- Cmu coefficient
-        scalar Cmu_;
-
-        //- Von Karman constant
-        scalar kappa_;
-
-        //- E coefficient
-        scalar E_;
-
-        //- Y+ at the edge of the laminar sublayer
-        scalar yPlusLam_;
-
-
     // Protected Member Functions
 
-        //- Check the type of the patch
-        virtual void checkType();
-
-        //- Calculate the Y+ at the edge of the laminar sublayer
-        virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
-
         //- Calculate the turbulence viscosity
         virtual tmp<scalarField> calcMut() const;
 
-        //- Write local wall function variables
-        virtual void writeLocalEntries(Ostream&) const;
-
 
 public:
 
@@ -163,15 +139,6 @@ public:
 
             //- Calculate and return the yPlus at the boundary
             virtual tmp<scalarField> yPlus() const;
-
-            //- Update the coefficients associated with the patch field
-            virtual void updateCoeffs();
-
-
-        // I-O
-
-            //- Write
-            virtual void write(Ostream&) const;
 };
 
 
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index c8f5085445df3b9ac23abd2cf75fb6bff0a434b2..3fb0f1c36b3d55dfba0617c492208681949cebb9 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -28,6 +28,7 @@ License
 #include "fvPatchFieldMapper.H"
 #include "volFields.H"
 #include "addToRunTimeSelectionTable.H"
+#include "mutWallFunctionFvPatchScalarField.H"
 #include "wallFvPatch.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -55,23 +56,6 @@ void omegaWallFunctionFvPatchScalarField::checkType()
 }
 
 
-scalar omegaWallFunctionFvPatchScalarField::calcYPlusLam
-(
-    const scalar kappa,
-    const scalar E
-) const
-{
-    scalar ypl = 11.0;
-
-    for (int i=0; i<10; i++)
-    {
-        ypl = log(E*ypl)/kappa;
-    }
-
-    return ypl;
-}
-
-
 void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
 {
     writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
@@ -96,7 +80,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
     kappa_(0.41),
     E_(9.8),
     beta1_(0.075),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
 
 {
     checkType();
@@ -136,7 +120,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
     kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
     E_(dict.lookupOrDefault<scalar>("E", 9.8)),
     beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)),
-    yPlusLam_(calcYPlusLam(kappa_, E_))
+    yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
 {
     checkType();
 }
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H
index 64faf11f645389793888126ed05ff32c4aa54483..db1b91b68814df0e40b7baaf9865d8cc834f3636 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -98,9 +98,6 @@ protected:
         //- Check the type of the patch
         virtual void checkType();
 
-        //- Calculate the Y+ at the edge of the laminar sublayer
-        virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
-
         //- Write local wall function variables
         virtual void writeLocalEntries(Ostream&) const;
 
diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
index 2cae3dee6d7c0f5e609602a70b7c3e8a44889c01..3579d15b6b8281ec2f85ef53e76afe4dfc5bca30 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
+++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
@@ -98,8 +98,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
                     "turbulenceModel"
                 );
 
-            return
-                model.kappaEff(patch_.index());
+            return model.kappaEff(patch_.index());
         }
         break;
 
@@ -116,23 +115,25 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
 
         case DIRECTIONALSOLIDTHERMO:
         {
-            const vectorField n(patch_.nf());
-
             const solidThermo& thermo =
                 mesh.lookupObject<solidThermo>
                 (
-                    "solidThermophysicalProperties"
+                    "thermophysicalProperties"
                 );
-//          note  SAF : Temporarily!
-            //return n & thermo.Kappa(patch_.index()) & n;
-              /*
-              scalarField isoK =
-                    (thermo.Kappa(patch_.index())[0] +
-                     thermo.Kappa(patch_.index())[1] +
-                     thermo.Kappa(patch_.index())[2]) / 3.0;
-               */
-
-              return scalarField(0);
+
+            tmp<scalarField> tmeanKappa(Tp);
+            scalarField& meanKappa = tmeanKappa();
+            forAll(meanKappa, i)
+            {
+                meanKappa[i] =
+                (
+                    thermo.Kappa(patch_.index())()[i].x()
+                  + thermo.Kappa(patch_.index())()[i].y()
+                  + thermo.Kappa(patch_.index())()[i].z()
+                )/3.0;
+            }
+
+            return meanKappa;
         }
         break;
 
diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C
index 6d998d74a442c39625226ace7aab24d75e862b37..111cd2a5369ecd549fc181da603926b2f02aeeb6 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C
+++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -68,7 +68,9 @@ turbulenceModel::turbulenceModel
     rho_(rho),
     U_(U),
     phi_(phi),
-    thermophysicalModel_(thermophysicalModel)
+    thermophysicalModel_(thermophysicalModel),
+
+    y_(mesh_)
 {}
 
 
@@ -137,7 +139,12 @@ tmp<volScalarField> turbulenceModel::rhoEpsilonEff() const
 
 
 void turbulenceModel::correct()
-{}
+{
+    if (mesh_.changing())
+    {
+        y_.correct();
+    }
+}
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H
index 464b70d85ec6da53dab01562335daaebe32d05af..790e6e99e44a02a7669c2a9050e2c89f1478b50d 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H
+++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H
@@ -49,6 +49,7 @@ SourceFiles
 #include "surfaceFieldsFwd.H"
 #include "fvMatricesFwd.H"
 #include "basicThermo.H"
+#include "nearWallDist.H"
 #include "autoPtr.H"
 #include "runTimeSelectionTables.H"
 
@@ -85,6 +86,9 @@ protected:
 
         const basicThermo& thermophysicalModel_;
 
+        //- Near wall distance boundary field
+        nearWallDist y_;
+
 
 private:
 
@@ -178,6 +182,12 @@ public:
              return thermophysicalModel_;
         }
 
+        //- Return the near wall distances
+        const nearWallDist& y() const
+        {
+            return y_;
+        }
+
         //- Return the laminar viscosity
         const volScalarField& mu() const
         {
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
index 59ab80e4fe712a1b226cb242309ff872178799fb..c5a2c5f8e8a6447359b44d9e00c0555aec3ee042 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -106,11 +106,12 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
         return;
     }
 
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
 
-    const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
 
     const vectorField Ui(Uw.patchInternalField());
 
@@ -118,9 +119,9 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
 
     const scalarField& ry = patch().deltaCoeffs();
 
-    tmp<volScalarField> tnuEff = rasModel.nuEff();
+    tmp<volScalarField> tnuEff = turbModel.nuEff();
     const volScalarField& nuEff = tnuEff();
-    const scalarField& nuEffw = nuEff.boundaryField()[patchI];
+    const scalarField& nuEffw = nuEff.boundaryField()[patchi];
 
     tmp<vectorField> UwUpdated =
         tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
@@ -130,8 +131,8 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
     if (debug)
     {
         tmp<vectorField> nHat = this->patch().nf();
-        volSymmTensorField Reff(rasModel.devReff());
-        Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl;
+        volSymmTensorField Reff(turbModel.devReff());
+        Info << "tau : " << (nHat & Reff.boundaryField()[patchi])() << endl;
     }
 
     fixedValueFvPatchVectorField::updateCoeffs();
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
index 917c65ca5f0beab8a0a8d8e2ab6d310a8609091a..a87f31144164c263e2e0eb6865514080a69b0322 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -201,21 +201,22 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
         return;
     }
 
-    const label patchI = patch().index();
+    const label patchi = patch().index();
 
     // Retrieve turbulence properties from model
-    const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
+    const turbulenceModel& turbModel =
+        db().lookupObject<turbulenceModel>("turbulenceModel");
     const scalar Cmu25 = pow(Cmu_, 0.25);
-    const scalarField& y = rasModel.y()[patchI];
-    const tmp<volScalarField> tnu = rasModel.nu();
+    const scalarField& y = turbModel.y()[patchi];
+    const tmp<volScalarField> tnu = turbModel.nu();
     const volScalarField& nu = tnu();
-    const scalarField& nuw = nu.boundaryField()[patchI];
-    const tmp<volScalarField> tk = rasModel.k();
+    const scalarField& nuw = nu.boundaryField()[patchi];
+    const tmp<volScalarField> tk = turbModel.k();
     const volScalarField& k = tk();
 
     // Molecular Prandtl number
     const scalar
-        Pr(dimensionedScalar(rasModel.transport().lookup("Pr")).value());
+        Pr(dimensionedScalar(turbModel.transport().lookup("Pr")).value());
 
     // Populate boundary values
     scalarField& kappatw = *this;
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C
index 065270eea67dc38ff766717190e4522bc9431104..c23aea5551d9c13e99025834358d851a1ba084de 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C
@@ -39,6 +39,11 @@ namespace incompressible
 namespace RASModels
 {
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0);
+
+
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
 void nutWallFunctionFvPatchScalarField::checkType()
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
index eabc768d86238c46b3f296e62a2bb24f4b28aa19..afbd1548d15fb7e38b4c494a56b92feb12dff40c 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
@@ -41,20 +41,6 @@ namespace RASModels
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
-void nutkWallFunctionFvPatchScalarField::checkType()
-{
-    if (!isA<wallFvPatch>(patch()))
-    {
-        FatalErrorIn("nutkWallFunctionFvPatchScalarField::checkType()")
-            << "Invalid wall function specification" << nl
-            << "    Patch type for patch " << patch().name()
-            << " must be wall" << nl
-            << "    Current patch type is " << patch().type() << nl << endl
-            << abort(FatalError);
-    }
-}
-
-
 tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
 {
     const label patchi = patch().index();
@@ -89,14 +75,6 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
 }
 
 
-void nutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
-{
-    os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
-    os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
-    os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
-}
-
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
@@ -105,14 +83,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(p, iF),
-    Cmu_(0.09),
-    kappa_(0.41),
-    E_(9.8),
-    yPlusLam_(yPlusLam(kappa_, E_))
-{
-    checkType();
-}
+    nutWallFunctionFvPatchScalarField(p, iF)
+{}
 
 
 nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
@@ -123,14 +95,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
     const fvPatchFieldMapper& mapper
 )
 :
-    fixedValueFvPatchScalarField(ptf, p, iF, mapper),
-    Cmu_(ptf.Cmu_),
-    kappa_(ptf.kappa_),
-    E_(ptf.E_),
-    yPlusLam_(ptf.yPlusLam_)
-{
-    checkType();
-}
+    nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
+{}
 
 
 nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
@@ -140,14 +106,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
     const dictionary& dict
 )
 :
-    fixedValueFvPatchScalarField(p, iF, dict),
-    Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
-    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
-    E_(dict.lookupOrDefault<scalar>("E", 9.8)),
-    yPlusLam_(yPlusLam(kappa_, E_))
-{
-    checkType();
-}
+    nutWallFunctionFvPatchScalarField(p, iF, dict)
+{}
 
 
 nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
@@ -155,14 +115,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
     const nutkWallFunctionFvPatchScalarField& wfpsf
 )
 :
-    fixedValueFvPatchScalarField(wfpsf),
-    Cmu_(wfpsf.Cmu_),
-    kappa_(wfpsf.kappa_),
-    E_(wfpsf.E_),
-    yPlusLam_(wfpsf.yPlusLam_)
-{
-    checkType();
-}
+    nutWallFunctionFvPatchScalarField(wfpsf)
+{}
 
 
 nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
@@ -171,48 +125,12 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
     const DimensionedField<scalar, volMesh>& iF
 )
 :
-    fixedValueFvPatchScalarField(wfpsf, iF),
-    Cmu_(wfpsf.Cmu_),
-    kappa_(wfpsf.kappa_),
-    E_(wfpsf.E_),
-    yPlusLam_(wfpsf.yPlusLam_)
-{
-    checkType();
-}
+    nutWallFunctionFvPatchScalarField(wfpsf, iF)
+{}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-scalar nutkWallFunctionFvPatchScalarField::yPlusLam
-(
-    const scalar kappa,
-    const scalar E
-)
-{
-    scalar ypl = 11.0;
-
-    for (int i=0; i<10; i++)
-    {
-        ypl = log(max(E*ypl, 1))/kappa;
-    }
-
-    return ypl;
-}
-
-
-void nutkWallFunctionFvPatchScalarField::updateCoeffs()
-{
-    if (updated())
-    {
-        return;
-    }
-
-    operator==(calcNut());
-
-    fixedValueFvPatchScalarField::updateCoeffs();
-}
-
-
 tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
 {
     const label patchi = patch().index();
@@ -232,14 +150,6 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
 }
 
 
-void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const
-{
-    fvPatchField<scalar>::write(os);
-    writeLocalEntries(os);
-    writeEntry("value", os);
-}
-
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 makePatchTypeField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H
index 8b4b181c2077f3dadd280cb23b9438a8535c968c..d4ffd6167a03d7a4b1dc29b9097a115d59aafc60 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H
@@ -37,7 +37,7 @@ SourceFiles
 #ifndef nutkWallFunctionFvPatchScalarField_H
 #define nutkWallFunctionFvPatchScalarField_H
 
-#include "fixedValueFvPatchFields.H"
+#include "nutWallFunctionFvPatchScalarField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -54,36 +54,15 @@ namespace RASModels
 
 class nutkWallFunctionFvPatchScalarField
 :
-    public fixedValueFvPatchScalarField
+    public nutWallFunctionFvPatchScalarField
 {
 protected:
 
-    // Protected data
-
-        //- Cmu coefficient
-        scalar Cmu_;
-
-        //- Von Karman constant
-        scalar kappa_;
-
-        //- E coefficient
-        scalar E_;
-
-        //- Y+ at the edge of the laminar sublayer
-        scalar yPlusLam_;
-
-
     // Protected Member Functions
 
-        //- Check the type of the patch
-        virtual void checkType();
-
         //- Calculate the turbulence viscosity
         virtual tmp<scalarField> calcNut() const;
 
-        //- Write local wall function variables
-        virtual void writeLocalEntries(Ostream&) const;
-
 
 public:
 
@@ -156,23 +135,8 @@ public:
 
     // Member functions
 
-        //- Calculate the Y+ at the edge of the laminar sublayer
-        static scalar yPlusLam(const scalar kappa, const scalar E);
-
-
-        // Evaluation functions
-
-            //- Calculate and return the yPlus at the boundary
-            virtual tmp<scalarField> yPlus() const;
-
-            //- Update the coefficients associated with the patch field
-            virtual void updateCoeffs();
-
-
-        // I-O
-
-            //- Write
-            virtual void write(Ostream&) const;
+        //- Calculate and return the yPlus at the boundary
+        virtual tmp<scalarField> yPlus() const;
 };
 
 
diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs b/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs
index 16b4384a8e4d782f4b00fe59820b5f0fd29799d1..c417948180611ece6dd697ac08455a49d3c34da8 100644
--- a/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs
+++ b/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs
@@ -32,14 +32,14 @@ boundaryField
 
     upperWall
     {
-        type            alphaSgsJayatillekeWallFunction;
+        type            alphatJayatillekeWallFunction;
         he              ha;
         value           uniform 0;
     }
 
     lowerWall
     {
-        type            alphaSgsJayatillekeWallFunction;
+        type            alphatJayatillekeWallFunction;
         he              ha;
         value           uniform 0;
     }
diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/0/muSgs b/tutorials/combustion/XiFoam/les/pitzDaily/0/muSgs
index a6e489dcf1df0296b1a382845251e96ba98d1b62..cec3a41ed65ddcb0052cfdb2014c2f1eed21043d 100644
--- a/tutorials/combustion/XiFoam/les/pitzDaily/0/muSgs
+++ b/tutorials/combustion/XiFoam/les/pitzDaily/0/muSgs
@@ -32,13 +32,13 @@ boundaryField
 
     upperWall
     {
-        type            muSgsUSpaldingWallFunction;
+        type            mutUSpaldingWallFunction;
         value           uniform 0;
     }
 
     lowerWall
     {
-        type            muSgsUSpaldingWallFunction;
+        type            mutUSpaldingWallFunction;
         value           uniform 0;
     }
 
diff --git a/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs
index 1a913f8b784e83f2d845ec0cdd61d03febd0cbc1..07d5fba6deb5e2e2868c4dadc5e7296163c325a7 100644
--- a/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs
+++ b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs
@@ -31,13 +31,13 @@ boundaryField
     }
     upperWall
     {
-        type            alphaSgsJayatillekeWallFunction;
+        type            alphatJayatillekeWallFunction;
         he              ha;
         value           uniform 0;
     }
     lowerWall
     {
-        type            alphaSgsJayatillekeWallFunction;
+        type            alphatJayatillekeWallFunction;
         he              ha;
         value           uniform 0;
     }
diff --git a/tutorials/combustion/XiFoam/les/pitzDaily3D/0/muSgs b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/muSgs
index 127f76d8cbdf6df42e964a0a7ff3cd75637734f2..684139326dd45482f51976aa674b92703b4e5b39 100644
--- a/tutorials/combustion/XiFoam/les/pitzDaily3D/0/muSgs
+++ b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/muSgs
@@ -31,12 +31,12 @@ boundaryField
     }
     upperWall
     {
-        type            muSgsUSpaldingWallFunction;
+        type            mutUSpaldingWallFunction;
         value           uniform 0;
     }
     lowerWall
     {
-        type            muSgsUSpaldingWallFunction;
+        type            mutUSpaldingWallFunction;
         value           uniform 0;
     }
     front
diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/alphaSgs b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/alphaSgs
index 4da8c755f205b9405d30b2beaf03c64d522c3c74..f50fb4a4811acc8bb419841df6b4892266e0cf5c 100644
--- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/alphaSgs
+++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/alphaSgs
@@ -23,7 +23,7 @@ boundaryField
 {
     ground
     {
-        type        alphaSgsWallFunction;
+        type        alphatWallFunction;
         value       uniform 0;
     }
 
@@ -44,7 +44,7 @@ boundaryField
 
     "(region0_to.*)"
     {
-        type        alphaSgsWallFunction;
+        type        alphatWallFunction;
         value       uniform 0;
     }
 }
diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/muSgs b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/muSgs
index 16cb59208153367ab36345fb5ced7dd5334539fa..cf1d5513646262a7ddf209706ffa07d9f9d5a83f 100644
--- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/muSgs
+++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/muSgs
@@ -43,7 +43,7 @@ boundaryField
 
     "(region0_to.*)"
     {
-        type            muSgsUSpaldingWallFunction;
+        type            mutUSpaldingWallFunction;
         value           uniform 0;
     }
 }
diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/controlDict b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/controlDict
index 61994e8d833cd5ffb9bc85559e68d73b0b49a682..53c9826a9b9a59f5db2a3767088a8fb4ab919271 100644
--- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/controlDict
+++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/controlDict
@@ -28,7 +28,7 @@ deltaT          0.03;
 
 writeControl    adjustableRunTime;
 
-writeInterval   0.03;
+writeInterval   0.5;
 
 purgeWrite      0;
 
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/0.org/htcConv b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/0.org/htcConv
index 4546c74039a328974626f43ae3ebd8129106fe08..d1baf0bd3791ccd72999dac6b3313887a7e56cb7 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/0.org/htcConv
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/0.org/htcConv
@@ -28,7 +28,7 @@ boundaryField
     }
     wallFilm
     {
-        type            htcConvection;
+        type            convectiveHeatTransfer;
         L               1.0;
         value           uniform 0;
     }