mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 08:54:53 -05:00
FullyImplicitBlackoilSolver: Throw an exception uppon encountering a non-finite residual
This commit is contained in:
1 parent
4845fc3073
commit
2f84156b91
1 file changed
+7
-1
@@ -31,6 +31,7 @@
|
|||||||
#include <opm/core/props/rock/RockCompressibility.hpp>
|
#include <opm/core/props/rock/RockCompressibility.hpp>
|
||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
#include <opm/core/utility/ErrorMacros.hpp>
|
#include <opm/core/utility/ErrorMacros.hpp>
|
||||||
|
#include <opm/core/utility/Exceptions.hpp>
|
||||||
#include <opm/core/well_controls.h>
|
#include <opm/core/well_controls.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -1272,7 +1273,12 @@ namespace {
|
|||||||
e = residual_.mass_balance.end();
|
e = residual_.mass_balance.end();
|
||||||
b != e; ++b)
|
b != e; ++b)
|
||||||
{
|
{
|
||||||
r = std::max(r, (*b).value().matrix().norm());
|
const double rowResid = (*b).value().matrix().norm();
|
||||||
|
if (!std::isfinite(rowResid)) {
|
||||||
|
OPM_THROW(Opm::NumericalProblem,
|
||||||
|
"Encountered a non-finite residual");
|
||||||
|
}
|
||||||
|
r = std::max(r, rowResid);
|
||||||
}
|
}
|
||||||
r = std::max(r, residual_.well_flux_eq.value().matrix().norm());
|
r = std::max(r, residual_.well_flux_eq.value().matrix().norm());
|
||||||
r = std::max(r, residual_.well_eq.value().matrix().norm());
|
r = std::max(r, residual_.well_eq.value().matrix().norm());
|
||||||
|
|||||||
Reference in new issue
Block a user