Go to the documentation of this file.
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"));
88 mesh.time().constant(),
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;
134 List<pointIndexHit> hitInfo;
139 forAll(porousCells, celli)
145 porousCells[porousCelli] = porousCells[celli];
148 (hit.hitPoint() -
C[porousCells[porousCelli]]) & zDir;
155 porousCells.
setSize(porousCelli);
156 zTop.setSize(porousCelli);
159 triSurface groundSurface
164 mesh.boundaryMesh().patchSet(groundPatches),
184 forAll(groundSurfaceProcTris, i)
186 nTris += groundSurfaceProcTris[i].size();
189 List<labelledTri> groundSurfaceTris(nTris);
192 forAll(groundSurfaceProcTris, i)
194 forAll(groundSurfaceProcTris[i], j)
196 groundSurfaceTris[trii] = groundSurfaceProcTris[i][j];
197 groundSurfaceTris[trii][0] += offset;
198 groundSurfaceTris[trii][1] += offset;
199 groundSurfaceTris[trii][2] += offset;
202 offset += groundSurfaceProcPoints[i].size();
206 forAll(groundSurfaceProcPoints, i)
208 nPoints += groundSurfaceProcPoints[i].size();
214 forAll(groundSurfaceProcPoints, i)
216 forAll(groundSurfaceProcPoints[i], j)
218 groundSurfacePoints[pointi++] = groundSurfaceProcPoints[i][j];
222 groundSurface = triSurface(groundSurfaceTris, groundSurfacePoints);
226 triSurfaceSearch groundSearch(groundSurface);
230 start.setSize(porousCelli);
231 end.setSize(porousCelli);
233 forAll(porousCells, porousCelli)
235 start[porousCelli] =
C[porousCells[porousCelli]];
236 end[porousCelli] = start[porousCelli] - searchSpan*zDir;
239 groundSearch.findLine(start,
end, hitInfo);
243 forAll(porousCells, porousCelli)
249 zBottom[porousCelli] =
250 (
C[porousCells[porousCelli]] - hit.hitPoint()) & zDir;
258 Sigma_ = SigmaFunc->value(zNorm);
268 zoneID = cellZones.size();
269 cellZones.setSize(
zoneID + 1);
286 <<
"Unable to create porous cellZone " <<
zoneName_
287 <<
": zone already exists"
293 Foam::porosityModels::powerLawLopesdaCosta::powerLawLopesdaCosta
296 const word& modelType,
299 const word& dummyCellZoneName
309 powerLawLopesdaCostaZone::zoneName_
311 Cd_(coeffs_.
get<scalar>(
"Cd")),
312 C1_(coeffs_.
get<scalar>(
"C1")),
313 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho"))
415 dict_.writeEntry(name_,
os);
const Field< point_type > & points() const noexcept
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
const point & max() const
const dimensionedScalar mu
static constexpr const zero Zero
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
IOoject and searching on triSurface.
const point_type & hitPoint() const
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dimensionSet dimForce
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
bool writeData(Ostream &os) const
Helper class to search on triSurface.
powerLawLopesdaCostaZone(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
A special matrix type and solver, designed for finite volume solutions of scalar equations.
virtual void correct(fvVectorMatrix &UEqn) const
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool hit() const noexcept
Generic templated field type.
Triangulated surface description with patch information.
void setSize(const label n)
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
const point & min() const
virtual ~powerLawLopesdaCosta()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const scalarField & Sigma() const
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
constexpr auto end(C &c) -> decltype(c.end())
const labelIOList & zoneID
Mesh data needed to do the Finite Volume discretisation.
virtual tmp< pointField > points() const
errorManip< error > abort(error &err)
label findZoneID(const word &zoneName) const
bool contains(const point &pt) const
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Top level model for porosity models.
void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
#define FatalErrorInFunction
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
static int myProcNo(const label communicator=worldComm)
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
static bool & parRun() noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List of wordRe with additional matching capabilities.
virtual void calcTransformModelData()
A special matrix type and solver, designed for finite volume solutions of scalar equations....
A bounding box defined in terms of min/max extrema points.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
word name(const expressions::valueTypeCode typeCode)
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Graphite solid properties.
Generic GeometricField class.
Variant of the power law porosity model with spatially varying drag coefficient.
static label nProcs(const label communicator=worldComm)