49 (KsPlus - 2.25)/87.75 +
Cs*KsPlus,
50 sin(0.4258*(
log(KsPlus) - 0.811))
54 return (1.0 +
Cs*KsPlus);
61 const label patchi = patch().index();
63 const auto& turbModel = db().lookupObject<turbulenceModel>
68 internalField().group()
74 const tmp<volScalarField> tk = turbModel.k();
77 const tmp<scalarField> tnuw = turbModel.nu(patchi);
80 const scalar Cmu25 =
pow025(wallCoeffs_.Cmu());
81 const scalar kappa = wallCoeffs_.kappa();
82 const scalar E = wallCoeffs_.E();
85 auto& nutw = tnutw.ref();
89 const label celli = patch().faceCells()[facei];
91 const scalar uStar = Cmu25*
sqrt(
k[celli]);
92 const scalar
yPlus = uStar*
y[facei]/nuw[facei];
93 const scalar KsPlus = uStar*Ks_[facei]/nuw[facei];
98 Edash /= fnRough(KsPlus, Cs_[facei]);
101 const scalar limitingNutw =
max(nutw[facei], nuw[facei]);
119 <<
", KsPlus = " << KsPlus
120 <<
", Edash = " << Edash
121 <<
", nutw = " << nutw[facei]
136 Ks_.writeEntry(
"Ks",
os);
216 nutkWallFunctionFvPatchScalarField::autoMap(m);
228 nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);
230 const auto& nrwfpsf =
233 Ks_.rmap(nrwfpsf.Ks_, addr);
234 Cs_.rmap(nrwfpsf.Cs_, addr);
244 writeLocalEntries(
os);
256 nutkRoughWallFunctionFvPatchScalarField
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,...
A FieldMapper for finite-volume patch fields.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
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.
This boundary condition provides a wall-function for the turbulent viscosity (i.e....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
scalarField Cs_
Roughness constant.
virtual void write(Ostream &) const
Write.
virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const
Compute the roughness function.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
scalarField & Cs()
Return Cs.
scalarField Ks_
Roughness height.
void writeLocalEntries(Ostream &os) const
Write local wall function variables.
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
nutkRoughWallFunctionFvPatchScalarField(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.
nutkWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
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.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
Namespace for handling debugging switches.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar sin(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar pow025(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.