Petroleum Knowledge Base

Finite Difference Discretization

Finite difference discretization replaces the derivatives in the partial differential equations of fluid flow in porous media with difference quotients at grid nodes, turning the continuous equations into a system of algebraic equations, one for each grid block. A central difference is commonly used for the second spatial derivative and a backward difference (implicit) for the time derivative; the explicit scheme is limited by the stability condition ηΔt/Δx² ≤ 1/2 (η is the hydraulic diffusivity). It is the earliest and most widely used discretization method in reservoir numerical simulation.

Concept

The most commonly used discretization method in reservoir simulation is the finite difference method. Whether the problem is single-phase or multiphase, single-component or multicomponent, one-dimensional or multidimensional, a complete body of theory and solution techniques has been developed for it. The finite element method, variational methods, and the boundary element method can also be used but are less widely applied. Discretization is needed because the flow equations describing the variation of pressure and saturation with time are mostly nonlinear partial differential equations, for which analytical solutions are difficult to obtain. After discretization, only approximate values at a finite number of points are sought, and the partial differential equations become algebraic equations.

The finite difference method replaces derivatives with difference quotients, and the discretization has two aspects:

  • Spatial discretization: the study region is divided into a grid, usually rectangular, with step sizes Δx, Δy, and Δz in the x, y, and z directions, and each grid block is regarded as a homogeneous cell;
  • Time discretization: the simulated period is divided into a number of time steps Δt, and the calculation advances step by step, with the new pressures and saturations obtained at each step from the results of the previous step.

After discretization, each grid node yields an equation that relates the unknowns at that point to those at the adjacent nodes. It is generally nonlinear; after linearization it is combined with the boundary and initial conditions into a system of algebraic equations, from which the pressure and saturation at each node are solved. For unsteady flow this is repeated at every time step.

Mechanism and Methods

Difference Quotients and Truncation Error

Let the step size at grid point xi be h, and fi = f(xi). Expanding fi+1 and fi−1 in a Taylor series about xi and dropping the higher-order terms gives the difference approximations of the derivatives; the part dropped is called the truncation error:

Approximation Difference formula Truncation error
First derivative, forward difference (fi+1 − fi)/h O(h), first-order accuracy
First derivative, backward difference (fi − fi−1)/h O(h), first-order accuracy
First derivative, central difference (fi+1 − fi−1)/(2h) O(h²), second-order accuracy
Second derivative, central difference (fi+1 − 2fi + fi−1)/h² O(h²), second-order accuracy

Flow equations often contain variable-coefficient terms such as ∂/∂x(k ∂p/∂x). The approach is to first take the first-order difference quotients at the half-points xi±1/2 on the two sides of the grid block, multiply them by the coefficient at that location, and then take the difference quotient of the two; the same treatment can be used when the grid step sizes on the left and right are unequal.

Spatial Discretization: Five-Point Scheme and Transmissibility

The flow equation is second order in space, for which central differences are usually used, and first order in time, for which a backward difference is usually used. This choice is made mainly for the numerical stability of the equation system. For two-dimensional problems the most common is the five-point difference scheme: the point (i, j) and its four neighbors above, below, left, and right form one equation with five points. To reduce the influence of grid orientation, a nine-point scheme is also sometimes adopted.

The coefficients at the half-points are combined into the transmissibility T, and the node equation is written as "sum of the pressure differences with each adjacent point multiplied by the transmissibility + source and sink terms = accumulation term." The transmissibility equals the product of the geometric factor G and the mobility term 1/(μB); the geometric factor in the x direction is:

Gi+1/2 = ΔyjΔzk / [(xi+1/2 − xi)/Ki + (xi+1 − xi+1/2)/Ki+1]

The denominator is the sum of the "length/permeability" of the half-segments in the two grid blocks, which is equivalent to treating the two segments as being in series; the permeability is taken as the distance-weighted harmonic average.

Each node is connected only with its adjacent nodes, so the coefficient matrix is very sparse: tridiagonal in one dimension, pentadiagonal for the two-dimensional five-point scheme, and heptadiagonal in three dimensions.

Time Discretization: Explicit, Implicit, and Crank-Nicolson

For the same node equation, the time level at which the spatial terms are evaluated determines the nature of the scheme:

Scheme Time level of spatial terms Characteristics
Forward difference (explicit) Old time level n pn+1 can be calculated directly at each node, with no need to solve simultaneously; the step size is limited by stability
Backward difference (implicit) New time level n+1 The equation system must be solved simultaneously; no strict stability limit on the step size, and it is widely used in reservoir simulation
Crank-Nicolson Arithmetic mean of n and n+1 Truncation error O(Δx² + Δt²); the amount of work is similar to that of the implicit scheme
Central difference in time n−1 and n+1 Second-order accuracy, but usually unstable and difficult to start from the initial conditions, so rarely used

