diff --git a/opm/input/eclipse/EclipseState/EclipseState.hpp b/opm/input/eclipse/EclipseState/EclipseState.hpp index c6c6d883e..df65e77a5 100644 --- a/opm/input/eclipse/EclipseState/EclipseState.hpp +++ b/opm/input/eclipse/EclipseState/EclipseState.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,7 @@ namespace Opm { namespace Opm { namespace RestartIO { class RstAquifer; + class RstNetwork; }} // namespace Opm::RestartIO namespace Opm { @@ -124,6 +126,9 @@ namespace Opm { // When we know and decide to handle the same for AQUFETP and AQUCT, this part will be refactored void appendAqufluxSchedule(const std::unordered_set& ids); + void loadRestartNetworkPressures(const RestartIO::RstNetwork& network); + const std::optional >& getRestartNetworkPressures() const { return this->m_restart_network_pressures; } + template void serializeOp(Serializer& serializer) { @@ -183,6 +188,8 @@ namespace Opm { std::string m_title{}; FaultCollection m_faults{}; + + std::optional > m_restart_network_pressures{std::nullopt}; }; } // namespace Opm diff --git a/opm/io/eclipse/rst/network.hpp b/opm/io/eclipse/rst/network.hpp index ef961bf2d..4ead39641 100644 --- a/opm/io/eclipse/rst/network.hpp +++ b/opm/io/eclipse/rst/network.hpp @@ -68,6 +68,9 @@ namespace Opm { namespace RestartIO { /// Whether or not to include lift gas of subordinate wells as /// part of the produced gas entering the network at this node. bool add_lift_gas{false}; + + /// Node pressure + double pressure{}; }; explicit RstNetwork(std::shared_ptr rstView, diff --git a/src/opm/input/eclipse/EclipseState/EclipseState.cpp b/src/opm/input/eclipse/EclipseState/EclipseState.cpp index ba277b04a..ac9e3a3a6 100644 --- a/src/opm/input/eclipse/EclipseState/EclipseState.cpp +++ b/src/opm/input/eclipse/EclipseState/EclipseState.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -315,6 +316,16 @@ namespace Opm { this->aquifer_config.appendAqufluxSchedule(ids); } + void EclipseState::loadRestartNetworkPressures(const RestartIO::RstNetwork& network) { + if (!network.isActive()) return; + + this->m_restart_network_pressures = std::map{}; + auto& node_pressures = this->m_restart_network_pressures.value(); + for (const auto& node : network.nodes()) { + node_pressures[node.name] = node.pressure; + } + } + void EclipseState::assignRunTitle(const Deck& deck) { if (! deck.hasKeyword()) { diff --git a/src/opm/io/eclipse/rst/network.cpp b/src/opm/io/eclipse/rst/network.cpp index 34faf807b..552ad02ba 100644 --- a/src/opm/io/eclipse/rst/network.cpp +++ b/src/opm/io/eclipse/rst/network.cpp @@ -193,6 +193,7 @@ namespace { usys.to_si(Opm::UnitSystem::measure::pressure, rnode[VI::RNode::index::PressureLimit]); } + node.pressure = rnode[VI::RNode::index::NodePres]; return node; }