WPI Summary Output: Address Review Comments

Add an explicit case for 'OIL' and throw an exception if the
"preferred" phase is not supported.
This commit is contained in:
Bård Skaflestad 2020-11-25 22:17:52 +01:00
parent a14c4184a9
commit 0422f38d23

View File

@ -1007,6 +1007,10 @@ inline quantity connection_productivity_index(const fn_args& args) {
return zero;
switch (args.schedule_wells.front().getPreferredPhase()) {
case Opm::Phase::OIL:
return { completion->rates.get(rt::productivity_index_oil, 0.0),
rate_unit<rt::productivity_index_oil>() };
case Opm::Phase::GAS:
return { completion->rates.get(rt::productivity_index_gas, 0.0),
rate_unit<rt::productivity_index_gas>() };
@ -1014,11 +1018,12 @@ inline quantity connection_productivity_index(const fn_args& args) {
case Opm::Phase::WATER:
return { completion->rates.get(rt::productivity_index_water, 0.0),
rate_unit<rt::productivity_index_water>() };
default:
return { completion->rates.get(rt::productivity_index_oil, 0.0),
rate_unit<rt::productivity_index_oil>() };
}
throw std::invalid_argument {
"Unsupported \"preferred\" phase: " +
std::to_string(static_cast<int>(args.schedule_wells.front().getPreferredPhase()))
};
}
template < bool isGroup, bool Producer, bool waterInjector, bool gasInjector>