47 Cmu_(dimensioned<scalar>::lookupOrAddToDict(
51 C1_(dimensioned<scalar>::lookupOrAddToDict(
55 C2_(dimensioned<scalar>::lookupOrAddToDict(
59 C3_(dimensioned<scalar>::lookupOrAddToDict(
63 sigmak_(dimensioned<scalar>::lookupOrAddToDict(
67 sigmaEps_(dimensioned<scalar>::lookupOrAddToDict(
72 epsilon_(const_cast<volScalarField&>(
73 mesh_.thisDb().lookupObject<volScalarField>(
"epsilon"))),
77 mesh.time().timeName(),
82 #ifdef CompressibleFlow
83 dimensionedScalar(
"epsilonRes", dimensionSet(1, -1, -4, 0, 0, 0, 0), 0.0),
85 #ifdef IncompressibleFlow
86 dimensionedScalar(
"epsilonRes", dimensionSet(0, 2, -4, 0, 0, 0, 0), 0.0),
88 zeroGradientFvPatchField<scalar>::typeName),
89 k_(const_cast<volScalarField&>(
90 mesh_.thisDb().lookupObject<volScalarField>(
"k"))),
94 mesh.time().timeName(),
99 #ifdef CompressibleFlow
100 dimensionedScalar(
"kRes", dimensionSet(1, -1, -3, 0, 0, 0, 0), 0.0),
102 #ifdef IncompressibleFlow
103 dimensionedScalar(
"kRes", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0.0),
105 zeroGradientFvPatchField<scalar>::typeName)
110 IOdictionary fvSchemes(
113 mesh.time().system(),
118 word ddtScheme = word(fvSchemes.subDict(
"ddtSchemes").lookup(
"default"));
119 if (ddtScheme ==
"steadyState")
122 daOption.getAllOptions().lookupOrDefault<label>(
"printInterval", 100);
127 daOption.getAllOptions().lookupOrDefault<label>(
"printIntervalUnsteady", 500);
131 label nWallFaces = 0;
134 if (
epsilon_.boundaryField()[patchI].type() ==
"epsilonWallFunction"
135 and
epsilon_.boundaryField()[patchI].size() > 0)
154 return tmp<fvScalarMatrix>(
157 dimVolume * rho_.dimensions() *
k_.dimensions()
163 return tmp<fvScalarMatrix>(
166 dimVolume * rho_.dimensions() *
epsilon_.dimensions()
172 return tmp<volScalarField>(
180 return tmp<volScalarField>(
214 word stateName = modelStates[idxI];
215 if (stateName ==
"nut")
217 modelStates[idxI] =
"epsilon";
218 modelStates.append(
"k");
233 nut_.correctBoundaryConditions();
250 k_.correctBoundaryConditions();
275 epsilon_.correctBoundaryConditions();
289 if (
epsilon_.boundaryField()[patchI].type() ==
"epsilonWallFunction"
290 and
epsilon_.boundaryField()[patchI].size() > 0)
292 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
314 if (
epsilon_.boundaryField()[patchI].type() ==
"epsilonWallFunction"
315 &&
epsilon_.boundaryField()[patchI].size() > 0)
317 const UList<label>& faceCells =
mesh_.boundaryMesh()[patchI].faceCells();
380 forAll(stateCon[idxI], idxJ)
382 word conStateName = stateCon[idxI][idxJ];
383 if (conStateName ==
"nut")
385 stateCon[idxI][idxJ] =
"epsilon";
386 stateCon[idxI].append(
"k");
432 if (
mesh_.thisDb().foundObject<volScalarField>(
"p"))
436 else if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
443 "Neither p nor p_rgh was found in mesh.thisDb()!"
444 "addModelResidualCon failed to setup turbulence residuals!")
449 #ifdef IncompressibleFlow
453 {
"U",
"epsilon",
"k",
"phi"},
454 {
"U",
"epsilon",
"k"},
455 {
"U",
"epsilon",
"k"}
460 {
"U",
"epsilon",
"k",
"phi"},
461 {
"U",
"epsilon",
"k"},
462 {
"U",
"epsilon",
"k"}
466 #ifdef CompressibleFlow
470 {
"U",
"T", pName,
"epsilon",
"k",
"phi"},
471 {
"U",
"T", pName,
"epsilon",
"k"},
472 {
"U",
"T", pName,
"epsilon",
"k"}
477 {
"U",
"T", pName,
"epsilon",
"k",
"phi"},
478 {
"U",
"T", pName,
"epsilon",
"k"},
479 {
"U",
"T", pName,
"epsilon",
"k"}
497 dictionary dummyOptions;
528 word divKScheme =
"div(phi,k)";
529 word divEpsilonScheme =
"div(phi,epsilon)";
535 isPC = options.getLabel(
"isPC");
539 divKScheme =
"div(pc)";
540 divEpsilonScheme =
"div(pc)";
547 volScalarField::Internal divU(
548 fvc::div(fvc::absolute(
phi_ / fvc::interpolate(rho_),
U_))().v());
550 tmp<volTensorField> tgradU = fvc::grad(
U_);
551 volScalarField::Internal G(
553 nut_.v() * (dev(twoSymm(tgradU().v())) && tgradU().v()));
559 epsilon_.boundaryFieldRef().updateCoeffs();
568 tmp<fvScalarMatrix> epsEqn(
577 epsEqn.ref().relax();
579 epsEqn.ref().boundaryManipulate(
epsilon_.boundaryFieldRef());
586 SolverPerformance<scalar> solverEpsilon =
solve(epsEqn);
589 Info <<
"epsilon Initial residual: " << solverEpsilon.initialResidual() << endl
590 <<
" Final residual: " << solverEpsilon.finalResidual() << endl;
607 tmp<fvScalarMatrix> kEqn(
612 - fvm::SuSp((2.0 / 3.0) *
phase_() * rho_() * divU,
k_)
623 SolverPerformance<scalar> solverK =
solve(kEqn);
626 Info <<
"k Initial residual: " << solverK.initialResidual() << endl
627 <<
" Final residual: " << solverK.finalResidual() << endl;