50 <<
"Cannot have all resistances set to negative, resistance = "
61 val[cmpt] *= -maxCmpt;
73 const word& modelType,
93 coeffs_(
dict.optionalSubDict(modelType +
"Coeffs")),
95 zoneName_(cellZoneName),
104 dict.readIfPresent(
"active", active_);
105 dict_.readEntry(
"cellZone", zoneName_);
115 <<
"Cannot find porous cellZone " << zoneName_ << endl
117 << flatOutput(mesh_.cellZones().names()) << nl
119 << flatOutput(mesh_.cellZones().groupNames()) << nl
131 const cellZone& cZone =
mesh_.cellZones()[zonei];
135 for (
const label celli : cZone)
137 const cell&
c =
cells[celli];
140 for (
const point& pt : cellPoints)
142 bb.add(
csys().localPosition(pt));
157 if (!mesh_.upToDatePoints(*
this))
159 calcTransformModelData();
162 mesh_.setUpToDatePoints(*
this);
167Foam::tmp<Foam::vectorField> Foam::porosityModel::porosityModel::force
174 transformModelData();
178 if (!cellZoneIDs_.empty())
189 if (cellZoneIDs_.empty())
194 transformModelData();
206 if (cellZoneIDs_.empty())
211 transformModelData();
223 if (cellZoneIDs_.empty())
228 transformModelData();
236 AU.correctBoundaryConditions();
249 dict.readIfPresent(
"active", active_);
251 coeffs_ =
dict.optionalSubDict(
type() +
"Coeffs");
253 dict.readEntry(
"cellZone", zoneName_);
254 cellZoneIDs_ = mesh_.cellZones().indices(zoneName_);
if(maxValue - minValue< SMALL)
void correctBoundaryConditions()
Correct boundary field.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static constexpr direction nComponents
Number of components in this vector space.
A bounding box defined in terms of min/max extrema points.
void reduce()
Inplace parallel reduction of min/max values, using UPstream::worldComm.
void add(const boundBox &bb)
Extend to include the second box.
vector span() const
The bounding box span (from minimum to maximum).
A cell is defined as a list of faces with extra functionality.
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,...
const Type & value() const noexcept
Return const reference to value.
Mesh data needed to do the Finite Volume discretisation.
Top level model for porosity models.
virtual void addResistance(fvVectorMatrix &UEqn)
Add resistance.
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.
virtual bool writeData(Ostream &os) const
Write.
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.
wordRe zoneName_
Name(s) of cell-zone.
const coordinateSystem & csys() const
Local coordinate system.
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.
const word & name() const
Return const access to the porosity model name.
labelList cellZoneIDs_
Cell zone IDs.
virtual bool read()
Inherit read from regIOobject.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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...
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
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.
OBJstream os(runTime.globalPath()/outputName)
const dimensionedScalar c
Speed of light in a vacuum.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
List< cell > cellList
List of cell.
fvMatrix< vector > fvVectorMatrix
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vector point
Point is a vector.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
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.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.