Report Group Level Injection Guide Rates if Present

We used to tie reporting these quantities to whether or not a group
had any guide rates for production (GuideRate::has()), but this is
clearly insufficient for injection guide rates.
This commit is contained in:
Bård Skaflestad 2021-10-15 17:26:51 +02:00
parent 9b3cf66a31
commit 67f4cf62f1

View File

@ -1633,16 +1633,22 @@ assignGroupGuideRates(const Group& group,
auto& inj = gdata.guideRates.injection; inj .clear();
auto xgrPos = groupGuideRates.find(group.name());
if ((xgrPos == groupGuideRates.end()) ||
!this->guideRate_.has(group.name()))
{
if (xgrPos == groupGuideRates.end()) {
// No guiderates defined for this group.
return;
}
const auto& xgr = xgrPos->second;
prod = xgr.production;
inj = xgr.injection;
if (this->guideRate_.has(group.name())) {
prod = xgr.production;
}
if (this->guideRate_.has(group.name(), Phase::WATER) ||
this->guideRate_.has(group.name(), Phase::GAS))
{
inj = xgr.injection;
}
}
void