Throw an error if the status "well convergence" in iterateWellEqWithSwitching of MultisegmentWell is not the same across all processes

This commit is contained in:
Lisa Julia Nebel 2024-09-30 09:06:50 +02:00
parent dd895654d7
commit 8860c598fe

View File

@ -1701,6 +1701,9 @@ namespace Opm
const auto report = getWellConvergence(simulator, well_state, Base::B_avg_, deferred_logger, relax_convergence);
converged = report.converged();
if (this->parallel_well_info_.communication().size() > 1 && converged != this->parallel_well_info_.communication().min(converged)) {
OPM_THROW(std::runtime_error, fmt::format("Misalignment of the parallel simulation run in iterateWellEqWithSwitching - the well calculation succeeded on rank {} but failed on other ranks.", this->parallel_well_info_.communication().rank()));
}
if (converged) {
// if equations are sufficiently linear they might converge in less than min_its_after_switch
// in this case, make sure all constraints are satisfied before returning