reverted kappa and E back to dimensionedScalar, using new lookup functionality

This commit is contained in:
andy
2008-06-24 13:09:57 +01:00
committed by graham
parent a96b0970c1
commit a91f1315f0
20 changed files with 75 additions and 55 deletions

View File

@ -89,14 +89,24 @@ RASModel::RASModel
kappa_ kappa_
( (
subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar> dimensioned<scalar>::lookupOrAddToDict
( (
"kappa", "kappa",
subDict("wallFunctionCoeffs"),
0.4187 0.4187
) )
), ),
E_(subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>("E", 9.0)), E_
yPlusLam_(yPlusLam(kappa_, E_)), (
dimensioned<scalar>::lookupOrAddToDict
(
"E",
subDict("wallFunctionCoeffs"),
9.0
)
),
yPlusLam_(yPlusLam(kappa_.value(), E_.value())),
k0_("k0", dimVelocity*dimVelocity, SMALL), k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
@ -171,10 +181,10 @@ bool RASModel::read()
lookup("turbulence") >> turbulence_; lookup("turbulence") >> turbulence_;
coeffDict_ = subDict(type() + "Coeffs"); coeffDict_ = subDict(type() + "Coeffs");
subDict("wallFunctionCoeffs").readIfPresent<scalar>("kappa", kappa_); kappa_.readIfPresent(subDict("wallFunctionCoeffs"));
subDict("wallFunctionCoeffs").readIfPresent<scalar>("E", E_); E_.readIfPresent(subDict("wallFunctionCoeffs"));
yPlusLam_ = yPlusLam(kappa_, E_); yPlusLam_ = yPlusLam(kappa_.value(), E_.value());
readIfPresent("k0", k0_); readIfPresent("k0", k0_);
readIfPresent("epsilon0", epsilon0_); readIfPresent("epsilon0", epsilon0_);

View File

@ -91,8 +91,8 @@ protected:
Switch printCoeffs_; Switch printCoeffs_;
dictionary coeffDict_; dictionary coeffDict_;
scalar kappa_; dimensionedScalar kappa_;
scalar E_; dimensionedScalar E_;
scalar yPlusLam(const scalar kappa, const scalar E); scalar yPlusLam(const scalar kappa, const scalar E);
scalar yPlusLam_; scalar yPlusLam_;
@ -226,13 +226,13 @@ public:
//- Return kappa for use in wall-functions //- Return kappa for use in wall-functions
scalar kappa() const dimensionedScalar kappa() const
{ {
return kappa_; return kappa_;
} }
//- Return E for use in wall-functions //- Return E for use in wall-functions
scalar E() const dimensionedScalar E() const
{ {
return E_; return E_;
} }

View File

@ -89,7 +89,7 @@ Description
omega_[faceCelli] += omega_[faceCelli] +=
sqrt(k_[faceCelli]) sqrt(k_[faceCelli])
/(Cmu25*kappa_*y_[faceCelli]); /(Cmu25*kappa_.value()*y_[faceCelli]);
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
@ -97,7 +97,7 @@ Description
(mutw[facei] + muw[facei]) (mutw[facei] + muw[facei])
*magFaceGradU[facei] *magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli]) *Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[faceCelli]); /(kappa_.value()*y_[faceCelli]);
} }
} }
} }

View File

