Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 19

CHAPTER 7

Accuracy of Solutions

Roundoff Error

Material Balance Error

Non-Linear Error

Instability Error

Truncation Error

Numerical Dispersion

Grid Orientation Problems

Accuracy of Solutions
In any type of computer simulation work, it is important to determine the accuracy of the
solution generated. In this chapter, seven type of errors are discussed that could cause errors in your
solution.
1.

Roundoff Error can occur when using single precision accuracy when double precision
is required or by mixing single and double precision variables.

2.

Material Balance Error (MBE) is a measure of consistency, not accuracy. Its primary
cause is from non-linear error. With IMPES, MBE is an indication of how well the equation
Ap=b is solved. One method to solve MBE's is to use a Newton or outer iteration loop that
would eventually converge on zero MBE.

3.

Non-Linear Error occurs when using a linear approximation (chord slope) to find a value at
the n+1 time level of a non-linear function such as formation volume factors.

4.

Instability Error is caused by explicit saturation dependent variables (krn and pcn) in IMPES.
A solution for instability is to take smaller timesteps or go to a fully implicit model.

5.

Truncation Error is caused by truncating the Taylor series. A solution to truncation error is
to vary timestep size (t) and gridblock size (x) by trial and error until the solution
converges.

6.

Numerical Dispersion is caused by saturation discontinuity within a cell. The solutions for
numerical dispersion are: (1) smaller x, (2) modify kr calculations, (3) select proper t,
and (4) use pseudo kr.

7.

Grid orientation can change the final answer. Grid orientation is generally important in
calculating saturation distributions in a waterflood. Typically, a diagonal grid system will
result in better recoveries (more optimistic).

2
Chapter 7 - Accuracy of Solutions

Round-off Error
Roundoff error occurs because of the number of significant figures each variable is defined
within the computer simulator. Single and double precision have different meanings for different
computers. It is less ambiguous to indicate precision with a delaration such as REAL*4 which
indicates that 4 bytes are to be taken up by the number. For an 8 bit machine, that means that 32 bits
or binary numbers will be used to represent the number. Scientific notation is used. The first bit is
positive or negative, the next few bits indicate the exponent, and the remaining bits are used for the
mantissa. The number of bits used for the mantissa determine the precision of the number.
REAL*4
6-7 significant figures
REAL*8
14-15 significant figures
REAL*16
30-31 significant figures

3
Chapter 7 - Accuracy of Solutions

Material Balance Error (MBE)


Material balance error is a measure of consistency, which is not accuracy. Consistency is an
indication of the way the equations are programmed and how the simulator is run. Accuracy is an
indication of the correctness of the answer.
There are two ways of determining MBE :
1. Local MBE, only applies to a single timestep - production should equal voidage. The oil
material balance equation is :
V p So
Local MBE =

Bo
i, j

n+1

n
V p S o
-
+
Bo

q t
o

i, j

(1)

2.
Cumulative MBE, the oil material balance equation, is defined so that a positive error
indicates too much fluid in the reservoir :

Problem:

Cum. MBE = OIPn+1 - OOIPo + Np

(2)

V S n 1 V p S o o n 1
p o
q o t

Cum.MBE

B
B
o
o
ij

1 ij

(3)

The material balance equations are conservative as written. However, the equations
written on paper are not solved exactly in the simulator.

Causes of MBE :
1.
2.
3.
4.
5.

Non-conservative equations
Residuals in iterative matrix methods.
Non-linear coefficients (coefficients that change with the solution, i.e. pressure).
Roundoff errors.
Program bugs.

4
Chapter 7 - Accuracy of Solutions

Non-Linear Error
The equation that we solve is the pressure equation, which causes two critical errors. Recall
(Chapter 4) that the pressure equation with Rs is as follows :
n 1
o

B ao p

n 1

n 1
w

B a w p

n 1

n 1
g

B a g p

n 1

V pn ct
t

n 1

p n Bgn1Rsn ao p n1 Bgn 1 Rsn1ao p n1


(4)

where :
c t = c f + c o S on + c w S nw + c g S ng
cf =

(5)

1 V p
V np p

n+1

1 Bo B g R s
+ n
co = - n
Bo p
Bo p

1 Bw
cw = - n
B w p

(6)

1 Bg
cg = - n
B g p

(7)

The biggest source of error when solving the above equation is the use of chord slope
approximations for ct calculations, especially near the bubble point. Another problem is calculating
Formation Volume Factors at the n+1 time level. Essentially, anything calculated at the n+1 time
level will introduce an error. Since these values are really not known, old values are generally used.

Bo

Bo

Bo(n+1)

Chord Slope
Bo
p

