Reservoir Simulation One Phase, 1D, Flow Numerical Solution: University of Stavanger
Reservoir Simulation One Phase, 1D, Flow Numerical Solution: University of Stavanger
RESERVOIR SIMULATION
One phase, 1D, flow
Numerical solution
Hans Kleppe
2010
i
University of Stavanger
Contents
1 INTRODUCTION ................................................................................................................ 1
3 DARCY’S LAW................................................................................................................... 2
6 LINEAR EQUATIONS........................................................................................................ 5
7 EXERCISES ......................................................................................................................... 7
ii
University of Stavanger
1 INTRODUCTION
The flow equations are obtained using the principle of mass conservation and Darcy’s
law. The equations will in the notes be referred to as the mass balance equations or mass
conservation equations. Mass balance equations are differential equations and they are
solved numerically, involving discretization (replacing differential equations by
algebraic equations), linearization (replacing algebraic equations by linear equations)
and solution of large sets of linear equations. Before we deal with the general 3D
multiphase flow, the solution procedure will be illustrated using 1D, one phase flow.
Consider a 1D reservoir with constant cross section A and length L. One fluid, oil, is
flowing in the reservoir. Denote the reservoir porosity by ϕ(x,t) and fluid density by
ρ(x,t). Moreover, u(x,t) denotes the fluid Darcy velocity at position x (Au(x) will be the
volumetric flow rate across the cross section at x).
Let ∆x be a small increment in distance.
u(x) u(x+∆x)
x x+∆x
x-axis
Moreover, let t denote a given time and ∆t a small increment in time.
t t+∆t
time
Flow of oil into volume V=A∆x during time ∆t is given by
Au(x) ρ(x)∆t
and similarly flow out at x+∆x
Au(x+∆x) ρ (x+∆x)∆t.
1
University of Stavanger
Let ∆x and ∆t approach zero and use the definition of derivative to obtain the
differential equation for the principle of mass conservation
∂ ∂
(uρ ) = − (ϕρ ) . (1)
∂x ∂t
Equation (1) is also called the diffusivity equations.
3 Darcy’s law
Equation (1) will be used to determine pressure p. Before the solution starts, variation of
density and porosity with pressure must be specified, i.e. functions ϕ(p) and ρ(p) must
be given. Examples of such functions are given in Exercise e.2. In addition to pressure,
velocity u is a second unknown in (1). To reduce the number of unknowns to one,
pressure, a relation between velocity and pressure is needed. Darcy’s law gives this
relation
k ∂p
u=− . (2)
µ ∂x
In (2) two new parameters are introduced, one rock parameter, permeability k, and one
fluid parameter, viscosity µ .
Using Darcy’s law (2) in the principle of mass conservation (1) gives equation
∂ kρ ∂p ∂
( ) = (ϕρ ) .
∂x µ ∂x ∂t
2
University of Stavanger
∂ kρ ∂p ∂
( ) + q = (ϕρ ) (3)
∂x µ ∂x ∂t
Equation (3) is the final version of mass balance (diffusivity) equation for a 1D,
horizontal reservoir with one flowing fluid. It is used to determine pressure as function
of position and time.
5 Numerical solution
Analytical solution of (3) means derivation of a formula for computing p(x,t). For some
special cases (3) can be solved analytically. In Exercises e.1 and e.2 analytical solutions
are presented. But generally, numerical methods are required to solve the mass balance
equations.
In order to compute a numerical solution a set of computational points along x must be
established. Also, a number of time steps are needed. The numerical solution will be
computed numbers for each computational point and each time step. In most practical
applications the computational domain is subdivided into grid blocks and the
computational points will be block centers. Also, two boundary conditions are needed.
First, the initial state must be given, i.e. numbers for all computational point at time t =
0. Secondly, specifications at the boundaries of the computational domain are required.
Frequently no flow exterior boundaries are specified.
The numerical solution proceeds as follows:
Initial solution compute solution compute solution
(t=0) specified at step 1 at step 2
time
Before computations at a time step n +1 the value of the solution at all computational
point at the previous time step n must be calculated.
3
University of Stavanger
Finite differences.
Consider a uniform grid with Nx blocks of length ∆x.
flow
1 i-1 i i+1 Nx
i-1/2 i+1/2 x
and a subdivision of the time axis into Nt points with equal spacing ∆t .
In addition to specification of initial state no flow exterior boundaries are used, i.e. no
flow across the left face of block 1 and no flow across the right face of block Nx. In the
discretization procedure the differential equation (3) is replaced by one algebraic
equation for each grid block. The new equations will express mass balance for each
block.
Consider block i . Using Darcy’s law the mass flow rate across the left boundary i-1/2
into i can be computed as
Akρ
− ( pi − pi −1 ) ,
µ∆x i −1 / 2
and for the right boundary i+1/2 the flow rate out of i
Akρ
− ( p i +1 − pi ) .
µ∆x i +1 / 2
Akρ Akρ
∆t ( pi +1 − pi ) − ∆t ( pi − pi −1 ) . (4)
µ∆x i +1 / 2 µ∆x i −1 / 2
[
∆xA (ϕρ )in +1 − (ϕρ )in . ] (5)
4
University of Stavanger
Akρ
Akρ
( p i +1 − pi ) − [ n +1
]
( p i − pi −1 ) = V (ϕρ )i − (ϕρ )i / ∆t .
n
µ∆x i +1 / 2 µ∆x i −1 / 2
If a source/sink term (well) is present in block i the mass balance equation becomes
Akρ
Akρ
( pi +1 − p i ) − [ n
]
( pi − p i −1 ) + Qi = V (ϕρ )i − (ϕρ )i / ∆t
n +1
(6)
µ∆x i +1 / 2 µ∆x i −1 / 2
Equation (6) can be deduced from equation (3) using general discretization techniques
(finite differences). This procedure will be introduced at a later stage.
6 Linear equations
0 i-1 i i+1 Nx
5
University of Stavanger
∆t
Set γ = 2 . Then equation (7) can be written
∆x α
− γp in−+11 + (1 + 2γ ) pin +1 − γp in++11 = p in .
Using the boundary specifications, the equations for blocks 1 and Nx become
(1 + 2γ ) p1n +1 − γp2n +1 = p1n + γa
.
−1 + (1 + 2γ ) p Nx = p Nx + γb
n +1 n +1
− pNx n
• • • •
• • • •
− γp Nx −1 + (1 + 2γ ) p Nx = p Nx + γb
n +1 n +1 n
The equations have a banded structure with elements on the main diagonal and two
bands corresponding to flow between neighbor blocks. The equations are easily solved
using the Thomas’ algorithm
(http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm) .
For field simulation problems the set of linear equations to be solved is huge. Solution
of more then one million equations and unknowns can be required. Moreover, many
such large systems of equations must be solved during a simulation procedure. Hence,
efficient linear solution methods are needed. Iterative methods must be used. More
general linear flow equations also have a banded structure where most elements in the
coefficient matrix are zero. It is important to take advantage of this special structure
when the equations are solved.
6
University of Stavanger
7 Exercises
Exercise e1.
Consider equation (3). Make the following assumptions
- homogeneous and incompressible reservoir, i.e. k and are ϕ constants
- incompressible fluid, i.e. ρ and µ are constants
- no source/sink term
- Reservoir length L.
Show that (3) can be written
∂2 p
=0 . ( 1.1 )
∂x 2
In order to obtain a unique solution of (1.1), boundary conditions must be imposed.
Fluid is injected at one end, x = 0, with constant volume rate Q and a constant pressure
p0 is specified at the other end, x = L.
Show that the solution is given by
Qµ
p ( x ) = p0 + ( L − x). (1.2)
Ak
Exercise e2.
In this exercise assumptions are made such that equation (3) is identical to the heat
equation. Many solution of the heat equation is presented in the literature. The
interested reader can find solutions on the internet.
Assumptions
- homogeneous reservoir
- constant rock compressibility c r , cr a small number
- q = 0.
∂ kρ ∂p
- ρ in the flow term ( ) is considered constant ρ 0
∂x µ ∂x
7
University of Stavanger
Use the fact that c r , c are small numbers, i.e. terms containing c r2 , c 2 , c r c can be
neglected, to deduce formulas
ϕ = ϕ 0 [1 + c r ( p − p0 )], ρ = ρ 0 [1 + c( p − p0 )] . (2.3)
∂2 p ∂p ϕ 0 µ (c r + c )
=α , α= . (2.4)
∂x 2
∂t k
Equation (2.4) is frequently referred to as the heat equation.
Exercise e3.
In this exercise the heat equation (2.4) will be solved numerically. Show that using the
assumptions of Exercise e.2 the discretization of (2.4) can be written
p i −1 − 2 p i + p i +1 p in+1 − pin
= α
∆x 2 ∆t . (3.1)
ϕ 0 µ (c + c r )
α=
k
Hint: Use that ρ on the left hand side of (6) can be replaced by ρ 0 and
ϕρ ≈ ϕ 0 ρ 0 [1 + c r ( p − p0 ) + c( p − p 0 )] (see Exercise e2).
The left hand side can be evaluated at time n or time n+1. Evaluation at step n is called
explicit formula
p in−1 − 2 p in + pin+1 p in +1 − p in
= α (3.2)
∆x 2 ∆t
and evaluation at step n+1 is called implicit formula
1 2 3 4 5
8
University of Stavanger
∆t
Set γ = = 0.5 and use explicit formula
α∆x 2
pin +1 = 0.5 pin−1 + 0.5 p in+1 (3.4)