mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 01:01:00 -06:00
changed: make has_foam contexpr
and use if constexpr to eliminate some code
This commit is contained in:
parent
73ccb42634
commit
f48ee17d59
@ -114,7 +114,7 @@ namespace Opm
|
||||
static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
|
||||
// flag for polymer molecular weight related
|
||||
static const bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>();
|
||||
static const bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>();
|
||||
static constexpr bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>();
|
||||
static const bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>();
|
||||
static const int contiSolventEqIdx = Indices::contiSolventEqIdx;
|
||||
static const int contiZfracEqIdx = Indices::contiZfracEqIdx;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user