From 8860c598fe28fb60668be152af36e3f57a8c5c77 Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel Date: Mon, 30 Sep 2024 09:06:50 +0200 Subject: [PATCH] Throw an error if the status "well convergence" in iterateWellEqWithSwitching of MultisegmentWell is not the same across all processes --- opm/simulators/wells/MultisegmentWell_impl.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 450075af4..b9aa70abe 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -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