mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 18:21:00 -06:00
use if constexpr to eliminate some polymer code
This commit is contained in:
parent
1fa74b5889
commit
83595d84c3
@ -65,7 +65,7 @@ namespace Opm
|
|||||||
OPM_THROW(std::runtime_error, "solvent is not supported by multisegment well yet");
|
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");
|
OPM_THROW(std::runtime_error, "polymer is not supported by multisegment well yet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
// TODO: the application of well efficiency factor has not been tested with an example yet
|
||||||
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
||||||
EvalWell cq_s_poly = cq_s[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?
|
// 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);
|
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
|
// modify the water mobility if polymer is present
|
||||||
if (has_polymer) {
|
if constexpr (has_polymer) {
|
||||||
if (!FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
if (!FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||||
OPM_DEFLOG_THROW(std::runtime_error, "Water is required when polymer is active", deferred_logger);
|
OPM_DEFLOG_THROW(std::runtime_error, "Water is required when polymer is active", deferred_logger);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user