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 a4f0bd13f751fb797a6d1668f901b6c179f19db6..ae8a57c303d3c686212acb5c8f5175c677c9bad2 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<scalar, volMesh>& iF ) : - fixedInternalValueFvPatchField<scalar>(p, iF) + fixedInternalValueFvPatchField<scalar>(p, iF), + UName_("U"), + kName_("k"), + GName_("G"), + nuName_("nu"), + nutName_("nut") { checkType(); } @@ -78,7 +83,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) + fixedInternalValueFvPatchField<scalar>(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<scalar>(p, iF, dict) + fixedInternalValueFvPatchField<scalar>(p, iF, dict), + UName_(dict.lookupOrDefault<word>("U", "U")), + kName_(dict.lookupOrDefault<word>("k", "k")), + GName_(dict.lookupOrDefault<word>("G", "G")), + nuName_(dict.lookupOrDefault<word>("nu", "nu")), + nutName_(dict.lookupOrDefault<word>("nut", "nut")) { checkType(); } @@ -102,7 +117,12 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField const epsilonWallFunctionFvPatchScalarField& ewfpsf ) : - fixedInternalValueFvPatchField<scalar>(ewfpsf) + fixedInternalValueFvPatchField<scalar>(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<scalar, volMesh>& iF ) : - fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) + fixedInternalValueFvPatchField<scalar>(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<volScalarField&> - (db().lookupObject<volScalarField>("G")); + (db().lookupObject<volScalarField>(GName_)); volScalarField& epsilon = const_cast<volScalarField&> - (db().lookupObject<volScalarField>("epsilon")); + (db().lookupObject<volScalarField>(dimensionedInternalField().name())); - const volScalarField& k = db().lookupObject<volScalarField>("k"); + const volScalarField& k = db().lookupObject<volScalarField>(kName_); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); const scalarField& nutw = - patch().lookupPatchField<volScalarField, scalar>("nut"); + patch().lookupPatchField<volScalarField, scalar>(nutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField<volVectorField, vector>("U"); + patch().lookupPatchField<volVectorField, vector>(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -192,6 +217,11 @@ void epsilonWallFunctionFvPatchScalarField::evaluate void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField<scalar>::write(os); + writeEntryIfDifferent<word>(os, "U", "U", UName_); + writeEntryIfDifferent<word>(os, "k", "k", kName_); + writeEntryIfDifferent<word>(os, "G", "G", GName_); + writeEntryIfDifferent<word>(os, "nu", "nu", nuName_); + writeEntryIfDifferent<word>(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 7e81a50a342a6029ecff4673fcc9c4ed4c687ebc..4dbdf40d1650b904fd2438174c0c0eacb20b5788 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<scalar> { + // 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 a62e333f1f165b9204036a73470ceb2107d3c5ff..138e78333305a6694d5c48d47f2d3a6df920d99b 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<word>("k", "k")), + nuName_(dict.lookupOrDefault<word>("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<volScalarField>("k"); + const scalarField& k = db().lookupObject<volScalarField>(kName_); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); scalarField& nutw = *this; @@ -226,6 +236,8 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs() void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); + writeEntryIfDifferent<word>(os, "k", "k", kName_); + writeEntryIfDifferent<word>(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 0263c145d09094a9ec4cb69792061cf45d57bca3..968c5c3f8f86612779651182cc3a6f733dd1ec92 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 a7bd44016d026b84e85cb7006f49d8678de4acf8..2d7bfc9cd2d842d2b067f97aa62b3beda323813e 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<scalar>::zero), roughnessConstant_(pTraits<scalar>::zero), roughnessFudgeFactor_(pTraits<scalar>::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<word>("U", "U")), + nuName_(dict.lookupOrDefault<word>("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<volVectorField, vector>("U"); + patch().lookupPatchField<volVectorField, vector>(UName_); // The flow velocity at the adjacent cell centre. scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); scalarField& nutw = *this; scalarField magFaceGradU = mag(U.snGrad()); @@ -276,6 +286,8 @@ void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write ) const { fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent<word>(os, "U", "U", UName_); + writeEntryIfDifferent<word>(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 53a0478cffd2ecfe0fc9ab12b723a651f8d7aea8..f8c65f434cd49043d544120a8df7d928da30eeeb 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 8e181f439b643bc7795bb5459b0bf85f9f493d4d..394c1ce7cf34c50866e65895ff22eeb13226199c 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<scalar, volMesh>& 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<word>("U", "U")), + nuName_(dict.lookupOrDefault<word>("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<scalar, volMesh>& 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<volVectorField, vector>("U"); + patch().lookupPatchField<volVectorField, vector>(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(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<word>(os, "U", "U", UName_); + writeEntryIfDifferent<word>(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 f96f7d927a3a63c3ac418c425a8ce6d652fa02af..0ab4a7671a1bdb4249a2c00df6de0137fc7319c9 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 420f7cd31c4704a2359a8ab7e82f69f0c4e0ffd2..112ae230257d55f6c81714205038bc0118ec7fc6 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<scalar, volMesh>& 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<word>("U", "U")), + nuName_(dict.lookupOrDefault<word>("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<scalar, volMesh>& 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<volVectorField, vector>("U"); + patch().lookupPatchField<volVectorField, vector>(UName_); scalarField magUp = mag(U.patchInternalField() - U); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); scalarField& nutw = *this; @@ -167,6 +177,17 @@ void nutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate } +void nutSpalartAllmarasWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + writeEntryIfDifferent<word>(os, "U", "U", UName_); + writeEntryIfDifferent<word>(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 b085c95346b0725b4af16fd22787c209fb21d1d2..5679a2c565c055ed0012b5966b9844066a1d45ce 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 4498e25e266b480d831cd7fc9e0242a8837bcbbc..8e89f18d9696ff3038040ceb9b01b56a0ad1cd96 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<scalar, volMesh>& 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<word>("k", "k")), + nuName_(dict.lookupOrDefault<word>("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<scalar, volMesh>& 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<volScalarField>("k"); + const volScalarField& k = db().lookupObject<volScalarField>(kName_); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); scalarField& nutw = *this; @@ -140,6 +150,8 @@ void nutWallFunctionFvPatchScalarField::updateCoeffs() void nutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); + writeEntryIfDifferent<word>(os, "k", "k", kName_); + writeEntryIfDifferent<word>(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 149ebdf3214599880e98dd971b8c2bf4bedcf0ee..6f77f7cbb1af6056fdbd210bad8c7944fd2f6686 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 84793a2c4208e2d33e42be64826b625ba8658da1..f6a3b6a191fdeeef6fb8de8d729259989d129183 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<scalar, volMesh>& iF ) : - fixedInternalValueFvPatchField<scalar>(p, iF) + fixedInternalValueFvPatchField<scalar>(p, iF), + UName_("U"), + kName_("k"), + GName_("G"), + nuName_("nu"), + nutName_("nut") { checkType(); } @@ -78,7 +83,12 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) + fixedInternalValueFvPatchField<scalar>(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<scalar>(p, iF, dict) + fixedInternalValueFvPatchField<scalar>(p, iF, dict), + UName_(dict.lookupOrDefault<word>("U", "U")), + kName_(dict.lookupOrDefault<word>("k", "k")), + GName_(dict.lookupOrDefault<word>("G", "G")), + nuName_(dict.lookupOrDefault<word>("nu", "nu")), + nutName_(dict.lookupOrDefault<word>("nut", "nut")) { checkType(); } @@ -99,10 +114,15 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ( - const omegaWallFunctionFvPatchScalarField& ewfpsf + const omegaWallFunctionFvPatchScalarField& owfpsf ) : - fixedInternalValueFvPatchField<scalar>(ewfpsf) + fixedInternalValueFvPatchField<scalar>(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<scalar, volMesh>& iF ) : - fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) + fixedInternalValueFvPatchField<scalar>(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<volScalarField&> - (db().lookupObject<volScalarField>("G")); + (db().lookupObject<volScalarField>(GName_)); volScalarField& omega = const_cast<volScalarField&> - (db().lookupObject<volScalarField>("omega")); + (db().lookupObject<volScalarField>(dimensionedInternalField().name())); - const scalarField& k = db().lookupObject<volScalarField>("k"); + const scalarField& k = db().lookupObject<volScalarField>(kName_); const scalarField& nuw = - patch().lookupPatchField<volScalarField, scalar>("nu"); + patch().lookupPatchField<volScalarField, scalar>(nuName_); const scalarField& nutw = - patch().lookupPatchField<volScalarField, scalar>("nut"); + patch().lookupPatchField<volScalarField, scalar>(nutName_); const fvPatchVectorField& Uw = - patch().lookupPatchField<volVectorField, vector>("U"); + patch().lookupPatchField<volVectorField, vector>(UName_); const scalarField magGradUw = mag(Uw.snGrad()); @@ -183,6 +208,11 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const { fixedInternalValueFvPatchField<scalar>::write(os); + writeEntryIfDifferent<word>(os, "U", "U", UName_); + writeEntryIfDifferent<word>(os, "k", "k", kName_); + writeEntryIfDifferent<word>(os, "G", "G", GName_); + writeEntryIfDifferent<word>(os, "nu", "nu", nuName_); + writeEntryIfDifferent<word>(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 37c8d90188a9e913c6e5c13795e83cda5ac53308..8f9e123ccfc0e5678c2ec68a663e868500fad9ca 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<scalar> { + // 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