Merge pull request #2726 from bska/guiderate-efac-accum

Include All Pertinent EFACs In Guiderate Potential Updates
This commit is contained in:
Bård Skaflestad 2020-09-15 15:15:08 +02:00 committed by GitHub
commit fdb035894d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,8 @@ namespace WellGroupHelpers
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};
@ -124,7 +126,7 @@ namespace WellGroupHelpers
else else
continue; continue;
pot[phasePos] += thisPot[phasePos]; pot[phasePos] += gefac * thisPot[phasePos];
} }
} else { } else {
const Group::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName); const Group::ProductionCMode& currentGroupControl = wellState.currentProductionGroupControl(groupName);
@ -133,12 +135,13 @@ namespace WellGroupHelpers
continue; continue;
} }
for (int phase = 0; phase < np; phase++) { for (int phase = 0; phase < np; phase++) {
pot[phase] += thisPot[phase]; pot[phase] += gefac * thisPot[phase];
} }
} }
} }
for (const std::string& wellName : group.wells()) { for (const std::string& wellName : group.wells()) {
const auto& wellTmp = schedule.getWell(wellName, reportStepIdx); const auto& wellTmp = schedule.getWell(wellName, reportStepIdx);
const auto wefac = wellTmp.getEfficiencyFactor();
if (wellTmp.isProducer() && isInjector) if (wellTmp.isProducer() && isInjector)
continue; continue;
@ -157,7 +160,7 @@ namespace WellGroupHelpers
const auto wellrate_index = well_index * wellState.numPhases(); const auto wellrate_index = well_index * wellState.numPhases();
// add contribution from wells unconditionally // add contribution from wells unconditionally
for (int phase = 0; phase < np; phase++) { for (int phase = 0; phase < np; phase++) {
pot[phase] += wellState.wellPotentials()[wellrate_index + phase]; pot[phase] += wefac * wellState.wellPotentials()[wellrate_index + phase];
} }
} }
@ -173,11 +176,9 @@ namespace WellGroupHelpers
if (pu.phase_used[BlackoilPhases::Aqua]) if (pu.phase_used[BlackoilPhases::Aqua])
waterPot = pot[pu.phase_pos[BlackoilPhases::Aqua]]; waterPot = pot[pu.phase_pos[BlackoilPhases::Aqua]];
const double gefac = group.getGroupEfficiencyFactor(); oilPot = comm.sum(oilPot);
gasPot = comm.sum(gasPot);
oilPot = comm.sum(oilPot) * gefac; waterPot = comm.sum(waterPot);
gasPot = comm.sum(gasPot) * gefac;
waterPot = comm.sum(waterPot) * gefac;
if (isInjector) { if (isInjector) {
wellState.setCurrentGroupInjectionPotentials(group.name(), pot); wellState.setCurrentGroupInjectionPotentials(group.name(), pot);
@ -217,10 +218,9 @@ namespace WellGroupHelpers
if (pu.phase_used[BlackoilPhases::Aqua] > 0) if (pu.phase_used[BlackoilPhases::Aqua] > 0)
waterpot = wpot[pu.phase_pos[BlackoilPhases::Aqua]]; waterpot = wpot[pu.phase_pos[BlackoilPhases::Aqua]];
} }
const double wefac = well.getEfficiencyFactor(); oilpot = comm.sum(oilpot);
oilpot = comm.sum(oilpot) * wefac; gaspot = comm.sum(gaspot);
gaspot = comm.sum(gaspot) * wefac; waterpot = comm.sum(waterpot);
waterpot = comm.sum(waterpot) * wefac;
guideRate->compute(well.name(), reportStepIdx, simTime, oilpot, gaspot, waterpot); guideRate->compute(well.name(), reportStepIdx, simTime, oilpot, gaspot, waterpot);
} }
} }