11/7/2021
RESERVOIR SIMULATION
Lecture Three
Law of Mass Conservation
and Finite Difference Approximation
1
11/7/2021
Part 1
Law of Mass Conservation
Law of Mass Conservation
The conservation of mass is a material-balance equation written for a component in
a control volume of the system to be modeled.
In petroleum reservoirs, the control volume is made up of a porous medium containing
one, two, or three fluid phases.
The control volume, whose shape depends on the coordinate system used in the
model, is chosen and a material balance for the component is written over it.
2
11/7/2021
Law of Mass Conservation
The material balance equation for any component, c, in the system may be
expressed as:
where mi = “mass in” = the mass of the component entering the control volume from
other parts of reservoir, mo = “mass out” = the mass of the component leaving the
control volume to other parts of reservoir, ms = “sink/source” = the mass of the
component leaving or entering the control volume externally (through wells); and ma =
“mass accumulated” = the mass of excess material stored in or depleted from the
control volume over a time interval.
Mass Conservation for Single-Phase Flow
in One Dimension
➢ the final eq. of mass conservation for single-phase flow in
one dimension becomes:
➢ Now we should derive this eq.
3
11/7/2021
Mass Conservation for Single-Phase Flow
in Multidimensions
➢ the final eq. of mass conservation for single-phase flow in
one multidimensions becomes:
Basic Single-Phase-Flow Equation
Combining Darcy’s law for single-phase flow and the mass-conservation equation
yields the flow equation for single-phase flow.
4
11/7/2021
Part 2
Finite Difference Approximation
Basic Differential Calculus
Differential calculus forms the mathematical basis for describing recovery processes
observed in hydrocarbon reservoirs.
Because practicing simulation engineers rarely directly apply differential calculus
techniques. This lecture considers only the methods used directly to derive, simplify,
and expand reservoir-simulation equations.
5
11/7/2021
Examples
1. Expand the left side:
2. Find the derivative of The single-phase transmissibility of a porous medium to gas with
respect to pressure:
6
11/7/2021
Taylor Series Expansion
One of the most useful tools in numerical analysis is the Taylor series expansion, which
provides a means for converting most well-behaved functions into simple polynomials.
Has the form:
where f(x) has N+1 continuous derivatives evaluated at x= xo. Above eq. can be
written in a more compact form as:
Taylor Series Expansion
The reminder term:
When the remainder term is included in the expansion, the Taylor series is an exact
representation of f(x). If the expansion is carried out for a finite number of terms and the
remainder is ignored, then the Taylor series expansion is only an approximation of f(x).
That is,
7
11/7/2021
Discretization
The result of the formulation process is a set of coupled, nonlinear PDE’s that describes
fluid flow through porous media.
Because of the nonlinear nature of the equations, analytical techniques cannot be
used and solutions must be obtained with numerical (approximate) methods. In
contrast to analytical solutions, numerical solutions give the values of pressure and
saturation only at discrete points in the reservoir.
Discretization is the process of converting the PDE’s into algebraic equations.
The spatial domain is divided into a number of grids (also called cells or blocks) and the
time domain discretized to a number of time steps.
Several numerical methods can be used to discretize the fluid flow equations; however,
the most common approach in the oil industry is the finite-difference method. Finite-
difference calculus is related to differential calculus through the Taylor series expansion.
Spatial Discretization
1D grid system
.1 . . . .i .
i+1 . . .N
2D grid system 3D grid system
i-1
i,j-1
i-1,j i,j i+1,j
i,j+1
8
11/7/2021
Time Discretization
Superscript indicates
time index
Subscript indicates
block index
tn+1
Pin
tn
i-1
t
i,j-1
t1
i-1,j i,j i+1,j
i,j+1 t0
Finite-Difference Calculus
The differential calculus discussed in the previous slides is appropriate for continuous
functions only.
In petroleum reservoir applications, a situation often arises where functional values are
known only at discrete points. For example, these discrete points can occur during field
measurements where such values as pressures and production rates are measured at
fixed time intervals.
For discrete points, mathematical techniques are also available to approximate values
of functions and their derivatives at points where they are not known.
Finite-difference calculus is the branch of mathematics that uses basic arithmetic
operations (addition, subtraction, multiplication, and division) to approximate
derivatives, differential equations, and other analytical operations performed on
continuous functions.
9
11/7/2021
Finite-Difference Operators
The basis of finite-difference calculus is a group of operators that acts on discrete
points. An operator is a sequence of mathematical operations performed in a fixed
order that acts on any number of the discrete points and results in a final number.
The operators used in finite-difference calculus include:
1. Forward-difference operator (Δ)
2. Backward-difference operator (∇)
3. Central-difference operator (δ)
Finite-Difference Operators
The forward-difference operator (Δ) of f(xi):
The backward-difference operator (∇) of f(xi):
The Central-difference operator (δ) of f(xi):
10
11/7/2021
Approximations to the First Derivative
Forward-Difference Approximation
The finite-difference operators for discrete points are related to the derivative operators
of continuous functions’ through the Taylor series expansion.
Evaluating the Taylor series expansion at and letting yields :
Approximations to the First Derivative
Forward-Difference Approximation
represents the forward-difference
approximation to the first derivative
11
11/7/2021
Approximations to the First Derivative
Forward-Difference Approximation
Approximations to the First Derivative
Forward-Difference Approximation
The forward-difference approximation to the first derivative is called a first-order
approximation because the truncation error is a function of (i.e., a second-order
approximation would be a function of , and so forth).
A higher-order approximation (for example, second-order) would be preferable
because as the spacing size, h, is reduced the truncation error would approach zero
more rapidly. In other words, fewer measured or discrete points would give the same
accuracy.
12
11/7/2021
Approximations to the First Derivative
Forward-Difference Approximation
Approximations to the First Derivative
Backward Difference Approximation
Following the same procedure as for the forward-difference approximation, by
Expanding about yields:
represents the backward-difference
approximation to the first derivative
(first-order approximation )
13
11/7/2021
Approximations to the First Derivative
Central Difference Approximation
The central-difference approximation is a higher-order approximation that is:
represents the central-difference
approximation to the first derivative
The truncation error becomes:
Approximations to the Second Derivative
The central-difference approximation is used almost exclusively to approximate the
second derivative in reservoir transport equations because of its higher-order accuracy.
represents the central-difference
approximation to the second
derivative
The truncation error becomes:
14
11/7/2021
Thank you
15