diff --git a/opm/parser/eclipse/EclipseState/Schedule/Events.hpp b/opm/parser/eclipse/EclipseState/Schedule/Events.hpp index 4b26f5958..26bfe8baf 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Events.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Events.hpp @@ -121,6 +121,11 @@ namespace Opm * Well switched between injector and producer */ WELL_SWITCHED_INJECTOR_PRODUCER = (1 << 19), + + /* + * The well has been affected in an ACTIONX keyword. + */ + ACTIONX_WELL_EVENT = (1 << 20), }; } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 7437f05fa..d5950b4d2 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -1194,6 +1194,12 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e &affected_wells, &target_wellpi); } + if (!affected_wells.empty()) { + this->snapshots.back().events().addEvent( ScheduleEvents::ACTIONX_WELL_EVENT ); + for (const auto& well: affected_wells) + this->snapshots.back().wellgroup_events().addEvent(well, ScheduleEvents::ACTIONX_WELL_EVENT); + } + if (reportStep < this->m_sched_deck.size() - 1) iterateScheduleSection(reportStep + 1, this->m_sched_deck.size(), parseContext, errors, true, &target_wellpi, nullptr, nullptr, prefix); OpmLog::info("\\----------------------------------------------------------------------"); diff --git a/tests/parser/ACTIONX.cpp b/tests/parser/ACTIONX.cpp index ded0b9c63..523d7eecb 100644 --- a/tests/parser/ACTIONX.cpp +++ b/tests/parser/ACTIONX.cpp @@ -150,6 +150,22 @@ TSTEP BOOST_CHECK_EQUAL( affected_wells.size(), 1); BOOST_CHECK_EQUAL( affected_wells.count("W1"), 1); + { + const auto& wg_events = sched[0].wellgroup_events(); + const auto& events = sched[0].events(); + BOOST_CHECK(events.hasEvent(ScheduleEvents::ACTIONX_WELL_EVENT)); + BOOST_CHECK(wg_events.hasEvent("W1", ScheduleEvents::ACTIONX_WELL_EVENT)); + BOOST_CHECK(!wg_events.hasEvent("W2", ScheduleEvents::ACTIONX_WELL_EVENT)); + } + + { + const auto& wg_events = sched[1].wellgroup_events(); + const auto& events = sched[1].events(); + BOOST_CHECK(!events.hasEvent(ScheduleEvents::ACTIONX_WELL_EVENT)); + BOOST_CHECK(!wg_events.hasEvent("W1", ScheduleEvents::ACTIONX_WELL_EVENT)); + BOOST_CHECK(!wg_events.hasEvent("W2", ScheduleEvents::ACTIONX_WELL_EVENT)); + } + // The deck3 contains the 'GRID' keyword in the ACTIONX block - that is not a whitelisted keyword. ParseContext parseContext( {{ParseContext::ACTIONX_ILLEGAL_KEYWORD, InputError::THROW_EXCEPTION}} ); BOOST_CHECK_THROW( make_schedule(WITH_GRID, parseContext), OpmInputError );