diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 4e01c64d74..637cf8037a 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -244,6 +244,23 @@ void Foam::fvPatchField::write(Ostream& os) const } +template +template +void Foam::fvPatchField::writeEntryIfDifferent +( + Ostream& os, + const word& entryName, + const EntryType& value1, + const EntryType& value2 +) const +{ + if (value1 != value2) + { + os.writeKeyword(entryName) << value2 << token::END_STATEMENT << nl; + } +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 701dd9fb4e..851d9d33ae 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -414,8 +414,21 @@ public: virtual void manipulateMatrix(fvMatrix& matrix); - //- Write - virtual void write(Ostream&) const; + // I-O + + //- Write + virtual void write(Ostream&) const; + + //- Helper function to write the keyword and entry only if the + // values are not equal. The value is then output as value2 + template + void writeEntryIfDifferent + ( + Ostream& os, + const word& entryName, + const EntryType& value1, + const EntryType& value2 + ) const; // Check diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index 26b1a214d5..60d3dc3e84 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -125,6 +125,8 @@ RASModel::RASModel k0_("k0", dimVelocity*dimVelocity, SMALL), epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), + omega0_("omega", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL), y_(mesh_) {} @@ -204,6 +206,8 @@ bool RASModel::read() k0_.readIfPresent(*this); epsilon0_.readIfPresent(*this); epsilonSmall_.readIfPresent(*this); + omega0_.readIfPresent(*this); + omegaSmall_.readIfPresent(*this); return true; } diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 7f45f88eed..7479eb4c55 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -80,22 +80,47 @@ protected: // Protected data + //- Turbulence on/off flag Switch turbulence_; + + //- Flag to print the model coeffs at run-time Switch printCoeffs_; + + //- Model coefficients dictionary dictionary coeffDict_; - dictionary wallFunctionDict_; - dimensionedScalar kappa_; - dimensionedScalar E_; - dimensionedScalar Cmu_; - dimensionedScalar Prt_; + // 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_; + //- Lower limit of k dimensionedScalar k0_; + + //- Lower limit of epsilon dimensionedScalar epsilon0_; + + //- Small epsilon value used to avoid divide by zero dimensionedScalar epsilonSmall_; + //- Lower limit for omega + dimensionedScalar omega0_; + + //- Small omega value used to avoid divide by zero + dimensionedScalar omegaSmall_; + + //- Near wall distance boundary field nearWallDist y_; @@ -193,6 +218,19 @@ public: return epsilonSmall_; } + //- Return the value of omega0 which epsilon is not allowed to be + // less than + const dimensionedScalar& omega0() const + { + return omega0_; + } + + //- Return the value of omegaSmall which is added to epsilon when + // calculating nut + const dimensionedScalar& omegaSmall() const + { + return omegaSmall_; + } //- Allow k0 to be changed dimensionedScalar& k0() @@ -212,6 +250,17 @@ public: return epsilonSmall_; } + //- Allow omega0 to be changed + dimensionedScalar& omega0() + { + return omega0_; + } + + //- Allow omegaSmall to be changed + dimensionedScalar& omegaSmall() + { + return omegaSmall_; + } //- Return kappa for use in wall-functions dimensionedScalar kappa() const 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 6ee5c45fea..6b2974b04f 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -48,7 +48,8 @@ alphatWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + mutName_("mut") {} @@ -61,7 +62,8 @@ alphatWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + mutName_(ptf.mutName_) {} @@ -73,7 +75,8 @@ alphatWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + mutName_(dict.lookupOrDefault("mut", "mut")) {} @@ -83,7 +86,8 @@ alphatWallFunctionFvPatchScalarField const alphatWallFunctionFvPatchScalarField& awfpsf ) : - fixedValueFvPatchScalarField(awfpsf) + fixedValueFvPatchScalarField(awfpsf), + mutName_(awfpsf.mutName_) {} @@ -94,7 +98,8 @@ alphatWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(awfpsf, iF) + fixedValueFvPatchScalarField(awfpsf, iF), + mutName_(awfpsf.mutName_) {} @@ -106,7 +111,7 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs() const scalar Prt = ras.Prt().value(); const scalarField& mutw = - patch().lookupPatchField("mut"); + patch().lookupPatchField(mutName_); operator==(mutw/Prt); } @@ -115,6 +120,7 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs() void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); + writeEntryIfDifferent(os, "mut", "mut", mutName_); 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 1d8ebc436c..da71e80a2f 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H @@ -57,6 +57,11 @@ class alphatWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + // Private data + + //- Name of turbulent viscosity field + word mutName_; + 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 b22c101340..387f54df33 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -64,7 +64,13 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(p, iF) + fixedInternalValueFvPatchField(p, iF), + UName_("U"), + kName_("k"), + GName_("G"), + rhoName_("rho"), + muName_("mu"), + mutName_("mut") { checkType(); } @@ -78,7 +84,13 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField(ptf, p, iF, mapper) + fixedInternalValueFvPatchField(ptf, p, iF, mapper), + UName_(ptf.UName_), + kName_(ptf.kName_), + GName_(ptf.GName_), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_), + mutName_(ptf.mutName_) { checkType(); } @@ -91,7 +103,13 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedInternalValueFvPatchField(p, iF, dict) + fixedInternalValueFvPatchField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + kName_(dict.lookupOrDefault("k", "k")), + GName_(dict.lookupOrDefault("G", "G")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")), + mutName_(dict.lookupOrDefault("mut", "mut")) { checkType(); } @@ -102,7 +120,13 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const epsilonWallFunctionFvPatchScalarField& ewfpsf ) : - fixedInternalValueFvPatchField(ewfpsf) + fixedInternalValueFvPatchField(ewfpsf), + UName_(ewfpsf.UName_), + kName_(ewfpsf.kName_), + GName_(ewfpsf.GName_), + rhoName_(ewfpsf.rhoName_), + muName_(ewfpsf.muName_), + mutName_(ewfpsf.mutName_) { checkType(); } @@ -114,7 +138,13 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(ewfpsf, iF) + fixedInternalValueFvPatchField(ewfpsf, iF), + UName_(ewfpsf.UName_), + kName_(ewfpsf.kName_), + GName_(ewfpsf.GName_), + rhoName_(ewfpsf.rhoName_), + muName_(ewfpsf.muName_), + mutName_(ewfpsf.mutName_) { checkType(); } @@ -135,24 +165,24 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; volScalarField& G = const_cast - (db().lookupObject("G")); + (db().lookupObject(GName_)); volScalarField& epsilon = const_cast - (db().lookupObject("epsilon")); + (db().lookupObject(dimensionedInternalField().name())); - const volScalarField& k = db().lookupObject("k"); + const volScalarField& k = db().lookupObject(kName_); const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); const scalarField& mutw = - patch().lookupPatchField("mut"); + patch().lookupPatchField(mutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -197,6 +227,12 @@ void epsilonWallFunctionFvPatchScalarField::evaluate void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "G", "G", GName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntryIfDifferent(os, "mut", "mut", mutName_); 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 2cb6b336bf..42bdeea681 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -57,6 +57,26 @@ class epsilonWallFunctionFvPatchScalarField : public fixedInternalValueFvPatchField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of turbulence generation field + word GName_; + + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + + //- Name of turbulent viscosity field + word mutName_; + // Private member functions 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 d224109c20..c772d95bff 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C @@ -77,6 +77,9 @@ mutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), + rhoName_("rho"), + muName_("mu"), + kName_("k"), Ks_(p.size(), 0.0), Cs_(p.size(), 0.0) {} @@ -92,6 +95,9 @@ mutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_), + kName_(ptf.kName_), Ks_(ptf.Ks_, mapper), Cs_(ptf.Cs_, mapper) {} @@ -106,6 +112,9 @@ mutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")), + kName_(dict.lookupOrDefault("k", "k")), Ks_("Ks", dict, p.size()), Cs_("Cs", dict, p.size()) {} @@ -114,25 +123,31 @@ mutRoughWallFunctionFvPatchScalarField mutRoughWallFunctionFvPatchScalarField:: mutRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& nrwfpsf + const mutRoughWallFunctionFvPatchScalarField& rwfpsf ) : - fixedValueFvPatchScalarField(nrwfpsf), - Ks_(nrwfpsf.Ks_), - Cs_(nrwfpsf.Cs_) + fixedValueFvPatchScalarField(rwfpsf), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_), + kName_(rwfpsf.kName_), + Ks_(rwfpsf.Ks_), + Cs_(rwfpsf.Cs_) {} mutRoughWallFunctionFvPatchScalarField:: mutRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& nrwfpsf, + const mutRoughWallFunctionFvPatchScalarField& rwfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(nrwfpsf, iF), - Ks_(nrwfpsf.Ks_), - Cs_(nrwfpsf.Cs_) + fixedValueFvPatchScalarField(rwfpsf, iF), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_), + kName_(rwfpsf.kName_), + Ks_(rwfpsf.Ks_), + Cs_(rwfpsf.Cs_) {} @@ -178,12 +193,12 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); - const scalarField& k = db().lookupObject("k"); + const scalarField& k = db().lookupObject(kName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); scalarField& mutw = *this; @@ -229,6 +244,9 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntryIfDifferent(os, "k", "k", kName_); 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 c1bddbc360..88209f4184 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H @@ -64,6 +64,15 @@ class mutRoughWallFunctionFvPatchScalarField { // Private data + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + + //- Name of turbulence kinetic energy field + word kName_; + //- 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 041bc46847..a480ba072b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -49,6 +49,9 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), + UName_("U"), + rhoName_("rho"), + muName_("mu"), roughnessHeight_(pTraits::zero), roughnessConstant_(pTraits::zero), roughnessFudgeFactor_(pTraits::zero) @@ -65,6 +68,9 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_), roughnessHeight_(ptf.roughnessHeight_), roughnessConstant_(ptf.roughnessConstant_), roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) @@ -80,6 +86,9 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")), roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) @@ -89,27 +98,33 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& rwfpsf ) : - fixedValueFvPatchScalarField(tppsf), - roughnessHeight_(tppsf.roughnessHeight_), - roughnessConstant_(tppsf.roughnessConstant_), - roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) + fixedValueFvPatchScalarField(rwfpsf), + UName_(rwfpsf.UName_), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) {} mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf, + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& rwfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF), - roughnessHeight_(tppsf.roughnessHeight_), - roughnessConstant_(tppsf.roughnessConstant_), - roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) + fixedValueFvPatchScalarField(rwfpsf, iF), + UName_(rwfpsf.UName_), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) {} @@ -131,16 +146,16 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); const fvPatchScalarField& rho = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); // The flow velocity at the adjacent cell centre. scalarField magUp = mag(U.patchInternalField() - U); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); scalarField& mutw = *this; scalarField magFaceGradU = mag(U.snGrad()); @@ -172,7 +187,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate // Enforce the roughnessHeight to be less than the distance to // the first cell centre. - if(dKsPlusdYPlus > 1) + if (dKsPlusdYPlus > 1) { dKsPlusdYPlus = 1; } @@ -211,7 +226,7 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate } scalar denom = 1.0 + log(E* yPlus) - G - yPlusGPrime; - if(mag(denom) > VSMALL) + if (mag(denom) > VSMALL) { yPlus = (kappaRe + yPlus*(1 - yPlusGPrime))/denom; if( yPlus < 0 ) @@ -288,6 +303,9 @@ void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write ) const { fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); 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 86cff3403f..16aa54faa1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -58,9 +58,25 @@ class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField { // Private data - scalar roughnessHeight_; - scalar roughnessConstant_; - scalar roughnessFudgeFactor_; + //- Name of velocity field + word UName_; + + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + + // Roughness parameters + + //- Height + scalar roughnessHeight_; + + //- Constant + scalar roughnessConstant_; + + //- Scale factor + scalar roughnessFudgeFactor_; public: @@ -143,38 +159,38 @@ public: // Access - //- Return the fluctuation scale + //- Return the roughness height scale const scalar& roughnessHeight() const { return roughnessHeight_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness height to allow adjustment scalar& roughnessHeight() { return roughnessHeight_; } - - //- Return the fluctuation scale + //- Return the roughness constant scale const scalar& roughnessConstant() const { return roughnessConstant_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness constant to allow adjustment scalar& roughnessConstant() { return roughnessConstant_; } - //- Return the fluctuation scale + //- Return the roughness scale factor const scalar& roughnessFudgeFactor() const { return roughnessFudgeFactor_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness scale factor to allow + // adjustment scalar& roughnessFudgeFactor() { return roughnessFudgeFactor_; 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 f284fd13ba..0501a266a9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -48,7 +48,10 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + UName_("U"), + rhoName_("rho"), + muName_("mu") {} @@ -61,7 +64,10 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_) {} @@ -73,28 +79,37 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")) {} mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& rwfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(rwfpsf), + UName_(rwfpsf.UName_), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_) {} mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: mutSpalartAllmarasStandardWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf, + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& rwfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(rwfpsf, iF), + UName_(rwfpsf.UName_), + rhoName_(rwfpsf.rhoName_), + muName_(rwfpsf.muName_) {} @@ -114,15 +129,15 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); scalarField& mutw = *this; scalarField magFaceGradU = mag(U.snGrad()); @@ -158,6 +173,19 @@ void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate } +void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntry("value", os); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField 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 e417d5ed39..45f88e4c04 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -56,6 +56,17 @@ class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + public: @@ -142,6 +153,9 @@ public: ( const Pstream::commsTypes commsType=Pstream::blocking ); + + //- Write + virtual void write(Ostream& os) const; }; 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 c814a1b827..88d087dc9c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -48,7 +48,10 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + UName_("U"), + rhoName_("rho"), + muName_("mu") {} @@ -61,7 +64,10 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_) {} @@ -73,28 +79,37 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")) {} mutSpalartAllmarasWallFunctionFvPatchScalarField:: mutSpalartAllmarasWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf + const mutSpalartAllmarasWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(wfpsf), + UName_(wfpsf.UName_), + rhoName_(wfpsf.rhoName_), + muName_(wfpsf.muName_) {} mutSpalartAllmarasWallFunctionFvPatchScalarField:: mutSpalartAllmarasWallFunctionFvPatchScalarField ( - const mutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf, + const mutSpalartAllmarasWallFunctionFvPatchScalarField& wfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(wfpsf, iF), + UName_(wfpsf.UName_), + rhoName_(wfpsf.rhoName_), + muName_(wfpsf.muName_) {} @@ -113,15 +128,15 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); scalarField& mutw = *this; @@ -174,6 +189,19 @@ void mutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate } +void mutSpalartAllmarasWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntry("value", os); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField(fvPatchScalarField, mutSpalartAllmarasWallFunctionFvPatchScalarField); 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 b0f3fa0e02..dc7b241b8d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -56,6 +56,18 @@ class mutSpalartAllmarasWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + + public: //- Runtime type information @@ -134,6 +146,9 @@ public: ( const Pstream::commsTypes commsType=Pstream::blocking ); + + //- Write + virtual void write(Ostream& os) const; }; 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 3f0faddd86..f57f52cdc1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -48,7 +48,10 @@ mutWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + rhoName_("rho"), + muName_("mu"), + kName_("k") {} @@ -61,7 +64,10 @@ mutWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + rhoName_(ptf.rhoName_), + muName_(ptf.muName_), + kName_(ptf.kName_) {} @@ -73,28 +79,37 @@ mutWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + rhoName_(dict.lookupOrDefault("rho", "rho")), + muName_(dict.lookupOrDefault("mu", "mu")), + kName_(dict.lookupOrDefault("k", "k")) {} mutWallFunctionFvPatchScalarField:: mutWallFunctionFvPatchScalarField ( - const mutWallFunctionFvPatchScalarField& tppsf + const mutWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(wfpsf), + rhoName_(wfpsf.rhoName_), + muName_(wfpsf.muName_), + kName_(wfpsf.kName_) {} mutWallFunctionFvPatchScalarField:: mutWallFunctionFvPatchScalarField ( - const mutWallFunctionFvPatchScalarField& tppsf, + const mutWallFunctionFvPatchScalarField& wfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(wfpsf, iF), + rhoName_(wfpsf.rhoName_), + muName_(wfpsf.muName_), + kName_(wfpsf.kName_) {} @@ -113,12 +128,12 @@ void mutWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); - const volScalarField& k = db().lookupObject("k"); + const volScalarField& k = db().lookupObject(kName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); scalarField& mutw = *this; @@ -145,6 +160,9 @@ void mutWallFunctionFvPatchScalarField::updateCoeffs() void mutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntryIfDifferent(os, "k", "k", kName_); 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 244dec844b..ec00de9763 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H @@ -57,6 +57,17 @@ class mutWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + // Private data + + //- Name of density field + word rhoName_; + + //- Name of laminar viscosity field + word muName_; + + //- Name of turbulence kinetic energy field + word kName_; + public: @@ -138,7 +149,7 @@ public: // I-O //- Write - void write(Ostream&) const; + virtual void write(Ostream&) const; }; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 5b0ee67630..eacf26b1d4 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -64,7 +64,13 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(p, iF) + fixedInternalValueFvPatchField(p, iF), + UName_("U"), + rhoName_("rho"), + kName_("k"), + GName_("G"), + muName_("mu"), + mutName_("mut") { checkType(); } @@ -78,7 +84,13 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField(ptf, p, iF, mapper) + fixedInternalValueFvPatchField(ptf, p, iF, mapper), + UName_(ptf.UName_), + rhoName_(ptf.rhoName_), + kName_(ptf.kName_), + GName_(ptf.GName_), + muName_(ptf.muName_), + mutName_(ptf.mutName_) { checkType(); } @@ -91,7 +103,13 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedInternalValueFvPatchField(p, iF, dict) + fixedInternalValueFvPatchField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + kName_(dict.lookupOrDefault("k", "k")), + GName_(dict.lookupOrDefault("G", "G")), + muName_(dict.lookupOrDefault("mu", "mu")), + mutName_(dict.lookupOrDefault("mut", "mut")) { checkType(); } @@ -99,10 +117,16 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ( - const omegaWallFunctionFvPatchScalarField& ewfpsf + const omegaWallFunctionFvPatchScalarField& owfpsf ) : - fixedInternalValueFvPatchField(ewfpsf) + fixedInternalValueFvPatchField(owfpsf), + UName_(owfpsf.UName_), + rhoName_(owfpsf.rhoName_), + kName_(owfpsf.kName_), + GName_(owfpsf.GName_), + muName_(owfpsf.muName_), + mutName_(owfpsf.mutName_) { checkType(); } @@ -110,11 +134,17 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ( - const omegaWallFunctionFvPatchScalarField& ewfpsf, + const omegaWallFunctionFvPatchScalarField& owfpsf, const DimensionedField& iF ) : - fixedInternalValueFvPatchField(ewfpsf, iF) + fixedInternalValueFvPatchField(owfpsf, iF), + UName_(owfpsf.UName_), + rhoName_(owfpsf.rhoName_), + kName_(owfpsf.kName_), + GName_(owfpsf.GName_), + muName_(owfpsf.muName_), + mutName_(owfpsf.mutName_) { checkType(); } @@ -135,24 +165,24 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; volScalarField& G = const_cast - (db().lookupObject("G")); + (db().lookupObject(GName_)); volScalarField& omega = const_cast - (db().lookupObject("omega")); + (db().lookupObject(dimensionedInternalField().name())); - const scalarField& k = db().lookupObject("k"); + const scalarField& k = db().lookupObject(kName_); const scalarField& rhow = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const scalarField& muw = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); const scalarField& mutw = - patch().lookupPatchField("mut"); + patch().lookupPatchField(mutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -188,6 +218,12 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "G", "G", GName_); + writeEntryIfDifferent(os, "mu", "mu", muName_); + writeEntryIfDifferent(os, "mut", "mut", mutName_); 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 266e7987d5..6dfe7a772b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -55,6 +55,26 @@ class omegaWallFunctionFvPatchScalarField : public fixedInternalValueFvPatchField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of density field + word rhoName_; + + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of turbulence generation field + word GName_; + + //- Name of laminar viscosity field + word muName_; + + //- Name of turbulent viscosity field + word mutName_; + // Private member functions diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index ab941a32a4..52cfaf2df8 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -208,19 +208,6 @@ kOmegaSST::kOmegaSST ) ), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", dimless/dimTime, SMALL), - - Cmu_ - ( - dimensioned::lookupOrAddToDict - ( - "Cmu", - coeffDict_, - 0.09 - ) - ), - y_(mesh_), k_ @@ -350,7 +337,6 @@ bool kOmegaSST::read() betaStar_.readIfPresent(coeffDict_); a1_.readIfPresent(coeffDict_); c1_.readIfPresent(coeffDict_); - Cmu_.readIfPresent(coeffDict_); return true; } diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index a9f668b6ad..8a948a5f77 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -56,7 +56,6 @@ Description @verbatim kOmegaSST { - Cmu 0.09; alphaK1 0.85034; alphaK2 1.0; alphaOmega1 0.5; @@ -96,7 +95,7 @@ namespace RASModels { /*---------------------------------------------------------------------------*\ - Class kOmega Declaration + Class kOmegaSST Declaration \*---------------------------------------------------------------------------*/ class kOmegaSST @@ -105,36 +104,38 @@ class kOmegaSST { // Private data - dimensionedScalar alphaK1_; - dimensionedScalar alphaK2_; + // Model coefficients - dimensionedScalar alphaOmega1_; - dimensionedScalar alphaOmega2_; + dimensionedScalar alphaK1_; + dimensionedScalar alphaK2_; - dimensionedScalar alphah_; + dimensionedScalar alphaOmega1_; + dimensionedScalar alphaOmega2_; - dimensionedScalar gamma1_; - dimensionedScalar gamma2_; + dimensionedScalar alphah_; - dimensionedScalar beta1_; - dimensionedScalar beta2_; + dimensionedScalar gamma1_; + dimensionedScalar gamma2_; - dimensionedScalar betaStar_; + dimensionedScalar beta1_; + dimensionedScalar beta2_; - dimensionedScalar a1_; - dimensionedScalar c1_; + dimensionedScalar betaStar_; - dimensionedScalar omega0_; - dimensionedScalar omegaSmall_; + dimensionedScalar a1_; + dimensionedScalar c1_; - dimensionedScalar Cmu_; + //- Wall distance + // Note: different to wall distance in parent RASModel wallDist y_; - volScalarField k_; - volScalarField omega_; - volScalarField mut_; - volScalarField alphat_; + // Fields + + volScalarField k_; + volScalarField omega_; + volScalarField mut_; + volScalarField alphat_; // Private member functions diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index b70be3ad4d..d06bc6652b 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -115,6 +115,8 @@ RASModel::RASModel k0_("k0", dimVelocity*dimVelocity, SMALL), epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), + omega0_("omega0", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL), y_(mesh_) {} @@ -250,6 +252,8 @@ bool RASModel::read() k0_.readIfPresent(*this); epsilon0_.readIfPresent(*this); epsilonSmall_.readIfPresent(*this); + omega0_.readIfPresent(*this); + omegaSmall_.readIfPresent(*this); return true; } diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H index 50127d8c66..963af37ddd 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -77,21 +77,45 @@ protected: // Protected data + //- Turbulence on/off flag Switch turbulence_; + + //- Flag to print the model coeffs at run-time Switch printCoeffs_; + + //- Model coefficients dictionary dictionary coeffDict_; - dictionary wallFunctionDict_; - dimensionedScalar kappa_; - dimensionedScalar E_; - dimensionedScalar Cmu_; + // Wall function properties + //- Wall function dictionary + dictionary wallFunctionDict_; + + dimensionedScalar kappa_; + + dimensionedScalar E_; + + dimensionedScalar Cmu_; + + //- Value of y+ at the edge of the laminar sublayer scalar yPlusLam_; + //- Lower limit of k dimensionedScalar k0_; + + //- Lower limit of epsilon dimensionedScalar epsilon0_; + + //- Small epsilon value used to avoid divide by zero dimensionedScalar epsilonSmall_; + //- Lower limit for omega + dimensionedScalar omega0_; + + //- Small omega value used to avoid divide by zero + dimensionedScalar omegaSmall_; + + //- Near wall distance boundary field nearWallDist y_; @@ -183,6 +207,20 @@ public: return epsilonSmall_; } + //- Return the value of omega0 which epsilon is not allowed to be + // less than + const dimensionedScalar& omega0() const + { + return omega0_; + } + + //- Return the value of omegaSmall which is added to epsilon when + // calculating nut + const dimensionedScalar& omegaSmall() const + { + return omegaSmall_; + } + //- Allow k0 to be changed dimensionedScalar& k0() { @@ -201,6 +239,18 @@ public: return epsilonSmall_; } + //- Allow omega0 to be changed + dimensionedScalar& omega0() + { + return omega0_; + } + + //- Allow omegaSmall to be changed + dimensionedScalar& omegaSmall() + { + return omegaSmall_; + } + //- Return kappa for use in wall-functions dimensionedScalar kappa() const { diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index a4f0bd13f7..ae8a57c303 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -64,7 +64,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(p, iF) + fixedInternalValueFvPatchField(p, iF), + UName_("U"), + kName_("k"), + GName_("G"), + nuName_("nu"), + nutName_("nut") { checkType(); } @@ -78,7 +83,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField(ptf, p, iF, mapper) + fixedInternalValueFvPatchField(ptf, p, iF, mapper), + UName_(ptf.UName_), + kName_(ptf.kName_), + GName_(ptf.GName_), + nuName_(ptf.nuName_), + nutName_(ptf.nutName_) { checkType(); } @@ -91,7 +101,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedInternalValueFvPatchField(p, iF, dict) + fixedInternalValueFvPatchField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + kName_(dict.lookupOrDefault("k", "k")), + GName_(dict.lookupOrDefault("G", "G")), + nuName_(dict.lookupOrDefault("nu", "nu")), + nutName_(dict.lookupOrDefault("nut", "nut")) { checkType(); } @@ -102,7 +117,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const epsilonWallFunctionFvPatchScalarField& ewfpsf ) : - fixedInternalValueFvPatchField(ewfpsf) + fixedInternalValueFvPatchField(ewfpsf), + UName_(ewfpsf.UName_), + kName_(ewfpsf.kName_), + GName_(ewfpsf.GName_), + nuName_(ewfpsf.nuName_), + nutName_(ewfpsf.nutName_) { checkType(); } @@ -114,7 +134,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(ewfpsf, iF) + fixedInternalValueFvPatchField(ewfpsf, iF), + UName_(ewfpsf.UName_), + kName_(ewfpsf.kName_), + GName_(ewfpsf.GName_), + nuName_(ewfpsf.nuName_), + nutName_(ewfpsf.nutName_) { checkType(); } @@ -135,21 +160,21 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; volScalarField& G = const_cast - (db().lookupObject("G")); + (db().lookupObject(GName_)); volScalarField& epsilon = const_cast - (db().lookupObject("epsilon")); + (db().lookupObject(dimensionedInternalField().name())); - const volScalarField& k = db().lookupObject("k"); + const volScalarField& k = db().lookupObject(kName_); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); const scalarField& nutw = - patch().lookupPatchField("nut"); + patch().lookupPatchField(nutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -192,6 +217,11 @@ void epsilonWallFunctionFvPatchScalarField::evaluate void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "G", "G", GName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); + writeEntryIfDifferent(os, "nut", "nut", nutName_); writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index 7e81a50a34..4dbdf40d16 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -57,6 +57,23 @@ class epsilonWallFunctionFvPatchScalarField : public fixedInternalValueFvPatchField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of turbulence generation field + word GName_; + + //- Name of laminar viscosity field + word nuName_; + + //- Name of turbulent viscosity field + word nutName_; + // Private member functions diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C index a62e333f1f..138e783333 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C @@ -77,6 +77,8 @@ nutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), + kName_("k"), + nuName_("nu"), Ks_(p.size(), 0.0), Cs_(p.size(), 0.0) {} @@ -92,6 +94,8 @@ nutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), + kName_(ptf.kName_), + nuName_(ptf.nuName_), Ks_(ptf.Ks_, mapper), Cs_(ptf.Cs_, mapper) {} @@ -106,6 +110,8 @@ nutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), + kName_(dict.lookupOrDefault("k", "k")), + nuName_(dict.lookupOrDefault("nu", "nu")), Ks_("Ks", dict, p.size()), Cs_("Cs", dict, p.size()) {} @@ -118,6 +124,8 @@ nutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(nrwfpsf), + kName_(nrwfpsf.kName_), + nuName_(nrwfpsf.nuName_), Ks_(nrwfpsf.Ks_), Cs_(nrwfpsf.Cs_) {} @@ -131,6 +139,8 @@ nutRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(nrwfpsf, iF), + kName_(nrwfpsf.kName_), + nuName_(nrwfpsf.nuName_), Ks_(nrwfpsf.Ks_), Cs_(nrwfpsf.Cs_) {} @@ -177,10 +187,10 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; - const scalarField& k = db().lookupObject("k"); + const scalarField& k = db().lookupObject(kName_); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); scalarField& nutw = *this; @@ -226,6 +236,8 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs() void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); Cs_.writeEntry("Cs", os); Ks_.writeEntry("Ks", os); writeEntry("value", os); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H index 0263c145d0..968c5c3f8f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H @@ -64,6 +64,12 @@ class nutRoughWallFunctionFvPatchScalarField { // Private data + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of laminar viscosity field + word nuName_; + //- Roughness height scalarField Ks_; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C index a7bd44016d..2d7bfc9cd2 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -49,6 +49,8 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), + UName_("U"), + nuName_("nu"), roughnessHeight_(pTraits::zero), roughnessConstant_(pTraits::zero), roughnessFudgeFactor_(pTraits::zero) @@ -65,6 +67,8 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + nuName_(ptf.nuName_), roughnessHeight_(ptf.roughnessHeight_), roughnessConstant_(ptf.roughnessConstant_), roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) @@ -80,6 +84,8 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + nuName_(dict.lookupOrDefault("nu", "nu")), roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) @@ -93,6 +99,8 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(tppsf), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_), roughnessHeight_(tppsf.roughnessHeight_), roughnessConstant_(tppsf.roughnessConstant_), roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) @@ -107,6 +115,8 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(tppsf, iF), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_), roughnessHeight_(tppsf.roughnessHeight_), roughnessConstant_(tppsf.roughnessConstant_), roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) @@ -130,13 +140,13 @@ void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); // The flow velocity at the adjacent cell centre. scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); scalarField& nutw = *this; scalarField magFaceGradU = mag(U.snGrad()); @@ -276,6 +286,8 @@ void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write ) const { fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); os.writeKeyword("roughnessHeight") << roughnessHeight_ << token::END_STATEMENT << nl; os.writeKeyword("roughnessConstant") diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H index 53a0478cff..f8c65f434c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -58,9 +58,22 @@ class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField { // Private data - scalar roughnessHeight_; - scalar roughnessConstant_; - scalar roughnessFudgeFactor_; + //- Name of velocity field + word UName_; + + //- Name of laminar viscosity field + word nuName_; + + // Roughness model parameters + + //- Height + scalar roughnessHeight_; + + //- Constant + scalar roughnessConstant_; + + //- Scale factor + scalar roughnessFudgeFactor_; public: @@ -143,38 +156,39 @@ public: // Access - //- Return the fluctuation scale + //- Return the roughness height const scalar& roughnessHeight() const { return roughnessHeight_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness height to allow adjustment scalar& roughnessHeight() { return roughnessHeight_; } - //- Return the fluctuation scale + //- Return the roughness constant scale const scalar& roughnessConstant() const { return roughnessConstant_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness constant to allow adjustment scalar& roughnessConstant() { return roughnessConstant_; } - //- Return the fluctuation scale + //- Return the roughness scale factor const scalar& roughnessFudgeFactor() const { return roughnessFudgeFactor_; } - //- Return reference to the fluctuation scale to allow adjustment + //- Return reference to the roughness scale factor to allow + // adjustment scalar& roughnessFudgeFactor() { return roughnessFudgeFactor_; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C index 8e181f439b..394c1ce7cf 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -48,7 +48,9 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + UName_("U"), + nuName_("nu") {} @@ -61,7 +63,9 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + nuName_(ptf.nuName_) {} @@ -73,7 +77,9 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + nuName_(dict.lookupOrDefault("nu", "nu")) {} @@ -83,7 +89,9 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(tppsf), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_) {} @@ -94,7 +102,9 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(tppsf, iF), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_) {} @@ -114,12 +124,12 @@ void nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); scalarField& nutw = *this; scalarField magFaceGradU = mag(U.snGrad()); @@ -155,6 +165,17 @@ void nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate } +void nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H index f96f7d927a..0ab4a7671a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -58,6 +58,12 @@ class nutSpalartAllmarasStandardWallFunctionFvPatchScalarField { // Private data + //- Name of velocity field + word UName_; + + //- Name of laminar viscosity field + word nuName_; + public: @@ -144,6 +150,9 @@ public: ( const Pstream::commsTypes commsType=Pstream::blocking ); + + //- Write + virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C index 420f7cd31c..112ae23025 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -48,7 +48,9 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + UName_("U"), + nuName_("nu") {} @@ -61,7 +63,9 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + nuName_(ptf.nuName_) {} @@ -73,7 +77,9 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + nuName_(dict.lookupOrDefault("nu", "nu")) {} @@ -83,7 +89,9 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField const nutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(tppsf), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_) {} @@ -94,7 +102,9 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(tppsf, iF), + UName_(tppsf.UName_), + nuName_(tppsf.nuName_) {} @@ -113,12 +123,12 @@ void nutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate const scalarField& ry = patch().deltaCoeffs(); const fvPatchVectorField& U = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); scalarField& nutw = *this; @@ -167,6 +177,17 @@ void nutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate } +void nutSpalartAllmarasWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField(fvPatchScalarField, nutSpalartAllmarasWallFunctionFvPatchScalarField); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H index b085c95346..5679a2c565 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -58,6 +58,12 @@ class nutSpalartAllmarasWallFunctionFvPatchScalarField { // Private data + //- Name of velocity field + word UName_; + + //- Name of laminar viscosity field + word nuName_; + public: @@ -137,6 +143,9 @@ public: ( const Pstream::commsTypes commsType=Pstream::blocking ); + + //- Write + virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 4498e25e26..8e89f18d96 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -48,7 +48,9 @@ nutWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + kName_("k"), + nuName_("nu") {} @@ -61,7 +63,9 @@ nutWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + kName_(ptf.kName_), + nuName_(ptf.nuName_) {} @@ -73,28 +77,34 @@ nutWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + kName_(dict.lookupOrDefault("k", "k")), + nuName_(dict.lookupOrDefault("nu", "nu")) {} nutWallFunctionFvPatchScalarField:: nutWallFunctionFvPatchScalarField ( - const nutWallFunctionFvPatchScalarField& tppsf + const nutWallFunctionFvPatchScalarField& nwfpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(nwfpsf), + kName_(nwfpsf.kName_), + nuName_(nwfpsf.nuName_) {} nutWallFunctionFvPatchScalarField:: nutWallFunctionFvPatchScalarField ( - const nutWallFunctionFvPatchScalarField& tppsf, + const nutWallFunctionFvPatchScalarField& nwfpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(nwfpsf, iF), + kName_(nwfpsf.kName_), + nuName_(nwfpsf.nuName_) {} @@ -112,10 +122,10 @@ void nutWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; - const volScalarField& k = db().lookupObject("k"); + const volScalarField& k = db().lookupObject(kName_); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); scalarField& nutw = *this; @@ -140,6 +150,8 @@ void nutWallFunctionFvPatchScalarField::updateCoeffs() void nutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H index 149ebdf321..6f77f7cbb1 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -57,6 +57,14 @@ class nutWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { + //Private data + + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of laminar viscosity field + word nuName_; + public: diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 84793a2c42..f6a3b6a191 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -64,7 +64,12 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedInternalValueFvPatchField(p, iF) + fixedInternalValueFvPatchField(p, iF), + UName_("U"), + kName_("k"), + GName_("G"), + nuName_("nu"), + nutName_("nut") { checkType(); } @@ -78,7 +83,12 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField(ptf, p, iF, mapper) + fixedInternalValueFvPatchField(ptf, p, iF, mapper), + UName_(ptf.UName_), + kName_(ptf.kName_), + GName_(ptf.GName_), + nuName_(ptf.nuName_), + nutName_(ptf.nutName_) { checkType(); } @@ -91,7 +101,12 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedInternalValueFvPatchField(p, iF, dict) + fixedInternalValueFvPatchField(p, iF, dict), + UName_(dict.lookupOrDefault("U", "U")), + kName_(dict.lookupOrDefault("k", "k")), + GName_(dict.lookupOrDefault("G", "G")), + nuName_(dict.lookupOrDefault("nu", "nu")), + nutName_(dict.lookupOrDefault("nut", "nut")) { checkType(); } @@ -99,10 +114,15 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ( - const omegaWallFunctionFvPatchScalarField& ewfpsf + const omegaWallFunctionFvPatchScalarField& owfpsf ) : - fixedInternalValueFvPatchField(ewfpsf) + fixedInternalValueFvPatchField(owfpsf), + UName_(owfpsf.UName_), + kName_(owfpsf.kName_), + GName_(owfpsf.GName_), + nuName_(owfpsf.nuName_), + nutName_(owfpsf.nutName_) { checkType(); } @@ -110,11 +130,16 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ( - const omegaWallFunctionFvPatchScalarField& ewfpsf, + const omegaWallFunctionFvPatchScalarField& owfpsf, const DimensionedField& iF ) : - fixedInternalValueFvPatchField(ewfpsf, iF) + fixedInternalValueFvPatchField(owfpsf, iF), + UName_(owfpsf.UName_), + kName_(owfpsf.kName_), + GName_(owfpsf.GName_), + nuName_(owfpsf.nuName_), + nutName_(owfpsf.nutName_) { checkType(); } @@ -135,21 +160,21 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& y = ras.y()[patch().index()]; volScalarField& G = const_cast - (db().lookupObject("G")); + (db().lookupObject(GName_)); volScalarField& omega = const_cast - (db().lookupObject("omega")); + (db().lookupObject(dimensionedInternalField().name())); - const scalarField& k = db().lookupObject("k"); + const scalarField& k = db().lookupObject(kName_); const scalarField& nuw = - patch().lookupPatchField("nu"); + patch().lookupPatchField(nuName_); const scalarField& nutw = - patch().lookupPatchField("nut"); + patch().lookupPatchField(nutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -183,6 +208,11 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField::write(os); + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "G", "G", GName_); + writeEntryIfDifferent(os, "nu", "nu", nuName_); + writeEntryIfDifferent(os, "nut", "nut", nutName_); writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index 37c8d90188..8f9e123ccf 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -55,6 +55,23 @@ class omegaWallFunctionFvPatchScalarField : public fixedInternalValueFvPatchField { + // Private data + + //- Name of velocity field + word UName_; + + //- Name of turbulence kinetic energy field + word kName_; + + //- Name of turbulence generation field + word GName_; + + //- Name of laminar viscosity field + word nuName_; + + //- Name of turbulent viscosity field + word nutName_; + // Private member functions diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C index ad8d3d14f7..a45ff8c33b 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C @@ -101,9 +101,6 @@ kOmega::kOmega ) ), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", dimless/dimTime, SMALL), - k_ ( IOobject @@ -271,7 +268,7 @@ void kOmega::correct() // Re-calculate viscosity - nut_ == k_/omega_; + nut_ == k_/(omega_ + omegaSmall_); nut_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H index d07d8a5fcb..649a13abe7 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H @@ -90,10 +90,6 @@ class kOmega dimensionedScalar alphaOmega_; - dimensionedScalar omega0_; - dimensionedScalar omegaSmall_; - - // Fields volScalarField k_; diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index a066017a64..6a737fce49 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -198,19 +198,6 @@ kOmegaSST::kOmegaSST ) ), - omega0_("omega0", dimless/dimTime, SMALL), - omegaSmall_("omegaSmall", dimless/dimTime, SMALL), - - Cmu_ - ( - dimensioned::lookupOrAddToDict - ( - "Cmu", - coeffDict_, - 0.09 - ) - ), - y_(mesh_), k_ @@ -331,7 +318,6 @@ bool kOmegaSST::read() betaStar_.readIfPresent(coeffDict_); a1_.readIfPresent(coeffDict_); c1_.readIfPresent(coeffDict_); - Cmu_.readIfPresent(coeffDict_); return true; } diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H index 8994b1ab3a..4563853801 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -57,7 +57,6 @@ Description @verbatim kOmegaSST { - Cmu 0.09; alphaK1 0.85034; alphaK2 1.0; alphaOmega1 0.5; @@ -103,33 +102,33 @@ class kOmegaSST { // Private data - dimensionedScalar alphaK1_; - dimensionedScalar alphaK2_; + // Model coefficients + dimensionedScalar alphaK1_; + dimensionedScalar alphaK2_; - dimensionedScalar alphaOmega1_; - dimensionedScalar alphaOmega2_; + dimensionedScalar alphaOmega1_; + dimensionedScalar alphaOmega2_; - dimensionedScalar gamma1_; - dimensionedScalar gamma2_; + dimensionedScalar gamma1_; + dimensionedScalar gamma2_; - dimensionedScalar beta1_; - dimensionedScalar beta2_; + dimensionedScalar beta1_; + dimensionedScalar beta2_; - dimensionedScalar betaStar_; + dimensionedScalar betaStar_; - dimensionedScalar a1_; - dimensionedScalar c1_; - - dimensionedScalar omega0_; - dimensionedScalar omegaSmall_; - - dimensionedScalar Cmu_; + dimensionedScalar a1_; + dimensionedScalar c1_; + //- Wall distance field + // Note: different to wall distance in parent RASModel wallDist y_; - volScalarField k_; - volScalarField omega_; - volScalarField nut_; + // Fields + + volScalarField k_; + volScalarField omega_; + volScalarField nut_; // Private member functions