From 0d993ebd6abf876a8b89ee5a009c56baaa365cc6 Mon Sep 17 00:00:00 2001 From: David Landa Marban Date: Wed, 25 Oct 2023 19:45:49 +0200 Subject: [PATCH] Support for mechanical dispersion --- .../eclipse/EclipseState/Grid/FieldProps.hpp | 3 ++- .../EclipseState/SimulationConfig/RockConfig.hpp | 3 +++ .../EclipseState/SimulationConfig/RockConfig.cpp | 15 ++++++++++++++- .../eclipse/share/keywords/900_OPM/D/DISPERC | 10 ++++++++++ .../eclipse/share/keywords/keyword_list.cmake | 1 + .../material/fluidsystems/BlackOilFluidSystem.cpp | 3 +++ src/opm/output/eclipse/WriteInit.cpp | 1 + 7 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/opm/input/eclipse/share/keywords/900_OPM/D/DISPERC diff --git a/opm/input/eclipse/EclipseState/Grid/FieldProps.hpp b/opm/input/eclipse/EclipseState/Grid/FieldProps.hpp index e81f47018..f09739d39 100644 --- a/opm/input/eclipse/EclipseState/Grid/FieldProps.hpp +++ b/opm/input/eclipse/EclipseState/Grid/FieldProps.hpp @@ -130,7 +130,8 @@ namespace ALIAS { namespace GRID { -static const std::unordered_map> double_keywords = {{"MULTPV", keyword_info{}.init(1.0)}, +static const std::unordered_map> double_keywords = {{"DISPERC",keyword_info{}.unit_string("Length")}, + {"MULTPV", keyword_info{}.init(1.0)}, {"NTG", keyword_info{}.init(1.0)}, {"PORO", keyword_info{}.distribute_top(true)}, {"PERMX", keyword_info{}.unit_string("Permeability").distribute_top(true)}, diff --git a/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp b/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp index 51f4aeeeb..28f485d46 100644 --- a/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp +++ b/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp @@ -71,6 +71,7 @@ public: std::size_t num_rock_tables() const; Hysteresis hysteresis_mode() const; bool water_compaction() const; + bool dispersion() const; bool operator==(const RockConfig& other) const; @@ -83,6 +84,7 @@ public: serializer(num_tables); serializer(m_water_compaction); serializer(hyst_mode); + serializer(m_dispersion); } private: @@ -92,6 +94,7 @@ private: std::size_t num_tables = 0; bool m_water_compaction = false; Hysteresis hyst_mode = Hysteresis::REVERS; + bool m_dispersion = false; }; } //namespace Opm diff --git a/src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp b/src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp index 9a9e1b657..3df8318ab 100644 --- a/src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp +++ b/src/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.cpp @@ -24,6 +24,7 @@ #include +#include #include #include @@ -98,6 +99,7 @@ RockConfig::RockConfig(const Deck& deck, const FieldPropsManager& fp) using rock = ParserKeywords::ROCK; using rockopts = ParserKeywords::ROCKOPTS; using rockcomp = ParserKeywords::ROCKCOMP; + using disperc = ParserKeywords::DISPERC; if (deck.hasKeyword()) { for (const auto& table : RockTable { deck.get().back() }) { @@ -126,6 +128,10 @@ RockConfig::RockConfig(const Deck& deck, const FieldPropsManager& fp) this->m_active = false; } } + + if (deck.hasKeyword()) { + this->m_dispersion = true; + } } RockConfig RockConfig::serializationTestObject() @@ -137,6 +143,7 @@ RockConfig RockConfig::serializationTestObject() result.num_tables = 10; result.m_water_compaction = false; result.hyst_mode = Hysteresis::HYSTER; + result.m_dispersion = false; return result; } @@ -171,6 +178,11 @@ bool RockConfig::water_compaction() const return this->m_water_compaction; } +bool RockConfig::dispersion() const +{ + return this->m_dispersion; +} + bool RockConfig::operator==(const RockConfig& other) const { return (this->num_property == other.num_property) @@ -178,7 +190,8 @@ bool RockConfig::operator==(const RockConfig& other) const && (this->num_tables == other.num_tables) && (this->m_active == other.m_active) && (this->m_water_compaction == other.m_water_compaction) - && (this->hyst_mode == other.hyst_mode); + && (this->hyst_mode == other.hyst_mode) + && (this->m_dispersion == other.m_dispersion); } } //namespace Opm diff --git a/src/opm/input/eclipse/share/keywords/900_OPM/D/DISPERC b/src/opm/input/eclipse/share/keywords/900_OPM/D/DISPERC new file mode 100644 index 000000000..f78879797 --- /dev/null +++ b/src/opm/input/eclipse/share/keywords/900_OPM/D/DISPERC @@ -0,0 +1,10 @@ +{ + "name": "DISPERC", + "sections": [ + "GRID" + ], + "data": { + "value_type": "DOUBLE", + "dimension": "Length" + } + } \ 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 d4a3d1817..748aec48b 100644 --- a/src/opm/input/eclipse/share/keywords/keyword_list.cmake +++ b/src/opm/input/eclipse/share/keywords/keyword_list.cmake @@ -1109,6 +1109,7 @@ set( keywords 900_OPM/C/COMPTRAJ 900_OPM/C/CONNECTION_PROBE_OPM 900_OPM/D/DISGASW + 900_OPM/D/DISPERC 900_OPM/D/DRSDTCON 900_OPM/E/EXIT 900_OPM/G/GCOMPIDX diff --git a/src/opm/material/fluidsystems/BlackOilFluidSystem.cpp b/src/opm/material/fluidsystems/BlackOilFluidSystem.cpp index 3db5f4aed..f05b8a64d 100644 --- a/src/opm/material/fluidsystems/BlackOilFluidSystem.cpp +++ b/src/opm/material/fluidsystems/BlackOilFluidSystem.cpp @@ -332,6 +332,9 @@ soluteComponentIndex(unsigned phaseIdx) case oilPhaseIdx: return gasCompIdx; case gasPhaseIdx: + if (enableVaporizedWater()) { + return waterCompIdx; + } return oilCompIdx; default: diff --git a/src/opm/output/eclipse/WriteInit.cpp b/src/opm/output/eclipse/WriteInit.cpp index 5f9e802c1..5b42ab931 100644 --- a/src/opm/output/eclipse/WriteInit.cpp +++ b/src/opm/output/eclipse/WriteInit.cpp @@ -447,6 +447,7 @@ namespace { {"NTG" , ::Opm::UnitSystem::measure::identity}, // the rest in alphabetic order starting here {"BIOTCOEF" , ::Opm::UnitSystem::measure::identity}, + {"DISPERC" , ::Opm::UnitSystem::measure::length}, {"POELCOEF" , ::Opm::UnitSystem::measure::identity}, {"PRATIO" , ::Opm::UnitSystem::measure::identity}, {"THERMEXR" , ::Opm::UnitSystem::measure::identity}, // 1/(temperature difference)