49 void Foam::fv::limitPressure::readCoeffs()
53 pName_ =
dict.lookupOrDefault<word>(
"p",
"p");
55 if (
dict.found(
"min") &&
dict.found(
"max"))
57 pMin_.
value() =
dict.lookup<scalar>(
"min");
60 pMax_.
value() =
dict.lookup<scalar>(
"max");
70 scalar pMax = -vGreat;
77 ||
isA<calculatedFvPatchField<scalar>>(pbf[
patchi])
87 reduce(pLimits, andOp<bool>());
90 reduce(pMax, maxOp<scalar>());
91 reduce(pMin, minOp<scalar>());
94 if (
dict.found(
"min"))
96 pMin_.
value() =
dict.lookup<scalar>(
"min");
99 else if (
dict.found(
"minFactor"))
104 <<
"'minFactor' specified rather than 'min'" <<
nl
105 <<
" but the corresponding reference pressure cannot"
106 " be evaluated from the boundary conditions." <<
nl
107 <<
" Please specify 'min' rather than 'minFactor'"
111 const scalar pMinFactor(
dict.lookup<scalar>(
"minFactor"));
112 pMin_.
value() = pMinFactor*pMin;
116 if (
dict.found(
"max"))
118 pMax_.
value() =
dict.lookup<scalar>(
"max");
121 else if (
dict.found(
"maxFactor"))
126 <<
"'maxFactor' specified rather than 'max'" <<
nl
127 <<
" but the corresponding reference pressure cannot"
128 " be evaluated from the boundary conditions." <<
nl
129 <<
" Please specify 'max' rather than 'maxFactor'"
133 const scalar pMaxFactor(
dict.lookup<scalar>(
"maxFactor"));
134 pMax_.
value() = pMaxFactor*pMax;
139 if (limitMinP_ || limitMaxP_)
161 const word& modelType,
187 bool constrained =
false;
189 if (limitMinP_ || limitMaxP_)
193 const scalar pMin =
min(
p).value();
195 if (pMin < pMin_.value())
197 Info<<
"limitPressure: min " << pMin <<
endl;
205 const scalar pMax =
max(
p).value();
207 if (pMax > pMax_.value())
209 Info<<
"limitPressure: max " << pMax <<
endl;
215 p.correctBoundaryConditions();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const Type & value() const
Return const reference to value.
Finite volume options abstract base class.
const dictionary & coeffs() const
Return dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
const fvMesh & mesh() const
Return const access to the mesh database.
Mesh data needed to do the Finite Volume discretisation.
Limits the specified pressure field to be between specified minimum and maximum limits.
virtual bool movePoints()
Update for mesh motion.
virtual bool constrain(volScalarField &p) const
Constrain the pressure field.
limitPressure(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
const dimensionSet dimPressure
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
VolField< scalar > volScalarField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)