From 5f30a969f0402f5c256d13a708b5a5ff9e0b2cbb Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 16 Mar 2021 15:53:35 +0100 Subject: [PATCH] clean-up the interface of the guiderates --- .../EclipseState/Schedule/Group/GuideRate.hpp | 20 +++--- .../Schedule/Group/GuideRateConfig.hpp | 2 +- .../EclipseState/Schedule/Group/GuideRate.cpp | 63 +++++++++++-------- .../Schedule/Group/GuideRateConfig.cpp | 2 +- tests/parser/GroupTests.cpp | 56 ++++++++--------- tests/parser/ScheduleTests.cpp | 2 +- tests/test_GuideRate.cpp | 62 +++++++++--------- 7 files changed, 111 insertions(+), 96 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp b/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp index 9020c2b89..f41d50f41 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp @@ -92,16 +92,18 @@ struct GRValState { public: GuideRate(const Schedule& schedule); - double getProductionGroupOrWell(const std::string& name, GuideRateModel::Target model_target, const RateVector& rates) const; - double getWell(const std::string& well, Well::GuideRateTarget target, const RateVector& rates) const; - double getProductionGroup(const std::string& group, Group::GuideRateProdTarget target, const RateVector& rates) const; - double getInjectionGroup(const Phase& phase, const std::string& group) const; - bool hasProductionGroupOrWell(const std::string& name) const; - bool hasInjectionGroup(const Phase& phase, const std::string& name) const; - void injectionGroupCompute(const std::string& wgname, const Phase& phase, size_t report_step, double guide_rate); - void productionGroupCompute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot); - void wellCompute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot); + void compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot); + void compute(const std::string& wgname, const Phase& phase, size_t report_step, double guide_rate); + double get(const std::string& well, Well::GuideRateTarget target, const RateVector& rates) const; + double get(const std::string& group, Group::GuideRateProdTarget target, const RateVector& rates) const; + double get(const std::string& name, GuideRateModel::Target model_target, const RateVector& rates) const; + double get(const std::string& group, const Phase& phase) const; + bool has(const std::string& name) const; + bool has(const std::string& name, const Phase& phase) const; + private: + void well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot); + void group_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot); double eval_form(const GuideRateModel& model, double oil_pot, double gas_pot, double wat_pot) const; double eval_group_pot() const; double eval_group_resvinj() const; diff --git a/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp b/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp index 61f84e244..1850da905 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp @@ -95,7 +95,7 @@ struct GroupInjTarget { bool has_model() const; bool update_model(const GuideRateModel& model); void update_well(const Well& well); - void update_injection_group(const std::string& group_name, Group::GroupInjectionProperties& properties); + void update_injection_group(const std::string& group_name, const Group::GroupInjectionProperties& properties); void update_production_group(const Group& group); const WellTarget& well(const std::string& well) const; const GroupProdTarget& production_group(const std::string& group) const; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp index c3eb4b6f1..5d5622f5e 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp @@ -28,7 +28,7 @@ #include #include #include - +#include #include namespace Opm { @@ -67,17 +67,17 @@ GuideRate::GuideRate(const Schedule& schedule_arg) : schedule(schedule_arg) {} -double GuideRate::getWell(const std::string& well, Well::GuideRateTarget target, const RateVector& rates) const +double GuideRate::get(const std::string& well, Well::GuideRateTarget target, const RateVector& rates) const { - return this->getProductionGroupOrWell(well, GuideRateModel::convert_target(target), rates); + return this->get(well, GuideRateModel::convert_target(target), rates); } -double GuideRate::getProductionGroup(const std::string& group, Group::GuideRateProdTarget target, const RateVector& rates) const +double GuideRate::get(const std::string& group, Group::GuideRateProdTarget target, const RateVector& rates) const { - return this->getProductionGroupOrWell(group, GuideRateModel::convert_target(target), rates); + return this->get(group, GuideRateModel::convert_target(target), rates); } -double GuideRate::getProductionGroupOrWell(const std::string& name, GuideRateModel::Target model_target, const RateVector& rates) const +double GuideRate::get(const std::string& name, GuideRateModel::Target model_target, const RateVector& rates) const { using namespace unit; using prefix::micro; @@ -104,38 +104,52 @@ double GuideRate::getProductionGroupOrWell(const std::string& name, GuideRateMod return grvalue * scale; } -double GuideRate::getInjectionGroup(const Phase& phase, const std::string& name) const +double GuideRate::get(const std::string& name, const Phase& phase) const { auto iter = this->injection_group_values.find(std::make_pair(phase, name)); if (iter == this->injection_group_values.end()) { - std::string message = "Did not find any guiderate values for injection group " + name + ":" + std::to_string(static_cast(phase)); + auto message = fmt::format("Did not find any guiderate values for injection group {}:{}", name, std::to_string(static_cast(phase))); throw std::logic_error {message}; } return iter->second; } -bool GuideRate::hasProductionGroupOrWell(const std::string& name) const +bool GuideRate::has(const std::string& name) const { return this->values.count(name) > 0; } -bool GuideRate::hasInjectionGroup(const Phase& phase, const std::string& name) const +bool GuideRate::has(const std::string& name, const Phase& phase) const { return this->injection_group_values.count(std::pair(phase, name)) > 0; } -void GuideRate::productionGroupCompute(const std::string& wgname, - size_t report_step, - double sim_time, - double oil_pot, - double gas_pot, - double wat_pot) +void GuideRate::compute(const std::string& wgname, + size_t report_step, + double sim_time, + double oil_pot, + double gas_pot, + double wat_pot) { this->potentials[wgname] = RateVector{oil_pot, gas_pot, wat_pot}; - const auto& config = this->schedule.guideRateConfig(report_step); - if (!config.has_production_group(wgname)) - return; + const auto& config = this->schedule.guideRateConfig(report_step); + if (config.has_production_group(wgname)) { + this->group_compute(wgname, report_step, sim_time, oil_pot, gas_pot, wat_pot); + } + else { + this->well_compute(wgname, report_step, sim_time, oil_pot, gas_pot, wat_pot); + } +} + +void GuideRate::group_compute(const std::string& wgname, + size_t report_step, + double sim_time, + double oil_pot, + double gas_pot, + double wat_pot) +{ + const auto& config = this->schedule.guideRateConfig(report_step); const auto& group = config.production_group(wgname); if (group.guide_rate > 0.0) { auto model_target = GuideRateModel::convert_target(group.target); @@ -187,10 +201,10 @@ void GuideRate::productionGroupCompute(const std::string& wgname, } } -void GuideRate::injectionGroupCompute(const std::string& wgname, - const Phase& phase, - size_t report_step, - double guide_rate) +void GuideRate::compute(const std::string& wgname, + const Phase& phase, + size_t report_step, + double guide_rate) { const auto& config = this->schedule.guideRateConfig(report_step); if (!config.has_injection_group(phase, wgname)) @@ -208,14 +222,13 @@ void GuideRate::injectionGroupCompute(const std::string& wgname, this->injection_group_values[std::make_pair(phase, wgname)] = group.guide_rate; } -void GuideRate::wellCompute(const std::string& wgname, +void GuideRate::well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot) { - this->potentials[wgname] = RateVector{oil_pot, gas_pot, wat_pot}; const auto& config = this->schedule.guideRateConfig(report_step); // guide rates spesified with WGRUPCON diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp index 08b7d540f..da0e95c4e 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp @@ -87,7 +87,7 @@ void GuideRateConfig::update_production_group(const Group& group) { group_node.target = guide_target; } -void GuideRateConfig::update_injection_group(const std::string& group_name, Group::GroupInjectionProperties& properties) { +void GuideRateConfig::update_injection_group(const std::string& group_name, const Group::GroupInjectionProperties& properties) { if (group_name == "FIELD") return; diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index 5d9e6f08b..ca8ce8a60 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -508,48 +508,48 @@ BOOST_AUTO_TEST_CASE(GCONINJE_GUIDERATE) { GuideRate gr = GuideRate(schedule); const auto& g1 = schedule.getGroup("G1", 0); const auto& g2 = schedule.getGroup("G2", 0); - gr.injectionGroupCompute(g1.name(), Phase::WATER, 0, 0.0); - gr.injectionGroupCompute(g1.name(), Phase::GAS, 0, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::WATER, 0, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::GAS, 0, 0.0); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::WATER, g1.name())); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::GAS, g1.name())); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::WATER, g2.name())); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::GAS, g2.name())); + gr.compute(g1.name(), Phase::WATER, 0, 0.0); + gr.compute(g1.name(), Phase::GAS, 0, 0.0); + gr.compute(g2.name(), Phase::WATER, 0, 0.0); + gr.compute(g2.name(), Phase::GAS, 0, 0.0); + BOOST_CHECK( !gr.has(g1.name(), Phase::WATER)); + BOOST_CHECK( !gr.has(g1.name(), Phase::GAS)); + BOOST_CHECK( !gr.has(g2.name(), Phase::WATER)); + BOOST_CHECK( !gr.has(g2.name(), Phase::GAS)); } // Step 1 { GuideRate gr = GuideRate(schedule); const auto& g1 = schedule.getGroup("G1", 1); const auto& g2 = schedule.getGroup("G2", 1); - gr.injectionGroupCompute(g1.name(), Phase::WATER, 1, 0.0); - gr.injectionGroupCompute(g1.name(), Phase::GAS, 1, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::WATER, 1, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::GAS, 1, 0.0); + gr.compute(g1.name(), Phase::WATER, 1, 0.0); + gr.compute(g1.name(), Phase::GAS, 1, 0.0); + gr.compute(g2.name(), Phase::WATER, 1, 0.0); + gr.compute(g2.name(), Phase::GAS, 1, 0.0); - BOOST_CHECK( gr.hasInjectionGroup(Phase::WATER, g1.name())); - BOOST_CHECK( gr.hasInjectionGroup(Phase::GAS, g1.name())); - BOOST_CHECK( gr.hasInjectionGroup(Phase::WATER, g2.name())); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::GAS, g2.name())); + BOOST_CHECK( gr.has(g1.name(), Phase::WATER)); + BOOST_CHECK( gr.has(g1.name(), Phase::GAS)); + BOOST_CHECK( gr.has(g2.name(), Phase::WATER)); + BOOST_CHECK( !gr.has(g2.name(), Phase::GAS)); - BOOST_CHECK_EQUAL(1.0, gr.getInjectionGroup(Phase::WATER, g1.name())); - BOOST_CHECK_EQUAL(1.0, gr.getInjectionGroup(Phase::GAS, g1.name())); - BOOST_CHECK_EQUAL(1.0, gr.getInjectionGroup(Phase::WATER, g2.name())); - BOOST_CHECK_THROW(gr.getInjectionGroup(Phase::GAS, g2.name()), std::logic_error); + BOOST_CHECK_EQUAL(1.0, gr.get(g1.name(), Phase::WATER)); + BOOST_CHECK_EQUAL(1.0, gr.get(g1.name(), Phase::GAS)); + BOOST_CHECK_EQUAL(1.0, gr.get(g2.name(), Phase::WATER)); + BOOST_CHECK_THROW(gr.get(g2.name(), Phase::GAS), std::logic_error); } // Step 2 { GuideRate gr = GuideRate(schedule); const auto& g1 = schedule.getGroup("G1", 2); const auto& g2 = schedule.getGroup("G2", 2); - gr.injectionGroupCompute(g1.name(), Phase::WATER, 2, 0.0); - gr.injectionGroupCompute(g1.name(), Phase::GAS, 2, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::WATER, 2, 0.0); - gr.injectionGroupCompute(g2.name(), Phase::GAS, 2, 0.0); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::WATER, g1.name())); - BOOST_CHECK( gr.hasInjectionGroup(Phase::GAS, g1.name())); - BOOST_CHECK( gr.hasInjectionGroup(Phase::WATER, g2.name())); - BOOST_CHECK( !gr.hasInjectionGroup(Phase::GAS, g2.name())); + gr.compute(g1.name(), Phase::WATER, 2, 0.0); + gr.compute(g1.name(), Phase::GAS, 2, 0.0); + gr.compute(g2.name(), Phase::WATER, 2, 0.0); + gr.compute(g2.name(), Phase::GAS, 2, 0.0); + BOOST_CHECK( !gr.has(g1.name(), Phase::WATER)); + BOOST_CHECK( gr.has(g1.name(), Phase::GAS)); + BOOST_CHECK( gr.has(g2.name(), Phase::WATER)); + BOOST_CHECK( !gr.has(g2.name(), Phase::GAS)); } } diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index 3a84152ca..9719d0b78 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -3487,7 +3487,7 @@ COMPDAT double gas_pot = 1; double wat_pot = 1; - gr.wellCompute("XYZ",1, 1.0, oil_pot, gas_pot, wat_pot); + gr.compute("XYZ",1, 1.0, oil_pot, gas_pot, wat_pot); } { const auto& changed_wells = schedule.changed_wells(0); diff --git a/tests/test_GuideRate.cpp b/tests/test_GuideRate.cpp index afc3d96b2..3846a5504 100644 --- a/tests/test_GuideRate.cpp +++ b/tests/test_GuideRate.cpp @@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(P1_First) const auto stm = 0.0; const auto rpt = size_t{1}; - cse.gr.wellCompute("P1", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P1", rpt, stm, wopp, wgpp, wwpp); const auto orat = 2.0; const auto grat = 4.0; // == 2 * orat @@ -213,14 +213,14 @@ BOOST_AUTO_TEST_CASE(P1_First) // GR_{oil} { - const auto grval = cse.gr.getWell("P1", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P1", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); BOOST_CHECK_CLOSE(grval, expect_gr_oil, 1.0e-5); } // GR_{gas} { - const auto grval = cse.gr.getWell("P1", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P1", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * expect_gr_oil; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -228,7 +228,7 @@ BOOST_AUTO_TEST_CASE(P1_First) // GR_{water} { - const auto grval = cse.gr.getWell("P1", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P1", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * expect_gr_oil; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE(P2_Second) const auto stm = 0.0; const auto rpt = size_t{1}; - cse.gr.wellCompute("P2", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P2", rpt, stm, wopp, wgpp, wwpp); } { @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(P2_Second) const auto stm = 10.0*Opm::unit::second; // Before recalculation delay const auto rpt = size_t{1}; - cse.gr.wellCompute("P2", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P2", rpt, stm, wopp, wgpp, wwpp); } const auto orat = 2.0; @@ -267,14 +267,14 @@ BOOST_AUTO_TEST_CASE(P2_Second) // GR_{oil} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); BOOST_CHECK_CLOSE(grval, expect_gr_oil_1, 1.0e-5); } // GR_{gas} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -282,7 +282,7 @@ BOOST_AUTO_TEST_CASE(P2_Second) // GR_{water} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -295,14 +295,14 @@ BOOST_AUTO_TEST_CASE(P2_Second) const auto stm = 10.0*Opm::unit::day; // After recalculation delay const auto rpt = size_t{3}; - cse.gr.wellCompute("P2", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P2", rpt, stm, wopp, wgpp, wwpp); } const auto expect_gr_oil_2 = 10.0 / (0.5 + 1.0/10.0); // wopp_2 / (0.5 + wwpp_2/wopp_2) // GR_{oil} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::OIL, { orat, grat, wrat }); const auto expect = 0.5*expect_gr_oil_2 + 0.5*expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(P2_Second) // GR_{gas} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * (0.5*expect_gr_oil_2 + 0.5*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE(P2_Second) // GR_{water} { - const auto grval = cse.gr.getWell("P2", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P2", Opm::Well::GuideRateTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * (0.5*expect_gr_oil_2 + 0.5*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -336,7 +336,7 @@ BOOST_AUTO_TEST_CASE(P_Third) const auto stm = 0.0; const auto rpt = size_t{1}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -346,7 +346,7 @@ BOOST_AUTO_TEST_CASE(P_Third) const auto stm = 10.0*Opm::unit::day; const auto rpt = size_t{3}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(P_Third) const auto stm = 20.0*Opm::unit::day; const auto rpt = size_t{4}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } const auto expect_gr_oil_1 = 1.0 / (0.5 + 0.1/ 1.0); // wopp_1 / (0.5 + wwpp_1/wopp_1) @@ -369,7 +369,7 @@ BOOST_AUTO_TEST_CASE(P_Third) // GR_{oil} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); const auto expect = 0.5*expect_gr_oil_3 + 0.5*0.5*expect_gr_oil_2 + 0.5*0.5*expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -377,7 +377,7 @@ BOOST_AUTO_TEST_CASE(P_Third) // GR_{gas} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * (0.5*expect_gr_oil_3 + 0.5*0.5*expect_gr_oil_2 + 0.5*0.5*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -385,7 +385,7 @@ BOOST_AUTO_TEST_CASE(P_Third) // GR_{water} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * (0.5*expect_gr_oil_3 + 0.5*0.5*expect_gr_oil_2 + 0.5*0.5*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -403,7 +403,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) const auto stm = 0.0; const auto rpt = size_t{1}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -413,7 +413,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) const auto stm = 10.0*Opm::unit::day; const auto rpt = size_t{3}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) const auto stm = 20.0*Opm::unit::day; const auto rpt = size_t{4}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } const auto expect_gr_oil_1 = 1.0 / (0.5 + 0.1/ 1.0); // wopp_1 / (0.5 + wwpp_1/wopp_1) @@ -436,7 +436,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) // GR_{oil} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); const auto expect = 0.1*expect_gr_oil_3 + 0.1*0.9*expect_gr_oil_2 + 0.9*0.9*expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -444,7 +444,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) // GR_{gas} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * (0.1*expect_gr_oil_3 + 0.1*0.9*expect_gr_oil_2 + 0.9*0.9*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -452,7 +452,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df01) // GR_{water} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * (0.1*expect_gr_oil_3 + 0.1*0.9*expect_gr_oil_2 + 0.9*0.9*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -470,7 +470,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) const auto stm = 0.0; const auto rpt = size_t{1}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -480,7 +480,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) const auto stm = 10.0*Opm::unit::day; const auto rpt = size_t{3}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } { @@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) const auto stm = 20.0*Opm::unit::day; const auto rpt = size_t{4}; - cse.gr.productionGroupCompute("P", rpt, stm, wopp, wgpp, wwpp); + cse.gr.compute("P", rpt, stm, wopp, wgpp, wwpp); } const auto expect_gr_oil_1 = 1.0 / (0.5 + 0.1/ 1.0); // wopp_1 / (0.5 + wwpp_1/wopp_1) @@ -503,7 +503,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) // GR_{oil} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::OIL, { orat, grat, wrat }); const auto expect = 0.9*expect_gr_oil_3 + 0.9*0.1*expect_gr_oil_2 + 0.1*0.1*expect_gr_oil_1; BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -511,7 +511,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) // GR_{gas} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::GAS, { orat, grat, wrat }); const auto expect = (grat / orat) * (0.9*expect_gr_oil_3 + 0.9*0.1*expect_gr_oil_2 + 0.1*0.1*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5); @@ -519,7 +519,7 @@ BOOST_AUTO_TEST_CASE(P_Third_df09) // GR_{water} { - const auto grval = cse.gr.getProductionGroup("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); + const auto grval = cse.gr.get("P", Opm::Group::GuideRateProdTarget::WAT, { orat, grat, wrat }); const auto expect = (wrat / orat) * (0.9*expect_gr_oil_3 + 0.9*0.1*expect_gr_oil_2 + 0.1*0.1*expect_gr_oil_1); BOOST_CHECK_CLOSE(grval, expect, 1.0e-5);