47 Cmu_(dimensioned<scalar>::lookupOrAddToDict(
51 beta_(dimensioned<scalar>::lookupOrAddToDict(
55 gamma_(dimensioned<scalar>::lookupOrAddToDict(
59 alphaK_(dimensioned<scalar>::lookupOrAddToDict(
63 alphaOmega_(dimensioned<scalar>::lookupOrAddToDict(
68 omega_(const_cast<volScalarField&>(
69 mesh_.thisDb().lookupObject<volScalarField>(
"omega"))),
73 mesh.time().timeName(),
78 #ifdef CompressibleFlow
79 dimensionedScalar(
"omegaRes", dimensionSet(1, -3, -2, 0, 0, 0, 0), 0.0),
81 #ifdef IncompressibleFlow
82 dimensionedScalar(
"omegaRes", dimensionSet(0, 0, -2, 0, 0, 0, 0), 0.0),
84 zeroGradientFvPatchField<scalar>::typeName),
86 const_cast<volScalarField&>(
87 mesh_.thisDb().lookupObject<volScalarField>(
"k"))),
91 mesh.time().timeName(),
96 #ifdef CompressibleFlow
97 dimensionedScalar(
"kRes", dimensionSet(1, -1, -3, 0, 0, 0, 0), 0.0),
99 #ifdef IncompressibleFlow
100 dimensionedScalar(
"kRes", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0.0),
102 zeroGradientFvPatchField<scalar>::typeName),
105 betaFieldInversion_(const_cast<volScalarField&>(
106 mesh.thisDb().lookupObject<volScalarField>(
"betaFieldInversion"))),
107 surfaceFriction_(const_cast<volScalarField&>(
108 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFriction"))),
109 surfaceFrictionData_(const_cast<volScalarField&>(
110 mesh.thisDb().lookupObject<volScalarField>(
"surfaceFrictionData"))),
111 pData_(const_cast<volScalarField&>(
112 mesh.thisDb().lookupObject<volScalarField>(
"pData"))),
113 UData_(const_cast<volVectorField&>(
114 mesh.thisDb().lookupObject<volVectorField>(
"UData"))),
115 USingleComponentData_(const_cast<volScalarField&>(
116 mesh.thisDb().lookupObject<volScalarField>(
"USingleComponentData")))
121 IOdictionary fvSchemes(
124 mesh.time().system(),
129 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
130 if (ddtScheme ==
"steadyState")
133 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
138 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
142 label nWallFaces = 0;
145 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
146 &&
omega_.boundaryField()[patchI].size() > 0)
189 word stateName = modelStates[idxI];
190 if (stateName ==
"nut")
192 modelStates[idxI] =
"omega";
193 modelStates.append(
"k");
208 nut_.correctBoundaryConditions();
225 k_.correctBoundaryConditions();
250 omega_.correctBoundaryConditions();
264 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
265 and
omega_.boundaryField()[patchI].size() > 0)
267 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
289 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
290 &&
omega_.boundaryField()[patchI].size() > 0)
292 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
297 omega_.boundaryFieldRef()[patchI][faceI] =
omega_[faceCells[faceI]];
353 label stateConSize = stateCon.size();
357 forAll(stateCon[idxI], idxJ)
359 word conStateName = stateCon[idxI][idxJ];
360 if (conStateName ==
"nut")
362 stateCon[idxI][idxJ] =
"omega";
363 stateCon[idxI].append(
"k");
373 forAll(stateCon[idxI], idxJ)
375 word conStateName = stateCon[idxI][idxJ];
376 if (conStateName ==
"U")
383 stateCon[idxI].append(
"U");
388 if (idxI != stateConSize - 1)
391 forAll(stateCon[idxI + 1], idxJ)
393 word conStateName = stateCon[idxI + 1][idxJ];
394 if (conStateName ==
"U")
401 stateCon[idxI + 1].append(
"U");
407 "In DAStateInfo, nut shows in the largest connectivity level! "
408 "This is not supported!")
455 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
459 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
466 "Neither p nor p_rgh was found in mesh.thisDb()!"
467 "addModelResidualCon failed to setup turbulence residuals!")
472 #ifdef IncompressibleFlow
476 {
"U",
"omega",
"k",
"phi"},
483 {
"U",
"omega",
"k",
"phi"},
489 #ifdef CompressibleFlow
493 {
"U",
"T", pName,
"omega",
"k",
"phi"},
494 {
"U",
"T", pName,
"omega",
"k"},
495 {
"U",
"T", pName,
"omega",
"k"}
500 {
"U",
"T", pName,
"omega",
"k",
"phi"},
501 {
"U",
"T", pName,
"omega",
"k"},
502 {
"U",
"T", pName,
"omega",
"k"}
520 dictionary dummyOptions;
551 word divKScheme =
"div(phi,k)";
552 word divOmegaScheme =
"div(phi,omega)";
558 isPC = options.getLabel(
"isPC");
562 divKScheme =
"div(pc)";
563 divOmegaScheme =
"div(pc)";
570 volScalarField divU(fvc::div(fvc::absolute(
phi_ / fvc::interpolate(rho_),
U_)));
572 tmp<volTensorField> tgradU = fvc::grad(
U_);
573 volScalarField G(
"kOmegaFieldInversionOmega:G",
nut_ * (tgradU() && dev(twoSymm(tgradU()))));
579 omega_.boundaryFieldRef().updateCoeffs();
589 tmp<fvScalarMatrix> omegaEqn(
597 omegaEqn.ref().relax();
598 omegaEqn.ref().boundaryManipulate(
omega_.boundaryFieldRef());
605 SolverPerformance<scalar> solverOmega =
solve(omegaEqn);
608 Info <<
"omega Initial residual: " << solverOmega.initialResidual() << endl
609 <<
" Final residual: " << solverOmega.finalResidual() << endl;
626 tmp<fvScalarMatrix> kEqn(
631 - fvm::SuSp((2.0 / 3.0) *
phase_ * rho_ * divU,
k_)
641 SolverPerformance<scalar> solverK =
solve(kEqn);
644 Info <<
"k Initial residual: " << solverK.initialResidual() << endl
645 <<
" Final residual: " << solverK.finalResidual() << endl;