49 void Foam::fv::limitPressure::readCoeffs(
const dictionary&
dict)
51 pName_ =
dict.lookupOrDefault<word>(
"p",
"p");
53 if (
dict.found(
"min") &&
dict.found(
"max"))
55 pMin_.
value() =
dict.lookup<scalar>(
"min");
58 pMax_.
value() =
dict.lookup<scalar>(
"max");
68 scalar pMax = -vGreat;
75 ||
isA<calculatedFvPatchField<scalar>>(pbf[
patchi])
85 reduce(pLimits, andOp<bool>());
88 reduce(pMax, maxOp<scalar>());
89 reduce(pMin, minOp<scalar>());
92 if (
dict.found(
"min"))
94 pMin_.
value() =
dict.lookup<scalar>(
"min");
97 else if (
dict.found(
"minFactor"))
102 <<
"'minFactor' specified rather than 'min'" <<
nl
103 <<
" but the corresponding reference pressure cannot"
104 " be evaluated from the boundary conditions." <<
nl
105 <<
" Please specify 'min' rather than 'minFactor'"
109 const scalar pMinFactor(
dict.lookup<scalar>(
"minFactor"));
110 pMin_.
value() = pMinFactor*pMin;
114 if (
dict.found(
"max"))
116 pMax_.
value() =
dict.lookup<scalar>(
"max");
119 else if (
dict.found(
"maxFactor"))
124 <<
"'maxFactor' specified rather than 'max'" <<
nl
125 <<
" but the corresponding reference pressure cannot"
126 " be evaluated from the boundary conditions." <<
nl
127 <<
" Please specify 'max' rather than 'maxFactor'"
131 const scalar pMaxFactor(
dict.lookup<scalar>(
"maxFactor"));
132 pMax_.
value() = pMaxFactor*pMax;
137 if (limitMinP_ || limitMaxP_)
159 const word& modelType,
185 bool constrained =
false;
187 if (limitMinP_ || limitMaxP_)
191 const scalar pMin =
min(
p).value();
193 if (pMin < pMin_.value())
195 Info<<
"limitPressure: min " << pMin <<
endl;
203 const scalar pMax =
max(
p).value();
205 if (pMax > pMax_.value())
207 Info<<
"limitPressure: max " << pMax <<
endl;
213 p.correctBoundaryConditions();
242 readCoeffs(coeffs(
dict));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const Type & value() const
Return const reference to value.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const dictionary & coeffs(const dictionary &) const
Return the coefficients sub-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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
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)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.