From a0f85c8a937b6e1627f4db3577d43e63f18f62e2 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 10 Jan 2023 12:37:34 +0100 Subject: [PATCH 1/2] add missing WellFoamProperties.hpp includes --- opm/simulators/utils/ParallelSerialization.cpp | 1 + opm/simulators/wells/WellInterface_impl.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/opm/simulators/utils/ParallelSerialization.cpp b/opm/simulators/utils/ParallelSerialization.cpp index 3e8a42b3c..dc9433682 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/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 90a344c3f..c3dbcb2f6 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include From a29d5f81b675e72b492c967b4823e179b03e80f7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 12 Jan 2023 15:15:42 +0100 Subject: [PATCH 2/2] WellInterface: move code using WellFoamProperties to compile unit --- opm/simulators/wells/WellInterfaceGeneric.cpp | 14 ++++++++++++++ opm/simulators/wells/WellInterfaceGeneric.hpp | 2 ++ opm/simulators/wells/WellInterface_impl.hpp | 11 +---------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/opm/simulators/wells/WellInterfaceGeneric.cpp b/opm/simulators/wells/WellInterfaceGeneric.cpp index c34dc4533..5ac1302e2 100644 --- a/opm/simulators/wells/WellInterfaceGeneric.cpp +++ b/opm/simulators/wells/WellInterfaceGeneric.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -439,4 +440,17 @@ bool WellInterfaceGeneric::isPressureControlled(const WellState& well_state) con } } +double WellInterfaceGeneric::wfoam_() const +{ + auto injectorType = this->well_ecl_.injectorType(); + + if (injectorType == InjectorType::GAS) { + WellFoamProperties fprop = this->well_ecl_.getFoamProperties(); + return fprop.m_foamConcentration; + } else { + // Not a gas injection well => no foam. + return 0.0; + } +} + } // namespace Opm diff --git a/opm/simulators/wells/WellInterfaceGeneric.hpp b/opm/simulators/wells/WellInterfaceGeneric.hpp index b67b12875..8db620684 100644 --- a/opm/simulators/wells/WellInterfaceGeneric.hpp +++ b/opm/simulators/wells/WellInterfaceGeneric.hpp @@ -198,6 +198,8 @@ public: protected: bool getAllowCrossFlow() const; + double wfoam_() const; + // definition of the struct OperabilityStatus struct OperabilityStatus { bool isOperableAndSolvable() const { diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index c3dbcb2f6..faed0c53f 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -122,15 +121,7 @@ namespace Opm wfoam() const { if constexpr (has_foam) { - auto injectorType = this->well_ecl_.injectorType(); - - if (injectorType == InjectorType::GAS) { - WellFoamProperties fprop = this->well_ecl_.getFoamProperties(); - return fprop.m_foamConcentration; - } else { - // Not a gas injection well => no foam. - return 0.0; - } + return this->wfoam_(); } return 0.0;