49 void Foam::fv::limitPressure::readCoeffs()
51 const dictionary&
dict(coeffs());
57 pMin_.value() = dict.
lookup<scalar>(
"min");
60 pMax_.value() = dict.
lookup<scalar>(
"max");
70 scalar pMax = -vGreat;
76 pbf[patchi].fixesValue()
77 ||
isA<calculatedFvPatchField<scalar>>(pbf[patchi])
82 pMin =
min(pMin,
min(pbf[patchi]));
83 pMax =
max(pMax,
max(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_)
143 Info<<
" min " << pMin_.value() <<
nl;
148 Info<<
" max " << pMax_.value() <<
nl;
161 const word& modelType,
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;
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dimensionSet dimPressure
dimensionedScalar pMin("pMin", dimPressure, mixture)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of the boundary field.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual bool constrain(volScalarField &he) const
Constrain the energy field.
A class for handling words, derived from string.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
static const word null
An empty word.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Mesh data needed to do the Finite Volume discretisation.
limitPressure(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
void correctBoundaryConditions()
Correct boundary field.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual bool movePoints()
Update for mesh motion.
Class containing mesh-to-mesh mapping information.
Finite volume options abstract base class.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.