38#define addObstacleReader(obsType, obsName) \
41 namespace PDRobstacles \
43 addNamedToMemberFunctionSelectionTable \
76 for (scalar& val : blockage)
78 val = 1 - limits01.clip(val);
115 { inletDirnType::_X,
"-x" },
116 { inletDirnType::_Y,
"-y" },
117 { inletDirnType::_Z,
"-z" },
118 { inletDirnType::_X,
"_x" },
119 { inletDirnType::_Y,
"_y" },
120 { inletDirnType::_Z,
"_z" },
121 { inletDirnType::X,
"+x" },
122 { inletDirnType::Y,
"+y" },
123 { inletDirnType::Z,
"+z" },
124 { inletDirnType::X,
"x" },
125 { inletDirnType::Y,
"y" },
126 { inletDirnType::Z,
"z" },
134addObstacleReader(cylinder, cyl);
135addObstacleReader(cylinder, cylinder);
143 obs.PDRobstacle::readProperties(
dict);
155 obs.
orient = vectorComponentsNames.get(
"direction",
dict);
173addObstacleReader(diagbeam,
diag);
174addObstacleReader(diagbeam, diagbeam);
182 obs.PDRobstacle::readProperties(
dict);
190 dict.readEntry(
"point", obs.
pt);
191 dict.readEntry(
"length", obs.
len());
195 obs.
orient = vectorComponentsNames.get(
"direction",
dict);
198 scalar angle =
dict.get<scalar>(
"angle");
200 while (angle > 180) angle -= 180;
201 while (angle < 0) angle += 180;
204 dict.readEntry(
"width", dims);
219 const scalar ctheta =
cos(obs.
theta());
220 const scalar stheta =
sin(obs.
theta());
242 Info<<
"... changed diag-beam to box" <<
nl;
275addObstacleReader(
cuboid, box);
283 obs.PDRobstacle::readProperties(
dict);
290 dict.readEntry(
"point", obs.
pt);
298 obs.
xbkge = blockages.x();
299 obs.
ybkge = blockages.y();
300 obs.
zbkge = blockages.z();
306addObstacleReader(wallbeam, wallbeam);
328addObstacleReader(grating, grating);
329addObstacleReader(grating, grate);
337 obs.PDRobstacle::readProperties(
dict);
343 dict.readEntry(
"point", obs.
pt);
356 obs.
xbkge = blockages.x();
357 obs.
ybkge = blockages.y();
358 obs.
zbkge = blockages.z();
384addObstacleReader(louver, louver);
385addObstacleReader(louver, louvre);
393 obs.PDRobstacle::readProperties(
dict);
399 dict.readEntry(
"point", obs.
pt);
412 obs.
xbkge = blockages.x();
413 obs.
ybkge = blockages.y();
414 obs.
zbkge = blockages.z();
420 const scalar blowoffPress =
dict.get<scalar>(
"pressure");
428 Info<<
"Louver : blowoff-type 1 not yet implemented." <<
nl;
433 Info<<
"Louver : has blowoff time set,"
434 <<
" not set to blow off cell-by-cell" <<
nl;
443 && (blowoffPress > 0)
446 if (blowoffPress > maxBlowoffPressure)
448 Info<<
"Blowoff pressure (" << blowoffPress
449 <<
") too high for blowoff type "
456 Info<<
"Problem with blowoff parameters" <<
nl;
458 Info<<
"Pressure[bar] " << blowoffPress
468addObstacleReader(patch, patch);
476 obs.PDRobstacle::readProperties(
dict);
483 if (patchName.empty())
486 <<
"RECT_PATCH without a patch name"
489 else if (patchName.length() != nameLen)
492 <<
"RECT_PATCH stripped invalid characters from patch name: "
502 dict.readEntry(
"point", obs.
pt);
510#undef addObstacleReader
Macros for easy insertion into member function selection tables.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
T & first() noexcept
The first element of the list, position [0].
static MinMax< scalar > zero_one()
A 0-1 range corresponding to the pTraits zero, one.
Obstacle definitions for PDR.
scalar sortBias
Bias for position sorting.
point pt
The obstacle location.
direction orient
The x/y/z orientation (0,1,2)
vector span
The obstacle dimensions (for boxes)
int typeId
The obstacle type-id.
void flip()
Flip the Pair in-place.
const T & second() const noexcept
Return second element, which is also the last element.
virtual bool read()
Re-read model coefficients if they have changed.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
Specialization of rigidBody to construct a cuboid given the mass and lengths of the sides.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
virtual void validate()
Validate the turbulence fields after construction.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
PtrList< volScalarField > & Y
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Different types of constants.
constexpr scalar barToPa(const scalar bar) noexcept
Conversion from bar to Pa.
dimensionedScalar sin(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool equal(const T &s1, const T &s2)
Compare two values for equality.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
static constexpr const zero Zero
Global zero (0)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
static constexpr int enumTypeId
static constexpr int enumTypeId
Unit conversion functions.