37 namespace porosityModels
50 const word& modelType,
55 zoneName_(
name +
":porousZone")
63 scalar searchSpan(coeffs.
lookup<scalar>(
"searchSpan"));
66 word topSurfaceFileName(coeffs.
lookup(
"topSurface"));
78 dict.lookupEntryBackwardsCompatible
108 surfBounds.
min() - searchSpan*zDir, surfBounds.
max()
115 label porousCelli = 0;
121 porousCells[porousCelli++] = celli;
125 porousCells.
setSize(porousCelli);
130 forAll(porousCells, porousCelli)
132 start[porousCelli] =
C[porousCells[porousCelli]];
133 end[porousCelli] = start[porousCelli] + searchSpan*zDir;
143 searchSurf.
findLine(start, end, hitInfo);
147 forAll(porousCells, celli)
153 porousCells[porousCelli] = porousCells[celli];
156 (hit.
hitPoint() -
C[porousCells[porousCelli]]) & zDir;
163 porousCells.
setSize(porousCelli);
192 forAll(groundSurfaceProcTris, i)
194 nTris += groundSurfaceProcTris[i].
size();
200 forAll(groundSurfaceProcTris, i)
202 forAll(groundSurfaceProcTris[i], j)
204 groundSurfaceTris[trii] = groundSurfaceProcTris[i][j];
205 groundSurfaceTris[trii][0] +=
offset;
206 groundSurfaceTris[trii][1] +=
offset;
207 groundSurfaceTris[trii][2] +=
offset;
214 forAll(groundSurfaceProcPoints, i)
222 forAll(groundSurfaceProcPoints, i)
224 forAll(groundSurfaceProcPoints[i], j)
226 groundSurfacePoints[pointi++] = groundSurfaceProcPoints[i][j];
230 groundSurface =
triSurface(groundSurfaceTris, groundSurfacePoints);
241 forAll(porousCells, porousCelli)
243 start[porousCelli] =
C[porousCells[porousCelli]];
244 end[porousCelli] = start[porousCelli] - searchSpan*zDir;
247 groundSearch.
findLine(start, end, hitInfo);
251 forAll(porousCells, porousCelli)
257 zBottom[porousCelli] =
258 (
C[porousCells[porousCelli]] - hit.
hitPoint()) & zDir;
266 Av_ = AvFunc->value(zNorm);
284 <<
"Unable to create porous cellZone " <<
zoneName_
285 <<
": zone already exists"
294 const word& modelType,
297 const word& dummyCellZoneName
309 Cd_(coeffs_.lookup<scalar>(
"Cd")),
310 C1_(coeffs_.lookup<scalar>(
"C1")),
311 rhoName_(coeffs_.lookupOrDefault<
word>(
"rho",
"rho"))
345 apply(Udiag, V,
rho,
U);
365 apply(Udiag, V,
rho,
U);
385 apply(Udiag, V,
rho,
U);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Graphite solid properties.
Run-time selectable general function of one variable.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & hitPoint() const
Return hit point.
bool hit() const
Is there a hit.
const Field< PointType > & points() const
Return reference to global points.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
static const word & constant()
Return constant name.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
void append(ZoneType *) const
Append or update a zone.
bool found(const label objectIndex) const
Return true if objectIndex is in any zone.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A bounding box defined in terms of the points at its extremities.
const point & min() const
Minimum point defining the bounding box.
const point & max() const
Maximum point defining the bounding box.
bool contains(const point &) const
Contains point? (inside or on edge)
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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 usePatchGroups=true) const
Return the set of patch indices corresponding to the given names.
const cellZoneList & cellZones() const
Return cell zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Top level model for porosity models.
const word zoneName_
Automatically generated zone name for this porous zone.
const scalarField & Av() const
Return the porosity surface area per unit volume zone field.
scalarField Av_
Porosity surface area per unit volume zone field.
powerLawLopesdaCostaZone(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Constructor.
Variant of the power law porosity model with spatially varying drag coefficient.
powerLawLopesdaCosta(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict, const word &cellZoneName)
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 void correct(fvVectorMatrix &UEqn) const
Add resistance.
virtual ~powerLawLopesdaCosta()
Destructor.
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
const vectorField & cellCentres() const
static const word & geometryDir()
Return the geometry directory name.
A surface geometry formed of discrete facets, e.g. triangles and/or quadrilaterals,...
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 class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const dimensionedScalar mu
Atomic mass unit.
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
const dimensionSet dimLength
const dimensionSet dimForce
const dimensionSet dimVolume
const dimensionSet dimArea
void offset(label &lst, const label o)
Ostream & indent(Ostream &os)
Indent stream.