From 8a4117441cf6dc21d8792e28c5c829b111ea19be Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 25 Apr 2019 10:33:39 +0200 Subject: [PATCH] Make sure that the convergece report is stored before throw --- opm/autodiff/BlackoilModelEbos.hpp | 8 -------- opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 64aaa51b8..b4241cc3f 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -795,14 +795,6 @@ namespace Opm { auto report = getReservoirConvergence(timer.currentStepLength(), iteration, B_avg, residual_norms); report += wellModel().getWellConvergence(B_avg); - // Throw if any NaN or too large residual found. - ConvergenceReport::Severity severity = report.severityOfWorstFailure(); - if (severity == ConvergenceReport::Severity::NotANumber) { - OPM_THROW(Opm::NumericalIssue, "NaN residual found!"); - } else if (severity == ConvergenceReport::Severity::TooLarge) { - OPM_THROW(Opm::NumericalIssue, "Too large residual found!"); - } - return report; } diff --git a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp index 7e6bda3e8..e64a03bcb 100644 --- a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp @@ -491,6 +491,7 @@ namespace Opm { std::ostringstream msg; msg << " Excessive chopping detected in report step " << sr.back().report_step << ", substep " << sr.back().current_step << "\n"; + assert(!sr.back().report.empty()); const auto& wfs = sr.back().report.back().wellFailures(); for (const auto& wf : wfs) { msg << " Well that failed: " << wf.wellName() << "\n";