mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Include All Pertinent EFACs In Guiderate Potential Updates
This commit switches the helper function
WellGroupHelpers::updateGuideRateForGroups<>()
to include efficiency factors in the potential rates at grouptree
levels below a particular group. We furthermore switch the helper
function
WellGroupHelpers::updateGuideRatesForWells<>()
to not include efficiency factors at all.
The motivation for this change is that efficiency factors always
apply to the level we're accumulating rate values into rather than
to the rate values themselves.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user