From 6e8b1e8d2e66a6ebcdb7cadb9f84b73ccc3116a8 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 1 Mar 2021 11:00:00 +0100 Subject: [PATCH] Honor gefac of topmost group in WellHelpers::updateGuideRateForGroups --- opm/simulators/wells/WellGroupHelpers.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/opm/simulators/wells/WellGroupHelpers.hpp b/opm/simulators/wells/WellGroupHelpers.hpp index db2a6a260..658119f1e 100644 --- a/opm/simulators/wells/WellGroupHelpers.hpp +++ b/opm/simulators/wells/WellGroupHelpers.hpp @@ -110,11 +110,11 @@ namespace WellGroupHelpers for (const std::string& groupName : group.groups()) { std::vector thisPot(np, 0.0); const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx); + + // Note that group effiency factors for groupTmp are applied in updateGuideRateForGroups updateGuideRateForGroups( groupTmp, schedule, pu, reportStepIdx, simTime, isInjector, wellState, comm, guideRate, thisPot); - const auto gefac = groupTmp.getGroupEfficiencyFactor(); - // accumulate group contribution from sub group unconditionally if (isInjector) { const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS}; @@ -129,7 +129,7 @@ namespace WellGroupHelpers else continue; - pot[phasePos] += gefac * thisPot[phasePos]; + pot[phasePos] += thisPot[phasePos]; } } else { const Group::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName); @@ -138,7 +138,7 @@ namespace WellGroupHelpers continue; } for (int phase = 0; phase < np; phase++) { - pot[phase] += gefac * thisPot[phase]; + pot[phase] += thisPot[phase]; } } } @@ -173,6 +173,13 @@ namespace WellGroupHelpers } } + // Apply group efficiency factor for this goup + auto gefac = group.getGroupEfficiencyFactor(); + + for (int phase = 0; phase < np; phase++) { + pot[phase] *= gefac; + } + double oilPot = 0.0; if (pu.phase_used[BlackoilPhases::Liquid]) oilPot = pot[pu.phase_pos[BlackoilPhases::Liquid]];