47 sigmaNut_(dimensioned<scalar>::lookupOrAddToDict(
51 kappa_(dimensioned<scalar>::lookupOrAddToDict(
56 Cb1_(dimensioned<scalar>::lookupOrAddToDict(
60 Cb2_(dimensioned<scalar>::lookupOrAddToDict(
64 Cw1_(Cb1_ / sqr(kappa_) + (1.0 + Cb2_) / sigmaNut_),
65 Cw2_(dimensioned<scalar>::lookupOrAddToDict(
69 Cw3_(dimensioned<scalar>::lookupOrAddToDict(
73 Cv1_(dimensioned<scalar>::lookupOrAddToDict(
77 Cv2_(dimensioned<scalar>::lookupOrAddToDict(
82 nuTilda_(const_cast<volScalarField&>(
83 mesh.thisDb().lookupObject<volScalarField>(
"nuTilda"))),
87 mesh.time().timeName(),
92 #ifdef CompressibleFlow
93 dimensionedScalar(
"nuTildaRes", dimensionSet(1, -1, -2, 0, 0, 0, 0), 0.0),
95 #ifdef IncompressibleFlow
96 dimensionedScalar(
"nuTildaRes", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0.0),
98 zeroGradientFvPatchField<scalar>::typeName),
101 "nuTildaResPartDeriv",
102 mesh.time().timeName(),
107 betaFieldInversion_(const_cast<volScalarField&>(
108 mesh.thisDb().lookupObject<volScalarField>(
"betaFieldInversion"))),
109 UData_(const_cast<volVectorField&>(
110 mesh.thisDb().lookupObject<volVectorField>(
"UData"))),
111 surfaceFriction_(const_cast<volScalarField&>(
112 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFriction"))),
113 surfaceFrictionData_(const_cast<volScalarField&>(
114 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFrictionData"))),
115 pData_(const_cast<volScalarField&>(
116 mesh.thisDb().lookupObject<volScalarField>(
"pData"))),
117 USingleComponentData_(const_cast<volScalarField&>(
118 mesh.thisDb().lookupObject<volScalarField>(
"USingleComponentData"))),
119 y_(
mesh.thisDb().lookupObject<volScalarField>(
"yWall"))
124 IOdictionary fvSchemes(
127 mesh.time().system(),
132 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
133 if (ddtScheme ==
"steadyState")
136 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
141 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
154 const volScalarField& chi)
const
156 const volScalarField chi3(pow3(
chi));
157 return chi3 / (chi3 + pow3(
Cv1_));
161 const volScalarField& chi,
162 const volScalarField& fv1)
const
164 return 1.0 / pow3(scalar(1) +
chi /
Cv2_);
168 const volScalarField& chi,
169 const volScalarField& fv1)
const
172 const volScalarField chiByCv2((1 /
Cv2_) *
chi);
174 return (scalar(1) +
chi *
fv1)
176 * (3 * (scalar(1) + chiByCv2) + sqr(chiByCv2))
177 / pow3(scalar(1) + chiByCv2);
181 const volScalarField& Stilda)
const
188 dimensionedScalar(
"SMALL", Stilda.dimensions(), SMALL))
191 r.boundaryFieldRef() == 0.0;
193 const volScalarField g(r +
Cw2_ * (pow6(r) - r));
195 return g * pow((1.0 + pow6(
Cw3_)) / (pow6(g) + pow6(
Cw3_)), 1.0 / 6.0);
200 return tmp<volScalarField>(
231 word stateName = modelStates[idxI];
232 if (stateName ==
"nut")
234 modelStates[idxI] =
"nuTilda";
247 const volScalarField
chi(this->
chi());
248 const volScalarField
fv1(this->
fv1(chi));
251 nut_.correctBoundaryConditions();
267 nuTilda_.correctBoundaryConditions();
320 forAll(stateCon[idxI], idxJ)
322 word conStateName = stateCon[idxI][idxJ];
323 if (conStateName ==
"nut")
325 stateCon[idxI][idxJ] =
"nuTilda";
371 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
375 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
382 "Neither p nor p_rgh was found in mesh.thisDb()!"
383 "addModelResidualCon failed to setup turbulence residuals!")
388 #ifdef IncompressibleFlow
392 {
"U",
"nuTilda",
"phi"},
398 #ifdef CompressibleFlow
402 {
"U",
"T", pName,
"nuTilda",
"phi"},
403 {
"U",
"T", pName,
"nuTilda"},
404 {
"T", pName,
"nuTilda"}
422 dictionary dummyOptions;
453 word divNuTildaScheme =
"div(phi,nuTilda)";
459 isPC = options.getLabel(
"isPC");
463 divNuTildaScheme =
"div(pc)";
467 const volScalarField
chi(this->
chi());
468 const volScalarField
fv1(this->
fv1(chi));
470 const volScalarField Stilda(
471 this->
fv3(chi,
fv1) * ::sqrt(2.0) * mag(skew(fvc::grad(
U_)))
474 tmp<fvScalarMatrix> nuTildaEqn(
482 nuTildaEqn.ref().relax();
489 SolverPerformance<scalar> solverNuTilda =
solve(nuTildaEqn);
492 Info <<
"nuTilda Initial residual: " << solverNuTilda.initialResidual() << endl
493 <<
" Final residual: " << solverNuTilda.finalResidual() << endl;
497 nuTilda_.correctBoundaryConditions();
523 const volScalarField
chi(this->
chi());
524 const volScalarField
fv1(this->
fv1(chi));
526 const volScalarField Stilda(
527 this->
fv3(chi,
fv1) * ::sqrt(2.0) * mag(skew(fvc::grad(
U_)))
534 prodTerm[cellI] = SAProdTerm[cellI];