diff --git a/opm/models/blackoil/blackoilmodel.hh b/opm/models/blackoil/blackoilmodel.hh index 1c7ebd258..d7994ce3f 100644 --- a/opm/models/blackoil/blackoilmodel.hh +++ b/opm/models/blackoil/blackoilmodel.hh @@ -287,8 +287,8 @@ class BlackOilModel enum { numEq = getPropValue() }; enum { enableDiffusion = getPropValue() }; - static const bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0; - static const bool waterEnabled = Indices::waterEnabled; + static constexpr bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0; + static constexpr bool waterEnabled = Indices::waterEnabled; using SolventModule = BlackOilSolventModule; using ExtboModule = BlackOilExtboModule; @@ -320,7 +320,7 @@ public: VtkBlackOilModule::registerParameters(); VtkCompositionModule::registerParameters(); - if (enableDiffusion) + if constexpr (enableDiffusion) VtkDiffusionModule::registerParameters(); } @@ -443,7 +443,7 @@ public: // we do not care much about water, so it gets de-prioritized by a factor of 100 static constexpr Scalar waterPriority = 1e-2; - if (getPropValue()) { + if constexpr (getPropValue()) { // Roughly convert the surface volume of the fluids from m^3 to kg. (in this // context, it does not really matter if the actual densities are off by a // factor of two or three.) @@ -610,7 +610,7 @@ protected: this->addOutputModule(new VtkBlackOilModule(this->simulator_)); this->addOutputModule(new VtkCompositionModule(this->simulator_)); - if (enableDiffusion) + if constexpr (enableDiffusion) this->addOutputModule(new VtkDiffusionModule(this->simulator_)); }