diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index e3bdb23a6..a1e396e2c 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -535,6 +535,33 @@ double efac( const std::vector>& eff_factors, cons return (it != eff_factors.end()) ? it->second : 1.0; } +inline quantity artificial_lift_quantity( const fn_args& args ) { + // Note: This function is intentionally supported only at the well level + // (meaning there's no loop over args.schedule_wells by intention). Its + // purpose is to calculate WALQ only. + auto alq = quantity { 0.0, measure::identity }; + + if (args.schedule_wells.empty()) { + return alq; + } + + const auto* well = args.schedule_wells.front(); + if (well->isInjector()) { + return alq; + } + + auto xwPos = args.wells.find(well->name()); + if ((xwPos == args.wells.end()) || + (xwPos->second.dynamicStatus == Opm::Well::Status::SHUT)) + { + return alq; + } + + alq.value = well->productionControls(args.st).alq_value; + + return alq; +} + inline bool has_alq_type(const Opm::ScheduleState& sched_state, const Opm::Well::ProductionControls& pc) @@ -1578,6 +1605,7 @@ static const std::unordered_map< std::string, ofun > funs = { { "WEPR", rate< rt::energy, producer > }, { "WTPRHEA", rate< rt::energy, producer > }, { "WGLIR", glir}, + { "WALQ", artificial_lift_quantity }, { "WNPR", rate< rt::solvent, producer > }, { "WCPR", rate< rt::polymer, producer > }, { "WSPR", rate< rt::brine, producer > }, diff --git a/tests/2_WLIFT_MODEL5_NOINC.DATA b/tests/2_WLIFT_MODEL5_NOINC.DATA index c056c69e1..f01312160 100644 --- a/tests/2_WLIFT_MODEL5_NOINC.DATA +++ b/tests/2_WLIFT_MODEL5_NOINC.DATA @@ -10291,6 +10291,9 @@ WWPRH WGLIR 'B-*' 'C-*' / +WALQ + 'B-*' / + -- Production cumulatives WOPT 'B-*' 'C-*' / diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index 169c62c7f..d7f0c4233 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -1207,6 +1207,10 @@ BOOST_AUTO_TEST_CASE(GLIR_and_ALQ) BOOST_CHECK_CLOSE(1234.56 + 2345.67 + 3456.78, ecl_sum_get_group_var(resp, 1, "B1", "GGLIR"), 1.0e-5); + + BOOST_CHECK_CLOSE(0.0, ecl_sum_get_well_var(resp, 1, "B-1H", "WALQ"), 1.0e-5); + BOOST_CHECK_CLOSE(0.0, ecl_sum_get_well_var(resp, 1, "B-2H", "WALQ"), 1.0e-5); + BOOST_CHECK_CLOSE(0.0, ecl_sum_get_well_var(resp, 1, "B-3H", "WALQ"), 1.0e-5); } BOOST_AUTO_TEST_CASE(connection_kewords) {