37 namespace incompressible
51 immersedBoundaryWallFunctionFvPatchScalarField(
p, iF),
54 GName_(
"RASModel::G"),
72 immersedBoundaryWallFunctionFvPatchScalarField(
p, iF,
dict),
73 UName_(
dict.lookupOrDefault<
word>(
"U",
"U")),
74 kName_(
dict.lookupOrDefault<
word>(
"k",
"k")),
75 GName_(
dict.lookupOrDefault<
word>(
"G",
"RASModel::G")),
76 nuName_(
dict.lookupOrDefault<
word>(
"nu",
"nu")),
77 nutName_(
dict.lookupOrDefault<
word>(
"nut",
"nut")),
78 Cmu_(
dict.lookupOrDefault<scalar>(
"Cmu", 0.09)),
79 kappa_(
dict.lookupOrDefault<scalar>(
"kappa", 0.41)),
80 E_(
dict.lookupOrDefault<scalar>(
"E", 9.8)),
81 beta1_(
dict.lookupOrDefault<scalar>(
"beta1", 0.075))
94 immersedBoundaryWallFunctionFvPatchScalarField(ptf,
p, iF, mapper),
113 immersedBoundaryWallFunctionFvPatchScalarField(owfpsf),
133 immersedBoundaryWallFunctionFvPatchScalarField(owfpsf, iF),
157 if (!db().foundObject<volScalarField>(
GName_))
161 "void immersedBoundaryOmegaWallFunctionFvPatchScalarField::"
163 ) <<
"Cannot access " <<
GName_ <<
" field. for patch "
164 << patch().name() <<
". Evaluating as regular immersed boundary"
167 immersedBoundaryWallFunctionFvPatchScalarField::evaluate();
175 const scalar yPlusLam = rasModel.yPlusLam(
kappa_,
E_);
177 const scalar Cmu25 =
pow(
Cmu_, 0.25);
189 refCast<const immersedBoundaryVelocityWallFunctionFvPatchVectorField>
196 (
I -
sqr(
n)) & (Uw.ibSamplingPointValue() - Uw.ibValue());
200 scalarField& UTangentialNew = Uw.wallTangentialValue();
208 const immersedBoundaryWallFunctionFvPatchScalarField& kw =
209 refCast<const immersedBoundaryWallFunctionFvPatchScalarField>(kg);
218 const immersedBoundaryFvPatchScalarField& nuw =
219 refCast<const immersedBoundaryFvPatchScalarField>(nuwg);
225 const immersedBoundaryWallFunctionFvPatchScalarField& nutw =
226 refCast<const immersedBoundaryWallFunctionFvPatchScalarField>(nutwg);
235 const labelList& ibc = ibPatch().ibCells();
238 const scalarField& ySample = ibPatch().ibSamplingPointDelta();
244 scalarField omegaSample = this->ibSamplingPointValue();
259 const scalar yPlusSample = ypd[ibCellI];
263 if (yPlusSample > yPlusLam)
267 tauW = magUtanOld[ibCellI]*Cmu25*
sqrt(
k[ibCellI])*
kappa_
268 /
log(
E_*yPlusSample);
273 tauW = magUtanOld[ibCellI]*Cmu25*
sqrt(
k[ibCellI])/yPlusSample;
279 tauWall[ibCellI] = tauW*UtanOld[ibCellI]/(magUtanOld[ibCellI] + SMALL);
283 scalar yPlusIB = yPlusSample*
y[ibCellI]/ySample[ibCellI];
286 if (yPlusIB > yPlusLam)
288 const scalar nuLam =
nu[ibCellI];
293 scalar nutw = nuLam*(yPlusIB*
kappa_/
log(
E_*yPlusIB) - 1);
297 sqr((nutw + nuLam)*magGradUw[ibCellI])/
301 kNew[ibCellI] = tauW/Cmu50;
305 omegaNew[ibCellI] =
sqrt(kNew[ibCellI])/(Cmu25*
kappa_*
y[ibCellI]);
311 nutNew[ibCellI] = nutw;
322 kNew[ibCellI] =
k[ibCellI]*
sqr(yPlusIB/yPlusLam);
325 omegaNew[ibCellI] = 6.0*
nu[ibCellI]/(
beta1_*
sqr(
y[ibCellI]));
330 if(omegaNew[ibCellI] > 10.0)
336 UTangentialNew[ibCellI] =
uTau*yPlusIB;
339 nutNew[ibCellI] = SMALL;
349 Uw.wallMask() =
true;
351 nutw.wallMask() =
true;
352 this->wallMask() =
true;
355 immersedBoundaryWallFunctionFvPatchScalarField::updateCoeffs();
365 this->setIbCellValues(this->wallValue());
375 writeEntryIfDifferent<word>(os,
"U",
"U",
UName_);
376 writeEntryIfDifferent<word>(os,
"k",
"k",
kName_);
377 writeEntryIfDifferent<word>(os,
"G",
"RASModel::G",
GName_);
378 writeEntryIfDifferent<word>(os,
"nu",
"nu",
nuName_);
379 writeEntryIfDifferent<word>(os,
"nut",
"nut",
nutName_);