nutkRoughWallFunction: Re-derived and implemented to improve stability and range of applicability

This wall function is now stable even if the near-wall cell centre distance is
less than the roughness height although it is unlikely to be very accurate if
used in this way.

The sudden change limit stabilisation has been re-implemented to avoid the
near-wall viscosity being lower limited to half the laminar viscosity which has
no physical meaning.
This commit is contained in:
Henry Weller
2019-06-07 23:24:55 +01:00
parent f8f083841e
commit a1091a254a

View File

@ -43,8 +43,11 @@ scalar nutkRoughWallFunctionFvPatchScalarField::fnRough
) const ) const
{ {
// Return fn based on non-dimensional roughness height // Return fn based on non-dimensional roughness height
if (KsPlus < 2.25)
if (KsPlus < 90.0) {
return 1;
}
else if (KsPlus < 90)
{ {
return pow return pow
( (
@ -54,7 +57,7 @@ scalar nutkRoughWallFunctionFvPatchScalarField::fnRough
} }
else else
{ {
return (1.0 + Cs*KsPlus); return (1 + Cs*KsPlus);
} }
} }
@ -84,31 +87,25 @@ tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const
forAll(nutw, facei) forAll(nutw, facei)
{ {
label celli = patch().faceCells()[facei]; const label celli = patch().faceCells()[facei];
scalar uStar = Cmu25*sqrt(k[celli]); const scalar uStar = Cmu25*sqrt(k[celli]);
scalar yPlus = uStar*y[facei]/nuw[facei]; const scalar KsPlus = uStar*Ks_[facei]/nuw[facei];
scalar KsPlus = uStar*Ks_[facei]/nuw[facei]; const scalar Edash = E_/fnRough(KsPlus, Cs_[facei]);
const scalar yPlusMin = constant::mathematical::e/Edash;
scalar Edash = E_; const scalar yPlus = max(uStar*y[facei]/nuw[facei], yPlusMin);
if (KsPlus > 2.25)
{
Edash /= fnRough(KsPlus, Cs_[facei]);
}
scalar limitingNutw = max(nutw[facei], nuw[facei]);
// To avoid oscillations limit the change in the wall viscosity // To avoid oscillations limit the change in the wall viscosity
// which is particularly important if it temporarily becomes zero
nutw[facei] = nutw[facei] =
max max
( (
min min
( (
nuw[facei] nuw[facei]
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1), *max(yPlus*kappa_/log(max(Edash*yPlus, 1)) - 1, 0),
2*limitingNutw max(2*nutw[facei], nuw[facei])
), 0.5*limitingNutw ),
0.5*nutw[facei]
); );
if (debug) if (debug)
@ -116,6 +113,8 @@ tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const
Info<< "yPlus = " << yPlus Info<< "yPlus = " << yPlus
<< ", KsPlus = " << KsPlus << ", KsPlus = " << KsPlus
<< ", Edash = " << Edash << ", Edash = " << Edash
<< ", yPlusMin " << yPlusMin
<< ", yPlusLam " << yPlusLam(kappa_, Edash)
<< ", nutw = " << nutw[facei] << ", nutw = " << nutw[facei]
<< endl; << endl;
} }