@ -58,7 +58,7 @@ Description
{ {
mutw[facei] = mutw[facei] =
muw[facei] muw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1); *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
} }
else else
{ {

View File

@ -123,14 +123,14 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties"); = db().lookupObject<RASModel>("RASProperties");
const scalar kappa = rasModel.kappa(); const scalar kappa = rasModel.kappa().value();
const scalar E = rasModel.E(); const scalar E = rasModel.E().value();
const scalar yPlusLam = 11.225; const scalar yPlusLam = 11.225;
// The reciprical of the distance to the adjacent cell centre. // The reciprical of the distance to the adjacent cell centre.
const scalarField& ry = patch().deltaCoeffs(); const scalarField& ry = patch().deltaCoeffs();
const fvPatchVectorField& U = const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, vector>("U"); patch().lookupPatchField<volVectorField, vector>("U");
const fvPatchScalarField& rho = const fvPatchScalarField& rho =
@ -139,7 +139,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
// The flow velocity at the adjacent cell centre. // The flow velocity at the adjacent cell centre.
scalarField magUp = mag(U.patchInternalField() - U); scalarField magUp = mag(U.patchInternalField() - U);
const scalarField& muw = const scalarField& muw =
patch().lookupPatchField<volScalarField, scalar>("mu"); patch().lookupPatchField<volScalarField, scalar>("mu");
scalarField& mutw = *this; scalarField& mutw = *this;
@ -155,7 +155,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
//if (KsPlusBasedOnYPlus_) //if (KsPlusBasedOnYPlus_)
{ {
// If KsPlus is based on YPlus the extra term added to the law // If KsPlus is based on YPlus the extra term added to the law
// of the wall will depend on yPlus. // of the wall will depend on yPlus.
forAll(mutw, facei) forAll(mutw, facei)
{ {
@ -206,7 +206,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
const scalar sint_2 = sin(t_2); const scalar sint_2 = sin(t_2);
const scalar logt_1 = log(t_1); const scalar logt_1 = log(t_1);
G = logt_1*sint_2; G = logt_1*sint_2;
yPlusGPrime = yPlusGPrime =
(c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2));
} }
@ -268,7 +268,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001
&& ++iter < 10 && ++iter < 10
); );
if (yPlus > yPlusLam) if (yPlus > yPlusLam)
{ {
mutw[facei] = muw[facei]*(yPlus*yPlus/Re - 1); mutw[facei] = muw[facei]*(yPlus*yPlus/Re - 1);
@ -291,7 +291,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
<< roughnessConstant_ << token::END_STATEMENT << nl; << roughnessConstant_ << token::END_STATEMENT << nl;
os.writeKeyword("roughnessFudgeFactor") os.writeKeyword("roughnessFudgeFactor")
<< roughnessFudgeFactor_ << token::END_STATEMENT << nl; << roughnessFudgeFactor_ << token::END_STATEMENT << nl;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -90,7 +90,7 @@ Description
epsilon_[faceCelli] += epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5) Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*RASModel::y_[patchi][facei]); /(kappa_.value()*RASModel::y_[patchi][facei]);
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
@ -98,7 +98,7 @@ Description
(mutw[facei] + muw[facei]) (mutw[facei] + muw[facei])
*magFaceGradU[facei] *magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli]) *Cmu25*sqrt(k_[faceCelli])
/(kappa_*RASModel::y_[patchi][facei]); /(kappa_.value()*RASModel::y_[patchi][facei]);
} }
} }
} }

View File

@ -58,7 +58,7 @@ Description
{ {
mutw[facei] = mutw[facei] =
muw[facei] muw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1); *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
} }
else else
{ {

View File

@ -43,7 +43,7 @@
epsilon_[faceCelli] += epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5) Cmu75*pow(k_[faceCelli], 1.5)
/( /(
kappa_*y_[faceCelli] kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli])) *(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli]))
) )
*exp(-Amu_.value()*sqr(yStar_[faceCelli])); *exp(-Amu_.value()*sqr(yStar_[faceCelli]));

View File

@ -43,7 +43,7 @@
epsilon_[faceCelli] += epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5) Cmu75*pow(k_[faceCelli], 1.5)
/( /(
kappa_*y_[faceCelli] kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon*yStar_[faceCelli])) *(1.0 - exp(-Aepsilon*yStar_[faceCelli]))
) )
*exp(-Amu*sqr(yStar_[faceCelli])); *exp(-Amu*sqr(yStar_[faceCelli]));

View File

@ -85,14 +85,24 @@ RASModel::RASModel
kappa_ kappa_
( (
subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar> dimensioned<scalar>::lookupOrAddToDict
( (
"kappa", "kappa",
subDict("wallFunctionCoeffs"),
0.4187 0.4187
) )
), ),
E_(subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>("E", 9.0)), E_
yPlusLam_(yPlusLam(kappa_, E_)), (
dimensioned<scalar>::lookupOrAddToDict
(
"E",
subDict("wallFunctionCoeffs"),
9.0
)
),
yPlusLam_(yPlusLam(kappa_.value(), E_.value())),
k0_("k0", dimVelocity*dimVelocity, SMALL), k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
@ -168,14 +178,14 @@ bool RASModel::read()
lookup("turbulence") >> turbulence_; lookup("turbulence") >> turbulence_;
coeffDict_ = subDict(type() + "Coeffs"); coeffDict_ = subDict(type() + "Coeffs");
subDict("wallFunctionCoeffs").readIfPresent<scalar>("kappa", kappa_); kappa_.readIfPresent(subDict("wallFunctionCoeffs"));
subDict("wallFunctionCoeffs").readIfPresent<scalar>("E", E_); E_.readIfPresent(subDict("wallFunctionCoeffs"));
yPlusLam_ = yPlusLam(kappa_, E_); yPlusLam_ = yPlusLam(kappa_.value(), E_.value());
readIfPresent("k0", k0_); k0_.readIfPresent(*this);
readIfPresent("epsilon0", epsilon0_); epsilon0_.readIfPresent(*this);
readIfPresent("epsilonSmall", epsilonSmall_); epsilonSmall_.readIfPresent(*this);
return true; return true;
} }

