diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C index 7673f8a887e87eda716b5c2dde7f6a43d52dc09e..690a83b395f125283d854a398bd9b031049d6423 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -128,29 +128,29 @@ LRR::LRR 0.0 ) ), - alphaR_ + sigmaR_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaR", + "sigmaR", coeffDict_, - 1.22 + 0.81967 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.76923 + 1.3 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -297,9 +297,9 @@ bool LRR::read() C2_.readIfPresent(coeffDict()); Cs_.readIfPresent(coeffDict()); Ceps_.readIfPresent(coeffDict()); - alphaR_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmaR_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); couplingFactor_.readIfPresent(coeffDict()); if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) @@ -324,7 +324,7 @@ void LRR::correct() if (!turbulence_) { // Re-calculate viscosity - mut_ == rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H index c51b41490fd6c2cae1676077c86cf93ff3d572af..189caafc96a54be8986adf748e44773c47638d77 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.H +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H @@ -40,9 +40,9 @@ Description C2 1.92; Cs 0.25; Ceps 0.15; - alphah 1.0; // only for compressible - alphaEps 0.76923; - alphaR 1.22; // only for compressible + Prt 1.0; // only for compressible + sigmaEps 1.3; + sigmaR 0.81967; // only for compressible couplingFactor 0.0; // only for incompressible } @endverbatim @@ -77,27 +77,32 @@ class LRR { // Private data - dimensionedScalar Cmu_; + // Model coefficients - dimensionedScalar Clrr1_; - dimensionedScalar Clrr2_; + dimensionedScalar Cmu_; - dimensionedScalar C1_; - dimensionedScalar C2_; - dimensionedScalar Cs_; - dimensionedScalar Ceps_; + dimensionedScalar Clrr1_; + dimensionedScalar Clrr2_; - dimensionedScalar couplingFactor_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; - dimensionedScalar alphaR_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + dimensionedScalar couplingFactor_; - volSymmTensorField R_; - volScalarField k_; - volScalarField epsilon_; - volScalarField mut_; - volScalarField alphat_; + dimensionedScalar sigmaR_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; + + + // Fields + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; public: @@ -129,7 +134,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DREff", alphaR_*mut_ + mu()) + new volScalarField("DREff", mut_/sigmaR_ + mu()) ); } @@ -138,7 +143,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -153,7 +158,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 08a5e0176b1e27aa2fb9da3a96719e6d04ceabc1..6d8e6593361f9037b0de935522f962447aa980fa 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -65,6 +65,15 @@ LaunderGibsonRSTM::LaunderGibsonRSTM 0.09 ) ), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + coeffDict_, + 0.41 + ) + ), Clg1_ ( dimensioned<scalar>::lookupOrAddToDict @@ -146,29 +155,29 @@ LaunderGibsonRSTM::LaunderGibsonRSTM 0.0 ) ), - alphaR_ + sigmaR_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaR", + "sigmaR", coeffDict_, - 1.22 + 0.81967 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.76923 + 1.3 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -311,6 +320,7 @@ bool LaunderGibsonRSTM::read() if (RASModel::read()) { Cmu_.readIfPresent(coeffDict()); + kappa_.readIfPresent(coeffDict()); Clg1_.readIfPresent(coeffDict()); Clg2_.readIfPresent(coeffDict()); C1_.readIfPresent(coeffDict()); @@ -319,9 +329,9 @@ bool LaunderGibsonRSTM::read() Ceps_.readIfPresent(coeffDict()); C1Ref_.readIfPresent(coeffDict()); C2Ref_.readIfPresent(coeffDict()); - alphaR_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmaR_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); couplingFactor_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index 450da9e6e7d521aa87060292961a167f5ff786f1..4f466d43c3ab08b9eec931e9d5a2ad71c7665cb3 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -33,6 +33,7 @@ Description LaunderGibsonRSTMCoeffs { Cmu 0.09; + kappa 0.41; Clg1 1.8; Clg2 0.6; C1 1.44; @@ -41,9 +42,9 @@ Description C2Ref 0.3; Cs 0.25; Ceps 0.15; - alphah 1.0; // only for compressible - alphaEps 0.76923; - alphaR 1.22; + sigmah 1.0; // only for compressible + sigmaEps 1.3; + sigmaR 0.81967; couplingFactor 0.0; } @endverbatim @@ -79,32 +80,38 @@ class LaunderGibsonRSTM { // Private data - dimensionedScalar Cmu_; + // Model coefficients - dimensionedScalar Clg1_; - dimensionedScalar Clg2_; + dimensionedScalar Cmu_; + dimensionedScalar kappa_; - dimensionedScalar C1_; - dimensionedScalar C2_; - dimensionedScalar Cs_; - dimensionedScalar Ceps_; + dimensionedScalar Clg1_; + dimensionedScalar Clg2_; - dimensionedScalar C1Ref_; - dimensionedScalar C2Ref_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; - dimensionedScalar couplingFactor_; + dimensionedScalar C1Ref_; + dimensionedScalar C2Ref_; - dimensionedScalar alphaR_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + dimensionedScalar couplingFactor_; - wallDistReflection y_; + dimensionedScalar sigmaR_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; - volSymmTensorField R_; - volScalarField k_; - volScalarField epsilon_; - volScalarField mut_; - volScalarField alphat_; + + // Fields + + wallDistReflection y_; + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; public: @@ -136,7 +143,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DREff", alphaR_*mut_ + mu()) + new volScalarField("DREff", mut_/sigmaR_ + mu()) ); } @@ -145,7 +152,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -160,7 +167,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index b742b14d20bb955a41bc52dee8a02a3ae288c38e..20221e63cd825bee6012bcd346070a9d3352eb5d 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -107,29 +107,29 @@ LaunderSharmaKE::LaunderSharmaKE -0.33 ) ), - alphak_ + sigmak_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphak", + "sigmak", coeffDict_, 1.0 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.76923 + 1.3 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -257,9 +257,9 @@ bool LaunderSharmaKE::read() C1_.readIfPresent(coeffDict()); C2_.readIfPresent(coeffDict()); C3_.readIfPresent(coeffDict()); - alphak_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmak_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); return true; } diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H index b912ae539b56c2825279972946ace62a480f6aa6..1fa2c2fa432e3d17f292243477fab44974e74efb 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -79,9 +79,9 @@ class LaunderSharmaKE dimensionedScalar C1_; dimensionedScalar C2_; dimensionedScalar C3_; - dimensionedScalar alphak_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; // Fields @@ -127,7 +127,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DkEff", alphak_*mut_ + mu()) + new volScalarField("DkEff", mut_/sigmak_ + mu()) ); } @@ -136,7 +136,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -151,7 +151,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index 5d46b78788d576a907edea39f713cc43abdb88f2..8d18cec8c5ddc10f794424399046b1c643d687ad 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -47,8 +47,7 @@ void RASModel::printCoeffs() { if (printCoeffs_) { - Info<< type() << "Coeffs" << coeffDict_ << nl - << "wallFunctionCoeffs" << wallFunctionDict_ << endl; + Info<< type() << "Coeffs" << coeffDict_ << endl; } } @@ -82,46 +81,6 @@ RASModel::RASModel printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subDictPtr(type + "Coeffs")), - 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.09 - ) - ), - Prt_ - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "Prt", - wallFunctionDict_, - 0.85 - ) - ), - - yPlusLam_(yPlusLam(kappa_.value(), E_.value())), - k0_("k0", dimVelocity*dimVelocity, SMALL), epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), @@ -204,7 +163,7 @@ scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const } -tmp<scalarField> RASModel::yPlus(const label patchNo) const +tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const { const fvPatch& curPatch = mesh_.boundary()[patchNo]; @@ -213,7 +172,7 @@ tmp<scalarField> RASModel::yPlus(const label patchNo) const if (isType<wallFvPatch>(curPatch)) { - Yp = pow(Cmu_.value(), 0.25) + Yp = pow(Cmu, 0.25) *y_[patchNo] *sqrt(k()().boundaryField()[patchNo].patchInternalField()) /( @@ -256,18 +215,6 @@ bool RASModel::read() coeffDict_ <<= *dictPtr; } - if (const dictionary* dictPtr = subDictPtr("wallFunctionCoeffs")) - { - wallFunctionDict_ <<= *dictPtr; - } - - kappa_.readIfPresent(wallFunctionDict_); - E_.readIfPresent(wallFunctionDict_); - Cmu_.readIfPresent(wallFunctionDict_); - Prt_.readIfPresent(wallFunctionDict_); - - yPlusLam_ = yPlusLam(kappa_.value(), E_.value()); - k0_.readIfPresent(*this); epsilon0_.readIfPresent(*this); epsilonSmall_.readIfPresent(*this); diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 7c787d8ceb6406a3cc67b6eb112830f97d423077..cc189f24c80275ba3e7159dde0416339ee1e7ee1 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -89,19 +89,6 @@ protected: //- Model coefficients dictionary dictionary coeffDict_; - // Wall function properties - - //- Wall function dictionary - dictionary wallFunctionDict_; - - dimensionedScalar kappa_; - - dimensionedScalar E_; - - dimensionedScalar Cmu_; - - dimensionedScalar Prt_; - //- Value of y+ at the edge of the laminar sublayer scalar yPlusLam_; @@ -262,30 +249,6 @@ public: return omegaSmall_; } - //- Return kappa for use in wall-functions - dimensionedScalar kappa() const - { - return kappa_; - } - - //- Return E for use in wall-functions - dimensionedScalar E() const - { - return E_; - } - - //- Return Cmu for use in wall-functions - dimensionedScalar Cmu() const - { - return Cmu_; - } - - //- Return turbulent Prandtl number for use in wall-functions - dimensionedScalar Prt() const - { - return Prt_; - } - //- Return the near wall distances const nearWallDist& y() const { @@ -295,25 +258,12 @@ public: //- Calculate y+ at the edge of the laminar sublayer scalar yPlusLam(const scalar kappa, const scalar E) const; - //- Return y+ at the edge of the laminar sublayer - // for use in wall-functions - scalar yPlusLam() const - { - return yPlusLam_; - } - //- Const access to the coefficients dictionary const dictionary& coeffDict() const { return coeffDict_; } - //- Const access to the wall functions coefficients dictionary - const dictionary& walLFunctionDict() const - { - return wallFunctionDict_; - } - //- Return the turbulence viscosity virtual tmp<volScalarField> mut() const = 0; @@ -346,7 +296,11 @@ public: virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; //- Return yPlus for the given patch - virtual tmp<scalarField> yPlus(const label patchI) const; + virtual tmp<scalarField> yPlus + ( + const label patchI, + const scalar Cmu + ) const; //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct() = 0; diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C index e27c548014b7273ec56d99613005c105314e8767..2fc2bdab294ab8a4c8247cd54e2a2f9ab92d80cd 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -91,29 +91,29 @@ RNGkEpsilon::RNGkEpsilon -0.33 ) ), - alphak_ + sigmak_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphak", + "sigmak", coeffDict_, - 1.39 + 0.71942 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 1.39 + 0.71942 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -256,9 +256,9 @@ bool RNGkEpsilon::read() C1_.readIfPresent(coeffDict()); C2_.readIfPresent(coeffDict()); C3_.readIfPresent(coeffDict()); - alphak_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); eta0_.readIfPresent(coeffDict()); beta_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H index f7d8570ec84ff50655b0dc1413f6cd4688beeed8..49aa946f6c6738702e84de43c50ea4e579ad7399 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -36,9 +36,9 @@ Description C1 1.42; C2 1.68; C3 -0.33; // only for compressible - alphah 1.0; // only for compressible - alphak 1.39; - alphaEps 1.39; + Prt 1.0; // only for compressible + sigmak 0.71942; + sigmaEps 0.71942; eta0 4.38; beta 0.012; } @@ -74,20 +74,24 @@ class RNGkEpsilon { // Private data - dimensionedScalar Cmu_; - dimensionedScalar C1_; - dimensionedScalar C2_; - dimensionedScalar C3_; - dimensionedScalar alphak_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; - dimensionedScalar eta0_; - dimensionedScalar beta_; + // Model coefficients - volScalarField k_; - volScalarField epsilon_; - volScalarField mut_; - volScalarField alphat_; + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar C3_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; + dimensionedScalar eta0_; + dimensionedScalar beta_; + + // Fields + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; public: @@ -119,7 +123,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DkEff", alphak_*mut_ + mu()) + new volScalarField("DkEff", mut_/sigmak_ + mu()) ); } @@ -128,7 +132,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -143,7 +147,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 4daef2dd8e1084d7dfed62339a4d61d15151f5fb..603ed83962dcf182fc74ed49178fd8af9fb7f1f3 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -115,20 +115,29 @@ SpalartAllmaras::SpalartAllmaras : RASModel(typeName, rho, U, phi, thermophysicalModel), - alphaNut_ + sigmaNut_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaNut", + "sigmaNut", coeffDict_, - 1.5 + 0.66666 ) ), - alphah_ + kappa_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "kappa", + coeffDict_, + 0.41 + ) + ), + Prt_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Prt", coeffDict_, 1.0 ) @@ -152,7 +161,7 @@ SpalartAllmaras::SpalartAllmaras 0.622 ) ), - Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw1_(Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_), Cw2_ ( dimensioned<scalar>::lookupOrAddToDict @@ -296,12 +305,13 @@ bool SpalartAllmaras::read() { if (RASModel::read()) { - alphaNut_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmaNut_.readIfPresent(coeffDict()); + kappa_.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()); @@ -350,7 +360,7 @@ void SpalartAllmaras::correct() fvm::ddt(rho_, nuTilda_) + fvm::div(phi_, nuTilda_) - fvm::laplacian(DnuTildaEff(), nuTilda_) - - alphaNut_*Cb2_*rho_*magSqr(fvc::grad(nuTilda_)) + - Cb2_/sigmaNut_*rho_*magSqr(fvc::grad(nuTilda_)) == Cb1_*rho_*Stilda*nuTilda_ - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_*rho_/sqr(d_), nuTilda_) diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index 7b96627f8e7d52affd944fbadb56dba041545c51..ada7094e172c4be9d31a663fcde0ef47d7f33312 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -54,8 +54,9 @@ Description Cw3 2.0; Cv1 7.1; Cv2 5.0; - alphaNut 1.5; - alphah 1.0; // only for compressible + sigmaNut 0.66666; + Prt 1.0; // only for compressible + kappa 0.41; } @endverbatim @@ -91,8 +92,10 @@ class SpalartAllmaras // Private data // Model coefficients - dimensionedScalar alphaNut_; - dimensionedScalar alphah_; + + dimensionedScalar sigmaNut_; + dimensionedScalar kappa_; + dimensionedScalar Prt_; dimensionedScalar Cb1_; dimensionedScalar Cb2_; @@ -164,7 +167,7 @@ public: new volScalarField ( "DnuTildaEff", - alphaNut_*rho_*nuTilda_ + mu() + rho_*nuTilda_/sigmaNut_ + mu() ) ); } @@ -180,7 +183,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index 0c125200b5e7be58c918dfc11606bd30d8550d3d..73c332895643304166c575981d40d2a48f95a2f9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "alphatWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -49,7 +48,8 @@ alphatWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - mutName_("mut") + mutName_("mut"), + Prt_(0.85) {} @@ -63,7 +63,8 @@ alphatWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), - mutName_(ptf.mutName_) + mutName_(ptf.mutName_), + Prt_(ptf.Prt_) {} @@ -76,7 +77,8 @@ alphatWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), - mutName_(dict.lookupOrDefault<word>("mut", "mut")) + mutName_(dict.lookupOrDefault<word>("mut", "mut")), + Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)) {} @@ -87,7 +89,8 @@ alphatWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(awfpsf), - mutName_(awfpsf.mutName_) + mutName_(awfpsf.mutName_), + Prt_(awfpsf.Prt_) {} @@ -99,7 +102,8 @@ alphatWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(awfpsf, iF), - mutName_(awfpsf.mutName_) + mutName_(awfpsf.mutName_), + Prt_(awfpsf.Prt_) {} @@ -107,13 +111,10 @@ alphatWallFunctionFvPatchScalarField void alphatWallFunctionFvPatchScalarField::updateCoeffs() { - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalar Prt = rasModel.Prt().value(); - const scalarField& mutw = patch().lookupPatchField<volScalarField, scalar>(mutName_); - operator==(mutw/Prt); + operator==(mutw/Prt_); } @@ -121,6 +122,7 @@ void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); writeEntryIfDifferent<word>(os, "mut", "mut", mutName_); + os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H index c49a0bc4826377334289fbbfc681906f0abd8ff7..a20db7eaccf12d1ccd66a892907312cfa42918ec 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H @@ -29,6 +29,7 @@ Description Boundary condition for turbulent thermal diffusivity when using wall functions - replicates OpenFOAM v1.5 (and earlier) behaviour + - Turbulent Prandtl number defaults to 0.85 if unspecified SourceFiles alphatWallFunctionFvPatchScalarField.C @@ -62,6 +63,9 @@ class alphatWallFunctionFvPatchScalarField //- Name of turbulent viscosity field word mutName_; + //- Turbulent Prandtl number + scalar Prt_; + public: 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 939878c13b8854e083e2a2c4b43b9a557a6df5ac..0587d7958291f8cb6f80c910ce1742c6018b2d2c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -70,7 +70,10 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_("RASModel::G"), rhoName_("rho"), muName_("mu"), - mutName_("mut") + mutName_("mut"), + Cmu_(0.09), + kappa_(0.41), + E_(9.0) { checkType(); } @@ -90,7 +93,10 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_(ptf.GName_), rhoName_(ptf.rhoName_), muName_(ptf.muName_), - mutName_(ptf.mutName_) + mutName_(ptf.mutName_), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_) { checkType(); } @@ -109,7 +115,10 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_(dict.lookupOrDefault<word>("G", "RASModel::G")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")), muName_(dict.lookupOrDefault<word>("mu", "mu")), - mutName_(dict.lookupOrDefault<word>("mut", "mut")) + mutName_(dict.lookupOrDefault<word>("mut", "mut")), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) { checkType(); } @@ -126,7 +135,10 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_(ewfpsf.GName_), rhoName_(ewfpsf.rhoName_), muName_(ewfpsf.muName_), - mutName_(ewfpsf.mutName_) + mutName_(ewfpsf.mutName_), + Cmu_(ewfpsf.Cmu_), + kappa_(ewfpsf.kappa_), + E_(ewfpsf.E_) { checkType(); } @@ -144,7 +156,10 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_(ewfpsf.GName_), rhoName_(ewfpsf.rhoName_), muName_(ewfpsf.muName_), - mutName_(ewfpsf.mutName_) + mutName_(ewfpsf.mutName_), + Cmu_(ewfpsf.Cmu_), + kappa_(ewfpsf.kappa_), + E_(ewfpsf.E_) { checkType(); } @@ -156,11 +171,9 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() { const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalar Cmu = rasModel.Cmu().value(); - const scalar Cmu25 = pow(Cmu, 0.25); - const scalar Cmu75 = pow(Cmu, 0.75); - const scalar kappa = rasModel.kappa().value(); - const scalar yPlusLam = rasModel.yPlusLam(); + const scalar Cmu25 = pow(Cmu_, 0.25); + const scalar Cmu75 = pow(Cmu_, 0.75); + const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; @@ -195,7 +208,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() Cmu25*y[faceI]*sqrt(k[faceCellI]) /(muw[faceI]/rhow[faceI]); - epsilon[faceCellI] = Cmu75*pow(k[faceCellI], 1.5)/(kappa*y[faceI]); + epsilon[faceCellI] = Cmu75*pow(k[faceCellI], 1.5)/(kappa_*y[faceI]); if (yPlus > yPlusLam) { @@ -203,7 +216,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() (mutw[faceI] + muw[faceI]) *magGradUw[faceI] *Cmu25*sqrt(k[faceCellI]) - /(kappa*y[faceI]); + /(kappa_*y[faceI]); } else { @@ -233,6 +246,9 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntryIfDifferent<word>(os, "mu", "mu", muName_); writeEntryIfDifferent<word>(os, "mut", "mut", mutName_); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + 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/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index c97659cc73f7e1ec7ce0b4dde37e8a91c3bfb8f0..31cbf011d86f41fac22408472556e27f749054e6 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -77,6 +77,15 @@ class epsilonWallFunctionFvPatchScalarField //- Name of turbulent viscosity field word mutName_; + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + // Private member functions diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C index 8286c1b149f0c91f17e6ede8cd1d03f8c96b228f..c0152e545a3fac7830ddbe955ed8cda1cb7e9cd1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C @@ -25,9 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "kQRWallFunctionFvPatchField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" -#include "volFields.H" #include "addToRunTimeSelectionTable.H" #include "wallFvPatch.H" diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C index a6b699d20d6fda74edceb157834b4f392049bce4..c669ea2115ba67b72ecb589240a51704e7adfd4b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C @@ -78,6 +78,9 @@ mutRoughWallFunctionFvPatchScalarField rhoName_("rho"), muName_("mu"), kName_("k"), + Cmu_(0.09), + kappa_(0.41), + E_(9.0), Ks_(p.size(), 0.0), Cs_(p.size(), 0.0) {} @@ -96,6 +99,9 @@ mutRoughWallFunctionFvPatchScalarField rhoName_(ptf.rhoName_), muName_(ptf.muName_), kName_(ptf.kName_), + Cmu_(0.09), + kappa_(0.41), + E_(9.0), Ks_(ptf.Ks_, mapper), Cs_(ptf.Cs_, mapper) {} @@ -113,6 +119,9 @@ mutRoughWallFunctionFvPatchScalarField rhoName_(dict.lookupOrDefault<word>("rho", "rho")), muName_(dict.lookupOrDefault<word>("mu", "mu")), kName_(dict.lookupOrDefault<word>("k", "k")), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.4187)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)), Ks_("Ks", dict, p.size()), Cs_("Cs", dict, p.size()) {} @@ -128,6 +137,9 @@ mutRoughWallFunctionFvPatchScalarField rhoName_(rwfpsf.rhoName_), muName_(rwfpsf.muName_), kName_(rwfpsf.kName_), + Cmu_(rwfpsf.Cmu_), + kappa_(rwfpsf.kappa_), + E_(rwfpsf.E_), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} @@ -144,6 +156,9 @@ mutRoughWallFunctionFvPatchScalarField rhoName_(rwfpsf.rhoName_), muName_(rwfpsf.muName_), kName_(rwfpsf.kName_), + Cmu_(rwfpsf.Cmu_), + kappa_(rwfpsf.kappa_), + E_(rwfpsf.E_), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} @@ -181,15 +196,11 @@ void mutRoughWallFunctionFvPatchScalarField::rmap void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() { const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar Cmu = rasModel.Cmu().value(); - const scalar Cmu25 = pow(Cmu, 0.25); - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); - scalar yPlusLam = rasModel.yPlusLam(); - + scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; + const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& rhow = patch().lookupPatchField<volScalarField, scalar>(rhoName_); @@ -210,12 +221,12 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]); - scalar Edash = E; + scalar Edash = E_; scalar yPlusLamNew = yPlusLam; if (KsPlus > 2.25) { - Edash = E/fnRough(KsPlus, Cs_[faceI]); - yPlusLamNew = rasModel.yPlusLam(kappa, Edash); + Edash /= fnRough(KsPlus, Cs_[faceI]); + yPlusLamNew = rasModel.yPlusLam(kappa_, Edash); } if (debug) @@ -230,8 +241,7 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() if (yPlus > yPlusLamNew) { mutw[faceI] = - muw[faceI] - *(yPlus*kappa/log(max(Edash*yPlus, 1+1e-4)) - 1); + muw[faceI]*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1); } else { @@ -247,6 +257,9 @@ void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntryIfDifferent<word>(os, "mu", "mu", muName_); writeEntryIfDifferent<word>(os, "k", "k", kName_); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; Cs_.writeEntry("Cs", os); Ks_.writeEntry("Ks", os); writeEntry("value", os); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H index b12ad6bc5765937ccb7226bb9580f9605fa91b6a..b3642ed4f07f940d287209d776dcc45076766811 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H @@ -73,6 +73,15 @@ class mutRoughWallFunctionFvPatchScalarField //- Name of turbulence kinetic energy field word kName_; + //- Cmu coefficient + scalar Cmu_; + + //- Von-karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + //- Roughness height scalarField Ks_; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C index 36a3b819dedf03dc605fc46c85caf7c8bc9a8366..9ba755327b4d1c0df3623bbf0c7cb07134fec922 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -52,6 +51,8 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField UName_("U"), rhoName_("rho"), muName_("mu"), + kappa_(0.41), + E_(9.0), roughnessHeight_(pTraits<scalar>::zero), roughnessConstant_(pTraits<scalar>::zero), roughnessFudgeFactor_(pTraits<scalar>::zero) @@ -71,6 +72,8 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField UName_(ptf.UName_), rhoName_(ptf.rhoName_), muName_(ptf.muName_), + kappa_(ptf.kappa_), + E_(ptf.E_), roughnessHeight_(ptf.roughnessHeight_), roughnessConstant_(ptf.roughnessConstant_), roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) @@ -89,6 +92,8 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField 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.0)), roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) @@ -105,6 +110,8 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField UName_(rwfpsf.UName_), rhoName_(rwfpsf.rhoName_), muName_(rwfpsf.muName_), + kappa_(rwfpsf.kappa_), + E_(rwfpsf.E_), roughnessHeight_(rwfpsf.roughnessHeight_), roughnessConstant_(rwfpsf.roughnessConstant_), roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) @@ -122,6 +129,8 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField UName_(rwfpsf.UName_), rhoName_(rwfpsf.rhoName_), muName_(rwfpsf.muName_), + kappa_(rwfpsf.kappa_), + E_(rwfpsf.E_), roughnessHeight_(rwfpsf.roughnessHeight_), roughnessConstant_(rwfpsf.roughnessConstant_), roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) @@ -135,10 +144,6 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate const Pstream::commsTypes ) { - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); const scalar yPlusLam = 11.225; // The reciprical of the distance to the adjacent cell centre. @@ -173,7 +178,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate { const scalar magUpara = magUp[facei]; const scalar Re = rho[facei]*magUpara/(muw[facei]*ry[facei]); - const scalar kappaRe = kappa*Re; + const scalar kappaRe = kappa_*Re; scalar yPlus = yPlusLam; const scalar ryPlusLam = 1.0/yPlus; @@ -222,7 +227,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); } - scalar denom = 1.0 + log(E* yPlus) - G - yPlusGPrime; + scalar denom = 1.0 + log(E_*yPlus) - G - yPlusGPrime; if (mag(denom) > VSMALL) { yPlus = (kappaRe + yPlus*(1 - yPlusGPrime))/denom; @@ -262,7 +267,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate { const scalar magUpara = magUp[facei]; const scalar Re = rho[facei]*magUpara/(muw[facei]*ry[facei]); - const scalar kappaRe = kappa*Re; + const scalar kappaRe = kappa_*Re; scalar yPlus = yPlusLam; const scalar ryPlusLam = 1.0/yPlus; @@ -273,7 +278,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate do { yPlusLast = yPlus; - yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + yPlus = (kappaRe + yPlus)/(1.0 + log(E_*yPlus)); } while ( @@ -303,6 +308,8 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write 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; os.writeKeyword("roughnessHeight") << roughnessHeight_ << token::END_STATEMENT << nl; os.writeKeyword("roughnessConstant") diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H index 16aa54faa1b4d006e1234605b9e4e8cc4400fb04..8fa529d863a0e345bb15301bed5fe6dc3c4280bd 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -67,6 +67,13 @@ class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField //- Name of laminar viscosity field word muName_; + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + // Roughness parameters //- Height diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C index f17d16ecd9d69fe54f5c26bd5d941cc42e326d4a..8eb2b2c0807322af3bedf825d1d989502dbafa76 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -51,7 +51,9 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_("U"), rhoName_("rho"), - muName_("mu") + muName_("mu"), + kappa_(0.41), + E_(9.0) {} @@ -67,7 +69,9 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), rhoName_(ptf.rhoName_), - muName_(ptf.muName_) + muName_(ptf.muName_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -82,34 +86,40 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField 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)) {} mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& rwfpsf + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& sawfpsf ) : - fixedValueFvPatchScalarField(rwfpsf), - UName_(rwfpsf.UName_), - rhoName_(rwfpsf.rhoName_), - muName_(rwfpsf.muName_) + fixedValueFvPatchScalarField(sawfpsf), + UName_(sawfpsf.UName_), + rhoName_(sawfpsf.rhoName_), + muName_(sawfpsf.muName_), + kappa_(sawfpsf.kappa_), + E_(sawfpsf.E_) {} mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& rwfpsf, + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& sawfpsf, const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(rwfpsf, iF), - UName_(rwfpsf.UName_), - rhoName_(rwfpsf.rhoName_), - muName_(rwfpsf.muName_) + fixedValueFvPatchScalarField(sawfpsf, iF), + UName_(sawfpsf.UName_), + rhoName_(sawfpsf.rhoName_), + muName_(sawfpsf.muName_), + kappa_(sawfpsf.kappa_), + E_(sawfpsf.E_) {} @@ -121,10 +131,7 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate ) { const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); - scalar yPlusLam = rasModel.yPlusLam(); + scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& ry = patch().deltaCoeffs(); @@ -146,7 +153,7 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate { scalar magUpara = magUp[faceI]; - scalar kappaRe = kappa*magUpara/((muw[faceI]/rhow[faceI])*ry[faceI]); + scalar kappaRe = kappa_*magUpara/((muw[faceI]/rhow[faceI])*ry[faceI]); scalar yPlus = yPlusLam; scalar ryPlusLam = 1.0/yPlus; @@ -157,13 +164,13 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate do { yPlusLast = yPlus; - yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + yPlus = (kappaRe + yPlus)/(1.0 + log(E_*yPlus)); } while (mag(ryPlusLam*(yPlus - yPlusLast)) > 0.01 && ++iter < 10 ); if (yPlus > yPlusLam) { - mutw[faceI] = muw[faceI]*(yPlus*kappa/log(E*yPlus) - 1); + mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1); } else { @@ -182,6 +189,8 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::write 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/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H index 45f88e4c040d3e35ee682c88435fe159f6efe3ec..a1c13581bf63f97ebc3522cfaad73af1b1321be9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -67,6 +67,12 @@ class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField //- Name of laminar viscosity field word muName_; + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + public: diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C index 42111a981a1b2ad155d3e25f272faf9e8bcdf787..df628e0fe385996ca3067d4f58293c9dc7f14848 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -25,7 +25,6 @@ License \*---------------------------------------------------------------------------*/ #include "mutSpalartAllmarasWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -51,7 +50,9 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_("U"), rhoName_("rho"), - muName_("mu") + muName_("mu"), + kappa_(0.41), + E_(9.0) {} @@ -67,7 +68,9 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), rhoName_(ptf.rhoName_), - muName_(ptf.muName_) + muName_(ptf.muName_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -82,7 +85,9 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField 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)) {} @@ -95,7 +100,9 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(wfpsf), UName_(wfpsf.UName_), rhoName_(wfpsf.rhoName_), - muName_(wfpsf.muName_) + muName_(wfpsf.muName_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_) {} @@ -109,7 +116,9 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(wfpsf, iF), UName_(wfpsf.UName_), rhoName_(wfpsf.rhoName_), - muName_(wfpsf.muName_) + muName_(wfpsf.muName_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_) {} @@ -120,11 +129,6 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate const Pstream::commsTypes ) { - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); - const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = @@ -156,18 +160,18 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::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]*(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); @@ -177,7 +181,7 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate mutw[faceI] = max ( - rhow[faceI]*sqr(max(utau, 0))/magFaceGradU[faceI]- muw[faceI], + rhow[faceI]*sqr(max(utau, 0))/magFaceGradU[faceI] - muw[faceI], 0.0 ); } @@ -198,6 +202,8 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::write 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/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H index dc7b241b8dbd1f46e0b09a2be97b9526752f68d9..1b2dfa9f908da1e59c6da1d5925bf90c0daac434 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -67,6 +67,12 @@ class mutSpalartAllmarasWallFunctionFvPatchScalarField //- Name of laminar viscosity field word muName_; + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + public: diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C index 97cb57bcd6b7036ebb1b98f9a710b349473a897f..efb283b08c5a7e71f4e1326c0030e4da628d2070 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -51,7 +51,10 @@ mutWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF), rhoName_("rho"), muName_("mu"), - kName_("k") + kName_("k"), + Cmu_(0.09), + kappa_(0.41), + E_(9.0) {} @@ -67,7 +70,10 @@ mutWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(ptf, p, iF, mapper), rhoName_(ptf.rhoName_), muName_(ptf.muName_), - kName_(ptf.kName_) + kName_(ptf.kName_), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_) {} @@ -82,7 +88,10 @@ mutWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF, dict), rhoName_(dict.lookupOrDefault<word>("rho", "rho")), muName_(dict.lookupOrDefault<word>("mu", "mu")), - kName_(dict.lookupOrDefault<word>("k", "k")) + kName_(dict.lookupOrDefault<word>("k", "k")), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) {} @@ -95,7 +104,10 @@ mutWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(wfpsf), rhoName_(wfpsf.rhoName_), muName_(wfpsf.muName_), - kName_(wfpsf.kName_) + kName_(wfpsf.kName_), + Cmu_(wfpsf.Cmu_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_) {} @@ -109,7 +121,10 @@ mutWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(wfpsf, iF), rhoName_(wfpsf.rhoName_), muName_(wfpsf.muName_), - kName_(wfpsf.kName_) + kName_(wfpsf.kName_), + Cmu_(wfpsf.Cmu_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_) {} @@ -118,15 +133,11 @@ mutWallFunctionFvPatchScalarField void mutWallFunctionFvPatchScalarField::updateCoeffs() { const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar Cmu = rasModel.Cmu().value(); - const scalar Cmu25 = pow(Cmu, 0.25); - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); - const scalar yPlusLam = rasModel.yPlusLam(); - + const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; + const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& rhow = patch().lookupPatchField<volScalarField, scalar>(rhoName_); @@ -147,7 +158,7 @@ void mutWallFunctionFvPatchScalarField::updateCoeffs() if (yPlus > yPlusLam) { - mutw[faceI] = muw[faceI]*(yPlus*kappa/log(E*yPlus) - 1); + mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1); } else { @@ -163,6 +174,9 @@ void mutWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntryIfDifferent<word>(os, "mu", "mu", muName_); writeEntryIfDifferent<word>(os, "k", "k", kName_); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + 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/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H index ec00de97634cda84b0e0cdb9ee8cdb9780953fb4..e99b7cd79ffe8dcf9f6e8a30d9d9bae4c926266e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H @@ -68,6 +68,15 @@ class mutWallFunctionFvPatchScalarField //- Name of turbulence kinetic energy field word kName_; + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + public: 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 b89ce2ed3559f0c72609a0706c446a386d3b7c9f..e6d0847cbe2fbdbc1c81dde67eba9f56df49c04a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -70,7 +70,10 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField kName_("k"), GName_("RASModel::G"), muName_("mu"), - mutName_("mut") + mutName_("mut"), + Cmu_(0.09), + kappa_(0.41), + E_(9.0) { checkType(); } @@ -90,7 +93,10 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField kName_(ptf.kName_), GName_(ptf.GName_), muName_(ptf.muName_), - mutName_(ptf.mutName_) + mutName_(ptf.mutName_), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_) { checkType(); } @@ -109,7 +115,10 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField kName_(dict.lookupOrDefault<word>("k", "k")), GName_(dict.lookupOrDefault<word>("G", "RASModel::G")), muName_(dict.lookupOrDefault<word>("mu", "mu")), - mutName_(dict.lookupOrDefault<word>("mut", "mut")) + mutName_(dict.lookupOrDefault<word>("mut", "mut")), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.0)) { checkType(); } @@ -126,7 +135,10 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField kName_(owfpsf.kName_), GName_(owfpsf.GName_), muName_(owfpsf.muName_), - mutName_(owfpsf.mutName_) + mutName_(owfpsf.mutName_), + Cmu_(owfpsf.Cmu_), + kappa_(owfpsf.kappa_), + E_(owfpsf.E_) { checkType(); } @@ -144,7 +156,10 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField kName_(owfpsf.kName_), GName_(owfpsf.GName_), muName_(owfpsf.muName_), - mutName_(owfpsf.mutName_) + mutName_(owfpsf.mutName_), + Cmu_(owfpsf.Cmu_), + kappa_(owfpsf.kappa_), + E_(owfpsf.E_) { checkType(); } @@ -155,15 +170,11 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField void omegaWallFunctionFvPatchScalarField::updateCoeffs() { const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalar Cmu = rasModel.Cmu().value(); - const scalar Cmu25 = pow(Cmu, 0.25); - - const scalar kappa = rasModel.kappa().value(); - const scalar yPlusLam = rasModel.yPlusLam(); - + const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; + const scalar Cmu25 = pow(Cmu_, 0.25); + volScalarField& G = const_cast<volScalarField&> (db().lookupObject<volScalarField>(GName_)); @@ -195,7 +206,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() Cmu25*y[faceI]*sqrt(k[faceCellI]) /(muw[faceI]/rhow[faceI]); - omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa*y[faceI]); + omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa_*y[faceI]); if (yPlus > yPlusLam) { @@ -203,7 +214,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() (mutw[faceI] + muw[faceI]) *magGradUw[faceI] *Cmu25*sqrt(k[faceCellI]) - /(kappa*y[faceI]); + /(kappa_*y[faceI]); } else { @@ -224,6 +235,9 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_); writeEntryIfDifferent<word>(os, "mu", "mu", muName_); writeEntryIfDifferent<word>(os, "mut", "mut", mutName_); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + 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/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index 3c75fcca25627f89cc68eef220c9cebe070ac832..be50b4a33fa8355afa35d4bcd215857ebeeaa584 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -75,6 +75,15 @@ class omegaWallFunctionFvPatchScalarField //- Name of turbulent viscosity field word mutName_; + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + // Private member functions diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C index c7aa94cfe8a895f66c4b3bb0eb10db7a66782f66..e0c04f1e446f9594b093b3ea543954d7a670016f 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C @@ -91,29 +91,29 @@ kEpsilon::kEpsilon -0.33 ) ), - alphak_ + sigmak_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphak", + "sigmak", coeffDict_, 1.0 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.76923 + 1.3 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -239,9 +239,9 @@ bool kEpsilon::read() C1_.readIfPresent(coeffDict()); C2_.readIfPresent(coeffDict()); C3_.readIfPresent(coeffDict()); - alphak_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmak_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); return true; } diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H index 199316246dd95eafb7b0c807c312cfb331baa9f4..929d761e4670f9cbdf25d34c466ff9c62469a1cc 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H @@ -36,9 +36,9 @@ Description C1 1.44; C2 1.92; C3 -0.33; // only for compressible - alphak 1.0; // only for compressible - alphaEps 0.76923; - alphah 1.0; // only for compressible + sigmak 1.0; // only for compressible + sigmaEps 1.3; + Prt 1.0; // only for compressible } @endverbatim @@ -78,9 +78,9 @@ class kEpsilon dimensionedScalar C1_; dimensionedScalar C2_; dimensionedScalar C3_; - dimensionedScalar alphak_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; // Fields @@ -119,7 +119,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DkEff", alphak_*mut_ + mu()) + new volScalarField("DkEff", mut_/sigmak_ + mu()) ); } @@ -128,7 +128,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -143,7 +143,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index a75cb0d749af51e29ee8e511e65c2eef633c2e17..d7627f35e00e636e2a89b12995e2f9aecd72cdd1 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -134,11 +134,11 @@ kOmegaSST::kOmegaSST 0.85616 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -328,7 +328,7 @@ bool kOmegaSST::read() alphaK2_.readIfPresent(coeffDict()); alphaOmega1_.readIfPresent(coeffDict()); alphaOmega2_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); gamma1_.readIfPresent(coeffDict()); gamma2_.readIfPresent(coeffDict()); beta1_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index ec57b0d3db07323effc8b0f3c0b31bb5715c323e..76d39ffe460e6adf05325377fd977d90a98e09bb 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -60,7 +60,7 @@ Description alphaK2 1.0; alphaOmega1 0.5; alphaOmega2 0.85616; - alphah 1.0; // only for compressible + Prt 1.0; // only for compressible beta1 0.075; beta2 0.0828; betaStar 0.09; @@ -112,7 +112,7 @@ class kOmegaSST dimensionedScalar alphaOmega1_; dimensionedScalar alphaOmega2_; - dimensionedScalar alphah_; + dimensionedScalar Prt_; dimensionedScalar gamma1_; dimensionedScalar gamma2_; @@ -153,34 +153,22 @@ class kOmegaSST return F1*(psi1 - psi2) + psi2; } - tmp<volScalarField> alphaK - ( - const volScalarField& F1 - ) const + tmp<volScalarField> alphaK(const volScalarField& F1) const { return blend(F1, alphaK1_, alphaK2_); } - tmp<volScalarField> alphaOmega - ( - const volScalarField& F1 - ) const + tmp<volScalarField> alphaOmega(const volScalarField& F1) const { return blend(F1, alphaOmega1_, alphaOmega2_); } - tmp<volScalarField> beta - ( - const volScalarField& F1 - ) const + tmp<volScalarField> beta(const volScalarField& F1) const { return blend(F1, beta1_, beta2_); } - tmp<volScalarField> gamma - ( - const volScalarField& F1 - ) const + tmp<volScalarField> gamma(const volScalarField& F1) const { return blend(F1, gamma1_, gamma2_); } @@ -239,7 +227,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); } diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C index 4eaa83683b45a14b7855be227339f04100b2eb43..a79eff7b8a9e7647e8a85022f55f445fed39d863 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C @@ -123,29 +123,29 @@ realizableKE::realizableKE 1.9 ) ), - alphak_ + sigmak_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphak", + "sigmak", coeffDict_, 1.0 ) ), - alphaEps_ + sigmaEps_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.833333 + 1.2 ) ), - alphah_ + Prt_ ( dimensioned<scalar>::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -272,9 +272,9 @@ bool realizableKE::read() Cmu_.readIfPresent(coeffDict()); A0_.readIfPresent(coeffDict()); C2_.readIfPresent(coeffDict()); - alphak_.readIfPresent(coeffDict()); - alphaEps_.readIfPresent(coeffDict()); - alphah_.readIfPresent(coeffDict()); + sigmak_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); return true; } diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H index aa76c2a3c35889c6a9f78a22918a63046a9aa0c9..68a95485a3b0a243be6a23d1be1be52a338efa72 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H @@ -46,9 +46,9 @@ Description Cmu 0.09; A0 4.0; C2 1.9; - alphak 1.0; - alphaEps 0.833333; - alphah 1.0; // only for compressible + sigmak 1.0; + sigmaEps 1.2; + Prt 1.0; // only for compressible } @endverbatim @@ -72,7 +72,7 @@ namespace RASModels { /*---------------------------------------------------------------------------*\ - Class realizableKE Declaration + Class realizableKE Declaration \*---------------------------------------------------------------------------*/ class realizableKE @@ -81,17 +81,25 @@ class realizableKE { // Private data - dimensionedScalar Cmu_; - dimensionedScalar A0_; - dimensionedScalar C2_; - dimensionedScalar alphak_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + // Model coefficients - volScalarField k_; - volScalarField epsilon_; - volScalarField mut_; - volScalarField alphat_; + dimensionedScalar Cmu_; + dimensionedScalar A0_; + dimensionedScalar C2_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; + + + // Fields + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + + // Private member functions tmp<volScalarField> rCmu ( @@ -100,10 +108,8 @@ class realizableKE const volScalarField& magS ); - tmp<volScalarField> rCmu - ( - const volTensorField& gradU - ); + tmp<volScalarField> rCmu(const volTensorField& gradU); + public: @@ -134,7 +140,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DkEff", alphak_*mut_ + mu()) + new volScalarField("DkEff", mut_/sigmak_ + mu()) ); } @@ -143,7 +149,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -158,7 +164,7 @@ public: { return tmp<volScalarField> ( - new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + new volScalarField("alphaEff", alphat_/Prt_ + alpha()) ); }