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)
107 IOdictionary fvSchemes(
110 mesh.time().system(),
115 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
116 if (ddtScheme ==
"steadyState")
119 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
124 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
128 label nWallFaces = 0;
131 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
132 &&
omega_.boundaryField()[patchI].size() > 0)
175 word stateName = modelStates[idxI];
176 if (stateName ==
"nut")
178 modelStates[idxI] =
"omega";
179 modelStates.append(
"k");
194 nut_.correctBoundaryConditions();
211 k_.correctBoundaryConditions();
236 omega_.correctBoundaryConditions();
250 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
251 and
omega_.boundaryField()[patchI].size() > 0)
253 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
275 if (
omega_.boundaryField()[patchI].type() ==
"omegaWallFunction"
276 &&
omega_.boundaryField()[patchI].size() > 0)
278 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
283 omega_.boundaryFieldRef()[patchI][faceI] =
omega_[faceCells[faceI]];
339 label stateConSize = stateCon.size();
343 forAll(stateCon[idxI], idxJ)
345 word conStateName = stateCon[idxI][idxJ];
346 if (conStateName ==
"nut")
348 stateCon[idxI][idxJ] =
"omega";
349 stateCon[idxI].append(
"k");
359 forAll(stateCon[idxI], idxJ)
361 word conStateName = stateCon[idxI][idxJ];
362 if (conStateName ==
"U")
369 stateCon[idxI].append(
"U");
374 if (idxI != stateConSize - 1)
377 forAll(stateCon[idxI + 1], idxJ)
379 word conStateName = stateCon[idxI + 1][idxJ];
380 if (conStateName ==
"U")
387 stateCon[idxI + 1].append(
"U");
393 "In DAStateInfo, nut shows in the largest connectivity level! "
394 "This is not supported!")
441 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
445 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
452 "Neither p nor p_rgh was found in mesh.thisDb()!"
453 "addModelResidualCon failed to setup turbulence residuals!")
458 #ifdef IncompressibleFlow
462 {
"U",
"omega",
"k",
"phi"},
469 {
"U",
"omega",
"k",
"phi"},
475 #ifdef CompressibleFlow
479 {
"U",
"T", pName,
"omega",
"k",
"phi"},
480 {
"U",
"T", pName,
"omega",
"k"},
481 {
"U",
"T", pName,
"omega",
"k"}
486 {
"U",
"T", pName,
"omega",
"k",
"phi"},
487 {
"U",
"T", pName,
"omega",
"k"},
488 {
"U",
"T", pName,
"omega",
"k"}
506 dictionary dummyOptions;
537 word divKScheme =
"div(phi,k)";
538 word divOmegaScheme =
"div(phi,omega)";
544 isPC = options.getLabel(
"isPC");
548 divKScheme =
"div(pc)";
549 divOmegaScheme =
"div(pc)";
556 volScalarField divU(fvc::div(fvc::absolute(
phi_ / fvc::interpolate(rho_),
U_)));
558 tmp<volTensorField> tgradU = fvc::grad(
U_);
559 volScalarField G(
"kOmega:G",
nut_ * (tgradU() && dev(twoSymm(tgradU()))));
565 omega_.boundaryFieldRef().updateCoeffs();
575 tmp<fvScalarMatrix> omegaEqn(
583 omegaEqn.ref().relax();
584 omegaEqn.ref().boundaryManipulate(
omega_.boundaryFieldRef());
591 SolverPerformance<scalar> solverOmega =
solve(omegaEqn);
594 Info <<
"omega Initial residual: " << solverOmega.initialResidual() << endl
595 <<
" Final residual: " << solverOmega.finalResidual() << endl;
612 tmp<fvScalarMatrix> kEqn(
617 - fvm::SuSp((2.0 / 3.0) *
phase_ * rho_ * divU,
k_)
627 SolverPerformance<scalar> solverK =
solve(kEqn);
630 Info <<
"k Initial residual: " << solverK.initialResidual() << endl
631 <<
" Final residual: " << solverK.finalResidual() << endl;