use if constexpr to eliminate some polymer code

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

View File

@ -65,7 +65,7 @@ namespace Opm
OPM_THROW(std::runtime_error, "solvent is not supported by multisegment well yet");
}
if (has_polymer) {
if constexpr (has_polymer) {
OPM_THROW(std::runtime_error, "polymer is not supported by multisegment well yet");
}

View File

@ -773,7 +773,7 @@ namespace Opm
}
}
if (has_polymer) {
if constexpr (has_polymer) {
// 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_poly = cq_s[waterCompIdx];
@ -957,13 +957,13 @@ namespace Opm
}
// this may not work if viscosity and relperms has been modified?
if (has_solvent) {
if constexpr (has_solvent) {
OPM_DEFLOG_THROW(std::runtime_error, "individual mobility for wells does not work in combination with solvent", deferred_logger);
}
}
// modify the water mobility if polymer is present
if (has_polymer) {
if constexpr (has_polymer) {
if (!FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
OPM_DEFLOG_THROW(std::runtime_error, "Water is required when polymer is active", deferred_logger);
}