Bon

pn

Correct
Chord Slope

p (n+1)

pp

PRESSURE

PRESSURE

5
Chapter 7 - Accuracy of Solutions

Fig. 1 - The use of chord slopes in solving the pressure equation is the biggest cause of material
balance error, especially near the bubble point.
Possible Solutions to Non-Linear Errors :
1.
Take smaller timesteps.
2.
Use an outer iteration (Newton) loop. Iterate IMPES solutions to get a good estimate of
FVF at the n+1 timestep. An infinite number of iterations should result in zero MBE.
NOTE:

Just because MBE is equal to zero, does not mean that the answer is correct. It just
means that mass is being conserved. The fluid may not be in the correct

locations.

6
Chapter 7 - Accuracy of Solutions

Instability Error
Instability Error is caused by :
IMPES - Implicit pressure, explicit saturation, krn and Pcn .
For krn limit, there is a timestep limit such that if you take one bigger timestep,
IMPES
will blow up (see solutions to numerical dispersion).
a.

df
u t max

ds w

(8)

Solution : Take smaller timesteps if practical or go to a fully implicit model.


b.

Fully Implicit : Stable for any size t, but convergence is not guaranteed.

Sw

TIME

Fig. 2 - Oscillations of water saturation as a function of time are an indication of instability with
IMPES.

7
Chapter 7 - Accuracy of Solutions

Truncation Error
The finite difference equation is an approximation based on a Taylor series expansion. The
accuracy of the solution depends on the magnitude of the truncated term. Taylor series is:
so:

x2
x3
f(x + x) = f(x) + x f (x) +
f (x)+
f (x) + ....
2!
3!
f (x) =

f(x + x) - f(x)
x
x2
f (x) f (x) + ....
x
2!
3!

(9)
(10)

This is an infinite series which is theoretically exact for an infinite number of terms. However, if we
truncate the series after n terms, then we introduce a truncation error as follows :
f (x) =

f(x + x) - f(x)
- O x
x

(11)

Solution to Truncation Error: Vary timestep size (t) and gridblock size (x) independently and
compare the results graphically. As the solutions tend to converge, you will be approaching the
"correct" values for t and x. This is a trial and error method of determining the "correct" values
for t and x. Fig. 3 illustrates the effect of varying timestep size. Notice that as t becomes
smaller, the pressure solution converges. The proper t to use is the one that optimizes both
computer efficiency and accuracy. For example, from Fig. 4, a t of 1.25 days is probably the
proper choice for this case. There is not a great deal of accuracy lost going from a t of 0.15 days to
1.25 days while the number of timesteps is reduced substantially.

PRESSURE (X = 100 ll ), psia

1,000

DELT

800

10 days
600

5 days
1.25 days
400

0.15 days
200
0

20

40

60

80

TIME, days

Fig. 3 - Effect of varying timestep size (t) on pressure at 100 ft.


8
Chapter 7 - Accuracy of Solutions

Numerical Dispersion
Numerical dispersion is seen during immiscible displacement. For example, when water
displaces oil in one dimension. This displacement is sometimes called "Buckley-Leverett flow".
"Buckley-Leverett flow" assumes an incompressible system and ignores capillary pressure.
"Buckley Leverett flow" is illustrated in Fig. 4. A characteristic of "Buckley-Leverett flow" is the
"shock" or clearly defined saturation front.

Fig. 4 - (from Fig. A-1, SPE Monograph 13)


The equations that we solve, IMPES pressure equations, are parabolic which implies a
smooth function with no discontinuities. To minimize numerical dispersion, upstream values of k r
should be used, but this will still result in a "dispersed" front. Simulation does not give you a
"shock" or clear front like Buckley-Leverett predicts. Fig. 7 illustrates the effect of numerical
dispersion by comparing a calculated water saturation profile to the theoretical Buckley-Leverett
solution.
If we program relative permeability normally, as soon as the water saturation in a gridblock
is greater than the irreducible saturation, the relative permeability of water is no longer zero. In the
next timestep, there will be flow of water to all surrounding blocks which have lower w. With this
scenario in mind, it is apparent that in a number of timesteps equal to the number of gridblocks
between the injection and production well, water breakthough (although small) will be predicted by
the simulator.

9
Chapter 7 - Accuracy of Solutions

Sw

Cant Determine
Location of Front
in a Cell

GRID BLOCKS
Fig. 5 - Numerical dispersion is caused by the inability to simulate saturation discontinuity within a
cell.
Solutions to Minimize Numerical Dispersion
1.

Smaller Gridblock Size (x) : For large gridblocks, saturation definition is lost. However, it
is improved with smaller (or more) gridblocks.

