Merge pull request #3059 from alfbr/fix-error

Do not report confusing error
This commit is contained in:
Kai Bao 2021-02-23 14:21:59 +01:00 committed by GitHub
commit f00b4d9aa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -27,6 +27,8 @@
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <string>
#include <dune/istl/solvers.hh>
#if HAVE_UMFPACK
#include <dune/istl/umfpack.hh>
@ -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(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);
}
}
}
@ -156,7 +160,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;

View File

@ -22,7 +22,9 @@
#include <opm/simulators/wells/MSWellHelpers.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <string>
#include <algorithm>
namespace Opm
@ -3185,10 +3187,13 @@ 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()
<< " 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?