MRST - Transforming research on reservoir simulation

Release Notes for MRST 2021a

Highlights of MRST 2021a

The release of MRST 2021a is slightly earlier in the year than recent releases. We have adjusted our release schedule such that we now aim to release in April and October. The new release comes with some improvements in functionality and minor bug fixes. In particular we would like to highlight the following:

  • Improved Octave support.
  • New functionality for cut-cell grids.
  • New functionality for setting up the new Sleipner 2019 Benchmark Model in MRST.

New Functionality

  • The Octave compatibility of MRST has been significantly improved. This includes OCT file support for MEX-accelerated automatic differentiation and full support compiled linear solvers. There is no need to load the octave module anymore and key AD solvers have been verified to run on the latest Octave 6.2 with performance that is close to that of the Matlab version. Altogether, this should make Octave much more viable for running simulations with MRST. There are still several limitations due to functionality being missing from Octave. If you use Octave with MRST and find solutions to such issues, please let us know.
  • New function 'sliceGrid' for creating (polyhedral) cut-cell grids by slicing an existing grid along lines/curves in arbitrary directions. Example-script 'cutCellGrids' demonstrates functionality.
  • A new mrstSettings feature has been added to customize automatic downloads, use of MEX extensions and other customizable features. Settings modified by this routine are persistent between Matlab/MRST sessions and are stored in a .mat file under ROOTDIR(). The file name is settings.mat on Matlab and settings_octave.mat on Octave to allow for Matlab and Octave to interact with the same MRST install.
  • The mrstPlatform routine allows for easier checking of various parameters of the current MRST host (e.g. Octave or MATLAB, if GUI is running, version numbers, etc)
  • searchForBoundaryFaces has been added. This function was previously a local function boundaryFaceIndices in CO2lab that conflicted with the private core routine of the same name.

Changes and updates to MRST core

  • discspace1 is a new routine that is similar to linspace, but allows for local or polynomial refinements of the point density.
  • ADI.numval has been removed. Use ADI.numelValue instead.

New modules


This module provides functionality for setting up a model in MRST for the new Sleipner 2019 Benchmark Model, recently released by CO2DataShare The example hybridSleipnerExample.m in the hybrid-ve module demonstrates how to setup the model, convert the original grid into a layered vertical equilibrium grid and run a simulation.

Changes to existing modules


Key changes that impact user code:

  • The syntax to the objective function (in e.g. adjoints) has been changed. The format is now obj = @(stepNo, model, state). Note that the state is the AD-initialized version.
  • Support for ministep output for adjoint solvers and inside packed problems. To support this, the “state” struct now holds a time. Restarting simulations from the previous MRST release in the new one can be unpredictible when this field is missing.
  • A new base driving force has been added in the form of the stopFunction which has a default definition:
    • StopFunction = @(model, state, state_prev) false
    This function is called between timesteps and can be used to dynamically stop the simulation by returning true when some condition is fullfilled. Models that inherit physical model should take care to either define stopFunction themselves, or to call the base class in getValidDrivingForces.

Other updates

  • Efficiency updates to AD backends that use MEX. These can now directly compile OCT files on Octave instead of using the less efficient MEX compatibility layer.
  • Many improvements to efficiacy of simulator/state function graph evaluation. This is partially done by reducing the number of calls to getProp. The effect on runtime is most pronounced on smaller cases where Matlab function calls dominate the runtime.
  • Option to evaluate all state functions in a single pass (see PhysicalModel.setStateFunctionEvaluation).
  • Fixing a bug where cells with anisotropic permeability could be deactivated if the permeability was zero in one direction.
  • combineSchedules now automatically makes the resulting schedule consistent.
  • State functions class can now validate the numerical outputs (range and if inf/nan is allowed) if validationLevel > 0.
  • Simulation runtime panel will no longer pop up partially outside of the display area on some monitor configurations.
  • mrst_demo example script which was presented at the MathWorks Energy Conference 2020 now included. A video of the presentation can be found here:


  • Logic for selecting the scaling type for CPR has been improved and made consistent across different CPR implementations.
  • See also performance improvements in ad-core, which apply to many of the standard blackoil state functions.


Added setup scripts for benchmarks SPE1, SPE3 and SPE9.


Several improvements to the sequential-implicit simulation capabilites

  • Proper scaling of pressure equation makes it possible to measure convergence of pressure equation residual also with numerical pressure reduction factors.
  • Proper relaxation of all transport variables if outer loop relaxation is enabled.
  • Improved outer loop residual convergence check.


  • Support of uniform and logarithmic node distribution in Y direction of 2D WR region to improve the grid quality when the reservoir thickness is small compared with the length of well segments.
  • New method for clipping the Voronoi diagram by function 'removeShortEdges'. The method will be used when the default method encounters errors.
  • Support of aquifers. Convert the aquifer output of original CPG to the NWM grid. Note that only the influx bottom aquifer that connects the whole bottom CPG layer is supported if the aquifer partially connects the VOI grid.

Published April 19, 2021