22 DATurbulenceModel::DATurbulenceModel(
29 mesh.time().timeName(),
37 allOptions_(daOption.getAllOptions()),
39 nut_(const_cast<volScalarField&>(
40 mesh.thisDb().lookupObject<volScalarField>(
"nut"))),
41 U_(const_cast<volVectorField&>(
42 mesh.thisDb().lookupObject<volVectorField>(
"U"))),
43 phi_(const_cast<surfaceScalarField&>(
44 mesh.thisDb().lookupObject<surfaceScalarField>(
"phi"))),
48 mesh.time().timeName(),
54 dimensionedScalar(
"phase", dimensionSet(0, 0, 0, 0, 0, 0, 0), 1.0),
55 zeroGradientFvPatchField<scalar>::typeName),
56 phaseRhoPhi_(const_cast<surfaceScalarField&>(
57 mesh.thisDb().lookupObject<surfaceScalarField>(
"phi"))),
62 mesh.time().timeName(),
68 dimensionedScalar(
"rho", dimensionSet(0, 0, 0, 0, 0, 0, 0), 1.0),
69 zeroGradientFvPatchField<scalar>::typeName),
72 "turbulenceProperties",
73 mesh.time().constant(),
78 coeffDict_(turbDict_.subDict(
"RAS")),
79 kMin_(dimensioned<scalar>::lookupOrAddToDict(
84 epsilonMin_(dimensioned<scalar>::lookupOrAddToDict(
87 kMin_.dimensions() / dimTime,
89 omegaMin_(dimensioned<scalar>::lookupOrAddToDict(
94 nuTildaMin_(dimensioned<scalar>::lookupOrAddToDict(
102 if (
mesh.thisDb().foundObject<incompressible::turbulenceModel>(incompressible::turbulenceModel::propertiesName))
106 else if (
mesh.thisDb().foundObject<compressible::turbulenceModel>(compressible::turbulenceModel::propertiesName))
112 FatalErrorIn(
"DATurbulenceModel") <<
"turbModelType_ not valid!" << abort(FatalError);
119 IOdictionary transportProperties(
121 "transportProperties",
122 mesh.time().constant(),
127 Pr_ = readScalar(transportProperties.lookup(
"Pr"));
129 if (
mesh_.thisDb().foundObject<volScalarField>(
"alphat"))
131 Prt_ = readScalar(transportProperties.lookup(
"Prt"));
139 IOdictionary thermophysicalProperties(
141 "thermophysicalProperties",
142 mesh.time().constant(),
148 thermophysicalProperties.subDict(
"mixture").subDict(
"transport").lookup(
"Pr"));
150 if (
mesh_.thisDb().foundObject<volScalarField>(
"alphat"))
152 const IOdictionary& turbDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"turbulenceProperties");
153 dictionary rasSubDict = turbDict.subDict(
"RAS");
154 Prt_ = rasSubDict.getScalar(
"Prt");
162 const word modelType,
166 if (daOption.
getAllOptions().lookupOrDefault<label>(
"debug", 0))
168 Info <<
"Selecting " << modelType <<
" for DATurbulenceModel" << endl;
171 dictionaryConstructorTable::iterator cstrIter =
172 dictionaryConstructorTablePtr_->find(modelType);
174 if (cstrIter == dictionaryConstructorTablePtr_->end())
177 "DATurbulenceModel::New"
183 <<
"Unknown DATurbulenceModel type "
184 << modelType << nl << nl
185 <<
"Valid DATurbulenceModel types:" << endl
186 << dictionaryConstructorTablePtr_->sortedToc()
190 return autoPtr<DATurbulenceModel>(
191 cstrIter()(modelType,
mesh, daOption));
206 if (
mesh_.thisDb().foundObject<volScalarField>(
"alphat"))
208 dimensionedScalar
Prt(
213 volScalarField&
alphat =
const_cast<volScalarField&
>(
214 mesh_.thisDb().lookupObject<volScalarField>(
"alphat"));
216 alphat.correctBoundaryConditions();
227 return tmp<volScalarField>(
244 const volScalarField&
alphat =
mesh_.thisDb().lookupObject<volScalarField>(
"alphat");
245 return tmp<volScalarField>(
248 this->
alpha() + alphat));
252 const volScalarField&
alphat =
mesh_.thisDb().lookupObject<volScalarField>(
"alphat");
253 const fluidThermo&
thermo =
mesh_.thisDb().lookupObject<fluidThermo>(
"thermophysicalProperties");
254 return tmp<volScalarField>(
261 FatalErrorIn(
"alphaEff") <<
"turbModelType_ not valid!" << abort(FatalError);
263 return this->
alpha();
278 const volScalarField&
nu =
mesh_.thisDb().lookupObject<singlePhaseTransportModel>(
"transportProperties").
nu();
283 const volScalarField&
mu =
mesh_.thisDb().lookupObject<fluidThermo>(
"thermophysicalProperties").
mu();
284 return mu / this->
rho();
288 FatalErrorIn(
"alphaEff") <<
"turbModelType_ not valid!" << abort(FatalError);
309 const volScalarField&
rho =
mesh_.thisDb().lookupObject<volScalarField>(
"rho");
314 FatalErrorIn(
"alphaEff") <<
"turbModelType_ not valid!" << abort(FatalError);
316 return this->
alpha();
329 const volScalarField&
rho =
mesh_.thisDb().lookupObject<volScalarField>(
"rho");
330 return rho.dimensions();
334 FatalErrorIn(
"alphaEff") <<
"turbModelType_ not valid!" << abort(FatalError);
346 return this->
nu() /
Pr_;
360 const volScalarField&
mu =
mesh_.thisDb().lookupObject<fluidThermo>(
"thermophysicalProperties").
mu();
365 FatalErrorIn(
"flowCondition not valid!") << abort(FatalError);
378 return tmp<volSymmTensorField>(
379 new volSymmTensorField(
381 IOobject::groupName(
"devRhoReff",
U_.group()),
382 mesh_.time().timeName(),
399 divScheme =
"div((nuEff*dev2(T(grad(U)))))";
403 divScheme =
"div(((rho*nuEff)*dev2(T(grad(U)))))";
450 volScalarField yPlus(
453 mesh_.time().timeName(),
456 IOobject::AUTO_WRITE),
458 dimensionedScalar(dimless, Zero));
459 volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef();
461 const nearWallDist nwd(
mesh_);
462 const volScalarField::Boundary& d = nwd.y();
464 const fvPatchList& patches =
mesh_.boundary();
466 const volScalarField::Boundary& nutBf =
nut_.boundaryField();
467 const volVectorField::Boundary& UBf =
U_.boundaryField();
470 volScalarField
nu = this->
nu();
472 const volScalarField::Boundary& nuEffBf =
nuEff.boundaryField();
473 const volScalarField::Boundary& nuBf =
nu.boundaryField();
477 const fvPatch& patch = patches[patchI];
479 if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchI]))
481 const nutWallFunctionFvPatchScalarField& nutPf =
482 dynamic_cast<const nutWallFunctionFvPatchScalarField&
>(
485 yPlusBf[patchI] = nutPf.yPlus();
487 else if (isA<wallFvPatch>(patch))
493 * mag(UBf[patchI].snGrad()))
502 const fvPatch& patch = patches[patchI];
503 if (isA<wallFvPatch>(patch))
505 forAll(yPlusBf[patchI], faceI)
507 yPlusAll.append(yPlusBf[patchI][faceI]);
511 scalar minYplus = gMin(yPlusAll);
512 scalar maxYplus = gMax(yPlusAll);
513 scalar avgYplus = gAverage(yPlusAll);
515 Info <<
"yPlus min: " << minYplus
516 <<
" max: " << maxYplus
517 <<
" mean: " << avgYplus << endl;
523 const label printInterval)
const
530 if (
runTime.timeIndex() % printInterval == 0 ||
runTime.timeIndex() == 1)
547 FatalErrorIn(
"DATurbulenceModel::getTurbProdTerm")
548 <<
"Child class not implemented!"
549 << abort(FatalError);
559 FatalErrorIn(
"DATurbulenceModel::getTurbProdOverDestruct")
560 <<
"Child class not implemented!"
561 << abort(FatalError);
571 FatalErrorIn(
"DATurbulenceModel::getTurbConvOverProd")
572 <<
"Child class not implemented!"
573 << abort(FatalError);
577 const volScalarField& mySource,
585 FatalErrorIn(
"DATurbulenceModel::invTranProdNuTildaEqn")
586 <<
"Child class not implemented!"
587 << abort(FatalError);
597 FatalErrorIn(
"DATurbulenceModel::calcLduResidualTurb")
598 <<
"Child class not implemented!"
599 << abort(FatalError);
609 FatalErrorIn(
"DATurbulenceModel::constructPseudoNuTildaEqn")
610 <<
"Child class not implemented!"
611 << abort(FatalError);
621 FatalErrorIn(
"DATurbulenceModel::rhsSolvePseudoNuTildaEqn")
622 <<
"Child class not implemented!"
623 << abort(FatalError);
633 FatalErrorIn(
"DATurbulenceModel::getFvMatrixFields")
634 <<
"Child class not implemented!"
635 << abort(FatalError);
641 const scalarList& rhs,
644 FatalErrorIn(
"DATurbulenceModel::solveAdjointFP")
645 <<
"Child class not implemented!"
646 << abort(FatalError);