38#define addObstacleReader(obsType, obsName) \
41 namespace PDRobstacles \
43 addNamedToMemberFunctionSelectionTable \
75 for (scalar& val : blockage)
92static const Foam::Enum<Foam::vector::components>
111static const Foam::Enum<inletDirnType>
114 { inletDirnType::_X,
"-x" },
115 { inletDirnType::_Y,
"-y" },
116 { inletDirnType::_Z,
"-z" },
117 { inletDirnType::_X,
"_x" },
118 { inletDirnType::_Y,
"_y" },
119 { inletDirnType::_Z,
"_z" },
120 { inletDirnType::X,
"+x" },
121 { inletDirnType::Y,
"+y" },
122 { inletDirnType::Z,
"+z" },
123 { inletDirnType::X,
"x" },
124 { inletDirnType::Y,
"y" },
125 { inletDirnType::Z,
"z" },
133addObstacleReader(cylinder, cyl);
134addObstacleReader(cylinder, cylinder);
142 obs.PDRobstacle::readProperties(
dict);
150 dict.readEntry(
"point", obs.
pt);
151 dict.readEntry(
"length", obs.
len());
152 dict.readEntry(
"diameter", obs.
dia());
154 obs.
orient = vectorComponentsNames.get(
"direction",
dict);
181 obs.PDRobstacle::readProperties(
dict);
189 dict.readEntry(
"point", obs.
pt);
190 dict.readEntry(
"length", obs.
len());
194 obs.
orient = vectorComponentsNames.get(
"direction",
dict);
197 scalar angle =
dict.get<scalar>(
"angle");
199 while (angle > 180) angle -= 180;
200 while (angle < 0) angle += 180;
203 dict.readEntry(
"width", dims);
218 const scalar ctheta =
cos(obs.
theta());
219 const scalar stheta =
sin(obs.
theta());
241 Info<<
"... changed diag-beam to box" <<
nl;
274addObstacleReader(
cuboid, box);
282 obs.PDRobstacle::readProperties(
dict);
289 dict.readEntry(
"point", obs.
pt);
297 obs.
xbkge = blockages.x();
298 obs.
ybkge = blockages.y();
299 obs.
zbkge = blockages.z();
328addObstacleReader(
grating, grate);
336 obs.PDRobstacle::readProperties(
dict);
342 dict.readEntry(
"point", obs.
pt);
355 obs.
xbkge = blockages.x();
356 obs.
ybkge = blockages.y();
357 obs.
zbkge = blockages.z();
384addObstacleReader(
louver, louvre);
392 obs.PDRobstacle::readProperties(
dict);
398 dict.readEntry(
"point", obs.
pt);
411 obs.
xbkge = blockages.x();
412 obs.
ybkge = blockages.y();
413 obs.
zbkge = blockages.z();
419 const scalar blowoffPress =
dict.get<scalar>(
"pressure");
427 Info<<
"Louver : blowoff-type 1 not yet implemented." <<
nl;
432 Info<<
"Louver : has blowoff time set,"
433 <<
" not set to blow off cell-by-cell" <<
nl;
442 && (blowoffPress > 0)
445 if (blowoffPress > maxBlowoffPressure)
447 Info<<
"Blowoff pressure (" << blowoffPress
448 <<
") too high for blowoff type "
455 Info<<
"Problem with blowoff parameters" <<
nl;
457 Info<<
"Pressure[bar] " << blowoffPress
475 obs.PDRobstacle::readProperties(
dict);
482 if (patchName.empty())
485 <<
"RECT_PATCH without a patch name"
488 else if (patchName.
length() != nameLen)
491 <<
"RECT_PATCH stripped invalid characters from patch name: "
501 dict.readEntry(
"point", obs.
pt);
509#undef addObstacleReader
Macros for easy insertion into member function selection tables.
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 & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & y() const noexcept
Access to the vector y component.
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
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
static std::string::size_type length(const char *s)
Length of the character sequence (with nullptr protection).
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
PtrList< volScalarField > & Y
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Different types of constants.
Pair< label > labelPair
A pair of labels.
constexpr scalar barToPa(const scalar bar) noexcept
Conversion from bar to Pa.
dimensionedScalar sin(const dimensionedScalar &ds)
bool equal(const T &a, const T &b)
Compare two values for equality.
messageStream Info
Information stream (stdout output on master, null elsewhere).
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
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).
A cuboid, selectable as box.
static void read(PDRobstacle &obs, const dictionary &dict)
static constexpr int enumTypeId
static void read(PDRobstacle &obs, const dictionary &dict)
static constexpr int enumTypeId
A diagonal beam, which is cylinder-like, selectable as diag or diagbeam.
static void read(PDRobstacle &obs, const dictionary &dict)
A grating, selectable as grate or grating.
static void read(PDRobstacle &obs, const dictionary &dict)
Louver blowoff, selectable as louver or louvre.
static void read(PDRobstacle &obs, const dictionary &dict)
Rectangular patch, selectable as patch.
static void read(PDRobstacle &obs, const dictionary &dict)
A wallbeam, selectable as wallbeam which is currently identical to a box (PDRobstacles::cuboid).
static void read(PDRobstacle &obs, const dictionary &dict)
Unit conversion functions.