Developments in Petroleum Science, 6 FUNDAMENTALS OF NUMERICAL RESERVOIR SIMULATION
FURTHER TITLESI N THISSERIES
1 A...
540 downloads
2454 Views
7MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Developments in Petroleum Science, 6 FUNDAMENTALS OF NUMERICAL RESERVOIR SIMULATION
FURTHER TITLESI N THISSERIES
1 A.GENE COLLINS GEOCHEMISTRY OF OILFIELD WATERS 2 W.H. FERTL ABNORMAL FORMATION PRESSURES 3 A.P. SZILAS PRODUCTION AND TRANSPORT OF OIL AND GAS
4 C.E.B. CONYBEARE GEOMORPHOLOGY OF OIL AND GAS FIELDS IN SANDSTONE BODIES 5 T.F. YEN and G.V. CHILINGARIAN (Editors) OIL SHALE
Developments in Petroleum Science, 6
FUNDAMENTALS OF NUMERICAL RESERVOIR SIMULATION
DONALD W. PEACEMAN Senior Research Advisor, Exxon Production Research Company, Houston, Texas, U.S.A.
ELSEVIER SCIENTIFIC PUBLISHING COMPANY Amsterdam - Oxford- New York 1977
ELSEVIER SCIENTIFIC PUBLISHING COMPANY 335 Jan van Galenstraat P.O. Box 211, Amsterdam, The Netherlands Uisfributors forthe IJnited States and Canada.
ELSEVIER NORTH-HOLLAND INC. 52, Vanderbilt Avenue New York,N.Y. 1 0 0 1 7
Libraryof CongressCataloging in Publication Data
Peaceman, Donald W Fundamentals of numerical reservoir simulation. (develrpents in petroleum science ; 6) Bibliography: p. Incluaes index. 1. Lil reservoir engineering--Mathematicalmdels. 2. Oil reservsir engineering--Data processing. I. Title. I;. Series. m871.47 ~2 7.18 282 77-4771 ISYN 2-444-41578-5
ISBN: 0-444-41578-5 (~01.6) ISBN : 0 - 4 4 4 - 4 1625-0 (series) d Elsevier Scientific Publishing Company, 1 9 7 7 .
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmit,ted in any form o r by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the publisher, Elsevier Scientific Publishing Company, P.O. Box 330, Amsterdam, The Netherlands Printed in The Netherlands
PREFACE
Over the past decade, the use of numerical reservoir simulation with highspeed electronic computers has gained wide acceptance throughout the petroleum industry for making engineering studies of a wide variety of oil and gas reservoirs throughout the world. These reservoir simulators have been designed for use by reservoir engineers who may possess little or no background in the numerical mathematics upon which they are based. Yet in spite of our best efforts t o improve numerical methods so as t o make reservoir simulators as reliable, efficient, and automatic as possible, the user of a simulator is constantly faced with a myriad of decisions that have nothing t o do with the problem he really wants t o solve. He must decide on various numerical questions not directly germane t o the problem at hand. For example, he may have a choice among several simulators that use different numerical methods. He may have t o pick an iteration method. He definitely will have to choose the grid spacing as part of the reservoir description, and probably will also have t o select the time step size. And perhaps the biggest bugaboo of all is the choice of iteration parameters. It is this engineer-user that I have had in mind while writing this book, one who wants t o learn how t o deal more effectively with the numerical decisions mentioned above. I hope he also has some curiosity about the inner workings of the “black box” that is a reservoir simulator, and I have tried to satisfy that curiosity, as well as t o prepare him t o read the literature, should he wish t o study recent developments and future research in greater depth than I have been able t o provide here. The first chapter combines a review of some basic reservoir mechanics with the derivation of the differential equations that reservoir simulators are designed to solve. The next four chapters provide basic theory on the numerical solution of simple partial differential equations. The final chapter brings together this basic theory as it applies t o the numerical solution of multidimensional, multiphase flow problems. I have attempted t o make this book as self-contained as possible. The reader is assumed to have some knowledge of partial differential equations and simple matrix algebra; additional mathematical tools are provided where needed. In developing the numerical theory, I have tried t o serve the engineer’s needs better than d o the standard textbooks on numerical analysis, which tend t o be either too rigorous or too general. I have not attempted to be completely rigorous in the mathematical proofs, but I have included
VI
sufficient derivations so as t o make the various mathematical arguments as plausible as possible. But the engineer-user is not the only reader I had in mind in writing this book. The mathematician skilled in numerical analysis will, of course, find much material already familiar to him. However, the first chapter will introduce him to the basic principles of reservoir mechanics, and the remainder of the book will indicate t o him those topics in numerical analysis that I consider significant in the numerical solution of reservoir flow problems. Furthermore, I have included some material which appears not to be well known. For example, the section on successive overrelaxation methods discusses the effect of Neumann boundary conditions and the effect of anisotropy. whereas standard textbooks confine themselves t o Dirichlet boundary conditions and isotropic problems. Finally, the material in the last chapter should be new t o most numerical analysts, as it is quite special t o the area of multiphase reservoir flow. It is my hope this book will provide food for thought leading t o further progress in numerical reservoir simulation. While much work is now being done on the application of variational methods t o the solution of partial differential equations, little of this has reached the stage of practical application in reservoir simulation. Most practical reservoir simulators now in use are based on finite-difference methods. For this reason, only finitedifference methods are covered in this book. The reader familiar with reservoir engineering will note a departure from a practice I feel is all too common in the field, namely, the inclusion of numerical constants in equations involving flow. All the equations in this book are free from numerical constants (which are dependent on the units being used) and are valid for any consistent set of units. The use of dimension-free equations should become more common as the industry moves t o the adoption of the SI (Systeme International) standard of units, as is now being proposed. Accordingly, in the nomenclature following each chapter, I have specified the units of various quantities in the basic SI units of kilograms, meters, and seconds, together with the derived units of the newton for force (which equals kg * m/s2) and the pascal for pressure (which equals N/mZ).These form a consistent set of units. If the reader prefers, any other consistent set of units can be used, and the equations will still be correct. The material in this book is based primarily on notes prepared for a series of lectures I was privileged t o give a t a NATO-sponsored Summer School on “Hydrocarbon Reservoir Simulation by Computer”, held in Milan, Italy, in May, 1969. I have given the same lectures within Exxon Production Research Company and for a Continuing Education Group of the Los Angeles Basin SPE Section in January, 1974. Many who have seen these lecture notes have urged me t o enlarge and publish them. I felt that the original notes were somewhat incomplete and so added several sections. The most significant additions were the section (in Chapter 1)on alternative differential equations
v I1 for two-phase flow, all of Chapter 4 on solution of hyperbolic problems, the section (in Chapter 5 ) on relaxation methods, and the sections (in Chapter 6) on sequential solution methods, semi-implicit mobility, and well rates. I am indebted t o the management of Exxon Production Research Company for permission t o publish this book and for the encouragement they gave. In particular, I want t o thank C.C. Mattax, Manager of the Reservoir Divison, for his encouragement and many helpful suggestions about the revision of the original lecture notes. Thanks are due, also, t o J.W. Watts and R.P. Kendall, of EPR, for the helpful discussions I had with them while writing the section on relaxation methods. Discussions with J.G. Hillestad and H.L.Stone, of EPR, also were of great help. I owe much to the skill of Dodi Fenner for the preparation of the figures, to Winn Alms for typing the original lecture notes and part of the book manuscript, and t o Altha Frazier and the Word Processing Group of EPR for typing the major portion of the manuscript for the book. I owe a large debt of gratitude to John Colby, Supervising Editor at EPR, for carefully editing the first draft of the book and checking the printer’s proofs. Finally, I would like to dedicate this book t o the three women in my life, who have provided inspiration t o me and many others around them: to my mother, Ida, of blessed memory; t o my wife, Ruth; and t o my daughter, Caren. DONALD W. PEACEMAN Exxon Production ResearchCompany, Houston, Texas, 1977 January,
This Page Intentionally Left Blank
CONTENTS
PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
V
Chapter 1. DIFFERENTIAL EQUATIONS F O R FLOW IN RESERVOIRS . . . . . .
1
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Single-phase flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Darcy’slaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . One-dimensional, single-phase, compressible flow . . . . . . . . . . . . . . . . . . . . . Two-dimensional, single-phase, compressible flow . . . . . . . . . . . . . . . . . . . . . Three-dimensional, single-phase, compressible flow . . . . . . . . . . . . . . . . . . . . Differential operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General equation for single-phase flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specie1 cases of single-phase flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ideal liquid of constant compressibility . . . . . . . . . . . . . . . . . . . . . . . . . . Liquids of slight compressibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Idealgas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Incompressible flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Types of second-order differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . Parabolic equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elliptic equations . . . . . . . . . . . . ._ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hyperbolic equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Classification of equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . First-order hyperbolic equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Two-phase flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Darcy’slaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conservation of each p h a s e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The differential equations for two-phase flow . . . . . . . . . . . . . . . . . . . . . . . . Alternative differential equations for two-phase flow . . . . . . . . . . . . . . . . . . . Pressure differential equation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Characterization of pressure differential equation . . . . . . . . . . . . . . . . . Total velocity for incompressible case . . . . . . . . . . . . . . . . . . . . . . . . . Saturation differential equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Characterization of saturation equation . . . . . . . . . . . . . . . . . . . . . . . . Diffusion-convection equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nature of saturation equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . One-dimensional case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Three-phaseflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Darcy’slaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conservation of each phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alternative f o r m of differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . Flow with change of phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The general compositional model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Component balances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 2 2 3 5 6 6 7 8 9 9 10 11 12 12 12 13 13 13 13 14 14 15 16 16 17 17
18 18 19 20 21 21 22 23 23 23 23 24 24 24 24 25
X Differential equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Auxiliary relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The black-oil model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simplified, two-component, hydrocarbon system . . . . . . . . . . . . . . . . . . . Differential equations for black-oil model . . . . . . . . . . . . . . . . . . . . . . . . Limited compositional model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Two-component hydrocarbon system with volatility . . . . . . . . . . . . . . . . . Differential equations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25 25 27 27 29 30 30 31 32 33
Chapter 2. ELEMENTARY FINITE DIFFERENCES . . . . . . . . . . . . . . . . . . . .
35
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . First-difference quotients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Second-difference quotients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gridsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Block-centered grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Point-centered grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparison of t h e t w o grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Truncation error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35 35 37 38 38 39 40 41 43
Chapter 3. NUMERICAL SOLUTION O F PARABOLIC PROBLEMS IN ONE ....... DEPENDENTVARIABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The forward-difference equation . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... Stability by harmonic analysis ( t h e von Neumann criterion) . . . . . . . . . . . . . . . . Implicit difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... The backward-difference equation . . . . . . . . . . . . . . . . . . . . . . . . ....... The tridiagonal algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... The Crank-Nicolson difference equation . . . . . . . . . . . . . . . . . . . . ....... Other explicit difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . ....... A time-centered explicit equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Dufort-Frankel approximation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multidimensional problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Forward-difference equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implicit difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alternating-direction methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Peaceman-Rachford method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Douglas-Rachford method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Brian and Douglas methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45 45 46 49 49 50 52 53 53 53 55 55 56 57 51 60 62 64
Chapter 4. NUMERICAL SOLUTION O F FIRST-ORDER PROBLEMS IN ONE DEPENDENT VARIABLE . . . . . . . . . . .
...........
65
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Distance.weighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Time-weighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General form of difference equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Linearization of difference equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65 65 65 66 66 68
HYPERBOLIC
XI Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stability of centered-in-distance equations . . . . . . . . . . . . . . . . . . . . . . . . . . Stability of backward-in-distance equations . . . . . . . . . . . . . . . . . . . . . . . . . Stability of forward-in-distance equations . . . . . . . . . . . . . . . . . . . . . . . . . . Truncation error analysis-numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . Local truncation error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Superposition of numerical and physical dispersion . . . . . . . . . . . . . . . . . . . . Example calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Purpose and details of calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Solutions showing numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . Solutions without numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unstable solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 5 . NUMERICAL SOLUTION OF ELLIPTIC PROBLEMS IN ONE DEPENDENTVARIABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elliptic difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Matrix notation; t h e structure of t h e coefficient matrix . . . . . . . . . . . . . . . . . Direct solution of band matrix equations by factorization . . . . . . . . . . . . . . . . . . Application of band algorithm t o two-dimensional problems . . . . . . . . . . . . . . . . Standard ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nonstandard orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Iterative methods for solving elliptic problems . . . . . . . . . . . . . . . . . . . . . . . . . Point relaxation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Southwell relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gauss-Seidel method ( met h o d of successive displacements) . . . . . . . . . . . . . . . Successive overrelaxation (SOR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Method of simultaneous displacements (Jacobi m e thod) . . . . . . . . . . . . . . . . . Matrix representation of point-iteration methods. . . . . . . . . . . . . . . . . . . . . . Jacobi method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Successive overrelaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convergence rate for Jacobi iteration b y harmonic analysis . . . . . . . . . . . . . . . Error expansion for Dirichlet boundary conditions, point-centered grid . . . . . Error expansion for Neumann boundary conditions. point-centered gird . . . . Error expansion for Neumann boundary conditions. block-centered grid . . . . Convergence analysis for Neumann boundary conditions. . . . . . . . . . . . . . . Effect of anisotropy o n convergence rate for Neumann boundary conditions . Convergence rate for Dirichlet boundary conditions . . . . . . . . . . . . . . . . . . Convergence rate for Jacobi iteration by eigenvalue analysis . . . . . . . . . . . . . . Definition of eigenvalues and eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . Relation between convergence and eigenvalues . . . . . . . . . . . . . . . . . . . . . Application t o Jacobi iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convergence rate for successive overrelaxation . . . . . . . . . . . . . . . . . . . . . . . PropertyA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Eigenvalues of SOR iteration matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . More o n eigenvalues of Jacobi iteration matrix . . . . . . . . . . . . . . . . . . . . . Relation between convergence of S OR and convergence of Jacobi method . . . Convergence rate of method of successive displacements . . . . . . . . . . . . . . . Optimum parameter for S OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
68 69 70 70 71 71 74 74 75 75 76 78 80 81 82 83 83 83 84 87 90 90 91 91 92 92 93 94 94 94 95 95 96 97 97 97 98 98 100 100 101 101 101 102 103 104 104 107 108 108 109
XI1 Comparison of convergence rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Effects of anisotropy and boundary conditions o n convergence rate of SOR . . Line relaxation methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Line' simultaneous displacements (line-Jacobi). . . . . . . . . . . . . . . . . . . . . . . . Line successive overrelaxation (LSOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convergence rate of line-Jacobi iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . With Neumann boundary condtions . . . . . . . . . . . . . . . . . . . . . . . . . . . . With Dirichlet boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . Acceleration of convergence with Neumann boundary conditions . . . . . . . . . . . 1 - D method of additive corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-Dmethod of additive corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convergence rates of LSOR and LSORC . . . . . . . . . . . . . . . . . . . . . . . . . . . With Neumann boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . With Dirichlet boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of convergence rates for point and line relaxation methods . . . . . . . . Alternating-direction iteration (A.D.I.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formulation of Peaceman-Rachford iteration procedure . . . . . . . . . . . . . . . . . Convergence analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Choice of parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optimal parameters and convergence rate for ideal case . . . . . . . . . . . . . . . Variable A X and A Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other alternating-direction iteration procedures . . . . . . . . . . . . . . . . . . . . . . Strongly implicit procedure (S.I.P.). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Approximate factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Choice of coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simple method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Method of Dupont, Kendall and Rachford . . . . . . . . . . . . . . . . . . . . . . . . Method of Stone (S.I.P.). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
110 112 112 112 112 113 113 113 115 115 115 118 118
119 119 119 120 120 121 121 124 126 127 128 128 131 131 132 132 134 135
Chapter 6 . NUMERICAL SOLUTION O F TWO-PHASE FLOW PROBLEMS . . . . . 139 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Differential equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic equations in terms of phase pressures . . . . . . . . . . . . . . . . . . . . . . . . . . Alternative equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Difference notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Difference operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Injection-production terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interval absolute permeabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mobility weighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some special combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simultaneous numerical solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Explicit difference equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alternating-direction implicit procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . Simultaneous implicit procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Solution by alternating-direction iteration . . . . . . . . . . . . . . . . . . . . . . . . Solution by strongly implicit procedure . . . . . . . . . . . . . . . . . . . . . . . . . . Direct solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculation of nonlinear coefficient, s’. . . . . . . . . . . . . . . . . . . . . . . . . .
139 139 139 140 141 141 142 143 143 143 144 144 144 146 147 148 150 151 151
XI11 Material balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sequential numerical solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Leapfrog method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Saturation creep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other sequential solution methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sequential solution method using total velocity . . . . . . . . . . . . . . . . . . . . . . . Implicit and semi-implicit mobilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Limitations resulting from use of explicit mobilities . . . . . . . . . . . . . . . . . . . . Implicit mobilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Semi-implicit mobilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Numerical dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wellrates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Injection wells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Production wells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Explicit production rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Semi-implicit production r a t e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Allocation of total injection o r production rates . . . . . . . . . . . . . . . . . . . . . . Special rate routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nomenclature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
152 153 153 153 154 154 155 156 157 160 160 161 162 164 164 164 164 165 165 165 166 166
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
169
............................................
173
SUBJECT INDEX
This Page Intentionally Left Blank
CHAPTER 1
DIFFERENTIAL EQUATIONS FOR FLOW IN RESERVOIRS
INTRODUCTION
By reservoir simulation, we mean the process of inferring the behavior of a real reservoir from the performance of a model of that reservoir. The model may be physical, such as a scaled laboratory model, or mathematical. For our purposes, a mathematical model of a physical system is a set of partial differential equations, together with an appropriate set of boundary conditions, which we believe adequately describes the significant physical processes taking place in that system. The processes occurring in petroleum reservoirs are basically fluid flow and mass transfer. Up to three immiscible phases (water, oil, and gas) flow simultaneously, while mass transfer may take place between the phases (chiefly between the gas and oil phases). Gravity, capillary, and viscous forces all play a role in the fluid flow process. The model equations must account for all these forces, and should also take into account an arbitrary reservoir description with respect t o heterogeneity and geometry. The differential equations are obtained by combining Darcy’s law for each phase with a simple differential material balance for each phase. In this first chapter, we shall first derive the simple differential equation that describes single-phase flow, and then proceed stepwise to derive the set of simultaneous differential equations that describes the most complicated case of multidimensional, multicomponent, three-phase flow. In the course of deriving these differential equations, we will be introducing many of the basic concepts of reservoir mechanics. For a fuller treatment of the subject of flow of fluids through porous media, the reader is referred to Collins (1961). To use differential equations for predicting the behavior of a reservoir, it is necessary to solve them subject to the appropriate boundary conditions. Only for the simplest cases involving homogeneous reservoirs and very regular boundaries (such as a circular boundary about a single well) can solutions be obtained by the classical methods of mathematical physics. Numerical methods carried out on high-speed computers, on the other hand, are extremely general in their applicability and have proved to be highly successful for obtaining solutions to very complex reservoir situations. A numerical model of a reservoir, then, is a computer program that uses numerical methods to obtain an approximate solution t o the mathematical model.
2
Over the past decade, numerical reservoir simulation has gained wide acceptance throughout the petroleum industry, a consequence of three major factors: a ) a tremendous increase in computing speed and capacity, resulting in lower unit computing cost; b ) improvements in the numerical algorithms for solving the partial differential equations; and, perhaps most important, c ) the generality built into reservoir simulators permitting them to model more realistically the wide variety of oil and gas reservoirs that exist throughout the world. The remaining chapters of this book will be devoted t o outlining some of the basic ideas involved in the numerical solution of partial differential equations by finite-difference methods, and t o showing their application t o the equations describing reservoir behavior. SINGLE-PHASE FLOW
Darcy’s law Darcy’s law for single-phase flow states that in a horizontal system the volumetric flow rate, Q, through a sample of porous material of length L and a cross-sectional area A , is given by : A
Q
KAAp
= --
I-(L where A p is the applied pressure drop across the sample, 1.1 is the viscosity of the fluid, and K is the absolute permeability of the medium. For flow in only one direction (say, parallel t o the x-axis), we can write Darcy’s law in the following differential form:
Q
K aP
u = - = ---
A I-( ax where u = Q J A is a superficial flow velocity, and aplaxis the pressure gradient in the x-direction. Note the negative sign in eq. (1-2), which indicates that the pressure declines in the direction of flow. The differential form of Darcy’s law may be generalized t o three dimensions as follows : (1-3a) (1-3b)
3
where u, , u s , and v, are the x - , y - , and z-components of a velocity vector, 3, oriented in some arbitrary direction in three-dimensional space. Equations (1-3) do not take gravity into account, however, and must be modified t o include gravity terms. For generality, we shall take the depth, D ,t o be an arbitrary function of the coordinates, ( x , y , z ) , rather than commit ourselves at the outset t o identifying any one of the coordinates (frequently z ) with the depth. Then the differential form of Darcy's law becomes: (1-4a) (1-4b) (1-4~) where p is the density of the fluid and g is the acceleration due t o gravity.
One-dimensional, single-phase, compressible flow In deriving a differential equation for flow in one dimension, we wish t o include the possibilities that the cross-sectional area for flow, A , as well as the depth, D ,are functions of the single space variable, x . We shall include a term for injection of fluid by using a variable, q , equal t o the mass rate of injection per unit volume of reservoir. (A negative q implies production.) Finally, we shall recognize that the density of the fluid will be changing with time. (Frequently, the porosity of the medium, $, can also change with time.) Consider a mass balance about the small box shown in Fig. 1A.The box has length A x ; the left face has area A ( x ) , the right face has area A ( x + A x ) . The rate at which fluid mass enters the box at the left face is given by: u,(x)
= (APu,), The rate at which fluid leaves at the right face is: P ( X + A X ) U,(X AX) A ( x + AX) = ( A p ~ , ) ~ + h P(X)
+
The volume of the box is K A x . Here indicates the average value of A between x and x A x . Then the rate at which fluid mass is injected into the box is:
+
qKAx The mass contained in the box is & p of mass in the box is:
A x . Then the rate of accumulation
4
Fig. 1. Differential elements of volume. A. F o r one-dimensional flow. B. For twodimensional flow. C. F o r three-dimensional flow.
Since mass must be conserved, we have: [rate in]
-
[rate out]
+ [rate injected]
Thus : (Apu,), - ( A p u x ) , + A x
+ qKAx
=
K
=
a m )Ax
-
at
Dividing by A x gives:
- (Apux)x Ax
- (APUx)x+Ax
+
= A-
[rate of accumulation]
a(?+) at
(1-5)
5
Taking the limit as A x
af
-(x) ax
=
+
0 (and noting that a derivative is defined by a limit):
f ( x + A x ) -f ( x ) Ax
lim Ax-0
and that A + A ( x ) , P
+p(x),
etc., we obtain:
Two-dimensional, single-phase, compressible f l o w In two-dimensional flow, we wish t o allow for the variation of the thickness of the reservoir, H = H ( x , y ) . Consider now a mass balance about the small box in Fig, 1B. The box has length A x and width A y . The center of the box is located a t x' = x 4 A x and y ' = y 4 A y . The left face has area H ( x , y ' ) A y . Hence the rate at which fluid mass enters the box at the left face is given by:
+
+
P(X,
Y')
VX(X,
Y ' ) . H ( x , Y ' ) AY = AY(HPVx)x,yf
Similarly, fluid mass leaves the box a t the right face a t the rate:
Ay(HPvx)x+Ax,y' Fluid enters the front face a t the rate: A X ( H P ~ , ) X y~ ,
and leaves the rear face a t the rate: AX(HPVy)x',y+Ay
As the volume of the box is injected into the box is:
R A x A y , the rate at which fluid mass is
QRAXAY and the rate of accumulation of mass in the box is:
+ [QRAxAy]
-a ( mAxA
= H-
at By rearranging, dividing by A x A y , and taking the limits as A x A y -+ 0, we obtain:
-+
0 and
6
Three-dimensional, single-phase, compressible flow Consider now a mass balance about the small box in Fig. lC,with length A x ,width A y ,and height A z .The center of the box is located at x’= x + l a x y,’= y $ A y ,and z' = z + 4Az.The area of the left face is A y A z ; hence the rate at which fluid mass enters the box at the left face is:
+
vx(x, Y’, 2') AYAZ = AYAZ(PUX)X,Y,,*, Fluid leaves the right face at the rate:
P ( X ,Y ’ , 2’)
AYAZ(PUx)x+Ax,y’,z’ Fluid enters the front face at the rate: AXAZ(PUY)X’,Y,Z’ and leaves the rear face a t the rate: A x A z ( P v y ) x ’y,+ A y , z ’
Fluid enters the bottom face a t the rate:
AXAY (Pvz),,, y ’ , z and leaves the top face a t the rate: A x A Y ( P u z ) x ’y,’ , z + A z
The volume of the box is A x A y * A z ;thus the rate of injection of mass into the box is:
qAxAyAz and the rate of accumulation of mass in the box is:
a(’p)A x A yA z
at By substituting these rates into eq. (1-5),dividing by A x A y A z ,and taking the limits as A x + 0, A y + 0 ,and A z + 0, we obtain:
Differential operators Let u x ,u y ,and u, be the x - ,y - ,and z-components of a vector 2. The divergence of this vector, written V Z, is a differential operator on 2 such that:
7
Another useful differential operator is the gradient, which is a vector formed from the derivatives of a scalar function. If u is a scalar function, the gradient, written V u ,is a vector whose x-component is a u / a xwhose , ycomponent is a u / a yand , whose z-component is au/az. Thus aplax, a p / a y , and ap la z, are the components of v p ,and aD/ax, aD/ay, and aD/azare the components of VD. We can now write Darcy’s law (eqs. (1-4))in the compact form: -+
v =
K
(1-10)
- - ( V p-pgVD)
I.1
A combination of operators which we shall see very frequently is V * (f V u ) , where f and u are both scalar functions. Since f au/ax, f a u l a yand , f au/az are the x-, y - , and z-components of the vector ( f v u ) ,
a
au
[ a,i
V * ( f V u=) - f ax
+-a ay
( l.3
+ -:z
(
f-
f-
(1-11)
A special case of this combination is the divergence of the gradient of a function, i.e., V ( V u )This . is called the Laplacian of u ,and is abbreviated as V2u. By setting f 1in eq. (1-11), we obtain: (1-12) General equation for single-phase f l o w
It will be most convenient in our later work if we can use the same differential equation for flow with any number of dimensions. This we can do by arbitrarily defining a “geometric factor” function, a ,as follows: one dimension:
a(x, y ,z )= A ( x )
(1-13a)
two dimensions:
a ( x , y ,z ) = H ( x , y )
(1-13b)
three dimensions:
Q(X,
y ,z )
1
(1-13~)
Then eqs. (1-6), (1-7), and (1-8) can each be written as: --a(aPu,)
ax
WPV,)
aY
a(aPV*) I aq =
az
QI
a($P) at
(1-14)
We recognize that in two-dimensional flow v, is assumed t o be zero, while in one-dimensional flow both u, and u, are assumed t o be zero. In this way we complete the correspondence between eq. (1-14) and eqs. (1-6) and (1-7).
8
As a and p are scalar functions, then (apu,), (apu,), and (apuJare the x - , y - ,and z-components of the vector ( a p l i ) . Using the definition of divergence, eq. (1-14)can be written in the very compact form:
(1-15) Finally, by substituting eq. (1-10) into (1-15), one general equation for single-phase flow is obtained:
v * [ -aPK
(Vp-pPgVD)
I-(
I
a(4P)
+aq = a-
at
(1-16)
In addition to specifying boundary conditions, it is necessary also to specify porosity and an equation of state for the fluid; that is, relationships between porosity, density and pressure:
4
=
m), P
= P(P)
When this is done we have, in theory, all the information necessary to solve the problem.
Boundaryconditions In reservoir simulation, a frequent boundary condition is that the reservoir lies within some closed curve C across which there is no flow, and fluid injection and production take place at wells which can be represented by point sources and sinks. Strictly, we should represent the no-floy boundary conditon by requiring that the normal component of the vector Gat the curve C be zero. This is relatively difficult to do numerically for an arbitrary curve. However, there usually is little interest in an accurate solution in the neighborhood of the curved boundary; rather, our interest lies mostly within the interior of the reservoir. For this reason, it is adequate to represent the curved boundary in the crude way shown in Fig. 2.The reservoir is embedded in a rectangle (or rectangular parallelopiped), and the functions K and @ are set t o zero outside the curve C. As stated above, a well is equivalent t o a point source or sink. Numerically, we cannot represent a true point source or sink, wherein q is zero everywhere except at the wells, and infinite at the location of the wells. Again we resort t o an approximation. Let Q be the desired mass rate of injection at a well. Let V be the volume of a smad box centered at the well. Within the box, we take: = Q/V
and outside the box, we set q t o zero. Inasmuch as we will divide the computing region into a grid with spacing A x (for 1-D), A x and A y (for 2-D),
9
INSIDE RESERVOIR
f Y
OLJTSIDE RESERVOIR K ( x . y ) = d x . y l= 0
Fig. 2.Representation ofan irregularly shapedreservoir
and A x , A y , and A z (for 3-D), we choose V = A A x (for 1-D), V =HAxAy (for 2-D), or V = A x A y A z (for 3-D). There are occasions, of course, when we wish part or all of the boundary of the reservoir t o be straight. In such a case, a no-flow boundary condition is easy t o represent by specifying that the normal component of be zero. Flow across a boundary can be represented by specifying the value of the normal component of 5;an easy, alternative stratagem is t o continue t o require no flow across the boundary and to place fictitious wells at grid points on or near the boundary. Injection at such a fictitious well represents flow into the region across the boundary, while production would represent flow out of the region. Finally, it is desired t o include among possible boundary conditions the specification of pressure, rather than rate, either a t curved o r straight boundaries or a t wells (i.e., at points within the interior).
Special cases of single-phase f l o w It is of interest t o examine several simplifications of eq. (1-16)- simplifications that lead t o classical equations of mathematical physics. While these simple equations are not directly candidates for numerical solution by reservoir simulators, they will serve as excellent prototypes for explaining the numerical methods used in the simulators. The initial simplication is t o assume that gravitational effects are negligible and that the flow region is free of sources and sinks. With V D = 0, and q = 0, eq. (1-16) can be written:
(1-17) Several different cases arise, depending on the choice of the equation of state for the fluid.
Ideal liquid of constant compressibility The compressibility of a fluid, c , is defined, for isothermal conditions, by:
(1-18) For an ideal liquid, that is, one with constant compressibility (as well as constant viscosity), integration yields: P =
Po
exp [C(P -Poll
(1-19)
where po is the density at the reference pressure, po. This particular equation of state applies rather well t o most liquids, unless they contain large quantities of dissolved gas. From eq. (1-18): dP pdp = C
1 pvp = - v p C
and eq. (1-17) becomes:
If, in addition, the porous medium and the reservoir are homogeneous, then
a ,K ,and 4 are uniform, and we obtain: (1-20) This is exactly of the same form as the Fourier equation of heat conduction discussed below. Liquids of slight compressibility For liquids of slight compressibility, the same equation as (1-20) is obtained in terms of pressure: (1-21) When analytical techniques, such as Laplace transforms, are used for the solution of the heat conduction equation to simulate reservoir performance, eq. (1-21) is most frequently used, rather than (1-20). In doing so, it is important to recognize the significance of the assumption that compressibility is small. To demonstrate the nature of this assumption, we rewrite eq. (1-18)as dp = cpdp and obtain aP _ -
at
aP C P Z
(1-22)
11
and :
aP _ ax
aP CPZ
(1-23)
Differentiating eq. (1-23) with respect t o x gives:
Similar expressions hold for a 2 p / a y 2and a 2 p / a z 2 .Thus: (1-24) Substituting eqs. (1-22) and (1-24) into (1-20), and dividing by c p , gives: (1-25) For eq. (1-21) to be a good approximation for (1-25) (and thus for (1-20)), it is necessary that: a2p
a2p
a2p
-+++-pc 3x2 ay az
[ ($I2
+
[:I2 (31 +
Hence the requirement that c be very small.
Ideal gas In the case of flow of an ideal gas through porous media, we can again ignore gravitational effects. The equation of state is:
M P = E P
(1-26)
where M is molecular weight, R the gas constant, and T is the absolute temperature. Substitution of eq. (1-26) into (1-17) gives:
If a,K , 4, and p are again considered constant, this can be written in the very simple form: (1-27) While eq. (1-27) is nonlinear, it is quite similar t o (1-21).
12
Incompressible flow An important category of single-phase flow problems is that of incompressible flow. With p and q5 constant, eq. (1-16) becomes: V
r
-(Vp-pgVD)
1 +: -
= 0
(1-28)
It is convenient t o define a potential, @, as: @ = p - pgD
Then eq. (1-28) becomes:
For the case of a homogeneous reservoir (constant a and K ) as well as constant viscosity, this simplifies t o Poisson’s equation (see below) :
and, in the region where there are no fluid sources or sinks, t o Laplace’s equation (also see below): V2@ = 0
For sufficiently regular boundary conditions, the results of potential theory (which involve solution of Laplace’s equation) can then be applied t o some simple reservoir simulation problems. TYPES O F SECOND-ORDER DIFFERENTIAL EQUATIONS
There are basically three types of second-order differential equations, parabolic, elliptic, and hyperbolic. We need t o be able t o distinguish among these types, since the numerical methods for their solution need t o be considered separately, as we shall do in Chapters 3,4,and 5. In the discussion below, the variable, u, is a generalized dependent variable. Parabolic equations The prototype parabolic equation is the Fourier equation of diffusion or heat conduction, (1-29)
which arises in the theory of diffusion, conduction of heat, and in electrical conduction (in purely resistive material). Here, k is the diffusivity or the thermal (or electrical) conductivity.
13
Elliptic equations
Laplace’s equation, V 2 u = 0, and Poisson’s equation, V 2 u = f ( x , y ,z ) , are the simplest of the elliptic equations. They arise in electrostatic and magnetic field theory and in hydrodynamics of incompressible fluids. Hyperbolic equations
The prototype hyperbolic equation is the wave equation,
(1-30) which arises in acoustics and electrodynamics. Here, u is the velocity of propagation of the acoustic o r electromagnetic disturbance. Classification of equations
If we restrict ourselves t o two independent variables (either x and y , or x and t ) , then these equations may be written in the following general form:
(1-31) This equation may then be classified into the three types as follows: 1) A * B> 0. Elliptic
2) A .B = 0. Parabolic 3) A - B< 0. Hyperbolic There is an obvious analogy with the familiar algebraic equation : Ax2 + B y 2 = y
which is an equation for an ellipse when A B B = 0, and for a hyperbola when A B < 0.
> 0,
for a parabola when
First-order hyperbolic equations
In one space dimension, the second-order hyperbolic eq. (1-30) is: 1 a2u -
azu
- 0
v2 at2 which can be “factored” into two first-order parts as follows: ax2
14
The second factor is equivalent to the first-order convection equation :
(1-32) Below, we shall see that eq. (1-32) is important in the theory of multiphase flow through porous media. On the other hand, second-order hyperbolic problems will be of little interest t o us in this book. Consequently, the discussion of numerical methods for the solution of hyperbolic problems (in Chapter 4 ) will be focussed entirely on first-order problems.
TWO-PHASE FLOW
Introduction In reservoir simulation, we are primarily concerned with modelling the displacement, within a porous medium, of oil by either water or gas. While the displacing fluid may be immiscible with the fluid being displaced, the displacement does not take place as a piston-like process with a sharp interface between the two fluids. Rather, simultaneous flow of the two immiscible fluids takes place within the porous medium. In considering this simultaneous flow we assume, for the present, no mass transfer between the two fluids. One of the fluids wets the porous medium more than the other; we refer t o this as the wetting phase fluid (and use the subscript w), and we refer t o the other as the nonwetting phase fluid (and use the subscript n). In a water-oil system, water is most often the wetting phase; in an oil-gas system, oil is the wetting phase. Several new concepts peculiar t o multiphase flow must now be introduced, namely saturation, capillary pressure, and relative permeability. The saturation of a phase is defined as the fraction of the void volume of the porous medium filled by that phase. Since the two fluids jointly fill the void space, we have :
s, + s w
= 1
(1-33)
Because of surface tension and the curvature of the interfaces between the two fluids within the small pores, the pressure in the nonwetting fluid is higher than the pressure in the wetting fluid. The difference between these two pressures is the capillary pressure, p c :
Pc
=
Pn -Pw
(1-34)
We accept, as an empirical fact, that the capillary pressure is a unique function of saturation:
Pn -Pw
=
PC(SW)
(1-35)
15
sw
SW
Fig.3.Typical curvesfortwo-phase data. A. Capillary pressure. B. Relative permeabilities.
A typical capillary pressure curve is shown in Fig. 3A.
Darcy’s law Darcy’s law is extended t o multiphase flow by postulating that these same phase pressures are involved in causing each fluid t o flow. Equation (1-10) can then be written for each fluid: (1-36a) -+ Vw
KW
= -- (VPW - PwgVD)
(1-36b)
Pw
cw
Here G,,and are the superficial velocities for the nonwetting and wetting fluids, respectively, pn and p w are the respective viscosities, and ,on and pw the respective densities. K n and K w are the effective permeabilities for flow for each of the two fluids. Because the simultaneous flow of the two fluids causes each to interfere with the flow of the other, these effective permeabilities must be less than o r equal to the single-fluid permeability, K , of the medium. Relative permeabilities are therefore defined by: k,, =
k,
Kn -< K
1
KW = - 1 for any choice of p and r. Thus eq. (3-27) is unconditionally unstable, and we must reject trying it, in spite of its attractive error estimate and ease of computation. The Dufort-Frankel approximation This is another three-level difference equation, similar t o (3-27), but the
54
central term U l , f lin the second difference is replaced by the tune average (Ul,,I+I + U1,fl-I)P:
__ Ul+l,fl
- (U,,fl+l
+
UL.fl-1)
+ U,-I,fl
-
Ul.fl+l - U1,n-1
Ax
(3-29)
2At
Let us first consider its stability. By substituting eq. (3-8), we obtain:
2(At/Ax2)[y"{exp(ipAx) + exp (- ipAx)}- {y""
+ y"-')]
= y"" --y"-’
Use of eq. (3-10) gives:
2(At/Ax2)[y"(2c0spA.x)
+ ?"-')I
= y n + '-y"-’
- (y"+’
Divide by y"-’ and rearrange t o obtain:
+
y 2 ( 1 2r) - yr(4 c o s p h )
2r cos 8
Y =
+ (2r - 1) =
0
(3-30)
* (1- 4r2sin20)"2 1 + 2r
(3-31)
where r = At/Ax2 and 8 = p A x . We now consider the two possibilities: (1) 4r2 sin20 > 1. Using la + ib12 = a 2 b 2 , we can show that ly21 = (2r - 1)/(2r+ 1)and that IyI' < 1. (2) 4r2 sin2 8 < 1. Using I1 - 4r2 sin2 81 < 1 and the inequality la + bl< la1 + lbl, we find that: 12r cos 81 1 IYI __ < l 2r + 1
+
+
Hence eq. (3-29) is unconditionally stable. However, a truncation error analysis shows the Dufort-Frankel approximation t o be somewhat unusual. Following eq. (2-23),we write EL
=
Ui+l,n-(Ui,n+l
+ U i , n - l ) + Ui-1,"
- ~ i , n + l -Ui,n-l
Ax
2At
In addition t o using (2-lo),i.e.:
zUi, +
a z U - -____ U,+l,n Ui-l,n __
ax*
Ax2 and rewriting (2-8) as:
& at
.-
-
ui,n+1
-
Ui,n-l
2At
-.
a x 2 a4U ~-
1 2 ax4 At2a3u 6 at3
we also add the following two Taylor expansions together: au
~ i , ~ = + l ujn
At2a2u
+ At-at + --(t’) 2 at2
a2u a u ax2 at
+-
55
u ~ ,-~ uin - -~A t -
au at
2u + -A-2t(2t aat2 ”)
to obtain:
azu u ~ ,+ ~ u + ~ ~, =~ 2uin - ~+ A t 2 - ( t ” ’ ) at2 or : Ui,n+l
+ Ui,n..l
-
Ax
2 2 3 At2a2U ~ x 2 ~~2 at2
+
Then : EL =
Ax2 a4u 1 2 ax4
A t 2 a3u 6 at3
At2 a2u A x 2 at’
eL = o ( A x 2 )+ O ( A t 2 )+ 0 ( A t 2 / A x 2 )
(3-32)
In order t o get convergence similar t o that of the forward- or backwarddifference equations, it is necessary that A t be kept proportional t o Ax2 (or smaller) as both A t and Ax are reduced t o zero. If A t were kept proportional to Ax, we see that eL would remain constant (i.e., 0(1)),indicating lack of convergence. This indicates that Dufort-Frankel must be used with great care and that, probably, A t should be kept relatively small, even for practically large values of A x . MULTIDIMENSIONAL PROBLEMS
Finite-difference methods for paraaolic equations in several space variables can be separated into two categories: (1)extensions of the difference equations described above, and ( 2 ) alternating-direction methods, which have no analog in one space dimension. In this section, we will develop the extensions of the previous equations and confine our attention t o two space variables, as that will be typical of the general multidimensional problem.
Forward-difference equation Consider the differential equation : -a z+U3x2
a2u
a p
aU
= -
at
(3-33)
The forwarddifference equation (3-4) easily generalizes t o :
Ui,j,n+l = where :
uijn
+ AtAzUijn + AtA:Uij,
(3-34)
56
A:uiin
(Ui+l,j,n - 2Uin + U i - l , j , n ) / A ~ 2
, n2uijn + Ui,j-l,n)/A~’ A:u"n = ( u i , j + lTo analyze the stability, we assume an error of the form:
(3-35)
(3-36) eiin = ynexp (ipiAx) exp (iqjAy) Substituting eq. (3-36) into (3-34) and cancelling common factors leads now to : y = 1 - 4(At/Ax2) sin' (paX/2) - 4(At/Ay2) sin' (qAy/2)
(3-37)
To satisfy the von Neumann criterion for stability, we require:
- l < y < l The right-hand inequality is satisfied trivially, while the left-hand inequality leads to: -2
< - 4(At/Ax2) sin'
(paX/2) - (At/Ay’) sin' (qAy/2)
Maximizing the sines of (paX/2) and (qAy/2) will require the smallest value of At in order t o satisfy this inequality. As a conservative approximation, we can take: max sin' ( p A x / 2 ) x max sin' (qAy/2) 1 giving :
(3-38) For Ax = Ay,we have:
r = At/Ax2= At/Ay2 < f
(3-39)
as the requirement for stability. By comparing with eq. (3-14), we see that the critical time step for a two-dimensional problem is only half that for a onedimensional problem when the forward-difference equation is used. Implicit difference eq ua tions Let us consider use of two-dimensional implicit equations t o achieve unconditional stability. The backwarddifference equation would be :
(3-40) Substituting eq. (3-36) and cancelling common factors leads to:
1 = 1 4 ( x t / A x sin' 2 ) (pAx/2) + 4(At/Ay’) sin' (qAy/2)
(3-41)
51
which is always less than one in magnitude; hence, eq. ( 3 - 4 0 ) is unconditionally stable. The Crank-Nicolson difference analog of eq. ( 3 - 3 3 )is also unconditionally stable. The difference equation is:
!j[A2Ui,,,n+l+ Aiu191,n+1+ A:uun + A;uunI =
u,,,,n+ I uun -
At
(3-42)
Substituting eq. ( 3 - 3 6 )and cancelling common factors leads t o :
’
1- [ 2 ( A t / A x 2 sin2 ) ( p a X / 2 )+ 2 ( A t / A y 2 )sin2 ( q A y / 2 ) ] = 1 + [ 2 ( A t / A x 2 sin2 ) ( p A x / 2 )+ 2 ( A t / A y 2 )sin2 ( q A y / 2 ) ]
(3-43)
which is always less than one in magnitude. While the implicit difference equations ( 3 - 4 0 ) and ( 3 - 4 2 ) are unconditionally stable, they are much more difficult t o solve than their onedimensional counterparts. Their use gives rise t o systems of simultaneous equations that are of the same form as tho$e arising in connection with solutions of elliptic problems, which we will be studying in Chapter 5 in considerable detail. Suffice it t o say here that direct solution of this system of equations involves much more computational labor than that associated with the simpler tridiagonal system of equations, and hence the solution is usually attempted by some method of iteration. It will be helpful for us, a t this point, t o list the truncation errors associated with the forward, backward, and Crank-Nicolson difference equations, in order to have a basis for comparison with alternating-direction methods discussed in the following section. By using the method outlined in Chapter 2 , we can find that the local truncation error of the two-dimensional forward-difference equation ( 3 - 3 4 )is:
F-D:
eL = (3(h2) + (3 ( A y ’ ) + O ( A t )
(3-44)
The local truncation error of the two-dimensional backward-difference equation ( 3 - 4 0 )is the same: B-D:
eL =
0 ( A x 2 )+ ( 3 ( A y 2 )+ ( 3 ( A t )
(3-45)
while the local truncation error of the two-dimensional Crank-Nicolson difference equation ( 3 - 4 2 )is: C-N: eL = (3 ( A x 2 )
+ ( 3 ( A y 2 )+ (3 ( A t 2 )
(3-46)
ALTERNATING-DIRECTION METHODS
The Peaceman-Rachford method As Douglas (1961, p. 37) points out, the use of implicit difference equations is motivated by several desires. The primary one is to obtain
58
unconditional stability. Better accuracy is also sought. However, as a practical matter, it is highly desirable that the resulting simultaneous equations be easy t o solve. While the implicit equations for a single space variable satisfy these wishes reasonably well, the implicit equations so far considered for two or more space variables yield systems of equations that are quite difficult to solve. The alternating-direction method was first proposed by Peaceman and Rachford (1955) for two space variables, and extended t o three space variables by Douglas and Rachford (1956), by Brian (1961), and by Douglas (1962), to simplify the solution problem while preserving unconditional stability and reasonable accuracy. Consider first the heat equation (3-33)on the unit square, with Ax = Ay. The solution of tridiagonal linear equations is quite simple, as we have found. If the simultaneous equations are t o be of this form, then only one of the spatial difference quotients can be evaluated at t,+ 1. This leads t o the difference equation : (3-47) Let us consider the von Neumann stability of eq. (3-47). Assume an error of the form (3-36).Now:
A;E",, = [y" exp {ip(i + 1)Ax) - 27" exp { i p i h }
+ y" exp {ip(i - l ) h } l
exp {iqjAy)/Ax'
*
= y" exp ( i p i h } exp (iqjAy)[exp (ipAx) - 2
+ exp (-
ipAx)]/Ax'
= - ( 4 / h 2 ) e i i nsin' ( p h / 2 )
(3-48a)
Similarly : A;eiifl = - (4/Ay')~,,, sin' (qAy/2)
(3-48b)
Therefore, substitution of eqs. (3-36)and (3-48) into (3-47) gives - y " + ' ( 4 / h 2 )sin'
(pAx/2) - y"(4/Ay2) sin' (qAyl2) = (y"+l
Y")/At
Let r = At/Ax2 = At/Ay2. Then:
y"+"1 yn+l
+ 4r sin'
-
y"
(pAx/2)] = y"[ 1 - 4r sin' (qAy/2)]
1 - 4r sin2 (4Ay/2) 1 + 4r sin' (pAx/2)
(3-49)
If r > p = 1,and q = J - 1,then 1yI > 1, so that eq. (3-47) is unstable, at least for r > Suppose we had evaluated A:U instead of A; U a t t n + l .Then the difference equation would be:
4,
4.
59
(3-50) Instead of eq. (3-49),the stability ratio would be:
y"+l -7"
1 - 4 r sin' ( p A x / 2 )
(3-51)
1 + 4r sin' ( q A y / 2 )
which again yields Iyi > 1 for some r, p ,and q , so that eq. (3-50)is also unstable for r > $. Consider taking one time step using eq. (3-47) and then one time step using (3-50).Equation (3-49) stays the same, but (3-51)becomes:
Y-n +-2 -
Y"+
1 - 4r sin' ( p A x / 2 )
(3-52)
1 + 4r sin2 ( q A y / 2 )
Multiplying eqs. (3-49)and (3-52)gives the stability ratio for the double step:
yn+' y"
-
1 - 4r sin' ( p A x l 2 ) -. 1- 4r sin' ( q A y / 2 ) 1 4r sin' ( p A x / 2 )1 + 4r sin2 ( q A y / 2 )
(3-53)
+
which is less than one in magnitude for any size time step for any p and q . The alternate use of eqs. (3-47) and (3-50) results in a stable procedure, as was first shown by Peaceman and Rachford (1955). Since we are interested in the solution after the double time step, let us t o indicate the alter At t o correspond t o the double step, and use n intermediate values:
+4
(3-54) To facilitate studying the accuracy of eq. (3-54),let us eliminate Ui,j,,+; to obtain what we might call an "overall" equation. First we add and subtract the two equations (3-54):
zA;Ui,j>n++ + A$(U"n+ Ui,j,n+l) = 2(ui,j,n+1 - U"n)/At
(3-55)
(3-56) 2(ui,j,n + Ui,j,n+l -2ui,j,n++)/~t Solve eq. (3-56) for U i , j , ntake + + , its second x-difference and substitute into (3-55): A;(ui,j, -nU",j +l =
Ui,j,n++ = $(Uijn + Ui,j,n+l) - (At/4)A,2(Ui,j,n+l - uijn) A.:ui,j,n++ = &AZ(uijn + Ui,j,n+l) - (At/4)A;A,2(Ui,j,n+l - Uijn)
A;(uijn + Ui,j,n+ 1 ) - (At/z)A;A,2(Ui,j,n+l - u i j n+ )
60
+ ( A t / 4 ) A ? A , ' ( U i , j , n +-l Uijn)
(3-57)
As Douglas (1961, p. 38)noted, eq. ( 3 - 5 7 )is a perturbation of the CrankNicolson equation ( 3 - 4 2 ) .Like it, ( 3 - 5 7 )is also second-order correct both in space and time; that is, the error is AX)' (Ay)' + ( A t ) 2 ] . When we try t o extend the Peaceman-Rachford method t o three dimensions, we get the following difference equations. To simplify the writing, let us suppress i and j in the index:
+
A?U,,+++ A:Un
+ AjU,
=
un+;- un At13
A stability analysis, after much messy manipulation, yields:
'
Y"+_-- I _ Y"
+
3(Y-9)(X+ Y+Z) ( 3 X ) ( 3 + Y ) ( 3+ 2)
+
where :
X = 4 ( A t / A x 2 )sin' ( p A . x / 2 ) Y = 4 ( A t / A y ' ) sin' ( q A y l 2 ) Z = 4 ( A t / A z 2 )sin' ( s A z / 2 )
If X > 6 and Y = Z = 0, then y < - 1. Thus At/&' > 3 implies instability, so that the three-dimensional version of the Peaceman-Rachford method is not unconditionally stable.
The Douglas-Rachford method The first unconditionally stable alternating-direction method for three dimensions was proposed by Douglas and Rachford (1956):
(3-58a)
61
(3-58b) (3-58~) The second and third equations (3-58) might be regarded as “corrections” t o the first equation. A standard stability analysis shows eq. (3-58) t o be unconditionally stable; it yields the result:
1 + XY =
+ xz + YZ + X Y Z
1+xY+xz+Yz+xYz+x+Y+z
< 1
We eliminate U,+; and U,++ t o obtain an overall equation as follows. First solve eq. (3-58c) for U,++and difference with respect t o y .
un++=
Un+l- A t A Z ( u n + l -un)
A;U,,++ = A;U,+,- AtA;A,2(U,,+, - U,) Solve eq. (3-58b) for U,,++, substitute both of the above equations, and difference with respect t o x : U,,++= U,++- AtA;U,,+; AtA:U,,
+
-AtAZ(U,+,-U,)-At[A:U,+,-AtA;AZ(un+,-un)I + AtA;U,
un++=
un+l
- AtAzA;(U,,+, - U,,) - AtA~A;U,,+, A:U,++ = A;U,,+,
+ At2A;A;A;(U,+,- U,,)+ AtA;A;U, Substitute the above two equations into eq. (3-58a)
A;t.U,,+, - AtAiAZ(U,,+, - U,)- AtA;A$U,,+, + A t 2 A ~ A , A 2 ( U ,- - ,U,) +, +AtA;A;U, +A;U, +AzU,, = ( U , + , / A t ) - A ~ ( U , , + , - U n )
+
- A;Un+, AtA;A;(U,+,- U,)+ A, U,, - (U,,/At)
+ At(A;A;+ AzAz + A;AZ) (Un+-,U,,)
(3-59)
We see that eq. (3-59) is a perturbation of the backward-difference equation (3-40).Like the backward-difference equation, it has an error term of AX)^ + (Ay) + ( A Z ) ~ At]. An interesting aspect of the two-dimensional version of the DouglasRachford method is that if it is used for half a time step (i.e., for At/2), and then “extrapolated” t o a full time step, the result is identical with the Peaceman-Rachford procedure for two dimensions. The two-dimensional
+
62
version of Douglas-Rachford for half a time step is:
(3-60) The extrapolation equation is :
u,+, = u,+ 2 ( U , + + -
(3-61)
U,)
Now the overall equation for (3-60) can be obtained from (3-59) by setting A: = 0 and using At12 for A t : (3-62) From eq. (3-61), we have ( U , + ; - U , )= ( U , + , - U n ) / 2 and U,+; = ( U ,+ U n +1 ) / 2 .Substituting into the above gwes (3-57),the overall equation for the Peaceman-Rachford method. The Brianand Douglasmethods
Brian (1961) used the same extrapolation approach t o the threedimensional Douglas-Rachford method t o obtain a more accurate three-dimensional method. Thus the difference equation is:
(3-63) Equation (3-61) still serves as the extrapolation equation. Making the appropriate changes in the overall equation (3-59) gives:
(A:
+ A; + AZ)U,++ =
&++At12
u,
- ( A t 2 / 4 ) A : A ; A Z ( U , +; U,)
+ ( A t / 2 ) ( A : A ; + A:AZ + A ; A z ) ( U n + i -U,) Again using ( U n t + U,)= ( U n +l U,)/2and U,+t= ( U ,+ Un+l)/2, we
63
+ (At/4)(AfA; + A:A: + A;A:)(U,+, U,) -
(3-64)
Douglas (1962)approached the problem of obtaining a more accurate three-dimensional procedure by setting up an alternating-direction modification of the Crank-Nicolson method from the beginning. (The two-dimensional version of the following treatment turns out t o be equivalent t o the Peaceman-Rachford method.) First evaluate the x-difference at t,+;t o obtain U,++, then move the evaluation of the y-difference t o t,+; when obtaining U,+;;finally, move the evaluation of the z-difference t o t,+; when obtaining U,+
(3-65) A more convenient form for calculation may be obtained by rearranging the first equation and by subtracting the first two and last two equations of (3-65):
$AZ(U,+; - U,)+ (A: + A;
- u, + A;)U, = k+$ At
Elimination of U,.; and U,++ from eq. (3-66) leads t o the same overall equation as (3-64), showing that Brian's method and Douglas's method are equivalent (although the intermediate numbers are different for the two is a perturbation of the Crank-Nicolson equation methods). Equation (3-64) for three dimensions, and also has an error of AX)^ + (Ay)' + (Az)’ + (At)’]. Thus the Brian-Douglas procedures possess the desired accuracy, as compared with the Douglas-Rachford method, which is only (3 A AX)^ 4( A Y )+~ ( A . z )At]. ~ The analyses of alternating-direction procedures cannot be extended t o nonrectangular regions or t o cases where the coefficients of the differential equations are not constant. This does not mean that alternating-direction methods themselves fail for such problems; indeed, the methods have been found very useful for the more complex problems.
+
64
NOMENCLATURE S y m boIs
ai bi ci di
= off-diagonal coefficient of tridiagonal system of equations = diagonal coefficient of tridiagonal system of equations = off-diagonal coefficient of tridiagonal system of equations
= fo = gl = g2 = i =
right-hand side in tridiagonal system of equations function specifying initial condition function specifying boundary condition a t x = x 1 functton specifying boundary condition a t x = x2 (-1)T I = number of grid points in x-direction p = index in Fourier expansion of error q = index in Fourier expansion of error r = At1A.x’ o r AtlAy’ s = index in Fourier expansion of error t = time u = general function U = difference solution for function u wi = intermediate variable in solution of tridiagonal system of equations x = distance X = 4 ( A t / A . x z )sin’ ( p A x / 2 ) y = distance Y = 4 ( A t / A y 2 )sin’ ( q A y / 2 ) z = distance Z = 4 ( A t / A z 2 )sin’ ( s A z / 2 ) pi = intermediate variable in solution of tridiagonal system of equations y i = intermediate variable in solution of tridiagonal system of equations y = yr,= amplification factor for stability analysis 7” = 7; = coefficient in Fourier expansion of error A t = increment of t Ax = increment of x Ay = increment of y Az = increment of z A Z U , = second-difference quotient in x-direction, equals ( U i + l , j - 2uij + Ui-l,j)/A.x’ AZU, = second-difference quotient in y-direction, equals (Ui,j+l- 2uij + Ui,j-l)/&’ AzUijk = second-difference quotient in z-direction, equals ( U i , j , k + l-2Uijk + u i , j , k - l ) l h 2 EL = local truncation error e =
Subscripts i j
h R
p
index index index index index
in x-direction in y-direction in z-direction in t-direction (i.e., time) in Fourier expansion
CHAPTER 4
NUMERICAL SOLUTION OF FIRST-ORDER HYPERBOLIC PROBLEMS IN ONE DEPENDENT VARIABLE
INTRODUCTION
The first-order hyperbolic problem we shall consider is the following nonlinear convection equation in one space dimension :
a
-u-f(u)
ax
au at
= -
(4-1)
where f is some function of the dependent variable, u . We observe that eq. (4-1)is a simplified version of eq. (1-63) (which was derived for two-phase flow), the simplifications being the assumptions of one-dimensional, horizontal flow and zero capillary pressure. The velocity, u , is assumed t o be positive, corresponding to flow in the direction of increasing x . In this chapter, we shall consider several simple difference equations for approximating (4-l),and examine them for stability and truncation error. An understanding of the behavior of these simple difference equations should lead to an improved understanding of some of the problems associated with the numerical solution of multiphase flow problems, the subject covered in Chapter 6. DIFFERENCE EQUATIONS
Distance-weighting The first step in obtaining a difference analog for eq. (4-1) is t o approximate the space derivative, a f / a x , by:
Several options are available for choosing F i + t . The simplest option is arithmetic averaging:
Another option, more commonly used, is:
66
(4-4) Fi++= Fi = f ( U i ) Since the point, xi, is the upstream end of the interval between x iand x i + l , we refer t o this as upstream weighting of the function f ,while eq. (4-3) is referred t o as mid-point weighting. A weighting parameter, W , can be used t o characterize the options:
upstream weighting:
W = l
mid-point weighting:
W =
downstream weighting:
W = 0
4
Then eqs. (4-3) and (4-4) can be combined into the general equation:
Fi,+ = ( W ) F i+ (1- W ) F i + ,
(4-5)
Similarly :
F i _ t= ( W ) F i _+,(1- W ) F ,
(4-6)
Timeweighting We can use a similar parametric approach t o differentiating among explicit, implicit, and centered-in-time (e.g., Crank-Nicolson for the heat equation) difference equations, wherein the spatial derivatives are evaluated, respectively, at t,,t n + lor, t,+;. If we use 8 as the “time-weighting” parameter, with the values: implicit :
e = i
centered-in-time: 8 = explicit :
4
e = o
then eq. (4-1) can be replaced by the difference analog:
Ui,n+l - ui,n _ _v [ e ( F i + +t1 ,n F i - t , n ++l(1- e ) ( F i + t-,F.i - ; , n )=l At Ax
(4-7)
General formofdifference equation Substitution of eqs. (4-5) and (4-6) into eq. (4-7) gives the final, general, difference analog for eq. (4-1):
+ i , n +l (W)J i-l,n+I} + ( 1 - @ ) { ( 1 - W ) F i ++l (,2nW - - ) F i , , - ( W ) F i - l , n } l
- ( u A t / A x ) [e {W)Fi+l,n+l (l (2W - l)J
-
- Ui,n+l -ui,n
(4-8)
Nine particular cases of special interest are listed in Table IV, together
TABLE IV Special cases of first-order difference equation Backward-in-distance
Centered-in-distance
W=l
W=i
Forward-in-distance
w=o
r
Backward-in-time e=1 n:l 1-1
I
I
always stable = ;uf'Ax(A
3,,,
+ 1)
always stable = $uf'Ax(h)
9,-
, + l
stable if A 2 1 f),, = $uf'Ax(A
-
1)
Centered-in-time
e=f
1-1
9,-
Forward-in-time
e=o
'
n 1-1 + l
1-1
I
always stable = ;uf'Ax
J
I
9,-
"+'
1
n
9,-
I
Thus, by solving the difference equation ( 4 - l lwe ) ,are, in effect, solving the diffusion-convection problem:
(4-30) (a one-dimensional equivalent t o eq. (1-64)), rather than the pure convection problem expressed by eq. (4-21). The truncation error associated with the use of the various difference equations discussed above has therefore been dispersion. described by the term numerical In Table IV, $InUrnis listed for each of the nine special difference is associequations. It is interesting t o note that in every case, positive ated with stability, while negative gnu, is associated with instability. In only two cases is = 0, i.e.:
a,,,
anurn
(a) Forward-in-time, backward-in-distance ( W = 1, 0 = 0), with equal t o one.
X exactly
(b) Centered-in-time, centered-in-distance ( W = 8 = 3). In both of these cases, neutral stability obtains, wherein I y I = 1. Thus, it is clear that there is a close connection between stability and numerical dispersion and that, in effect, the numerical dispersion acts t o stabilize the difference equation.
Superposition ofnumerical andphysical dispersion If we consider solving the diffusion-convection equation with a “physical” diffusivity, 9:
75 aZu
au
ax
ax
g7-ufL
au
= -
(4-31)
at
and derive a difference analog in the same manner as discussed above for the convection equation, then truncation error analysis will show that the solution of the difference equation corresponds t o the solution of the modified problem :
au
a2u au (Tl+Tlnurn)y-uf’= ax ax at
(4-32)
A serious problem now becomes evident. When the physical diffusivity, 3, is small, the true solution should be a relatively sharp front, and it may be important t o obtain from the calculation the “width” of the front. When numerical dispersion is severe, as it so frequently is (unfortunately), 9nurn can be much larger than 9. As a result, numerical dispersion will swamp physical dispersion, leading t o a front apparently much more smeared than it should be. Equation (4-29) suggests that numerical dispersion can be reduced by reducing A x , but reduction t o a tolerable level may require an excessive number of grid points. It can be controlled t o some extent by adjustment of the weighting factor, W , but care must be taken not t o let the difference equation go unstable, which can lead t o an oscillatory or otherwise unrealistic solution. EXAMPLE CALCULATIONS
Purpose and details of calculations To illustrate some of the ideas developed above, we consider some examples of the numerical solution of the diffusion-convection equation (4-31).These solutions are all obtained by use of the difference equation ( 4 - l l ) , modified by adding t o the left-hand side the following centered-indistance, centered-in-time analog of the “physical” diffusion term :
(9At/2Ax2)(Ui+1,n+1 -2Ui,n+1 + Ui-l,n+l +
Ui+L,n-
2Ui,n
+ Ui-l,n)
Note that the weighting factors, W and 8, are not applied t o the diffusion term, but only to the convection term. For the initial condition:
u ( x0, ) = 0 ,
x >o
(4-33)
and boundary conditions :
u ( 0t,)
=
1, u(=J, t )= 0 , t> o
(4-34)
76
eq. (4-31) has the exact solution: u =
5 erfc
[
1+4
x-uft
’
x
[
exp ( u f x / erfc a)
2( 9 t ) f
~
+ uf
1
t
2(9t)i
(4-35)
where erfc is the complementary error function, defined by: erfc ( x ) = 1 - (2/&)
5” exp
(- u 2 ) d u
0
The corresponding initial and boundary conditions for the numerical examples are :
ui,o=o,
(4-36)
i > l
U o , n= 1, U I S n= 0 , n > 1
(4-37)
The last equation is an adequate representation of the boundary condition at = m if I is chosen sufficiently large that the solution does not change appreciably at the point i = I - 1. In the example calculations, I = 5/Ax (corresponding t o x = 5)satisfies this condition. The exact solution (4-35) is indeterminate at the point x = 0, t = 0 .However, the numerical procedure (in most cases) requires a value for U o , oFor . the example calculations, the arbitrary choice of U o , o= 0.5is made. Further specifics of the calculation are: x
Ax = 0.1 ufl
ii,
=
1.0
=
0.01 At = 0.1
x
= 0.5
= 1.0
At each time step, solution is accomplished by use of the tridiagonal algorithm described in Chapter 3.
So1u tio nsshowingnumerical dispersion Figures 10 and 11 show six examples of solutions that exhibit significant numerical dispersion. In each example, the exact solution t o eq. (4-31), namely eq. (4-35) for f? = 0.01 and t = 1.0, is plotted as the solid curve. Corresponding numerical values for obtained from eq. (4-29), are noted in the legends. The numerical solutions exhibit significantly more smearing than the exact solutions, and the amount of smearing clearly increases as increases. For comparison, eq. (4-35) has also been evaluated using a “total” diffusion coefficient:
a,,,,
a,,,
fIt
=
9 + !I),,,
77 P
1. 0 0
2
E
- -
20
DISTANCE, X
I
8 E X A C T S O L U T I O N . ' / = 0 01
20 DISTANCE. X
I
C
.
1
E X A C T S O L U T I O N . T = 0 01
J
1 o+-
---
E X A C T S O L U T I O N , Y = 0 085
c -'o--
--
0-
Fig. 10.Numerical solutions (of diffusion-convection equation) exhibiting numerical dispersion. Difference equations are backward-in-distance and: A . Forward-in-time, with h = f. B. Centered-in-time, with h = f. C. Backward-in-time, with h = f. D. Backward-intime, with h = 1.
78
EXACT SOLUTION.Y= 0.01
0 ACT
W = 0.5, I1 = 1, A = 0.5
SOLUTIONS, = 0.035 9
0.5
1.0
r
1.5
-
-
A
2.0
DISTANCE, X
I
E
10
il
---4
I
I
0 NUMERICAL SOLUTION I n = 101
\o~\‘/CnHL’
j
J U L
W = 0.5,fl = 1, h = 1
Pnum = 0.05 OO
I
I
05
10
1.5
2 .o
DISTANCE. X
Fig.11.Numericalsolutions (ofdiffusion-convection equation) exhibiting numerical disA. h = 4. persion. Difference equations are centered-in-distance and backward-in-time. B. h = 1.
and this is shown as the dashed curve in each figure. Good-to-excellent agreement exists between the numerical solutions and the “exact” solutions of eq. (4-35) that use the “total” diffusion coefficient.
Solutions without numerical dispersion Figure 1 2 shows solutions for three cases where TIn,, = 0. Case Ainvolves the backward-in-distance, forward-in-time difference equation, for which zero numerical dispersion can be obtained only by choosing the time step, At,so that X = 1. This choice of h yields excellent agreement between the numerical and exact solutions. Indeed, if u f ’ is constant and the size of the time step is freely at one’s disposal, such an approach t o avoiding numerical dispersion is highly recommended. Unfortunately, this approach cannot be carried over to more complex situations of interest, such as multiphase problems where f is not constant, or t o multidimensional problems where u, and u, are not constant. Cases B and C in Fig. 12 involve another approach to reducing gnu, to zero, namely the use of a centered-in-distance, centered-in-time difference equation. Here, the numerical solutions oscillate somewhat, with overshoot occurring behind the moving front. This overshoot is typical of many higher-
79
NUMERICAL SOLUTION (n = 10) W.05 ii=O5,h=1
OO
I
I
05
10
n
15
DISTANCE. X
l.oo---olu
--
-- .
C
eEXACT S D L U T I O N . ~ =0.01
P 3
I
1 .o
0.5
00
1.5
-
DISTANCE, X
Fig. 12. Numerical solutions (of diffusion-convection equation) with zero numerical dispersion. Difference equations are: A. Backward-in-distance, forward-in-time, with h = 1. B. Centered-in-distance, centered-in-time, with A = 1. C. Centered-in-distance, centeredin-time, with h =
4.
order difference equations designed t o eliminate numerical dispersion, and the overshoot tends t o become more severe as the front becomes sharper (i.e., as the physical diffusion coefficient, 9,becomes smaller).
80
Unstable solutions Finally, Fig. 13 shows two examples of unstable numerical solutions obtained with a centered-in-distance, forward-in-time difference equation. In both examples, the numerical dispersion coefficient (as well as the “total” diffusion coefficient, = 9 ),,Ur, is negative, and the degree of insta-
+
l
A
0
N U M E R I C A L SOLUTIONS FOR W = 0.5, U = 0; h = 0.5 Vnu, = -0.025
\
\
---n--- --o---
\
n.10,
” = 20,
t=0.5 t = 1.0
z
0 3 -I
a
05
‘\ \
\
DISTANCE, X
DISTANCE, X
Fig. 13. Numerical solutions (of diffusion-convection equation) exhibiting instability. Difference equations are centered-in-distance, forward-in-time. A . h = i. B. h = 1.
81
bility (i.e., growth of the oscillation with each time step) increases as h and increase. One can also carry out calculations for the forward-in-distance difference equations (i.e., W = 0), but the instability is so great as t o preclude plotting the solutions in any meaningful way.
a,,,
SUMMARY
Example calculations clearly indicate that a numerical solution of the diffusion-convection equation can be expected to exhibit either numerical dispersion or some oscillatory behavior. (The one exception, illustrated by Fig. 12A,must be regarded as a special case, since it cannot be generalized t o more complex situations.) While the above examples and truncation analyses apply only t o the linearized version of the diffusion-convection equation, the same phenomena can be observed for nonlinear versions associated with multiphase flow. The influence of the nonlinearity is not completely understood, so quantitative interpretation of numerical dispersion or oscillatory behavior is, at this time, somewhat elusive. Lantz (1971) does provide some guidelines, however. In any event, the user of a reservoir simulator needs t o be aware that either numerical dispersion or oscillatory behavior (usually in the form of overshoot) can be expected in convection-dominated problems and that he can, t o some extent, trade off between one or the other by adjusting the weighting factors. But he cannot make them both disappear. His primary recourse is t o refine the grid, but this, of course, is limited by practical considerations involving computational costs as well as available computing time and storage. The subject of this chapter is an active area of research, and several higherorder difference equations for solving the diffusionconvection equation have been proposed. They include the two-point upstream weighting method of Todd et al. (1972), the variational approach of Price et al. (1968),higherorder difference equations of Stone and Brian (1963) and of Chaudhari (1971), and, most recently, a new “truncation-cancellation” procedure of Laumbach (1975). A detailed discussion of these equations is beyond the scope of this book. While some look very promising, at least for the linearized convection-diffusion problem, only a few have been implemented in existing reservoir simulators, and the successful application of the others t o multiphase flow problems has yet t o be demonstrated.
82
NOMENCLATURE Sy m b 01s
9
3 num
a, f f) F I
I t U
U u
W X
At Ax 8
h
= physical diffusivity [ m2 / s ] = numerical diffusivity [ m2 / s ] = 9+ [m2/s1 = function of dependent variable u = df/du = difference solution for function f = (- 1); = number of grid points in x-direction = time [ s ] = general function = difference solution for function u = velocity [ m / s ] = distance-weighting parameter = distance [ m ] = increment of t [ s ] = increment of x [ m ] = time -weighting parameter = uf’At/Ax
9,-
Subscripts I
m n
index in x-direction fractional index in t-direction = (1- e ) n-k e ( n index in t-direction (i.e., time)
+ 1)
CHAPTER 5
NUMERICAL SOLUTION OF ELLIPTIC PROBLEMS IN ONE DEPENDENT VARIABLE
ELLIPTIC DIFFERENCE EQUATIONS
Formula tion Consider the two-dimensional elliptic differential equation:
O<x 1, We ask whether successive overrelaxation will converge. Since 1-1 and - 1-1 both occur as pigenvalues, we take the positive one, 1-1 > 1,and take the positive root in the expression for a,eq. (5-78):
+
max w t = +l/3p1+ + [ p * p 2 - 4(/3- 111 From the assumption that I p I
> 1,it follows that:
> 41/31 + 3 [ p 2 - 4p + 41; rnax at > +1/31 + 31$- 21
max
We need t o examine three cases: (a) p G 0. Then 1/31 = - 0, Ip - 21 = 2 - 0, and rnax w+ > 3(2 - 2/31 = I - p.
(b)O~/3\ &(/3 + 2 - 0)
0;
(c)2 i ( 2 / 3 - 2 ) =
p-
= $---2,and
1.
In each case: maxw+>l Thus, successive overrelaxation can neverbe a convergent iteration (for real
p ) when the Jacobi method itself diverges. The advantage of scccessive overrelaxation lies in accelerating the rate of convergence of an already convergent process. From now on, we consider only 11-11 < 1.
Convergence rateof methodof successive displacements Consider first, the method of successive displacements, i.e., SOR with 1.Then, from eq. (5-78), we have:
=
&
= $p
+ &(/J2)+
rnax o+= max 11-11
109
maxlwl = m a p 2 Since, by eq. (5-68): R(Gs,)= -1nmax I w I = -21nmax = 2R(Gj)
lpl
(5-80)
The method of successive displacements converges exactly twice as fast as the Jacobi method. Optimumparameter forSOR What is the optimum value of t o use for successive overrelaxation? To guide the search, eq. (5-78) is plotted in Fig. 25, which shows I w 1 vs. /3 for different values of p . First, we see the previous result that 1 w 1 > 1 for p > 1.
Fig.25.Solution of eq.(5-78), showingvariation ofI w I withp forvarious values of p . w iseigenvalue of GSOR;p iseigenvalue of GJ;p isSOR relaxation parameter.
We also see that ( w l = p 2 at p = 1. We note that for (1.11< 1, l w l is always greater than p2 for /3 < 1, and is greater than 1 for p > 2. It is clear that the optimum p will lie between 1and 2. It turns out that the break in each curve, which is where 1 w I is minimized, occurs at that value of /3 for which the discriminant, p 2 p 2 - 4(/3- l), is zero.
110
Thus: 12P:pt - 4POpt
+4
(5-81)
= 0
or :
Popt =
*
2[1 (1 -p2)t]/p*
The negative root should be taken, since Popt< 2.Then: Popt
(5-82)
= 2 [ 1 - (1- P2)t1/P2
: From eq. (5-81) p2Popt= 4(POpt - 1)/(30pt = 4(1- Pi;,)
Combination with eq. (5-82) yields the alternative expression :
2/[1+ (1-p2),] Since the discriminant is zero a t this value of
(5-83)
Popt -
0, we obtain from eq. (5-78) :
I w I = P&tP2/4 = PoPt(PoPt~2)/4
which, combined with eqs. (5-82) and (5-83), yields the result:
+
max IwOptl = [I - (1- max p 2 ) + 1 / [ 1 (1- max p 2 ) f ]
(5-84)
The straight-line portion of the curves in Fig. 25 corresponds to the region in which the discriminant is negative. It can be shown for this region that I w 1 is independent of p and satisfies the simple equation 101
=
(3-1
Comparison of convergence rates How much better SOR is than Jacobi iteration and the method of successive displacements can be seen as follows. In most practical cases, we expect max 1 p 1 t o be slightly less than one. Let maxlpl = 1 - E
For the Jacobi method:
R ( G J )= - m a x l n l p I
= -ln(l-e)
x E
For successive displacements (SOR with /3 = 1):
R(Gs,)= 2R(Gj)z 2~ For optimum successive overrelaxation:
=
m a x p 2 = (1
(1- max p2)+
M
1 - 2 ~
(zE)+
From eq. (5-84):
(5-85)
111
rnax Iwoptl
=
[I - (2e)+1/[1+
(~E)+I
=
1- 2(2e)+
and : R(GSOR)opt =
- max In I uoptl= 23/2E+
(5-86)
Substitution of eq. (5-85) into (5-86) gives: R(GSOR)opt
'
23/2[R(GJ)I
(5-87)
For small E, this is a very large improvement. To illustrate this, we consider the solution of Laplace's equation in a square with Neumann boundary conditions. Consider three mesh sizes, I = J = 10, I = J = 32, and I = J = 100. For this simple example, A x = A y ,and A X = A Y .Then, by eqs. (5-57) and (5-67):
rnax IpI = 1- (n2/4)(l/12) The results are summarized in Table V. The last line of the table shows the potential improvement in convergence rate that SOR possesses over Jacobi iteration. TABLE V Comparison of point iteration methods Mesh size, Ix J
10 x 10
32 x 3 2
1 0 0 x 100
Jacobi iteration m a IpI E = n2/4I2 R(GJ) = - max In 1/11
0.9753 0.0247 0.0250
0.99759 0.00241 0.00241
0.999753 0.000247 0.000247
Method of successive displacement R ( G s o= ) ~R(GJ)
0.0500
0.00482
0.000494
1.638 0.6383 0.4489
1.870 0.8702 0.1390
1.957 0.9565 0.04443
0.4443
0.1388
0.04443
Optimum successive overrelaxation
Popt,f r o m eq. (5-83)
max IWODtI,from eq. (5-84) R(GsoR)opt = -In max lWopt/ 23/2E) R(GSOR)opt Improvement = R(GmR)opt/R(GJ)
17.97
57.61
180.1
The advantage of selecting the optimum (3 when using SOR is obvious. Unfortunately, as can be seen from Fig. 25, it depends very critically on having a good estimate for max 1 p I, and this is hard t o come by for problems more complex than those involving uniform A X and A Y in a rectangle. One rule to follow in estimating Poptis t o try t o be on the high side, as can be seen from the curves for ( w I vs. 0. Some discussions of the problem of choosing Poptare given by Young (1962, 1971) and Forsythe and Wasow (1960).
112
Effects of anisotropy and boundary conditions on convergence rate of SOR Inasmuch as the rate of convergence of SOR is directly related t o the rate of convergence of Jacobi iteration, we can immediately assess the effects of anisotropy and boundary conditions on SOR. For isotropic problems in a square grid, the above conclusion that Jacobi iteration for problems with Dirichlet boundary conditions converges twice as fast as for problems with Neumann boundary conditions leads t o the conclusion, via eq. (5-87), that optimal SOR will also converge faster, but only by a factor of 2;.For problems with Dirichlet boundary conditions, anisotropy should not significantly affect the rate of convergence of SOR. On the other hand, just as for Jacobi iteration, we can expect that anisotropy will significantly slow down the convergence of SOR when Neumann boundary conditions are used.
LINE RELAXATION METHODS
Introduction The previously described point-iteration methods are also called explicit is solved methods because, in each step of the process, one unknown, P;,+’, for explicitly. An implicit method is one in which several unknowns at adjacent points are solved for simultaneously. These are referred to as block iterative methods. The most important example of this is where all the points on a line are solved for simultaneously. We can again distinguish two classes of processes, simultaneous displacements and successive displacements. Line simultaneous displacements (line-Jacobi) In the present discussion we take our lines t o be columns (i.e., constant x). For simultaneous displacements by columns, all the unknowns on the ith
2 , . . . , P l ,J , are solved for implicitly. Thus, instead of eq. column, Pi, Pi, (5-29), the iteration equation is:
pF1+l= ( A WijPF-l,j
;, (5-88) + A E i j P f ++l ,ASijP,",?tl+ A N i j P f ,+J Qij)/dij
In this method, the order in which the columns are solved is immaterial. For each column, the equations form a tridiagonal system. We have already considered the solution of such equations by the tridiagonal algorithm in Chapter 3. Using that algorithm, the computing labor per line is directly proportional to the number of points on the line, so that the work
113
required for one line-Jacobi iteration should be only slightly greater than that required for one point-Jacobi iteration.
Linesuccessive overrelaxation (LSOR) Analogous to point successive relaxation, we consider solving the columns in sequence, and use the newest values of the unknowns in the equations for the next column. Then the LSOR equation (without overrelaxation) would be :
P*. I1 = (AWijPf-*/,j + A E i j P f ++l ASijP:,j-l ,j + ANijPY,,,, f Qij)/dij (5-89) Again, the extrapolation equation is:
+
P?+’ = Pfj p ( P t- P $ )
(5-90)
but this is not applied until after eq. ( 5 - 8 9is) solved for the entire line.
Convergence rateof line-Jacobi iteration WithNeumannboundary conditions The potential improvement of line iteration over point iteration can perhaps best be illustrated by harmonic analysis of the convergence rate for the line-Jacobi method. Again we assume the simplified case that A X and A Y are uniform, and that d i j= 2 ( A X + A Y ) Then . the error equation corresponding t o eq. ( 5 - 8 8can ) be written:
2(AX)EE.+’ = 2(AX)E; + (AX)6:EE, + (AY)6;Efj+l Again, we assume that the error is a sum of components, where each component is a product of cosines, as in eq. ( 5 - 4 8Then, ) . upon substitution of eqs. ( 5 - 4 8()5,- 4 9and ) ( 5 - 5 0we ) ,have for each component:
SAX(yF,’’ - y Pk4 ) = - 4 A X y i qsin2 ( p 7 ~ / 2 I4AYy::’ ) sin2 ( q n / 2 J ) Thus :
(5-91) We shall see later that the case of A X S A Y is not of interest, since line iteration by rows rather than by columns would then be used. In searching for the maximum eigenvalue, p , we consider again the same combinations of p and q as we examined for point-Jacobi iteration. In each case, I and J are assumed large. For the various combinations, eq. ( 5 - 9 1reduces ) to
( p= I, q = 0 ) p :l,= o 1 - 2 sin2 ( n / 2 1x) 1 - ( n ’ / 2 1 ~ )
(5-92)
114
( P = 094 = 1):110,l =
1 __ 1 + 2 ( A Y / A X )sin’ ( n / 2 J )
- 1 + ( A Y / A1X ) ( n 2 / 2 J 2 ) ( P = 1,(I = 1):1 1 1 . 1 = 5
(5-93)
1 - 2 sin’ ( ~ 1 2 1 ) 1 + 2 ( A Y / A X )sin’ ( n / 2 J ) 1- (n2/212) 1+ ( A Y / A X ) ( n 2 / 2 J 2 )
x
-1
+ (7?/2I’)
1 + ( A Y / A X ) [ 2- ( n 2 / 2 J 2 ) ]
(5-94)
(5-95)
It follows from the assumptions of A Y 2 AX and J 9 1that the denominator of eq. (5-95) is larger than the denominator of (5-94). Hence p1-,,J - ~is less in magnitude than p l ,I , which in turn is less than po, Thus either po,I or P , , is ~ the maximum eigenvalue, and the rate of convergence is, using eq. (5-68), given by: min [ ( n 2 / 2 1 2 ) ; ( A Y / A X ) ( n 2 / 2 J 2 ) ]
R(G,)
(5-96)
For isotropic problems in a square grid ( A X = A Y ; I = J ) , the convergence rate is:
R(G,)
5
n2/212
(5-97)
which shows, by comparison with eq. (5-59),that line-Jacobi is twice as fast as point-Jacobi when Neumann boundary conditions are used. For highly anisotropic problems ( AY % A X ) , po, will be considerably smaller than c ( ~ , ~ so , that the convergence rate will still be given by eq. (5-97). Comparison with eq. (5-59) shows this t o be a considerable improvement over point-Jacobi, since the convergence rate for line-Jacobi is thus essentially independent of the degree of anisotropy, while that for pointJacobi decreases very significantly. We have yet t o dispose of the anisotropic case where A Y < A X . For this case, eq. (5-96) reduces t o :
R(GU)
5
(AY/AX)(n2/2J2)
indicating a much slower rate of convergence than that gwen by eq. (5-97). For this type of anisotropy, it is clear that the use of columns for the direction of the line iteration is the wrong choice; rather, the points should be solved simultaneously along the rows.
115
WithDirichlet boundary conditions As pointed out in the discussion of point-Jacobi iteration, components with p = 0 or q = 0 are not involved when Dirichlet boundary conditions are specified. Then p , , is the largest eigenvalue in magnitude, and the rate of convergence is given by :
R ( G L J ) ( n 2 / 2 Z 2+) ( A Y / A X ) ( . r r 2 / 2 J 2 )
(5-98)
For isotropic problems in a square grid, this reduces t o :
R(G,)
= n2/12
which, by comparison with eq. (5-61), shows again that line-Jacobi is twice as fast as point-Jacobi. For anisotropic problems, however, eq. (5-98) shows a marked effect of the degree of anisotropy. For large A Y I A X ,the rate is approximately proportional t o A Y I A X ; this contrasts with point-Jacobi, for which we found essentially no effect of the degree of anisotropy when Dirichlet boundary conditions are used. Acceleration of convergence withNeumann boundary conditions
1-Dmethodof additive corrections We have seen in the previous section that, for anisotropic problems with Neumann boundary conditions, line iteration is considerably faster than point iteration, but not as fast as would be the case if Dirichlet boundary conditions were specified. Watts (1971, 1973) proposed using the method of additive corrections t o accelerate the convergence of LSOR for anisotropic problems with Neumann boundary conditions. This method comes close to achieving the convergence rate obtainable with Dirichlet boundary conditions. The combination of LSOR with additive corrections is designated as LSORC. Before we consider LSORC, let us first discuss the method of additive corrections and examine its effect on line-Jacobi iteration. The combination of W with additive corrections is designated LJC. Watts’s method of additive corrections consists in adding to each P in a column a constant, ai, so that a “corrected” value of P f ; h c ’ is used as the starting point for the next iteration. Thus: p;;k+
=
+
ppj+l (yi
(5-99)
The a sare chosen so that the sum of the residuals for each column is reduced t o zero. To obtain the equations for the a s, we write the following two equations for residuals similar t o eq. (5-25):
116
Rfj+l = dijPE+’ - AWijpF-+:vj - AEijP":,- ASijPf9T! I - ANijPF,j: - Qij R;;"’ = d..PC,sk+l 11 1J - A W i j Pci, -k +ll-, Ai E i j Pc ,ik++ll-,AjS i j Pc ,ik,+jl-A lN~~P;;~~’
(5-100)
- Qij
Combining with eq. (5-99) gives:
+
R:;"’ = RYj+’ - A W i j ~ i -( l d i-ASij j - A N i j ) a-i A E ~ , c Y ~ + , Then the condition that the sum of residuals in a column be reduced t o zero, 1.e.: J
1 R;;"’ =
0
(5-101)
j=1
leads t o the system of equations: J
J
J
J
which can be easily solved for the a’sby the tridiagonal algorithm given in Chapter 3. To understand why this method of additive corrections accelerates the convergence of line-Jacobi iteration (and also LSOR), we begin by expressing the residuals in terms of the error. Substitute eq. (5-34) into (5-100) and use the fact that PE satisfies eq. (5-24)t o obtain: R;ik+’ = d..EC,’"’’ -AWijEF:;;.l - A E i i E f ; t-ASijE?,f-;’ J1 - A N i j cE,ik, +l j+l 11
11
The assumption that A X and A Y are uniform and that dii= 2 ( A X+ A Y ) yields: ~
;
= -(
~
t
~
+
~~ x ) @ g k + l- ( ~ y ) @ ; j ~ + l
Then, using the error expansion of eq. (5-48) and substituting eqs. (5-49) and (5-50),we have: 1-1 J-1
~ " k + = l 11
4
C
y ; t + l cos ( p d / l cos ) (q?rjVJ)[AX sin' (p.rrl21)
p=o q=o
+ A Y sin2 ( q 7 r / 2 J ) ] The condition that the sum of residuals along a column be zero, eq. (5-101), yields: J
1-1
J-1
j=lp = o q=o
y;$+’ cos ( p d / l )cos ( q r j Y J ) [sin' A X (p77/21)
+ A Y sin2 ( q n / 2 J ) ]
= 0
117
Reordering the summations: I-1 d-1
yi$+’ cos ( p n i ’ / l )sin' [ A X( p n / 2 1 +)A Y sin' ( q n / 2 J ) ]
1
p=o q=o
J *
1
cos (q'lTjl/J) = 0
i=1
But, for q f 0, it can be shown that: J i=l
For q = 0 the sum is, of course, equal t o J. Then: I- 1 P=o
from which it follows that c . k + lYP,O
- 0
(5-102)
In other words, the method of additive corrections annihilates all the components for which q = 0. As a consequence of this, the eigenvalues associated with the q = 0 components d o not need t o be included in the search for the maximum eigenvalue. The maximum eigenvalue of line-Jacobi with correction is thus given by eq. (5-93), and the rate of convergence is given (for large J )by:
R ( G L J C )% ( A Y / A X ) ( n 2 / 2 J 2 )
(5-103)
For large A Y I A X ,we see that this is almost as large as the rate for lineJacobi iteration for Dirichlet problems, given by eq. (5-98). For isotropic problems with Neumann boundary conditions, comparison with line-Jacobi iteration, whose rate is given by eq. ( 5 - 9 6shows ) , essentially no difference. We can conclude that the method of additive corrections provides the most improvement in convergence rate for anisotropic problems, while not causing any change in rate for isotropic problems. Since there are no components involving q = 0 associated with problems using Dirichlet boundary conditions, there is no incentive for applying the method of additive corrections t o such problems. The above analysis, showing that the method of additive corrections annihilates the q = 0 components, is applicable only for Jacobi iteration, and cannot be directly extended t o LSOR. The components (i.e., eigenvectors) for LSOR are not the same as the eigenvectors for LJ. However, Watts (1973) has shown that the q = 0 eigenvectors for LSOR are also annihilated by the method of additive corrections, so that the maximum eigenvalue for LJC can be used t o calculate the maximum eigenvalue for LSORC, as we shall d o in the next section.
118
It would appear sufficient t o apply the additive correction only once, say prior t o the first iteration. In theory, once the eigenvectors for q = 0 are annihilated, they stay annihilated. In practice, as a result of round-off, some of these eigenvectors are reintroduced into the solution during the iteration, so that it is necessary t o perform the additive correction step every several iterations (Watts suggests every ten iterations). Further, the theory is strictly applicable only for the case of uniform AX and A Y ,and experiments with nonuniformly anisotropic problems show that it is necessary t o d o the additive correction step frequently, in some cases as often as every iteration. 2 - 0 methodof additive corrections
It is clear that the one-dimensional additive corrections method described above will have maximum benefit when the anisotropy is completely in one direction, with A Y S A X . In many real reservoir situations such as one-well coning problems, where the radial grid spacing is very small near the well and very large away from the well, the direction of higher transmissibility may vary from one part of the computing region t o another. Thus we may have A Y > A X in one subregion and AX > A Y in another. For such situations, Settari and Aziz (1973) proposed a two-dimensional additive corrections procedure. In its simplest form, their technique can be described as two onedimensional corrections in sequence, one of which reduces the sum of residuals t o zero in one direction (say columns, as described above) followed by another step which reduces the sum of residuals t o zero in the other direction. For the line-Jacobi iteration, this removes all the components involving both p = 0 and q = 0. For LSOR, Watts has shown that one of the sets of eigenvectors is annihilated (either p = 0 or q = 0); the other set is greatly reduced but not completely annihilated (J.W. Watts, personal communication, 1976). Settari and Aziz (1973) have also suggested that the methods of additive corrections have greater generality, in that they can be applied t o other iteration schemes besides line relaxation methods. Convergence rates of LSOR and LSORC Methods similar t o those used for point-SOR can be used t o analyze lineSOR, both without and with additive corrections. Results similar t o eqs. (5-83) and (5-84) are obtained, namely: (5-104
(5-105
119
Further, a result similar t o eq. (5-87) is obtained: (5-106)
2 3 / 2[ R ( G L J ) I e
R(GLSOR )opt
Similar equations hold for LSORC. In particular:
=
~ ( ~ L s O R c ) o p t z 3 l[R(G,)I 2
(5-107)
+
By substituting the various asymptotic rates of convergence already derived for line-Jacobi iterations into eqs. (5-106) and (5-107), the following asymptotic rates of convergence for LSOR and LSORC are easily obtained.
WithNeumannboundary conditions (5-108)
R(GLSOR)optx (27r/Z) min [l;( A Y / A X ) i ( Z / J ) ] R(GLS0RC)opt
=
(5-109)
(2n/WAY/AX)f(W)
Summaryofconvergence rates forpoint and line relaxation methods To facilitate the comparison of the various relaxation methods presented in this chapter, the asymptotic convergence rates are listed in Table VI. To simplify the comparisons, a square grid ( I= J )is assumed. TABLE VI Asymptotic convergence rates, R(G ) , for various relaxation methods. Square grid ( I= J ) , and A Y 2 A X ,are assumed Method
Boundary conditions Neumann
Point-Jacobi ( J ) Line-Jacobi ( L J ) Line-Jacobi, corrected ( LJ C ) Optimal SOR Optimal LSOR Optimal LSORC
Dirichlet
+
-’
( n2/2I2 ,[ 1 ( AYIAX) J n2/212 (n2/2I z ) ( YA /AX) (2n/I)[l (AY/AX)]-+ 2n/I ( 2 n / I ) ( AY / A X ) f
+
nz/2I (n2/212)[1 ( A Y I A X ) ] (nz/212)[1 ( A Y I A X ) ] 2nlI (2n/l)[l ( A Y / A X ) ] t (2n/I)[1 ( A Y / A X ) ] r
+
+
+ +
Examination of this table reconfirms some of the general conclusions already reached. For isotropic problems, Jacobi iterations with Dirichlet boundary conditions converge twice as fast as Jacobi iterations with Neumann boundary conditions, while each SOR method with Dirichlet boundary conditions converges 2”* times as fast as the same SOR method with Neumann boundary conditions, Again for isotropic problems, line-
120
Jacobi iteration converges twice as fast as point-Jacobi iteration, while LSOR converges 2 1'2 times as fast as SOR. Finally, for highly anisotropic problems with Neumann boundary conditions, the table clearly shows the improvements in convergence rates brought about by the use of additive corrections.
ALTERNATING-DIRECTION ITERATION (A.D.I.)
Formulation ofPeaceman-Rach forditeration procedure As discussed in Chapter 3 , the Peaceman-Rachford alternating-direction implicit procedure was first proposed for the solution of unsteady-state, or parabolic, problems. Since the solution of an elliptic problem is the steadystate (or infinite-time) solution of a corresponding parabolic problem, it was soon realized that an altemating-direction approach could be used for solving elliptic problems, wherein each time step corresponds to one step of an iteration. The size of the time step is arbitrary in the approach t o the steadystate solution. Hence, time-step size can be considered t o be an iteration parameter, chosen t o accelerate the convergence of the iteration t o the steady-state solution. The alternating-direction iteration procedure of Peaceman and Rachford (1955), as applied t o the solution of eq. (5-5),is now given. It is analogous to eq. (3-54). Recall that the superscript h indicates the iteration number. The iteration proceeds in two steps: (1)the x-sweep, implicit in the x-direction, wherein the equations for each row of points (i.e., in the x-direction) form one tridiagonal system of equations which is easily solved by the tridiagonal algorithm presented in Chapter 3 ; ( 2 ) the y-sweep, implicit in the y-direction, wherein the equations for each columnof points (i.e., in the y-direction) also form a tridiagonal system of equations which is easily solved. x-sweep :
AXi+;,,(PF++:,, -Pfj") - A X i - + , j ( P ?j+ Pk+’ ’I - I , j ) + AYi,j++(P?,j+l -Pt’) -A
Yi,j-+(PE - P;,,-’ ) -tQ i j = SijPk(P;.+’ -P t . )
(5-111)
y-sweep : AXi++,j(PF::,j - PFj+’) - A X i - + , j ( P ?-jPk+l + Il- 1 , j ) -AYi,j-;(P;’2 - P ki ,+j -2l )
+ AYi,j+;(P?,f:, - P?,")
+ Qij = Sij/3h(P:.+2- P;’")
(5-112)
Oh, the iteration
parameter, corresponds t o the reciprocal of the pseudo-timestep size. The subscript, h , on indicates the possibility of changing that parameter for each double sweep. Sij is a "normalizing factor" defined by:
(5-113)
121
The necessity for such a normalizing factor can be seen from the situation where A X and A Y are equal and constant. In that case, we should like the result of applying eqs. (5-111) and (5-112) t o depend only on P k and t o be independent of the constant chosen for A X and A Y . The matrix formulation of eqs. (5-111)and (5-112) is obtained by splitting the coefficient matrix into a “horizontal” matrix H and a “vertical” matrix V:
A = H+V
(5-114)
where H contains only terms involving A X , and V contains only terms involving A Y . In addition, let us also define the diagonal matrix D whose Then the matrix formulation of eqs. elements consist of the terms Sij. (5-111) and (5-112) is: (5-115) (5-11 6 ) While alternating-direction iteration has been found very useful for solving elliptic problems, even under rather general conditions, mathematical analysis of the method has been somewhat limited and requires various simplifying assumptions. For example, if the matrices H and V commute, i.e., if:
HV = VH
it can be demonstrated that the procedure will converge for any sequence of parameters, P k . The most common situation, where A X and A Y are not constant but vary with x and y , leads t o noncommutivity of H and V,and it is indeed possible to choose sequences of P k that will cause the alternatingdirection iteration t o diverge. It has been shown, however, for any matrices H and V (commutative or not), that alternating-direction iteration will converge for any single parameter 0. The convergence will be extremely slow, however, and it has been found, both by experiment and by analysis, that a judicious choice of a sequence of parameters P k will greatly accelerate the convergence. A more complete discussion of altemating-direction iteration may be found in Varga (1962) o r Young (1971). Convergence analysis Choice of parameters W e can analyze the convergence of A.D.I. by harmonic analysis, provided we assume that AX and A Y are constant (though not necessarily the same). Then eqs. (5-111) and (5-112) may be written: (AX)6ZP:”
( A Y ) 6 ; P : 4-Qij = sPk(Pfj-P;j)
(5-11 7 )
122
(AX)G;PFj"+ ( AY )6;PFjc2 + Qij = spk(PFj"- Pfj")
(5-118)
+
where S = 2 ( A X A Y ), and 6: and 6; are the second-difference operators defined by eqs. ( 5 - 4 5and ) (5-46). Let P r be the solution after convergence. Then:
( A X ) 6 2 P Z+ ( A Y ) 6 ; P+r Q i j= 0
(5-119)
The error at each point is defined by eq. ( 5 - 3 4 Substitution ). of eqs. ( 5 - 3 4 ) and ( 5 - 1 1 9into ) eqs. ( 5 - 1 1 7and ) ( 5 - 1 1 8gives ) the following error equations:
(AX)S,ZE;+’ + ( A Y ) 6 : E := spk(Erj"-Epj)
+
(AX)62Efj" (AY)6;E;" = S/3k(EFj’2 - EFj+’)
(5-120) (5-121)
We proceed with the harmonic analysis t o examine the convergence in a manner similar t o that which we used for the Jacobi iteration methods. We shall assume Neumann boundary conditions, and use the error expansion of eq. ( 5 - 4 8 where ), each component is a proGuct of cosines. Then, upon substitution of eqs. ( 5 - 4 8 ( )5 , - 4 9 and ) , ( 5 - 5 0into ) eqs. ( 5 - 1 2 0and ) ( 5 - 1 2 1we ), have for each component: -
4AXy;:’sin' ( p n / 2 1-)4 A ~ y :sin2 , ( q n / B J=) Sok(y::’ -y i q )
-
4AXy:,+’ sin' ( p n / 2 1 -)4AYyi,"sin' ( q n / 2 = ~ )s/?k(y:,'2 - 7::’)
These equations can be solved, respectively, for the ratios yE:'/y:q and yi:2/yi:', which can then be multiplied together t o give:
(5-122) where :
x,=
2AX sin' ( p n / 2 I ) AX+AY
(5-123)
Y,=
2 AY sin' ( q n / 2 J ) AX+AY
(5-124)
Now p can take on the values 0, 1, 2 ,. . . , I - 1, and q can take on the values 0 ,1, 2 ,. , . , J - 1. Ideally, we could try t o pick o h in such a way that some components will vanish for each k . For example, all the components E ,, 9 (Le., p = 1)will vanish for:
pk
= x
'
=
2AX sin' ( n / 2 1 ) A X t A Y
Let us therefore consider a sequence of parameters:
123
p
12
= x = A X2 +A XA Y
sin2 (p.rr/21), p = 1, 2 ,3 , . . . , I -1
(5-125)
(Note that for strictly elliptic problems arising from incompressible flow = 0, as that will cause division by zero at the problems, we cannot choose end of each line in the tridiagonal algorithm.) This sequence of parameters would annihilate all components for which p 2 1and q > 0. Components for which p = 0 would not be annihilated; for this we could choose another sequence of parameters:
pk = y
‘
=
2 AY sin2 ( q r / 2 J )q, = 1,2 ,3,. . . , J - 1 AX+AY
(5-126)
This would annihilate all components for which q > 1and p 2 0. This leaves only the component for which p = 4 = 0. We see from eqs. (5-122)-(5-124) that for any choice of >0 :
1 As already pointed out in the discussion of point-Jacobi iteration, the p = 0. q = 0 component corresponds t o the arbitrary constant of integration for an elliptic problem with Neumann boundary conditions, and the fact that it cannot be reduced o r annihilated is of no consequence. As a practical matter, we do not actually attempt t o annihilate specific components. High-frequency components which might be annihilated at one stage of the iteration would reappear due t o round-off error. Furthermore, the above analysis is highly idealized because of the restrictive nature of the assumption of uniform A X and A Y . Consequently, we merely use eqs. ( 5 - 1 2 5and ) ( 5 - 1 2 6as)indicative of the “spectrum” that pk should cover. We assume that I and J are sufficiently large that approximations may be used for the sines. Thus we have that p k should span the two intervals: Y!,+2/Y!,O
m, =
=
2AX ( r 2 / 4 1 2 )< AX+AY
< A X2 AfXA Y [l - ( r 2 / 4 1 2 =) ]m,
(5-127)
and : m3 =
2 AY 2 AY (.rr2/4J2) < Pk < [l - ( n 2 / 4 J 2=) ]m4 ( 5 - 1 2 8 ) AX+AY AX+AY
It may be that these intervals are not disjoint, in which case we may choose the interval: m5 GOk < m 6 where : ms = m i n ( m , , m 3 ) m6
=
max(m2,m4)
(5-129)
124
It is the customary practice t o use for Pk a geometric sequence that spans the and to apply the same sequence several times until coninterval ( m 5 , m 6 ) , vergence is obtained. The sequence which is repeated is referred t o as a cycle. If the intervals ( m ,m,, ) and ( r n 3 , m 4 ) are disjoint, we may wish t o choose a cycle to be the union of two geometric sequences that span the respective intervals. Not much more is known about picking parameters in this case. Optimal parameters and convergence rate for ideal case In the ideal case where A X and A Y are constant and equal, and a square grid ( I= J ) is used, it is possible t o derive an optimal set of parameters and to estimate the associated rate of convergence. Let s be the number of iterations (i.e., double sweeps) per cycle. Within each cycle, we use a sequence of parameters: 01,
02,
*
.*
9
Ps
Then the reduction in each error component over the entire cycle is given by the product: Y Pk +9 2 s/ Y Ph Q
-
b
r=l [(Or - x p ) / ( o r
+ x p ) l
[(Or-
yq)/(Pr
+
y q ) ~
(5-130)
We want t o choose an optimum set of parameters so as t o minimize the function :
(5-131) This function corresponds t o the average error reduction per double sweep. As a consequence of the idealizations that A X = A Y and I = J, X p and Y q span the same spectrum, so we can instead look at minimizing the simpler function :
(5-132) Although X p takes on discrete values, we can approach this as a continuous problem, where X is a continuous variable lying in the interval:
rn, = (n2/4P) < x < 1- (7?/412) = m ,
(5-133)
So now we seek t o minimize the function:
\
fi
m,m Q Xm Qm, r=l l ( o r - x ) / ( o r
2IS
(5-134)
+x)4
This is a difficult problem. An exact treatement using elliptic functions, due t o Wachspress and Jordon, is described by Young (1971, p. 522). An almost optimum method of choosing the is t o use the geometric sequence:
or
125
or =
(5-135)
. . . ,s
I ? Z ~ ( I ? Z ~ / ~ ~ ) ( ~ - r~ )=’ (1, ~ 2, - ~ ) ,
where s 2 2.These are known as the Wachspress parameters. To estimate the convergence rate using these parameters, we first consider a cycle of fixed length, s. Then the error reduction over the entire cycle is given by the function:
where:
ps(x) =
ii
r=l
I(Pr
- x ) / ( P r+ x)l
Divide the interval (rn
,, m 2 )into the s
(5-137) -
1subintervals:
/ 3 r < X < P r + lr,= 1 , 2 , . . . ,s - 1 Since the factors in the product are less than unity (and since s > 2), we can write :
ps(X) lBij + Dij F i j H i jI), then an ah= 1should be included in the cycle. Stone found that changing the order of points in alternate iterations greatly improves the speed of convergence. That is, in every second iteration, the factorization and forward solution should proceed in the order of decreasing j and increasing i, while the back solution proceeds in the order of decreasing i and increasing j . This has the effect of bringing in two different points, ( i - 1, j - 1) and (i + 1, j + 1) into eq. (5-153), rather than the points (i + 1,j - 1)and (i - 1,j + 1). The S.I.P. algorithm presented above is, of course, limited t o the solution of two-dimensional problems. Weinstein e t al. (1969) have extended the algorithm t o permit the application of the strongly implicit procedure t o the solution of three-dimensional elliptic problems.
+
+
SUMMARY
Experience shows that for the very simple, or ideal problems, where A X and A Y are almost constant, A.D.I. is the fastest iteration method. For widely varying A X and A Y , for complex-shaped reservoir regions, and/or with very high or low ratios of A Y t o A X , the convergence of A.D.I. deteriorates badly and, in some cases, it has not been possible t o choose iteration parameters t o make it converge. In such difficult cases, S.I.P. converges only a little slower than it does for ideal problems. Further, the use of eqs. (5-171) and (5-172)t o choose iteration parameters is relatively reliable, making the search for good iteration parameters for S.I.P. much easier than for other iteration methods. Line relaxation methods with additive corrections also constitute a viable choice for the solution of difficult problems. Because of the great variety of situations that can be encountered in reservoir simulation, at the present time the most reliable simulators are those which offer the user the choice among direct solution, S.I.P., and LSORC, for the solution of the elliptic problems encountered in the simulation.
135
NOMENCLATURE
Units Some of t h e symbols listed below are defined in terms of SI units, kg (kilogram), m (meter), s (second), N (newton = kg * m/ s 2 ) and Pa (pascal = N /m 2).
Symbols = A = A’ = = AEij = ANi, = ASij AX,++,j= = A Wij AYi,j++ = = = Q
(B+
0-
l)/P
coefficient matrix approximate coefficient matrix “east” coefficient, corresponding t o AXi+;,i “north” coefficient, corresponding t o A Y i , j + + “south” coefficient, corresponding t o A Yi,j-; K X i + ~ , j A y j / ( x i -+x~i ) = transmissibility in x-direction [m 2/Pa* s] “west” coefficient, corresponding t o AXi-+,, K Y i , j + + A x i / ( ~ j- + y j~) = transmissibili,ty in y-direction [m2/Pa * s ] element of lower approximate factor L element of band matrix B = same as - ASi, = element of coefficient matrix A = element of approximate coefficient matrix A‘ = band matrix = element of lower approximate factor L’ = element of approximate coefficient matrix A‘ = diagonal element of coefficient matrix A, o r of lower approximate factor L’ = same as - AWi, = element of coefficient matrix A = element of approximate coefficient matrix A’ = diagonal matrix = element of upper approximate factor U’ = error vector, whose components are E $ = same as di, = diagonal element of coefficient matrix A = error in solution for Pi, after k iterations = diagonal element of approximate coefficient matrix A‘ = element of upper approximate factor U = same as - AEi, = element of coefficient matrix A = element of approximate coefficient matrix A’ = intermediate variable in direct solution algorithm = vector whose elements are gr = element of approximate coefficient matrix A = iteration matrix = same as - ANij = element of coefficient matrix A = element of approximate coefficient matrix A’ = “horizontal” portion of coefficient matrix A; used in A.D.I. = index of grid points or blocks in x-direction = half-index in x-direction, equals i = (-1); = number of grid points o r blocks in x-direction = identity matrix = index of grid points o r blocks in y-direction = half-index in y-direction, equals i = number of grid points o r blocks in y-direction
4
4
136
KX KY 1,s
L L L' m M N P P P
= = = =
= = = = = = =
= = Pi j P,(?i) = P:(X) = 4
=
4
= = =
4 Qij r R Rij
= =
S
= = =
urs
=
S
U U’ uij
= =
V
= =
VP 4
=
~3~
= =
V W W W' X
X XP
= = = = =
=
--
mobility in x-direction [m2/Pa s ] mobility in y-direction [m2/Pa s ] element of lower triangular matrix L length of reservoir (in x-direction) [ m ] lower triangular factor, used in direct solution lower approximate factor of coefficient matrix A limits o n range of A.D.I. parameters general matrix number of equations, equals I * J pressure [ P a ] index in Fourier expansion for error solution vector, whose components are Pi, difference solution for pressure p [ P a ] product of functions of X , defined by eq. ( 5 - 1 3 7 ) partial product of functions of X , defined by eq. (5-138) volume rate of injection ( o r production, if negative) per unit volume of reservoir [s-’ 1 index in Fourier expansion for error input-output vector, whose components are Qij volume rate of injection ( o r production, if negative) for grid block (i, j ) per unit thickness, equals q i , A x i A y , [ m 2 / s ] residual vector, whose components are Rij R(G)= Young's rate of convergence of iteration, defined by eq. (5-52) residual, defined by eq. (5-25) [ m 2 / s ] number of iterations ( o r double sweeps) per cycle normalizing factor used in A.D.I. [m2/Pa s ] element of upper triangular factor U upper triangular factor, used in direct solution upper approximate factor of coefficient matrix A intermediate variable in approximate factorization vector whose components are uij eigenvector element of eigenvector vp4 "vertical" portion of coefficient matrix A ; used in A.D.I. width of reservoir (in y-direction) [ m ] width of band matrix half-width of band matrix, equals ( W - 1 ) / 2 distance [ m ] continuous variable over interval ( m l , m 2 ) 2 A X ( A X A Y ) - ' sin2 ( p n / 2 1 ) distance [ m ]
-
+
Y
=
cr
= iteration parameter = column correction, used in method o f additive corrections [Pa] = overrelaxation parameter in SOR methods; also iteration parameter in A.D.I. and in iterations using approximate factorization = coefficient in Fourier expansion for error = change in Pi, in h th iteration, equals P$+’ - P E [ P a ] = second-difference operator in x-direction, defined by eq. ( 5 - 4 5 ) = second-difference operator in y-direction, defined by eq. ( 5 - 4 6 ) = solution change vector, whose elements are 6 ;
7 7::Q 6r1
6:
6; ijh
137
Axi Ayj
h
r
I-1 w
= x i + ; -xi-; [ m ] = yj+; - y j - + [ m ] = eigenvalue of matrix D - ~ A = special diagonal matrix = eigenvalue of Jacobi iteration matrix = eigenvalue of SOR iteration matrix
Subscripts and superscripts
AD1 C
C
i
i J k k
L opt P 4 r S
SOR m
*
refers to alternating-direction iteration refers to corrected iterate in method of additive corrections refers t o iterative method with additive correction index in x-direction index in y-direction refers t o Jacobi iteration method iteration count summation index in direct solution algorithm refers t o line version of an iteration method optimum index in Fourier expansion f o r error index in Fourier expansion for error row index of a matrix column index of a matrix refers to successive overrelaxation refers t o solution after convergence refers t o intermediate solution (before extrapolation) in SOR methods
This Page Intentionally Left Blank
CHAPTER 6
NUMERICAL SOLUTION OF TWO-PHASE FLOW PROBLEMS
INTRODUCTION
In this final chapter, we shall examine several numerical methods for the solution of multidimensional, multiphase flow problems. For the sake of clarity and brevity of presentation, the discussion will be limited t o the case of horizontal, two-dimensional flow of two incompressible phases with no mass transfer between phases. Of course, current practical resevoir simulators are much more general, in that they include the effects of compressibility, gravity, and some mass transfer (using at least a black-oil system). Further, modern simulators frequently deal with three phases and are increasingly used t o solve problems in three dimensions. The numerical methods used in these more general simulators involve, for the most part, extensions of methods which can be adequately, and certainly more clearly, described in terms of the simpler two-phase incompressible case. It turns out that compressible problems are easier t o solve numerically than incompressible problems. Paradoxically, the equations that describe incompressible flow problems are simpler than those which describe compressible ones, even though incompressible problems present more numerical difficulties and are more interesting from a mathematical point of view. Furthermore, inasmuch as any reliable simulator should be able t o deal with any level of compressibility, down to zero, the numerical procedures must be based on methods which work for the incompressible case.
DIFFERENTIAL EQUATIONS
Basic equations in termsof phasepressures The assumptions of horizontal flow of incompressible fluids imply that pw are constant. In addition, t o simplify matters further, we ignore the possible variation of porosity, 4, with pressure, and of the geometric factor, a ,with position. Then eqs. (1-40) become:
D , p n , and
140
v
[(K~,,/P,)VP,I
*
+ Q,
=
as,
4%
(6-2)
where Q, = qn/p, and Q, = q w / p w are the volumetric rates of injection per unit of reservoir volume. Recall the definitions for phase mobilities (eqs. 1-48): An
= KkrnIPn
A,
= Kk,,/P,
Then eqs. (6-1)-(6-2) may be written:
If we expand the accumulation terms, we get:
as,
-.
- -asw -
at
at
dSn a ~ c dp, a t
st
i”R,n
) ;2
where S = dS,/dp, is considered t o be a unique function of S , (or of p,). Then eqs. (6-5)-(6-6) may be written:
Note that S’,as defined above, is always positive. Alternative equations
An alternative form of eqs. (6-7)-(6-8) is of interest. Define the total mobility and the difference of mobilities by:
X, Ad
X, + A, = A, -- X,
=
In addition, average pressure and capillary pressure are defined by : pa% = ( P n + ~ w ) / 2 -
Pc - Pn-Pw
By adding and subtracting eqs. (6-7) and (6-8), we obtain:
(6-9) (6-10)
141
(6-11) $V * ( h , V p c+)V
aPC
*
( h d v p a v+g Q ) , - Q , = 2@S'__ at
(6-12)
Equation (6-11) could have been obtained directly from the pressure equation (1-49) by using the simplifying assumptions of constant D , p,, p,, a ,and 6. While eq. (6-12) can be considered to be a saturation equation, its relationship t o the saturation equation (1-58)is much less direct. By making use of the concept of total velocity, however, we can use the Buckley-Leverett form of the saturation equation (1-58). The individual phase velocities are, from eqs. (1-38)and the assumption of horizontal flow: +
v, = *
u,
=
(6-13)
- h,vp, -
(6-14)
h,Vp,
and the total velocity is +
Ut =
+
u,
+ v, -
(6-15)
With the simplifying assumptions of constant D , p n , p,, a,and $, together with the substitution of eqs. (1-55) and (1-56), the Buckley-Leverett form of the saturation equation (1-58)becomes: (6-16)
DIFFERENCE NOTATION
Difference operators To simplify the writing of the difference equations, let us reintroduce some difference notation. For each interval of the grid, we define phase mobility coeffients, such as: LNXi+k,j,m
(L)i++,j,m
LWYi,j++,m
( ~ , ) i , , + ; , ~
Then difference operators which serve as the analogs of the derivatives:
are :
(6-17)
and :
AYj
(6-18)
where :
AX^ =
(6-19)
xi+ \ - xi+
(6-20)
Ayj = yj+; -y j - ~
Note the similarity of eqs. (6-17) and (6-18)with (2-19) and (2-20). Finally, it is convenient t o define a combined, or twodimensional, operator: A(LN,APN,) = A x ( L N m A x P N n+)A y ( L N m A y P N n )
(6-21)
which is, of course, the difference analog of the differential operator V * ( L V P n1. Injection-production terms We need t o consider various forms of the injection (or production) terms. Recall that Q, and Q, are volumetric rates of injection (if positive) or of production (if negative) per unit volume of reservoir. Let: Xi+$
mij = f x i 2 2
xi++ Y j + i
~j++
I
Q,cudydx
and:
QTij = [ xi-;
yj-L 2
Q,adydx
yj-’
be the total volumetric rates associated with the gnd point (i, j ) . Actually, injection or production rates are usually not distributed continuously over the area occupied by the block surrounding each grid point but, rather, are associated with wells which may be considered t o be mathematical point and Q T i jrepresent volumetric rates (i.e., sources and sinks. Thus, volume per unit time) associated with a well located at the point ( ij,) . In replacing differential equations with their difference analogs, then, we will replace Q, and Q , by:
mij
QNij= Q h S : j / ( ~ ~ i A y j )
(6-22)
143
Q W i j= Q ~ j j / ( ~ A ~ i A ~ , )
(6-23)
Interval absolute permeabilities We allow for the possibility that the absolute permeability is anisotropic; that is, that K , is not necessarily equal to K,. For each grid interval, we define :
K X i + ; ,=j (K,)i+;,j and KY,,,,; z (K3,)i,j+; These quantities may be input directly by the user, or they may be evaluated from grid-point values of K , and K , which are input by the user. In the latter case, the arithmetic average is usually used, e.g.: K X i + t ,= j [ ( K x l i j + (Kx)j+,,jl/2 although sometimes a geometric average is used, namely : K X i + t ,=j ( K x ) i ( K x ) ; + l , j Mobility weighting For each gnd interval, the mobility coefficients can now be evaluated in more detail. We write:
(6-24) L N X i + t , , ,=m KXj+;,j[(W)(h,n/Vn)ijm + (1- W)(krn/Vn)i+1,j,m I The quantity W is the weighting factor on the mobility. I t is analogous to the distance-weighting factor discussed in Chapter 4 in connection with the solution of the nonlinear convection equation (4-1). W = 4 corresponds t o midpointweighting. The more commonly used alternative is upstream weighting, wherein W is chosen t o be 0 or 1, depending on the direction of the potential gradient in that phase for that interval. For this example, if flow is from left t o right, we use the mobility at the left (upstream) end of the interval and pick W = 1. Similar definitions are made for: L N Y i , j + t , mLWXi+t,j,rn, and 9
L W Y i +,,;j
Note that, at this point, we have not specified m and therefore have not committed ourselves as t o the time level at which the mobilities (kr/p) are t o be evaluated.
Some special combinations In analogy with eqs. ( 6 - 9 )and ( 6 - l o )we , can define the following terms :
L T X j + ; , j= , mL N X j + t , j + , mL W X j + t , j , m L D X i + i , j ,=m L N X j + + , j -, L, W X j + : , j , ,
(6-25) (6-26)
Similar definitions hold for L T Y i ,+,j + and L D Y i ,,; j +. In addition, we
144
use P A i j and PCijt o refer to the difference solutions for p a v gand p c , respectively. Then we can proceed t o define operators, such as:
Ax (LTmAxPA n ), A y ( LDm A ,PCn 1 etc., as well as the combined twodimensional operators, such as:
A(LTmAPA.), A(LDmAPC,) etc. These will be useful in setting up difference analogs of eqs. (6-11) and (6-12).
SIMULTANEOUS NUMERICAL SOLUTION
Explicit difference equations First, let us consider an explicit difference analog of eqs. (6-11)-(6-12):
+ + + QW)ijn= 4A(LT,,AZ’Cn) + A(LDnAPAn) + (QN - QW)ij, A(Z,TnAPAn)&A(LDnAPCn) (QN
0
= 2(@sf/At)ijn(PCi,j,n + 1 -PCijn)
But there is no explicit way t o solve for We can solve directly for PAz,j,n +1! If we write an explicit difference analog of eqs. (6-7)-(6-8), we have: +
A ( L N n M N n )+ QNijn = (@S’/At)ijn(PNi,j,n+l -PNijri - P w i , j , n ++IPWijn) (6-27) A ( I I W n A P W n+ ) QWij,= (@s’/At)ijn(PWi,j,n+~ -PWijn - P N i , j , n++PNijn) ~ (6-28) It is clear that these equations are inconsistent. The right-hand side of eq. (6-27) is the negative of the right-hand side of (6-28); two separate answers can thus be obtained for the explicit calculation of the change in capillary pressure, i.e., for: PCi,j,n+l -PCijn = (PN-PW)i,j,n+I -(PN-PW)ijn while it is not possible t o calculate the changes in PW or PN themselves. Hence, we must rule out any such simple approach as these totally explicit procedures. Alternating-direction implicit procedure Next, we consider an alternatingdirection implicit procedure that is an extension of the A.D.I. method of eqs. (3-54), which was used t o solve a parabolic problem in one dependent variable. For this purpose, eqs.
145
(6-7)-(6-8) are exactly equivalent t o eqs. (6-11)-(6-12). It will be more convenient for analysis t o work with the latter pair. The A.D.I. difference equations are, then, for the horizontal sweep: A x ( L T , A x P A , ++ A,(LT,A,PA,)+ $Ax(LD,A,PCn+ + ~ A , ( L D n A y P C n )
+ ( Q N + QW)ij,
1
0
(6-29)
+ Ax(LDnAxPAn+ 1 ) + Ay(LDnAyPAn) i A x ( L T n A x P C n ++l $Ay(LTnAyPCn) )
+ (QN-QQW)ijn= 2(@S’/At)ij(PCi,j,n+l -PCijn)
(6-30)
and for the vertical sweep:
Ax ( L T nA x p ~+n1 )
+ Ay(LTnAyPAn+ 2 ) + l a x(LDnAxPCn + 1 )
+ iAy(LDnAyPCn+,) + (QN + Qw)ijn=
0
(6-31)
4A.x ( L T nA.xPCn+ 1 ) + i A y ( L TAnyPCn + 2 ) + Ax(LDnAxPAn+ 1 )
+ Ay(LD"AyPAn+,) + (Q:N--Qbv)ijn (6-32) 2(@S’/At)ij(PCi, j ,n + 2 -pCi,j, n + 1) For a von Neumann stability analysis, we will drop QN and QW and assume constant Ax,A y ,4, S’,L T X = L T Y ,and L D X = L D Y . Multiply each equation through by ( A t / 2 @ SLet: ’). =
a
L T X ( A t / 2 @ S= ’ )L T Y ( A t / 2 @ S ’ )
(6-33)
b = L D X ( A t / 2 @ S= ’ )L D Y ( A t / 2 @ S ’ )
(6-34)
=
Then the horizontal sweep simplifies to:
A:(aPA,,+, + i b P C , + ,+) A;(aPA,,+ $bPC,) = 0
(6-35)
+ $aPC,+l)+ A:(bPAn+ ~ u P C , )= PCj,j,fl+l -PCijn A:(bPA,+, and the vertical sweep t o :
(6-36)
A:(aPAn+, + @PC,+,)+ A:(aPAfl+, + $bPC,,+,)= 0
(6-37)
A:(bPA,+, + laPC,.,)+ A;(bPA,,+, + iaPCn+,)= P C i , j , n-+PCi, 2 j ,n + 1 (6-38) We assume that errors of the form of eq. ( 3 - 3 6satisfy ) these difference equations; hence we assume: PAijn= y" exp ( i p i A exp x) (iqjAy) PCijn= $" exp (ipiAx) exp ( i q j A y )
(639) (6-40)
Upon substituting eqs. (6-39)-(6-40) into eqs. (6-35)-(6-38) and cancelling common factors, we obtain, for the horizontal sweep: -
+
Xp(Uyn+l 3 b $ " + ’-) Y,(ay"+
= 0
(6-41)
146 - X,C
'+
+ tat")
by"+ & a ( " + ' ) - Y,(by" and for the vertical sweep:
-X,(ay""
=
t"+I- t"
+ 4bt"")- Yq(ay"+2+ +b,g"+Z)=
-X,(by"+’ + t a t " + ') Y,(by"’2+ i U t " + 2=)
(6-42)
0 p + 2
(6-43)
t"+'
(6-44)
where : = (4/Ax2)sin2 (pAx/2)
(6-45)
Y , = ( 4 / A y 2sin2 ) (4Ay/2)
(6-46)
X,
By multiplying eqs. (6-41) and (6-43) by - b/aand adding, respectively, to eqs. (6-42) and (6-44), we obtain: -
$X,[a- ( b 2 / a ) ] t" +12 ’Y q [ a- ( b 2 / a ) ]= t "t n + l t"
(6-47)
-
i X , , [-a ( b 2 / a ) ] t" +12 ’ y, [ a - (p/a)]t"+’ = ["+2 -t"+'
(6-48)
while eq. (6-48) can be solved for Equation (6-47) can be solved for t"+'/tn, E n + 2 / (I". +Upon multiplying these two ratios together, we obtain: En+*
__ -
tfl
1 - i [ u- ( b 2 / a ) ] X1p- $ [ a - ( b 2 / a )-l Y ,
1 + & [ a - ( b 2 / a ) ] X1p+ + [ a - ( b 2 / a ) l Y ,
(6-49)
Since a > 0 and Ibl < a , then lt"+*/.$"I < 1,and it appears that this method is stable. However, we must also examine y. From eqs. (6-41) and (6-43), we have : ayn+2 + $bt"+2 = ay" + @t"
+
Thus the linear combination, ay i b tremains , constant and does not decay, as we should expect from a stable process. Since eq. ( 6 4 9 ) shows .$ t o be decreasing in magnitude, we should therefore expect that y will increase somewhat in magnitude with each double time step. This means that a simultaneous alternatingdirection implicit procedure cannot be expected t o be stable. It is true that if compressibility were included, then this alternatingdirection implicit method will work for sufficiently large compressibility or, equivalently, for sufficiently small time step. But since we have stipulated that our simulators be sufficiently general t o include small or zero compressibility, we must therefore rule out this approach also.
Simu 1taneo us implicit procedure Since explicit and alternatingdirection implicit methods are not stable for incompressible two-phase flow problems, we must consider other implicit procedures. We examine now a simultaneous implicit procedure, introduced
147
by Douglas, Peaceman and Rachford ( 1 9 5 9 ) which , was the first method t o be used successfully for such problems in two dimensions. Because simultaneous solution for two dependent variables is involved, eqs. (6-7)-(6-8) are exactly equivalent t o eqs. (6-11)-(6-12). It is easier to analyze for stability using the latter pair, although the former pair is more convenient t o use when setting up the solution procedure. Stability analysis The difference analog of eqs. ( 6 - 1 1 ) - ( 6 that 1 2 is ) completely implicit in pressure is the following pair of equations:
+
A(LT,APA.+,) + iA(LD,APC,+,)(QN
+ QW),j,=
0
(6-50)
# A ( L T n u C n ++ , )A ( L D n D A n + ,+)(QN-QW)ijn = 2(GS’/At)ij(PCi,j,n+ 1 -PCijn)
(6-51)
This will, of course, give rise t o a formidable system of linear equations to solve, since there are two equations and two unknowns for every grid point. Let us postpone the discussion of how t o solve this difference system until we examine its stability. For the stability analysis, we use the same approach as used above with the alternating-direction implicit procedure, in that we drop QN and QW and assume constant Ax,A y ,4, S’,L T X = L T Y ,and LDX = L D Y . Multiply each equation through by ( A t / 2 @ S ’Then ) . eqs. ( 6 - 5 0 ) - ( 6 become: -51) (6-52) A:(aPA,+, + ibPC,.,)+ A:(uPA.+,+ ibPC,+,)= 0 A;(bPA,+, + iuPC,.,)+ A:(bPA,+l + ;aPC,+,)= P C , , j , n-PCijn +l (6-53) Again, we assume solutions of t,he form ( 6 - 3 9and ) (6-40). Upon substitutand cancelling common factors, we obtain: ing into (6-52)-(6-53) -
( X ,+ Yq)(ay"+l + i b t " " )= 0
+ Y , ) ( b y "++ ’$I["+')
-(X,
=
(6-54)
t " + '- tfl
(6-55)
Multiplying eq. ( 6 - 5 4by) - b/uand adding t o ( 6 - 5 5gives: ) = En+’ + Y,)[u - (b’/~)]t;"’
-J(X,
-
tfl
or:
t"+
- -
1
< 1 t;" 1 + ; [ a - ( b 2 / a ) ]+ ( XY,) , From eq. ( 6 - 5 4we ) have: -
= -;(b/a)t"+’
Since this should be true for any n ,then:
(6-56)
and :
y"+l-
__
7"
0 and Ibl< a, ( b 2 / ais) less than a, so this ratio is less than one. From eq. (6-82),we can also write:
Hence we can conclude also that:
lyn+l/ynl< 1
(6-84)
Therefore the leapfrog method is stable.
Satu ration creep The leapfrog method has given satisfactory results in a limited number of calculations, although the time truncation error tends t o be somewhat larger than that obtained with simultaneous solution; this, of course, is not surprising. The leapfrog method does give rise t o an anomalous situation where nontrivial changes in saturation take place in regions of the reservoir where there is no injection but where one of the relative permeabilities is zero. This change, which is usually not large but does persist, is known as saturation creep. It is not a physically real phenomenon, of course, and does not occur in simulators using the simultaneous solution method. To understand the origin of saturation creep, we note that if the wettingphase relative permeability is zero (as may be the case in the uninvaded oil zone), then, by eqs. (6-25) and (6-26):
LTX = LDX = LNX LTY = LDY = LNY Upon subtracting eq. (6-78) from (6-79) and taking QN = QW = 0 ,we get:
4A(LN,APC,
+
)
--
i A ( L NAPC, , ) = 2(@S"/At)ij (PCi, j , ,+
- PCij, )
or: (6-85) iA(LNnA[PCn + 1 -pCn I ) = 2($ij/At) (SNi, j ,n + 1 -SNijn On the other hand, if the nonwetting-phase relative permeability is zero (as may be the case in the aquifer), then, by eqs. (6-25) and (6-26):
LTX = -LDX
= LWX
L T Y = - L D Y = LWY Adding equations (6-78) and (6-79) and taking QN = QW = 0 yields:
iA(Lw,APC,+ 1 ) - iA(LW,APCn) = 2(@S’/At)i,(PCi,j,,+ -PCi,,)
156
or: (6-86) !jA(LW n A[PCn+ 1 - PCn 1) = 2 ( 4 i j /(SNi, A t )j ,n + I - SNijn ) If the capillary pressure curve is steep, small fluctuations in saturation caused by round-off error or by incomplete iterations can induce relatively large fluctuations in PC. From eq. (6-85) or (6-86), we see that these spatial fluctuations in PC will induce changes in saturation from one time step to the next. Let us reconsider the simultaneous solution method. For that method, if the wetting-phase relative permeability is zero, we get, instead of eq. (6-85): $A(LlvnA[PCn+ I - PCn + 1 I 1 = 2(4ij /At) (SNi, j , n + 1 - SNijn ) while if the nonwetting-phase relative permeability is zero, we get, instead of eq. (6-86):
fA(LWnA[PCn+ - P,C n + , I )
= 2($ij/At)(SNi,j,n+l -SNijn)
In either case: so that saturation creep cannot occur if simultaneous solution is being used.
Othersequential soiution methods A more popular choice for a sequential solution procedure than the leapfrog method (which involves solving first for PA and then for P C ) has been to solve first for one of the phase pressures (usually the oil pressure) and then t o solve for saturation, either explicitly or implicitly. Examples in the literature are: Fagin and Stewart (1966); Breitenbach et al. (1968); and the first two methods described by MacDonald and Coats (1970). The differential equation for pressure (6-11) is modified so that the dependent variables are one phase pressure and the capillary pressure. Assuming oil is the nonwetting phase, we choose the pressure of that phase t o be a dependent variable. Then we write: ~ a v g=
(Pn
+Pw)/2
= Pn
-
4 ~c
(6-87)
Substitution of eq. (6-87) into the pressure equation (6-11) yields: V (X tV p n )
+ $V
*
[(Ad
- X,)VpC]
+ Q, + Q w
= 0
But:
&-At
=
--A,
so that the pressure equation becomes: (6-88)
157
The difference analog is : (6-89) A(LT,APN,+1) - A(LW,APC,)+ (QN + QW)ij,= 0 which can be solved for P N i , j , fimplicitly l+l by one of the methods of Chapter 5 for solving elliptic equations in one dependent variable. Since the nonwetting phase pressure at the new time level, t n c is l ,now known, the difference analog for eq. (6-8):
A(LW,A[PN,+, -PC,+,]) + QWi,,= - (@3 /At)ij(PCi,,,fl+l - X i , , ) (6-90) can be solved implicitly for the new capillary pressure at each grid point. This method is also subject t o saturation creep when the nonwetting phase relative Permeability is zero (as in an aquifer region). In this situation, we have:
LTX = LWX and LTY = LWY sothat subtraction of eq. (6-90) from (6-89), taking QN = Q W = 0, gives: A(LWnA[PCn + 1 - PCn 1) = (@ij/At) (SNi, j ,n + 1 - SNijn) Again we see that if the capillary pressure curve is steep, small spatial fluctuations in saturation lead t o larger spatial fluctuations in PC; these larger fluctuations in turn induce physically unreal saturation changes from one time step t o the next. Other variations on this sequential method are possible. For example, the wetting-phase pressure can be the unknown in the pressure equation, and the difference analog of eq. (6-7) can be used to calculate the new capillary pressure. In all cases, the significant aspect of the method is that the capillary pressure term is evaluated explicitly in the pressure equation. Combined with implicit evaluation of capillary pressure in the saturation equation, this turns out t o be the source of the anomalous saturation creep behavior. Sequential solution methodusing total velocity Spillette et al. (1973) proposed a sequential simulator based on the use of eq. (6-88) for the pressure equation and a difference analog of the BuckleyLeverett form of the saturation equation, eq. (6-16). The significant innovation is that the total velocity is calculated after solution of the pressure equation, and this velocity is then used for the saturation equation. We shall demonstrate two basic properties of this method, which contribute t o its advantage over other sequential methods. First, the total velocity calculated from the pressures (after solution of the pressure equation) is the same whether the capillary pressure term in the pressure equation is evaluated explicitly or implicitly. Second, when either relative permeability is zero, there is no anomalous saturation creep. Instead of using eq. (6-89) as the difference analog of the pressure differential equation (6-88), let us write the following analog:
158
A(L? ,APN,+ 1 ) - A(LW,APC,)
+ (QN + QW)jj,=
(6-91)
0
The subscript m is used on the capillary pressure term in order that we do not commit ourselves, a t this point, as to whether it is evaluated explicitly or implicitly. Now, for each grid interval, the difference analogs for the components of the phase velocities are by eqs. (6-13) and (6-14):
VNXi+ k,j =
- LNXi+ + , jn, (PNi + 1 , j ,n + 1 - PNi, j ,n + 1 ) / ( X + i1
- Xi)
VNYj,j+k = - LNYi,j+k,n(PN.,. i 1 + 1 , n + 1 - PNi, j ,n + 1 ) / ( Y j 1 + -Yj) Similar expressions hold for VWX,+ ;,j and V W Y,, + +. Comparison with eqs. (6-17), (6-18),and (6-21) gives: A(LNnAPNn+ ,) =
(VNXi+;,jVNXj-;,j) - ( V N Y i , j+V ;N Y j , j - t ) -
h i
AY j
(6-92) We recognize the right-hand side of eq. (6-92) t o be the discrete analog of - V * G,. Therefore, let us designate it by - A ( V N )and , rewrite eq. (6-92) as:
A(LN,APN,+,) =
-A(VN)
Now, while P W i , j , nhas + lnot been solved for, we can obtain it from the solution for the nonwetting-phase pressure by using the equation: PWi,j ,n + 1 = PNi,j,n+I -PCi,j,m Then we can write the following expression for the wetting-phase velocity:
A(VW)=
- A(LW,APW,+,) =
-
A(LW,APN,+,) + A(LW,APC,)
The total velocity for each grid interval is:
VTXi+ ,;
j
=
VNXi+ ,;
j
+ VWXi ,; +
j
VTYj,j+k = V NYj,j+t + VWYj,j+t sothat: A ( V T )= A ( V N )+ A ( V W )
+
A ( V T )= - A ( L N n A P N n + , -)A(LW,APN,+,) A(LW,APC,)
+ A(LW,APC,) A ( V T )= -A(LT,APN,+,)
(6-93)
Substitution of eq. (6-93) into (6-91) gives:
A ( V U = (QW
+ QN)ijn
(6-94)
which we recognize t o be the difference analog of eq. (1-53). Equation (6-94) shows that the values obtained for total velocity are independent of rn; we have therefore demonstrated the proposition that the total velocity is insensitive t o the time level at which capillary pressure is evaluated in the pressure equation.
159
While Spillette et al. chose t o solve for oil pressure in the pressure equation, other choices are possible. In particular, one might solve for the average pressure, using eq. (6-78). In that case, we would define:
PNi,j,n+l = PAi,j,n+l + iPCi,j,m PWi,j,n+l = PAi,j,n+l -iPCi,j,rn and arrive at the same result for the total velocity, namely eq. (6-94), thus showing V T X and V T Y again t o be independent of the subscript on the capillary pressure term in (6-78). Let us now consider the difference analog for the saturation equation (6-16). First, we define interval values for the quantities f, and f w X n : (6-95) j ,m + L wxi+t, j ,m ) FWXi + f,j ,m = L WXi + k,j ,m /(LNXi++, FWYi,j+;,m = L W Y i , j + t , m / ( L N Y i ,+jL+WtY,im, j + t , m ) (6-96) FWLNXi + ; , j ,,= FWX;+i , j , L N X i+ ; , j ,
(6-97)
-
F W L N Yi,j + t, - F W Yi,j +,; L N Y ;,j + ,; , Expressions analogous t o (6-17) and (6-18)are used t o define: A,(FWLNm AxPC,) and A , ( F W L N ,A y P C n )
(6-98)
which may then be added together t o form the two-dimensional operator:
A ( F W L N m U C n ) = A,(FWLNmA,PCn)+ A , ( F W L N m A y P C n )
(6-99)
For the discrete analog of the convection term, we have the operators:
A,(F W , V T ) = (FWXi+ f ,j , V T X i+ ;,j- FWXi - ; , j , V T X i- ,; j)/Axi A,(FWm V T ) = ( F W Y i , j + VTYi,,+;t,m FWYi,j-t,mVTYi,j-;)/Ayj and the combined two-dimensional operator:
A ( F W m V T ) = A,(FW, V T )+ A,(FW, V T )
-
(6-100)
which is the analog of V (fwZt). The difference analog of the saturation equation (6-16) is then:
+ QWij, =
- A ( F W L N n P C m )- A ( F W n V T )
(@ij/At)(swi -SWij,) ,j,n+i
(6-101) Spillette et a l . point out that an explicit treatment of the capillary pressure term (i.e., m = n ) should be used only for easy-to-solve problems; they recommend that in most cases a semi-implicit treatment of the capillary pressure term should be used, wherein:
PCi,j,m= PCijn+ (dp,/dSw)ijn(SWi,j,n+l -SWijn)
(6-10 2 )
(The topic of semi-implicit treatment will be discussed more fully in the next section.) The substitution of eq. (6-102) into (6-101) produces a linear set of
160
equations which, because of the spatial differencing, is implicit in SW.; 1 J , f I + l * Spillette et al. provide several options for the solution of the saturation equation; one is t o treat it as a parabolic equation and take one double sweep of an alternatingdirection implicit procedure; other options are to iterate using S.I.P., or t o use direct solution. Examination of eq. (6-101) shows why this method is not subject to saturation creep when either relative permeability is zero. By eqs. (6-95)(6-98), we have: = L WXj+ + , j , LNXj+t , j , m/ ( L N X+ , +,j,,
FWLNXj++ , j ,
+ L WXi+
k,j,
)
and:
,
-
LWYi,j + i, m LNYj, j + k, rn l(LNYj,j+ +, m + LWYi, j + k,m ) which are zero if either relative permeability is zero. Since these coefficients multiply the capillary pressure differences in eq. (6-lOl),the mechanism for FWLNYi-j,; +
-
producing saturation creep is absent. IRIPLICIT AND SEMI-IMPLICIT MOBILITIES
Limitations resulting fromuseo fexplicit mobilities Up to now, all mobilities have been specified as being evaluated as functions of saturation at the old time level, t,.This is referred t o as the use of explicit mobilities. Simulators based on explicit mobilities are satisfactory for a great variety of field problems, but there are two particular types of problems where they fail badly. One is the coning problem, which involves converging radial flow into a well with small radial increments near the boundary that represents the well. The second is the gas percolation problem, in which gas comes out of solution and rises up through the reservoir. Both of these types of problems involve high velocity in one or both phases. In the coning problem, the high velocity is a result of the converging flow. In the gas percolation problem, high gas velocity is a result of the low gas viscosity and the large density difference between oil and gas. In both cases, unless the time steps are cut t o impractically small values, very large oscillations in the calculated saturations occur in the high-velocity regions. The reason that the stability analyses given earlier in this chapter do not predict this instability (or a severe time-step restriction for stability) is that the mobility was assumed t o be constant; this, of course, is not the case. It is not hard t o perform a stability analysis which does not assume constant mobility, but then it is necessary or desirable t o make some other simplifications. Perhaps the easiest approach is t o start with eq. (6-101). Since highvelocity problems are characterized by the dominance of the convection
term over the capillary pressure term, we shall assume p c = 0. In addition, let us drop QW. Then eq. (6-101)simplifies to: - A(FWnVT)=
(Cbij/At)(SWi,j,n+ 1 -SWijn)
(6-103)
If we further simplify the problem t o one dimension and assume the total becomes : velocity is constant, then eq. (6-103)
(6-104) Assume VTX is positive. Then we see that, except for the additional factor of porosity, & , eq. (6-104) is identical t o (4-7), provided the timeweighting parameter, 0 ,is taken equal to zero in eq. (4-7). We examined the stability of this equation in Chapter 4 and found that it is unconditionally unstable for midpoint weighting ( W = 1 / 2 ) , while for upstream weighting ( W = 1) it is stable provided (4-17) is satisfied. If we include the additional factor of porosity, the condition for stability is then:
VTX(~
)A~
(6-105) @iAXi From this condition it is easy t o see why the time step must be very small, when the velocity becomes very large, in order to prevent oscillatory solutions. The analysis could be extended to two dimensions and include nonzero capillary pressure. The effect of nonzero p c is t o relax the time step restriction somewhat, but we can still expect that the use of explicit mobilities will cause large oscillations in saturation when the flow through any grid block in one time step, i.e.: VTX * At
-___-