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),
103 mesh.time().timeName(),
108 pseudoNuTildaEqn_(fvm::div(phi_, pseudoNuTilda_,
"div(phi,nuTilda)")),
109 y_(
mesh.thisDb().lookupObject<volScalarField>(
"yWall"))
114 IOdictionary fvSchemes(
117 mesh.time().system(),
122 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
123 if (ddtScheme ==
"steadyState")
126 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
131 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
135 const fvSolution& myFvSolution =
mesh.thisDb().lookupObject<fvSolution>(
"fvSolution");
137 if (myFvSolution.found(
"relaxationFactors"))
139 if (myFvSolution.subDict(
"relaxationFactors").found(
"equations"))
141 if (myFvSolution.subDict(
"relaxationFactors").subDict(
"equations").found(
"nuTilda"))
143 relaxNuTildaEqn_ = myFvSolution.subDict(
"relaxationFactors").subDict(
"equations").getScalar(
"nuTilda");
158 const volScalarField& chi)
const
160 const volScalarField chi3(pow3(
chi));
161 return chi3 / (chi3 + pow3(
Cv1_));
165 const volScalarField& chi,
166 const volScalarField& fv1)
const
168 return 1.0 / pow3(scalar(1) +
chi /
Cv2_);
172 const volScalarField& chi,
173 const volScalarField& fv1)
const
176 const volScalarField chiByCv2((1 /
Cv2_) *
chi);
178 return (scalar(1) +
chi *
fv1)
180 * (3 * (scalar(1) + chiByCv2) + sqr(chiByCv2))
181 / pow3(scalar(1) + chiByCv2);
185 const volScalarField& Stilda)
const
192 dimensionedScalar(
"SMALL", Stilda.dimensions(), SMALL))
195 r.boundaryFieldRef() == 0.0;
197 const volScalarField g(r +
Cw2_ * (pow6(r) - r));
199 return g * pow((1.0 + pow6(
Cw3_)) / (pow6(g) + pow6(
Cw3_)), 1.0 / 6.0);
204 return tmp<volScalarField>(
235 word stateName = modelStates[idxI];
236 if (stateName ==
"nut")
238 modelStates[idxI] =
"nuTilda";
251 const volScalarField
chi(this->
chi());
252 const volScalarField
fv1(this->
fv1(chi));
255 nut_.correctBoundaryConditions();
271 nuTilda_.correctBoundaryConditions();
324 forAll(stateCon[idxI], idxJ)
326 word conStateName = stateCon[idxI][idxJ];
327 if (conStateName ==
"nut")
329 stateCon[idxI][idxJ] =
"nuTilda";
375 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
379 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
386 "Neither p nor p_rgh was found in mesh.thisDb()!"
387 "addModelResidualCon failed to setup turbulence residuals!")
392 #ifdef IncompressibleFlow
396 {
"U",
"nuTilda",
"phi"},
402 #ifdef CompressibleFlow
406 {
"U",
"T", pName,
"nuTilda",
"phi"},
407 {
"U",
"T", pName,
"nuTilda"},
408 {
"T", pName,
"nuTilda"}
426 dictionary dummyOptions;
457 word divNuTildaScheme =
"div(phi,nuTilda)";
463 isPC = options.getLabel(
"isPC");
467 divNuTildaScheme =
"div(pc)";
471 const volScalarField
chi(this->
chi());
472 const volScalarField
fv1(this->
fv1(chi));
474 const volScalarField Stilda(
475 this->
fv3(chi,
fv1) * ::sqrt(2.0) * mag(skew(fvc::grad(
U_)))
478 tmp<fvScalarMatrix> nuTildaEqn(
486 nuTildaEqn.ref().relax();
493 SolverPerformance<scalar> solverNuTilda =
solve(nuTildaEqn);
496 Info <<
"nuTilda Initial residual: " << solverNuTilda.initialResidual() << endl
497 <<
" Final residual: " << solverNuTilda.finalResidual() << endl;
501 nuTilda_.correctBoundaryConditions();
521 const volScalarField& mySource,
608 const volScalarField
chi(this->
chi());
609 const volScalarField
fv1(this->
fv1(chi));
612 const volScalarField Stilda(
613 this->
fv3(chi,
fv1) * ::sqrt(2.0) * mag(skew(fvc::grad(
U_)))
647 const fvPatch& pp =
pseudoNuTilda_.boundaryField()[patchI].patch();
650 label cellI = pp.faceCells()[faceI];
672 const volScalarField
chi(this->
chi());
673 const volScalarField
fv1(this->
fv1(chi));
676 const volScalarField Stilda(
677 this->
fv3(chi,
fv1) * ::sqrt(2.0) * mag(skew(fvc::grad(
U_)))
681 fvScalarMatrix nuTildaEqn(
688 List<scalar>& nuTildaSource = nuTildaEqn.source();
689 List<scalar>& nuTildaDiag = nuTildaEqn.diag();
692 for (label i = 0; i <
nuTilda_.size(); i++)
694 nuTildaRes[i] = nuTildaDiag[i] *
nuTilda_[i] - nuTildaSource[i];
696 nuTildaRes.primitiveFieldRef() -= nuTildaEqn.lduMatrix::H(
nuTilda_);
701 const fvPatch& pp =
nuTilda_.boundaryField()[patchI].patch();
706 label cellI = pp.faceCells()[faceI];
710 nuTildaRes[cellI] += nuTildaEqn.internalCoeffs()[patchI][faceI] *
nuTilda_[cellI];
711 nuTildaRes[cellI] -= nuTildaEqn.boundaryCoeffs()[patchI][faceI];
716 nuTildaRes.correctBoundaryConditions();