View File

@ -88,8 +88,8 @@ protected:
Switch printCoeffs_; Switch printCoeffs_;
dictionary coeffDict_; dictionary coeffDict_;
scalar kappa_; dimensionedScalar kappa_;
scalar E_; dimensionedScalar E_;
scalar yPlusLam(const scalar kappa, const scalar E); scalar yPlusLam(const scalar kappa, const scalar E);
scalar yPlusLam_; scalar yPlusLam_;
@ -213,13 +213,13 @@ public:
//- Return kappa for use in wall-functions //- Return kappa for use in wall-functions
scalar kappa() const dimensionedScalar kappa() const
{ {
return kappa_; return kappa_;
} }
//- Return E for use in wall-functions //- Return E for use in wall-functions
scalar E() const dimensionedScalar E() const
{ {
return E_; return E_;
} }

View File

@ -87,7 +87,7 @@ Description
omega_[faceCelli] += omega_[faceCelli] +=
sqrt(k_[faceCelli]) sqrt(k_[faceCelli])
/(Cmu25*kappa_*y_[faceCelli]); /(Cmu25*kappa_.value()*y_[faceCelli]);
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
@ -95,7 +95,7 @@ Description
(nutw[facei] + nuw[facei]) (nutw[facei] + nuw[facei])
*magFaceGradU[facei] *magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli]) *Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[faceCelli]); /(kappa_.value()*y_[faceCelli]);
} }
} }
} }

View File

@ -55,7 +55,7 @@ Description
{ {
nutw[facei] = nutw[facei] =
nuw[facei] nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1); *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
} }
else else
{ {

View File

@ -89,7 +89,7 @@ Description
epsilon_[faceCelli] += epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5) Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*y_[patchi][facei]); /(kappa_.value()*y_[patchi][facei]);
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
@ -97,7 +97,7 @@ Description
(nutw[facei] + nuw[facei]) (nutw[facei] + nuw[facei])
*magFaceGradU[facei] *magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli]) *Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[patchi][facei]) /(kappa_.value()*y_[patchi][facei])
- (nonlinearStress_[faceCelli] && gradU_[faceCelli]); - (nonlinearStress_[faceCelli] && gradU_[faceCelli]);
} }
} }

View File

@ -123,8 +123,8 @@ void nutStandardRoughWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties"); = db().lookupObject<RASModel>("RASProperties");
const scalar kappa = rasModel.kappa(); const scalar kappa = rasModel.kappa().value();
const scalar E = rasModel.E(); const scalar E = rasModel.E().value();
const scalar yPlusLam = 11.225; const scalar yPlusLam = 11.225;
// The reciprical of the distance to the adjacent cell centre. // The reciprical of the distance to the adjacent cell centre.

View File

@ -108,9 +108,9 @@ void nutStandardWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties"); = db().lookupObject<RASModel>("RASProperties");
scalar kappa = rasModel.kappa(); scalar kappa = rasModel.kappa().value();
scalar E = rasModel.E(); scalar E = rasModel.E().value();
scalar yPlusLam = rasModel.E(); scalar yPlusLam = rasModel.E().value();
const scalarField& ry = patch().deltaCoeffs(); const scalarField& ry = patch().deltaCoeffs();

View File

@ -100,8 +100,8 @@ void nutWallFunctionFvPatchScalarField::evaluate(const Pstream::commsTypes)
const RASModel& rasModel const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties"); = db().lookupObject<RASModel>("RASProperties");
scalar kappa = rasModel.kappa(); scalar kappa = rasModel.kappa().value();
scalar E = rasModel.E(); scalar E = rasModel.E().value();
const scalarField& ry = patch().deltaCoeffs(); const scalarField& ry = patch().deltaCoeffs();

View File

@ -88,7 +88,7 @@ Description
epsilon_[faceCelli] += epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5) Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*RASModel::y_[patchi][facei]); /(kappa_.value()*RASModel::y_[patchi][facei]);
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
@ -96,7 +96,7 @@ Description
(nutw[facei] + nuw[facei]) (nutw[facei] + nuw[facei])
*magFaceGradU[facei] *magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli]) *Cmu25*sqrt(k_[faceCelli])
/(kappa_*RASModel::y_[patchi][facei]); /(kappa_.value()*RASModel::y_[patchi][facei]);
} }
} }
} }

View File

@ -55,7 +55,7 @@ Description
if (yPlus > yPlusLam_) if (yPlus > yPlusLam_)
{ {
nutw[facei] = nuw[facei] nutw[facei] = nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1); *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
} }
else else
{ {

View File

@ -55,7 +55,7 @@ Description
{ {
nutw[facei] = nutw[facei] =
nuw[facei] nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1); *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
} }
else else
{ {