mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 07:07:42 -05:00
Throw if bhp is NaN in findTHP
This commit is contained in:
1 parent
ca92b6906c
commit
8153c2d095
2 files changed
+18
-3
No files matched your search
@@ -262,9 +262,20 @@ namespace Opm
|
||||
return;
|
||||
}
|
||||
|
||||
BVectorWell xw(1);
|
||||
this->linSys_.recoverSolutionWell(x, xw);
|
||||
updateWellState(simulator, xw, well_state, deferred_logger);
|
||||
try {
|
||||
BVectorWell xw(1);
|
||||
this->linSys_.recoverSolutionWell(x, xw);
|
||||
|
||||
updateWellState(simulator, xw, well_state, deferred_logger);
|
||||
}
|
||||
catch (const NumericalProblem& exp) {
|
||||
// Add information about the well and log to deferred logger
|
||||
// (Logging done inside of recoverSolutionWell() (i.e. by UMFpack) will only be seen if
|
||||
// this is the process with rank zero)
|
||||
deferred_logger.problem("In MultisegmentWell::recoverWellSolutionAndUpdateWellState for well "
|
||||
+ this->name() +": "+exp.what());
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <opm/simulators/wells/VFPHelpers.hpp>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/densead/Evaluation.hpp>
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
@@ -368,6 +369,9 @@ findTHP(const std::vector<Scalar>& bhp_array,
|
||||
{
|
||||
int nthp = thp_array.size();
|
||||
|
||||
if (std::isnan(bhp)) {
|
||||
throw NumericalProblem("findTHP: Error bhp is nan");
|
||||
}
|
||||
Scalar thp = -1e100;
|
||||
|
||||
//Check that our thp axis is sorted
|
||||
|
||||
Reference in new issue
Block a user