From 529a181617a5fab66838d49ced0ade40e71cff33 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 28 Nov 2019 23:22:14 +0100 Subject: [PATCH] fixed: serialize thp to OPM_XWEL --- src/opm/output/eclipse/LoadRestart.cpp | 3 ++- src/opm/output/eclipse/RestartIO.cpp | 3 ++- tests/test_Restart.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/opm/output/eclipse/LoadRestart.cpp b/src/opm/output/eclipse/LoadRestart.cpp index d3e597ed4..61fcc239f 100644 --- a/src/opm/output/eclipse/LoadRestart.cpp +++ b/src/opm/output/eclipse/LoadRestart.cpp @@ -705,7 +705,7 @@ namespace { -> std::size_t { return acc - + 2 + phases.size() + + 3 + phases.size() + (w.getConnections().size() * (phases.size() + Opm::data::Connection::restart_size)); }); @@ -764,6 +764,7 @@ namespace { auto& well = wells[ sched_well.name() ]; well.bhp = *opm_xwel_data; ++opm_xwel_data; + well.thp = *opm_xwel_data; ++opm_xwel_data; well.temperature = *opm_xwel_data; ++opm_xwel_data; well.control = *opm_iwel_data; ++opm_iwel_data; diff --git a/src/opm/output/eclipse/RestartIO.cpp b/src/opm/output/eclipse/RestartIO.cpp index 5cd2a12a1..c3c95d2c4 100644 --- a/src/opm/output/eclipse/RestartIO.cpp +++ b/src/opm/output/eclipse/RestartIO.cpp @@ -124,7 +124,7 @@ namespace { { const auto elems = (sched_well.getConnections().size() * (phases.size() + data::Connection::restart_size)) - + 2 /* bhp, temperature */ + + 3 /* bhp, thp, temperature */ + phases.size(); // write zeros if no well data is provided @@ -135,6 +135,7 @@ namespace { const auto& well = wells.at( sched_well.name() ); xwel.push_back( well.bhp ); + xwel.push_back( well.thp ); xwel.push_back( well.temperature ); for (auto phase : phases) diff --git a/tests/test_Restart.cpp b/tests/test_Restart.cpp index 0b0927fea..337d50952 100644 --- a/tests/test_Restart.cpp +++ b/tests/test_Restart.cpp @@ -285,6 +285,7 @@ data::Wells mkWells() { data::Well w1, w2; w1.rates = r1; + w1.thp = 1.0; w1.bhp = 1.23; w1.temperature = 3.45; w1.control = 1; @@ -297,6 +298,7 @@ data::Wells mkWells() { w1.connections.push_back( { 288, rc2, 33.19, 123.4, 432.1, 0.26, 0.45, 2.56 } ); w2.rates = r2; + w2.thp = 2.0; w2.bhp = 2.34; w2.temperature = 4.56; w2.control = 2;