From 40800da0a8b23bccd2824b3905a7cc0d78aef56d Mon Sep 17 00:00:00 2001 From: Alf Birger Rustad Date: Thu, 11 Feb 2021 23:48:30 +0100 Subject: [PATCH 1/3] Do not report confusing error --- opm/simulators/wells/MultisegmentWell_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 9af1166db..2b66184df 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -3185,7 +3185,7 @@ namespace Opm const EvalWell d = 1.0 - rs * rv; if (d <= 0.0 || d > 1.0) { - OPM_THROW(Opm::NumericalIssue, "Problematic d value " << d << " obtained for well " << name() + OPM_THROW_NOLOG(Opm::NumericalIssue, "Problematic d value " << d << " obtained for well " << name() << " during convertion to surface volume with rs " << rs << ", rv " << rv << " and pressure " << seg_pressure << " obtaining d " << d); From 8fce439f13ed72bb3241185053ae9041bd6cea80 Mon Sep 17 00:00:00 2001 From: Alf Birger Rustad Date: Fri, 12 Feb 2021 10:39:04 +0100 Subject: [PATCH 2/3] One more message --- opm/simulators/wells/MSWellHelpers.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/MSWellHelpers.hpp b/opm/simulators/wells/MSWellHelpers.hpp index dad00a3ce..ec152b8e7 100644 --- a/opm/simulators/wells/MSWellHelpers.hpp +++ b/opm/simulators/wells/MSWellHelpers.hpp @@ -64,7 +64,7 @@ namespace mswellhelpers for (size_t i_block = 0; i_block < y.size(); ++i_block) { for (size_t i_elem = 0; i_elem < y[i_block].size(); ++i_elem) { if (std::isinf(y[i_block][i_elem]) || std::isnan(y[i_block][i_elem]) ) { - OPM_THROW(Opm::NumericalIssue, "nan or inf value found after UMFPack solve due to singular matrix"); + OPM_THROW_NOLOG(Opm::NumericalIssue, "nan or inf value found after UMFPack solve due to singular matrix"); } } } @@ -156,7 +156,7 @@ namespace mswellhelpers linsolver.apply(y, x, res); if ( !res.converged ) { - OPM_DEFLOG_THROW(Opm::NumericalIssue, "the invDX does not get converged! ", deferred_logger); + OPM_DEFLOG_THROW(Opm::NumericalIssue, "the invDX did not converge ", deferred_logger); } return y; From 034dab84f98474c77dc155fb5f8f673979a9fda6 Mon Sep 17 00:00:00 2001 From: Alf Birger Rustad Date: Tue, 23 Feb 2021 12:17:51 +0100 Subject: [PATCH 3/3] Messages sent to debug file --- opm/simulators/wells/MSWellHelpers.hpp | 6 +++++- opm/simulators/wells/MultisegmentWell_impl.hpp | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/opm/simulators/wells/MSWellHelpers.hpp b/opm/simulators/wells/MSWellHelpers.hpp index ec152b8e7..54e1ac780 100644 --- a/opm/simulators/wells/MSWellHelpers.hpp +++ b/opm/simulators/wells/MSWellHelpers.hpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #if HAVE_UMFPACK #include @@ -64,7 +66,9 @@ namespace mswellhelpers for (size_t i_block = 0; i_block < y.size(); ++i_block) { for (size_t i_elem = 0; i_elem < y[i_block].size(); ++i_elem) { if (std::isinf(y[i_block][i_elem]) || std::isnan(y[i_block][i_elem]) ) { - OPM_THROW_NOLOG(Opm::NumericalIssue, "nan or inf value found after UMFPack solve due to singular matrix"); + const std::string msg{"nan or inf value found after UMFPack solve due to singular matrix"}; + OpmLog::debug(msg); + OPM_THROW_NOLOG(Opm::NumericalIssue, msg); } } } diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 2b66184df..6ab4a158d 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -22,7 +22,9 @@ #include #include #include +#include +#include #include namespace Opm @@ -3185,10 +3187,13 @@ namespace Opm const EvalWell d = 1.0 - rs * rv; if (d <= 0.0 || d > 1.0) { - OPM_THROW_NOLOG(Opm::NumericalIssue, "Problematic d value " << d << " obtained for well " << name() - << " during convertion to surface volume with rs " << rs - << ", rv " << rv << " and pressure " << seg_pressure - << " obtaining d " << d); + std::ostringstream sstr; + sstr << "Problematic d value " << d << " obtained for well " << name() + << " during conversion to surface volume with rs " << rs + << ", rv " << rv << " and pressure " << seg_pressure + << " obtaining d " << d; + OpmLog::debug(sstr.str()); + OPM_THROW_NOLOG(Opm::NumericalIssue, sstr.str()); } if (rs > 0.0) { // rs > 0.0?