From 034dab84f98474c77dc155fb5f8f673979a9fda6 Mon Sep 17 00:00:00 2001 From: Alf Birger Rustad Date: Tue, 23 Feb 2021 12:17:51 +0100 Subject: [PATCH] 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?