changed: make has_foam contexpr

and use if constexpr to eliminate some code
This commit is contained in:
Arne Morten Kvarving
2021-05-11 12:28:10 +02:00
parent 73ccb42634
commit f48ee17d59
2 changed files with 12 additions and 12 deletions

View File

@@ -400,19 +400,19 @@ namespace Opm
WellInterface<TypeTag>::
wfoam() const
{
if (!has_foam) {
return 0.0;
if constexpr (has_foam) {
auto injectorType = well_ecl_.injectorType();
if (injectorType == InjectorType::GAS) {
WellFoamProperties fprop = well_ecl_.getFoamProperties();
return fprop.m_foamConcentration;
} else {
// Not a gas injection well => no foam.
return 0.0;
}
}
auto injectorType = well_ecl_.injectorType();
if (injectorType == InjectorType::GAS) {
WellFoamProperties fprop = well_ecl_.getFoamProperties();
return fprop.m_foamConcentration;
} else {
// Not a gas injection well => no foam.
return 0.0;
}
return 0.0;
}