Matlab reservoir toolbox user guide

We track Knut-Andreas Lie’s progress on his user guide to Sintef’s MRST, a 450 plus page introduction to petroleum geology and engineering for computer scientists and mathematicians.

Knut-Andreas Lie’s Introduction to reservoir simulation using Matlab doubles as a user guide for Norway’s Sintef R&D organization’s Matlab reservoir simulation toolbox (MRST). The MRST UG is work in progress but, at 458 pages, is already a substantial oeuvre. In his introduction, Lie observes that many books already cover mathematical models for flow in porous media along with introductory numerical methods. But current literature fails to implement such models and numerical methods in a ‘robust and efficient simulator.’ Lie claims a different approach, with a combination of a self-contained introduction to flow simulation along with a discussion, complete with MRST-based examples, on real world implementation. The MRST handbook is backed up with a companion module of example code and short instructional videos originally developed as Standford’s ‘Jolts’ just-in-time online learning tools.

Lie is something of an evangelist for scripting (in Matlab or Python) over object-oriented languages like C++ which often are ‘alien and unintuitive’ to engineers and involve many library version gotchas. Matlab’s ‘simple and intuitive’ syntax assures compatibility across different platforms and provides built-in functions for numerical computations, data analysis, and visualization. One complaint often made by would-be developers is a lack of access to real-world data sets. The MRST UG includes copious pointers to sample data sets from the SPE’s comparative solution project, NTNU’s Norne benchmark, the EU Saigup project and for those interested in CO2 sequestration, grids from the CO2 Storage Atlas of the Norwegian North Sea. For users of Sclumberger’s Eclipse industry standard simulators, a module converts Eclipse input decks into MRST-compatible objects. We balked at a complete review of this huge book and instead asked Lie for help and some clarification.

The book does a good job of explaining geology to non-geologists, are you also trying to teach petroleum engineering to geologists, or do you assume a grounding in PE of the reader.

Not really. Personally I am more of a mathematician and computer scientist than geologist or petroleum engineer. The book should be seen as an attempt to teach people like me something about geology and PE.

Are you using the MRST to teach PE? Is the MRST UG usable as a PE textbook?

Not yet, but as the book expands to also cover two-phase flow and three-phase, black-oil equations, it should prove useful. This is what I will be working on whenever I have time to spare over the next couple of months.

What is your target audience?

Students, researchers and anybody interested in learning more about simulation of flow and transport in the subsurface. However, I realize that the book has a strong flavor of PE.

What about someone in an oil company who just wants to avoid paying an Eclipse license? Would you expect a PE in a small company to be able to use the MRST in an operational context?

Absolutely. We don’t support all of Eclipse’s more exotic keywords. But keyword support is added whenever we or one of our clients/collaborators need it in their research. However, the most recent versions of MRST support a lot of the central keywords you need in order to simulate a typical black-oil reservoir model. The software has been successfully validated against Eclipse on a number of field cases. Likewise, we are adding in support for EOR, geomechanics, thermal effects, geochemistry, etc. Actually, we are already in contact with a number of users of the kind you are referring to. We also have a number of expert users in big oil/service companies who have full access to commercial/in-house simulators, but still find MRST to be more flexible and easy to use for special purposes, although they may not admit this publicly! In summary, I think MRST is not far from being usable in an operational context. However, to really know what the toolbox is capable of, you may have to dig into the software yourself, or work with my team.

MRST is open source software but Matlab is not. Have you tried running the software against open source Matlab clones like SciLab?

We have tried MRST with GNU Octave and it works fine for most of the older parts of the software (incompressible flow). The exception is plotting, which is not that well supported in Octave. The newer parts of MRST (fully-implicit codes for black-oil and EOR models) relies on user-defined classes in Matlab, which is not yet supported in Octave. We have not yet tried SciLab. However, my impression is that SciLab does not support some of the nice functionality we use to write efficient Matlab, like accumarray, bsxfun, cellfun, etc. We have also started developing a MRST clone in Python, but this work is not yet in a state where it can be released publicly. Finally, MRST has got a C++ cousin, OPM, that aims to become an open-source reservoir simulator for operational use.

Download the MRST here and read a preliminary edition of the MRST UG here.

Click here to comment on this article

Click here to view this article in context on a desktop

© Oil IT Journal - all rights reserved.