122
Basic Reservoir Simulation Lateef Akanji (Ph.D., D.I.C.) Petroleum and Gas Engineering University of Salford [email protected] February 21, 2012

Basic Simulation

Embed Size (px)

DESCRIPTION

Basic reservoir simulation book

Citation preview

  • Basic Reservoir Simulation

    Lateef Akanji (Ph.D., D.I.C.)Petroleum and Gas Engineering

    University of [email protected]

    February 21, 2012

  • 2

  • Contents

    1 Introduction 111.1 The meaning of simulation . . . . . . . . . . . . . . . . . . . . . 121.2 The need for reservoir simulation . . . . . . . . . . . . . . . . . . 121.3 Steps in a simulation study . . . . . . . . . . . . . . . . . . . . . 13

    1.3.1 Setting the objectives . . . . . . . . . . . . . . . . . . . . 131.3.2 Choosing the proper simulation approach . . . . . . . . . 131.3.3 Gathering, collecting and preparing the input data . . . . . 131.3.4 Planning simulation runs . . . . . . . . . . . . . . . . . . 141.3.5 Analyzing, interpreting and reporting the results . . . . . 14

    1.4 Reservoir simulation approach . . . . . . . . . . . . . . . . . . . 14

    2 Mathematical concepts 192.1 Elementary vector analysis . . . . . . . . . . . . . . . . . . . . . 192.2 Vector gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.3 Divergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    2.3.1 Divergence of gradient . . . . . . . . . . . . . . . . . . . 222.3.2 Divergence theorem and the continuity equation . . . . . . 22

    2.4 Matrix methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.4.1 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.4.2 Order of a matrix . . . . . . . . . . . . . . . . . . . . . . 24

    2.5 Matrix operations . . . . . . . . . . . . . . . . . . . . . . . . . . 252.5.1 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    2.5.1.1 Subtraction . . . . . . . . . . . . . . . . . . . . 262.5.2 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.6 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.7 Matrix inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.8 Matrix Eigenvalue problem . . . . . . . . . . . . . . . . . . . . . 272.9 Solution of simultaneous linear algebraic equations . . . . . . . . 28

    2.9.1 Gaussian elimination . . . . . . . . . . . . . . . . . . . . 282.9.1.1 Gaussian elimination - worked example . . . . 28

    2.9.2 Gauss-Jordan method - worked example . . . . . . . . . . 31

    3

  • 4 CONTENTS

    2.9.3 LU decomposition - worked example . . . . . . . . . . . 322.10 Iterative methods . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    2.10.1 Iterative methods - worked example . . . . . . . . . . . . 33

    3 Fundamental equations of flow through porous media 353.1 Laminar viscous flow . . . . . . . . . . . . . . . . . . . . . . . . 36

    3.1.1 Viscous forces . . . . . . . . . . . . . . . . . . . . . . . 363.1.2 External forces . . . . . . . . . . . . . . . . . . . . . . . 363.1.3 Force of gravity . . . . . . . . . . . . . . . . . . . . . . . 37

    3.2 Darcys equation for liquids . . . . . . . . . . . . . . . . . . . . . 373.3 Darcys equation for gases . . . . . . . . . . . . . . . . . . . . . 37

    3.3.1 Turbulent flow . . . . . . . . . . . . . . . . . . . . . . . 383.4 Differential form of Darcys equation . . . . . . . . . . . . . . . 38

    3.4.1 Darcys law for anisotropic porous media . . . . . . . . . 393.5 Equations of state for fluids . . . . . . . . . . . . . . . . . . . . . 393.6 Equations of state for gases . . . . . . . . . . . . . . . . . . . . . 403.7 Continuity Equation . . . . . . . . . . . . . . . . . . . . . . . . . 40

    3.7.1 Single-phase incompressible flow . . . . . . . . . . . . . 403.7.2 Compressible fluids . . . . . . . . . . . . . . . . . . . . . 433.7.3 Ideal gas flow . . . . . . . . . . . . . . . . . . . . . . . . 443.7.4 Real gas flow . . . . . . . . . . . . . . . . . . . . . . . . 44

    3.8 Generalized multiphase flow equation . . . . . . . . . . . . . . . 463.9 Black-oil reservoir simulator . . . . . . . . . . . . . . . . . . . . 48

    4 Reservoir flow geometries and dimensions 514.1 Tank models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514.2 1D models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524.3 2D models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    4.3.1 2D cross-sectional and radial models . . . . . . . . . . . 534.4 3D models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    4.4.1 Spherical flow geometry . . . . . . . . . . . . . . . . . . 564.4.2 Elliptical-cylindrical flow geometry . . . . . . . . . . . . 58

    5 Finite difference methods 595.1 Reservoir grids and boundary conditions . . . . . . . . . . . . . . 62

    5.1.1 Structured grids . . . . . . . . . . . . . . . . . . . . . . . 625.1.1.1 Rectilinear grids . . . . . . . . . . . . . . . . . 645.1.1.2 Curvilinear grids . . . . . . . . . . . . . . . . . 64

    5.1.2 Unstructured grids . . . . . . . . . . . . . . . . . . . . . 655.2 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . 65

    5.2.1 Dirichlet boundary conditions . . . . . . . . . . . . . . . 65

  • CONTENTS 5

    5.2.2 Neumann boundary conditions . . . . . . . . . . . . . . . 695.2.3 Discretization of Boundary Conditions . . . . . . . . . . 715.2.4 Initial Conditions . . . . . . . . . . . . . . . . . . . . . . 715.2.5 Treatment of individual wells . . . . . . . . . . . . . . . 72

    5.3 Application to single-phase flow in 1D . . . . . . . . . . . . . . . 735.3.1 Example: one-dimensional flow system . . . . . . . . . . 765.3.2 Truncation error . . . . . . . . . . . . . . . . . . . . . . 785.3.3 Truncation error in boundary conditions . . . . . . . . . . 79

    5.4 Application to single-phase flow in 2D . . . . . . . . . . . . . . . 805.4.1 Explicit form of the difference equation . . . . . . . . . . 825.4.2 Implicit form of the difference equation . . . . . . . . . . 825.4.3 Matrix form . . . . . . . . . . . . . . . . . . . . . . . . . 835.4.4 Example: two-dimensional flow system . . . . . . . . . . 84

    5.5 Multiphase flow in 3D . . . . . . . . . . . . . . . . . . . . . . . 855.5.1 Implicit Pressure-Explicit Saturation (IMPES) solution method 915.5.2 Simultaneous Solution (SS) method . . . . . . . . . . . . 925.5.3 Example: three-dimensional flow system . . . . . . . . . 94

    5.6 Solution methods . . . . . . . . . . . . . . . . . . . . . . . . . . 955.6.1 Direct methods . . . . . . . . . . . . . . . . . . . . . . . 95

    5.6.1.1 Gaussian elimination . . . . . . . . . . . . . . 955.6.1.2 Band matrix equations . . . . . . . . . . . . . . 96

    5.6.2 Ordering schemes . . . . . . . . . . . . . . . . . . . . . . 975.6.2.1 Standard ordering . . . . . . . . . . . . . . . . 975.6.2.2 A3 and D4 ordering . . . . . . . . . . . . . . . 99

    5.6.3 Iterative methods . . . . . . . . . . . . . . . . . . . . . . 995.6.3.1 Point relaxation . . . . . . . . . . . . . . . . . 99

    5.6.4 Alternating Direction Implicit Procedure (ADIP) . . . . . 1005.6.5 Factorization and minimization methods . . . . . . . . . . 101

    5.6.5.1 Strongly Implicit Procedure (SIP) . . . . . . . . 1025.7 Comparison of direct and iterative methods . . . . . . . . . . . . 103

    6 Compositional simulation models 1076.1 Phase behaviour and equations of state . . . . . . . . . . . . . . 108

    6.1.1 Reservoir fluid characterization . . . . . . . . . . . . . . 1086.1.2 Equations of State (EOS) . . . . . . . . . . . . . . . . . . 1106.1.3 Equation of state for perfect and real gases . . . . . . . . 1126.1.4 Cubic equation of state . . . . . . . . . . . . . . . . . . . 112

    6.1.4.1 Redlich-Kwong . . . . . . . . . . . . . . . . . 1146.1.4.2 Soave . . . . . . . . . . . . . . . . . . . . . . 1156.1.4.3 Peng-Robinson . . . . . . . . . . . . . . . . . 1156.1.4.4 Multicomponents and mixing rules . . . . . . . 116

  • 6 CONTENTS

    6.1.4.5 Virial . . . . . . . . . . . . . . . . . . . . . . . 1176.2 Defining reservoir composition . . . . . . . . . . . . . . . . . . . 118

    6.2.1 Compositional initialisation in a single-phase reservoir . . 1186.2.2 Compositional initialisation in a reservoir with GOC . . . 1196.2.3 Original fluid in place . . . . . . . . . . . . . . . . . . . 1196.2.4 Black oil and compositional models . . . . . . . . . . . . 120

  • List of Figures

    1.1 Stages in carrying out reservoir simulation studies . . . . . . . . . 151.2 Workflow for building a simulation model . . . . . . . . . . . . . 17

    2.1 Cartesian coordiante . . . . . . . . . . . . . . . . . . . . . . . . 202.2 (a) Four neighbouring triangles and quadrilaterals share node C around

    which finite volume is built using finite-element barycenters and mid-points of faces. Finite-elements are subdivided into sectors delimited byfinite-volume facets, f, with outward pointing normals, ~n. (b) 3D finitevolume composed of six pyramid finite elements. . . . . . . . . . . . 23

    3.1 Elemental volume in a region of fluid flow . . . . . . . . . . . . . 41

    4.1 A tank model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514.2 A one-dimensional model . . . . . . . . . . . . . . . . . . . . . . 524.3 A two-dimensional model . . . . . . . . . . . . . . . . . . . . . . 534.4 A cross-section of a two-dimensional model . . . . . . . . . . . . 544.5 A cross-section of a radial r,z coordinate system . . . . . . . . . . 544.6 Areal model in cartesian coordinate system . . . . . . . . . . . . 554.7 Areal model in radial r, coordinate system . . . . . . . . . . . . 554.8 Areal model in curvilinear coordinate system . . . . . . . . . . . 554.9 A three-dimensional model in cartesian coordinate system . . . . 564.10 A three-dimensional radial model grid. re is the reservoir external

    radius and rw is the well-bore radius . . . . . . . . . . . . . . . . 574.11 A spherical geometry . . . . . . . . . . . . . . . . . . . . . . . . 574.12 (a) An ellipse (b) Flow profile (confocal hyperbolas) in a sys-

    tem of equipotential contours (confocal ellipses) passing througha high conductivity fracture . . . . . . . . . . . . . . . . . . . . . 58

    5.1 One-dimensional discretization into blocks . . . . . . . . . . . . . 615.2 Mesh-intersection grid points . . . . . . . . . . . . . . . . . . . . 635.3 Block-centered grid points . . . . . . . . . . . . . . . . . . . . . 635.4 Irregular block-centered grid . . . . . . . . . . . . . . . . . . . . 64

    7

  • 8 LIST OF FIGURES

    5.5 Three common types of meshes include: (a) rectilinear; (b) curvi-linear; (c) unstructured grid with varying element size; and (d)hybrid finite-element mesh showing featureless regions consistingof hexahedra, constrained ones of tetrahedral, and transitions cov-ered by pyramid and prism elements interfacing tetrahedra withhexahedra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    5.6 (a) Dirichlet boundary condition for a mesh intersection grid (b)Dirichlet boundary condition for block-centered grid (c) Neumannboundary condition for a mesh intersection grid (d) Neumann bound-ary condition for a block-centered grid . . . . . . . . . . . . . . . 67

    5.7 Dirichlet boundary condition in a mesh intersection grid system . 685.8 Finite-element mesh of a 30m10m channel geometry show-

    ing a Dirichlet boundary conditions at the inlet and outlet of themodel, a reference slit, the nodes and the velocity fields com-puted at the barycenter of each of the finite-elements (Akanji andMatthai, 2010). . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    5.9 Boundaries for r z systems with a single well of radius rw . . . . 705.10 A typical boundary grid-block in a cross-sectional model . . . . . 715.11 A typical grid-block hosting a vertical well of radius rw and height h 725.12 Finite difference mesh for two independent variables x and t . . . 745.13 Finite difference mesh for three independent variables x, y and t . 745.14 A simple block-centered one-dimensional system composed of

    five blocks with Dirichlet boundary conditions specified at the firstand fifth blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    5.15 Nomenclature for pressure coefficients . . . . . . . . . . . . . . . 825.16 A simple block-centered two-dimensional system composed of

    nine blocks with Dirichlet boundary conditions specified at theblocks 1,2 and 3. The grids are numbered using normal grid or-dering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    5.17 A simple block-centered three-dimensional system composed oftwenty-seven blocks with Dirichlet boundary conditions specifiedat the blocks 1,2,3,10,11,12,19,20 and 21. The grids are num-bered using normal grid ordering. . . . . . . . . . . . . . . . . . 95

    5.18 Standard ordering of model gridblocks (a) 42 and (b) 24 . . . 985.19 Coefficient matrices of (a) 42 and (b) 24 . . . . . . . . . . . 985.20 Ordering of gridblocks (a) A3 and (b) D4 . . . . . . . . . . . . . 995.21 Guidelines for selecting a solution method . . . . . . . . . . . . . 105

    6.1 The Van Der Waals isotherms near the critical point . . . . . . . . 113

  • List of Tables

    3.1 Number of unknowns in the multiphase equation . . . . . . . . . 473.2 Number of auxilliary relations required to solve the equation . . . 473.3 Description of the mass fractions in black oil simulator . . . . . . 483.4 Description of the volume-related parameters in black oil simulator 49

    9

  • 10 LIST OF TABLES

    Recommended texts

    The books that cover much of the material in the class are:

    1. Petroleum Reservoir Simulation by Aziz and Settari (1979)

    2. Principles of Hydrocarbon Reservoir Simulation by Thomas (1981)

    3. Reservoir Simulation by Mattax and Dalton (1990)

    4. Modern Reservoir Engineering - A Simulation Approach by Crichlow (1976)

  • Chapter 1

    Introduction

    The primary objective in a reservoir management study is to determine the op-timum conditions needed to maximize the economic recovery of hydrocarbonsfrom a prudently operated field. Reservoir simulation is the most sophisticatedmethod of achieving the primary reservoir management objective. There are sev-eral reasons for carrying out reservoir studies. These include:

    1. cash flow predictioneconomic forecast of hydrocarbon price is needed in acieving corporategoals

    2. coordinate reservoir management activities

    3. evaluate project performance in order to interpret and understand reservoirbehaviour

    4. determination of model sensitivity to estimated data and to identify need foradditional data

    5. estimation of project life

    6. prediction of hydrocarbon recovery with time

    7. comparison of different recovery processes

    8. plan developmental or operational changes

    9. selection and optimization of project design in order to maximize economicrecovery

    11

  • 12 CHAPTER 1. INTRODUCTION

    1.1 The meaning of simulation

    Simulation involves the application of computer model(s) to understand the be-haviour of a physical process. It is used in carrying out an extensive study of aparticular problem or in confirming an hypothesis. In petroleum engineering, sim-ulation is used to describe the hydrodynamics of flow of hydrocarbon fluid fromthe reservoir through the well-bore and the surface facilities. In reservoir sim-ulation, the basic flow model consists of the partial differential equations whichgovern the unsteady-state flow of all fluid phases in the medium. The input datainto the reservoir simulator is prepared by many different disciplines and all algo-rithms needed to solve the equations are incorporated into the model.

    A simulation exercise is an evolutionary process involving continuous refine-ment based on our conceptual understanding of the entire system. While the im-portance of an accurate reservoir description in a good reservoir simulation studyis so pertinent, we do need to acknowledge the fact that data availability is alwaysa challenge. A better understanding of the system is therefore achieved throughrefinement of the initial data. The outcome of a reservoir simulator would there-fore strongly depend on the quality of the input data.

    1.2 The need for reservoir simulation

    The number of variables that an engineer is faced with, in order to adequatelycapture the whole system is usually enormous. These variables may not be de-fined in an easily definable form but they do exist. Although analytical tools havebeen used in proferring exact solution to approximate problems; they become lesseffective as the complexity of the problems increase. In petroleum engineeringdiscipline, complexity in physical processes is more the rule than exception. Theengineer today is expected not only to determine the best performance based onphysical behaviour, but also to be conversant with the increasing level of inter-action between the economic, regulatory, legal and environmental impact of hisdecisions. The level of complexity in reservoir engineering therefore requires areasonable amount of data to be incorporated into the simulator.

    A reservoir simulation exercise can then provide answers to several intriguingquestions bothering on effective exploitation mechanisms, optimum performanceand improved recovery techniques.

  • 1.3. STEPS IN A SIMULATION STUDY 13

    1.3 Steps in a simulation studyThere are five basic steps in conducting a reservoir simulation study:

    1.3.1 Setting the objectives

    The major objectives of reservoir simulation are in two-folds: one is investigativeand the other is substantive. Investigative objective involves carrying out simu-lation in order to identify specific cause of a problem in a system. For instance,a simulation study that matches well test data for the purpose of determining thedamaged zone around a wellbore is investigative. Substantive objective involvesdeveloping a number of plausible scenarios for a process (e.g., waterflooding) andstudying the system response in an attempt to determine the optimum scenario. Inthis case, a number of numerical exercises must be carefully developed to avoidwaste of time on exercises that may not significantly contribute toward the goal.

    1.3.2 Choosing the proper simulation approach

    The approach to adopt in any simulation study would depend on the reservoircomplexity, the fluid type and the scope of the study. Depending on the complex-ity of the reservoir system and the scope of study, we can choose to conduct thesimulation in 1, 2 or 3-dimensions. Further, the type of fluid(s) involved in thesimulation would determine whether a black oil, compositional, thermal (steamand in situ combustion), chemical (surfactant and polymer), hydrocarbon misci-ble, or CO2 flooding would be appropriate.

    1.3.3 Gathering, collecting and preparing the input data

    In reservoir simulation, one of the most tedious exercise is data gathering, col-lection and preparation. Most times, this requires collaboration among technicalpersonnel with varying levels of expertise. For instance, geological and geophysi-cal data are extremely crucial and needed to be processed in the form that is usefulfor reservoir description. In situations where data are sparse or incomplete, statis-tics or other tools can prove quite helpful. Due to the large volume of data neededto be processed and the likelihood of internal inconsistencies in the data, the en-gineer must have strong organizational skills and sound judgment.

    The time spent in adequately preparing and ensuring internal consistency ininput data can be worthwhile since a great deal of problems can be avoided in theprocess. The engineer should ensure that all inconsistencies are resolved at the

  • 14 CHAPTER 1. INTRODUCTION

    data preparation stage as the presence of inconsistencies can lead to severe sim-ulation problems. Ill-posed problems due to data inconsistency can prevent thesimulator from running. However, when the inconsistencies are burried within thesystem, the simulator may run but yield erroneous solutions. Modern simulatorsand compilers/debuggers have internal checks to detect and flag any inconsisten-cies in the data.

    1.3.4 Planning simulation runsAn engineer must carefully map out the type and number of computer runs thatwill achieve the set objectives at a minimum cost. The number of parametersto be examined as well as the duration of prediction and the type of informationneeded to answer the pertinent questions should be carefully considered. Care-ful planning of computer runs includes not only determining their order, but alsoestablishing a systematic labelling procedure for them. This is particularly im-portant because of the large number of runs usually required and the voluminousamount of information invariably generated for analysis.

    1.3.5 Analyzing, interpreting and reporting the resultsThe analysis of results caps all the steps in simulation studies. The mode of anal-ysis and the presentation of results will depend very largely on the audience forwhom they are meant and the post-processing capability available. Judgement asto how realistic the simulation results are comes with experience and can largelybe based on comparison with laboratory and/or analytic results. The graphicscapabilities currently available on most computers now make it easier to visual-ize information in three-dimension. In addition, graphics features, such as imagerotation and animation, enhance our interpretation and inferential ability.

    The stages in carrying out reservoir simulation studies is shown in Figure 1.1.First is setting the objectives, then choosing the simulation approach followed bypreparation of input data; since the computer program, based on the mathematicalmodel needs input. Then we need to plan the computer runs, analyse the resultsand make necessary inferences.

    1.4 Reservoir simulation approachIn order to understand fluid flow, evaluate the behaviour and predict the perfor-mance of oil and gas reservoirs, the petroleum engineer models the relevant phys-ical and chemical processes by systems of partial differential equations. This

  • 1.4. RESERVOIR SIMULATION APPROACH 15

    Figure 1.1: Stages in carrying out reservoir simulation studies

  • 16 CHAPTER 1. INTRODUCTION

    equations account for mass and heat transfer. They include terms for gravity, cap-illary and viscous forces. Thermodynamic equilibrium conditions determine thenumber of existing phases, their composition and properties. Reservoir simula-tion therefore involves the numerical solution of such systems with a computer,together with appropriate boundary and essential conditions as supplementary re-lationships. A reservoir is a three-dimensional, heterogeneous, anisotropic rockbody, filled up inhomogenously with fluids of different composition. It is evidentthat a reservoir model can only be constructed mathematically.

    The mathematical model consists of constitutive equations (e.g., Darcy equa-tion), balance equations, property functions and constraints. The balance equa-tions combined with Darcys law yield highly non-linear, partial differential equa-tions of mixed hyperbolic-parabolic type. In general, those equations cannot besolved analytically, but can be solved numerically by replacing the differentialequations with difference equations. This process is called discretization (Figure1.2).

    The discretization must start with the construction of an appropriate grid ormesh followed by the setting up of proper algebraic equations. There are twomethods available of discretization: the finite difference and the finite elementmethod. When dealing with mass transfer both methods need a definition of acontrol volume around a grid point. Consequently, they are called the Control Vol-ume Finite Difference (CVFD) and the Control Volume Finite Element (CVFE)method. Both methods reduce the differential equations to a finite-dimensionalsystem of algebraic equations. The discretization method can be based on Taylorseries, leading to finite difference method (FDM), on integral formulation, lead-ing to control volume difference method (CVDE) or on variational formulationresulting in finite element method (FEM). A special variant of FEM is the controlvolume finite element method (CVFE).

    The major requirements in discretization is that the discrete solution has to bea good approximation to the exact solution and the structure of the matrix equa-tion must be such that the solution can be obtained economically.

  • 1.4. RESERVOIR SIMULATION APPROACH 17

    Figure 1.2: Workflow for building a simulation model

  • 18 CHAPTER 1. INTRODUCTION

  • Chapter 2

    Mathematical concepts

    In order to grasp the concepts involved in the formulation and use of reservoirsimulators, it is necessary that we have an adequate knowledge of some basicmathematical tools, particularly the vector analysis and matrix theory.

    2.1 Elementary vector analysis

    From high school physics, we know that a vector is a quantity having both mag-nitude and direction. If we denote a vector by ~v, then its magnitude is denotedby |v|; also called the modulus or norm of~v. Thus, the velocity of a particle P offluid at a point M in a reservoir R is a vector in contrast to reservoir temperatureand density which are scalar quantities and thus, not characterized by directionalproperty (see also Thomas (1981)).

    The direction of a vector ~v in 3dimensional space is specified by its com-ponents in the x, y and z directions. Vector ~v is then the resultant of its vectorcomponents, thus:

    ~v= ~v1+~v2+~v3 (2.1)

    In terms of unit vector, equation 2.1 can be further expressed in terms of unitvectors (~i,~j,~k) each with moduli unity and having directions that are parallel tothe x, y and z coordinate axes, respectively.

    ~v= v1~i+ v2~j+ v3~k, (2.2)

    where |~v1| = v1, |~v2| = v2, |~v3| = v3 and v1, v2, v3 are the scalar componentsof~v.

    19

  • 20 CHAPTER 2. MATHEMATICAL CONCEPTS

    Figure 2.1: Cartesian coordiante

    Regardless of the position~v occupies in space, its representation would still begiven by its scalar component as given by equation 2.2. A vector can therefore bedefined simply as an ordered triple of numbers thus;

    ~v= (v1,v2,v3) (2.3)

    The collection of all such vectors is referred to as 3dimensional Euclideanspace, E3, if for vectors ~x = (x1,x2, ...,xn) and ~x = (y1,y2, ...,yn), the followingvector addition and subtraction are also true:

    1. commutativity~x+~y=~y+~x (2.4)

    2. associativity~x+(~y+~z) = (~x+~y)+~z (2.5)

    3. nullity

    ~x+(~y) =~0~x+~0=~x

    (2.6)

    This concept can be generalized to a collection of ndimensional Euclidean(En) space vectors (where n> 3); which is an abstract one. It is not possible to dis-play pictorially. The dimension of a Euclidean space should not be confused withthe dimensionality of a reservoir which modelled at most in 3dimensions. In or-der words, a Euclidean space is not the spatial configuration we assign to a reser-voir. Rather, it is a mathematical entity that provides us a framework within whichwe can discuss the numerical solution of a reservoir engineering problems. Thus,the computation of pressure at nordered points in a reservoir can be thought ofas finding the solution vector (p1, p2, p3, ..., pn).

  • 2.2. VECTOR GRADIENT 21

    Scalar multiplication of a vector can also be considered thus: if is a scalarand ~a = (a1,a2, ...,an) then, ~a = (a1,a2, ...,an). Furthermore, ~a = ~a ,(~a+~b) = ~a+~b and ( + )~a = ~a+~a, for another scalar . All vectorsin a Euclidean space satisfying these properties of scalar multiplication constitutea vector space.

    The dot or inner product of two vectors~a and~b is given by:

    ~a ~b= (a1b1+a2b2+ ...+anbn), (2.7)

    ~a ~b= |a||b|cos , (2.8)where is the angle between ~a and ~b. Notice that the dot products of vectorsresults in a scalar quantity (i.e. scalar product). If~a ~b= 0 then we say~a and~b areorthogonal. The cross-product or vector product on the other hand can be definedsuch that a vector rather than a scalar quantity is obtained. It is particularly usefulin describing those processes characterized by rotational flow. Such regimes aregenerally negligible in global reservoir problems.

    The length or norm of a vector is given by

    |~a|= (~a ~a)(1/2), (2.9)

    2.2 Vector gradient

    Let (x,y,z) be a scalar function such that x ,y ,

    z are continuous at some

    point M in R. Physically, these represent rates of change with respect to distancein each of the coordinate directions x, y and z. The gradient of is given by

    =x

    ~i+y

    ~j+ z

    ~k (2.10)

    The scalar field whose gradient is is referred to as the potential of thevector field . The corresponding surfaces Sc are equipotential surfaces. Simu-lation engineers are often confronted with the determination of potential distribu-tions or the potential gradients, throughout the system. The potential gradient has the following important properties: (1) It is a vector function, (2) Its direc-tion is in the direction of maximum increase of , (3) It is always perpendicularto the equipotential surface, Sc, defined by (x,y,z) = c (4) It remains invariantunder a coordinate transformation.

  • 22 CHAPTER 2. MATHEMATICAL CONCEPTS

    2.3 DivergenceThe divergence of a velocity vector~v(x,y,z) at a point M in 3space is given by:

    div|~v|= ~v=(x~i+

    y

    ~j+ z~k) (v1~i+ v2~j+ v3~k), (2.11)

    ~v= v1x

    +v2y

    +v3 z

    (2.12)

    The divergence of a vector is a scalar quantity and remains invariant under acoordinate transformation.

    2.3.1 Divergence of gradientThe divergence of the gradient of can be written as:

    div (grad) = =

    (x~i+

    y

    ~j+ z~k)(x

    ~i+y

    ~j+ z

    ~k)

    = 2x2

    + 2y2

    + 2 z2

    2, (2.13)

    where 2 = 2

    x2 + 2y2 +

    2 z2 is the Laplacian operator.

    2.3.2 Divergence theorem and the continuity equationThe divergence theorem, also known as Gausss theorem is a theorem in vectorcalculus that relates an integral over a volume V to an integral defined on its sur-face, S, thus

    V ~vdV =

    S~v d

    =S~v ~ndS (2.14)

    where~v is a velocity vector in V , dV is a differential element of volume in V, dis a directed element of surface = ~ndS and ~n is an outward unit vector normal tothe scalar surface element, dS, see Figure 2.2. Considering the fluid flux q = ~vat a pointC, then

  • 2.3. DIVERGENCE 23

    V (~v)dV =

    S~v d

    =S~v ~ndS (2.15)

    Figure 2.2: (a) Four neighbouring triangles and quadrilaterals share node C around whichfinite volume is built using finite-element barycenters and midpoints of faces. Finite-elements are subdivided into sectors delimited by finite-volume facets, f, with outwardpointing normals,~n. (b) 3D finite volume composed of six pyramid finite elements.

    Since ~v ~n dS= |~v| |~n dS|cos = dS |~v| cos ,where is the angle betweenvectors~n and~v, then ~v ~n dS physically represents the component of the fluid fluxescaping fromV through the element of surface dS in the direction of the outwardnormal. Therefore the integral of this quantity over the entire surface of V can bewritten as

    S~v ~n dS=

    V t

    ()dV, (2.16)

    or combining Equation 2.15 and 2.16, we can write

    V (~v) dV =

    V t

    ()dV, (2.17)

    Since V is an arbitrary volume, it follows that

    (~v) = t

    (), (2.18)

    which is known as the continuity equation and basically depicts the law of con-servation of mass at a pointC in V.

  • 24 CHAPTER 2. MATHEMATICAL CONCEPTS

    2.4 Matrix methodsA matrix is simply a rectangular array of elements arranged in horizontal rowsand vertical columns.

    2.4.1 Matrices

    Examples of matrices are:

    X=

    1 4 12 0 23 2 3

    , Y=1 30 05 2

    , Z=[ 1 0 ]

    (2.19)

    2.4.2 Order of a matrix

    We say a matrix is of order mn if it consists of m rows and n columns. A matrixis said to be a square matrix of nth-order if m= n. In general, an mnmatrix willbe denoted by

    X=

    a11 a11 ... a1na21 a22 ... a2n. . .. . .. . .

    am1 am2 ... amn

    (2.20)

    which be simply written as X= [xi j]; meaning X is a collection of elements withrow index i and column j.

    The collection of elements X= [xi j] is called the main diagonal of the matrix.If all the elements of X are zero with the exception of the diagonal matrix, then Xis called a diagonal matrix i.e.

    X=

    x11 0

    ..

    .0 xnn

    (2.21)If xii = , a constant for all i then X is called a scalar matrix and a scalar identitymatrix I results when = 1.

  • 2.5. MATRIX OPERATIONS 25

    A lower triangular matrix, L, is a square matrix where xi j = 0, for i< j, whilean upper triangular matrix, U, has elements xi j = 0 for i> j

    The transpose of a matrix X= [xi j] is denoted by XT = [x ji], e.g.

    X=

    x11 x11 ... x1mx21 x22 ... x2m. . .. . .. . .

    xm1 xm2 ... xmm

    , XT =

    x11 x21 ... xm1x12 x22 ... xm2. . .. . .. . .

    x1m x2m ... xmm

    (2.22)

    A square matrix X is said to be symmetric if X = XT. If X = XT, then it isskew symmetric. It should be noted that the vector v = (v1,v2, ...,vn) is a 1 n(i.e. row matrix). Similarly, vT its transpose,

    vT =

    v1v2...vn

    (2.23)

    is an n 1 column matrix. Further, the rows and columns of an n n matrix Xare are known as the row vectors and column vectors respectively, since each isan ordered ntuple of elements.

    2.5 Matrix operationsGiven two matrices

    X=[2 01 1

    ], Y=

    [3 10 2

    ](2.24)

    we can define some essential operations involving matrices thus;

    2.5.1 Addition

    X+Y=[2+3 0+11+0 1+(2)

    ]=[5 11 3

    ](2.25)

  • 26 CHAPTER 2. MATHEMATICAL CONCEPTS

    2.5.1.1 Subtraction

    XY=[23 0110 1 (2)

    ]=[1 11 1

    ](2.26)

    2.5.2 Multiplication

    XY=[2 01 1

    ][3 10 2

    ]=[2(3)+0(0) 2(1)+0(2)1(3)+1(0) 1(1)+1(2)

    ]=[6 23 3

    ](2.27)

    2.6 DeterminantsA determinant is a single number that we associate with a square matrix X :

    det(X) =

    x11 x21 ... xm1x12 x22 ... xm2. . .. . .. . .

    x1m x2m ... xmm

    = |X|. (2.28)

    To compute the |X|, we consider the minor and the cofactors. The minor of asquare matrix X is the determinant of any square submatrix of X obtained byremoval of equal number of rows and columns. The cofactor of the element xi jis a scalar obtained by multiplying together the term (1)i+ j and the minor Mijobtained by eliminating the ith row and the jth column. A general determinant fora matrix X has a value

    |X|=k

    i=1

    xi j =k

    i=1

    xi jCi j (2.29)

    with no implied summation over j and whereCi j is the cofactor of xi j defined by

    Cij (1)i+ jMij (2.30)

    2.7 Matrix inverseThe inverse of an nn matrix is a square matrix B satisfying

    XX1 = X1X= I (2.31)

  • 2.8. MATRIX EIGENVALUE PROBLEM 27

    If |X| 6= 0 then X1 exists and X is said to be invertible or nonsingular. If, on theother hand, |X | = 0, then X1 will not exist and X is singular. This is particu-larly useful when solving simultaneous algebraic equations for instance, given thefollowing set of simultaneous equations;

    5x3y+2z = 14x+ y4z = 77x3z = 1, (2.32)

    we can solve for x, y, and z in terms of a matrix equation Ax= b, where A is thecoefficient of the matrix.

    A=

    5 3 21 1 47 0 3

    x=xyz

    b=147

    1

    (2.33)Since |A| 6= 0, A is nonsingular and the solution vector x can be found by premul-tiplying the matrix equation by A1, i.e.

    A1Ax = A1bIx = A1bx = A1b (2.34)

    2.8 Matrix Eigenvalue problemMost times we are faced with a problem of the form

    Ax= x (2.35)where A is nth order matrix, x is a nonzero vector and is a scalar. For a givenmatrix A, we want to find those numbers such that a matrix multiplication of avector x yields the same thing as the scalar multiplication x. This is known as aneigenvalue problem where is an eigenvalue and x is its associated eigenvector.This can also be written as:

    (A I)x= 0 (2.36)This corresponds to a homogeneous set of n algebraic equations in n unknowns.The trivial solution x= 0 is excluded since x is restricted to the nonzero values. Itcan be shown that nontrivial solution solutions will exist if and only if |A I|=0. The expansion of this determinant yields a polynomial of degree n called thecharacteristic polynomial, p( ), whose roots ni=1 are the eigen values we seek.

  • 28 CHAPTER 2. MATHEMATICAL CONCEPTS

    2.9 Solution of simultaneous linear algebraic equa-tions

    There are two methods of solving linear algebraic equations in a reservoir simu-lator: (1) direct e.g. Gaussian elimination (2) iterative methods.

    2.9.1 Gaussian elimination

    Given a system of simultaneous algebraic equations of the form

    a11 x1+a12 x2+ ...+a1m xm = b1a21 x1+a22 x2+ ...+a2m xm = b2

    ... = .

    ... = .

    ... = .am1 x1+am2 x2+ ...+amm xm = bm;

    (2.37)

    derived from the reservoir fluid flow equations, we can apply the Gaussian elimi-nation method by reducing the system of n equations in n unknowns to a systemof n 1 equations in n 1 unknowns. The system of n 1 equations in n 1unknowns is further reduced to a system of n 2 equations in n 2 unknowns.The process continues until one equation in one unknown is obtained. The oneunknown is determined while the others are found by back-substitution.

    2.9.1.1 Gaussian elimination - worked example

    Example 1

    x1+ x2+ x3 = 22x1+ x2+ x3 = 32x1+ x2 = 0, (2.38)

    step 1

    Subtract twice the first row from the second row and add twice the first row tothe third;

  • 2.9. SOLUTIONOF SIMULTANEOUS LINEARALGEBRAIC EQUATIONS29

    x1+ x2+ x3 = 2x2 x3 = 1

    +3x2+2x3 = 4, (2.39)

    step 2

    Multiply the second row by 3 and add the result to the third row;

    x1+ x2+ x3 = 2x2+ x3 = 1

    x3 = 1, (2.40)Hence, the value of x3 = 1. Back substituting, we have x2 = 2 and x1 = 1.

    This method involves a triangulation of A to yield an upper triangular matrix Ufollowed by a back solution for the vector x. This was achieved by eliminating allthe elements below the main diagonal A.

    When dealing with large sets of reservoir simulator equations, they are usu-ally difficult to discuss and virtually impossible to manipulate unless they areexpressed as matrices. An example of a typical small set of linear equations isgiven below.

    Example 2

    a11P1+a12P2+a13P3 = b1a21P1+a22P2+a23P3 = b2a31P1+a32P2+a33P3 = b3 (2.41)

    There are three unknowns: P1, P2 and P3; all other quantities are known.

    step 1Re-write the equations in matrix form thus:a11 a12 a13a21 a22 a23

    a31 a32 a33

    P1P2P3

    =b1b2b3

    (2.42)or symbolically, AP= b.

  • 30 CHAPTER 2. MATHEMATICAL CONCEPTS

    step 2

    Working forward, eliminate a21 by multiplying row 1 (the first equation) bya21/a11 and subtracting the result from row 2 (the second equation). Eliminatea31 in a similar manner. The result isa11 a12 a130 a22 a12a21a11 a23 a13a21a11

    0 a32 a12a31a11 a33a13a31a11

    P1P2P3

    = b1b2b1 a21a11b3b1 a31a11

    (2.43)or a11 a12 a130 a22 a23

    0 a32 a33

    P1P2P3

    =b1b2b3

    (2.44)where the primed letters are shorthand symbols for the corresponding elements inEquation 2.43

    step 3

    Eliminate a32 by multiplying row 2 by a32/a

    22 and subtracting the result from

    row 3: a11 a12 a130 a22 a230 0 a33

    P1P2P3

    =b1b2b3

    (2.45)Equation 2.45 can be solved explicitly for P3 = b3/a

    3 and subesequently for P2

    and P1.

    Note that the coefficient matrix is converted to a triangular matrix with onlyone element in the last row. All terms to the left of the diagonal are zero, so this isan upper triangular matrix. Also, note that even with this small set of equations,large amounts of arithmetic and storage are required for direct solution. The appli-cation of the direct solution method in solving discretized reservoir flow equationswould be further discussed in Chapter 5.

    Exercise

    Solve the following set of equations using Gaussian elimination method

  • 2.9. SOLUTIONOF SIMULTANEOUS LINEARALGEBRAIC EQUATIONS31

    P1+P2+P3+P4 = 102P1+P2+3P3+2P4 = 21P1+3P2+2P3+P4 = 173P1+3P2+P3+P4 = 14

    (2.46)

    Hints:

    Divide the arithmetic operation in the Gaussian elimination method into two:

    1. Normalization step - in which the diagonal elements are converted to one

    2. Reduction step - in which the off-diagonal elements are converted to zero

    2.9.2 Gauss-Jordan method - worked exampleThe Gauss-Jordan method is similar to the Gaussian elimination method but avoidsthe back back-substitution step.

    step 1

    Subtract twice the first row from the second row and add twice the first row tothe third;

    x1+ x2+ x3 = 2x2 x3 = 1

    +3x2+2x3 = 4, (2.47)

    step 2

    Multiply the second row of equation 2.47 by 3 and 1 and add the result to thethird and first row, respectively;

    x1+0x2+0x3 = 10x1 x2 x3 = 10x1+0x2 x3 = 1. (2.48)

  • 32 CHAPTER 2. MATHEMATICAL CONCEPTS

    step 3

    Add (1) times the third row to the second row, hence

    x1+0x2+0x3 = 10x1 x20x3 = 20x1+0x2 x3 = 1. (2.49)

    Therefore, x3 =1, x2 = 2 and x1 = 1

    2.9.3 LU decomposition - worked exampleMatrix A can also be factored into lower and upper triangular matrices L andU. Thus, for Ax = b, LUx= b where A = LU, we can set Ux = y, and solvethe problem by finding L= [li j] and U= [ui j]; li j = 0, i < j and ui j = 0, i > j.Ly= b can then be solved for y (i.e. forward solution) and then Ux= y for x (i.e.backward solution) U would be unit upper triangular, i.e. with ones on the maindiagonal.

    The LU factors of A are

    L=

    1 0 02 1 02 3 1

    ; U=1 1 10 1 10 0 1

    . (2.50)The forward solution involves 1 0 02 1 0

    2 3 1

    y1y2y3

    =230

    (2.51)Thus,

    y1 = 22y1 y2 = 3

    2y1+3y2 y3 = 0. (2.52)and the backward solution is1 1 10 1 1

    0 0 1

    x1x2x3

    = 211

    (2.53)Therefore, x3 =1,x2 = 2 and x1 = 1.

  • 2.10. ITERATIVE METHODS 33

    2.10 Iterative methodsThe solution of the matrix equation Ax= b where A is n n can be found iter-atively; by dividing each row of A by its diagonal element (assuming aii 6= 0 forevery i), thus

    D Ax= (IB)x= Db c, (2.54)whereD is a diagonal matrix with dii = 1/aii, i= 1,2, ...,n and B is an nnmatrixconsisting of zeros on the diagonal and the off-diagonals are ai j/aii, i 6= j, i =1,2,3, ...,n.We can then write

    x= Bx+ c. (2.55)

    A method of successive approximations is given by

    x(l+1) = Bx(l)+ c, (2.56)

    where l is an iteration level (x(0) is arbitrary). Equation 2.56 defines a convergentprocess if for any given x(0), {x(l)|l = 1,2,3, ...} converges. If the spectra radiusof B is less than one, then convergence is guaranteed for most iterative processes.

    2.10.1 Iterative methods - worked example

    In order to ensure that the diagonals are all nonzero, we re-write problem 2.38 bysimply interchanging the first and the last columns, thus;

    x3+ x2+ x1 = 2x3+ x2+2x1 = 3

    x22x1 = 0, (2.57)

    The iteration matrix, B, is

    B=

    0 1 11 0 20 1/2 0

    (2.58)and

    c=

    1 0 00 1 00 0 1/2

    230

    =230

    . (2.59)

  • 34 CHAPTER 2. MATHEMATICAL CONCEPTS

    If we take a first guess, x(0) =

    111

    we get after 10 iterations,x(10) =

    0.8751.750.9375

    . (2.60)

  • Chapter 3

    Fundamental equations of flowthrough porous media

    In order to arrive at the basic equatios governing reservoir fluid flow, we need tocombine the continuity equation, an expression for the superficial flow velocityin a porous medium (e.g. Darcys law), description of the flow potential andappropriate equations of state. Basic assumptions involved the derivation of ofthe flow equations include:

    flow is laminar and viscous flow is irrotational diffusion effects are negligible flow is isothermal electrokinetic effects are negligibleFor a steady laminar flow of fluid through porous media, the most important

    forces that must be in equilibrium are the following:

    viscous (frictional) forces (acting on surfaces) force of compression (acting on surface)

    Convective and local acceleration are mostly so small in case of filtra-tion

    force of gravity (acting on body) forces of inertia (acting on body)

    35

  • 36CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    forces of inertia may be neglected for steady and non-steady state fil-tration as well

    capillary forces (acting on surfaces)

    3.1 Laminar viscous flow

    Laminar flow of a fluid is characterized by a fixed set of streamlines. The viscosityof a fluid is a measure of the internal resistance associated with laminar flow andit is equal and opposite to the drag force on the solid.

    3.1.1 Viscous forces

    For a flat plate, the shear force per unit area between the solid surface and a fluidtangent to it is given by Newtons equation

    F = (dvdz

    )solid, (3.1)

    where is fluid viscosity, v is fluid velocity which is a function of position abovethe plate, and z is the distance from the surface into the fluid. For laminar flow,the relative distribution of v is independent of |v|; v and hence dvdz (evaluated atthe surface of the solid) must be every where proportional to q/A, where q isvolumetric flowrate

    F = BqL, (3.2)

    B is a constant which is characteristic of pore geometry.

    3.1.2 External forces

    The external forces acting on the fluid contained within the porous sample can beexpressed in terms of the pressures Pa and Pb at the ends of the sample. Since thepore cross-sectional area available for fluid flow is given by A, the net upwardforce on the fluid due to these pressures is:

    Fp = (PbPa)A (3.3)where is the porosity of the medium.

  • 3.2. DARCYS EQUATION FOR LIQUIDS 37

    3.1.3 Force of gravityThe body force on the fluid is simply the weight of the fluid in the sample. Thiscorresponds to a downward force:

    Fg = (AL)g (3.4)

    where is the density of the fluid and g is the acceleration due to gravity

    3.2 Darcys equation for liquidsFor steady flow, the forces F , Fp and Fg must be in equilibrium. Thus:

    BqL+(AL)g= (PbPa)A (3.5)

    q=KAL

    [(PaPb)+gL] (3.6)

    3.3 Darcys equation for gasesDarcys law of laminar flow in the form of the Eq. 3.6 is also valid for gasesprovided the flow rate, q, is taken as the volumetric flow rate as measured at themean pressure, (Pa+Pb)/2, and provided this mean pressure is sufficiently large.

    qPa+Pb

    2= qaPa (3.7)

    Thus Darcys law can be written as

    qaPa =KAL [(P2a P2b )

    2+(

    Pa+Pb2

    )2MRT

    gL] (3.8)

    Where the density , is obtained from the ideal gas law:

    =MRT

    P=MRT

    Pa+Pb2

    (3.9)

    In the case of gas flow, a phenomenon known as molecular slippage preventsthe sticking of gas molecules to the walls of the pores as required by Darcys law.This is known as Klinkenberg effect and it shows the dependence of permeabilityon pressure:

    K = K(1+bP), (3.10)

  • 38CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    where K is the permeability as observed for incompressible fluids (liquids), P isthe mean flowing pressure and b is a constant characteristic of both the gas andthe porous medium. When K is not sufficiently large, the flow is slip flow andDarcys equation becomes:

    qaPa =KA (P2a P2b

    2L)(1+

    2bPa+Pb

    ) (3.11)

    3.3.1 Turbulent flowWhen the flow rate becomes sufficiently large the laminar flow regime breaksdown and Darcys law is no longer valid. The transition from laminar to turbulentis defined by Reynolds number Re. Discussions on turbulent flow is beyond thescope of this course.

    3.4 Differential form of Darcys equationFor steady flow, the viscous force, the force due to applied pressure and the forcedue to the weight of the fluid must all be in equilibrium, thus:

    (P+ Bv+ ng) sA= 0 (3.12)

    or~v=

    B(P+~ng) (3.13)

    where K = B

    ~v = K(P+~ig) (3.14)

    = K[~i1

    Px1

    +~i2Px2

    +~i3(Px3

    +g)], (3.15)

    which can be written in a more compact form as:

    ~v=K (3.16)

    Introducing a so called potential function instead of pressure we have:

    = ba

    dP(P)

    +gx3. (3.17)

  • 3.5. EQUATIONS OF STATE FOR FLUIDS 39

    Differentiation of Equation 3.17 yields

    = P+g~i3 (3.18)

    3.4.1 Darcys law for anisotropic porous mediaConsidering a rotational transformation of a symmetric matrix, the rotation ofthe axes to a particular orientation will produce a diagonal matrix i.e.

    ( matrix) =1 0 00 2 0

    0 0 3

    (3.19)The particular directions of the set of coordinate axis to which the matrix cor-responds are the principal axes of the porous medium having orthogonal principalaxes, the matrix is symmetric for any orientation of the coordinate system andis diagonal for a coordinate system congruent with the principal axes.

    3.5 Equations of state for fluidsIn order to derive the law governing fluid flow in porous media, the dependenceof the fluid density, on P must be established. We will investigate the followingcases

    Incompressible fluids:ddP

    = 0 (3.20)

    which gives = constant

    Constant compressibility:

    c f = 1VfdVfdP

    , (3.21)

    for a unit mass Vf = 1/

    c f =d( 1 )

    dP

    c f =1ddP

    (3.22)

  • 40CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    Integrating within reservoir pressure P and Po with corresponding fluid density and o gives:

    = oec(PPo) (3.23)

    Applying Taylors rule and neglecting higher order terms of the expansionseries, we get the following approximation:

    o [1+ c(PPo)] (3.24)This EoS applies rather well to most liquids, though the presence of large

    quantities of dissolved gases causes deviations.

    3.6 Equations of state for gasesFor isothermal variations in pressure, the ideal gas EoS is given by:

    PV =mMRT (3.25)

    c=1ddP

    =1P

    (3.26)

    where V is the volume occupied by the mass, m, of gas of molecular weight M,R is the gas constant and T is the absolute temperature. For real gases the gasdeviation from ideal gas law are taken into account through the Z f actor thus:

    =MRT

    PZ(P)

    (3.27)

    3.7 Continuity EquationThe continuity equation can be generally written as given in Equation 2.18 thus:

    (~v) g= t

    (), (3.28)

    3.7.1 Single-phase incompressible flowFor single-phase incompressible flow, the volume of an element of fluid is notaltered by changes in pressure and hence the density is a constant. Equation 2.18therefore reduces to

  • 3.7. CONTINUITY EQUATION 41

    Figure 3.1: Elemental volume in a region of fluid flow

    ~v=g S (3.29)substituting Equation 3.16 into 3.28, we have

    {

    (P+g~i3

    )}= S (3.30)

    where S is the source or sink term and the potential function is defined byEquation 3.17. For anisotropic, heterogeneous porous media in cartesian coordi-nate (x, y, z)

    x1

    (

    Px1

    )+x2

    (

    Px2

    )+x3

    [

    (Px3

    +g~i3

    )]= S (3.31)

    The fluid viscosity is usually considered constant but the permeability couldvary depending on the pore geometry. For a homogeneous system, and areconstant and neglecting gravitational effects; the differential equation becomes:

    2Px21

    + 2Px22

    + 2Px23

    = S?, (3.32)

    which is Poissons equation and S? S/.

  • 42CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    In an isotropic porous medium, the permeability is a scalar, but in an anisotropicmedium is a tensor. Thus,

    u= (3.33)

    which can also be written as:

    u1u2u3

    =

    11 12 1321 22 2331 32 33

    x1x2x3

    (3.34)If the matrix is symmetrical (i.e. i j = ji) the coordinate system can be trans-

    formed so that all values apart from the main diagonal become zero. Directionsparallel to these coordinate axes are called principal directions (axis) of the porousmedium. These principal directions are orthogonal to each other as described ear-lier in section 3.4.1. We can then write the Darcys law for for a coordinate systemwith axis parallel to the principal directions of the porous medium as:

    u1u2u3

    =

    11 0 00 22 00 0 33

    x1 x2 x3

    (3.35)where

    = PPo

    dP(P)

    +g3

    i=1

    xicosi (3.36)

    and i, i= 1,2,3 are the angles between the respective axes and the vertical.

    Differentiating Equation 3.36, we have,

    2 = P+2g3

    i=1

    ~iicosi (3.37)

    If the 3rd coordinate direction is vertical then Equation 3.37 becomes simpler

    2 = P+2g~i3 (3.38)

    Substituting Equation 3.38 into Equation 3.30, yields

    {

    (P+g~i3

    )}=

    t() (3.39)

    Neglecting gravity and assuming constant porosity, we can simply write:

  • 3.7. CONTINUITY EQUATION 43

    (P

    )=

    t(3.40)

    Considering a slightly compressible fluid and substituting the expression forthe density (Equation 3.24), the single-phase flow equation becomes

    (P)=cP

    t(3.41)

    If there are no fluid sources or sinks within the region of flow, or if fluid andporous media are incompressible and the reservoir has reached steady state, thenthe divergence of the volumetric flux density becomes zero resulting in Laplacesequation.

    2P= 0 (3.42)

    3.7.2 Compressible fluidsBased on Equation 3.23 the following transformation can be made:

    P = oec(PPo)P

    =1c(oec(PPo)

    )=

    1c (3.43)

    Substituting Equation 3.43 into Equation 3.39 becomes:

    {c

    (+2cg~i3

    )}=

    t(3.44)

    for a system with constant porosity. In cartesian coordinates, we have

    x

    (c

    x

    )+

    y

    (c

    y

    )+

    z

    [c

    ( z

    +cg)]

    = t

    (3.45)

    Neglecting gravity effects and if the medium is homogeneous and isotropicand is constant, the equation reduces to

    2 =c

    t

    =1 t

    (3.46)

  • 44CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    where

    c

    . (3.47)

    This is known as the Fouriers equation or the diffusivity equation.

    3.7.3 Ideal gas flowFor ideal gases, = PM/RT , = (/P) P2/ t and P = P2; where M/2 RT. Substituting in Equation 3.40,

    (P2

    )=

    PP2

    t(3.48)

    For an isotropic, homogeneous medium with constant viscosity, we have

    2P2 =P

    P2

    t, (3.49)

    which is non-linear.

    3.7.4 Real gas flowThe equation of state for real gas is defined by Equation 3.27 and the compress-ibilty is

    cg =1P

    , (3.50)

    Substituting Equation 3.27 into Equation 3.40 and taking the porosity as con-stant since the rock compressibility is several orders of magnitude less than thegas compressibility, the right side of the Equation 3.27 can be developed in thefollowing way:

    t

    () = t

    = 1P

    (P t

    )= cg

    MPRT

    P t

    =M2RT

    cg2PZ

    P t

    (3.51)

  • 3.7. CONTINUITY EQUATION 45

    Thus, Equation 3.27 becomes:

    [

    MPRTZ

    P]=

    M2RT

    cg2PZ

    P t

    , (3.52)

    and after simplication, we have

    [2PZP]= cg

    2PZ

    P t

    , (3.53)

    The real gas pseudo pressure function was introduced by Al-Hussainy, Ramey,Crawford:

    m(P) = 2 PPb

    PdPZ

    , (3.54)

    This function enabled the following derivations:

    m(P) =dm(P)dP

    P

    =2PZP, (3.55)

    and

    m(P) t

    =dm(P)dP

    P t

    =2PZ

    P t

    , (3.56)

    Substitution of Equations 3.54 and 3.56 into 3.53 results in:

    [m(P)] = cgm(P) t

    . (3.57)

    Assuming that the porous medium is isotropic and homogeneous, Equation3.57 becomes

    2m(P) =cg

    m(P) t

    (3.58)

  • 46CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    3.8 Generalized multiphase flow equationWe consider the flow of a single component i, present in all three fluid phases; oil,water and gas. LetCio,Ciw andCig represent the mass fractions of component i inthe three phases, then,

    3

    i=1

    Cillvl = the mass f lux density o f component i (3.59)

    3

    i=1

    CillSl = the mass o f component i per unit pore volume (3.60)

    The continuity equation then becomes

    (

    3

    i=1

    Cillvl

    )

    3

    i=1

    Cil gl = t

    (

    3

    i=1

    CillSl

    )(3.61)

    In the presence of two or more fluids flowing in the reservoir, the absolute ,effective l and relative permeability rl can be defined as

    l = rl (3.62)

    and the modified Darcys law for multiphase flow can be written as

    ~vl = []rll ll, l = 1, 2, 3. (3.63)where the Hubbert flow potential is defined as

    l = PP0

    dl( )

    ( ggc

    )d (3.64)

    where the negative sign on the gravity term denotes that the positive direction isdownward. The general multiphase flow equation can then be written by combin-ing Equations 3.61-3.64:

    {

    3

    i=1

    Cill[]rll

    (Pl ld)}

    3

    i=1

    Cil gl = t

    (

    3

    i=1

    CillSl

    )(3.65)

    For a system with N components, there will be 3N+ 15 unknowns and 3N+ 15auxilliary relations would be required to solve them.

    Considering a system with minimal hydrocarbon phase changes involving wa-ter (i.e. all of the water phase is the water component), and N hydrocarbon com-ponents in the oil and gas phases, then, the total number of components is N+1;

  • 3.8. GENERALIZED MULTIPHASE FLOW EQUATION 47

    Table 3.1: Number of unknowns in the multiphase equationUnknown Number

    Cil 3Nl 3rl 3l 3Pl 3Sl 3

    Total 3N + 15

    Table 3.2: Number of auxilliary relations required to solve the equationEquations Number Comments3

    i=1

    Cil = 1, l = 1,2,3 3 i-component mass fraction

    l = (T,Pl) 3 density of phase lrl = r(So,Sw,Sg) 3 rel-perm of phase ll = (T,Pl) 3 viscosity of phase lPcwo = PoPw 1 capillary pressure (ow)Pcgo = PgPo 1 capillary pressure (go)3

    i=1

    Sl = 1, l = 1,2,3 1 total phase saturation

    CigCio

    =Kigo(T,Pg,Po,Cig,Cio) N equilibrium constantsCigCiw

    =Kigw(T,Pg,Pw,Ciw,Cig) N equilibrium constantsMass balances NTotal 3N + 15

    where the (N+1)st component is water. In Equation 3.65 we setCiw = 0 for i

  • 48CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    Table 3.3: Description of the mass fractions in black oil simulatorMass fractions Value Comments

    Cww 1Cgg 1Cwo 0Cwg 0Cow 0Cgw 0Cog 0

    Coo momo+mg mo- mass fraction of oil

    Cgomg

    mo+mgmg- mass fraction of gas

    {w

    []rww

    (Pw wd)} gw = t (wSw) (3.67)

    3.9 Black-oil reservoir simulatorIn a black oil reservoir simulator, the basic underlying assumption is that thereis no significant interphase mass transfer between the water-oil and water-gasphases. A one-way phase transfer may however occur between the gas and oil;in which case gas moves in and out of the oil, but the oil does not vaporize intothe gas phase.

    Substituting the relations given in Tables 3.3 and 3.4 into Equation 3.65 gives

    Oil equation:

    {[]rooBo

    (Po od)}Qo = t

    (SoBo

    )(3.68)

    Water equation:

    {[]rwwBw

    (Pw wd)}Qw = t

    (SwBw

    )(3.69)

    Gas equation:

    {[]roRsoBo

    (Po od)}+

    {[]rggBg

    (Pg gd)}

    (RsQo+Qg) = t

    (SgBg

    +SoRsBo

    )(3.70)

  • 3.9. BLACK-OIL RESERVOIR SIMULATOR 49

    Table 3.4: Description of the volume-related parameters in black oil simulatorParameter Description Comments

    Vo

    (mo(res)+mg(res)

    )o(res)

    Vgmgg

    BoVo(res)Vo(sur f )

    =Vo(res)o(sur f )

    mo

    (mo(res)+mg(res)

    )o(sur f )

    mo(res)o(res)

    Cooo(sur f )o(res)Bo

    RsVg(sur f )Vo(sur f )

    =mg(res)g(sur f )

    /mo(res)o(sur f )

    CgoRsg(sur f )o(res)Bo

    Bgg(sur f )g(res)

    Bww(sur f )w(res)

    If we define

    o = Po odw = Pw wdg = Pg gd

    (3.71)

    Then, we can re-write Equations 3.68 - 3.70 as

    Oil equation:

    {rooBo

    o}Qo = t

    (SoBo

    )(3.72)

    Water equation:

    {rwwBw

    w}Qw = t

    (SwBw

    )(3.73)

  • 50CHAPTER 3. FUNDAMENTAL EQUATIONSOF FLOWTHROUGHPOROUSMEDIA

    Gas equation:

    {rooRsoBo

    o}+

    {rgggBg

    o}

    (RsQo+Qg) = t

    (SgBg

    +SoRsBo

    )(3.74)

  • Chapter 4

    Reservoir flow geometries anddimensions

    The choice of the dimensions to assign to a particular reservoir engineering prob-lem is to a large extent dependent on the physical system that is being modelled,the level of detail required and the computational resources available in carryingout such simulation exercise.

    The types of models are: tank models (zero dimension), 1D models, 2D areal(x,y; r, ; curvilinear) models, 2D cross-sectional (x,z) or radial (r,z) models,multilayer (stacks of 2D areal) models and 3D models.

    4.1 Tank models

    Tank models (e.g. Craft and Hawkins (1959); Lutes (1977)) are mostly used whenrapid answers are needed and average reservoir pressure behaviour is consideredthe only important factor in making operating or investment decisions. Pressuregradients in the reservoir should be small or else their impact should not be con-sidered significant (4.1).

    Figure 4.1: A tank model

    51

  • 52 CHAPTER 4. RESERVOIR FLOW GEOMETRIES AND DIMENSIONS

    Figure 4.2: A one-dimensional model

    4.2 1D modelsIn one-dimensional models, there basically no property variation along other di-rections (i.e. y and z directions). Hence, if a section is taken perpendicular to theindicated flow direction (4.2), there will be no property variation across the plane.Also, any cross-section taken in the x z or x y planes will show a uniformityof the flow structure. More explicitly, the pressure profiles of flow paths will besimilar.

    1D models can be used in evaluating the influence of heterogeneity in the di-rection of flow. McCulloch et al. (1968) found that natural depletion and crestalgas injection for a high-relief (reef) reservoir could be predicted reliably using a1D vertical model. Hirasaki (1975) used a 1D model to study the sensitivity of oilrecovery to changes in displaceable oil volume, mobility ratio, permeability leveland shape of the relative permeability curves. However, 1D models usually can-not calculate realistic displacement efficiencies in invaded regions because theycannot represent gravity effects perpendicular to the direction of flow.

    4.3 2D models2D models in cartesian coordinate systems are mostly used in reservoir simula-tion studies particularly when areal flow patterns dominate reservoir performance.Figure 4.3 illustrates a two-dimensional flow structure along the x and y directions.

    No property variation (such as porosity, permeability and saturations) existswhen a slice is taken parallel to the x y plane. A 2D model allows us to accountfor variations in directional permeability and lateral well distributions. Further-more, a two-dimensional approach allows the representation of various well com-pletion strategies (e.g., vertical wells, horizontal wells, stimulated wells). Hen-derson et al. (1968) used a 2D areal model to determine the optimal placement

  • 4.3. 2D MODELS 53

    Figure 4.3: A two-dimensional model

    of wells in a gas-storage reservoir. A two-dimensional model can also be used todescribe a thin but laterally extensive reservoir formation.

    Areal models normally use Cartesian (x,y) coordinate system (e.g. Figures4.3 and 4.4), but there are some applications for which radial (r, ) coordinate(e.g. Figure 4.7) or curvilinear coordinate systems (Figure 4.8) is more suitable.A curvilinear flow geometry provides a more accurate representation of the flowgeometry. Grid orientation do not necessarily affect the results obtained with acurvilinear coordinate system as is often the case with other coordinate systems.A significantly lesser amount of grid-blocks may just be sufficient to obtain thesame level of accuracy.

    Radial and curvilinear systems provide better definition near wells than do xy areal models. In certain cases, curvilinear coordinates may reduce the numberof gridblocks needed in areal or 3D models.

    4.3.1 2D cross-sectional and radial models

    2D cross-sectional and radial models are used to develop well functions or pseudo-functions for use in 2D areal or 3D models. They are also used to simulate pe-ripheral water injection, crestal gas injection or other physical processes in whichfrontal velocities toward producers are largely uniform. When vertical effectsdominate performance, 2D cross-sectional and radial models can also be used toevaluate well behaviour.

    The interaction of gravity, capillary and viscous forces and the resultant ef-fect on vertical sweep and displacement efficiencies can be evaluated using cross-sectional models although application in estimating overall field performance is

  • 54 CHAPTER 4. RESERVOIR FLOW GEOMETRIES AND DIMENSIONS

    Figure 4.4: A cross-section of a two-dimensional model

    Figure 4.5: A cross-section of a radial r,z coordinate system

    limited if areal sweep efficiency is an important consideration.

    2D radial (r,z) (Figure 4.5) models are especially useful in studies of the be-haviour of wells in bottom-water drive, gas-cap drive reservoirs or reservoirs hav-ing a thin oil rims ovelain by gas and underlain by large aquifer. For these typesof reservoirs, selection of initial completion intervals and recognition of opportu-nities for recompletion are very critical in field development planning and perfor-mance optimization.

  • 4.3. 2D MODELS 55

    Figure 4.6: Areal model in cartesian coordinate system

    Figure 4.7: Areal model in radial r, coordinate system

    Figure 4.8: Areal model in curvilinear coordinate system

  • 56 CHAPTER 4. RESERVOIR FLOW GEOMETRIES AND DIMENSIONS

    Figure 4.9: A three-dimensional model in cartesian coordinate system

    4.4 3D models3D models are particularly useful when reservoir geometry is too complex to re-duce to a combination of cross-sectional and areal models. For instance, reservoirshaving shales and other flow barriers that are continuous over large areas but withpermeable regions where cross-flow occurs are difficult to model in 2D. Further,when vertical flow dominates particularly near well-bore where cusping and con-ing may occur, combination of both areal and verical details which can only beobtained in 3D models.

    Layered and multi-layered reservoirs (with or without crossflow), partiallypenetrating wells, and thick reservoirs where gravitational forces could be signif-icant are also easily modelled in 3D. Although factors such as as computationalresources, costs, data availability and marginal utility may prevent full applicationof the 3Dmodels. Figure 4.9 is a three-dimensional model in cartesian coordinatesystem.

    3D radial-cylindrical coordinate system is used for single-well studies. Cylin-drical grids are used in the reservoir (see Figure 4.10). The gridblock size in-creases logarithmically in size outward from the well. Small grids near the well-bore can effectively simulate the well behaviour.

    4.4.1 Spherical flow geometryThe spherical coordinate system (r, , ) is used in special cases reservoir engi-neering problems. Two examples are partial penetration to a thick formation by aproduction well, and flow around perforations.

  • 4.4. 3D MODELS 57

    Figure 4.10: A three-dimensional radial model grid. re is the reservoir externalradius and rw is the well-bore radius

    Figure 4.11: A spherical geometry

  • 58 CHAPTER 4. RESERVOIR FLOW GEOMETRIES AND DIMENSIONS

    Figure 4.12: (a) An ellipse (b) Flow profile (confocal hyperbolas) in a systemof equipotential contours (confocal ellipses) passing through a high conductivityfracture

    4.4.2 Elliptical-cylindrical flow geometryElliptical-cylindrical flow geometry is commonly used in single-well studies whena strong permeability contrast exists in two principal directions on the lateralplane. Also, elliptical-cylindrical geometry can be used to model systems in whicha vertical well is intercepted by a vertical, high conductivity fracture.

    In these cases, the normally concentric equipotential contours degenerate intoconfocal ellipses in the sense that there is a unique ellipse passing through eachpoint in the plane. Similarly, the streamlines become distorted into confocal hy-perbolas in the sense that there is a unique hyperbola passing through each pointin the plane (Figure 4.12).

  • Chapter 5

    Finite difference methods

    The finite difference techniques are based upon the approximations that permitreplacing differential equations by finite difference equations. These finite differ-ence approximations are algebraic in form, and the solutions are related to gridpoints.

    If we define a function P(x) of class Cn on an interval (a,b) S, then we canrepresent P(x) by its Taylor polynomial thus:

    P(x) = P(xo)+xP(xo)+x2

    2!P(xo)+

    x3

    3!P(xo)+ ...+

    xn

    n!Pn(xo). (5.1)

    Denoting P(xo) by Po and Px by P1, Equation 5.1 becomes

    P1 = Po+xPo+x2

    2!Po +

    x3

    3!Po + ...+

    xn

    n!Pno . (5.2)

    This is the forward expansion. The backward expansion can be written as:

    P1 = PoxPo+x2

    2!Po

    x3

    3!Po + ... (5.3)

    If x is small and terms of degree two and above are ignored, Equation 5.3can be re-arranged as:

    Po P1Pox

    +(x) (5.4)

    which is a finite difference form of dP/dx at point xo. Subtraction of Equation5.4 from 5.3 gives

    Po P1P1x

    +(x2) (5.5)

    59

  • 60 CHAPTER 5. FINITE DIFFERENCE METHODS

    which is another difference form of dP/dx. Comparison of Equations 5.4 and5.5 shows that the truncation error (which is the error incurred by ignoring higherorder terms in the series expansion) is of the order of x in Equation 5.4 and x2 inEquation 5.5. Thus, the latter is a more accurate representation of the first deriva-tive than the former.

    Addition of Equations 5.2 and 5.3 gives a finite difference form of the secondderivative

    Po P12Po+P1

    x2+(x2) (5.6)

    In summary,

    Px

    Pi+1Pix

    PiPi+1x

    Pi+1Pi12x

    (5.7)

    2Px2

    Pi+12Pi+Pi1x2

    , (5.8)

    where,Pi = P(ix). Another approximation to the first derivative is given by

    Px

    Pi+1/2Pi1/2x

    .

    This form is useful in expressing in difference form, the term 2P/x t or x[(x)Px

    ]which appears in reservoir simulation equation.

    For heterogeneous systems where properties vary spatially, the second-orderderivative

    x

    ((x)

    Px

    )(5.9)

    takes the form:

    (x

    (x)Px

    )i 1

    (x)2[i+1/2(Pi+1Pi)i1/2(PiPi1)

    ](5.10)

  • 61

    Figure 5.1: One-dimensional discretization into blocks

    Figure 5.1 is the discretization of a one-dimensional geometry into blocks. InEquation 5.10, the dependent variable P is computed at the nodal points, whereasthe variable (x) is computed at the block boundaries, mid-way between the nodesi and i+1 and i and i1. The subscripts i+1/2 and i1/2 simply indicate theneed to calculate the variables using some averaging technique at the correspond-ing boundaries.

    Some of the flow properties that are usually computed at the block boundariesinclude mobility, ( f =

    f f ), where f is the flowing fluid (oil, water or gas); trans-

    missibility (T ); effective permeability or relative permeability etc. In expressingany of these terms at the interface of two neighbouring blocks, we need to estab-lish the direction of flow and use an appropriate averaging, upstream or down-stream weighting procedure. If the variable that is being computed is a constant,harmonic averaging can be used; for weakly non-linear components, arithmeticaveraging can be used while a strongly non-linear components (e.g. relative per-meability term is a strong function of saturation) can be obtained using upstreamaveraging.

    Note

    ( Px

    )i+1/2

    = i+1/2Pi+1Pix

    ( Px

    )i1/2

    = i1/2PiPi1x

    ( Px

    )i= i Pi+1Pi12x

  • 62 CHAPTER 5. FINITE DIFFERENCE METHODS

    Exercise: Write the finite difference form of the following equations:

    2Px t x

    [(x)

    Px

    ]5.1 Reservoir grids and boundary conditionsIn reservoir simulation problems, we are usually concerned with one or more de-pendent variables, typically pressure (P), temperature (T ), concentration (C), sat-uration (S). Generally, a variable f is a function of the independent spatial vari-ables x, y, z and t i.e.

    f = f (x,y,z, t) (5.11)

    The position of the variable in space is a grid point (xi,y j,zk) in the reservoir.Two common types of grids employed in reservoir simulation include

    structured (regular) grid cartesian; mesh-intersection (Figure 5.2) or block-centered grid points(Figure 5.3)

    rectilinear curvilinear

    unstructured (irregular) grid (Figures 5.4, 5.5).The choice of the grid type depends upon the spatial complexity of the reserv-

    ior as well as the associated boundary conditions.

    5.1.1 Structured gridsThe Cartesian grid is the simplest example of structured grids. The solution pointsare located at the intersection of the grid lines, while the elements are unit squaresor unit cubes, and the vertices are integer points. This type of mesh is extremelysimple and quick to generate.

    However, if the problem to be solved has curved internal and/or external bound-aries, solving on a structured Cartesian grid requires one to modify the numericalscheme near these boundaries.

  • 5.1. RESERVOIR GRIDS AND BOUNDARY CONDITIONS 63

    Figure 5.2: Mesh-intersection grid points

    Figure 5.3: Block-centered grid points

  • 64 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.4: Irregular block-centered grid

    Grids of this type appear on graph paper and may be used in finite elementanalysis as well as finite volume methods and finite difference methods. Since thederivatives of field variables can be conveniently expressed as finite differences,structured grids mainly appear in finite difference methods.

    5.1.1.1 Rectilinear grids

    Rectilinear grids are tessellation by rectangles or parallelepipeds that are not, ingeneral, all congruent to each other. The cells may still be indexed by integers asin cartesian, but the mapping from indexes to vertex coordinates is less uniformthan in a cartesian grid.

    Rectilinear grids have a fixed resolution. The refinement they require in orderto track material interfaces (i.e. interfaces between different geometric entities)that are not aligned with the coordinate axes is prohibitively high, especially ifthese interfaces are curved. Accurate resolution of these material properties isvery important because they can vary by several orders of magnitude across agiven geometry.

    5.1.1.2 Curvilinear grids

    Curvilinear and unstructured grids can provide a more adaptive resolution. Struc-tured curvilinear grids (Figure 5.5b), also known as O-grids, are able to capturefree-form objects by mapping curves and surfaces to topologically cubic blocksin parametric space. They have the same combinatorial structure as cartesian and

  • 5.2. BOUNDARY CONDITIONS 65

    rectilinear grids, but the cells are quadrilaterals or cuboids rather than rectanglesor rectangular parallelepipeds.

    However, even for geometrically simple models, this subdivision requires sig-nificant manual intervention. Therefore, curvilinear grids are ill-suited for thediscretization of complex geometric models Owen (1998).

    5.1.2 Unstructured grids

    Unstructured grids (Figure 5.5c) offer more flexibility than structured grids andhence are very useful in finite element and finite volume methods. They can fitfree-form geometrical entities, such as NURBS with spatially variable refinement,and they can also be generated automatically. The disadvantage of unstructuredgrids is that mesh coordinates cannot be calculated from indices. They thereforemust be stored. However, in practice, this does not significantly increase memoryrequirements because the majority of storage is taken up by the discretized phys-ical variables. Unstructured grids also allow hybrid of different element types tobe used (Figure 5.5d) in the discretization.

    5.2 Boundary conditions

    Boundary conditions are the set of conditions specified for the behaviour of thesolution to a set of differential equations at the boundary of its domain. Theboundary conditions are required at wells (inner boundaries) and at the exteriorboundary of the reservoir. The finite difference representation of a system of par-tial differential equations is independent of the grid system employed; i.e. they areidentical for both block-centered and mesh-intersection. In reservoir simulationproblems, two types of boundary conditions can be specified on the boundary ofthe geometries: (a) Dirichlet (b) Neumann

    5.2.1 Dirichlet boundary conditions

    When dirichlet boundary conditions (e.g. Figure 5.6a,b) are imposed on an ordi-nary or a partial differential equation governing pressure behaviour in a reservoirsystem, the values of the pressure on the reservoir boundaries are specified; forinstance, a value of P0 = c1 was specified at the boundary in Figure 5.6a. The

  • 66 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.5: Three common types of meshes include: (a) rectilinear; (b) curvilin-ear; (c) unstructured grid with varying element size; and (d) hybrid finite-elementmesh showing featureless regions consisting of hexahedra, constrained ones oftetrahedral, and transitions covered by pyramid and prism elements interfacingtetrahedra with hexahedra

  • 5.2. BOUNDARY CONDITIONS 67

    Figure 5.6: (a) Dirichlet boundary condition for a mesh intersection grid (b)Dirichlet boundary condition for block-centered grid (c) Neumann boundary con-dition for a mesh intersection grid (d) Neumann boundary condition for a block-centered grid

  • 68 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.7: Dirichlet boundary condition in a mesh intersection grid system

    mesh-intersection grid (Figure 5.2) as well as unstructured grid are easily em-ployed in Dirichlet type problem.

    Figure 5.7 shows a Dirichlet boundary condition in a two-dimensional mesh-intersection grid system. Mathematically, this boundary condition can be writtenas

    Pi,J = PtPi,1 = Pb

    }

    {for i= 1, ..., I (5.12)

    P1, j = PlPI, j = Pr

    }

    {for j = 1, ...,J (5.13)

    where I and J represent the maximum number of nodes along the x andydirections, respectively.

    Figure 5.6b, shows a Dirichlet boundary condition in a block-centered gridsystem. The implementation basically follows the same logic. The value of thedependent variable (e.g. pressure) is specified at the center along the portion ofthe boundary affected; for instance, a value of P0 = c1 was specified at center ofthe left-boundary block in Figure 5.6b. In order words, we neglect the fact thatthe block centers are not actually coincident with the reservoir boundaries. This

  • 5.2. BOUNDARY CONDITIONS 69

    Figure 5.8: Finite-element mesh of a 30m 10m channel geometry showinga Dirichlet boundary conditions at the inlet and outlet of the model, a referenceslit, the nodes and the velocity fields computed at the barycenter of each of thefinite-elements (Akanji and Matthai, 2010).

    approximation is improved if we use smaller grid spacings, (i.e. refined grid). Atypical application of Dirichlet boundary condition in unstructured finite-elementgrid in 2D flow geometry is shown in Figure 5.8.

    5.2.2 Neumann boundary conditionsWhen Neumann boundary conditions (e.g. Figure 5.6c,d) are imposed on an or-dinary or a partial differential equation, the values of the pressure derivative onthe reservoir boundaries are specified. The block-centered grid (Figure 5.3) hasan advantage in the Neumann problem where boundary conditions specify flux orflow across the reservoir boundaries (Figure 5.9).

    When some flow rate across a boundary is specified (e.g. 1 and 3 in Figure5.9), the normal component of the velocity vector at the boundary must equal thisflow rate thus:

    (P h) ~n= q(), (5.14)

    and the total flow rate across a boundary is the integrated value of q over theboundary. For instance, over the boundary 3 of Figure 5.9 the total flow rate is

  • 70 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.9: Boundaries for r z systems with a single well of radius rw

    qT =3q()d() (5.15)

    When there is no flow across a boundary (e.g. 1 in Figure 5.9), the com-ponent of the velocity vector normal to the boundary surface must be zero. Thisis obtained by taking the dot (vector) product of Darcy velocity with the normalvector~n thus:

    (P h) ~n= 0. (5.16)

    For x y areal model, we can writex

    (Px

    hx

    )= 0, (5.17)

    for all boundaries which are normal to the x-direction and

    y

    (Py

    hy

    )= 0, (5.18)

    for all boundaries which are normal to the y-direction.

    Figures 5.6c,d show a Neumann boundary conditions for a mesh-intersectionand block-centered grid systems.

  • 5.2. BOUNDARY CONDITIONS 71

    Figure 5.10: A typical boundary grid-block in a cross-sectional model

    5.2.3 Discretization of Boundary Conditions

    Figure 5.10 is a typical boundary grid-block in a cross-sectional model. If the flowacross the boundary is zero, then Px = 0 can be approximated by using the secondorder expression

    Pi+1Pi12(xi+1 xi) = 0. (5.19)

    This approach assumes a a complete symmetry of properties about xi and themethod is known as the reflection technique. In order to create a reflection node,we simply need to treat the boundary as a mirror showing the images of the actualnodes that are adjacent to the boundary. This technique preserves the symme-try and the order of approximation of the finite-difference equations because theimage nodes are assigned the same properties as the actual nodes that they reflect .

    5.2.4 Initial Conditions

    For newly discovered fields, it is reasonable to assume that pressure gradient inthe reservoir is due to the hydrostatic head of the fluid:

    dPdh

    = (5.20)

  • 72 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.11: A typical grid-block hosting a vertical well of radius rw and height h

    The simulation of single-phase flow in a reservoir is possible from any giveninitial pressure distribution.

    5.2.5 Treatment of individual wellsSince typical wells in reservoirs have small diameters compared to the size ofthe simulation cells (e.g. Figure 5.11), it is common to employ a well indexWI(or productivity index, PI) to relate the local flow rate q to the difference in wellpressure Pw and numerically computed pressure PE in the perforated grid-cell by

    q= tPI (PE Pw) (5.21)where t is the total mobility and the commonly used Peacemans (Peaceman,

    1983) productivity index PI for a vertical well in a Cartesian cell with dimensionsxyz is given as

    PI =2pizln( rorw )

    . (5.22)

    The effective well-cell radius, ro; which can be interpreted as the radius atwhich the actual pressure equals the numerically computed pressure can be writtenas:

    ro = 0.28

    ((x)2

    yx

    )+((y)2

    xy

    )4

    yx +

    4

    xy

    (5.23)

    For isotropic media, we have:

    ro = 0.14

    (x)2+(y)2 (5.24)

    The validity of the Peaceman well-index decreases rapidly with increasingnear-well heterogeneity and grid skewness. Furthermore, it was developed for thetwo-point flux-approximation (TPFA) method (see e.g., Aziz and Settari (1979))

  • 5.3. APPLICATION TO SINGLE-PHASE FLOW IN 1D 73

    and as such, it is not valid for other methods (such as mixed finite-element meth-ods (MFEM) with exact integration or mimetic finite-difference methods (MFDM,Brezzi et al. (2005)) in general).

    If Neumann boundary condition is specified (i.e. specified flow rate), the valueis substituted into the flow equation and only written for the block(s) hosting thewell. For blocks with no wells, the flow rate values are set to zero.

    For Dirichlet boundary conditions (i.e. specified boundary pressure) Equation5.21 is substituted into the flow equation (replacing the qi, j,k) term. The flow ratecan then be calculated by back-substitution.

    5.3 Application to single-phase flow in 1DTo illustrate finite difference techniques in one-dimensional geometry, we willconsider a homogeneous and isotropic 1D cartesian system where the viscosityis assumed constant and the fluid is slightly compressible.

    Recall the homogeneous and isotropic form of the flow Equation 3.41 in one-dimension,

    2Px2

    = P t

    , (5.25)

    where =

    c

    , (5.26)

    presumed to hold in some region 0 < x < X and 0 < t represented by gridx= ix, 0< i< I where X = Ix and t = nt; x and t are selected spatial andtime increment respectively.

    The finite difference representation of Equation 5.25 at the point (i,n) can bewritten as

    Pni+12Pni +Pni1x2

    =

    (Pn+1i Pni

    t

    ), (5.27)

    where the term Pni represents the value P(ix,nt). Equation 5.27 is termed anexplicit difference represenation of Equation 5.25 because at each time step, onlyone unknown appears (i.e. Pn+1i ) and this unknown can therefore be solved forexplicitly. Thus, re-arranging Equation 5.27 gives

    Pn+1i = Pni1 (2 1)Pni +Pni+1, (5.28)

  • 74 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.12: Finite difference mesh for two independent variables x and t

    Figure 5.13: Finite difference mesh for three independent variables x, y and t

  • 5.3. APPLICATION TO SINGLE-PHASE FLOW IN 1D 75

    where

    =t

    x2. (5.29)

    At zero time (i.e. n= 0) all P2i for 0< i< I are known from the initial conditionand P1i can be calculated explicitly for all i from Equation 5.28. Knowledge ofPi,1 then allows calculations of Pi,2 and so on.

    An implicit representation of Equation 5.25 at the point (i,n) can be written as

    Pn+1i1 2Pn+1i +Pn+1i+1x2

    =

    (Pn+1i Pni

    t

    ). (5.30)

    Note that the spatial derivative 2Px2 is replaced by a difference form evaluated at

    (n+1)t rather than nt and at each time-step the result contains three unknownvalues of the dependent variable P. Re-arranging Equation 5.30 we have

    Pn+1i1 (2+)Pn+1i +Pn+1i+1 =Pni , (5.31)where,

    =x2

    t

    =1. (5.32)

    Thus, at each timestep, a set of simultaneous equations which form a tri-diagonalmatrix is obtained. The term implicit refers to the fact that the unknowns areimplicitly related to one another through the set of simultaneous equations. Theimplicit scheme is unconditionally stable but requires extra computing time, theexplicit scheme on the other hand is only stable under some restrictions.

    Another scheme combines implicit and explicit scheme:

    (Pni+12Pni +Pni1

    x2

    )+(1)

    (Pn+1i+1 2Pn+1i +Pn+1i1

    x2

    )=

    (Pn+1i Pni

    t

    ),

    (5.33)where 0< < 1; when = 1/2, we have the Crank-Nicolson scheme.

  • 76 CHAPTER 5. FINITE DIFFERENCE METHODS

    Figure 5.14: A simple block-centered one-dimensional system composed of fiveblocks with Dirichlet boundary conditions specified at the first and fifth blocks.

    5.3.1 Example: one-dimensional flow system

    We demonstrate the application of finite difference discretization in single-phaseflow by using a simple one-dimensional regular block-centered grid system com-posed of five blocks Figure 5.14.

    A Dirichlet boundary condition i.e. pressure values (P) are specified on theboundaries of Equation 5.28 thus:

    Pn0 = c1,PnN+1 = c2, (5.34)

    Recall the implicit pressure Equation 5.31:

    Pn+1i1 (2+)Pn+1i +Pn+1i+1 =Pni ,

    which represents the characteristic equation for any block i = 1,2, ...,5 in Fig-ure 5.14. We need to write this pressure equation for each of the blocks in thegeometry. For example, when