The coefficients also have a time-level issue: B and μ in the transmissibility vary with pressure. If they are evaluated at the old-time-level pressure pn, the coefficients are known and the equation is linear; if they are evaluated at pn+1, the coefficients are themselves functions of the unknowns, giving nonlinear algebraic equations that must be linearized before being solved. Different combinations of the time levels at which pressure and saturation are evaluated give rise to solution methods such as the implicit pressure, explicit saturation method and the fully implicit method.

Consistency, Convergence, and Stability

Whether a difference equation can replace the differential equation depends on three properties:

  • Consistency: as the step size tends to zero, the truncation error also tends to zero, that is, the truncation error is O(hp) with p ≥ 1. It is a property of the difference equation itself and does not guarantee the accuracy of the solution.
  • Convergence: as the step size tends to zero, the solution of the difference equation tends to the solution of the differential equation.
  • Stability: rounding errors and other errors introduced in the calculation are not amplified as the time steps advance.

For the explicit difference scheme of the one-dimensional diffusion equation ∂²u/∂x² = ∂u/∂t, let r = Δt/Δx²; the stability condition is r ≤ 1/2. In a demonstration example with Δx = 0.2 and Δt equal to 0.01, 0.02, and 0.04 (r = 0.25, 0.5, and 1.0), the first two results decay smoothly with time, whereas at r = 1.0 the values alternate in sign with ever-increasing amplitude, and by t = 0.32 the value at x = 0.2 has already reached 13, which is meaningless. The Fourier method (the von Neumann criterion) is commonly used in general stability analysis and requires that the modulus of the error amplification factor not exceed 1.

Unified example. For single-phase slightly compressible flow in a one-dimensional horizontal homogeneous reservoir, the equation can be written as ∂²p/∂x² = (φμCt/K)∂p/∂t. Assume K = 0.1 μm² (10−13 m²), φ = 0.20, μ = 2 mPa·s, and Ct = 1.5 × 10−3 MPa−1, with a length of 1 000 m divided into 5 grid blocks, so that Δx = 200 m. The hydraulic diffusivity is

η = K/(φμCt) = 10−13 / (0.20 × 2 × 10−3 × 1.5 × 10−9) ≈ 0.1667 m²/s

Here r = ηΔt/Δx², and the explicit scheme requires

Δt ≤ Δx²/(2η) = 200² / (2 × 0.1667) ≈ 1.2 × 105 s ≈ 1.39 d

When the grid is refined to Δx = 20 m, the upper limit drops to 1 200 s (20 min), a reduction to 1/100. The implicit scheme has no such limit, and for the 5 grid blocks a 5 × 5 tridiagonal system is solved at each step.

Influencing Factors and Considerations

  1. Step size, accuracy, and workload. The finer the grid and time step, the smaller the truncation error and the greater the computational work; a coarser grid saves computation but reduces accuracy. The step sizes are chosen according to the problem to be solved.
  2. Stable does not mean accurate. For linear problems the implicit scheme is not subject to a stability limit on step size, but if the step is too large, the time truncation error still distorts the results. For the explicit scheme, even if the stability condition is satisfied, the error is merely not amplified.
  3. Grid orientation effect. The results of two-dimensional displacement calculations may vary with the grid direction: for the same well pattern, changing the grid direction may give different front positions and water breakthrough times. To reduce the grid orientation effect, the more complex nine-point scheme can be adopted. For the division of the grid, see Grid System.
  4. Unequal grid spacing. With unequal step sizes the accuracy of the central difference is generally lower than on an equally spaced grid. The sizes of adjacent grid blocks should transition gradually, and the grid can be locally refined near wells and where saturation and pressure change sharply.
  5. Time level of nonlinear coefficients. Whether transmissibility and relative permeability are evaluated at the old or the new time level affects stability and the computational work per step, especially in multiphase flow.
  6. Independence from the model. The same discretization method is used for the black oil model and the compositional model; the difference lies only in the number of equations and unknowns at each node.

References

  1. Chen Yueming. Fundamentals of Reservoir Numerical Simulation (in Chinese). China University of Petroleum Press, 1989.
  2. Zhang Liehui. Fundamentals of Oil and Gas Reservoir Numerical Simulation (in Chinese). Petroleum Industry Press, 2005.
  3. Han Dakuang; Chen Qinlei; Yan Cunzhang. Fundamentals of Reservoir Numerical Simulation (in Chinese). Petroleum Industry Press, 1993.