mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 04:23:48 -06:00
Merge pull request #3645 from totto82/fixNoWellReduction
Adjust reduction rate when well control is considered for GRUP
This commit is contained in:
commit
f755cc3be1
@ -1182,18 +1182,50 @@ namespace WellGroupHelpers
|
|||||||
// Add my reduction back at the level where it is included in the local reduction
|
// Add my reduction back at the level where it is included in the local reduction
|
||||||
if (local_reduction_level == ii )
|
if (local_reduction_level == ii )
|
||||||
target += current_rate * efficiencyFactor;
|
target += current_rate * efficiencyFactor;
|
||||||
}
|
|
||||||
if (ii < num_ancestors - 1) {
|
for (size_t iii = ii + 1; iii < num_ancestors; ++iii) {
|
||||||
// Not final level. Add sub-level reduction back, if
|
// Not final level. Add sub-level reduction back, if
|
||||||
// it was nonzero due to having no group-controlled
|
// it was not under individual control and nonzero due to having no group-controlled
|
||||||
// wells. Note that we make this call without setting
|
// wells. We may need to look several levels down the hierarchy to find groups without
|
||||||
// the current well to be always included, because we
|
// group control wells
|
||||||
// want to know the situation that applied to the
|
const Group::ProductionCMode& subGroupControl = group_state.production_control(chain[iii]);
|
||||||
// calculation of reductions.
|
const bool individual_control = (subGroupControl != Group::ProductionCMode::FLD
|
||||||
const int num_gr_ctrl = groupControlledWells(schedule, wellState, group_state, reportStepIdx, chain[ii + 1], "", /*is_producer*/true, /*injectionPhaseNotUsed*/Phase::OIL);
|
&& subGroupControl != Group::ProductionCMode::NONE);
|
||||||
if (num_gr_ctrl == 0) {
|
// The sub group is on individual control. No adjustments needed.
|
||||||
if (guideRate->has(chain[ii + 1])) {
|
if (individual_control) {
|
||||||
target += localReduction(chain[ii + 1]);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note that we make this call without setting
|
||||||
|
// the current well to be always included, because we
|
||||||
|
// want to know the situation that applied to the
|
||||||
|
// calculation of reductions.
|
||||||
|
const int num_gr_ctrl = groupControlledWells(schedule,
|
||||||
|
wellState,
|
||||||
|
group_state,
|
||||||
|
reportStepIdx,
|
||||||
|
chain[iii],
|
||||||
|
"",
|
||||||
|
/*is_producer*/ true,
|
||||||
|
/*injectionPhaseNotUsed*/ Phase::OIL);
|
||||||
|
if (num_gr_ctrl == 0) {
|
||||||
|
// We found a sub wells with no group controlled wells. We now need to adapt the reduction rate
|
||||||
|
// to reflect what would have happen if the current well under consideration would have been
|
||||||
|
// under group control. I.e. we first remove the efficient sub_rate from the reduction rate
|
||||||
|
// (since the reduction rate is removed already from the target we need to add it to the target)
|
||||||
|
const double sub_efficiency
|
||||||
|
= schedule.getGroup(chain[iii], reportStepIdx).getGroupEfficiencyFactor();
|
||||||
|
const double sub_rate = tcalc.calcModeRateFromRates(group_state.production_rates(chain[iii]));
|
||||||
|
target += sub_efficiency * sub_rate;
|
||||||
|
// than we remove the local reduction from the target if it does not have a guide rate
|
||||||
|
if (!guideRate->has(chain[iii])) {
|
||||||
|
target -= sub_efficiency * localReduction(chain[iii]);
|
||||||
|
// this local reduction rate may also need adjustments since it may be computed based on the
|
||||||
|
// assumption that its subgroup dont have a group control wells. I.e we need to move down the
|
||||||
|
// hierarchy.
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1297,7 +1329,6 @@ namespace WellGroupHelpers
|
|||||||
local_reduction_level = ii;
|
local_reduction_level = ii;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double target = orig_target;
|
double target = orig_target;
|
||||||
for (size_t ii = 0; ii < num_ancestors; ++ii) {
|
for (size_t ii = 0; ii < num_ancestors; ++ii) {
|
||||||
if ((ii == 0) || guideRate->has(chain[ii], injectionPhase)) {
|
if ((ii == 0) || guideRate->has(chain[ii], injectionPhase)) {
|
||||||
@ -1309,18 +1340,51 @@ namespace WellGroupHelpers
|
|||||||
// Add my reduction back at the level where it is included in the local reduction
|
// Add my reduction back at the level where it is included in the local reduction
|
||||||
if (local_reduction_level == ii )
|
if (local_reduction_level == ii )
|
||||||
target += current_rate * efficiencyFactor;
|
target += current_rate * efficiencyFactor;
|
||||||
}
|
|
||||||
if (ii < num_ancestors - 1) {
|
for (size_t iii = ii + 1; iii < num_ancestors; ++iii) {
|
||||||
// Not final level. Add sub-level reduction back, if
|
// Not final level. Add sub-level reduction back, if
|
||||||
// it was nonzero due to having no group-controlled
|
// it was not under individual control and nonzero due to having no group-controlled
|
||||||
// wells. Note that we make this call without setting
|
// wells. We may need to look several levels down the hierarchy to find groups without
|
||||||
// the current well to be always included, because we
|
// group control wells
|
||||||
// want to know the situation that applied to the
|
const Group::InjectionCMode& subGroupControl = group_state.injection_control(chain[iii], injectionPhase);
|
||||||
// calculation of reductions.
|
const bool individual_control = (subGroupControl != Group::InjectionCMode::FLD
|
||||||
const int num_gr_ctrl = groupControlledWells(schedule, wellState, group_state, reportStepIdx, chain[ii + 1], "", /*is_producer*/false, injectionPhase);
|
&& subGroupControl != Group::InjectionCMode::NONE);
|
||||||
if (num_gr_ctrl == 0) {
|
// The sub group is on individual control. No adjustments needed.
|
||||||
if (guideRate->has(chain[ii + 1], injectionPhase)) {
|
if (individual_control) {
|
||||||
target += localReduction(chain[ii + 1]);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note that we make this call without setting
|
||||||
|
// the current well to be always included, because we
|
||||||
|
// want to know the situation that applied to the
|
||||||
|
// calculation of reductions.
|
||||||
|
const int num_gr_ctrl = groupControlledWells(schedule,
|
||||||
|
wellState,
|
||||||
|
group_state,
|
||||||
|
reportStepIdx,
|
||||||
|
chain[iii],
|
||||||
|
"",
|
||||||
|
/*is_producer*/ false,
|
||||||
|
injectionPhase);
|
||||||
|
if (num_gr_ctrl == 0) {
|
||||||
|
// We found a sub wells with no group controlled wells. We now need to adapt the reduction rate
|
||||||
|
// to reflect what would have happen if the well under consideration would have been
|
||||||
|
// under group control. I.e. we first remove the efficient sub_rate from the reduction rate
|
||||||
|
// (since the reduction rate is removed already from the target we need to add it to the target)
|
||||||
|
const double sub_efficiency
|
||||||
|
= schedule.getGroup(chain[iii], reportStepIdx).getGroupEfficiencyFactor();
|
||||||
|
const double sub_rate
|
||||||
|
= tcalc.calcModeRateFromRates(group_state.injection_surface_rates(chain[iii]));
|
||||||
|
target += sub_efficiency * sub_rate;
|
||||||
|
// than we remove the local reduction from the target if it does not have a guide rate
|
||||||
|
if (!guideRate->has(chain[iii], injectionPhase)) {
|
||||||
|
target -= sub_efficiency * localReduction(chain[iii]);
|
||||||
|
// this local reduction rate may also need adjustments since it may be computed based on the
|
||||||
|
// assumption that its subgroup dont have group control wells. I.e we need to move down the
|
||||||
|
// hierarchy.
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user