Go to the documentation of this file.
98 identifier = std::move(obsName);
145 slat_width *= factor;
164 vol = wa * wb * len();
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];
382 const PDRobstacle& obs = *
this;
389 boundBox box(obs.pt, obs.pt + obs.span);
394 surf.transfer(pts, fcs);
407 box.min() =
vector(0, -0.5*obs.wa, -0.5*obs.wb);
408 box.max() =
vector(obs.len(), 0.5*obs.wa, 0.5*obs.wb);
414 box.min() =
vector(-0.5*obs.wb, 0, -0.5*obs.wa);
415 box.max() =
vector(0.5*obs.wb, obs.len(), 0.5*obs.wa);
421 box.min() =
vector(-0.5*obs.wa, -0.5*obs.wb, 0);
422 box.max() =
vector(0.5*obs.wa, 0.5*obs.wb, obs.len());
430 coordinateRotations::axisAngle
443 surf.transfer(pts, fcs);
452 constexpr
int nDiv = 12;
477 org[e3] += obs.len();
478 SubList<point>(pts, nDiv, nDiv) = org;
480 const scalar radius = 0.5*obs.dia();
482 for (label i=0; i < nDiv; ++i)
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)
523 surf.transfer(pts, fcs);
533 switch (obs.inlet_dirn)
597 vtk::surfaceWriter& surfWriter,
598 const UList<PDRobstacle>& list,
602 for (
const PDRobstacle& obs : list)
608 surfWriter.piece(surf.points(), surf.surfFaces());
610 surfWriter.writeGeometry();
611 surfWriter.beginCellData(2);
612 surfWriter.writeUniform(
"group", label(obs.groupId));
613 surfWriter.writeUniform(
"type", label(obs.typeId));
614 surfWriter.writeUniform(
"obstacle", pieceId);
625 const fileName& outputDir,
626 const UList<PDRobstacle>& obslist,
627 const UList<PDRobstacle>& cyllist
632 meshedSurf::emptySurface dummy;
634 vtk::surfaceWriter surfWriter
639 (outputDir /
"Obstacles"),
643 pieceId = addPieces(surfWriter, obslist, pieceId);
644 pieceId = addPieces(surfWriter, cyllist, pieceId);
646 Info<<
"Wrote " << pieceId <<
" obstacles (VTK) to "
647 << outputDir/
"Obstacles" <<
nl;
656 const InfoProxy<PDRobstacle>& iproxy
659 const PDRobstacle& obs = iproxy.t_;
665 os <<
"box { point " << obs.pt
666 <<
"; size " << obs.span
671 os <<
"cyl { point " << obs.pt
672 <<
"; length " << obs.len() <<
"; diameter " << obs.dia()
678 os <<
"diag { point " << obs.pt
679 <<
"; length " << obs.len()
680 <<
"; width (" << obs.wa <<
' ' << obs.wb <<
')'
681 <<
"; angle " <<
radToDeg(obs.theta())
687 os <<
"wallbeam { point " << obs.pt
688 <<
" size " << obs.span
693 os <<
"grate { point " << obs.pt
694 <<
"; size " << obs.span
695 <<
"; slats " << obs.slat_width
700 os <<
"louver { point " << obs.pt
701 <<
"; size " << obs.span
702 <<
"; pressure " <<
paToBar(obs.blowoff_press)
707 os <<
"patch { " << obs.pt
708 <<
"; size " << obs.span
709 <<
"; name " << obs.identifier
716 os <<
"/* ignored: " << obs.typeId <<
" */";
720 os <<
"/* unknown: " << obs.typeId <<
" */";
733 return (a.pt.x() + a.sortBias) < (
b.pt.x() +
b.sortBias);
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
type
Volume classification types.
static const char *const componentNames[]
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))
static constexpr const zero Zero
Global zero (0)
static const faceList faces
Faces to point addressing, as per a 'hex' cell.
Different types of constants.
dimensionedScalar sin(const dimensionedScalar &ds)
bool read(const char *buf, int32_t &val)
Same as readInt32.
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Unit conversion functions.
PDRobstacle()
Construct zero-initialized.
volumeType trim(const boundBox &bb)
components
Component labeling enumeration.
direction orient
The x/y/z orientation (0,1,2)
bool tooSmall(const scalar minWidth) const
True if the obstacle is considered to be too small.
int typeId
The obstacle type-id.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
vector span
The obstacle dimensions (for boxes)
messageStream Info
Information stream (uses stdout - output is on the master only)
point pt
The obstacle location.
meshedSurface surface() const
Surface (points, faces) representation.
A location that is partly inside and outside.
void transfer(List< T > &list)
Macros for easy insertion into member function selection tables.
constexpr scalar radToDeg(const scalar rad) noexcept
Conversion from radians to degrees.
void resize(const label newSize)
Adjust allocated size of list.
constexpr scalar twoPi(2 *M_PI)
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)
void clear()
Reset to a zero obstacle.
Vector< scalar > vector
A scalar version of the templated Vector.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
radiation::radiationModel & rad
constexpr scalar pi(M_PI)
MeshedSurface< face > meshedSurface
List< face > faceList
A List of faces.
constexpr scalar paToBar(const scalar pa) noexcept
Conversion from Pa to bar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
scalar sortBias
Bias for position sorting.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A location inside the volume.
const dimensionedScalar c
Speed of light in a vacuum.
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
static void generateVtk(const fileName &outputDir, const UList< PDRobstacle > &obslist, const UList< PDRobstacle > &cyllist)
Generate multi-piece VTK (vtp) file of obstacles.
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling factor.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
void readProperties(const dictionary &dict)
Read the 'name' identifier if present.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
static constexpr direction nComponents
Number of components in this vector space.
A location outside the volume.
static label addPieces(vtk::surfaceWriter &surfWriter, const UList< PDRobstacle > &list, label pieceId=0)
Add pieces to vtp output.
scalar volume() const
Volume of the obstacle.
label groupId
The group-id.
dimensionedScalar cos(const dimensionedScalar &ds)