Merge pull request #4609 from akva2/fix_wtest_for_newly_created_well

WellGroupHelpers: make sure we have a GuideRate value or potential for well
This commit is contained in:
Markus Blatt 2023-04-27 09:17:14 +02:00 committed by GitHub
commit 5a2b25ec31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -923,7 +923,11 @@ namespace WellGroupHelpers
const PhaseUsage& pu)
{
if (schedule.hasWell(name, reportStepIdx)) {
return guideRate->get(name, target, getWellRateVector(wellState, pu, name));
if (guideRate->has(name) || guideRate->hasPotentials(name)) {
return guideRate->get(name, target, getWellRateVector(wellState, pu, name));
} else {
return 0.0;
}
}
if (guideRate->has(name)) {
@ -955,7 +959,9 @@ namespace WellGroupHelpers
if (!wellState.isProductionGrup(wellName))
continue;
totalGuideRate += guideRate->get(wellName, target, getWellRateVector(wellState, pu, wellName));
totalGuideRate += getGuideRate(wellName, schedule, wellState, group_state,
reportStepIdx, guideRate, target, pu);
}
return totalGuideRate;
}
@ -972,7 +978,8 @@ namespace WellGroupHelpers
const PhaseUsage& pu)
{
if (schedule.hasWell(name, reportStepIdx)) {
return guideRate->get(name, target, getWellRateVector(wellState, pu, name));
return getGuideRate(name, schedule, wellState, group_state,
reportStepIdx, guideRate, target, pu);
}
if (guideRate->has(name, injectionPhase)) {
@ -1142,7 +1149,8 @@ namespace WellGroupHelpers
double FractionCalculator::guideRate(const std::string& name, const std::string& always_included_child)
{
if (schedule_.hasWell(name, report_step_)) {
return guide_rate_->get(name, target_, getWellRateVector(well_state_, pu_, name));
return getGuideRate(name, schedule_, well_state_, group_state_,
report_step_, guide_rate_, target_, pu_);
} else {
if (groupControlledWells(name, always_included_child) > 0) {
if (is_producer_ && guide_rate_->has(name)) {