From abf92eed52d44ef092c466823c5d87ac15b3c88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 10 Jan 2022 13:27:12 +0100 Subject: [PATCH] Accumulate Dissolved Gas and Vaporized Oil Flow Rates Across Ranks This is needed to get consistent estimates for the summary vectors * {F,G,W}OP{R,T}{F,S} -- Free/Vaporized Oil Production * {F,G,W}GP{R,T}{F,S} -- Free/Dissolved Gas Production in the case of distributed wells. Thanks to [at]blattms for the suggested fix. --- opm/simulators/wells/StandardWell_impl.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 24094f95e..d32eda972 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -467,6 +467,14 @@ namespace Opm // Update the connection this->connectionRates_ = connectionRates; + // Accumulate dissolved gas and vaporized oil flow rates across all + // ranks sharing this well (this->index_of_well_). + { + const auto& comm = this->parallel_well_info_.communication(); + ws.dissolved_gas_rate = comm.sum(ws.dissolved_gas_rate); + ws.vaporized_oil_rate = comm.sum(ws.vaporized_oil_rate); + } + // accumulate resWell_ and invDuneD_ in parallel to get effects of all perforations (might be distributed) wellhelpers::sumDistributedWellEntries(this->invDuneD_[0][0], this->resWell_[0], this->parallel_well_info_.communication());