use if constexpr to eliminate some brine code

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

View File

@ -77,7 +77,7 @@ namespace Opm
OPM_THROW(std::runtime_error, "foam is not supported by multisegment well yet");
}
if (Base::has_brine) {
if constexpr (Base::has_brine) {
OPM_THROW(std::runtime_error, "brine is not supported by multisegment well yet");
}
// since we decide to use the WellSegments from the well parser. we can reuse a lot from it.

View File

@ -831,7 +831,7 @@ namespace Opm
connectionRates[perf][contiZfracEqIdx] = Base::restrictEval(cq_s_zfrac_effective);
}
if (has_brine) {
if constexpr (has_brine) {
// TODO: the application of well efficiency factor has not been tested with an example yet
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
EvalWell cq_s_sm = cq_s[waterCompIdx];