Abstract

As the oil and gas industry enters the digital era, openness is a key enabler to realizing the vision of transforming the industry for the better. The practice of reservoir engineering and reservoir simulation is no exception. In this paper, an openness mechanism in a reservoir simulator using Python scripting language is introduced. It empowers engineers to utilize simulation in new ways. It extends simulator capabilities and enables people to implement flexible-control logic to solve field management challenges.

The new openness mechanism in the simulator allows engineers to program and include Python scripts in a simulation model. These scripts interrogate and interact with the simulator. The scripts are executed by the simulator while running the model. Flexibility is available to execute the scripts at every Newton iteration, before and after every simulation timestep, at specified times, or when a criterion is met. Simulation model properties can be queried through the scripts, such as well connections, well properties, group properties, grid region properties, network entities, current simulation time, etc. The scripts can set properties such as well constraints, well and connection productivity index (PI), group production target, pausing or stopping the run, etc. Customized control logic, if not directly available in the simulator, can be implemented in the scripts that interrogate and drive the simulator. Such customization can be packaged as Python libraries and shared with team members, enabling continuous value creation. Public Python libraries, such as NumPy, pandas and pywin32 or win32com, can also be loaded in the scripts to extend even further what the simulator can do.

The openness mechanism is demonstrated on case examples. They include customized action to acidize wells when production drops, approximating the geomechanical effect of decreasing well pressure, modeling the effect of fines in injected water on well injectivity, and connecting to a network simulator. Examples are also given on customized reporting for model diagnostics and result interpretation, setting production constraints based on economics calculated in an Excel sheet with complex fiscal regime, advanced gas accounting, management of sulphur content, dual-optimization to meet gas demand while honoring oil treatment capacity, and integrated asset modeling from reservoir to surface networks to processing facilities.

the ability to extend built-in functionalities of a reservoir simulator and customize field management controls using user scripting language. It embraces innovation and enables continuous value creation in reservoir simulation.

You can access this article if you purchase or spend a download.