From a86bd1c5856302ef052a3e828b31e01de74338e4 Mon Sep 17 00:00:00 2001 From: hnil Date: Tue, 1 Nov 2022 21:39:55 +0100 Subject: [PATCH 1/3] removed assert in cprw for strictly positive diagonal well coupling --- opm/simulators/wells/MultisegmentWell_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index ac69f0ff9..76ce35d7c 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -815,7 +815,11 @@ namespace Opm } } - assert(diag_ell > 0.0); + if(not(diag_ell > 0.0)){ + std::cout << "Diagonal element for cprw on " + << this->name() + << " is " << diag_ell << std::endl; + } jacobian[welldof_ind][welldof_ind] = diag_ell; }else{ jacobian[welldof_ind][welldof_ind] = 1.0; // maybe we could have used diag_ell if calculated From 85bfa13c467ec074cf8811f7a33a00ea0e7ddeda Mon Sep 17 00:00:00 2001 From: hnil Date: Fri, 4 Nov 2022 16:26:12 +0100 Subject: [PATCH 2/3] change std:cout to OPM::debug --- opm/simulators/wells/MultisegmentWell_impl.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 76ce35d7c..3ee2c0d65 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -816,9 +816,11 @@ namespace Opm } if(not(diag_ell > 0.0)){ - std::cout << "Diagonal element for cprw on " + std::stringstream msg; + msg << "Diagonal element for cprw on " << this->name() - << " is " << diag_ell << std::endl; + << " is " << diag_ell; + OpmLog::debug(msg.str()); } jacobian[welldof_ind][welldof_ind] = diag_ell; }else{ From 9c76c96f21a7f9e8d22acd056d2f3d0ebc2e3144 Mon Sep 17 00:00:00 2001 From: hnil Date: Mon, 14 Nov 2022 11:36:48 +0100 Subject: [PATCH 3/3] moved debug code into #if section --- opm/simulators/wells/MultisegmentWell_impl.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 3ee2c0d65..0b528a2b1 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -814,14 +814,18 @@ namespace Opm diag_ell -= matel; } } - + +#define EXTRA_DEBUG_MSW 0 +#if EXTRA_DEBUG_MSW if(not(diag_ell > 0.0)){ std::stringstream msg; msg << "Diagonal element for cprw on " << this->name() << " is " << diag_ell; - OpmLog::debug(msg.str()); + OpmLog::warning(msg.str()); } +#endif +#undef EXTRA_DEBUG_MSW jacobian[welldof_ind][welldof_ind] = diag_ell; }else{ jacobian[welldof_ind][welldof_ind] = 1.0; // maybe we could have used diag_ell if calculated @@ -1586,6 +1590,7 @@ namespace Opm sstr << " " << measure_history[i] << " \n"; } #endif +#undef EXTRA_DEBUG_MSW deferred_logger.debug(sstr.str()); }