30 const Foam::scalar Foam::atmBoundaryLayer::kappaDefault_ = 0.41;
32 const Foam::scalar Foam::atmBoundaryLayer::CmuDefault_ = 0.09;
37 void Foam::atmBoundaryLayer::init()
39 if (
mag(flowDir_) < small ||
mag(zDir_) < small)
42 <<
"magnitude of n or z must be greater than zero" 47 flowDir_ /=
mag(flowDir_);
50 Ustar_ = kappa_*Uref_/(
log((Zref_ + z0_)/z0_));
86 const scalar epsilonLower
101 epsilonLower_(epsilonLower)
113 flowDir_(dict.
lookup(
"flowDir")),
114 zDir_(dict.
lookup(
"zDir")),
117 Uref_(dict.
lookup<scalar>(
"Uref")),
118 Zref_(dict.
lookup<scalar>(
"Zref")),
119 z0_(
"z0", dict, p.
size()),
120 zGround_(
"zGround", dict, p.
size()),
122 offset_(dict.
found(
"Ulower")),
137 flowDir_(abl.flowDir_),
143 z0_(mapper(abl.z0_)),
144 zGround_(mapper(abl.zGround_)),
145 Ustar_(mapper(abl.Ustar_)),
146 offset_(abl.offset_),
147 Ulower_(abl.Ulower_),
148 kLower_(abl.kLower_),
149 epsilonLower_(abl.epsilonLower_)
155 flowDir_(abl.flowDir_),
162 zGround_(abl.zGround_),
164 offset_(abl.offset_),
165 Ulower_(abl.Ulower_),
166 kLower_(abl.kLower_),
167 epsilonLower_(abl.epsilonLower_)
176 m(zGround_, zGround_);
187 z0_.
rmap(blptf.z0_, addr);
188 zGround_.
rmap(blptf.zGround_, addr);
189 Ustar_.
rmap(blptf.Ustar_, addr);
201 *
log(
max((zDir_ & p) - zGround_ + z0_, z0_)/z0_)
206 return flowDir_*Un + flowDir_*Ulower_;
242 pow3(Ustar_)/(kappa_*((zDir_ & p) - zGround_ + z0_))
248 tepsilon.
ref() =
pos0(z)*tepsilon() +
neg(z)*epsilonLower_;
269 writeEntry(os,
"epsilonLower", epsilonLower_);
This class provides functions to evaluate the velocity and turbulence distributions appropriate for a...
tmp< scalarField > epsilon(const vectorField &p) const
Return the turbulent dissipation rate distribution for the ATM.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
dimensionedScalar log(const dimensionedScalar &ds)
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< vectorField > U(const vectorField &p) const
Return the velocity distribution for the ATM.
tmp< scalarField > k(const vectorField &p) const
Return the turbulent kinetic energy distribution for the ATM.
dimensionedScalar neg(const dimensionedScalar &ds)
Foam::fvPatchFieldMapper.
void write(Ostream &) const
Write.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar pos0(const dimensionedScalar &ds)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar pow3(const dimensionedScalar &ds)
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
atmBoundaryLayer()
Construct null.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.