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),
120 mesh.time().timeName(),
128 mesh.time().timeName(),
136 mesh.time().timeName(),
142 const_cast<volScalarField&>(
143 mesh_.thisDb().lookupObject<volScalarField>(
"k"))),
147 mesh.time().timeName(),
152 #ifdef CompressibleFlow
153 dimensionedScalar(
"kRes", dimensionSet(1, -1, -3, 0, 0, 0, 0), 0.0),
155 #ifdef IncompressibleFlow
156 dimensionedScalar(
"kRes", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0.0),
158 zeroGradientFvPatchField<scalar>::typeName),
162 mesh.time().timeName(),
170 mesh.time().timeName(),
178 mesh.time().timeName(),
184 betaFieldInversion_(const_cast<volScalarField&>(
185 mesh.thisDb().lookupObject<volScalarField>(
"betaFieldInversion"))),
186 surfaceFriction_(const_cast<volScalarField&>(
187 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFriction"))),
188 surfaceFrictionData_(const_cast<volScalarField&>(
189 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFrictionData"))),
190 pData_(const_cast<volScalarField&>(
191 mesh.thisDb().lookupObject<volScalarField>(
"pData"))),
192 UData_(const_cast<volVectorField&>(
193 mesh.thisDb().lookupObject<volVectorField>(
"UData"))),
194 USingleComponentData_(const_cast<volScalarField&>(
195 mesh.thisDb().lookupObject<volScalarField>(
"USingleComponentData"))),
196 y_(mesh_.thisDb().lookupObject<volScalarField>(
"yWall"))
201 IOdictionary fvSchemes(
204 mesh.time().system(),
209 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
210 if (ddtScheme ==
"steadyState")
213 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
218 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
222 label nWallFaces = 0;
225 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
226 &&
omega_.boundaryField()[patchI].size() > 0)
243 const volScalarField& CDkOmega)
const
246 tmp<volScalarField> CDkOmegaPlus = max(
248 dimensionedScalar(
"1.0e-10", dimless / sqr(dimTime), 1.0e-10));
250 tmp<volScalarField> arg1 = min(
254 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
258 return tanh(pow4(arg1));
264 tmp<volScalarField> arg2 = min(
267 scalar(500) * (this->
nu()) / (sqr(
y_) *
omega_)),
270 return tanh(sqr(arg2));
276 tmp<volScalarField> arg3 = min(
280 return 1 - tanh(pow4(arg3));
285 tmp<volScalarField> f23(
F2());
296 const volScalarField::Internal& GbyNu0,
297 const volScalarField::Internal& F2,
298 const volScalarField::Internal& S2)
const
307 const volScalarField::Internal& G)
const
313 const volScalarField& F1,
314 const volTensorField& gradU)
const
321 const volScalarField&
rho = rho_;
322 return tmp<fvScalarMatrix>(
325 dimVolume *
rho.dimensions() *
k_.dimensions() / dimTime));
330 const volScalarField&
rho = rho_;
331 return tmp<fvScalarMatrix>(
334 dimVolume *
rho.dimensions() *
omega_.dimensions() / dimTime));
338 const volScalarField::Internal& S2,
339 const volScalarField::Internal& gamma,
340 const volScalarField::Internal& beta)
const
342 const volScalarField&
rho = rho_;
343 return tmp<fvScalarMatrix>(
346 dimVolume *
rho.dimensions() *
omega_.dimensions() / dimTime));
377 word stateName = modelStates[idxI];
378 if (stateName ==
"nut")
380 modelStates[idxI] =
"omega";
381 modelStates.append(
"k");
394 const volVectorField
U =
mesh_.thisDb().lookupObject<volVectorField>(
"U");
395 tmp<volTensorField> tgradU = fvc::grad(
U);
396 volScalarField S2(2 * magSqr(symm(tgradU())));
400 nut_.correctBoundaryConditions();
417 k_.correctBoundaryConditions();
442 omega_.correctBoundaryConditions();
456 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
457 and
omega_.boundaryField()[patchI].size() > 0)
459 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
481 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
482 &&
omega_.boundaryField()[patchI].size() > 0)
484 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
489 omega_.boundaryFieldRef()[patchI][faceI] =
omega_[faceCells[faceI]];
545 label stateConSize = stateCon.size();
549 forAll(stateCon[idxI], idxJ)
551 word conStateName = stateCon[idxI][idxJ];
552 if (conStateName ==
"nut")
554 stateCon[idxI][idxJ] =
"omega";
555 stateCon[idxI].append(
"k");
565 forAll(stateCon[idxI], idxJ)
567 word conStateName = stateCon[idxI][idxJ];
568 if (conStateName ==
"U")
575 stateCon[idxI].append(
"U");
580 if (idxI != stateConSize - 1)
583 forAll(stateCon[idxI + 1], idxJ)
585 word conStateName = stateCon[idxI + 1][idxJ];
586 if (conStateName ==
"U")
593 stateCon[idxI + 1].append(
"U");
599 "In DAStateInfo, nut shows in the largest connectivity level! "
600 "This is not supported!")
647 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
651 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
658 "Neither p nor p_rgh was found in mesh.thisDb()!"
659 "addModelResidualCon failed to setup turbulence residuals!")
664 #ifdef IncompressibleFlow
668 {
"U",
"omega",
"k",
"phi"},
675 {
"U",
"omega",
"k",
"phi"},
681 #ifdef CompressibleFlow
685 {
"U",
"T", pName,
"omega",
"k",
"phi"},
686 {
"U",
"T", pName,
"omega",
"k"},
687 {
"U",
"T", pName,
"omega",
"k"}
692 {
"U",
"T", pName,
"omega",
"k",
"phi"},
693 {
"U",
"T", pName,
"omega",
"k"},
694 {
"U",
"T", pName,
"omega",
"k"}
712 dictionary dummyOptions;
743 word divKScheme =
"div(phi,k)";
744 word divOmegaScheme =
"div(phi,omega)";
750 isPC = options.getLabel(
"isPC");
754 divKScheme =
"div(pc)";
755 divOmegaScheme =
"div(pc)";
762 volScalarField::Internal divU(fvc::div(fvc::absolute(
phi_ / fvc::interpolate(rho_),
U_)));
764 tmp<volTensorField> tgradU = fvc::grad(
U_);
765 volScalarField S2(2 * magSqr(symm(tgradU())));
766 volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
767 volScalarField::Internal G(
"kOmegaSSTFieldInversion:G",
nut_ * GbyNu0);
772 omega_.boundaryFieldRef().updateCoeffs();
781 volScalarField CDkOmega(
784 volScalarField
F1(this->
F1(CDkOmega));
785 volScalarField
F23(this->
F23());
789 volScalarField::Internal
gamma(this->
gamma(F1));
790 volScalarField::Internal
beta(this->
beta(F1));
793 tmp<fvScalarMatrix> omegaEqn(
808 omegaEqn.ref().relax();
809 omegaEqn.ref().boundaryManipulate(
omega_.boundaryFieldRef());
816 SolverPerformance<scalar> solverOmega =
solve(omegaEqn);
819 Info <<
"omega Initial residual: " << solverOmega.initialResidual() << endl
820 <<
" Final residual: " << solverOmega.finalResidual() << endl;
838 tmp<fvScalarMatrix> kEqn(
843 - fvm::SuSp((2.0 / 3.0) *
phase_() * rho_() * divU,
k_)
856 SolverPerformance<scalar> solverK =
solve(kEqn);
859 Info <<
"k Initial residual: " << solverK.initialResidual() << endl
860 <<
" Final residual: " << solverK.finalResidual() << endl;