98 identifier = std::move(obsName);
145 slat_width *= factor;
160 vol = 0.25 * mathematical::pi *
sqr(dia()) * len();
164 vol = wa * wb * len();
192 if ((0.25 * dia() *
sqrt(mathematical::pi)) <= minWidth)
203 (len() <= minWidth && wa <= minWidth)
204 || (len() <= minWidth && wb <= minWidth)
205 || (wa <= minWidth && wb <= minWidth)
222 (span.x() <= minWidth && span.y() <= minWidth)
223 || (span.y() <= minWidth && span.z() <= minWidth)
224 || (span.z() <= minWidth && span.x() <= minWidth)
242 if (!bb.
valid() || !typeId)
251 const scalar
rad = 0.5*dia();
276 (pt[e1] +
rad <= bb.
min()[e1])
277 || (pt[e2] +
rad <= bb.
min()[e2])
278 || (pt[e3] + len() <= bb.
min()[e3])
279 || (pt[e1] -
rad >= bb.
max()[e1])
280 || (pt[e2] -
rad >= bb.
max()[e2])
281 || (pt[e3] >= bb.
max()[e3])
291 if (pt[e3] < bb.
min()[e3])
294 len() -= bb.
min()[e3] - pt[e3];
295 pt[e3] = bb.
min()[e3];
298 if (pt[e3] + len() > bb.
max()[e3])
301 len() = bb.
max()[e3] - pt[e3];
307 (pt[e1] -
rad < bb.
min()[e1]) || (pt[e1] +
rad > bb.
max()[e1])
308 || (pt[e2] -
rad < bb.
min()[e2]) || (pt[e2] +
rad > bb.
max()[e2])
336 ((pt[cmpt] + span[cmpt]) < bb.
min()[cmpt])
337 || (pt[cmpt] > bb.
max()[cmpt])
352 if (pt[cmpt] < bb.
min()[cmpt])
357 span[cmpt] -= bb.
min()[cmpt] - pt[cmpt];
359 pt[cmpt] = bb.
min()[cmpt];
363 if (pt[cmpt] + span[cmpt] > bb.
max()[cmpt])
366 span[cmpt] -= bb.
max()[cmpt] - pt[cmpt];
407 box.min() =
vector(0, -0.5*obs.
wa, -0.5*obs.
wb);
414 box.min() =
vector(-0.5*obs.
wb, 0, -0.5*obs.
wa);
421 box.min() =
vector(-0.5*obs.
wa, -0.5*obs.
wb, 0);
452 constexpr int nDiv = 12;
477 org[e3] += obs.
len();
480 const scalar radius = 0.5*obs.
dia();
482 for (label i=0; i < nDiv; ++i)
484 const scalar angle = (i * mathematical::twoPi) / nDiv;
485 const scalar
s = radius *
sin(angle);
486 const scalar
c = radius *
cos(angle);
491 pts[nDiv+i][e1] +=
s;
492 pts[nDiv+i][e2] +=
c;
496 for (label facei=0; facei < nDiv; ++facei)
498 face&
f = fcs[facei];
502 f[3] = (facei + 1) % nDiv;
509 face& f1 = fcs[nDiv];
513 for (label pti=1; pti < nDiv; ++pti)
637 (outputDir /
"Obstacles"),
641 pieceId = addPieces(surfWriter, obslist, pieceId);
642 pieceId = addPieces(surfWriter, cyllist, pieceId);
644 Info<<
"Wrote " << pieceId <<
" obstacles (VTK) to "
645 << outputDir/
"Obstacles" <<
nl;
663 os <<
"box { point " << obs.
pt
664 <<
"; size " << obs.
span
669 os <<
"cyl { point " << obs.
pt
670 <<
"; length " << obs.
len() <<
"; diameter " << obs.
dia()
676 os <<
"diag { point " << obs.
pt
677 <<
"; length " << obs.
len()
678 <<
"; width (" << obs.
wa <<
' ' << obs.
wb <<
')'
685 os <<
"wallbeam { point " << obs.
pt
686 <<
" size " << obs.
span
691 os <<
"grate { point " << obs.
pt
692 <<
"; size " << obs.
span
698 os <<
"louver { point " << obs.
pt
699 <<
"; size " << obs.
span
705 os <<
"patch { " << obs.
pt
706 <<
"; size " << obs.
span
714 os <<
"/* ignored: " << obs.
typeId <<
" */";
718 os <<
"/* unknown: " << obs.
typeId <<
" */";
Macros for easy insertion into member function selection tables.
radiation::radiationModel & rad
A helper class for outputting values to Ostream.
void resize(const label len)
Adjust allocated size of list.
void transfer(pointField &pointLst, List< Face > &faceLst)
Transfer the components.
const List< Face > & surfFaces() const
Return const access to the faces.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Obstacle definitions for PDR.
scalar volume() const
Volume of the obstacle.
static label addPieces(vtk::surfaceWriter &surfWriter, const UList< PDRobstacle > &list, label pieceId=0)
Add pieces to vtp output.
scalar sortBias
Bias for position sorting.
point pt
The obstacle location.
direction orient
The x/y/z orientation (0,1,2)
static void generateVtk(const fileName &outputDir, const UList< PDRobstacle > &obslist, const UList< PDRobstacle > &cyllist)
Generate multi-piece VTK (vtp) file of obstacles.
bool tooSmall(const scalar minWidth) const
True if the obstacle is considered to be too small.
meshedSurface surface() const
Surface (points, faces) representation.
label groupId
The group-id.
void readProperties(const dictionary &dict)
Read the 'name' identifier if present.
void clear()
Reset to a zero obstacle.
vector span
The obstacle dimensions (for boxes)
@ OLD_BLOWOFF
ignored (old)
int typeId
The obstacle type-id.
PDRobstacle()
Construct zero-initialized.
scalar scale
Overall scale factor.
const Field< point_type > & points() const noexcept
Return reference to global points.
A List obtained as a section of another List.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
components
Component labeling enumeration.
const Cmpt & x() const
Access to the vector x component.
A bounding box defined in terms of min/max extrema points.
bool valid() const
Bounding box is non-inverted.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
static const faceList faces
Faces to point addressing, as per a 'hex' cell.
A coordinateRotation specified by a rotation axis and a rotation angle about that axis.
Base class for coordinate system specification, the default coordinate system type is cartesian .
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
void trim()
Inplace trim leading and trailing whitespace.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static const char *const componentNames[]
static constexpr direction nComponents
Number of components in bool is 1.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
An enumeration wrapper for classification of a location as being inside/outside of a volume.
type
Volume classification types.
@ OUTSIDE
A location outside the volume.
@ MIXED
A location that is partly inside and outside.
@ INSIDE
A location inside the volume.
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
void writeUniform(const word &fieldName, const Type &val)
Write a uniform field of Cell (Poly) or Point values.
void piece(const pointField &points, const faceList &faces)
Reset point/face references to begin a new piece.
virtual bool writeGeometry()
Write patch topology.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define defineMemberFunctionSelectionTable(baseType, funcName, argNames)
Define run-time selection table.
const dimensionedScalar c
Speed of light in a vacuum.
Different types of constants.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
bool read(const char *buf, int32_t &val)
Same as readInt32.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sin(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensionedScalar sqrt(const dimensionedScalar &ds)
constexpr scalar radToDeg() noexcept
Multiplication factor for radians to degrees conversion.
static constexpr const zero Zero
Global zero (0)
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
constexpr scalar paToBar(const scalar pa) noexcept
Conversion from Pa to bar.
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
Unit conversion functions.