A New Method for the Rapid Calculation of FinelyGridded Reservoir Simulation Pressures


 Sherilyn Berry
 8 months ago
 Views:
Transcription
1 Brigham Young University BYU ScholarsArchive All Theses and Dissertations A New Method for the Rapid Calculation of FinelyGridded Reservoir Simulation Pressures Benjamin Arik Hardy Brigham Young University  Provo Follow this and additional works at: Part of the Chemical Engineering Commons BYU ScholarsArchive Citation Hardy, Benjamin Arik, "A New Method for the Rapid Calculation of FinelyGridded Reservoir Simulation Pressures" (005). All Theses and Dissertations This Thesis is brought to you for free and open access by BYU ScholarsArchive. It has been accepted for inclusion in All Theses and Dissertations by an authorized administrator of BYU ScholarsArchive. For more information, please contact
2 A NEW METHOD FOR THE RAPID CALCULATION OF FINELYGRIDDED RESERVOIR SIMULATION PRESSURES by Benjamin A. Hardy A thesis submitted to the faculty of Brigham Young University in partial fulfillment of the requirements for the degree of Master of Science Department of Chemical Engineering Brigham Young University December 005
3 Copyright 005 Benjamin A. Hardy All Rights Reserved
4 BRIGHAM YOUNG UNIVERSITY GRADUATE COMMITTEE APPROVAL of a thesis submitted by Benjamin A. Hardy This thesis has been read by each member of the following graduate committee and by a majority vote has been found satisfactory. Date Hugh B. Hales, Chair Date Larry L. Baxter Date Merrill W. Beckstead
5 BRIGHAM YOUNG UNIVERSITY As chair of the candidate s graduate committee, I have read the thesis of Benjamin A. Hardy in its final form and have found that (1) its format, citations, and bibliographical style are consistent and acceptable and fulfill university and department style requirements; () its illustrative materials including figures, tables, and charts are in place; and (3) the final manuscript is satisfactory to the graduate committee and is ready for submission to the university library. Date Hugh B. Hales Chair, Graduate Committee Accepted for the Department William G. Pitt Graduate Coordinator Accepted for the College Alan R. Parkinson Dean, Ira A. Fulton College of Engineering and Technology
6 ABSTRACT A NEW METHOD FOR THE RAPID CALCULATION OF FINELYGRIDDED RESERVOIR SIMULATION PRESSURES Benjamin A. Hardy Department of Chemical Engineering Master of Science A new method for the determination of finelygridded reservoir simulation pressures has been developed. It is estimated to be as much as hundreds to thousands of times faster than other methods for very large reservoir simulation grids. The method extends the work of Weber et al. 7 Weber demonstrated accuracies for the pressure solution normally requiring millions of cells using traditional finitedifference equations with only hundreds of cells. This was accomplished through the use of finitedifference equations that incorporate the physics of the flow. Although these coarsegrid solutions achieve accuracies normally requiring orders of magnitude more resolution, their coarse resolution does not resolve local pressure variations resulting from finegrid permeability variations. Many oil reservoir simulation models require fine grids to adequately represent the reservoir properties. Weber s coarse grids are of little value. This study
7 takes advantage of the accurate coarsegrid solutions of Weber, by nesting them in the requisite fine grids to achieve much faster solutions of the large systems. Application of the nestedgrid method involved calculating an accurate solution on a coarse grid, nesting the coarsegrid solution as fixed points into a finer grid and solving. Best results were obtained when an optimal number of coarsegrid pressure points were nested into the fine grid and when an optimal number of nestedgrid systems were used. Speed Increase Factor for Weber's Results Grid Size One Optimum NestedGrid Two Optimum NestedGrids Three Optimum Nested Grids
8 ACKNOWLEDGEMENTS I would like to express appreciation to my advisor Dr. Hugh B. Hales for his untiring support and kindness. I would also like to thank the members of my graduate committee, Dr. Larry L. Baxter and Dr. Merrill W. Beckstead for their input and willingness to be on my committee. I am very grateful for the financial support that IRSRI has provided during my time as a graduate student. I consider myself fortunate to have had the privilege of completing my Master of Science degree at Brigham Young University among such outstanding students and faculty.
9 TABLE OF CONTENTS List of Tables...xi List of Figures xiii Nomenclature xvi Chapter 1 Introduction Technologies That Depend on Reservoir Simulation.. 1. Reservoir Descriptions Reservoir Simulation Approaches Review of Multiscale Methods Summary.. 8 Chapter Background Weber s Equations and NestedGrid Description 9. Comparison to Multigrid Method Reservoir Description Solution of the Pressure Equation Summary Chapter 3 Testing the Performance of Various Solvers as a Function of Grid Size Size Direct Methods Iterative Methods MATLAB 7.0 Iterative Methods Summary... Chapter 4 Performance of Various Solvers Direct Methods: Results Stationary and Nonstationary Iterative Methods: Results Summary 30 Chapter 5 Determination of Best Solver viii
10 5.1 Summary 3 Chapter 6 Implementation of Solver in NestedGrid Method Grid Geometries and General Setup Calculation of CoarseGrid Pressure Calculation of FineGrid Pressure: LaPlace SOR Results NestedGrid Method: GMRES Results Data Analysis Summary 41 Chapter 7 Interpolation Considering Interpolation Summary 46 Chapter 8 Weber s Coefficients Summary 56 Chapter 9 Study with Weber s Coefficients Applied Grid Geometries and General Setup NestedGrid Results Regression and Dimensionless Time Analysis Summary 63 Chapter 10 Regression of All Results Regression of LaPlace and Weber SOR GMRES Regression Summary 70 Chapter 11 Dimensionless Time and Optimum CoarseGrid Size Dimensionless Time LaPlace SOR: Optimization of the NestedGrid Method GMRES: Optimization of the NestedGrid Method Weber SOR: Optimization of the NestedGrid Method Comparison of the Performance of the Different Methods Optimal Number of Fixed Points Summary Chapter 1 Error Anlaysis Error Analysis Results...8 ix
11 1. Summary 86 Chapter 13 Multiple NestedGrid Analysis Results Practical Multiple NestedGrid Study Summary 93 Chapter 14 Conclusion and Future Work Conclusions Future Work.100 Appendix Appendix A Appendix B Appendix C Appendix D Appendix E References..101 Tables Referred to in Body of Thesis..103 Original LaPlace and GMRES Regression and Dimensionless Time Analysis Original Weber Regression and Dimensionless Time Analysis..13 Optimal OverRelaxation Factor Finder..19 Summary of Computer Programs x
12 LIST OF TABLES Table Page I. General Objectives of Study II. III. IV. Grid Sizes and Dimensions..18 FineGrid Sizes Used in NestedGrid Study CourseGrid Sizes 34 V. Grid Dimensions and Size VI. VII. VIII. IX. NestedGrid Points Take From a 5x5x10 Grid 84 NestedGrid Points Taken From a 15x15x30 Grid..84 NestedGrid Points Taken From a 5x5x10 Grid..84 NestedGrid Points Taken From a 15x15x30 Grid..84 X. Size of Coarse and Fine Grids in NestedGrid Method...88 XI. A.XII A.XIII A.XIV A.XV. A.XVI. A.XVII. Dimensionless Time Required to Solve NestedGrid Method NestedGrid Configurations LaPlace SOR: Fine and NestedGrid Results GMRES: Fine and NestedGrid Results Interpolation Study Interpolation Study: Comparison with No Interpolation Weber SOR: Fine and NestedGrid Results with Weber s Coefficients..106 A.XVIII. LaPlace SOR: Dimensionless Time Results of NestedGrid Method..107 xi
13 A.XIX A.XX. A.XXI A.XXII B.XXIII B.XXIV B.XXV B.XXVI GMRES: Dimensionless Time Results of NestedGrid Method..107 Weber SOR: Dimensionless Time Results of NestedGrid Method. 108 Absolute Difference from a 109 Solution Percent Difference from 109 Solution Laplace SOR: Fine and NestedGrid Results Fine and NestedGrid Results for GMRES Dimensionless Time Results of NestedGrid Method Dimensionless Time Results of NestedGrid Method...10 C.XXVII Weber SOR: Fine and NestedGrid Results with Weber s Coefficients..13 C.XXVIII Performance of NestedGrid Method Using Weber s Coefficients xii
14 LIST OF FIGURES Figure Page 1. Weber et al. Results Depiction of Smoothing Property Hypothetical Reservoir Being Simulated Determination of the Optimal OverRelaxation Factor Direct Methods: Time required for Convergence as a Function of Grid Size Direct Methods: Memory (RAM) Requirements as a Function of Grid Size Iterative Methods: Time Required for Convergence as a Function of Grid Size Iterative Methods: Memory (RAM) Requirements as a Function of Grid Size Top and Side Plane Views of Fixed Points in a 5x5x10 Grid NestedGrid Configurations: Percentage of Fixed Points LaPlace SOR: Time Required for Convergence of Various NestedGrids GMRES: Time Required for Convergence as a Function of Grid Size Comparison of Time Required to Obtain FullFine Grid Pressure Solution With and Without Interpolation Application of Weber s Coefficients Coarse Grid Dimensions in Feet x5x10 CoarseGrid Pressures Nested Into a 15x15x30 Grid xiii
15 17. Weber SOR: Time Required for Convergence of Various NestedGrid Configurations LaPlace and Weber SOR Combined Data Set Regression LaPlace and Weber SORCombined ORF Regression GMRES Regression Time/Iteration as a Function of Total Grid Size Laplace SOR: Improvement Obtained by the NestedGrid Method GMRES: Improvement Obtained by the NestedGrid Method Weber SOR: Improvement Obtained by the NestedGrid Method Ratio of Improvement Dimensionless Time Summary Optimal Number of Fixed Points Multiple NestedGrid Analysis: 10 3, 10 5, and 10 6 Grid Sizes Practical NestedGrid Configuration A Look at Optimal, Practical and No Nested Grid Configurations B.31. LaPlace SOR Time/Iteration as a Function of Total Grid B.3. Improvement Obtained by the NestedGrid Method B.33. Optimal Number of CoarseGrid Points Nested Into Fine Grid B.34. GMRES: Time/Iteration as a Function of Total Grid Size B.35. Optimized NestedGrid Method Using SOR Compared with GMRES B.36. Comparison of Improvement Obtained by the NestedGrid Method for GMRES and SOR....1 C.37. Weber Time/Iteration as a Function of Total Grid Size C.38. Improvement Obtained by NestedGrid Method xiv
16 C.39. Comparison of Dimensionless Time for all Solution Algorithms D.40. ORF D.41. ORF D.4. ORF D.43. ORF D.44. ORF D.45. ORF D.46. ORF D.47 ORF D.48. ORF D.49. ORF D.50. ORF D.51. ORF D.5. ORF xv
17 NOMENCLATURE a c i,j,k n p q r x,y,z Proportionality constant Integration constant Grid point location in x,y,z respectively Number of grid refinements; number of wells Pressure Flux of fluid through porous media Distance to the wells Cartesian coordinates A, B, C, D Variables determined by regression Fx, Fy, Fz Fraction of x, y, and zdistances that the finegrid points are from point (1) of the coursegrid block K Permeability K Pseudopermeability N Parameter used to describe effectiveness of well, determined by regression P Pressure N ITER N FG N CG N LAPLACE N WEBER N CG` N FG` Q n r n t d t total t coarsegrid t nestedgrid Number of Iterations Number of finegrid points Number of coarsegrid points Parameter used to describe effectiveness of well for LaPlace SOR Parameter used to describe effectiveness of well for Weber SOR N CG N N FG N Volumetric injection rate of well n Distance to well n Dimensionless time Total dimensionless time Dimensionless time required to calculate coarsegrid solution Dimensionless time required to calculate a given nestedgrid solution λ Ratio of pseudopermeability to actual permeability µ Fluid viscosity ω Overrelaxation factor ω opt Optimal Overrelaxation factor Ω Solid angle Positive cell face  Negative cell face xvi
18 CHAPTER 1 INTRODUCTION This thesis proposes a new method of linear algebra that provides a rapid solution of very large systems of equations. This work was motivated by the need for such a technology in reservoir simulation. However, the method is likely to be valuable in other disciplines where large systems of linear equations are encountered, such as in computational fluid mechanics. Oil is the lifeblood of America s economy. It presently supplies more than 40% of the nation s total energy demands. 1 Recently the Department of Energy (DOE) has expressed two key concerns over oil in America: (1) maintaining an immediate readiness to respond to oil supply disruptions and () keeping America s oil fields producing in the future. The DOE has determined that one way to prevent an oil supply disruption is to make certain that domestic production of oil is maintained. Remaining U.S. oil fields are becoming progressively more costly to produce because much of the easily produced oil has already been recovered. Better technology is needed to locate and produce the residual oil. 1 Many of the emerging technologies that will keep U.S. oil fields producing long into the future do and will employ reservoir simulators. 1
19 1.1 Technologies That Depend on Reservoir Simulation Reservoir simulation became feasible some thirty years ago with the dawn of the computer age. Since that time, computer technology has increased greatly. Computer hardware and software have become continuously more powerful at an astonishing rate. However, throughout the history of computers reservoir simulators have always taxed the very fastest machines, and despite these enormous advances in computer technology, reservoir simulators continue to strain the largest and fastest computer systems. The need for faster reservoir simulation remains as critical today as it has ever been. Emerging technologies in the oil industry that depend on reservoir simulators would be greatly enhanced by more accurate and faster reservoir simulations. Brief descriptions of some of the emerging technologies key to optimal oil recovery are described as follows. Geostatistics: Geostatistics involves gathering large quantities of data from exposed rock outcrops, where measurements of physical properties can be made with relative ease. The statistical variations in physical properties observed in the outcrops are applied to data obtained from well cores, logs, and from surface seismic data for subterranean reservoirs. Many possible subsurface models of the same field, each with some probability of being correct, can then be generated. Simulation of all the geostatistical reservoir models is practical only when simulations can be made rapidly. Results of these reservoir simulations are valuable as they can provide a measure of a field s potential profitability as well as the associated risks. Automated History Matching: History matching plays a critical role in monitoring displacement processes, constructing good reservoir models, and predicting future reservoir performance. Production data are the most common type of reservoir data. Matching these data allows reservoir engineers to better characterize reservoir properties such as permeability and porosity. This process has been automated, and is relatively simple when the number of data values to be adjusted is small and when simulations can be accomplished rapidly. For more extensive applications, history matching remains a difficult and timeconsuming task, as many simulations of the same field must be made to determine a data set that matches the production history of the field. Optimization: Optimization of reservoir production involves repeated simulations of a particular field to determine optimal reservoir design variables
20 and design functions such as well location, geometry, completion intervals, well rates, well remedial treatments, etc. Optimization software is available, yet fast, accurate and robust reservoir models are essential to enhance the optimization process. Smart Wells: Smart wells are equipped with downhole measurement equipment, packers, and control valves. They use realtime simulations to control the production rate from different well segments through the use of packers, which isolate the various production intervals in a well, and valves, that control the amount of flow from each interval. Smart wells have the potential to significantly increase production (up to 65%). 3 Optimal realtime control theory, used to determine proper packer and valve settings, requires rapid reservoir simulation. 1. Reservoir Descriptions Modern reservoir imaging techniques and advances in geological modeling are allowing very detailed reservoir descriptions. Often ten million cells or more may be used to describe reservoir rock properties. With current computers, most oil companies cannot afford to run routine fluidflow simulations with more than about 100,000 grid blocks. 4 Typical reservoir models generally contain 10, ,000 cells. 5 The alternative to running multimillion cell simulation models that incorporate the geologic models, is Upscaling. Upscaling is the practice by which a fine geologic model containing a detailed description of reservoir rock properties is replaced by a coarser scale description of equivalent reservoir rock properties which is more suitable for reservoir simulation. The coarsening of the geologic model can lead to reservoir simulation runs that can be completed in hours, as opposed to days. The challenge in applying this process is to retain an accurate representation of the physical characteristics of the geologic model critical to fluid flow. 6 A variety of different methods has been proposed to upscale single and multiphase flow properties. Many studies 7,8,9,10,11,1 and reviews 4,5,13,14,15,16 have been conducted, yet all upscaling methods 3
21 suffer from the problem that either, they make assumptions about the largescale boundary conditions, which may significantly affect the results, or they require a finegrid solution to derive coarse grid properties. 17 Other unsettled issues include grouping of upscaled relative permeabilities, robustness and process independence. There are still unresolved issues dealing with extending multiphase scales up to threephase flow, compositional flow, and flow in naturally occurring systems. 5 Consequently, despite a huge literature on multiphase upscaling, the best approach is still very much an open issue. In fact, the current industry practice is to limit upscaling to singlephase properties only. 17 In a recent review, M. A. Christie stated that, The most promising methods of the last few years may be those that regard upscaling as an integral part of the solution of the flow equations, rather than as an external process which have the correct boundary conditions to provide the correct answer Reservoir Simulation Approaches In the May 17 th, 004, Oil & Gas Journal, 6 Scott Evans summarized four basic approaches that can be used for reservoir simulation in today s high performance computing environments. Four basic approaches that can be successfully used in reservoir simulation are available for subsurface modeling: 1. Traditional. A geologic model upscaled to a second model and used for reservoir simulation. The result is two models, only one of which is used for simulation.. Geologic. A geologic model run without coarsening in the reservoir simulator. The result is one model but with potentially very slow simulation runs 4
22 3. Hybrid. One model generated, but with varying scale, in which the model has more detail where needed and less where it is not. The result is one model with potentially more acceptable simulation runs. 4. Multiscale. Two or more models, one fine and one coarse, linked and used simultaneously in the reservoir simulator. This is an area of industry research and would have each of the models used in the simulation as appropriate. The multiscale approach is a current area of research and development. This methodology will hopefully provide a way to more accurately represent the static and dynamic properties of a reservoir with minimal computational power. Recent studies have shown how to use both coarse and fine grid information during reservoir simulations. 1.4 Review of Multiscale Methods In 1991, Ramé and Killough 18 presented the first implementation of a multiscale simulation technique. The method used the implicitpressure, explicit saturation (IMPES) procedure to decouple the pressure equation from the conservation equations numerically. A fourthorder finite element method was used to solve the pressure equation on each coarse grid. Finescale information was interpolated from the coarse grid using a splinesundertension technique, and the conservation equations for fluid transport were solved on the fine grid. Time stepping was performed on the fine grid and after several timesteps the current mobilities on the fine grid were passed to the coarse grid to update the pressure field. D examples for miscible flow were presented. In 1995 Guérillot and Verdière 19 proposed a dual mesh method where the pressure field was first computed on a coarse grid, but where the saturation was moved on the fine grid. Using approximate boundary conditions, the velocity field was estimated within 5
23 each coarse block by solving for the pressure. This technique was applied to a D singlephase model and in 1996 they extended their work to multiphase flow. 0 They showed the results in D for twophase flow models with simplified injectionproduction boundary conditions. Comparison of the time of calculation spent for the full finegrid calculation and the dual mesh method gave a speedup factor from 5 to 7. In 1996 Hou and Wu 1 presented the derivation of a mathematically rigorous multiscale finiteelement method for solving the class of elliptical problems that arise from composite material (steadyheat conduction through a composite material with tubular fiber reinforcement in a matrix) and flows in porous media. By constructing multiscale finiteelement base functions that were adaptive to the local property of the differential operator, this method was able to capture efficiently the largescale behavior of the solution without resolving the smallscale features. Results for flow in porous media were provided in D without gravity and capillary effects. In 1999 Guedes and Schoiozer implemented the same methodology as Guérillot and Verdière, using an upscaling method developed by Hermitte and Guerillot. 3 They provided results in D and included gravity effects. Well boundary conditions were considered as sources or sinks applied in one grid block. Also in 1999, Gautier et al. 4 presented a similar approach using streamlinebased simulation (an IMPES method). The pressure solve method (psm) was used to upscale the transmissivities for each coarsegrid block from petrophysical properties defined on a fine grid. Gravity effects and wells where included. The well pressures were determined using Peaceman s well model, and special attention was given to keep equivalent fluxes on both coarse and fine scales. The method was tested on a series of waterflood problems 6
24 and it was demonstrated that the method could give accurate estimates of oil production for large 3D models up to 8.5 times faster than direct simulation using streamlines on the fine grid. The results were very efficient in terms of CPU time and memory management. Arbogast and Bryant 5 introduced a slightly different dual grid approach in 001 by using Green function methods to upscale transmissivities and a mixed finiteelement method to solve the pressure field. Gravity and capillary effects were considered in their methodology. Similar to Guatier et al. 4, they observed a reduction ratio for the time of calculation of about to 10 compared to finegrid simulation. Audigane and Blunt (004) 17 present an extension of the dualmesh method of Guérillot and Verdière to 3D cases and included gravity and wells. Using an IMPES method, the pressure field was solved on the coarse mesh with a conventional finitedifference scheme. Transmissivities were upscaled either with the psm method or with a simple geometric average (ga). The pressure field was reconstructed on the fine mesh using flux boundary conditions from the coarsegrid simulation. Multiscale methods continue to develop and make advances in reducing the cpu time of reservoir simulations. The solution of the pressure equation is the most timeconsuming step in any reservoir simulation 5, and it has become more evident that improved mathematics, which will allow faster and more accurate simulations, is fundamental to improved reservoir simulation capabilities. In reservoir simulation, the primary concern is movement of gas, oil, and water in the reservoir. 6 These fluids flow as a result of pressure variations in the reservoir. Hence, the accurate prediction of reservoir pressures is essential to a good reservoir simulator. This work proposes a new linear algebra technique for the solving of finelygridded 7
25 reservoir pressures. The new method is multiscale, in that it involves the calculation of the reservoir pressures on a coarse grid and then uses the coarsegrid solution in a nested grid to calculate finegrid pressures. Improved mathematics are key to the method and permit faster and more accurate solutions of the pressure equation. 1.5 Summary Better technology is needed to produce oil and gas reserves in a more effective manner. Many developing technologies that improve oil and gas production would be greatly enhanced by faster and more accurate reservoir simulators. In approaching reservoir simulation, the multiscale method is an area of industry research which has been shown by various researchers to reduce the computational time required to complete reservoir simulations. Calculation of reservoir pressures is the most time consuming step in any reservoir simulator; this thesis proposes a new linear algebraic method that incorporates the multiscale approach to calculate reservoir simulation pressures in an accurate and fast manner. 8
26 CHAPTER BACKGROUND.1 Weber s Equations and NestedGrid Description The new pressuresolution method developed in this thesis is based on the work of Weber et al. 7 They proposed that finitedifference equations, used to represent the pressure equation, be based on mathematical expressions that incorporate the physics of the process instead of on traditional polynomial expressions. In modeling reservoir pressures, equations incorporating the physically realistic ln(r) dependence on pressure for reservoirs with straight line wells, and a 1/r dependence for reservoirs with more complex well geometries were used (r is the distance to the wells). Weber investigated formulations in which ln(r) s and 1/r s were summed over all the wells in the reservoir, and in which only the single, closest well value was used. The results of Weber s study that incorporated a 1/r dependence into the finitedifference equations are shown in Figure 1. The figure compares the accuracy of the pressures calculated by various methods for an 11x11x grid of a rectangular reservoir of similar geometry to that used in this study. The different methods were compared with an analytical solution generated by Weber. The new finitedifference equations showed a fourorderofmagnitude improvement in accuracy compared with traditional polynomial based finitedifference equations and approximately threeordersofmagnitude improvement over Peaceman s 9
27 Correction. This dramatic improvement in accuracy was the catalyst for the development of a new method to calculate finelygridded pressures Figure 4: Reservoir Pressure Error Summary Error (psi) Average Maximum 0.01 Traditional Finite Difference Method Traditional Method w/ Peaceman Correction Inverser Finite Difference Method Inverser Finite Volume Method Single Well Method Figure 1. Weber et al. Results 7 The new method involves two steps: (1) The creation of a coursegrid solution using Weber s finitedifference equations that incorporate the physics of the flow to obtain an accurate pressure solution on a small, coarse grid, and () nesting the coarsegrid solutions into a desired fine grid and solving the system of equations to obtain detailed pressures that honor the nestedcoursegrid pressures. The improved mathematics of Weber et al. is vital to this method, as it permits the generation of accurate solutions on coarse grids. 10
28 . Comparison to Multigrid Method This method is not a multigrid method, yet it does utilize some of the basic ideas of the multigrid method, namely coarsegrid relaxation and nested iteration. Multigrid methods are built on the fact that many standard iterative methods possess a smoothing property. The smoothing property describes the fact that as iterative methods progress to convergence the reduction in error decreases and becomes smooth. Figure is taken from the book A Multigrid Tutorial by William L. Briggs 8 and shows this smoothing effect for the weighted Jacobi method in a plot of the absolute error versus iteration number. The error decreases quickly within the first five iterations and then decreases slowly. Absolute Error Iteration Number Figure. Depiction of Smoothing Property 8 The initial rapid decrease in error is associated with the quick elimination of highfrequency modes, and the slow decrease is due to the presence of lowfrequency modes. The modes are Fourier modes where a small wave number, k, is associated with long 11
29 smooth waves, and large values of k correspond to highly oscillatory waves. As stated earlier, many standard iterative methods possess this smoothing property which makes them very effective at eliminating highfrequency or oscillatory components of the error, while leaving the lowfrequency or smooth components relatively unchanged. Through the use of coarse grids, the multigrid method puts the smoothing property to good use as the smooth error is relatively more oscillatory on coarser grids. Hence relaxation becomes more effective on coarser grids. Coarse grids can be used to compute an improved initial guess for finegrid relaxation, and a reliable way to improve the relaxation scheme on the fine grid is to use a good initial guess. This wellknown technique of using a coarse grid to generate improved initial guesses on a fine grid is called nested iteration. In a nut shell, multigrid methods relax on a fine grid until the smooth error is reached and the high frequency oscillations have been eliminated. The grid is then restricted to a coarse grid where the error is relatively more oscillatory. The grid is again relaxed until smooth error is reached. The coarse grid points become a new and improved initial guess for the fine grid where the coarse grid points are mapped to the fine grid through interpolation. The fine grid is relaxed again and the process continued to convergence. 8 The research of this thesis investigates the potential value of implementing, in a nestedgrid/multiscale manner, the new finitedifference equations developed by Weber et al. However, unlike the multigrid method described previously, the new method can potentially be completed in only two steps, one using a course grid and a second using a fine grid. Only two grids are necessary because of the very high accuracy of the coarsegrid solution using Weber s solution. 1
30 This thesis describes development of this new method. The steps involved are outlined in Table I. Table I. General Objectives of Study Objectives of Study Test performance of various solvers as a function of grid size (Chapters 3,4) Analyze results to determine the best solver(s) for coarse and fine grids. Selected solver(s) will be used in nestedgrid solution method (Chapter 5) Implement best solver(s) in the nestedgrid solution method (Chapter 6) Consider potential value of applying interpolated values to initial solution guesses (Chapter 7) Apply Weber s coefficients in nestedgrid solution method (Chapters 8,9) Regress all results to determine potential correlations that fit data (Chapter 10) Conduct a dimensionless time analysis using correlations determined from regressions and optimize the nestedgrid configuration (Chapter 11) Analyze the error of the nestedgrid solution method (Chapter 1) Investigate the use of multiple nestedgrids to improve method further (Chapter 13).3 Reservoir Description In this work, the reservoir geometry considered is shown in Figure 3. Injection at 1,500 psi occurs in one well; production at 1,500 psi occurs in the other well. The two wells are centered, one in each of the two cubic elements comprising the threedimensional rectangular reservoir. The boundary conditions of the reservoir are no flow, i.e. the pressure gradients in the direction normal to the boundaries are zero. 13
31 Injection Well Production Well Figure 3. Hypothetical Reservoir Being Simulated 7 The dimensions of the reservoir are in the following ratio: 1x1x. The actual reservoir dimensions were factored in by scaling the well radius with the size of the grid block. For grid blocks of 100 foot dimensions, the well radius of three inches becomes Although gravity effects are assumed negligible, the reservoir was considered to lie with its largest dimension in the horizontal plane..4 Solution of the Pressure Equation The pressure equation is written in terms of average pressure for the conservation of mass flowing through porous material. The incompressible, steadystate, threedimensional pressure in a reservoir for which the mobility is everywhere uniform, is given by the Laplace equation: P P P x y z = 0 (1) 14
32 15 Replacing each of the second derivatives by secondorder, centereddifference approximations at grid point (i,j,k) yields 0 1,,,, 1,, 1,,,, 1,,, 1,,,, 1, = z P P P y P P P x P P P k j i k j i k j i k j i k j i k j i k j i k j i k j i () In the special case where x = y = z the grid aspect ratio is unity and Equation () becomes 6 1,, 1,, 1,, 1,,, 1,, 1,,, = k j i k j i k j i k j i k j i k j i k j i P P P P P P P (3) This is the traditional, finitedifference formulation used to solve the pressure equation in three dimensions..5 Summary Weber et. al 7 developed finitedifference equations that incorporate physics of flow and allow for pressure solutions, fourordersofmagnitude more accurate, to be generated on coarse grids. The proposed new calculation method developed in this thesis takes advantage of Weber s accurate coarsegrid solutions in a nestedgrid calculation method to determine finelygridded reservoir simulation pressures. Although this method incorporates some of the basic ideas of multigrid methods, namely coarsegrid relaxation and nested iteration, it is not a multigrid method as the coarsegrid pressure solutions are nested and fixed throughout the entire relaxation process of the fine grid. The reservoir
33 being simulated is of an idealized nature. The simplify assumptions include: (1) homogeneous permeability, () neglected gravity effects, (3) incompressibility (4) steadystate, and (5) dimensions of reservoir and placement of wells generate a symmetric pressure solution. 16
34 CHAPTER 3 TESTING THE PERFORMANCE OF VARIOUS SOLVERS AS A FUNCTION OF GRID SIZE Reservoir simulations can be made at varying degrees of grid refinement ranging, as mentioned previously, from hundreds to millions of grid blocks. For this study, it was important to know how various solvers performed as a function of grid size so that the best solver(s) could be used for all grid sizes in the nestedgrid method. The study was initialized by considering the performance of various numerical methods for the solution of systems of linear algebraic equations as a function of grid size on a standard desktop computer. The computer used four Intel (R) Pentium (R) processors running at 1.80GHz, and 655 MB of RAM. In the entire study, swapping RAM data to the hard drive paging was not apparent. Hence the same performance increase would be expected on any computer (workstation, supercomputer) with sufficient memory to avoid paging. Both direct and iterative methods were considered and compared. The performance metrics included convergence time, iterations required to converge, and runtime memory requirements. To study the performance of the various linear algebraic solvers as a function of grid size, a range of test grid sizes was selected. The grids were constructed so that the wells were always in the center of their respective cells. Table II summarizes the various grid sizes used. 17
35 Table II. Grid Sizes and Dimensions Grid Size Grid Dimensions 50 5X5X X7X X9X X11X X17X X1X X33X X37X X51X X65X Direct Methods Direct solution methods perform very well for small grids, but can require excessive computational effort and computer memory as the number of grid points increases. 9 Direct methods might be preferable for the coursegrid solution, while iterative methods might be required for the fine grid. The direct elimination methods analyzed were Gauss Elimination 9, the Doolittle LU factorization method 9, and a band solver, DGBSV, from the LAPACK library. 30 The programs were developed using Compaq Visual Fortran 6.5 (Fortran 90). Default compiler options were used throughout so that others could duplicate results. 3. Iterative Methods Iterative methods can be divided into two general categories, stationary and nonstationary. 31 Three standard stationary iterative methods were considered, namely Jacobi, GaussSeidel, and SuccessiveOverRelaxation (SOR). Five advanced nonstationary iterative methods from MATLAB and a hybrid of direct and iterative 18
36 methods, Line SuccessiveOverRelaxation (LSOR), were also considered. Iterative methods should be better suited for the large systems of equations required in this study. The computer programs for these solvers, other than the five found in MATLAB, were developed inhouse with the incorporation of the Thomas algorithm (DGTSV) from the LAPACK library 30 for LSOR. The inhouse programs were developed in Compaq Visual Fortran 6.5 (Fortran 90). Some iterative methods require diagonal dominance to guarantee convergence and in general are less robust than direct solvers. The system of equations arising from the sevenpoint, second order approximation of the Laplace equation used in the simulations of this study is always diagonally dominant. Hence, such iterative solvers work well. For any iterative method, an initial approximation must be made for the solution to start the process. Several choices are available: (1) Simply let the solution (in this case the value of the pressure P i,j,k at the various grid points) equal zero at all nonspecified points; () Approximate P i,j,k by some average of the well pressures and or boundary conditions; or (3) Construct a solution on a course grid, and map the coursegrid values onto the fine grid through interpolation. 9 For the determination of the best solver to be used in the nestedgrid method, the initial P i,j,k solution vector was set to 0.0 everywhere except at the wells, which was set to the average of the well pressures, 1500 and However, later in the study (See Chapters 6 and 9), coarsegrid points would be nested into the fine grid, and threedimensional linear interpolation would also be considered to establish good starting values for iterative methods on the fine grid. 19
37 Iterative methods only generate an approximate solution after a finite number of iterative steps; the iterative process terminates when it meets a specified convergence criterion. In general, the number of iterations required to satisfy the convergence criterion is influenced by diagonal dominance, method of iteration, initial solution vector, and the convergence criterion itself. 9 The convergence criterion used by the inhouse iterative methods in this study is described by the following equation. P 1,1,1 P Imax,Jmax,Kmax 106 (31) P 1,1,1 and P Imax,Jmax,Kmax are the values of the pressures at opposite corner points of the grid furthest from each other in three dimensions. The symmetry of the problem indicates that P 1,1,1 equals P Imax,Jmax,Kmax in a properly converged solution. P 1,1,1 is the first to be calculated and hence is the least converged. P Imax,Jma,Kmax is the last to be calculated and would be expected to be the most converged. Since the pressures are initially at zero and relax to their solution values asymptotically, with points near the wells changing most rapidly, this convergence criteria should represent the maximum error in the solution after many iterations. For the iterative method of SOR and the hybrid method of LSOR, another key factor in the determination of the number of iterations required for convergence was the value of the overrelaxation factor, ω. When ω equals one, SOR yields the GaussSeidel method. When ω is greater than one, but less than two, the system is overrelaxed; when the ω factor is equal two or greater than two, the system becomes unstable. Figure 4 shows a plot of the iterations required for convergence as a function of the over 0
38 relaxation factor for a 17x17x34 grid solved by SOR. In this case it is apparent that by using the optimal overrelaxation factor one reduces the number of iterations required for convergence by approximately two orders of magnitude in comparison with the Gauss Seidel iteration method. Optimal OverRelaxation Factor: 17x17x34 1.E05 1.E04 Iterations 1.E03 1.E OverRelaxation Factor Figure 4. Determination of the Optimal OverRelaxation Factor The relaxation factor does not change the final solution since it multiplies the residual, which is zero when the final solution is reached. The major difficulty with the overrelaxation method is the determination of the best value for ω. In general, the optimal value of the overrelaxation factor, ω opt, depends on the size of the system of equations and the nature of the equations. As a general rule, larger values of ω opt are associated with larger systems of equations. 9 The optimum value of ω was determined by 1
39 experimentation for the various grid sizes considered in this study. The process of finding ω opt was straight forward but often time consuming, especially for large grids. 3.3 MATLAB 7.0 Iterative Methods MATLAB is a highperformance language for technical computing; the name stands for matrix laboratory. MATLAB incorporates LAPACK and BLAS libraries in its software for matrix computation. Nine functions are available in MATLAB that implement advanced iterative methods for sparse systems of simultaneous linear systems. Of these nine, five where considered: Biconjugate Gradient (BICG), Biconjugate Gradient stabilized (BICGSTAB), LSQR implementation of Conjugate Gradients on the Normal Equations (LSQR), Generalized Minimum Residual (GMRES), and Quasiminimal Residual (QMR). GMRES is a Krylove Subspace Method and was recommended for use in this study by simulation developers from ConocoPhillips. All of the MATAB algorithms were implemented without preconditioners, and the magnitude of the convergence tolerance was Summary A standard desktop computer was used for the study of the performance of various solvers as a function of gird size. Direct solution methods considered were Gauss Elimination 9, the Doolittle LU factorization method 9, and a band solver, DGBSV, from the LAPACK library. 30 Stationary iterative methods considered for the study were Jacobi, GaussSeidel, and SuccessiveOverRelaxation (SOR). Five nonstationary iterative methods from MATLAB 7.0: Biconjugate Gradient (BICG), Biconjugate Gradient
40 stabilized (BICGSTAB), LSQR implementation of Conjugate Gradients on the Normal Equations (LSQR), Generalized Minimum Residual (GMRES), and Quasiminimal Residual (QMR) were considered. A hybrid of direct and iterative methods, Line SuccessiveOverRelaxation (LSOR), was also considered. SOR and LSOR require the determination of an optimal overrelaxation factor. 3
41 4
42 CHAPTER 4 PERFORMANCE OF VARIOUS SOLVERS 4.1 Direct Methods: Results Figure 5 shows a plot of convergence time as a function of grid size for the direct methods of Gauss Elimination (GE), Doolittle LU factorization (LU) and the band solver, DGBSV, from the LAPACK library. Due to the computational limits of the computer, the solvers performance was only considered on smaller grid sizes. Direct Methods: Time vs Grid Size 1.E04 1.E03 1.E0 y = 8E11x R = CPU Time (s) 1.E01 1.E00 1.E01 y = 8E09x.4374 R = GE LU DGBSV 1.E0 1.E03 1.E0 1.E03 1.E04 1.E05 Grid Size Figure 5. Direct Methods: Time Required for Convergence as a Function of Grid Size 5
43 A power law fit of the relationship between time and grid size is included for the DGBSV solver. GE and LU data points are nearly coincident and the same power law fit is used to describe both. Indeed, these direct methods proved to work reasonably well on small grids, yet bigger grid sizes required large amounts of memory and numerous calculation steps. The direct methods eventually became impractical for the larger grids. For example, an 11x11x grid results in =,6 equations in,6 unknowns and a full coefficient matrix with (,6) = 7,086,44 array elements. For the Gauss Elimination and Doolittle LU factorization programs, the next largest grid size considered, 17x17x34, has an input array of 96,550,76 elements and would have taken an estimated four and a half days to compute using 378,544 K of RAM. The banded solver from the LAPACK library, DGBSV, showed some improvement in both time and memory performance but still struggled on larger grids. The memory requirements for the direct methods are shown in Figure 6 with power law fits of the data for the DGBSV and LU/GE solver. These general trends were expected, yet the study was conducted for comparative purposes and to aid in understanding the solution process. Direct solutions could be preferable for obtaining the coursegrid solutions for the new method. Again, since GE and LU memory requirements are so similar, the plotted points are essentially coincident and one trend line describes both. The leftmost points are influenced by the finite amount of RAM that would be required even for a zero grid size, hence these points were excluded in the regression. 6
44 Direct Methods: RAM Requirements vs Grid Size 1.E06 1.E05 y = x R = RAM(K) 1.E04 y = x R = GE LU DGBSV 1.E03 1.E0 1.E0 1.E03 1.E04 1.E05 Grid Size Figure 6. Direct Methods: Memory (RAM) Requirements as a Function of Grid Size 4. Stationary and Nonstationary Iterative Methods: Results The iterative methods performance was tested at various grid sizes. Of all the iterative methods described in the previous chapter, LSOR was found to have the best convergencetime performance with SOR following closely. Of the five nonstationary MATLAB iterative methods, GMRES and LSQR were shown to have the best convergencetime performance. Figure 7 shows the convergence time performance of the various solvers as a function of grid size. Once again a power law fit is included for the best performer, LSOR. 7
45 Itertative Methods: Time vs Grid Size 1.E05 CPU Time (s) 1.E04 1.E03 1.E0 1.E01 1.E00 1.E01 1.E0 y = 1E06x R = LSOR SOR GAUSS SEIDEL JACOBI LSQR GMRES BICG BICGSTAB QMR 1.E03 1.E0 1.E03 1.E04 1.E05 1.E06 Grid Size Figure 7. Iterative Methods: Time Required for Convergence as a Function of Grid Size Extrapolation of the GMRES data from this plot suggests that GMRES could eventually perform better than any of the iterative methods at larger grid sizes. This can be seen by using the four data points for GMRES, which give a slope that indicates better performance for GMRES at larger grids; however GMRES memory requirements prohibited actual determination of results at larger grids. The potential of GMRES performing better than the other iterative methods at larger grids is somewhat diminished if the slope from the two largest grid sizes is used. Given the trends of the other iterative methods, decisions for GMRES were based on the data for the two largest grid sizes. QMR and BICG were stable for only the smallest grid size and had comparable convergence times to the other MATLAB iterative methods at the respective gird size. The use of a preconditioner at larger grid sizes could possibly help QMR and BICG to 8
46 stabilize and generate reasonable answers, but this was not done as this study was conducted without preconditioners. BICGSTAB was shown to be the slowest of the five MATLAB iterative methods. As expected, Jacobi and Gauss Seidel iterative methods performed poorly with respect to the other methods when comparing convergence time. SOR and LSOR performed better than all other iterative methods; LSOR had slightly better convergence times than SOR, but demanded more RAM than the other inhouse iterative methods for all grid sizes. It was difficult to determine how much memory was used for small grid sizes in MATLAB while the routines were in progress, yet for grid sizes larger than 17x17x34 the desktop computer did not have enough memory to complete the solution for any of the MATLAB methods. The results of the runtime memory performance of the various iterative methods are summarized in Figure 8. The values shown for SOR and LSOR are at the optimum overrelaxation factor, ω opt. Runtime memory requirements for MATLAB iterative methods at a grid size of 17x17x34 were determined for the three methods that worked at this grid size. These three points, which show similar memory requirements for MATLAB methods, are shown in Figure 8 and indicate memory requirement two orders of magnitude larger than the stationary iterative methods. This completes the first objective of this thesis, which was to test the performance of various solvers as a function of grid size. From these results, the best solver to be used on coarse and fine grids can be determined. 9