63 return (idx.
x() >= 0 && idx.
y() >= 0 && idx.
z() >= 0);
76 {
"Aw",
"surface area per unit volume" },
83 {
"Bv",
"area blockage" },
84 {
"B",
"area blockage" },
86 {
"Blong",
"longitudinal blockage" },
108 static constexpr
unsigned outputPrecision = 8;
112 double brs,
double brr,
bool blocked,
113 double surr_br,
double surr_dr,
114 scalar* drags_p, scalar* dragr_p,
121 void write_scalarField
124 const scalar& deflt,
const scalarMinMax& limits,
const char *wall_bc,
130 void write_uniformField
132 const word& fieldName,
const scalar& deflt,
const char *wall_bc,
145 void write_symmTensorField
154 void write_symmTensorFieldV
163 void write_blocked_face_list
172 double limit_par,
const fileName& casepath
175 void write_blockedCellsSet
186 static inline scalar averageSurrounding
195 mat(i,j) + mat(i,j+1) + mat(i,j+2)
196 + mat(i+1,j) + mat(i+1,j+2)
197 + mat(i+2,j) + mat(i+2,j+1) + mat(i+2,j+2)
213 static void make_header
221 string note = fieldNotes(
object);
225 os <<
"FoamFile\n{\n" 227 <<
" format ascii;\n" 228 <<
" class " << clsName <<
";\n";
232 os <<
" note " << note <<
";\n";
235 if (!location.empty())
237 os <<
" location " << location <<
";\n";
240 os <<
" object " <<
object <<
";\n" 258 <<
"No PDRblock set" <<
nl 267 const int xdim = faceDims.
x();
268 const int ydim = faceDims.
y();
269 const int zdim = faceDims.
z();
294 Info<<
"Calculating fields" <<
nl;
310 const label maxDim =
cmptMax(surrDims);
326 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
330 for (label iz = 0; iz <= zdim; ++iz)
333 (iz == 0 ? 0 : iz == zdim ? zdim - 2 : iz - 1);
337 area_block_s(ix,iy,izz).x()
338 + area_block_r(ix,iy,izz).x()
348 for (label iz = 0; iz < surrDims.
z(); ++iz)
353 neiBlock(0, iz) = neiBlock(cellDims.
y(), iz);
354 neiDrag(0, iz) = neiDrag(cellDims.
y(), iz);
355 neiBlock(ydim, iz) = neiBlock(1, iz);
356 neiDrag(ydim, iz) = neiDrag(1, iz);
360 neiBlock(0, iz) = neiBlock(1, iz);
361 neiDrag(0, iz) = neiDrag(1, iz);
362 neiBlock(ydim, iz) = neiBlock(cellDims.
y(), iz);
363 neiDrag(ydim, iz) = neiDrag(cellDims.
y(), iz);
369 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
371 const scalar cell_vol = pdrBlock.
V(ix,iy,iz);
373 const scalar surr_br = averageSurrounding(neiBlock, iy, iz);
374 const scalar surr_dr = averageSurrounding(neiDrag, iy, iz);
378 area_block_s(ix,iy,iz).
x(),
379 area_block_r(ix,iy,iz).
x(),
380 dirn_block(ix,iy,iz).
x(),
382 &(drag_s(ix,iy,iz).xx()),
383 &(drag_r(ix,iy,iz).
x()),
385 &(cbdi(ix,iy,iz).
x()),
400 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
402 for (label ix = 0; ix <= xdim; ++ix)
405 (ix == 0 ? 0 : ix == xdim ? xdim - 2 : ix - 1);
409 area_block_s(ixx,iy,iz).y()
410 + area_block_r(ixx,iy,iz).y()
419 for (label ix = 0; ix < surrDims.
x(); ++ix)
421 neiBlock(0, ix) = neiBlock(1, ix);
422 neiDrag(0, ix) = neiDrag(1, ix);
423 neiBlock(zdim, ix) = neiBlock(cellDims.
z(), ix);
424 neiDrag(zdim, ix) = neiDrag(cellDims.
z(), ix);
427 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
429 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
431 const scalar cell_vol = pdrBlock.
V(ix,iy,iz);
433 const scalar surr_br = averageSurrounding(neiBlock, iz, ix);
434 const scalar surr_dr = averageSurrounding(neiDrag, iz, ix);
438 area_block_s(ix,iy,iz).
y(),
439 area_block_r(ix,iy,iz).
y(),
440 dirn_block(ix,iy,iz).
y(),
442 &(drag_s(ix,iy,iz).yy()),
443 &(drag_r(ix,iy,iz).
y()),
445 &(cbdi(ix,iy,iz).
y()),
458 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
460 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
462 for (label iy = 0; iy <= ydim; ++iy)
468 iyy = (iy == 0 ? ydim - 2 : iy == ydim ? 0 : iy - 1);
472 iyy = (iy == 0 ? 0 : iy == ydim ? ydim - 2 : iy - 1);
477 area_block_s(ix,iyy,iz).z()
478 + area_block_r(ix,iyy,iz).z()
487 for (label iy = 0; iy < surrDims.
y(); ++iy)
489 neiBlock(0, iy) = neiBlock(1, iy);
490 neiDrag(0, iy) = neiDrag(1, iy);
491 neiBlock(xdim, iy) = neiBlock(cellDims.
x(), iy);
492 neiDrag(xdim, iy) = neiDrag(cellDims.
x(), iy);
495 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
499 const scalar cell_vol = pdrBlock.
V(ix,iy,iz);
501 const scalar surr_br = averageSurrounding(neiBlock, ix, iy);
502 const scalar surr_dr = averageSurrounding(neiDrag, ix, iy);
506 area_block_s(ix,iy,iz).z(),
507 area_block_r(ix,iy,iz).z(),
508 dirn_block(ix,iy,iz).z(),
510 &(drag_s(ix,iy,iz).zz()),
511 &(drag_r(ix,iy,iz).z()),
513 &(cbdi(ix,iy,iz).z()),
526 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
528 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
532 const scalar dx = pdrBlock.
dx(ix);
533 const scalar dy = pdrBlock.
dy(iy);
534 const scalar dz = pdrBlock.
dz(iz);
535 const scalar cell_vol = pdrBlock.
V(ix, iy, iz);
536 const scalar cell_size = pdrBlock.
width(ix, iy, iz);
546 if (cbdi(ix,iy,iz).
x() > maxCT ) { cbdi(ix,iy,iz).x() = maxCT; } ;
547 if (cbdi(ix,iy,iz).
y() > maxCT ) { cbdi(ix,iy,iz).y() = maxCT; } ;
548 if (cbdi(ix,iy,iz).z() > maxCT ) { cbdi(ix,iy,iz).z() = maxCT; } ;
550 surf(ix,iy,iz) /= cell_vol;
556 const scalar vb = v_block(ix,iy,iz);
563 && ((area_block_s(ix,iy,iz).z() + area_block_r(ix,iy,iz).z()) <
MIN_AB_FOR_SIZE)
567 || ( surf(ix,iy,iz) <= 0.0 )
577 double nn, lobs, lobsMax;
578 nn = obs_count(ix,iy,iz) - sub_count(ix,iy,iz).x() + grating_count(ix,iy,iz).x();
579 if ( nn < 1.0 ) { nn = 1.0; }
580 lobsMax = (area_block_s(ix,iy,iz).x() + area_block_r(ix,iy,iz).x()) / nn *
std::sqrt( dy * dz );
581 nn = obs_count(ix,iy,iz) - sub_count(ix,iy,iz).y() + grating_count(ix,iy,iz).y();
582 if ( nn < 1.0 ) { nn = 1.0; }
583 lobs = (area_block_s(ix,iy,iz).y() + area_block_r(ix,iy,iz).y()) / nn *
std::sqrt( dz * dx );
584 if ( lobs > lobsMax )
589 nn = obs_count(ix,iy,iz) - sub_count(ix,iy,iz).z() + grating_count(ix,iy,iz).z();
590 if ( nn < 1.0 ) { nn = 1.0; }
591 lobs = (area_block_s(ix,iy,iz).z() + area_block_r(ix,iy,iz).z()) / nn *
std::sqrt( dx * dy );
592 if ( lobs > lobsMax )
597 obs_size(ix,iy,iz) = lobsMax;
607 if (v_block(ix,iy,iz) < 0)
609 v_block(ix,iy,iz) = 0;
611 else if (v_block(ix,iy,iz) > 1)
613 v_block(ix,iy,iz) = 1;
624 if (sub_count(ix,iy,iz)[cmpt] < 0)
626 sub_count(ix,iy,iz)[cmpt] = 0;
630 v_block(ix,iy,iz) = 1.0 - v_block(ix,iy,iz);
649 write_blocked_face_list
652 obs_count, sub_count, n_blocked_faces,
656 write_blockedCellsSet
660 casepath,
"blockedCellsSet" 665 "betav", arr.
v_block, 1, {0, pars.cong_max_betav},
"zeroGradient",
670 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
672 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
676 const scalar cell_vol = pdrBlock.
V(ix, iy, iz);
685 scalar nmin =
cmptMin(sub_count(ix,iy,iz));
687 sub_count(ix,iy,iz).x() -= nmin;
688 sub_count(ix,iy,iz).y() -= nmin;
689 sub_count(ix,iy,iz).z() -= nmin;
691 obs_count(ix,iy,iz) -= nmin;
693 assert(obs_count(ix,iy,iz) > -1);
699 const scalar cell_23 =
::pow(cell_vol, 2.0/3.0);
700 obs_count(ix,iy,iz) /= cell_23;
701 sub_count(ix,iy,iz) /= cell_23;
709 Info<<
"Writing field files" <<
nl;
721 "Aw", arr.
surf, 0, {0, 1000},
"zeroGradient",
725 write_symmTensorField
730 write_symmTensorFieldV
732 "CT", cbdi,
Zero,
"zeroGradient",
741 "Nv", arr.
obs_count, 0, {0, 1000},
"zeroGradient",
745 write_symmTensorFieldV
756 "N", arr.
obs_count, 0, {0, 1000},
"zeroGradient",
760 write_symmTensorFieldV
771 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
775 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
781 + area_block_r(ix,iy,iz)
787 eff_block /= pdrBlock.
width(ix, iy, iz);
793 if (dirn_block(ix,iy,iz)[cmpt] || eff_block[cmpt] < 0)
801 drag_s(ix,iy,iz).xx() = eff_block.x();
802 drag_s(ix,iy,iz).yy() = eff_block.y();
803 drag_s(ix,iy,iz).zz() = eff_block.z();
805 cbdi(ix,iy,iz).x() = 1.0 / (betai_inv1(ix,iy,iz).x() + 1.0);
806 cbdi(ix,iy,iz).y() = 1.0 / (betai_inv1(ix,iy,iz).y() + 1.0);
807 cbdi(ix,iy,iz).z() = 1.0 / (betai_inv1(ix,iy,iz).z() + 1.0);
809 if (cbdi(ix,iy,iz).z() < 0 || cbdi(ix,iy,iz).z() > 1.0)
812 <<
"beta_i problem. z-betai_inv1=" << betai_inv1(ix,iy,iz).z()
813 <<
" beta_i=" << cbdi(ix,iy,iz).z()
820 obs_size(ix,iy,iz) = 0.001 / obs_size(ix,iy,iz);
823 obs_count(ix,iy,iz) = 1.0;
831 write_symmTensorField
840 write_symmTensorField
849 write_symmTensorFieldV
857 write_symmTensorFieldV
873 "b", 1.0,
"zeroGradient",
893 "ft", 0,
"zeroGradient",
917 "Xi", 1,
"zeroGradient",
923 "Xp", 1,
"zeroGradient",
929 "GRxp", 0,
"zeroGradient",
935 "GRep", 0,
"zeroGradient",
941 "RPers", 0,
"zeroGradient",
945 write_pU_fields(meshIndexing,
patches, casepath);
966 "combustFlag", 1,
"zeroGradient",
984 "H2OPS", 0,
"zeroGradient",
990 "AIR", 0,
"zeroGradient",
996 "Ydefault", 0,
"zeroGradient",
1002 "eRatio", 1,
"zeroGradient",
1008 "sprayFlag", 1,
"zeroGradient",
1024 calculateAndWrite(*
this, meshIndexing, casepath,
patches);
1030 double brs,
double brr,
bool blocked,
1031 double surr_br,
double surr_dr,
1032 scalar* drags_p, scalar* dragr_p,
1039 scalar br = brr + brs;
1045 const scalar
alpha =
1048 ? (1.0 - 0.5 * br) / (1.0 - br) / (1.0 - br)
1056 const scalar
expon =
1059 ?
min(
max((surr_br / br - 0.25) * 4.0 / 3.0, scalar(0)), scalar(1))
1066 *dragr_p *= alpha_r;
1067 *drags_p *=
::pow(alpha_s, 1.09);
1069 if ( *cbdi_p < 0.0 ) { *cbdi_p = 0.0; }
1073 if ( *drags_p < 0.0 ) { *drags_p = 0.0; }
1077 if ( (surr_dr * 0.25) > *drags_p )
1079 *drags_p = surr_dr * 0.25;
1083 if ( blocked ) { *cbdi_p = 0.0; *drags_p = 0.0; *dragr_p = 0.0; }
1093 <<
"No blockage information - PDRblock is not set" <<
nl;
1100 scalar totCount = 0;
1101 scalar totVolBlock = 0;
1106 for (label iz = 0; iz < pdrBlock.
size(vector::Z); ++iz)
1110 for (label ix = 0; ix < pdrBlock.
size(vector::X); ++ix)
1114 totVolBlock += v_block(ijk) * pdrBlock.
V(ijk);
1115 totArea += surf(ijk);
1117 totCount +=
max(0, obs_count(ijk));
1119 totDrag.x() +=
max(0, drag_s(ijk).xx());
1120 totDrag.y() +=
max(0, drag_s(ijk).yy());
1121 totDrag.z() +=
max(0, drag_s(ijk).zz());
1125 totBlock[cmpt] +=
max(0, area_block_s(ijk)[cmpt]);
1126 totBlock[cmpt] +=
max(0, area_block_r(ijk)[cmpt]);
1133 <<
"Volume blockage: " << totVolBlock <<
nl 1134 <<
"Total drag: " << totDrag <<
nl 1135 <<
"Total count: " << totCount <<
nl 1136 <<
"Total area blockage: " << totBlock <<
nl 1137 <<
"Total surface area: " << totArea <<
nl;
1144 template<
class Type>
1145 static void tail_field
1149 const char* wall_bc,
1157 putUniform(
os,
"value", deflt);
1163 const word& patchName =
patches[patchi].patchName;
1174 putUniform(
os,
"value", deflt);
1183 else if (
patches[patchi].patchType == 0)
1188 putUniform(
os,
"value", deflt);
1196 putUniform(
os,
"value", deflt);
1250 void write_scalarField
1253 const scalar& deflt,
const scalarMinMax& limits,
const char *wall_bc,
1272 for (label celli=0; celli < meshIndexing.
nCells(); ++celli)
1276 if (!isGoodIndex(cellIdx))
1297 putUniform(
os,
"inletValue", deflt);
1298 putUniform(
os,
"value", deflt);
1303 tail_field(
os, deflt, wall_bc,
patches);
1313 void write_uniformField
1315 const word& fieldName,
const scalar& deflt,
const char *wall_bc,
1329 putUniform(
os,
"internalField", deflt);
1338 if (fieldName ==
"alphat" || fieldName ==
"nut")
1346 putUniform(
os,
"inletValue", deflt);
1349 putUniform(
os,
"value", deflt);
1353 tail_field(
os, deflt, wall_bc,
patches);
1363 void write_pU_fields
1380 putUniform(
os,
"internalField", vector::zero);
1389 putUniform(
os,
"inletValue", vector::zero);
1401 for (label patchi = 0; patchi < 3; ++patchi)
1408 for (label patchi = 3; patchi <
patches.
size(); ++patchi)
1411 const word& patchName =
p.patchName;
1413 if (
p.patchType == 0)
1418 os.
writeEntry(
"fileName",
"<case>" / (patchName +
".dat"));
1420 putUniform(
os,
"value", vector::zero);
1426 os.
writeEntry(
"type",
"activePressureForceBaffleVelocity");
1436 putUniform(
os,
"value", vector::zero);
1441 putUniform(
os,
"value", vector::zero);
1446 putUniform(
os,
"value", vector::zero);
1489 const char *wall_bc =
"zeroGradient;\n\trho\trho";
1499 putUniform(
os,
"internalField", deflt);
1512 putUniform(
os,
"value", deflt);
1516 tail_field(
os, deflt, wall_bc,
patches);
1527 void write_symmTensorField
1529 const word& fieldName,
1531 const symmTensor& deflt,
const char *wall_bc,
1549 for (label celli=0; celli < meshIndexing.
nCells(); ++celli)
1553 if (!isGoodIndex(cellIdx))
1572 putUniform(
os,
"inletValue", deflt);
1573 putUniform(
os,
"value", deflt);
1578 tail_field(
os, deflt, wall_bc,
patches);
1588 void write_symmTensorFieldV
1590 const word& fieldName,
1592 const symmTensor& deflt,
const char *wall_bc,
1612 for (label celli=0; celli < meshIndexing.
nCells(); ++celli)
1616 if (!isGoodIndex(cellIdx))
1641 putUniform(
os,
"inletValue", deflt);
1642 putUniform(
os,
"value", deflt);
1647 tail_field(
os, deflt, wall_bc,
patches);
1657 void write_blocked_face_list
1665 double limit_par,
const fileName& casepath
1678 for (label facei=0; facei < meshIndexing.
nFaces(); ++facei)
1683 if (!isGoodIndex(faceIdx))
1688 const label ix = faceIdx.
x();
1689 const label iy = faceIdx.
y();
1690 const label iz = faceIdx.
z();
1707 val = face_block(faceIdx).x();
1708 patchId = face_patch(faceIdx).x();
1714 && iz < cellDims[vector::Z]
1720 if (ix < cellDims[vector::X])
1722 ++n_blocked_faces(ix,iy,iz).x();
1723 sub_count(ix,iy,iz).x() = obs_count(ix,iy,iz);
1729 ++n_blocked_faces(ix-1,iy,iz).x();
1730 sub_count(ix-1,iy,iz).x() = obs_count(ix-1,iy,iz);
1738 val = face_block(faceIdx).y();
1739 patchId = face_patch(faceIdx).y();
1744 && iz < cellDims[vector::Z]
1745 && ix < cellDims[vector::X]
1753 ++n_blocked_faces(ix,iy,iz).y();
1754 sub_count(ix,iy,iz).y() = obs_count(ix,iy,iz);
1760 ++n_blocked_faces(ix,iy-1,iz).y();
1761 sub_count(ix,iy-1,iz).y() = obs_count(ix,iy-1,iz);
1769 val = face_block(faceIdx).z();
1770 patchId = face_patch(faceIdx).z();
1775 && ix < cellDims[vector::X]
1782 if (iz < cellDims[vector::Z])
1784 ++n_blocked_faces(ix,iy,iz).z();
1785 sub_count(ix,iy,iz).z() = obs_count(ix,iy,iz);
1791 ++n_blocked_faces(ix,iy,iz-1).z();
1792 sub_count(ix,iy,iz-1).z() = obs_count(ix,iy,iz-1);
1804 else if (val > limit_par)
1822 if (!
isDir(setsDir))
1832 const word& patchName =
patches[patchi].patchName;
1836 make_header(
os,
"polyMesh/sets",
"faceSet", patchName);
1839 const auto& fnd = usedFaces.
cfind(patchi);
1841 if (fnd.good() && (*fnd).any())
1843 os <<
nl << (*fnd).toc() <<
nl;
1858 OFstream os(casepath /
"system/PDRMeshDict");
1860 make_header(
os,
"system",
"dictionary",
"PDRMeshDict");
1867 const word& patchName =
p.patchName;
1868 const word setName = patchName +
"Set";
1870 if (
p.patchType == 0)
1877 else if (
p.patchType > 0)
1879 panelNames.
append(setName);
1890 const word& patchName =
p.patchName;
1891 const word setName = patchName +
"Set";
1893 if (
p.patchType > 0)
1908 OFstream os2(casepath /
"panelList");
1916 void write_blockedCellsSet
1923 const word& listName
1926 if (listName.empty())
1949 for (label celli=0; celli < meshIndexing.
nCells(); ++celli)
1953 if (!isGoodIndex(cellIdx))
1958 if (
fld(cellIdx) < limit_par)
1960 blockedCell.
set(celli);
1966 const label n_bfaces =
cmptSum(blocked);
1974 if (blocked[cmpt] > 1) ++n_bpairs;
1979 Info<<
"block " << celli <<
" from " 1980 << blocked <<
" -> (" 1981 << n_bfaces <<
' ' << n_bpairs
1992 blockedCell.
set(celli);
1998 make_header(
os,
"constant/polyMesh/sets",
"cellSet", listName);
2000 if (blockedCell.
any())
2002 os << blockedCell.
toc();
word outerPatchName
The name for the "outer" patch.
scalar blockedFacePar
Faces with area blockage greater than this are blocked.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
IjkField< labelVector > face_patch
Face field for (directional) for patch Id.
void set(const bitSet &bitset)
Set specified bits from another bitset.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
IjkField< vector > drag_r
Directional drag from round obstacles.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Return the sum of components of a SphericalTensor.
scalar V(const label i, const label j, const label k) const
Cell volume at i,j,k position.
bool equal(const T &a, const T &b)
Compare two values for equality.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IjkField< vector > area_block_s
Summed area blockage (directional) from sharp obstacles.
const PDRblock & block() const
Reference to PDRblock.
IjkField< Vector< bool > > dirn_block
A total directional blockage in the cell.
labelVector faceDims
The face i-j-k addressing range.
List< labelVector > cellIndex
For each cell, the corresponding i-j-k address.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static void calculateAndWrite(PDRarrays &arr, const PDRmeshArrays &meshIndexing, const fileName &casepath, const UList< PDRpatchDef > &patches)
Output to file stream, using an OSstream.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)
IjkField< vector > along_block
Longitudinal area blockage from obstacles that extend all the way through the cell in a given directi...
IjkField< vector > sub_count
Number of obstacles parallel to specified direction.
const dimensionSet dimViscosity
dimensionedScalar sqrt(const dimensionedScalar &ds)
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
Begin list [isseparator].
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const Cmpt & y() const noexcept
Access to the vector y component.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
static std::string path(const std::string &str)
Return directory path name (part before last /)
label nCells() const
The number of cells.
const dimensionSet dimless
Dimensionless.
bool any() const
True if any bits in this bitset are set.
IjkField< scalar > v_block
Volume blockage.
#define forAll(list, i)
Loop across all elements in list.
label nFaces() const
The number of faces.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
IjkField< scalar > surf
Surface area in cell.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
scalar maxCR
Upper limit on CR (CT also gets limited)
T clamp(const T &val) const
Return value clamped component-wise.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static const SymmTensor I
const_iterator cfind(const label &key) const
Find and return an const_iterator set at the hashed entry.
List< labelVector > faceIndex
For each face, the corresponding i-j-k address.
virtual int precision() const override
Get precision of output field.
word groundPatchName
The name for the "ground" patch.
scalar dz(const label k) const
Cell size in z-direction at k position.
A class for handling words, derived from Foam::string.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
void blockageSummary() const
Summary of the blockages.
label size() const noexcept
The number of entries in the list.
virtual Ostream & endBlock()
Write end block group.
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation. Some of the input is similar to blockMeshDict, but since this specialization is for a single-block that is aligned with the x-y-z directions, it provides a different means of specifying the mesh.
List< direction > faceOrient
For each face, the x/y/z orientation.
scalar outerCombFac
Value for outer region.
IjkField< vector > area_block_r
Summed area blockage (directional) from round obstacles.
IjkField< vector > face_block
Face area blockage for face, summed from cell centre-plane to cell centre-plane.
Preparation of fields for PDRFoam.
void append(const T &val)
Copy append an element to the end of this list.
const dimensionSet dimPressure
scalar width(const label i, const label j, const label k) const
Characteristic cell size at i,j,k position.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
string UPatchBc
"fixedValue;value uniform (0 0 0)"
IjkField< vector > betai_inv1
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool isNull(const T *ptr)
True if ptr is a pointer (of type T) to the nullObject.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int nPairsToBlockC
Min number of blocked cell face pairs (on opposite faces of a cell) for a cell to be marked as blocke...
const Cmpt & x() const noexcept
Access to the vector x component.
IjkField< scalar > obs_count
Number of obstacles in cell.
OBJstream os(runTime.globalPath()/outputName)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
labelList toc() const
The indices of the on bits as a sorted labelList.
const word typeName("volScalarField::Internal")
scalar dy(const label j) const
Cell size in y-direction at j position.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
OpenFOAM/PDRblock addressing information.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const Cmpt & z() const noexcept
Access to the vector z component.
IjkField< scalar > obs_size
Obstacle size in cell.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
PtrList< volScalarField > & Y
const polyBoundaryMesh & patches
Foam::PDRparams pars
Globals for program parameters (ugly hack)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
static Vector< label > uniform(const label &s)
Return a VectorSpace with all elements = s.
label size() const
Return the total i*j*k size.
IjkField< symmTensor > drag_s
Tensorial drag from sharp obstacles.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
Work array definitions for PDR fields.
scalar empty_lobs_fac
Lobs in empty cell is this * cube root of cell volume.
int nFacesToBlockC
Min number of blocked cell faces for a cell to be marked as blocked.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
List< label > labelList
A List of labels.
virtual Ostream & endEntry()
Write end entry (';') followed by newline.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
#define MIN_COUNT_FOR_SIZE
labelVector cellDims
The cell i-j-k addressing range.
Bookkeeping for patch definitions.
IjkField< vector > grating_count
Addition to count to account for grating comprises many bars (to get Lobs right)
scalar dx(const label i) const
Cell size in x-direction at i position.
scalar blockedCellPoros
Cells with porosity less than this are blocked.
bool set(const label &key, const T &obj)
Copy assign a new entry, overwriting existing entries.
A HashTable to objects of type <T> with a label key.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity