From f33737afc4fe8b88a5879d6c413bb7f7280969af Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 4 May 2020 09:16:42 +0200 Subject: [PATCH] Fix solvent reinjection when different reinjection group is given --- opm/simulators/wells/BlackoilWellModel_impl.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index bb56ca838..d9d169d92 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -2312,8 +2312,11 @@ namespace Opm { const Group::InjectionCMode& currentGroupControl = wellState.currentInjectionGroupControl(Phase::GAS, group.name()); if( currentGroupControl == Group::InjectionCMode::REIN ) { int gasPos = phase_usage_.phase_pos[BlackoilPhases::Vapour]; - double gasProductionRate = WellGroupHelpers::sumWellRates(group, schedule, wellState, reportStepIdx, gasPos, /*isInjector*/false); - double solventProductionRate = WellGroupHelpers::sumSolventRates(group, schedule, wellState, reportStepIdx, /*isInjector*/false); + const auto& summaryState = ebosSimulator_.vanguard().summaryState(); + const auto& controls = group.injectionControls(Phase::GAS, summaryState); + const Group& groupRein = schedule.getGroup(controls.reinj_group, reportStepIdx); + double gasProductionRate = WellGroupHelpers::sumWellRates(groupRein, schedule, wellState, reportStepIdx, gasPos, /*isInjector*/false); + double solventProductionRate = WellGroupHelpers::sumSolventRates(groupRein, schedule, wellState, reportStepIdx, /*isInjector*/false); const auto& comm = ebosSimulator_.vanguard().grid().comm(); solventProductionRate = comm.sum(solventProductionRate);