39#ifndef Foam_porosityModel_H
40#define Foam_porosityModel_H
128 inline label
fieldIndex(
const label index)
const;
149 const word& modelName,
153 const wordRe& cellZoneName
162 const word& modelType,
273 virtual bool global()
const
fileName globalFilePath(const word &typeName, const bool search=true) const
Redirect to fileHandler filePath, searching up if in parallel.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Base class for coordinate system specification, the default coordinate system type is cartesian .
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
Return pointer to new porosityModel object created on the freestore.
autoPtr< porosityModel > operator()(Istream &is) const
iNew(const fvMesh &mesh, const word &name)
Top level model for porosity models.
virtual void addResistance(fvVectorMatrix &UEqn)
Add resistance.
virtual void correct(fvVectorMatrix &UEqn, const volScalarField &rho, const volScalarField &mu) const =0
virtual void calcTransformModelData()=0
Transform the model data wrt mesh changes.
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const =0
Calculate the porosity force.
bool active_
Porosity active flag.
const fvMesh & mesh_
Reference to the mesh database.
void operator=(const porosityModel &)=delete
No copy assignment.
declareRunTimeSelectionTable(autoPtr, porosityModel, mesh,(const word &modelName, const word &name, const fvMesh &mesh, const dictionary &dict, const wordRe &cellZoneName),(modelName, name, mesh, dict, cellZoneName))
Selection table.
virtual bool writeData(Ostream &os) const
Write.
virtual bool global() const
Is object global.
const labelList & cellZoneIDs() const
Return const access to the cell zone IDs.
TypeName("porosityModel")
Runtime type information.
virtual ~porosityModel()=default
Destructor.
autoPtr< coordinateSystem > csysPtr_
Local coordinate system.
dictionary coeffs_
Model coefficients dictionary.
porosityModel(const porosityModel &)=delete
No copy construct.
virtual void transformModelData()
Transform the model data wrt mesh changes.
const dictionary dict_
Dictionary used for model construction.
virtual fileName filePath() const
Return complete path + object name if the file exists.
wordRe zoneName_
Name(s) of cell-zone.
virtual void correct(const fvVectorMatrix &UEqn, volTensorField &AU) const =0
const coordinateSystem & csys() const
Local coordinate system.
virtual void correct(fvVectorMatrix &UEqn) const =0
const dictionary & dict() const
Return dictionary used for model construction.
void adjustNegativeResistance(dimensionedVector &resist)
Adjust negative resistance values to be multiplier of max value.
static autoPtr< porosityModel > New(const word &name, const fvMesh &mesh, const dictionary &dict, const wordRe &cellZoneName=wordRe::null)
Selector.
bool active() const
Return const access to the porosity active flag.
const word & name() const
Return const access to the porosity model name.
labelList cellZoneIDs_
Cell zone IDs.
virtual tmp< vectorField > force(const volVectorField &U, const volScalarField &rho, const volScalarField &mu)
Return the force over the cell zone(s).
virtual bool read()
Inherit read from regIOobject.
label fieldIndex(const label index) const
Return label index.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
virtual bool read()
Read object.
A class for managing temporary objects.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
static const wordRe null
An empty wordRe.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Forward declarations of fvMatrix specializations.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
fvMatrix< vector > fvVectorMatrix
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
Trait for specifying global vs. local IOobject file types.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.