Honor gefac of topmost group in WellHelpers::updateGuideRateForGroups

This commit is contained in:
Markus Blatt
2021-03-01 11:16:29 +01:00
parent 1d9f13e310
commit 6e8b1e8d2e
+11 -4
View File
@@ -110,11 +110,11 @@ namespace WellGroupHelpers
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
std::vector<double> thisPot(np, 0.0); std::vector<double> thisPot(np, 0.0);
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx); const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
// Note that group effiency factors for groupTmp are applied in updateGuideRateForGroups
updateGuideRateForGroups( updateGuideRateForGroups(
groupTmp, schedule, pu, reportStepIdx, simTime, isInjector, wellState, comm, guideRate, thisPot); groupTmp, schedule, pu, reportStepIdx, simTime, isInjector, wellState, comm, guideRate, thisPot);
const auto gefac = groupTmp.getGroupEfficiencyFactor();
// accumulate group contribution from sub group unconditionally // accumulate group contribution from sub group unconditionally
if (isInjector) { if (isInjector) {
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS}; const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
@@ -129,7 +129,7 @@ namespace WellGroupHelpers
else else
continue; continue;
pot[phasePos] += gefac * thisPot[phasePos]; pot[phasePos] += thisPot[phasePos];
} }
} else { } else {
const Group::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName); const Group::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName);
@@ -138,7 +138,7 @@ namespace WellGroupHelpers
continue; continue;
} }
for (int phase = 0; phase < np; phase++) { 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; double oilPot = 0.0;
if (pu.phase_used[BlackoilPhases::Liquid]) if (pu.phase_used[BlackoilPhases::Liquid])
oilPot = pot[pu.phase_pos[BlackoilPhases::Liquid]]; oilPot = pot[pu.phase_pos[BlackoilPhases::Liquid]];