38 const bool pRefRequired
61 if (
dict.found(
"pMax") &&
dict.found(
"pMin"))
63 dict.readEntry(
"pMax", pMax_.
value()); limitMaxP_ =
true;
64 dict.readEntry(
"pMin", pMin_.
value()); limitMinP_ =
true;
71 scalar rhoRefMax = -GREAT;
72 scalar rhoRefMin = GREAT;
73 bool rhoLimits =
false;
77 if (pbf[patchi].fixesValue())
82 pMax =
max(pMax,
max(pbf[patchi]));
85 rhoRefMax =
max(rhoRefMax,
max(rhobf[patchi]));
86 rhoRefMin =
min(rhoRefMin,
min(rhobf[patchi]));
100 if (
dict.readIfPresent(
"pMax", pMax_.
value()))
104 else if (
dict.found(
"pMaxFactor"))
109 <<
"'pMaxFactor' specified rather than 'pMax'" <<
nl 110 <<
" but the corresponding reference pressure cannot" 111 " be evaluated from the boundary conditions." <<
nl 112 <<
" Please specify 'pMax' rather than 'pMaxFactor'" 116 pMax_.
value() = pMax *
dict.get<scalar>(
"pMaxFactor");
119 else if (
dict.found(
"rhoMax"))
124 <<
"'rhoMax' specified rather than 'pMax' or 'pMaxFactor'" 126 <<
" This is supported for backward-compatibility but" 127 " 'pMax' or 'pMaxFactor' are more reliable." <<
endl;
132 <<
"'rhoMax' specified rather than 'pMax'" <<
nl 133 <<
" but the corresponding reference pressure cannot" 134 " be evaluated from the boundary conditions." <<
nl 135 <<
" Please specify 'pMax' rather than 'rhoMax'" 142 <<
"'rhoMax' specified rather than 'pMaxFactor'" <<
nl 143 <<
" but the corresponding reference density cannot" 144 " be evaluated from the boundary conditions." <<
nl 145 <<
" Please specify 'pMaxFactor' rather than 'rhoMax'" 155 if (
dict.readIfPresent(
"pMin", pMin_.
value()))
159 else if (
dict.found(
"pMinFactor"))
164 <<
"'pMinFactor' specified rather than 'pMin'" <<
nl 165 <<
" but the corresponding reference pressure cannot" 166 " be evaluated from the boundary conditions." <<
nl 167 <<
" Please specify 'pMin' rather than 'pMinFactor'" 174 else if (
dict.found(
"rhoMin"))
179 <<
"'rhoMin' specified rather than 'pMin' or 'pMinFactor'" <<
nl 180 <<
" This is supported for backward-compatibility but" 181 " 'pMin' or 'pMinFactor' are more reliable." <<
endl;
186 <<
"'rhoMin' specified rather than 'pMin'" <<
nl 187 <<
" but the corresponding reference pressure cannot" 188 " be evaluated from the boundary conditions." <<
nl 189 <<
" Please specify 'pMin' rather than 'rhoMin'" 196 <<
"'rhoMin' specified rather than 'pMinFactor'" <<
nl 197 <<
" but the corresponding reference density cannot" 198 " be evaluated from the boundary conditions." <<
nl 199 <<
" Please specify 'pMinFactor' rather than 'rhoMin'" 210 if (limitMaxP_ || limitMinP_)
212 Info<<
"pressureControl" <<
nl;
233 if (limitMaxP_ || limitMinP_)
237 const scalar pMax =
max(
p).value();
239 if (pMax > pMax_.value())
241 Info<<
"pressureControl: p max " << pMax <<
endl;
const Type & value() const noexcept
Return const reference to value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionedScalar & pMin
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionedScalar rhoMin
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic...
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool limit(volScalarField &p) const
Limit the pressure if necessary and return true if so.
const dimensionSet dimPressure
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const dimensionSet dimDensity
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
#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.
const dimensionedScalar rhoMax
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)