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(
100 omega_(const_cast<volScalarField&>(
101 mesh_.thisDb().lookupObject<volScalarField>(
"omega"))),
105 mesh.time().timeName(),
110 #ifdef CompressibleFlow
111 dimensionedScalar(
"omegaRes", dimensionSet(1, -3, -2, 0, 0, 0, 0), 0.0),
113 #ifdef IncompressibleFlow
114 dimensionedScalar(
"omegaRes", dimensionSet(0, 0, -2, 0, 0, 0, 0), 0.0),
116 zeroGradientFvPatchField<scalar>::typeName),
118 const_cast<volScalarField&>(
119 mesh_.thisDb().lookupObject<volScalarField>(
"k"))),
123 mesh.time().timeName(),
128 #ifdef CompressibleFlow
129 dimensionedScalar(
"kRes", dimensionSet(1, -1, -3, 0, 0, 0, 0), 0.0),
131 #ifdef IncompressibleFlow
132 dimensionedScalar(
"kRes", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0.0),
134 zeroGradientFvPatchField<scalar>::typeName),
135 y_(mesh_.thisDb().lookupObject<volScalarField>(
"yWall"))
140 IOdictionary fvSchemes(
143 mesh.time().system(),
148 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
149 if (ddtScheme ==
"steadyState")
152 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
157 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
161 label nWallFaces = 0;
164 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
165 &&
omega_.boundaryField()[patchI].size() > 0)
182 const volScalarField& CDkOmega)
const
185 tmp<volScalarField> CDkOmegaPlus = max(
187 dimensionedScalar(
"1.0e-10", dimless / sqr(dimTime), 1.0e-10));
189 tmp<volScalarField> arg1 = min(
193 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
197 return tanh(pow4(arg1));
203 tmp<volScalarField> arg2 = min(
206 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
209 return tanh(sqr(arg2));
215 tmp<volScalarField> arg3 = min(
219 return 1 - tanh(pow4(arg3));
224 tmp<volScalarField> f23(
F2());
235 const volScalarField::Internal& GbyNu0,
236 const volScalarField::Internal& F2,
237 const volScalarField::Internal& S2)
const
246 const volScalarField::Internal& G)
const
252 const volScalarField& F1,
253 const volTensorField& gradU)
const
260 const volScalarField&
rho = rho_;
261 return tmp<fvScalarMatrix>(
264 dimVolume *
rho.dimensions() *
k_.dimensions() / dimTime));
269 const volScalarField&
rho = rho_;
270 return tmp<fvScalarMatrix>(
273 dimVolume *
rho.dimensions() *
omega_.dimensions() / dimTime));
277 const volScalarField::Internal& S2,
278 const volScalarField::Internal& gamma,
279 const volScalarField::Internal& beta)
const
281 const volScalarField&
rho = rho_;
282 return tmp<fvScalarMatrix>(
285 dimVolume *
rho.dimensions() *
omega_.dimensions() / dimTime));
316 word stateName = modelStates[idxI];
317 if (stateName ==
"nut")
319 modelStates[idxI] =
"omega";
320 modelStates.append(
"k");
333 const volVectorField
U =
mesh_.thisDb().lookupObject<volVectorField>(
"U");
334 tmp<volTensorField> tgradU = fvc::grad(
U);
335 volScalarField S2(2 * magSqr(symm(tgradU())));
339 nut_.correctBoundaryConditions();
356 k_.correctBoundaryConditions();
381 omega_.correctBoundaryConditions();
395 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
396 and
omega_.boundaryField()[patchI].size() > 0)
398 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
420 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
421 &&
omega_.boundaryField()[patchI].size() > 0)
423 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
428 omega_.boundaryFieldRef()[patchI][faceI] =
omega_[faceCells[faceI]];
484 label stateConSize = stateCon.size();
488 forAll(stateCon[idxI], idxJ)
490 word conStateName = stateCon[idxI][idxJ];
491 if (conStateName ==
"nut")
493 stateCon[idxI][idxJ] =
"omega";
494 stateCon[idxI].append(
"k");
504 forAll(stateCon[idxI], idxJ)
506 word conStateName = stateCon[idxI][idxJ];
507 if (conStateName ==
"U")
514 stateCon[idxI].append(
"U");
519 if (idxI != stateConSize - 1)
522 forAll(stateCon[idxI + 1], idxJ)
524 word conStateName = stateCon[idxI + 1][idxJ];
525 if (conStateName ==
"U")
532 stateCon[idxI + 1].append(
"U");
538 "In DAStateInfo, nut shows in the largest connectivity level! "
539 "This is not supported!")
586 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
590 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
597 "Neither p nor p_rgh was found in mesh.thisDb()!"
598 "addModelResidualCon failed to setup turbulence residuals!")
603 #ifdef IncompressibleFlow
607 {
"U",
"omega",
"k",
"phi"},
614 {
"U",
"omega",
"k",
"phi"},
620 #ifdef CompressibleFlow
624 {
"U",
"T", pName,
"omega",
"k",
"phi"},
625 {
"U",
"T", pName,
"omega",
"k"},
626 {
"U",
"T", pName,
"omega",
"k"}
631 {
"U",
"T", pName,
"omega",
"k",
"phi"},
632 {
"U",
"T", pName,
"omega",
"k"},
633 {
"U",
"T", pName,
"omega",
"k"}
651 dictionary dummyOptions;
682 word divKScheme =
"div(phi,k)";
683 word divOmegaScheme =
"div(phi,omega)";
689 isPC = options.getLabel(
"isPC");
693 divKScheme =
"div(pc)";
694 divOmegaScheme =
"div(pc)";
701 volScalarField::Internal divU(fvc::div(fvc::absolute(
phi_ / fvc::interpolate(rho_),
U_)));
703 tmp<volTensorField> tgradU = fvc::grad(
U_);
704 volScalarField S2(2 * magSqr(symm(tgradU())));
705 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
706 volScalarField::Internal G(
"kOmegaSST:G",
nut_ * GbyNu0);
711 omega_.boundaryFieldRef().updateCoeffs();
720 volScalarField CDkOmega(
723 volScalarField
F1(this->
F1(CDkOmega));
724 volScalarField
F23(this->
F23());
728 volScalarField::Internal
gamma(this->
gamma(F1));
729 volScalarField::Internal
beta(this->
beta(F1));
732 tmp<fvScalarMatrix> omegaEqn(
747 omegaEqn.ref().relax();
748 omegaEqn.ref().boundaryManipulate(
omega_.boundaryFieldRef());
755 SolverPerformance<scalar> solverOmega =
solve(omegaEqn);
758 Info <<
"omega Initial residual: " << solverOmega.initialResidual() << endl
759 <<
" Final residual: " << solverOmega.finalResidual() << endl;
777 tmp<fvScalarMatrix> kEqn(
782 - fvm::SuSp((2.0 / 3.0) *
phase_() * rho_() * divU,
k_)
795 SolverPerformance<scalar> solverK =
solve(kEqn);
798 Info <<
"k Initial residual: " << solverK.initialResidual() << endl
799 <<
" Final residual: " << solverK.finalResidual() << endl;