From c2368e53582ce6d8969da50320c95ba777521be0 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 1 Nov 2023 13:40:58 +0100 Subject: [PATCH] adding member to check whether WVFPDP active --- opm/input/eclipse/Schedule/Well/WVFPDP.hpp | 4 ++++ src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/opm/input/eclipse/Schedule/Well/WVFPDP.hpp b/opm/input/eclipse/Schedule/Well/WVFPDP.hpp index 5c988da2e..d723e9a83 100644 --- a/opm/input/eclipse/Schedule/Well/WVFPDP.hpp +++ b/opm/input/eclipse/Schedule/Well/WVFPDP.hpp @@ -41,6 +41,8 @@ namespace Opm { void update(const DeckRecord& record); void update(const RestartIO::RstWell& rst_well); + bool active() const; + bool operator==(const WVFPDP& other) const; bool operator!=(const WVFPDP& other) const; @@ -49,11 +51,13 @@ namespace Opm { { serializer(m_dp); serializer(m_fp); + serializer(m_active); } private: double m_dp{0.0}; double m_fp{1.0}; + bool m_active{false}; }; } // namespace Opm diff --git a/src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp b/src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp index cc09bdabb..f13a2b351 100644 --- a/src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp +++ b/src/opm/input/eclipse/Schedule/Well/WVFPDP.cpp @@ -33,23 +33,32 @@ namespace Opm { WVFPDP result; result.m_dp = 1.23; result.m_fp = 0.456; + result.m_active = false; return result; } bool WVFPDP::operator==(const WVFPDP& other) const { return (m_dp == other.m_dp) - && (m_fp == other.m_fp); + && (m_fp == other.m_fp) + && (m_active == other.m_active); } void WVFPDP::update(const DeckRecord& record) { m_dp = record.getItem().getSIDouble(0); m_fp = record.getItem().get(0); + this->m_active = true; } void WVFPDP::update(const RestartIO::RstWell& rst_well) { this->m_dp = rst_well.vfp_bhp_adjustment; this->m_fp = rst_well.vfp_bhp_scaling_factor; + // \Note: not totally sure we should do this + this->m_active = true; + } + + bool WVFPDP::active() const { + return this->m_active; } double WVFPDP::getPressureLoss(double bhp_tab, double thp_limit) const {