From dd1c6c61fba97f2462fd1f8b415896b104f1afa0 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Wed, 30 Mar 2016 11:15:11 +0200 Subject: [PATCH] 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). --- applications/ebos/eclpeacemanwell.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/applications/ebos/eclpeacemanwell.hh b/applications/ebos/eclpeacemanwell.hh index 4ca59a9ef..69358f620 100644 --- a/applications/ebos/eclpeacemanwell.hh +++ b/applications/ebos/eclpeacemanwell.hh @@ -1430,6 +1430,8 @@ protected: const DofVariables *replacementDofVars = 0, int replacedGridIdx = -1) const { + typedef Opm::MathToolbox BhpEvalToolbox; + // compute the volumetric reservoir and surface rates for the complete well BhpEval resvRate = 0.0; @@ -1485,17 +1487,17 @@ protected: if (wellType_ == Injector) { // for injectors the computed rates are positive and the target BHP is the // maximum allowed pressure ... - result = std::min(maxSurfaceRate - surfaceRate, result); - result = std::min(maxResvRate - resvRate, result); - result = std::min(1e-7*(targetBottomHolePressure_ - bhp), result); + result = BhpEvalToolbox::min(maxSurfaceRate - surfaceRate, result); + result = BhpEvalToolbox::min(maxResvRate - resvRate, result); + result = BhpEvalToolbox::min(1e-7*(targetBottomHolePressure_ - bhp), result); } else { assert(wellType_ == Producer); // ... for producers the rates are negative and the bottom hole pressure is // is the minimum - result = std::min(maxSurfaceRate + surfaceRate, result); - result = std::min(maxResvRate + resvRate, result); - result = std::min(1e-7*(bhp - targetBottomHolePressure_), result); + result = BhpEvalToolbox::min(maxSurfaceRate + surfaceRate, result); + result = BhpEvalToolbox::min(maxResvRate + resvRate, result); + result = BhpEvalToolbox::min(1e-7*(bhp - targetBottomHolePressure_), result); } const Scalar scalingFactor = 1e-3;