diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index cf0697708..e0d8ebfd1 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -69,7 +69,7 @@ namespace Opm OPM_THROW(std::runtime_error, "polymer is not supported by multisegment well yet"); } - if (Base::has_energy) { + if constexpr (Base::has_energy) { OPM_THROW(std::runtime_error, "energy is not supported by multisegment well yet"); } diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index a9a034f1f..3cffefdf8 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -722,11 +722,11 @@ namespace Opm well_state.wellVaporizedOilRates()[index_of_well_] += perf_vap_oil_rate; } - if (has_energy) { + if constexpr (has_energy) { connectionRates[perf][contiEnergyEqIdx] = 0.0; } - if (has_energy) { + if constexpr (has_energy) { auto fs = intQuants.fluidState(); for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++phaseIdx) { diff --git a/opm/simulators/wells/WellInterface.hpp b/opm/simulators/wells/WellInterface.hpp index 605413d46..76f443ba4 100644 --- a/opm/simulators/wells/WellInterface.hpp +++ b/opm/simulators/wells/WellInterface.hpp @@ -108,7 +108,7 @@ namespace Opm static constexpr bool has_solvent = getPropValue(); static constexpr bool has_zFraction = getPropValue(); static constexpr bool has_polymer = getPropValue(); - static const bool has_energy = getPropValue(); + static constexpr bool has_energy = getPropValue(); static const bool has_temperature = getPropValue(); // flag for polymer molecular weight related static constexpr bool has_polymermw = getPropValue();