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);
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);
274 coeffs_.readIfPresent(
"U", UName_);
275 coeffs_.readIfPresent(
"mu", muName_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
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())
@ NO_REGISTER
Do not request registration (bool: false).
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
void setSize(label n)
Alias for resize().
void resize(const label len)
Adjust allocated size of list.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void setSize(const label n)
Same as resize().
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
void clearAddressing()
Clear addressing.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const dimensionSet & dimensions() const noexcept
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Field< Type > & source() noexcept
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Applies inter-region explicit porosity source.
void initialise()
Initialise.
word UName_
Name of operand velocity field.
virtual bool read(const dictionary &dict)
Read dictionary.
word muName_
Name of operand dynamic viscosity field (compressible case only).
autoPtr< porosityModel > porosityPtr_
Run-time selectable porosity model.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Vector.
interRegionExplicitPorositySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
bool firstIter_
First iteration.
Intermediate class for handling inter-region exchanges.
word nbrRegionName_
Name of the neighbour region to map.
interRegionOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
virtual bool read(const dictionary &dict)
Read dictionary.
const meshToMesh & meshInterp() const
Return const access to the mapToMap pointer.
Base abstract class for handling finite volume options (i.e. fvOption).
bool active_
Source active flag.
const word & name() const noexcept
Return const access to the source name.
const fvMesh & mesh_
Reference to the mesh database.
wordList fieldNames_
Field names to apply source to - populated by derived models.
dictionary coeffs_
Dictionary containing source coefficients.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
const word name_
Source name.
const scalarField & diag() const
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...
static autoPtr< porosityModel > New(const word &name, const fvMesh &mesh, const dictionary &dict, const wordRe &cellZoneName=wordRe::null)
Selector.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Namespace for finite-volume.
const dimensionSet dimViscosity
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with cellZone content on a polyMesh.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimDensity
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.