40 namespace porosityModels
53 const word& modelType,
58 zoneName_(
name +
":porousZone")
66 scalar searchSpan(coeffs.
get<scalar>(
"searchSpan"));
69 const word topSurfaceFileName(coeffs.
get<
word>(
"topSurface"));
100 surfBounds.
min() - searchSpan*zDir, surfBounds.
max()
107 label porousCelli = 0;
113 porousCells[porousCelli++] = celli;
117 porousCells.
setSize(porousCelli);
122 forAll(porousCells, porousCelli)
124 start[porousCelli] =
C[porousCells[porousCelli]];
125 end[porousCelli] = start[porousCelli] + searchSpan*zDir;
135 searchSurf.
findLine(start, end, hitInfo);
139 forAll(porousCells, celli)
145 porousCells[porousCelli] = porousCells[celli];
148 (hit.
hitPoint() -
C[porousCells[porousCelli]]) & zDir;
155 porousCells.
setSize(porousCelli);
182 forAll(groundSurfaceProcTris, i)
184 nTris += groundSurfaceProcTris[i].
size();
190 forAll(groundSurfaceProcTris, i)
192 forAll(groundSurfaceProcTris[i], j)
194 groundSurfaceTris[trii] = groundSurfaceProcTris[i][j];
195 groundSurfaceTris[trii][0] += offset;
196 groundSurfaceTris[trii][1] += offset;
197 groundSurfaceTris[trii][2] += offset;
200 offset += groundSurfaceProcPoints[i].
size();
204 forAll(groundSurfaceProcPoints, i)
212 forAll(groundSurfaceProcPoints, i)
214 forAll(groundSurfaceProcPoints[i], j)
216 groundSurfacePoints[pointi++] = groundSurfaceProcPoints[i][j];
220 groundSurface =
triSurface(groundSurfaceTris, groundSurfacePoints);
229 end.setSize(porousCelli);
231 forAll(porousCells, porousCelli)
233 start[porousCelli] =
C[porousCells[porousCelli]];
234 end[porousCelli] = start[porousCelli] - searchSpan*zDir;
237 groundSearch.
findLine(start, end, hitInfo);
241 forAll(porousCells, porousCelli)
247 zBottom[porousCelli] =
248 (
C[porousCells[porousCelli]] - hit.
hitPoint()) & zDir;
256 Sigma_ = SigmaFunc->value(zNorm);
284 <<
"Unable to create porous cellZone " <<
zoneName_
285 <<
": zone already exists"
294 const word& modelType,
297 const word& dummyCellZoneName
309 Cd_(coeffs_.get<scalar>(
"Cd")),
310 C1_(coeffs_.get<scalar>(
"C1")),
311 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho"))
413 dict_.writeEntry(name_,
os);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Graphite solid properties.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void setSize(const label n)
Alias for resize()
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool hit() const noexcept
Is there a hit?
const point_type & hitPoint() const
Return hit point. Fatal if not hit.
const Field< point_type > & points() const noexcept
Return reference to global points.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
const T * set(const label i) const
void setSize(const label newLen)
Same as resize()
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
const word & constant() const
Return constant name.
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
label size() const noexcept
The number of elements in the list.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bounding box defined in terms of min/max extrema points.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
bool contains(const point &pt) const
Contains point? (inside or on edge)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
Top level model for porosity models.
const word zoneName_
Automatically generated zone name for this porous zone.
scalarField Sigma_
Porosity surface area per unit volume zone field.
const scalarField & Sigma() const
Return the porosity surface area per unit volume zone field.
Variant of the power law porosity model with spatially varying drag coefficient.
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
bool writeData(Ostream &os) const
Write.
virtual ~powerLawLopesdaCosta()
Destructor.
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
const vectorField & cellCentres() const
int myProcNo() const noexcept
Return processor number.
IOoject and searching on triSurface.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual tmp< pointField > points() const
Get the points that define the surface.
Helper class to search on triSurface.
void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
Triangulated surface description with patch information.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & mu
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const labelIOList & zoneID
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
errorManip< error > abort(error &err)
const dimensionSet dimForce
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define forAll(list, i)
Loop across all elements in list.