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
106 surfBounds.
min() - searchSpan*zDir, surfBounds.
max()
113 label porousCelli = 0;
119 porousCells[porousCelli++] = celli;
123 porousCells.
setSize(porousCelli);
128 forAll(porousCells, porousCelli)
130 start[porousCelli] =
C[porousCells[porousCelli]];
131 end[porousCelli] = start[porousCelli] + searchSpan*zDir;
141 searchSurf.
findLine(start, end, hitInfo);
145 forAll(porousCells, celli)
151 porousCells[porousCelli] = porousCells[celli];
154 (hit.
hitPoint() -
C[porousCells[porousCelli]]) & zDir;
161 porousCells.
setSize(porousCelli);
190 forAll(groundSurfaceProcTris, i)
192 nTris += groundSurfaceProcTris[i].
size();
198 forAll(groundSurfaceProcTris, i)
200 forAll(groundSurfaceProcTris[i], j)
202 groundSurfaceTris[trii] = groundSurfaceProcTris[i][j];
203 groundSurfaceTris[trii][0] +=
offset;
204 groundSurfaceTris[trii][1] +=
offset;
205 groundSurfaceTris[trii][2] +=
offset;
212 forAll(groundSurfaceProcPoints, i)
220 forAll(groundSurfaceProcPoints, i)
222 forAll(groundSurfaceProcPoints[i], j)
224 groundSurfacePoints[pointi++] = groundSurfaceProcPoints[i][j];
228 groundSurface =
triSurface(groundSurfaceTris, groundSurfacePoints);
239 forAll(porousCells, porousCelli)
241 start[porousCelli] =
C[porousCells[porousCelli]];
242 end[porousCelli] = start[porousCelli] - searchSpan*zDir;
245 groundSearch.
findLine(start, end, hitInfo);
249 forAll(porousCells, porousCelli)
255 zBottom[porousCelli] =
256 (
C[porousCells[porousCelli]] - hit.
hitPoint()) & zDir;
264 Av_ = AvFunc->value(zNorm);
274 zoneID = cellZones.
size();
292 <<
"Unable to create porous cellZone " <<
zoneName_
293 <<
": zone already exists"
302 const word& modelType,
305 const word& dummyCellZoneName
317 Cd_(coeffs_.lookup<scalar>(
"Cd")),
318 C1_(coeffs_.lookup<scalar>(
"C1")),
319 rhoName_(coeffs_.lookupOrDefault<
word>(
"rho",
"rho"))
353 apply(Udiag, V,
rho,
U);
373 apply(Udiag, V,
rho,
U);
393 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.
label findZoneID(const word &zoneName) const
Find zone index given a name.
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.
bool set(const label) const
Is element set.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
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)
label size() const
Return the number of elements in the UPtrList.
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 IDs corresponding to the given names.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const meshCellZones & cellZones() const
Return cell zones.
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.
errorManip< error > abort(error &err)
const dimensionSet dimForce
void offset(label &lst, const label o)
word name(const complex &)
Return a string representation of a complex.
Ostream & indent(Ostream &os)
Indent stream.