37 namespace porosityModels
50 const word& modelType,
55 zoneName_(name +
":porousZone")
60 vector zDir(coeffs.lookup(
"zDir"));
63 scalar searchSpan(coeffs.lookup<scalar>(
"searchSpan"));
66 word topSurfaceFileName(coeffs.lookup(
"topSurface"));
70 List<wordRe> groundPatches(coeffs.lookup(
"groundPatches"));
97 surfBounds.min() - searchSpan*zDir, surfBounds.max()
104 label porousCelli = 0;
108 if (searchBounds.contains(C[celli]))
110 porousCells[porousCelli++] = celli;
114 porousCells.setSize(porousCelli);
119 forAll(porousCells, porousCelli)
121 start[porousCelli] = C[porousCells[porousCelli]];
122 end[porousCelli] = start[porousCelli] + searchSpan*zDir;
132 searchSurf.
findLine(start, end, hitInfo);
136 forAll(porousCells, celli)
142 porousCells[porousCelli] = porousCells[celli];
145 (hit.
hitPoint() - C[porousCells[porousCelli]]) & zDir;
152 porousCells.
setSize(porousCelli);
181 forAll(groundSurfaceProcTris, i)
183 nTris += groundSurfaceProcTris[i].
size();
189 forAll(groundSurfaceProcTris, i)
191 forAll(groundSurfaceProcTris[i], j)
193 groundSurfaceTris[trii] = groundSurfaceProcTris[i][j];
194 groundSurfaceTris[trii][0] += offset;
195 groundSurfaceTris[trii][1] += offset;
196 groundSurfaceTris[trii][2] += offset;
199 offset += groundSurfaceProcPoints[i].
size();
203 forAll(groundSurfaceProcPoints, i)
205 nPoints += groundSurfaceProcPoints[i].
size();
211 forAll(groundSurfaceProcPoints, i)
213 forAll(groundSurfaceProcPoints[i], j)
215 groundSurfacePoints[pointi++] = groundSurfaceProcPoints[i][j];
219 groundSurface =
triSurface(groundSurfaceTris, groundSurfacePoints);
230 forAll(porousCells, porousCelli)
232 start[porousCelli] = C[porousCells[porousCelli]];
233 end[porousCelli] = start[porousCelli] - searchSpan*zDir;
236 groundSearch.
findLine(start, end, hitInfo);
240 forAll(porousCells, porousCelli)
246 zBottom[porousCelli] =
247 (C[porousCells[porousCelli]] - hit.
hitPoint()) & zDir;
255 Sigma_ = SigmaFunc->value(zNorm);
265 zoneID = cellZones.
size();
283 <<
"Unable to create porous cellZone " << zoneName_
284 <<
": zone already exists" 293 const word& modelType,
296 const word& dummyCellZoneName
308 Cd_(coeffs_.lookup<scalar>(
"Cd")),
309 C1_(coeffs_.lookup<scalar>(
"C1")),
310 rhoName_(coeffs_.lookupOrDefault<
word>(
"rho",
"rho"))
344 apply(Udiag, V, rho, U);
364 apply(Udiag, V, rho, U);
384 apply(Udiag, V, rho, U);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
Run-time selectable general function of one variable.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
Graphite solid properties.
label findZoneID(const word &zoneName) const
Find zone index given a name.
#define forAll(list, i)
Loop across all elements in list.
virtual Ostream & write(const char)=0
Write character.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
Ostream & indent(Ostream &os)
Indent stream.
bool set(const label) const
Is element set.
Variant of the power law porosity model with spatially varying drag coefficient.
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
const meshCellZones & cellZones() const
Return cell zones.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const scalarField & Sigma() const
Return the porosity surface area per unit volume zone field.
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
powerLawLopesdaCosta(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict, const word &cellZoneName)
virtual tmp< pointField > points() const
Get the points that define the surface.
const GeometricField< Type, fvPatchField, volMesh > & psi() const
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A bounding box defined in terms of the points at its extremities.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Time & time() const
Return the top-level database.
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.
Macros for easy insertion into run-time selection tables.
powerLawLopesdaCostaZone(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Constructor.
IOoject and searching on triSurface.
Helper class to search on triSurface.
const Point & hitPoint() const
Return hit point.
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
static const word & geometryDir()
Return the geometry directory name.
A class for handling words, derived from string.
const word & constant() const
Return constant name.
bool hit() const
Is there a hit.
const Field< PointType > & points() const
Return reference to global points.
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
bool writeData(Ostream &os) const
Write.
const dimensionSet dimForce
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Mesh data needed to do the Finite Volume discretisation.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Triangulated surface description with patch information.
const word zoneName_
Automatically generated zone name for this porous zone.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
virtual ~powerLawLopesdaCosta()
Destructor.
Top level model for porosity models.
const dimensionSet & dimensions() const