64 initABL_(
dict.getOrDefault<bool>(
"initABL", true)),
70 C1_(
dict.getOrDefault(
"C1", 0.0)),
71 C2_(
dict.getOrDefault(
"C2", 1.0)),
91 initABL_(abl.initABL_),
99 flowDir_(abl.flowDir_.clone()),
100 zDir_(abl.zDir_.clone()),
101 Uref_(abl.Uref_.clone()),
102 Zref_(abl.Zref_.clone()),
103 z0_(abl.z0_.clone(patch_)),
104 d_(abl.d_.clone(patch_))
110 initABL_(abl.initABL_),
118 flowDir_(abl.flowDir_.clone()),
119 zDir_(abl.zDir_.clone()),
120 Uref_(abl.Uref_.clone()),
121 Zref_(abl.Zref_.clone()),
122 z0_(abl.z0_.clone(patch_)),
123 d_(abl.d_.clone(patch_))
132 const vector dir(flowDir_->value(t));
133 const scalar magDir =
mag(dir);
138 <<
"magnitude of " << flowDir_->name() <<
" = " << magDir
139 <<
" vector must be greater than zero" 150 const vector dir(zDir_->value(t));
151 const scalar magDir =
mag(dir);
156 <<
"magnitude of " << zDir_->name() <<
" = " << magDir
157 <<
" vector must be greater than zero" 168 const scalar Uref = Uref_->value(t);
169 const scalar Zref = Zref_->value(t);
174 <<
"Negative entry in " << Zref_->name() <<
" = " << Zref
179 return kappa_*Uref/
log((Zref + z0)/z0);
187 z0_->autoMap(mapper);
198 const atmBoundaryLayer& abl,
204 z0_->rmap(abl.z0_(), addr);
208 d_->rmap(abl.d_(), addr);
218 const scalar groundMin =
zDir() & ppMin_;
235 const scalar groundMin =
zDir() & ppMin_;
240 *
sqrt(C1_*
log(((
zDir() & pCf) - groundMin - d + z0)/z0) + C2_);
249 const scalar groundMin =
zDir() & ppMin_;
253 pow3(
Ustar(z0))/(kappa_*((
zDir() & pCf) - groundMin - d + z0))
254 *
sqrt(C1_*
log(((
zDir() & pCf) - groundMin - d + z0)/z0) + C2_);
263 const scalar groundMin =
zDir() & ppMin_;
266 return Ustar(z0)/(kappa_*
sqrt(Cmu_)*((
zDir() & pCf) - groundMin - d + z0));
273 os.writeEntry(
"kappa", kappa_);
274 os.writeEntry(
"Cmu", Cmu_);
275 os.writeEntry(
"C1", C1_);
276 os.writeEntry(
"C2", C2_);
279 flowDir_->writeData(
os);
283 zDir_->writeData(
os);
287 Uref_->writeData(
os);
291 Zref_->writeData(
os);
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Base class to set log-law type ground-normal inlet boundary conditions for wind velocity and turbulen...
tmp< scalarField > k(const vectorField &pCf) const
Return the turbulent kinetic energy distribution for the ATM.
dimensionedScalar log(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
vector flowDir() const
Return flow direction.
A bounding box defined in terms of min/max extrema points.
tmp< scalarField > Ustar(const scalarField &z0) const
Return friction velocity.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
vector zDir() const
Return the ground-normal direction.
tmp< scalarField > omega(const vectorField &pCf) const
Return the specific dissipation rate distribution for the ATM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< vectorField > U(const vectorField &pCf) const
Return the velocity distribution for the ATM.
A FieldMapper for finite-volume patch fields.
void write(Ostream &) const
Write.
bool initABL_
Flag to initialise profiles with the theoretical ABL expressions, otherwise initialises by using "val...
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pow3(const dimensionedScalar &ds)
scalar timeOutputValue() const
Return current time value.
tmp< scalarField > epsilon(const vectorField &pCf) const
Return the turbulent dissipation rate distribution for the ATM.
const std::string patch
OpenFOAM patch number as a std::string.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
atmBoundaryLayer(const Time &time, const polyPatch &pp)
Construct null from time.