Honor gefac of topmost group in WellHelpers::updateGuideRateForGroups

This commit is contained in:
Markus Blatt 2021-03-01 11:00:00 +01:00
parent 1d9f13e310
commit 6e8b1e8d2e

View File

@ -110,11 +110,11 @@ namespace WellGroupHelpers
for (const std::string& groupName : group.groups()) {
std::vector<double> 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]];