Introduction to Scripting with CoViz 4D
Dynamic Graphics provides powerful, interactive functionality to simplify software usage, but it has always recognized the need to prevent the limitations of a “black box” environment, allowing for the extension and customization of the tools by providing users with access to the underlying modular functionality. This enables clients to build their own solutions for precise problem solving, analysis, and 4D visualization without having to navigate the existing buttons and toolbars. CoViz 4D offers an extensive array of command line modules accessible via bash scripting as well as through the Python Developers’ Toolkit.
DGI’s efforts in this area are continuously advancing and we have developed further functionality in a Python package, ‘dgpy’ which reduces the barriers to entry in converting bash commands to Python. Additionally, we have expanded our current command modules, notably ‘cv_viewserver’, to include more of the options available in the CoViz 4D Viewer GUI. This progress has led to increasingly powerful, flexible, and efficient new tools that take advantage of programming with our Developers’ Toolkits, such as Cloud-computing and writing Python Jupyter notebooks that access DGI modules.
Use Case: Ensemble Analysis and Oil Thickness Calculations via a Jupyter Notebook
An offshore team needed to analyze an ensemble dataset, operating on, and comparing dozens of reservoir simulation models. These simulation models shared the same geospatial coordinates, wells, and properties, but the property data varied from model to model based on a Monte Carlo simulation. To conduct an in-depth analysis, individual model comparisons were necessary even though many of the same calculations were being run. Using a graphical user interface would have been slow and inefficient, and writing a generalized script would not have allowed for individual choices in comparisons. This challenge presented the perfect opportunity for the team to access CoViz 4D’s command line modules from within a Python Jupyter notebook.
The team’s goals were two-fold: 1) to compare a user-selected attribute at a user-selected timestep across every model in the ensemble and, 2) to calculate the difference in oil thickness between two user-selected models in the ensemble, and to compute and overlay the difference in Cumulative Oil Production for each well in the two models. In both cases the team needed a solution where the inputs/outputs could be easily changed, and new results generated rapidly.
Figure 1. .SO_max computed for an ensemble of 20 reservoir simulation grids.
For the second goal, determining the difference in oil thickness between two models in the ensemble, a custom Python Jupyter notebook was utilized to do the following steps:
- Read two user-selected simulation grids from the ensemble.
- Compute oil thickness (porosity*Oil Saturation*Net to Gross) at a user-given timestep for each model.
- For each model, sum the oil thickness over a user input k-layer range, then calculate the difference and output the result as a 2D map.
- Read the Cumulative Oil Production (COP) data for all wells in the two simulation models.
- Compute the difference in COP between the two models.
- Create a COP bubble map of the difference.
- Overlay the COP bubble map on the 2D oil thickness difference map.
Figure 2. Oil thickness difference with COP bubble map overlay for two user-selected reservoir simulation models within an ensemble.
See the CoViz 4D page for more information.