MRST - Transforming research on reservoir simulation

Release Notes for MRST 2022a

Highlights of MRST 2022a

The new release comes with three new modules, improvements in functionality and various bug fixes. In particular we would like to highlight the following:

  • New gridding functionality to build 3D grids from a set of horizons.
  • New module for importing meshes from gmsh.
  • Major revision of the test-suite module (formerly example-suite)
  • Major updates to the network-models module to reflect recent research.

New Functionality

Unstructured plotting

  • New funtion unstructuredContour: Plot 2D contours for data defined on unstructured 2D grids
  • New function unstructuredSurf: Surface plot of 2D data defined on unstructured 2D grids
  • New visualization utility function interpolateData: Interpolate data to coordinates in a grid

Grid processing

  • New function makeLayeredHorizonGrid: Build 3D grid that adapts to a set of horizons from a 2D grid by making a layered grid and interpolating z coordinates between horizons

New modules


The gmsh module provides a script for converting meshes generated by the free, open-source mesh generator and geometry modeler Gmsh to meshes in the MRST format. Gmsh is primarily a mesh generator for generating simplex meshes. A few examples are included in the module, but there are many included in the Gmsh source code. Citing from the web page “Gmsh is an open source 3D finite element mesh generator with a built-in CAD engine and post-processor. Its design goal is to provide a fast, light and user-friendly meshing tool with parametric input and advanced visualization capabilities. Gmsh is built around four modules: geometry, mesh, solver and post-processing. The specification of any input to these modules is done either interactively using the graphical user interface, in ASCII text files using Gmsh's own scripting language (.geo files), or using the C++, C, Python or Julia Application Programming Interface (API).”


This module provides an extension to the dual-porosity module. The module implements the dual porosity/dual permeability model [1]. Examples added: a modified SPE 6th comparative study [2] and a comparison with discrete fracture simulations [3].


  1. Hill, A.C., Thomas, G.W.: A new approach for simulating complex fractured reservoirs. Society of Petroleum Engineers (1985).
  2. A. Firoozabadi, L. K. Thomas, Sixth SPE Comparative Solution Project: Dual-Porosity Simulators, Journal of Petroleum Technology 42 (06): 710–763. doi: 10.2118/18741-PA.
  3. N. Andrianov and H. M. Nick. Machine learning of dual porosity model closures from discrete fracture simulations. Advances in Water Resources, 147:103810, 2021.


This module collects functionality relevant for constructing static earth modeling. It currently includes spline-based curve and surface generation from scattered points, useful for generating trend surfaces and horizons, simulation of Gaussian random fields in arbitrary dimensions, as well as semivariogram estimation and maximum likelihood estimation of probability function parameters from sampled data.

Changes to existing modules


Hashing: New function obj2hash

  • Functionality for computing the md5 checksum of an object
  • Can be used track changes to a simulation setup, and compare instances of the same setup to see if they are equal
  • NOTE: This functionality is currently in an experimental state, and may not work as expected depending on MATLAB version and operating system


  • Function “shortname” added to get the abbreviated name for an equation of state.


See release notes for the test-suite module


  • The OptimizationProblem-class is rewritten such that it now utilizes the ensemble functionalities for computations (both for single- and multiple realization problems).
  • The class now includes default setup-routines for both control optimization and parameter tuning cases.


Major revision of the test suite (formerly example suite), a unified specification of test cases in MRST. Highlights include:

  • All test case setup functions now return a setup struct with the relevant test case fields
  • Improved hashing capabilities that allow for detecting (almost) any change to the test case (experimental - see note on hashing under ad-core)
  • Improved nonlinear and linear solver selection


  • Several improvements to the code base
  • New, experimental functionality. NOTE: this is currently under development and will likely undergo major changes before the next release
  • Support for phase transitions (water can exist in liquid and/or vapor phase)
  • Support for simple group control (wells can operate under common targets)


  • Improving the main functionality with respect to stability and usability, but mostly without breaking existing API
  • Added functionality for ensemble-based calibration. This has mainly been applied to very coarse models and network models (see the network-model module) but should be applicable to more classical history matching using well observations as well.
  • Functionality for running Monte Carlo and multilevel Monte Carlo simulations for uncertainty quantification


Added support for WPIMULT keyword (multiplicative adjustment of well indices)


Added version of the discretization code that supports the use of AD-variables, as well as functionality for doing adjoint-based optimization of linear elastic moduli, boundary conditions and load term, which can be used for calibrating a geomechanical model to measurement data.


  • A new DiagnosticsModel-class is added to facilitate gradient-based (using adjoints) optimization.
  • New functionality for adjoint-based trajectory optimization using flow diagnostics proxies.
  • New examples illustrating optimization of well-controls/well-trajectories over single/multiple realizations using an NPV-proxy.


  • Support for surface plots of 2D data in plotToolbar (see notes on unstructured plotting under mrst-core)


  • The module has been completely reworked to reflect recent research
  • The NetworkModel class has been renamed to GPSNet and the creation of the model has been moved into the class constructor. Input data have changed, new member and utility functions have been added, bugs have been corrected, and the code has been documented.
  • Plotting functions have been improved and enhanced.
  • GPSNet models are now trained using a random training schedule that adds a sequence of random perturbations around the prescribed liquid-rate and bhp controls.
  • The tutorial examples have been completely reworked and more explanations added. The examples are set up using functionality from the reworked test-suite module.
  • A tutorial demonstrating the alternative CGNet approach (in which the topology of the network graph is taken from a 3D volumetric grid) has been added. This type of network is simpler to set up and will generally train better than GPSNet.


  • Support for nonlinear domain decomposition with sequential-implicit models
  • Several minor improvements, including better default subdomain nonlinear/linear solvers

Published April 19, 2021