mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: use the correct min() function in the well residual
i.e., the method provided by the MathToolbox for the evaluation, not std::min(). I wonder why this even compiled (and more surprisingly: worked).
This commit is contained in:
@@ -1430,6 +1430,8 @@ protected:
|
|||||||
const DofVariables *replacementDofVars = 0,
|
const DofVariables *replacementDofVars = 0,
|
||||||
int replacedGridIdx = -1) const
|
int replacedGridIdx = -1) const
|
||||||
{
|
{
|
||||||
|
typedef Opm::MathToolbox<BhpEval> BhpEvalToolbox;
|
||||||
|
|
||||||
// compute the volumetric reservoir and surface rates for the complete well
|
// compute the volumetric reservoir and surface rates for the complete well
|
||||||
BhpEval resvRate = 0.0;
|
BhpEval resvRate = 0.0;
|
||||||
|
|
||||||
@@ -1485,17 +1487,17 @@ protected:
|
|||||||
if (wellType_ == Injector) {
|
if (wellType_ == Injector) {
|
||||||
// for injectors the computed rates are positive and the target BHP is the
|
// for injectors the computed rates are positive and the target BHP is the
|
||||||
// maximum allowed pressure ...
|
// maximum allowed pressure ...
|
||||||
result = std::min<BhpEval>(maxSurfaceRate - surfaceRate, result);
|
result = BhpEvalToolbox::min(maxSurfaceRate - surfaceRate, result);
|
||||||
result = std::min<BhpEval>(maxResvRate - resvRate, result);
|
result = BhpEvalToolbox::min(maxResvRate - resvRate, result);
|
||||||
result = std::min<BhpEval>(1e-7*(targetBottomHolePressure_ - bhp), result);
|
result = BhpEvalToolbox::min(1e-7*(targetBottomHolePressure_ - bhp), result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(wellType_ == Producer);
|
assert(wellType_ == Producer);
|
||||||
// ... for producers the rates are negative and the bottom hole pressure is
|
// ... for producers the rates are negative and the bottom hole pressure is
|
||||||
// is the minimum
|
// is the minimum
|
||||||
result = std::min<BhpEval>(maxSurfaceRate + surfaceRate, result);
|
result = BhpEvalToolbox::min(maxSurfaceRate + surfaceRate, result);
|
||||||
result = std::min<BhpEval>(maxResvRate + resvRate, result);
|
result = BhpEvalToolbox::min(maxResvRate + resvRate, result);
|
||||||
result = std::min<BhpEval>(1e-7*(bhp - targetBottomHolePressure_), result);
|
result = BhpEvalToolbox::min(1e-7*(bhp - targetBottomHolePressure_), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Scalar scalingFactor = 1e-3;
|
const Scalar scalingFactor = 1e-3;
|
||||||
|
|||||||
Reference in New Issue
Block a user