47 <<
"Cannot have all resistances set to negative, resistance = "
53 maxCmpt =
max(0, maxCmpt);
59 val[cmpt] *= -maxCmpt;
69 if (!coordSys_.R().uniform())
79 Foam::porosityModel::porosityModel
82 const word& modelType,
85 const word& cellZoneName
102 coeffs_(
dict.optionalSubDict(modelType +
"Coeffs")),
103 zoneName_(cellZoneName),
122 <<
"cannot find porous cellZone " <<
zoneName_
138 if (!mesh_.upToDatePoints(*
this))
140 calcTransformModelData();
143 mesh_.setUpToDatePoints(*
this);
159 if (!cellZoneIDs_.empty())
161 this->calcForce(
U,
rho,
mu, tforce.ref());
170 if (cellZoneIDs_.empty())
175 transformModelData();
187 if (cellZoneIDs_.empty())
192 transformModelData();
216 cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_);
Generic GeometricField class.
void correctBoundaryConditions()
Correct boundary field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
labelList findIndices(const wordRe &) const
Return zone indices for all matches.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static bool master(const label communicator=0)
Am I the master process.
static const direction nComponents
Number of components in this vector space.
Base class for other coordinate system specifications.
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.
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const meshCellZones & cellZones() const
Return cell zones.
Top level model for porosity models.
virtual void addResistance(fvVectorMatrix &UEqn)
Add resistance.
const fvMesh & mesh_
Reference to the mesh database.
virtual ~porosityModel()
Destructor.
virtual bool writeData(Ostream &os) const
Write.
virtual void transformModelData()
Transform the model data wrt mesh changes.
const dictionary dict_
Dictionary used for model construction.
wordRe zoneName_
Name(s) of cell-zone.
void adjustNegativeResistance(dimensionedVector &resist)
Adjust negative resistance values to be multiplier of max value.
labelList cellZoneIDs_
Cell zone IDs.
virtual bool read()
Inherit read from regIOobject.
label fieldIndex(const label index) const
Return label index.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su)
const dimensionedScalar mu
Atomic mass unit.
errorManipArg< error, int > exit(error &err, const int errNo=1)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
defineTypeNameAndDebug(combustionModel, 0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
word name(const complex &)
Return a string representation of a complex.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.