Concept
After Finite Difference Discretization, the flow equations yield a system of algebraic equations; if the system is nonlinear, it is likewise reduced to a linear system [A]x = d after linearization. Except for the explicit difference scheme, it must be solved once at every time step (at every iteration for the fully implicit method), so solving the linear system is one of the most central steps in reservoir simulation.
These systems have several favorable properties. Each grid block is connected only to its neighbors, so the coefficient matrix is a sparse banded matrix: with natural ordering it is tridiagonal in one dimension, pentadiagonal in two dimensions, and heptadiagonal in three dimensions, with the nonzero elements concentrated within a band of width 2bw + 1, where bw = 1 in one dimension, bw equals the number of grid blocks in one direction in two dimensions, and bw is the product of the numbers of grid blocks in two directions in three dimensions. The matrix is also usually diagonally dominant and irreducible. The efficiency of the various methods depends to a large extent on whether these properties are exploited.
Solution methods fall into two broad classes:
- Direct methods: based on Gaussian elimination, they obtain the solution through a finite number of definite operations; ignoring round-off error, the result is the exact solution of the system.
- Iterative methods: an initial guess is given first and then corrected step by step according to some scheme, approaching the true solution under certain conditions, and stopping when the required accuracy is met.
The strongly implicit procedure uses matrix factorization, and line relaxation solves a tridiagonal system at each iteration; they contain components of both classes, but both are completed by iteration and are generally classed as iterative methods.
Classification
Direct Methods
| Method | Key points |
|---|---|
| Gaussian elimination | The basis of all direct methods, requiring about n³/3 multiplications and divisions; Gauss-Jordan elimination omits back substitution but requires about n³/2 |
| LU (Crout) decomposition | Essentially the same as Gaussian elimination; the right-hand-side vector is not changed during decomposition, so the factors can be reused when the same coefficient matrix has several right-hand sides |
| Thomas algorithm | Dedicated to tridiagonal equations, with simple operations and small storage; whether in a direct or an iterative method, it is used whenever a tridiagonal system is encountered |
| Compressed-storage banded elimination | Operates on and stores only the band; one of the most commonly used direct methods in numerical simulation |
| D4 ordering | Reorders the grid to change the matrix structure; in two dimensions with I = J the workload is about 1/4 of that of natural ordering, and in general 1/2 to 1/4; in three dimensions it is generally 0.2 to 0.5 |
The coefficient matrix of the flow equations is diagonally dominant, so pivoting is generally unnecessary during elimination and the time for pivot selection can be saved; elimination with partial (column) pivoting is used only when the matrix lacks strict diagonal dominance. With natural ordering, the ordering should run along the direction with fewer grid blocks to reduce the bandwidth: for a two-dimensional region with I and J grid blocks in the x and y directions and J < I, the workload of banded Gaussian elimination is about IJ³ operations and the storage about IJ² elements. Simultaneous solution of multiple phases gives block tridiagonal, block pentadiagonal, and similar systems; see Fully Implicit Method.
Iterative Methods
- Simple iteration (Jacobi) and Gauss-Seidel iteration: convergence is too slow, and they are almost no longer used in reservoir simulation.
- Successive over-relaxation (SOR) and line relaxation (LSOR): a relaxation factor is used for acceleration; in line relaxation, all the nodes on an entire line are solved together by the Thomas algorithm at each iteration, converging faster than point relaxation, and it is the most widely used iterative method.
- Alternating direction implicit procedure (ADIP): very fast for simple homogeneous problems, but converges poorly for anisotropic, heterogeneous problems and problems with complex boundaries, for which it is difficult to find suitable iteration factors; it has tended to be phased out.
- Strongly implicit procedure (SIP): iterates by constructing an approximate upper and lower triangular decomposition and is fairly adaptable to heterogeneous problems; after comparisons, some authors have concluded that the strongly implicit procedure is better for areal models and line relaxation is better for cross-section models.
- Preconditioned conjugate gradient method (PCG) family: an incomplete LU decomposition of the coefficient matrix is first made as the preconditioner, and conjugate gradient iteration is then applied; each step is fast and the residual is guaranteed to decrease, and for large sparse systems these preconditioned conjugate gradient methods are far superior to traditional iterative methods. The conjugate gradient method requires a symmetric positive definite matrix, whereas the systems in reservoir simulation are often unsymmetric and sometimes ill-conditioned, so the most widely used method is the orthogonal minimization (Orthomin) method, developed from it. This family has become the most competitive class of methods.
Comparison of the Two Classes of Methods
| Item | Direct methods | Iterative methods |
|---|---|---|
| Reliability | The exact solution is obtained in one pass (ignoring round-off error); independent of whether the problem is heterogeneous or the matrix is ill-conditioned | The speed of convergence depends strongly on the nature of the problem, and difficult problems may converge very slowly or not at all |
| Workload | Depends only on the method and the size, and can be estimated in advance | Depends on the number of iterations and is hard to estimate; choosing the iteration factors often requires trial calculations |
| Storage | Large, growing faster and faster as the number of nodes increases | Small, and the size of problem that can be solved is much larger |
| Error | In large multiphase problems, round-off error may cause trouble | Errors produced in the iteration are gradually eliminated |
The workloads can be compared roughly. For the iterative method, WI = cNiIM, and for the banded direct method, WD = fIM³; their ratio is:
where c is the number of multiplications and divisions per node per iteration (two dimensions: strongly implicit 24, ADIP 19, line relaxation 9; three dimensions: 37, 28, 11); Ni is the number of iterations required to reach the termination criterion; I is the number of nodes in the direction with the most nodes; M is the half-bandwidth under natural ordering, M = J in two dimensions and M = JK in three dimensions; and f is the ordering coefficient, equal to 1 for natural ordering and 0.17 to 0.5 for D4 ordering. When the half-bandwidth M < Mc the direct method is faster, and when M > Mc the iterative method is faster.
Unified example. The single-phase or IMPES pressure equation for 5 grid blocks in one dimension (assumed; this is the unified example used throughout this category) is a tridiagonal system of order 5, solved directly by the Thomas algorithm. If it is extended to a two-dimensional 5 × 5 grid, there are 25 equations in all and the half-bandwidth is M = 5; with line relaxation (c = 9) and assuming 20 iterations per step, Mc = √(9 × 20) ≈ 13.4 and WD/WI = 5²/(9 × 20) ≈ 0.14, so the direct method is about 7 times faster; with D4 ordering (f taken as 0.25), Mc ≈ 26.8. With the iteration count assumed in this example (20 iterations, and f = 0.25 for D4 ordering), the iterative method becomes advantageous only when the short side of the two-dimensional grid exceeds a dozen or so blocks (natural ordering) or two dozen or so (D4 ordering); the number of iterations varies with the number of grid blocks, the degree of heterogeneity, and so on, and the critical value varies accordingly.
Influencing Factors and Considerations
- Choose the method by size. The general principle is to use direct methods for smaller problems and iterative methods for larger ones. Experience suggests that direct methods are usually better than iterative methods for fewer than 2,000 to 3,000 equations, and they are recommended for single-well models, window models, and coarse-grid cross-section models; IMPES has only one pressure equation per grid block, so direct methods can be used for larger models than with the fully implicit method; large models should all use iterative methods, and when in doubt, both classes of methods should be tested early in the study.
- Number of iterations. The workload c of each iteration is essentially fixed for an iterative method, so the total workload mainly depends on the number of iterations Ni, and the various acceleration measures all aim at reducing it. The factors affecting Ni fall into two groups:
| Adjustable | Determined by the problem |
|---|---|
| Iteration factors: good or bad choices can change the speed by a factor of several to dozens | Degree of heterogeneity and boundary shape |
| Termination error: the stricter it is, the more iterations; when it is already very strict, tightening it further increases the count rapidly | When the flow is close to steady state, convergence takes only a few iterations; strongly unsteady flow converges slowly |
| Initial guess: a good choice reduces the iterations | Ill-conditioned matrices may converge extremely slowly or not at all |
| Sweep direction: for line relaxation in a cross-section model, taking the "lines" along the vertical direction, where transmissibility is greatest, is much faster than along the horizontal direction; alternating the sweep direction is often helpful | Time step: a large step weakens the diagonal dominance and increases the number of iterations |
- Adaptability of the methods. The relative merits of iterative methods vary with the problem, and comparison conclusions are only trends: the appropriate method may differ between areal and cross-section problems and between homogeneous and strongly heterogeneous problems, and the actual choice often depends on experience with similar problems or on trial calculations.
- Termination accuracy and material balance. An iterative method gives an approximate solution; if the allowable error is set too wide, the residuals of each step may accumulate into a material balance error, while tightening it increases computer time, so it should be determined together with material balance checks.
- Effect of the number of grid blocks. The number of grid blocks and the ordering scheme determine the bandwidth and hence the workload and storage of direct methods, and should be considered together in grid design; see Grid System.