Merge pull request #5036 from blattms/comm-sigular-mat-exception

Communicate exceptions during WellModel::updateAndCommunicate
This commit is contained in:
Markus Blatt 2023-12-06 09:54:00 +01:00 committed by GitHub
commit abd387abba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View File

@ -2150,10 +2150,16 @@ namespace Opm {
DeferredLogger& deferred_logger)
{
updateAndCommunicateGroupData(reportStepIdx, iterationIdx);
// updateWellStateWithTarget might throw for multisegment wells hence we
// have a parallel try catch here to thrown on all processes.
OPM_BEGIN_PARALLEL_TRY_CATCH()
// if a well or group change control it affects all wells that are under the same group
for (const auto& well : well_container_) {
well->updateWellStateWithTarget(ebosSimulator_, this->groupState(), this->wellState(), deferred_logger);
}
OPM_END_PARALLEL_TRY_CATCH("BlackoilWellModel::updateAndCommunicate failed: ",
ebosSimulator_.gridView().comm())
updateAndCommunicateGroupData(reportStepIdx, iterationIdx);
}

View File

@ -501,9 +501,19 @@ namespace Opm
// We assemble the well equations, then we check the convergence,
// which is why we do not put the assembleWellEq here.
const BVectorWell dx_well = this->linSys_.solve();
try{
const BVectorWell dx_well = this->linSys_.solve();
updateWellState(summary_state, dx_well, well_state, deferred_logger);
updateWellState(summary_state, dx_well, well_state, deferred_logger);
}
catch(const NumericalProblem& exp) {
// Add information about the well and log to deferred logger
// (Logging done inside of solve() method will only be seen if
// this is the process with rank zero)
deferred_logger.problem("In MultisegmentWell::solveEqAndUpdateWellState for well "
+ this->name() +": "+exp.what());
throw;
}
}
@ -1306,7 +1316,18 @@ namespace Opm
assembleWellEqWithoutIteration(ebosSimulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger);
const BVectorWell dx_well = this->linSys_.solve();
BVectorWell dx_well;
try{
dx_well = this->linSys_.solve();
}
catch(const NumericalProblem& exp) {
// Add information about the well and log to deferred logger
// (Logging done inside of solve() method will only be seen if
// this is the process with rank zero)
deferred_logger.problem("In MultisegmentWell::iterateWellEqWithControl for well "
+ this->name() +": "+exp.what());
throw;
}
if (it > this->param_.strict_inner_iter_wells_) {
relax_convergence = true;