SlideShare a Scribd company logo
MATLAB Reservoir Simulation Toolbox
(MRST)
by
Rupak
Department of Chemical Engineering
Indian Institute of Technology Guwahati
The MATLAB Reservoir Simulation Toolbox
 A free open-source software for petroleum reservoir:
 reading
 running simulation
 visualization
 MRST is not a primarily a simulator:
 developed as a research tool by researcher at SINTEF Digital.
 can be downloaded and used under GNU General Public License (GPL).
 To download, visit: www.sintef.no/mrst/
 MRST offers black-oil and compositional model capable of simulating industry-standard problems.
 Graphical user interfaces for post-processing simulation results.
April 24, 2025 CL 644: Reservoir Simulation 2
Core Functionality & Add-on Modules
April 24, 2025 CL 644: Reservoir Simulation 3
MRST= Core Modules + Add-on Modules
Core Functionality & Add-on Modules
April 24, 2025 CL 644: Reservoir Simulation 4
 Core Module
 data structures for creating and manipulating grids.
 petro-physical data
 drive mechanism: gravity, boundary conditions, source terms, and wells
 Automatic differentiations.
 Add-on modules
 discretization : TPFA, MPFA, mimetic etc.
 flow equations and solvers
 workflow tools: coarsening, upscaling, flow diagnostics, visualization
 analysis of large-scale CO2 storage in saline aquifers.
 special models like geomechanics and fractured reservoirs
Overview of Functionality
Grid generation and coarsening
April 24, 2025 Flow Visualization Lab 5
 upr: used to generates the 2D or 3D
Voronoi grid.
 coarsegrid: data structures and
simple coarsening
 agglom: to create an adapted coarse
partition.
 libgeometry: to compute geometric
quantities like cell volumes, areas ,
centroids etc.
 opm_gridprocessing: contains
functionality for reading and
processing the GRID section of
ECLIPSE input data.
 triangle: to create triangular grid
Overview of Functionality
Discretization and solvers for incompressible flow:
April 24, 2025 Flow Visualization Lab 6
 incomp: incompressible, two phase
flow. This module implements two point
flux approximations (TPFA) and
implicit/explicit transport solver.
 mimetic, mfpa, ntpfa, vem implements
consistent discretization.
 adjoint: Implements strategies for
production optimization for
incompressible, two-phase flow
Overview of Functionality
Implicit solvers based on Automatic Differentiation:
April 24, 2025 Flow Visualization Lab 7
The automatic differentiation-object oriented (AD-OO) frame work offers fully implicit simulators from
industry-standard input decks, including computations of adjoints
Overview of Functionality
Workflow tools:
April 24, 2025 Flow Visualization Lab 8
 co2lab: comprehensive tools for large-
scale CO2 storage saline aquifers
 diagnostics: flow diagnostics,
 mrst-gui: interactive visualization
 optimization: solution of optimal control
problems based on AD-OO
 enkf and remso: third-party modules for
EnKF (Ensemble Kalman filter) and
multiple-shooting optimization
Overview of Functionality
Upscaling and multiscale methods
April 24, 2025 Flow Visualization Lab 9
 msrsb is state-of-the art multiscale
solver.
 msfem: implements multiscale finite
elements method on unstructured grids.
 msfvm: Implements the operator
formulation of the multiscale finite-
volume method for incompressible flow
on structured and unstructured grids.
 hfm: implements msrsb this for fracture
models
 upscaling: flow-based single-phase
upscaling.
 steady-state: multiphase upscaling based
on steady state assumptions.
Overview of Functionality
Fractured Media
April 24, 2025 Flow Visualization Lab 10
dfm: discrete fracture models, hfm: hierarchical/embedded fracture models
Downloading and Installing
April 24, 2025 CL 644: Reservoir Simulation 11
Download official release from SINTEF Digital official website and extract
mrst-2021b containing all parts of software.
Since MRST is a secondary software you need to activate the software in
MATLAB
 You have to run startup.m script to activate MRST
MRST Package Welcome Message
Exploring Functionality and Getting Help
April 24, 2025 CL 644: Reservoir Simulation 12
 To find out what a specific function does, you ca type help function_Name in the
