Merge pull request #6630 from GitPaean/small_code_adjustment

Small code adjustment when reading the code
This commit is contained in:
Kai Bao authored and GitHub committed 2025-12-03 11:57:11 +01:00
commit 688e44dbd7
1 file changed
+10 -12
+10 -12
View File
@@ -144,7 +144,7 @@ GroupStateHelper<Scalar, IndexTraits>::checkGroupConstraintsInj(const std::strin
this->report_step_,
&this->guide_rate_,
tcalc.guideTargetMode(),
/*is_production_group=*/false,
/*is_producer=*/false,
injection_phase};
auto local_fraction_lambda = [&](const std::string& child) { return fcalc.localFraction(child, name); };
@@ -317,7 +317,7 @@ GroupStateHelper<Scalar, IndexTraits>::checkGroupConstraintsProd(const std::stri
this->report_step_,
&this->guide_rate_,
tcalc.guideTargetMode(),
/*is_production_group=*/true,
/*is_producer=*/true,
/*injection_phase=*/Phase::OIL};
auto local_fraction_lambda = [&](const std::string& child) { return fcalc.localFraction(child, name); };
@@ -385,8 +385,8 @@ GroupStateHelper<Scalar, IndexTraits>::checkGroupConstraintsProd(const std::stri
for (std::size_t ii = 1; ii < num_ancestors; ++ii) {
const int num_gr_ctrl = this->groupControlledWells(chain[ii],
/*always_included_child=*/"",
/*is_producer=*/true,
/*injection_phase_not_used=*/Phase::OIL);
/*is_production_group=*/true,
/*injection_phase=*/Phase::OIL/*not used*/);
if (this->guide_rate_.has(chain[ii]) && num_gr_ctrl > 0) {
local_reduction_level = ii;
}
@@ -707,7 +707,7 @@ GroupStateHelper<Scalar, IndexTraits>::getWellGroupTargetInjector(const std::str
this->report_step_,
&this->guide_rate_,
tcalc.guideTargetMode(),
/*is_production_group=*/false,
/*is_producer=*/false,
injection_phase};
auto local_fraction_lambda = [&](const std::string& child, const std::string& always_incluced_name) {
@@ -1724,12 +1724,10 @@ GroupStateHelper<Scalar, IndexTraits>::updateGroupControlledWellsRecursive_(
bool included = false;
if (is_production_group) {
const auto ctrl = this->groupState().production_control(child_group);
included
= included || (ctrl == Group::ProductionCMode::FLD) || (ctrl == Group::ProductionCMode::NONE);
included = (ctrl == Group::ProductionCMode::FLD || ctrl == Group::ProductionCMode::NONE);
} else {
const auto ctrl = this->groupState().injection_control(child_group, injection_phase);
included
= included || (ctrl == Group::InjectionCMode::FLD) || (ctrl == Group::InjectionCMode::NONE);
included = (ctrl == Group::InjectionCMode::FLD || ctrl == Group::InjectionCMode::NONE);
}
if (included) {
@@ -1744,14 +1742,14 @@ GroupStateHelper<Scalar, IndexTraits>::updateGroupControlledWellsRecursive_(
bool included = false;
const Well& well = this->schedule_.getWell(child_well, this->report_step_);
if (is_production_group && well.isProducer()) {
included = included || this->wellState().isProductionGrup(child_well) || group.as_choke();
included = (this->wellState().isProductionGrup(child_well) || group.as_choke());
} else if (!is_production_group && !well.isProducer()) {
const auto& well_controls = well.injectionControls(this->summary_state_);
auto injectorType = well_controls.injector_type;
if ((injection_phase == Phase::WATER && injectorType == InjectorType::WATER)
|| (injection_phase == Phase::OIL && injectorType == InjectorType::OIL)
|| (injection_phase == Phase::GAS && injectorType == InjectorType::GAS)) {
included = included || this->wellState().isInjectionGrup(child_well);
included = this->wellState().isInjectionGrup(child_well);
}
}
const auto ctrl1 = this->groupState().production_control(group.name());
@@ -1877,7 +1875,7 @@ GroupStateHelper<Scalar, IndexTraits>::updateGroupTargetReductionRecursive_(
= this->groupControlledWells(sub_group.name(),
/*always_included_child=*/"",
!is_injector,
/*injection_phase_not_used=*/Phase::OIL);
/*injection_phase=*/Phase::OIL);
if (individual_control || num_group_controlled_wells == 0) {
for (int phase = 0; phase < np; phase++) {
group_target_reduction[phase]