41 const label patchi = patch().index();
53 internalField().group()
69 const auto yPlus = [&](
const label facei) -> scalar
75 const auto nutLog = [&](
const label facei) -> scalar
77 const scalar yPlusFace =
yPlus(facei);
80 nutVis[facei]*yPlusFace*kappa
81 /
log(
max(E*yPlusFace, 1 + 1
e-4))
86 auto&
nutw = tnutw.ref();
90 case blenderType::STEPWISE:
94 if (
yPlus(facei) > yPlusLam)
96 nutw[facei] = nutLog(facei);
100 nutw[facei] = nutVis[facei];
106 case blenderType::MAX:
111 nutw[facei] =
max(nutVis[facei], nutLog(facei));
116 case blenderType::BINOMIAL:
124 pow(nutVis[facei],
n_) +
pow(nutLog(facei),
n_),
131 case blenderType::EXPONENTIAL:
136 const scalar yPlusFace =
yPlus(facei);
137 const scalar Gamma = 0.01*
pow4(yPlusFace)/(1 + 5*yPlusFace);
138 const scalar invGamma = scalar(1)/(Gamma + ROOTVSMALL);
141 nutVis[facei]*
exp(-Gamma) + nutLog(facei)*
exp(-invGamma);
146 case blenderType::TANH:
151 const scalar nutLogFace = nutLog(facei);
152 const scalar b1 = nutVis[facei] + nutLogFace;
156 pow(nutVis[facei], 1.2) +
pow(nutLogFace, 1.2),
161 nutw[facei] = phiTanh*b1 + (1 - phiTanh)*b2;
246 const label patchi = patch().index();
253 internalField().group()
273 const scalar Cmu25 =
pow025(wallCoeffs_.Cmu());
274 const scalar yPlusLam = wallCoeffs_.yPlusLam();
277 auto&
yPlus = tyPlus.ref();
282 yPlus[facei] = Cmu25*
y[facei]*
sqrt(kwc[facei])/nutVis[facei];
284 if (yPlusLam >
yPlus[facei])
288 y[facei]*
sqrt(nuEff[facei]*magGradUw[facei])/nutVis[facei];
302 writeLocalEntries(
os);
314 nutkWallFunctionFvPatchScalarField
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Smooth ATC in cells next to a set of patches supplied by type.
A FieldMapper for finite-volume patch fields.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
static const nutWallFunctionFvPatchScalarField & nutw(const turbulenceModel &turbModel, const label patchi)
Return the nut patchField for the given wall patch.
virtual void write(Ostream &) const
Write.
wallFunctionCoefficients wallCoeffs_
Wall-function coefficients.
nutWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
This boundary condition provides a wall function for the turbulent viscosity (i.e....
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
virtual void write(Ostream &) const
Write.
void writeLocalEntries(Ostream &) const
Write local wall function variables.
nutkWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
void writeEntries(Ostream &) const
Write wall-function blending data as dictionary entries.
wallFunctionBlenders()
Default construct with default coefficients.
blenderType
Options for the blending treatment of viscous and inertial sublayers.
@ STEPWISE
"Stepwise switch (discontinuous)"
enum blenderType blender_
Blending treatment.
scalar n_
Binomial blending exponent being used when blenderType is blenderType::BINOMIAL.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar exp(const dimensionedScalar &ds)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar tanh(const dimensionedScalar &ds)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar pow4(const dimensionedScalar &ds)
static constexpr const zero Zero
Global zero (0).
UList< label > labelUList
A UList of labels.
fvPatchField< vector > fvPatchVectorField
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar pow025(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.