command window
Example of Automatic Differentiation (AD)
April 24, 2025 CL 644: Reservoir Simulation 13
We want to compute z = f(x,y) = x3
y and its partial derivatives for the values x=1 and y = 2.
z = f(x,y) = x3
y
𝜕𝑧
𝜕𝑥
=3 𝑥 2 𝑦
𝜕 𝑧
𝜕 𝑦
=𝑥 3
z | x=1,y=2 = 2
𝜕𝑧
𝜕𝑥
| x=1,y =2=6
𝜕 𝑧
𝜕 𝑦
| x=1,y =2=1
Manual
 Independent variables: x, y
 Dependent variable: z
[x,y] = initVariablesADI(1,2);
Independent variables Initialized value of IV
𝜕𝑥
𝜕𝑥
|1,2
𝜕 𝑥
𝜕 𝑦
|1,2
𝜕 𝑦
𝜕 𝑥
|1,2
𝜕 𝑦
𝜕 𝑦
|1,2 𝜕𝑧
𝜕𝑥
|1,2
𝜕 𝑧
𝜕 𝑦
|1,2
Basic Data Structures in a Model
April 24, 2025 CL 644: Reservoir Simulation 14
Fluid properties:
fluid = initSingleFluid('mu' , 1*centi*poise , ...
'rho', 1014*kilogram/meter^3);
fluid = initSimpleFluid('mu' , [ 1, 10]*centi*poise , ...
'rho', [1014, 859]*kilogram/meter^3, ...
'n' , [ 2, 2]);
fluid = initCoreyFluid('mu' , [ 1, 10]*centi*poise , ...
'rho', [1014, 859]*kilogram/meter^3, ...
'n' , [ 2, 2] , ...
'sr' , [ 0.2, 0.2] , ...
'kwm', [ 0.85, 0.60]);
Single-Phase Flow
Two-Phase Flow
• Corey model with exponent ‘n’
• Zero residual saturation
• krw=, kro=
Two-Phase Flow
• Corey model with exponent ‘n’
• With residual saturation
• krw=, kro=
Basic Data Structures in a Model
April 24, 2025 CL 644: Reservoir Simulation 15
Reservoir states:
state = initResSol(G, p0,s0);
state = initResSol(G, W, p0,s0);
• p0 = Initial pressure
• s0 = Initial saturation
• When there are wells in the reservoir
• Additional field ‘wellsol’
• wellSol = initWellSol(W, pw0);
𝑠0=
{ 1, 𝐹𝑜𝑟 𝑠𝑖𝑛𝑔𝑙𝑒− h
𝑝 𝑎𝑠𝑒
[𝑠𝑤 0𝑠𝑜 0], 𝐹𝑜𝑟 𝑡𝑤𝑜− h
𝑝 𝑎𝑠𝑒 𝑓𝑙𝑜𝑤
Basic Data Structures in a Model
April 24, 2025 CL 644: Reservoir Simulation 16
Fluid sources:
src = addSource(src, cells, rates, ‘sat’, sat)
 src = an empty array (src==[])
 rates = volumetric flow rates of sources
 sat = fluid composition of injected fluids with rate > 0
Example:
src==[]
src = addSource(src, 1,1,[], 100*m3/day, ‘sat’, 1)
Boundary conditions:
bc = addBC(bc, faces, type, values, ‘sat’, sat)
 bc = an empty array (bc==[])
 faces = faces for which the conditions are set
 type = type of boundary condition: pressure or flux
 values = pressure of flux value for the given conditions
Basic Data Structures in a Model
April 24, 2025 CL 644: Reservoir Simulation 17
Boundary conditions:
bc = pside(bc, G, ‘side’,p)
bc = fluxside(bc, G, ‘side’,flux)
Side argument is a string which one out of the following six alias groups:
• West/Xmin/Left
• East/Xmax/Right
• South/Ymin/Back
• North/Ymax/Front
• Upper/Zmin/Top
• Lower/Zmax/Bottom
Basic Data Structures in a Model
April 24, 2025 CL 644: Reservoir Simulation 18
Wells:
W = addWell(W, G, rock, cellInx)
W = verticalWell(W, G, rock, I, J, K, 'pn1', pv1, ...)
W = verticalWell(W , G, rock, I, J, K, 'Type', 'rate/bhp', ...
'InnerProduct', well_ip, ...
'Val’,rate/bhp value, 'Radius’, radious of well, ...
'Name', ‘I/P', 'Comp_i', [1, 0],'Sign',1);
 I,J,K=Location of well
 Type = String specifying the well control: rate or bhp
 InnerProduct = Method of consistent discretizations
 Val = Target value of well control
 Radius =Welbore radius in meters
 Name = String giving the name of the well
 Comp_i = Fluid composition for injection well
 Sign = Well type: Production (sign=-1)/Injection (sign=1)
Example:
April 24, 2025 CL 644: Reservoir Simulation 19
Problem 1: Quarter five-spot problem
- Flow equations: - .( )=q
∇ 𝐾∇𝑝
- Single-phase incompressible flow
- 2D cartesian grid covering 500× 500 m2
- Two source term at diagonally opposite corners
- Permeability = 100 mD and Porosity = 0.25
- Fluid = Water
Problem 2: Boundary conditions
- The reservoir is 50 m thick and is restricted to a 1 × 1 km2
area.
- The permeability is uniform and anisotropic, with a diagonal (1,000, 300, 10) mD tensor
- the porosity is uniform and equal 0.2
- the reservoir is represented as a 20×20×5 rectangular grid
- Neumann conditions with total inflow of 100 m3
/day on the east boundary
- Dirichlet conditions with fixed pressure of 25 bar on the west boundary
Grids:
April 24, 2025 CL 644: Reservoir Simulation 20
 MRST Module: gridProcessing
 Features:
 a common data structures and infrastructures for all types of grids
 all grids are assumed to be unstructured
 nbo grid generator
 several grid factory routines for : regular cartesian grids, rectilinear grids, triangular grids etc.
Regular Cartesian Grid Rectilinear Grid Triangular Grid
Grids:
April 24, 2025 CL 644: Reservoir Simulation 21
 Basic files and their functions:
 cartGrid - Construct 2d or 3d Cartesian grid in physical space
 tensorGrid - Construct Cartesian grid with variable physical cell sizes
 tetrahedralGrid - Construct valid grid definition from points and tetrahedron list
 triangleGrid - Construct valid grid definition from points and triangle list
 computeGeometry - Add geometry information (centroids, volumes, areas) to a grid
Parameters:
April 24, 2025 CL 644: Reservoir Simulation 22
 MRST Module: params
 Features:
 Data structures for petrophysical properties
 Routines for setting and manipulating : boundary conditions, source/sink, well models etc.
 Basic files and their functions: Rock
 makeRock - Create rock structure from given permeabilty and porosity values
 grdecl2Rock - Extract rock properties from input deck
 permeabilityConverter - Add tensor permeability to GRDECL struct
 permTensor - Expand permeability tensor to full format.
 poreVolume - Compute pore volumes of individual cells in grid.
*GRDECL: Grid section of an ECLIPSE deck
Rock Modelling: Example
April 24, 2025 CL 644: Reservoir Simulation 23
 Homogeneous modelling:
 Square 10 × 10 grid model with a uniform porosity of 0.2 and isotropic permeability
equal 200 mD
 The permeability is uniform and anisotropic, with a diagonal (1,000, 100, 10) mD
tensor the porosity is uniform and equal 0.2
 Heterogeneous modelling:
 Generate φ as a Gaussian field and then compute K from the Carman–Kozeny relation
Upscaling
April 24, 2025 CL 644: Reservoir Simulation 24
• Also called homogenization
• Replace number of heterogeneous fine grid blocks with one equivalent coarse homogeneous grid
block
• Properties of fine scale model are approximated by that of a coarse model
• It’s an averaging procedure
• Additive properties
 Porosity
 Fluid saturations
• Non-additive properties: Permeability
Why Upscaling?
April 24, 2025 CL 644: Reservoir Simulation 25
• First level upscaling :
 Laboratory data interpretation at the scale of reservoir.
• Second level upscaling:
 Scales properties of a fine grid to a coarse grid
 Scale up of geological grid to simulator grid for numerical simulation
• Other example:
 Consideration of first-hand-data distribution.
 Reservoir engineers usually apply a finer local grid in well-denser-area as well as in wellbore
around, and apply a coarser grid in well-thinner-area.

More Related Content

PDF
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
PDF
Overview of reservoir simulation Basic Level.pdf
PPT
Reservoir Simulation
PPTX
Mathematicals Models
 
PPTX
An introduction to MRST (Matlab Reservoir Simulation Toolbox)
PPTX
Static model development
PDF
DSD-INT 2016 Delft3D Flexible Mesh Suite 2017 in a nutshell - Melger
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
Overview of reservoir simulation Basic Level.pdf
Reservoir Simulation
Mathematicals Models
 
An introduction to MRST (Matlab Reservoir Simulation Toolbox)
Static model development
DSD-INT 2016 Delft3D Flexible Mesh Suite 2017 in a nutshell - Melger

Similar to Introduction to MRST for Reservoir Simulation (20)

PPT
Some examples of Open Source computational tools for researchers
PDF
DSD-INT 2015 - The present and future 3D world in and around D-Flow FM - Rob ...
PDF
DSD-INT 2024 Delft3D FM Suite 2025.01 1D2D - Beta testing programme - Hutten
PPTX
Reservoir Modeling with Petrel
PDF
Rock Flow Dynamics (Rfd)
PPT
Fluent and Gambit Workshop
PDF
Scientific visualization with_gr
PDF
User guide of reservoir geological modeling v2.2.0
PPSX
AQUASOIL FEFLOW Training Slides
PPTX
Python Awareness for Exploration and Production Students and Professionals
PPTX
Shweta_Varma_project presentation 23NA60R14.pptx
PPTX
Practice for petroelum reservoir simulation using Eclipse Software
PDF
turecko-150426_pse_01
PDF
Efficient Simulations for Contamination of Groundwater Aquifers under Uncerta...
PPTX
Developing Computational Skills in the Sciences with Matlab Webinar 2017
PPT
Secrets of supercomputing
PPT
Secrets of supercomputing
PDF
Structural Dynamics Toolbox and OpenFEM, a technical overview
PDF
Semester Project in Reservoir Simulation
PDF
DSD-INT 2015 - Overview of development and plans - Dirk-jan Walstra
Some examples of Open Source computational tools for researchers
DSD-INT 2015 - The present and future 3D world in and around D-Flow FM - Rob ...
DSD-INT 2024 Delft3D FM Suite 2025.01 1D2D - Beta testing programme - Hutten
Reservoir Modeling with Petrel
Rock Flow Dynamics (Rfd)
Fluent and Gambit Workshop
Scientific visualization with_gr
User guide of reservoir geological modeling v2.2.0
AQUASOIL FEFLOW Training Slides
Python Awareness for Exploration and Production Students and Professionals
Shweta_Varma_project presentation 23NA60R14.pptx
Practice for petroelum reservoir simulation using Eclipse Software
turecko-150426_pse_01
Efficient Simulations for Contamination of Groundwater Aquifers under Uncerta...
Developing Computational Skills in the Sciences with Matlab Webinar 2017
Secrets of supercomputing
Secrets of supercomputing
Structural Dynamics Toolbox and OpenFEM, a technical overview
Semester Project in Reservoir Simulation
DSD-INT 2015 - Overview of development and plans - Dirk-jan Walstra
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPT
Project quality management in manufacturing
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
additive manufacturing of ss316l using mig welding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Welding lecture in detail for understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Digital Logic Computer Design lecture notes
PPTX
CH1 Production IntroductoryConcepts.pptx
OOP with Java - Java Introduction (Basics)
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
CYBER-CRIMES AND SECURITY A guide to understanding
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Project quality management in manufacturing
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
additive manufacturing of ss316l using mig welding
bas. eng. economics group 4 presentation 1.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Foundation to blockchain - A guide to Blockchain Tech
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Welding lecture in detail for understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Digital Logic Computer Design lecture notes
CH1 Production IntroductoryConcepts.pptx
Ad

Introduction to MRST for Reservoir Simulation

  • 1. MATLAB Reservoir Simulation Toolbox (MRST) by Rupak Department of Chemical Engineering Indian Institute of Technology Guwahati
  • 2. The MATLAB Reservoir Simulation Toolbox  A free open-source software for petroleum reservoir:  reading  running simulation  visualization  MRST is not a primarily a simulator:  developed as a research tool by researcher at SINTEF Digital.  can be downloaded and used under GNU General Public License (GPL).  To download, visit: www.sintef.no/mrst/  MRST offers black-oil and compositional model capable of simulating industry-standard problems.  Graphical user interfaces for post-processing simulation results. April 24, 2025 CL 644: Reservoir Simulation 2
  • 3. Core Functionality & Add-on Modules April 24, 2025 CL 644: Reservoir Simulation 3 MRST= Core Modules + Add-on Modules
  • 4. Core Functionality & Add-on Modules April 24, 2025 CL 644: Reservoir Simulation 4  Core Module  data structures for creating and manipulating grids.  petro-physical data  drive mechanism: gravity, boundary conditions, source terms, and wells  Automatic differentiations.  Add-on modules  discretization : TPFA, MPFA, mimetic etc.  flow equations and solvers  workflow tools: coarsening, upscaling, flow diagnostics, visualization  analysis of large-scale CO2 storage in saline aquifers.  special models like geomechanics and fractured reservoirs
  • 5. Overview of Functionality Grid generation and coarsening April 24, 2025 Flow Visualization Lab 5  upr: used to generates the 2D or 3D Voronoi grid.  coarsegrid: data structures and simple coarsening  agglom: to create an adapted coarse partition.  libgeometry: to compute geometric quantities like cell volumes, areas , centroids etc.  opm_gridprocessing: contains functionality for reading and processing the GRID section of ECLIPSE input data.  triangle: to create triangular grid
  • 6. Overview of Functionality Discretization and solvers for incompressible flow: April 24, 2025 Flow Visualization Lab 6  incomp: incompressible, two phase flow. This module implements two point flux approximations (TPFA) and implicit/explicit transport solver.  mimetic, mfpa, ntpfa, vem implements consistent discretization.  adjoint: Implements strategies for production optimization for incompressible, two-phase flow
  • 7. Overview of Functionality Implicit solvers based on Automatic Differentiation: April 24, 2025 Flow Visualization Lab 7 The automatic differentiation-object oriented (AD-OO) frame work offers fully implicit simulators from industry-standard input decks, including computations of adjoints
  • 8. Overview of Functionality Workflow tools: April 24, 2025 Flow Visualization Lab 8  co2lab: comprehensive tools for large- scale CO2 storage saline aquifers  diagnostics: flow diagnostics,  mrst-gui: interactive visualization  optimization: solution of optimal control problems based on AD-OO  enkf and remso: third-party modules for EnKF (Ensemble Kalman filter) and multiple-shooting optimization
  • 9. Overview of Functionality Upscaling and multiscale methods April 24, 2025 Flow Visualization Lab 9  msrsb is state-of-the art multiscale solver.  msfem: implements multiscale finite elements method on unstructured grids.  msfvm: Implements the operator formulation of the multiscale finite- volume method for incompressible flow on structured and unstructured grids.  hfm: implements msrsb this for fracture models  upscaling: flow-based single-phase upscaling.  steady-state: multiphase upscaling based on steady state assumptions.
  • 10. Overview of Functionality Fractured Media April 24, 2025 Flow Visualization Lab 10 dfm: discrete fracture models, hfm: hierarchical/embedded fracture models
  • 11. Downloading and Installing April 24, 2025 CL 644: Reservoir Simulation 11 Download official release from SINTEF Digital official website and extract mrst-2021b containing all parts of software. Since MRST is a secondary software you need to activate the software in MATLAB  You have to run startup.m script to activate MRST MRST Package Welcome Message
  • 12. Exploring Functionality and Getting Help April 24, 2025 CL 644: Reservoir Simulation 12  To find out what a specific function does, you ca type help function_Name in the command window
  • 13. Example of Automatic Differentiation (AD) April 24, 2025 CL 644: Reservoir Simulation 13 We want to compute z = f(x,y) = x3 y and its partial derivatives for the values x=1 and y = 2. z = f(x,y) = x3 y 𝜕𝑧 𝜕𝑥 =3 𝑥 2 𝑦 𝜕 𝑧 𝜕 𝑦 =𝑥 3 z | x=1,y=2 = 2 𝜕𝑧 𝜕𝑥 | x=1,y =2=6 𝜕 𝑧 𝜕 𝑦 | x=1,y =2=1 Manual  Independent variables: x, y  Dependent variable: z [x,y] = initVariablesADI(1,2); Independent variables Initialized value of IV 𝜕𝑥 𝜕𝑥 |1,2 𝜕 𝑥 𝜕 𝑦 |1,2 𝜕 𝑦 𝜕 𝑥 |1,2 𝜕 𝑦 𝜕 𝑦 |1,2 𝜕𝑧 𝜕𝑥 |1,2 𝜕 𝑧 𝜕 𝑦 |1,2
  • 14. Basic Data Structures in a Model April 24, 2025 CL 644: Reservoir Simulation 14 Fluid properties: fluid = initSingleFluid('mu' , 1*centi*poise , ... 'rho', 1014*kilogram/meter^3); fluid = initSimpleFluid('mu' , [ 1, 10]*centi*poise , ... 'rho', [1014, 859]*kilogram/meter^3, ... 'n' , [ 2, 2]); fluid = initCoreyFluid('mu' , [ 1, 10]*centi*poise , ... 'rho', [1014, 859]*kilogram/meter^3, ... 'n' , [ 2, 2] , ... 'sr' , [ 0.2, 0.2] , ... 'kwm', [ 0.85, 0.60]); Single-Phase Flow Two-Phase Flow • Corey model with exponent ‘n’ • Zero residual saturation • krw=, kro= Two-Phase Flow • Corey model with exponent ‘n’ • With residual saturation • krw=, kro=
  • 15. Basic Data Structures in a Model April 24, 2025 CL 644: Reservoir Simulation 15 Reservoir states: state = initResSol(G, p0,s0); state = initResSol(G, W, p0,s0); • p0 = Initial pressure • s0 = Initial saturation • When there are wells in the reservoir • Additional field ‘wellsol’ • wellSol = initWellSol(W, pw0); 𝑠0= { 1, 𝐹𝑜𝑟 𝑠𝑖𝑛𝑔𝑙𝑒− h 𝑝 𝑎𝑠𝑒 [𝑠𝑤 0𝑠𝑜 0], 𝐹𝑜𝑟 𝑡𝑤𝑜− h 𝑝 𝑎𝑠𝑒 𝑓𝑙𝑜𝑤
  • 16. Basic Data Structures in a Model April 24, 2025 CL 644: Reservoir Simulation 16 Fluid sources: src = addSource(src, cells, rates, ‘sat’, sat)  src = an empty array (src==[])  rates = volumetric flow rates of sources  sat = fluid composition of injected fluids with rate > 0 Example: src==[] src = addSource(src, 1,1,[], 100*m3/day, ‘sat’, 1) Boundary conditions: bc = addBC(bc, faces, type, values, ‘sat’, sat)  bc = an empty array (bc==[])  faces = faces for which the conditions are set  type = type of boundary condition: pressure or flux  values = pressure of flux value for the given conditions
  • 17. Basic Data Structures in a Model April 24, 2025 CL 644: Reservoir Simulation 17 Boundary conditions: bc = pside(bc, G, ‘side’,p) bc = fluxside(bc, G, ‘side’,flux) Side argument is a string which one out of the following six alias groups: • West/Xmin/Left • East/Xmax/Right • South/Ymin/Back • North/Ymax/Front • Upper/Zmin/Top • Lower/Zmax/Bottom
  • 18. Basic Data Structures in a Model April 24, 2025 CL 644: Reservoir Simulation 18 Wells: W = addWell(W, G, rock, cellInx) W = verticalWell(W, G, rock, I, J, K, 'pn1', pv1, ...) W = verticalWell(W , G, rock, I, J, K, 'Type', 'rate/bhp', ... 'InnerProduct', well_ip, ... 'Val’,rate/bhp value, 'Radius’, radious of well, ... 'Name', ‘I/P', 'Comp_i', [1, 0],'Sign',1);  I,J,K=Location of well  Type = String specifying the well control: rate or bhp  InnerProduct = Method of consistent discretizations  Val = Target value of well control  Radius =Welbore radius in meters  Name = String giving the name of the well  Comp_i = Fluid composition for injection well  Sign = Well type: Production (sign=-1)/Injection (sign=1)
  • 19. Example: April 24, 2025 CL 644: Reservoir Simulation 19 Problem 1: Quarter five-spot problem - Flow equations: - .( )=q ∇ 𝐾∇𝑝 - Single-phase incompressible flow - 2D cartesian grid covering 500× 500 m2 - Two source term at diagonally opposite corners - Permeability = 100 mD and Porosity = 0.25 - Fluid = Water Problem 2: Boundary conditions - The reservoir is 50 m thick and is restricted to a 1 × 1 km2 area. - The permeability is uniform and anisotropic, with a diagonal (1,000, 300, 10) mD tensor - the porosity is uniform and equal 0.2 - the reservoir is represented as a 20×20×5 rectangular grid - Neumann conditions with total inflow of 100 m3 /day on the east boundary - Dirichlet conditions with fixed pressure of 25 bar on the west boundary
  • 20. Grids: April 24, 2025 CL 644: Reservoir Simulation 20  MRST Module: gridProcessing  Features:  a common data structures and infrastructures for all types of grids  all grids are assumed to be unstructured  nbo grid generator  several grid factory routines for : regular cartesian grids, rectilinear grids, triangular grids etc. Regular Cartesian Grid Rectilinear Grid Triangular Grid
  • 21. Grids: April 24, 2025 CL 644: Reservoir Simulation 21  Basic files and their functions:  cartGrid - Construct 2d or 3d Cartesian grid in physical space  tensorGrid - Construct Cartesian grid with variable physical cell sizes  tetrahedralGrid - Construct valid grid definition from points and tetrahedron list  triangleGrid - Construct valid grid definition from points and triangle list  computeGeometry - Add geometry information (centroids, volumes, areas) to a grid
  • 22. Parameters: April 24, 2025 CL 644: Reservoir Simulation 22  MRST Module: params  Features:  Data structures for petrophysical properties  Routines for setting and manipulating : boundary conditions, source/sink, well models etc.  Basic files and their functions: Rock  makeRock - Create rock structure from given permeabilty and porosity values  grdecl2Rock - Extract rock properties from input deck  permeabilityConverter - Add tensor permeability to GRDECL struct  permTensor - Expand permeability tensor to full format.  poreVolume - Compute pore volumes of individual cells in grid. *GRDECL: Grid section of an ECLIPSE deck
  • 23. Rock Modelling: Example April 24, 2025 CL 644: Reservoir Simulation 23  Homogeneous modelling:  Square 10 × 10 grid model with a uniform porosity of 0.2 and isotropic permeability equal 200 mD  The permeability is uniform and anisotropic, with a diagonal (1,000, 100, 10) mD tensor the porosity is uniform and equal 0.2  Heterogeneous modelling:  Generate φ as a Gaussian field and then compute K from the Carman–Kozeny relation
  • 24. Upscaling April 24, 2025 CL 644: Reservoir Simulation 24 • Also called homogenization • Replace number of heterogeneous fine grid blocks with one equivalent coarse homogeneous grid block • Properties of fine scale model are approximated by that of a coarse model • It’s an averaging procedure • Additive properties  Porosity  Fluid saturations • Non-additive properties: Permeability
  • 25. Why Upscaling? April 24, 2025 CL 644: Reservoir Simulation 25 • First level upscaling :  Laboratory data interpretation at the scale of reservoir. • Second level upscaling:  Scales properties of a fine grid to a coarse grid  Scale up of geological grid to simulator grid for numerical simulation • Other example:  Consideration of first-hand-data distribution.  Reservoir engineers usually apply a finer local grid in well-denser-area as well as in wellbore around, and apply a coarser grid in well-thinner-area.