Files
opm-common/tests/msim/action2.py
Joakim Hove 46b663218a Enable running normal ACTIONX keywords from PYACTION
The run() function invoked by PYACTION has got a new fifth argument which is a
callable the script should utilize to apply the keywords from an ACTIONX
keyword. The callable is implemented as C++ lambda which will run the
Schedule::iterateScheduleSection() method and make sure an updated
SimulatorUpdate variable can be passed back to the simulator.
2022-01-25 10:04:43 +01:00

10 lines
266 B
Python

def run(ecl_state, schedule, report_step, sim, actionx_callback):
wells_shut = False
for well in sim.wells:
if sim.well_var(well, "WWCT") > 0.50:
schedule.shut_well(well, report_step)
wells_shut = True
return wells_shut