Commit fb5f66ee authored by Andrew Heather's avatar Andrew Heather
Browse files

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

parent 68346506
......@@ -89,14 +89,24 @@ RASModel::RASModel
kappa_
(
subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
subDict("wallFunctionCoeffs"),
0.4187
)
),
E_(subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>("E", 9.0)),
yPlusLam_(yPlusLam(kappa_, E_)),
E_
(
dimensioned<scalar>::lookupOrAddToDict
(
"E",
subDict("wallFunctionCoeffs"),
9.0
)
),
yPlusLam_(yPlusLam(kappa_.value(), E_.value())),
k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
......@@ -171,10 +181,10 @@ bool RASModel::read()
lookup("turbulence") >> turbulence_;
coeffDict_ = subDict(type() + "Coeffs");
subDict("wallFunctionCoeffs").readIfPresent<scalar>("kappa", kappa_);
subDict("wallFunctionCoeffs").readIfPresent<scalar>("E", E_);
kappa_.readIfPresent(subDict("wallFunctionCoeffs"));
E_.readIfPresent(subDict("wallFunctionCoeffs"));
yPlusLam_ = yPlusLam(kappa_, E_);
yPlusLam_ = yPlusLam(kappa_.value(), E_.value());
readIfPresent("k0", k0_);
readIfPresent("epsilon0", epsilon0_);
......
......@@ -91,8 +91,8 @@ protected:
Switch printCoeffs_;
dictionary coeffDict_;
scalar kappa_;
scalar E_;
dimensionedScalar kappa_;
dimensionedScalar E_;
scalar yPlusLam(const scalar kappa, const scalar E);
scalar yPlusLam_;
......@@ -226,13 +226,13 @@ public:
//- Return kappa for use in wall-functions
scalar kappa() const
dimensionedScalar kappa() const
{
return kappa_;
}
//- Return E for use in wall-functions
scalar E() const
dimensionedScalar E() const
{
return E_;
}
......
......@@ -89,7 +89,7 @@ Description
omega_[faceCelli] +=
sqrt(k_[faceCelli])
/(Cmu25*kappa_*y_[faceCelli]);
/(Cmu25*kappa_.value()*y_[faceCelli]);
if (yPlus > yPlusLam_)
{
......@@ -97,7 +97,7 @@ Description
(mutw[facei] + muw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[faceCelli]);
/(kappa_.value()*y_[faceCelli]);
}
}
}
......
......@@ -58,7 +58,7 @@ Description
{
mutw[facei] =
muw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1);
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
......
......@@ -123,14 +123,14 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties");
const scalar kappa = rasModel.kappa();
const scalar E = rasModel.E();
const scalar kappa = rasModel.kappa().value();
const scalar E = rasModel.E().value();
const scalar yPlusLam = 11.225;
// The reciprical of the distance to the adjacent cell centre.
const scalarField& ry = patch().deltaCoeffs();
const fvPatchVectorField& U =
const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, vector>("U");
const fvPatchScalarField& rho =
......@@ -139,7 +139,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
// The flow velocity at the adjacent cell centre.
scalarField magUp = mag(U.patchInternalField() - U);
const scalarField& muw =
const scalarField& muw =
patch().lookupPatchField<volScalarField, scalar>("mu");
scalarField& mutw = *this;
......@@ -155,7 +155,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
//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.
forAll(mutw, facei)
{
......@@ -206,7 +206,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::evaluate
const scalar sint_2 = sin(t_2);
const scalar logt_1 = log(t_1);
G = logt_1*sint_2;
yPlusGPrime =
yPlusGPrime =
(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
&& ++iter < 10
);
if (yPlus > yPlusLam)
{
mutw[facei] = muw[facei]*(yPlus*yPlus/Re - 1);
......@@ -291,7 +291,7 @@ void mutStandardRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
<< roughnessConstant_ << token::END_STATEMENT << nl;
os.writeKeyword("roughnessFudgeFactor")
<< roughnessFudgeFactor_ << token::END_STATEMENT << nl;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -90,7 +90,7 @@ Description
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*RASModel::y_[patchi][facei]);
/(kappa_.value()*RASModel::y_[patchi][facei]);
if (yPlus > yPlusLam_)
{
......@@ -98,7 +98,7 @@ Description
(mutw[facei] + muw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_*RASModel::y_[patchi][facei]);
/(kappa_.value()*RASModel::y_[patchi][facei]);
}
}
}
......
......@@ -58,7 +58,7 @@ Description
{
mutw[facei] =
muw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1);
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
......
......@@ -43,7 +43,7 @@
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(
kappa_*y_[faceCelli]
kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli]))
)
*exp(-Amu_.value()*sqr(yStar_[faceCelli]));
......
......@@ -43,7 +43,7 @@
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(
kappa_*y_[faceCelli]
kappa_.value()*y_[faceCelli]
*(1.0 - exp(-Aepsilon*yStar_[faceCelli]))
)
*exp(-Amu*sqr(yStar_[faceCelli]));
......
......@@ -85,14 +85,24 @@ RASModel::RASModel
kappa_
(
subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>
dimensioned<scalar>::lookupOrAddToDict
(
"kappa",
subDict("wallFunctionCoeffs"),
0.4187
)
),
E_(subDict("wallFunctionCoeffs").lookupOrAddDefault<scalar>("E", 9.0)),
yPlusLam_(yPlusLam(kappa_, E_)),
E_
(
dimensioned<scalar>::lookupOrAddToDict
(
"E",
subDict("wallFunctionCoeffs"),
9.0
)
),
yPlusLam_(yPlusLam(kappa_.value(), E_.value())),
k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
......@@ -168,14 +178,14 @@ bool RASModel::read()
lookup("turbulence") >> turbulence_;
coeffDict_ = subDict(type() + "Coeffs");
subDict("wallFunctionCoeffs").readIfPresent<scalar>("kappa", kappa_);
subDict("wallFunctionCoeffs").readIfPresent<scalar>("E", E_);
kappa_.readIfPresent(subDict("wallFunctionCoeffs"));
E_.readIfPresent(subDict("wallFunctionCoeffs"));
yPlusLam_ = yPlusLam(kappa_, E_);
yPlusLam_ = yPlusLam(kappa_.value(), E_.value());
readIfPresent("k0", k0_);
readIfPresent("epsilon0", epsilon0_);
readIfPresent("epsilonSmall", epsilonSmall_);
k0_.readIfPresent(*this);
epsilon0_.readIfPresent(*this);
epsilonSmall_.readIfPresent(*this);
return true;
}
......
......@@ -88,8 +88,8 @@ protected:
Switch printCoeffs_;
dictionary coeffDict_;
scalar kappa_;
scalar E_;
dimensionedScalar kappa_;
dimensionedScalar E_;
scalar yPlusLam(const scalar kappa, const scalar E);
scalar yPlusLam_;
......@@ -213,13 +213,13 @@ public:
//- Return kappa for use in wall-functions
scalar kappa() const
dimensionedScalar kappa() const
{
return kappa_;
}
//- Return E for use in wall-functions
scalar E() const
dimensionedScalar E() const
{
return E_;
}
......
......@@ -87,7 +87,7 @@ Description
omega_[faceCelli] +=
sqrt(k_[faceCelli])
/(Cmu25*kappa_*y_[faceCelli]);
/(Cmu25*kappa_.value()*y_[faceCelli]);
if (yPlus > yPlusLam_)
{
......@@ -95,7 +95,7 @@ Description
(nutw[facei] + nuw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[faceCelli]);
/(kappa_.value()*y_[faceCelli]);
}
}
}
......
......@@ -55,7 +55,7 @@ Description
{
nutw[facei] =
nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1);
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
......
......@@ -89,7 +89,7 @@ Description
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*y_[patchi][facei]);
/(kappa_.value()*y_[patchi][facei]);
if (yPlus > yPlusLam_)
{
......@@ -97,7 +97,7 @@ Description
(nutw[facei] + nuw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_*y_[patchi][facei])
/(kappa_.value()*y_[patchi][facei])
- (nonlinearStress_[faceCelli] && gradU_[faceCelli]);
}
}
......
......@@ -123,8 +123,8 @@ void nutStandardRoughWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties");
const scalar kappa = rasModel.kappa();
const scalar E = rasModel.E();
const scalar kappa = rasModel.kappa().value();
const scalar E = rasModel.E().value();
const scalar yPlusLam = 11.225;
// The reciprical of the distance to the adjacent cell centre.
......
......@@ -108,9 +108,9 @@ void nutStandardWallFunctionFvPatchScalarField::evaluate
const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties");
scalar kappa = rasModel.kappa();
scalar E = rasModel.E();
scalar yPlusLam = rasModel.E();
scalar kappa = rasModel.kappa().value();
scalar E = rasModel.E().value();
scalar yPlusLam = rasModel.E().value();
const scalarField& ry = patch().deltaCoeffs();
......
......@@ -100,8 +100,8 @@ void nutWallFunctionFvPatchScalarField::evaluate(const Pstream::commsTypes)
const RASModel& rasModel
= db().lookupObject<RASModel>("RASProperties");
scalar kappa = rasModel.kappa();
scalar E = rasModel.E();
scalar kappa = rasModel.kappa().value();
scalar E = rasModel.E().value();
const scalarField& ry = patch().deltaCoeffs();
......
......@@ -88,7 +88,7 @@ Description
epsilon_[faceCelli] +=
Cmu75*pow(k_[faceCelli], 1.5)
/(kappa_*RASModel::y_[patchi][facei]);
/(kappa_.value()*RASModel::y_[patchi][facei]);
if (yPlus > yPlusLam_)
{
......@@ -96,7 +96,7 @@ Description
(nutw[facei] + nuw[facei])
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_*RASModel::y_[patchi][facei]);
/(kappa_.value()*RASModel::y_[patchi][facei]);
}
}
}
......
......@@ -55,7 +55,7 @@ Description
if (yPlus > yPlusLam_)
{
nutw[facei] = nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1);
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
......
......@@ -55,7 +55,7 @@ Description
{
nutw[facei] =
nuw[facei]
*(yPlus*kappa_/log(E_*yPlus) - 1);
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment