Section 3
Section 3
RESERVOIR SIMULATION
FINITE DIFFERENCE SOLUTIONS
TO PDES
𝑘 𝑑𝑝
Flow in Porous Media Darcy’s Law 𝑣=−
𝜇 𝑑𝑥
𝑑𝑣
Fluid Mechanics Newton’s Law 𝜏 = −𝜇
𝑑𝑦
Conservation Laws Governing PDE
𝑑𝑇
Heat Transfer Fourier’s Law 𝑞 = −𝑘
𝑑𝑥
𝑑𝜑
Mass Transfer Fick’s Law 𝐽 = −𝐷 How to Solve?
𝑑𝑥
Dr. Khoozan 2
1
5/13/2024
SOLUTION OF PDES
Analytical Methods
Limited Applicability
Simple Cases
Simple Geometries
Simple Boundary Conditions
Mostly Linear Problems
Numerical Methods
Finite Difference Method (FDM)
Finite Volume Method (FVM)
Finite Element Method (FEM)
Dr. Khoozan 3
Structured Grid
Purely Numerical
Simple Geometries
Dr. Khoozan 4
2
5/13/2024
Dr. Khoozan 5
Various Methods for Different Physics: Mixed Finite Element Method, Discontinuous
Galerkin Method, …
Dr. Khoozan 6
3
5/13/2024
Dr. Khoozan 7
Dr. Khoozan 8
4
5/13/2024
Dr. Khoozan 9
The terminology elliptic, parabolic, and hyperbolic chosen to classify PDEs reflects the analogy
between the form of the discriminant,𝐵2 − 4𝐴𝐶, for PDEs and the form of the discriminant, 𝐵2
− 4𝐴𝐶, which classifies conic sections.
Dr. Khoozan 10
5
5/13/2024
Dr. Khoozan 11
CHARACTERISTICS OF PDE
What impact, if any, does the classification of a PDE have on the allowable and/or required initial
and boundary conditions?
Does the classification of a PDE have any effect on the choice of numerical method employed to
solve the equation?
Dr. Khoozan 12
6
5/13/2024
CHARACTERISTICS OF PDE
In two dimensional space, characteristics are paths (curved, in general) in the solution domain
along which information propagates.
Information propagates throughout the solution domain along the characteristics paths.
Discontinuities in the derivatives of the dependent variable (if they exist) also propagate along the
characteristics paths.
Dr. Khoozan 13
CHARACTERISTICS OF PDE
If a PDE possesses real characteristics, then information propagates along these characteristics.
If no real characteristics exist, then there are no preferred paths of information propagation.
Consequently, the presence or absence of characteristics has a significant impact on the solution of
a PDE (by both analytical and numerical methods).
Dr. Khoozan 14
7
5/13/2024
CHARACTERISTICS OF PDE
A simple physical example can be used to illustrate the physical significance of characteristic paths.
Convection is the process in which a physical property is propagated (convected) through space by
the motion of the medium occupying the space.
Fluid flow is a common example of convection. The convection of a property 𝑓 of a fluid particle in
one dimension is governed by the convection equation:
Dr. Khoozan 15
CHARACTERISTICS OF PDE
The location 𝑥(𝑡) of the fluid particle is related to its velocity 𝑢(𝑡) by the relationship:
Hence, the path of the fluid particle, called its path-line, is given by:
The fluid property 𝑓 is convected along the path-line, which is the characteristic path associated
with the convection equation.
Dr. Khoozan 16
8
5/13/2024
CHARACTERISTICS OF PDE
The physical significance of the path-line (i.e., the characteristic path) as the path of propagation of
the fluid property 𝑓 is quite apparent for fluid convection.
Dr. Khoozan 17
CHARACTERISTICS OF PDE
Discontinuities in the derivatives of the solution, if they exist, must propagate along the
characteristics.
Are there any paths in the solution domain 𝐷(𝑥, 𝑦) passing through a general point 𝑃 along which
the second derivatives of 𝑓(𝑥, 𝑦) , that is, 𝑓𝑥𝑥 , 𝑓𝑥𝑦 , and 𝑓𝑦𝑦 , are multivalued or discontinuous?
Such paths, if they exist, are the paths of information propagation, that is, the characteristics.
Dr. Khoozan 18
9
5/13/2024
CHARACTERISTICS OF PDE
Dr. Khoozan 19
CHARACTERISTICS OF PDE
Elliptic PDEs have no real characteristic paths, parabolic PDEs have one real repeated characteristic
path, and hyperbolic PDEs have two real distinct characteristic paths.
The presence of characteristic paths in the solution domain leads to the concepts of domain of
dependence and range of influence.
The domain of dependence of point 𝑷 is defined as the region of the solution domain upon which
the solution at point 𝑃, 𝑓 𝑥𝑃 , 𝑦𝑃 , depends. In other words, 𝑓 𝑥𝑃 , 𝑦𝑃 depends on everything that
has happened in the domain of dependence.
The range of influence of point 𝑷 is defined as the region of the solution domain in which the
solution 𝑓(𝑥, 𝑦) is influenced by the solution at point𝑃. In other words, 𝑓 𝑥𝑃 , 𝑦𝑃 influences the
solution at all points in the range of influence.
Dr. Khoozan 20
10
5/13/2024
CHARACTERISTICS OF PDE
Domain of dependence (horizontal hatching) and range of influence (vertical hatching) of PDEs:
Dr. Khoozan 21
Physical problems fall into one of the following three general classifications:
Equilibrium problems
Propagation problems
Eigenproblems
Each of these three types of physical problems has its own special features,
its own particular type of governing partial differential equation, and it’s
own special numerical solution method.
Dr. Khoozan 22
11
5/13/2024
EQUILIBRIUM PROBLEMS
Equilibrium problems are steady-state problems in closed domains 𝐷(𝑥, 𝑦) in which the solution
𝑓(𝑥, 𝑦) is governed by an elliptic PDE subject to boundary conditions specified at each point on the
boundary 𝐵 of the domain.
Equilibrium problems are jury problems in which the entire solution is passed on by a jury
requiring satisfaction of all internal requirements (i.e., the PDE) and all the boundary conditions
simultaneously.
Elliptic PDEs have no real characteristics. Thus, the solution at every point in the solution domain is
influenced by the solution at all the other points, and the solution at each point influences the
solution at all the other points
Dr. Khoozan 23
EQUILIBRIUM PROBLEMS
or
Dr. Khoozan 24
12
5/13/2024
PROPAGATION PROBLEMS
Propagation problems are initial-value problems in open domains(open with respect to one of the
independent variables) in which the solution 𝑓(𝑥, 𝑡) in the domain of interest 𝐷(𝑥, 𝑡) is marched
forward from the initial state, guided and modified by boundary conditions.
The solution of a propagation problem is subject to initial conditions specified at a particular value
of the time-like coordinate and boundary conditions specified at each point on the space-like
boundary.
Dr. Khoozan 25
PROPAGATION PROBLEMS
Dr. Khoozan 26
13
5/13/2024
Dr. Khoozan 27
It is of course impossible to utilize the infinite number of terms in the series to obtain an
exact function evaluation, but approximate solutions can be found by truncating the series;
that is, using a finite number of terms. This approximation introduces truncation error in
the evaluation of 𝑓(𝑥).
Dr. Khoozan 28
14
5/13/2024
Dr. Khoozan 29
Dr. Khoozan 30
15
5/13/2024
Dr. Khoozan 31
Where ∆𝑥 = 𝑥𝑖+1 − 𝑥𝑖 . Rearranging and using some algebra to solve for the first derivative
of pressure yields:
Dr. Khoozan 32
16
5/13/2024
Since the first (and largest) term in the neglected remainder is proportional to ∆𝑥 , the
forward difference approximation is of first order accuracy, written as 𝑂(∆𝑥). This means
that if ∆𝑥 is decreased by a factor of two, the error in the derivative would decrease by a
factor two, in the limit that ∆𝑥 approaches 0.
Dr. Khoozan 33
Dr. Khoozan 34
17
5/13/2024
Neglecting all terms higher than the first-order derivative and then rearranging to solve for
the derivative gives the first-order backward finite difference approximation,
Dr. Khoozan 35
Therefore, the forward and backward differences have the same order of accuracy.
This does not mean that the forward and backward approximations will give the
same answer, nor will they have the same error.
It does mean that both will converge to the true derivative at the same rate.
Dr. Khoozan 36
18
5/13/2024
Dr. Khoozan 37
Approximations to the first derivative can also be determined using a second order,
centered finite difference, which can be derived by subtracting a backward Taylor series
from a forward Taylor series:
Dr. Khoozan 38
19
5/13/2024
Rearranging for the first-order derivative gives the centered difference approximation:
where the leading term in the remainder, 𝑅𝑐 , is proportional to ∆𝑥 2 . Thus, the centered
difference approximation is 𝑂(∆𝑥 2 ) accurate, which means it converges faster to the true
solution than either a forward or backward difference approximation.
Recall that if ∆𝑥 were decreased by a factor of two, the error in the derivative
approximation would also decrease by a factor of two for either a forward or backward
difference; however, the error would decrease by a factor of four for a centered difference.
Dr. Khoozan 39
Dr. Khoozan 40
20
5/13/2024
Dr. Khoozan 41
This equation can alternatively be derived by recognizing that the second-order derivative
is simply the derivative of the first-order derivative. Substitution of the centered difference
for the first-order derivatives gives:
Dr. Khoozan 42
21
5/13/2024
where 𝑥𝑖+1 refers to the midpoint of 𝑥𝑖 and 𝑥𝑖+1 , and 𝑥𝑖−1 refers
2 2
to the midpoint of 𝑥𝑖 and 𝑥𝑖−1 .
Dr. Khoozan 43
Dr. Khoozan 44
22
5/13/2024
Dr. Khoozan 45
Dr. Khoozan 46
23
5/13/2024
Dr. Khoozan 47
Dr. Khoozan 48
24
5/13/2024
Dr. Khoozan 49
Dr. Khoozan 50
25
5/13/2024
Dr. Khoozan 51
Finally, set the coefficients of 𝑝𝑘𝑖 = 1 (where 𝑘 is the order of the derivative) and all other
coefficients to zero in order to minimize the truncation error. This will lead to a system of
equations that can be solved to obtain 𝛽s. There should be the same number of linearly
independent equations as unknowns (if more equations than unknowns are used they will
not be linearly independent)
Dr. Khoozan 52
26
5/13/2024
Dr. Khoozan 53
Dr. Khoozan 54
27
5/13/2024
Dr. Khoozan 55
Dr. Khoozan 56
28
5/13/2024
Dr. Khoozan 57
Dr. Khoozan 58
29
5/13/2024
Dr. Khoozan 59
Dr. Khoozan 60
30
5/13/2024
The PDE is well posed if one initial condition and two boundary conditions
are included, provided at least one of those initial or boundary conditions
defines pressure.
Dr. Khoozan 61
The slide shows a 1D porous medium (e.g., rock core sample) with
length 𝐿 discretized into 𝑁 equally spaced grid blocks.
Dr. Khoozan 62
31
5/13/2024
Dr. Khoozan 63
In this course, it is generally assumed that grid points are placed exactly at
the center of the grid block and are therefore referred to as cell-centered or
block-centered grids.
32
5/13/2024
Using the finite difference approximations, the spatial derivatives can be discretized using
a centered difference approximation which was shown to be of 𝑂(∆𝑥 2) in accuracy based
on the truncated terms in the Taylor series:
where 𝑃 is used to denote the approximate solution for pressure. Note the important
switch from lower-case 𝑝 (true, exact pressure) to upper-case 𝑃 (approximate, finite
difference pressure).
Dr. Khoozan 65
Likewise, the PDE is solved in discrete increments of time, each separated by an interval
∆𝑡.
A time interval with a superscript “𝑛” is denoted and the next time level as “𝑛 + 1”.
A finite difference approximation in time can also be employed. Note that the superscript
indicates the time level and the subscript the spatial location. Discretization of the time
derivative gives:
Dr. Khoozan 66
33
5/13/2024
1
It is a centered difference if the current time is 𝑛 + 2.
The backward (explicit method), forward (implicit method), and centered (Crank-
Nicolson method) time difference approximations are the starting points for the
numerical solutions described in this course.
Dr. Khoozan 67
Dr. Khoozan 68
34
5/13/2024
Each term in the equation has units of pressure. It is often more convenient to write the
equations in units of flow rate (e.g., ft3/day or RB/day); after all, a primary interest of the
reservoir engineer is to determine the rate of oil, gas, and water produced. Multiplying this
equation by 𝐴 and 𝑐𝑡 :
Dr. Khoozan 69
Given an initial condition (pressures of all blocks at time 𝑛), this equation can be solved for
𝑃𝑖𝑛+1 in all blocks with 𝑖 = 1 to 𝑁.
Dr. Khoozan 70
35
5/13/2024
For the 1D parabolic diffusivity equation, two boundary conditions (one at 𝑥 = 0 and the
other at 𝑥 = 𝐿) in addition to one initial condition are needed to define the problem.
There are many different possibilities for boundary conditions, but the most common that
are applied to flow in reservoir simulation are Dirichlet (constant pressure) and Neumann
(constant rate).
Dr. Khoozan 71
36
5/13/2024
The discretized heat equation includes the ghost block pressure (𝑃0 ) if 𝑖 = 1; so, the above
boundary condition equation can be substituted into it if the boundary is subject to a
Dirichlet boundary condition.
Dr. Khoozan 74
37
5/13/2024
where a centered finite difference approximation is used for the first derivative.
This may “look like” a forward or backward difference, but because the flux is specified at
the boundary (i.e., the interface between block “𝑁” and “𝑁 + 1”) it is a centered
difference approximation with accuracy 𝑂(∆𝑥 2).
Dr. Khoozan 75
Dr. Khoozan 76
38
5/13/2024
Dr. Khoozan 78
39
5/13/2024
The spatial derivatives on the right hand side of the equation are evaluated at the time step 𝑛
in the explicit method.
Since initial conditions (𝑛 = 0) for pressure as a function of position are known, the solution
)
of grid block pressures (𝑃10, 𝑃20 , ⋯ , 𝑃𝑁 ) is known.
These initial conditions can be substituted into the above equation and the righthand side can
be evaluated.
Therefore, new pressures can be computed explicitly at the new time level, 𝑛 + 1.
The equations are not “coupled”, i.e., each equation is independent and does not depend on
the others.
Dr. Khoozan 79
40
5/13/2024
Dr. Khoozan 81
Dr. Khoozan 82
41
5/13/2024
Dr. Khoozan 83
Dr. Khoozan 84
42
5/13/2024
Dr. Khoozan 85
Dr. Khoozan 86
43
5/13/2024
Dr. Khoozan 87
Dr. Khoozan 88
44
5/13/2024
Dr. Khoozan 89
Dr. Khoozan 90
45
5/13/2024
Dr. Khoozan 91
46
5/13/2024
Dr. Khoozan 93
For all mixed methods, a system of equations must still be solved and has
slightly more computational work compared to the implicit method, but
larger timesteps can be taken in C-N and maintain accuracy.
Dr. Khoozan 94
47
5/13/2024
Since this is a centered difference, the time derivative is 𝑂(Δ𝑡 2 ) in accuracy. The spatial
derivative is also at the 𝑛 + 1Τ2 time level; intermediate time levels do not exist but can
be approximated as an average of the “𝑛” and “𝑛 + 1” time intervals.
Dr. Khoozan 95
Dr. Khoozan 96
48
5/13/2024
Dr. Khoozan 97
Dr. Khoozan 98
49
5/13/2024
Dr. Khoozan 99
50
5/13/2024
51
5/13/2024
52
5/13/2024
53
5/13/2024
54
5/13/2024
55
5/13/2024
Unlike the explicit equations, the implicit (and mixed methods) equations are coupled; a
system of 𝑁 simultaneous linear equations are formed.
The system of linear equations can be solved using direct or indirect methods.
Direct methods attempt to solve the system exactly and are not subject to truncation error.
Examples include Gauss Elimination and LU decomposition, which are theoretically both
𝑂(𝑁 3 )methods, meaning that increasing number of grids by 10-fold results in a computation
time that is 1000-fold larger.
Dr. Khoozan 111
Direct methods are often not feasible for very large (e.g., tens of thousands or millions
of blocks) systems of equations.
The Thomas algorithm is a fast, 𝑂(𝑁), direct method, but only applicable to 1D,
tridiagonal problems.
Indirect methods begin with a guess value for the solution and iterate until
convergence to a predetermined tolerance and are thus subject to truncation error.
56
5/13/2024
However, they are only guaranteed to converge for certain matrices (e.g.,
symmetric, positive definite) and are usually slow compared to Krylov subspace
methods for the very large systems often employed in reservoir simulation.
57
5/13/2024
The implicit method requires significantly more computational work per timestep
than the explicit method because a system of linear equations must be solved.
Implicit methods are not, in general, more accurate than explicit methods.
The order of accuracy is the same for both the implicit and explicit methods since
the spatial derivatives in both methods were approximated to second-order
accuracy, 𝑂(∆𝑥 2 ) and the temporal derivatives were first-order accurate, 𝑂(∆𝑡).
The advantage of the implicit method is that it is more stable and convergent.
58
5/13/2024
The solution becomes unstable if the chosen timestep is too large or the grid
block size is too small. This is unfortunate because one may want to improve
accuracy by reducing ∆𝑥 or decrease computation time by using a larger ∆𝑡.
59
5/13/2024
60