From e2968b6a36c636c7f1a90209640aad2a4f06714b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 31 Jul 2009 17:34:49 +0200 Subject: [PATCH] file-scoped (static const) variables for default turbulence parameters - avoids raw values sprinkled about the code eg, 'defaultKappa_' vs. '0.41' --- ...ayatillekeWallFunctionFvPatchScalarField.C | 25 +++++++++++------- .../muSgsWallFunctionFvPatchScalarField.C | 20 +++++++++----- ...ngLengthFrequencyInletFvPatchScalarField.C | 10 +++++-- .../alphatWallFunctionFvPatchScalarField.C | 12 ++++++--- .../epsilonWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- .../mutWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- .../omegaWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- .../nuSgsWallFunctionFvPatchScalarField.C | 19 +++++++++----- ...ngLengthFrequencyInletFvPatchScalarField.C | 10 +++++-- .../epsilonWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- .../nutWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- .../omegaWallFunctionFvPatchScalarField.C | 26 ++++++++++++------- 12 files changed, 170 insertions(+), 82 deletions(-) diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C index 624bf819d8..66fb1ae6e8 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C @@ -46,6 +46,13 @@ scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0; scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01; label alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10; +//! @cond fileScope +static const scalar defaultPrt_(0.85); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void alphaSgsJayatillekeWallFunctionFvPatchScalarField::checkType() @@ -114,9 +121,9 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - Prt_(0.85), - kappa_(0.41), - E_(9.8) + Prt_(defaultPrt_), + kappa_(defaultKappa_), + E_(defaultE_) { checkType(); } @@ -147,9 +154,9 @@ alphaSgsJayatillekeWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), - Prt_(dict.lookupOrDefault("Prt", 0.85)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + Prt_(dict.lookupOrDefault("Prt", defaultPrt_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) { checkType(); } @@ -311,9 +318,9 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - writeEntryIfDifferent(os, "Prt", 0.85, Prt_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Prt", defaultPrt_, Prt_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C index 3f3c56c4cd..e6c779a105 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C @@ -39,6 +39,14 @@ namespace compressible namespace LESModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField @@ -51,8 +59,8 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField UName_("U"), rhoName_("rho"), muName_("mu"), - kappa_(0.41), - E_(9.8) + kappa_(defaultKappa_), + E_(defaultE_) {} @@ -84,8 +92,8 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField UName_(dict.lookupOrDefault("U", "U")), rhoName_(dict.lookupOrDefault("rho", "rho")), muName_(dict.lookupOrDefault("mu", "mu")), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) {} @@ -197,8 +205,8 @@ void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntryIfDifferent(os, "mu", "mu", muName_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 27f2ee8cc8..1beb48840a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -38,6 +38,12 @@ namespace Foam namespace compressible { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +//! @endcond fileScope + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // turbulentMixingLengthFrequencyInletFvPatchScalarField:: @@ -48,7 +54,7 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField ) : fixedValueFvPatchField(p, iF), - mixingLength_(0.0), + mixingLength_(0.001), kName_("k") {} @@ -116,7 +122,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + rasModel.coeffDict().lookupOrDefault("Cmu", defaultCmu_); const scalar Cmu25 = pow(Cmu, 0.25); 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 c06ae66c71..676850c3cd 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -38,6 +38,12 @@ namespace compressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultPrt_(0.85); +//! @endcond fileScope + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // alphatWallFunctionFvPatchScalarField:: @@ -49,7 +55,7 @@ alphatWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(p, iF), mutName_("mut"), - Prt_(0.85) + Prt_(defaultPrt_) {} @@ -78,7 +84,7 @@ alphatWallFunctionFvPatchScalarField : fixedValueFvPatchScalarField(p, iF, dict), mutName_(dict.lookupOrDefault("mut", "mut")), - Prt_(dict.lookupOrDefault("Prt", 0.85)) + Prt_(dict.lookupOrDefault("Prt", defaultPrt_)) {} @@ -122,7 +128,7 @@ void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeEntryIfDifferent(os, "mut", "mut", mutName_); - writeEntryIfDifferent(os, "Prt", 0.85, Prt_); + writeEntryIfDifferent(os, "Prt", defaultPrt_, Prt_); writeEntry("value", os); } 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 f68c7db44a..bafabf5943 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace compressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void epsilonWallFunctionFvPatchScalarField::checkType() @@ -71,9 +79,9 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField rhoName_("rho"), muName_("mu"), mutName_("mut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8) + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_) { checkType(); } @@ -116,9 +124,9 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField rhoName_(dict.lookupOrDefault("rho", "rho")), muName_(dict.lookupOrDefault("mu", "mu")), mutName_(dict.lookupOrDefault("mut", "mut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) { checkType(); } @@ -247,9 +255,9 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "mu", "mu", muName_); writeEntryIfDifferent(os, "mut", "mut", mutName_); - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } 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 3413844d44..701a74291c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace compressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void mutWallFunctionFvPatchScalarField::checkType() @@ -107,9 +115,9 @@ tmp mutWallFunctionFvPatchScalarField::calcMut() const void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); } @@ -122,9 +130,9 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_), yPlusLam_(calcYPlusLam(kappa_, E_)) {} @@ -153,9 +161,9 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)), yPlusLam_(calcYPlusLam(kappa_, E_)) {} 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 950dd45938..01489c3917 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace compressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void omegaWallFunctionFvPatchScalarField::checkType() @@ -71,9 +79,9 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField GName_("RASModel::G"), muName_("mu"), mutName_("mut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8) + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_) { checkType(); } @@ -116,9 +124,9 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField GName_(dict.lookupOrDefault("G", "RASModel::G")), muName_(dict.lookupOrDefault("mu", "mu")), mutName_(dict.lookupOrDefault("mut", "mut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) { checkType(); } @@ -236,9 +244,9 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "mu", "mu", muName_); writeEntryIfDifferent(os, "mut", "mut", mutName_); - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C index 6b65ce3275..aeabcca8a2 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C @@ -38,6 +38,13 @@ namespace incompressible namespace LESModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // nuSgsWallFunctionFvPatchScalarField:: @@ -50,8 +57,8 @@ nuSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_("U"), nuName_("nu"), - kappa_(0.41), - E_(9.8) + kappa_(defaultKappa_), + E_(defaultE_) {} @@ -83,8 +90,8 @@ nuSgsWallFunctionFvPatchScalarField fixedValueFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault("U", "U")), nuName_(dict.lookupOrDefault("nu", "nu")), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) {} @@ -189,8 +196,8 @@ void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "nu", "nu", nuName_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index e59e51125c..e4b7c01b06 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -38,6 +38,12 @@ namespace Foam namespace incompressible { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +//! @endcond fileScope + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // turbulentMixingLengthFrequencyInletFvPatchScalarField:: @@ -116,7 +122,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + rasModel.coeffDict().lookupOrDefault("Cmu", defaultCmu_); const scalar Cmu25 = pow(Cmu, 0.25); @@ -137,7 +143,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write fvPatchField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - writeEntryIfDifferent(os, "k", "k", kName_); + writeEntryIfDifferent(os, "k", "k", kName_); writeEntry("value", os); } 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 a6e221842f..e1786de417 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace incompressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void epsilonWallFunctionFvPatchScalarField::checkType() @@ -70,9 +78,9 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_("RASModel::G"), nuName_("nu"), nutName_("nut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8) + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_) { checkType(); } @@ -113,9 +121,9 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField GName_(dict.lookupOrDefault("G", "RASModel::G")), nuName_(dict.lookupOrDefault("nu", "nu")), nutName_(dict.lookupOrDefault("nut", "nut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) { checkType(); } @@ -235,9 +243,9 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "nu", "nu", nuName_); writeEntryIfDifferent(os, "nut", "nut", nutName_); - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); } 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 af131ecb9e..466ce5580c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace incompressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void nutWallFunctionFvPatchScalarField::checkType() @@ -106,9 +114,9 @@ tmp nutWallFunctionFvPatchScalarField::calcNut() const void nutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); } @@ -121,9 +129,9 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_), yPlusLam_(calcYPlusLam(kappa_, E_)) { checkType(); @@ -156,9 +164,9 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ) : fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)), yPlusLam_(calcYPlusLam(kappa_, E_)) { checkType(); 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 1c41104c37..1ba2d3d0db 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -40,6 +40,14 @@ namespace incompressible namespace RASModels { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//! @cond fileScope +static const scalar defaultCmu_(0.09); +static const scalar defaultKappa_(0.41); +static const scalar defaultE_(9.8); +//! @endcond fileScope + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void omegaWallFunctionFvPatchScalarField::checkType() @@ -70,9 +78,9 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField GName_("RASModel::G"), nuName_("nu"), nutName_("nut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8) + Cmu_(defaultCmu_), + kappa_(defaultKappa_), + E_(defaultE_) { checkType(); } @@ -113,9 +121,9 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField GName_(dict.lookupOrDefault("G", "RASModel::G")), nuName_(dict.lookupOrDefault("nu", "nu")), nutName_(dict.lookupOrDefault("nut", "nut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)) + Cmu_(dict.lookupOrDefault("Cmu", defaultCmu_)), + kappa_(dict.lookupOrDefault("kappa", defaultKappa_)), + E_(dict.lookupOrDefault("E", defaultE_)) { checkType(); } @@ -225,9 +233,9 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "nu", "nu", nuName_); writeEntryIfDifferent(os, "nut", "nut", nutName_); - writeEntryIfDifferent(os, "Cmu", 0.09, Cmu_); - writeEntryIfDifferent(os, "kappa", 0.41, kappa_); - writeEntryIfDifferent(os, "E", 9.8, E_); + writeEntryIfDifferent(os, "Cmu", defaultCmu_, Cmu_); + writeEntryIfDifferent(os, "kappa", defaultKappa_, kappa_); + writeEntryIfDifferent(os, "E", defaultE_, E_); writeEntry("value", os); }