Go to the documentation of this file.
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;
pressureControl(const volScalarField &p, const volScalarField &rho, const dictionary &dict, const bool pRefRequired=true)
const dimensionSet dimPressure
const dimensionedScalar & pMin
static constexpr const zero Zero
const dimensionSet dimDensity
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
Ostream & endl(Ostream &os)
const Type & value() const
label min(const labelHashSet &set, label minValue=labelMax)
bool limit(volScalarField &p) const
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
bool setRefCell(const volScalarField &field, const volScalarField &fieldRef, const dictionary &dict, label &refCelli, scalar &refValue, const bool forceReference=false)
const dimensionedScalar rhoMin
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
reduce(hasMovingMesh, orOp< bool >())
Generic dimensioned Type class.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionedScalar rhoMax
#define FatalIOErrorInFunction(ios)
#define IOWarningInFunction(ios)
Generic GeometricField class.