49 void Foam::fv::limitPressure::readCoeffs()
51 const dictionary&
dict(coeffs());
55 pMin_.value() = dict.
lookup<scalar>(
"min");
58 pMax_.value() = dict.
lookup<scalar>(
"max");
68 scalar pMax = -vGreat;
72 if (pbf[
patchi].fixesValue())
81 reduce(pLimits, andOp<bool>());
84 reduce(pMax, maxOp<scalar>());
85 reduce(pMin, minOp<scalar>());
88 if (dict.
found(
"min"))
90 pMin_.value() = dict.
lookup<scalar>(
"min");
93 else if (dict.
found(
"minFactor"))
98 <<
"'minFactor' specified rather than 'min'" <<
nl 99 <<
" but the corresponding reference pressure cannot" 100 " be evaluated from the boundary conditions." <<
nl 101 <<
" Please specify 'min' rather than 'minFactor'" 105 const scalar pMinFactor(dict.
lookup<scalar>(
"minFactor"));
106 pMin_.value() = pMinFactor*
pMin;
110 if (dict.
found(
"max"))
112 pMax_.value() = dict.
lookup<scalar>(
"max");
115 else if (dict.
found(
"maxFactor"))
120 <<
"'maxFactor' specified rather than 'max'" <<
nl 121 <<
" but the corresponding reference pressure cannot" 122 " be evaluated from the boundary conditions." <<
nl 123 <<
" Please specify 'max' rather than 'maxFactor'" 127 const scalar pMaxFactor(dict.
lookup<scalar>(
"maxFactor"));
128 pMax_.value() = pMaxFactor*pMax;
133 if (limitMinP_ || limitMaxP_)
137 Info<<
" min " << pMin_.value() <<
nl;
142 Info<<
" max " << pMax_.value() <<
nl;
155 const word& modelType,
180 bool constrained =
false;
182 if (limitMinP_ || limitMaxP_)
186 const scalar pMin =
min(p).value();
188 if (pMin < pMin_.value())
190 Info<<
"limitPressure: p min " << pMin <<
endl;
198 const scalar pMax =
max(p).value();
200 if (pMax > pMax_.value())
202 Info<<
"limitPressure: p max " << pMax <<
endl;
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.
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...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const dimensionSet dimPressure
dimensionedScalar pMin("pMin", dimPressure, mixture)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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.
#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.
Finite volume options abstract base class.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.