From e94c1aa386a34bc88bdf23cf76c56f4ff4eba8e4 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 26 Jun 2023 11:58:06 +0200 Subject: [PATCH] WIP in supporting the keyword WINJDAM --- opm/input/eclipse/Schedule/Schedule.hpp | 1 + opm/input/eclipse/Schedule/Well/Connection.hpp | 13 +++++++++++++ opm/input/eclipse/Schedule/Well/Well.hpp | 2 ++ .../input/eclipse/Schedule/KeywordHandlers.cpp | 15 +++++++++++++++ .../input/eclipse/Schedule/Well/Connection.cpp | 13 +++++++++++++ src/opm/input/eclipse/Schedule/Well/Well.cpp | 5 +++++ 6 files changed, 49 insertions(+) diff --git a/opm/input/eclipse/Schedule/Schedule.hpp b/opm/input/eclipse/Schedule/Schedule.hpp index d8b42275f..2a2689b25 100644 --- a/opm/input/eclipse/Schedule/Schedule.hpp +++ b/opm/input/eclipse/Schedule/Schedule.hpp @@ -746,6 +746,7 @@ namespace Opm void handleWVFPEXP (HandlerContext&); void handleWWPAVE (HandlerContext&); void handleWPIMULT (HandlerContext&); + void handleWINJDAM (HandlerContext&); void handleWINJMULT (HandlerContext&); void handleWPMITAB (HandlerContext&); void handleWPOLYMER (HandlerContext&); diff --git a/opm/input/eclipse/Schedule/Well/Connection.hpp b/opm/input/eclipse/Schedule/Well/Connection.hpp index e607b0e30..6a0387242 100644 --- a/opm/input/eclipse/Schedule/Well/Connection.hpp +++ b/opm/input/eclipse/Schedule/Well/Connection.hpp @@ -79,6 +79,19 @@ namespace RestartIO { Defaulted, }; + + // TODO: the following related to filter cake modeling should probably go to its own files + enum class FilterCakeGeometry { + LINEAR, + RADIAL, + NONE, + }; + + static FilterCakeGeometry filterCakeGeometryFromString(const std::string& str); + + // TODO: the end of the filter cake model + + Connection(); Connection(int i, int j , int k , std::size_t global_index, diff --git a/opm/input/eclipse/Schedule/Well/Well.hpp b/opm/input/eclipse/Schedule/Well/Well.hpp index 1bc1b9556..dbfd8ec81 100644 --- a/opm/input/eclipse/Schedule/Well/Well.hpp +++ b/opm/input/eclipse/Schedule/Well/Well.hpp @@ -481,6 +481,8 @@ public: bool handleWELOPENConnections(const DeckRecord& record, Connection::State status); bool handleCOMPLUMP(const DeckRecord& record); bool handleWPIMULT(const DeckRecord& record); + // TODO: not sure need to return bool + bool handleWINJDAM(const DeckRecord& record); bool handleWINJMULT(const DeckRecord& record, const KeywordLocation& location); bool applyGlobalWPIMULT(double scale_factor); diff --git a/src/opm/input/eclipse/Schedule/KeywordHandlers.cpp b/src/opm/input/eclipse/Schedule/KeywordHandlers.cpp index 0670f7579..0f0234244 100644 --- a/src/opm/input/eclipse/Schedule/KeywordHandlers.cpp +++ b/src/opm/input/eclipse/Schedule/KeywordHandlers.cpp @@ -1969,6 +1969,20 @@ Well{0} entered with 'FIELD' parent group: } } + void Schedule::handleWINJDAM(HandlerContext& handlerContext) { + for (const auto& record : handlerContext.keyword) { + const std::string& wellNamePattern = record.getItem("WELL_NAME").getTrimmedString(0); + const auto well_names = wellNames(wellNamePattern); + + for (const auto& well_name : well_names) { + auto well = this->snapshots.back().wells(well_name); + if (well.handleWINJDAM(record)) { + this->snapshots.back().wells.update( std::move(well) ); + } + } + } + } + void Schedule::handleWPMITAB(HandlerContext& handlerContext) { for (const auto& record : handlerContext.keyword) { const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0); @@ -2550,6 +2564,7 @@ Well{0} entered with 'FIELD' parent group: { "WVFPEXP" , &Schedule::handleWVFPEXP }, { "WWPAVE" , &Schedule::handleWWPAVE }, { "WPIMULT" , &Schedule::handleWPIMULT }, + { "WINJDAM" , &Schedule::handleWINJDAM }, { "WPMITAB" , &Schedule::handleWPMITAB }, { "WPOLYMER", &Schedule::handleWPOLYMER }, { "WRFT" , &Schedule::handleWRFT }, diff --git a/src/opm/input/eclipse/Schedule/Well/Connection.cpp b/src/opm/input/eclipse/Schedule/Well/Connection.cpp index da5b0de80..44ea0dce9 100644 --- a/src/opm/input/eclipse/Schedule/Well/Connection.cpp +++ b/src/opm/input/eclipse/Schedule/Well/Connection.cpp @@ -460,5 +460,18 @@ bool Connection::activeInjMult() const { void Connection::setInjMult(const InjMult& inj_mult) { m_injmult = inj_mult; } +Connection::FilterCakeGeometry +Connection::filterCakeGeometryFromString(const std::string& str) +{ + if (str == "LINEAR") + return Connection::FilterCakeGeometry::LINEAR; + else if (str == "RADIAL") + return Connection::FilterCakeGeometry::RADIAL; + else if (str == "NONE") + return Connection::FilterCakeGeometry::NONE; + else + throw std::invalid_argument("Unknow enum INJMultMode string: " + str); + +} } diff --git a/src/opm/input/eclipse/Schedule/Well/Well.cpp b/src/opm/input/eclipse/Schedule/Well/Well.cpp index 044161548..f2577ba5c 100644 --- a/src/opm/input/eclipse/Schedule/Well/Well.cpp +++ b/src/opm/input/eclipse/Schedule/Well/Well.cpp @@ -1303,6 +1303,11 @@ bool Well::handleWPIMULT(const DeckRecord& record) { return this->updateConnections(std::move(new_connections), false); } +bool Well::handleWINJDAM(const Opm::DeckRecord& record) +{ + return false; +} + bool Well::handleWINJMULT(const Opm::DeckRecord& record, const KeywordLocation& location) { // for this keyword, the default for I, J, K will be negative