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.
More...
#include <nutUSpaldingWallFunctionFvPatchScalarField.H>


Public Member Functions | |
| TypeName ("nutUSpaldingWallFunction") | |
| Runtime type information. | |
| nutUSpaldingWallFunctionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &) | |
| Construct from patch and internal field. | |
| nutUSpaldingWallFunctionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &) | |
| Construct from patch, internal field and dictionary. | |
| nutUSpaldingWallFunctionFvPatchScalarField (const nutUSpaldingWallFunctionFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &) | |
| Construct by mapping given nutUSpaldingWallFunctionFvPatchScalarField onto a new patch. | |
| nutUSpaldingWallFunctionFvPatchScalarField (const nutUSpaldingWallFunctionFvPatchScalarField &) | |
| Construct as copy. | |
| nutUSpaldingWallFunctionFvPatchScalarField (const nutUSpaldingWallFunctionFvPatchScalarField &, const DimensionedField< scalar, volMesh > &) | |
| Construct as copy setting internal field reference. | |
| virtual tmp< fvPatchField< scalar > > | clone () const |
| Return a clone. | |
| virtual tmp< fvPatchField< scalar > > | clone (const DimensionedField< scalar, volMesh > &iF) const |
| Clone with an internal field reference. | |
| virtual | ~nutUSpaldingWallFunctionFvPatchScalarField () |
| Destructor. | |
| virtual tmp< scalarField > | yPlus () const |
| Calculate and return the yPlus at the boundary. | |
| virtual void | write (Ostream &os) const |
| Write. | |
| Public Member Functions inherited from nutWallFunctionFvPatchScalarField | |
| TypeName ("nutWallFunction") | |
| Runtime type information. | |
| nutWallFunctionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &) | |
| Construct from patch and internal field. | |
| nutWallFunctionFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &) | |
| Construct from patch, internal field and dictionary. | |
| nutWallFunctionFvPatchScalarField (const nutWallFunctionFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &) | |
| Construct by mapping given nutWallFunctionFvPatchScalarField onto a new patch. | |
| nutWallFunctionFvPatchScalarField (const nutWallFunctionFvPatchScalarField &) | |
| Construct as copy. | |
| nutWallFunctionFvPatchScalarField (const nutWallFunctionFvPatchScalarField &, const DimensionedField< scalar, volMesh > &) | |
| Construct as copy setting internal field reference. | |
| const wallFunctionCoefficients & | wallCoeffs () const noexcept |
| Return wallFunctionCoefficients. | |
| virtual void | updateCoeffs () |
| Update the coefficients associated with the patch field. | |
Protected Member Functions | |
| virtual tmp< scalarField > | calcNut () const |
| Uncomment in case of intrumentation. | |
| tmp< scalarField > | calcUTau (const scalarField &magGradU) const |
| Calculate the friction velocity. | |
| tmp< scalarField > | calcUTau (const scalarField &magGradU, const label maxIter, scalarField &err) const |
| Calculate the friction velocity and number of iterations for convergence. | |
| void | writeLocalEntries (Ostream &) const |
| Write local wall function variables. | |
| Protected Member Functions inherited from nutWallFunctionFvPatchScalarField | |
| 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 void | checkType () |
| Check the type of the patch. | |
| void | writeLocalEntries (Ostream &) const |
| Write local wall function variables. | |
Protected Attributes | |
| const label | maxIter_ |
| Max iterations in calcNut. | |
| const scalar | tolerance_ |
| Convergence tolerance. | |
| Protected Attributes inherited from nutWallFunctionFvPatchScalarField | |
| word | UName_ |
| Name of velocity field. | |
| wallFunctionCoefficients | wallCoeffs_ |
| Wall-function coefficients. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from nutWallFunctionFvPatchScalarField | |
| static const nutWallFunctionFvPatchScalarField & | nutw (const turbulenceModel &turbModel, const label patchi) |
| Return the nut patchField for the given wall patch. | |
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.
![\[ y^+ = u^+ + \frac{1}{E} \left[exp(\kappa u^+) - 1 - \kappa u^+\,
- 0.5 (\kappa u^+)^2 - \frac{1}{6} (\kappa u^+)^3\right]
\]](form_1042.png)
where
![]() | = | Wall-normal height of a cell centre in wall units |
![]() | = | Velocity at ![]() |
![]() | = | von Karman constant |
<patchName>
{
// Mandatory entries
type nutUSpaldingWallFunction;
// Optional entries
maxIter 10;
tolerance 0.0001;
// Inherited entries
...
}
where the entries mean:
| Property | Description | Type | Reqd | Deflt |
|---|---|---|---|---|
type | Type name: nutUSpaldingWallFunction | word | yes | - |
maxIter | Number of Newton-Raphson iterations | label | no | 10 |
tolerance | Convergence tolerance | scalar | no | 0.0001 |
The inherited entries are elaborated in:
correctNut() (called through turbulence->validate) returns a slightly different value every time it is called. This is since the seed for the Newton-Raphson iteration uses the current value of *this (=nut ).Definition at line 141 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
| nutUSpaldingWallFunctionFvPatchScalarField | ( | const fvPatch & | p, |
| const DimensionedField< scalar, volMesh > & | iF ) |
Construct from patch and internal field.
Definition at line 204 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References maxIter_, nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField(), p, and tolerance_.
Referenced by nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), and TypeName().


