From c7713c41f5e163c40ea0f3aad991faa468fe154f Mon Sep 17 00:00:00 2001 From: Svenn Tveit Date: Fri, 4 Mar 2022 15:45:44 +0100 Subject: [PATCH] Added H2STORE keyword. Activates H2-Brine PVT models in opm-material. --- opm/input/eclipse/EclipseState/Runspec.hpp | 3 + .../input/eclipse/EclipseState/Runspec.cpp | 17 +++++ .../share/keywords/001_Eclipse300/H/H2STORE | 6 ++ .../eclipse/share/keywords/keyword_list.cmake | 1 + tests/parser/RunspecTests.cpp | 71 ++++++------------- 5 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 src/opm/input/eclipse/share/keywords/001_Eclipse300/H/H2STORE diff --git a/opm/input/eclipse/EclipseState/Runspec.hpp b/opm/input/eclipse/EclipseState/Runspec.hpp index c8ac14a78..6c8ffb7a1 100644 --- a/opm/input/eclipse/EclipseState/Runspec.hpp +++ b/opm/input/eclipse/EclipseState/Runspec.hpp @@ -455,6 +455,7 @@ public: const Nupcol& nupcol() const noexcept; const Tracers& tracers() const; bool co2Storage() const noexcept; + bool h2Storage() const noexcept; bool micp() const noexcept; bool operator==(const Runspec& data) const; @@ -478,6 +479,7 @@ public: serializer(m_sfuncctrl); serializer(m_nupcol); serializer(m_co2storage); + serializer(m_h2storage); serializer(m_micp); } @@ -498,6 +500,7 @@ private: Nupcol m_nupcol; Tracers m_tracers; bool m_co2storage; + bool m_h2storage; bool m_micp; }; diff --git a/src/opm/input/eclipse/EclipseState/Runspec.cpp b/src/opm/input/eclipse/EclipseState/Runspec.cpp index 5204e5cb5..a8cc3ff68 100644 --- a/src/opm/input/eclipse/EclipseState/Runspec.cpp +++ b/src/opm/input/eclipse/EclipseState/Runspec.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -578,6 +579,7 @@ Runspec::Runspec( const Deck& deck ) , m_nupcol( ) , m_tracers( deck ) , m_co2storage (false) + , m_h2storage (false) , m_micp (false) { if (DeckSection::hasRUNSPEC(deck)) { @@ -612,6 +614,13 @@ Runspec::Runspec( const Deck& deck ) } + if (runspecSection.hasKeyword()) { + m_h2storage = true; + std::string msg = "The H2 storage option is given. PVT properties from the Brine-H2 system is used \n" + "See the OPM manual for details on the used models."; + OpmLog::note(msg); + } + if (runspecSection.hasKeyword()) { m_micp = true; std::string msg = "The MICP option is given. Single phase (WATER) + 3 transported components + \n" @@ -638,6 +647,7 @@ Runspec Runspec::serializationTestObject() result.m_sfuncctrl = SatFuncControls::serializationTestObject(); result.m_nupcol = Nupcol::serializationTestObject(); result.m_co2storage = true; + result.m_h2storage = true; result.m_micp = true; return result; @@ -703,6 +713,11 @@ bool Runspec::co2Storage() const noexcept return this->m_co2storage; } +bool Runspec::h2Storage() const noexcept +{ + return this->m_h2storage; +} + bool Runspec::micp() const noexcept { return this->m_micp; @@ -745,6 +760,7 @@ bool Runspec::rst_cmp(const Runspec& full_spec, const Runspec& rst_spec) { full_spec.saturationFunctionControls() == rst_spec.saturationFunctionControls() && full_spec.m_nupcol == rst_spec.m_nupcol && full_spec.m_co2storage == rst_spec.m_co2storage && + full_spec.m_h2storage == rst_spec.m_h2storage && full_spec.m_micp == rst_spec.m_micp && Welldims::rst_cmp(full_spec.wellDimensions(), rst_spec.wellDimensions()); } @@ -762,6 +778,7 @@ bool Runspec::operator==(const Runspec& data) const { this->saturationFunctionControls() == data.saturationFunctionControls() && this->m_nupcol == data.m_nupcol && this->m_co2storage == data.m_co2storage && + this->m_h2storage == data.m_h2storage && this->m_micp == data.m_micp; } diff --git a/src/opm/input/eclipse/share/keywords/001_Eclipse300/H/H2STORE b/src/opm/input/eclipse/share/keywords/001_Eclipse300/H/H2STORE new file mode 100644 index 000000000..b4c226060 --- /dev/null +++ b/src/opm/input/eclipse/share/keywords/001_Eclipse300/H/H2STORE @@ -0,0 +1,6 @@ +{ + "name": "H2STORE", + "sections": [ + "RUNSPEC" + ] +} \ No newline at end of file diff --git a/src/opm/input/eclipse/share/keywords/keyword_list.cmake b/src/opm/input/eclipse/share/keywords/keyword_list.cmake index b129b171b..8508cc5f5 100644 --- a/src/opm/input/eclipse/share/keywords/keyword_list.cmake +++ b/src/opm/input/eclipse/share/keywords/keyword_list.cmake @@ -1062,6 +1062,7 @@ set( keywords 001_Eclipse300/G/GASWAT 001_Eclipse300/G/GCONPROD 001_Eclipse300/G/GSF + 001_Eclipse300/H/H2STORE 001_Eclipse300/H/HEATCR 001_Eclipse300/H/HEATCRT 001_Eclipse300/H/HWELLS diff --git a/tests/parser/RunspecTests.cpp b/tests/parser/RunspecTests.cpp index 2b7c151f5..19583bb08 100644 --- a/tests/parser/RunspecTests.cpp +++ b/tests/parser/RunspecTests.cpp @@ -434,55 +434,6 @@ WELLDIMS BOOST_CHECK_EQUAL(wd.maxGroupsInField(), 0); // WELLDIMS(3), defaulted } -BOOST_AUTO_TEST_CASE(WELLDIMS_MaxWList_Dflt) -{ - const auto input = std::string { R"( -RUNSPEC - -WELLDIMS -/ -)" }; - - const auto wd = Welldims { - Parser{}.parseString(input) - }; - - BOOST_CHECK_EQUAL(wd.maxWellListsPrWell(), 1); // WELLDIMS(11), defaulted -} - -BOOST_AUTO_TEST_CASE(WELLDIMS_MaxWList_Assigned) -{ - const auto input = std::string { R"( -RUNSPEC - -WELLDIMS -10* 5 / -)" }; - - const auto wd = Welldims { - Parser{}.parseString(input) - }; - - BOOST_CHECK_EQUAL(wd.maxWellListsPrWell(), 5); // WELLDIMS(11), assigned -} - -BOOST_AUTO_TEST_CASE(WELLDIMS_MaxWList_Zero) -{ - const auto input = std::string { R"( -RUNSPEC - -WELLDIMS -10* 0 / -)" }; - - const auto wd = Welldims { - Parser{}.parseString(input) - }; - - // WELLDIMS(11) assigned but reset to at least 1. - BOOST_CHECK_EQUAL(wd.maxWellListsPrWell(), 1); -} - BOOST_AUTO_TEST_CASE(WSEGDIMS_NotSpecified) { const auto input = std::string { @@ -1049,6 +1000,28 @@ BOOST_AUTO_TEST_CASE(Co2Storage_watergas) { BOOST_CHECK( runspec.co2Storage() ); +} + +BOOST_AUTO_TEST_CASE(H2Storage) { + const std::string input = R"( + RUNSPEC + OIL + GAS + H2STORE + )"; + + Parser parser; + + auto deck = parser.parseString(input); + + Runspec runspec( deck ); + const auto& phases = runspec.phases(); + BOOST_CHECK_EQUAL( 2U, phases.size() ); + BOOST_CHECK( phases.active( Phase::OIL ) ); + BOOST_CHECK( phases.active( Phase::GAS ) ); + BOOST_CHECK( runspec.h2Storage() ); + + } BOOST_AUTO_TEST_CASE(Co2Storage_oilwater) {