mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
c44ad1ca3c
commit
2c8e1da7f3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user