diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index aca063f80..8316ccb0d 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -738,6 +738,23 @@ inline quantity injection_history( const fn_args& args ) { return { sum, rate_unit< phase >() }; } +inline quantity abondoned_injectors( const fn_args& args ) { + std::size_t count = 0; + + for (const auto& sched_well : args.schedule_wells) { + if (sched_well.hasInjected()) { + const auto& well_name = sched_well.name(); + auto well_iter = args.wells.find( well_name ); + if (well_iter == args.wells.end()) + continue; + + count += !well_iter->second.flowing(); + } + } + + return { 1.0 * count, measure::identity }; +} + inline quantity abondoned_producers( const fn_args& args ) { std::size_t count = 0; @@ -1363,6 +1380,7 @@ static const std::unordered_map< std::string, ofun > funs = { { "FMWPR", flowing< producer > }, { "FVPRT", res_vol_production_target }, { "FMWPA", abondoned_producers }, + { "FMWIA", abondoned_injectors }, //Field control mode { "FMCTP", group_control< false, true, false, false >}, diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp index 0fb82e734..7ef27895e 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp @@ -1528,6 +1528,7 @@ bool Well::operator==(const Well& data) const { this->guide_rate == data.guide_rate && this->solvent_fraction == data.solvent_fraction && this->hasProduced() == data.hasProduced() && + this->hasInjected() == data.hasInjected() && this->predictionMode() == data.predictionMode() && this->productivity_index == data.productivity_index && this->getTracerProperties() == data.getTracerProperties() && diff --git a/tests/SPE1CASE1.DATA b/tests/SPE1CASE1.DATA index c3fb8c38b..ef7c1eeb7 100644 --- a/tests/SPE1CASE1.DATA +++ b/tests/SPE1CASE1.DATA @@ -288,6 +288,7 @@ RPR__NUM RUNSUM FMWPA +FMWIA -- 1a) Oil rate vs time FOPR @@ -393,7 +394,9 @@ WELSPECS 'PROD' 'G1' 10 10 8400 'OIL' / 'INJ' 'G1' 1 1 8335 'GAS' / 'RFTP' 'G1' 10 10 8400 'OIL' / + 'RFTI' 'G1' 9 9 8400 'WATER' / / + -- Coordinates in item 3-4 are retrieved from Odeh's figure 1 and 2 -- Note that the depth at the midpoint of the well grid blocks -- has been used as reference depth for bottom hole pressure in item 5 @@ -402,6 +405,7 @@ COMPDAT -- Item #: 1 2 3 4 5 6 7 8 9 'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 / 'RFTP' 10 10 3 3 'OPEN' 1* 1* 0.5 / + 'RFTI' 9 9 3 3 'OPEN' 1* 1* 0.5 / 'INJ' 1 1 1 1 'OPEN' 1* 1* 0.5 / / -- Coordinates in item 2-5 are retreived from Odeh's figure 1 and 2 @@ -422,7 +426,9 @@ WCONPROD WCONINJE -- Item #:1 2 3 4 5 6 7 'INJ' 'GAS' 'OPEN' 'RATE' 100000 1* 9014 / + 'RFTI' 'GAS' 'SHUT' 'RATE' 0 / / + -- Stated in Odeh that gas inj. rate (item 5) is 100MMscf per day -- BHP upper limit (item 7) should not be exceeding the highest -- pressure in the PVT table=9014.7psia (default is 100 000psia) @@ -433,17 +439,23 @@ TSTEP WELOPEN 'RFTP' OPEN / + 'RFTI' OPEN / / WCONHIST 'RFTP' 'OPEN' 'RESV' 0 / / +WCONINJE + 'RFTI' 'GAS' 'OPEN' 'RATE' 0 / +/ + TSTEP 31 / WELOPEN 'RFTP' 'SHUT' / + 'RFTI' 'SHUT' / / TSTEP diff --git a/tests/msim/test_msim.cpp b/tests/msim/test_msim.cpp index fc207bd03..b1e6db6e4 100644 --- a/tests/msim/test_msim.cpp +++ b/tests/msim/test_msim.cpp @@ -56,6 +56,11 @@ double prod_rft(const EclipseState& es, const Schedule& /* sched */, const Summ return -units.to_si(UnitSystem::measure::rate, 0.0); } +double inj_rft(const EclipseState& es, const Schedule& /* sched */, const SummaryState&, const data::Solution& /* sol */, size_t /* report_step */, double /* seconds_elapsed */) { + const auto& units = es.getUnits(); + return units.to_si(UnitSystem::measure::rate, 0.0); +} + void pressure(const EclipseState& es, const Schedule& /* sched */, data::Solution& sol, size_t /* report_step */, double seconds_elapsed) { const auto& grid = es.getInputGrid(); const auto& units = es.getUnits(); @@ -85,6 +90,7 @@ BOOST_AUTO_TEST_CASE(RUN) { msim.well_rate("PROD", data::Rates::opt::oil, prod_opr); msim.well_rate("RFTP", data::Rates::opt::oil, prod_rft); + msim.well_rate("RFTI", data::Rates::opt::wat, inj_rft); msim.solution("PRESSURE", pressure); { const WorkArea work_area("test_msim"); @@ -107,6 +113,7 @@ BOOST_AUTO_TEST_CASE(RUN) { } const auto& fmwpa = smry.get("FMWPA"); + const auto& fmwia = smry.get("FMWIA"); const auto& dates = smry.dates(); const auto& day = smry.get("DAY"); const auto& month = smry.get("MONTH"); @@ -120,8 +127,10 @@ BOOST_AUTO_TEST_CASE(RUN) { } BOOST_CHECK_EQUAL( fmwpa[0], 0.0 ); - // The RFTP well will appear as an abondoned well. + BOOST_CHECK_EQUAL( fmwia[0], 0.0 ); + // The RFTP /RFTI wells will appear as an abondoned well. BOOST_CHECK_EQUAL( fmwpa[dates.size() - 1], 1.0 ); + BOOST_CHECK_EQUAL( fmwia[dates.size() - 1], 1.0 ); const auto rsm = EclIO::ERsm("SPE1CASE1.RSM"); BOOST_CHECK( EclIO::cmp( smry, rsm )); @@ -141,8 +150,10 @@ BOOST_AUTO_TEST_CASE(RUN) { const int report_step = 50; const auto& rst_state = Opm::RestartIO::RstState::load(rst, report_step); Schedule sched_rst(deck, state, python, &rst_state); - const auto& rft_well = sched_rst.getWell("RFTP", report_step); - BOOST_CHECK(rft_well.getStatus() == Well::Status::SHUT); + const auto& rfti_well = sched_rst.getWell("RFTI", report_step); + const auto& rftp_well = sched_rst.getWell("RFTP", report_step); + BOOST_CHECK(rftp_well.getStatus() == Well::Status::SHUT); + BOOST_CHECK(rfti_well.getStatus() == Well::Status::SHUT); } } }