mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3313 from totto82/fix_ginj_reduction
fix reduction rate for injection groups
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
if (currentGroupControl != Group::InjectionCMode::FLD
|
|
||||||
&& currentGroupControl != Group::InjectionCMode::NONE) {
|
|
||||||
// Subgroup is under individual control.
|
|
||||||
groupTargetReduction[phasePos]
|
|
||||||
+= sumWellRates(subGroup, schedule, wellStateNupcol, reportStepIdx, phasePos, isInjector);
|
|
||||||
} else {
|
} else {
|
||||||
groupTargetReduction[phasePos] += subGroupTargetReduction[phasePos];
|
// 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 (!has_guide_rate) {
|
||||||
|
// Accumulate from this subgroup only if no group guide rate is set for it.
|
||||||
|
for (int phase = 0; phase < np; phase++) {
|
||||||
|
groupTargetReduction[phase] += subGroupTargetReduction[phase];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user