ECL peaceman well: throw an exception if the BHP cannot determined

this used to be an assert(), but it is not a programmer error but
something which can happen during valid simulation runs.
This commit is contained in:
Andreas Lauser 2015-12-31 13:20:39 +01:00
parent c44ad1ca3c
commit 2c8e1da7f3

View File

@ -1358,7 +1358,10 @@ protected:
Scalar fStar = wellResidual_(bhp + eps);
Scalar fPrime = (fStar - f)/eps;
assert(std::abs(fPrime) > 1e-20);
if (std::abs(fPrime) < 1e-20)
OPM_THROW(Opm::NumericalProblem,
"Cannot determine the bottom hole pressure for well " << name()
<< ": Derivative of the well residual is too small");
Scalar delta = f/fPrime;
bhp -= delta;