From 98220372ebb12b98af8d724daaa71a07ea8fabe7 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 20 Nov 2023 15:46:52 +0100 Subject: [PATCH] Add return of wdfac type --- opm/input/eclipse/Schedule/Well/WDFAC.hpp | 2 ++ src/opm/input/eclipse/Schedule/Well/WDFAC.cpp | 5 ++--- tests/parser/ScheduleTests.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/opm/input/eclipse/Schedule/Well/WDFAC.hpp b/opm/input/eclipse/Schedule/Well/WDFAC.hpp index 2719b9e2f..905dd6204 100644 --- a/opm/input/eclipse/Schedule/Well/WDFAC.hpp +++ b/opm/input/eclipse/Schedule/Well/WDFAC.hpp @@ -53,6 +53,8 @@ namespace Opm { bool useDFactor() const; bool useConnectionDFactor() const; + bool useWellDFactor() const; + WDFACTYPE getType() const; bool operator==(const WDFAC& other) const; bool operator!=(const WDFAC& other) const; diff --git a/src/opm/input/eclipse/Schedule/Well/WDFAC.cpp b/src/opm/input/eclipse/Schedule/Well/WDFAC.cpp index 04ad337e8..c8b325fab 100644 --- a/src/opm/input/eclipse/Schedule/Well/WDFAC.cpp +++ b/src/opm/input/eclipse/Schedule/Well/WDFAC.cpp @@ -109,10 +109,9 @@ namespace Opm { return m_type != WDFACTYPE::NONE; } - bool WDFAC::useConnectionDFactor() const { - return m_type == WDFACTYPE::CON_DFACTOR; + WDFACTYPE WDFAC::getType() const { + return m_type; } - bool WDFAC::operator!=(const WDFAC& other) const { return !(*this == other); } diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index 7063a1f9d..5283ed4fa 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -5780,9 +5780,9 @@ END double phi = 0.3; // WDFAC overwrites D factor in COMDAT - BOOST_CHECK(!wdfac11.useConnectionDFactor()); + BOOST_CHECK(wdfac11.getType() != WDFACTYPE::CON_DFACTOR); BOOST_CHECK(wdfac11.useDFactor()); - BOOST_CHECK(!wdfac21.useConnectionDFactor()); + BOOST_CHECK(wdfac21.getType() != WDFACTYPE::CON_DFACTOR); BOOST_CHECK_CLOSE(wdfac11.getDFactor(rho, mu, k, phi, rw, h), 1*Opm::unit::day, 1e-12); BOOST_CHECK_CLOSE(wdfac21.getDFactor(rho, mu, k, phi, rw, h), 2*Opm::unit::day, 1e-12); @@ -5800,9 +5800,9 @@ END const auto& well23 = sched.getWell("W2", 3); const auto& wdfac13 = well13.getWDFAC(); const auto& wdfac23 = well23.getWDFAC(); - BOOST_CHECK(wdfac13.useConnectionDFactor()); + BOOST_CHECK(wdfac13.getType() == WDFACTYPE::CON_DFACTOR); BOOST_CHECK(wdfac13.useDFactor()); - BOOST_CHECK(!wdfac23.useConnectionDFactor()); + BOOST_CHECK(wdfac23.getType() != WDFACTYPE::CON_DFACTOR); BOOST_CHECK_CLOSE(well13.getConnections()[0].dFactor(), 0*Opm::unit::day, 1e-12);