41 const label patchi =
patch().index();
48 internalField().
group()
65 sqr(
calcUTau(magGradU))/(magGradU + ROOTVSMALL) - nuw
86 nutw[facei] = this->operator[](facei);
101 return calcUTau(magGradU, maxIter_, err);
113 const label patchi =
patch().index();
120 internalField().
group()
132 const scalar
kappa = wallCoeffs_.kappa();
133 const scalar E = wallCoeffs_.E();
138 auto&
uTau = tuTau.ref();
145 scalar ut =
sqrt((nutw[facei] + nuw[facei])*magGradU[facei]);
156 const scalar fkUu =
exp(kUu) - 1 - kUu*(1 + 0.5*kUu);
159 - ut*
y[facei]/nuw[facei]
161 + 1.0/E*(fkUu - 1.0/6.0*kUu*
sqr(kUu));
168 const scalar uTauNew = ut +
f/df;
169 err[facei] =
mag((ut - uTauNew)/ut);
177 && err[facei] > tolerance_
181 uTau[facei] =
max(scalar(0), ut);
238 maxIter_(ptf.maxIter_),
239 tolerance_(ptf.tolerance_)
256 maxIter_(
dict.getOrDefault<label>(
"maxIter", 10)),
257 tolerance_(
dict.getOrDefault<scalar>(
"tolerance", 0.01))
272 maxIter_(wfpsf.maxIter_),
273 tolerance_(wfpsf.tolerance_)
289 maxIter_(wfpsf.maxIter_),
290 tolerance_(wfpsf.tolerance_)
324 const label patchi =
patch().index();
331 internalField().
group()
352 writeLocalEntries(
os);
364 nutUSpaldingWallFunctionFvPatchScalarField
void writeLocalEntries(Ostream &) const
Write local wall function variables.
virtual const volVectorField & U(const turbulenceModel &turb) const
Helper to return the velocity field either from the turbulence model (default) or the mesh database...
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Abstract base class for turbulence models (RAS, LES and laminar).
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.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
The class nutWallFunction is an abstract base class that hosts calculation methods and common functi...
This boundary condition provides a wall function for the turbulent viscosity (i.e. nut) based on velocity (i.e. U). Using Spalding's law gives a continuous nut profile to the wall.
void setSize(const label n)
Alias for resize()
dimensionedScalar exp(const dimensionedScalar &ds)
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
tmp< scalarField > calcUTau(const scalarField &magGradU) const
Calculate the friction velocity.
nutUSpaldingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void write(Ostream &os) const
Write.
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.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void write(Ostream &) const
Write.
virtual tmp< scalarField > calcNut() const
Uncomment in case of intrumentation.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
OBJstream os(runTime.globalPath()/outputName)
const scalar tolerance_
Convergence tolerance.
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.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
A class for managing temporary objects.
static const nutWallFunctionFvPatchScalarField & nutw(const turbulenceModel &turbModel, const label patchi)
Return the nut patchField for the given wall patch.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual ~nutUSpaldingWallFunctionFvPatchScalarField()
Destructor.
static constexpr const zero Zero
Global zero (0)