36 const bool pRefRequired
51 if (pRefRequired &&
setRefCell(p, dict, refCell_, refValue_))
71 scalar rhoRefMax = -great;
72 scalar rhoRefMin = great;
73 bool rhoLimits =
false;
77 if (pbf[
patchi].fixesValue())
83 pMin =
min(pMin,
min(pbf[patchi]));
85 rhoRefMax =
max(rhoRefMax,
max(rhobf[patchi]));
86 rhoRefMin =
min(rhoRefMin,
min(rhobf[patchi]));
100 if (dict.
found(
"pMax"))
105 else if (dict.
found(
"pMaxFactor"))
110 <<
"'pMaxFactor' specified rather than 'pMax'" <<
nl 111 <<
" but the corresponding reference pressure cannot" 112 " be evaluated from the boundary conditions." <<
nl 113 <<
" Please specify 'pMax' rather than 'pMaxFactor'" 118 pMax_.value() = pMaxFactor*pMax;
121 else if (dict.
found(
"rhoMax"))
126 <<
"'rhoMax' specified rather than 'pMax' or 'pMaxFactor'" 128 <<
" This is supported for backward-compatibility but " 129 "'pMax' or 'pMaxFactor' are more reliable." <<
endl;
134 <<
"'rhoMax' specified rather than 'pMax'" <<
nl 135 <<
" but the corresponding reference pressure cannot" 136 " be evaluated from the boundary conditions." <<
nl 137 <<
" Please specify 'pMax' rather than 'rhoMax'" 144 <<
"'rhoMax' specified rather than 'pMaxFactor'" <<
nl 145 <<
" but the corresponding reference density cannot" 146 " be evaluated from the boundary conditions." <<
nl 147 <<
" Please specify 'pMaxFactor' rather than 'rhoMax'" 153 pMax_.value() =
max(rhoMax.
value()/rhoRefMax, 1)*pMax;
157 if (dict.
found(
"pMin"))
162 else if (dict.
found(
"pMinFactor"))
167 <<
"'pMinFactor' specified rather than 'pMin'" <<
nl 168 <<
" but the corresponding reference pressure cannot" 169 " be evaluated from the boundary conditions." <<
nl 170 <<
" Please specify 'pMin' rather than 'pMinFactor'" 175 pMin_.value() = pMinFactor*
pMin;
178 else if (dict.
found(
"rhoMin"))
183 <<
"'rhoMin' specified rather than 'pMin' or 'pMinFactor'" <<
nl 184 <<
" This is supported for backward-compatibility but" 185 "'pMin' or 'pMinFactor' are more reliable." <<
endl;
190 <<
"'rhoMin' specified rather than 'pMin'" <<
nl 191 <<
" but the corresponding reference pressure cannot" 192 " be evaluated from the boundary conditions." <<
nl 193 <<
" Please specify 'pMin' rather than 'rhoMin'" 200 <<
"'rhoMin' specified rather than 'pMinFactor'" <<
nl 201 <<
" but the corresponding reference density cannot" 202 " be evaluated from the boundary conditions." <<
nl 203 <<
" Please specify 'pMinFactor' rather than 'rhoMin'" 209 pMin_.value() =
min(rhoMin.
value()/rhoRefMin, 1)*pMin;
214 if (limitMaxP_ || limitMinP_)
216 Info<<
"pressureControl" <<
nl;
220 Info<<
" pMax " << pMax_.value() <<
nl;
225 Info<<
" pMin " << pMin_.value() <<
nl;
237 if (limitMaxP_ || limitMinP_)
241 const scalar pMax =
max(p).value();
243 if (pMax > pMax_.
value())
245 Info<<
"pressureControl: p max " << pMax <<
endl;
252 const scalar
pMin =
min(p).value();
254 if (pMin < pMin_.
value())
256 Info<<
"pressureControl: p min " << pMin <<
endl;
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic...
const Type & value() const
Return const reference to value.
bool limit(volScalarField &p) const
Limit the pressure if necessary and return true if so.
const dimensionSet dimPressure
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar pMin("pMin", dimPressure, fluid)
const dimensionSet dimDensity
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
If the field fieldRef needs referencing find the reference cell nearest.
pressureControl(const volScalarField &p, const volScalarField &rho, const dictionary &dict, const bool pRefRequired=true)
Construct from the simple/pimple sub-dictionary.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.