Merge pull request #3313 from totto82/fix_ginj_reduction

fix reduction rate for injection groups
This commit is contained in:
Bård Skaflestad
2021-05-29 17:17:27 +02:00
committed by GitHub

View File

@@ -323,26 +323,33 @@ namespace WellGroupHelpers
// accumulate group contribution from sub group // accumulate group contribution from sub group
if (isInjector) { if (isInjector) {
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS}; const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
bool individual_control = false;
int num_group_controlled_wells = 0;
for (Phase phase : all) { for (Phase phase : all) {
const Group::InjectionCMode& currentGroupControl const Group::InjectionCMode& currentGroupControl
= group_state.injection_control(subGroup.name(), phase); = group_state.injection_control(subGroup.name(), phase);
int phasePos; individual_control = individual_control || (currentGroupControl != Group::InjectionCMode::FLD
if (phase == Phase::GAS && pu.phase_used[BlackoilPhases::Vapour]) && currentGroupControl != Group::InjectionCMode::NONE);
phasePos = pu.phase_pos[BlackoilPhases::Vapour]; num_group_controlled_wells
else if (phase == Phase::OIL && pu.phase_used[BlackoilPhases::Liquid]) += groupControlledWells(schedule, wellStateNupcol, group_state, reportStepIdx, subGroupName, "", !isInjector, phase);
phasePos = pu.phase_pos[BlackoilPhases::Liquid]; }
else if (phase == Phase::WATER && pu.phase_used[BlackoilPhases::Aqua]) if (individual_control || num_group_controlled_wells == 0) {
phasePos = pu.phase_pos[BlackoilPhases::Aqua]; for (int phase = 0; phase < np; phase++) {
else groupTargetReduction[phase]
continue; += sumWellRates(subGroup, schedule, wellStateNupcol, reportStepIdx, phase, isInjector);
}
} else {
// The subgroup may participate in group control.
bool has_guide_rate = false;
for (Phase phase : all) {
has_guide_rate = has_guide_rate || guide_rate.has(subGroupName, phase);
}
if (currentGroupControl != Group::InjectionCMode::FLD if (!has_guide_rate) {
&& currentGroupControl != Group::InjectionCMode::NONE) { // Accumulate from this subgroup only if no group guide rate is set for it.
// Subgroup is under individual control. for (int phase = 0; phase < np; phase++) {
groupTargetReduction[phasePos] groupTargetReduction[phase] += subGroupTargetReduction[phase];
+= sumWellRates(subGroup, schedule, wellStateNupcol, reportStepIdx, phasePos, isInjector); }
} else {
groupTargetReduction[phasePos] += subGroupTargetReduction[phasePos];
} }
} }
} else { } else {