diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index 7b1189e72..853859551 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -344,6 +344,20 @@ inline quantity injection_history( const fn_args& args ) { return { sum, rate_unit< phase >() }; } +inline quantity res_vol_production_target( const fn_args& args ) { + + if( args.timestep == 0 ) return { 0.0, measure::rate }; + + const auto timestep = args.timestep - 1; + + double sum = 0.0; + for( const Well* sched_well : args.schedule_wells ) + if (sched_well->getProductionProperties(timestep).predictionMode) + sum += sched_well->getProductionProperties( timestep ).ResVRate; + + return { sum, measure::rate }; +} + /* * A small DSL, really poor man's function composition, to avoid massive * repetition when declaring the handlers for each individual keyword. bin_op @@ -717,6 +731,8 @@ static const std::unordered_map< std::string, ofun > funs = { { "GMWIN", flowing< injector > }, { "GMWPR", flowing< producer > }, + { "GVPRT", res_vol_production_target }, + { "CWIR", crate< rt::wat, injector > }, { "CGIR", crate< rt::gas, injector > }, { "CWIT", mul( crate< rt::wat, injector >, duration ) }, diff --git a/tests/summary_deck.DATA b/tests/summary_deck.DATA index e1a2d92ed..9b29ecd61 100644 --- a/tests/summary_deck.DATA +++ b/tests/summary_deck.DATA @@ -552,6 +552,7 @@ WELSPECS 'W_1' 'G_1' 1 1 3.33 'OIL' 7* / 'W_2' 'G_1' 2 1 3.33 'OIL' 7* / 'W_3' 'G_2' 3 1 3.92 'WATER' 7* / + 'W_5' 'G_3' 4 1 3.92 'OIL' 7* / / -- Completion data. @@ -577,6 +578,10 @@ WCONINJH W_3 WATER STOP 30.0 2.1 2.2 / / +WCONPROD + W_5 SHUT ORAT 0.0 0.0 0.0 1* 30.1 / +/ + TSTEP -- register time steps (in days). This allows us to write *two* report steps (1 -- and 2. Without this, totals/accumulations would fail (segfault) when looking diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index 0d1e2858d..db1920567 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -498,6 +498,9 @@ BOOST_AUTO_TEST_CASE(group_keywords) { ecl_sum_get_group_var( resp, 1, "G_1", "GLPTH" ), 1e-5 ); BOOST_CHECK_CLOSE( 0, ecl_sum_get_group_var( resp, 1, "G_2", "GLPTH" ), 1e-5 ); + /* Production targets */ + BOOST_CHECK_CLOSE( 30.1 , ecl_sum_get_group_var( resp, 1, "G_3", "GVPRT" ), 1e-5 ); + /* Injection rates */ BOOST_CHECK_CLOSE( 30.0, ecl_sum_get_group_var( resp, 1, "G_2", "GWIR" ), 1e-5 ); BOOST_CHECK_CLOSE( 30.2, ecl_sum_get_group_var( resp, 1, "G_2", "GGIR" ), 1e-5 );