Fig. 6 - (from Fig. 5.7, SPE Monograph 13)


10
Chapter 7 - Accuracy of Solutions

2.

Modify kr Calculations: For relative permeability (kr), use upstream weighting instead of
average weighting (between two gridblocks). Fig. 7 shows that upstream weighted kr's give
better results.

Fig 7 - (from Fig. C.1, Appendix C, SPE Monograph 13)

11
Chapter 7 - Accuracy of Solutions

3.

Select a Better Timestep Size (t):


The Buckley-Leverett method solves Eq. 12, which does not depend on rate, just movement
of the saturation as it moves through the system.
S
df S
vt
t
dS x

(12)

However, we actually end up solving Eq. 13, which is a diffusion-convection differential


equation where c = concentration.
c
c
2 c
= - vt
+ d
t
x
x2

(13)

The second term in Eq. 13 is the diffusion term (or numerical dispersion). IMPES and fully
implicit models solve Eq. 13 accidentially, so the second term is actually an error term.
For IMPES:
d =

df
vt df
t
x - vt
2 dS
dS

(14)

For implicit:
d =

df

v t df
x + v t
t
2 dS
dS

(15)

To reduce dispersion, make d = 0. And d will be zero when :

x vt

df
t 0
ds
or

t =

x
df

ut
ds

(16)

where :
vt =

ut

(17)

However, at this timestep, IMPES is on the verge of blowing up (instability). Also, we


cannot satisfy Eq. 16 for each gridblock simultaneously. So, in practice we cannot eliminate
numberical dispersion with selection of timestep size.

12
Chapter 7 - Accuracy of Solutions

4.

Use Pseudo Relative Permeabilities:


Data modifications may decrease numerical dispersion. One of these modifications can be
applied to relative permeability. Fig. 10 illustrates this point.

Fig. 8 - (from Fig.5.16, SPE Monograph 13)


Practical Considerations. "Buckley-Leverett flow" may not actually apply to real field situations.
Dispersion in a reservoir may be caused by :
1. Capillary pressure, which spreads out the front, espcecially in low permeability reservoirs, and
2. Heterogeneities.
Therefore, for field type problems, we may not want to eliminate numerical dispersion altogether.
13
Chapter 7 - Accuracy of Solutions

14
Chapter 7 - Accuracy of Solutions

Grid Orientation Problems


Fig. 9 illustrates an example of two methods to model one-quarter of a five-spot. The flow
path from an injector to a producer is parallel to the grid lines in Fig. 11(a) and diagonal to the grid
lines in Fig. 9(b). For pressure, it doesn't matter which way grids are oriented, but for saturations
(water floods), it does make a difference.

Fig. 9 - (from Fig. 5.17, SPE Monograph 13)

15
Chapter 7 - Accuracy of Solutions

Grid Orientation Problems :


1.

High Mobility Ratios result in different answers depending on grid orientation. For high
mobility ratios (displacing fluid / displaced fluid), Fig. 11 (a) and (b) yield different
answers.

2.

A Diagonal Grid predicts better recovery. Fig. 10 shows different answers for different
grids. Diagonal grids predict more efficient recovery and more oil before water
break-through.

Fig. 10 - (from Fig. 5.19, SPE Monograph 13)

16
Chapter 7 - Accuracy of Solutions

One of the solutions to grid orientation problems is a nine-point template, illustrated in Fig. 11,
where flow into the center block is from eight directions. Fig. 11 shows how the equations are
solved.

Fig. 11 - (from Fig. 5.20, SPE Monograph 13)

17
Chapter 7 - Accuracy of Solutions

EXERCISES
PROBLEM NO.1.
Odeh's case 1 assumes that the bubble point is constant. Case 2 has a variable bubble point.
Which case has a faster pressure rise at the beginning of injection ? Why ?

PROBLEM NO.2.
Make a list of the 6 types of errors which result in reservoir simulation using our IMPES
formulation.

18
Chapter 7 - Accuracy of Solutions

Accuracy
The attached article shows the results of Odeh's case 1. The producing well produces at 20,000
STB/D until the gas/oil increases, which reduces the productivity index and gridblock pressure until
the bottom hole flowing pressure reached 1,000 psig. At that point the oil production rate is curtailed
by producing at a constant bottom hole pressure of 1,000 psig.
The gas front tends to move along the top layer which is a higher permeability than the middle
layer. After the gas sweeps to the vicinity of the producing well, it then moves downward until it is
produced in the third layer. The gas also tends to move directly down from the injection well and
then along the bottom layer, avoiding the middle layer.

19
Chapter 7 - Accuracy of Solutions

You might also like