Merge pull request #2053 from joakim-hove/fglir

Summary function glir should sum over all argument wells
This commit is contained in:
Bård Skaflestad 2020-10-26 15:57:02 +01:00 committed by GitHub
commit e38b8f5812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,21 +470,21 @@ double efac( const std::vector<std::pair<std::string,double>>& eff_factors, cons
return (it != eff_factors.end()) ? it->second : 1;
}
/*
This is bit dangerous, exactly how the ALQ value should be interpreted varies
between the different VFP tables. The code here assumes - without checking -
that it represents gas lift rate.
*/
inline quantity glir( const fn_args& args ) {
const quantity zero = { 0.0, measure::gas_surface_rate };
double alq_rate = 0;
if (args.schedule_wells.empty())
return zero;
for (const auto& well : args.schedule_wells) {
auto xwPos = args.wells.find(well.name());
if (xwPos != args.wells.end())
alq_rate += xwPos->second.rates.get(rt::alq, 0.0);
}
const auto& well = args.schedule_wells.front();
auto xwPos = args.wells.find(well.name());
if (xwPos == args.wells.end())
return zero;
// This is bit dangerous, exactly how the ALQ value should be interpreted
// varies between the different VFP tables. The code here assumes - without
// checking - that it represents gas lift rate.
return { xwPos->second.rates.get(rt::alq, 0.0), measure::gas_surface_rate };
return { alq_rate, measure::gas_surface_rate };
}
template< rt phase, bool injection = true >