Building an open-source community for subsurface flow simulation
Authors: Lie Knut-Andreas 
Published: August 2022

The MATLAB Reservoir Simulation Toolbox (MRST) is a unique research tool for rapid prototyping and demonstration of new computational methods for flow in porous media. The software has a large user base all over the world in both academia and industry. My group is also one of the key contributors to OPM Flow, the world's first open-source reservoir simulator aimed at full industry use. In addition, we are currently developing Jutul, an upcoming Julia code for high-performance demonstrators of subsurface flow. In the talk, I will briefly describe the MRST and OPM Flow platforms, how they came to be, compare and contrast their development and ownership models, and outline some of the factors that have contributed to their current success. MRST was originally an internal research tool that has, over the last ten years, morphed into the de-facto standard tool for researchers who want to learn about subsurface flow, and obtain a head start for their own research prototypes. MRST is organized as a minimal core module offering basic data structures and functionality for representing grids and physical parameters relevant to porous media flow, and a large set of add-on modules offering discretizations, solvers, physical models, and a wide variety of simulators and workflow tools. In the modules, you will find many tutorial examples that explain and showcase how MRST can be used to make general or fit-for-purpose simulators and workflow tools. The modular structure makes it easy to add new or modify existing functionality, and many of the 60 currently released modules are authored entirely or in part at other institutions. The software is licensed under the viral GPL license, with copyright of the core parts vested at SINTEF, where we heavily rely on the code for both our contract work and academic research. The software exists as an add-on to the commercial MATLAB product, which greatly simplifies the process of getting started, but also poses certain restrictions on usage and performance potential. (Except for graphical interfaces, large parts of MRST also work well with GNU Octave.) OPM Flow aims to simulate many of the same physical processes as MRST, but its disruptive power comes from being a drop-in replacement for commercial reservoir simulators that have been developed and validated over decades. Such simulators, which are used for development planning and day to day operations of oil and gas fields and CO2 storage operations, are highly complex, expensive and difficult to modify as the source codes are not available. OPM Flow is a collaborative effort, developed in collaboration with Equinor, NORCE, and others, to provide an open-source alternative that enables more open innovation. The simulator is written in high-performance C++ and is released under the GPL license. A key requirement for the development has been that the new simulator should reproduce virtually identical simulation results as contemporary commercial tools both in hindcasting decades of production histories and in forecasting future production. Achieving this has been a vast undertaking filled with stumbling blocks and a lot of reverse engineering. The two platforms are approaching the same goal of open-source simulation of subsurface flow from opposing ends: MRST educates users in subsurface simulation and embeds them directly at the research front by giving access to the codes behind scientific papers, while OPM’s greatest achievement is that users may not notice that they have switched from an expensive closed code to a modern open-source simulator with high potential for computational speedup.