mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 01:01:00 -06:00
changed: make has_solvent and has_zFraction constexpr
and use if constexpr to eliminate some code
This commit is contained in:
parent
dc8bbc9e5a
commit
a78c7e598d
@ -107,8 +107,8 @@ namespace Opm
|
||||
typedef Dune::BlockVector<VectorBlockType> BVector;
|
||||
typedef DenseAd::Evaluation<double, /*size=*/numEq> Eval;
|
||||
|
||||
static const bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
|
||||
static const bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
|
||||
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 const bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||
static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
|
||||
|
@ -97,10 +97,12 @@ namespace Opm
|
||||
|
||||
wsolvent_ = 0.0;
|
||||
|
||||
if ((has_solvent || has_zFraction) && well.isInjector()) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
if (injectorType == InjectorType::GAS) {
|
||||
wsolvent_ = well_ecl_.getSolventFraction();
|
||||
if constexpr (has_solvent || has_zFraction) {
|
||||
if (well.isInjector()) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
if (injectorType == InjectorType::GAS) {
|
||||
wsolvent_ = well_ecl_.getSolventFraction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user