100% found this document useful (3 votes)
611 views11 pages

Reservoir Simulation One Phase, 1D, Flow Numerical Solution: University of Stavanger

The document discusses numerical reservoir simulation of 1D, single phase flow. It begins by covering the principles of mass conservation and Darcy's law. The mass balance equation is derived by combining these principles. The document then describes how to numerically solve the mass balance equation by discretizing it using finite differences on a grid, replacing differentials with algebraic equations at grid blocks. Initial and boundary conditions are also specified to fully define the problem and allow the pressure field to be solved for incrementally at each time step.

Uploaded by

Nefeli Matsouka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
611 views11 pages

Reservoir Simulation One Phase, 1D, Flow Numerical Solution: University of Stavanger

The document discusses numerical reservoir simulation of 1D, single phase flow. It begins by covering the principles of mass conservation and Darcy's law. The mass balance equation is derived by combining these principles. The document then describes how to numerically solve the mass balance equation by discretizing it using finite differences on a grid, replacing differentials with algebraic equations at grid blocks. Initial and boundary conditions are also specified to fully define the problem and allow the pressure field to be solved for incrementally at each time step.

Uploaded by

Nefeli Matsouka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

University of Stavanger

RESERVOIR SIMULATION
One phase, 1D, flow
Numerical solution

Hans Kleppe
2010

i
University of Stavanger

Contents

1 INTRODUCTION ................................................................................................................ 1

2 PRINCIPLE OF MASS CONSERVATION........................................................................ 1

3 DARCY’S LAW................................................................................................................... 2

4 MASS BALANCE EQUATION.......................................................................................... 2

5 NUMERICAL SOLUTION ................................................................................................. 3

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.

2 Principle of mass conservation

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.

The change of mass in V will be equal to

1
University of Stavanger

[ Au(x) ρ (x) - Au(x+∆x) ρ (x+∆x )]∆t.

Change of mass in volume V can also be expressed using

V[ϕ(x,t+∆t) ρ (x,t+∆t) − ϕ(x,t) ρ (x,t)] .

The two expressions must be equal and dividing by A∆x∆t gives

[ u(x) ρ (x) - u(x+∆x) ρ (x+∆x)]/∆x = [ϕ(x,t+∆t) ρ (x,t+∆t) − ϕ(x,t) ρ (x,t)]/∆t .

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 µ .

4 Mass balance equation

Using Darcy’s law (2) in the principle of mass conservation (1) gives equation
∂ kρ ∂p ∂
( ) = (ϕρ ) .
∂x µ ∂x ∂t

2
University of Stavanger

A source/sink term q may be added accounting for injection/production from wells

∂ 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

Indices i ± ½ means a representative values at the boundary between blocks.


During time ∆t the exchange of mass between block i and neighbor blocks i+1 and i-1
is given by

 Akρ   Akρ 
  ∆t ( pi +1 − pi ) −   ∆t ( pi − pi −1 ) . (4)
 µ∆x  i +1 / 2  µ∆x  i −1 / 2

On the other hand the change of mass in block i during ∆t = t n+1 − t n is

[
∆xA (ϕρ )in +1 − (ϕρ )in . ] (5)

High index n is used to denote time step n .


Expressions (4) and (5) are equal and dividing by ∆t results in the algebraic equation

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

The discretized (algebraic) equation (6) is in general a non-linear equation since ϕ , ρ , µ


are pressure dependent. Except for special cases, the only algebraic equations we ca
solve are the linear equations. After discretization the next step in a numerical solution
procedure will be to approximate the algebraic equations by linear equations and then
solve the linear equations. At this stage we will leave out the linearization step and
move to the solution of linear equations.
In Exercise e3 a special case of the 1D one phase difference equation (6) is studied.
Two formulations are presented

p in−1 − 2 p in + p in+1 pin +1 − pin


- explicit formula = α
∆x 2 ∆t
p in−+11 − 2 pin +1 + pin++11 pin +1 − pin
- implicit formula = α . (7)
∆x 2 ∆t
The difference equations are used to compute the solution at new time step n+1 once the
solution at step n is known. The explicit formula is easy to use since it contains only one
unknown pin +1 . In Exercise e3 the explicit formula is used to compute a numerical
solution. The main drawback using explicit solution is stability problems. In fact, for
realistic reservoir problems explicit solution method is never used.
The implicit formula contains more than one unknown, pin−+11 , p in +1 , pin++11 . Consider a
subdivision of the computational domain into Nx +2 blocks

0 i-1 i i+1 Nx

5
University of Stavanger

Assume that the solution is constant in blocks 0 and Nx +1, p 0n = a, p Nx


n
+1 = b for all n.

∆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

The set of linear equations to be solved:


(1 + 2γ ) p1n +1 - γp2n +1 = p1n + γa

− γp1n +1 + (1 + 2γ ) p2n +1 - γp3n +1 = p2n

− γp 2n +1 + (1 + 2γ ) p3n +1 - γp4n +1 = p3n

• • • •

• • • •

− γ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

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

- constant fluid compressibility c, c a small number


- viscosity µ is constant

- q = 0.
∂ kρ ∂p
- ρ in the flow term ( ) is considered constant ρ 0
∂x µ ∂x

Compressibilities are defined as follows


1 dϕ 1 dρ
cr = , c= . (2.1)
ϕ dp ρ dp

7
University of Stavanger

Show that constant compressibilities implies


ϕ = ϕ 0 e c ( p− p ) ,
r 0
ρ = ρ 0 e c( p− p ) ,
0
(2.2)

where ϕ 0 , ρ 0 are reference values at reference pressure p0 .

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)

Hint: use Taylor expansion.


Use expressions (2.3) to write equation (3) as

∂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

p in−+11 − 2 pin +1 + pin++11 pin +1 − pin


= α . (3.3)
∆x 2 ∆t
Assume the reservoir is subdivided into 5 blocks

1 2 3 4 5

8
University of Stavanger

Use the following boundary conditions


- initial values of p, p1 = 1, p2 = 2.5, p3 = 4, p4 = 3, p5 = 2
- p1n = 1, p5n = 2 for all time steps .

∆t
Set γ = = 0.5 and use explicit formula
α∆x 2
pin +1 = 0.5 pin−1 + 0.5 p in+1 (3.4)

to compute the solution at step 3.

You might also like