From 6ea0e73512c23de3db427ddd4dee7843e35a0c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Sat, 19 Sep 2020 00:09:16 +0200 Subject: [PATCH] Prepare for Creating Network-Level Summary Output This commit adds a level of indirection to the existing group-level data (active controls and guiderates), and adds a new 'NodeData' level to the 'data::' protocol for transporting values from the simulator to the output layer. Update all call sites and users accordingly. --- msim/include/opm/msim/msim.hpp | 10 +- msim/src/msim.cpp | 28 ++--- opm/output/data/Groups.hpp | 80 +++++++++++--- opm/output/eclipse/RestartValue.hpp | 6 +- opm/output/eclipse/Summary.hpp | 22 ++-- src/opm/output/eclipse/LoadRestart.cpp | 4 +- src/opm/output/eclipse/RestartValue.cpp | 7 +- src/opm/output/eclipse/Summary.cpp | 86 +++++++-------- tests/test_EclipseIO.cpp | 4 +- tests/test_RFT.cpp | 10 +- tests/test_Restart.cpp | 2 +- tests/test_Summary.cpp | 136 ++++++++++++------------ tests/test_Summary_Group.cpp | 22 ++-- tests/test_restartwellinfo.cpp | 4 +- 14 files changed, 237 insertions(+), 184 deletions(-) diff --git a/msim/include/opm/msim/msim.hpp b/msim/include/opm/msim/msim.hpp index 52c1dfd46..4ac23e7af 100644 --- a/msim/include/opm/msim/msim.hpp +++ b/msim/include/opm/msim/msim.hpp @@ -44,13 +44,13 @@ public: void well_rate(const std::string& well, data::Rates::opt rate, std::function func); void solution(const std::string& field, std::function func); void run(Schedule& schedule, EclipseIO& io, bool report_only); - void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step); + void post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step); private: - void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step, EclipseIO& io) const; - void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step, double dt, EclipseIO& io) const; - void output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupValues& group_data, EclipseIO& io) const; - void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step, double seconds_elapsed, double time_step) const; + void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io) const; + void run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const; + void output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io) const; + void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step) const; EclipseState state; std::map>> well_rates; diff --git a/msim/src/msim.cpp b/msim/src/msim.cpp index d9b546717..e8752f040 100644 --- a/msim/src/msim.cpp +++ b/msim/src/msim.cpp @@ -54,14 +54,14 @@ void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) { io.writeInitial(); for (size_t report_step = 1; report_step < schedule.size(); report_step++) { data::Wells well_data; - data::GroupValues group_data; + data::GroupAndNetworkValues group_nwrk_data; if (report_only) - run_step(schedule, action_state, st, udq_state, sol, well_data, group_data, report_step, io); + run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, io); else { double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1)); - run_step(schedule, action_state, st, udq_state, sol, well_data, group_data, report_step, time_step, io); + run_step(schedule, action_state, st, udq_state, sol, well_data, group_nwrk_data, report_step, time_step, io); } - post_step(schedule, action_state, st, sol, well_data, group_data, report_step); + post_step(schedule, action_state, st, sol, well_data, group_nwrk_data, report_step); const auto& exit_status = schedule.exitStatus(); if (exit_status.has_value()) return; @@ -73,7 +73,7 @@ UDAValue msim::uda_val() { } -void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupValues& /* group_data */, size_t report_step) { +void msim::post_step(Schedule& schedule, Action::State& action_state, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, data::GroupAndNetworkValues& /* grp_nwrk_data */, size_t report_step) { const auto& actions = schedule.actions(report_step); if (actions.empty()) return; @@ -93,12 +93,12 @@ void msim::post_step(Schedule& schedule, Action::State& action_state, SummarySta -void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step, EclipseIO& io) const { - this->run_step(schedule, action_state, st, udq_state, sol, well_data, group_data, report_step, schedule.stepLength(report_step - 1), io); +void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& grp_nwrk_data, size_t report_step, EclipseIO& io) const { + this->run_step(schedule, action_state, st, udq_state, sol, well_data, grp_nwrk_data, report_step, schedule.stepLength(report_step - 1), io); } -void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupValues& group_data, size_t report_step, double dt, EclipseIO& io) const { +void msim::run_step(const Schedule& schedule, Action::State& action_state, SummaryState& st, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io) const { double start_time = schedule.seconds(report_step - 1); double end_time = schedule.seconds(report_step); double seconds_elapsed = start_time; @@ -108,7 +108,7 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa if ((seconds_elapsed + time_step) > end_time) time_step = end_time - seconds_elapsed; - this->simulate(schedule, st, sol, well_data, group_data, report_step, seconds_elapsed, time_step); + this->simulate(schedule, st, sol, well_data, group_nwrk_data, report_step, seconds_elapsed, time_step); seconds_elapsed += time_step; @@ -118,7 +118,7 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa this->state, schedule, well_data, - group_data, + group_nwrk_data, {}); schedule.getUDQConfig( report_step ).eval(report_step, st, udq_state); @@ -131,15 +131,15 @@ void msim::run_step(const Schedule& schedule, Action::State& action_state, Summa seconds_elapsed, sol, well_data, - group_data, + group_nwrk_data, io); } } -void msim::output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupValues& group_data, EclipseIO& io) const { - RestartValue value(sol, well_data, group_data); +void msim::output(Action::State& action_state, SummaryState& st, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) const { + RestartValue value(sol, well_data, group_nwrk_data); io.writeTimeStep(action_state, st, udq_state, @@ -150,7 +150,7 @@ void msim::output(Action::State& action_state, SummaryState& st, const UDQState& } -void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupValues& /* group_data */, size_t report_step, double seconds_elapsed, double time_step) const { +void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& /* group_nwrk_data */, size_t report_step, double seconds_elapsed, double time_step) const { for (const auto& sol_pair : this->solutions) { auto func = sol_pair.second; func(this->state, schedule, sol, report_step, seconds_elapsed + time_step); diff --git a/opm/output/data/Groups.hpp b/opm/output/data/Groups.hpp index 633b322a2..930d7784f 100644 --- a/opm/output/data/Groups.hpp +++ b/opm/output/data/Groups.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -105,34 +106,87 @@ namespace Opm { namespace data { } }; - class GroupValues : public std::map { - public: + struct NodeData { + double pressure { 0.0 }; + template void write(MessageBufferType& buffer) const { - unsigned int size = this->size(); - buffer.write(size); - - for (const auto& [gname, gdata] : *this) { - buffer.write(gname); - gdata .write(buffer); - } + buffer.write(this->pressure); } template void read(MessageBufferType& buffer) + { + buffer.read(this->pressure); + } + + bool operator==(const NodeData& other) const + { + return this->pressure == other.pressure; + } + }; + + class GroupAndNetworkValues { + public: + std::map groupData {}; + std::map nodeData {}; + + template + void write(MessageBufferType& buffer) const + { + this->writeMap(this->groupData, buffer); + this->writeMap(this->nodeData, buffer); + } + + template + void read(MessageBufferType& buffer) + { + this->readMap(buffer, this->groupData); + this->readMap(buffer, this->nodeData); + } + + bool operator==(const GroupAndNetworkValues& other) const + { + return (this->groupData == other.groupData) + && (this->nodeData == other.nodeData); + } + + void clear() + { + this->groupData.clear(); + this->nodeData.clear(); + } + + private: + template + void writeMap(const std::map& map, + MessageBufferType& buffer) const + { + const unsigned int size = map.size(); + buffer.write(size); + + for (const auto& [name, elm] : map) { + buffer.write(name); + elm .write(buffer); + } + } + + template + void readMap(MessageBufferType& buffer, + std::map& map) { unsigned int size; buffer.read(size); - for (size_t i = 0; i < size; ++i) { + for (std::size_t i = 0; i < size; ++i) { std::string name; buffer.read(name); - auto gdata = GroupData{}; - gdata.read(buffer); + auto elm = ValueType{}; + elm.read(buffer); - this->emplace(name, gdata); + map.emplace(name, std::move(elm)); } } }; diff --git a/opm/output/eclipse/RestartValue.hpp b/opm/output/eclipse/RestartValue.hpp index 3103565f1..ee5f2d591 100644 --- a/opm/output/eclipse/RestartValue.hpp +++ b/opm/output/eclipse/RestartValue.hpp @@ -71,11 +71,11 @@ namespace Opm { using ExtraVector = std::vector>>; data::Solution solution; data::Wells wells; - data::GroupValues groups; + data::GroupAndNetworkValues grp_nwrk; ExtraVector extra; std::vector aquifer; - RestartValue(data::Solution sol, data::Wells wells_arg, data::GroupValues groups_arg); + RestartValue(data::Solution sol, data::Wells wells_arg, data::GroupAndNetworkValues grpn_nwrk_arg); RestartValue() {} @@ -91,7 +91,7 @@ namespace Opm { { return solution == val2.solution && wells == val2.wells && - groups == val2.groups && + grp_nwrk == val2.grp_nwrk && extra == val2.extra; } }; diff --git a/opm/output/eclipse/Summary.hpp b/opm/output/eclipse/Summary.hpp index a5342fec3..a6698800d 100644 --- a/opm/output/eclipse/Summary.hpp +++ b/opm/output/eclipse/Summary.hpp @@ -38,7 +38,7 @@ namespace Opm { namespace Opm { namespace data { class WellRates; - class GroupValues; + class GroupAndNetworkValues; }} // namespace Opm::data namespace Opm { namespace out { @@ -59,16 +59,16 @@ public: void add_timestep(const SummaryState& st, const int report_step); - void eval(SummaryState& summary_state, - const int report_step, - const double secs_elapsed, - const EclipseState& es, - const Schedule& schedule, - const data::WellRates& well_solution, - const data::GroupValues& group_solution, - GlobalProcessParameters single_values, - const RegionParameters& region_values = {}, - const BlockValues& block_values = {}) const; + void eval(SummaryState& summary_state, + const int report_step, + const double secs_elapsed, + const EclipseState& es, + const Schedule& schedule, + const data::WellRates& well_solution, + const data::GroupAndNetworkValues& group_and_nwrk_solution, + GlobalProcessParameters single_values, + const RegionParameters& region_values = {}, + const BlockValues& block_values = {}) const; void write() const; diff --git a/src/opm/output/eclipse/LoadRestart.cpp b/src/opm/output/eclipse/LoadRestart.cpp index 7c41d6c7f..b5bd06994 100644 --- a/src/opm/output/eclipse/LoadRestart.cpp +++ b/src/opm/output/eclipse/LoadRestart.cpp @@ -1562,9 +1562,9 @@ namespace Opm { namespace RestartIO { auto xw = rst_view->hasKeyword("OPM_XWEL") ? restore_wells_opm(es, grid, schedule, *rst_view) : restore_wells_ecl(es, grid, schedule, rst_view); - data::GroupValues xg; + data::GroupAndNetworkValues xg_nwrk; - auto rst_value = RestartValue{ std::move(xr), std::move(xw) , std::move(xg)}; + auto rst_value = RestartValue{ std::move(xr), std::move(xw), std::move(xg_nwrk)}; if (! extra_keys.empty()) { restoreExtra(extra_keys, es.getUnits(), *rst_view, rst_value); diff --git a/src/opm/output/eclipse/RestartValue.cpp b/src/opm/output/eclipse/RestartValue.cpp index 20e23a9d6..654061008 100644 --- a/src/opm/output/eclipse/RestartValue.cpp +++ b/src/opm/output/eclipse/RestartValue.cpp @@ -17,8 +17,9 @@ along with OPM. If not, see . */ -#include #include +#include +#include #include @@ -32,10 +33,10 @@ namespace Opm { - RestartValue::RestartValue(data::Solution sol, data::Wells wells_arg, data::GroupValues groups_arg) : + RestartValue::RestartValue(data::Solution sol, data::Wells wells_arg, data::GroupAndNetworkValues grp_nwrk_arg) : solution(std::move(sol)), wells(std::move(wells_arg)), - groups(std::move(groups_arg)) + grp_nwrk(std::move(grp_nwrk_arg)) { } diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index 0891fda60..d43fdab65 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -382,7 +382,7 @@ struct fn_args { const std::string fip_region; const Opm::SummaryState& st; const Opm::data::Wells& wells; - const Opm::data::GroupValues& groups; + const Opm::data::GroupAndNetworkValues& grp_nwrk; const Opm::out::RegionCache& regionCache; const Opm::EclipseGrid& grid; const std::vector< std::pair< std::string, double > > eff_factors; @@ -778,8 +778,8 @@ inline quantity group_control( const fn_args& args ) { // production control if (Producer) { - auto it_g = args.groups.find(g_name); - if (it_g != args.groups.end()) { + auto it_g = args.grp_nwrk.groupData.find(g_name); + if (it_g != args.grp_nwrk.groupData.end()) { const auto& value = it_g->second.currentControl.currentProdConstraint; auto it_c = pCModeToPCntlMode.find(value); if (it_c == pCModeToPCntlMode.end()) { @@ -792,8 +792,8 @@ inline quantity group_control( const fn_args& args ) { } // water injection control else if (waterInjector){ - auto it_g = args.groups.find(g_name); - if (it_g != args.groups.end()) { + auto it_g = args.grp_nwrk.groupData.find(g_name); + if (it_g != args.grp_nwrk.groupData.end()) { const auto& value = it_g->second.currentControl.currentWaterInjectionConstraint; auto it_c = iCModeToICntlMode.find(value); if (it_c == iCModeToICntlMode.end()) { @@ -807,8 +807,8 @@ inline quantity group_control( const fn_args& args ) { // gas injection control else if (gasInjector){ - auto it_g = args.groups.find(g_name); - if (it_g != args.groups.end()) { + auto it_g = args.grp_nwrk.groupData.find(g_name); + if (it_g != args.grp_nwrk.groupData.end()) { const auto& value = it_g->second.currentControl.currentGasInjectionConstraint; auto it_c = iCModeToICntlMode.find(value); if (it_c == iCModeToICntlMode.end()) { @@ -879,8 +879,8 @@ quantity guiderate_value(const ::Opm::data::GuideRateValue& grvalue) template quantity group_guiderate(const fn_args& args) { - auto xgPos = args.groups.find(args.group_name); - if (xgPos == args.groups.end()) { + auto xgPos = args.grp_nwrk.groupData.find(args.group_name); + if (xgPos == args.grp_nwrk.groupData.end()) { return { 0.0, rate_unit() }; } @@ -1588,7 +1588,7 @@ namespace Evaluator { struct SimulatorResults { const Opm::data::WellRates& wellSol; - const Opm::data::GroupValues& groupSol; + const Opm::data::GroupAndNetworkValues& grpNwrkSol; const std::map& single; const std::map>& region; const std::map, double>& block; @@ -1642,7 +1642,7 @@ namespace Evaluator { wells, group_name, stepSize, static_cast(sim_step), std::max(0, this->node_.number), this->node_.fip_region, - st, simRes.wellSol, simRes.groupSol, input.reg, input.grid, + st, simRes.wellSol, simRes.grpNwrkSol, input.reg, input.grid, std::move(efac.factors) }; @@ -2326,16 +2326,16 @@ public: SummaryImplementation& operator=(const SummaryImplementation& rhs) = delete; SummaryImplementation& operator=(SummaryImplementation&& rhs) = default; - void eval(const EclipseState& es, - const Schedule& sched, - const int sim_step, - const double duration, - const data::WellRates& well_solution, - const data::GroupValues& group_solution, - const GlobalProcessParameters& single_values, - const RegionParameters& region_values, - const BlockValues& block_values, - SummaryState& st) const; + void eval(const EclipseState& es, + const Schedule& sched, + const int sim_step, + const double duration, + const data::WellRates& well_solution, + const data::GroupAndNetworkValues& grp_nwrk_solution, + const GlobalProcessParameters& single_values, + const RegionParameters& region_values, + const BlockValues& block_values, + SummaryState& st) const; void internal_store(const SummaryState& st, const int report_step); void write(); @@ -2428,23 +2428,23 @@ internal_store(const SummaryState& st, const int report_step) void Opm::out::Summary::SummaryImplementation:: -eval(const EclipseState& es, - const Schedule& sched, - const int sim_step, - const double duration, - const data::WellRates& well_solution, - const data::GroupValues& group_solution, - const GlobalProcessParameters& single_values, - const RegionParameters& region_values, - const BlockValues& block_values, - Opm::SummaryState& st) const +eval(const EclipseState& es, + const Schedule& sched, + const int sim_step, + const double duration, + const data::WellRates& well_solution, + const data::GroupAndNetworkValues& grp_nwrk_solution, + const GlobalProcessParameters& single_values, + const RegionParameters& region_values, + const BlockValues& block_values, + Opm::SummaryState& st) const { const Evaluator::InputData input { es, sched, this->grid_, this->regCache_ }; const Evaluator::SimulatorResults simRes { - well_solution, group_solution, single_values, region_values, block_values + well_solution, grp_nwrk_solution, single_values, region_values, block_values }; for (auto& evalPtr : this->outputParameters_.getEvaluators()) { @@ -2728,16 +2728,16 @@ Summary::Summary(const EclipseState& es, : pImpl_(new SummaryImplementation(es, sumcfg, grid, sched, basename)) {} -void Summary::eval(SummaryState& st, - const int report_step, - const double secs_elapsed, - const EclipseState& es, - const Schedule& schedule, - const data::WellRates& well_solution, - const data::GroupValues& group_solution, - GlobalProcessParameters single_values, - const RegionParameters& region_values, - const BlockValues& block_values) const +void Summary::eval(SummaryState& st, + const int report_step, + const double secs_elapsed, + const EclipseState& es, + const Schedule& schedule, + const data::WellRates& well_solution, + const data::GroupAndNetworkValues& grp_nwrk_solution, + GlobalProcessParameters single_values, + const RegionParameters& region_values, + const BlockValues& block_values) const { validateElapsedTime(secs_elapsed, es, st); @@ -2758,7 +2758,7 @@ void Summary::eval(SummaryState& st, const auto sim_step = std::max( 0, report_step - 1 ); this->pImpl_->eval(es, schedule, sim_step, duration, - well_solution, group_solution, single_values, + well_solution, grp_nwrk_solution, single_values, region_values, block_values, st); st.update_elapsed(duration); diff --git a/tests/test_EclipseIO.cpp b/tests/test_EclipseIO.cpp index 9794ae712..b56f33b41 100644 --- a/tests/test_EclipseIO.cpp +++ b/tests/test_EclipseIO.cpp @@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE(EclipseIOIntegration) { eclWriter.writeInitial( eGridProps , int_data ); data::Wells wells; - data::GroupValues groups; + data::GroupAndNetworkValues grp_nwrk; for( int i = first; i < last; ++i ) { data::Solution sol = createBlackoilState( i, 3 * 3 * 3 ); @@ -325,7 +325,7 @@ BOOST_AUTO_TEST_CASE(EclipseIOIntegration) { Action::State action_state; UDQState udq_state(1); - RestartValue restart_value(sol, wells, groups); + RestartValue restart_value(sol, wells, grp_nwrk); auto first_step = ecl_util_make_date( 10 + i, 11, 2008 ); eclWriter.writeTimeStep( action_state, st, diff --git a/tests/test_RFT.cpp b/tests/test_RFT.cpp index 51c726585..4c99d7374 100644 --- a/tests/test_RFT.cpp +++ b/tests/test_RFT.cpp @@ -302,7 +302,7 @@ BOOST_AUTO_TEST_CASE(test_RFT) Opm::data::Solution solution = createBlackoilState(2, numCells); Opm::data::Wells wells; - Opm::data::GroupValues groups; + Opm::data::GroupAndNetworkValues group_nwrk; using SegRes = decltype(wells["w"].segments); using Ctrl = decltype(wells["w"].current_control); @@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(test_RFT) wells["OP_1"] = { std::move(r1), 1.0, 1.1, 3.1, 1, std::move(well1_comps), SegRes{}, Ctrl{} }; wells["OP_2"] = { std::move(r2), 1.0, 1.1, 3.2, 1, std::move(well2_comps), SegRes{}, Ctrl{} }; - RestartValue restart_value(std::move(solution), std::move(wells), std::move(groups)); + RestartValue restart_value(std::move(solution), std::move(wells), std::move(group_nwrk)); eclipseWriter.writeTimeStep( action_state, st, @@ -438,7 +438,7 @@ BOOST_AUTO_TEST_CASE(test_RFT2) wells["OP_1"] = { std::move(r1), 1.0, 1.1, 3.1, 1, std::move(well1_comps), SegRes{}, Ctrl{} }; wells["OP_2"] = { std::move(r2), 1.0, 1.1, 3.2, 1, std::move(well2_comps), SegRes{}, Ctrl{} }; - RestartValue restart_value(std::move(solution), std::move(wells), data::GroupValues()); + RestartValue restart_value(std::move(solution), std::move(wells), data::GroupAndNetworkValues()); eclipseWriter.writeTimeStep( action_state, st, @@ -469,13 +469,11 @@ namespace { explicit Setup(const ::Opm::Deck& deck) : es { deck } - , python{ std::make_shared<::Opm::Python>() } - , sched { deck, es , python } + , sched { deck, es, std::make_shared() } { } ::Opm::EclipseState es; - std::shared_ptr<::Opm::Python> python; ::Opm::Schedule sched; }; diff --git a/tests/test_Restart.cpp b/tests/test_Restart.cpp index cff7a7f01..240f11505 100644 --- a/tests/test_Restart.cpp +++ b/tests/test_Restart.cpp @@ -137,7 +137,7 @@ std::ostream& operator<<( std::ostream& stream, } -data::GroupValues mkGroups() { +data::GroupAndNetworkValues mkGroups() { return {}; } diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index f7ca37bcf..9587d1a0d 100755 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -305,16 +305,16 @@ data::Wells result_wells(const bool w3_injector = true) return wellrates; } -data::GroupValues result_groups() +data::GroupAndNetworkValues result_group_nwrk() { using GRValue = data::GuideRateValue; - data::GroupValues groups; + data::GroupAndNetworkValues grp_nwrk; data::GroupConstraints cgc_group; cgc_group.set(p_cmode::NONE, i_cmode::VREP, i_cmode::RATE); { - auto& grp = groups["G_1"]; + auto& grp = grp_nwrk.groupData["G_1"]; grp.currentControl = cgc_group; grp.guideRates.production @@ -329,15 +329,15 @@ data::GroupValues result_groups() } cgc_group.set(p_cmode::ORAT, i_cmode::RESV, i_cmode::FLD); - groups["G_2"].currentControl = cgc_group; + grp_nwrk.groupData["G_2"].currentControl = cgc_group; cgc_group.set(p_cmode::GRAT, i_cmode::REIN, i_cmode::VREP); - groups["G_3"].currentControl = cgc_group; + grp_nwrk.groupData["G_3"].currentControl = cgc_group; cgc_group.set(p_cmode::NONE, i_cmode::NONE, i_cmode::NONE); - groups["FIELD"].currentControl = cgc_group; + grp_nwrk.groupData["FIELD"].currentControl = cgc_group; - return groups; + return grp_nwrk; } std::unique_ptr< EclIO::ESmry > readsum( const std::string& base ) { @@ -419,7 +419,7 @@ struct setup { Schedule schedule; SummaryConfig config; data::Wells wells; - data::GroupValues groups; + data::GroupAndNetworkValues grp_nwrk; std::string name; WorkArea ta; @@ -433,7 +433,7 @@ struct setup { schedule( deck, es, python), config( deck, schedule, es.getTableManager()), wells( result_wells(w3_injector) ), - groups( result_groups() ), + grp_nwrk( result_group_nwrk() ), name( toupper(std::move(fname)) ), ta( "summary_test" ) {} @@ -456,13 +456,13 @@ BOOST_AUTO_TEST_CASE(well_keywords) { SummaryState st(std::chrono::system_clock::now()); out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule , cfg.name ); - writer.eval(st, 0, 0*day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval(st, 0, 0*day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval(st, 1, 1*day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval(st, 1, 1*day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval(st, 2, 2*day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval(st, 2, 2*day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -681,11 +681,11 @@ BOOST_AUTO_TEST_CASE(udq_keywords) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule , cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -706,13 +706,13 @@ BOOST_AUTO_TEST_CASE(group_keywords) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -863,11 +863,11 @@ BOOST_AUTO_TEST_CASE(group_group) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -919,11 +919,11 @@ BOOST_AUTO_TEST_CASE(completion_kewords) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -980,13 +980,13 @@ BOOST_AUTO_TEST_CASE(DATE) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); - writer.eval( st, 3, 18 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 3, 18 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 3); - writer.eval( st, 4, 22 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 4, 22 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 4); writer.write(); @@ -1017,11 +1017,11 @@ BOOST_AUTO_TEST_CASE(field_keywords) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -1154,11 +1154,11 @@ BOOST_AUTO_TEST_CASE(report_steps_time) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -1181,11 +1181,11 @@ BOOST_AUTO_TEST_CASE(skip_unknown_var) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -1292,11 +1292,11 @@ BOOST_AUTO_TEST_CASE(region_vars) { { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}, region_values); + writer.eval( st, 1, 2 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}, region_values); writer.add_timestep( st, 1); - writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}, region_values); + writer.eval( st, 1, 5 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}, region_values); writer.add_timestep( st, 1); - writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}, region_values); + writer.eval( st, 2, 10 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}, region_values); writer.add_timestep( st, 2); writer.write(); } @@ -1343,11 +1343,11 @@ BOOST_AUTO_TEST_CASE(region_production) { { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); } @@ -1375,11 +1375,11 @@ BOOST_AUTO_TEST_CASE(region_injection) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -1431,15 +1431,15 @@ BOOST_AUTO_TEST_CASE(BLOCK_VARIABLES) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {},{}, block_values); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {},{}, block_values); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {},{}, block_values); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {},{}, block_values); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {},{}, block_values); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {},{}, block_values); writer.add_timestep( st, 2); - writer.eval( st, 3, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {},{}, block_values); + writer.eval( st, 3, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {},{}, block_values); writer.add_timestep( st, 3); - writer.eval( st, 4, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {},{}, block_values); + writer.eval( st, 4, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {},{}, block_values); writer.add_timestep( st, 4); writer.write(); @@ -1526,11 +1526,11 @@ BOOST_AUTO_TEST_CASE(MISC) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule , cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); @@ -1546,19 +1546,19 @@ BOOST_AUTO_TEST_CASE(EXTRA) { { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule , cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, { {"TCPU" , 0 }}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, { {"TCPU" , 0 }}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, { {"TCPU" , 1 }}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, { {"TCPU" , 1 }}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, { {"TCPU" , 2}}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, { {"TCPU" , 2}}); writer.add_timestep( st, 2); /* Add a not-recognized key; that is OK */ - BOOST_CHECK_NO_THROW( writer.eval( st, 3, 3 * day, cfg.es, cfg.schedule, cfg.wells , cfg.groups, { {"MISSING" , 2 }})); + BOOST_CHECK_NO_THROW( writer.eval( st, 3, 3 * day, cfg.es, cfg.schedule, cfg.wells , cfg.grp_nwrk, { {"MISSING" , 2 }})); BOOST_CHECK_NO_THROW( writer.add_timestep( st, 3)); /* Override a NOT MISC variable - ignored. */ - writer.eval( st, 4, 4 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval( st, 4, 4 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 4); writer.write(); } @@ -1677,11 +1677,11 @@ BOOST_AUTO_TEST_CASE(efficiency_factor) { out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule, cfg.name ); SummaryState st(std::chrono::system_clock::now()); - writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval( st, 0, 0 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval( st, 1, 1 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 1); - writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval( st, 2, 2 * day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 2); writer.write(); auto res = readsum( cfg.name ); @@ -1915,11 +1915,11 @@ namespace { }; SummaryState st(std::chrono::system_clock::now()); - smry.eval(st, 0, 0*day, config.es, config.schedule, config.wells, config.groups, {}); + smry.eval(st, 0, 0*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); smry.add_timestep(st, 0); - smry.eval(st, 1, 1*day, config.es, config.schedule, config.wells, config.groups, {}); + smry.eval(st, 1, 1*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); smry.add_timestep(st, 1); - smry.eval(st, 2, 2*day, config.es, config.schedule, config.wells, config.groups, {}); + smry.eval(st, 2, 2*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); smry.add_timestep(st, 2); return st; @@ -2915,11 +2915,11 @@ BOOST_AUTO_TEST_CASE(Write_Read) }; SummaryState st(std::chrono::system_clock::now()); - writer.eval(st, 0, 0*day, config.es, config.schedule, config.wells, config.groups, {}); + writer.eval(st, 0, 0*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); writer.add_timestep(st, 0); - writer.eval(st, 1, 1*day, config.es, config.schedule, config.wells, config.groups, {}); + writer.eval(st, 1, 1*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); writer.add_timestep(st, 1); - writer.eval(st, 2, 2*day, config.es, config.schedule, config.wells, config.groups, {}); + writer.eval(st, 2, 2*day, config.es, config.schedule, config.wells, config.grp_nwrk, {}); writer.add_timestep(st, 2); writer.write(); diff --git a/tests/test_Summary_Group.cpp b/tests/test_Summary_Group.cpp index b6dcd075c..9a994fd2d 100644 --- a/tests/test_Summary_Group.cpp +++ b/tests/test_Summary_Group.cpp @@ -191,23 +191,23 @@ static data::Wells result_wells() { } -static data::GroupValues result_groups() { - data::GroupValues groups; +static data::GroupAndNetworkValues result_group_network() { + data::GroupAndNetworkValues grp_nwrk; data::GroupConstraints cgc_group; cgc_group.set(p_cmode::NONE, i_cmode::VREP, i_cmode::RATE); - groups["TEST"].currentControl = cgc_group; + grp_nwrk.groupData["TEST"].currentControl = cgc_group; cgc_group.set(p_cmode::ORAT, i_cmode::RESV, i_cmode::REIN); - groups["LOWER"].currentControl = cgc_group; + grp_nwrk.groupData["LOWER"].currentControl = cgc_group; cgc_group.set(p_cmode::GRAT, i_cmode::REIN, i_cmode::VREP); - groups["UPPER"].currentControl = cgc_group; + grp_nwrk.groupData["UPPER"].currentControl = cgc_group; cgc_group.set(p_cmode::NONE, i_cmode::NONE, i_cmode::NONE); - groups["FIELD"].currentControl = cgc_group; + grp_nwrk.groupData["FIELD"].currentControl = cgc_group; - return groups; + return grp_nwrk; } @@ -219,7 +219,7 @@ struct setup { Schedule schedule; SummaryConfig config; data::Wells wells; - data::GroupValues groups; + data::GroupAndNetworkValues grp_nwrk; std::string name; WorkArea ta; @@ -233,7 +233,7 @@ struct setup { schedule( deck, es, python), config( deck, schedule, es.getTableManager()), wells( result_wells() ), - groups( result_groups() ), + grp_nwrk( result_group_network() ), name( toupper(std::move(fname)) ), ta( "test_summary_group_constraints" ) {} @@ -258,10 +258,10 @@ BOOST_AUTO_TEST_CASE(group_keywords) { SummaryState st(std::chrono::system_clock::now()); out::Summary writer( cfg.es, cfg.config, cfg.grid, cfg.schedule , cfg.name ); - writer.eval(st, 0, 0*day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval(st, 0, 0*day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 0); - writer.eval(st, 1, 1*day, cfg.es, cfg.schedule, cfg.wells, cfg.groups, {}); + writer.eval(st, 1, 1*day, cfg.es, cfg.schedule, cfg.wells, cfg.grp_nwrk, {}); writer.add_timestep( st, 1); writer.write(); diff --git a/tests/test_restartwellinfo.cpp b/tests/test_restartwellinfo.cpp index 8fd225318..15f10a9b2 100644 --- a/tests/test_restartwellinfo.cpp +++ b/tests/test_restartwellinfo.cpp @@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(EclipseWriteRestartWellInfo) { solution.insert( "SWAT" , Opm::UnitSystem::measure::identity , std::vector< double >( num_cells, 1 ) , Opm::data::TargetType::RESTART_SOLUTION); solution.insert( "SGAS" , Opm::UnitSystem::measure::identity , std::vector< double >( num_cells, 1 ) , Opm::data::TargetType::RESTART_SOLUTION); Opm::data::Wells wells; - Opm::data::GroupValues groups; + Opm::data::GroupAndNetworkValues group_nwrk; for(int timestep = 0; timestep <= countTimeStep; ++timestep) { @@ -226,7 +226,7 @@ BOOST_AUTO_TEST_CASE(EclipseWriteRestartWellInfo) { timestep, false, schedule.seconds(timestep), - Opm::RestartValue(solution, wells, groups)); + Opm::RestartValue(solution, wells, group_nwrk)); } for (int i=1; i <=4; i++) {