mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
include wells under individual control when accumulating guiderates
This commit is contained in:
parent
70b7bed057
commit
97876530e3
@ -718,7 +718,7 @@ namespace WellGroupHelpers
|
||||
{
|
||||
const double my_guide_rate = guideRate(name, always_included_child);
|
||||
const Group& parent_group = schedule_.getGroup(parent(name), report_step_);
|
||||
const double total_guide_rate = guideRateSum(parent_group, always_included_child);
|
||||
const double total_guide_rate = guideRateSum(parent_group, always_included_child, false);
|
||||
assert(total_guide_rate >= my_guide_rate);
|
||||
const double guide_rate_epsilon = 1e-12;
|
||||
return (total_guide_rate > guide_rate_epsilon) ? my_guide_rate / total_guide_rate : 0.0;
|
||||
@ -731,20 +731,20 @@ namespace WellGroupHelpers
|
||||
return schedule_.getGroup(name, report_step_).parent();
|
||||
}
|
||||
}
|
||||
double FractionCalculator::guideRateSum(const Group& group, const std::string& always_included_child)
|
||||
double FractionCalculator::guideRateSum(const Group& group, const std::string& always_included_child, const bool include_all)
|
||||
{
|
||||
double total_guide_rate = 0.0;
|
||||
for (const std::string& child_group : group.groups()) {
|
||||
const auto ctrl = well_state_.currentProductionGroupControl(child_group);
|
||||
const bool included = (ctrl == Group::ProductionCMode::FLD) || (ctrl == Group::ProductionCMode::NONE)
|
||||
|| (child_group == always_included_child);
|
||||
if (included) {
|
||||
if (included || include_all) {
|
||||
total_guide_rate += guideRate(child_group, always_included_child);
|
||||
}
|
||||
}
|
||||
for (const std::string& child_well : group.wells()) {
|
||||
const bool included = (well_state_.isProductionGrup(child_well)) || (child_well == always_included_child);
|
||||
if (included) {
|
||||
if (included || include_all) {
|
||||
total_guide_rate += guideRate(child_well, always_included_child);
|
||||
}
|
||||
}
|
||||
@ -761,9 +761,8 @@ namespace WellGroupHelpers
|
||||
} else {
|
||||
// We are a group, with default guide rate.
|
||||
// Compute guide rate by accumulating our children's guide rates.
|
||||
// (only children not under individual control though).
|
||||
const Group& group = schedule_.getGroup(name, report_step_);
|
||||
return guideRateSum(group, always_included_child);
|
||||
return guideRateSum(group, always_included_child, true);
|
||||
}
|
||||
} else {
|
||||
// No group-controlled subordinate wells.
|
||||
|
@ -301,7 +301,7 @@ namespace WellGroupHelpers
|
||||
|
||||
private:
|
||||
std::string parent(const std::string& name);
|
||||
double guideRateSum(const Group& group, const std::string& always_included_child);
|
||||
double guideRateSum(const Group& group, const std::string& always_included_child, const bool include_all);
|
||||
double guideRate(const std::string& name, const std::string& always_included_child);
|
||||
int groupControlledWells(const std::string& group_name, const std::string& always_included_child);
|
||||
GuideRate::RateVector getGroupRateVector(const std::string& group_name);
|
||||
|
Loading…
Reference in New Issue
Block a user