| nutUSpaldingWallFunctionFvPatchScalarField | ( | const fvPatch & | p, |
| const DimensionedField< scalar, volMesh > & | iF, | ||
| const dictionary & | dict ) |
Construct from patch, internal field and dictionary.
Definition at line 240 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References dict, maxIter_, nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField(), p, and tolerance_.

| nutUSpaldingWallFunctionFvPatchScalarField | ( | const nutUSpaldingWallFunctionFvPatchScalarField & | ptf, |
| const fvPatch & | p, | ||
| const DimensionedField< scalar, volMesh > & | iF, | ||
| const fvPatchFieldMapper & | mapper ) |
Construct by mapping given nutUSpaldingWallFunctionFvPatchScalarField onto a new patch.
Definition at line 221 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References maxIter_, nutUSpaldingWallFunctionFvPatchScalarField(), nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField(), p, and tolerance_.

| nutUSpaldingWallFunctionFvPatchScalarField | ( | const nutUSpaldingWallFunctionFvPatchScalarField & | wfpsf | ) |
Construct as copy.
Definition at line 258 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References maxIter_, nutUSpaldingWallFunctionFvPatchScalarField(), nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField(), and tolerance_.

| nutUSpaldingWallFunctionFvPatchScalarField | ( | const nutUSpaldingWallFunctionFvPatchScalarField & | wfpsf, |
| const DimensionedField< scalar, volMesh > & | iF ) |
Construct as copy setting internal field reference.
Definition at line 274 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References maxIter_, nutUSpaldingWallFunctionFvPatchScalarField(), nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField(), and tolerance_.

|
virtual |
Destructor.
Definition at line 293 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
|
protectedvirtual |
Uncomment in case of intrumentation.
mutable uint64_t invocations_; mutable uint64_t nontrivial_; mutable uint64_t nonconvergence_; mutable uint64_t iterations_;
Calculate the turbulent viscosity
Implements nutWallFunctionFvPatchScalarField.
Definition at line 32 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References calcUTau(), forAll, IOobject::groupName(), Foam::mag(), Foam::max(), nutWallFunctionFvPatchScalarField::nutw(), turbulenceModel::propertiesName, tmp< T >::ref(), Foam::sqr(), tolerance_, and U.

|
protected |
Calculate the friction velocity.
Definition at line 88 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References calcUTau(), and maxIter_.
Referenced by calcNut(), calcUTau(), and yPlus().


|
protected |
Calculate the friction velocity and number of iterations for convergence.
Definition at line 99 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References Foam::exp(), f(), forAll, IOobject::groupName(), Foam::mag(), magUp, Foam::max(), Foam::min(), tmp< T >::New(), nutWallFunctionFvPatchScalarField::nutw(), fvPatchField< Type >::patchInternalField(), turbulenceModel::propertiesName, List< T >::setSize(), Foam::sqr(), Foam::sqrt(), tolerance_, U, uTau, nutWallFunctionFvPatchScalarField::wallCoeffs_, y, and Foam::Zero.

|
protected |
Write local wall function variables.
Definition at line 192 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References maxIter_, os(), and tolerance_.
Referenced by write().


| TypeName | ( | "nutUSpaldingWallFunction" | ) |
Runtime type information.
References nutUSpaldingWallFunctionFvPatchScalarField().

|
inlinevirtual |
Return a clone.
Definition at line 260 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
References fvPatchField< Type >::Clone().

|
inlinevirtual |
Clone with an internal field reference.
Definition at line 268 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
References fvPatchField< Type >::Clone().

|
virtual |
Calculate and return the yPlus at the boundary.
Implements nutWallFunctionFvPatchScalarField.
Definition at line 315 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References calcUTau(), IOobject::groupName(), Foam::mag(), turbulenceModel::propertiesName, fvPatchField< Type >::snGrad(), U, and y.

|
virtual |
Write.
Reimplemented from nutWallFunctionFvPatchScalarField.
Definition at line 339 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References os(), nutWallFunctionFvPatchScalarField::write(), writeLocalEntries(), and fvPatchField< Type >::writeValueEntry().

|
protected |
Max iterations in calcNut.
Definition at line 152 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
Referenced by calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), and writeLocalEntries().
|
protected |
Convergence tolerance.
Definition at line 157 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
Referenced by calcNut(), calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), nutUSpaldingWallFunctionFvPatchScalarField(), and writeLocalEntries().