With this commit the PYACTION keyword is changed, instead of embedding the Python code directly in the .DATA file the keyword now points to an external file which is loaded verbatim into the PyAction keyword. In addition the PYACTION keyword has now got a name and a string indicating how many times it should run.
23 lines
800 B
Python
23 lines
800 B
Python
import sys
|
|
sys.stdout.write("Running PYACTION\n")
|
|
if "FOPR" in context.sim:
|
|
sys.stdout.write("Have FOPR: {}\n".format( context.sim["FOPR"] ))
|
|
else:
|
|
sys.stdout.write("Missing FOPR\n")
|
|
|
|
grid = context.state.grid()
|
|
sys.stdout.write("Grid dimensions: ({},{},{})\n".format(grid.nx, grid.ny, grid.nz))
|
|
|
|
prod_well = context.schedule.get_well("PROD1", context.report_step)
|
|
sys.stdout.write("Well status: {}\n".format(prod_well.status()))
|
|
if not "list" in context.storage:
|
|
context.storage["list"] = []
|
|
context.storage["list"].append(context.report_step)
|
|
|
|
if context.sim.well_var("PROD1", "WWCT") > 0.80:
|
|
context.schedule.shut_well("PROD1", context.report_step)
|
|
context.schedule.open_well("PROD2", context.report_step)
|
|
context.sim.update("RUN_COUNT", 1)
|
|
print(context.storage["list"])
|
|
|