45 interRegionExplicitPorositySource,
60 const word zoneName(
name_ +
":porous");
72 cz.setSize(zoneID + 1);
80 nbrMesh.faceNeighbour(),
91 <<
"Unable to create porous cellZone " << zoneName
92 <<
": zone already exists" 116 const word& modelType,
122 porosityPtr_(nullptr),
124 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
125 muName_(coeffs_.getOrDefault<
word>(
"mu",
"thermo:mu"))
145 const auto& nbrMesh = mesh_.time().lookupObject<
fvMesh>(nbrRegionName_);
156 auto& UNbr = tUNbr.ref();
159 meshInterp().mapSrcToTgt
163 UNbr.primitiveFieldRef()
168 porosityPtr_->addResistance(nbrEqn);
175 Udiag.setSize(eqn.
diag().size(),
Zero);
194 const auto& nbrMesh = mesh_.time().lookupObject<
fvMesh>(nbrRegionName_);
205 auto& UNbr = tUNbr.ref();
208 meshInterp().mapSrcToTgt
212 UNbr.primitiveFieldRef()
224 auto& rhoNbr = trhoNbr.ref();
233 auto& muNbr = tmuNbr.ref();
238 meshInterp().mapSrcToTgt
240 rho.primitiveField(),
242 rhoNbr.primitiveFieldRef()
246 meshInterp().mapSrcToTgt
250 muNbr.primitiveFieldRef()
253 porosityPtr_->addResistance(nbrEqn, rhoNbr, muNbr);
260 Udiag.setSize(eqn.
diag().size(),
Zero);
274 coeffs_.readIfPresent(
"U", UName_);
275 coeffs_.readIfPresent(
"mu", muName_);
const scalarField & diag() const
void size(const label n)
Older name for setAddressableSize.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Intermediate class for handling inter-region exchanges.
virtual bool read(const dictionary &dict)
Read dictionary.
wordList fieldNames_
Field names to apply source to - populated by derived models.
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvMesh & mesh_
Reference to the mesh database.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
const dimensionSet dimViscosity
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
static autoPtr< porosityModel > New(const word &name, const fvMesh &mesh, const dictionary &dict, const wordRe &cellZoneName=wordRe::null)
Selector.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
virtual bool read(const dictionary &dict)
Read dictionary.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
const word name_
Source name.
A class for handling words, derived from Foam::string.
word UName_
Name of operand velocity field.
label size() const noexcept
The number of entries in the list.
interRegionExplicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
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.
word nbrRegionName_
Name of the neighbour region to map.
errorManip< error > abort(error &err)
static tmp< GeometricField< vector, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< vector >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
void initialise()
Initialise.
const dimensionSet dimDensity
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
const dimensionedScalar mu
Atomic mass unit.
Field< Type > & source() noexcept
const dimensionSet & dimensions() const noexcept
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
dictionary coeffs_
Dictionary containing source coefficients.
Do not request registration (bool: false)
bool active_
Source active flag.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
bool firstIter_
First iteration.
static constexpr const zero Zero
Global zero (0)