use if constexpr to eliminate some foam code

This commit is contained in:
Arne Morten Kvarving 2021-05-14 21:38:47 +02:00
parent 6157122bd8
commit 1fa74b5889
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ namespace Opm
OPM_THROW(std::runtime_error, "energy is not supported by multisegment well yet");
}
if (Base::has_foam) {
if constexpr (Base::has_foam) {
OPM_THROW(std::runtime_error, "foam is not supported by multisegment well yet");
}

View File

@ -793,7 +793,7 @@ namespace Opm
}
}
if (has_foam) {
if constexpr (has_foam) {
// TODO: the application of well efficiency factor has not been tested with an example yet
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
EvalWell cq_s_foam = cq_s[gasCompIdx] * well_efficiency_factor_;