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();
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]
135 Cs_.writeEntry(
"Cs",
os);
136 Ks_.writeEntry(
"Ks",
os);
165 Ks_(ptf.Ks_, mapper),
180 Cs_(
"Cs",
dict,
p.size())
216 nutkWallFunctionFvPatchScalarField::autoMap(m);
228 nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);
230 const auto& nrwfpsf =
231 refCast<const nutkRoughWallFunctionFvPatchScalarField>(ptf);
233 Ks_.rmap(nrwfpsf.Ks_, addr);
234 Cs_.rmap(nrwfpsf.Cs_, addr);
244 writeLocalEntries(
os);
256 nutkRoughWallFunctionFvPatchScalarField
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
dimensionedScalar log(const dimensionedScalar &ds)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalarField & Cs()
Return Cs.
virtual void write(Ostream &) const
Write.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
dimensionedScalar pow025(const dimensionedScalar &ds)
This boundary condition provides a wall-function for the turbulent viscosity (i.e. nut) when using wall functions for rough walls, based on the turbulent kinetic energy (i.e. k). The condition manipulates the wall roughness parameter (i.e. E) to account for roughness effects.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
label k
Boltzmann constant.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
void writeLocalEntries(Ostream &os) const
Write local wall function variables.
const dimensionedScalar e
Elementary charge.
This boundary condition provides a wall function for the turbulent viscosity (i.e. nut) based on the turbulent kinetic energy, (i.e. k) for for low- and high-Reynolds number applications.
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
virtual void write(Ostream &) const
Write.
nutkRoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const
Compute the roughness function.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
static constexpr const zero Zero
Global zero (0)