diff --git a/opm/input/eclipse/Schedule/Group/Group.hpp b/opm/input/eclipse/Schedule/Group/Group.hpp index e394cd0155d..4b8b72d7c05 100644 --- a/opm/input/eclipse/Schedule/Group/Group.hpp +++ b/opm/input/eclipse/Schedule/Group/Group.hpp @@ -119,8 +119,7 @@ class Group { VOID = 2, NETV = 3, RESV = 4, - POTN = 5, - NO_GUIDE_RATE = 6 + NO_GUIDE_RATE = 5 }; static GuideRateInjTarget GuideRateInjTargetFromString( const std::string& stringValue ); static GuideRateInjTarget GuideRateInjTargetFromInt(int ecl_id); diff --git a/opm/input/eclipse/Schedule/Group/GuideRate.cpp b/opm/input/eclipse/Schedule/Group/GuideRate.cpp index e05f8e7ea55..75ca53ddb4b 100644 --- a/opm/input/eclipse/Schedule/Group/GuideRate.cpp +++ b/opm/input/eclipse/Schedule/Group/GuideRate.cpp @@ -283,22 +283,22 @@ void Opm::GuideRate::group_compute(const std::string& wgname, } } -void Opm::GuideRate::compute(const std::string& wgname, - const Phase& phase, - const std::size_t report_step, - const double guide_rate) +void Opm::GuideRate::compute(const std::string& wgname, + const Phase& phase, + const std::size_t report_step, + const std::optional guide_rate) { const auto& config = this->schedule[report_step].guide_rate(); if (!config.has_injection_group(phase, wgname)) return; - if (guide_rate > 0) { - this->injection_group_values[std::make_pair(phase, wgname)] = guide_rate; + if (guide_rate) { + this->injection_group_values[std::make_pair(phase, wgname)] = *guide_rate; return; } const auto& group = config.injection_group(phase, wgname); - if (group.target == Group::GuideRateInjTarget::POTN) { + if (group.target == Group::GuideRateInjTarget::NO_GUIDE_RATE) { return; } this->injection_group_values[std::make_pair(phase, wgname)] = group.guide_rate; diff --git a/opm/input/eclipse/Schedule/Group/GuideRate.hpp b/opm/input/eclipse/Schedule/Group/GuideRate.hpp index 110b353f8d4..79ab0165098 100644 --- a/opm/input/eclipse/Schedule/Group/GuideRate.hpp +++ b/opm/input/eclipse/Schedule/Group/GuideRate.hpp @@ -122,10 +122,10 @@ class GuideRate const double gas_pot, const double wat_pot); - void compute(const std::string& wgname, - const Phase& phase, - const std::size_t report_step, - const double guide_rate); + void compute(const std::string& wgname, + const Phase& phase, + const std::size_t report_step, + const std::optional guide_rate); bool has(const std::string& name) const; bool hasPotentials(const std::string& name) const; diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index 0f5fdefb43d..250e1cef958 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -604,10 +604,10 @@ GCONINJE GuideRate gr = GuideRate(schedule); const auto& g1 = schedule.getGroup("G1", 1); const auto& g2 = schedule.getGroup("G2", 1); - 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); + gr.compute(g1.name(), Phase::WATER, 1, std::nullopt); + gr.compute(g1.name(), Phase::GAS, 1, std::nullopt); + gr.compute(g2.name(), Phase::WATER, 1, std::nullopt); + gr.compute(g2.name(), Phase::GAS, 1, std::nullopt); BOOST_CHECK( gr.has(g1.name(), Phase::WATER)); BOOST_CHECK( gr.has(g1.name(), Phase::GAS));