mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: make has_polymer contexpr
and use if constexpr to eliminate some code
This commit is contained in:
@@ -109,7 +109,7 @@ namespace Opm
|
||||
|
||||
static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
|
||||
static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
|
||||
static const bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
|
||||
static constexpr bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
|
||||
static const bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||
static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
|
||||
// flag for polymer molecular weight related
|
||||
|
||||
@@ -375,20 +375,20 @@ namespace Opm
|
||||
WellInterface<TypeTag>::
|
||||
wpolymer() const
|
||||
{
|
||||
if (!has_polymer) {
|
||||
return 0.0;
|
||||
if constexpr (has_polymer) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
|
||||
if (injectorType == InjectorType::WATER) {
|
||||
WellPolymerProperties polymer = well_ecl_.getPolymerProperties();
|
||||
const double polymer_injection_concentration = polymer.m_polymerConcentration;
|
||||
return polymer_injection_concentration;
|
||||
} else {
|
||||
// Not a water injection well => no polymer.
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
|
||||
if (injectorType == InjectorType::WATER) {
|
||||
WellPolymerProperties polymer = well_ecl_.getPolymerProperties();
|
||||
const double polymer_injection_concentration = polymer.m_polymerConcentration;
|
||||
return polymer_injection_concentration;
|
||||
} else {
|
||||
// Not a water injection well => no polymer.
|
||||
return 0.0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user