36 namespace compressible
44 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus
49 const label patchI = patch().index();
59 if (roughnessHeight_ > 0.0)
62 const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_;
63 static const scalar c_2 = 2.25/(90 - 2.25);
64 static const scalar c_3 = 2.0*
atan(1.0)/
log(90/2.25);
65 static const scalar c_4 = c_3*
log(2.25);
73 const scalar magUpara = magUp[facei];
74 const scalar
Re = rho[facei]*magUpara*y[facei]/muw[facei];
75 const scalar kappaRe = kappa_*
Re;
77 scalar yp = yPlusLam_;
78 const scalar ryPlusLam = 1.0/yp;
81 scalar yPlusLast = 0.0;
82 scalar dKsPlusdYPlus = roughnessHeight_/y[facei];
86 if (dKsPlusdYPlus > 1)
92 dKsPlusdYPlus *= roughnessFudgeFactor_;
99 scalar KsPlus = yp*dKsPlusdYPlus;
104 scalar yPlusGPrime = 0.0;
108 const scalar t_1 = 1 + roughnessConstant_*KsPlus;
110 yPlusGPrime = roughnessConstant_*KsPlus/t_1;
112 else if (KsPlus > 2.25)
114 const scalar t_1 = c_1*KsPlus - c_2;
115 const scalar t_2 = c_3*
log(KsPlus) - c_4;
116 const scalar sint_2 =
sin(t_2);
117 const scalar logt_1 =
log(t_1);
120 (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*
cos(t_2));
123 scalar denom = 1.0 +
log(E_*yp) - G - yPlusGPrime;
124 if (
mag(denom) > VSMALL)
126 yp = (kappaRe + yp*(1 - yPlusGPrime))/denom;
131 mag(ryPlusLam*(yp - yPlusLast)) > 0.0001
136 yPlus[facei] =
max(0.0, yp);
145 const scalar magUpara = magUp[facei];
146 const scalar
Re = rho[facei]*magUpara*y[facei]/muw[facei];
147 const scalar kappaRe = kappa_*
Re;
149 scalar yp = yPlusLam_;
150 const scalar ryPlusLam = 1.0/yp;
153 scalar yPlusLast = 0.0;
158 yp = (kappaRe + yp)/(1.0 +
log(E_*yp));
162 mag(ryPlusLam*(yp - yPlusLast)) > 0.0001
166 yPlus[facei] =
max(0.0, yp);
175 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcMut()
const
177 const label patchI = patch().index();
195 if (yPlus[facei] > yPlusLam_)
197 const scalar
Re = rho[facei]*magUp[facei]*y[facei]/muw[facei];
198 mutw[facei] = muw[facei]*(
sqr(yPlus[facei])/Re - 1);
208 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
209 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
222 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
223 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
238 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
239 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
253 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
254 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
266 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::
267 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
283 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus()
const
285 const label patchI = patch().index();
291 return calcYPlus(magUp);
295 void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write
300 fixedValueFvPatchScalarField::write(os);
301 writeLocalEntries(os);