diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C index 73c0d2397a3a1b9b4ce9f26aed4b042058ff0046..41063cd2cd9ceab0c265ad068e8223471ed21427 100644 --- a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C +++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -49,7 +49,7 @@ void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K) muSgs_ = ck_*rho()*sqrt(K)*delta(); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C index 150e7f10cf9a42a082ebc4e19713d1e40aeb2ef2..055c76214e814589ba1dd8c461a0d6f6c53810d3 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C @@ -60,6 +60,16 @@ GenEddyVisc::GenEddyVisc ) ), + Prt_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Prt", + coeffDict_, + 1.0 + ) + ), + k_ ( IOobject @@ -135,6 +145,7 @@ bool GenEddyVisc::read() if (LESModel::read()) { ce_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); return true; } diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H index 41fd37066cd471b4efbbcc11bcd24e78b9118819..440ec71c5c9b40bb88176ee3f11aeba2af77a208 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -68,7 +68,13 @@ class GenEddyVisc protected: + // Model coefficients + dimensionedScalar ce_; + dimensionedScalar Prt_; + + + // Fields volScalarField k_; volScalarField muSgs_; diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C index 8c6ea7afea6d1b6ce366b903747a3ebab4b03bfc..1f4e57552739e65b30524ec0eb769148bd214781 100644 --- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C @@ -64,6 +64,16 @@ GenSGSStress::GenSGSStress ) ), + Prt_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Prt", + coeffDict_, + 1.0 + ) + ), + B_ ( IOobject diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H index 07ca666a2f2ba2c6f07db9129b3c9e7a94e4a8fb..ff71c80b798a20792b90ff3e568197c80e059ce9 100644 --- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H @@ -69,7 +69,12 @@ class GenSGSStress protected: + // Model coefficients + dimensionedScalar ce_; + dimensionedScalar Prt_; + + // Fields volSymmTensorField B_; volScalarField muSgs_; diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C index 7301318b160fa59f9107660b2d1964e21fed38f4..5602e44d7f8ea3b6e3e8746b53085b2d7faa2315 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -81,45 +81,7 @@ LESModel::LESModel k0_("k0", dimVelocity*dimVelocity, SMALL), - delta_(LESdelta::New("delta", U.mesh(), *this)), - - wallFunctionDict_(subDictPtr("wallFunctionCoeffs")), - kappa_ - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "kappa", - wallFunctionDict_, - 0.4187 - ) - ), - E_ - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "E", - wallFunctionDict_, - 9.0 - ) - ), - Cmu_ - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "Cmu", - wallFunctionDict_, - 0.07 - ) - ), - Prt_ - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "Prt", - wallFunctionDict_, - 0.85 - ) - ) + delta_(LESdelta::New("delta", U.mesh(), *this)) { readIfPresent("k0", k0_); } @@ -201,20 +163,10 @@ bool LESModel::read() coeffDict_ <<= *dictPtr; } - if (const dictionary* dictPtr = subDictPtr("wallFunctionCoeffs")) - { - wallFunctionDict_ <<= *dictPtr; - } - readIfPresent("k0", k0_); delta_().read(*this); - kappa_.readIfPresent(wallFunctionDict_); - E_.readIfPresent(wallFunctionDict_); - Cmu_.readIfPresent(wallFunctionDict_); - Prt_.readIfPresent(wallFunctionDict_); - return true; } else diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index 3012b4124ac1bdb5b3138af153f4debdd600e6c2..cf019ea9a8aca9b93a709e94507a74c08a9ef6c1 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -87,19 +87,6 @@ protected: autoPtr<LESdelta> delta_; - // Wall function properties - - //- Wall function dictionary - dictionary wallFunctionDict_; - - dimensionedScalar kappa_; - - dimensionedScalar E_; - - dimensionedScalar Cmu_; - - dimensionedScalar Prt_; - // Protected Member Functions @@ -173,55 +160,34 @@ public: // Member Functions - //- Const access to the coefficients dictionary, - // which provides info. about choice of models, - // and all related data (particularly model coefficients). - inline const dictionary& coeffDict() const - { - return coeffDict_; - } - - //- Return the value of k0 which k is not allowed to be less than - const dimensionedScalar& k0() const - { - return k0_; - } - - //- Allow k0 to be changed - dimensionedScalar& k0() - { - return k0_; - } + // Access - //- Access function to filter width - inline const volScalarField& delta() const - { - return delta_(); - } + //- Const access to the coefficients dictionary, + // which provides info. about choice of models, + // and all related data (particularly model coefficients). + inline const dictionary& coeffDict() const + { + return coeffDict_; + } - //- Return kappa for use in wall-functions - dimensionedScalar kappa() const - { - return kappa_; - } + //- Return the value of k0 which k is not allowed to be less than + const dimensionedScalar& k0() const + { + return k0_; + } - //- Return E for use in wall-functions - dimensionedScalar E() const - { - return E_; - } + //- Allow k0 to be changed + dimensionedScalar& k0() + { + return k0_; + } - //- Return Cmu for use in wall-functions - dimensionedScalar Cmu() const - { - return Cmu_; - } + //- Access function to filter width + inline const volScalarField& delta() const + { + return delta_(); + } - //- Return turbulent Prandtl number for use in wall-functions - dimensionedScalar Prt() const - { - return Prt_; - } //- Return the SGS turbulent kinetic energy. virtual tmp<volScalarField> k() const = 0; diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C index e5787ab8163589bd2663e454f6eba97fea63a61d..514ad301fff1706adf3b5afd0e1fd0fd2e15808c 100644 --- a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C @@ -57,7 +57,7 @@ void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU) muSgs_ = ck_*rho()*delta()*sqrt(k_); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C index a3b75dc5290004aa8f62ad3b7dba62c2892b001d..bb74a41f8cf9be402950192e89b9c2deb7d33a38 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -50,7 +50,7 @@ void SpalartAllmaras::updateSubGridScaleFields() muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField(); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } @@ -112,13 +112,22 @@ SpalartAllmaras::SpalartAllmaras : LESModel(typeName, rho, U, phi, thermoPhysicalModel), - alphaNut_ + sigmaNut_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaNut", + "sigmaNut", coeffDict_, - 1.5 + 0.66666 + ) + ), + Prt_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Prt", + coeffDict_, + 1.0 ) ), @@ -185,7 +194,7 @@ SpalartAllmaras::SpalartAllmaras 0.4187 ) ), - Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), Cw2_ ( dimensioned<scalar>::lookupOrAddToDict @@ -299,11 +308,11 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU) + fvm::div(phi(), nuTilda_) - fvm::laplacian ( - alphaNut_*(nuTilda_*rho() + mu()), + (nuTilda_*rho() + mu())/sigmaNut_, nuTilda_, "laplacian(DnuTildaEff,nuTilda)" ) - - alphaNut_*rho()*Cb2_*magSqr(fvc::grad(nuTilda_)) + - rho()*Cb2_/sigmaNut_*magSqr(fvc::grad(nuTilda_)) == rho()*Cb1_*Stilda*nuTilda_ - fvm::Sp(rho()*Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_) @@ -320,10 +329,11 @@ bool SpalartAllmaras::read() { if (LESModel::read()) { - alphaNut_.readIfPresent(coeffDict()); + sigmaNut_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict()); - Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); + Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_; Cw2_.readIfPresent(coeffDict()); Cw3_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H index 9d5fa78d642ef7eed646869dc67cfddd53c7e597..e6239ec91bc623240c124f128a8697110a4b6a8c 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -58,18 +58,29 @@ class SpalartAllmaras { // Private data - dimensionedScalar alphaNut_; + // Model coefficients - dimensionedScalar Cb1_; - dimensionedScalar Cb2_; - dimensionedScalar Cv1_; - dimensionedScalar Cv2_; - dimensionedScalar CDES_; - dimensionedScalar ck_; - dimensionedScalar kappa_; - dimensionedScalar Cw1_; - dimensionedScalar Cw2_; - dimensionedScalar Cw3_; + dimensionedScalar sigmaNut_; + dimensionedScalar Prt_; + + dimensionedScalar Cb1_; + dimensionedScalar Cb2_; + dimensionedScalar Cv1_; + dimensionedScalar Cv2_; + dimensionedScalar CDES_; + dimensionedScalar ck_; + dimensionedScalar kappa_; + dimensionedScalar Cw1_; + dimensionedScalar Cw2_; + dimensionedScalar Cw3_; + + + // Fields + + volScalarField nuTilda_; + volScalarField dTilda_; + volScalarField muSgs_; + volScalarField alphaSgs_; // Private member functions @@ -86,11 +97,6 @@ class SpalartAllmaras SpalartAllmaras(const SpalartAllmaras&); SpalartAllmaras& operator=(const SpalartAllmaras&); - volScalarField nuTilda_; - volScalarField dTilda_; - volScalarField muSgs_; - volScalarField alphaSgs_; - public: diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C index b868d8baa50f808a025e83358dcb516477053ce9..61a1f6428838cb1910f828284639b61f33afa0fa 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,17 +75,15 @@ scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::Psmooth scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::yPlusTherm ( const scalar P, - const scalar Prat, - const scalar E, - const scalar kappa + const scalar Prat ) const { scalar ypt = 11.0; for (int i=0; i<maxIters_; i++) { - scalar f = ypt - (log(E*ypt)/kappa + P)/Prat; - scalar df = 1.0 - 1.0/(ypt*kappa*Prat); + scalar f = ypt - (log(E_*ypt)/kappa_ + P)/Prat; + scalar df = 1.0 - 1.0/(ypt*kappa_*Prat); scalar yptNew = ypt - f/df; if (yptNew < VSMALL) @@ -115,7 +113,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + Prt_(0.85), + kappa_(0.41), + E_(9.0) { checkType(); } @@ -130,7 +131,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + Prt_(ptf.Prt_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -142,7 +146,10 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) { checkType(); } @@ -151,10 +158,13 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField alphaSgsJayatillekeWallFunctionFvPatchScalarField:: alphaSgsJayatillekeWallFunctionFvPatchScalarField ( - const alphaSgsJayatillekeWallFunctionFvPatchScalarField& tppsf + const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(awfpsf), + Prt_(awfpsf.Prt_), + kappa_(awfpsf.kappa_), + E_(awfpsf.E_) { checkType(); } @@ -163,11 +173,14 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField alphaSgsJayatillekeWallFunctionFvPatchScalarField:: alphaSgsJayatillekeWallFunctionFvPatchScalarField ( - const alphaSgsJayatillekeWallFunctionFvPatchScalarField& tppsf, + const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf, const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(awfpsf, iF), + Prt_(awfpsf.Prt_), + kappa_(awfpsf.kappa_), + E_(awfpsf.E_) { checkType(); } @@ -182,11 +195,6 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate { const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties"); - // Wall function constants - const scalar E = lesModel.E().value(); - const scalar kappa = lesModel.kappa().value(); - const scalar Prt = lesModel.Prt().value(); - // Field data const label patchI = patch().index(); @@ -223,18 +231,18 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate do { - scalar kUu = min(kappa*magUp[faceI]/uTau, maxExp_); + scalar kUu = min(kappa_*magUp[faceI]/uTau, maxExp_); scalar fkUu = exp(kUu) - 1.0 - kUu*(1.0 + 0.5*kUu); scalar f = - uTau/(ry[faceI]*muw[faceI]/rhow[faceI]) + magUp[faceI]/uTau - + 1.0/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + 1.0/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = - 1.0/(ry[faceI]*muw[faceI]/rhow[faceI]) - magUp[faceI]/sqr(uTau) - - 1.0/E*kUu*fkUu/uTau; + - 1.0/E_*kUu*fkUu/uTau; scalar uTauNew = uTau - f/df; err = mag((uTau - uTauNew)/uTau); @@ -248,11 +256,11 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate scalar Pr = muw[faceI]/alphaw[faceI]; // Molecular-to-turbulenbt Prandtl number ratio - scalar Prat = Pr/Prt; + scalar Prat = Pr/Prt_; // Thermal sublayer thickness scalar P = Psmooth(Prat); - scalar yPlusTherm = this->yPlusTherm(P, Prat, E, kappa); + scalar yPlusTherm = this->yPlusTherm(P, Prat); // Evaluate new effective thermal diffusivity scalar alphaEff = 0.0; @@ -266,11 +274,11 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate else { scalar A = qDot[faceI]*rhow[faceI]*uTau/ry[faceI]; - scalar B = qDot[faceI]*Prt*(1.0/kappa*log(E*yPlus) + P); - scalar magUc = uTau/kappa*log(E*yPlusTherm) - mag(Uw[faceI]); + scalar B = qDot[faceI]*Prt_*(1.0/kappa_*log(E_*yPlus) + P); + scalar magUc = uTau/kappa_*log(E_*yPlusTherm) - mag(Uw[faceI]); scalar C = 0.5*rhow[faceI]*uTau - *(Prt*sqr(magUp[faceI]) + (Pr - Prt)*sqr(magUc)); + *(Prt_*sqr(magUp[faceI]) + (Pr - Prt_)*sqr(magUc)); alphaEff = A/(B + C + VSMALL); } @@ -281,7 +289,7 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate { Info<< " uTau = " << uTau << nl << " Pr = " << Pr << nl - << " Prt = " << Prt << nl + << " Prt = " << Prt_ << nl << " qDot = " << qDot[faceI] << nl << " yPlus = " << yPlus << nl << " yPlusTherm = " << yPlusTherm << nl @@ -299,6 +307,16 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate } +void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H index 09bb27059e1b57f9d215aa4eae76771edda2b90e..e7f6184d814f6633342b290164b19d523abb5faf 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,9 +58,21 @@ class alphaSgsJayatillekeWallFunctionFvPatchScalarField { // Private data - static scalar maxExp_; - static scalar tolerance_; - static label maxIters_; + //- Turbulent Prandtl number + scalar Prt_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + + // Solution parameters + + static scalar maxExp_; + static scalar tolerance_; + static label maxIters_; // Private member functions @@ -75,9 +87,7 @@ class alphaSgsJayatillekeWallFunctionFvPatchScalarField scalar yPlusTherm ( const scalar P, - const scalar Prat, - const scalar E, - const scalar kappa + const scalar Prat ) const; @@ -163,6 +173,12 @@ public: ( const Pstream::commsTypes commsType=Pstream::Pstream::blocking ); + + + // I-O + + //- Write + void write(Ostream&) const; }; diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C index 5d59e7f6d774d9dfe8b3f35bd69e4a6677be8a6a..f2c944220a2189081b26ea953c06adbca04362dd 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C @@ -66,7 +66,8 @@ alphaSgsWallFunctionFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + Prt_(0.85) { checkType(); } @@ -81,7 +82,8 @@ alphaSgsWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + Prt_(ptf.Prt_) {} @@ -93,7 +95,8 @@ alphaSgsWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)) { checkType(); } @@ -102,10 +105,11 @@ alphaSgsWallFunctionFvPatchScalarField alphaSgsWallFunctionFvPatchScalarField:: alphaSgsWallFunctionFvPatchScalarField ( - const alphaSgsWallFunctionFvPatchScalarField& tppsf + const alphaSgsWallFunctionFvPatchScalarField& awfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(awfpsf), + Prt_(awfpsf.Prt_) { checkType(); } @@ -114,11 +118,13 @@ alphaSgsWallFunctionFvPatchScalarField alphaSgsWallFunctionFvPatchScalarField:: alphaSgsWallFunctionFvPatchScalarField ( - const alphaSgsWallFunctionFvPatchScalarField& tppsf, + const alphaSgsWallFunctionFvPatchScalarField& awfpsf, const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(awfpsf, iF), + Prt_(awfpsf.Prt_) + { checkType(); } @@ -133,14 +139,10 @@ void alphaSgsWallFunctionFvPatchScalarField::evaluate { const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties"); - // Turbulent Prandtl number - const scalar Prt = lesModel.Prt().value(); - - // Get the turbulent viscosity at the wall const scalarField muSgsw = lesModel.muSgs()().boundaryField()[patch().index()]; - operator==(muSgsw/Prt); + operator==(muSgsw/Prt_); } diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H index e5e200d2b51d2e80807e526fbef648550323edf3..fb738498e754196eeb85dddc1628ce2ef86b6621 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.H @@ -56,6 +56,12 @@ class alphaSgsWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + // Private data + + //- Turbulent Prandtl number + scalar Prt_; + + // Private member functions //- Check the type of the patch diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C index a0268ea59f892e3c23c09b567c8f04d1eb4e131a..143b989ede245bcf26f4b76bbf6d0eecdf499efc 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C @@ -50,7 +50,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_("U"), rhoName_("rho"), - muName_("mu") + muName_("mu"), + kappa_(0.41), + E_(9.0) {} @@ -65,7 +67,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), rhoName_(ptf.rhoName_), - muName_(ptf.muName_) + muName_(ptf.muName_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -79,7 +83,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault<word>("U", "U")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")), - muName_(dict.lookupOrDefault<word>("mu", "mu")) + muName_(dict.lookupOrDefault<word>("mu", "mu")), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) {} @@ -91,7 +97,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(mwfpsf), UName_(mwfpsf.UName_), rhoName_(mwfpsf.rhoName_), - muName_(mwfpsf.muName_) + muName_(mwfpsf.muName_), + kappa_(mwfpsf.kappa_), + E_(mwfpsf.E_) {} @@ -104,7 +112,9 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(mwfpsf, iF), UName_(mwfpsf.UName_), rhoName_(mwfpsf.rhoName_), - muName_(mwfpsf.muName_) + muName_(mwfpsf.muName_), + kappa_(mwfpsf.kappa_), + E_(mwfpsf.E_) {} @@ -115,11 +125,6 @@ void muSgsWallFunctionFvPatchScalarField::evaluate const Pstream::commsTypes ) { - const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties"); - - const scalar kappa = lesModel.kappa().value(); - const scalar E = lesModel.E().value(); - const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = @@ -151,18 +156,18 @@ void muSgsWallFunctionFvPatchScalarField::evaluate do { - scalar kUu = kappa*magUpara/utau; + scalar kUu = kappa_*magUpara/utau; scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - utau/(ry[facei]*muw[facei]/rhow[facei]) + magUpara/utau - + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = - 1.0/(ry[facei]*muw[facei]/rhow[facei]) - magUpara/sqr(utau) - - 1/E*kUu*fkUu/utau; + - 1/E_*kUu*fkUu/utau; scalar utauNew = utau - f/df; err = mag((utau - utauNew)/utau); @@ -191,6 +196,8 @@ void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent<word>(os, "U", "U", UName_); writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntryIfDifferent<word>(os, "mu", "mu", muName_); + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H index 0f55216d5113664fb6a564c936074f0f07b1f886..38f20535d337dc56b14668e61c0c15ee4283cc3a 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H @@ -67,6 +67,12 @@ class muSgsWallFunctionFvPatchScalarField //- Name of laminar viscosity field word muName_; + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + public: diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C index 4736499b4f70ac73c6e5ba1cbee7d575383b8820..edd0f4bcf079b07f551a0e1fc831a075900ecc19 100644 --- a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -48,7 +48,7 @@ void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D) muSgs_ = ck_(D)*rho()*sqrt(k_)*delta(); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C index 3bf3dd2cf212e571122fb059772c3950c91cf1e1..77b12af60e986f60818ce5a63aac45687f2642c6 100644 --- a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C @@ -52,7 +52,7 @@ void lowReOneEqEddy::updateSubGridScaleFields() muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu())); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C index bb2759dae3ffaf4ae3744b3414d7ad60975d274c..c6212dd74c250cc9faba61c91ad05d7792e68443 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C @@ -48,7 +48,7 @@ void oneEqEddy::updateSubGridScaleFields() muSgs_ = ck_*rho()*sqrt(k_)*delta(); muSgs_.correctBoundaryConditions(); - alphaSgs_ = muSgs_/Prt(); + alphaSgs_ = muSgs_/Prt_; alphaSgs_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H index 189caafc96a54be8986adf748e44773c47638d77..445faebd39e2534e5c6dec9a2123382120f548bc 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.H +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H @@ -158,7 +158,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index 4f466d43c3ab08b9eec931e9d5a2ad71c7665cb3..00db2c304f9d9338575f2de850098349a894ce02 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -167,7 +167,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H index 1fa2c2fa432e3d17f292243477fab44974e74efb..b7c972a662c05b473d8b8eb2f80b4e7125593e4f 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -151,7 +151,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H index 49aa946f6c6738702e84de43c50ea4e579ad7399..1e4301adcd222a32d1dabb714db0e7ece32c8bc6 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -147,7 +147,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index ada7094e172c4be9d31a663fcde0ef47d7f33312..39e70c492245a6087aafc12713e241eefc5bd89b 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -183,7 +183,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H index 929d761e4670f9cbdf25d34c466ff9c62469a1cc..865120d8c6c9c320351bcda9b80c655755d48884 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H @@ -143,7 +143,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index 76d39ffe460e6adf05325377fd977d90a98e09bb..a563557f764cb24dfdba768fe6afe2061f8e1cc4 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -227,7 +227,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H index 68a95485a3b0a243be6a23d1be1be52a338efa72..222ee733a3210374de39e8145036981fe9213c86 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H @@ -164,7 +164,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphat_/Prt_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C index b5d7b80c6e3e956bc06fef6cbff2ccafbcd8e2ee..7d49a7055c7fc00fe53bb09377c38842a3d366bc 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "nuSgsWallFunctionFvPatchScalarField.H" -#include "LESModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -50,7 +49,9 @@ nuSgsWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(p, iF), UName_("U"), - nuName_("nu") + nuName_("nu"), + kappa_(0.41), + E_(9.0) {} @@ -65,7 +66,9 @@ nuSgsWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), - nuName_(ptf.nuName_) + nuName_(ptf.nuName_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -79,7 +82,9 @@ nuSgsWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault<word>("U", "U")), - nuName_(dict.lookupOrDefault<word>("nu", "nu")) + nuName_(dict.lookupOrDefault<word>("nu", "nu")), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) {} @@ -91,7 +96,9 @@ nuSgsWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(nwfpsf), UName_(nwfpsf.UName_), - nuName_(nwfpsf.nuName_) + nuName_(nwfpsf.nuName_), + kappa_(nwfpsf.kappa_), + E_(nwfpsf.E_) {} @@ -104,7 +111,9 @@ nuSgsWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(nwfpsf, iF), UName_(nwfpsf.UName_), - nuName_(nwfpsf.nuName_) + nuName_(nwfpsf.nuName_), + kappa_(nwfpsf.kappa_), + E_(nwfpsf.E_) {} @@ -115,15 +124,6 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate const Pstream::commsTypes ) { - const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties"); - - // TODO: make these lookups optional (or more robust)? - const scalar kappa = readScalar(lesModel.lookup("kappa")); - const scalar E = readScalar - ( - lesModel.subDict("wallFunctionCoeffs").lookup("E") - ); - const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = @@ -151,18 +151,18 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate do { - scalar kUu = min(kappa*magUpara/utau, 50); + scalar kUu = min(kappa_*magUpara/utau, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - utau/(ry[facei]*nuw[facei]) + magUpara/utau - + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = - 1.0/(ry[facei]*nuw[facei]) - magUpara/sqr(utau) - - 1/E*kUu*fkUu/utau; + - 1/E_*kUu*fkUu/utau; scalar utauNew = utau - f/df; err = mag((utau - utauNew)/utau); @@ -186,6 +186,8 @@ void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const fvPatchField<scalar>::write(os); writeEntryIfDifferent<word>(os, "U", "U", UName_); writeEntryIfDifferent<word>(os, "nu", "nu", nuName_); + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H index 9db775556ee369ae5aa423e3d9661bfad6c1688a..d1dbeb5fc945811589c3677bbb2fb76a8a946a89 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H @@ -64,6 +64,12 @@ class nuSgsWallFunctionFvPatchScalarField //- Name of laminar viscosity field word nuName_; + //- Von Karman constant + scalar kappa_; + + //- E constant + scalar E_; + public: