Clone wiki

MRST-core / Home

Welcome the MRST repositories

What is this?

This is the official main repository for the Matlab Reservoir Simulation Toolbox (MRST), an open source toolbox for simulation of flow, mechanics and transport in porous media developed at group for Computational Geosciences at SINTEF Digital. We only recommend getting MRST from the repositories for users who are interested in following the development actively and tolerate the occasional bug or broken feature. For most users, the MRST releases released twice each year are a better option, which comes pre-packaged and tested.

For more details on MRST, please see our website at

How do I work with the developer version of MRST?

MRST is organized into the core (contained in this repository) and modules (found in other repositories). Depending on your interests, you may want to clone some or all of the related repositories. A simple sample script for checking out all repositories and setting up a startup_user file can be found here. (See below for more info about the startup_user file.)

Name Description URL
core Core functionality for MRST
autodiff Solvers based on automatic differentiation: Black-oil, compressible flow, compositional and the AD framework
solvers Different solvers without automatic differentiation: Consistent discretizations, fractured media and geomechanics.
co2lab Numerical CO2 laboratory: Solvers and utilities for large-scale CO2 injection.
model-io Different utilities and modules for input and output to MRST.
multiscale Solvers and routines for scale transitions, including multiscale and upscaling implementations.
visualization Modules with a focus on visualization and graphical user interfaces.
thirdparty-modules Third-party modules for MRST. This repository contains a set of git submodules which link to other git repositories with useful modules.

Once downloaded (for example using one of the scripts in, all modules must be registered using the mrstPath routine after running startup.m in Matlab. We recommend writing a startup_user.m file in the root mrst-core folder, so that the modules are registered automatically at startup. If all repositories are checked out in the same folder like this:


the startup_user file may look like this:

% mrst-autodiff, mrst-multiscale, ...
names = {'autodiff', ...
         'multiscale', ...
         'visualization', ...
         'model-io', ...
         'thirdparty-modules', ...
% Generate paths
names = cellfun(@(x) fullfile(ROOTDIR, '..', ['mrst-', x]), names, ...
                    'UniformOutput', false);

mrstPath('addroot', names{:});
% CO2lab is a single subfolder, add specifically
mrstPath('add', 'co2lab', fullfile(ROOTDIR, '..', 'mrst-co2lab', 'co2lab'));

If you do not have a bitbucket account with SSH keys set up, the HTTPS version is recommended.

Once all repositories are cloned and paths are defined using startup_user.m, running the startup.m file in Matlab will launch MRST.