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...
Protected Member Functions | |
virtual tmp< scalarField > | calcNut () const |
Uncomment in case of intrumentation. More... | |
tmp< scalarField > | calcUTau (const scalarField &magGradU) const |
Calculate the friction velocity. More... | |
tmp< scalarField > | calcUTau (const scalarField &magGradU, const label maxIter, scalarField &err) const |
Calculate the friction velocity and number of iterations for convergence. More... | |
void | writeLocalEntries (Ostream &) const |
Write local wall function variables. More... | |
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. More... | |
virtual void | checkType () |
Check the type of the patch. More... | |
void | writeLocalEntries (Ostream &) const |
Write local wall function variables. More... | |
Protected Attributes | |
const label | maxIter_ |
Max iterations in calcNut. More... | |
const scalar | tolerance_ |
Convergence tolerance. More... | |
Protected Attributes inherited from nutWallFunctionFvPatchScalarField | |
word | UName_ |
Name of velocity field. More... | |
wallFunctionCoefficients | wallCoeffs_ |
Wall-function coefficients. More... | |
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. More... | |
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.
where
= | Wall-normal height of a cell centre in wall units | |
= | Velocity at in wall units | |
= | 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 206 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
nutUSpaldingWallFunctionFvPatchScalarField | ( | const fvPatch & | p, |
const DimensionedField< scalar, volMesh > & | iF, | ||
const dictionary & | dict | ||
) |
Construct from patch, internal field and dictionary.
Definition at line 242 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
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 223 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
nutUSpaldingWallFunctionFvPatchScalarField | ( | const nutUSpaldingWallFunctionFvPatchScalarField & | wfpsf | ) |
Construct as copy.
Definition at line 260 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
nutUSpaldingWallFunctionFvPatchScalarField | ( | const nutUSpaldingWallFunctionFvPatchScalarField & | wfpsf, |
const DimensionedField< scalar, volMesh > & | iF | ||
) |
Construct as copy setting internal field reference.
Definition at line 276 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
|
virtual |
Destructor.
Definition at line 294 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 GeometricField< Type, PatchField, GeoMesh >::boundaryField(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), forAll, Foam::constant::atomic::group, IOobject::groupName(), Foam::mag(), Foam::max(), nutWallFunctionFvPatchScalarField::nutw(), Foam::foamVersion::patch, turbulenceModel::propertiesName, tmp< T >::ref(), Foam::sqr(), nutUSpaldingWallFunctionFvPatchScalarField::tolerance_, and nutWallFunctionFvPatchScalarField::U().
|
protected |
Calculate the friction velocity.
Definition at line 89 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
Referenced by nutUSpaldingWallFunctionFvPatchScalarField::calcNut().
|
protected |
Calculate the friction velocity and number of iterations for convergence.
Definition at line 100 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References Foam::exp(), f(), forAll, Foam::constant::atomic::group, IOobject::groupName(), Foam::constant::electromagnetic::kappa, Foam::mag(), magUp, Foam::max(), Foam::min(), tmp< T >::New(), Foam::foamVersion::patch, fvPatchField< Type >::patchInternalField(), turbulenceModel::propertiesName, List< T >::setSize(), Foam::sqr(), Foam::sqrt(), U, uTau, y, and Foam::Zero.
|
protected |
Write local wall function variables.
Definition at line 193 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References os(), and Ostream::writeEntryIfDifferent().
TypeName | ( | "nutUSpaldingWallFunction" | ) |
Runtime type information.
|
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 269 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 Foam::constant::atomic::group, IOobject::groupName(), Foam::mag(), Foam::foamVersion::patch, turbulenceModel::propertiesName, fvPatchField< Type >::snGrad(), U, and y.
|
virtual |
Write.
Reimplemented from nutWallFunctionFvPatchScalarField.
Definition at line 340 of file nutUSpaldingWallFunctionFvPatchScalarField.C.
References os(), nutWallFunctionFvPatchScalarField::write(), and fvPatchField< Type >::writeValueEntry().
|
protected |
Max iterations in calcNut.
Definition at line 152 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
|
protected |
Convergence tolerance.
Definition at line 157 of file nutUSpaldingWallFunctionFvPatchScalarField.H.
Referenced by nutUSpaldingWallFunctionFvPatchScalarField::calcNut().