Go to the documentation of this file.
52 int main(
int argc,
char* argv[])
56 "Processes a set of geometrical obstructions to determine the"
57 " equivalent blockage effects when setting cases for PDRFoam"
74 "Force use of legacy obstacles table"
79 "Read obstacles and write VTK only"
148 pdrBlock.
read(iodict);
159 const scalar volObstacles =
171 pars.obsfile_dir,
pars.obsfile_names,
184 <<
"dry-run: stopping after reading/writing obstacles" <<
nl
193 const labelRange origBlocks(0, obstacles.size());
196 labelRange interBlocks(origBlocks.after(), 0);
198 scalar volSubtract = 0;
207 Info<<
" block/cylinder intersections" <<
endl;
209 label nblocked = obstacles.size();
213 nblocked = (obstacles.size() - nblocked);
215 interBlocks += nblocked;
216 int1Blocks += nblocked;
225 Info<<
" block/block intersections" <<
endl;
227 label nblocked = obstacles.size();
231 nblocked = (obstacles.size() - nblocked);
233 interBlocks += nblocked;
234 int2Blocks += nblocked;
243 Info<<
" triple intersections" <<
endl;
245 label nblocked = obstacles.size();
247 volSubtract +=
block_overlap(obstacles, interBlocks, 1.0/3.0);
249 nblocked = (obstacles.size() - nblocked);
251 interBlocks += nblocked;
252 int3Blocks += nblocked;
265 if (origBlocks.size())
267 Info<<
" negative blocks: " << origBlocks.size() <<
nl;
269 for (
const PDRobstacle& obs : obstacles.slice(origBlocks))
271 arr.addBlockage(obs,
patches, -1);
278 if (interBlocks.size())
280 Info<<
" blocks " << interBlocks.size() <<
nl;
282 for (
const PDRobstacle& obs : obstacles.slice(interBlocks))
284 arr.addBlockage(obs,
patches, 0);
289 if (origBlocks.size())
291 Info<<
" positive blocks: " << origBlocks.size() <<
nl;
293 for (
const PDRobstacle& obs : obstacles.slice(origBlocks))
295 arr.addBlockage(obs,
patches, 1);
300 if (cylinders.size())
302 Info<<
" cylinders: " << cylinders.size() <<
nl;
306 arr.addCylinder(obs);
313 arr.blockageSummary();
324 <<
setw(6) << origBlocks.size() <<
" blocks and "
325 << cylinders.size() <<
" cylinders/diagonal blocks" <<
nl;
328 <<
" intersections amongst blocks" <<
nl;
331 <<
" intersections between blocks and cyl/beams" <<
nl;
334 <<
"/3 triple intersections" <<
nl;
336 Info<<
"Volume of obstacles read in: " << volObstacles
337 <<
", volume of intersections: " << volSubtract <<
nl;
339 Info<<
nl <<
"After corrections:" <<
nl;
340 arr.blockageSummary();
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Preparation of fields for PDRFoam.
A class for handling words, derived from Foam::string.
A class for handling file names.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Foam::PDRparams pars
Globals for program parameters (ugly hack)
scalar block_overlap(DynamicList< PDRobstacle > &blocks, const labelRange &range, const scalar multiplier=1.0)
const word dictName("faMeshDefinition")
static void addNote(const string ¬e)
Ostream & endl(Ostream &os)
bool readIfPresent(const word &optName, T &val) const
static const Enum< predefined > names
void read_mesh_spec(const fileName &casepath, PDRblock &pdrBlock)
static void calculateAndWrite(PDRarrays &arr, const PDRmeshArrays &meshIndexing, const fileName &casepath, const UList< PDRpatchDef > &patches)
void print_info(const PDRblock &block)
void read(const dictionary &dict)
static void noFunctionObjects(bool addWithOption=false)
int dryRun() const noexcept
Work array definitions for PDR fields.
static scalar legacyReadFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
Istream and Ostream manipulators taking arguments.
A range or interval of labels defined by a start and a size.
Omanip< int > setw(const int i)
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation....
static void addDryRunOption(const string &usage, bool advanced=false)
void resize(const label newLen)
void read(const Time &runTime, const PDRblock &pdrBlock)
const word & name() const noexcept
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
const word & system() const
Obstacle definitions for PDR.
const polyBoundaryMesh & patches
fileName globalPath() const
OpenFOAM/PDRblock addressing information.
static void generateVtk(const fileName &outputDir, const UList< PDRobstacle > &obslist, const UList< PDRobstacle > &cyllist)
scalar block_cylinder_overlap(DynamicList< PDRobstacle > &blocks, const labelRange &range, const UList< PDRobstacle > &cylinders)
static scalar gridPointRelTol
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
bool read(const dictionary &dict)
bool found(const word &optName) const