47 alphaK1_(dimensioned<scalar>::lookupOrAddToDict(
51 alphaK2_(dimensioned<scalar>::lookupOrAddToDict(
55 alphaOmega1_(dimensioned<scalar>::lookupOrAddToDict(
59 alphaOmega2_(dimensioned<scalar>::lookupOrAddToDict(
63 gamma1_(dimensioned<scalar>::lookupOrAddToDict(
67 gamma2_(dimensioned<scalar>::lookupOrAddToDict(
71 beta1_(dimensioned<scalar>::lookupOrAddToDict(
75 beta2_(dimensioned<scalar>::lookupOrAddToDict(
79 betaStar_(dimensioned<scalar>::lookupOrAddToDict(
83 a1_(dimensioned<scalar>::lookupOrAddToDict(
87 b1_(dimensioned<scalar>::lookupOrAddToDict(
91 c1_(dimensioned<scalar>::lookupOrAddToDict(
95 F3_(Switch::lookupOrAddToDict(
99 ca1_(dimensionedScalar::lookupOrAddToDict(
103 ca2_(dimensionedScalar::lookupOrAddToDict(
107 ce1_(dimensionedScalar::lookupOrAddToDict(
111 ce2_(dimensionedScalar::lookupOrAddToDict(
115 cThetat_(dimensionedScalar::lookupOrAddToDict(
119 sigmaThetat_(dimensionedScalar::lookupOrAddToDict(
123 lambdaErr_(this->coeffDict_.lookupOrDefault(
"lambdaErr", 1e-6)),
124 maxLambdaIter_(this->coeffDict_.lookupOrDefault(
"maxLambdaIter", 10)),
125 deltaU_(
"deltaU", dimVelocity, SMALL),
127 omega_(const_cast<volScalarField&>(
128 mesh_.thisDb().lookupObject<volScalarField>(
"omega"))),
132 mesh.time().timeName(),
137 dimensionedScalar(
"omegaRes", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
138 zeroGradientFvPatchField<scalar>::typeName),
139 k_(const_cast<volScalarField&>(
140 mesh_.thisDb().lookupObject<volScalarField>(
"k"))),
144 mesh.time().timeName(),
149 dimensionedScalar(
"kRes", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
150 zeroGradientFvPatchField<scalar>::typeName),
151 ReThetat_(const_cast<volScalarField&>(
152 mesh_.thisDb().lookupObject<volScalarField>(
"ReThetat"))),
156 mesh_.time().timeName(),
161 dimensionedScalar(
"ReThetatRes", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
162 zeroGradientFvPatchScalarField::typeName),
163 gammaInt_(const_cast<volScalarField&>(
164 mesh_.thisDb().lookupObject<volScalarField>(
"gammaInt"))),
168 mesh_.time().timeName(),
173 dimensionedScalar(
"gammaIntRes", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
174 zeroGradientFvPatchScalarField::typeName),
175 gammaIntEff_(const_cast<volScalarField::Internal&>(
176 mesh_.thisDb().lookupObject<volScalarField::Internal>(
"gammaIntEff"))),
177 y_(mesh_.thisDb().lookupObject<volScalarField>(
"yWall")),
182 mesh.time().timeName(),
184 IOobject::READ_IF_PRESENT,
185 IOobject::AUTO_WRITE),
187 dimensionedScalar(
"betaFIK", dimensionSet(0, 0, 0, 0, 0, 0, 0), 1.0),
192 mesh.time().timeName(),
194 IOobject::READ_IF_PRESENT,
195 IOobject::AUTO_WRITE),
197 dimensionedScalar(
"betaFIOmega", dimensionSet(0, 0, 0, 0, 0, 0, 0), 1.0),
203 omegaRes_.dimensions().reset(dimensionSet(0, 0, -2, 0, 0, 0, 0));
204 kRes_.dimensions().reset(dimensionSet(0, 2, -3, 0, 0, 0, 0));
205 ReThetatRes_.dimensions().reset(dimensionSet(0, 0, -1, 0, 0, 0, 0));
206 gammaIntRes_.dimensions().reset(dimensionSet(0, 0, -1, 0, 0, 0, 0));
210 omegaRes_.dimensions().reset(dimensionSet(1, -3, -2, 0, 0, 0, 0));
211 kRes_.dimensions().reset(dimensionSet(1, -1, -3, 0, 0, 0, 0));
212 ReThetatRes_.dimensions().reset(dimensionSet(1, -3, -1, 0, 0, 0, 0));
213 gammaIntRes_.dimensions().reset(dimensionSet(1, -3, -1, 0, 0, 0, 0));
217 label nWallFaces = 0;
220 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
221 &&
omega_.boundaryField()[patchI].size() > 0)
234 tmp<volTensorField> tgradU = fvc::grad(
U_);
235 volScalarField S2(2 * magSqr(symm(tgradU())));
236 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
237 GPtr_.reset(
new volScalarField::Internal(
"kOmegaSSTLM:G",
nut_ * GbyNu0));
244 const volScalarField& CDkOmega)
const
247 tmp<volScalarField> CDkOmegaPlus = max(
249 dimensionedScalar(
"1.0e-10", dimless / sqr(dimTime), 1.0e-10));
251 tmp<volScalarField> arg1 = min(
255 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
259 return tanh(pow4(arg1));
265 tmp<volScalarField> arg2 = min(
268 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
271 return tanh(sqr(arg2));
277 tmp<volScalarField> arg3 = min(
281 return 1 - tanh(pow4(arg3));
286 tmp<volScalarField> f23(
F2());
297 const volScalarField::Internal& GbyNu0,
298 const volScalarField::Internal& F2,
299 const volScalarField::Internal& S2)
const
308 const volScalarField::Internal& G)
const
314 const volScalarField& F1,
315 const volTensorField& gradU)
const
322 return tmp<fvScalarMatrix>(
330 return tmp<fvScalarMatrix>(
337 const volScalarField::Internal& S2,
338 const volScalarField::Internal& gamma,
339 const volScalarField::Internal& beta)
const
341 return tmp<fvScalarMatrix>(
349 const volScalarField& CDkOmega)
const
351 const volScalarField Ry(
y_ * sqrt(
k_) / this->
nu());
352 const volScalarField
F3(exp(-pow(Ry / 120.0, 8)));
354 return max(this->
F1SST(CDkOmega),
F3);
358 const volScalarField::Internal& G)
const
364 const volScalarField& F1,
365 const volTensorField& gradU)
const
372 const volScalarField::Internal& Us,
373 const volScalarField::Internal& Omega,
374 const volScalarField::Internal& nu)
const
376 const volScalarField::Internal& omega =
omega_();
377 const volScalarField::Internal& y =
y_();
379 const volScalarField::Internal delta(375 * Omega *
nu *
ReThetat_() * y / sqr(Us));
380 const volScalarField::Internal ReOmega(sqr(y) * omega /
nu);
381 const volScalarField::Internal Fwake(exp(-sqr(ReOmega / 1e5)));
383 return tmp<volScalarField::Internal>(
384 new volScalarField::Internal(
385 IOobject::groupName(
"Fthetat",
U_.group()),
388 Fwake * exp(-pow4((y / delta))),
396 tmp<volScalarField::Internal> tReThetac(
397 new volScalarField::Internal(
399 IOobject::groupName(
"ReThetac",
U_.group()),
400 mesh_.time().timeName(),
404 volScalarField::Internal&
ReThetac = tReThetac.ref();
408 const scalar ReThetat =
ReThetat_[celli];
414 + 120.656e-4 * ReThetat
415 - 868.230e-6 * sqr(ReThetat)
416 + 696.506e-9 * pow3(ReThetat)
417 - 174.105e-12 * pow4(ReThetat))
418 : scalar(ReThetat - 593.11 - 0.482 * (ReThetat - 1870));
425 const volScalarField::Internal& nu)
const
428 tmp<volScalarField::Internal> tFlength(
429 new volScalarField::Internal(
431 IOobject::groupName(
"Flength",
U_.group()),
432 mesh_.time().timeName(),
436 volScalarField::Internal&
Flength = tFlength.ref();
438 const volScalarField::Internal& omega =
omega_();
439 const volScalarField::Internal& y =
y_();
443 const scalar ReThetat =
ReThetat_[celli];
449 - 119.270e-4 * ReThetat
450 - 132.567e-6 * sqr(ReThetat);
452 else if (ReThetat < 596)
456 - 123.939e-2 * ReThetat
457 + 194.548e-5 * sqr(ReThetat)
458 - 101.695e-8 * pow3(ReThetat);
460 else if (ReThetat < 1200)
462 Flength[celli] = 0.5 - 3e-4 * (ReThetat - 596);
469 const scalar Fsublayer =
470 exp(-sqr(sqr(y[celli]) * omega[celli] / (200 *
nu[celli])));
472 Flength[celli] =
Flength[celli] * (1 - Fsublayer) + 40 * Fsublayer;
479 const volScalarField::Internal& Rev,
480 const volScalarField::Internal& ReThetac,
481 const volScalarField::Internal& RT)
const
483 const volScalarField::Internal Fonset1(Rev / (2.193 *
ReThetac));
485 const volScalarField::Internal Fonset2(
486 min(max(Fonset1, pow4(Fonset1)), scalar(2)));
488 const volScalarField::Internal Fonset3(max(1 - pow3(RT / 2.5), scalar(0)));
490 return tmp<volScalarField::Internal>(
491 new volScalarField::Internal(
492 IOobject::groupName(
"Fonset",
U_.group()),
493 max(Fonset2 - Fonset3, scalar(0))));
497 const volScalarField::Internal& Us,
498 const volScalarField::Internal& dUsds,
499 const volScalarField::Internal& nu)
const
502 tmp<volScalarField::Internal> tReThetat0(
503 new volScalarField::Internal(
505 IOobject::groupName(
"ReThetat0",
U_.group()),
506 mesh_.time().timeName(),
510 volScalarField::Internal&
ReThetat0 = tReThetat0.ref();
512 const volScalarField&
k =
k_;
519 max(100 * sqrt((2.0 / 3.0) *
k[celli]) / Us[celli], scalar(0.027)));
533 const scalar lambda0 =
lambda;
537 const scalar Flambda =
543 * exp(-pow(Tu / 1.5, 1.5)))
545 + 0.275 * (1 - exp(-35 *
lambda))
549 (1173.51 - 589.428 * Tu + 0.2196 / sqr(Tu))
550 * Flambda *
nu[celli]
555 const scalar Flambda =
561 * exp(-pow(Tu / 1.5, 1.5)))
563 + 0.275 * (1 - exp(-35 *
lambda))
567 331.50 * pow((Tu - 0.5658), -0.671)
568 * Flambda *
nu[celli] / Us[celli];
571 lambda = sqr(thetat) /
nu[celli] * dUsds[celli];
574 lambdaErr = mag(
lambda - lambda0);
576 maxIter = max(maxIter, ++iter);
580 ReThetat0[celli] = max(thetat * Us[celli] /
nu[celli], scalar(20));
586 <<
"Number of lambda iterations exceeds maxLambdaIter("
621 word stateName = modelStates[idxI];
622 if (stateName ==
"nut")
624 modelStates[idxI] =
"omega";
625 modelStates.append(
"k");
626 modelStates.append(
"ReThetat");
627 modelStates.append(
"gammaInt");
640 const volVectorField
U =
mesh_.thisDb().lookupObject<volVectorField>(
"U");
641 tmp<volTensorField> tgradU = fvc::grad(
U);
642 volScalarField S2(2 * magSqr(symm(tgradU())));
646 nut_.correctBoundaryConditions();
663 k_.correctBoundaryConditions();
691 omega_.correctBoundaryConditions();
705 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
706 and
omega_.boundaryField()[patchI].size() > 0)
708 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
730 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
731 &&
omega_.boundaryField()[patchI].size() > 0)
733 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
738 omega_.boundaryFieldRef()[patchI][faceI] =
omega_[faceCells[faceI]];
797 label stateConSize = stateCon.size();
801 forAll(stateCon[idxI], idxJ)
803 word conStateName = stateCon[idxI][idxJ];
804 if (conStateName ==
"nut")
806 stateCon[idxI][idxJ] =
"omega";
807 stateCon[idxI].append(
"k");
808 stateCon[idxI].append(
"ReThetat");
809 stateCon[idxI].append(
"gammaInt");
819 forAll(stateCon[idxI], idxJ)
821 word conStateName = stateCon[idxI][idxJ];
822 if (conStateName ==
"U")
829 stateCon[idxI].append(
"U");
834 if (idxI != stateConSize - 1)
837 forAll(stateCon[idxI + 1], idxJ)
839 word conStateName = stateCon[idxI + 1][idxJ];
840 if (conStateName ==
"U")
847 stateCon[idxI + 1].append(
"U");
853 "In DAStateInfo, nut shows in the largest connectivity level! "
854 "This is not supported!")
901 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
905 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
912 "Neither p nor p_rgh was found in mesh.thisDb()!"
913 "addModelResidualCon failed to setup turbulence residuals!")
923 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
924 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"},
925 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"}
930 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
931 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"},
932 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"}
938 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
939 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"},
940 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"}
946 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
947 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"},
948 {
"U",
"omega",
"k",
"ReThetat",
"gammaInt"}
956 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
957 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"},
958 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"}
963 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
964 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"},
965 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"}
971 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
972 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"},
973 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"}
979 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt",
"phi"},
980 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"},
981 {
"U",
"T", pName,
"omega",
"k",
"ReThetat",
"gammaInt"}
999 dictionary dummyOptions;
1000 dummyOptions.set(
"printToScreen", printToScreen);
1029 label printToScreen = options.lookupOrDefault(
"printToScreen", 0);
1031 word divKScheme =
"div(phi,k)";
1032 word divOmegaScheme =
"div(phi,omega)";
1033 word divReThetatScheme =
"div(phi,ReThetat)";
1034 word divGammaIntScheme =
"div(phi,gammaInt)";
1036 volScalarField
rho = this->
rho();
1042 isPC = options.getLabel(
"isPC");
1046 divKScheme =
"div(pc)";
1047 divOmegaScheme =
"div(pc)";
1048 divReThetatScheme =
"div(pc)";
1049 divGammaIntScheme =
"div(pc)";
1057 volScalarField::Internal divU(fvc::div(fvc::absolute(
phi_ / fvc::interpolate(
rho),
U_)));
1059 tmp<volTensorField> tgradU = fvc::grad(
U_);
1060 volScalarField S2(2 * magSqr(symm(tgradU())));
1061 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
1062 volScalarField::Internal& G =
const_cast<volScalarField::Internal&
>(
GPtr_());
1063 G =
nut_() * GbyNu0;
1068 omega_.boundaryFieldRef().updateCoeffs();
1077 volScalarField CDkOmega(
1080 volScalarField
F1(this->
F1(CDkOmega));
1081 volScalarField
F23(this->
F23());
1085 volScalarField::Internal
gamma(this->
gamma(F1));
1086 volScalarField::Internal
beta(this->
beta(F1));
1089 tmp<fvScalarMatrix> omegaEqn(
1104 omegaEqn.ref().relax();
1105 omegaEqn.ref().boundaryManipulate(
omega_.boundaryFieldRef());
1111 SolverPerformance<scalar> solverOmega =
solve(omegaEqn);
1129 tmp<fvScalarMatrix> kEqn(
1134 - fvm::SuSp((2.0 / 3.0) *
phase_() *
rho() * divU,
k_)
1147 SolverPerformance<scalar> solverK =
solve(kEqn);
1170 const tmp<volScalarField> tnu = this->
nu();
1171 const volScalarField::Internal&
nu = tnu()();
1172 const volScalarField::Internal& y =
y_();
1175 tmp<volTensorField> tgradULM = fvc::grad(
U_);
1176 const volScalarField::Internal Omega(sqrt(2 * magSqr(skew(tgradULM()()))));
1177 const volScalarField::Internal S(sqrt(2 * magSqr(symm(tgradULM()()))));
1178 const volScalarField::Internal Us(max(mag(
U_()),
deltaU_));
1179 const volScalarField::Internal dUsds((
U_() & (
U_() & tgradULM()())) / sqr(Us));
1185 const volScalarField::Internal t(500 *
nu / sqr(Us));
1186 const volScalarField::Internal Pthetat(
1190 tmp<fvScalarMatrix> ReThetatEqn(
1196 ReThetatEqn.ref().relax();
1203 SolverPerformance<scalar> solverReThetat =
solve(ReThetatEqn);
1222 const volScalarField::Internal Rev(sqr(y) * S /
nu);
1223 const volScalarField::Internal RT(
k_() / (
nu *
omega_()));
1226 const volScalarField::Internal Pgamma(
1230 const volScalarField::Internal Fturb(exp(-pow4(0.25 * RT)));
1232 const volScalarField::Internal Egamma(
1236 tmp<fvScalarMatrix> gammaIntEqn(
1243 gammaIntEqn.ref().relax();
1250 SolverPerformance<scalar> solverGammaInt =
solve(gammaIntEqn);
1255 const volScalarField::Internal Freattach(exp(-pow4(RT / 20.0)));
1256 const volScalarField::Internal gammaSep(
1257 min(2 * max(Rev / (3.235 *
ReThetac) - 1, scalar(0)) * Freattach, scalar(2))
1289 Info <<
"Warning!!!!!! this child class is not implemented!" << endl;
1476 tmp<volTensorField> tgradU = fvc::grad(
U_);
1477 volScalarField S2(2 * magSqr(symm(tgradU())));
1478 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
1479 volScalarField::Internal& G =
const_cast<volScalarField::Internal&
>(
GPtr_());
1480 G =
nut_() * GbyNu0;
1482 volScalarField
rho = this->
rho();
1484 volScalarField CDkOmega(
1487 volScalarField
F1(this->
F1(CDkOmega));
1489 volScalarField::Internal P =
phase_() *
rho() *
Pk(G);
1494 PoD[cellI] = P[cellI] / (
D[cellI] + P[cellI] + 1e-16);
1505 tmp<volTensorField> tgradU = fvc::grad(
U_);
1506 volScalarField S2(2 * magSqr(symm(tgradU())));
1507 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
1508 volScalarField::Internal& G =
const_cast<volScalarField::Internal&
>(
GPtr_());
1509 G =
nut_() * GbyNu0;
1511 volScalarField
rho = this->
rho();
1513 volScalarField CDkOmega(
1516 volScalarField
F1(this->
F1(CDkOmega));
1518 volScalarField::Internal P =
phase_() *
rho() *
Pk(G);
1523 CoP[cellI] = C[cellI] / (P[cellI] + C[cellI] + 1e-16);