50 if (!isA<wallFvPatch>(patch()))
53 <<
"Invalid wall function specification" <<
nl
54 <<
" Patch type for patch " << patch().name()
55 <<
" must be wall" <<
nl
56 <<
" Current patch type is " << patch().type() <<
nl <<
endl
87atmAlphatkWallFunctionFvPatchScalarField::
88atmAlphatkWallFunctionFvPatchScalarField
94 fixedValueFvPatchScalarField(
p, iF),
105atmAlphatkWallFunctionFvPatchScalarField::
106atmAlphatkWallFunctionFvPatchScalarField
114 fixedValueFvPatchScalarField(ptf,
p, iF, mapper),
117 Pr_(ptf.Pr_.clone()),
118 Prt_(ptf.Prt_.clone(
p.patch())),
119 z0_(ptf.z0_.clone(
p.patch()))
125atmAlphatkWallFunctionFvPatchScalarField::
126atmAlphatkWallFunctionFvPatchScalarField
133 fixedValueFvPatchScalarField(
p, iF,
dict),
136 dict.getCheckOrDefault<scalar>
145 dict.getCheckOrDefault<scalar>
160atmAlphatkWallFunctionFvPatchScalarField::
161atmAlphatkWallFunctionFvPatchScalarField
166 fixedValueFvPatchScalarField(wfpsf),
168 kappa_(wfpsf.kappa_),
169 Pr_(wfpsf.Pr_.clone()),
170 Prt_(wfpsf.Prt_.clone(this->patch().patch())),
171 z0_(wfpsf.z0_.clone(this->patch().patch()))
177atmAlphatkWallFunctionFvPatchScalarField::
178atmAlphatkWallFunctionFvPatchScalarField
184 fixedValueFvPatchScalarField(wfpsf, iF),
186 kappa_(wfpsf.kappa_),
187 Pr_(wfpsf.Pr_.clone()),
188 Prt_(wfpsf.Prt_.clone(this->patch().patch())),
189 z0_(wfpsf.z0_.clone(this->patch().patch()))
204 const label patchi = patch().index();
212 internalField().group()
226 const scalar t = db().time().timeOutputValue();
227 const scalar
Pr =
Pr_->value(t);
233 <<
"Pr cannot be negative or zero. "
234 <<
"Please check input Pr = " <<
Pr
245 if (
Prt[i] < VSMALL || z0[i] < VSMALL)
248 <<
"Elements of input surface fields can only be positive. "
249 <<
"Please check input fields z0 and Prt."
264 const scalar Edash = (
y[facei] + z0[facei])/(z0[facei] + 1
e-4);
274 alphatw =
max(alphatw, scalar(0.01));
285 fixedValueFvPatchScalarField::autoMap(m);
304 fixedValueFvPatchScalarField::rmap(ptf, addr);
306 const auto& nrwfpsf =
307 refCast<const atmAlphatkWallFunctionFvPatchScalarField>(ptf);
311 Prt_->rmap(nrwfpsf.Prt_(), addr);
315 z0_->rmap(nrwfpsf.z0_(), addr);
324 writeEntry(
"value",
os);
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...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
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,...
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
This boundary condition provides a wall constraint on the kinematic turbulent thermal conductivity (i...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
autoPtr< PatchFunction1< scalar > > z0_
Surface roughness length [m].
void writeLocalEntries(Ostream &) const
Write local wall function variables.
static scalar tolerance_
Solution parameters.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
autoPtr< Function1< scalar > > Pr_
Molecular Prandtl number.
const scalar kappa_
von Kármán constant
const scalar Cmu_
Empirical model constant.
autoPtr< PatchFunction1< scalar > > Prt_
Turbulent Prandtl number field.
virtual void checkType()
Check the type of the patch.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Smooth ATC in cells next to a set of patches supplied by type.
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class for managing temporary objects.
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar log(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar pow025(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
dimensionedScalar Prt("Prt", dimless, laminarTransport)
dimensionedScalar Pr("Pr", dimless, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.