diff --git a/opm/simulators/utils/ParallelSerialization.cpp b/opm/simulators/utils/ParallelSerialization.cpp index dc9433682..2c89dc1db 100644 --- a/opm/simulators/utils/ParallelSerialization.cpp +++ b/opm/simulators/utils/ParallelSerialization.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include diff --git a/opm/simulators/wells/WellInterfaceGeneric.cpp b/opm/simulators/wells/WellInterfaceGeneric.cpp index 5ac1302e2..15b2d1732 100644 --- a/opm/simulators/wells/WellInterfaceGeneric.cpp +++ b/opm/simulators/wells/WellInterfaceGeneric.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -453,4 +454,17 @@ double WellInterfaceGeneric::wfoam_() const } } +double WellInterfaceGeneric::wsalt_() const +{ + auto injectorType = this->well_ecl_.injectorType(); + + if (injectorType == InjectorType::WATER) { + WellBrineProperties fprop = this->well_ecl_.getBrineProperties(); + return fprop.m_saltConcentration; + } else { + // Not a water injection well => no salt (?). + return 0.0; + } +} + } // namespace Opm diff --git a/opm/simulators/wells/WellInterfaceGeneric.hpp b/opm/simulators/wells/WellInterfaceGeneric.hpp index 8db620684..5b096bba3 100644 --- a/opm/simulators/wells/WellInterfaceGeneric.hpp +++ b/opm/simulators/wells/WellInterfaceGeneric.hpp @@ -199,6 +199,7 @@ protected: bool getAllowCrossFlow() const; double wfoam_() const; + double wsalt_() const; // definition of the struct OperabilityStatus struct OperabilityStatus { diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index faed0c53f..ccea224ea 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -135,15 +135,7 @@ namespace Opm wsalt() const { if constexpr (has_brine) { - auto injectorType = this->well_ecl_.injectorType(); - - if (injectorType == InjectorType::WATER) { - WellBrineProperties fprop = this->well_ecl_.getBrineProperties(); - return fprop.m_saltConcentration; - } else { - // Not a water injection well => no salt (?). - return 0.0; - } + return this->wsalt_(); } return 0.0; diff --git a/tests/test_ParallelSerialization.cpp b/tests/test_ParallelSerialization.cpp index 3d575f574..69b22b607 100644 --- a/tests/test_ParallelSerialization.cpp +++ b/tests/test_ParallelSerialization.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include