From bfd1d3187ad34c6302b3f0cec4ae2afa1a800cc3 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 13 Jul 2022 13:40:16 +0200 Subject: [PATCH] [bugfix] Fix well transmissibility weights for distributed wells. If we compute a sum over all perforations than we need to cater for the case of distributed wells. That is we need to also sum up over all processes involved after performing the local sum. One of these global sums was missing in computeWellConnectionDensitesPressures for producers when we compute the weights based on well transmissibilities. --- opm/simulators/wells/StandardWell_impl.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index c717c92ad..0cd4ee999 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -1474,6 +1474,11 @@ namespace Opm for (int perf = 0; perf < nperf; ++perf) { total_tw += this->well_index_[perf]; } + const auto& comm = this->parallel_well_info_.communication(); + if (comm.size() > 1) + { + total_tw = comm.sum(total_tw); + } for (int perf = 0; perf < nperf; ++perf) { const int cell_idx = this->well_cells_[perf]; const auto& intQuants = *(ebosSimulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/0));