Professional Documents
Culture Documents
Roundoff Error Material Balance Error Non-Linear Error Instability Error Truncation Error Numerical Dispersion Grid Orientation Problems
Roundoff Error Material Balance Error Non-Linear Error Instability Error Truncation Error Numerical Dispersion Grid Orientation Problems
Accuracy of Solutions
Roundoff Error
Non-Linear Error
Instability Error
Truncation Error
Numerical Dispersion
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
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:
(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
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)
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.
1,000
DELT
800
10 days
600
5 days
1.25 days
400
0.15 days
200
0
20
40
60
80
TIME, days
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.
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.
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.
11
Chapter 7 - Accuracy of Solutions
3.
(12)
(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)
x vt
df
t 0
ds
or
t =
x
df
ut
ds
(16)
where :
vt =
ut
(17)
12
Chapter 7 - Accuracy of Solutions
4.
14
Chapter 7 - Accuracy of Solutions
15
Chapter 7 - Accuracy of Solutions
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.
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.
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