37 namespace incompressible
51 immersedBoundaryWallFunctionFvPatchScalarField(
p, iF),
54 GName_(
"RASModel::G"),
71 immersedBoundaryWallFunctionFvPatchScalarField(
p, iF,
dict),
72 UName_(
dict.lookupOrDefault<
word>(
"U",
"U")),
73 kName_(
dict.lookupOrDefault<
word>(
"k",
"k")),
74 GName_(
dict.lookupOrDefault<
word>(
"G",
"RASModel::G")),
75 nuName_(
dict.lookupOrDefault<
word>(
"nu",
"nu")),
76 nutName_(
dict.lookupOrDefault<
word>(
"nut",
"nut")),
77 Cmu_(
dict.lookupOrDefault<scalar>(
"Cmu", 0.09)),
78 kappa_(
dict.lookupOrDefault<scalar>(
"kappa", 0.41)),
79 E_(
dict.lookupOrDefault<scalar>(
"E", 9.8))
92 immersedBoundaryWallFunctionFvPatchScalarField(ptf,
p, iF, mapper),
110 immersedBoundaryWallFunctionFvPatchScalarField(ewfpsf),
129 immersedBoundaryWallFunctionFvPatchScalarField(ewfpsf, iF),
152 if (!db().foundObject<volScalarField>(
GName_))
156 "void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::"
158 ) <<
"Cannot access " <<
GName_ <<
" field. for patch "
159 << patch().name() <<
". Evaluating as regular immersed boundary"
162 immersedBoundaryWallFunctionFvPatchScalarField::evaluate();
170 const scalar yPlusLam = rasModel.yPlusLam(
kappa_,
E_);
172 const scalar Cmu25 =
pow(
Cmu_, 0.25);
174 const scalar Cmu75 =
pow(
Cmu_, 0.75);
185 refCast<const immersedBoundaryVelocityWallFunctionFvPatchVectorField>
192 (
I -
sqr(
n)) & (Uw.ibSamplingPointValue() - Uw.ibValue());
196 scalarField& UTangentialNew = Uw.wallTangentialValue();
204 const immersedBoundaryWallFunctionFvPatchScalarField& kw =
205 refCast<const immersedBoundaryWallFunctionFvPatchScalarField>(kg);
214 const immersedBoundaryFvPatchScalarField& nuw =
215 refCast<const immersedBoundaryFvPatchScalarField>(nuwg);
221 const immersedBoundaryWallFunctionFvPatchScalarField& nutw =
222 refCast<const immersedBoundaryWallFunctionFvPatchScalarField>(nutwg);
231 const labelList& ibc = ibPatch().ibCells();
234 const scalarField& ySample = ibPatch().ibSamplingPointDelta();
240 scalarField epsilonSample = this->ibSamplingPointValue();
253 const scalar nuLam =
nu[ibCellI];
256 const scalar yPlusSample = ypd[ibCellI];
260 if (yPlusSample > yPlusLam)
274 tauWall[ibCellI] =
sqr(
uTau)*UtanOld[ibCellI]/(magUtanOld[ibCellI] + SMALL);
278 scalar yPlusIB = yPlusSample*
y[ibCellI]/ySample[ibCellI];
281 if (yPlusIB > yPlusLam)
286 scalar nutw = nuLam*(yPlusIB*
kappa_/
log(
E_*yPlusIB) - 1);
290 sqr((nutw + nuLam)*magGradUw[ibCellI])/
294 UTangentialNew[ibCellI] =
302 nutNew[ibCellI] = nutw;
305 kNew[ibCellI] = (nutw + nuLam)*magGradUw[ibCellI]/Cmu50;
308 epsilonNew[ibCellI] =
309 Cmu75*
pow(kNew[ibCellI], 1.5)/(
kappa_*
y[ibCellI]);
320 UTangentialNew[ibCellI] =
min(magUtanOld[ibCellI],
uTau*yPlusIB);
323 nutNew[ibCellI] = SMALL;
326 kNew[ibCellI] =
k[ibCellI];
332 epsilonNew[ibCellI] = epsilonSample[ibCellI];
342 Uw.wallMask() =
true;
344 nutw.wallMask() =
true;
345 this->wallMask() =
true;
348 immersedBoundaryWallFunctionFvPatchScalarField::updateCoeffs();
358 this->setIbCellValues(this->wallValue());
368 writeEntryIfDifferent<word>(os,
"U",
"U",
UName_);
369 writeEntryIfDifferent<word>(os,
"k",
"k",
kName_);
370 writeEntryIfDifferent<word>(os,
"G",
"RASModel::G",
GName_);
371 writeEntryIfDifferent<word>(os,
"nu",
"nu",
nuName_);
372 writeEntryIfDifferent<word>(os,
"nut",
"nut",
nutName_);