




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















It is not possible to develop analytical solutions for many problems. The most common reasons are the heterogeneity and irregular shapes of reservoirs. Another common reason, as in the case for gases, is the nonlinearity of the equations (properties changing with pressure). Reservoir simulation is a viable method for solving such problems and has become the standard method for solving reservoir flow problems in both field offices and in research environments.
Reservoir simulation has become a common tool in reservoir engineering. Reservoir simulation is used to solve research-type problems, such as analysis of enhanced oil recovery, horizontal wells, well stimulation techniques, etc. More common applications, however, are the simulation of actual wells and actual reservoirs. Since the late 1960's the technology and computer hardware have advanced enormously and the cost and speed of doing reservoir simulation have been improved dramatically.
The valuable aspect of reservoir simulation for field problems is the ability to make production forecasts. Usually a number of different simulated cases are compared for the purpose of making decisions. Drilling locations, production rates, injection plans, etc. are factors that may vary from case to case.
The simulator data is taken from available information such as well logs, core analysis, geological description, pressure data, and production data. In many cases, the well or wells have already produced. For these cases, the past production period is simulated for the purpose of "history matching". The input data usually must be adjusted in order to match the past performance. This calibration process provides a more accurate reservoir "model" to be used for forecasts.
In this chapter, we introduce the finite difference approach as an alternative to analytical solutions. This approach is usually called reservoir simulation. The theory and practice of reservoir simulation are covered in several publications.
t
x
t
p p p P(x+ ā x)
x x+ ā x
P(x)
x
P
Fig. 1 - Finite difference template, Fig. 2 - Illustration of Taylor showing pressures involved in the finite series analysis. difference equation.
We know the value of p at the n time level and we are trying to determine the values of p at the n+1 time level.
The solution procedure for the finite difference equations is as follows:
(1) specify values for all pi^0 at t = 0. (this is the initial condition)
(2) solve for all pin+1^ for timestep 1.
(3) repeat this procedure for a sequence of timesteps, using the values from the previous timestep as the "old" n values.
(4) stop when the desired time has been simulated.
It would have been possible to discretize the left-hand side of Eq. 1 at the n time level. In that case, we would have only had one unknown, pin+1. This method would be called an explicit finite difference equation. This would be easier to solve, but is of no practical use because it is unstable (oscillates or blows up) for practical timestep sizes.
Theoretical basis, Taylor series. Our justification for approximating Eq.1 with Eq.2 is based on Taylor series analysis. Consider the function p(x) in Fig. 2. Suppose we know the value of p(x) at the point x. Also suppose we know all the derivatives of p(x) at the point x. If we want to approximate the value
p(x + x) = p(x)+ xp (x)+ x 2!
p (x)+ x 3!
p (x)+ + x n!
p (x)+
2 3 n (^) n ā ā
where pn^ is the n th derivative of p. 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 , e (^) t , (the remaining terms which are not included). This truncation error is
t
n+1 (^) n e =
p(x ) x (n + 1)!
1 (4)
and is equal to
t
n+1 (^) n e =
p(x + ) x (n + 1)!
(0 x)
⤠ā¤
1 (5)
It should be remembered that the function p(x) and all its derivatives must be continuous throughout the interval under consideration. (In fact, we often deal with discontinuities in both time and space. That limits the Taylor series analysis. Still we will continue our discussion about using Taylor series for developing our finite difference equations.)
i+1 i
(^2 ) 2
3 3
4 p (^) = p + x (^4) p x
x 2!
p x
x 3!
p x
x 4!
p x
i-1 i
2 2
3 3
4 p (^) = p - x (^4) p x
x 2!
p x
x 3!
p x
x 4!
p x
Notice that the right-hand side now uses partial derivatives (evaluated at x (^) i ) since p is a function of both x and t , p(x,t).
Initial conditions. Initial conditions are required to begin the timestep sequence. For the initial conditions, n=0 , a value is specified for each pressure. The most common initial condition is to specify each pressure to be equal to a constant, such as
i
0 p = pinitial i = 1,.., IMAX (11)
where IMAX is the total number of points in the x direction. This typifies a well or reservoir at initial conditions of no fluid flow.
Boundary conditions. For a 1-D problem, we need to specify equations other than Eq. 2 at the left boundary and the right boundary. Usually, either a fixed pressure (mathematically called the Dirichlet condition) or a fixed first derivative (the Neumann condition) are specified, as follows:
Fixed pressure:
p 1 n+1^ = C 1 (12)
or,
pIMAXn+1^ = C 2 (13)
Fixed first derivative:
2 1 3
p - p x
or,
IMAX IMAX - 4
p - p x
where C 1 , C 2 , C 3 , and C 4 are values specified by the problem. Although these values may change with time, they are held constant during the timestep.
We now will discuss how the solution is obtained for a timestep.
The pressure solution - a matrix problem. We can now state all of the equations that are to be solved simultaneously for a particular timestep. Let us take a case where the boundary conditions are fixed pressure. For the following equations, the unknown pressures are on the left hand side and the right hand side has known values.
The left boundary:
p 1 = (^) C 1
The interior points, i = 2,...,IMAX-1 :
- p^ + 2 +
c 0.00633k
x t
p (^) - p (^) =
c 0.00633k
x t i-1n+1^ t in+1 i+1n+1 pin
The right boundary:
p (^) IMAX = (^) C 2 (18)
Eqs. 16-18 comprise a system of simultaneous equations with IMAX unknowns and IMAX equations. All of these equations are linear with respect to the unknown pressures. That is, there are no pressure squared, etc. All of the pressure terms have coefficients which do not depend on pressure.
As an example, let us consider a problem where IMAX = 5. For this problem, we have five unknown pressures and five equations. Three of these equations are for interior points, represented by the finite difference equation, Eq. 2. The first and last equations are for the boundary conditions.
This set of equations can be represented by a matrix equation which can simply be written as
A p = d (19)
where A is a coefficient matrix, and p and d are column vectors. The matrix equation, Eq. 19, can be shown as
Forward sweep:
w 1 = b 1 g 1 = d 1 /w 1 wi = bi - a (^) i c (^) i-1 / wi- gi = (di - a (^) i gi-1 ) / wi
carried out with i increasing, and
Backward sweep:
pIMAX = gIMAX
pi = gi - c (^) i pi+1 / wi
carried out with i decreasing.
After this computation is completed, we have now solved for the new pressures and are ready to go to the next timestep.
Example 2.1 ā 1-D Simulation
Problem. Solve the following initial/boundary value problem with the method just discussed:
permeability = 10 md viscosity = 10 cp compressibility = 20 x 10 -6^ psi - length = 400 ft porosity = 0.
Initial condition:
p(x,0) = 1,000 psi
Boundary conditions:
p(0,t) = 0 psi
p(400,t) = 1,000 psi
Model parameters:
Solution.
This problem is solved by writing a FORTRAN program. The following program is specifically written to solve this problem and output the pressure results each timestep.
Boundary Conditions Example.
p 1 = 0
p 5 = 1,
1 0 1 1 1 1 1 1 0 1
0
1000
2 3 4
1 2 3 4 5
2 3 4
ā ā ā ā ā ā
ā
ā
ā ā ā ā ā ā
ā
ā
ā ā ā ā ā ā
ā
ā
ā ā ā ā ā ā
ā
ā
ā ā ā ā ā ā
=
ā
ā
ā ā ā ā ā ā
ā
ā
ā ā ā ā ā ā b b b
p p p p p
d d d
b 2 = b 3 = b 4 = 2 + α
d 3 = α p 3 n
c==================================================== thomas SUBROUTINE thomas(a,b,c,d,p,n) c this is a solution of tridiagonal system of equations c a,b,c,d : coefficients of the equation, c a(i) * x(i-1) + b(i) * x(i) + c(i) * x(i+1) = d(i) c p = solution vector c n = number of unknowns DIMENSION a(),b(),c(),d(),p(*),w(101),g(101) w(1) = b(1) g(1) = d(1) / w(1) DO 1 i = 2,n w(i) = b(i) - a(i) * c(i-1) / w(i-1) g(i) = (d(i) - a(i) * g(i-1)) / w(i) 1 CONTINUE p(n) = g(n) DO 2 i = n-1,1,- p(i) = g(i) - c(i) * p(i+1) / w(i) 2 CONTINUE RETURN END
The numerical results are shown in Fig. 3 Although results are only computed at discrete points, it is customary to draw straight lines between points. The straight lines, rather than a smoothed curve, emphasize the discrete nature of the solution and clearly shows where the discrete points are. The solutions in Fig. 3 show that the early solution is transient but approaches steady state at 80 days.
0 100 200 300 400 X (ft)
0
200
400
600
800
1000 p(x,t) (psi)
t = 5 days 10 (^2030) 80
0 100 200 300 400 X (ft)
0
200
400
600
800
1000 p(x,5) (psi)
.ā t = 5 days .ā t = 2.5 days ā t = 1.25 days .ā t = 0. .ā t = 0. .ā t = 0.
Fig. 3 - Pressure profiles Fig. 4 - Comparison of pressure for Example 1. profiles at t = 5 days for different timestep sizes.
about the highest in the x profile). This selection of āt and āx is a judgement, according to the practicality for the problem being solved.
0 1 2 3 4 5 .ā t (days)
550
575
600
625
650
675
700 p(100,5) (psi)
āx = 12.5 ft
0 20 40 60 80 100 .ā x (ft)
550
575
600
625
650
675
700 p(100,5) (psi)
āt = 5 days
āt = 1.25 days
āt = 0.15625 days āt = 0.01 days
ā x = 6. 25 ft
āx = 100 ft
āx = 50 ft
Fig. 5 - Effect of timestep size on Fig. 6 - Effect of grid spacing on pressures at x = 100 feet and t = 5 days pressures at x = 100 feet and t = 5 days
0 100 200 300 400 X (ft)
0
200
400
600
800
1000 p(x,5) (psi)
āx = 25 ft , āt = 1.25 days
āx=100 ft , āt =5 days
Analytical Solution
0 20 40 60 80 Time (days)
0
200
400
600
800
1000 p(100,t) (psi)
āx = 100 ft , āt = 5 days
āx = 25 ft ,āt = 1.25 days
Analytical Solution
Fig. 7 - Comparison of pressure Fig. 8 - Comparison of pressure profiles at t = 5 days vs. time at x = 100 feet
On large problems encountered in reservoir simulation, there is a cost involved in taking
data is somewhat inaccurate and uncertain. Therefore, something less then complete accuracy may be acceptable in order to reduce cost and simplify data preparation.
should not expect these values to apply to other problems. The trial and error procedure for
for practical problems when the question of accuracy arises. Most of the time the correct analytical solution is not known, so converging results are taken to be converging on the correct solution.
approaching zero. For certain other problems, such as water displacing oil (the Buckley-Leverett
always give the best results.
Other Taylor Series Approximations. The following is a table that shows forward, backward, and central difference expressions for first and second derivatives.
pi = p(x) pi+1 = p(x+āx) pi+2 = p(x+2āx) z z z
Difference Expression pi-3 pi-2 pi-1 pi pi+1 pi+2 pi+
Forward Difference
Backward Difference
Central Difference
Higher Order Difference Expressions
2 2
p x
p t
+ ( x ) ( x)
x_
p (^2) 2
i- 1 i i+ 1 2
2 ā ā ā
where
(x,t) (x- x x x+ x) x
p 12
( x) ( x)=- 4
(^24) (^2) ā ⤠⤠ā ā
+ ( t) t
t_
p n i
n+ 1 i (^) ā ā ā
where
(x,t ) (t t t+ t) x
p 2
t ( t)=- 2
2 ⤠⤠ā ā
( x )
( p - 2 p + p ) =
t 2 i-1n in i+1n ( p^ in+1 -^ p )in ā ā
( x )
( p - 2 p + p ) =
t 2 i-1n+1 in+1 i+1n+1 ( p^ in+1 -^ p )in ā ā^
Crank-Nicolson Method (C-N). This is a half explicit/half implicit method
( x )
( p - 2 p + p ) +
( x )
( p - 2 p + p ) =
t 2 i-1n in i+1n 2 i-1n+1 in+1 i+1n+1 ( p^ in+1 -^ p )in ā ā ā
General Implicit Methods. This is also a mixed explicit/implicit method, but is more flexible than the C-N method.
( x )
( p - 2 p + p ) +
( x )
( p - 2 p + p ) =
t
Only the implicit method is unconditionally stable (for any timestep size). The explicit method is stable only for sufficiently small timesteps, which are generally impractical. Although the Crank-Nicholson method has higher order accuracy, it is on the borderline of instability and is conditionally stable for practical purposes. Therefore, the implicit method is the standard in reservoir simulation. If more accuracy is required, smaller timesteps are used.