40#ifndef Foam_PDRobstacle_H
41#define Foam_PDRobstacle_H
226 inline scalar
x()
const {
return pt.x(); }
227 inline scalar
y()
const {
return pt.
y(); }
228 inline scalar
z()
const {
return pt.
z(); }
229 inline scalar&
x() {
return pt.x(); }
230 inline scalar&
y() {
return pt.
y(); }
231 inline scalar&
z() {
return pt.
z(); }
235 inline static bool isCylinder(
const label
id);
251 bool tooSmall(
const scalar minWidth)
const;
260 const int groupTypeId,
261 const string& buffer,
262 const label lineNo = -1,
328class obstacleGrouping
391 return size() * nObstacle_;
397 return size() * nCylinder_;
403 return size() * (nObstacle_ + nCylinder_);
410 void append(
const scalar
x,
const scalar
y,
const scalar z)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
constexpr DynamicList() noexcept
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Locations for each instance of an obstacle group.
void addCylinder()
Increment the number of cylinder-like obstacles.
label nObstacle() const
The number of obstacles.
void addObstacle()
Increment the number of obstacles.
label nTotalObstacle() const
The number of locations x number of obstacles.
label nCylinder() const
The number of cylinder-like obstacles.
void append(const scalar x, const scalar y, const scalar z)
Add a location.
obstacleGrouping()
Construct null.
obstacleGrouping(const vector &origin)
Construct with one location (instance).
label nTotal() const
The number of locations x number of obstacles.
void clear()
Clear obstacle count and locations.
label nTotalCylinder() const
The number of locations x number of cylinder-like obstacles.
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.
bool isCylinder() const
Is obstacle cylinder-like?
point pt
The obstacle location.
PDRobstacle(Istream &is)
Read construct as named dictionary.
direction orient
The x/y/z orientation (0,1,2).
scalar x() const
Obstacle position accessors.
bool setFromLegacy(const int groupTypeId, const string &buffer, const label lineNo=-1, const word &inputFile=word::null)
Set values from single-line, multi-column format.
volumeType trim(const boundBox &bb)
Trim obstacle to ensure it is within the specified bounding box and return the intersection type.
declareMemberFunctionSelectionTable(void, PDRobstacle, read, dictionary,(PDRobstacle &obs, const dictionary &dict),(obs, dict))
static void generateVtk(const fileName &outputDir, const UList< PDRobstacle > &obslist, const UList< PDRobstacle > &cyllist)
Generate multi-piece VTK (vtp) file of obstacles.
static scalar readFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
Read obstacle files and set the lists.
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.
friend Istream & operator>>(Istream &is, PDRobstacle &obs)
void clear()
Reset to a zero obstacle.
static scalar legacyReadFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
Read obstacle files and add to the lists.
static constexpr int maxBlowoffPressure
The max blowoff pressure [bar].
vector span
The obstacle dimensions (for boxes).
bool read(Istream &is)
Read name / dictionary.
legacyTypes
Obstacle types (legacy numbering).
@ OLD_BLOWOFF
ignored (old)
int typeId
The obstacle type-id.
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling factor.
InfoProxy< PDRobstacle > info() const noexcept
Return info proxy, used to print information to a stream.
PDRobstacle()
Construct zero-initialized.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
A bounding box defined in terms of min/max extrema points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Base class for surface writers.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
OBJstream os(runTime.globalPath()/outputName)
Macros to ease declaration of member function selection tables.
#define declareMemberFunctionSelectionTable(returnType, baseType, funcName, argNames, argList, parListUnused)
Declare a run-time member-function selection (variables and adder classes).
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Legacy and transitional routines.
labelPair readObstacleFiles(const fileName &obsFileDir, const wordList &obsFileNames, Map< obstacleGrouping > &groups)
Read obstacle files, do counting only.
Namespace for handling VTK output. Contains classes and functions for writing VTK file content.
bool operator!=(const eddy &a, const eddy &b)
Pair< label > labelPair
A pair of labels.
List< word > wordList
List of word.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
MeshedSurface< face > meshedSurface
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))