Você está na página 1de 658

Copyright

by

Waleed Fazelipour

2007
Development of a Fully Implicit, Parallel,
Equation-of-State Compositional Simulator to
Model Asphaltene Precipitation in
Petroleum Reservoirs

by

Waleed Fazelipour, B.Sc.

Thesis

Presented to the Faculty of the Graduate School of


The University of Texas at Austin
in Partial Fulfillment
of the Requirements
for the Degree of

Master of Science in Engineering

The University of Texas at Austin


December 2007
Development of a Fully Implicit, Parallel,

Equation-of-State Compositional Simulator to

Model Asphaltene Precipitation in

Petroleum Reservoirs

Approved by
Supervising Committee:

_____________________
Gary A. Pope, Co-Supervisor

_____________________
Kamy Sepehrnoori, Co-Supervisor
Dedication

To all my teachers who brighten up the path of science for me


Acknowledgements

I have been lucky to have the privilege of studying at The University of Texas at

Austin. During my studies at UT, many people helped me in different ways in completing

this research work.

First, I would like to thank my supervising professors, Prof. Gary A. Pope and

Prof. Kamy Sepehrnoori for their kind supervision and in completing this research. I am

indebted to them for all the useful meetings and discussions I had with them, for helping

me out whenever I was stuck and most importantly, for teaching me how to analyze a

problem and solve it in a rational way.

I am highly grateful to Choongyong Han, Abdoljalil Varavei and Farhad

Tarahhom for their great help with the General Purpose Adaptive Simulator. Numerous

and long discussions with them on the formulation and coding were very useful.

I would also like to thank Kazuhiro Asakawa and Nitin Chowdhury for helping

me get started on my research. Thanks to Ajitabh Kumar for his help on starting use of

CMG GEM. I would also like to thank my friends, Elif Altinay, Vishal Bang, Mohabbat

Ahmadi, Abraham John, Jitendra Mohan, Gholamreza Garmeh, Nariman Fathi, Amir

Jahanbakhsh, Yousef Ghomian, Baosheng Liang, Francisco Marcondes, Morteza

Sayarpour, Hourshad Mohammadi and Davood Ghorbani for helping me in various

different ways, for their good company and for providing me with some useful

suggestions from time to time.

I would also like to take this opportunity to thank the industrial sponsors of this

research; NIOC, Chevron, Marathon Oil, ConocoPhillips, PetroTel, Devon Energy, Shell

and Shengli Oilfields. I would also like to thank CMG Ltd. for providing their tools

v
which includes Builder, GEM, Results 3D, Results Graph and WinProp for my research

and also for their technical support throughout the time. I am specially, thankful to Bruce

Kohse for his help with the asphaltene-related models in CMG GEM and WinProp. I am

also thankful to Clovis R. Maliska Jr. and Marcos Cabral Damiani from ESSS for

providing their post processing software called Kraken which was used for GPAS.

I would also like to thank Ms. Esther Barrientes for taking care of all the

administrative hassles for me. Thanks are also due to Ms. Joanna Castillo for her help

with the computers and network.

Finally, I am highly indebted to my parents, my brother and my sister for their

love and faith in me. Their constant encouragement enabled me to keep going and

complete my research.

vi
Abstract

Development of a Fully Implicit, Parallel, Equation-of-State

Compositional Simulator to Model Asphaltene Precipitation in

Petroleum Reservoirs

by

Waleed Fazelipour, M.S.E.

The University of Texas at Austin, 2005

Supervisors: Gary A. Pope and Kamy Sepehrnoori

Asphaltene precipitation is a serious and complex problem in oil recovery that

affects all aspects of oil production, processing and transportation. It is very important to

predict the asphaltene precipitation during the production process. Many models have

been developed to predict the precipitation behavior of asphaltene.

In this work we present implementation of asphaltene precipitation model into a

fully implicit, three-dimensional, multiphase, multicomponent, parallel, equation-of-state

compositional simulator called GPAS, developed at the Center for Petroleum and

Geosystems Engineering at The University of Texas at Austin. The primary goal of

GPAS, currently under development, is to support realistic, high-resolution reservoir

studies with a million or more gridblocks on massively parallel computers. Key


vii
requirements for this simulator include the ability to handle multiple physical models,

generalized well management, multiple fault blocks, and flexible gridding.

GPAS is developed under the framework named IPARS (Integrated Parallel

Accurate Reservoir Simulator) and is constructed using a Newton-type formulation. The

Peng-Robinson EOS is used for the hydrocarbon phase behavior calculations. The linear

solvers from PETSc package (Portable Extensible Toolkit for Scientific Computation) are

used for the solution of the underlying linear equations. The framework provides

input/output, table lookups, FORTRAN array memory allocation, domain decomposition,

and message passing between processors for updating physical properties in mass-

balance equations in overlapping regions. PETSc handles communications between

processors needed for the linear solver.

After studying many available models in the literature for asphaltene

precipitation, Nghiem's model was chosen for modeling asphaltene precipitation in

GPAS. We believe this implementation has led to a more powerful reservoir simulator

that can be used to predict asphaltene precipitation by small and large oil companies to

help them in the design of complex gas and waterflooding processes on their desktops or

a cluster of computers.

Nghiem's model is a solid model that treats the precipitating asphaltene as a single

component residing in the solid phase while oil and gas phases are modeled with a cubic

EOS. Solid models may require many empirical parameters and a large amount of tuning

to match experimental data.

Since asphaltene precipitation severely reduces both absolute permeability and

relative permeability, it is important to simulate the precipitation behavior of asphaltenes

during the oil production process. Many models have been developed to predict the onset

point and the amount of asphaltene precipitation as well as the change in relative

viii
permeability. In this study, physical properties models were also implemented in GPAS

to estimate the effect of asphaltene precipitation on permeability in order to calculate the

amount of precipitation during oil production.

Compositional simulation results with asphaltene precipitation model indicate that

asphaltene precipitation may damage the oil production in most cases. A key conclusion

of the findings is the ability to predict the deposition of asphaltenes in the reservoir

without the need for generating data from expensive downhole samples.

ix
Table of Contents

Acknowledgements ............................................................................................................v

Abstract............................................................................................................................ vii

Table of Contents ...............................................................................................................x

List of Tables ................................................................................................................. xxii

List of Figures.............................................................................................................. xxvii

List of Figures.............................................................................................................. xxvii

Chapter 1: Introduction ....................................................................................................1


1.1 Introduction........................................................................................................1
1.2 Objectives of this Research................................................................................2
1.3 Brief Description of Chapters ............................................................................3

Chapter 2: Literature Review...........................................................................................7


2.1 Introduction........................................................................................................7
2.2 Nature of Asphaltenes........................................................................................7
2.3 Precipitation of Asphaltenes ..............................................................................8
2.4 Flocculation of Asphaltenes.............................................................................10
2.5 Adsorption of Asphaltenes...............................................................................11
2.6 Deposition of Asphaltenes ...............................................................................12
2.7 Reduction of Permeability Due to Asphaltenes ...............................................13
2.8 Alteration of Reservoir Wettability Due to Asphaltenes .................................15

Chapter 3: Compositional Reservoir Simulation of Asphaltene Precipitation and


Deposition in CMG GEM.......................................................................................17
3.1 Introduction......................................................................................................17
3.2 Representation Of Asphaltene Precipitate .......................................................18
3.3 Asphaltene Precipitation Model.......................................................................19
3.3.1 Thermodynamic Model for Oil and Gas Phases .....................................20
3.3.2 Thermodynamic Model for Solid Phase .................................................21
x
3.3.3 Estimation of Model Parameters.............................................................21
3.3.4 Amount of Asphaltene Precipitation.......................................................22
3.3.5 Mechanistic Aspect of the Model ...........................................................22
3.3.6 Keywords for Asphaltene Precipitation Model.......................................23
3.4 Asphaltene Flocculation Model .......................................................................23
3.4.1 Keyword for Asphaltene Flocculation Model.........................................24
3.5 Asphaltene Deposition Model..........................................................................25
3.5.1 Keywords for Asphaltene Deposition Model .........................................26
3.6 Porosity Alteration Model In CMG GEM .......................................................26
3.7 Permeability Resistance Factor In CMG GEM ...............................................27
3.8 Component Transport Equations .....................................................................29
3.9 Solution Method...............................................................................................31
3.10 One-Dimensional Oil Core Flood Simulation .................................................32
3.10.1 Simulation Input and Reservoir Fluid Data ...................................32
3.10.2 Results and Discussion ..................................................................34
3.11 One-Dimensional Gas Injection Core Flood Simulation .................................34
3.11.1 Simulation Input and Reservoir Fluid Data ...................................35
3.11.2 Results and Discussion ..................................................................36
3.12 Two-Dimensional Radial Model Pressure Depletion Simulation....................39
3.12.1 Reservoir Model and Fluid Description.........................................40
3.12.2 Results and Discussion ..................................................................42
3.13 Two-Dimensional Radial Model Pressure Depletion Simulation with Grid
Refinement and Heterogeneity ........................................................................43
3.13.1 Reservoir Model and Fluid Description.........................................43
3.13.2 Results and Discussion ..................................................................45
3.14 Summary and Conclusions ..............................................................................47

Chapter 4: Review of the General Purpose Adaptive Simulator ................................98


4.1 Introduction......................................................................................................98
4.2 Description of the Framework .......................................................................101
4.2.1 Framework Characteristics ...................................................................102
4.2.2 Framework Functionalities ...................................................................103
xi
4.3 Basic Assumptions.........................................................................................105
4.4 Governing Equations .....................................................................................106
4.4.1 Phase Equilibrium Equations................................................................106
4.4.2 Material Balance Equations ..................................................................107
4.4.3 Volume Constraint Equation.................................................................110
4.5 Phase Behavior...............................................................................................111
4.6 Phase Stability Analysis.................................................................................111
4.7 Flash Calculation ...........................................................................................113
4.7.1 Equality of the Component Fugacity ....................................................114
4.7.2 Composition Constraint ........................................................................114
4.7.3 Rachford-Rice Equation........................................................................115
4.7.4 Equation of State...................................................................................116
4.8 Phase Identification and Tracking .................................................................119
4.9 Physical Property Models ..............................................................................121
4.9.1 Viscosity ...............................................................................................121
4.9.2 Interfacial Tension ................................................................................123
4.9.3 Relative Permeability............................................................................123
4.9.3.1 Corey Model ..........................................................................124
4.9.3.2 Normalized Stone's Model I with Constant Three-Phase Sor 125

4.9.3.3 Normalized Stone's Model I with Variable Three-Phase Sor 126


4.9.3.4 Normalized Stone's Model II .................................................128
4.9.3.5 Corey-type Function with Trapping Number ........................128
4.9.4 Phase Pressure.......................................................................................130
4.9.5 Capillary Pressure .................................................................................131
4.9.6 Formation Porosity................................................................................131
4.9.7 Hydrocarbon Solubility in Water..........................................................131
4.10 Well Models...................................................................................................133
4.10.1 Constant Bottom Hole Flowing Pressure Injector .......................134
4.10.2 Constant Volume Rate Injector....................................................136
4.10.3 Constant Bottom Hole Flowing Pressure Producer .....................138
4.11 Overall Computation of the Simulator...........................................................138
xii
4.11.1 Primary and Secondary Variables................................................138
4.11.2 Solution Procedure.......................................................................139
4.12 Executive Routines in EOSCOMP ................................................................142
4.13 Work Routines in EOSCOMP .......................................................................144
4.14 Description of the Solver ...............................................................................145
4.15 Automatic Time Step Control........................................................................146

Chapter 5: Fully Implicit, EOS Compositional, Parallel Reservoir Simulator


with Asphaltene Precipitation Model..................................................................148
5.1 Introduction....................................................................................................148
5.2 Modeling Asphaltene Precipitation................................................................149
5.2.1 Solid Models .........................................................................................149
5.2.2 Thermodynamic Solubility Models ......................................................151
5.2.3 Thermodynamic Colloidal Models .......................................................153
5.2.4 Thermodynamic Micellization Models.................................................153
5.3 Selection of an Asphaltene Precipitation Model for Compositional
Simulation ......................................................................................................154
5.3.1 Solid Model Approach versus Activity-Coefficient Approach ............154
5.4 Effect of Temperature on Modeling Asphaltene Precipitation ......................156
5.5 Implementation of Asphaltene Precipitation Model into GPAS....................156
5.5.1 Nghiems Model for Asphaltene Precipitation .....................................157
5.5.2 Assumptions..........................................................................................158
5.6 Multiphase Oil-Gas-Solid Flash Calculations for Asphaltene.......................159
5.6.1 Stability Test for Solid Phase................................................................159
5.6.2 Oil-Gas-Solid Flash Calculations .........................................................160
5.7 Modeling Phase Behavior of Solid Precipitate in GPAS...............................163
5.7.1 Coupling the Asphaltene Model and Flash Calculations in
INFLUID0.............................................................................................164
5.7.2 Coupling the Asphaltene Model and Flash Calculations in XWELL...166
5.7.3 Coupling the Asphaltene Model and Flash Calculations in
XUPDATE............................................................................................166
5.8 Modeling Dynamic Aspects of Asphaltene Precipitation..............................169
5.8.1 Asphaltene Adsorption Equations.........................................................170
xiii
5.8.2 Linear Permeability Reduction Model for Plugging due to
Asphaltenes ...........................................................................................171
5.9 Independent Variables ...................................................................................173
5.10 Description of Governing Equations for Asphaltene Precipitation ...............173
5.10.1 Phase Equilibrium Equations.......................................................175
5.10.2 Volume Constraint Equation........................................................175
5.10.3 Mass Conservation Equation for Hydrocarbon Components ......176
5.10.4 Mass Conservation Equation for Water.......................................180
5.10.5 Multiphase Flash Equation ..........................................................181
5.10.6 Solid-Oil Equilibrium Ratio Equation .........................................182
5.11 Derivatives for Construction of the Jacobian Matrix for Modeling
Asphaltene Precipitation ................................................................................183
5.11.1 Derivatives of Governing Equations............................................183
5.11.2 Derivatives of Component Mole Fractions..................................184
5.11.3 Derivatives of the Peng-Robinson Equation-Of-State.................184
5.11.4 Derivatives of the Compressibility Factor ...................................185
5.11.5 Derivatives of Physical Properties ...............................................186
5.12 Residuals of Governing Equations.................................................................187
5.12.1 Residuals of Phase Equilibrium Equations ..................................188
5.12.2 Residual of Volume Constraint Equation ....................................188
5.12.3 Residual of the Mass Conservation Equation for Hydrocarbon
Components ..........................................................................................189
5.12.4 Residual of the Mass Conservation Equation for Water..............190
5.12.5 Residual of the Multiphase Flash Equation .................................190
5.12.6 Residual of the Solid-Oil Equilibrium-Ratio Equation................191
5.13 Jacobian Matrix..............................................................................................191
5.13.1 Jacobian Structure for a Gridblock without Asphaltene
Precipitation ..........................................................................................192
5.13.2 Jacobian Structure for a Single-Phase-Oil Gridcell with
Asphaltene Precipitation .......................................................................193
5.13.3 Jacobian Structure for a Multiphase Oil-Gas-Solid Gridcell .......194
5.14 Solution Method.............................................................................................196
5.15 Implementation of the Asphaltene Precipitation Code ..................................201
xiv
5.15.1 Brief Description of the Main Subroutines..................................202

Chapter 6: Compositional Simulation of Asphaltene Precipitation in GPAS..........209


6.1 Introduction....................................................................................................209
6.2 One-Dimensional Modeling of Asphaltene Precipitation: Case GF1............210
6.3 One-Dimensional Modeling of Asphaltene Precipitation: Case GF3............215
6.4 One-Dimensional Modeling of Asphaltene Precipitation: Case GVM5........219
6.5 Two-Dimensional Modeling of Asphaltene Precipitation: Case GVM10.....224
6.6 Two-Dimensional Modeling of Asphaltene Precipitation: Case GVR8........229
6.7 Three-Dimensional Modeling of Asphaltene Precipitation Under
Waterflooding ................................................................................................233

Chapter 7: Summary, Conclusions and Recommendations ......................................374


7.1 Summary........................................................................................................374
7.2 Conclusions....................................................................................................376
7.3 Recommendations for Future Work...............................................................379

Appendix A: Derivation of the Three-Phase Flash Equation ....................................381

Appendix B: Derivatives of Gas-Oil Fugacity Equations...........................................384


B.1 Derivatives with respect to lnK ig ..................................................................385

B.2 Derivatives with respect to N i .......................................................................386


B.3 Derivatives with respect to P ........................................................................387
B.4 Derivatives with respect to lnK n cs .................................................................388

B.5 Derivatives with respect to L g .......................................................................389

B.6 Derivatives with respect to Ls .......................................................................390

Appendix C: Derivatives of Volume Constraint Equation ........................................392


C.1 Derivatives with respect to lnK ig ..................................................................392

C.2 Derivatives with respect to N i .......................................................................393


C.3 Derivatives with respect to P ........................................................................393
C.4 Derivatives with respect to N w .....................................................................394

xv
C.5 Derivatives with respect to lnK n cs .................................................................395

C.6 Derivatives with respect to L g .......................................................................396

C.7 Derivatives with respect to Ls .......................................................................396

Appendix D: Derivatives of Mass Conservation Equation for Hydrocarbon


Components ...........................................................................................................398
D.1 Derivatives with respect to lnK ig ..................................................................398
D.1.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......398
D.1.2Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....404
D.2 Derivatives with respect to N i .......................................................................406
D.2.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......406
D.2.2Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....412
D.3 Derivatives with respect to P ........................................................................414
D.3.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......414
D.3.2Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....420
D.4 Derivatives with respect to lnK n cs .................................................................422
D.4.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......422
D.4.2Derivatives for the On-Diagonal Elements of the Jacobian Matrix......429
D.5 Derivatives with respect to L g .......................................................................430
D.5.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......430
D.5.2Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....437
D.6 Derivatives with respect to Ls .......................................................................438
D.6.1Derivatives for the On-Diagonal Elements of the Jacobian Matrix......438
D.6.2Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....445

Appendix E: Derivatives of Mass Conservation Equation for Water.......................447


E.1 Derivatives with respect to lnK ig ..................................................................447
E.1.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......447
E.1.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....449
E.2 Derivatives with respect to N w and N i ........................................................450

xvi
E.2.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......450
E.2.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....457
E.3 Derivatives with respect to P ........................................................................458
E.3.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......458
E.3.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....463
E.4 Derivatives with respect to lnK n cs .................................................................467
E.4.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......467
E.4.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....469
E.5 Derivatives with respect to L g .......................................................................470
E.5.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......470
E.5.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....473
E.6 Derivatives with respect to Ls .......................................................................473
E.6.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix......473
E.6.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix .....476

Appendix F: Derivatives of Solid-Oil Fugacity Equation ..........................................478


F.1 Derivatives with respect to lnK ig ..................................................................478

F.2 Derivatives with respect to N i .......................................................................479


F.3 Derivatives with respect to P ........................................................................480
F.4 Derivatives with respect to lnK n cs .................................................................481

F.5 Derivatives with respect to L g .......................................................................481

F.6 Derivatives with respect to Ls .......................................................................482

Appendix G: Derivatives of Multiphase Flash Equation ...........................................483


G.1 Derivatives with respect to lnK ig ..................................................................483

G.2 Derivatives with respect to N i .......................................................................483


G.3 Derivatives with respect to P ........................................................................484
G.4 Derivatives with respect to lnK n cs .................................................................484

G.5 Derivatives with respect to L g .......................................................................484

xvii
G.6 Derivatives with respect to Ls .......................................................................485

Appendix H: Derivatives of Solid-Oil Equilibrium Ratio Equation .........................486


H.1 Derivatives of a Solid-Oil System .................................................................486
H.1.1Derivatives with respect to lnK ig .........................................................486

H.1.2Derivatives with respect to N i ..............................................................486


H.1.3Derivatives with respect to P ...............................................................486
H.1.4Derivatives with respect to lnK n cs ........................................................486

H.1.5Derivatives with respect to L g ..............................................................487

H.1.6Derivatives with respect to Ls ..............................................................487


H.2 Derivatives of a Multiphase System ..............................................................487
H.2.1Derivatives with respect to lnK ig .........................................................487

H.2.2Derivatives with respect to N i ..............................................................487


H.2.3Derivatives with respect to P ...............................................................488
H.2.4Derivatives with respect to lnK n cs ........................................................488

H.2.5Derivatives with respect to L g ..............................................................488

H.2.6Derivatives with respect to Ls ..............................................................488

Appendix I: Derivatives of Component Mole Fraction ..............................................489


I.1 Derivatives of Single Phase System ..............................................................489
I.1.1 Derivatives with respect to lnK ig .........................................................489

I.1.2 Derivatives with respect to N i ..............................................................489

I.1.3 Derivatives with respect to lnK n cs ........................................................490

I.1.4 Derivatives with respect to L g ..............................................................490

I.1.5 Derivatives with respect to Ls ..............................................................490


I.2 Derivatives of a Two-Phase System ..............................................................490
I.2.1 Derivatives with respect to lnK ig .........................................................491

xviii
I.2.2 Derivatives with respect to N i ..............................................................491

I.2.3 Derivatives with respect to lnK n cs ........................................................493

I.2.4 Derivatives with respect to L g ..............................................................494

I.2.5 Derivatives with respect to Ls ..............................................................494


I.3 Derivatives of a Multiphase System ..............................................................494
I.3.1 Derivatives with respect to lnK ig .........................................................495

I.3.2 Derivatives with respect to N i ..............................................................496

I.3.3 Derivatives with respect to lnK n cs ........................................................497

I.3.4 Derivatives with respect to L g ..............................................................497

I.3.5 Derivatives with respect to Ls ..............................................................498

Appendix J: Derivatives of the Peng-Robinson EOS..................................................499


Z Z
J.1 Derivation of and ...........................................................................499
x io P
J.2 Derivatives of Fugacity Coefficient...............................................................501
J.2.1 Derivatives with respect to x ij ..............................................................501
J.2.2 Derivatives with respect to P ...............................................................503

Appendix K: Derivatives of the Compressibility Factor ............................................504


K.1 Derivatives with respect to lnK ig ..................................................................504

K.2 Derivatives with respect to N i .......................................................................504


K.3 Derivatives with respect to lnK n cs .................................................................504

K.4 Derivatives with respect to Lg .......................................................................505

K.5 Derivatives with respect to Ls .......................................................................505


Z j Z j
K.6 Relationship between and .............................................................505
x ij n ij

Appendix L: Derivatives of Physical Properties .........................................................507


L.1 Derivatives of Molar Density.........................................................................507
xix
L.1.1 Derivatives with respect to lnK ig .........................................................507

L.1.2 Derivatives with respect to N i ..............................................................507


L.1.3 Derivatives with respect to lnK n cs ........................................................507

L.1.4 Derivatives with respect to Lg ..............................................................507

L.1.5 Derivatives with respect to Ls ..............................................................508


L.2 Derivatives of Phase Saturation .....................................................................508
L.2.1 Derivatives with respect to lnK ig .........................................................508

L.2.2 Derivatives with respect to N i ..............................................................509


L.2.3 Derivatives with respect to P ...............................................................509
L.2.4 Derivatives with respect to lnK n cs ........................................................510

L.2.5 Derivatives with respect to Lg ..............................................................511

L.2.6 Derivatives with respect to Ls ..............................................................512


L.3 Derivatives of Relative Permeability .............................................................513
L.3.1 Derivatives with respect to lnK ig .........................................................513

L.3.2 Derivatives with respect to N i ..............................................................513


L.3.3 Derivatives with respect to P ...............................................................514
L.3.4 Derivatives with respect to lnK n cs ........................................................514

L.3.5 Derivatives with respect to Lg ..............................................................515

L.3.6 Derivatives with respect to Ls ..............................................................515


L.4 Derivatives of Viscosity.................................................................................515
L.4.1 Derivatives with respect to lnK ig .........................................................518

L.4.2 Derivatives with respect to N i ..............................................................519


L.4.3 Derivatives with respect to P ...............................................................519
L.4.4 Derivatives with respect to lnK n cs ........................................................519

L.4.5 Derivatives with respect to Lg ..............................................................519

xx
L.4.6 Derivatives with respect to Ls ..............................................................519

Appendix M: Code Variables for Modeling Asphaltene Precipitation in GPAS.....520


M.1 Description of the Variables for Asphaltene Precipitation Code...................520
M.1.1 Residuals of the Governing Equations.........................................520
M.1.2 Derivatives of the Governing Equations......................................521
M.1.2.1 Derivatives of Gas-Oil Fugacity Equations.............................521
M.1.2.2 Derivatives of Volume Constraint Equation ...........................522
M.1.2.3 Derivatives of Mass Balance Equation for Hydrocarbon
Components .................................................................................522
M.1.2.4 Derivatives of Mass Balance Equation for Water
Component...................................................................................523
M.1.2.5 Derivatives of Solid-Oil Fugacity Equation (new)..................524
M.1.2.6 Derivatives of Multiphase Flash Equation (new)....................525
M.1.2.7 Derivatives of Solid-Oil Equilibrium Ratio Equation (new)...525
M.1.3 Other Derivatives .........................................................................526
M.1.4 Other Grid Element Variables .....................................................529
M.1.5 Scalar Variables for Modeling Asphaltene Precipitation.............532
M.2 List of New Grid Element Variables .............................................................534
M.3 List of New Scalar Variables .........................................................................536

Appendix N: Sample Code Development Guide to Model Asphaltene


Precipitation in GPAS ..........................................................................................537

Appendix O: Sample Input File with Asphaltene for CMG GEM............................593

Appendix P: Sample Input File with Asphaltene for GPAS ......................................598

Nomenclature .................................................................................................................604

References .......................................................................................................................610

Vita .................................................................................................................................620

xxi
List of Tables

Table 3.1: Modeled fluid composition for Weyburn dead oil...........................................49

Table 3.2: Core data for oil core flood simulation ............................................................49

Table 3.3: Deposition model parameters for oil core flood simulation ............................50

Table 3.4: PVT properties of Weyburn dead oil ...............................................................51

Table 3.5: Binary Interaction Parameters for different components for Weyburn fluid...52

Table 3.6: Liquid-gas relative permeability and capillary pressure table .........................52

Table 3.7: Water-oil relative permeability and capillary pressure table ...........................53

Table 3.8: The fluid compositions and molecular weights of dead oil and separator

gas .................................................................................................................53

Table 3.9: The composition of core oil and injection gas .................................................54

Table 3.10: Core displacement data for North Sea fluid...................................................54

Table 3.11: The PVT properties of North Sea fluid..........................................................55

Table 3.12: Binary interaction parameters for the North Sea fluid...................................55

Table 3.13: Liquid-gas relative permeability and capillary pressure table .......................56

Table 3.14: Water-oil relative permeability and capillary pressure table .........................56

Table 3.15: Modeled fluid composition for Burke Oil 1 ...............................................57

Table 3.16: Two-dimensional radial model data for oil depletion simulation ..................57

Table 3.17: Input parameters for the deposition and flocculation models ........................58

Table 3.18: The Burke oil PVT properties........................................................................59

Table 3.19: Liquid-gas relative permeability & capillary pressure table for rock 1 .........60

Table 3.20: Liquid-gas relative permeability & capillary pressure table for rock 2 .........60

Table 3.21: Water-oil relative permeability & capillary pressure table for rock 1 ...........61

xxii
Table 3.22: Water-oil relative permeability & capillary pressure table for rock 2 ...........61

Table 3.23: Input parameters for asphaltene precipitation model.....................................61

Table 3.24: Modeled fluid composition for Burke Oil 1 ...............................................62

Table 3.25: Parameters for asphaltene precipitation model ..............................................62

Table 3.26: Input parameters for the asphaltene deposition model...................................63

Table 3.27: Input parameters for the asphaltene flocculation model ................................63

Table 3.28: 2-D radial model data for oil depletion simulation with grid refinement ......64

Table 3.29: The Burke Oil 1 PVT properties ................................................................65

Table 3.29: The Burke Oil 1 PVT properties (continued) .............................................66

Table 3.30: Liquid-gas relative permeability & capillary pressure table..........................67

Table 3.31: Water-oil relative permeability & capillary pressure table............................67

Table 3.32: Binary interaction coefficients between the components ..............................68

Table 3.33: Well data for the 2-dimensional radial model................................................69

Table 5.1: Summary of code added to GPAS for modeling asphaltene precipitation ....204

Table 6.1: Data for modeling the porous medium (Case GF1).......................................236

Table 6.2: Grid data for the 30-gridblock scenario (Case GF1)......................................236

Table 6.3: Grid data for the 60-gridblock scenario (Case GF1)......................................237

Table 6.4: Properties of water (Case GF1)......................................................................237

Table 6.5: Characteristics of fluid considered (Case GF1) .............................................238

Table 6.6: Modeled fluid composition (Case GF1).........................................................238

Table 6.7: PVT properties for the modeled fluid (Case GF1).........................................239

Table 6.8: Binary Interaction Coefficients between different components (Case GF1).239

Table 6.9: Water-oil relative permeability table (Case GF1)..........................................240

Table 6.10: Liquid-gas relative permeability table (Case GF1)......................................240

Table 6.11: Well specifications for the 30-gridblock scenario (Case GF1)....................241

xxiii
Table 6.12: Well specifications for the 60-gridblock scenario (Case GF1)....................242

Table 6.13: Injected fluid composition (Case GF1)........................................................243

Table 6.14: Input parameters for the asphaltene precipitation model (Case GF1) .........243

Table 6.15: Summary of runs made for sensitivity and comparative studies (Case

GF1) ............................................................................................................244

Table 6.16: Data for modeling the porous medium (Case GF3).....................................245

Table 6.17: Grid data for the 30-gridblock scenario (Case GF3)....................................245

Table 6.18: Grid data for the 60-gridblock scenario (Case GF3)....................................246

Table 6.19: Properties of water (Case GF3)....................................................................246

Table 6.20: Characteristics of fluid considered (Case GF3) ...........................................247

Table 6.21: Modeled fluid composition (Case GF3).......................................................247

Table 6.22: PVT properties for the modeled fluid (Case GF3).......................................248

Table 6.23: Binary Interaction Coefficients between different components (Case

GF3) ............................................................................................................248

Table 6.24: Water-oil relative permeability table (Case GF3)........................................249

Table 6.25: Liquid-gas relative permeability table (Case GF3)......................................249

Table 6.26: Well specifications for the 30-gridblock scenario (Case GF3)....................250

Table 6.27: Well specifications for the 60-gridblock scenario (Case GF3)....................251

Table 6.28: Injected fluid composition (Case GF3)........................................................252

Table 6.29: Input parameters for the asphaltene precipitation model (Case GF3) .........252

Table 6.30: Summary of runs made for sensitivity and comparative studies (Case

GF3) ............................................................................................................253

Table 6.31: Data for modeling porous medium (Case GVM5).......................................254

Table 6.32: Grid data for the 30-gridblock scenario (Case GVM5) ...............................254

Table 6.33: Grid data for the 60-gridblock scenario (Case GVM5) ...............................255

xxiv
Table 6.34: Properties of water (Case GVM5) ...............................................................255

Table 6.35: Characteristics of fluid considered (Case GVM5).......................................256

Table 6.36: Modeled fluid composition (Case GVM5) ..................................................256

Table 6.37: PVT properties for the modeled fluid (Case GVM5) ..................................257

Table 6.38: Binary Interaction Coefficients between components (Case GVM5) .........257

Table 6.39: Water-oil relative permeability table (Case GVM5)....................................258

Table 6.40: Liquid-gas relative permeability table (Case GVM5)..................................258

Table 6.41: Well specifications for the 30-gridblock scenario (Case GVM5)................259

Table 6.42: Well specifications for the 60-gridblock scenario (Case GVM5)................260

Table 6.43: Injected fluid composition (Case GVM5)....................................................261

Table 6.44: Input parameters for the asphaltene precipitation model (Case GVM5) .....261

Table 6.45: Summary of runs for sensitivity and comparative studies (Case GVM5) ...262

Table 6.46: Data for modeling the porous medium (Case GVM10)...............................263

Table 6.47: Grid system used (Case GVM10) ................................................................263

Table 6.48: Properties of water (Case GVM10) .............................................................264

Table 6.49: Characteristics of fluid considered (Case GVM10).....................................265

Table 6.50: Modeled fluid composition (Case GVM10) ................................................265

Table 6.51: PVT properties for the modeled fluid (Case GVM10) ................................266

Table 6.52: Binary Interaction Coefficients between components (Case GVM10) .......266

Table 6.53: Water-oil relative permeability table (Case GVM10)..................................267

Table 6.54: Liquid-gas relative permeability table (Case GVM10)................................267

Table 6.55: Well specifications (Case GVM10) .............................................................268

Table 6.56: Injected fluid composition (Case GVM10)..................................................269

Table 6.57: Input parameters for the asphaltene precipitation model (Case GVM10) ...269

Table 6.58: Summary of runs for sensitivity and comparative studies (Case GVM10) .270

xxv
Table 6.59: Data for modeling the porous medium (Case GVR8)..................................271

Table 6.60: Grid system used (Case GVR8) ...................................................................271

Table 6.61: Properties of water (Case GVR8) ................................................................272

Table 6.62: Characteristics of fluid considered (Case GVR8)........................................273

Table 6.63: Modeled fluid composition (Case GVR8) ...................................................273

Table 6.64: PVT properties for the modeled fluid (Case GVR8) ...................................274

Table 6.65: Binary Interaction Coefficients between components (Case GVR8) ..........274

Table 6.66: Water-oil relative permeability table (Case GVR8) ....................................275

Table 6.67: Liquid-gas relative permeability table (Case GVR8) ..................................275

Table 6.68: Well specifications (Case GVR8) ................................................................276

Table 6.69: Injected fluid composition (Case GVR8).....................................................277

Table 6.70: Input parameters for the asphaltene precipitation model (Case GVR8) ......277

Table 6.71: Summary of runs for sensitivity and comparative studies (Case GVR8) ....278

Table 6.72: Data for modeling the reservoir (Case 6.7)..................................................279

Table 6.73: Grid system used (Case 6.7) ........................................................................279

Table 6.74: Characteristics of reservoir fluid (Case 6.7) ................................................280

Table 6.75: Modeled reservoir fluid composition (Case 6.7) .........................................280

Table 6.76: PVT properties for the reservoir fluid (Case 6.7) ........................................281

Table 6.77: Binary Interaction Coefficients between components (Case 6.7)................281

Table 6.78: Water-oil relative permeability table (Case 6.7)..........................................282

Table 6.79: Liquid-gas relative permeability table (Case 6.7)........................................282

Table 6.80: Well specifications (Case 6.7) .....................................................................283

Table 6.81: Properties of water (Case 6.7)......................................................................284

Table 6.82: Input parameters for the asphaltene precipitation model (Case 6.7)............284

xxvi
List of Figures

Figure 3.1: Schematic representation of the oil core flood simulation .............................70

Figure 3.2: The liquid-gas relative permeability curves ...................................................71

Figure 3.3: The water-oil relative permeability curves.....................................................72

Figure 3.4: Permeability resistance factor vs. length ........................................................73

Figure 3.5: Deposition induced permeability reduction....................................................73

Figure 3.6: Schematic representation of the gas injection core flood simulation .............74
Figure 3.7: S g and interfacial tension, k12 = 0.0 day 1 and = 0.0 day 1 ....................75

Figure 3.8: Precipitated asphaltene, k 21 = 0.0 day 1 and = 0.0 day 1 .........................76

Figure 3.9: Flocculated asphaltene, k 21 = 0.0 day 1 and = 0.0 day 1 .........................76

Figure 3.10: Precipitated asphaltene, k12 = 10.0 day 1 and = 0 day 1 ........................77

Figure 3.11: Flocculated asphaltene, k12 = 10.0 day 1 and = 0 day 1 ........................77

Figure 3.12: Precipitated asphaltene, k12 = 100 day 1 and = 0 day 1 .........................78

Figure 3.13: Flocculated asphaltene, k12 = 100 day 1 and = 0 day 1 .........................78

Figure 3.14: Precipitated asphaltene, k12 = 10 day 1 and k 21 = 1 day 1 .........................79

Figure 3.15: Precipitated asphaltene, k12 = 10 day 1 and k 21 = 10 day 1 ........................79

Figure 3.16: Flocculated asphaltene, k12 = 10 day 1 and k 21 = 1 day 1 ..........................80

Figure 3.17: Flocculated asphaltene, k12 = 10 day 1 and k 21 = 10 day 1 ........................80

Figure 3.18: Deposited asphaltene, k12 = 10 day 1 and k 21 = 1 day 1 ...........................81

Figure 3.19: Deposited asphaltene, k12 = 10 day 1 and k 21 = 10 day 1 ..........................81

Figure 3.20: Schematic representation of the radial reservoir in 3-D viewpoint..............82

Figure 3.21: Schematic of the radial reservoir including the production well..................82

Figure 3.22: The liquid-gas relative permeability curves for rock type 1.........................83
xxvii
Figure 3.23: The liquid-gas relative permeability curves for rock type 2.........................83

Figure 3.24: The water-oil relative permeability curves for rock type 1 ..........................84

Figure 3.25: The water-oil relative permeability curves for rock type 2 ..........................84

Figure 3.26: The liquid-gas capillary pressure curve for rock type 1 ...............................85

Figure 3.27: The liquid-gas capillary pressure curve for rock type 2 ...............................85

Figure 3.28: The water-oil capillary pressure curve for rock type 1.................................86

Figure 3.29: The water-oil capillary pressure curve for rock type 2.................................86

Figure 3.30: Three-phase oil relative permeability for rock type 1 ..................................87

Figure 3.31: Three-phase oil relative permeability for rock type 2 ..................................87

Figure 3.32: Development of solid deposition for single-well simulation .......................88

Figure 3.33: Development of resistance factor for radial model simulation ....................88

Figure 3.34: Block pressure as a function of time for pressure depletion simulation.......89

Figure 3.35: Deposited asphaltene, permeability resistance factor and block pressure....89

Figure 3.36: Deposited asphaltene (lb/cu. ft bulk vol.) after 1 year production ...............90

Figure 3.37: Schematic representation of the radial reservoir with grid refinement ........91

Figure 3.38: Schematic of the radial reservoir with grid refinement including the well ..91

Figure 3.39: Burke Oil 1 asphaltene modeling P-T Diagram........................................92

Figure 3.40: The liquid-gas relative permeability curves .................................................92

Figure 3.41: The water-oil relative permeability curves...................................................93

Figure 3.42: The liquid-gas capillary pressure curve........................................................93

Figure 3.43: The water-oil capillary pressure curve .........................................................94

Figure 3.44: Three-phase oil relative permeability...........................................................94

Figure 3.45: Development of solid deposition for single-well with heterogeneity ..........95

Figure 3.46: Development of resistance factor for radial model with grid refinement ....95

Figure 3.47: Block pressure for 2-D radial model with grid refinement ..........................96

xxviii
Figure 3.48: Deposited asphaltene, permeability resistance factor and block pressure....96

Figure 3.49: Deposited asphaltene (lb/cu. ft bulk vol.) after 1 year production ...............97

Figure 5.1: The overall structure of GPAS with the capability of modeling asphaltene

precipitation ................................................................................................207

Figure 6.1: Schematic representation of the discretized porous media used in Case

GF1 .............................................................................................................285

Figure 6.2: Location of injection and production wells used in Case GF1.....................285

Figure 6.3: Water-oil relative permeability curves (Case GF1)......................................286

Figure 6.4: Liquid-gas relative permeability curves (Case GF1)....................................286

Figure 6.5: Three-phase oil relative permeability for rock type 1 by Stones first

model (Case GF1) .......................................................................................287

Figure 6.6: Three-phase oil relative permeability for rock type 1 by Stones second

model (Case GF1) .......................................................................................288

Figure 6.7: Schematic representation of the fluid flow pattern in 3-dimensional

viewpoint (Case GF1) .................................................................................289

Figure 6.8: Schematic representation of the fluid flow vectors in areal viewpoint

(Case GF1) ..................................................................................................289

Figure 6.9: Static asphaltene Precipitation curve for the reservoir fluid used (Case

GF1) ............................................................................................................290

Figure 6.10: Comparison of average pressure without and with the effect of

asphaltene precipitation (Case GF1)...........................................................290

Figure 6.11: Comparison of pressure profile without (top) and with (bottom) the

effect of asphaltene precipitation at 685 PV injected (Case GF1)..............291

Figure 6.12: Comparison of oil rate without and with the effect of asphaltene (Case

GF1) ............................................................................................................292

xxix
Figure 6.13: Comparison of injector bottom-hole pressure without and with the effect

of asphaltene precipitation (Case GF1).......................................................292


Figure 6.14: Pressure profile at 685 PV injected for R f ,max of 2 (Case GF1) ................293

Figure 6.15: Pressure profile at 685 PV injected for R f ,max of 3 (Case GF1) ................293

Figure 6.16: Pressure profile at 685 PV injected for R f ,max of 4 (Case GF1) ................294

Figure 6.17: Pressure profile at 685 PV injected for R f ,max of 5 (Case GF1) ................294

Figure 6.18: Sensitivity of average pressure to maximum permeability resistance

factor (Case GF1)........................................................................................295


Figure 6.19: Sensitivity of oil rate to maximum resistance factor (Case GF1) ..............295
Figure 6.20: Pressure profile at 685 PV injected for w as,max of 0.0005 (Case GF1) ......296

Figure 6.21: Pressure profile at 685 PV injected for w as,max of 0.0010 (Case GF1) ......296

Figure 6.22: Pressure profile at 685 PV injected for w as,max of 0.0015 (Case GF1) ......297

Figure 6.23: Pressure profile at 685 PV injected for w as,max of 0.0020 (Case GF1) ......297

Figure 6.24: Sensitivity of average pressure to the maximum mass fraction of

adsorbed solid (Case GF1)..........................................................................298

Figure 6.25: Average pressure under the effect of gridblock discretion (Case GF1) .....298

Figure 6.26: Comparison of the oil rate under the effect of gridblock discretion with

the effect of asphaltene precipitation (Case GF1).......................................299

Figure 6.27: Comparison of the pressure profile under the effect of gridblock

discretion with the effect of asphaltene precipitation at 685 PV injected

(Case GF1) ..................................................................................................300

Figure 6.28: Comparison of the average pressure between CMG GEM and GPAS

with the effect of asphaltene precipitation (Case GF1) ..............................301

Figure 6.29: Comparison of the oil rate between CMG GEM and GPAS (Case GF1) ..301

xxx
Figure 6.30: Schematic representation of the discretized porous media used in Case

GF3 .............................................................................................................302

Figure 6.31: Location of injection and production wells used in Case GF3...................302

Figure 6.32: Water-oil relative permeability curves (Case GF3)....................................303

Figure 6.33: Liquid-gas relative permeability curves (Case GF3)..................................303

Figure 6.34: Three-phase oil relative permeability for rock type 1 by Stones first

model (Case GF3) .......................................................................................304

Figure 6.35: Three-phase oil relative permeability for rock type 1 by Stones second

model (Case GF3) .......................................................................................305

Figure 6.36: Schematic representation of the fluid flow pattern in 3-dimensional

viewpoint (Case GF3) .................................................................................306

Figure 6.37: Schematic representation of the fluid flow vectors in areal viewpoint

(Case GF3) ..................................................................................................306

Figure 6.38: Static asphaltene precipitation curve for the reservoir fluid used (Case

GF3) ............................................................................................................307

Figure 6.39: Comparison of average pressure with and without the effect of

asphaltene precipitation (Case GF3)...........................................................307

Figure 6.40: Comparison of pressure profile without (top) and with (bottom) the

effect of asphaltene precipitation at 80 PV injected (Case GF3)................308

Figure 6.41: Comparison of oil rate without and with the effect of asphaltene (Case

GF3) ............................................................................................................309

Figure 6.42: Comparison of the injector bottom-hole pressure without and with the

effect of asphaltene precipitation (Case GF3) ............................................309


Figure 6.43: Pressure profile at 80 PV injected for R f ,max of 2 (Case GF3) ..................310

Figure 6.44: Pressure profile at 80 PV injected for R f ,max of 4 (Case GF3) ..................310

xxxi
Figure 6.45: Pressure profile at 80 PV injected for R f ,max of 5 (Case GF3) ..................311

Figure 6.46: Pressure profile at 80 PV injected for R f ,max of 6 (Case GF3) ..................311

Figure 6.47: Pressure profile at 80 PV injected for R f ,max of 8 (Case GF3) ..................312

Figure 6.48: Pressure profile at 80 PV injected for R f ,max of 10 (Case GF3) ................312

Figure 6.49: Sensitivity of average pressure to the maximum permeability resistance

factor (Case GF3)........................................................................................313

Figure 6.50: Sensitivity of oil rate to the maximum resistance factor (Case GF3).........313

Figure 6.51: Sensitivity of average pressure to the maximum mass fraction of


adsorbed solid (Case GF3)..........................................................................314

Figure 6.52: Average pressure under the effect of gridblock discretion (Case GF3) .....314

Figure 6.53: Comparison of the oil rate under the effect of gridblock discretion with

the effect of asphaltene precipitation (Case GF3).......................................315

Figure 6.54: Comparison of the pressure profile under the effect of gridblock

discretion with the effect of asphaltene precipitation at 80 PV injected

(Case GF3) ..................................................................................................316

Figure 6.55: Comparison of the average pressure between CMG GEM and GPAS

with the effect of asphaltene precipitation (Case GF3) ..............................317


Figure 6.56: Comparison of the oil rate between CMG GEM and GPAS (Case GF3) ..317

Figure 6.57: Schematic representation of the discretized porous media used in Case

GVM5 .........................................................................................................318

Figure 6.58: Location of injection and production wells used in Case GVM5 ..............318

Figure 6.59: Water-oil relative permeability curves (Case GVM5) ...............................319

Figure 6.60: Liquid-gas relative permeability curves (Case GVM5) .............................319

Figure 6.61: Three-phase oil relative permeability for rock type 1 by Stones first

model (Case GVM5)...................................................................................320


xxxii
Figure 6.62: Three-phase oil relative permeability for rock type 1 by Stones second

model (Case GVM5)...................................................................................321

Figure 6.63: Schematic representation of the fluid flow pattern in 3-dimensional

viewpoint (Case GVM5).............................................................................322

Figure 6.64: Schematic representation of the fluid flow vectors in areal viewpoint

(Case GVM5)..............................................................................................322

Figure 6.65: Static asphaltene precipitation curve for the reservoir fluid (Case

GVM5)........................................................................................................323

Figure 6.66: Comparison of average pressure without and with the effect of

asphaltene precipitation (Case GVM5).......................................................323

Figure 6.67: Comparison of the pressure profile without (top) and with (bottom) the

effect of asphaltene precipitation at 67 PV injected (Case GVM5)............324

Figure 6.68: Comparison of the oil rate without and with the effect (Case GVM5) ......325

Figure 6.69: Comparison of the injector bottom-hole pressure without and with the

effect of asphaltene precipitation (Case GVM5) ........................................325


Figure 6.70: Pressure profile at 67 PV injected for R f ,max of 2 (Case GVM5) ..............326

Figure 6.71: Pressure profile at 67 PV injected for R f ,max of 4 (Case GVM5) ..............326

Figure 6.72: Pressure profile at 67 PV injected for R f ,max of 5 (Case GVM5) ..............327

Figure 6.73: Pressure profile at 67 PV injected for R f ,max of 6 (Case GVM5) ..............327

Figure 6.74: Pressure profile at 67 PV injected for R f ,max of 8 (Case GVM5) ..............328

Figure 6.75: Pressure profile at 67 PV injected for R f ,max of 10 (Case GVM5) ............328

Figure 6.76: Sensitivity of average pressure to maximum permeability resistance

factor (Case GVM5) ...................................................................................329

Figure 6.77: Sensitivity of oil rate to maximum resistance factor (Case GVM5) ..........329
Figure 6.78: Pressure profile at 67 PV injected for w as,max of 0.0005 (Case GVM5) ....330

xxxiii
Figure 6.79: Pressure profile at 67 PV injected for w as,max of 0.0010 (Case GVM5) ....330

Figure 6.80: Pressure profile at 67 PV injected for w as,max of 0.0015 (Case GVM5) ....331

Figure 6.81: Pressure profile at 67 PV injected for w as,max of 0.0020 (Case GVM5) ....331

Figure 6.82: Sensitivity of average pressure to the maximum mass fraction of

adsorbed solid (Case GVM5)......................................................................332

Figure 6.83: Average pressure under the effect of gridblock discretion (Case GVM5).332

Figure 6.84: Comparison of the oil rate under the effect of gridblock discretion with

asphaltene precipitation (Case GVM5).......................................................333


Figure 6.85: Comparison of the pressure profile under the effect of gridblock

discretion with the effect of asphaltene precipitation at 67 PV injected

(Case GVM5)..............................................................................................334

Figure 6.86: Comparison of the average pressure between CMG GEM and GPAS

with the effect of asphaltene precipitation (Case GVM5) ..........................335

Figure 6.87: Comparison of the oil rate between CMG GEM and GPAS (Case

GVM5)........................................................................................................335

Figure 6.88: Schematic representation of the discretized porous media used in Case

GVM10 .......................................................................................................336
Figure 6.89: Location of injection and production wells used in Case GVM10 ............336

Figure 6.90: Water-oil relative permeability curves (Case GVM10) .............................337

Figure 6.91: Liquid-gas relative permeability curves (Case GVM10) ...........................337

Figure 6.92: Three-phase oil relative permeability for rock type 1 by Stones first

model (Case GVM10).................................................................................338

Figure 6.93: Three-phase oil relative permeability for rock type 1 by Stones second

model (Case GVM10).................................................................................339

xxxiv
Figure 6.94: Schematic representation of the fluid flow pattern in 3-dimensional

viewpoint (Case GVM10)...........................................................................340

Figure 6.95: Schematic representation of the fluid flow vectors in areal viewpoint

(Case GVM10)............................................................................................340

Figure 6.96: Static asphaltene precipitation curve for reservoir fluid used (Case

GVM10)......................................................................................................341

Figure 6.97: Comparison of average pressure without and with the effect of

asphaltene precipitation (Case GVM10).....................................................341

Figure 6.98: Comparison of pressure profile without (top) and with (bottom) the

effect of asphaltene precipitation at 68 PV injected (Case GVM10)..........342

Figure 6.99: Comparison of producer oil rate without and with the effect (Case

GVM10)......................................................................................................343

Figure 6.100: Comparison of injector bottom-hole pressure without and with the

effect of asphaltene precipitation (Case GVM10) ......................................343


Figure 6.101: Pressure profile at 68 PV injected for R f ,max of 2 (Case GVM10) ..........344

Figure 6.102: Pressure profile at 68 PV injected for R f ,max of 3 (Case GVM10) ..........344

Figure 6.103: Pressure profile at 68 PV injected for R f ,max of 4 (Case GVM10) ..........345

Figure 6.104: Pressure profile at 68 PV injected for R f ,max of 5 (Case GVM10) ..........345

Figure 6.105: Sensitivity of average pressure to the maximum permeability resistance

factor (Case GVM10) .................................................................................346

Figure 6.106: Sensitivity of oil rate to the maximum resistance factor (Case GVM10) 346
Figure 6.107: Pressure profile at 68 PV injected for w as,max of 0.0010 (Case GVM10) 347

Figure 6.108: Pressure profile at 68 PV injected for w as,max of 0.0013 (Case GVM10) 347

Figure 6.109: Pressure profile at 68 PV injected for w as,max of 0.0015 (Case GVM10) 348

Figure 6.110: Pressure profile at 68 PV injected for w as,max of 0.0020 (Case GVM10) 348

xxxv
Figure 6.111: Sensitivity of average pressure to w as,max (Case GVM10).......................349

Figure 6.112: Sensitivity of injector bottom-hole pressure to w as,max (Case GVM10) ..349

Figure 6.113: Pressure profile at 68 PV injected for vs of 0.6 litres/gmol (Case

GVM10)......................................................................................................350
Figure 6.114: Pressure profile at 68 PV injected for vs of 0.8 litres/gmol (Case

GVM10)......................................................................................................350
Figure 6.115: Pressure profile at 68 PV injected for vs of 1.2 litres/gmol (Case

GVM10)......................................................................................................350

Figure 6.116: Sensitivity of average pressure to the solid molar volume (Case

GVM10)......................................................................................................351

Figure 6.117: Sensitivity of producer oil rate to the solid molar volume (Case

GVM10)......................................................................................................351

Figure 6.118: Sensitivity of bottom-hole pressure to solid molar volume (Case

GVM10)......................................................................................................352

Figure 6.119: Comparison of the average pressure between CMG GEM and GPAS

with the effect of asphaltene precipitation (Case GVM10) ........................352

Figure 6.120: Comparison of the producer oil rate between CMG GEM and GPAS

with the effect of asphaltene precipitation (Case GVM10) ........................353

Figure 6.121: Comparison of injector bottom-hole pressure (Case GVM10) ................353

Figure 6.122: Schematic representation of the discretized porous media used in Case

GVR8 ..........................................................................................................354

Figure 6.123: Location of injection and production wells used in Case GVR8 .............354

Figure 6.124: Water-oil relative permeability curves (Case GVR8) ..............................355

Figure 6.125: Liquid-gas relative permeability curves (Case GVR8) ............................355

xxxvi
Figure 6.126: Three-phase oil relative permeability for rock type 1 by Stones first

model (Case GVR8)....................................................................................356

Figure 6.127: Three-phase oil relative permeability for rock type 1 by Stones second

model (Case GVR8)....................................................................................357

Figure 6.128: Schematic representation of the fluid flow pattern in 3-dimensional

viewpoint (Case GVR8)..............................................................................358

Figure 6.129: Schematic representation of flow vectors in areal viewpoint (Case

GVR8).........................................................................................................358

Figure 6.130: Static asphaltene precipitation curve for reservoir fluid used (Case

GVR8).........................................................................................................359

Figure 6.131: Comparison of the average pressure without and with the effect of

asphaltene precipitation (Case GVR8)........................................................359

Figure 6.132: Comparison of pressure profile without (top) and with (bottom) the

effect of asphaltene precipitation at 73 PV injected (Case GVR8) ............360

Figure 6.133: Comparison of producer oil rate without and with the effect (Case

GVR8).........................................................................................................361

Figure 6.134: Comparison of injector bottom-hole pressure without and with the

effect of asphaltene precipitation (Case GVR8) .........................................361


Figure 6.135: Pressure profile at 73 PV injected for R f ,max of 2 (Case GVR8) .............362

Figure 6.136: Pressure profile at 73 PV injected for R f ,max of 3 (Case GVR8) .............362

Figure 6.137: Pressure profile at 73 PV injected for R f ,max of 4 (Case GVR8) .............363

Figure 6.138: Pressure profile at 73 PV injected for R f ,max of 5 (Case GVR8) .............363

Figure 6.139: Sensitivity of average pressure to maximum resistance factor (Case

GVR8).........................................................................................................364

xxxvii
Figure 6.140: Sensitivity of producer oil rate to the maximum permeability resistance

factor (Case GVR8) ....................................................................................364


Figure 6.141: Pressure profile at 73 PV injected for w as,max of 0.0010 (Case GVR8) ...365

Figure 6.142: Pressure profile at 73 PV injected for w as,max of 0.0013 (Case GVR8) ...365

Figure 6.143: Pressure profile at 73 PV injected for w as,max of 0.0015 (Case GVR8) ...366

Figure 6.144: Pressure profile at 73 PV injected for w as,max of 0.0020 (Case GVR8) ...366

Figure 6.145: Sensitivity of average pressure to w as,max (Case GVR8)..........................367

Figure 6.146: Sensitivity of injector bottom-hole pressure to w as,max (Case GVR8) .....367

Figure 6.147: Pressure profile at 73 PV injected for vs of 0.6 litres/gmol (Case

GVR8).........................................................................................................368
Figure 6.148: Pressure profile at 73 PV injected for vs of 0.8 litres/gmol (Case

GVR8).........................................................................................................368
Figure 6.149: Pressure profile at 73 PV injected for vs of 1.2 litres/gmol (Case

GVR8).........................................................................................................368

Figure 6.150: Sensitivity of average pressure to the solid molar volume (Case GVR8)369

Figure 6.151: Sensitivity of producer oil rate to the solid molar volume (Case GVR8) 369

Figure 6.152: Sensitivity of injector pressure to the solid molar volume (Case GVR8) 370

Figure 6.153: Comparison of average pressure between CMG GEM and GPAS with

the effect of asphaltene precipitation (Case GVR8) ...................................370

Figure 6.154: Comparison of the oil rate between CMG GEM and GPAS (Case

GVR8).........................................................................................................371

Figure 6.156: Schematic representation of the discretized reservoir used in

waterflooding ..............................................................................................372

Figure 6.157: Sensitivity of average pressure to maximum resistance factor (Case

6.7) ..............................................................................................................372

xxxviii
Figure 6.158: Sensitivity of producer oil rate to the maximum permeability resistance

factor (Case 6.7)..........................................................................................373

xxxix
Chapter 1: Introduction

1.1 INTRODUCTION

One of the most important phenomena in the oil industry is the precipitation of

heavy organic materials such as asphaltene in petroleum reservoirs and also equipment

for oil processing and transportation, which can cause several flow assurance problems

and undermine the economy and safety of the operation. For instance, asphaltene

precipitation in oil reservoirs can cause diffusivity reduction and wettability alteration in

reservoir rock and finally affect the oil production and economical efficiency.

Asphaltene precipitation and deposition in petroleum reservoirs has proved to be a

difficult problem to define and study. Field conditions conductive to asphaltene

precipitation include primary depletion, acid stimulation, gas-lift operations and miscible

flooding, just to mention a few.

Asphaltenes are found in most crude oils. Under normal conditions they are held

in suspension by resins. Changes in the crude composition or pressure and temperature

can alter their association with the resins. This can result in asphaltenes precipitating and

being deposited. In general, the parameters that govern precipitation appear to be

composition of the crude, pressure, temperature, and properties of asphaltenes.

Experimental activities for studying asphaltene precipitation by itself cannot be

enough to achieve a clear picture of the condition and possible problems, as just doing the

experiments, besides involving high costs, is impossible in some cases. For a specific

project one can investigate the asphaltene flocculation process experimentally but this

proposition is usually impractical because it requires a large number of experiments at

reservoir conditions of pressure and temperature.

1
Hence, there is a need for reservoir simulation of asphaltene precipitation.

Predictive models for compositional simulation of asphaltene precipitation and deposition

should become through by which the above issues would be predicted with a reasonable

accuracy. Numerous models have been proposed based on different microscopic theories

for predicting the amount of asphaltene precipitation. The accurate prediction of

asphaltene precipitation in petroleum reservoirs is, therefore, crucial for the economical

and safe operation of any petroleum production scenario. A key conclusion of the

findings is the ability to predict the deposition of asphaltenes in the reservoir without the

need for generating data from expensive downhole samples.

In this chapter, we first discuss the main research objectives of this work and then

present an overview of the other chapters of this thesis.

1.2 OBJECTIVES OF THIS RESEARCH

The research work that was done, in this thesis, on predicting asphaltene

precipitation and deposition in oil and gas reservoirs has two main parts. The first part

dealt with compositional simulation of asphaltene precipitation, flocculation and

deposition in petroleum reservoirs using CMG's equation-of-state compositional

simulator, GEM. The primary objective was to investigate the effects of asphaltene

precipitation, deposition and plugging on properties of the formation, and also the oil

production, in order to obtain a better understanding of such complex problems. In

addition, capability of reliably predicting the conditions and the amount of asphaltene

precipitation can significantly help to tackle the above mentioned issues. Another

objective of the first part of this research work was to study several commercial and

academic compositional reservoir simulators (e.g. CMG GEM; UTCOMP and

ECLISPE300) with the essential physics for prediction of asphaltene precipitation.

2
After studying many available models in the literature for asphaltene

precipitation, the second challenging part of this research dealt with implementation of

asphaltene precipitation model into a fully implicit, three-dimensional, multiphase,

multicomponent, equation-of-state compositional, parallel simulator called GPAS,

developed at the Center for Petroleum and Geosystems Engineering at The University of

Texas at Austin.

The ultimate and main goal of this research work was to add an asphaltene

precipitation model to the existing fully implicit, compositional, Peng-Robinson cubic

equation-of-state module of GPAS. The simulator includes the IPARS framework, the

EOS compositional and the chemical modules. More specifically, the entire software,

which includes the framework and several modules for IOR, is called General Purpose

Adaptive Simulator (GPAS). Incorporation of a model in GPAS for correlating and

predicting asphaltene precipitation and plugging in oil and gas reservoirs was highly

desirable because it would allow the design of injection or production schemes such that

asphaltene precipitation could be predicted.

1.3 BRIEF DESCRIPTION OF CHAPTERS

Chapter 2, which has two main parts, presents a literature review of the research

which was performed on asphaltene precipitation, flocculation and deposition in oil and

gas reservoirs. The first part of this chapter describes the nature, precipitation, adsorption,

flocculation and deposition of asphaltenes. The second part of the chapter discusses in

detail the role of asphaltenes in reduction of permeability and alteration of reservoir

wettability.

Chapter 3 describes in detail the compositional simulation of asphaltene

precipitation, flocculation and deposition using a commercial, compositional simulator

3
called CMG GEM. First, it outlines the features of the models implemented in CMG

GEM for compositional simulation of asphaltene precipitation and deposition in

petroleum reservoirs. The assumptions and formulations are discussed in detail. Next, the

modeling of porosity alteration and permeability reduction due to asphaltenes are detailed

and presented. Then, the component transport equations are described. The integration of

the models and the solution method used are discussed next. In the last part of this

chapter, several cases are set up on CMG GEM to simulate the effect of asphaltenes on

the properties of rock and oil production, and finally the simulation results for each case

are presented, analyzed and discussed.

Chapter 4 presents a review of the General Purpose Adaptive Simulator, GPAS.

First, it gives a general description of the simulator functionalities, describing the

framework in detail, and then it discusses the assumptions and the important equations

for multiphase and multicomponent flow in porous medium which are referred to as the

governing equations of the simulator. In addition, the mathematical formulations for each

section are discussed in detail. Next, a brief description of phase behavior, phase stability

analysis and equations for flash calculation are presented. Phase identification and

tracking are reviewed, followed by a detailed discussion of the physical property models.

The different well models implemented in the simulator are described next. This chapter

also details the overall computation procedure of the simulator and outlines the executive

and work routines of the EOS compositional module of GPAS. The last part deals with a

brief description of the PETSc solver and the automatic time-step control of the

simulator.

Chapter 5 deals with the implementation of the asphaltene precipitation model

into the fully implicit, EOS compositional module of the General Purpose Adaptive

Simulator. This chapter is one of the most important and challenging contributions of this

4
research and it describes, in detail and step by step, the methodology for choosing and

implementing an asphaltene precipitation model into GPAS. First, the available models

for asphaltene precipitation are reviewed and discussed and then a model selection

procedure for the implementation is proposed. The assumptions involved and the

mathematical formulations used for the approach are presented and discussed. Next, the

modeling procedure for the phase behavior of the solid asphaltene precipitate and the

methodology used for coupling it with the important routines of the simulator are

described in detail. A brief description of multiphase oil-gas-solid flash calculation

including the stability test for an additional solid phase is presented next. The models for

simulating the dynamic aspects of asphaltene precipitation include the solid adsorption

and the resistance factor for permeability reduction. The new independent variables, the

effect of asphaltene precipitation on the old governing equations and the new

implemented governing equations are discussed in detail. The discretization of the

governing equations is presented as well. The mathematical formulation for the

derivatives of the governing equations with the effect of asphaltene precipitation for

constructing the new Jacobian matrix and the residuals of the governing equations are

described next. The final part of this chapter deals with describing the new Jacobian

matrix, the step-by-step solution procedure and the approach used for code development.

Chapter 6 presents in detail several cases that were set up to test and validate the

implementation of the asphaltene precipitation model in GPAS. This chapter is another

important and challenging contribution of this research. A Generalized Equation-of-state

Model compositional reservoir simulator called GEM from the Computer Modelling

Group Ltd. (CMG Ltd.) was used as the benchmark for validation and comparison studies

and numerous test cases were set up and run on both CMG GEM and GPAS to

accomplish this goal. The models used for the validation and comparison studies between

5
CMG GEM and GPAS along with the asphaltic reservoir fluid are described. For each

case, the simulation results are presented and analyzed. Several sensitivity studies on the

parameters of the asphaltene precipitation model were performed and are addressed in

this chapter as well.

Chapter 7 is a summary of this research followed by conclusions and

recommendations for future research in compositional simulation, modeling and phase

behavior of asphaltene precipitation, flocculation and deposition in hydrocarbon

reservoirs.

6
Chapter 2: Literature Review

2.1 INTRODUCTION

In this chapter, we present a literature review on the description of asphaltenes

and the related problems due to their formation in petroleum reservoirs. First we review

the research that has been conducted on the nature of asphaltenes, asphaltene

precipitation, flocculation and deposition in oil and gas reservoirs. Then we describe the

effects of asphaltene precipitation on the properties of reservoir rocks, such as

permeability reduction and alteration of reservoir wettability, followed by a discussion on

the effects of asphaltene formation on the properties of reservoir fluids and more

importantly on the oil production. Last, but not least, we briefly discuss some studies

related to modeling asphaltene precipitation in this chapter, as well.

2.2 NATURE OF ASPHALTENES

Petroleum asphaltenes and resins are the polar fractions of crude oil and bitumen

that can be separated by the addition of low molecular weight alkanes. These fractions

are formed by molecules with a predominantly polyaromatic structure containing

paraffinic and naphthenic chains, as well as oxygen, nitrogen and sulfur as functional

groups or heteroatoms (Speigh, 1980).

Asphaltenes are heavy hydrocarbon molecules that are in colloidal suspension in

the oil, stabilized by resins adsorbed on their surface (Hirschberg et al., 1984; Kawanaka

et al., 1989; Leontaritis et al., 1987). Changes in pressure, temperature and composition

7
may cause asphaltene precipitation. The nature of the precipitated asphaltene is still under

investigation. Two scenarios are possible (Leontaritis et al., 1989):

1. The asphaltene/resin micelles precipitate essentially unaltered.

2. There is a dissociation of the asphaltene/resin micelles, which cause the

precipitation of the asphaltene.

When pressure in the reservoir is reduced or when light hydrocarbon or other

gaseous injectants are introduced, the colloidal suspension may become destabilized,

resulting in asphaltene and resin molecules precipitating out of the oil.

Recent research has shown that this precipitation process, whether it is due to

pressure depletion or gas injection, is largely reversible (Hammami et al., 2000;

Peramanu et al., 2001). However, there can be significant hysteresis in the redissolution

process, that is, the time required for asphaltenes to go back into solution may be

considerably longer than the time required for the original precipitate to form.

Asphaltene precipitation has been reported during primary depletion in many

reservoirs. The fluids in place are undersaturated light to medium crudes, usually

containing a small amount of asphaltene. In field situations, asphaltenes will first

flocculate and depending on the flow dynamics may or may not deposit in the rock

matrix. Asphaltenes and other solids create production problems if they deposit onto the

walls of the tubing or into the reservoir formation.

2.3 PRECIPITATION OF ASPHALTENES

Asphaltene precipitation from hydrocarbon reservoir fluids during petroleum

production is a serious problem because it can result in plugging of the formation,

wellbore and production facilities. Asphaltene precipitation also occurs frequently during

enhanced-oil-recovery by gas injection, which impedes the recovery seriously. Iron

8
contaminated acid has recently been found to promote the precipitation of asphaltenes

when acidizing certain oil-bearing zones. This can cause severe formation damage.

Precipitation occurs above the saturation or bubble-point pressure, reaches a

maximum value around the saturation pressure, and decreases as pressure drops further.

In other words, further decrease in pressure from the bubble-point pressure gives rise to a

decrease in the amount of precipitate. Above the saturation pressure, the precipitation is

solely due to pressure, while below the bubble-point pressure both pressure and

composition affect the precipitation behavior. As the light components come out of the

solution, the solubility of asphaltene in the liquid phase increases.

The measurement of asphaltene precipitation under reservoir conditions is a

difficult task. The onset of precipitation can be detected with changes in light intensity

(Novosad and Costain, 1990), in optical fluorescence and electrical conductance

(MacMillan et al., 1995), in viscosity (Escobedo and Mansoori, 1995; Turta et al., 1997),

laser intensity (Hammami et al., 1999; Hammami and Raines, 1999), and acoustic

resonance (Sivaraman et al. 1999). The measurement of the amount of precipitated

asphaltene is a very challenging problem. These measurements take a long time and are

subject to a high degree of experimental error. Multiple tests are often performed to

check the reproducibility of the measurements.

de Boer et al. (1995) observed that reservoirs that experience asphaltene

precipitation usually have the following characteristics:

1. The fluid in place is light to medium oil with small asphaltene content.

2. The initial reservoir pressure is much larger than the saturation pressure.

3. Maximum precipitation occurs around the saturation pressure.

4. Heavier crudes that contain a large amount of asphaltene have very little

asphaltene precipitation problems as they can dissolve more asphaltene.

9
Precipitated asphaltenes that have not aggregated into larger particles may flow

with the reservoir fluids without any detrimental effects on production. Conversely, for

"in-situ upgrading" to have any beneficial effect in heavy oil recovery, the precipitated

asphaltenes must deposit onto the reservoir rock in sufficient quantity to lighten the

character of the produced fluid, but not to such an extent that production is impaired.

Nagel et al. (1990) and Novosad et al. (1990) reported that during solvent

injection into reservoirs containing medium crudes, asphaltene precipitation occurs at the

producing wells after solvent breakthrough. No asphaltene problems were observed

during primary and secondary production. A possible explanation of this observation is

that the solvent enriched the oil and made it very light. Near the production wells, the

pressure drops and asphaltene precipitates as in the case of light oils during primary

depletion.

Many thermodynamic models that describe the phase behavior of asphaltene

precipitation have been reported in the literature. These include the use of a liquid

solubility model (Hirschberg et al., 1984), a thermodynamic colloidal model (Leontaritis

et al, 1987), a thermodynamic micellization model (Pan et al., 1998), a colloidal activity

coefficient model (Zhou et al., 1996), a variation of a model for wax (MacMillan et al.,

1995; Thomas et al., 1992), or a pure solid model. Nghiem et al. (1999) also describe the

incorporation of the pure solid model into an equation-of-state compositional simulator.

2.4 FLOCCULATION OF ASPHALTENES

Once flocculated, asphaltenes form or contribute to the formation of organic

deposits causing problems such as formation damage, flow restriction due to partial

plugging of the production string or pipelines and limitations in the crude oil and

produced water treatment facilities due to the formation of stable emulsions.

10
Asphaltenes are believed to exist in the crude oil partly dissolved and partly kept

in finely dispersed colloidal suspension form that may be stabilized by non-polar resin

fractions of the crude (Branco et al., 2001). In case of inadequate amount of resins in the

crude, the precipitated asphaltenes may flocculate to form much larger particles that are

likely to cause formation damage. The formation damage due to unstabilized and

flocculated colloidal asphaltene deposition has recently been the focus of intensive

research.

Reversibility of formation of asphaltene precipitates is often an issue. Pressure

reversibility at high temperatures has been addressed by Hirshberg et al. (1984) and

seems to be accepted by others. Reversibility with respect to composition at low

temperatures is still unresolved.

Ramssamdana et al. (1996) performed experiments at room temperature to study

the reversibility of asphaltene precipitation with respect to composition. They observed

that part of the precipitated asphaltene redissolved into solution and concluded that the

asphaltene precipitation process is partially reversible. The dissolution of the precipitated

asphaltenes is a kinetically slow process and therefore the reversibility may require a

relatively long time. At reservoir temperatures several experimental observations

(Hirschberg et al., 1984; Kokal et al., 1992; Godbole et al., 1992) have shown the

reversibility of asphaltene precipitation from the change of pressure or composition.

Based on this evidence, one can conclude that the asphaltene precipitation process

is a thermodynamically reversible process, especially at reservoir temperatures.

2.5 ADSORPTION OF ASPHALTENES

The asphaltene precipitates can remain suspended in the oil phase, rather than

being adsorbed onto solid surfaces. Adsorption may be restricted to surfaces that were

11
made oil-wet by oil/brine/rock interactions prior to precipitation (Buckley, 1995).

Asphaltene adsorption causes permeability reduction and changes in wettability.

The presence of asphaltene in a crude oil has been shown to affect rock

properties. Most of these effects have been recognized to be the result of asphaltene

adsorption and precipitation on the rock surface (Clementz, 1982). Previous studies

indicate that asphaltene adsorption leads to alteration of rock wettability. Piro et al.

(1995) conducted a series of adsorption studies to determine the isotherms of asphaltene

on sandstone rocks. They observed that asphaltene adsorption is a continuous

phenomenon and does not reach saturation like conventional surface-active materials.

However, they did not report the effect of adsorption on rock permeability.

Collins and Melrose (1983), Dubey and Waxman (1991), and Gonzalez and

Travalloni-Louvisse (1973) showed that the asphaltene adsorption onto different rocks

could be modeled with Langmuir isotherms.

2.6 DEPOSITION OF ASPHALTENES

The precipitated asphaltenes are fine particles that may form aggregates, which

are large enough to be retained at small pore throats. After asphaltene precipitates from

the oil, it can deposit onto the rock and cause plugging and changes in wettability.

Deposition begins with adsorption of flocculated asphaltene particles onto active sites on

the rock surface.

Ali and Islam (1997) found that asphaltene deposition is a function of

permeability, flow rate and concentration. Asphaltene deposition could be explained in

terms of trapping and mechanical plugging which were sharply dependent on the flow

rate. Adsorption can be explained in terms of irreversible thermodynamics. Interestingly,

12
the coupling between the two mechanisms into a unified model has not been reported in

the past.

Recent investigations show that asphaltene deposition is due to adsorption

followed by retention or trapping mechanism (Ali et al., 1997; Turta et al., 1997). The

adsorption of asphaltenes onto different rocks has been extensively measured in

laboratories. The first step in the deposition process is the rapid adsorption of asphaltene

onto the active sites on the rock surface, particularly onto high specific area clayey

minerals such as kaolinite.

This is followed by hydrodynamic retention or trapping process of particles at the

pore throats. In addition to adsorption, Minssieux et al. (1997) showed that the deposition

also occurs because of mechanical entrapment. This entrapment is similar to the

deposition of fines in porous media. The deposition process through mechanical

entrapment (also called plugging deposit as the deposition plugs the pore throat) is

complex.

Deposition of solid asphaltenes causes a reduction of the pore space available for

fluids. Other formation damage mechanisms may include permeability reduction and

alteration of rock wettability from water-wet to oil-wet (Kamath et al., 1993; Celementz

et al., 1982). The deposition may induce favorable changes in relative permeabilities and

flow diversion that improve the displacement efficiency.

2.7 REDUCTION OF PERMEABILITY DUE TO ASPHALTENES

Kamath et al. (1993) conducted a series of dynamic displacement tests in order to

evaluate the effect of asphaltene deposition on water flooding in both consolidated and

unconsolidated sand packs. They concluded that asphaltene deposition has an impact on

reservoir rock permeability and end-point saturations. Minssieux et al. (1997), Ali et al.

13
(1997), and Piro et al. (1996) report experimental observations on permeability reduction

induced by asphaltene deposition.

Asphaltene precipitation has been the subject of many research papers; however,

research on the effect of this precipitation on porous media permeability is still scarce.

Until recently, there have been very few attempts to model formation damage caused by

organic scale deposition. Many of these reported models are one-dimensional, and are

based on the plugging and non-plugging parallel pathways approach of Gruesbeck and

Collings (Ali et al., 1997; Civan, 2000; Gruesbeck et al., 1982; Ring et al., 1994).

Gruesbeck and Collins divided the porous medium into pluggable and non-

pluggable pathways. Therefore, they presented the porous medium by two continuous

branches. One branch consists of small pores that have a significant variation in diameter.

These pores make a network of tortuous flow paths that are susceptible to complete

plugging. The other branch consists of large pores that make the non-pluggable pathways.

These smooth and large diameter flow paths involve surface deposition, and are

considered non-plugging. In the plugging pathways, deposition of particles occurs by

mechanical entrapment, i.e. by jamming and therefore blocking pore throats when several

particles approach narrow flow constrictions. Sticky and deformable asphaltene deposits

seal the flow constrictions. Conductivity of a flow path can diminish without filling the

pore space or by partial filling of the pore space. Therefore, the fluid seeks other

unblocked flow paths. As a consequence, the permeability diminishes, even though the

porosity may not diminish significantly.

Using the Gruesbeck and Collins parallel pathways approach, Ali and Islam

(1997) developed a single-phase formation damage model for under-saturated oil. In their

representation, they included the effects of both adsorption and mechanical entrapment.

The permeability reduction in the plugging and non-plugging pathways was represented

14
by the Gruesbeck and Collins empirical expressions. However, models based on

Gruesbeck and Collins simplify the pore structure and do not take into account the rock

heterogeneity and wellbore geometry.

Garrouch and Al-Ruhaimani (2005) formulated a model for estimating

permeability impairment caused by asphaltene deposition. Their model is based on a

mass balance and is capable of predicting permeability reduction in vertical and

horizontal wells.

2.8 ALTERATION OF RESERVOIR WETTABILITY DUE TO ASPHALTENES

The alteration of formation wettability due to asphaltene deposition has been a

subject of numerous investigations. Wettability controls the flow and distribution of

immiscible fluids in an oil reservoir and thus plays a key role in any oil recovery process.

One way that oil components are thought to alter wettability is by coating pore surfaces

with precipitated asphaltenes. The deposited asphaltene may cause alteration of rock

wettability from water-wet to oil-wet.

A review of the effect of wettability on oil recovery is given by Morrow (1990).

Wettability has been shown to affect relative permeabilities, irreducible water saturation,

residual oil saturation, capillary pressures, dispersion and electrical properties. The

alteration of relative permeabilities and the end points has the strongest influence on

displacement processes. Morrow (1990) reviewed results for core waterfloods showing

that the shift towards a less water-wet condition can range from being highly adverse to

highly beneficial to oil recovery. Huang and Holm (1988), Lin and Huang (1990), and

Yeh et al. (1992) presented results on the implication of wettability changes on Water-

Alternating-Gas (WAG) processes. Typical results for CO2 WAG processes indicate that

15
the amount of oil trapped in water-wet cores (45%) was much higher than that trapped in

either mixed-wet (15% to 20%) or oil-wet cores (5%).

The potential for asphaltenes to adsorb onto high-energy mineral surfaces and

thus to affect reservoir wettability has long been recognized. Previous studies indicated

that asphaltene adsorption leads to alteration of rock wettability. Collins and Melrose

(1983), Crocker and Marchin (1988) and Buckley et al. (1997) describe the change of

formation wettability from water-wet to mixed-wet or oil-wet upon adsorption of

asphaltene onto the rock surface. A good summary of early work is provided by

Anderson (1986).

Clementz (1982) discussed the permanent alteration of core properties after

asphaltene adsorption. Crocker and Marchin (1988) and Buckley et al. (1997) studied

asphaltene adsorption for different oil compositions and corresponding degree of

wettability alteration. Kamath et al. (1993) described observations on wettability changes

due to asphaltene deposition. More recently, there have been a number of studies on

asphaltene adsorption and resulting changes in wettability of smooth surfaces (Akhlaq et

al., 1996; Gonzalez et al., 1991; Pedroza et al., 1996; Toulhoat et al., 1994).

In conclusion, the modeling of wettability effects is itself a complex topic and is a

subject of active research. Data and models that describe the alteration of wettability due

to asphaltene adsorption and deposition and the subsequent effects on the displacement

efficiency are not currently available.

16
Chapter 3: Compositional Reservoir Simulation of Asphaltene
Precipitation and Deposition in CMG GEM

3.1 INTRODUCTION

This chapter deals with the asphaltene precipitation, flocculation and deposition

models implemented in CMG GEM for compositional simulation of asphaltene

precipitation and plugging in petroleum reservoirs. CMG GEM version 2004.10, which

was used in simulations carried out in this chapter, is a three-dimensional, finite-

difference, compositional simulator from the Computer Modeling Group (CMG Ltd.) that

uses the adaptive implicit method as an option.

The asphaltene precipitation, flocculation and deposition models used in the

simulator are discussed in detail in this chapter including the models for porosity

alteration and permeability reduction due to the formation of asphaltenes. The component

flow equations with the effect of asphaltene precipitation are also presented.

Nghiems thermodynamic model is used in the simulator for asphaltene

precipitation simulation. To take into account the effects, due to flocculation and

deposition of asphaltenes, CMG's equation-of-state compositional, reservoir simulator,

GEM (CMG GEM 2004.10), was modified to incorporate these new phenomena. So the

models for solid phase behavior of the simulator include precipitation, flocculation and

deposition.

The simulator uses a standard cubic equation-of-state (EOS) for the fluid phase

behavior. The Peng-Robinson equation-of-state (PR EOS) was used to model the fluid

properties of the oil and gas phases. Using CMG WinProp the values of the required

parameters in PVT calculations were obtained.

17
WinProp is CMG's equation-of-state, multiphase, equilibrium, property package

featuring fluid characterization, lumping of components, matching of laboratory data

through regression, simulation of multiple contact processes, phase diagram construction,

solids precipitation, and more. CMG WinProp version 2004.10 has been used in this

study.

This chapter also describes, in detail, the processes involved in the initial

precipitation of asphaltene from the reservoir fluid, the flocculation of these precipitates

into larger particles and the deposition of these particles in porous media. Models for

these processes and in a compositional reservoir simulator are then given. The alteration

of porosity and the impairment of permeability due to asphaltene deposition are also

investigated. The models results are compared to experimental data for an oil core flood

experiment.

By performing a sensitivity study, the effect of the parameters of the models for

asphaltene precipitation, flocculation and deposition is illustrated for a one-dimensional

simulation of gas injection into an oil-filled core. Two-dimensional simulations

illustrating asphaltene deposition due to pressure depletion for homogenous and

heterogeneous reservoirs with grid refinement are also presented. The results are also

interpreted for the decrease in oil production due to asphaltene occurrence. A sample

input file for compositional simulation of asphaltene precipitation in CMG GEM can be

found in Appendix O.

3.2 REPRESENTATION OF ASPHALTENE PRECIPITATE

In CMG GEM (versions 2004.10 and later), the asphaltene precipitate is modeled
as two solids: Solid 1, s1 , is thermodynamically reversible and is in the oil phase. Solid 2,

s 2 , is created from Solid s1 via a chemical reaction. Solid s 2 can be used to represent the

18
flocculation of smaller precipitated asphaltene particles into larger aggregates. This

aggregation can be made fully reversible, fully irreversible or partially irreversible. Solid
s1 flows as suspended particles in the oil phase, while Solid s 2 may flow with the oil or

deposit in the rock matrix.

3.3 ASPHALTENE PRECIPITATION MODEL

Long Nghiems model (Nghiem et al., 1987) which is used in CMG GEM is

considered to be a solid model. Solid models treat the precipitating asphaltene as a single

component residing in the solid phase while oil and gas phases are modeled with a cubic

EOS (e.g. Peng-Robinson equation-of-state). Solid models may require many empirical

parameters and excessive tuning to match experimental data (Thomas et al., 1992).

Additional details about solid models can be found in Chapter 5.

Nghiems model is based on the representation of the precipitated asphaltene as a

pure dense phase and assumes that the heaviest component in oil can be split into two

parts: non-precipitating and precipitating components. The precipitating component is

considered to be asphaltene. These two components have identical critical properties and

acentric factors, but different interaction parameters with the light components in the

system. The precipitating component has larger interaction coefficients with the light

components. Larger interaction coefficients correspond to greater incompatibility

between components and favor the formation of the asphalt phase.


Let s1 represent the solid phase in equilibrium with the fluid hydrocarbon phases.

In a mixture of n c components, when the oil, gas, and solid phases coexist, the following

thermodynamic equilibrium equations are satisfied:

ln fio = ln f ig i = 1,..., n c (3.3.1)

19
ln f n c o = ln f s1 (3.3.2)

Equation (3.3.1) expresses the equality of fugacity of i th component in the oil and

gas phases. Equation (3.3.2) expresses the equality of fugacity of the precipitating
component in the oil phase and in the precipitated solid s1 . The asphaltene component in

the oil phase is considered to be the n c th component.

3.3.1 Thermodynamic Model for Oil and Gas Phases

The oil and gas phases are modeled with an equation-of-state. Fugacities in the oil
and gas phases, f io and f ig , are calculated from the Peng-Robinson equation-of-state with

volume shift parameters. The fugacity of i th component in jth phase is

si bi P
ln f ij = ln f ijEOS + i = 1,..., n c j = o, g (3.3.3)
RT

where fij is the fugacity of i th component in jth phase, fijEOS is the fugacity with

translation, si is the dimensionless volume shift parameter for i th component and bi is

the EOS b parameter for component i. The molar volume of phase j with volume shift
is

nc
v j = v EOS
j + x ijsi bi j = o, g (3.3.4)
i=1

The volume shift parameter was introduced to improve liquid density prediction.
This parameter is also crucial for modeling the effect of pressure on asphaltene
precipitation.

20
3.3.2 Thermodynamic Model for Solid Phase

The fugacity of the solid phase for isothermal predictions is given by

vs1 ( P P* )
ln fs1 = ln f +
*
s1 (3.3.5)
RT

where fs1 is the fugacity of solid s1 at reservoir pressure, fs*1 is the reference solid
fugacity at P * , vs1 is the solid molar volume and P * is the pressure at which the

asphaltene just starts to precipitate. As the formation of the solid s1 is governed solely by
the above thermodynamic reversibility, any precipitated solid s1 will go back into

solution when the system is returned to a state outside the asphaltene precipitation
envelope.

3.3.3 Estimation of Model Parameters


The use of the model requires the knowledge of fs*1 and vs1 at P * and a specific
temperature. fs*1 is estimated from experimental volubility data. The molar volume vs1 ,

can be estimated from volubility data at different pressures. P * , the highest pressure at
which asphaltenes are first observed to be coming out of solution for a given oil or
oil/solvent mixture, is referred to as the upper onset pressure. P * has to be obtained from
experimental data and is critical to the simulation of asphaltene precipitation. The
parameters ln f s*1 , vs1 and P * are input keywords in CMG GEM and have to be

calculated beforehand using some PVT utility e.g. CMG WinProp.

21
3.3.4 Amount of Asphaltene Precipitation

The solid model given in Equation (3.3.5) can be used to predict the amount of
solid precipitate for isothermal cases because the current model implemented in CMG
GEM is not tailored to account for temperature variations (non-isothermal effects). The
molar volume of the solid affects the amount of asphaltene precipitation within the
asphaltene deposition envelope. Increasing the solid molar volume results in greater
amounts of solid precipitated. The existence of a solid phase satisfies the following
criterion:

ln f n c o ln fs1 (3.3.6)

If the fugacity of the n c th component in the oil phase is greater than the fugacity

of asphaltene in the solid phase, asphaltene will precipitate until both become equal as
given by the equilibrium condition in Equation (3.3.6) that also gives the amount of
asphaltene precipitated.

3.3.5 Mechanistic Aspect of the Model

The non-precipitating component can be related to resins, asphaltene/resin


micelles that do not dissociate, and heavy paraffins. The precipitating component
corresponds to both the asphaltenes that dissociate and the asphaltene/resin micelles that
precipitate unaltered. Because of identical critical properties and acentric factors, the non-
precipitating and precipitating components behave as a single component in solution. The
larger interaction coefficients between the precipitating and the solvent components cause
the precipitation of the former with the addition of solvent.

22
3.3.6 Keywords for Asphaltene Precipitation Model

The Asphaltene precipitation model of CMG GEM is described by the


*SOLIDMODEL keyword. The keywords *ADSCST, *WSLMAX, *RFMAX, and
*DENROCK control the modeling of the adsorption of the solid asphaltene phase, which
is entrained in the oil phase, onto the reservoir rock. In the new version of CMG GEM
the last four keywords, which describe the solid adsorption model, are not being used
anymore. With the implementation of the asphaltene flocculation and deposition models,
the solid adsorption model became an optional and unnecessary section in the input files
of CMG GEM. The keyword *SOLIDMODEL must have been used to invoke the
asphaltene model.

3.4 ASPHALTENE FLOCCULATION MODEL

The flocculation model describes a process that occurs when the pressure is
reduced below the onset pressure. This process is actually the flocculation of asphaltene
particles into larger aggregates.
The asphaltene precipitation model exhibits complete thermodynamic
reversibility; that is, the precipitated asphaltene will go back into solution if the system is
returned to a thermodynamic state outside the asphaltene precipitation envelope.
Irreversibility of solid precipitates is modeled by allowing solid s1 to be
transformed via a simple reversible chemical reaction into another solid, s 2 . This can be

viewed as the flocculation of smaller asphaltene particles into larger aggregates. The
reaction may be written as follows

s1 s 2 (3.4.1)

23
The reaction rate for the formation of s 2 is

r = k12 Cs1 ,o - k 21Cs2 ,o (3.4.2)

where k 12 is the forward rate of formation of solid s 2 from s1 , k 21 is the reverse rate of
formation of solid s1 from solid s 2 , r is the reaction rate, Cs1 ,o is the concentration of
suspended solid s1 in oil phase and Cs2 ,o is the concentration of suspended solid s 2 in oil

phase.
Note that s 2 can go back into solution by first becoming s1 through the reverse
reaction, then dissolving into the oil phase through thermodynamic equilibrium. If k 21 is
zero, the reaction is irreversible and s 2 will not go back into solution. If k 21 << k12 , the
precipitation of s 2 is reversible, but may take a long time to complete. The above

chemical reaction allows the modeling of irreversible precipitation or a slow redissolution


of the precipitated asphaltene.

3.4.1 Keyword for Asphaltene Flocculation Model

*SOLID-CONV-RATE allows the user to enter forward and reverse rates for the
conversion of precipitated asphaltene to flocculated asphaltene. This conversion may be
made reversible, fully irreversible or partially irreversible as mentioned before.
Asphaltene flocs may deposit in the porous media as will be described in the next
section. This keyword controls the generation of flocculated solid particles from the
thermodynamic asphaltene precipitate model.

24
3.5 ASPHALTENE DEPOSITION MODEL

An asphaltene deposition model was first presented by Wang and Civan (2001).
This model is implied in an equation, which relates asphaltene deposition rate to the
primary physical deposition processes such as initial adsorption, pore-throat plugging and
re-entrainment. The deposition model, which incorporates the fundamental physical
phenomena associated with solids deposition in porous media, has been implemented in
CMG GEM.
In the implementation of the deposition model, only the flocculated particles
(solid s 2 ) are considered to deposit. Physically, this implies that the small asphaltene

precipitate particles are more likely to flow with the oil phase, while the larger
aggregates, which are formed according to the time dependent chemical reaction of
Equation (3.4.2), are more likely to deposit on the reservoir rock. The discretized form of
the deposition rate equation (Kohse and Nghiem, 2004) is

Vsnd +1 Vsnd
2 2
Csnf+1n+1 + Vsnd +1 ( v no v cr,o ) u on Csnf+1 = 0 (3.5.1)
t 2 2 2

where Vsd is the volume of deposited solid s 2 per gridblock volume, Csf is the
2 2

volumetric concentration of flowing solid s 2 per volume of oil, vo is the oil phase
interstitial velocity, v cr,o is the critical oil phase interstitial velocity, u o is the oil phase

Darcy velocity, is the surface deposition rate coefficient, is the entrainment rate
coefficient and is the pore throat plugging rate coefficient.
The surface deposition rate coefficient, , is a positive constant and is dependent
on the rock type. The entrainment rate coefficient is set to zero when the interstitial
velocity is less than the critical interstitial velocity, and may be set to a positive constant

25
otherwise. The pore-throat plugging coefficient is set to zero if the average pore-throat
diameter is larger than some critical value. If it is smaller, the coefficient is calculated as

(
= i 1 + Vsd
2
) (3.5.2)

where i is the instantaneous pore-throat plugging rate coefficient and is the snowball-

effect deposition constant. This formulation allows the plugging deposition rate to
increase proportionally with the total amount of deposits.

3.5.1 Keywords for Asphaltene Deposition Model

The keywords *SOLID_ALPHA, *SOLID_BETA, *SOLID_CRITVEL,


*SOLID_GAMMA and *SOLID_SIGMA, control the deposition of the flocculated solid
particles in CMG GEM.

3.6 POROSITY ALTERATION MODEL IN CMG GEM

Before 2004, CMG GEM did not consider any change in porosity due to
asphaltene precipitation because with the optional solid adsorption model, adsorbed solid
is assumed to affect permeability only and not the porosity. However, in the new versions
(2004.10 and later) of the simulator, with the introduction of the asphaltene deposition
model, the instantaneous local porosity is equal to the initial porosity o minus the

amount of the deposited solid, given by

= o Vsd (3.6.1)
2

26
In all versions of CMG GEM that are developed with asphaltene models, the
volume of precipitated solid is accounted for in the volume balance. With the asphaltene
deposition model, deposited solid affects the porosity, which is then related to
permeability reduction.
When simulating field-scale problems, the total volume of deposition within the
blocks is usually negligible, unless a very fine scale grid refinement exists around the
wells. In these cases the effect of asphaltene deposition on porosity is not important. So,
in conclusion, the effect of asphaltene formation on porosity will vary depending on the
simulation process.

3.7 PERMEABILITY RESISTANCE FACTOR IN CMG GEM

Once the solid phase has deposited on the reservoir rock, partial plugging which
leads to damage of the formation is expected. The permeability resistance factor that
takes into account the permeability reduction due to asphaltene formation relates the
instantaneous permeability, k, to the original permeability, k o . The permeability
reduction is directly related to transmissibility reduction. The permeability resistance
factor can also be defined as the ratio of the original porosity to the instantaneous
porosity. The new permeability resistance factor in CMG GEM is

b
k o o
Rf = = (3.7.1)
k

Note that the instantaneous porosity, , is defined by Equation (3.6.1). The above
equation for R f is based on the power law model of permeability and porosity. Power-

law and exponential models may be used for permeability reductions of up to about 80%

27
due to asphaltene deposition (Reis and Acock, 1994). The power-law model relating
permeability and porosity is given by

k = cb (3.7.2)

The exponent b in Equation (3.7.1) can have values ranging from 3 to 7. The
chosen value for b in the current version of CMG GEM is 3, which was first suggested by
Wang and Civan (2001). Hence, to calculate the resistance factor in CMG GEM version
2004.10, according to the permeability reduction model of Wang and Civan the following
equation is being used:

3
o
Rf = o (3.7.3)
Vsd
2

Once R f is calculated from Equation (3.7.3), all the phase permeabilities, or more

generally phase mobilities and consequently the phase transmissibilities, are divided by
this permeability resistance factor to account for the reduced permeability due to the
asphaltene formation.
The resistance factor can be applied to the relative permeability of each phase.
The code has been written in CMG GEM to apply the resistance factor to the relative
permeability, so that in the future it would be possible to apply different factors to
different phases. Currently, the same factor is applied to the oil, gas and water phases.

28
3.8 COMPONENT TRANSPORT EQUATIONS

CMG GEM uses the following finite-difference equation for the flow of
components in the oil and gas phases (Kohse and Nghiem, 2004):

( ) ( p on +1d ) + Tgn +1 yign +1 ( p n +1 + Pcgo gn +1d )


n +1
Ton +1 yio + yis1 + yis2 n +1 n +1

(3.8.1)
( k kSk Dik ) yikn +1 + qin +1 ( Nin +1 Nin ) = 0
A V
+
n +1
i = 1,..., n c
k = o,g l t

where Tk is the transmissibility of phase k, yik is the mole fraction of i th component in


phase k, p is the pressure, k is the gradient of phase k defined by mass density of phase
k times g, d is the depth, Pcgo is the gas-oil capillary pressure, A is the gridblock cross-

sectional area, l is the length of the gridblock, k is the molar density of phase k, Sk is
the saturation of phase k, Dik is the total dispersion coefficient for i th component in
phase k, qi is the well molar flow rate of i th component, V is the gridblock volume, t is
the time and N i is the moles of i th component per gridblock volume.

The phase transmissibility of phase k which depends on the permeabilities,


relative permeabilities, molar densities, viscosities and gridblock sizes, is calculated from

kA k rk k
Tk = (3.8.2)
l k

where k rk is the relative permeability of phase k and k is the viscosity of phase k. With

yz / x x direction
A
= zx / y y direction (3.8.3)
l
xy / z z direction

29
where x, y , and z are the gridblock sizes in x, y and z directions. Equation (3.8.1)

includes both the convective and dispersive fluxes. The main difference between the
mentioned equation and the component flow equation in a standard EOS compositional,
reservoir simulator is the presence of the terms, yis1 and yis2 which correspond to the
suspended solids in the oil phase. yio and yig are the mole fractions of i th component in

the oil and gas phases.


The terms, yis1 and yis2 represent the suspended solids, s1 and s 2 in the oil phase.
yis1 and yis2 are zero for all the components, except for the asphaltene component. For

example for solid s1 we have:

0 i nc
yis1 = (3.8.4)
N s1 / N o i = nc

where N s1 corresponds to the moles of the suspended solid phase, s1 , and N o is the

moles of the oil phase per gridblock volume. The flow of the water satisfies the following
discretized equation (Nghiem et al., 2001):

Twn +1 ( p n +1 Pcow nw+1d ) + q nw+1 ( N nw+1 N nw ) = 0


n +1 V
(3.8.5)
t

where Tw represents the transmissibility of the water phase, Pcow is the oil-water
capillary pressure, w is the gradient of the water phase defined by mass density of water
times g and N w is the moles of water per gridblock volume.
Also a material balance on solid s 2 gives

Tom yism2 ( p n +1 om d ) + VSo r + q sn2+1


V
t
( )
N sn2+1 N sn2 = 0 (3.8.6)

30
where N s2 corresponds to the moles of the suspended solid phase, s 2 , per gridblock

volume. Note that in Equation (3.8.6) the rate of formation of solid s 2 is included. CMG

GEM uses an adaptive implicit technique to discretize the above equations. The
superscripts n and n+1 denote the old time level and new time level, respectively. The
superscript m corresponds to n (IMPES formulation) for explicit gridblocks and n+1
(fully implicit formulation) for implicit gridblocks.
When only asphaltene precipitation and solid adsorption models are being used,
no changes are made to the implicitness as controlled by the *AIM and/or *AIMSET
input keywords. When the asphaltene flocculation and deposition models are used, the
above equations are treated implicitly at all times.

3.9 SOLUTION METHOD

Equations (3.5.1), (3.8.1), (3.8.6), and the thermodynamic equilibrium Equations


(3.3.1) and (3.3.2) allow the determination of all the moles related to the asphaltene
component.
Equations (3.8.1), (3.8.5), (3.8.6), (3.3.1), (3.3.2), (3.4.2) and, (3.5.1) that are
respectively; the component flow equation, the water flow equation, the solid s 2 flow

equation together with the phase equilibrium equations, the reaction rate equation and the
deposition rate equation provide the necessary equations for compositional simulation of
asphaltene precipitation and deposition processes.

31
3.10 ONE-DIMENSIONAL OIL CORE FLOOD SIMULATION

This section presents the results for compositional reservoir simulation of


asphaltene precipitation, flocculation and deposition of an oil core flood. Using CMG
GEM, one-dimensional simulation of injection of asphaltic stock tank oil into a core was
performed to investigate the possible precipitation of asphaltene. Asphaltene deposition
or any solid particle deposition leads to reduction of permeability and, more generally,
formation damage.

3.10.1 Simulation Input and Reservoir Fluid Data

Two vertical wells are used for this simulation case. The first well is an injector
and the second well is a producer. This case was run in Fontainebleau sandstone which is
known as a homogenous porous medium. A schematic representation of the case is
shown in Figure 3.1. Note that in that figure, the numbers represent the gridblocks in the
x direction.
The core fluid used for studying asphaltene precipitation was obtained from a
Weyburn dead oil and the injection fluid is the same with known composition. The
Weyburn dead oil consists of 9 components which are N2 + C1, CO2, C2-C3, C4-C5,
C6-C9, C10-C19, C20-C29, C30A+, and C30B+.
Table 3.1 shows the composition of the Weyburn dead oil and the molecular

weight of the pseudo-components. Table 3.2 shows the core data for the oil injection
simulation. The parameters of the asphaltene precipitation and flocculation models were
set according to the following pattern: the onset pressure for the precipitation model to a
very high value (50 MPa) and to set the rate constants for the flocculation model as
k12 = 50, 000 day 1 and k 21 = 0 day 1 . The forward and reverse rate constants ( k12 and

32
k 21 ) are defined in Equation (3.4.2). The deposition model parameters used in the

simulation runs are given in Table 3.3.


Table 3.4 shows the PVT properties of the Weyburn dead oil. In addition Table

3.5, which was obtained from CMG WinProp, shows the binary interaction parameters

for different components of the oil core flood simulation case.


Tables 3.6 and 3.7 are sets of relative permeability curves that are defined by

table entries. These data define a section of CMG GEM, which is called Rock and Fluid
Data. Table 3.6 shows the liquid-gas relative permeability and capillary pressure data
for the simulation case, while Table 3.7 shows the same properties for the water-oil case,
which are dependent on water saturation. Figure 3.2 shows the liquid-gas relative
permeability curves and Figure 3.3 shows the water-oil relative permeability curves for
the oil core flood simulation case. CMG ModelBuilder has been used to plot these
graphs.
CMG ModelBuilder (CMG MB) is a visual interface based pre-processor
software for CMG's IMEX, GEM and STARS simulators. The new version (2004.11) has
a stronger user interface compared to the previous ones.
The Initial Reservoir Conditions section of the input file includes the following
information. Vertical equilibrium calculations were not performed for this case. The
keyword *VERTICAL that controls the vertical equilibrium calculations in CMG GEM
input files was set to be *OFF in this run. The initial reservoir pressure for the oil core
flood simulation is 1000 kPa. The water saturation is zero and finally the initial
composition of the fluid can be found in Table 3.1.

33
3.10.2 Results and Discussion

Figure 3.4 presents the result for the simulated case, in terms of the permeability

resistance factor as a function of core length for different values of PV injected. The
highest PV injected results in a higher resistance factor for permeability. The oil core
flood case was run in Fontainebleau sandstone, which has no clay and represents a very
homogeneous medium with regular grain size. In conclusion, one can say that the
permeability resistance factor of the core is uniform from inlet to outlet with a slight
decrease towards the outlet.
For simulating this case, which had an initial permeability of 77.4 md, only a
surface deposition rate coefficient of = 6.0 day 1 has been used. The other input
parameters i.e. , v cr,o , and that identify the deposition model in CMG GEM were

turned off. Figure 3.5 shows the permeability reduction ( k / k 0 ) with respect to the core
length. Note that k 0 represents the original permeability. The permeability reduction is

the inverse of the permeability resistance factor. A steady decline of overall permeability
with a slightly concave-up shape can be seen in this plot.

3.11 ONE-DIMENSIONAL GAS INJECTION CORE FLOOD SIMULATION

Using CMG GEM, one-dimensional simulation of near-miscible gas injection into


an oil-filled core was performed to investigate the possible precipitation and deposition of
asphaltene. The effect of the parameters of the models for this one-dimensional
simulation is also investigated. This section presents the results for this compositional
reservoir simulation.

34
3.11.1 Simulation Input and Reservoir Fluid Data

A schematic representation of the case is shown in Figure 3.6. Note that in this
figure, the numbers represent the gridblocks in the x direction. The core fluid used for
studying asphaltene precipitation and deposition was obtained from a North Sea oil and
the injection fluid is a hydrocarbon gas with known composition. The North Sea oil
consists of 7 pseudo-components which are N2 + C1, C2-C5, C6-C9, C10-C20, C21-
C31, C32A+, and C32B+.
Table 3.8 and Table 3.9 show the pseudo-component representation, fluid

compositions and component molecular weights of the reservoir fluid together with
separator oil (dead oil) and separator gas compositions. The heaviest fraction, C32+, is
split into a non-precipitating component, C32A+, and a precipitating component, C32B+,
as shown in the tables. The precipitating component is considered to be asphaltene. The
oil in the system is created by recombining a North Sea dead oil with 35-mole percent
separator gas, and the injection gas is specified as having the separator gas composition.
Table 3.10 shows the data for the simulation of a typical gas core displacement

with the North Sea reservoir fluid. Also, the grid data can be found in this table. A
uniform of 30 1 1 grid was used. The width of each gridblock in the x direction was

a uniform of 0.02286 m. The porosity is 0.30 and the core had a uniform permeability of
500 md. For this simulation case, flow only in one direction was considered.
Table 3.11 shows the PVT properties of the North Sea reservoir fluid. In addition,

Table 3.12, which was obtained from CMG WinProp, shows the binary interaction

parameters for different components for the gas injection case.


Table 3.13 shows the liquid-gas relative permeability and capillary pressure data

for the simulated case, while Table 3.14 shows the same properties for the water-oil case,
which are dependent on water saturation. The relative permeability and capillary pressure

35
data for the gas injection case were similar to the oil core flood simulation case. Figure
3.2 shows the liquid-gas relative permeability curves and Figure 3.3 shows the water-oil

relative permeability curves. The initial reservoir conditions section of the input file for
the gas injection core flood simulation is the same as that for the oil core flood
simulation.
Two vertical wells were used for this simulation case. The first well is an injector
and the second well is a producer. The details of the wells including geometry and
constraints can be found in a section of the input file called Well Data of the input file.

3.11.2 Results and Discussion

Figures 3.7 through 3.19 present the results of the gas injection core flood

simulation case. The user interface of CMG Results accepts the unit Days for time,
only. Therefore, as an example, the arbitrary dimensionless time of 0.65 PV injected
was converted to days. The calculation is as follows:

A = yz Cross sectional area, open to flow

y = 8.10732E-03 m

z=1m

L = 0.6858 m Core length

= 0 .3 Porosity

q = 1.668 103 m 3 /day Bottom hole flow rate

Therefore,

A = 8.10732E-03 m 2 and

36
qt
PV Injected = t D = = 0.65
AL

Hence

Al 0.3 8.10732 103 0.6858


t= tD = 0.65 = 0.6500 Days
q 1.668 103

In all the runs which are related to the gas core flood simulation to facilitate
interpretation of the results, the pore-throat plugging, , and entrainment rate
coefficients, , of the deposition model were not used. Figures 3.7 to 3.9 correspond to
several runs which were performed initially with irreversible flocculation, k 21 = 0.0
(solid s 2 will not go back into solution), and no deposition, = 0.0. Values of k12 from

0 to 100.0 day 1 were investigated in these runs.


Figure 3.7 shows the gas saturation and interfacial tension profiles as a function
of the core length after 0.65 PV of gas injection for a run with no flocculation ( k12 = 0.0).

This plot shows a region of reduced interfacial tension behind the near-miscible gas front
where asphaltene precipitation is expected to be prevalent. Also it indicates the level of
oil saturation remaining behind the front. The value of k12 does not have any effect on

these profiles.
Figure 3.8 shows the amount of precipitated asphaltene, s1 , for different values of

k12 as a function of the core length. The lowest forward formation rate of solid s 2 from
solid s1 , will have the highest amount of precipitation. Figure 3.9 shows the profiles for
flocculated asphaltene, s 2 . Considering that in this set of runs the deposition model was
not counted for and there is no irreversibility (k 21 = 0.0); by increasing the forward rate

of formation, the flocculation of asphaltene will increase. These asphaltene flocculates


will flow in suspension in the oil phase.

37
Figures 3.10 through 3.13 correspond to simulation runs that include the forward

and reverse reaction rates (partial or full reversibility of flocculated asphaltene) without
considering the effects of the deposition model. Figure 3.10 shows the precipitated
asphaltene profile for k12 = 10.0 day 1 with different values of k12 that range from 0.0 to
10.0 day 1 . Full reversibility can be implied from k12 = 10. Figure 3.11 is similar to

Figure 3.10 but it shows the results of the flocculation reaction of asphaltene.

The main difference between Figures 3.12 through 3.13 and Figures 3.10
through 3.11 is the value of k12 . The profiles in Figures 3.12 and 3.13 follow patterns

similar to those in Figures 3.10 and 3.11, respectively. In both cases, the results are as
expected; with the amount of precipitated asphaltene increasing and the amount of
flocculated asphaltene decreasing as the rate of the reverse reaction increases. Comparing
Figure 3.10 with Figure 3.12 one can say that an increase in k12 will reduce the amount

of precipitated asphaltene. On the other hand, when the profiles of Figures 3.11 and 3.13
are compared with each other, an increase in flocculation is observed. The deposition
model was turned off for Figures 3.10 through 3.13 and only the effects of the
precipitation and flocculation models were studied.
Figures 3.14 through 3.19 are sets of simulation runs with k12 = 10.0 day 1 , k 21

= 1 or 10.0 day 1 , and a surface deposition parameter of = 0.0 to 100 day 1 . These

plots represent three sets of runs with a certain choice of formation rates and a specific
surface deposition parameter. Figures 3.14 and 3.15 are similar, as they indicate the
precipitated asphaltene at 0.65 PV injected. The main difference between these two plots
is the reverse rate of formation of solid s1 from solid s 2 .

The plot of Figure 3.15 is known as the fully reversible run. It can be seen that
the surface deposition parameter changes only slightly the amount of precipitated

38
asphaltene when the reverse formation rate is low. On the other hand, the plot shows that
when both k12 and k 21 are high, increasing will reduce the amount of precipitation.

Figures 3.16 and 3.17 are similar as they show the flocculated asphaltene at 0.65
PV injected. The reverse rate of formation k 21 is higher for the run of Figure 3.17. These

plots follow the same pattern, that is, by increasing the deposition rate, , the amount of

flocculated asphaltene increases along the core. It can be concluded that increasing the
deposition rate will cause the flocculation reaction to go forward without considering the
effect of reverse rate of formation of solid s1 from solid s 2 .

Figures 3.18 and 3.19 show the deposited asphaltene at 0.65 PV injected for

studying the effects of surface deposition and formation rates. The reverse rate of
formation, k 21 , is lower for the run of Figure 3.18 compared to that in Figure 3.19. The

reverse formation rate will not have a great effect on the amount of deposited asphaltene
except in a run with = 10.0. This means that the highest deposition rate will cause a

higher amount of deposition of asphaltene. The effect of deposition model was not
considered in two runs of this simulation case (i.e. = 0.0). In conclusion, the deposited

asphaltene is formed mainly from the asphaltene flocculates.

3.12 TWO-DIMENSIONAL RADIAL MODEL PRESSURE DEPLETION SIMULATION

The results of a two-dimensional simulation illustrating the initial precipitation of


asphaltene from the reservoir fluid, the flocculation of these precipitates into larger
particles and the deposition of these particles in porous media, due to production and
pressure depletion are presented in this section.

39
3.12.1 Reservoir Model and Fluid Description

Using CMG GEM, a two-dimensional simulation of depletion of a radial uniform


reservoir was performed to investigate the possible precipitation and deposition of
asphaltene due to pressure reduction. Asphaltene deposition leads to reduction of
permeability or formation damage. One vertical well at a depth of 3281 ft, which is a
production well, was used for this simulation case. The reservoir fluid used for studying
asphaltene precipitation was obtained from a paper by Burke et al. (1990) Table 1 for
Oil 1. The modeled fluid consists of 15 components, which are CO2, N2, C1, C2, C3,
i-C4, n-C4, i-C5, n-C5, FC6, C7-C15, C16-C25, C26-C30, C31A+, and C31B+. This
case was run with a fluid of 19 API gravity and 16.8 weight percent asphaltene content.
Schematic representations of this simulation case are shown in Figure 3.20 and Figure
3.21.

Table 3.15 presents the composition of the oil and molecular weights of the

pseudo-components, and Table 3.16 shows the two-dimensional radial model data for the
single-well, pressure depletion simulation. The grid data can be found in this table as
well. A uniform grid of 7 1 8 is used. The width of each gridblock in the r-direction
is variable. The porosity is 0.20 and the reservoir has a uniform horizontal permeability
of 30 md and a uniform vertical permeability of 15 md. The permeability in the -

direction is the same as that in the r-direction. This is a 2-D radial simulation case.
The parameters of the asphaltene deposition and flocculation models were set
using the following pattern: the onset pressure for the precipitation model to a very high
value (4500 psia) and to set the rate constants for the flocculation model as k12 = 0.1
day 1 and k 21 = 0.08 day 1 . The input parameters for flocculation and deposition models

used in the simulation runs are given in Table 3.17. These values are similar to those
used for the oil core flood simulation case.

40
Using CMG WinProp the values of the required parameters in PVT calculations
were obtained. Table 3.18 shows the PVT properties of the oil. Tables 3.19 through 3.22
are sets of relative permeability curves that are defined by table entries. These data define
a section of CMG GEM, which is called Rock and Fluid Data. Table 3.19 and Table
3.20 show the liquid-gas relative permeability and capillary pressure data for rock type 1

and rock type 2, respectively, while Table 3.21 and Table 3.22 show the same properties
for water-oil, which are dependent on water saturation.
Figure 3.22 and Figure 3.23 show the liquid-gas relative permeability curves for

rock type 1 and rock type 2 respectively. Figure 3.24 and Figure 3.25 show the water-oil
relative permeability curves for the two-dimensional radial simulation case. Figure 3.26
and Figure 3.27 show the liquid-gas capillary pressure curves for rock type 1 and rock
type 2, respectively. Figure 3.28 and Figure 3.29 show the water-oil curves. Using the
segregated model in CMG ModelBuilder, the three-phase oil relative permeability for the
two rock types were plotted in Figure 3.30 and Figure 3.31, respectively. CMG
ModelBuilder has been used to plot the graphs in Figures 3.22 through 3.31.
The initial reservoir conditions section of the input file includes the following
information. Vertical equilibrium calculations were performed in this case. The keyword
*VERTICAL which controls the vertical equilibrium calculations in CMG GEM input
files was set to be *COMP in this run. The initial reservoir pressure for the 2-D radial
simulation is 6092 psia. The water saturation is 0.0 and finally the initial composition of
the fluid in this run can be found in Table 3.15.
One vertical well is used for this simulation case. This well is a producer. The
details of the well including geometry and constraints can be found in a section of the
input file called Well Data. The parameters for the asphaltene precipitation model are
given in Table 3.23.

41
3.12.2 Results and Discussion

Figures 3.32 through 3.35, which were plotted with CMG Results Graph version

2004.11, present the results for the simulated case, 2-D radial model pressure depletion in
terms of the asphaltene deposited per unit bulk volume, permeability resistance factor and
pressure for the gridblock containing the deepest perforation in the well as a function of
time. The x axis in these figures represents the time in units of month. Considering
Figure 3.32 one can say that the asphaltene deposited per unit bulk volume of the

reservoir will be uniform after 5 months of production with a slight decrease towards a
value of less than 2, approximately one year and a half of depletion.
For simulating the 2-D radial model, single-well case, which had a horizontal
permeability of 30 md and a vertical permeability of 15 md, a surface deposition rate
coefficient of = 0.01 day 1 has been used. The rest of the parameters e.g. , v cr,o ,

and that identify the asphaltene deposition model were set, based on the oil core flood
simulation case. Figure 3.33 shows the permeability resistance factor ( k o / k ) with

respect to the production time. A steady decline of overall permeability followed by a


uniform and constant pattern can be understood from this figure.
Figure 3.34 was plotted in order to show the pressure as a function of time for the

gridblock, which contains the deepest perforation. For this case, the onset pressure of
asphaltene is 4500 psia and the initial reservoir pressure is about 6100 psia. This plot
illustrates that after approximately 5 months of production the asphaltene onset pressure
will be reached. In addition, the pressure continues to decrease further until it approaches
a value of 3500 psia after 19 months of depletion.
Figure 3.35, which shows the asphaltene deposited per unit bulk volume,

permeability resistance factor and pressure as a function of time, is a combination of

42
Figures 3.32 through 3.34. This plot indicates that after 5 months of production the

pressure will decrease below the upper onset pressure of asphaltene, which is
accompanied by an increase in the permeability resistance factor. In addition, for the
considered time period, there is a steady increase in the amount of deposited asphaltene.
Figure 3.36, which was plotted with CMG Results 3D (version 2004.11), shows

the amount of deposited asphaltene or deposited asphaltene concentration in units of lb/ft


bulk volume after 1 year of production for the radial model pressure depletion simulation.

3.13 TWO-DIMENSIONAL RADIAL MODEL PRESSURE DEPLETION SIMULATION


WITH GRID REFINEMENT AND HETEROGENEITY

To understand the effect of heterogeneity on asphaltene precipitation, flocculation


and deposition in oil reservoirs, a layered reservoir with a high permeability contrast
between the different layers was simulated. The results of this simulation, which was
performed under a grid refinement method, are presented in this section.

3.13.1 Reservoir Model and Fluid Description

Using CMG GEM, two-dimensional simulation of depletion of a radial


heterogeneous reservoir was performed to investigate the possible precipitation and
deposition of asphaltenes due to pressure reduction. Asphaltene deposition leads to
reduction of permeability or formation damage. One vertical well at a depth of 3281 ft,
which is a production well is used for this simulation case. The oil used for studying
asphaltene precipitation was obtained from Burke et al. (1990) Table 1 for Oil 1. The
modeled fluid consists of 15 components, which are CO2, N2, C1, C2, C3, i-C4, n-C4, i-
C5, n-C5, FC6, C7-C15, C16-C25, C26-C30, C31A+, and C31B+. This case was run
with a fluid of 19 API gravity and 16.8 weight percent asphaltene content. Schematic

43
representations of the case are shown in Figures 3.37 and 3.38. In addition, Figure 3.39,
which was plotted with CMG WinProp, shows the phase envelope of the reservoir fluid.
Table 3.24 presents the composition of the oil and the molecular weights of the

pseudo-components. The parameters of the asphaltene precipitation, flocculation and


deposition models were set using the following pattern: the onset pressure for the
precipitation model set to a very high value (4500 psia) and to set the rate constants for
the flocculation model as k 12 = 0.1 day 1 and k 21 = 0.08 day 1 . The parameters for the

asphaltene precipitation model are given in Table 3.25. The input parameters for the
deposition and flocculation models used in the simulation runs are given in Table 3.26
and Table 3.27, respectively. These values are similar to those used for the oil core flood
simulation case.
Table 3.28 shows the two-dimensional radial model data for the simulation with

grid refinement and heterogeneity. The grid data can be found in this table as well. A
uniform grid of 29 1 8 is used. The width of each gridblock in the r-direction is
variable and is presented in the table. The porosity is 0.20 and the reservoir has variable
horizontal and vertical permeabilities. The permeability in the -direction is the same as

that in the r-direction. This is a 2-D radial, heterogeneous simulation case with grid
refinement. The permeability of each layer is given in the table as well.
Using CMG WinProp, the values of the required parameters in PVT calculations
were obtained. Table 3.29 shows the PVT properties of the oil. Table 3.30 and Table
3.31 are sets of relative permeability curves that are defined by table entries. These data

define a section of CMG GEM, which is called Rock and Fluid Data. Table 3.30 shows
the liquid-gas relative permeability and capillary pressure data while Table 3.31 shows
the same properties for water-oil, which are dependent on water saturation.

44
Figure 3.40 shows the liquid-gas relative permeability curves and Figure 3.41

shows the water-oil relative permeability curves for the two-dimensional radial
simulation case. Figure 3.42 shows the liquid-gas capillary pressure curve and Figure 3.43
shows the water-oil curve. Using the segregated model in CMG ModelBuilder, the three-
phase oil relative permeability for rock type 1 was plotted in Figure 3.44.
CMG ModelBuilder has been used to plot the graphs in Figures 3.40 through
3.43. CMG ModelBuilder or MB (version 2004.11), which is the latest one, is a visual

interface based pre-processor software for CMG's IMEX, GEM and STARS simulators.
Compared to the previous version, the new package has a stronger user interface.
In addition, Table 3.32, which was obtained from CMG WinProp, shows the
binary interaction parameters for different components for the simulation case.
The initial reservoir conditions section of the input file includes the following
information. Vertical equilibrium calculations were performed in this case. The keyword
*VERTICAL which controls the vertical equilibrium calculations in CMG GEM input
files was set to be *COMP for this run. The initial reservoir pressure for the 2-D radial
simulation is 6092 psia. The water saturation is 0.0 and finally the initial composition of
the fluid in these runs can be found in Table 3.24.
One vertical well is used for this simulation case. This well is a producer. The
details of the well including geometry and constraints can be found in a section of the
input file called Well Data. This information can be found in Table 3.33.

3.13.2 Results and Discussion

Figures 3.45 through 3.48, which were plotted with CMG Results Graph version

2004.11, present the results for the simulated case, 2-D radial model pressure depletion in
terms of the asphaltene deposited per unit bulk volume, permeability resistance factor and

45
pressure for the grid block containing the deepest perforation in the well as a function of
time. The x axis in these figures represents the time in units of month. Considering
Figure 3.45, one can say that the asphaltene deposited per unit bulk volume of the

reservoir will be uniform after 5 months of production with a slight decrease towards a
value of less than 0.0130, approximately one year and a half of depletion.
For simulating the 2-D radial model, single-well case, which had a variable
horizontal permeability and a vertical permeability ranging from 10 to 150 md, a surface
deposition rate coefficient of = 0.01 day 1 has been used. The rest of the parameters,
e.g. , v cr,o , and , that identify the asphaltene deposition model were set based on the

oil core flood simulation. Figure 3.46 shows the permeability resistance factor ( k o / k )

with respect to the production time. A steady decline of overall permeability followed by
a uniform and constant pattern can be understood from this plot.
Figure 3.47 was plotted in order to show the pressure of the grid block, which

contains the deepest perforation. For this case, the onset pressure of asphaltene is 4500
psia and the initial reservoir pressure is about 6100 psia. This plot illustrates that after
approximately 5 months of production the asphaltene onset pressure will be reached. In
addition, the pressure continues to decrease further until it approaches a value of 3500
psia after 19 months of depletion.
Figure 3.48, which shows the asphaltene deposited per unit bulk volume,

permeability resistance factor and pressure as a function of time is a combination of


Figures 3.45 through 3.47. This plot indicates that after 5 months of production the

pressure will decrease below the upper onset pressure of asphaltene, which is
accompanied by an increase in the permeability resistance factor. In addition, for the
considered time period, there is a steady increase in the amount of deposited asphaltene.

46
Figure 3.49, which was plotted with CMG Results 3D (version 2004.11), shows

the amount of deposited asphaltene or deposited asphaltene concentration in units of lb/


cu. ft bulk volume after 1 year of production for the radial model pressure depletion
simulation with grid refinement and heterogeneity.

3.14 SUMMARY AND CONCLUSIONS

Before 2004, the only model for simulation of problems related to the formation
of asphaltenes in petroleum reservoirs, in CMGs equation of state compositional,
reservoir simulator, was the precipitation model. Two new models were implemented in
this simulator, the flocculation and deposition models. In this chapter, in order to study
the new models, four main cases were set up and simulated, includimg the oil core flood
and the gas injection core flood simulations. The permeability resistance factor and
permeability reduction for the oil core flood case were calculated. The new permeability
reduction model is based on a porosity reduction model that incorporates plugging of
pores by solids deposition. The amounts of asphaltene precipitation, flocculation and
deposition during a typical gas injection core flood were simulated. The occurrence of
asphaltene flocculates reduces the amount of precipitation and increases the deposited
asphaltene.
A single-well, two-dimensional radial model was simulated in order to study the
amount of asphaltene precipitation, deposition and flocculation due to pressure depletion.
Asphaltene deposition and flocculation are the names of two new models, which were
added to CMG's compositional simulator, GEM, in 2004. It was noted that the amount of
asphaltene deposition is higher around the wellbore area. There is also a relation between
the amount of deposition, the permeability resistance factor and the reservoir pressure.

47
The effect of grid refinement and reservoir heterogeneity on asphaltene precipitation was
also investigated.

48
Table 3.1: Modeled fluid composition for Weyburn dead oil

No. Component Oil Composition Molecular Weight


(mol %)
1 N2 + C1 0.00321 17.930
2 CO2 0.00409 44.010
3 C2-C3 1.75432 39.448
4 C4-C5 11.14261 64.552
5 C6-C9 36.27861 124.491
6 C10-C19 35.16170 217.808
7 C20-C29 11.54219 364.176
8 C30A+ 2.43375 622.538
9 C30B+ 1.67952 622.538
Total - 100.000 -

Table 3.2: Core data for oil core flood simulation

Parameter Value

Fluid Type Weyburn dead oil


Core type Fontainebleau
Permeability (md) 77.4
Porosity (%) 13.7
Length (cm) 6
Diameter (cm) 2.3
Flow rate (cm3/h) 10
Back pressure (kPa) 1000

49
Table 3.3: Deposition model parameters for oil core flood simulation

Parameter Value

(day 1 ) 6.0
(m 1 ) 0.0
v cr,o (m / day) 0.0
(m 1 ) 0.0
0.0

50
Table 3.4: PVT properties of Weyburn dead oil

No. Component Pc (atm) Vc (m3/mol) Tc (deg K) AC MW


1 N2 + C1 4.36E+01 9.75E-02 1.80E+02 1.30E-02 1.79E+01
2 CO2 7.28E+01 9.40E-02 3.04E+02 2.25E-01 4.40E+01
3 C2-C3 4.41E+01 1.84E-01 3.50E+02 1.34E-01 3.94E+01
4 C4-C5 3.54E+01 2.79E-01 4.42E+02 2.13E-01 6.46E+01
5 C6-C9 2.76E+01 4.57E-01 5.93E+02 3.30E-01 1.24E+02
6 C10-C19 1.87E+01 7.66E-01 7.30E+02 5.69E-01 2.18E+02
7 C20-C29 1.30E+01 1.17E+00 8.65E+02 8.86E-01 3.64E+02
8 C30A+ 8.73E+00 1.73E+00 1.03E+03 1.26E+00 6.23E+02
9 C30B+ 8.73E+00 1.73E+00 1.03E+03 1.26E+00 6.23E+02

No. Component HcFlag Vol. Shift OMEGA OMEGB Parachor


1 N2 + C1 0.000 -1.52E-01 4.57E-01 7.78E-02 7.13E+01
2 CO2 0.000 -1.54E-01 3.66E-01 6.22E-02 7.80E+01
3 C2-C3 0.000 1.67E-01 4.57E-01 7.78E-02 1.36E+02
4 C4-C5 0.000 1.51E-01 4.57E-01 7.78E-02 2.07E+02
5 C6-C9 0.000 2.01E-01 4.57E-01 7.78E-02 3.37E+02
6 C10-C19 0.000 4.87E-03 4.57E-01 7.78E-02 6.04E+02
7 C20-C29 0.000 7.48E-02 4.57E-01 7.78E-02 1.02E+03
8 C30A+ 0.000 1.47E-01 4.57E-01 7.78E-02 1.76E+03
9 C30B+ 0.000 1.47E-01 4.57E-01 7.78E-02 1.76E+03

51
Table 3.5: Binary Interaction Parameters for different components for Weyburn fluid

N2+C1 CO2 C2-C3 C4-C5 C6-C9 C10-C19 C20-C29 C30A+ C30B+


N2 + C1 0.00
CO2 0.13 0.00
C2-C3 0.01 0.14 0.00
C4-C5 0.02 0.13 0.00 0.00
C6-C9 0.04 0.10 0.02 0.00 0.00
C10-C19 0.08 0.10 0.04 0.02 0.01 0.00
C20-C29 0.11 0.10 0.06 0.04 0.02 0.00 0.00
C30A+ 0.14 0.10 0.09 0.06 0.03 0.01 0.00 0.00
C30B+ 0.16 0.18 0.10 0.07 0.04 0.01 0.00 0.00 0.00

Table 3.6: Liquid-gas relative permeability and capillary pressure table

Sg krg krog Drainage dkrg/dSg dkrog/dSg Drainage


Pcog dPcog/dSg
0 0 1 0 0.0000E+00 -2.4000E+00 0.0000E+00
0.05 0 0.88 0 2.5707E-02 -4.5681E+00 0.0000E+00
0.0889 0.001 0.7023 0 1.0124E-01 -2.6074E+00 0.0000E+00
0.1778 0.01 0.4705 0 2.2497E-01 -1.9595E+00 0.0000E+00
0.2667 0.03 0.2963 0 2.2497E-01 -1.4038E+00 0.0000E+00
0.3556 0.05 0.1715 0 5.6306E-01 -9.4257E-01 0.0000E+00
0.4444 0.1 0.0878 0 1.1249E+00 -5.7143E-01 0.0000E+00
0.5333 0.2 0.037 0 1.6873E+00 -2.9246E-01 0.0000E+00
0.6222 0.35 0.011 0 1.4388E+00 -3.9568E-01 0.0000E+00
0.65 0.39 0 0 2.7823E+00 0.0000E+00 0.0000E+00
0.7111 0.56 0 0 4.9494E+00 0.0000E+00 0.0000E+00

52
Table 3.7: Water-oil relative permeability and capillary pressure table

Drainage Imbibition Drainage Imbibition


Sw krw krow Pcow Pcow dkrw/dSw dkrow/dSw dPcwo/dSw dPcwo/dSw
0.2000 0.0000 1.0000 0.0 0.00000 0.02447 -3.59400 0.00000 0.00000
0.2899 0.0022 0.6769 0.0 0.00000 0.17975 -2.97610 0.00000 0.00000
0.3778 0.0180 0.4153 0.0 0.00000 0.48031 -2.22160 0.00000 0.00000
0.4667 0.0607 0.2178 0.0 0.00000 0.93476 -1.51070 0.00000 0.00000
0.5556 0.1438 0.0835 0.0 0.00000 1.54390 -0.80180 0.00000 0.00000
0.6444 0.2809 0.0123 0.0 0.00000 2.30220 -0.22122 0.00000 0.00000
0.7000 0.4089 0.0000 0.0 0.00000 2.30030 0.00000 0.00000 0.00000
0.7333 0.4855 0.0000 0.0 0.00000 3.21030 0.00000 0.00000 0.00000
0.8222 0.7709 0.0000 0.0 0.00000 2.57710 0.00000 0.00000 0.00000
0.9111 1.0000 0.0000 0.0 0.00000 0.00000 0.00000 0.00000 0.00000
1.0000 1.0000 0.0000 0.0 0.00000 0.00000 0.00000 0.00000 0.00000

Table 3.8: The fluid compositions and molecular weights of dead oil and separator gas

Dead Oil Separator Gas Molecular


No. Component Composition Composition Weight
(mol %) (mol %)
1 N2 + C1 8.365 70.216 16.61
2 C2-C5 25.273 28.319 14.43
3 C6-C9 27.014 1.465 94.63
4 C10-C20 24.625 0 167.20
5 C21-C31 9.698 0 354.65
6 C32A+ 3.654 0 591.68
7 C32B+ 1.371 0 591.68
Total - 100.000 100.000 -

53
Table 3.9: The composition of core oil and injection gas

Oil in the Injection Gas


No. Component System Composition
(mol %) (mol %)
1 N2 + C1 30.01285 70.216
2 C2-C5 26.3391 28.319
3 C6-C9 18.07185 1.465
4 C10-C20 16.00625 0
5 C21-C31 6.3037 0
6 C32A+ 2.3751 0
7 C32B+ 0.89115 0
Total - 100.000 100.000

Table 3.10: Core displacement data for North Sea fluid

Property Value

Length (m) 0.6858


Diameter (m) 0.0508
Permeability (md) 500
Porosity (%) 30
Water Saturation (fraction) 0
Pressure (kPa) 25000
Temperature ( C) 92
Separator gas in recombined oil (%) 35
Injection gas Separator Gas
Rate (m/D) 0.6858
No. of gridblocks in x direction 30

54
Table 3.11: The PVT properties of North Sea fluid

No Component Pc (atm) Vc (m3/mol) Tc (deg K) AC MW Zc


1 N2 + C1 45.163 0.099 188.928 0.010 16.614 0.28736
2 C2-C5 43.389 0.190 357.836 0.138 41.425 0.28093
3 C6-C9 31.101 0.375 535.827 0.305 94.626 0.26542
4 C10-C20 21.282 0.626 660.857 0.527 167.200 0.24573
5 C21-C31 11.759 1.217 839.559 0.974 354.646 0.20770
6 C32A+ 7.122 1.996 983.204 1.345 591.682 0.17619
7 C32B+ 7.122 1.996 983.204 1.345 591.682 0.17619

No Component HcFlag Vol. Shift OMEGA OMEGB Parachor VISVC


1 N2 + C1 0.000 -0.153 0.457 0.078 47.468 0.099
2 C2-C5 0.000 -0.078 0.457 0.078 118.357 0.192
3 C6-C9 0.000 0.015 0.457 0.078 270.361 0.376
4 C10-C20 0.000 0.112 0.457 0.078 477.713 0.626
5 C21-C31 0.000 0.110 0.457 0.078 1013.274 1.219
6 C32A+ 0.000 0.057 0.457 0.078 1690.520 1.997
7 C32B+ 0.000 0.057 0.457 0.078 1690.520 1.997

Table 3.12: Binary interaction parameters for the North Sea fluid

N2 + C1 C2-C5 C6-C9 C10-C20 C21-C31 C32A+ C32B+


N2 + C1 0.00000000
C2-C5 0.00500198 0.00000000
C6-C9 0.02045016 0.00536884 0.00000000
C10-C20 0.03848399 0.01633704 0.00305121 0.00000000
C21-C31 0.06911029 0.03881787 0.01592196 0.00512854 0.00000000
C32A+ 0.09643750 0.06099387 0.03167576 0.01546879 0.00285130 0
C32B+ 0.17260800 0.11093600 0.05836900 0.02870800 0.00532100 0 0

55
Table 3.13: Liquid-gas relative permeability and capillary pressure table

Sg krg krog Drainage dkrg/dSg dkrog/dSg Drainage


Pcog dPcog/dSg
0 0 1 0 0.0000E+00 -2.4000E+00 0.0000E+00
0.05 0 0.88 0 2.5707E-02 -4.5681E+00 0.0000E+00
0.0889 0.001 0.7023 0 1.0124E-01 -2.6074E+00 0.0000E+00
0.1778 0.01 0.4705 0 2.2497E-01 -1.9595E+00 0.0000E+00
0.2667 0.03 0.2963 0 2.2497E-01 -1.4038E+00 0.0000E+00
0.3556 0.05 0.1715 0 5.6306E-01 -9.4257E-01 0.0000E+00
0.4444 0.1 0.0878 0 1.1249E+00 -5.7143E-01 0.0000E+00
0.5333 0.2 0.037 0 1.6873E+00 -2.9246E-01 0.0000E+00
0.6222 0.35 0.011 0 1.4388E+00 -3.9568E-01 0.0000E+00
0.65 0.39 0 0 2.7823E+00 0.0000E+00 0.0000E+00
0.7111 0.56 0 0 4.9494E+00 0.0000E+00 0.0000E+00

Table 3.14: Water-oil relative permeability and capillary pressure table

Drainage Imbibition Drainage Imbibition


Sw krw krow Pcow Pcow dkrw/dSw dkrow/dSw dPcwo/dSw dPcwo/dSw
0.2000 0.0000 1.0000 0.00000 0.00000 0.02447 -3.59400 0.00000 0.00000
0.2899 0.0022 0.6769 0.00000 0.00000 0.17975 -2.97610 0.00000 0.00000
0.3778 0.0180 0.4153 0.00000 0.00000 0.48031 -2.22160 0.00000 0.00000
0.4667 0.0607 0.2178 0.00000 0.00000 0.93476 -1.51070 0.00000 0.00000
0.5556 0.1438 0.0835 0.00000 0.00000 1.54390 -0.80180 0.00000 0.00000
0.6444 0.2809 0.0123 0.00000 0.00000 2.30220 -0.22122 0.00000 0.00000
0.7000 0.4089 0.0000 0.00000 0.00000 2.30030 0.00000 0.00000 0.00000
0.7333 0.4855 0.0000 0.00000 0.00000 3.21030 0.00000 0.00000 0.00000
0.8222 0.7709 0.0000 0.00000 0.00000 2.57710 0.00000 0.00000 0.00000
0.9111 1.0000 0.0000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
1.0000 1.0000 0.0000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000

56
Table 3.15: Modeled fluid composition for Burke Oil 1

No. Component Oil Composition MW


(mol %)
1 CO2 2.46 44.010
2 N2 0.57 28.013
3 C1 36.37 16.043
4 C2 3.47 30.070
5 C3 4.05 44.097
6 i-C4 0.59 58.124
7 n-C4 1.34 58.124
8 i-C5 0.74 72.151
9 n-C5 0.83 72.151
10 FC6 1.62 86.000
11 C7-C15 19.66 147.272
12 C16-C25 12.55 279.231
13 C26-C30 4.00 389.527
14 C31A+ 7.42 665.624
15 C31B+ 4.32 665.624

Table 3.16: Two-dimensional radial model data for oil depletion simulation

Property Value

Drainage radius (ft) 950


Height (ft) 131
No. of radial grid blocks 7
No. of vertical grid blocks 8
Porosity (%) 20
Horizontal permeability (md) 30
Vertical permeability (md) 15
Water saturation (%) 0
Stock tank oil rate (bbl/day) 755
Initial pressure (psia) 6092
Bubble point pressure (psia) 2950
Temperature ( F) 212

57
Table 3.17: Input parameters for the deposition and flocculation models

Parameter Value

(day 1 ) 0.01
(m 1 ) 0.00
v cr,o (m/day) 0.00
(m 1 ) 0.05
150
k12 (day 1 ) 0.10
k 21 (day 1 ) 0.08
Asphaltene onset pressure (psia) 4500

58
Table 3.18: The Burke oil PVT properties

No Component Pc (atm) Vc (m3/mol) Tc (deg K) AC MW


1 CO2 72.80 0.094 304.2 0.225 44.01
2 N2 33.50 0.0895 126.2 0.04 28.013
3 C1 45.40 0.099 190.6 0.008 16.043
4 C2 48.20 0.148 305.4 0.098 30.07
5 C3 41.90 0.203 369.8 0.152 44.097
6 i-C4 36.00 0.263 408.1 0.176 58.124
7 n-C4 37.50 0.255 425.2 0.193 58.124
8 i-C5 33.40 0.306 460.4 0.227 72.151
9 n-C5 33.30 0.304 469.6 0.251 72.151
10 FC6 32.46 0.344 507.5 0.27504 86
11 C7-C15 25.90 0.521218 652.5765 0.451664 147.2724
12 C16-C25 16.01 0.927762 809.8804 0.789045 279.2312
13 C26-C30 12.08 1.248509 899.7084 1.014742 389.5274
14 C31A+ 6.81 2.197911 1075.737 1.423258 665.624
15 C31B+ 6.81 2.197911 1075.737 1.423258 665.624

No Component HcFlag Vol. Shift OMEGA OMEGB Parachor


1 CO2 0 0 0.457236 0.077796 78
2 N2 0 -0.16633 0.457236 0.077796 41
3 C1 0 -0.14925 0.457236 0.077796 77
4 C2 0 0 0.457236 0.077796 108
5 C3 0 0.03279 0.457236 0.077796 150.3
6 i-C4 0 0.054707 0.457236 0.077796 181.5
7 n-C4 0 0.012304 0.457236 0.077796 189.9
8 i-C5 0 -0.03851 0.457236 0.077796 225
9 n-C5 0 -0.02356 0.457236 0.077796 231.5
10 FC6 0 -0.06713 0.457236 0.077796 250.1
11 C7-C15 0 -0.03283 0.457236 0.077796 416.5737
12 C16-C25 0 0.079926 0.457236 0.077796 718.9826
13 C26-C30 0 0.15951 0.457236 0.077796 912.964
14 C31A+ 0 0.372312 0.457236 0.077796 1163.844
15 C31B+ 0 0.372312 0.457236 0.077796 1163.844

59
Table 3.19: Liquid-gas relative permeability & capillary pressure table for rock 1

Sg krg krog Pcog (psi)


0.0 0.0 1.00000 0.0
0.05000 0.0 0.88000 0.0
0.08890 0.00100 0.70230 0.0
0.17780 0.01000 0.47050 0.0
0.26670 0.03000 0.29630 0.0010
0.35560 0.05000 0.17150 0.0100
0.44440 0.10000 0.08780 0.0300
0.53330 0.20000 0.03700 0.8000
0.62220 0.35000 0.01100 3.0000
0.65000 0.39000 0.0 4.0000
0.71110 0.56000 0.0 8.0000
0.80000 1.0 0.0 30.0000

Table 3.20: Liquid-gas relative permeability & capillary pressure table for rock 2

Sg krg krog Pcog (psi)


0.0 0.0 1.0000 0.0
0.0500 0.0 0.8800 0.0
0.0889 0.0010 0.7023 0.0
0.1778 0.0100 0.4705 0.0
0.2667 0.0300 0.2963 0.0010
0.3556 0.0500 0.1715 0.0100
0.4444 0.1 0.0878 0.0300
0.5333 0.2 0.0370 0.8000
0.6222 0.3500 0.0110 3.0000
0.6500 0.3900 0.0 4.0000
0.7111 0.5600 0.0 8.0000
0.8000 1.0 0.0 30.0000

60
Table 3.21: Water-oil relative permeability & capillary pressure table for rock 1

Sw krw krow Pcow (psi)


0.2000 0.0 1.0 45.0000
0.2899 0.00220 0.67690 19.0300
0.3778 0.01800 0.41530 10.0700
0.4667 0.06070 0.21780 4.9000
0.5556 0.14380 0.08350 1.8000
0.6444 0.28090 0.01230 0.5000
0.7000 0.40890 0.0 0.0500
0.7333 0.48550 0.0 0.0100
0.8222 0.77090 0.0 0.0
0.9111 1.0 0.0 0.0
1.0 1.0 0.0 0.0

Table 3.22: Water-oil relative permeability & capillary pressure table for rock 2

Sw krw krow Pcow (psi)


0.2000 0.0 1.0 45.0000
0.7000 0.7 0.0 0.0500
0.9111 1.0 0.0 0.0
1.0 1.0 0.0 0.0

Table 3.23: Input parameters for asphaltene precipitation model

Parameter Value
Reference fugacity (atm) -25.2053
Molar volume of the solid phase (litres/gmol) 0.9
Reference pressure (psia) 50000
Molar volume of the solid phase (litres/gmol) 0.9

61
Table 3.24: Modeled fluid composition for Burke Oil 1

No. Component Oil Composition MW


(mol %)
1 CO2 2.46 44.010
2 N2 0.57 28.013
3 C1 36.37 16.043
4 C2 3.47 30.070
5 C3 4.05 44.097
6 i-C4 0.59 58.124
7 n-C4 1.34 58.124
8 i-C5 0.74 72.151
9 n-C5 0.83 72.151
10 FC6 1.62 86.000
11 C7-C15 19.66 147.272
12 C16-C25 12.55 279.231
13 C26-C30 4.00 389.527
14 C31A+ 7.42 665.624
15 C31B+ 4.32 665.624

Table 3.25: Parameters for asphaltene precipitation model

Parameter Value

Reference fugacity (atm) -25.2053


Molar volume of the solid phase (litres/gmol) 0.9
Reference pressure (psia) 50000
Molar volume of the solid phase (litres/gmol) 0.9

62
Table 3.26: Input parameters for the asphaltene deposition model

Parameter Value

(day 1 ) 0.01
(m 1 ) 0.00
v cr,o (m/day) 0.00
(m 1 ) 0.05
150

Table 3.27: Input parameters for the asphaltene flocculation model

Parameter Value

k 12 (day 1 ) 0.10
k 21 (day 1 ) 0.08
Asphaltene onset pressure (psia) 4500

63
Table 3.28: 2-D radial model data for oil depletion simulation with grid refinement

Property Value

Drainage radius (ft) 950


Height (ft) 131
No. of radial grid blocks 29
No. of vertical grid blocks 8
Porosity (%) 20
Water saturation (%) 0
Stock tank oil rate (bbl/day) 755
Initial pressure (psia) 6092
Bubble point pressure (psia) 2950
Temperature ( F) 212
Total Number of grid blocks 232
Horizontal permeability of layer 1 (md) 150
Horizontal permeability of layer 2 (md) 20
Horizontal permeability of layer 3 (md) 40
Horizontal permeability of layer 4 (md) 30
Horizontal permeability of layer 5 (md) 50
Horizontal permeability of layer 6 (md) 10
Horizontal permeability of layer 7 (md) 80
Horizontal permeability of layer 8 (md) 130
Vertical permeability of each layer (md) 0.1 Horizontal k
Grid dimension in r direction (ft) 41
Grid dimension in r direction (ft) 32
Grid dimension in r direction (ft) 55
Grid dimension in r direction (ft) 4 10
Grid dimension in r direction (ft) 3 25
Grid dimension in r direction (ft) 4 50
Grid dimension in r direction (ft) 6 100
Grid dimension in direction ( ) 360
Grid dimension in z direction (ft) 16.4042

64
Table 3.29: The Burke Oil 1 PVT properties

No Component Pc (atm) Vc (m3/mol) Tc (deg K) AC MW


1 CO2 72.80 0.094 304.2 0.225 44.01
2 N2 33.50 0.0895 126.2 0.04 28.013
3 C1 45.40 0.099 190.6 0.008 16.043
4 C2 48.20 0.148 305.4 0.098 30.07
5 C3 41.90 0.203 369.8 0.152 44.097
6 i-C4 36.00 0.263 408.1 0.176 58.124
7 n-C4 37.50 0.255 425.2 0.193 58.124
8 i-C5 33.40 0.306 460.4 0.227 72.151
9 n-C5 33.30 0.304 469.6 0.251 72.151
10 FC6 32.46 0.344 507.5 0.27504 86
11 C7-C15 25.90 0.521218 652.5765 0.451664 147.2724
12 C16-C25 16.01 0.927762 809.8804 0.789045 279.2312
13 C26-C30 12.08 1.248509 899.7084 1.014742 389.5274
14 C31A+ 6.81 2.197911 1075.737 1.423258 665.624
15 C31B+ 6.81 2.197911 1075.737 1.423258 665.624

65
Table 3.29: The Burke Oil 1 PVT properties (continued)

No Component HcFlag Vol. Shift OMEGA OMEGB Parachor


1 CO2 0 0 0.457236 0.077796 78
2 N2 0 -0.16633 0.457236 0.077796 41
3 C1 0 -0.14925 0.457236 0.077796 77
4 C2 0 0 0.457236 0.077796 108
5 C3 0 0.03279 0.457236 0.077796 150.3
6 i-C4 0 0.054707 0.457236 0.077796 181.5
7 n-C4 0 0.012304 0.457236 0.077796 189.9
8 i-C5 0 -0.03851 0.457236 0.077796 225
9 n-C5 0 -0.02356 0.457236 0.077796 231.5
10 FC6 0 -0.06713 0.457236 0.077796 250.1
11 C7-C15 0 -0.03283 0.457236 0.077796 416.5737
12 C16-C25 0 0.079926 0.457236 0.077796 718.9826
13 C26-C30 0 0.15951 0.457236 0.077796 912.964
14 C31A+ 0 0.372312 0.457236 0.077796 1163.844
15 C31B+ 0 0.372312 0.457236 0.077796 1163.844

66
Table 3.30: Liquid-gas relative permeability & capillary pressure table

Sg krg krog Pcog (psi)


0.0 0.0 1.00000 0.0
0.05000 0.0 0.88000 0.0
0.08890 0.00100 0.70230 0.0
0.17780 0.01000 0.47050 0.0
0.26670 0.03000 0.29630 0.0010
0.35560 0.05000 0.17150 0.0100
0.44440 0.10000 0.08780 0.0300
0.53330 0.20000 0.03700 0.8000
0.62220 0.35000 0.01100 3.0000
0.65000 0.39000 0.0 4.0000
0.71110 0.56000 0.0 8.0000
0.80000 1.0 0.0 30.0000

Table 3.31: Water-oil relative permeability & capillary pressure table

Sw krw krow Pcow (psi)


0.2000 0.0 1.0 45.0000
0.2899 0.00220 0.67690 19.0300
0.3778 0.01800 0.41530 10.0700
0.4667 0.06070 0.21780 4.9000
0.5556 0.14380 0.08350 1.8000
0.6444 0.28090 0.01230 0.5000
0.7000 0.40890 0.0 0.0500
0.7333 0.48550 0.0 0.0100
0.8222 0.77090 0.0 0.0
0.9111 1.0 0.0 0.0
1.0 1.0 0.0 0.0

67
CO2 N2 C1 C2 C3 IC4 NC4 IC5 NC5 FC6 C7- C16- C26- C31A C31B
C15 C25 C30 + +

CO2 0

N2 2E-2 0

C1 1.35 3.1E- 0
E-1 2
C2 4.31 9.5E- 2.094 0
17E- 2 1E-3
C3 9.15 1.25E 1.15E 1.294 0
82E- -1 -2 2E-3
IC4 6.03 3.598 9.5E- 1.3E- 8.694 0
97E- 6E-3 2 1 4094E
NC4 2.02 6.594 9.346 1.610 9.5E- 1.03E 0
62E- E-3 2E-4 7E-2 2 -1

68
IC5 5.61 2.124 3.668 1.16E 6.684 1.3E- 4.2E- 0
67E- 9E-2 E-3 -3 7E-3 1 2
NC5 1.14 4.130 1.574 3.759 1.777 2.11E 1.238 6.652 0
29E- 064E- 88E-2 5E-3 E-4 -3 1E-5 8E-3
FC6 5.72 1.5E- 3.065 1.593 2.236 1.982 2.722 1.25E 4.273 0
5E-2 1 E-2 3E-2 1E-3 4E-4 E-4 -1 59E-3
C7- 4.13 4.835 1.2E- 3.184 1.263 1.5E- 1.5E- 4.007 9.5E- 6.744 0
C15 57E- 33E-2 1 6E-2 4E-2 1 1 2E-4 2 91E-4
C16- 2.24 1.5E- 4.866 1.126 2.510 4.298 1.2E- 1.2E- 5.579 1.629 1.3E- 0
C25 E-1 1 2E-2 5E-1 3E-2 2E-3 1 1 5E-7 3E-2 1
C26- 2.24 2.24E 1.2E- 4.298 8.738 2.533 1.5E- 6.154 3.473 1.5E- 6.806 9.1E- 0
Table 3.32: Binary interaction coefficients between the components

C30 E-1 -1 1 77E-2 06E-2 3E-2 1 E-2 5E-2 1 3E-3 2


C31 0 0 2.24E 2.24E 2.626 6.925 2.117 1.2E- 4.214 2.01E 1.2E- 2.181 1.225 0
A+ -1 -1 8E-2 6E-2 E-2 1 E-2 -2 1 2E-3 6E-2
C31 0 0 0 2.24E 2.24E 9.573 5.569 9.818 7.779 2.921 1.142 1.978 2.974 3.828 0
B+ -1 -1 4E-3 7E-2 1E-3 8E-2 2E-2 4E-2 8E-2 7E-4 E-3
Table 3.33: Well data for the 2-dimensional radial model

Property Value
DTMIN 0.01
DTMAX 30.0
DTWELL 0.50
WELL 1 Producer
Oil rate constraint of 754.773 bbl/day
Constraints
Pressure constraint of 101.5264 psia
Perforation Location Blocks (1,1,5) , (1,1,6) and (1,1,7)
Monitored Well Constraint
Maximum water-cut of 0.8

The well bore is parallel to the K axis


Well bore radius is 0.32808 ft
Well Geometry
Geometric factor for the well element is 0.5
The fraction of a circle that the well models, is 1.0
Skin factor is 0.0

69
Figure 3.1: Schematic representation of the oil core flood simulation

70
Figure 3.2: The liquid-gas relative permeability curves

71
Figure 3.3: The water-oil relative permeability curves

72
Figure 3.4: Permeability resistance factor vs. length

Figure 3.5: Deposition induced permeability reduction

73
Figure 3.6: Schematic representation of the gas injection core flood simulation

74
Figure 3.7: S g and interfacial tension, k12 = 0.0 day 1 and = 0.0 day 1

75
Figure 3.8: Precipitated asphaltene, k 21 = 0.0 day 1 and = 0.0 day 1

Figure 3.9: Flocculated asphaltene, k 21 = 0.0 day 1 and = 0.0 day 1

76
Figure 3.10: Precipitated asphaltene, k12 = 10.0 day 1 and = 0 day 1

Figure 3.11: Flocculated asphaltene, k12 = 10.0 day 1 and = 0 day 1

77
Figure 3.12: Precipitated asphaltene, k12 = 100 day 1 and = 0 day 1

Figure 3.13: Flocculated asphaltene, k12 = 100 day 1 and = 0 day 1

78
Figure 3.14: Precipitated asphaltene, k12 = 10 day 1 and k 21 = 1 day 1

Figure 3.15: Precipitated asphaltene, k12 = 10 day 1 and k 21 = 10 day 1

79
Figure 3.16: Flocculated asphaltene, k12 = 10 day 1 and k 21 = 1 day 1

Figure 3.17: Flocculated asphaltene, k12 = 10 day 1 and k 21 = 10 day 1

80
Figure 3.18: Deposited asphaltene, k12 = 10 day 1 and k 21 = 1 day 1

Figure 3.19: Deposited asphaltene, k12 = 10 day 1 and k 21 = 10 day 1

81
Figure 3.20: Schematic representation of the radial reservoir in 3-D viewpoint

Figure 3.21: Schematic of the radial reservoir including the production well

82
Figure 3.22: The liquid-gas relative permeability curves for rock type 1

Figure 3.23: The liquid-gas relative permeability curves for rock type 2

83
Figure 3.24: The water-oil relative permeability curves for rock type 1

Figure 3.25: The water-oil relative permeability curves for rock type 2

84
Figure 3.26: The liquid-gas capillary pressure curve for rock type 1

Figure 3.27: The liquid-gas capillary pressure curve for rock type 2

85
Figure 3.28: The water-oil capillary pressure curve for rock type 1

Figure 3.29: The water-oil capillary pressure curve for rock type 2

86
Figure 3.30: Three-phase oil relative permeability for rock type 1

Figure 3.31: Three-phase oil relative permeability for rock type 2

87
Figure 3.32: Development of solid deposition for single-well simulation

Figure 3.33: Development of resistance factor for radial model simulation

88
Figure 3.34: Block pressure as a function of time for pressure depletion simulation

Figure 3.35: Deposited asphaltene, permeability resistance factor and block pressure

89
Figure 3.36: Deposited asphaltene (lb/cu. ft bulk vol.) after 1 year production

90
Figure 3.37: Schematic representation of the radial reservoir with grid refinement

Figure 3.38: Schematic of the radial reservoir with grid refinement including the well

91
Figure 3.39: Burke Oil 1 asphaltene modeling P-T Diagram

Figure 3.40: The liquid-gas relative permeability curves

92
Figure 3.41: The water-oil relative permeability curves

Figure 3.42: The liquid-gas capillary pressure curve

93
Figure 3.43: The water-oil capillary pressure curve

Figure 3.44: Three-phase oil relative permeability

94
Figure 3.45: Development of solid deposition for single-well with heterogeneity

Figure 3.46: Development of resistance factor for radial model with grid refinement

95
Figure 3.47: Block pressure for 2-D radial model with grid refinement

Figure 3.48: Deposited asphaltene, permeability resistance factor and block pressure

96
Figure 3.49: Deposited asphaltene (lb/cu. ft bulk vol.) after 1 year production

97
Chapter 4: Review of the General Purpose Adaptive Simulator

4.1 INTRODUCTION

Increased oil production using improved oil recovery processes requires


numerical modeling of such processes to minimize the risk involved in development
decisions. The oil industry is requiring much more detailed analyses with a greater
demand for reservoir simulation with geological, physical, and chemical models in much
more detail than in the past. Reservoir simulation has become an increasingly widespread
and important tool for analyzing and optimizing oil recovery projects.
Numerical simulation of large petroleum reservoirs with complex recovery
processes is computationally challenging due to the problem size and detailed property
calculations involved. This problem is compounded by the finer resolution needed to
model such processes accurately. Traditionally, such simulations have been performed
on workstations or high-end desktop computers. These computers restrict the problem
size due to their addressable memory limit, and simulation studies of the entire project
life become time consuming. Parallel reservoir simulation, especially on low cost, high-
performance computing clusters has alleviated these issues to a certain extent. Recent
publications describe the development of such approaches and emphasize the necessity
and advantages of using parallel processing (Dogru et al., 2002; Habiballah et al., 2003;
Gai et al., 2003; Zhang et al., 2001; Wang et al., 1997).
Compositional reservoir simulators that are based on equation-of-state (EOS)
formulations do not handle the modeling of aqueous phase behavior and those, which are
designed for chemical flood modeling typically assume simplified hydrocarbon phase
behavior. There is a need to have a single reservoir simulator capable of combining both

98
approaches to benefit from the advantages of both models. The overall objective of
GPAS is to develop such technology using a computational framework that also allows
parallel processing. The initial stage of development involved the formulation of a fully
implicit, parallel, EOS compositional simulator (Wang et al., 1997). The description of
the framework approach used for modular code development and the application to gas
injection is given in Wang et al. (1999).
The need for a reservoir simulation framework that supports and eases physical
model development led to the development of the Integrated Parallel Accurate Reservoir
Simulator (IPARS) at The University of Texas at Austin (Parashar et al., 1997). The
computational framework of IPARS is used to separate the physical reservoir model
development from the code involving parallel processing, solvers and other auxiliary
functions. The IPARS framework supports three-dimensional, multiphase,
multicomponent, isothermal flow. It has encapsulated functions to perform the input
processing, memory allocation and management, domain decomposition, well
management, output generation and other functions like table lookups, interpolation, etc.
The framework natively supports parallel computation on both distributed and
shared memory computers using message passing. On multiprocessor computers, the
reservoir domain is divided over the y direction into several subdomains equal to the
number of processors allocated for the run. The computations associated with each of
these subdomains are distributed to individual processors. An additional layer of
gridblocks is added surrounding each subdomain assigned to a processor. The
computational framework provides a routine that updates data in this communication
layer to enable each processor to perform its calculations while communicating necessary
data with the other processors using the message passing interface (MPI).

99
The primary source of the solvers used in the framework is that provided by the
software package called PETSc (Portable Extensible Toolkit for Scientific Computation)
(Balay et al., 1997). Other solvers based on the Generalized Minimum Residual Method
(GMRES), Line Successive Over-relaxation (LSOR) and Pre-conditioned Conjugate
Gradient (PCG) methods have also been implemented as additional options in the
framework. All of these solvers provide the users with great flexibility and control of the
numerical methods used for the solutions.
Finite difference formulations with a block-centered grid are used in the
framework. The nonlinear difference equations are solved by either fully-implicit or
semi-implicit techniques. Both mass balance and volume balance are supported. Since
the portability of the simulator is very important, FORTRAN is used wherever possible.
For memory management and user interaction, classical C is used. Commercial libraries
are prohibited except in the graphics front end to the simulator. The simulator is
formulated for a distributed memory, message-passing machine. Free-format keyword
input is used for direct data input. The simulator uses a single set of units to solve the
partial differential equations. However, the user may choose any physically correct units
for the input variables and they will then be converted to the default internal unit using
appropriate conversion factor.
The overall structure of IPARS framework consists of 3 layers:
1. Executive layer that consists of routines that direct the overall course of
the simulation.
2. Work routines that are typically FORTRAN subroutines that perform grid
element computations.
3. Data-management layer that handles the distribution of grid across
processing nodes, local storage allocation, dynamic reallocation and

100
dynamic load balancing, and communication rescheduling. The data-
management layer is also responsible for checkpoint/restart, input/output
and visualization.
The fully-implicit EOS compositional formulation has already been implemented
into the IPARS framework and successfully tested. The Peng-Robinson EOS is used for
hydrocarbon phase behavior calculations. The linear solvers from the PETSc package are
used for the solution of underlying linear equations. The framework provides hooks for
implementing specific physical models. Such hooks bridge the models with the
framework. There are several executive routines, and any communications between the
processors and compositional model are performed in these routines. Many tests have
been performed using the EOS compositional simulator on a variety of computer
platforms such as IBM SP and a cluster of PCs (Wang et al., 1999; Uetani et al., 2002).

4.2 DESCRIPTION OF THE FRAMEWORK

IPARS (Gropp et al., 1996; Parashar et al., 1997; Wheeler et al., 2000) was
developed as a framework for parallel reservoir simulation research. One of several
reservoir simulation models that has been developed and tested using this framework is
the compositional model EOSCOMP (Wang et al., 1997, 1999). Extensive testing of this
and other models has been done on both parallel supercomputers and clusters of PCs
(Abate et al., 1999) with excellent scaling on large numbers of processors running in
parallel.

101
4.2.1 Framework Characteristics

The IPARS framework supports three-dimensional transient flow of multiple


phases containing multiple components along with immobile phases and adsorbed
components. The framework allows the representation of heterogeneous reservoirs with
variable porosity and permeability. Permeability is treated as a diagonal tensor. The
framework treats the reservoir as consisting of one or more fault blocks. Each fault block
has an independent gravity vector and user-defined coordinate system. The different fault
blocks that share a common interface allow for the flow of fluids from one fault block to
the other. The fault block is subdivided into gridblocks. By making some of the
gridblocks keyed out they can be used to represent irregular shapes and impermeable
strata. The keyed out gridblocks are inaccessible for the fluids to flow through.
On multiprocessor computers, the gridblocks are distributed among the individual
processors. A "communication" layer of gridblocks belonging to other processors
surrounds the subgrid assigned to a processor. The framework provides a routine that
updates data in the communication layer.
The framework supports an arbitrary number of wells, each with one or more
completion intervals. On parallel machines, the well gridblock may be assigned to more
than one processor. For each of the well gridblocks, the framework computes the
permeability normal to the wellbore, the geometric constant in the productivity index, and
the length of the open interval. Other well calculations are performed in the individual
physical property models.
The framework is designed to be portable. FORTRAN and classical C code are
used. The C code is used mainly for the memory management and the user interaction.
The framework allows for a customizable output. From a user standpoint, the output
includes the phase pressures, saturations, molar densities, viscosities, phase compositions,

102
etc. Each of these phase outputs can be written out when the corresponding keyword is
used in the input file. From a developer standpoint, an option is available to print out the
values of many of the variables used in the code by including the debug keyword in the
input file. Every output statement in the simulator is assigned an output level and hence
based on the output level, that statement is either activated or not. The framework allows
for free-form keyword input with default values supplied for most of the input variables.
The framework is flexible in terms of selection of units to use. Internally the
simulator uses a single set of units for each physical quantity. The user may choose any
physically correct unit for a quantity and the framework will convert it to the internally
used unit. The framework provides a default set of units.
Two-dimensional utilities used to represent functions include:
1. Piecewise constant
2. Piecewise linear
3. Quadratic spline with optional poles
4. Cubic spline with optional poles
5. User-defined functions (FORTRAN code in the input data)
N-dimensional utilities include:
1. Bilinear interpolation (rectangular subdomains)
2. Quadratic splines (rectangular subdomains)
3. User-defined functions (FORTRAN code in the input data)

4.2.2 Framework Functionalities

The framework handles input/output, domain splitting (decomposition), memory


allocation and message passing between processors. The framework allows each
processor to read the entire input but process only the portion for which a processor is

103
responsible. The master processor collects all the output and redirects it to the output
files.
IPARS framework is capable of domain decomposition over the y direction. The
framework divides the entire reservoir simulation domain so that each processor in the
parallel machines handles only a particular subdomain for computation. The
computations are decomposed on parallel machines to achieve computational efficiency.
Thus the framework treats the oil reservoir as a union of blocks. The interfaces between
the blocks are thin domains tied together by physically meaningful interface boundary
conditions that permit input and output from one block to neighboring blocks or domains.
The framework supports two array types. Some arrays, such as the binary
interaction coefficients and critical properties, contain values independent of the
gridblock location, while other arrays such as porosity, density and saturation depend on
the gridblock location. These array types are declared and defined in separate
subroutines. The framework allocates memory for the gridblock arrays. The first three
dimensions of the arrays represent the three coordinate directions. The component and
phase indices are specified in the fourth and fifth array dimensions. The user provides the
variable name, ID in the memory, and size of the additional dimensions. The IDs are
assigned by the framework using C language when creating the variables and stored in a
common block for use in different subroutines.
The message passing interface (MPI) functionality in the framework handles all
the necessary message sending/receiving between the processors. In the physical models,
the function CALL when revoked carries out the same task of message sending/receiving
when evaluating the residuals of the component mass-balance equations, averaging some
physical properties such as pressure and saturation, and collecting well data for output. In
the physical model, the framework provides a function to update the properties in the

104
overlapping regions of all processors. This is done by calling the function UPDATE
wherein the model developers provide the name and ID index in the memory for the
property variables in the argument list of the function. But all the necessary
communications during the solution of the linear equations are handled by the toolkit
PETSc.
The framework also handles some of the common calculations needed by almost
all of the physical models. These calculations include:
The identification of the overlapping regions of all processors
Calculating the constant portion of transmissibility at the interface of two
adjacent gridblocks
Extracting the data from the table lookups for relative permeability and
capillary pressure and computing their derivatives with respect to phase
saturations
Identifying the well locations
Calculating the productivity indices
Preprocessing includes dimensioning FORTRAN arrays for non-gridblock
variables, estimating the size of message in bytes to be needed for passing between
processors, and some dimensions for well specifications.

4.3 BASIC ASSUMPTIONS

The assumptions made in developing the formulation for modeling


multicomponent, multiphase fluid flow in porous media used in the GPAS are:
Reservoir is isothermal.
Physical dispersion is neglected.

105
Darcy's law describes the multiphase flow of fluids through the porous
media.
Impermeable zones represented by the no-flow boundaries surround the
reservoir.
The injection and production of fluids are treated as source or sink terms.
The rock is slightly compressible and immobile.
Each hydrocarbon phase is composed of nc hydrocarbon components,
which may include the non-hydrocarbon components such as CO2, N2 or
H2S.
Instantaneous local thermodynamic equilibrium between hydrocarbon
phases exists.
The capillary pressure effects on hydrocarbon phase equilibrium are
negligible.
Water is slightly compressible and water viscosity is constant.
Radioactive decay does not occur.

4.4 GOVERNING EQUATIONS

4.4.1 Phase Equilibrium Equations

The phase equilibrium calculation determines the number, amounts and


composition of all equilibrium phases. The equilibrium solution must satisfy three
conditions (Baker et al., 1982). First, the molar balance constraint must be preserved.
Second, the chemical potentials for each component must be the same in all phases.
Third, the Gibbs free energy at constant temperature and pressure must be a minimum.

106
With the assumption of local thermodynamic equilibrium for the hydrocarbon
phases, the criterion of phase equilibrium applies:

ln ( fig ) ln ( f io ) = 0 (4.4.1)

In the above equation, fij is the fugacity of component i in phase j defined by


fij = ln ( x ijij ) , where ij is the fugacity coefficient of component i in phase j and x ij is

the mole fraction of component i in phase j. The following equations are used in the
solution of Equation (4.4.1):

nc

x
i =1
ij 1 = 0 j = 1,..., n p (4.4.2)

nc
z i ( K i 1)
1+ v (K
i =1 1)
=0 (4.4.3)
i

yi
The equilibrium ratio is defined as K i = , where x i and yi are the mole
xi

fractions of i th component in oil and gas phases, respectively. The solution to Equation
(4.4.1) satisfies the first and second conditions stated above and is the necessary
condition of the third criterion.

4.4.2 Material Balance Equations


The general mass conservation equation for species i ( i = 1,..., n c ) in a volume V

can be expressed as

107
{Rate of accumulation of i in V} = {Rate of i transported into V}
(4.4.4)
{Rate of i transported from V} + {Rate of production of i in V}

The differential form for the species conservation equation can be expressed as

Wi ur uur
+ Ni R i = 0 (4.4.5)
t

uur
where Wi is the overall concentration of i in units of mass of i per unit bulk volume, N i

is the flux vector of species i in units of mass of i per surface area-time and Ri is the mass
rate of production in units of mass of i per bulk volume-time.
The mass balance equation can be expressed in terms of moles per unit time by
defining each term of Equation (4.4.5) in terms of the porous media and fluid properties
such as porosity, permeability, density, saturations, compositions, rates, etc. The
accumulation term for a porous medium becomes

np

Wi = jS j x ij (4.4.6)
j=1

where is the porosity, j is the molar density of phase j, Sj is the saturation of phase j

and x ij is the mole fraction of component i in phase j.

The flux vector of i th component is a sum of the convective and the dispersive
flux, and can be expressed as

uur n p uur uur ur


N i = j x ij u j jS j K ij x ij (4.4.7)
j=1

108
uur uur
uur
Where u j represents the superficial velocity or flux of phase j and K ij is the

dispersion tensor of i th component in phase j. The flux is evaluated using Darcy's law for
multiphase flow of fluids through porous media.

r rr ur ur
u j = k rj (Pj j D) (4.4.8)

Darcy's law is a fundamental relationship describing the flow of fluids in


permeable media under laminar flow conditions. The differential form of Darcy's law
can be used to treat multiphase unsteady state flow, non-uniform permeability, and non-
uniform pressure gradients. It is used to govern the transport of phases from one cell to
another under the local pressure gradient, rock permeability, relative permeability and
viscosity. Converting each of the terms in the mass balance equation to units of moles
per unit time and expressing the flux using Darcy's law, the mass balance for each
component i is the following partial differential equation:

p
n
r np r r rr r q
t j=1
( )
jS j x ij j j x ij Pj jD + jS jK ij x ij
V
i
=0 (4.4.9)
j=1 b

Multiplying both sides of Equation (4.2.9) by Vb gives

p ur n p ur ur uur ur
n

Vb jS j x ij Vb j j x ij (Pj j D) + jS j K ij x ij q i = 0 (4.4.10)
t j=1 j=1

109
For water, x ij = 1 , in the above equation. The pressure difference between phases

is evaluated using the capillary pressure. This equation also holds for water by inserting
the properties of the aqueous phase.
The above equation is written is terms of moles per unit time, in which q i is the

molar injection (positive) or production (negative) rate for component i. The mobility for
phase j is defined by

r
kk rj
j = (4.4.11)
j

The mass balance equations for each hydrocarbon component and water are
discretized using a fully implicit approximation with single-point upstream weighting for
the transmissibility terms. This results in a set of non-linear equations that are linearized
using Newton's procedure. Computing the derivatives of the governing equations with
respect to the independent variables generates the Jacobian matrix, which represents the
linear system. This linear system is then solved for the independent variables for all the
cells.

4.4.3 Volume Constraint Equation

The volume constraint states that the pore volume in each of the cells must be
filled completely by the total fluid volume. This is expressed in a mathematical form as

nc np

Vb N i L j v j Vp = 0 (4.4.12)
i =1 j=1

110
where Ni is the number of moles of component i per unit bulk volume, Lj is the ratio of
moles in phase j to the total number of moles in the mixture, v j is the molar volume of

phase j, Vb is the bulk volume and Vp is the pore volume of a gridcell.

4.5 PHASE BEHAVIOR

The phase equilibrium relationship determines the number, amounts and


compositions of all the equilibrium phases. The sequence of phase equilibrium
calculations is as follows:
1. The number of phases in a gridblock is determined using the phase
stability analysis.
2. After the number of phases is determined, the composition of each
equilibrium phase is determined.
3. The phases in the gridblock are tracked for the next time step calculations.

4.6 PHASE STABILITY ANALYSIS

Some extensive studies on the development and use of the phase stability
principle can be found in the literature (Baker et al., 1982; Michelsen, 1982;
Trangenstein, 1987; Perschke, 1988; Chang, 1990). The phase stability test handles the
following two situations:
Single-phase fluid is checked to see whether a phase split occurs.
Previous two-phase fluid is checked to see if the fluid becomes a single
phase under current conditions.
One way of doing the phase stability analysis is given by Michelsen (1982). A
stability analysis on a mixture of overall hydrocarbon composition Z is a search for a

111
trial phase, taken from the original mixture that, when combined with the remainder of
the mixture, gives a value of Gibbs free energy that is lower than a single-phase mixture
of overall hydrocarbon composition, Z . If such a search is successful, an additional
phase must be added to the phase equilibrium calculation. This condition is expressed
mathematically as

nc
G = yi i (Y) i (Z) (4.6.1)
i =1

where i is the chemical potential of i th component and yi is the mole fraction of

component i in the trial phase. Thus, if for any set of mole fractions the value of G at

constant temperature and pressure is greater than zero, then the phase will be stable. If a
composition can be found in which G < 0 , the phase will be unstable.

The phase stability analysis is to solve the following set of nonlinear equations for
the variables Yi :

ln Yi + ln i (Y) h i = 0 i = 1,K , n c (4.6.2)

where i is the fugacity coefficient of i th component. The mole fraction Y and the term
h i is related to these variables by

Yi
yi = nc
(4.6.3)
Y
k =1
k

h i = ln Zi + ln i (Z) i = 1,K , n c (4.6.4)

112
where Yi is the unnormalized composition of i th component. The phase stability test

usually takes a significant portion of the total CPU time (Chang et al., 1990; Young,
1991). For single-hydrocarbon-phase cells, the phase change test is even more expensive
because of a poor initial guess of the trial phase composition. To reduce the
computational cost, a negative flash (Whitson et al., 1986) is likely to be a good choice
since the search for the solution can start with a very good initial guess except in the
stage of the initialization of a simulation.

4.7 FLASH CALCULATION

The flash calculation is used for the initialization of a reservoir simulation. This
procedure is also used to generate the linear system for cells in which fluids change their
state from single-hydrocarbon phase to two-hydrocarbon phase during the iteration.
Once a mixture has been shown to split into more than one phase by the stability
calculation, the flash involves calculation of the mole fraction and composition of each
phase at the given temperature, pressure and overall composition of the fluid. The
governing equations for the flash require equality of component fugacities and mass
balance. The equilibrium solution must satisfy three conditions:
1. Mass conservation of each component in the mixture
2. Equality of chemical potentials for each component in all phases
3. Minimum Gibbs free energy at constant temperature and pressure
Fugacity is calculated using the Peng-Robinson equation-of-state. The phase
composition constraint, which states that the sum of the mole fraction of all the
components in a phase equals one, and the Rachford-Rice equation for determining the
phase amounts for two hydrocarbon phases, are used implicitly in the solution of the
fugacity equation.

113
The Rachford-Rice equation is used to determine the phase compositions and
amounts. This equation requires the values of the equilibrium ratios, K i , which are

defined as the ratio of the mole fractions of component i in oil and gas phases,
respectively. The K i values are determined by the equality of component fugacities in

each phase. The fugacity equality, the Rachford-Rice equation and the Peng-Robinson
equation-of-state are described in detail in the following sections.

4.7.1 Equality of the Component Fugacity

One of the criteria for phase equilibrium is the equality of the partial molar Gibbs
free energies or the chemical potentials. Alternatively, this criterion can be expressed in
terms of fugacity (Sandler, 1999): with the assumption of local thermodynamic
equilibrium for the hydrocarbon phases, the criterion of phase equilibrium applies (Smith
and Van Ness, 1975), namely:

fij = f il i = 1,K , n c j = 2,K , n p ( j l) (4.7.1)

where phase l has been chosen as a reference phase. At a given temperature, the fugacity
of i th component in jth phase is taken as a function of pressure and phase composition:

fij = f ij ( P, x j ) i = 1,K , n c j = 2,K , n p ( j l) (4.7.2)

4.7.2 Composition Constraint

The phase composition constraint is

114
nc

x
i =1
ij 1 = 0 (4.7.3)

where the mole fractions are defined as

n ij
x ij = i = 1,K , n c j = 2,K , n p (4.7.4)
nj

4.7.3 Rachford-Rice Equation

In a classical flash calculation, the amount and composition of each equilibrium-


phase is evaluated using a material-balance equation after each update of the K-value
from the equation-of-state:

nc
(K i 1)zi
r(v) = =0 (4.7.5)
i =1 1 + v(K i 1)

where v is the mole fraction of gas in absence of water, K i is the equilibrium ratio, z i is

the overall mole fraction of component i in the feed and r(v) is the residual of the

Rachford-Rice equation.
The component mole fractions in the liquid and gas phases are then computed
from the equations:

zi
xi = (4.7.6)
1 + v(K i 1)

zi K i
yi = (4.7.7)
1 + v(K i 1)

115
The range for v is defined by

1
vl = <0
1 K max
(4.7.8)
1
vr = >0
1 K min

Equation (4.7.5) is a monotonically decreasing function of v with asymptotes at


vl and vr . Usually, a Newton iteration can efficiently solve Equations (4.7.6) and (4.7.7)

for v . However, round-off errors occur when solving Equation (4.7.5).

4.7.4 Equation of State

The hydrocarbon phase behavior in GPAS is modeled using a cubic equation-of-


state. The Peng-Robinson equation-of-state (Peng and Robinson, 1976) is

RT a
P= (4.7.9)
v b v(v + b) + b(v b)

The parameters a and b for a pure component are computed from

R 2 Tc2
a = 0.45724 (T) (4.7.10)
Pc

T
= 1 + 1 (4.7.11)
Tc

116
RTc
b = 0.07780 (4.7.12)
Pc

0.37464 + 1.54226 0.269922 < 0.49


= (4.7.13)
0.379640 + 1.485030 - 0.164423 + 0.016666 0.49
2 3

For a multicomponent mixture, the mixing rules for the two parameters are

nc nc
a = x i x j a i a j (1 k ij ) (4.7.14)
i =1 j=1

nc
b = x i bi (4.7.15)
i =1

where for i th component, a i is computed from Equation (4.7.10), and bi is computed


from Equation (4.7.12). The constant, k ij is called the binary interaction coefficient

between components i and j.


The Peng-Robinson equation-of-state can be written in the form

Z3 + Z2 + Z + = 0 (4.7.16)

Pv
where Z = is the compressibility factor, and the parameters are expressed as
RT

= 1 + B (4.7.17)

= A 3B2 2B (4.7.18)

117
= AB + B2 + B3 (4.7.19)

aP
A= (4.7.20)
(RT) 2

bP
B= (4.7.21)
RT

In GPAS, the equation-of-state calculations are done in the subroutine named


XEOS, which contains the four subroutines EOSPURE, EOSMIX, EOSPHI and
EOSPARTIAL. The equation-of-state parameters for each pure component are
calculated in the subroutine EOSPURE. Mixture values are calculated in the subroutine
EOSMIX. The fugacity coefficient is calculated from the equation-of-state in the
subroutine EOSPHI and the equation-of-state related derivatives are computed in the
EOSPARTIAL subroutine. The subroutine EOSCUB solves the Peng Robinson cubic
equation-of-state and calculates the compressibility factor and its derivative. EOSCOMP
requires the pure component critical temperature, critical pressure, critical volume,
acentric factors, molecular weights and binary interaction coefficients to calculate the
equation of state parameters.
The main flash subroutine in GPAS is XFLASH. This subroutine performs the
flash calculation at a given initial composition, temperature and pressure. The number of
components, binary interaction coefficients and the equilibrium ratio values are also part
of the input to this subroutine. An initial estimate of the equilibrium values is done in the
subroutine STABL, which is then passed to the flash calculations. The flash subroutine
calculates the liquid and vapor phase mole fractions, liquid and vapor compressibility
factors, and also the negative residual of component i in cell k . The subroutine SOLVE

118
solves the Rachford-Rice equation for finding the phase composition and the phase
amounts.

4.8 PHASE IDENTIFICATION AND TRACKING

Phase identification deals with the labeling of a phase as oil, gas, or aqueous at
the initial conditions and also when a new phase appears. After a phase has been
identified, phase tracking does the labeling of a phase during the simulation. Labeling
phases consistently is important because of the need to assign a consistent relative
permeability to each during a numerical simulation. Phase identification deals with the
following two situations (Trangenstein, 1987; Nghiem et al., 1979):
A multiphase fluid is found and the state of each equilibrium phase
remains to be known.
A single-hydrocarbon-phase fluid is detected by the phase stability test
and the state of this single-phase fluid remains to be known.
Perschke (1988) developed a method for phase identification and tracking in
which both phase mass density and phase composition are used. This is the procedure
followed in GPAS. Once a phase has been identified, it is tracked during simulation by
comparing the mole fraction value of a selected or key component in the equilibrium
phases at the new time step with the values at the old time step. The phases at the new
time step are labeled so that the mole fraction values are closest to the values at the old
time step.
Phase identification may be more difficult when a single-hydrocarbon-phase fluid
is present. Gosset et al. (1986) proposed an approach for this for a two-parameter EOS.
This procedure works well when single-phase fluids are not close to a phase boundary.
Wang and Baker (1996) noticed that, when applying in to determine the phase state of

119
fluids at different depths with different compositions, this procedure tends to identify a
dense gas as a light liquid phase when fluid is near its phase boundary.
The algorithm used in GPAS for naming a phase when the hydrocarbon mixture is
a single phase is similar to that proposed by Gosset et al. (1986). The parameters A and
B of a two-parameter cubic EOS are computed from

aP PTc2
A= = a (4.8.1)
(RT) 2 Pc T 2

bP PT
B= = b c (4.8.2)
RT Pc T

where

a = 0.4572355299
b = 0.077796074

Dividing Equation (4.8.1) by Equation (4.8.2) gives

A a Tc
= (4.8.3)
B b T

where is defined by Equation (4.7.11). A fluid is assumed to be in single-phase if


T > Tc , which also implies 1 . From Equation (4.8.3) this implies

A a
(4.8.4)
B b

120
Or its molar volume to be greater than the critical molar volume, v > vc , which

implies

BZc
Z> (4.8.5)
b

GPAS identifies a single phase as oil or gas using the above method. An option is
also provided in the code to identify a single-phase by the conventional method: The
fluid is liquid when sum of zi K i = 1 , and the fluid is gas when the sum of z i / K i = 1 .

4.9 PHYSICAL PROPERTY MODELS

The physical properties are calculated for the hydrocarbon phases based on their
compositions. The aqueous phase properties are calculated separately. In this section, the
physical models implemented in GPAS to calculate the viscosities, interfacial tension,
relative permeability, capillary pressure, formation porosity and the hydrocarbon
solubility in water are described.

4.9.1 Viscosity

The aqueous phase viscosity is constant and is specified as user input. The gas
and oil viscosity is computed using the Lohrenz et al. (1964) correlation. An option is
also available to input the oil phase viscosity.
The Lohrenz et al. (1964) correlation combines several viscosity correlations as
described below. The steps involved in calculating the phase viscosity are given below

121
Computation of the low-pressure, pure-component viscosity

0.00034Tri0.94
Tri 1.5
) i
i = (4.9.1)
0.0001776(4.58Tri 1.67)
5/ 8
Tri > 1.5
i

where

5.44Tci1/ 6
i =
MWi1/ 2 Pci2 / 3

Calculation of the low pressure viscosity

nc
)
x ij i MWi
=
*
j
i =1
nc
(4.9.2)
x
i =1
ij MWi

The reduced phase molar density calculation


nc
jr = j x ijVci (4.9.3)
i =1

1/ 6
nc
5.44 x ijTci
j = i =1
1/ 2 2/3
nc
nc

x ijMWi x ijPci
i =1 i=1

122
The phase viscosity calculation at the desired pressure

* jr
j + 0.000205 jr 0.18
j
j = * (4.9.4)
j + ( j 1)
4

104 jr > 0.18


j

Where

j = 1.023 + 0.23364 jr + 0.585332jr 0.407583jr + 0.0933244jr

4.9.2 Interfacial Tension

The interfacial tension between two hydrocarbon phases is calculated from the
Macleod-Sudgen correlation as reported in Reid, Prausnitz and Poling (1987):

4
nc

jl = 0.016018 i ( j x ij l x il ) (4.9.5)
i =1

where i is the parachor of component i. In GPAS, the interfacial tension between gas

and oil for each gridblock and the derivatives of the interfacial tension are calculated in
the subroutine IFT.

4.9.3 Relative Permeability

The relative permeability models implemented in the code are in the form of both
lookup tables and Corey-type functions. The two-phase relative permeability is given as
tabular input. Industry practice is to assume the three-phase relative permeabilities of

123
water and gas are the same as two-phase relative permeabilities. Only oil relative
permeability is treated as a function of both water and gas saturations. The three-phase
relative permeability to water, oil and gas is calculated based on the two-phase relative
permeability data, using Stones method I or II.
There are currently three models in GPAS to calculate the three-phase relative
permeability for compositional simulations and one model that takes into account the
effect of trapping number, which is suitable for chemical processes. Corey-type
equations, Stone's model I with constant Sor , Stone's model I with variable Sor , Stone's

model II and Corey-type function with trapping number will be described in the
following sections.

4.9.3.1 Corey Model

Corey-type equations are used in GPAS. The use of Corey-type equations


simplifies the expressions for the relative permeability derivatives needed for the
construction of the Jacobian matrix. The Corey model can be expressed by (John, 2003):

k rj = k orjSj j
n
(4.9.6)

where k orj is the relative permeability endpoint for phase j and Sj is the normalized phase

saturation defined as

S j S jr
Sj = (4.9.7)
1 S jr S j'r

where S j is the saturation of phase j and S jr is the residual saturation of phase j.

124
4.9.3.2 Normalized Stone's Model I with Constant Three-Phase Sor

The Stone Model I is normalized by the Aziz and Settary method (1979).

So k row k rog
k ro = (4.9.8)
k o
row (1 S ) (1 S )
w g

where k rj is the relative permeability of phase j and k rjb is the relative permeability of

phase j in the two-phase jb.


The normalized saturations are defined as

So =
(S o Sor )
(4.9.9)
(1 S or Swr )

Sg
Sg = (4.9.10)
(1 S or Swr )

Sw =
(S w Swr )
(4.9.11)
(1 S wr Sor )

Residual oil saturation during three-phase flow, Sor , is computed by Frayer's

approximation (1982).

Sor = bSorw + (1 b ) Sorg (4.9.12)

where

125
Sg
b = 1 (4.9.13)
(1 S wr Sorg )

Here we assume a value of 0.5 for b and the residual oil saturation is a constant as

Sor = 0.5 ( Sorw + Sorg ) (4.9.14)

The two-phase relative permeabilities, k rog and k row , are obtained from input

lookup tables or Corey-type function.

4.9.3.3 Normalized Stone's Model I with Variable Three-Phase Sor

The Stone Model I is normalized by the Aziz and Settary method (1979).

So k row k rog
k ro = (4.9.15)
k o
row (1 S ) (1 S )
w g

where k rj is the relative permeability of phase j and k rjb is the relative permeability of

phase j in the two-phase jb.


The normalized saturations are defined as

So =
(S o Sor )
(4.9.16)
(1 S or Swr )

Sg
Sg = (4.9.17)
(1 S or Swr )

126
Sw =
(S w Swr )
(4.9.18)
(1 S wr Sor )

Residual oil saturation during three-phase flow, Sor , is computed by Frayer's

approximation (1982).

Sor = bSorw + (1 b ) Sorg (4.9.19)

where

Sg
b = 1
(1 S wr Sorg )

Letting

Sorg Sorw
c1 = (4.9.20)
(1 S wr Sorg )

then

Sor = Sorw + c1Sorg (4.9.21)

127
4.9.3.4 Normalized Stone's Model II

The model is normalized by the method of Nolen (Dietrich, 1976). In Stones


Model II, the three-phase oil relative permeability is calculated from the two-phase
relative permeability using

k k rog
k ro = k oro row
o
+ k rw o
+ k rg ( k rw + k )
rg (4.9.22)
k ro k ro

where the oil/water and oil/gas two-phase relative permeability is obtained from the input
tables.
The subroutine RELPERM3EOS computes the three-phase relative permeability
to water, oil and gas based on the two-phase data.

4.9.3.5 Corey-type Function with Trapping Number

Low interfacial tension leads to decreased capillary forces and mobilization of


residual oil. This mobilization effect needs to be accurately captured in the relative
permeability model. The trapping number is a dimensionless number that includes both
the gravity/buoyancy and viscous forces on the trapped globule (Jin, 1995; Pope et al.,
2000). The trapping number for phase l is

rr r r
(
k l ' + g(l' l )D )
N Tl = (4.9.23)
ll '

rr
where k is the permeability tensor, is the flow potential, j is the mass density of

phase j, D is the depth from a reference datum plane and is the interfacial tension.

128
The change in residual saturations is modeled as a function of the trapping
number as shown below

SLow SHigh
Slr = min Sl ,SlrHigh + lr lr

1 + Tl N tl

where SlrHigh and SlrLow are the residual saturations for phase l at high and low trapping
numbers and Tl is the trapping number for phase l . This correlation was derived based

on the exponential data for n-Decane (Delshad, 1990).


The endpoints and exponents of the relative permeability curve also change as the
residual saturations change at high trapping numbers (Chatzis et al., 1981; Morrow et al.,
1985; Delshad et al., 1986). These changes are computed by linear interpolation between
the given input values at low and high trapping numbers:

Low
Sl'r
High ( rl
k o High k orlLow )
Sl'r
k orl = k orlLow + (4.9.24)
Sl'r Sl'r
Low

Low
Sl'r
High ( rl )
Sl'r
n l = n lLow + n High n Low (4.9.25)
Sl 'r Sl'r
Low rl

where k orl is the relative permeability endpoint for phase l and n l is the relative

permeability exponent for phase l.


The trapping number model is implemented in a fully implicit form in the EOS
compositional model. The main driver causing an increased trapping number comes from
the chemical model calculations (lowering of IFT). To build the Jacobian matrix for the

129
fully implicit EOS model formulation we need the following partial derivatives for the
relative permeability:

k rl
i = 1,..., n c
ln K i

k rl
i = 1,..., n c , n w
Ni

k rl
P

A Corey-type function for relative permeability is used with the trapping number
model. Without the trapping number, the relative permeability is a function of saturation
only. The trapping number changes the relationship because it depends on the pressure,
interfacial tension and densities. Also, the end point relative permeability and exponents
are not constant and change with the trapping number. The derivatives in this case can be
calculated applying the chain rule.

4.9.4 Phase Pressure

The phase pressure is related to the capillary pressure and a reference pressure,
Pref:

Pj = Pref + Pcref , j j = 1,K , n p (4.9.26)

For np phases, there are (np-1) independent capillary equations. The capillary
pressure is a function of phase saturations and compositions:

130
r r
Pcref , j = Pcref , j (S, x) j = 1,K , n p (4.9.27)

4.9.5 Capillary Pressure

The gas-oil and water-oil capillary pressure data are inputted as tables. The
capillary pressure at any saturation is interpolated from the tables.

4.9.6 Formation Porosity

The porosity is a function of pressure:

= ref (1 + cf (P Pref ) ) (4.9.28)

where ref is the porosity at reference pressure, Pref, and is calculated at a pressure P.

4.9.7 Hydrocarbon Solubility in Water

The mutual solubility between hydrocarbon phases and the aqueous phase can be
treated using either:
Simplified approach, in which the solubility calculation is performed
separately from the flash calculations using a different model that that
used for the flash calculation.
Rigorous approach, in which the aqueous phase is considered as one of the
equilibrium phases and water is included in the flash calculations.
The solubility of the hydrocarbons in the water is calculated, separately from the
flash calculations, using Henrys law. The vaporization of water into hydrocarbon phases

131
is ignored. When the solubility calculations are treated separately from the flash
calculations, the component molar balance equations are expressed as

(Nih + Nia )
np ur ur q
j j x ij (Pj j D) i = 0 (4.9.29)
t j=1 Vb

where N ih is the moles of component i in the hydrocarbon phase, N ia is the moles of

component i in the aqueous phase and i the index for hydrocarbon components.
N ih is selected as the primary variable instead of the total number of moles. The

solubility of hydrocarbon components in the aqueous phase needs to be determined using


the unknowns during the Newton iterations of the governing equations. The solubility of
each component in the aqueous phase is calculated using Henrys law.

fia N ia
x ia = = nc a
(4.9.30)
Hi
N + Ni
a
w
i =1

where H i is Henrys constant for i th component. The mole fraction of water in the

aqueous phase is

nc
N aw
x aw = 1 x ia = nc a
(4.9.31)
i =1
N + Ni
a
w
i =1

Dividing Equation (4.9.30) by Equation (4.9.31) yields

x ia a
N ia = Nw (4.9.32)
x aw

132
Since N ia can be determined using the primary variables as shown in the above

equation, it is apparent that the inclusion of the solubility calculations doesnt increase
the number of primary variables.

4.10 WELL MODELS

The well model accounts for the source/sink terms in the mass conservation
equations. A reservoir simulator needs a well model to translate historical
production/injection data and the actual or desired field operating conditions and
constraints into acceptable controls for the reservoir model. This requires that the
operating constraints such as production and injection facility limits be imposed correctly
as boundary conditions for the individual gridblock representing part or all of a well in
the reservoir model. The well-management routine assigns user-specified well rates or
pressures to individual producing blocks in the simulator at specified times. The
application of a constant-pressure boundary condition will hold the bottom hole
production or injection pressure in the well constant. A well is located at the center of the
gridblock containing the well. The equations given below apply only for vertical wells.
The relationship between volumetric flow rate, flowing bottomhole pressure and
gridblock pressure is expressed as

Q j = PI j (Pwf Pj ) (4.10.1)

where PI j is the productivity index for phase j. For one-dimensional (x direction) and x-

z cross-sectional simulations, the productivity index is given by (Chang, 1990):

133
k x k y yz rj
PI j = (4.10.2)
x
25.15*2
2

For two-dimensional areal and three-dimensional simulations, the phase


productivity index is computed as

k x k y z rj
PI j = (4.10.3)
r
25.15ln o
rw

where kx and ky (md) are permeability in the x and y directions, x, y and z are
gridblock sizes (ft) in x, y and z directions, rj is relative mobility in cp-1, Qj is the well

flow rate of phase j in ft3/day and pressure is in psi. In Equation (4.10.3), the radius ro is
given by Peaceman's equation:

k
1/ 2
k
1/ 2

x x + x
2
y
2

k y
k
y
ro = 0.28 (4.10.4)
1/ 4
k
1/ 4
ky
+ x
kx k
y

4.10.1 Constant Bottom Hole Flowing Pressure Injector

The bottomhole flowing pressure at elevation z is calculated from this reference


pressure as follows:

(Pwf )z = Pbot inj (z z bot ) (4.10.5)

134
where inj is the specific weight of the injected fluid at the well pressure. The

bottomhole reference depth for each well can be assigned in the input file. The
component flow rates for layer z are computed by

(q i ) z = 1 (f1 )inj (zi )inj (q t ) z i = 1,K , n c


(4.10.6)
(q i ) z = (f1 )inj (q t ) z i = nc + 1

and

(Q t )z
(q t ) z = (4.10.7)
(v t )inj

where

np

(Q t )z = (PI j ) z (Pwf ) z (Pj )z (4.10.8)


j=1

and

f L L
1 inj
( )
(v t )inj = 1 + 1 ( f1 )inj 2 + 2
2 2 inj
(4.10.9)
inj

where ( j )inj is the molar density of phase j, (L j )inj is a ratio of moles in hydrocarbon
phase j to the total number of hydrocarbon moles in the injection fluid and ( f1 )inj is the

molar fraction of water component in the injection stream. The values of ( j )inj and

135
(L j )inj for j = 2 and 3 are determined by flash calculations at the time the well conditions

are specified. The molar density for the aqueous phase, which is assumed to be slightly
compressible, is calculated using

1 = 1o 1 + c1 (P P1o ) (4.10.10)

where 1o is the aqueous phase molar density at the reference pressure P1o .

4.10.2 Constant Volume Rate Injector


The gas injection rate Qg in Mscf/day, the water injection rate Q w in stb/day, and

the hydrocarbon composition of the injected fluid (zi)inj are specified. The volumetric
rates are converted to molar flow rates using the following equations

qi = 2.6357Qg (zi )inj i = 1,...., n c


(4.10.11)
qi = 19.4658Q w i = nc +1

After computing the molar flow rates, the following allocation scheme is then
employed to distribute the molar injection rates into each layer.
For multiple layer simulations (cross-sectional and three-dimensional), the total
injection rates are allocated to the individual layers according to a total mobility
allocation scheme:

q i (PI t ) z
(q i ) z = zb
i = 1,..., n c , n c + 1 z = z t ,..., z b (4.10.12)
(PI )
m=zt
t m

136
where zt and zb are the top and bottom layer numbers of a well, respectively. The total
productivity index of a layer z is defined as

np

(PI t ) z = (PI j )z (4.10.13)


j=1

The denominator on the right side of Equation (4.10.12) is the summation of the
total productivity index over all communicating layers for a well. The values of zt and zb
do not have to be the first and last layers of the reservoir, respectively, and thus a well
can be specified as being partially completed. The relationship between volumetric and
molar flow rates is calculated as

3
(Q t )z = (Q j ) z = (q t ) z (v t )inj (4.10.14)
j=1

where

f L L
(v t )inj = ( 1 )inj + [1 (f1 )inj ][( 2 )inj + ( 3 )inj ] (4.10.15)
1 2 3

Here j is the molar density of phase j and (Lj)inj is a ratio of moles in hydrocarbon phase j
to the total number of hydrocarbon moles in the injection fluid. The values of (j)inj and
(Lj)inj for j = 2 and 3 are determined by flash calculations at the time the well conditions
are specified, and (j)inj is the molar density for the aqueous phase. The bottomhole
pressure is calculated using

(Q t )z
(Pwf )z = Pz + (4.10.16)
(PI t ) z

137
4.10.3 Constant Bottom Hole Flowing Pressure Producer

The flowing bottomhole pressures for a layer z is calculated using

( Pwf )z = Pbot z (z z bot ) (4.10.17)

The layer component flow rate is found by

np

(q i ) z = ( j x ijPI j ) z (Pwf Pj )z i = 1,K , n c


j= 2 (4.10.18)
(q i ) z = (1PI1 )z (Pwf P1 ) z i = nc + 1

4.11 OVERALL COMPUTATION OF THE SIMULATOR

4.11.1 Primary and Secondary Variables


The independent variables for solving the governing equations are P, N1 , N 2 , ,
N n c , ln K1 , ln K 2 ,, ln K n c . This set was selected to be the best choice because it

makes the fugacity equations more linear (Wang et al., 1995). The equilibrium ratio, K i

is defined as

yi
Ki = i = 1,..., n c (4.11.1)
xi

where x i and yi are the mole fractions of component i in oil and gas phases,

respectively.
The set of independent variables is further classified into the primary and
secondary variables. The primary variables are P, N1 , N 2 ,, N n c because they are

138
coupled between adjacent cells through the component mass-balance equations and need
to be solved simultaneously. The ln K i values are the secondary variables because they

are calculated from the equality of the component fugacities at given pressure,
temperature and total moles of all components.

4.11.2 Solution Procedure

A fully implicit solution method is used to solve the governing equations. The
equations are nonlinear and must be solved iteratively. A Newton procedure is used in
which the system of nonlinear equations is approximated by a system of linear equations.
The linearization is performed using the Jacobian matrix of the governing equations. The
Jacobian refers to the matrix whose elements are the derivatives of the governing
equations with respect to the independent variables.
The sequence of steps involved in the solution of the governing equations for the
independent variables over a timestep includes:
1. Initialization in Each Gridblock: The pressure, overall composition and
temperature of the fluids in each gridblock are specified. The initialization
and calculation of the initial fluid in place is done in the subroutine
INFLUID0. This subroutine is the main driver for the computation of the
initial fluid in place.
2. Phase identification and Physical Properties Calculation: The flash
calculations are performed in each gridblock and the phase saturations,
compositions and densities are determined. The phases are then identified
as gas, oil or aqueous phase. Phase viscosities and relative permeabilities
are subsequently computed. The flash calculations are performed in the
subroutine XFLASH and currently are limited to two phases. The

139
Rachford-Rice equation that determines the phase fractions is coded in the
subroutine SOLVE. All the fluid physical properties like the fluid
viscosity, relative permeability and phase density calculations are
determined in the PROP subroutine. The PROP subroutine calls separate
routines to determine the different physical properties. It calls the
subroutine LVISC2 to calculate the phase viscosity using the Lorenz
coefficient, the subroutine RELPERM3EOS to calculate the three-phase
relative permeability using Stone's model or calls the LOOKUP subroutine
to interpret the two-phase relative permeability from the relative
permeability tables.
3. Governing Equations Linearization: All the governing equations are

linearized in terms of the independent variables and the elements of the


Jacobian are calculated. The subroutine JACOBIAN that in turn calls
PREROW generates the Jacobian for the linear system. PREROW is the
main subroutine that calls the other subroutines, each with a specific task
of computing the derivatives of separate equations and terms. The
subroutine JACCUM calculates the derivatives of the accumulation term
of the component balance. The subroutine JACO2 calculates the
derivatives related to transmissibility terms. The subroutine JMASS
calculates the derivatives related to the component mass balance in X, Y,
and Z directions. The derivatives of the source/sink terms are calculated
in JSOURCE.
4. Jacobian Factorization and Reduction of the Linear Systems: Row

elimination is performed to reduce the size of the linear system from


2n c + 1 to n c for each gridblock. To achieve this, the linearized phase-

140
equilibrium relations and the linearized volume constraint are used to
eliminate the secondary variables and one of the overall component moles
from the linearized component mass balance equations. The subroutine
EOS_JACO forms the Jacobian for row elimination for two-phase cells.

5. Solution of the Reduced System of the Linear Equations for the Primary
Variables: The reduced system of linear equations is simultaneously
solved for pressure and the overall moles of n c 1 components per unit

bulk volume for all the cells.


6. Secondary Variables Calculation: A back substitution method is employed
to compute the secondary variables ln K i and overall moles of the

component eliminated in Step 4 using the factorized Jacobian. The phase-


stability analysis is then carried out for all the gridblocks using the newly
updated pressure and overall component moles.
7. Updating Phase Densities and Viscosities, Determination of Single-Phase
State and Estimation of Phase Relative Permeability: The subroutine
XUPDATE updates the phase composition and the phase properties as
phase density, viscosity, relative permeability and determination of single
phase in each cell. The main subroutine in the compositional model
EOSCOMP is XSTEP. XSTEP calls XDELTA, which in turn calls the
XUPDATE subroutine.
8. Check for Convergence: The residuals of the linear system obtained in
Step 3 are used to determine convergence. If a tolerance is exceeded, the
elements of the Jacobian and the residuals of the governing equations are
then updated and another Newton iteration is performed by returning to

141
Step 4. If the tolerance is met, a new timestep is then started by returning
to Step 3. The subroutine XSTEP is the contact routine between the
IPARS framework code and the EOSCOMP compositional model code.
The residuals are checked in XSTEP and if the tolerance is met, a new
timestep is started; otherwise another Newton-iteration is performed.

4.12 EXECUTIVE ROUTINES IN EOSCOMP

The IPARS framework provides hooks for implementing a specific physical


model. The executive routines in the EOSCOMP model are as follows (Wang et al.,
1999):
IPARS: Main driver for the fully-implicit, parallel, equation-of-state
compositional reservoir simulator.
XISDAT: All the initial scalar data are read by this subroutine. These
include the physical properties of each component, default number of
iterations, convergence tolerances for a variety of calculations, output
flags, operation specific flags and chemical property data. No grid-
element arrays can be reference in this subroutine.
XARRAY: This subroutine allocates memory for all the grid element
arrays.
XARYDAT: The pointer variables defined in the subroutine XARRAY
are stored in the common blocks in this subroutine.
CONTROL: Control data widely used by each model.
XIADAT: The entire grid element array input as the pressure, water
saturation, and feed composition is read in and written out to a file.

142
XIVDAT: Performs the model initialization before time iteration. The
PETSc linear solver is also initialized.
XSTEP: The main subroutine that performs all the calculations over a
timestep.
XQUIT: Exits from the simulation when it meets the maximum time,
production limits, or if an error occurs.
The most important routine for the EOS compositional model is XSTEP. It
handles the following operations at a given timestep:
1. Compute the dependent variables based on the independent
variables.
2. Update properties in the overlapping regions of all the processors
(communications between processors).
3. Evaluate the residuals for all the governing equations. For the
component mass-balance equations, it involves a summation of the
residuals from each of the processors. The function for doing so is
provided by the framework.
4. Select the maximum residuals for each type of the governing
equations among all of the processors.
5. Check if a convergence is reached on the master processor
(processor 0) and broadcast the outcome of the check to other
processors.
6. If the tolerances are met, output user-specified properties at this
current time level and then return to the framework for time-
stepping calculation for the next timestep.

143
7. If the tolerances are not met, evaluate the element of the Jacobian
and then call PETSc linear solver.
8. Update the independent variables and go back to step 2 for the
Newton iteration.
The communication between processors for the compositional model is performed
in the executive subroutines. There is no argument attached to these calls. Those
variables associated with grids are passed into these routines through pointers that are
stored in common block. These common blocks are included as header files in the
subroutines. The executive routines call the work routines to perform all the calculations.
The grid dimensions and variables are passed into these work routines through a C
routine called CALLWORK, which is handled by the framework. The CALLWORK
function passes the variables as an index argument list to the function being called.

4.13 WORK ROUTINES IN EOSCOMP

The major work routines of EOSCOMP model implemented in fully-implicit,


parallel, compositional reservoir simulator are as follows:
INFLUID0: Initialization and calculation of initial fluid in place. This
routine is called only once.
INFLUID: This subroutine computes fluid in place at both reservoir and
surface conditions.
IWELL: This routine inputs both initial and transient well data and locates
well elements on the current processor.
JACOBIAN: This subroutine constructs the Jacobian matrix.
JACCUM: This routine computes the derivatives of the accumulation term
with respect to the independent variables.

144
JXMASS: This routine computes the derivatives of the flux term of mass
conservation equations with respect to the independent variables in x
direction.
JYMASS: This routine computes the derivatives of the flux term of mass
conservation equations with respect to the independent variables in y
direction.
JZMASS: This routine computes the derivatives of the flux term of mass
conservation equations with respect to the independent variables in z
direction.
JSOURCE: This routine computes the derivatives of the source term with
respect to the independent variables.
MRESIPW: Calculation of the residuals of mass conservation equations.
PORP: This routine computes the rock and fluid properties.
FLASH: This routine performs the flash calculation and computes the
derivatives of fugacity equations with respect to independent variables.
RESIDUAL: This routine computes the residuals of governing equations.

4.14 DESCRIPTION OF THE SOLVER

PETSc (Balay et al., 1997; Wang et al., 1999) is a large suite of parallel, general-
purpose, object-oriented solvers for the scalable solution of partial differential equations
discretized using implicit and semi-implicit methods. PETSc is implemented in C, and is
usable from C, FORTRAN, and C++. It uses MPI for communication across processors.
GPAS uses the linear solver component of PETSc to solve the linearized Newton system
of equations and uses the parallel data formats provided by PETSc to store the Jacobian
and the vectors.

145
The linear solver components of PETSc provides a unified interface to various
Krylov methods, such as conjugate gradient (CG), generalized minimal residual
(GMRES), biconjugate gradient, etc., and also to various parallel preconditioners such as
Jacobi, block preconditioners like block Jacobi, and domain decomposition
preconditioners like additive Schwartz. GPAS uses the biconjugate gradient stabilized
approach as the Krylov method and block Jacobi preconditioner, with point block
incomplete factorization (ILU) on the subdomain blocks. The point block refers to
treating all the variables associated with a single gridblock as a single unit. The number
of subdomain blocks for block Jacobi is chosen to match the number of processors used,
so that each processor gets a complete subdomain of the problem and does a single local
incomplete factorization on the Jacobian corresponding to this subdomain.
For three-phase flow, the compositional model EOSCOMP generates 2n c + 1

equations per gridblock causing the Jacobian to have a point-block structure, and a point-
block sparse storage format is used to store the matrix. These 2n c + 1 equations do not

result in complete coupling of all the variables across gridblocks. This causes the
Jacobian to have some n c + 1 point-block locations with zero values. Thus a block size
of n c + 1 is chosen for this matrix type eliminating the need to store the ( n c + 1) ( n c + 1)

blocks with zero values. The usage of the point-block sparse matrix storage leads to the
improvement in the performance of the matrix routines.

4.15 AUTOMATIC TIME STEP CONTROL

A new automatic time step control was added which is more stable and more
efficient than the one already available in the code based on the number of Newtonian
iterations. The new implementation is based on the maximum change in pressure, phase

146
saturation, and molar concentration of each species. The formulation is described below
as

(1 + ) i
t n +1 = t n (4.15.1)
i + i min over all gridblocks

where is the tuning factor and is between a value of zero and one, i is the maximum

relative change for each variable as an input parameter, and i is the computed relative
change of the variable in gridblock i during the time step t. The value in the bracket in
Equation (4.15.1) will be different depending on the variables pressure, saturation, and
species molar concentration used and the minimum will be used in the time step
selection. Additional input parameters added for the time step control option 2
(TIME_CONTROL = 2) are listed as below:
TUNE: tuning factor with a value between 0 and 1
DCMAX: maximum relative change of molar concentration
DPMAX: maximum relative change of pressure
DSPMAX: maximum relative change of saturation
DELTIM: initial time step in days
DTIMMAX: maximum time step, days
DTIMMIN: minimum time step, days

147
Chapter 5: Fully Implicit, EOS Compositional, Parallel Reservoir
Simulator with Asphaltene Precipitation Model

5.1 INTRODUCTION

This chapter presents a detailed; step-by-step description of the research that was
done in this study to develop the General Purpose Adaptive Simulator (GPAS) with a
model for compositional simulation of asphaltene precipitation problem in petroleum
reservoirs. The first section provides a summary of the models for asphaltene
precipitation currently available in the petroleum engineering literature. The second
section is an introduction on how to select an asphaltene precipitation model to be
implemented into an equation-of-state compositional, reservoir simulator.
The effect of temperature on modeling asphaltene precipitation in reservoirs will
be discussed briefly. The next section is a description of the model used in GPAS for
asphaltene precipitation and the assumptions made for its implementation. In this chapter
we also address the modeling of the phase behavior of solid precipitates and its coupling
with the important existing subroutines of the simulator. A multiphase-flash calculation
procedure for oil-gas-solid systems was used for the first time in the simulator. The
adsorption of asphaltenes affects physical properties of oil and rock. These phenomena
are described in a section for modeling the dynamic aspects of asphaltene precipitation in
porous media, which includes a model for taking into account the permeability reduction
due to the plugging effect by asphaltenes.
Compared to the old version of GPAS, the modeling of asphaltene precipitation
requires more independent variables to deal directly with the solid phase. As a result, the
addition of new governing equations in the simulator, to be used for solving the system of

148
equations for the unknowns, is mandatory. The set of independent variables, the effect of
asphaltene precipitation on the old governing equation and the new governing equations
implemented in the simulator are discussed in the next sections.
In order to construct the Jacobian matrix for the fully implicit formulations, we
need the derivatives of the governing equations with respect to the independent variables.
These are described in detail in this chapter, including the residuals of the governing
equations and also some different possible scenarios for the Jacobian matrix. A robust
procedure to solve the new Jacobian matrix is also presented. A new solver that can be
used for cases with and without asphaltene precipitation was implemented in GPAS for
this purpose. Last but not least, the final section of this chapter gives a brief description
of the subroutines which were modified directly during the code development related to
implementation of asphaltene precipitation into GPAS.

5.2 MODELING ASPHALTENE PRECIPITATION

Several approaches for modeling the effect of asphaltene precipitation in


petroleum reservoirs have been developed and reported in the literature. These include: a
variation of a model for wax or a pure solid approach, the use of liquid solubility models,
a thermodynamic colloidal model, and finally a thermodynamic micellization model. A
review of different models for asphaltene precipitation in the petroleum engineering
literature is given in the following sections.

5.2.1 Solid Models

Thomas et al. (1992) and Gupta (1986) attempted the first solid model for
asphaltene precipitation which is based on a single-component approach. In this

149
approach, the precipitated asphaltene is considered as a pure solid phase while the
hydrocarbon fluid phases are modeled with a cubic equation-of-state (e.g. Peng-Robinson
EOS). The fugacity of the solid phase which consists of a single component can be
calculated using

vs ( P P * )
ln fs = ln f +
*
s (5.2.1)
RT

where fs is the fugacity of solid at reservoir pressure, fs* is the reference solid fugacity
at a reference pressure ( P * ), vs is the molar volume of the solid phase and P * is the

pressure at which the asphaltene just begins to precipitate from crude oil. It is also called
the reference pressure.
Thomas et al. found that this model is not able to give satisfactory results so a
new empirical model for calculation of fs (fugacity of solid) was proposed instead. Like

the old model, the new model is a function of pressure and temperature but it also takes
into account the overall composition of the mixture. The introduction of overall
composition in the model will result some conceptual problems because fluids with
various overall compositions might have the same solid, gas and oil composition. In
addition, the new model uses a large number of variables that require tuning for the
purpose of matching the experimental asphaltene precipitation data.
The representation of the solid asphaltene precipitate as a multi-component solid
phase was investigated by Thomas et al. as well. The new representation uses the solid-
liquid model which was initially developed by Won (1986) in order to study wax. The
new model was found to be successful and also suggested some fields for further
investigation and development including studying the behavior when the solvent
concentration increases. MacMillan et al. (1995) and Chung (1992) matched

150
experimental data with the new multi-component solid model. The specification of large
number of parameters is one of the main disadvantages of the multi-component solid
model for the asphaltene precipitate.

5.2.2 Thermodynamic Solubility Models

Asphaltenes can be considered to be in the solubility category. This means that


they can precipitate from crude oil when a solvent is added to the system. Therefore, the
behavior of asphaltenes can be studied by using a thermodynamic solubility model.
Hirschberg et al. (1984) developed a method for modeling the asphaltene
precipitate which is based on a solubility model by Flory-Huggins. Using an equation-of-
state (i.e. SRK EOS) this method first performs liquid-vapor equilibrium calculations in
order to divide the system into vapor and liquid phases. The liquid phase is further split
into two parts. The first part represents the asphaltene component and the second part
corresponds to the remaining oil mixture. The second part is also called the deasphalted
oil. One basic assumption here is that the precipitation of asphaltene will not have any
effect on the liquid-vapor equilibrium. The division of the liquid phase into two parts is
performed in order to model the asphaltene precipitate and does not have any relation
with the components of the equation-of-state which was used in the liquid-vapor
calculations. The maximum volume fraction of the asphaltene precipitate which is soluble
in oil phase cab be obtained from

v a v l vl 2
ln ( a )max = 1
vl va RT
( a l ) (5.2.2)

151
where ( a ) max is the maximum volume fraction of the asphaltene precipitate, va is the

molar volume of asphaltene, vl is the molar volume of deasphalted solvent/oil mixture, R


is the gas constant, T is the temperature, a is the solubility parameter of asphaltene and
l is the solubility parameter of solvent/oil mixture. The two parameters related to the

solvent/oil mixture, vl and l , can be obtained from the composition of the liquid phase
which is identified using the liquid-vapor equilibrium calculations. In addition, va and
a , are important parameters for this model. The molar volume is a function of density

and molecular weight. Anderson and Speight (1999) showed that most approaches for
calculation of molecular weight give data which is dependent on the aggregation effect.
Therefore, it is not possible to calculate the maximum solubility in the above equation
precisely. One way for determining the solubility parameter is by calculating the
solubility of asphaltenes in various solvents which have an increasing solubility. a can

be determined using that of the best solvent. The following correlation which uses two
constant parameters (a and b) suggests that the solubility parameter is a function of
temperature (Anderson and Speight, 1999):

= a + bT (5.2.3)

In order to take into account the fact that by increasing the temperature the
solubility parameter decreases, b is negative. This model was used by Burke et al. (1990),
Novosad and Costain (1990) and Hirschberg et al. (1984) but their degree of success was
limited. In fact Hirschberg et al. showed that the Flory-Huggins model cannot be used for
asphaltene and further studies are necessary. A development of this model is due to
Kanakawa et al. (1991). They suggested that the asphaltenes can be considered as
heterogeneous polymers while Hirschberg et al. were considering the asphaltenes to be

152
homogeneous polymers. The approach of Kanakawa et al. will enhance the fit but at the
same time will have higher number of parameters.

5.2.3 Thermodynamic Colloidal Models

The approaches described in the previous sections are originated from molecular
thermodynamics. These approaches are useful for scenarios where the resin/asphaltene
micelles precipitate from crude oil with no alteration. Leontaritis and Mansoori (1987)
presented a mechanistic method which assumes that the asphaltenes can be found in the
oil as solid particles. These solid particles are in colloidal suspension and are stabilized
by the resins. In additions, the resins are adsorbed to the surface of the asphaltenes. This
method is more useful for conditions where the resin/asphaltene micelles are dissociated.
In this method, first, using an EOS, liquid-vapor equilibrium calculations are
performed in order to specify a liquid phase. The precipitation of asphaltenes may occur
in the liquid phase. The Flory-Huggins solution theory and experimental data for the
calculation of precipitation onset are used to obtain a critical chemical potential for the
resins. The critical chemical potential will then be used to calculate the precipitation
onset of asphaltenes at different situations.

5.2.4 Thermodynamic Micellization Models

A thermodynamic framework was presented by Firoozabadi and Pan (1998). This


thermodynamic framework originates from the direct minimization of the molar Gibbs
free energy and the process of micellization. The primary goal here is to describe the
precipitation of asphaltenes and aggregation of them into larger particles. This model is
able to reproduce the experimental measurements; however, it requires time consuming

153
computational calculations, hence, more developments and improvements are still
necessary.

5.3 SELECTION OF AN ASPHALTENE PRECIPITATION MODEL FOR


COMPOSITIONAL SIMULATION

5.3.1 Solid Model Approach versus Activity-Coefficient Approach

The solid model which uses the same components being used in an equation-of-
state which is used to model the hydrocarbon phases is based on fugacities but the other
models presented in the previous discussions are all based on an activity-coefficient
approach (Prausnitz et al., 1986). The activity-coefficient approach, first, utilizes a two-
phase gas-oil flash in order to split the initial hydrocarbon mixture into two separate, gas
and oil phases. Further, the oil phase will be split into different components to model the
precipitation of asphaltenes from crude oil.
The solubility model of Hirschberg et al. (1984) mentioned earlier splits the oil
phase into two separate components. One component represents the deasphalted oil and
the other one represents the asphaltene component. The thermodynamic colloidal models
and the thermodynamic micellization models utilize other components to take into
account the resins and micelles.
The activity-coefficient approach does not take into account the fact that the
precipitation of asphaltenes will have an effect on the equilibrium of the oil and gas
phases since the activity-coefficient components do not have any relation with the
equation-of-state components. This fact will cause some probable errors in the phase-
behavior related calculations of the hydrocarbon phases because heavy components (i.e.
asphaltenes) affect the saturation pressure. Hence, the solubility model of Hirschberg et
al. which originates from the Flory-Huggins polymer solution is not precise. Based on

154
these facts, a method which utilizes three-phase gas-oil-asphaltene calculations is more
useful and desirable.
The main goal of using the activity-coefficient approach is describing and
modeling the phase behavior involved in the precipitation of asphaltenes from crude oils.
Thus, the primary goal is not its incorporation into compositional simulation in order to
model the precipitation of asphaltenes in reservoirs dynamically. More over,
implementation of phase behavior calculations related to asphaltene precipitation based
on the activity-coefficient approach will have conceptual difficulties considering that a
compositional simulator for asphaltenes has to solve the equations for asphaltene
precipitation, phase equilibrium and multiphase multicomponent flow simultaneously.
For a compositional simulator, it is crucial that the used components in the
equations mentioned earlier will be the same. This fact cannot be satisfied when using an
activity-coefficient model because it does not use the same EOS components but the solid
model for asphaltene precipitation follows this approach hence it is more desirable. The
solid model has another advantage as it is efficient from a computational viewpoint as
well which is of crucial importance because the oil-gas-solid equilibrium calculations are
called many times during different time steps in a compositional simulator.
In conclusion, this research aims to choose and implement a model for
precipitation of asphaltenes in crude oil, which satisfies the following requirements:

Able to make quantitative predictions


Compatible with flash calculations in an equation-of-state simulator
Uses lower number of parameters that require adjustment
Efficient from a computational viewpoint for potential incorporation into a
compositional simulator

155
Considering the above, we choose the solid model approach because the main
goal is to implement the thermodynamic model into an equation-of-state compositional
simulator. Hence, the precipitated asphaltene will be modeled as a pure dense phase in
GPAS.

5.4 EFFECT OF TEMPERATURE ON MODELING ASPHALTENE PRECIPITATION

This research is focused mainly on the modeling of asphaltene precipitation in


petroleum reservoirs that undergo pressure depletion or injection processes. These
activities usually take place under isothermal conditions. Therefore, at this point,
modeling the effect of temperature in GPAS is not crucial. However, in the future, for
other cases such as modeling the effect of asphaltene precipitation in wellbores during the
production process, the inclusion of temperature effects would be required.

5.5 IMPLEMENTATION OF ASPHALTENE PRECIPITATION MODEL INTO GPAS

The primary goal of this research was to implement of an asphaltene precipitation


model into the existing Peng-Robinson cubic equation-of-state compositional module of
GPAS known as EOSCOMP. A flow chart showing the general structure of the General
Purpose Adaptive Simulator (GPAS) with the ability to model asphaltene precipitation
can be found in Figure 5.1. As discussed previously (Chapter 4), the fully implicit, EOS
compositional module has been implemented into the IPARS framework and successfully
tested on a variety of computer platforms.

156
5.5.1 Nghiems Model for Asphaltene Precipitation

Nghiems model for asphaltene precipitation, which is a solid model, was selected
for the implementation of the asphaltene precipitation model into the General Purpose
Adaptive Simulator. The precipitated asphaltene is modeled as a pure solid, while the oil
and gas phases are modeled with an equation-of-state. Nghiem's model incorporates a
multiphase oil-gas-solid flash procedure to calculate the amount of solid precipitate and
the composition of the hydrocarbon phases at equilibrium. The multiphase oil-gas-solid
flash calculations will be described in the upcoming sections. In Chapter 3, Nghiems
model was presented and validated for description of asphaltene precipitation behavior.
Compared to the reported models, which we already reviewed in the previous
sections, this model is simpler to implement into an equation-of-state compositional
simulator. The calculations in the model are also based on thermodynamic methods. The
parameters that should be obtained from experimental studies or PVT utilities (e.g. CMG
WinProp) are:

The pressure at which the asphaltene just starts to precipitate, P*


The molar volume of solid, vs
The fugacity of pure asphaltene, ln fs* , at a reference pressure, P*
Maximum mass of adsorbed solid per mass of rock, w as,max

In this study the above parameters were estimated using CMG WinProp version
2004.10. Commercial and academic compositional simulators (e.g. CMG GEM and
UTCOMP) indicate that compared to the experimental data, the prediction results of this
model are reasonable. A detailed discussion on Nghiems model for asphaltene
precipitation can be found in Chapter 3. Hence, Nghiems model was adopted for GPAS.

157
5.5.2 Assumptions

The following assumptions have been made in developing the asphaltene


precipitation model for the GPAS simulator.
1. The precipitated asphaltene is represented as a pure solid.
2. Precipitation corresponds to the formation of a solid phase from
thermodynamic equilibrium, whereas adsorption means the settling of
solid particles in the reservoir. In GPAS, the solid precipitate resides onto
the rock surface and no longer flows.
3. The solid is incompressible.
4. For a given temperature, T, the fugacity of the solid is given by Equation
(5.2.1).
5. Reservoir is isothermal and the effect of temperature variations on
asphaltene precipitation are not considered in the compositional
simulation.
6. The precipitated solid resides in the reservoir. The total precipitated
asphaltene actually gets adsorbed on the rock surface as a solid that does
not flow with the oil phase and causes plugging and wettability alteration.
7. The change in porosity is usually much smaller than the reduction in
permeability and relative permeability.
8. The incorporation of wettability effects is beyond the scope of this thesis
so the alteration of formation wettability due to asphaltene precipitation
can be accounted for the change in relative permeability.
9. The precipitated asphaltene does not undergo chemical reactions.
10. Physical dispersion is neglected.
11. There is no radioactive decay.

158
5.6 MULTIPHASE OIL-GAS-SOLID FLASH CALCULATIONS FOR ASPHALTENE

This section describes methods for performing flash calculations with a solid
phase. In a mixture of n c components (letting n c , the heaviest component, to be the

index of the asphaltene component) at a given pressure, temperature and overall


composition of the fluid, multiphase oil-gas-solid flash calculations yield amount of each
phase and the number of moles of each component in the gas phase, the oil phase and the
solid phase.

5.6.1 Stability Test for Solid Phase

Generally, multiphase flash calculations are complex because the number of


phases in equilibrium is not known beforehand. The current stability analysis of GPAS
was developed for calculations where all phases are modeled with an equation-of-state
(e.g. PR EOS). Further, the additional complexity which arises at this point is in the
number of possible combinations of hydrocarbon fluid phases and the solid asphaltene
phase. A new procedure was developed and implemented in GPAS for the case where
one of the phases is a solid phase represented by

vs ( P P * )
ln f n cs = ln f *
ncs + (5.6.1)
RT

where f n cs is the fugacity of component n c or the heaviest component in the solid phase
at reservoir pressure, f n*cs is the reference fugacity at the onset pressure or P * , vs is the

molar volume of the solid phase and P * is the pressure at which the asphaltene just
begins to precipitate.

159
To check the existence of a solid asphaltene phase, the following criteria should
be satisfied. The solid phase or asphaltene will exist if

ln f n c ,o ln f n cs (5.6.2)

This implies that if the fugacity of the asphaltene component in the solid phase is
less than the fugacity of the n c th component in the oil phase, more asphaltene

precipitation will occur until both fugacities become equal. The model for asphaltene
must satisfy the above inequality and as a result the amount of asphaltene precipitate can
be obtained from the above equation. The solid phase does not exist if

ln f n c ,o < ln f n cs (5.6.3)

The procedure for testing the existence of the solid phase was implemented in the
subroutine STABLS.

5.6.2 Oil-Gas-Solid Flash Calculations

Multiphase flash calculations consist of determining the phase splits and


compositions of each phase for a feed with overall composition z i ( i = 1,..., n c ) at a given

pressure, P, and temperature, T. The equations that apply can be written as:

N io + Nig i nc
Ni =
N io + Nig +Nis i = nc
(5.6.4)

nc
NT = Ni (5.6.5)
i =1

160
Ni
zi = (5.6.6)
NT

where N ij is the moles of component i in phase j and N T is the total number of moles in

hydrocarbon phases. In flash calculations, the phase equilibrium equations can be


rewritten in terms of the three-phase K-values or equilibrium ratios as follows:

ln K ig + ln ig ln io = 0 i = 1,...,n c (5.6.7)

ln K n cs + ln n cs ln n co = 0 (5.6.8)

where ij is the fugacity coefficient of component i in phase j, K ig is the gas-oil


equilibrium ratio and K n cs is the solid-oil equilibrium ratio for component n c . The K-

values are determined by the equality of component fugacities in each phase. The values
of K is result from the representation of the precipitate as a pure solid. The gas-oil

equilibrium ratio for i th component is defined as

x ig
K ig = (5.6.9)
x io

And the solid-oil equilibrium ratio for component i is

0 i nc
x is
K is = = 1 (5.6.10)
x io i = nc
x io

161
where x io is the mole fraction of component i in oil phase, x ig is the mole fraction of

component i in gas phase and x is is the mole fraction of component i in solid phase. The

precipitated asphaltene is represented as a pure dense solid phase. The solid phase
consists of only one component called the asphaltene, hence

0 i nc
x is = (5.6.11)
1 i = nc

For oil and gas phases, the fugacity coefficient of component i in phase j, ij , can

be computed from an EOS and is a function of P, T and mole fraction of component i in


phase j:

fij
ij = (5.6.12)
x ijP

The fugacity coefficient of component n c in the solid phase is

f n cs
n c s = (5.6.13)
P

For multiphase flash calculations and in conjunction with the above equations the
following material balance equation can be derived:

nc
(K ig 1)z i
1 + L (K
i =1 1) + Ls (K is 1)
=0 (5.6.14)
g ig

162
where z i is the feed composition of component i, Lg is the mole fraction of the gas phase

and Ls is the mole fraction of the solid phase. Additional information regarding the

derivation of the above equation is given in Appendix A. When the gas, oil and solid
phases coexist, the phase compositions can be evaluated from the following equations:

zi
x io = i = 1,..., n c
1 + Lg (K ig 1) + Ls (K is 1)
(5.6.15)

x ig = K ig x io i = 1,..., n c
(5.6.16)

5.7 MODELING PHASE BEHAVIOR OF SOLID PRECIPITATE IN GPAS

The asphaltene precipitation model was linked to the equation-of-state


compositional model (EOSCOMP) in a fully implicit manner. All the calculations of the
model are performed implicitly during each time-step of the compositional module. The
values used are updated at the end of the last Newton iteration.
As previously discussed, the precipitated asphaltene is represented as a pure solid.
In addition, the fugacity of the solid phase is calculated from Nghiems model for
asphaltene precipitation. The oil and gas phases are modeled with a cubic equation-of-
state. The component fugacities in the oil and gas phases are calculated from the Peng-
Robinson EOS. Chapter 4 describes the equations for the Peng-Robinson equation-of-
state. The Peng-Robinson EOS is used for all the calculations in this thesis. To calculate
the amount of asphaltene precipitation, multiphase flash calculations are performed in a
stage-wise manner, as will be described in the upcoming sections.
The asphaltene phase behavior results in a lowering of the permeability, which is
the primary driver causing the formation damage. This effect is captured implicitly by

163
using the permeability resistance factor model in an implicit form. In some cases
asphaltene precipitation may induce favorable changes in relative permeabilities and flow
diversion that improve the displacement efficiency.
To test the existence of a solid phase, the subroutine STABLS was implemented
in GPAS. Using this subroutine, STABLS, a solid stability test is performed to see
whether the system would be more stable with the formation of a solid phase. Additional
details on the procedure for testing the existence of the solid phase are provided later in
this chapter.

5.7.1 Coupling the Asphaltene Model and Flash Calculations in INFLUID0

In GPAS, the initialization and calculation of initial fluid in place is performed in


the subroutine INFLUID0. This routine is called only once at the beginning of the
simulation. The subroutine INFLUID0 in turn calls INFLUID. This subroutine is the
main driver for the computation of the initial fluid in place at both reservoir and surface
conditions. More details about the initialization process in each gridblock can be found in
Chapter 4.
The implemented procedure for coupling the asphaltene precipitation model and
flash calculations in the subroutine INFLUID is as follows:
1. At first, since the number of phases in equilibrium is not known a priori, a
stability test based on an analysis of the Gibbs free energy is performed to
see whether we have a single-phase hydrocarbon system or a two-phase
oil-gas system.
2. Based on step 1, to perform the asphaltene related calculations, the system
is considered to be only one of the following scenarios at the outset:
2.1. First Case; Single-Phase Oil System

164
2.1.1 Test the existence of the solid phase using STABLS().
2.1.2 If the solid phase exists:
Two-phase oil-solid flash calculations are performed
because the single-phase oil system was unstable.
If the systems solid fraction is less than zero:
o Return to the original single-phase oil case.

o Exit.

A stability test using subroutine STABL() is performed


on the resulting oil phase to see whether the system
would be more stable with the formation of a third gas-
phase.
If a gas phase does not exist, then it is an oil-solid case.
If the test indicates that the addition of a gas phase
would yield a more stable system:
o Three-phase oil-gas-solid flash calculations are
performed using FLASH3I() subroutine.
o If the systems solid fraction is less than zero:

Return to the original oil-solid case


Exit.
2.2. Second Case; Two-Phase Oil-Gas System
2.2.1 Test the existence of the solid phase using STABLS().
2.2.2 If the solid phase exists:
Three-phase oil-gas-solid flash calculations are
performed using subroutine FLASH3I().
If the systems solid fraction is less than zero:

165
o Return to the original oil-gas case.

o Exit.

5.7.2 Coupling the Asphaltene Model and Flash Calculations in XWELL

The subroutine XWELL computes the well rates of the EOS compositional
module of GPAS and contributes to the residuals of the governing equations. For
gridcells containing wells, the implemented procedure for coupling the asphaltene
precipitation model and flash calculations in the subroutine XWELL is similar to that for
subroutine INFLUID0.

5.7.3 Coupling the Asphaltene Model and Flash Calculations in XUPDATE

In GPAS, for a given time-step, the subroutine XUPDATE updates the phase
composition and the phase properties as phase density, viscosity, relative permeability
and determination of single-phase or two-phase in each gridcell. During each update of
the new set of independent variables, the phase stability test is performed for each
gridcell to check whether the fluid changes its phase number.
In the new implementation with asphaltene precipitation, for the case of fluid
changing from a single-phase to a two-phase hydrocarbon system, the flash calculation is
done only to determine the composition and density of each separate phase for initializing
the iteration for the next Newton step. Subroutines FLASHOS and FLASH3 were
implemented to be called by subroutine XUPDATE exclusively to determine the phase
composition. In the new implementation, the phase fractions of gas and solid phases, Lg

and Ls , are treated as independent variables and are updated in XUDATE, therefore it is

166
not necessary to solve the oil-gas-solid flash calculations for those independent variables
again.
The implemented procedure for coupling the asphaltene precipitation model and
flash calculations in the subroutine XUPDATE is described in the following. To perform
the asphaltene related calculations, the system is considered to be one of the following
two cases from a previous time step or Newton iteration:
1. First Case; Single-Phase Oil System with/without Asphaltene
At first, a stability test based on an analysis of the Gibbs free energy is
performed to see whether the system would be more stable by splitting
into two hydrocarbon phases.
1.1. If two hydrocarbon phases exist:
Test the existence of the solid phase using STABLS().
If solid phase exists:
o Three-phase oil-gas-solid flash calculations are performed
using subroutine FLASH3().
o If the systems solid fraction is less than zero:

Return to the original oil-gas case.


Exit
1.2. Else if only the oleic phase exists:
1.2.1 If the solid phase exists from the previous iteration:
Test the existence of the solid phase using STABLS().
If the solid phase exists:
o A stability test using subroutine STABL() is
performed on the resulting oil phase to see whether

167
the system would be more stable with the formation
of a third gas-phase.
o If a gas phase does not exist, then it is an oil-solid
case.
o If the test indicates that the addition of a gas phase
would yield a more stable system:
Three-phase oil-gas-solid flash calculations are
performed using subroutine FLASH3().
If the systems solid fraction is less than zero:
Return to the original oil-gas case and exit.
1.2.2 Else if the solid does not exist from the previous iteration:
Test the existence of the solid phase using STABLS().
If the solid phase exists:
o Two-phase oil-solid flash calculations are
performed using subroutine FLASHOS()
o If the systems solid fraction is less than zero:

Return to the original oil-gas case and exit.


o A stability test using subroutine STABL() is
performed on the resulting oil phase to see whether
the system would be more stable with the formation
of a third gas-phase.
o If the test indicates that the addition of a gas phase
would yield a more stable system:
Three-phase oil-gas-solid flash calculations are
performed using FLASH3() subroutine.

168
If the systems solid fraction is less than
zero: Return to the original oil-gas case and
exit.
2. Second Case; Two-Phase Gas-Oil System with/without Asphaltene
2.1. If the solid phase exists from the previous iteration:
Test the existence of the solid phase using STABLS().
If the solid phase exists:
o Three-phase oil-gas-solid flash calculations are performed
using subroutine FLASH3().
o If the systems solid fraction is less than zero:

Return to the original oil-gas case and exit.


2.2. Else if the solid phase does not exist from the previous iteration
The process is continued towards an additional Newton
iteration or a new time step.
GPAS also has an option available to perform the phase stability test for the
gridcells adjacent to ones having both gas and oil. The gridcells containing wells are
always checked for phase-number change.

5.8 MODELING DYNAMIC ASPECTS OF ASPHALTENE PRECIPITATION

The dynamic aspect of asphaltene precipitation in petroleum reservoirs has been


the topic of many recent research investigations. The process of asphaltene precipitation
and deposition is complex. In GPAS, the deposition is limited to an adsorption process.
In this thesis, "precipitation" corresponds to the formation of a solid phase from
thermodynamic equilibrium, whereas "adsorption" means the settling of solid particles
onto the rock surface.

169
Asphaltene precipitation leads to formation plugging, reduction of permeability
and changes in wettability. Asphaltene deposition gives rise to wettability changes from a
water-wet reservoir to an oil-wet reservoir. More specifically, the presence of suspended
solid particles can affect the viscosity of the oil phase, while the presence of nonmobile
asphaltene particles can cause changes in relative wettability of the phases, induce
significant plugging of just the oil phase, and block all mobile phases approximately
equally. Equations describing the dynamics of asphaltene deposition and plugging are
given in the following sections. Permeability alteration due to the plugging is modeled
with a correlation.

5.8.1 Asphaltene Adsorption Equations

After asphaltene precipitates from the oil, it can deposit onto the rock and cause
plugging and alteration of wettability. Recent investigations show that asphaltene
deposition is due to adsorption followed by mechanical entrapment. The first step in the
deposition is the rapid adsorption of asphaltene onto the active sites on the rock surface.
Given the overall composition of the fluid, z i , a multiphase oil-gas-solid flash

calculation at P and T gives the oil, gas, solid mole fractions and the composition of the
phases. Let N s be the moles of solid precipitate per pore volume

nc
N s = Ls N i
i =1 (5.8.1)

where Ls is the mole fraction of the solid phase and N i is the moles of i th component per

pore volume. In GPAS, we treat the total precipitated asphaltene or solid to be composed
of only a portion that adsorbs on the rock surface. In other words, the precipitated

170
asphaltene, no longer flows with the oil phase and can only adsorb onto active sites on
the rock surface, causing plugging and permeability impairment. A material balance
gives

N s = N n c N n c ,o N n c ,g = N as (5.8.2)

where N n c corresponds to the total moles of n c th component (the heaviest component)


in the oil, gas and solid phases, N n c ,o is the total moles of n c th component in oil phase,
N n c ,g is the total moles of n c th component in gas phase and N as is the portion of N s that

adsorbs on the rock surface. N as can be also be considered as the moles of solid that

deposit onto the rock surface through adsorption. The mass of adsorbed solid asphaltene
is related to the moles of adsorbed solid per pore volume, through the equation

N as M s
w as = (5.8.3)
(1-)R

where w as is the mass of adsorbed asphaltene per mass of rock, is the rock porosity,
R is the mass density of rock and M s is the molecular weight of the asphaltene

component. The subroutine PROP which is called during each Newton iteration,
performs the last part of the calculations related to the amount of adsorbed solid.

5.8.2 Linear Permeability Reduction Model for Plugging due to Asphaltenes

As discussed before, several physical properties will be affected by asphaltene


precipitation, including permeability, relative permeability, fluid viscosity, and
wettability. The effect of asphaltene on wettability will be accounted for in relative
permeability. In this section, permeability and relative permeability models are presented.

171
The relative permeability reduction is calculated using a resistance factor model.
This model, which is proposed by Nghiem et al. (1994), is used in the GPAS simulator to
compute the change in relative permeability affected by asphaltene adsorption and
plugging. The permeability resistance factor is calculated as

w as
1.0 + (R f ,max 1) w w as w as,max
Rf = as,max (5.8.4)
R w as > w as,max
f ,max

where R f is the permeability resistance factor, R f,max is the maximum permeability


resistance factor and w as,max is the maximum mass of asphaltene that can precipitate from
oil. Both R f,max and w as,max are input parameters in the simulator and can in principle be

obtained from experimental data. The above equation corresponds to a linear relationship
between R f and w as , with a plateau at R f,max . Once R f is calculated, all the phase

permeabilities, or more generally phase mobilities (oil, gas and water mobilities), and
consequently the phase transmissibilities, are divided by this permeability resistance
factor to account for the reduced permeability due to asphaltene precipitation:

ko
k= (5.8.5)
Rf

In the above equation, k o represents the original permeability and k is the


instantaneous permeability affected by asphaltene precipitation. The effect of asphaltene
precipitation on each phase may be different. More likely, the relative permeability of the
oil phase is much more sensitive to the asphaltene precipitation than for the water and gas

172
phases. Thus, a different resistance factor may be given to each phase. The subroutine
PROP calculates the permeability resistance factor.

5.9 INDEPENDENT VARIABLES

Several choices are available for the independent variables for a fully implicit,
compositional simulator, which is also able to model asphaltene precipitation. In GPAS,
the set of independent variables for solving the governing equations includes ln K1g ,
ln K 2g ,, ln K n cg , N1 , N 2 ,, N n c , P, N w , ln K n cs , Lg and Ls . Note that P is the

water-phase pressure. With the introduction of asphaltene precipitation, the set of


independent variables of GPAS was increased from ( 2n c + 2 ) to ( 2n c + 5 ) variables. The
three new added independent variables are ln K n cs , Lg and Ls . The independent

variables can be obtained by simultaneously solving the system of governing equations


using Newtons method. The governing equations of GPAS with the effect of asphaltene
precipitation are presented and described in the following section.

5.10 DESCRIPTION OF GOVERNING EQUATIONS FOR ASPHALTENE


PRECIPITATION

The equations in an EOS compositional simulator consist of partial differential


equations for multiphase, multicomponent flow in porous media and correlations for
phase behavior, fluid properties and rock-fluid interactions.
Isothermal multicomponent and multiphase flow in a porous medium can be
described using three different types of equations:
1. Phase equilibrium equations dealing with equilibrium component mass
transfer between phases, in which flash calculations using an EOS are
performed to determine amounts and compositions of equilibrium phases

173
2. Equations constraining volume and component moles
3. Mass conservation equations
There is no conservation of momentum equation, although this may be important
for modeling fluid flow in and near the wellbore and in surface equipment.
Neglecting mutual solubility between water and hydrocarbon phases, for a system
consisting of hydrocarbon components and fluid phases (excluding the aqueous phase),
the above three types of equations are mathematically expressed for a control volume in
the upcoming sections.
With the introduction of asphaltene precipitation, many equations had to be
reformulated, modified and added to the simulator. To model the dynamic aspect of
asphaltene precipitation, the thermodynamic model for precipitation is incorporated into
GPAS, where equations for phase equilibrium, volume constraint equation, equations for
multiphase and multicomponent flow, multiphase flash equation, solid-oil equilibrium
ratio equation and equations for asphaltene deposition and plugging are solved
simultaneously. This allows the modeling of the precipitation with changes in pressure
and composition as they occur in the reservoir, because in GPAS the asphaltene
precipitation is affected solely by pressure and composition.
The new formulation was based on a fully implicit finite difference approach. The
Newton iteration method is used to solve the non-linear equations generated after the
finite differencing with the independent variables. The equations are linearized using
Newton's procedure. The Jacobian matrix representing the linear system is generated by
computing the derivatives of the governing equations with respect to the independent
variables. This linear system is then solved for the independent variables for all the cells.
The phase equilibrium calculations are performed to update physical properties. This

174
cycle is then repeated using the Newton solution scheme until the convergence criteria
based on the residual tolerance are met.
The fully implicit formulation allows us to take advantage of the larger time steps
in order to reduce the simulation time. The following sections describe the affect of
asphaltene precipitation on the governing equations of the General Purpose Adaptive
Simulator.

5.10.1 Phase Equilibrium Equations


Let n c be the number of components in the oil and gas phases and n c be the

index of the asphaltene component. With the assumption of local thermodynamic


equilibrium, and when the gas, oil and solid phases coexist, the following thermodynamic
equilibrium equations for the components are satisfied:

ln fig ln f io = 0 i = 1,..., n c (5.10.1)


ln f n c o ln f n cs = 0 (5.10.2)

where f io and f ig are the component fugacities in the oil and gas phases calculated with
an EOS, and f n cs is the pure solid fugacity calculated from Nghiems model. Additional

details regarding the effect of asphaltene precipitation on phase equilibrium equations are
given in Appendix B and Appendix F.

5.10.2 Volume Constraint Equation

The volume constraint equation expresses that the pore volume is equal to the
volume of all fluid phases plus the solid phase:

175
N w No Ng Ns
+ + + =1 (5.10.3)
w o g s

where N j is the total number of moles of jth phase per unit pore volume. Note that the
Ns
term , represents the effect of asphaltene precipitation on the volume constraint
s

equation. Additional details regarding the effect of asphaltene precipitation on the volume
constraint equation are given in Appendix C.

5.10.3 Mass Conservation Equation for Hydrocarbon Components


The mass conservation equation for i th component ( i = 1,..., n c ) with the effect of

asphaltene precipitation at a gridblock of (I,J,K) is described as follows:

M i = M i(I,J,K)accum + M i(I,J,K )flux M i(I,J,K )source (5.10.4)

where M i(I,J,K)accum is the accumulation term of the mass conservation equation for a
gridblock, M i(I,J,K )flux is the flux term and M i(I,J,K)source is the source term. The mass

conservation equation for hydrocarbon components needs to be discretized using a proper


scheme on the grid system that represents the geometry of a given reservoir. This
equation is discretized with finite difference techniques.
The implicit finite difference form for the mass conservation equation for
hydrocarbon component i on a rectangular grid can be expressed as

176
V
Mi = b
t
(( N )i
n +1 n
( Ni ) ) + ( Fi(I +1/ 2,J,K) Fi(I 1/ 2,J,K) ) +
(I,J,K )
n +1

(F Fi(I,J 1/ 2,K) ) + ( Fi(I,J +1/ 2,K ) Fi(I,J 1/ 2,K ) ) + ( Fi(I,J,K +1/ 2) Fi(I,J,K 1/ 2) ) (5.10.5)
n +1 n +1 n +1
i(I,J +1/ 2,K)
q i(I,J,K ) = 0

The dispersion term is not considered in the current version of the simulator. The
above equation is discretized using central differencing in space and backward
differencing in time. With

3
N i(I,J,K) = j(I,J,K )S j(I,J,K ) x ij(I,J,K ) (5.10.6)
j= 2

= r (1 + cf (P P o ) ) (5.10.7)

where N i is the moles of i th component per unit pore volume for a gridblock and r is

the porosity at reference pressure or Po . The material conservation equations for


hydrocarbon components with the effect of asphaltene precipitation are solved implicitly.
In the formulation, we will use Maccum , Mconv , and Msource instead for simplicity.
Since, in the current code of GPAS, the dispersion is not considered, only the convection
term is taken into account for the flux of the mass conservation equation. In this section,
I is used for the grid index, i for the component index, and j for the phase index.
Only the mathematical formulation for x direction is given here because the terms
for other directions are similar, so y and z indexes can be dropped for clarity. In the code,
the water phase is numbered as 1, the oil phase as 2, and the gas phase as 3.

177
3
Fi(I +1/ 2) = Tij(I +1/ 2) v j(I+1/ 2) (5.10.8)
j= 2

3
Fi(I 1/ 2) = Tij(I1/ 2) v j(I 1/ 2) (5.10.9)
j= 2

where the phase transmissibilities, Tij(I) , which depend upon the relative permeabilities,

molar densities, mole fractions and viscosities are calculated from

k rj j x ij k 0rj j x ij
Tij(I) = j x ij =
a
= (5.10.10)
j jR f
rj

In the above equation, the permeability resistance factor, R f , models the plugging

process and the permeability impairment due to asphaltene precipitation. In addition:

v j(I+1/ 2) = k (I +1/ 2) ( j(I +1) j(I) )


~

v j(I1/ 2) = k (I1/ 2) ( j(I) j(I1) )


~

~
where k is the harmonic mean of permeability on a Cartesian grid. With

~ 2y (I) z (I) k (I) k (I+1)


k (I +1/ 2) =
x (I +1) k (I +1) + x (I) k (I)

~ 2y (I) z (I) k (I) k (I 1)


k (I 1/ 2) =
x (I1) k (I1) + x (I) k (I)

178
And j is the potential of phase j given by

j(I) = Pj(I) + Pc(I) j(I) D(I)

Note that Pc(I) = 0 for the water phase. For one-point upstream weighting, we

have

Tij(I) if j(I) > j(I +1)


Tij(I+1/ 2) =
Tij(I +1) if j(I) < j(I+1)

Tij(I) if j(I) > j(I1)


Tij(I1/ 2) =
Tij(I 1) if j(I) < j(I1)

Hence there are four scenarios for the convection term

1. j(I +1) < j(I) and j(I) < j(I 1)

3
Fi(I +1/ 2) Fi(I1/ 2) = ( Tij(I) v j(I+1/ 2) Tij(I1) v j(I 1/ 2) )
j=1

2. j(I +1) > j(I) and j(I) > j(I 1)

3
Fi(I +1/ 2) Fi(I 1/ 2) = ( Tij(I+1) v j(I+1/ 2) Tij(I1) v j(I1/ 2) )
j=1

3. j(I +1) > j(I) and j(I) < j(I 1)

3
Fi(I +1/ 2) Fi(I 1/ 2) = ( Tij(I+1) v j(I+1/ 2) Tij(I1) v j(I1/ 2) )
j=1

4. j(I +1) < j(I) and j(I) > j(I 1)

179
3
Fi(I +1/ 2) Fi(I1/ 2) = ( Tij(I) v j(I+1/ 2) Tij(I) v j(I 1/ 2) )
j=1

The above equations represent three-dimensional finite-difference flow equations


with asphaltene precipitation. In GPAS, we assume that the precipitated asphaltene
deposits on the rock surface upon formation, and does not flow as suspended solid
particles in the oil phase. Additional details regarding the effect of asphaltene
precipitation on mass conservation equation for hydrocarbon components are given in
Appendix D.

5.10.4 Mass Conservation Equation for Water

The mass conservation equation for the water component consists of three terms:
accumulation, flux and source function. This equation, with the effect of asphaltene
precipitation at a gridblock of (I,J,K), is as follows:

M w = M w (I,J,K )accum + M w (I,J,K)flux M w (I,J,K )source (5.10.11)

where M w (I,J,K )accum is the accumulation term of the water mass conservation equation for
a gridblock, M w (I,J,K )flux is the flux term and M w (I,J,K )source is the source term. This

equation is discretized with a finite difference technique.


The implicit finite difference form for the mass conservation equation for the
water component on a rectangular grid can be expressed as

180
V
Mw = b
t
(( N w )
n +1 n
( N w ) ) + ( Fw (I+1/ 2,J,K ) Fw (I 1/ 2,J,K) ) +
(I,J,K )
n +1

(5.10.12)
(F Fw (I,J 1/ 2,K ) ) + ( Fw (I,J,K +1/ 2) Fw (I,J,K 1/ 2) ) q
n +1 n +1
w (I,J +1/ 2,K ) w (I,J,K ) = 0

In the code, the water phase is numbered as 1, and n c + 1 the represents water

component. Here we use "w" instead, for clarity. Neglecting the solubility of water in oil
and gas phases, we have

x w1 = 1

w = constant

w = w (P)

k rw = k rw (Sw )

k 0rw w ~
Fw = Tw v w = k P (5.10.13)
jR f

In the above equation, the permeability resistance factor, R f , models the plugging

process due to asphaltene precipitation. Additional details regarding the effect of


asphaltene precipitation on mass conservation equation for water are given in Appendix
E.

5.10.5 Multiphase Flash Equation

For multiphase flash calculations, the following equation can be defined:

181
nc
zi (K im 1)
1+ =0 m = 2,..., n p j = 2,..., n p (5.10.14)
i =1 L j (K ij 1)
j

For the case of a three-phase system of oil, gas and solid, we will use the
following flash equation

nc
z i (K ig 1)
FE(Lg , Ls ) = =0 (5.10.15)
i =1 1 + Lg (K ig 1) + Ls (K is 1)

Lg and Ls are, respectively, the mole fractions of gas and solid in the

hydrocarbon system. Additional details regarding the effect of asphaltene precipitation on


multiphase flash equation are given in Appendix G.

5.10.6 Solid-Oil Equilibrium Ratio Equation

The solid-oil equilibrium ratio can be defined as

0 i = 1,..., n c 1
x is
K is = = 1 (5.10.16)
x io i = nc
x nco

The values of K is in the above equation result from the representation of the

precipitate as a pure solid. The mole fraction of component i in the solid phase is defined
by

182
0 i = 1,..., n c 1
x is =
1 i = nc

Additional details regarding the effect of asphaltene precipitation on the solid-oil


equilibrium ratio equation are given in Appendix H.

5.11 DERIVATIVES FOR CONSTRUCTION OF THE JACOBIAN MATRIX FOR


MODELING ASPHALTENE PRECIPITATION

5.11.1 Derivatives of Governing Equations

The derivatives of the governing equations for modeling asphaltene precipitation


with respect to the independent variables used in GPAS to compute and construct the
elements of the Jacobian matrix can be found in Appendices B through H. Due to
asphaltene precipitation, many elements of the old Jacobian matrix were modified and
many new elements were added.
The derivatives of the mass conservation equations for hydrocarbon components
and water, with respect to the independent variables from the neighboring or adjacent
gridblocks, must also be accounted for in the Jacobian matrix too. As a result of this, the
corresponding rows of the Jacobian matrix for mass conservation equations for both
hydrocarbon component and water contain off-diagonal elements.
Later in this chapter we discuss a procedure for obtaining the ( 2n c + 5 ) primary

unknowns per gridblock ( ln K1g , ln K 2g ,, ln K n cg , N1 , N 2 ,, N n c , P, N w , ln K n cs ,


Lg and Ls ) by solving a system composed of the governing equations.

183
5.11.2 Derivatives of Component Mole Fractions

To build the Jacobian matrix for the fully implicit formulation in GPAS we need
the following partial derivatives, which represent the derivatives of the component mole
fractions with respect to the independent variables:

x ij
i = 1,..., n c i1 = 1,..., n c j = o, g
ln K i1g

x ij
i = 1,..., n c i1 = 1,..., n c j = o, g
N k

x ij
i = 1,..., n c j = o, g
ln K n cs

x ij
i = 1,..., n c j = o, g
Lg

x ij
i = 1,..., n c j = o, g
Ls

Appendix I describes in detail the derivatives of component mole fractions with


respect to the ( 2n c + 5 ) primary unknowns per gridblock for multiphase and

multicomponent flow in porous media with the effect of asphaltene precipitation.

5.11.3 Derivatives of the Peng-Robinson Equation-Of-State

GPAS uses a cubic EOS to model oil and gas phases. The Peng-Robinson EOS is
used for the hydrocarbon phase behavior calculations in this thesis. More details

184
regarding the Peng-Robinson EOS can be found in Chapter 4. In addition, Appendix J
describes in detail the derivatives of the Peng-Robinson equation-of-state which are
essential for constructing the Jacobian matrix for the fully implicit formulation in GPAS.

5.11.4 Derivatives of the Compressibility Factor

At constant temperature

Z j = f(x1j , x 2j , ..., x n c j , P) j = o, g (5.11.1)

Taking the total differential of the above equation, we have

nc
Z j Z j
dZ j = dx ij + dP (5.11.2)
i =1 x ij P

To build the Jacobian matrix for the fully implicit formulation in GPAS we need
the following partial derivatives, which represent the derivatives of the compressibility
factor with respect to the independent variables:

Z j
i = 1,..., n c j = o, g
ln K ig

Z j
i = 1,..., n c j = o, g
Ni

Z j
i = 1,..., n c j = o, g
ln K n cs

185
Z j
i = 1,..., n c j = o, g
Lg

Z j
i = 1,..., n c j = o, g
Ls

The derivatives in this case can be calculated by applying the chain rule and
computing the derivatives of the component mole fraction with respect to the independent
variables. Appendix K describes in detail the derivatives of the compressibility factor
with respect to the ( 2n c + 5 ) primary unknowns per gridblock for multiphase and

multicomponent flow in porous media with the effect of asphaltene precipitation.

5.11.5 Derivatives of Physical Properties

The physical properties are calculated for the phases based on their compositions.
The phase equilibrium calculations are performed to update the physical properties used
in governing equations and evaluating the residuals. The fluid physical properties and
variables used in the mass balance equation are expressed as a function of independent
variables. The physical properties are discussed in detail in Chapter 4.
{ }
Let V = ln K ig , N i , P, N w , ln K n cs , Lg , Ls represent the independent variables in

the solution. The partial derivatives of molar density of phase j, phase saturation, relative
permeability and viscosity with respect to V, are required to build the Jacobian matrix for
the fully implicit formulation in GPAS.
The partial derivatives of the molar density of phase j, with respect to V, can be
calculated by applying the chain rule and computing the derivatives of the
compressibility factor:

186
P
j = j = o, g (5.11.3)
RTZ j

j P Z j
= (5.11.4)
x ij RTZ j2 x ij

The partial derivatives of the relative permeability of phase j, with respect to V,


can be calculated by applying the chain rule and computing the derivatives of the phase
saturation.
Appendix L describes in detail the derivatives of physical properties (e.g. molar
density, saturation, relative permeability and viscosity of each phase) with respect to the
( 2n c + 5 ) primary unknowns per gridblock for multiphase and multicomponent flow in

porous media with the effect of asphaltene precipitation..

5.12 RESIDUALS OF GOVERNING EQUATIONS

To solve the governing equations for the independent variables over a time-step,
we first linearize the governing equations in terms of the independent variables and form
the Jacobian matrix. The Jacobian matrix consists of the derivatives of the residuals of
the governing equations with respect to the independent variables. In addition, the
residuals of the linear system are used to determine convergence. If a tolerance is
exceeded, the elements of the Jacobian matrix and the residuals of the governing
equations are then updated and an additional Newton iteration is performed. A detailed
description of the Jacobian matrix with the effect of asphaltene precipitation will be
presented later in this chapter. In this section, we present the residuals of the governing
equations of the General Purpose Adaptive Simulator.

187
5.12.1 Residuals of Phase Equilibrium Equations

The phase equilibrium Equations (5.10.1) and (5.10.2) can be rewritten in terms
of the K-values (equilibrium ratios) as follows:

ln K ig + ln ig ln io = 0 i = 1,...,n c (5.12.1)

ln K n cs + ln n cs ln n co = 0 (5.12.2)

We can define the residuals of phase equilibrium equations at a gridblock of


(I,J,K) as

R if = ln K ig + ln ig ln io i = 1,..., n c (5.12.3)

R fs = ln K n cs + ln n cs ln n co (5.12.4)

The derivatives of the residuals of the phase equilibrium equations, with respect
to the independent variables, can be found in Appendix B and Appendix F.

5.12.2 Residual of Volume Constraint Equation

The residual of the volume constraint equation for each gridblock is given by the
following equation.

N w No Ng Ns
Rv = + + + 1 (5.12.5)
w o g s

188
The residual of the volume constraint equation can be written in the following
form. Note that the molar volume of the solid phase is constant.

v w N w + v o N o + v g N g + vs N s 1
Rv =
NT
(
= vw N w 1 ) N1 + v o L o + v g L g + v s Ls (5.12.6)
T

The residual of the volume constraint is dependent only on independent variables


or unknowns at its own gridblock. The derivatives of the residual of the volume
constraint equation with respect to the independent variables can be found in Appendix
C.

5.12.3 Residual of the Mass Conservation Equation for Hydrocarbon Components

We can define the residual of the mass conservation equation for i th component at
a gridblock of (I,J,K) as

m
R i(I,J,K
Vb
) =
t
(( N ) i
n +1 n
( N i ) ) + ( Fi(I+1/ 2,J,K ) Fi(I1/ 2,J,K ) ) +
(I,J,K)
n +1

(F Fi(I,J 1/ 2,K) ) + ( Fi(I,J +1/ 2,K ) Fi(I,J 1/ 2,K ) ) + ( Fi(I,J,K +1/ 2) Fi(I,J,K 1/ 2) ) (5.12.7)
n +1 n +1 n +1
i(I,J +1/ 2,K)
q i(I,J,K )

The accumulation term in the residual of the mass conservation equation for
hydrocarbon components is dependent only on independent variables at its own
gridblock. The derivatives of the flux term for hydrocarbon components in the above
equation are more complicated because the flux term is dependent on primary variables at
six neighbor gridblocks as well as those at its own gridblock

189
The derivatives of the residual of the mass balance equation for hydrocarbon
components, with respect to the independent variables, can be found in Appendix D.

5.12.4 Residual of the Mass Conservation Equation for Water

We can define the residual of the water mass conservation equation at a gridblock
of (I,J,K) as

w
R (I,J,K
Vb
) =
t
(( N w )
n +1 n
( N w ) ) + ( Fw (I +1/ 2,J,K) Fw (I1/ 2,J,K ) ) +
(I,J,K )
n +1

(5.12.8)
(F Fw (I,J 1/ 2,K ) ) + ( Fw (I,J,K +1/ 2) Fw (I,J,K 1/ 2) ) q
n +1 n +1
w (I,J +1/ 2,K ) w (I,J,K )

The accumulation term in the residual of the mass conservation equation for water
is dependent only on independent variables at its own gridblock. The derivatives of the
flux term for water in the above equation are more complicated because the flux term is
dependent on primary variables at six neighbor gridblocks as well as those at its own
gridblock.
The derivatives of the residual of the mass conservation equation for water with
respect to the independent variables can be found in Appendix E.

5.12.5 Residual of the Multiphase Flash Equation

The residual of the multiphase flash equation at a gridcell can be expressed as

nc
zi (K ig 1)
R =
fe
(5.12.9)
i =1 1 + Lg (K ig 1) + Ls (K is 1)

190
The derivatives of the residual of the multiphase flash equation with respect to the
independent variables can be found in Appendix G.

5.12.6 Residual of the Solid-Oil Equilibrium-Ratio Equation

The residual of the solid-oil equilibrium ratio for each gridcell is given by the
following equation:

1
R er = K n cs (5.12.10)
x nco

The derivatives of the residual of the solid-oil equilibrium ratio equation with
respect to the independent variables can be found in Appendix H.

5.13 JACOBIAN MATRIX

The term Jacobian refers to the mathematical matrix that forms the system of
linear equations and whose elements are the derivatives of the residuals of the governing
equations with respect to the independent variables. An analytical method is used to
calculate the elements of the Jacobian matrix. The elements of the old Jacobian matrix of
GPAS were affected by asphaltene precipitation; and compared to the case without
considering the effect of asphaltene precipitation many elements were added to the new
Jacobian.
A Newton method is used, in which the system of nonlinear equations is
approximated by a system of linear equations. To linearize the governing equations in
terms of the independent variables, it is necessary to evaluate the following partial
derivatives for each gridblock.

191
J1,1 J1,2 ... J1,n b

J 2,1 J 2,2 ... J 2,n b
J= (5.13.1)
M M

J n b ,1 J n b ,2 ... J n b ,n b

where J is the Jacobian matrix, J i, j is the Jacobian matrix for i th gridblock with respect
to unknowns of jth gridblock and n b is the total number of gridblocks. To illustrate the

structure of the Jacobian matrix for different cases encountered in this research study, J1,1

(the Jacobian matrix for the first gridblock with respect to the unknowns of the same
gridblock) is presented in the following sections.

5.13.1 Jacobian Structure for a Gridblock without Asphaltene Precipitation

With no asphaltene precipitation, and if only oil and gas phases exist in a
gridblock, the derivatives with respect to the new independent variables, ln K n cs , Lg and

Ls are not needed for the Jacobian matrix. The structure of the Jacobian matrix for a

typical gridblock with no asphaltene precipitation is as follows:

192
R1f R1f R1f R1f R1f R1f
L L 0 0 0 0
ln K1g ln K n c g N1 N n c P N w
M M M M M M M M M M M M

R fnc R f
nc R f
nc R f
nc R f
nc R fn c
L L 0 0 0 0
ln K1g ln K1g N1 N n c P N w

R R v R v R v R v R v
v
L L 0 0 0 0
ln K1g ln K n c g N1 N n c P N w

R1
m
R1m R1m R1m R1m R1m
ln K L L 0 0 0 0
ln K n c g N1 N n c P N w
J1,1 = 1g

M M M M M M M M M M M M

R nc R mnc R mnc R mnc R mn c R mn c
m

L L 0 0 0 0
ln K1g ln K n c g N1 N n c P N w
R w R w R w R w R w R w
L L 0 0 0 0
ln K1g ln K n c g N1 N n c P N w

0 L 0 0 L 0 0 0 1 0 0 0
0 L 0 0 L 0 0 0 0 1 0 0

0 L 0 0 L 0 0 0 0 0 1 0
0 L L 0 0 0 1
0 0 0 0 0

5.13.2 Jacobian Structure for a Single-Phase-Oil Gridcell with Asphaltene


Precipitation

If only oil and solid phases exist in a gridblock, the derivatives with respect to
some independent variables, e.g. ln K ig and Lg , are not needed for the Jacobian matrix.

For single oil phase with asphaltene precipitation, the Jacobian matrix for a typical
gridblock is presented is as follows:

193
1 L 0 0 L 0 0 0 0 0 0 0
M
M M M M M M M M M M M
0 L 1 0 L 0 0 0 0 0 0 0

R v R v R v R v R v R v
0 L 0 L 0 0
N1 N n c P N w ln K n cs Ls

R1m R1m R1m R1m R1m R1m
0 L 0 L 0 0
N1 N n c P N w ln K n cs Ls
M M M M M M M M M M M M

R m
nc R m
nc R m
nc R m
nc R m
nc R mnc
J1,1 = 0 L 0 L 0 0
N1 N n c P N w ln K n cs Ls

0 R w R w R w R w R w R w
L 0 L 0 0
N1 N n c P N w ln K n cs Ls

R fs R fs R fs R fs R fs R fs
0 L 0 L 0 0
N1 N n c P N w ln K n cs Ls

0 L 0 0 L 0 0 0 0 1 0 0

0 R er R er R er R er R er R er

L 0 L 0 0
N1 N n c P N w ln K n cs Ls

0 L 0 0 L 0 0 0 0 0 0 1

Because the linearized system includes both the fugacity and volume constraint
equations, the gridblocks representing only oil (no gas) have their corresponding off-
diagonal elements in the Jacobian set to zero, and those on the diagonal are set to one.
The corresponding values in the right-hand side vector are set to zero.

5.13.3 Jacobian Structure for a Multiphase Oil-Gas-Solid Gridcell

The Jacobian structure for the general case of a multiphase oil-gas-solid system is
shown in the following:

194
R1f R1f R1f R1f R1f R1f R 1f R1f R1f
ln K L L 0
1g ln K n c g N1 N nc P N w ln K ncs L g Ls
M M M M M M M M M M M M

R fnc R f
nc R f
nc R f
nc R f
nc R f
nc R f
nc R f
nc R nf c
L L 0
ln K1g ln K1g N1 N nc P N w ln K ncs L g Ls
R v R v
R v
R v
R v
R v
R v
R v
R v
L L 0
ln K1g ln K n c g N1 N nc P N w ln K ncs L g Ls

R 1 R 1m R 1m R1m R1m R 1m R1m R1m R1m
0
m

ln K L L
ln K n c g N1 N nc P N w ln K ncs L g Ls
1g

M M M M M M M M M M M M

J1,1 = R mnc R m
nc R m
nc R m
nc R m
nc R m
nc R m
nc R m
nc R mn c
ln K L L 0
ln K n c g N1 N nc P N w ln K ncs L g Ls
1g

R w R w R w R w R w R w R w R w R w
L L 0
ln K1g ln K n c g N1 N nc P N w ln K ncs L g Ls

R R fs R fs R fs R fs R fs R fs R fs R fs
fs
L L 0
ln K1g ln K n c g N1 N nc P N w ln K ncs L g Ls

R fe R fe R fe R fe R fe R fe R fe R fe R fe
ln K L L 0
ln K n c g N1 N nc P N w ln K ncs L g Ls
1g
R er
R er R er R er R er R er R er R er R er
L L 0
ln K1g ln K n c g N1 N nc P N w ln K ncs L g Ls

0 L 0 0 L 0 0 0 0 0 0 1

The phase equilibrium equations, the volume constraint equation, the multiphase
flash equation and the solid-oil equilibrium ratio equation do not involve variables from
adjacent gridblocks, so the corresponding rows of the Jacobian matrix do not contain off-
diagonal elements. Before the Jacobian matrix is fed to the PETSc solver, some
processing can be done to simplify the matrix.

195
5.14 SOLUTION METHOD

The governing equations are solved simultaneously using a fully implicit method.
This method treats each term in the governing equations implicitly. These equations are
nonlinear and must be solved iteratively. To solve the nonlinear equations, Newtons
method is used.
The material balance equations need to be discretized using a proper scheme for a
given grid system that represents the geometry of the reservoir. The equations are
discretized using a forward in space and backward in time approximation. After the finite
differencing of the governing equations, we have ( 2n c + 5) n b nonlinear equations with
r r r
the same number of unknowns, x1 , x 2 ,..., x n b , for i th gridblock at new time level when
r
considering all the gridblocks. Where the unknowns-vector, xi , for i th gridblock is

r
(
x i = ln K1g ,..., ln K n cg , N1 ,..., N n c , P, N w , ln K n cs , Lg , Ls ) (5.14.1)

r
Residual vector for the method, R , consists of all the governing equations
r r r r r
( )
differentiated, and the unknown vector is x = x1 , x 2 ,..., x n b . The vector x is considered
r r r
as a solution vector at the new time level generally when it satisfies R(x) 0 . Another

criterion can be used for convergence based on the pressure and saturation changes being
r
sufficiently small for a given change of x by Newton iteration. This criterion is
preferred, especially when large saturation changes may occur for very small changes in
composition during the Newton iteration.
r
To search for the solution vector or to guess a new solution vector, x is updated
by

r new r old r
x = x + x (5.14.2)

196
r
where x is obtained from

r old r r old
J(x ) x = R(x ) (5.14.3)

The above system can be rewritten as follows

r r
J1,1 J1,2 ... J1,n b x 1 R1
r r
J 2,1 J 2,2 ... J 2,n b x 2 R2
= (5.14.4)
M M M M
r
xr n R n b
J n b ,1 J n b ,2 ... J n b ,n b b

r
Where the residual vector, R i , for i th gridblock is

r
(
R i = R f1 ,..., R fn , R v , R 1m ,..., R mn , R w , R fs , R fe , R er
c c
) (5.14.5)

As can be seen from the above discussion, the number of linear equations to be
solved for one Newton iteration is dependent on the number of components and
gridblocks. Therefore, if we use a number of components and gridblocks for a precise
simulation with a single processor, computational memory may be insufficient or run
time may be very long, even if there is enough memory. This problem can be overcome
by parallel processing using multiple processors. More details can be found in Chapter 4.
Figure 5.2 shows the flowchart to search a solution vector at a new time level
with asphaltene precipitation using Newtons method. Bold letters represent the names of
the FORTRAN subroutines used in GPAS. The flowchart of the asphaltene code
describes the role of each subroutine.

197
As an example, in the case of single-phase oil with asphaltene precipitation we
must solve the following system

R 1f R 1f R1f R1f R 1f R1f


0 L 0 L 0 0
N1 N nc P N w ln K ncs L s
M M M M M M M M M M M M

R f
nc R f
nc R f
nc R f
nc R f
nc R fn c
0 L 0 L 0 0
N1 N nc P N w ln K ncs L s ln K1g R1f

R v R v R v R v R v R v M
0 L 0 L 0 0 M
N1 N nc P N w ln K ncs L s ln K n g R f
c

nc

R1m R1m R1m R 1m R1m R1m N1 R v
0 L 0 L 0 0 m
N1 N nc P N w ln K ncs Ls
R1
M
M M M M M M M M M M M M N nc M
= m
R R R R R R mn c P R n c
m m m m m
nc nc nc nc nc
0 L 0 L 0 0
N1 N nc P N w ln K ncs L s N w R w

R w R w R w R w R w R w ln K ncs R fs
0 L 0 L 0 0 fe
N1 N nc P N w ln K ncs L s Lg R
Ls R er
0 R fs R fs R fs R fs R fs R fs
L 0 L 0 0
N1 N nc P N w ln K ncs L s 0 0

0 L 0 0 L 0 0 0 0 1 0 0

0 R er
R er
R er
R er
R er
R er
L 0 L 0 0
N1 N nc P N w ln K ncs L s

0 L 0 0 L 0 0 0 0 0 0 1

Newtons method is used to linearize the nonlinear equations according to the


following steps:
1. Guess a solution vector. Usually, the solution vector at the old time step is
used as the initial guess for the new time step.
2. Using the guessed solution vector, compute the residuals
f v m w fs fe er
R ,R ,R ,R ,R ,R ,R
i i from some initial guesses of the

198
independent variables. To calculate the residual vector, we need to
r
evaluate variables that depend on x , such as porosity, molar density,
relative permeability, molar composition, phase viscosities, and source or
sink. A detailed discussion of how to evaluate several important dependent
variables can be found in Chapter 4.
3. Check for convergence
3.1. If the value of the residual is less than the tolerance, then the
convergence is achieved for the current timestep and the guessed
solution vector becomes the true solution vector. If the value of the
residual is more than the tolerance, then start a new Newton
iteration.
3.2. If convergence is not achieved, another solution vector is guessed.
Calculate the partial derivatives of the residuals with respect to the
independent variables to form the Jacobian matrix.
r old r r old r old
4. Solve the system J(x ) x = R(x ) where J(x ) is the Jacobian
r r old
matrix, x is the vector of unknowns and R(x ) is the residuals vector

that is evaluated using the previous solution vector.


5. Update the independent variables, i.e.,

199
new
ln K1g = ln K1g
old
+ ln K1g
M
n c g = ln K n c g + ln K n c g
ln K new old

N1new = N1old + N1
M
n c = N n c + N n c
N new old

P new = P old + P
N new
w = N old
w + N w

ln K nnew
cs
= ln K old
n cs + ln K n cs

Lnew
g = Lold
g + L g

Lnew
s = Lold
s + L s

6. Return to step one to start a new timestep.

To show the structure of the Jacobian matrix, we will present a simple one-

dimensional system with three gridblocks and three hydrocarbon components plus water.

Hence, there are 33 unknowns in each gridblock:

( 2n c + 5 ) n b = ( 2 3 + 5 ) 3 = 33

r
The 33 unknowns form the vector of unknowns, x , namely:

1st Gridblock: ln K11g ln K12g ln K13g N11 N12 N13 P1 N1w ln K13s L1g L1s
2
2nd Gridblock: ln K1g ln K 22g 2
ln K 3g N12 N 22 N32 P2 N 2w ln K 3s2 L2g L2s
3rd Gridblock: ln K1g
3
ln K 32g 3
ln K 3g N13 N32 N 33 P3 N 3w 3
ln K 3s L3g L3s

200
We start with three gas-oil fugacity equations for the three components, then the

volume constraint equation followed by the three components mass balance equations,
and the water mass balance equation. Depending on whether or not there is asphaltene
precipitation, we add three more equations; the solid-oil fugacity equation, the flash

equation and finally the solid-oil equilibrium equation.



Based on this selection, the residuals vector, R , would have the following
elements:

1st Gridblock: R 1f 1 R 2f 1 R 3f 1 R v1 R 1m1 R m1


2 R 3m1 R w1 R fs1 R fe1 R er1
2nd Gridblock: R 1f 2 R f2 2 R 3f 2 R v2 R 1m2 R 2m2 R 3m2 R w2 R fs2 R fe2 R er2
3rd Gridblock: R 1f 3 R 2f 3 R 3f 3 R v3 R1m3 R m3
2 R 3m3 R w3 R fs3 R fe3 R er3

Note that for this system; because the phase equilibrium, the volume constraint

equation, the multiphase flash equation and the solid-oil equilibrium equation do not

involve variables from adjacent gridblocks, the corresponding rows for the general

structure of the Jacobian matrix will not contain off-diagonal elements.

5.15 IMPLEMENTATION OF THE ASPHALTENE PRECIPITATION CODE

The code structure of the General Purpose Adaptive Simulator is described in


detail by Wang et al. (1997), Parashar et al. (1997), and Nalla (2002). The asphaltene

precipitation model proposed in this research work was implemented primarily in the
subroutines as summarized in Table 5.1. This table describes the subroutines and GPAS
files involved with the implementation of the code for modeling asphaltene precipitation.

New keywords were added to allow the input of asphaltene precipitation model data and

related internal calculations of the simulator. These are detailed in Appendix M, along
with further details on the internal variables used. Appendix N presents sample code

201
development procedures and explains the steps taken in the modification of the GPAS

subroutines in order to implement the asphaltene precipitation model.


GPAS was designed to run on parallel computers with dynamic memory
allocation features. The same parallelization concepts were used for implementing the

asphaltene code. The variables are dynamically allocated memory and the grid indexes
are in conformance with the parallelization requirement.

On a multi-processor run, the variables used by the asphaltene precipitation code


must be shared at the domain boundaries with adjacent processors. This was done using
the built-in functions provided by the framework.

5.15.1 Brief Description of the Main Subroutines

The input scalar data for the compositional model and consequently the

asphaltene precipitation model are read in the subroutine XISDAT. This subroutine
cannot be used to read the memory managed arrays. The asphaltene precipitation model

scalar input comprises the flag for turning on the asphaltene precipitation model,

ASPHALTENE, the maximum permeability resistance factor for the oil phase,

RFACTMAX, the maximum mass fraction of adsorbed solid, WASMAX, the mass

density of rock, ROCKMDEN, the natural logarithm of reference fugacity at reference


pressure, FASS, the highest pressure at which asphaltenes are first observed to be coming
out of the solution, this is also called the reference pressure, PSTAR, and molar volume

of the solid phase, VBS. These keywords are specified in an input-data file with the
appropriate units for a typical asphaltene precipitation case. The framework facilitates the

reading of the input using the subroutine GETVAL. Additional details can be found in
the subroutine XISDAT.

202
The asphaltene model scalar inputs, read in the subroutine XISDAT, are stored in

common blocks in the XGENDAT header file. The variables are accessible when
XGENDAT is attached to a specific subroutine as an include-file.
The variables required for the asphaltene precipitation code and related internal

calculations of GPAS are defined in an argument list. Each element of the argument list
contains the pointer of the variables to be passed. This is how the dynamic memory

allocation is used. The pointers are specified in XARRAY and are stored in an include-
file, XARYDAT, using a common statement. For the dynamic memory allocation in the
subroutine XARRAY, the grid element array variables need to have memory allocated by

the framework using the subroutine ALCGEA.

The pointer variables defined in the subroutine XARRAY for the asphaltene

precipitation model are stored in common blocks in the subroutine XARYDAT. The
pointer variables are used in the index argument list in XSTEP and then passed from one

subroutine to another.

The subroutine XSTEP is the main subroutine for the compositional model

(EOSCOMP) which is able to model the asphaltene precipitation. For each Newton

iteration, XSTEP calls all the other subroutines involved with the compositional model
calculations. The asphaltene precipitation model, which incorporates many other

subroutines, is also called from XSTEP.

The subroutine STABLS is the main asphaltene subroutine. The name STABLS
stands for stability test for solid phase subroutine. The output from STABLS is the main
asphaltene flag, IASPR, which indicates whether solid precipitate exists in a gridblock or
not. This subroutine is called from INFLUID0, XWELL and XUPDATE. The

formulation of this subroutine is presented in the section, Stability Test for Solid Phase.
The subroutine XPRINT prints out the solution at one time level.

203
Table 5.1: Summary of code added to GPAS for modeling asphaltene precipitation

Subroutine Filename Functionality

Compositional data; general, widely used data


XGENDAT xgendat.dh

Compositional data; grid-element array


XARYDAT xarydat.h numbers

Allocate compositional model grid-element


XARRAY xarray.df arrays

Memory management routines; changes the


MEMMAN2 memman2.dc dimensions of grid-element arrays for one
block
Main driver for an implicit parallel accurate
IPARS ipars.df reservoir simulator

The main subroutine for the compositional


XSTEP xstep.df model, EOSCOMP, and it calls all the other
subroutines involved with the compositional
model calculations
This routine is related to defining the main
ROCK rock.dh ASPHALTENE flag

Inputs compositional model scalar data; inputs


XISDAT xisdat.df initial scalar data for the compositional model.
Grid-element arrays cannot be referenced in
this routine.
Computes the independent variables for each
PROP xprop.df grid

Computes the properties dependent on


PROPIN xprop.df independent variables for each grid

Computes residuals of all governing equations


RESIDUALS xtrans.df and then picks up the maximum residual from
each type of the governing equations.

204
Generates the Jacobian for the EOS
PREROW rowpw.df compositional model.

Computes the derivatives for the source terms


JSOURCE jsource.df based on user-specified specifications

Computes derivatives related to phase relative


RELDER relderiv.f permeability for two-phase cells

Computes the derivatives of the residuals w.r.t.


JXMASS jmass.f the independent variables in x direction

Computes the derivatives of the residuals w.r.t.


JYMASS jmass.f the independent variables in y direction

Computes the derivatives of the residuals w.r.t.


JZMASS jmaas.f the independent variables in z direction

This routine creates the linear system


JACOBIAN jacobian.df

This routine is directly related to computing the


FLOWLKN jaco2pw.f derivatives of transmissibility terms for
subroutine JACO2
This routine computes derivatives of
JACO2 jaco2pw.f transmissibility terms

Computes derivatives related to Z-factor for


ZDER zderiv.f two-phase cells

This routine computes viscosity of a mixture


LVISC2 vis.f and its derivatives w.r.t. phase composition and
pressure at high pressures
xeosbas.f This routine performs some basic operations
EOSBASIC for row-elimination for two-phase cells

This routine computes derivatives of Z-factor


RODER roderiv.f for two-phase cells

This routine forms Jacobian for row-


JACO1 eos_jaco.f elimination for two-phase cells

205
This routine solves a linear system from 3D
JPETSC3DA xsolver.df cases using the PETSc package

This routine setups the Jacobian for the solver


XSOLVER xsolver.df

This routine is directly related to the


INIT_IDX xsolver.df XSOLVER subroutine for construction of the
Jacobian
This routine in turn calls the XSOLVER
SOLVERS xsolve.df subroutine

206
Figure 5.1: The overall structure of GPAS with the capability of modeling asphaltene
precipitation

207
INFLUID0 Calculation of dependent variables and possible
Using initial Sj and P, calculate j and x asphaltene precipitation at t = 0
This x is considered as the first timestep solution

PROPIN
xn = xn-1
(just once before starting Newton iteration )

PROP Calculation of amount of adsorbed solid and


n permeability resistance factor if IASPR is turned
Using x , calculate dependent variables
ON
Calculation of k, Sj, krj, j

Calculation of possible asphaltene precipitation


XWELL for each well
Calculation of qi

TRANSPORT (material)
RESIDUALS (volume, fugacities,
r r newflash eq, equilibrium eq. )
Calculation of new residuals for asphaltene
Calculation of R(x )

Yes End of Newton Iteration


Newton Convergence
for n+1 timestep
Check
Iteration

JACOBIAN
Set xnew to xold New Jacobian for modeling asphaltene
old
Calculate the new J (x )

SOLVERS
old old New solver for modeling asphaltene
Calculate x from J ( x ) x = R( x )

XDELTA
new old Calculate possible precipitation of
x r = x + x asphaltene using the new solution
new
Using x , calculate j, xij, Sj

Figure 5.2: Flowchart of Newton's method for modeling asphaltene precipitation in


GPAS (Subroutine XSTEP)

208
Chapter 6: Compositional Simulation of Asphaltene Precipitation in
GPAS

6.1 INTRODUCTION

In this chapter, we present several case studies that were performed in order to
test and validate the newly developed code to model the phase behavior, dynamic aspects

and compositional simulation of asphaltene precipitation in GPAS. Numerous


simulations were carried out using GPAS to; first, verify the implementation of the

asphaltene precipitation model including the phase behavior of the solid precipitate and;

second, to illustrate the effect of asphaltene precipitation on the rock properties and the
damage caused due to the adsorption of asphaltenes in porous media. In the next step, a

Generalized Equation-of-state Model compositional reservoir simulator called GEM,

from the Computer Modelling Group Ltd. (CMG Ltd.), was used as the benchmark for

validation and comparison studies. Several test cases were set up and run on both CMG

GEM and GPAS to accomplish this goal. CMG GEM has been tested and compared
against experimental results, hence, it was chosen as the basis of comparison for

validation of the implementation of asphaltene precipitation code into GPAS.

The one-dimensional and two-dimensional compositional simulation cases which


were used for the validation and comparison studies between CMG GEM and GPAS,
along with the properties of the asphaltic reservoir fluid used and parameter selection, are

described in detail in the upcoming sections. For each simulation case, the obtained

simulation results are presented and analyzed. Several sensitivity studies on the
parameters of the asphaltene precipitation model are addressed in this chapter as well.
The sensitivity analyses were performed to illustrate the effect of asphaltene precipitation

209
parameters and to investigate the importance of different factors in various simulation

runs. More specifically, the goal was to study the sensitivity of the results to the
maximum permeability resistance factor, the maximum mass fraction of adsorbed solid
and the molar volume of the solid phase. Sections 6.1 through 6.3 present the results of

three one-dimensional simulation cases, which are GF1, GF3 and GVM5, respectively.
Sections 6.4 and 6.5, which discuss the results of cases GVM10 and GVR8, deal with

two-dimensional simulation cases. Sample input files for compositional simulation of


asphaltene precipitation in CMG GEM and GPAS can be found in Appendix O and
Appendix P, respectively.

6.2 ONE-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION: CASE GF1

Case GF1 is a compositional simulation case for one-dimensional injection of

asphaltic reservoir fluid into a core. This case was set up and run in order to investigate
the possible precipitation of asphaltenes, and more importantly to test and validate the

implementation of the asphaltene precipitation model into GPAS. The effect of

asphaltene precipitation and the damage caused due to this phenomenon are also

illustrated in this section. In addition, sensitivity analysis on the important parameters of

the model is presented. Last but not least, in order to perform the validation study, case
GF1 was also set up and run on CME GEM and the simulation results of GPAS were
compared against the results of the CMG GEM simulator.

The input data for modeling the porous medium is given in Table 6.1. This case,
GF1, was simulated in a Fontainebleau sandstone. This type of rock represents a
homogeneous porous medium, which has a regular grain size and does not have any clay.
This homogeneous porous medium has an initial permeability of 107 md in all directions

and a porosity of 0.131. The initial pressure for this simulation case is 145.038 psi. Two

210
different grid systems were used in case GF1. Tables 6.2 and 6.3 show the grid data for
30-gridblock and 60-gridblock scenarios, respectively. The first scenario which was used
in most of the runs, uses a uniform of 30 1 1 grid arrangement to discretize the
porous medium, while the second scenario uses a finer grid system of 60 1 1 . The

length of each gridblock in x direction is uniform. The properties of water which were
required for setting up this case in GPAS, can be found in Table 6.4. A summary of the
characteristics of the asphaltic reservoir fluid considered is presented in Table 6.5. Based
on these data, which include the asphaltene content for the reservoir fluid considered, and

using CMG WinProp, the equation-of-state model for the asphaltic reservoir fluid and
parameters for the asphaltene precipitation model were developed. WinProp is CMG's

package for modeling the phase behavior and properties of reservoir fluids. The

composition of the modeled fluid is given in Table 6.6, the PVT properties including the
molecular weights are given in Table 6.7, and the Binary Interaction Coefficients
between different components are given in Table 6.8. Numerous calculations were
performed in order to convert the units of the properties obtained from CMG WinProp for

GPAS. The water-oil relative permeability data is given in Table 6.9. This table provides
the water relative permeability and oil relative permeability to water as a function of

water saturation. The liquid-gas relative permeability data is given in Table 6.10. This
table provides the gas relative permeability and oil relative permeability to gas as a

function of gas saturation. Two wells with different constraints were specified in case
GF1. Tables 6.11 and 6.12 describe the data for well specifications used in GPAS for the
30-gridblock and 60-gridblock scenarios, respectively. For both scenarios, the injection

well, which operates under a constant rate, is located at a gridblock with an index of
(1,1,1). The production well, which operates under a constant bottom-hole pressure, is

located in a gridblock with an index of (30,1,1) for the first scenario and at a gridblock

211
with an index of (60,1,1) for the second scenario. The composition of the asphaltic

reservoir fluid being injected is given in Table 6.13. The input parameters for the
asphaltene precipitation model including ln f n*cs , P* and vs which were measured for the

reservoir fluid using CMG WinProp, are presented in Table 6.14. The values used for the
sensitivity studies on the maximum permeability resistance factor and the maximum mass

fraction of adsorbed solid are also given. P* is the onset pressure for precipitation of
asphaltenes for a specific reservoir fluid, ln f n*cs is the reference fugacity at P* and

finally, vs represents the molar volume of the solid phase. A summary of all the

simulation runs of case GF1 that were performed for the comparative and sensitivity
studies is shown in Table 6.15. A total of 700 pore volumes were injected continuously
with a constant injection rate. A constant time-step size was used for the simulation runs

of case GF1.
A schematic representation of the discretized porous media used in case GF1 is

presented in Figure 6.1. The location of the injection and production wells used in case
GF1 is shown in Figure 6.2. The water-oil relative permeability curves are plotted in
Figure 6.3 and the liquid-gas relative permeability curves are plotted in Figure 6.4.

Using Stones first and second models in CMG Builder, the three-phase oil relative

permeabilities for rock type 1 were plotted in Figures 6.5 and 6.6, respectively. A
schematic representation of the fluid-flow pattern in three-dimensional viewpoint is

shown in Figure 6.7 and the one-dimensional fluid-flow vectors are presented in Figure
6.8. The static asphaltene precipitation curve in Figure 6.9, which was obtained from

CMG WinProp, shows the amount of solid precipitate as a function of pressure at a

specific temperature for the fluid considered. The comparison of average pressure as a
function of pore volumes injected, without and with considering the effect of asphaltene

precipitation, is shown in Figure 6.10. The average pressure with asphaltene precipitation

212
is higher than that without asphaltene precipitation. In other words, the average pressure

drops faster when there is no asphaltene precipitation. More over, the precipitation of
asphaltenes causes a reduction of permeability and plugs the pore space, which was
initially available for the movement of the fluid. As shown in Figure 6.11, the pressure
profile at 685 pore volumes of asphaltic reservoir fluid injected was compared against the

case without asphaltene precipitation. For the case with asphaltene precipitation, a very
high pressure around the injection cell can be seen, which is related to the plugging
effect. Further more, this implies that the precipitation of asphaltenes prevents the

pressure from dropping too fast along the porous medium. Figure 6.12 shows the
comparison of oil rate without and with considering the effect of asphaltene precipitation.

As mentioned earlier, the producer operates under a constant bottom-hole pressure


constraint; this will help us to distinguish the rate considering the effect of asphaltene

precipitation from that without asphaltene precipitation. As expected, the oil rate

considering the asphaltene precipitation is lower than that without any asphaltene
precipitation. The presence of a solid precipitate tends to decrease the mobility of the

fluid and thus causes a lower rate. A comparison of bottom-hole pressure for the injection

cell, both without and with a consideration of the effect of asphaltene precipitation is

shown in Figure 6.13. Asphaltene precipitation results into a higher bottom-hole pressure
for the injector or the injection cell.

The first parameter that was chosen for the sensitivity study was the maximum
permeability resistance factor. Figures 6.14 through 6.17 show the sensitivity of the
pressure profile at 685 PV injected to variation of the maximum permeability resistance

factor. This comparison shows that a higher permeability resistance factor, which implies
more plugging of the pores due to precipitation of asphaltenes and also more difficult

movement for the fluid, results in much less pressure drop along the considered medium.

213
Figure 6.18 shows the sensitivity of average pressure to the maximum permeability

resistance factor and compares the results to the case without asphaltene precipitation.

Increasing the permeability resistance factor will increase the average pressure,
proportionally. Figure 6.19 shows the sensitivity of the oil rate to the maximum
permeability resistance factor. Increasing the maximum permeability resistance factor

will decrease the oil rate. Figures 6.20 through 6.23 present the sensitivity of the pressure
profile at 685 PV injected to variation of the maximum mass fraction of adsorbed solid.

This comparison shows that the lowest mass fraction of adsorbed solid results into higher
values for pressure distribution along the considered medium. Figure 6.24 shows the
sensitivity of average pressure to the maximum mass fraction of adsorbed solid.

Increasing the maximum mass fraction of adsorbed solid will decrease the average
pressure.

A sensitivity study on gridblock discretion was performed in order to study the

effect of grid refinement on asphaltene precipitation. Figure 6.25 compares the average
pressure as a function of pore volumes injected with the effect of asphaltene precipitation

between the 30-gridblock and 60-gridblock scenarios, respectively. A finer grid has the
same average pressure. Figure 6.26 compares the oil rate as a function of pore volumes
injected with the effect of asphaltene precipitation between the 30-gridblock and 60-

gridblock scenarios, respectively. A finer grid has the same oil rate. Figure 6.27
compares the pressure profile at 685 pore volumes injected with the effect of asphaltene

precipitation between the 30-gridblock and 60-gridblock scenarios, respectively. As


shown in Figure 6.28 the average pressure result of GPAS, considering the effect of the
asphaltene precipitation, compared well with that of CMG GEM. Finally, Figure 6.29
shows that a good agreement was obtained between GPAS and CMG GEM in terms of

214
oil rate as a function of pore volumes injected with consideration of the effect of

asphaltene precipitation in case GF1.

6.3 ONE-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION: CASE GF3

Case GF3 is a compositional simulation case for one-dimensional injection of


asphaltic reservoir fluid into a core. This case was set up and run in order to investigate

the possible precipitation of asphaltenes, and more importantly to test and validate the
implementation of the asphaltene precipitation model into GPAS. The effect of

asphaltene precipitation and the damage caused due to this phenomenon are illustrated in

this section as well. Sensitivity analysis on the important parameters of the model is also
presented. Last but not least, in order to perform the validation study, case GF3 was also

set up and run on CME GEM and the simulation results of GPAS were compared against

the results of the CMG GEM simulator.

The input data for modeling the porous medium is given in Table 6.16. This case,
GF3, was simulated in a Fontainebleau sandstone. This type of rock represents a
homogeneous porous medium, has a regular grain size and does not have any clay. This

homogeneous porous medium has an initial permeability of 77.4 md in all directions and

a porosity of 0.137. The initial pressure for this simulation case is 145.038 psi. Two

different grid systems were used in case GF3. Tables 6.17 and 6.18 show the grid data
for 30-gridblock and 60-gridblock scenarios, respectively. The first scenario, which was
used in most of the runs, uses a uniform grid arrangement of 30 1 1 to discretize the
porous medium and the second scenario uses a finer grid system of 60 1 1 . The

length of each gridblock in x direction is uniform. The properties of water which were
required for setting up this case in GPAS, can be found in Table 6.19. A summary of the
characteristics of the considered asphaltic reservoir fluid is presented in Table 6.20.

215
Based on these data which include the asphaltene content for the reservoir fluid

considered, and using CMG WinProp, the equation-of-state model for the asphaltic
reservoir fluid and parameters for the asphaltene precipitation model were developed.
WinProp is CMG's package for modeling the phase behavior and properties of reservoir

fluids. The composition of the modeled fluid is given in Table 6.21, the PVT properties
including the molecular weights are given in Table 6.22 and the Binary Interaction
Coefficients between different components are given in Table 6.23. Numerous
calculations were performed in order to convert the units of the properties obtained from

CMG WinProp for GPAS. The water-oil relative permeability data is given in Table
6.24. This table provides the water relative permeability and oil relative permeability to

water as a function of water saturation. The liquid-gas relative permeability data is given

in Table 6.25. This table provides the gas relative permeability and oil relative
permeability to gas as a function of gas saturation. Two wells with different constraints

were specified in case GF3. Tables 6.26 and 6.27 describe the data for well specifications
used in GPAS for the 30-gridblock and 60-gridblock scenarios, respectively. For both

scenarios, the injection well which operates under a constant rate, is located at a
gridblock with an index of (1,1,1). The production well, which operates under a constant

bottom-hole pressure, is located at a gridblock with an index of (30,1,1) for the first

scenario and at a gridblock with an index of (60,1,1) for the second scenario. The
composition of the asphaltic reservoir fluid being injected is given in Table 6.28. The
input parameters for the asphaltene precipitation model including ln f n*cs , P* and vs

which were measured for the reservoir fluid using CMG WinProp, are presented in Table
6.29. The values used for the sensitivity studies on the maximum permeability resistance

factor and the maximum mass fraction of adsorbed solid are also given. P* is the onset
pressure for precipitation of asphaltenes for a specific reservoir fluid, ln f n*cs is the

216
reference fugacity at P* and finally, vs represents the molar volume of the solid phase. A

summary of all the simulation runs of case GF3 that were performed for the comparative

and sensitivity studies is shown in Table 6.30. A total of 80 pore volumes were injected
continuously with a constant injection rate. A constant time-step size was used for the

simulation runs of case GF3.


A schematic representation of the discretized porous media used in case GF3 is
presented in Figure 6.30. The location of the injection and production wells used in case
GF3 is shown in Figure 6.31. The water-oil relative permeability curves are plotted in
Figure 6.32 and the liquid-gas relative permeability curves are plotted in Figure 6.33

Using Stones first and second models in CMG Builder, the three-phase oil relative

permeabilities for rock type 1 were plotted in Figures 6.34 and 6.35, respectively. A
schematic representation of the fluid flow pattern in three-dimensional viewpoint is

shown in Figure 6.36 and the one-dimensional fluid-flow vectors are presented in Figure
6.37. The static asphaltene precipitation curve in Figure 6.38, which was obtained from

CMG WinProp, shows the amount of solid precipitate as a function of pressure at a

specific temperature for the fluid under consideration. The comparison of average
pressure as a function of pore volumes injected, both without and with considering the
effect of asphaltene precipitation, is shown in Figure 6.39. The average pressure with
asphaltene precipitation is higher than that without asphaltene precipitation. In other
words, the average pressure drops faster when there is no asphaltene precipitation. More
over, the precipitation of asphaltenes causes a reduction of permeability and plugs the
pore space, which was initially available for the movement of the fluid. As shown in
Figure 6.40, the pressure profile at 80 pore volumes of asphaltic reservoir fluid injected

was compared against the case without asphaltene precipitation. For the case with
asphaltene precipitation, a very high pressure around the injection cell can be seen which

217
is related to the plugging effect. Further more, this implies that the precipitation of

asphaltenes prevents the pressure from dropping too fast along the porous medium.
Figure 6.41 shows the comparison of the oil rate both without and with considering the

effect of asphaltene precipitation. As mentioned earlier, the producer operates under a

constant bottom-hole pressure constraint; this will help us distinguish the rate considering
the effect of asphaltene precipitation from that without asphaltene precipitation. As
expected, the oil rate considering the asphaltene precipitation is lower than that without

any asphaltene precipitation. The presence of solid precipitate tends to decrease the
mobility of the fluid and thus causes a lower rate. A comparison of bottom-hole pressure

for the injection cell, both without and with considering the effect of asphaltene

precipitation is shown in Figure 6.42. Asphaltene precipitation results in a higher


bottom-hole pressure for the injector or the injection cell.

The first parameter chosen for the sensitivity study was the maximum
permeability resistance factor. Figures 6.43 through 6.46 show the sensitivity of the
pressure profile at 80 PV injected to variation of the maximum permeability resistance

factor. This comparison shows that a higher permeability resistance factor, which implies
more plugging of the pores due to precipitation of asphaltenes and also more difficult

movement for the fluid, results into much less pressure drop along the considered

medium. Figure 6.49 shows the sensitivity of average pressure to the maximum
permeability resistance factor and compares the results to the case with no asphaltene

precipitation. Increasing the permeability resistance factor will increase the average
pressure, proportionally. Figure 6.50 describes the sensitivity of the oil rate to maximum
permeability resistance factor. Increasing the maximum permeability resistance factor

will decrease the oil rate. Figure 6.51 shows the sensitivity of average pressure to the

218
maximum mass fraction of adsorbed solid. Increasing the maximum mass fraction of

adsorbed solid will decrease the average pressure.


A sensitivity study on gridblock discretion was performed in order to study the
effect of grid refinement on asphaltene precipitation. Figure 6.52 compares the average
pressure as a function of pore volumes injected with the effect of asphaltene precipitation

between the 30-gridblock and 60-gridblock scenarios, respectively. A finer grid has the
same average pressure. Figure 6.53 compares the oil rate as a function of pore volumes
injected with the effect of asphaltene precipitation between the 30-gridblock and 60-

gridblock scenarios, respectively. A finer grid has the same oil rate. Figure 6.54
compares the pressure profile at 80 pore volumes injected with the effect of asphaltene

precipitation between the 30-gridblock and 60-gridblock scenarios, respectively. As

shown in Figure 6.55, the average pressure result of GPAS considering the effect of
asphaltene precipitation compared well with that of CMG GEM. Finally, Figure 6.56
shows that a good agreement was obtained between GPAS and CMG GEM in terms of

oil rate as a function of pore volumes injected, considering the effect of asphaltene

precipitation in case GF3.

6.4 ONE-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION: CASE


GVM5

Case GVM5 is a compositional simulation case for one-dimensional injection of


asphaltic reservoir fluid into a core. This case was set up and run in order to investigate

the possible precipitation of asphaltenes and more importantly to test and validate the

implementation of the asphaltene precipitation model into GPAS. The effect of


asphaltene precipitation and the damage caused due to this phenomenon are illustrated in
this section as well. In addition, a sensitivity analysis on the important parameters of the

219
model is presented. Last but not least, in order to perform the validation study, case

GVM5 was also set up and run on CME GEM and the simulation results of GPAS were
compared against the results of the CMG GEM simulator.
The input data for modeling the porous medium is given in Table 6.31. This case,
GVM5, was simulated in a Vosges sandstone. This porous medium has an initial

homogeneous permeability of 29 md in all directions and a porosity of 0.247. The initial


pressure for this simulation case is 145.038 psi. Two different grid systems were used in
case GVM5. Tables 6.32 and 6.33 show the grid data for 30-gridblock and 60-gridblock
scenarios, respectively. The first scenario, which was used in most of the runs, uses a
uniform grid arrangement of 30 1 1 to discretize the porous medium, and the second
scenario uses a finer grid system of 60 1 1 . The length of each gridblock in x

direction is uniform. The properties of water which were required for setting up this case

in GPAS can be found in Table 6.34. A summary of the characteristics of the asphaltic
reservoir fluid considered is presented in Table 6.35. Based on these data, which include
the asphaltene content for the reservoir fluid considered, and using CMG WinProp, the

equation-of-state model for the asphaltic reservoir fluid and parameters for the asphaltene
precipitation model were developed. WinProp is CMG's package for modeling the phase

behavior and properties of reservoir fluids. The composition of the modeled fluid is given

in Table 6.36, the PVT properties including the molecular weights are given in Table
6.37 and the binary interaction coefficients between different components are given in

Table 6.38. Numerous calculations were performed in order to convert the units of the

properties obtained from CMG WinProp to GPAS. The water-oil relative permeability

data is given in Table 6.39. This table provides the water relative permeability and oil
relative permeability to water as a function of water saturation. The liquid-gas relative

permeability data is given in Table 6.40. This table provides the gas relative permeability

220
and oil relative permeability to gas as a function of gas saturation. Two wells with

different constraints were specified in case GVM5. Tables 6.41 and 6.42 give the data for
well specifications used in GPAS for the 30-gridblock and 60-gridblock scenarios,

respectively. For both scenarios, the injection well which operates under a constant rate,
is located at a gridblock with an index of (1,1,1). The production well, which operates
under a constant bottom-hole pressure, is located at a gridblock with an index of (30,1,1)

for the first scenario and at a gridblock with an index of (60,1,1) for the second scenario.
The composition of the asphaltic reservoir fluid being injected is given in Table 6.43.
The input parameters for the asphaltene precipitation model, including ln f n*cs , P* and vs

which were measured for the reservoir fluid using CMG WinProp, are presented in Table
6.44. The values used for the sensitivity studies on the maximum permeability resistance

factor and the maximum mass fraction of adsorbed solid are also given. P* is the onset
pressure for precipitation of asphaltenes for a specific reservoir fluid, ln f n*cs is the

reference fugacity at P* and finally, vs represents the molar volume of the solid phase. A

summary of all the simulation runs of case GVM5 that were performed for the
comparative and sensitivity studies is shown in Table 6.45. A total of 75 pore volumes
were injected continuously with a constant injection rate. A constant time-step size was

used for the simulation runs of case GVM5.


A schematic representation of the discretized porous media used in case GVM5 is

presented in Figure 6.57. The location of the injection and production wells used in case
GVM5 is shown in Figure 6.58. The water-oil relative permeability curves are plotted in
Figure 6.59 and the liquid-gas relative permeability curves are plotted in Figure 6.60.

Using Stones first and second models in CMG Builder, the three-phase oil relative

permeabilities for rock type 1 were plotted in Figures 6.61 and 6.62, respectively. A
schematic representation of the fluid flow pattern in three-dimensional viewpoint is

221
shown in Figure 6.63 and the one-dimensional fluid flow vectors are presented in Figure
6.64. The static asphaltene precipitation curve in Figure 6.65, which was obtained from

CMG WinProp, shows the amount of solid precipitate as a function of pressure at a

specific temperature for the fluid considered. The comparison of average pressure as a
function of pore volumes injected, both without and with considering the effect of
asphaltene precipitation, is shown in Figure 6.66. The average pressure with asphaltene
precipitation is higher than that without asphaltene precipitation. In other words, the

average pressure drops faster when there is no asphaltene precipitation. More over, the
precipitation of asphaltenes causes a reduction of permeability and plugs the pore space

which was initially available for the movement of the fluid. As shown in Figure 6.67, the
pressure profile at 67 pore volumes of asphaltic reservoir fluid injected was compared

against the case without asphaltene precipitation. For the case with asphaltene
precipitation, a very high pressure around the injection cell can be seen, which is related

to the plugging effect. Further more, this implies that the precipitation of asphaltenes

prevents the pressure from dropping quickly along the porous medium. Figure 6.68
shows the comparison of oil rate both without and with considering the effect of

asphaltene precipitation. As mentioned earlier, the producer operates under a constant


bottom-hole pressure constraint; this will help us distinguish the rate considering the

effect of asphaltene precipitation from that without asphaltene precipitation. As expected,


the oil rate considering the asphaltene precipitation is lower than that without any
asphaltene precipitation. The presence of solid precipitate tends to decrease the mobility
of the fluid and thus causes a lower rate. A comparison of bottom-hole pressure for the

injection cell, both without and with considering the effect of asphaltene precipitation is

shown in Figure 6.69. Asphaltene precipitation results in a higher bottom-hole pressure


for the injector or the injection cell.

222
The first parameter that was chosen for the sensitivity study was the maximum

permeability resistance factor. Figures 6.70 through 6.75 show the sensitivity of the
pressure profile at 67 PV injected to variation of the maximum permeability resistance

factor. This comparison shows that a higher permeability resistance factor, which implies
more plugging of the pores due to precipitation of asphaltenes and also more difficult
movement for the fluid, results into much less pressure drop along the considered

medium. Figure 6.76 shows the sensitivity of average pressure to the maximum
permeability resistance factor and compares the results with the case with no asphaltene

precipitation. Increasing the permeability resistance factor will increase the average
pressure, proportionally. Figure 6.77 describes the sensitivity of the oil rate to the
maximum permeability resistance factor. Increasing the maximum permeability

resistance factor will decrease the oil rate. Figures 6.78 through 6.81 present the
sensitivity of the pressure profile at 67 PV injected to varying the maximum mass

fraction of adsorbed solid. This comparison shows that the lowest mass fraction of
adsorbed solid, results into higher values for pressure distribution along the considered

medium. Figure 6.82 shows the sensitivity of average pressure to the maximum mass
fraction of adsorbed solid. Increasing the maximum mass fraction of adsorbed solid will

decrease the average pressure.


A sensitivity study on gridblock discretion was performed in order to study the

effect of grid refinement on asphaltene precipitation. Figure 6.83 compares the average
pressure as a function of pore volumes injected with the effect of asphaltene precipitation

between the 30-gridblock and 60-gridblock scenarios, respectively. A finer grid has the
same average pressure. Figure 6.84 compares the oil rate as a function of pore volumes
injected with the effect of asphaltene precipitation between the 30-gridblock and 60-

gridblock scenarios, respectively. A finer grid has the same oil rate. Figure 6.85

223
compares the pressure profile at 67 pore volumes injected with the effect of asphaltene

precipitation between the 30-gridblock and 60-gridblock scenarios, respectively. As


shown in Figure 6.86 the average pressure result of GPAS considering the effect of
asphaltene precipitation compared well with that of CMG GEM. Finally, Figure 6.87
shows that a reasonable agreement was obtained between GPAS and CMG GEM in terms

of oil rate as a function of pore volumes injected with considering the effect of asphaltene
precipitation in case GVM5.

6.5 TWO-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION: CASE


GVM10

Case GVM10 is a compositional simulation case for two-dimensional injection of

asphaltic reservoir fluid into a porous medium. This case was set up and run in order to

investigate the possible precipitation of asphaltenes, and more importantly to test and
validate the implementation of the asphaltene precipitation model into GPAS. The effect

of asphaltene precipitation and the damage caused due to this phenomenon are illustrated

in this section as well. In addition, a sensitivity analysis of the important parameters of


the model is presented. Last but not least, in order to perform the validation study, case

GVM10 was also set up and run on CME GEM and the simulation results of GPAS were

compared against the results of the CMG GEM simulator.

The input data for modeling the porous medium is given in Table 6.46. This case,
GVM10, was simulated in a Vosges sandstone. This porous medium has an initial

homogeneous permeability of 12.2 md in all directions and a porosity of 0.243. The

initial pressure for this simulation case is 145.038 psi. Table 6.47 shows the grid data
used for modeling the porous medium. Case GVM10 uses a uniform grid arrangement of
30 10 1 to discretize the porous medium. The length of each gridblock in x

224
direction and y direction is uniform. The properties of water which were required for

setting up this case in GPAS can be found in Table 6.48. A summary of the
characteristics of the asphaltic reservoir being considered fluid is presented in Table
6.49. Based on these data which include the asphaltene content for the reservoir fluid

considered and using CMG WinProp, the equation-of-state model for the asphaltic

reservoir fluid and parameters for the asphaltene precipitation model were developed.
WinProp is CMG's package for modeling the phase behavior and properties of reservoir
fluids. The composition of the modeled fluid is given in Table 6.50, the PVT properties
including the molecular weights are given in Table 6.51 and the binary interaction
coefficients between different components are given in Table 6.52. Numerous
calculations were performed in order to convert the units of the properties obtained from

CMG WinProp to GPAS. The water-oil relative permeability data is given in Table 6.53.
This table provides the water relative permeability and oil relative permeability to water

as a function of water saturation. The liquid-gas relative permeability data are given in
Table 6.54. This table provides the gas relative permeability and oil relative permeability

to gas as a function of gas saturation. Two wells with different constraints were specified

in case GVM10. Table 6.55 describes the data for well specifications used in GPAS. The
injection well, which operates under a constant rate, is located at a corner gridblock with

an index of (1,1,1). The production well which operates under a constant bottom-hole
pressure, is located at an opposite corner gridblock with an index of (30,10,1). The

composition of the asphaltic reservoir fluid being injected is given in Table 6.56. The
input parameters for the asphaltene precipitation model including ln f n*cs , P* and vs

which were measured for the reservoir fluid using CMG WinProp, are presented in Table
6.57. The values used for the sensitivity studies on the maximum permeability resistance

factor and the maximum mass fraction of adsorbed solid are also given. P* is the onset

225
pressure for precipitation of asphaltenes for a specific reservoir fluid, ln f n*cs is the

reference fugacity at P* and finally, vs represents the molar volume of the solid phase. A

summary of all the simulation runs of case GVM10 that were performed for the

comparative and sensitivity studies is shown in Table 6.58. A total of 75 pore volumes
were injected continuously with a constant injection rate. A constant time-step size was

used for the simulation runs of case GVM10.


A schematic representation of the discretized porous media used in case GVM10
is presented in Figure 6.88. The location of the injection and production wells used in
case GVM10 is shown in Figure 6.89. The water-oil relative permeability curves are
plotted in Figure 6.90 and the liquid-gas relative permeability curves are plotted in
Figure 6.91. Using Stones first and second models in CMG Builder, the three-phase oil

relative permeabilities for rock type 1 were plotted in Figures 6.92 and 6.93,
respectively. A schematic representation of the fluid flow pattern in three-dimensional
viewpoint is shown in Figure 6.94 and the one-dimensional fluid flow vectors are
presented in Figure 6.95. The static asphaltene precipitation curve in Figure 6.96, which
was obtained from CMG WinProp, shows the amount of solid precipitate as a function of
pressure at a specific temperature for the fluid considered. The comparison of average
pressure as a function of pore volumes injected, both without and with considering the

effect of asphaltene precipitation, is shown in Figure 6.97. The average pressure with
asphaltene precipitation is higher than that without asphaltene precipitation. In other
words, the average pressure drops faster when there is no asphaltene precipitation. More

over, the precipitation of asphaltenes causes a reduction of permeability and plugs the
pore space which was initially available for the movement of the fluid. As shown in
Figure 6.98, the pressure profile at 68 pore volumes of asphaltic reservoir fluid injected

was compared against the case without asphaltene precipitation. For the case with

226
asphaltene precipitation, a very high pressure around the injection cell can be seen which

is related to the plugging effect. Further more, this implies that the precipitation of
asphaltenes prevents the pressure from dropping quickly along the porous medium.
Figure 6.99 shows the comparison of oil rate both without and with considering the

effect of asphaltene precipitation. As mentioned earlier, the producer operates under a

constant bottom-hole pressure constraint; this will help us distinguish the rate considering
the effect of asphaltene precipitation from that without asphaltene precipitation. As
expected, the oil rate with considering the asphaltene precipitation is lower than that

without any asphaltene precipitation. The presence of solid precipitate tends to decrease
the mobility of the fluid and thus causes a lower rate. A comparison of bottom-hole

pressure for the injection cell, both without and with considering the effect of asphaltene

precipitation, is shown in Figure 6.100. Asphaltene precipitation results into a higher


bottom-hole pressure for the injector or the injection cell.

The first parameter that was chosen for the sensitivity study was the maximum
permeability resistance factor. Figures 6.101 through 6.104 show the sensitivity of the
pressure profile at 68 PV injected to variation of the maximum permeability resistance

factor. This comparison shows that a higher permeability resistance factor, which implies
more plugging of the pores due to precipitation of asphaltenes and also more difficult

movement for the fluid, results in much less pressure drop throughout the considered
medium. Figure 6.105 shows the sensitivity of average pressure to the maximum
permeability resistance factor and compares the results to the case with no asphaltene

precipitation. Increasing the permeability resistance factor will increase the average
pressure, proportionally. Figure 6.106 describes the sensitivity of the oil rate to the
maximum permeability resistance factor. Increasing the maximum permeability

resistance factor will decrease the oil rate. Figure 6.107 through 6.110 present the

227
sensitivity of the pressure profile at 68 PV injected to variation of the maximum mass

fraction of adsorbed solid. This comparison shows that the lowest mass fraction of
adsorbed solid results in higher values for pressure distribution throughout the considered
medium. Figure 6.111 shows the sensitivity of average pressure to the maximum mass
fraction of adsorbed solid. Increasing the maximum mass fraction of adsorbed solid will

decrease the average pressure. Figure 6.112 describes the sensitivity of injector bottom-
hole pressure to the maximum permeability resistance factor. A lower maximum mass

fraction of adsorbed solid will have a higher bottom-hole pressure for the injection cell.
Figures 6.113 through 6.115 present the sensitivity of the pressure profile at 68 PV

injected to varying the molar volume of the solid phase. This comparison shows that a

higher solid molar volume results in higher values for pressure distribution throughout
the considered medium. Figure 6.116 shows the sensitivity of average pressure to the
molar volume of the solid phase. Increasing the solid molar volume will increase the

average pressure, proportionally. Figure 6.117 describes the sensitivity of the oil rate to
the molar volume of the solid phase. Increasing the solid molar volume will decrease the

oil rate. Figure 6.118 shows the sensitivity of injector bottom-hole pressure to the molar
volume of the solid phase. A higher solid molar volume will have a higher bottom-hole

pressure for the injection cell. As shown in Figure 6.119, the average pressure result of
GPAS with considering the effect of asphaltene precipitation compared well with that of

CMG GEM. Figure 6.120 shows that a good agreement was obtained between GPAS
and CMG GEM in terms of oil rate as a function of pore volumes injected considering the

effect of asphaltene precipitation. Finally, the injector bottom-hole pressure obtained


from GPAS is compared with that obtained from CMG GEM in Figure 6.121. A good
agreement was achieved for case GVM10.

228
6.6 TWO-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION: CASE
GVR8

Case GVR8 is a compositional simulation case for two-dimensional injection of


asphaltic reservoir fluid into a porous medium. This case was set up and run in order to

investigate the possible precipitation of asphaltenes, and more importantly to test and
validate the implementation of the asphaltene precipitation model into GPAS. The effect
of asphaltene precipitation and the damage caused due to this phenomenon are also

illustrated in this section. In addition, a sensitivity analysis of the important parameters of


the model is presented. Last but not least, in order to perform the validation study, case

GVR8 was also set up and run on CME GEM and the simulation results of GPAS were

compared against the results of the CMG GEM simulator.

The input data for modeling the porous medium are given in Table 6.59. This
case, GVR8, was simulated in a Vosges sandstone. This porous medium has an initial
homogeneous permeability of 15.2 md in all directions and a porosity of 0.226. The

initial pressure for this simulation case is 145.038 psi. Table 6.60 shows the grid data
used for modeling the porous medium. Case GVR8 uses a uniform grid arrangement of
30 10 1 to discretize the porous medium. The length of each gridblock in x

direction and y direction is uniform. The properties of water which were required for

setting up this case in GPAS can be found in Table 6.61. A summary of the
characteristics of the considered asphaltic reservoir fluid is presented in Table 6.62.
Based on these data which include the asphaltene content for the reservoir fluid
considered and using CMG WinProp, the equation-of-state model for the asphaltic
reservoir fluid and parameters for the asphaltene precipitation model were developed.

WinProp is CMG's package for modeling the phase behavior and properties of reservoir
fluids. The composition of the modeled fluid is given in Table 6.63, the PVT properties

229
including the molecular weights are given in Table 6.64 and the Binary Interaction
Coefficients between different components are given in Table 6.65. Numerous
calculations were performed in order to convert the units of the properties obtained from

CMG WinProp to GPAS. The water-oil relative permeability data is given in Table 6.66.
This table provides the water relative permeability and oil relative permeability to water

as a function of water saturation. The liquid-gas relative permeability data is given in


Table 6.67. This table provides the gas relative permeability and oil relative permeability

to gas as a function of gas saturation. Two wells with different constraints were specified

in case GVR8. Table 6.68 describes the data for well specifications used in GPAS. The
injection well, which operates under a constant rate, is located at a corner gridblock with

an index of (1,1,1). The production well, which operates under a constant bottom-hole
pressure, is located at an opposite corner gridblock with an index of (30,10,1). The

composition of the asphaltic reservoir fluid being injected is given in Table 6.69. The
input parameters for the asphaltene precipitation model including ln f n*cs , P* and vs

which were measured for the reservoir fluid using CMG WinProp, are presented in Table
6.70. The values used for the sensitivity studies on the maximum permeability resistance

factor and the maximum mass fraction of adsorbed solid are also given. P* is the onset
pressure for precipitation of asphaltenes for a specific reservoir fluid, ln f n*cs is the

reference fugacity at P* and finally, vs represents the molar volume of the solid phase. A

summary of all the simulation runs of case GVR8 that were performed for the

comparative and sensitivity studies is shown in Table 6.71. A total of 85 pore volumes
were injected continuously with a constant injection rate. A constant time-step size was

used for the simulation runs of case GVR8.


A schematic representation of the discretized porous media used in case GVR8 is

presented in Figure 6.122. The location of the injection and production wells used in case

230
GVR8 is shown in Figure 6.123. The water-oil relative permeability curves are plotted in
Figure 6.124 and the liquid-gas relative permeability curves are plotted in Figure 6.125.

Using Stones first and second models in CMG Builder, the three-phase oil relative

permeabilities for rock type 1 were plotted in Figure 6.126 and Figure 6.127
respectively. A schematic representation of the fluid flow pattern in three-dimensional
viewpoint is shown in Figure 6.128 and the one-dimensional fluid flow vectors are
presented in Figure 6.129. The static asphaltene precipitation curve in Figure 6.130,
which was obtained from CMG WinProp, shows the amount of solid precipitate as a

function of pressure at a specific temperature for the fluid being considered. The
comparison of average pressure as a function of pore volumes injected, both without and

with considering the effect of asphaltene precipitation, is shown in Figure 6.131. The
average pressure with asphaltene precipitation is higher than that without asphaltene

precipitation. In other words, the average pressure drops faster when there is no
asphaltene precipitation. More over, the precipitation of asphaltenes causes a reduction of

permeability and plugs the pore space which was initially available for the movement of

the fluid. As shown in Figure 6.132, the pressure profile at 73 pore volumes of asphaltic
reservoir fluid injected was compared against the case without asphaltene precipitation.

For the case with asphaltene precipitation, a very high pressure around the injection cell
can be seen which is related to the plugging effect. Further more, this implies that the

precipitation of asphaltenes prevents the pressure from dropping quickly along the porous
medium. Figure 6.133 shows the comparison of oil rate both without and with
considering the effect of asphaltene precipitation. As mentioned earlier, the producer

operates under a constant bottom-hole pressure constraint; this will help us distinguish
the rate considering the effect of asphaltene precipitation from that without asphaltene

precipitation. As expected, the oil rate with considering the asphaltene precipitation is

231
lower than that without any asphaltene precipitation. The presence of solid precipitate

tends to decrease the mobility of the fluid and thus causes a lower rate. A comparison of
bottom-hole pressure for the injection cell, both without and with considering the effect
of asphaltene precipitation is shown in Figure 6.134. Asphaltene precipitation results into
a higher bottom-hole pressure for the injector or the injection cell.

The first parameter that was chosen for the sensitivity study was the maximum
permeability resistance factor. Figures 6.135 through 6.139 show the sensitivity of the
pressure profile at 73 PV injected to variation of the maximum permeability resistance

factor. This comparison shows that a higher permeability resistance factor, which implies
more plugging of the pores due to precipitation of asphaltenes and also more difficult

movement for the fluid, results into much less pressure drop throughout the considered

medium. Figure 6.139 shows the sensitivity of average pressure to the maximum
permeability resistance factor and compares the results to the case with no asphaltene

precipitation. Increasing the permeability resistance factor will increase the average
pressure, proportionally. Figure 6.140 describes the sensitivity of the oil rate to the
maximum permeability resistance factor. Increasing the maximum permeability

resistance factor will decrease the oil rate. Figures 6.141 through 6.144 present the
sensitivity of the pressure profile at 73 PV injected to variation of the maximum mass

fraction of adsorbed solid. This comparison shows that the lowest mass fraction of
adsorbed solid results in higher values for pressure distribution throughout the considered

medium. Figure 6.145 shows the sensitivity of average pressure to the maximum mass
fraction of adsorbed solid. Increasing the maximum mass fraction of adsorbed solid will

decrease the average pressure. Figure 6.146 describes the sensitivity of injector bottom-
hole pressure to the maximum permeability resistance factor. A lower maximum mass

fraction of adsorbed solid will have a higher bottom-hole pressure for the injection cell.

232
Figures 6.147 through 6.149 present the sensitivity of the pressure profile at 73 PV

injected to variation of the molar volume of the solid phase. This comparison shows that

a higher solid molar volume results into higher values for pressure distribution
throughout the considered medium. Figure 6.150 shows the sensitivity of average
pressure to molar volume of the solid phase. Increasing the solid molar volume will

increase the average pressure, proportionally. Figure 6.151 describes the sensitivity of
the oil rate to the molar volume of the solid phase. Increasing the solid molar volume will

decrease the oil rate. Figure 6.152 shows the sensitivity of injector bottom-hole pressure
to the molar volume of the solid phase. A higher solid molar volume will have a higher

bottom-hole pressure for the injection cell. As shown in Figure 6.153, the average
pressure result of GPAS with considering the effect of asphaltene precipitation compared

well with that of CMG GEM. Figure 6.154 shows that a good agreement was obtained
between GPAS and CMG GEM in terms of oil rate as a function of pore volumes injected

considering the effect of asphaltene precipitation. Finally, the injector bottom-hole


pressure obtained from GPAS is compared with that obtained from CMG GEM in Figure
6.155. A good agreement was achieved for case GVR8.

6.7 THREE-DIMENSIONAL MODELING OF ASPHALTENE PRECIPITATION UNDER


WATERFLOODING

A waterflooding case was set up to verify the three-dimensional option of GPAS


for compositional simulation of asphaltene precipitation. A sensitivity analysis on one of

the most important parameters of the model is presented. This simulation case deals with

waterflooding in a quarter of a five spot. The input data for modeling the reservoir is
given in Table 6.72. This homogeneous reservoir has an initial permeability of 15.2 md
in all directions and a porosity of 0.226. The initial reservoir pressure is 5200 psi. Table

233
6.73 shows the grid data used for modeling the porous medium. The waterflood case uses
a uniform grid arrangement of 7 7 3 to discretize the porous medium. The length of

each gridblock in x and y directions is a uniform 80 ft. The 100-ft reservoir was modeled
using 3 vertical layers of 20, 30, and 50 feet thickness, respectively. A summary of the

characteristics of the considered asphaltic reservoir fluid is presented in Table 6.74.


Based on this data, which includes the asphaltene content for the reservoir fluid

considered and using CMG WinProp, the equation-of-state model for the asphaltic
reservoir fluid and parameters for the asphaltene precipitation model were developed.

WinProp is CMG's package for modeling the phase behavior and properties of reservoir

fluids. The composition of the modeled reservoir fluid is given in Table 6.75; the PVT
properties including the molecular weights are given in Table 6.76; and the Binary
Interaction Coefficients between different components are given in Table 6.77.
Numerous calculations were performed in order to convert the units of the properties

obtained from CMG WinProp to GPAS. The data given in Table 6.78 provides the water
relative permeability and oil relative permeability to water as a function of water

saturation. The data in Table 6.79 provides the gas relative permeability and oil relative
permeability to gas as a function of gas saturation. Two production and injection wells

with different constraints were specified. Table 6.80 describes the data for well
specifications used. The injection well, which operates under a constant rate, is located at

a corner gridblock with an index of (1,1,1). The production well, which operates under a
constant bottom-hole pressure, is located at the opposite corner of the reservoir. The

properties of water which were required for setting up the waterflood are listed in Table
6.81. The input parameters for the asphaltene precipitation model, including ln f n*cs , P* ,

and vs , which were measured for the reservoir fluid using CMG WinProp, are presented

in Table 6.82. P* is the onset pressure for precipitation of asphaltenes for a specific

234
reservoir fluid; ln f n*cs is the reference fugacity at P* ; and vs represents the molar volume

of the solid phase. A constant time-step size was used for the waterflood simulation. A

schematic representation of the discretized porous media is presented in Figure 6.156.


The sensitivity of average reservoir pressure to the maximum permeability resistance

factor is shown in Figure 6.157. Increasing the permeability resistance factor will
increase the average reservoir pressure proportionally. Figure 6.158 describes the
sensitivity of the oil production rate to the maximum permeability resistance factor.

Increasing the maximum permeability resistance factor will decrease the oil rate. With
presenting the results of different cases in Sections 6.1 through 6.7, the verification of the

one-dimensional, two-dimensional and three-dimensional modeling options of GPAS is

completed.

235
Table 6.1: Data for modeling the porous medium (Case GF1)

Property Value Unit

Type of rock Fontainebleau Sandstone -


Length 6 cm
Width 2.3 cm
Thickness 2.3 cm
Permeability in x direction 107.0 md
Permeability in y direction 107.0 md
Permeability in z direction 107.0 md
Porosity 13.1 %
Initial pressure 145.038 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.2: Grid data for the 30-gridblock scenario (Case GF1)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0065616798 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 30 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 30 -

236
Table 6.3: Grid data for the 60-gridblock scenario (Case GF1)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0032808399 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 60 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 60 -

Table 6.4: Properties of water (Case GF1)

Property Value Unit

Initial water saturation 0.0000001 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

237
Table 6.5: Characteristics of fluid considered (Case GF1)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.6: Modeled fluid composition (Case GF1)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

238
Table 6.7: PVT properties for the modeled fluid (Case GF1)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

239
Table 6.8: Binary Interaction Coefficients between different components (Case GF1)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.9: Water-oil relative permeability table (Case GF1)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.10: Liquid-gas relative permeability table (Case GF1)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

240
Table 6.11: Well specifications for the 30-gridblock scenario (Case GF1)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.0032808399 ft
x-location of well interval bottoms 0.0032808399 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.007548 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 30,1,1 -
x-location of well interval tops 0.1935695541 ft
x-location of well interval bottoms 0.1935695541 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

241
Table 6.12: Well specifications for the 60-gridblock scenario (Case GF1)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.00164042 ft
x-location of well interval bottoms 0.00164042 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.007548 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 60,1,1 -
x-location of well interval tops 0.195209974 ft
x-location of well interval bottoms 0.195209974 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

242
Table 6.13: Injected fluid composition (Case GF1)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
9 Water 0.0000000
Total - 1.0000000

Table 6.14: Input parameters for the asphaltene precipitation model (Case GF1)

Parameter Value Unit

R f ,max 2, 3, 4, 5, 6 -
w as,max .0005, .00097, .001, .0015, .002 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 14.431 ft 3 /lbmol

243
Table 6.15: Summary of runs made for sensitivity and comparative studies (Case GF1)

Run Simulator Case Rock Perm. Porosity Nx Ny Nz NB R f ,max w as,max R ln f n*cs P* vs Qinj
3 3
No. type (md) (%) (lb/ft ) (atm) (psia) (litres/gmol) (cm / h)
1 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 - - - - - - 50
2 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 50
3 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 2 0.0005 165.43 -25.2052 7251.89 0.9 50
4 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 3 0.0005 165.43 -25.2052 7251.89 0.9 50
5 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 4 0.0005 165.43 -25.2052 7251.89 0.9 50
6 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 50

244
7 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0020 165.43 -25.2052 7251.89 0.9 50
8 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0015 165.43 -25.2052 7251.89 0.9 50
9 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0010 165.43 -25.2052 7251.89 0.9 50
10 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 50
11 GPAS GF1 Fontainbleau 107 13.1 60 1 1 60 5 0.0005 165.43 -25.2052 7251.89 0.9 50
12 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 50
13 CMG GEM GF1 Fontainbleau 107 13.1 30 1 1 30 - - - - - - 50
14 CMG GEM GF1 Fontainbleau 107 13.1 30 1 1 30 6 0.00097 165.43 -25.2052 7251.89 0.9 50
15 GPAS GF1 Fontainbleau 107 13.1 30 1 1 30 6 0.00097 165.43 -25.2052 7251.89 0.9 50
Table 6.16: Data for modeling the porous medium (Case GF3)

Property Value Unit

Type of rock Fontainebleau Sandstone -


Length 6 cm
Width 2.3 cm
Thickness 2.3 cm
Permeability in x direction 77.4 md
Permeability in y direction 77.4 md
Permeability in z direction 77.4 md
Porosity 13.7 %
Initial pressure 145.038 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.17: Grid data for the 30-gridblock scenario (Case GF3)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0065616798 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 30 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 30 -

245
Table 6.18: Grid data for the 60-gridblock scenario (Case GF3)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0032808399 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 60 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 60 -

Table 6.19: Properties of water (Case GF3)

Property Value Unit

Initial water saturation 0.0000001 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

246
Table 6.20: Characteristics of fluid considered (Case GF3)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.21: Modeled fluid composition (Case GF3)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

247
Table 6.22: PVT properties for the modeled fluid (Case GF3)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

248
Table 6.23: Binary Interaction Coefficients between different components (Case GF3)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.24: Water-oil relative permeability table (Case GF3)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.25: Liquid-gas relative permeability table (Case GF3)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

249
Table 6.26: Well specifications for the 30-gridblock scenario (Case GF3)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.0032808399 ft
x-location of well interval bottoms 0.0032808399 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 30,1,1 -
x-location of well interval tops 0.1935695541 ft
x-location of well interval bottoms 0.1935695541 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

250
Table 6.27: Well specifications for the 60-gridblock scenario (Case GF3)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.00164042 ft
x-location of well interval bottoms 0.00164042 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 60,1,1 -
x-location of well interval tops 0.195209974 ft
x-location of well interval bottoms 0.195209974 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

251
Table 6.28: Injected fluid composition (Case GF3)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
9 Water 0.0000000
Total - 1.0000000

Table 6.29: Input parameters for the asphaltene precipitation model (Case GF3)

Parameter Value Unit

R f ,max 2, 4, 5, 6, 8, 10 -
w as,max .00018, .0005, 001, .0015, .002 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 14.431 ft 3 /lbmol

252
Table 6.30: Summary of runs made for sensitivity and comparative studies (Case GF3)

Run Simulator Case Rock Perm. Porosity Nx Ny Nz NB R f ,max w as,max R ln f n*cs P* vs Qinj
3 3
No. type (md) (%) (lb/ft ) (atm) (psia) (litres/gmol) (cm / h)
1 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 - - - - - - 10
2 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
3 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 2 0.0005 165.43 -25.2052 7251.89 0.9 10
4 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 4 0.0005 165.43 -25.2052 7251.89 0.9 10
5 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
6 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 6 0.0005 165.43 -25.2052 7251.89 0.9 10
7 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 8 0.0005 165.43 -25.2052 7251.89 0.9 10

253
8 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 10 0.0005 165.43 -25.2052 7251.89 0.9 10
9 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0020 165.43 -25.2052 7251.89 0.9 10
10 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0015 165.43 -25.2052 7251.89 0.9 10
11 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0010 165.43 -25.2052 7251.89 0.9 10
12 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
13 GPAS GF3 Fontainbleau 77.4 13.7 60 1 1 60 5 0.0005 165.43 -25.2052 7251.89 0.9 10
14 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
15 CMG GEM GF3 Fontainbleau 77.4 13.7 30 1 1 30 - - - - - - 10
16 CMG GEM GF3 Fontainbleau 77.4 13.7 30 1 1 30 2 0.00018 165.43 -25.2052 7251.89 0.9 10
17 GPAS GF3 Fontainbleau 77.4 13.7 30 1 1 30 2 0.00018 165.43 -25.2052 7251.89 0.9 10
Table 6.31: Data for modeling porous medium (Case GVM5)

Property Value Unit

Type of rock Vosges Sandstone -


Length 6 cm
Width 2.3 cm
Thickness 2.3 cm
Permeability in x direction 29.0 md
Permeability in y direction 29.0 md
Permeability in z direction 29.0 md
Porosity 24.7 %
Initial pressure 145.038 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.32: Grid data for the 30-gridblock scenario (Case GVM5)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0065616798 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 30 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 30 -

254
Table 6.33: Grid data for the 60-gridblock scenario (Case GVM5)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0032808399 ft
Size of gridblocks in y direction 0.0668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 60 -
No. of gridblocks in y direction 1 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 60 -

Table 6.34: Properties of water (Case GVM5)

Property Value Unit

Initial water saturation 0.0000001 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

255
Table 6.35: Characteristics of fluid considered (Case GVM5)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.36: Modeled fluid composition (Case GVM5)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

256
Table 6.37: PVT properties for the modeled fluid (Case GVM5)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

257
Table 6.38: Binary Interaction Coefficients between components (Case GVM5)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.39: Water-oil relative permeability table (Case GVM5)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.40: Liquid-gas relative permeability table (Case GVM5)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

258
Table 6.41: Well specifications for the 30-gridblock scenario (Case GVM5)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.0032808399 ft
x-location of well interval bottoms 0.0032808399 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 30,1,1 -
x-location of well interval tops 0.1935695541 ft
x-location of well interval bottoms 0.1935695541 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

259
Table 6.42: Well specifications for the 60-gridblock scenario (Case GVM5)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.00164042 ft
x-location of well interval bottoms 0.00164042 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 60,1,1 -
x-location of well interval tops 0.195209974 ft
x-location of well interval bottoms 0.195209974 ft
y-location of well interval tops 0.0334370407 ft
y-location of well interval bottoms 0.0334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

260
Table 6.43: Injected fluid composition (Case GVM5)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
9 Water 0.0000000
Total - 1.0000000

Table 6.44: Input parameters for the asphaltene precipitation model (Case GVM5)

Parameter Value Unit

R f ,max 2, 4, 5, 6, 8, 10 -
w as,max .00038, .00050, .001, .0015, .002 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 14.431 ft 3 /lbmol

261
Table 6.45: Summary of runs for sensitivity and comparative studies (Case GVM5)

Run Simulator Case Rock Perm. Porosity Nx Ny Nz NB R f ,max w as,max R ln f n*cs P* vs Qinj
3 3
No. type (md) (%) (lb/ft ) (atm) (psia) (litres/gmol) (cm / h)
1 GPAS GVM5 Vosges 29 24.7 30 1 1 30 - - - - - - 10
2 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
3 GPAS GVM5 Vosges 29 24.7 30 1 1 30 2 0.0005 165.43 -25.2052 7251.89 0.9 10
4 GPAS GVM5 Vosges 29 24.7 30 1 1 30 4 0.0005 165.43 -25.2052 7251.89 0.9 10
5 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
6 GPAS GVM5 Vosges 29 24.7 30 1 1 30 6 0.0005 165.43 -25.2052 7251.89 0.9 10
7 GPAS GVM5 Vosges 29 24.7 30 1 1 30 8 0.0005 165.43 -25.2052 7251.89 0.9 10

262
8 GPAS GVM5 Vosges 29 24.7 30 1 1 30 10 0.0005 165.43 -25.2052 7251.89 0.9 10
9 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
10 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0010 165.43 -25.2052 7251.89 0.9 10
11 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0015 165.43 -25.2052 7251.89 0.9 10
12 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0020 165.43 -25.2052 7251.89 0.9 10
13 GPAS GVM5 Vosges 29 24.7 60 1 1 60 5 0.0005 165.43 -25.2052 7251.89 0.9 10
14 GPAS GVM5 Vosges 29 24.7 30 1 1 30 5 0.0005 165.43 -25.2052 7251.89 0.9 10
15 CMG GEM GVM5 Vosges 29 24.7 30 1 1 30 - - - - - - 10
16 CMG GEM GVM5 Vosges 29 24.7 30 1 1 30 2 0.00038 165.43 -25.2052 7251.89 0.9 10
17 GPAS GVM5 Vosges 29 24.7 30 1 1 30 2 0.00038 165.43 -25.2052 7251.89 0.9 10
Table 6.46: Data for modeling the porous medium (Case GVM10)

Property Value Unit

Type of rock Vosges Sandstone -


Length 6 cm
Width 2.3 cm
Thickness 2.3 cm
Permeability in x direction 12.2 md
Permeability in y direction 12.2 md
Permeability in z direction 12.2 md
Porosity 24.3 %
Initial pressure 145.038 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.47: Grid system used (Case GVM10)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0065616798 ft
Size of gridblocks in y direction 0.00668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 30 -
No. of gridblocks in y direction 10 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 300 -

263
Table 6.48: Properties of water (Case GVM10)

Property Value Unit

Initial water saturation 0.0000001 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

264
Table 6.49: Characteristics of fluid considered (Case GVM10)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.50: Modeled fluid composition (Case GVM10)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

265
Table 6.51: PVT properties for the modeled fluid (Case GVM10)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

266
Table 6.52: Binary Interaction Coefficients between components (Case GVM10)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.53: Water-oil relative permeability table (Case GVM10)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.54: Liquid-gas relative permeability table (Case GVM10)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

267
Table 6.55: Well specifications (Case GVM10)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.0032808399 ft
x-location of well interval bottoms 0.0032808399 ft
y-location of well interval tops 0.00334370407 ft
y-location of well interval bottoms 0.00334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 30,10,1 -
x-location of well interval tops 0.1935695541 ft
x-location of well interval bottoms 0.1935695541 ft
y-location of well interval tops 0.06353037733 ft
y-location of well interval bottoms 0.06353037733 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

268
Table 6.56: Injected fluid composition (Case GVM10)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
9 Water 0.0000000
Total - 1.0000000

Table 6.57: Input parameters for the asphaltene precipitation model (Case GVM10)

Parameter Value Unit

R f ,max 2, 3, 4, 5 -
w as,max .00045, .0005, .0010, .0013, .0015, .0020 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 9.611, 12.815, 14.431, 16.019, 19.222 ft 3 /lbmol

269
Table 6.58: Summary of runs for sensitivity and comparative studies (Case GVM10)

Run Simulator Case Rock Perm. Porosity Nx Ny Nz NB R f ,max w as,max R ln f n*cs P* vs Qinj
3 3
No. type (md) (%) (lb/ft ) (atm) (psia) (litres/gmol) (cm / h)
1 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 - - - - - - 10
2 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 2 0.0005 165.43 -25.2052 7251.89 0.9 10
3 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.9 10
4 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 4 0.0005 165.43 -25.2052 7251.89 0.9 10
5 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 3 0.0005 165.43 -25.2052 7251.89 0.9 10
6 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 2 0.0005 165.43 -25.2052 7251.89 0.9 10
7 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0010 165.43 -25.2052 7251.89 0.9 10

270
8 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0013 165.43 -25.2052 7251.89 0.9 10
9 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0015 165.43 -25.2052 7251.89 0.9 10
10 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0020 165.43 -25.2052 7251.89 0.9 10
11 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.6 10
12 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.8 10
13 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 1 10
14 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 1.2 10
15 CMG GEM GVM10 Vosges 12.2 24.3 30 10 1 300 - - - - - - 10
16 CMG GEM GVM10 Vosges 12.2 24.3 30 10 1 300 2 0.00045 165.43 -25.2052 7251.89 0.9 10
17 GPAS GVM10 Vosges 12.2 24.3 30 10 1 300 2 0.00045 165.43 -25.2052 7251.89 0.9 10
Table 6.59: Data for modeling the porous medium (Case GVR8)

Property Value Unit

Type of rock Vosges Sandstone -


Length 6 cm
Width 2.3 cm
Thickness 2.3 cm
Permeability in x direction 15.2 md
Permeability in y direction 15.2 md
Permeability in z direction 15.2 md
Porosity 22.6 %
Initial pressure 145.038 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.60: Grid system used (Case GVR8)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 0.0065616798 ft
Size of gridblocks in y direction 0.00668740814 ft
Size of gridblocks in z direction 0.0668740814 ft
No. of gridblocks in x direction 30 -
No. of gridblocks in y direction 10 -
No. of gridblocks in z direction 1 -
Total No. of Gridblocks 300 -

271
Table 6.61: Properties of water (Case GVR8)

Property Value Unit

Initial water saturation 0.0000001 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

272
Table 6.62: Characteristics of fluid considered (Case GVR8)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.63: Modeled fluid composition (Case GVR8)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

273
Table 6.64: PVT properties for the modeled fluid (Case GVR8)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

274
Table 6.65: Binary Interaction Coefficients between components (Case GVR8)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.66: Water-oil relative permeability table (Case GVR8)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.67: Liquid-gas relative permeability table (Case GVR8)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

275
Table 6.68: Well specifications (Case GVR8)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 0.0032808399 ft
x-location of well interval bottoms 0.0032808399 ft
y-location of well interval tops 0.00334370407 ft
y-location of well interval bottoms 0.00334370407 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
injection constraint 0.0015096 bbl/day
diameter 0.001 ft
skin 0 -
Well #2
type Producer -
user block address 30,10,1 -
x-location of well interval tops 0.1935695541 ft
x-location of well interval bottoms 0.1935695541 ft
y-location of well interval tops 0.06353037733 ft
y-location of well interval bottoms 0.06353037733 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 0.0668740814 ft
production constraint 145.038 psi
diameter 0.001 ft
skin 0 -

276
Table 6.69: Injected fluid composition (Case GVR8)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
9 Water 0.0000000
Total - 1.0000000

Table 6.70: Input parameters for the asphaltene precipitation model (Case GVR8)

Parameter Value Unit

R f ,max 2, 3, 4, 5 -
w as,max .000417, .0005, .0010, .0013, .0015, .0020 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 9.611, 12.815, 14.431, 16.019, 19.222 ft 3 /lbmol

277
Table 6.71: Summary of runs for sensitivity and comparative studies (Case GVR8)

Run Simulator Case Rock Perm. Porosity Nx Ny Nz NB R f ,max w as,max R ln f n*cs P* vs Qinj
3 3
No. type (md) (%) (lb/ft ) (atm) (psia) (litres/gmol) (cm / h)
1 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 - - - - - - 10
2 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 2 0.0005 165.43 -25.2052 7251.89 0.9 10
3 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.9 10
4 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 4 0.0005 165.43 -25.2052 7251.89 0.9 10
5 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 3 0.0005 165.43 -25.2052 7251.89 0.9 10
6 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 2 0.0005 165.43 -25.2052 7251.89 0.9 10
7 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0010 165.43 -25.2052 7251.89 0.9 10

278
8 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0013 165.43 -25.2052 7251.89 0.9 10
9 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0015 165.43 -25.2052 7251.89 0.9 10
10 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0020 165.43 -25.2052 7251.89 0.9 10
11 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.6 10
12 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 0.8 10
13 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 1 10
14 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 5 0.0005 165.43 -25.2052 7251.89 1.2 10
15 CMG GEM GVR8 Vosges 15.2 22.6 30 10 1 300 - - - - - - 10
16 CMG GEM GVR8 Vosges 15.2 22.6 30 10 1 300 2 0.000417 165.43 -25.2052 7251.89 0.9 10
17 GPAS GVR8 Vosges 15.2 22.6 30 10 1 300 2 0.000417 165.43 -25.2052 7251.89 0.9 10
Table 6.72: Data for modeling the reservoir (Case 6.7)

Property Value Unit

Length 560 ft
Width 560 ft
Thickness 100 ft
Permeability in x direction 15.2 md
Permeability in y direction 15.2 md
Permeability in z direction 15.2 md
Porosity 22.6 %
Initial pressure 5200 psi
Rock compressibility 0.000005 1/psi
Ref. pressure for rock compressibility 14.700 psi

Table 6.73: Grid system used (Case 6.7)

Property Value Unit

Grid type Cartesian -


Size of gridblocks in x direction 80 ft
Size of gridblocks in y direction 80 ft
Size of gridblocks in z direction 20, 30, 50 ft
No. of gridblocks in x direction 7 -
No. of gridblocks in y direction 7 -
No. of gridblocks in z direction 3 -
Total No. of Gridblocks 147 -

279
Table 6.74: Characteristics of reservoir fluid (Case 6.7)

Property Value Unit

Reservoir temperature 122 F


Weight % asphaltene content 5.3 -
Resins/Asphaltenes ratio 1.6 -
Viscosity @ 20 C 13 cp
Gravity 29 API

Table 6.75: Modeled reservoir fluid composition (Case 6.7)

No. Component Mole Fraction

1 N2 + C1 0.0000321
2 CO2 0.0000409
3 C2 - C3 0.0175432
4 C4 - C5 0.1114261
5 C6 - C9 0.3627861
6 C10 - C19 0.3516170
7 C20 - C29 0.1154219
8 C30+ 0.0411327
Total - 1.0000000

280
Table 6.76: PVT properties for the reservoir fluid (Case 6.7)

No. Component Tc ( R) Pc (psi) Vc ( ft 3 /lbmol ) Acentric Factor Molecular Weight Parachor

1 N2 + C1 324.0373 640.75082 1.5614987 0.013044585 17.930 71.324842


2 CO2 547.56 1069.8652 1.5057356 0.225 44.010 78
3 C2 - C3 630.39415 647.73794 2.9426398 0.1340237 39.448 136.04607
4 C4 - C5 796.06055 519.73263 4.4612474 0.21288126 64.552 206.66813
5 C6 - C9 1067.239 405.6109 7.3279787 0.33029816 124.491 337.39601
6 C10 - C19 1314.8906 274.60463 12.27393 0.56896138 217.808 604.01815
7 C20 - C29 1557.7558 191.15995 18.800209 0.88620979 364.176 1022.2112
8 C30+ 1859.4628 128.26892 27.684644 1.2553771 622.538 1760.3878

281
Table 6.77: Binary Interaction Coefficients between components (Case 6.7)

N2 + C1 CO2 C2 - C3 C4 - C5 C6 - C9 C10 - C19 C20 - C29 C30+


N2 + C1 0 0.13 0.007762697 0.021094499 0.044931584 0.077883596 0.11049057 0.15119478
CO2 0.13 0 0.135 0.125 0.10145797 0.10145797 0.10145797 0. 13352805
C2 - C3 0.007762697 0.135 0 0.003358593 0.015995421 0.038529427 0.063718053 0. 096119808
C4 - C5 0.021094499 0.125 0.003358593 0 0.004772006 0.019626948 0.039069383 0. 065301288
C6 - C9 0.044931584 0.10145797 0.015995421 0.004772006 0 0.005153061 0.017043088 0. 035417798
C10 - C19 0.077883596 0.10145797 0.038529427 0.019626948 0.005153061 0 0.003525969 0. 013481648
C20 - C29 0.11049057 0.10145797 0.063718053 0.039069383 0.017043088 0.003525969 0 0. 003075309
C30+ 0.15119478 0.1335281 0.096119808 0.065301288 0.035417798 0.013481648 0.003075309 0
Table 6.78: Water-oil relative permeability table (Case 6.7)

Sw krw krow

0.2 0 1
0.2899 0.0022 0.6769
0.3778 0.0180 0.4153
0.4667 0.0607 0.2178
0.5556 0.1438 0.0835
0.6444 0.2809 0.0123
0.7 0.4089 0
0.7333 0.4855 0
0.8222 0.7709 0
0.9111 1 0
1 1 0

Table 6.79: Liquid-gas relative permeability table (Case 6.7)

Sg krg krog

0 0 1
0.05 0 0.88
0.0889 0.001 0.7023
0.1778 0.010 0.4705
0.2667 0.030 0.2963
0.3556 0.050 0.1715
0.4444 0.100 0.0878
0.5333 0.200 0.0370
0.6222 0.350 0.0110
0.65 0.390 0
0.7111 0.560 0
0.8 1 0

282
Table 6.80: Well specifications (Case 6.7)

Property Value Unit

No. of vertical wells 2 -


Well #1
type Injector -
user block address 1,1,1 -
x-location of well interval tops 40 ft
x-location of well interval bottoms 40 ft
y-location of well interval tops 40 ft
y-location of well interval bottoms 40 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 100 ft
injection constraint 10 bbl/day
diameter 0.5 ft
skin 0 -
Well #2
type Producer -
user block address 7,7,1 7,7,3 -
x-location of well interval tops 520 ft
x-location of well interval bottoms 520 ft
y-location of well interval tops 520 ft
y-location of well interval bottoms 520 ft
z-location of well interval tops 0 ft
z-location of well interval bottoms 100 ft
production constraint 5000 psi
diameter 0.5 ft
skin 0 -

283
Table 6.81: Properties of water (Case 6.7)

Property Value Unit

Initial water saturation 0.2 -


Water compressibility 0.00000299922 1/psi
Ref. pressure for water compressibility 14.6959 psi
Water molar density 3.467 lbmol/ft 3
Water viscosity 1.0 cp

Table 6.82: Input parameters for the asphaltene precipitation model (Case 6.7)

Parameter Value Unit

R f ,max 2, 3, 5, 7 -
w as,max 0.013865 lb-solid/lb-rock
R 165 lb/ft 3
ln f n*cs -22.51768 psia
P* 7251.89 psia
vs 14.416 ft 3 /lbmol

284
Figure 6.1: Schematic representation of the discretized porous media used in Case GF1

Figure 6.2: Location of injection and production wells used in Case GF1

285
Figure 6.3: Water-oil relative permeability curves (Case GF1)

Figure 6.4: Liquid-gas relative permeability curves (Case GF1)

286
Figure 6.5: Three-phase oil relative permeability for rock type 1 by Stones first model
(Case GF1)

287
Figure 6.6: Three-phase oil relative permeability for rock type 1 by Stones second
model (Case GF1)

288
Figure 6.7: Schematic representation of the fluid flow pattern in 3-dimensional viewpoint
(Case GF1)

Figure 6.8: Schematic representation of the fluid flow vectors in areal viewpoint (Case
GF1)

289
Figure 6.9: Static asphaltene Precipitation curve for the reservoir fluid used (Case GF1)

Figure 6.10: Comparison of average pressure without and with the effect of asphaltene
precipitation (Case GF1)

290
Figure 6.11: Comparison of pressure profile without (top) and with (bottom) the effect of
asphaltene precipitation at 685 PV injected (Case GF1)

291
Figure 6.12: Comparison of oil rate without and with the effect of asphaltene (Case GF1)

Figure 6.13: Comparison of injector bottom-hole pressure without and with the effect of
asphaltene precipitation (Case GF1)

292
Figure 6.14: Pressure profile at 685 PV injected for R f ,max of 2 (Case GF1)

Figure 6.15: Pressure profile at 685 PV injected for R f ,max of 3 (Case GF1)

293
Figure 6.16: Pressure profile at 685 PV injected for R f ,max of 4 (Case GF1)

Figure 6.17: Pressure profile at 685 PV injected for R f ,max of 5 (Case GF1)

294
Figure 6.18: Sensitivity of average pressure to maximum permeability resistance factor
(Case GF1)

Figure 6.19: Sensitivity of oil rate to maximum resistance factor (Case GF1)

295
Figure 6.20: Pressure profile at 685 PV injected for w as,max of 0.0005 (Case GF1)

Figure 6.21: Pressure profile at 685 PV injected for w as,max of 0.0010 (Case GF1)

296
Figure 6.22: Pressure profile at 685 PV injected for w as,max of 0.0015 (Case GF1)

Figure 6.23: Pressure profile at 685 PV injected for w as,max of 0.0020 (Case GF1)

297
Figure 6.24: Sensitivity of average pressure to the maximum mass fraction of adsorbed
solid (Case GF1)

Figure 6.25: Average pressure under the effect of gridblock discretion (Case GF1)

298
Figure 6.26: Comparison of the oil rate under the effect of gridblock discretion with the
effect of asphaltene precipitation (Case GF1)

299
Figure 6.27: Comparison of the pressure profile under the effect of gridblock discretion
with the effect of asphaltene precipitation at 685 PV injected (Case GF1)

300
Figure 6.28: Comparison of the average pressure between CMG GEM and GPAS with
the effect of asphaltene precipitation (Case GF1)

Figure 6.29: Comparison of the oil rate between CMG GEM and GPAS (Case GF1)

301
Figure 6.30: Schematic representation of the discretized porous media used in Case GF3

Figure 6.31: Location of injection and production wells used in Case GF3

302
Figure 6.32: Water-oil relative permeability curves (Case GF3)

Figure 6.33: Liquid-gas relative permeability curves (Case GF3)

303
Figure 6.34: Three-phase oil relative permeability for rock type 1 by Stones first model
(Case GF3)

304
Figure 6.35: Three-phase oil relative permeability for rock type 1 by Stones second
model (Case GF3)

305
Figure 6.36: Schematic representation of the fluid flow pattern in 3-dimensional
viewpoint (Case GF3)

Figure 6.37: Schematic representation of the fluid flow vectors in areal viewpoint (Case
GF3)

306
Figure 6.38: Static asphaltene precipitation curve for the reservoir fluid used (Case GF3)

150
Without Asphaltene Precipitation

149.5 With Asphaltene Precipitation

149

148.5
Average Pressure (psi)

148

147.5

147

146.5

146

145.5

145
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.39: Comparison of average pressure with and without the effect of asphaltene
precipitation (Case GF3)

307
Figure 6.40: Comparison of pressure profile without (top) and with (bottom) the effect of
asphaltene precipitation at 80 PV injected (Case GF3)

308
0.00152

0.0015

0.00148

0.00146
Oil Rate (bbl/day)

0.00144

0.00142

0.0014

0.00138

Without Asphaltene Precipitation With Asphaltene Precipitation


0.00136
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.41: Comparison of oil rate without and with the effect of asphaltene (Case GF3)

152
With Asphaltene Precipitation Without Asphaltene Precipitation

151

150
Injector Bottom-hole Pressure (psi)

149

148

147

146

145

144
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.42: Comparison of the injector bottom-hole pressure without and with the effect
of asphaltene precipitation (Case GF3)

309
Figure 6.43: Pressure profile at 80 PV injected for R f ,max of 2 (Case GF3)

Figure 6.44: Pressure profile at 80 PV injected for R f ,max of 4 (Case GF3)

310
Figure 6.45: Pressure profile at 80 PV injected for R f ,max of 5 (Case GF3)

Figure 6.46: Pressure profile at 80 PV injected for R f ,max of 6 (Case GF3)

311
Figure 6.47: Pressure profile at 80 PV injected for R f ,max of 8 (Case GF3)

Figure 6.48: Pressure profile at 80 PV injected for R f ,max of 10 (Case GF3)

312
160
Rf,max = 10.0
Rf,max = 8.0
Rf,max = 6.0
Rf,max = 4.0
157
No Asphaltene Precipitation
Average Pressure (psi)

154

151

148

145
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.49: Sensitivity of average pressure to the maximum permeability resistance


factor (Case GF3)

0.0020
No Asphaltene Precipitation

Rf,max = 4.0
0.0019
Rf,max = 6.0

Rf,max = 8.0

Rf,max = 10.0
0.0018
Oil Rate (bbl/day)

0.0017

0.0016

0.0015

0.0014

0.0013
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.50: Sensitivity of oil rate to the maximum resistance factor (Case GF3)

313
150

149.5

149

148.5
Average Pressure (psi)

148

147.5

147

146.5

146
was,max = 0.0005
was,max = 0.0010
145.5
was,max = 0.0015
was,max = 0.0020
145
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.51: Sensitivity of average pressure to the maximum mass fraction of adsorbed
solid (Case GF3)

160

140

120
Average Pressure (psi)

100

80

60

40

20
30 gridblocks
60 gridblocks
0
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.52: Average pressure under the effect of gridblock discretion (Case GF3)

314
0.002

0.0018

0.0016

0.0014

0.0012
Oil Rate (bbl/day)

0.001

0.0008

0.0006

0.0004

0.0002
30 gridblocks
60 gridblocks
0
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.53: Comparison of the oil rate under the effect of gridblock discretion with the
effect of asphaltene precipitation (Case GF3)

315
Figure 6.54: Comparison of the pressure profile under the effect of gridblock discretion
with the effect of asphaltene precipitation at 80 PV injected (Case GF3)

316
160

140

120
Average Pressure (psi)

100

80

60

40

20
CMG GEM
GPAS
0
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.55: Comparison of the average pressure between CMG GEM and GPAS with
the effect of asphaltene precipitation (Case GF3)

0.005
CMG GEM
GPAS
0.0045

0.004

0.0035

0.003
Oil Rate (bbl/day)

0.0025

0.002

0.0015

0.001

0.0005

0
0 10 20 30 40 50 60 70 80
Pore Volumes Injected

Figure 6.56: Comparison of the oil rate between CMG GEM and GPAS (Case GF3)

317
Figure 6.57: Schematic representation of the discretized porous media used in Case
GVM5

Figure 6.58: Location of injection and production wells used in Case GVM5

318
Figure 6.59: Water-oil relative permeability curves (Case GVM5)

Figure 6.60: Liquid-gas relative permeability curves (Case GVM5)

319
Figure 6.61: Three-phase oil relative permeability for rock type 1 by Stones first model
(Case GVM5)

320
Figure 6.62: Three-phase oil relative permeability for rock type 1 by Stones second
model (Case GVM5)

321
Figure 6.63: Schematic representation of the fluid flow pattern in 3-dimensional
viewpoint (Case GVM5)

Figure 6.64: Schematic representation of the fluid flow vectors in areal viewpoint (Case
GVM5)

322
Figure 6.65: Static asphaltene precipitation curve for the reservoir fluid (Case GVM5)

180

160

140

120
Average Pressure (psi)

100

80

60

40

20 Without Asphaltene Precipitation

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.66: Comparison of average pressure without and with the effect of asphaltene
precipitation (Case GVM5)

323
Figure 6.67: Comparison of the pressure profile without (top) and with (bottom) the
effect of asphaltene precipitation at 67 PV injected (Case GVM5)

324
0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004

0.0002 Without Asphaltene Precipitation

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.68: Comparison of the oil rate without and with the effect (Case GVM5)

200

180

160
Injector Bottom-hole Pressure (psi)

140

120

100

80

60

40

With Asphaltene Precipitation


20
Without Asphaltene Precipitation
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.69: Comparison of the injector bottom-hole pressure without and with the effect
of asphaltene precipitation (Case GVM5)

325
Figure 6.70: Pressure profile at 67 PV injected for R f ,max of 2 (Case GVM5)

Figure 6.71: Pressure profile at 67 PV injected for R f ,max of 4 (Case GVM5)

326
Figure 6.72: Pressure profile at 67 PV injected for R f ,max of 5 (Case GVM5)

Figure 6.73: Pressure profile at 67 PV injected for R f ,max of 6 (Case GVM5)

327
Figure 6.74: Pressure profile at 67 PV injected for R f ,max of 8 (Case GVM5)

Figure 6.75: Pressure profile at 67 PV injected for R f ,max of 10 (Case GVM5)

328
214
Rf,max = 10.0
Rf,max = 8.0
Rf,max = 6.0
204
Rf,max = 4.0
No Asphaltene Precipitation

194
Average Pressure (psi)

184

174

164

154

144
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.76: Sensitivity of average pressure to maximum permeability resistance factor


(Case GVM5)

0.00152
No Asphaltene Precipitation

0.0015 Rf,max = 4.0

Rf,max = 6.0

0.00148 Rf,max = 8.0

Rf,max = 10.0
0.00146

0.00144
Oil Rate (bbl/day)

0.00142

0.0014

0.00138

0.00136

0.00134

0.00132
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.77: Sensitivity of oil rate to maximum resistance factor (Case GVM5)

329
Figure 6.78: Pressure profile at 67 PV injected for w as,max of 0.0005 (Case GVM5)

Figure 6.79: Pressure profile at 67 PV injected for w as,max of 0.0010 (Case GVM5)

330
Figure 6.80: Pressure profile at 67 PV injected for w as,max of 0.0015 (Case GVM5)

Figure 6.81: Pressure profile at 67 PV injected for w as,max of 0.0020 (Case GVM5)

331
180

160

140

120
Average Pressure (psi)

100

80

60

40

was,max = 0.0005
20 was,max = 0.0010
was,max = 0.0015
was,max = 0.0020
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.82: Sensitivity of average pressure to the maximum mass fraction of adsorbed
solid (Case GVM5)

180

160

140

120
Average Pressure (psi)

100

80

60

40

20
30 grid cells
60 grid cells
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.83: Average pressure under the effect of gridblock discretion (Case GVM5)

332
0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004

0.0002
30 grid cells
60 grid cells
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.84: Comparison of the oil rate under the effect of gridblock discretion with
asphaltene precipitation (Case GVM5)

333
Figure 6.85: Comparison of the pressure profile under the effect of gridblock discretion
with the effect of asphaltene precipitation at 67 PV injected (Case GVM5)

334
180
CMG GEM
GPAS
160

140

120
Average Pressure (psi)

100

80

60

40

20

0
0 5 10 15 20 25 30 35 40
Pore Volumes Injected

Figure 6.86: Comparison of the average pressure between CMG GEM and GPAS with
the effect of asphaltene precipitation (Case GVM5)

0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004

0.0002
CMG GEM
GPAS
0
0 5 10 15 20 25 30 35 40
Pore Volumes Injected

Figure 6.87: Comparison of the oil rate between CMG GEM and GPAS (Case GVM5)

335
Figure 6.88: Schematic representation of the discretized porous media used in Case
GVM10

Figure 6.89: Location of injection and production wells used in Case GVM10

336
Figure 6.90: Water-oil relative permeability curves (Case GVM10)

Figure 6.91: Liquid-gas relative permeability curves (Case GVM10)

337
Figure 6.92: Three-phase oil relative permeability for rock type 1 by Stones first model
(Case GVM10)

338
Figure 6.93: Three-phase oil relative permeability for rock type 1 by Stones second
model (Case GVM10)

339
Figure 6.94: Schematic representation of the fluid flow pattern in 3-dimensional
viewpoint (Case GVM10)

Figure 6.95: Schematic representation of the fluid flow vectors in areal viewpoint (Case
GVM10)

340
Figure 6.96: Static asphaltene precipitation curve for reservoir fluid used (Case GVM10)

180

160

140

120
Average Pressure (psi)

100

80

60

40

20 Without Asphaltene Precipitation

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.97: Comparison of average pressure without and with the effect of asphaltene
precipitation (Case GVM10)

341
Figure 6.98: Comparison of pressure profile without (top) and with (bottom) the effect of
asphaltene precipitation at 68 PV injected (Case GVM10)

342
0.002

0.0018

0.0016

0.0014

0.0012
Oil Rate (bbl/day)

0.001

0.0008

0.0006

0.0004

Without Asphaltene Precipitation


0.0002

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.99: Comparison of producer oil rate without and with the effect (Case GVM10)

200

180

160
Injector Bottom-hole Pressure (psi)

140

120

100

80

60

40

Without Asphaltene Precipitation


20

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.100: Comparison of injector bottom-hole pressure without and with the effect of
asphaltene precipitation (Case GVM10)

343
Figure 6.101: Pressure profile at 68 PV injected for R f ,max of 2 (Case GVM10)

Figure 6.102: Pressure profile at 68 PV injected for R f ,max of 3 (Case GVM10)

344
Figure 6.103: Pressure profile at 68 PV injected for R f ,max of 4 (Case GVM10)

Figure 6.104: Pressure profile at 68 PV injected for R f ,max of 5 (Case GVM10)

345
250

200
Average Pressure (psi)

150

100

50 Rf,max = 5.0
Rf,max = 4.0
Rf,max = 3.0
Rf,max = 2.0
No Asphaltene Precipitation
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.105: Sensitivity of average pressure to the maximum permeability resistance


factor (Case GVM10)

0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004 No Asphaltene Precipitation

Rf,max = 2.0

Rf,max = 3.0
0.0002
Rf,max = 4.0

Rf,max = 5.0
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.106: Sensitivity of oil rate to the maximum resistance factor (Case GVM10)

346
Figure 6.107: Pressure profile at 68 PV injected for w as,max of 0.0010 (Case GVM10)

Figure 6.108: Pressure profile at 68 PV injected for w as,max of 0.0013 (Case GVM10)

347
Figure 6.109: Pressure profile at 68 PV injected for w as,max of 0.0015 (Case GVM10)

Figure 6.110: Pressure profile at 68 PV injected for w as,max of 0.0020 (Case GVM10)

348
200

180

160

140
Average Pressure (psi)

120

100

80

60

40
was,max = 0.0010
was,max = 0.0013
20
was,max = 0.0015
was,max = 0.0020
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.111: Sensitivity of average pressure to w as,max (Case GVM10)

250

200
Injector Bottom-hole Pressure (psi)

150

100

50
was,max = 0.0010
was,max = 0.0013
was,max = 0.0015
was,max = 0.0020
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.112: Sensitivity of injector bottom-hole pressure to w as,max (Case GVM10)

349
Figure 6.113: Pressure profile at 68 PV injected for vs of 0.6 litres/gmol (Case GVM10)

Figure 6.114: Pressure profile at 68 PV injected for vs of 0.8 litres/gmol (Case GVM10)

Figure 6.115: Pressure profile at 68 PV injected for vs of 1.2 litres/gmol (Case GVM10)

350
300

250

200
Average Pressure (psi)

150

100

50
vs = 0.6 litres/gmol

vs = 0.8 litres/gmol

vs = 1.2 litres/gmol
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.116: Sensitivity of average pressure to the solid molar volume (Case GVM10)

0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004
vs = 0.6 litres/gmol

0.0002 vs = 0.8 litres/gmol

vs = 1.2 litres/gmol
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.117: Sensitivity of producer oil rate to the solid molar volume (Case GVM10)

351
400

350

300
Injector Bottom-hole Pressure (psi)

250

200

150

100
vs = 0.6 litres/gmol

50 vs = 0.8 litres/gmol

vs = 1.2 litres/gmol
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75
Pore Volumes Injected

Figure 6.118: Sensitivity of bottom-hole pressure to solid molar volume (Case GVM10)

200
CMG GEM
GPAS
180

160

140
Average Pressure (psi)

120

100

80

60

40

20

0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.119: Comparison of the average pressure between CMG GEM and GPAS with
the effect of asphaltene precipitation (Case GVM10)

352
0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004

0.0002
CMG GEM
GPAS
0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.120: Comparison of the producer oil rate between CMG GEM and GPAS with
the effect of asphaltene precipitation (Case GVM10)

250
CMG GEM
GPAS

200
Injector Bottom-hole Pressure (psi)

150

100

50

0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.121: Comparison of injector bottom-hole pressure (Case GVM10)

353
Figure 6.122: Schematic representation of the discretized porous media used in Case
GVR8

.
Injector

.
Producer

Figure 6.123: Location of injection and production wells used in Case GVR8

354
Figure 6.124: Water-oil relative permeability curves (Case GVR8)

Figure 6.125: Liquid-gas relative permeability curves (Case GVR8)

355
Figure 6.126: Three-phase oil relative permeability for rock type 1 by Stones first model
(Case GVR8)

356
Figure 6.127: Three-phase oil relative permeability for rock type 1 by Stones second
model (Case GVR8)

357
Figure 6.128: Schematic representation of the fluid flow pattern in 3-dimensional
viewpoint (Case GVR8)

Figure 6.129: Schematic representation of flow vectors in areal viewpoint (Case GVR8)

358
6.00

122 deg F
5.50

5.00
Asphaltene Precipitate (wt % of reservoir fluid)

4.50

4.00

3.50

3.00

2.50

2.00

1.50

1.00

0.50

0.00
145 645 1145 1645 2145 2645 3145 3645 4145 4645 5145 5645 6145 6645 7145 7645

Pressure (psi)

Figure 6.130: Static asphaltene precipitation curve for reservoir fluid used (Case GVR8)

180

160

140

120
Average Pressure (psi)

100

80

60

40

20 Without Asphaltene Precipitation

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.131: Comparison of the average pressure without and with the effect of
asphaltene precipitation (Case GVR8)

359
Figure 6.132: Comparison of pressure profile without (top) and with (bottom) the effect
of asphaltene precipitation at 73 PV injected (Case GVR8)

360
0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004

0.0002 Without Asphaltene Precipitation

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.133: Comparison of producer oil rate without and with the effect (Case GVR8)

200

180

160
Injector Bottom-hole Pressure (psi)

140

120

100

80

60

40

Without Asphaltene Precipitation


20

With Asphaltene Precipitation


0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.134: Comparison of injector bottom-hole pressure without and with the effect of
asphaltene precipitation (Case GVR8)

361
Figure 6.135: Pressure profile at 73 PV injected for R f ,max of 2 (Case GVR8)

Figure 6.136: Pressure profile at 73 PV injected for R f ,max of 3 (Case GVR8)

362
Figure 6.137: Pressure profile at 73 PV injected for R f ,max of 4 (Case GVR8)

Figure 6.138: Pressure profile at 73 PV injected for R f ,max of 5 (Case GVR8)

363
250

200
Average Pressure (psi)

150

100

Rf,max = 5.0
50
Rf,max = 4.0
Rf,max = 3.0
Rf,max = 2.0
No Asphaltene Precipitation
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.139: Sensitivity of average pressure to maximum resistance factor (Case GVR8)

0.002

0.0018

0.0016

0.0014

0.0012
Oil Rate (bbl/day)

0.001

0.0008

0.0006
No Asphaltene Precipitation

0.0004 Rf,max = 2.0

Rf,max = 3.0
0.0002 Rf,max = 4.0

Rf,max = 5.0
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.140: Sensitivity of producer oil rate to the maximum permeability resistance
factor (Case GVR8)

364
Figure 6.141: Pressure profile at 73 PV injected for w as,max of 0.0010 (Case GVR8)

Figure 6.142: Pressure profile at 73 PV injected for w as,max of 0.0013 (Case GVR8)

365
Figure 6.143: Pressure profile at 73 PV injected for w as,max of 0.0015 (Case GVR8)

Figure 6.144: Pressure profile at 73 PV injected for w as,max of 0.0020 (Case GVR8)

366
200

180

160

140
Average Pressure (psi)

120

100

80

60
was,max = 0.0010

40 was,max = 0.0013

was,max = 0.0015
20

was,max = 0.0020
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.145: Sensitivity of average pressure to w as,max (Case GVR8)

0.0014175

0.001417

0.0014165
Oil Rate (bbl/day)

0.001416

0.0014155

0.001415

0.0014145 was,max = 0.0010


was,max = 0.0013
was,max = 0.0015
was,max = 0.0020
0.001414
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
Time (day)

Figure 6.146: Sensitivity of injector bottom-hole pressure to w as,max (Case GVR8)

367
Figure 6.147: Pressure profile at 73 PV injected for vs of 0.6 litres/gmol (Case GVR8)

Figure 6.148: Pressure profile at 73 PV injected for vs of 0.8 litres/gmol (Case GVR8)

Figure 6.149: Pressure profile at 73 PV injected for vs of 1.2 litres/gmol (Case GVR8)

368
250

200
Average Pressure (psi)

150

100

50
vs = 0.6 litres/gmol

vs = 0.8 litres/gmol

vs = 1.2 litres/gmol
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.150: Sensitivity of average pressure to the solid molar volume (Case GVR8)

0.0016

0.0014

0.0012

0.001
Oil Rate (bbl/day)

0.0008

0.0006

0.0004
vs = 0.6 litres/gmol

0.0002 vs = 0.8 litres/gmol

vs = 1.2 litres/gmol
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.151: Sensitivity of producer oil rate to the solid molar volume (Case GVR8)

369
300

250
Injector Bottom-hole Pressure (psi)

200

150

100

vs = 0.6 litres/gmol

50 vs = 0.8 litres/gmol

vs = 1.2 litres/gmol

0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Pore Volumes Injected

Figure 6.152: Sensitivity of injector pressure to the solid molar volume (Case GVR8)

200
CMG GEM
GPAS
180

160

140
Average Pressure (psi)

120

100

80

60

40

20

0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.153: Comparison of average pressure between CMG GEM and GPAS with the
effect of asphaltene precipitation (Case GVR8)

370
0.0025
CMG GEM
GPAS

0.002

0.0015
Oil Rate (bbl/day)

0.001

0.0005

0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.154: Comparison of the oil rate between CMG GEM and GPAS (Case GVR8)

250
CMG GEM
GPAS

200
Injector Bottom-hole Pressure (psi)

150

100

50

0
0 5 10 15 20 25 30 35 40 45
Pore Volumes Injected

Figure 6.155: Comparison of the injector bottom-hole pressure (Case GVR8)

371
Figure 6.156: Schematic representation of the discretized reservoir used in waterflooding

6100
Rf,max = 2.0
6000 Rf,max = 3.0

Rf,max = 5.0
5900
Rf,max = 7.0

5800

5700
Average Pressure (psi)

5600

5500

5400

5300

5200

5100

5000
5 35 65 95 125 155 185 215 245 275 305 335 365
Time (days)

Figure 6.157: Sensitivity of average pressure to maximum resistance factor (Case 6.7)

372
1600

1400

1200

1000
Oil Rate (bbl/day)

800

600

400 Rf,max = 7.0

Rf,max = 5.0
200 Rf,max = 3.0

Rf,max = 2.0
0
5 35 65 95 125 155 185 215 245 275 305 335 365
Time (days)

Figure 6.158: Sensitivity of producer oil rate to the maximum permeability resistance
factor (Case 6.7)

373
Chapter 7: Summary, Conclusions and Recommendations

In this chapter, a summary of the performed research is first presented. The

summary section includes a brief description of the challenging accomplishments of the


research work done. Then, based on the discussions in the previous chapters, some
conclusions are drawn. Last but not least, the last section deals with recommendations for

the direction of future research work which can be found at the end of this chapter.

7.1 SUMMARY

The work in this thesis can be divided into two main parts. The first part deals

with compositional simulation of asphaltene precipitation, flocculation and deposition in


petroleum reservoirs using CMG GEM. In the second part, we present the incorporation

of an asphaltene precipitation and plugging model into a fully implicit, equation-of-state

compositional, parallel, reservoir simulator called GPAS.

The precipitation and deposition of asphaltenes is considered to be one of the

most difficult problems encountered during the exploitation of oil reservoirs. Asphaltene
precipitation can occur during normal or primary depletion, miscible or immiscible
flooding operations, transportation of oil or more commonly, during well stimulation

activities. Asphaltenes exist as colloidal particles held in suspension with associated resin
molecules, which act as surfactants to stabilize the colloidal suspension in crude oils.

Changing the prevalent pressure, temperature and crude oil composition can alter the
association of asphaltenes with resins, resulting in asphaltenes precipitating out of the oil.
The presence of asphaltenes in crude oils has been shown to affect rock properties and as

374
a result decrease the oil production. Most of these effects have been recognized as the

result of asphaltene precipitation and adsorption on the rock surface.


In the first part of this research, CMG's compositional simulator, GEM, was used
to simulate the effects of asphaltene precipitation, flocculation and deposition in

petroleum reservoirs. In CMG GEM, compositional simulation of the dynamics of


asphaltene precipitation in porous media includes the flow of suspended solids in the oil

phase, flocculation of smaller solid particles into larger aggregates, deposition of


flocculated asphaltene particles onto active sites on the rock surface through adsorption,
entrapment, and finally plugging. The models for predicting the dynamics of asphaltene

precipitation that are used in CMG GEM are discussed in detail. Furthermore, the

formation of asphaltenes in oil reservoirs leads to formation damage. The most important

rock properties that are affected by asphaltene precipitation are porosity and permeability.
The models for reduction of reservoir porosity and permeability are also presented. The

alteration of reservoir rock permeability due to asphaltene precipitation, and more

importantly, the effect of asphaltene precipitation on oil production were studied.

The General Purpose Adaptive Simulator, GPAS, is a fully implicit, three-

dimensional, multiphase, multicomponent, parallel, equation-of-state compositional


simulator developed at The University of Texas at Austin. A thermodynamic model for

asphaltene precipitation was implemented in GPAS in order to improve its prediction

accuracy for oil and gas production when asphaltenes are suspected of forming in
petroleum reservoirs. The modeling technique is based on the representation of the
precipitated asphaltene as a pure dense phase while the oil and gas phases modeled with
an equation-of-state. The integration of the thermodynamic model in GPAS is fully

described.

375
To take advantage of the larger time steps with the fully implicit formulation and

to reduce the simulation time, we developed a fully implicit model for asphaltene
precipitation with the relevant physical properties. The formulation and the derivatives of
the Jacobian matrix for this implementation are reported in detail. The effect of

asphaltene precipitation on the porous medium is accounted for. A resistance factor


model was introduced to compute the effect of precipitation on relative permeability.

The multiphase oil-gas-solid flash calculation algorithm was tested using a batch
flash example. Several test cases in different dimensions were created for GPAS. These
simulation cases have been run to test the implemented asphaltene precipitation model

and to compare its results against CMG GEM. One-dimensional compositional

simulations of core flood were performed using GPAS. Several two-dimensional cases

with different permeability and porosity were also created and tested for validation
purposes. The simulation results indicate that by introducing dynamic asphaltene

precipitation into an oil reservoir we will have different results compared to a case

without the asphaltene precipitation model. Compared to simulations, without

considering the asphaltene precipitation model, the algorithm takes too much

computational time for the phase behavior calculation when the model is invoked.

7.2 CONCLUSIONS

Based on this study the following conclusions can be drawn:


This thesis presents modeling of the phase behavior and dynamic aspects
of asphaltene precipitation and deposition for injection processes. In
addition, asphaltene precipitation induced by pressure depletion in an oil
reservoir with or without heterogeneity and grid-refinement was simulated

using CMG GEM in a radial model.

376
Compositional simulation results for a one-dimensional oil core flood
using CMG GEM to investigate asphaltene precipitation, flocculation and

deposition agree well with the experimental observations.


Simulation of a typical gas injection core displacement shows that
asphaltene precipitation is associated with the development of miscibility.

The precipitated asphaltene moves with the flood front and occupies a
sizeable portion of the core.
Simulation of a single-well depletion process with and without

heterogeneity shows the effect of plugging on well performance and

permeability impairment.
General field observations, which indicate the majority of asphaltene

deposition problems occur in the near-wellbore region, are consistent with


the simulation results.

Nghiem's thermodynamic model for asphaltene precipitation, which

incorporates the fundamental physical phenomena associated with solids


precipitation in porous media, was implemented into a fully implicit,

equation-of-state compositional, parallel simulator called GPAS to extend

its applicability and accuracy.


The precipitation model implemented in GPAS was previously found to
give quantitative matches to experimental asphaltene precipitation

behavior over a wide range of pressure, temperature and composition


conditions.

In GPAS, all the precipitated asphaltene adsorbs to the rock, but in CMG
GEM, just part of the precipitated asphaltene adsorbs to the rock and the

remaining part flows as a suspended solid in the oil phase.

377
The thermodynamic representation of the precipitated asphaltene as a pure
solid offers an efficient method for modeling asphaltene in GPAS.

The capability of modeling an additional phase, more specifically a solid


phase was added to GPAS.

A resistance factor model was introduced in GPAS for estimation of the


effect of asphaltene precipitation on relative permeability.

A pure solid model together with an equation-of-state provides an efficient


method for modeling asphaltene precipitation in GPAS. The solid model is

capable of predicting the amount of precipitation.


A constant rate oil injection well for the one-dimensional oil core flood

simulation cases was implemented into GPAS.


Modeling of the phase behavior of the solid precipitate beside the

hydrocarbon phases and simulation of the dynamics of asphaltene


precipitation was performed in GPAS.

Based on our knowledge at this time, other than GPAS there is no

compositional simulator that has the capability of modeling asphaltene


precipitation in the entire reservoir using a fully implicit scheme.

Validation work was carried out on GPAS. A batch flash calculation case

was run to test the multiphase oil-gas-solid flash calculations.


The asphaltene precipitation model in GPAS was verified and tested

against CMG's compositional simulator, called GEM, which is a


commercial simulator.

378
7.3 RECOMMENDATIONS FOR FUTURE WORK

Based on this study we make the following recommendations for future research
in this field:

This research is focused on the modeling of asphaltene precipitation in


petroleum reservoirs under pressure depletions or injection processes,

which usually occur under isothermal conditions. Therefore, the modeling


of the effect of temperature is not necessary. However, for other cases
such as the modeling of asphaltene precipitation in wellbores during

production, the inclusion of temperature effects would be required.


The oil injection core flood simulation which was run under CMG GEM is

based on an experimental study by Minssieux. This study includes similar

experimental cases. The asphaltic reservoir fluid used for the cases is
different and they also differ in core type, permeability, porosity and

injection flow rate. The effects of the precipitation, flocculation and

deposition models could be investigated for those cases as well.


Sensitivity analysis of the asphaltene precipitation model prediction with

changes in asphaltene component parameters (e.g., volume shift

parameter, interaction coefficients) and solid molar volume could be


performed.

The objective of this thesis was the presentation of a compositional


simulator with essential physics for asphaltene precipitation. GPAS can be

enhanced in the future to include additional phenomena (e.g.,


incorporation of models for asphaltene flocculation and deposition) related

to modeling the effect of asphaltenes in petroleum reservoirs.

379
Allowing the precipitated asphaltene to be converted to larger flocculated
particles according to a chemical reaction can enhance the precipitation

model of GPAS.
The compositional simulators described in this thesis incorporate some
important dynamic aspects of asphaltene: precipitation, adsorption and

plugging. Other effects such as trapping and wettability changes should


also be considered.
Though a validation of the GPAS simulator was carried out, a further in

depth validation work needs to be carried out. The scope may include

complex and heterogeneous two-phase and three-phase cases with


different scenarios of operation.

The asphaltene precipitation model should be modified to include the

effect of composition changes to give a better representation of asphaltene


precipitation behavior.

380
Appendix A: Derivation of the Three-Phase Flash Equation

For multiphase flash calculations, the following equation can be defined. This

equation is also called the flash equation:

nc
zi (K im 1)
=0 m = 2, ..., n p j = 2, ..., n p
i =1
1 + L j (K ij 1)
j

In this appendix, it is aimed to derive the flash equation for a three-phase case of
oil-gas-solid.

1 oil

j = 2 gas
3 solid

np

Solve L
j=1
j 1 = 0 for L1 , Hence,

L1 = 1 L 2 L3

Substitute L1 into

np

zi = L x
j=1
j ij i = 1, , nc

L1x i1 = zi L 2 x i2 L3 x i3

zi x x
L1 = L 2 i2 L3 i3
x i1 x i1 x i1

zi x x
1 L 2 L3 = L 2 i2 L3 i3
x i1 x i1 x i1

381
Use the definition of K-values

x i2 x i3
K i2 = K i3 = i = 1, , nc
x i1 x i1

zi
1 L 2 L3 = L2 K i2 L3 K i3
x i1

zi
1 L 2 L3 + L 2 K i2 + L3 K i3 =
x i1

Hence

zi
x i1 =
1 L 2 L3 + L 2 K i2 + L3 K i3

Using the relation

nc nc

x
i =1
i 2 x i1 = 0
i =1

We have

nc nc

x i1K i2 x i1 = 0
i =1 i =1

nc

x
i =1
i1 (K i2 1) = 0

nc
zi
1 L (K i2 1) = 0
i =1 2 L 3 + L 2 K i2 + L 3 K i3

Hence

nc
zi (K i2 1)
1 + L (K =0
i =1 2 i2 1) + L 3 (K i3 1)

Similarly if we instead, use

382
nc nc

x x
i =1
i3
i =1
i1 =0

The following expression can be derived

nc
z i (K i3 1)
1 + L (K =0
i =1 2 i2 1) + L 3 (K i3 1)

383
Appendix B: Derivatives of Gas-Oil Fugacity Equations

In this and the following appendices, because only one gridblock is involved in
the derivatives, we can drop grid indices (I, J, K) . At constant pressure and temperature

we have
r r
ij = f (K, K n cs , N, Lg , Ls ) i = 1,..., n c j = o, g (.1)

Where
r
K = (K1g , K 2g ,, K n c g )

r
N = (N1 , N 2 ,, N n c )

Taking total differential of Equation (B.1) we have

nc
ln ij ln ij
d ln ij = d ln K kg + d ln K n cs +

k =1 ln K kg
ln K n s r r
N,K m ,K ncs ,Lg ,Ls
r r
c N,K,L ,L
g s
(B.2)
nc
ln ij ln ij ln ij
r r
k =1 N k N ,K,K ,L ,L
dN k +

r r
dLg + r r dLs
m n cs g s Lg N,K,K ,L
n s s c
Ls N,K,K
n cs ,L g

Where
r
K m = (K1g , K 2g ,, K (k-1)g , K (k+1)g ,..., K n cg )

r
N m = (N1 , N 2 ,, N k-1 , N k+1 , , N n c )

The equations for thermodynamic equilibrium between the oil and gas phases are

fig fio = 0 i = 1,..., n c

l n ( x ig ig ) ln ( x io io ) = 0 i = 1,..., n c

384
Hence

R if = ln K ig + ln ig ln io = 0 i = 1,..., n c (B.3)

B.1 DERIVATIVES WITH RESPECT TO lnK ig

From Equation (B.3), we can get

R if ln K ig ln ig ln io
= +
ln K kg ln K kg ln K kg
ln K kg N,K
r r
m ,K n cs ,L g ,Ls
N,K
r r
m ,K ncs ,Lg ,Ls
N,K
r r
m ,K n cs ,Lg ,Ls
N,K
r r
m ,K n cs ,Lg ,Ls

Hence

ln ig ln io
1 +
ln K kg r r
i=k
R if ln K kg N,K r r
,K ,L ,L N,K m ,K ncs ,Lg ,Ls
=
m n cs g s

ln K kg N,K
r r
ln ig ln io
ln K r r ik
ln K kg r r
m ,K n cs ,Lg ,Ls

kg N,K m ,K n cs ,Lg ,Ls N,K m ,K ncs ,Lg ,Ls

Note that i and k are used to represent component index. At this point we need
ln ig ln io
and
ln K kg r r
.
ln K kg N,K
r r
m ,K n c s ,L g ,Ls
N,K m ,K n c s ,Lg ,Ls

r r
Dividing Equation (B.2) by ln K kg while holding N, K n cs , Lg , Ls and K m constant, for
the gas phase, then

ln ig ln ig ln ig ln K n cs
= +
ln K ln K n s r r
ln K kg N,K
r r
m ,K n cs ,L g ,Ls
kg N,K
r r
m ,K ncs ,L g ,L s
c N,K ,L ,L
m g s
ln K kg N,K
r r
m ,Lg ,Ls

ln ig Lg ln ig Ls
+ + r r
L Ls N,K,K ,L ln K kg
g N,K,K
r r
ncs ,Ls
ln K kg N,K
r r
m ,K ncs ,Ls
ncs g N,K
r r
m ,K n cs ,Lg

ln ig x kg
=
x kg
N,K
r r
m ,K n cs ,L g ,L s
ln K kg N,K
r r
m ,K n cs ,Lg ,Ls

where

385
x kg z k K kg 1 Lg + Ls (K ks 1)
=
ln K kg
2
N,K
r r
m ,K nc s ,L g ,L s

1 + L g (K kg 1) + L s (K ks 1)

Similarly, for oil phase, we have

ln io ln io ln io ln K n cs
= +
ln K kg ln K n s r r
ln K kg N,K
r r
m ,K n cs ,L g ,Ls
N,K
r r
m ,K ncs ,L g ,L s
c N,K ,L ,L
m g s
ln K kg N,K
r r
m ,Lg ,Ls

ln io Lg ln io Ls
+ + r r
L ln K kg r r Ls N,K,K ,L ln K kg
g N,K,K
r r
n cs ,Ls
N,K,K ncs ,Ls ncs g N,K,K
r r
ncs ,L g

ln io x ko
= r r
x ko N,K m ,K ncs ,Lg ,Ls ln K kg N,K
r r
m ,K n cs ,Lg ,Ls

Where

x ko z k Lg K kg
=
ln K kg 1 + Lg ( K kg 1) + Ls (K ks 1)
2
N,K
r r
m ,K nc s ,L g ,Ls

B.2 DERIVATIVES WITH RESPECT TO N i

From Equation (B.3) we can get

R if ln K ig ln ig ln io
r r = r r + r r r
N k Nm ,K,K ncs ,Lg ,Ls N k Nm ,K,K ncs ,Lg ,Ls N k N m ,K,K ncs ,Lg ,Ls N k Nr m ,K,K n cs ,L g ,Ls

with

ln K ig
r =0
N k Nr m ,K,K n cs ,L g ,L s

386
Note that i and k are used to represent component index. At this point we need to
ln ig ln io
know r r and r .
N k N m ,K,K ncs ,Lg ,Ls N k Nr m ,K,K n cs ,L g ,L s

r r
Dividing Equation (B.2) by N k while holding K, K n cs , Lg , Ls and N m constant, we
have

ln ig ln ig ln ig Lg
r = r + r
N k Nr m ,K,K n cs ,L g ,L s
N k Nr ,K,K
m n cs ,L g ,L s Lg Nr m ,K,K
r
n cs ,Ls
N k Nr m ,K,K n cs ,Ls

ln ig Ls ln ig x kg
+ r r r r = r r

Ls N,K,K ncs ,Lg N k N m ,K,K ncs ,Lg x kg K,
r r
N,K n cs ,Lg ,Ls
N k K,N
m ,K n cs ,Lg ,Ls

where

x ig K ig (1 z i )
r r =
N i K,Nm ,K ncs ,Lg ,Ls 1 + Lg (K ig 1) + Ls (K is 1) N T

Similarly, for oil phase, we have

ln io ln io ln io Lg
r r = r r + r r
N k K,N m ,K ncs ,Lg ,Ls N k K,N m ,K ncs ,Lg ,Ls Lg K,N r r
m ,K ncs ,Ls
N k K,N m ,K ncs ,Ls

ln io Ls ln io x ko
+ r r r r = r r r r
Ls N,K,K ncs ,Lg N k N m ,K,K ncs ,Lg x ko K,N ,K ncs ,Lg ,Ls N k K,N m ,K n cs ,L g ,Ls

where

x io
=
(1 zi )
r r
N i K,N m ,K ncs ,Lg ,Ls 1 + Lg (K ig 1) + Ls (K is 1) N T

B.3 DERIVATIVES WITH RESPECT TO P

From Equation (B.3) we can get

387
R if ln K ig ln ig ln io
r r = r r + r r r r
P N,K,K ncs ,Lg ,Ls P N,K m ,K ncs ,Lg ,Ls P N,K,K ncs ,Lg ,Ls P N,K,K n cs ,Lg ,Ls

ln ig ln io
= r r r r
P N,K,K ncs ,Lg ,Ls P N,K,K n cs ,Lg ,Ls

ln ij ln ij
Note that r r and are derived from Peng-Robinson
P N,K,K ,L ,L x kj r r
n cs g s N,K,K n cs ,Lg ,Ls

equation of state and are given later.

B.4 DERIVATIVES WITH RESPECT TO lnK n cs

From Equation (B.3), we can get

R if ln K ig ln ig ln io
= +
ln K n s r r ln K n s r r ln K n s
ln K n cs N,K,L
r r
g ,Ls
c N,K,L ,L
g s
c N,K,L ,L
g s
c N,K,L
r r
g ,Ls

ln ig ln io
At this point we need and
ln K n s r r
.
ln K n s r r
c N,K,L ,L
g s
c N,K,L ,L
g s

ln ij nc
ln ij x ij
= i = 1,..., n c j = o, g
ln K x ij ln K n s r r
n c N,K,L ,L
s r r
g s
i =1 c N,K,L ,L
g s

For gas phase, we have

0 i nc
x ig
= zi K ig Ls K is
i = nc
ln K n cs N,K,Lg ,Ls 1 + L ( K 1) + L (K 1) 2
r r

g ig s is

Similarly, for oil phase, we can get

388
0 i nc
x io
= z i Ls K is
ln K n s r r i = nc
c N,K,L ,L 1 + L ( K 1) + L (K 1) 2

g s
g ig s is

Hence

R if nc
ln ig x ig nc
ln io x io
=

ln K n cs N,K,L
r r
g ,Ls
i =1 x ig ln K n cs r r
N,K,Lg ,Ls
i =1 x io ln K n cs N,K,L
r r
g ,Ls

B.5 DERIVATIVES WITH RESPECT TO Lg

From Equation (B.3), we can get

R if ln K ig ln ig ln io
= +
Lg r r Lg r r
Lg N,K,K
r r
n cs ,Ls
N,K,K ncs ,Ls Lg N,K,K
r r
,L
n cs s
N,K,K ncs ,Ls

Note that i and k are used to represent component index. At this point we need
ln ig ln io
and
Lg r r
.
Lg N,K,Kr r
n cs ,Ls
N,K,K ncs ,Ls

ln ij nc
ln ij x ij
=
Lg r r
i = 1,..., n c j = o, g (B.4)
Lg N,K,Kr r
,L
n cs s
i =1 x ij
N,K,K ncs ,Ls

Where

x ig zi K ig (K ig 1)
= (B.5)
Lg
2
N,K,K
r r
ncs ,L s

1 + L g (K ig 1) + L s (K is 1)

x io zi (K ig 1)
= (B.6)
Lg
2
N,K,K
r r
nc s ,Ls
1 + Lg (K ig 1) + Ls (K is 1)

Substituting Equation (B.5) into Equation (B.4), for the gas phase, we have

389
ln ig nc
ln ig z i K ig (K ig 1)
= i = 1,..., n c

Lg N,K,K i =1 x ig 1 + L (K 1) + L (K 1)
2
r r
n cs ,Ls g ig s is

Substituting Equation (B.6) into Equation (B.4), for the oil phase, we have

ln io nc
ln io zi (K ig 1)
= i = 1,..., n c
Lg N,K,K i =1 x io 1 + L (K 1) + L (K 1)
2
r r
n cs ,Ls g ig s is

Hence, finally we get

R if nc
ln ig x ig nc
ln io x io
=
Lg r r Lg r r
Lg N,K,K
r r
n cs ,Ls
i =1 x ig
N,K,K ncs ,Ls
i =1 x io
N,K,K n cs ,Ls

B.6 DERIVATIVES WITH RESPECT TO Ls

From Equation (B.3), we can get

R if ln K ig ln ig ln io
r r = r r + r r r r
Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg Ls N,K,K ncs ,L g

Note that i and k are used to represent component index. At this point we need
ln ig ln io
r r and r r .
Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg

nc
ln ij ln ij x ij
r r = i = 1,..., n c j = o, g (B.7)
Ls N,K,K ncs ,Lg i =1 x ij Ls N,K,K r r
n cs ,L g

Where

x ig zi K ig (K is 1)
r r = (B.8)
Ls N,K,K nc s ,Lg 1 + Lg (K ig 1) + Ls (K is 1)
2

390
x io zi (K is 1)
r r = (B.9)
Ls N,K,K nc s ,Lg 1 + Lg (K ig 1) + Ls (K is 1)
2

Substituting Equation (B.8) into Equation (B.7), we have

ln ig nc
ln ig z i K ig (K is 1)
r r = i = 1,..., n c j = o, g
Ls N,K,K ncs ,Lg i =1 x ig
2
1 + Lg (K ig 1) + Ls (K is 1)

Substituting Equation (B.9) into Equation (B.7), we have

ln io nc
ln io zi (K is 1)
r r = i = 1,..., n c j = o, g
Ls N,K,K ncs ,Lg i =1 x io
2
1 + Lg (K ig 1) + Ls (K is 1)

Hence, finally we get

nc
R if ln ig x ig nc
ln io x io
r r = r r
Ls N,K,K ncs ,Lg i=1 x ig Ls N,K,K r r
ncs ,L g
i =1 x io Ls N,K,K
n cs ,L g

391
Appendix C: Derivatives of Volume Constraint Equation

C.1 DERIVATIVES WITH RESPECT TO lnK ig

Knowing that

vw
=0
ln K ig

N w
=0
ln K ig

vs
=0
ln K ig

We have

R v vo Lo vg Lg Ls
= Lo + vo + Lg + vg + vs
ln K ig ln K ig ln K ig ln K ig ln K ig ln K ig

RT Zo Zg Lo
= Lo + Lg + v o
P ln K ig ln K ig ln K ig

Using

Lo + Lg + Ls = 1

R v RT Zo Zg (1 Lg Ls )
= Lo + Lg + v o
ln K ig P ln K ig ln K ig ln K ig

thus

R v RT Zo Zg
= Lo + Lg
ln K ig P ln K ig ln K ig

392
C.2 DERIVATIVES WITH RESPECT TO N i

Neglecting solubility of hydrocarbon components in water phase, we have

N w v w
= =0 i = 1...n c
N i Ni

then

1

R v
= vw N w 1 T + L v o + v Lo + L v g + v Lg + L vs + v Ls
( )
N
Ni Ni N i N i N i N i N i N i
o o g g s s

Using

Z j RT
vj = j = o, g
P

Lo + Lg + Ls = 1

nc
NT = Ni
1

R v N w 1 RT Zo Zg (1 Lg Ls )
= 1 2 + Lo + Lg + vo
Ni w NT P N i Ni N i

Hence, finally we get

R v N w 1 RT Zo Zg
= 1 2 + Lo + Lg
Ni w NT P N i N i

C.3 DERIVATIVES WITH RESPECT TO P

Knowing that

393
N w Lo Lg Ls vs
= = = = =0
P P P P P

We have

R v v 1 v vg
= N w w + Lo o + Lg
P P N T P P

Zg Zo
P Z P Zo
vw 1 P
g
P
= N w + RT Lg + Lo
P N T P2 P2

Hence, finally we have

R v RT 3 Z j Z j v 1
P
= Lj
P j= 2 P
+ N w w
P P N T

C.4 DERIVATIVES WITH RESPECT TO N w

For water phase

R v
(
vw N w 1 ) N1 vo Lo vg Lg vs Ls
= T
+ Lo + vo + Lg + vg + Ls + vs
N w N w N w N w N w N w N w N w

with

vg vo vs
= = =0
N w N w N w

n wg = n wo = n ws = 0

394
Zw RT

v w P
= =0
N w N w

P,T

Hence, finally we get

R v 1 1
= vw =
N w NT w N T

C.5 DERIVATIVES WITH RESPECT TO lnK n cs

Knowing that

vw
=0
ln K n cs

N w
=0
ln K n cs

vs
=0
ln K n cs

then

R v vg Lg vo Lo Ls
= Lg + vg + Lo + vo + vs
ln K n cs ln K n cs ln K n cs ln K n cs ln K n cs ln K n cs

RT Zo Zg L o
= Lo + Lg + vo
P ln K n cs ln K n cs
ln K n cs

Hence, finally we get

R v RT Zo Zg
= Lo + Lg
ln K n cs P ln K n cs ln K n cs

395
C.6 DERIVATIVES WITH RESPECT TO Lg

Knowing that

vw
=0
Lg

N w
=0
Lg

vs
=0
Lg

We have

R v v L v L L v v L
= L g g + v g g + L o o + v o o + vs s = L g g + L o o + vg + vo o =
Lg L g Lg Lg Lg L g Lg Lg
Lg

using

Lo + Lg + Ls = 1

RT Zo Z (1 Lg Ls ) RT Zo Z
L o + Lg g + vg + vo = Lo (
+ Lg g + vg vo
Lg
)
P Lg Lg Lg P Lg

Hence

R v RT Zo Zg
= Lo + Lg + Zg Zo
Lg P Lg Lg

C.7 DERIVATIVES WITH RESPECT TO Ls

Knowing that

396
vw
=0
Ls

N w
=0
Ls

vs
=0
Ls

We have

R v v L v L L v v L
= L g g + v g g + L o o + v o o + vs s = L g g + L o o + v o o + vs =
Ls Ls Ls Ls Ls
Ls Ls
Ls Ls

using

Lo + Lg + Ls = 1

RT Zo Z (1 Lg Ls ) RT Z Z
Lo
P Ls
+ Lg g + vo
Ls Ls
+ vs =
P Ls Ls
(
L o o + L g g + vs v o )

Hence, finally we get

R v RT Zo Zg
= Lo + Lg Zo + v s
Ls P Ls Ls

397
Appendix D: Derivatives of Mass Conservation Equation for
Hydrocarbon Components

D.1 DERIVATIVES WITH RESPECT TO lnK ig

D.1.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M aconv M source


a
= +
ln K i2 g(I) ln K i2 g(I) ln K i2g(I) ln K i2 g(I)

For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t =0
=
ln K i2g(I) ln K i2g(I)

For the convection term, neglecting the effect of the change in ln K ig on capillary
pressure, then

v j(I)
=0
ln K ig(I)

The derivative of transmissibility is

Tia1 j(I) x i1 j(I) j(I) arj(I)


=
ln K i2 g(I) ln K i2 g(I)

x i1 j(I) j(I) arj(I)


= a
j(I) + x i1 j(I) + x i1 j(I) j(I)
ln K i2g(I)
rj(I)
ln K i 2 g(I) ln K i 2 g(I)

Knowing that

k arj(I)
a
=
j(I)
rj(I)

398
Therefore

k arj(I) j(I)

j(I) k arj(I)
T a
k a
x i1 j(I) j(I) ln K i2g(I) ln K i2g(I)
= j(I) + x i1 j(I) + x i1 j(I) j(I)
i1 j(I) rj(I)

ln K i2g(I) j(I) ln K i2g(I) ln K i2g(I) 2j(I)




Using the definition of permeability resistance factor for the oil phase to take into account
the change of the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Thus

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I) +
ln K i2g(I) j(I) R f (I) ln K i2g(I) ln K i2g(I) 2j(I) R f (I) ln K i2g(I)
k0
rj(I)
x i1 j(I) j(I) R f (I)

j(I)
2 j(I)
ln K i2g( I)


Focusing on the terms that will be affected by asphaltene precipitation we need

k 0rj(I) k 0rj(I) R f (I)

R f (I) R f (I) ln K k 0rj(I)


ln K i2g (I) k 0rj(I) k 0rj(I) R f (I)
= i 2 g(I)
=
1

ln K i2g (I) R f (I) 2 R f (I) ln K i2g(I) R f (I) 2 ln K i2g(I)

Thus

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I) +
ln K i2g(I) j(I) R f (I) ln K i2g(I) ln K i2g(I) 2j(I) R f (I) ln K i2g(I)
x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) R f (I )

j(I) R f (I) ln K i2g (I) R f (I) 2 ln K i2g(I)

399
R f (I)
Focusing on and using the linear model for permeability resistance factor
ln K i2g(I)

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K i2g (I) ln K i2 g(I) w sa,max(I) ln K i2 g(I)

Thus

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


= j(I) + x i1 j(I) +
ln K i2g(I) j(I) R f (I) ln K i2g(I) ln K i2g(I) 2j(I) R f (I) ln K i2g(I)
x i1 j(I) j(I) 1 k 0rj(I) k 0 (R 1) w sa (I)
ro(I)2 f ,max(I)
j(I) R f (I) ln K i2g (I) R f (I) w sa,max(I) ln K i2g(I)

w sa (I)
Focusing on and knowing that w sa , mass of adsorbed asphaltene per mass of
ln K i2g(I)
rock is defined as

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Hence

N s(I) M s(I) (I)



w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
ln K i2g (I) ln K i2g(I) (1-(I) ) R(I) ln K i2g(I)
and

400
Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I) +
ln K i2g(I) j(I) R f (I) ln K i2g(I) ln K i2g(I) 2j(I) R f (I) ln K i2g(I)

x i1 j(I) j(I) 1 k 0rj(I) k 0 (R 1) M s(I) (I) N s(I)


rj(I) 2 f ,max(I)
j(I) R f (I) ln K i2g (I) R f (I) w sa ,max(I) (1-(I) ) R(I) ln K i2g (I)

N s(I)
To get let N s be the moles of asphaltene that precipitate from the heaviest
ln K i2g(I)
component n c in crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Hence

Ns(I) Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K i2 g(I) ln K i2g (I) ln K i2g(I) ln K i 2g(I) ln K i2g (I)
nc
Ni(I)
i =1 =L
nc
N i(I)
= Ls(I) s(I) =0
ln K i2 g(I) i =1 ln K i 2 g(I)

Hence, finally we have

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I)
ln K i2g(I) j(I) R f (I) ln K i2g(I) ln K i2g (I) 2j(I) R f (I) ln K i2g (I)
(D.1)
x i1 j(I) j(I) k 0rj(I)
+
j(I) R f (I) ln K i2g(I)

Then the derivatives for the four scenarios are

M aconv Ti1 j(I) a

1. = v j(I +1/ 2)
ln K i2g(I) ln K i2g(I)

M aconv Ti1 j(I) a

2. = v j(I 1/ 2)
ln K i2 g(I) ln K i2g(I)

401
M aconv
3. =0
ln K i2 g(I)

M aconv Tia1 j(I) Tia1 j(I)


4. = v j(I+1/ 2) v j(I 1/ 2)
ln K i2 g(I) ln K i2 g(I) ln K i2g(I)

For the source term, we have

k arj(I) j(I)
1 ( f w ) 3 k a

q i(I) ln K i2g(I) ln K i2g(I)
a j(I) rj(I)
inj P P
ln K i2g (I)
= c(I)
( Vt )inj j=1 j(I)
2 ( wf j(I) )

Using

k 0rj(I)
R f (I) =
k arj(I)

k 0rj(I)

R f (I) k 0
rj(I) j(I)
1 f 3 j(I)
q i(I) ( w )inj ln K i2g(I) R f (I) ln K i2g(I)
a

ln K i2 g(I)
= c(I)
( Vt )inj 2j(I)
(P
wf Pj(I) )
j=1

A rearrangement gives

k 0rj(I)
1 ( f w ) 3
q i(I)
a
1 0
j(I)
inj R f (I) k rj(I)
ln K i2g (I)
= c(I)
( Vt )inj R f (I) 2j(I) ln K i2g(I)
( Pwf Pj(I) )
j=1 j(I) ln K i 2 g(I)


Focusing on

k0 k 0rj(I) R f (I)
rj(I) R f (I) k 0
R ln K i2 g(I)
rj(I)
ln K i2 g(I)
f (I) =
ln K i2g (I) 2
R f (I)

402
Thus

q i(I)
a 1 ( f w )
= c(I) inj

ln K i2 g(I) ( Vt )inj
3 k 0rj(I) R f (I) k 0rj(I) j(I)
( Pwf Pj(I) )
1

j=1 j(I) R f (I)
2
R
f (I) ln K i g(I)
k 0
rj(I)
ln K i2g(I) R f (I) 2j(I) ln K i2g(I)
2

Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K i2g (I) ln K i2 g(I) w sa,max(I) ln K i2 g(I)

Thus

q i(I)
a 1 ( f w )
= c(I)
inj

ln K i2g (I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) w sa (I) 0
k rj(I) j(I)
( Pwf Pj(I) )
1
2 f (I)

j=1 j(I) R f (I)
R
ln K i2 g(I)
k 0
rj(I)
w sa,max(I) ln K i2g(I) R f (I) j(I) ln K i2 g(I)
2

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Therefore

403
N s(I) M s(I) (I)

w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
ln K i2g (I) ln K i2g(I) (1-(I) ) R(I) ln K i2g(I)
and

q i(I)
a 1 ( f w )
= c(I)
inj

ln K i2g(I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) M s(I) (I) N s(I) k 0rj(I) j(I)
1
R f (I) k 0rj(I) ( P Pj(I ) )
j=1 j(I) R f (I)
2
ln K i2 g(I) w sa,max(I) (1-(I) ) R(I) ln K i2g(I) R f (I) 2j(I) ln K i 2g(I) wf

Where

nc
N s = Ls N T =Ls N i
i =1

Hence

Ns(I) Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K i2 g(I) ln K i2g (I) ln K i2g(I) ln K i2g(I) ln K i2g (I)
nc
Ni(I)
Ls(I) i =1 =L
nc
Ni(I)
= N T(I) + Ls(I) s(I) =0
ln K i2g(I) ln K i 2g(I) i =1 ln K i 2 g(I)

So finally we have

q i(I)
a 1 ( f w ) 3 k rj(I)
0
k 0rj(I) j(I)
= c(I)
inj
( Pwf Pj(I) )
1
ln K i2g(I)

( Vt )inj j=1 j(I) R f (I) ln K i2g(I) R f (I) j(I) ln K i2g(I)
2

D.1.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
ln K i2g(I1) ln K i2g(I1) ln K i2g(I 1) ln K i2g (I 1)

404
For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t =0
=
ln K i2g(I1) ln K i2g(I 1)

For the cell to the left side of diagonal in x direction, the four scenarios are

M aconv Ti1 j(I 1)


a

1. = v j(I1/ 2)
ln K i2g(I 1) ln K i2 g(I1)

M aconv
2. =0
ln K i2g(I 1)

M aconv Ti1 j(I 1)


a

3. = v j(I1/ 2)
ln K i2g(I 1) ln K i2 g(I1)

M aconv
4. =0
ln K i2g(I 1)

Tia1 j(I1)
Substituting (I) with (I-1) in Equation (D.1), we can get the terms for oil and
ln K i2g(I 1)
gas phases.

Similarly, for the cell to the right side of diagonal in x direction, we have

M aconv
1. =0
ln K i2g(I +1)

M aconv Ti1 j(I+1)a

2. = v j(I +1/ 2)
ln K i2g(I+1) ln K i2 g(I+1)

M aconv Ti1 j(I+1)


a

3. = v j(I +1/ 2)
ln K i2g(I+1) ln K i2 g(I+1)

405
M aconv
4. =0
ln K i2g(I +1)

Tia1 j(I +1)


Substituting (I) with (I+1) in Equation (D.1), we can get the terms for oil
ln K i2g(I +1)
and gas phases.

For the source term, we have

M source
a
q ia1 (I)
= =0
ln K i2g(I1) ln K i2 g(I1)

D.2 DERIVATIVES WITH RESPECT TO N i

D.2.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M aconv M source


a
= +
N i2 (I) N i2 (I) Ni2 (I) N i2 (I)

For the accumulation term, we have

Vb(I) (I) N i1 (I)


0 i1 i 2
M accum t =
= Vb(I) (I)
N i2 (I) Ni2 (I) i1 = i 2
t

For the convection term, if neglecting the effect of the change in N i on capillary
pressure we have

v j(I)
=0
N i(I)

The derivative of transmissibility with respect to number of moles of hydrocarbon


components with the effect of asphaltene precipitation is

406
Tia1 j(I) x i1 j(I) j(I) arj(I) x i1 j(I) j(I) arj(I)
= = arj(I) j(I) + x i1 j(I) rj(I)
a
+ x i1 j(I) j(I)
Ni2 (I) N i2 (I) Ni2 (I) N i2 (I) N i2 (I)

The relative mobility of phase j with the effect of asphaltene precipitation is

k arj(I)
a
=
j(I)
rj(I)

Therefore

k arj(I) j(I)
j(I) k arj(I)
Tia1 j(I) k arj(I) x i1 j(I) j(I) N i2 (I) Ni2 (I)
= j(I) + x i1 j(I) + x i1 j(I) j(I)
Ni2 (I) j(I) Ni2 (I) Ni2 (I) j(I)
2


Using the definition of permeability resistance factor to take into account the change of
the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Hence

k 0rj(I)

R k 0

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I)
j(I)
f (I)
= j(I) + x i1 j(I) +
rj(I) j(I)

Ni2 (I) R f (I) j(I) N i2 (I) N i2 (I) j(I)


2 Ni2 (I) R N
f (I) i2 (I)


k rj(I)
0
R f (I)
R f (I) k 0rj(I)
k rj(I)
0
x i1 j(I) j(I) x i1 j(I) j(I) N i2 (I) N i2 (I) k rj(I) j(I)
0

= j(I) + x i1 j(I) + j(I)


R f (I) j(I) N i2 (I) N i2 (I) 2j(I) R f2(I) R N
f (I) i2 (I)

Using the linear model for permeability resistance factor

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

407
Therefore

Tia1 j(I) k 0rj(I) x i1 j(I) j(I)


= j(I) + x i1 j(I) +
Ni2 (I) R f (I) j(I) N i2 (I) N i2 (I)
k 0rj(I) (R f ,max(I) 1) w sa (I)
R f (I) k rj(I)
0

x i1 j(I) j(I) Ni2 (I) w sa,max(I) N i2 (I) k rj(I) j(I)
0

j(I)
2j(I) R f (I) 2 R f (I) N i2 (I)


w sa , mass of adsorbed asphaltene per mass of rock is defined as

Ns(I) M s(I) (I)


w sa(I) =
(1- ) (I) R(I)

Hence

Tia1 j(I) k 0rj(I) x i1 j(I) j(I)


= j(I) + x i1 j(I)
Ni2 (I) R f j(I) N i2 (I) N i2 (I)

x i j(I) j(I) 1 k rj(I)


0
(R 1) N s(I) M s(I) (I) k 0rj(I) j(I)
+ 1 2 j(I) j(I) k 0rj(I) f ,max(I) 2
j(I)

R f N i2 (I)
(
w sa,max(I) R f Ni 2 (I) 1-(I) R(I) ) R f N i (I)
2

A rearrangement gives

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


= j(I) + x i1 j(I) + 2 j(I) k 0rj(I)
Ni2 (I) j(I) R f N i2 (I) N i2 (I) j(I) R f N i2 (I) N i2 (I)

x i1 j(I) j(I) j(I) k 0rj(I) (R f ,max(I) 1) M s(I) (I) Ns(I)



2j(I)

w sa,max(I) R f 2 (1-(I) ) R(I) Ni2 (I)
Focusing on

Ns(I)
=?
Ni2 (I)

408
Let N s be the moles of asphaltene that precipitate from the heaviest component n c in
crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Therefore

nc
N i1 (I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i1 =1 =L
nc
N i1 (I)
= = N T(I) + Ls(I) = Ls(I) s(I) = Ls(I)
Ni2 (I) Ni 2 (I) Ni 2 (I) N i2 (I) N i2 (I) i =1 N i 2 (I)

Hence, finally we have

Tia1 j(I) j(I) k 0rj(I) x i1 j(I) x i1 j(I) k 0rj(I) j(I) x i1 j(I) j(I) k 0rj(I) x i1 j(I) j(I) k 0rj(I) j(I)
= + +
Ni2 (I) j(I) R f (I) Ni2 (I) j(I) R f (I) Ni2 (I) j(I) R f (I) N i2 (I) 2j(I) R f (I) N i2 (I)
k 0 (R 1)M s(I) Ls(I) (I)
x i1 j(I) j(I) rj(I) f ,max(I) (D.2)
j(I) R f (I) 2 w sa,max(I) (1-(I) ) R(I)

For the four scenarios, we have

M aconv Ti1 j(I)


a

1. = v j(I+1/ 2)
Ni2 (I) Ni2 (I)

M aconv Tia1 j(I)


2. = v j(I1/ 2)
Ni2 (I) N i2 (I)

M aconv
3. =0
Ni2 (I)

M conv
a
Tia1 j(I) Ti1aj(I)
4. = v j(I +1/ 2) v j(I1/ 2)
Ni2 (I) N i2 (I) Ni2 (I)

For the source term, we have

( q ) = [1 f ] ( z ) ( q )
a
i z w i
a
t z

409
If i1 i 2

q ia1 (I)
=0
N i2 (I)

If i1 = i 2 = i

3 a
q i(I)
a 1 ( f w ) rj(I) ( Pwf Pj(I) )

= c(I) inj j=1
N i(I) ( Vt )inj N i(I)
1 ( f w ) 3 a
inj
= c(I) rj(I)

( t )inj j=1 i(I) wf j(I)


V N
(P P )
k arj(I)
1 ( f w ) 3
inj j P P
= c(I)
( Vt )inj j=1 Ni(I)
( wf j(I) )
k arj(I) j(I)
1 ( f w ) 3 k a

Ni(I) Ni(I)
j(I) rj(I)
inj Pwf Pj(I) )
= c(I)
( Vt )inj j=1 j(I)
2 (

Using

k 0rj(I)
R f (I) =
k arj(I)

k0
q i(I) 1 ( f w ) 3 rj(I)
R f (I) k 0 ( Pwf Pj(I) )


a
inj rj(I)
N i(I)
= c(I)
( Vt )inj j=1 j(I) N i(I)

R

N
j(I)
2j(I)
f (I) i(I)

410
k 0rj(I) R f (I)
1 ( f w ) 3 R f (I) k 0rj(I)
inj Ni(I) Ni(I) k 0rj(I) j(I) ( Pwf Pj(I) )
( Vt )inj
= c(I) j(I)
R f (I)
j=1

R f2(I) N i(I)
2j(I)


Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

and

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Ni(I) N i(I) w sa,max(I) N i(I)

Thus

k 0rj(I) (R f ,max(I) 1) w sa (I)


R f (I) k 0rj(I)
N i(I) w sa,max(I) N i(I)
q i(I) 1 ( f w ) 3
( Pwf Pj(I) )
j(I)
a
inj

N i(I)
= c(I)
( Vt )inj j=1 0
R f2(I) 2j(I)


k rj(I) j(I)
R f (I) N i(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

and

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
N i(I) Ni(I) (1-(I) ) R(I) Ni(I)

411
Hence

k 0rj(I) (R f ,max(I) 1) M s(I) (I) Ns(I)


R f (I) k 0rj(I)
Ni(I) w sa,max(I) (1-(I) ) R(I) Ni(I)
q i(I) 1 ( f w ) 3 ( Pwf Pj(I) )
a
inj

( Vt )inj
= c(I)
j(I)
R 2

Ni(I) j=1
f (I)
2j(I)
k rj(I) j(I)
0


R f (I) Ni(I)

where

nc
N s = Ls N T =Ls N i
i =1

Thus

nc
N i(I)
N s(I) (Ls(I) N T(I) ) Ls(I) N T(I) Ls(I) i =1 =L
= = N T(I) + Ls(I) = N T(I) + Ls(I)
Ni(I) N i(I) Ni(I) Ni(I) Ni(I) Ni(I)
s(I)

Hence, finally we have

1 k 0rj(I) 0
k rj(I) j(I)
2
q i(I)
a 1 ( f w ) 3 j(I) R f (I) N i(I) j(I) R f (I) N i(I)

( Pwf Pj(I) )
inj
= c(I) 0
Ni(I) ( Vt )inj j=1 k rj(I) (R f ,max(I) 1)M s(I) (I) Ls(I)

j(I) R f (I) w sa ,max(I) (1-(I) ) R(I)
2

Note that the impact of the change in N i on capillary pressure is neglected.

D.2.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M aconv M sourcea


= +
N i2 (I 1) Ni2 (I1) N i2 (I 1) N i2 (I 1)

For the accumulation term, we have

412
Vb(I) (I) Ni1 (I)

M accum t =0
=
N i2 (I1) Ni2 (I1)

For convection term, the derivatives of the four scenarios for the cell to the left side of
the diagonal in x direction are

M aconv Tiaj(I1)
1. = 1 v j(I1/ 2)
N i2 (I 1) Ni2 (I1)

M aconv
2. =0
N i2 (I 1)

M aconv Tiaj(I1)
3. = 1 v j(I1/ 2)
N i2 (I 1) Ni2 (I1)

M aconv
4. =0
N i2 (I 1)

Tia1 j(I 1)
Substituting (I) with (I-1) in Equation (D.2), we can get the terms for oil and gas
N i2 (I 1)
phases.

Similarly, for the cell to the right side of the diagonal in x direction, we have

M aconv
1. =0
N i2 (I +1)

M aconv Tia1 j(I+1)


2. = v j(I+1/ 2)
N i2 (I +1) Ni2 (I+1)

M aconv Tia1 j(I+1)


3. = v j(I+1/ 2)
N i2 (I +1) Ni2 (I+1)

413
M aconv
4. =0
N i2 (I +1)

Tia1 j(I+1)
Substituting (I) with (I+1) in Equation (D.2), we can get the terms for oil and
N i2 (I+1)
gas phases.

For the source term, we have

q ia1 (I)
=0
N i2 (I 1)

D.3 DERIVATIVES WITH RESPECT TO P

D.3.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
P(I) P(I) P(I) P(I)

For the accumulation term, we have

V N
b(I) (I) i(I)
M accum
=
t = Vb(I) cf 0(I) N i(I)
P(I) P(I) t

For the convection term, the derivative of transmissibility with respect to pressure with
the effect of asphaltene precipitation is

Tij(I)
a
x ij(I) j(I) arj(I) x ij(I) j(I) arj(I)
= = a
j(I) + x ij(I) a
+ x ij(I) j(I)
P(I) P(I) P(I) P(I) P(I)
rj(I) rj(I)

Note that N i = const. and K ig = const.

If x ij changes as P changes, the condition, K ig is constant will be violated so

414
x ij(I)
=0
P(I)

Knowing that

k arj(I)
a
=
j(I)
rj(I)

Therefore

k arj(I) j(I)
j(I) k arj(I)
T a
k a
j(I) P(I) P(I)
ij(I)
= x ij(I) rj(I)
+ x ij(I) j(I)
P(I) j(I) P(I) 2
j(I)

x ij(I) j(I) j(I) k arj(I)


= 2 j(I) k rj(I)
a
+ k rj(I) j(I)
a
+ j(I) j(I)
j(I) P(I) P(I) P(I)
x ij(I) a j(I) k arjI)
= 2 j(I) k rj(I) + j(I) j(I) k arj(I) j(I)
j(I) P(I) P(I) P(I)

Using the definition of permeability resistance factor to take into account the change of
relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Hence

k 0rj(I)
0
Tij(I) k rj(I) j(I) R f (I)
k rj(I) j(I)
a 0

=
x ij(I)
P(I) 2j(I) j(I) R P
+ j(I)
P(I)
j(I)
R f (I) P(I)
f (I) (I)


k 0rj(I) R f (I)
0 R k 0rj(I)
k rj(I) j(I) + P(I) P(I) k rj(I) j(I)
f (I) 0
x ij(I)
= j(I) R
2j(I) P j(I) R
f (I) P(I)
j(I)
R f2(I)
f (I) (I)

415
k 0rj(I) R f (I)
R f (I) k rj(I)
0

x ij(I) 0 j(I) P(I) P(I) j(I)
= 2 j(I) k rj(I) + j(I) j(I) k rj(I) P
0

j(I) R f (I) P(I) R f (I)


(I)



x 0 j(I) k 0
k R f (I)
0

= 2 ij(I) j(I) k rj(I) + j(I) rj(I) j(I) rj(I) j(I) k 0rj(I) j(I)
j(I) R f (I) P(I) P(I) R f (I) P(I) P(I)

Using the linear model for permeability resistance factor

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore

Tij(I)
a
x ij(I) j(I) k 0rj(I)
= 2 j(I) k rj(I) + j(I) j(I)
0

P(I) j(I) R f (I) P(I) P(I)


(R 1)
j(I) j(I) k 0rj(I) f ,max(I)
w sa,max(I) w sa (I)
j(I) k 0rj(I) j(I)
R f (I) P(I) P(I)

w sa , mass of adsorbed asphaltene per mass of rock is defined as

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Thus

Tij(I)
a
x ij(I) j(I) k 0rj(I)
=
j(I) rj(I)
k 0
+
P(I) o(I) P(I) P(I)
2 j(I) j(I)
R f (I)

(R f ,max(I) 1) N s(I) M s(I) (I)
j(I) j(I) k rj(I)
0
(1-(I) ) R(I) k 0 j(I)
w sa ,max(I)

P(I) P(I)
j(I) rj(I)
R f (I)

416
A rearrangement gives

Tij(I)
a
x ij(I) j(I) k 0rj(I)
= 2 j(I) k rj(I)
0
+ j(I) j(I)
P(I) j(I) R f (I) P(I) P(I)
(R 1)
j(I) j(I) k 0rj(I) f ,max(I)
w sa,max(I) M s(I) (I) Ns(I) j(I)
k 0

R f (I) (1-(I) ) R(I) P(I) j(I) rj(I) P(I)


Focusing on

N s(I)
=?
P(I)

Let N s be the moles of asphaltene that precipitate from the heaviest component n c in
crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

nc
N i(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =L
nc
N i(I)
= = N T(I) + Ls(I) = Ls(I) s(I) =0
P(I) P(I) P(I) P(I) P(I) i =1 P(I)

Hence, finally we have

Tij(I)
a
x ij(I) j(I) k rj(I)
0
j(I)
= j(I) k 0rj(I) + j(I) j(I) k rj(I)
0
(C.3)
P(I) 2
R f (I) P(I) P(I) P(I)
j(I)

For the four scenarios, we have

M aconv Tij(I)
a

1. = v j(I +1/ 2)
P(I) P(I)

417
M aconv Tij(I)
a

2. = v j(I1/ 2)
P(I) P(I)

M conv
3. =0
P(I)

M aconv Tij(I)
a
Tij(I)
a

4. = v j(I +1/ 2) v j(I1/ 2)


P(I) P(I) P(I)

For the source term, we have

k arj(I) j(I)
1 ( f w ) 3 j(I) P k rj(I) P
a

q i(I)
a
inj
a
k rj(I)
P(I)
= c(I)
( Vt )inj
(I)

2j(I)
(I)
( Pwf Pj(I) )
j=1
j(I)

Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

k 0rj(I)

R f (I) k 0 k 0rj(I)
rj(I)
1 ( f w ) 3 j(I)
j(I)

q i(I)
a
P(I) R f (I) P(I)
inj R f (I)
= c(I)
( Vt )inj
(P Pj(I) )
P(I) j=1 j(I)
2 wf
j(I)



Focusing only on the terms that will be affected by asphaltene precipitation we will have

k0 k 0 R f (I)
ro(I) R f (I) ro(I) k 0ro(I)
R f (I) P(I) P(I)
=
P(I) 2
R f (I)

418
Thus

k 0rj(I) R f (I)
R k 0rj(I)
P(I) P(I) k 0rj(I) j(I)
f (I)
k 0rj(I)
1 ( f w ) 3 j(I)
q i(I)
a
inj R f2(I) R f (I) P(I) R
P(I)
= c(I)
( Vt )inj j=1
j(I)
2 ( Pwf Pj(I) ) f (I)
j(I)




Using the linear model for permeability resistance factor

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore,

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
P(I) P(I) w sa,max(I) P(I)

Hence,

k 0rj(I) (R 1) w sa (I)
R k 0rj(I) f ,max(I)
P(I) P(I) k 0rj(I) j(I)
f (I)
w sa,max(I)
q i(I)
a 1 ( f w ) 3 j(I) R 2

R f (I) P(I)

( Vt )inj
= c (I)
inj f (I)

P(I) j=1 2j(I)

k 0rj(I)
( wf
P P j(I) )
R f (I) j(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- ) (I) R(I)

Therefore

419
N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
P(I) P(I) (1-(I) ) R(I) P(I)
k 0rj(I) (R 1) M s(I) (I) N s(I)
R f (I) k 0ro(I) f ,max(I)
P(I) w sa,max(I) (1-(I) ) R(I) P(I) k 0rj(I) j(I)
q i(I)
a 1 ( f w ) 3 j(I) R f2(I)

R f (I) P(I)

inj
= c (I)
P(I) ( Vt )inj j=1 j(I)
2

k 0rj(I)
( Pwf Pj(I) )
R f (I) j(I)

Where,

nc
N s = Ls N T =Ls N i
i =1

Thus,

nc
N i(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =0
= = N T(I) + Ls(I) = Ls(I)
P(I) P(I) P(I) P(I) P(I)

Hence, finally we have

k 0rj(I) j(I)
1 ( f w ) 3 k 0

q i(I) P(I) P(I)
a j(I) rj(I)
inj k 0rj(I)
P(I)
= c(I)
( Vt )inj R f (I) 2j(I)
( Pwf Pj(I) ) R
j=1
f (I) j(I)

D.3.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
P(I1) P(I1) P(I1) P(I1)

420
For the accumulation term

M accum
=0
P(I1)

For the convection term, the derivatives of the four scenarios for the cell to the left side
of the diagonal in x direction are

M conv
a
Tij(I
a
1)
1. = v j(I1/ 2)
P(I1) P(I 1)

M aconv
2. =0
P(I1)

M conv
a
Tij(I
a
1)
3. = v j(I1/ 2)
P(I1) P(I 1)

M aconv
4. =0
P(I1)

Tij(I
a
1)
Substituting (I) with (I-1) in Equation (D.3), we can get the terms for oil and gas
P(I 1)
phases.

Similarly, for the cell to the right side of the diagonal in x direction, we have

M aconv
1. =0
P(I+1)

M aconv Tij(I
a
+1)
2. = v j(I +1/ 2)
P(I+1) P(I +1)

M aconv Tij(I
a
+1)
3. = v j(I +1/ 2)
P(I+1) P(I +1)

M aconv
4. =0
P(I+1)

421
Tij(I
a
+1)
Substituting (I) with (I+1) in Equation (D.3), we can get the terms for oil and gas
P(I+1)
phases.

For the source term we have

M source
a
=0
P(I 1)

D.4 DERIVATIVES WITH RESPECT TO lnK n cs

D.4.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
ln K n cs(I) ln K n cs(I) ln K n cs(I) ln K n cs(I)

For the accumulation term, we have

Vb(I) (I) Ni1 (I)



M accum t =0
=
ln K n cs(I) ln K n cs(I)

For the convection term, neglecting the effect of the change in ln K n cs on capillary
pressure, then

v j(I)
=0 i = nc
ln K is(I)

The derivative of transmissibility is

Tia1 j(I) x i1 j(I) j(I) rj(I)


a
x i1o(I) o(I) aro(I)
= = a
o(I) + x i1o(I) + x i1o(I) o(I)
ln K n cs(I) ln K n cs(I)
ro(I)
ln K n cs(I) ln K n cs(I) ln K n cs(I)

Knowing that

422
k arj(I)
a
=
j(I)
rj(I)

Therefore,

k arj(I) j(I)

j(I) k arj(I)
T a
k a
x i1 j(I) j(I) ln K n cs(I) ln K n cs(I)
= j(I) + x i1 j(I) + x i1 j(I) j(I)
i1 j(I) rj(I)

ln K n cs(I) j(I) ln K n cs(I) ln K n cs(I) j(I)


2


Using the definition of permeability resistance factor for the oil phase to take into account
the change of the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Thus,

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I)
ln K ncs(I) j(I) R f (I) ln K ncs(I) ln K ncs(I) 2j(I) R f (I) ln K ncs(I)
k0
rj(I)
x i j(I) j(I) R f (I)
+ 1 2
j(I) j(I)
ln K ncs( I)


Focusing on the terms that will be affected by asphaltene precipitation we need

k 0rj(I) k 0rj(I) R f (I)

R f (I) R f (I) ln K k 0rj(I)


ln K n cs(I) k 0rj(I) k 0rj(I) R f (I)
= n c s(I)
=
1

ln K n cs(I) R f (I) 2 R f (I) ln K n cs(I) R f (I) 2 ln K n cs(I)

Thus,

423
Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k rj(I)
0
j(I)
= j(I) + x i1 j(I)

ln K ncs(I) j(I) R f (I) ln K ncs(I)
ln K ncs(I) j(I) R f (I) ln K ncs(I)
2

x i j(I) j(I) 1 k 0rj(I) k 0rj(I) R f (I )


+ 1
j(I) R f (I) ln K ncs(I) R f (I) 2 ln K ncs(I)

R f (I)
Focusing on and using the linear model for permeability resistance factor
ln K n cs(I)

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore,

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K n cs(I) ln K n cs(I) w sa,max(I) ln K n cs(I)

Thus,

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k rj(I)
0
j(I)
=
j(I) + x
ln K ncs(I) j(I) R f (I) ln K ncs(I) ln K ncs(I) j(I) R f (I) ln K ncs(I)
i1 j(I) 2

x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) (R f ,max(I) 1) w sa (I)


+
j(I) R f (I) ln K ncs(I) R f (I) 2 w sa,max(I) ln K ncs(I)

w sa (I)
Focusing on and knowing that w sa , mass of adsorbed asphaltene per mass of
ln K n cs(I)
rock is defined as

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Hence,

424
N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
ln K n cs(I) ln K n cs(I) (1-(I) ) R(I) ln K ncs(I)
And,

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I)
ln K ncs(I) j(I) R f (I) ln K ncs(I) ln K ncs(I) 2j(I) R f (I) ln K ncs(I)

x i j(I) j(I) 1 k 0rj(I) k 0ro(I) (R f ,max(I) 1) M s(I) (I) N s(I)


+ 1
j(I) R f (I) ln K ncs(I) R f (I) w sa,max(I) (1-(I) ) R(I) ln K ncs(I)
2

Ns(I)
To get , let N s be the moles of asphaltene that precipitate from the heaviest
ln K n cs(I)
component n c in crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Hence,

N s(I) Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K n cs(I) ln K n cs(I) ln K n cs(I) ln K n cs(I) ln K n cs(I)
nc
Ni(I)
i =1 =L
nc
N i(I)
= Ls(I) s(I) =0
ln K n cs(I) i =1 ln K n cs(I)

Hence, finally we have

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k rj(I)
0
j(I)
= j(I) + x i1 j(I)
ln K ncs(I) j(I) R f (I) ln K ncs(I) ln K ncs(I) 2j(I) R f (I) ln K ncs(I)
(D.4)
x i1 j(I) j(I) k 0rj(I)
+
j(I) R f (I) ln K n cs(I)

Then the derivatives for the four scenarios are

425
M aconv Ti1 j(I) a

1. = v j(I+1/ 2)
ln K n cs(I) ln K n cs(I)

M aconv Ti1 j(I) a

2. = v j(I1/ 2)
ln K n cs(I) ln K n cs(I)

M aconv
3. =0
ln K n cs(I)

M aconv Tia1 j(I) Ti1aj(I)


4. = v j(I+1/ 2) v j(I 1/ 2)
ln K n cs(I) ln K n cs(I) ln K n cs(I)

For the source term, we have

k arj(I) j(I)

1 ( f w ) 3 j(I) ln K k arj(I)
q a
inj ln K n cs(I) P P
= c(I) ( wf j(I) )
i(I) n cs(I)

ln K n cs(I) ( Vt )inj j=1 j(I)


2


Using

k 0ro(I)
R f (I) =
k aro(I)

k 0rj(I)

R k 0
f (I) rj(I) j(I)
q i(I)
a 1 ( f w ) 3 j(I) ln K n cs(I) R f (I) ln K n cs(I)
inj

ln K n cs(I)
= c(I)
( Vt )inj 2j(I)
(P
wf Pj(I) )
j=1

A rearrangement gives

426
k 0rj(I)
1 ( f w ) 3
q i(I)
a
R k 0

ln K n cs(I)
= c(I)
V
inj

( t )inj j=1 j(I)
1
ln K
f (I) rj(I) j(I)

R f (I) 2j(I) ln K n cs(I)


( Pwf Pj(I) )
n c s(I)


Focusing on

k0 k 0rj(I) R f (I)
rj(I) R f (I) k 0
R f (I) ln K n cs(I)
rj(I)
ln K n cs(I)
=
ln K n cs(I) 2
R f (I)

Thus

q i(I)
a 1 ( f w )
= c(I)
inj

ln K n cs(I) ( Vt )inj
3 k 0rj(I) R f (I) k 0rj(I) j(I)
R f (I) 2j(I) ln K n s(I) ( wf
P Pj(I) )
1
2

j=1 j(I) R f (I)
R f (I)
ln K n cs(I)
k 0rj(I)
ln K n cs(I)

c

Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence,

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I) w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K n cs(I) ln K n cs(I) w sa,max(I) ln K n cs(I)

Thus

427
1 f
q i(I) ( w )inj
a

= c(I)
ln K n cs(I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) w sa (I) k 0rj(I) j(I)
( Pwf Pj(I) )
1
R f (I)

j=1 j(I) R f (I) ln K n cs(I)
k rj(I)
0

w sa ,max(I) ln K n cs(I)


R f (I) j(I) ln K n cs(I)
2 2

with

Ns(I) M s(I) (I)


w sa(I) =
(1- ) (I) R(I)

Therefore,

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
ln K n cs(I) ln K n cs(I) (1-(I) ) R(I) ln K ncs(I)
and

q i(I)
a 1 ( f w )
= c(I) inj

ln K n cs(I) ( Vt )inj
1 k 0rj(I) (R f ,max(I) 1) M s(I) (I) Ns(I) k 0rj(I) j(I)
R k 0

( )
3
f (I) ln K n cs(I)


rj(I)

2 2
R w 1- ln K R ln K
j(I) f (I)
sa,max(I) (I) R(I) n c s(I)
f (I) j(I) n c s(I)

j=1

(P wf Pj( I) )

where

nc
N s = Ls N T =Ls N i
i =1

Hence,

N s(I) Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K n cs(I) ln K n cs(I) ln K n cs(I) ln K n cs(I) ln K n cs(I)

428
nc
Ni(I)
Ls(I) i =1 =L
nc
N i(I)
= N T(I) + Ls(I) s(I) =0
ln K n cs(I) ln K n cs(I) i =1 ln K n cs(I)

So finally we have

1 f 3
q i(I) ( w )inj k rj(I) j(I)
a 0 0
k rj(I)
( Pwf Pj(I) )
1
ln K n cs(I)
= c(I)


( Vt )inj j=1 j(I) R f (I) ln K ncs(I) R f (I) j(I) ln K ncs(I)
2

D.4.2 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
ln K n cs(I1) ln K n cs(I1) ln K n cs(I1) ln K n cs(I1)

For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t
= =0
ln K n cs(I 1) ln K n cs(I 1)

For the cell to the left side of diagonal in x direction, the four scenarios are

M aconv Tia1 j(I 1)


1. = v j(I1/ 2)
ln K n cs(I 1) ln K n cs(I 1)

M aconv
2. =0
ln K n cs(I 1)

M aconv Tia1 j(I 1)


3. = v j(I1/ 2)
ln K n cs(I 1) ln K n cs(I 1)

M aconv
4. =0
ln K n cs(I 1)

429
Tia1 j(I 1)
Substituting (I) with (I-1) in Equation (D.4), we can get the terms for oil and
ln K n cs(I1)
gas phases.

Similarly, for the cell to the right side of diagonal in x direction, we have

M aconv
1. =0
ln K n cs(I +1)

M aconv Tia1 j(I +1)


2. = v j(I +1/ 2)
ln K n cs(I +1) ln K n cs(I +1)

M aconv Tia1 j(I +1)


3. = v j(I +1/ 2)
ln K n cs(I +1) ln K n cs(I +1)

M aconv
4. =0
ln K n cs(I +1)

Tia1 j(I +1)


Substituting (I) with (I+1) in Equation (D.4), we can get the terms for the oil
ln K n cs(I+1)
and gas phases.

For the source term, we have

M source
a
q ia1 (I)
= =0
ln K n cs(I 1) ln K n cs(I 1)

D.5 DERIVATIVES WITH RESPECT TO Lg

D.5.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M aconv M source


a
= +
Lg(I) Lg(I) Lg(I) Lg(I)

430
For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t =0
=
Lg(I) Lg(I)

For the convection term, the derivative of transmissibility with respect to mole fraction
of gas phase with the effect of asphaltene precipitation is

Tia1 j(I) x i j(I) j(I) arj(I) x i1 j(I) j(I) arj(I)


= 1 = rj(I) j(I)
a
+ x i1 j(I) + x i1 j(I) j(I)
Lg(I) Lg(I) L g(I) Lg (I) Lg(I)

Knowing that

k arj(I)
arj(I) =
j(I)

Therefore

k arj(I) j(I)
j(I) k arj(I)
T a
k a
x i j(I) j(I) L g(I) Lg(I)
= j(I) 1 + x i1 j(I) + x i1 j(I) j(I)
i1 j(I) rj(I)

Lg(I) j(I) Lg(I) Lg(I) j(I)


2


Using the definition of permeability resistance factor for the oil phase to take into account
the change of the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Thus

431
k 0rj(I)

Tia1 j(I) k 0rj(I) x i j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I) x i1 j(I) j(I) R
f (I)
= j(I) 1 + x i1 j(I) + j(I)
Lg (I) j(I) R f (I) Lg (I) Lg(I) 2
R L 2j(I) Lg(I)
j(I) f (I) g (I)


Focusing on the terms that will be affected by asphaltene precipitation we need

k0 k 0 R f (I)
rj(I) R f (I) rj(I) k rj(I)
0
R f (I) Lg(I) Lg(I) 1 k rj(I) k rj(I) R f (I)
0 0
= =
Lg(I) R f (I) 2 R f (I) L g(I) R f (I) 2 Lg(I)

Thus

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


= j(I) + x i1 j(I)
Lg (I) j(I) R f (I) Lg (I) Lg(I) 2j(I) R f (I) Lg(I)
x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) R f (I)
+
j(I) R f (I) Lg(I) R f (I) 2 Lg (I)

R f (I)
Focusing on and using the linear model for permeability resistance factor
Lg(I)

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Lg(I) Lg(I) w sa,max(I) Lg(I)

Thus

432
Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I)
Lg (I) j(I) R f (I) Lg (I) Lg(I) 2j(I) R f (I) Lg(I)
x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) (R f ,max(I) 1) w sa (I)
+
j(I) R f (I) Lg(I) R f (I) 2 w sa,max(I) Lg(I)

w sa (I)
Focusing on and knowing that w sa , mass of adsorbed asphaltene per mass of
Lg(I)
rock is defined as

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Hence

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
L g(I) Lg(I) (1-(I) ) R(I) Lg(I)
and

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
=
j(I) + x i1 j(I)
Lg (I) j(I) R f (I) Lg (I) Lg(I) 2j(I) R f (I) Lg(I)

x i j(I) j(I) 1 k 0rj(I) k 0rj(I) (R f ,max(I) 1) M s (I) (I) N s(I)


+ 1
j(I) R f (I) Lg(I) R f (I) 2 w sa ,max(I) (1-(I) ) R(I) Lg(I)

Ns(I)
To get let N s be the moles of asphaltene that precipitate from the heaviest
Lg (I)
component n c in crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Hence

433
nc
Ni(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =L
nc
Ni(I)
= = N T(I) + Ls(I) = Ls(I) s(I) =0
Lg (I) Lg(I) Lg(I) Lg(I) Lg(I) i =1 L g(I)

Hence, finally we have

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


= j(I) + x i1 j(I)
Lg (I) j(I) R f (I) Lg (I) Lg(I) 2j(I) R f (I) Lg(I)
(D.5)
x i1 j(I) j(I) k 0rj(I)
+
j(I) R f (I) Lg(I)

Then the derivatives for the four scenarios are

M aconv Ti1 j(I)


a

1. = v j(I+1/ 2)
Lg(I) Lg(I)

M aconv Tia1 j(I)


2. = v j(I1/ 2)
Lg(I) Lg(I)

M aconv
3. =0
Lg(I)

M aconv Ti1 j(I) Tiaj(I)


a

4. = v j(I+1/ 2) 1 v j(I 1/ 2)
Lg(I) Lg(I) Lg(I)

For the source term, we have

k arj(I) j(I)
1 ( f w ) 3 j(I) L k rj(I) L
a

q a
inj P P
( wf j(I) )
= c(I)
i(I) g(I) g(I)

Lg (I) ( Vt )inj j=1 j(I)


2


Using

434
k 0rj(I)
R f (I) =
k arj(I)

k 0rj(I)

R
k rj(I) j(I)
0
f (I)
q i(I)
a 1 ( f w ) 3 j(I) Lg (I) R f (I) Lg (I)
inj

Lg(I)
= c(I)
( Vt )inj 2j(I)
(P
wf Pj(I) )
j=1

A rearrangement gives

k 0rj(I)
1 ( f w ) 3
q i(I) 1 R f (I) k 0rj(I) j(I)
a
inj

Lg (I)
= c(I)
( Vt )inj
R f (I) 2j(I) Lg(I)
( Pwf Pj(I) )
j=1 j(I) Lg(I)


Focusing on

k 0rj(I) k 0rj(I) R f (I)


R f (I) k 0rj(I)
R f (I) Lg(I) Lg(I)
=
Lg (I) R f2(I)

Thus

q i(I)
a 1 ( f w )
= c(I) inj

Lg (I) ( Vt )inj
3 k 0rj(I) R f (I) k 0rj(I) j(I)
( Pwf Pj(I) )
1
R f (I)
j=1 j(I) R f (I)
2
Lg(I)
k rj(I)
0

Lg(I) R f (I) 2j(I) Lg(I)

Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence,

435
w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Lg(I) Lg(I) w sa,max(I) Lg(I)

Thus

q i(I)
a 1 ( f w )
= c(I) inj

Lg (I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) w sa (I) k 0rj(I) j(I)
( Pwf Pj(I) )
1


j=1 j(I) R f (I)
R
Lg(I)
k 0

w sa,max(I) Lg(I)

R f (I) j(I) Lg(I)
2 f (I) rj(I) 2

with

Ns(I) M s(I) (I)


w sa(I) =
(1- ) (I) R(I)

Therefore

N s(I) M s(I)

w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
Lg(I) L g(I) (1-(I) ) R(I) Lg(I)
and

qi(I)
a 1 ( f w )
= c(I)
inj

L g(I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) M s(I) (I) Ns(I) k 0rj(I) j(I)
( Pwf Pj(I) )
1

j=1 j(I) R f (I)
2
R f (I)
L g(I)
k 0
rj(I)

w sa,max(I) (1-(I) ) R(I) Lg(I) R f (I) 2j(I) L g(I)

where

nc
N s = Ls N T =Ls N i
i =1

Hence,

436
nc
Ni(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =L
nc
Ni(I)
= = N T(I) + Ls(I) = Ls(I) s(I) =0
Lg (I) Lg(I) Lg(I) Lg(I) Lg(I) i =1 L g(I)

So finally we have

q i(I)
a 1 ( f w ) 3 k 0rj(I) 0
j(I)
= c(I)
inj k rj(I)
(P P )
1
L g(I)

( Vt )inj j=1 j(I) R f (I) Lg (I) R f (I) j(I) Lg(I) wf j(I)
2

D.5.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
Lg(I1) Lg(I1) L g(I1) Lg(I 1)

For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t =0
=
Lg(I 1) Lg(I1)

For the cell to the left side of diagonal in x direction, the four scenarios are

M aconv Tia1 j(I 1)


1. = v j(I 1/ 2)
Lg(I1) Lg(I 1)

M aconv
2. =0
Lg(I 1)

M aconv Tiaj(I 1)
3. = 1 v j(I 1/ 2)
Lg(I1) Lg(I 1)

M aconv
4. =0
Lg(I 1)

437
Tia1 j(I 1)
Substituting (I) with (I-1) in Equation (D.5), we can get the terms for oil and gas
Lg(I1)
phases.

Similarly, for the cell to the right side of diagonal in x direction, we have

M aconv
1. =0
Lg(I +1)

M aconv Ti1 j(I +1)


a

2. = v j(I+1/ 2)
Lg(I+1) Lg(I+1)

M aconv Ti1 j(I +1)


a

3. = v j(I+1/ 2)
Lg(I+1) Lg(I+1)

M aconv
4. =0
Lg(I +1)

Tia1 j(I +1)


Substituting (I) with (I+1) in Equation (D.5), we can get the terms for oil and
Lg(I +1)
gas phases.

For the source term, we have

M source
a
qia1 (I)
= =0
Lg(I 1) Lg(I 1)

D.6 DERIVATIVES WITH RESPECT TO Ls

D.6.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M aconv M source


a
= +
Ls(I) Ls(I) Ls(I) Ls(I)

For the accumulation term, we have

438
Vb(I) (I) N i1 (I)

M accum t
= =0
Ls(I) Ls(I)

For the convection term, the derivative of transmissibility with respect to mole fraction
of gas phase with the effect of asphaltene precipitation is

Tia1 j(I) x i1 j(I) j(I) arj(I) x i1 j(I) j(I) arj(I)


= = a
j(I) + x i1 j(I) + x i1 j(I) j(I)
Ls(I) Ls(I) Ls(I) Ls(I) Ls(I)
rj(I)

Knowing that

k arj(I)
a
=
j(I)
rj(I)

Therefore

k arj(I) j(I)

j(I) k rj(I)
a

T a
k a
x i j(I) j(I) Ls(I) Ls(I)
= j(I) 1 + x i1 j(I) + x i1 j(I) j(I)
i1 j(I) rj(I)

Ls(I) j(I) Ls(I) Ls(I) 2j(I)




Using the definition of permeability resistance factor for the oil phase to take into account
the change of the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

Thus

k0
rj(I)
T a 0
x i j(I) j(I) x i1 j(I) j(I) k j(I) x i1 j(I) j(I)
0 R
k f (I)
= j(I) 1 + x i1 j(I) + j(I)
i1 j(I)

rj(I) rj(I)

Ls(I) j(I) R f (I) Ls(I) Ls(I) 2j(I) R f (I) Ls(I) 2j(I) Ls(I)


Focusing on the terms that will be affected by asphaltene precipitation we need

439
k0 k 0 R f (I)
rj(I) R f (I) rj(I) k 0rj(I)
R f (I) Ls(I) Ls(I) 1 k rj(I) k rj(I) R f (I)
0 0
= =
Ls(I) R f (I) 2 R f (I) Ls(I) R f (I) 2 Ls(I)

Thus

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


= j(I) + x i1 j(I)
Ls(I) j(I) R f (I) Ls(I) Ls(I) 2j(I) R f (I) Ls(I)
x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) R f (I)
+
j(I) R f (I) Ls(I) R f (I) 2 Ls(I)

R f (I)
Focusing on and using the linear model for permeability resistance factor
Ls(I)

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Therefore,

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Ls(I) Ls(I) w sa,max(I) Ls(I)

Thus

Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)


=
j(I) + x
Ls(I) j(I) R f (I) Ls(I) Ls(I) 2j(I) R f (I) Ls(I)
i1 j(I)

x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) (R f ,max(I) 1) w sa (I)


+
j(I) R f (I) Ls(I) R f (I) 2 w sa,max(I) Ls(I)

w sa (I)
Focusing on and knowing that w sa , mass of adsorbed asphaltene per mass of
Ls(I)
rock is defined as

440
Ns(I) M s(I) (I)
w sa(I) =
(1- )
(I) R(I)

Hence,

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
Ls(I) Ls(I) (1-(I) ) R(I) Ls(I)
and

Tia1 j(I)
k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
=
j(I) + x
Ls(I) j(I) R f (I) Ls(I) Ls(I) 2j(I) R f (I) Ls(I)
i1 j(I)

x i1 j(I) j(I) 1 k 0rj(I) k 0rj(I) (R f ,max(I) 1) M s (I) (I) N s(I)


+
j(I) R f (I) Ls(I) R f (I) 2 w sa ,max(I) (1-(I) ) R(I) Ls(I)

N s(I)
To get let N s be the moles of asphaltene that precipitate from the heaviest
Ls(I)
component n c in crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Hence,

nc
N i(I)
N s(I) Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1
= = = N T(I) + Ls(I) = N T(I) + Ls(I)
Ls(I) Ls(I) Ls(I) Ls(I) Ls(I) Lg (I)
nc
Ni(I)
=N T(I) + Ls(I) = N T(I)
i =1 Lg(I)

Hence, finally we have

441
Tia1 j(I) k 0rj(I) x i1 j(I) j(I) x i1 j(I) j(I) k 0rj(I) j(I)
= j(I) + x i1 j(I)
Ls(I) j(I) R f (I) Ls(I) Ls(I) 2j(I) R f (I) Ls(I)
(D.6)
x i1 j(I) j(I) k 0rj(I) x i1 j(I) j(I) k 0rj(I) (R f ,max(I ) 1)M s(I) (I) N T(I)
+
j(I) R f (I) Ls(I) R f (I) 2 j(I) w sa,max(I) (1-(I) ) R(I)

Then the derivatives for the four scenarios are

M aconv Ti1 j(I)


a

1. = v j(I+1/ 2)
Ls(I) Ls(I)

M aconv Ti j(I) a

2. = 1 v j(I1/ 2)
Ls(I) Ls(I)

M aconv
3. =0
Ls(I)

M aconv Ti1 j(I) Tiaj(I)


a

4. = v j(I+1/ 2) 1 v j(I 1/ 2)
Ls(I) Ls(I) Ls(I)

For the source term, we have

k arj(I) j(I)
1 ( f w ) 3 j(I) L k rj(I) L
a

q a
inj P P
( wf j(I) )
= c(I)
i(I) s(I) s(I)

Ls(I) ( Vt )inj j=1 j(I)


2


Using

k 0rj(I)
R f (I) =
k arj(I)

k 0rj(I)

R k 0
f (I) rj(I)
1 ( f w ) 3 j(I)
j(I)

q i(I)
a
inj Ls(I) R f (I) Ls(I)
Ls(I)
= c(I)
( Vt )inj 2j(I)
(P wf Pj(I) )
j=1

442
A rearrangement gives

k 0rj(I)
1 ( f w ) 3
q i(I)
a
R f (I) k 0rj(I) j(I)
Ls(I)
= c(I)
( Vt )inj
inj

1
Ls(I)
( Pwf Pj(I) )
j=1 j(I) Ls(I) R f (I) 2j(I)


Focusing on

k0 k 0rj(I) R f (I)
rj(I) R f (I) k rj(I)
0
R f (I) Ls(I) Ls(I)
=
Ls(I) 2
R f (I)

Thus

q i(I)
a 1 ( f w ) 3 k 0rj(I) R f (I) k 0rj(I) j(I)
= c(I)
inj
R 2 L ( wf
P Pj(I) )
1
( Vt )inj
R
f (I) L
k 0

Ls(I) j=1 j(I) R f (I)
2 rj(I)
s(I) L s(I) f (I) j(I) s(I)

Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence,

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Ls(I) Ls(I) w sa,max(I) Ls(I)

Thus,

443
q i(I)
a 1 ( f w )
= c(I) inj

Ls(I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) w sa (I) k 0rj(I) j(I)
( Pwf Pj(I) )
1
R f (I)
j=1 j(I) R f (I)
2

k rj(I)
0



2

L s(I) w sa,max(I) L s(I) R f (I) j(I) L s(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Therefore

N s(I) M s(I)

w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
Ls(I) Ls(I) (1-(I) ) R(I) Ls(I)
and

q i(I)
a 1 ( f w )
= c(I) inj

Ls(I) ( Vt )inj
3 k 0rj(I) (R f ,max(I) 1) M s(I) (I) N s(I) k 0rj(I) j(I)
( Pwf Pj(I) )
1

j=1 j(I) R f (I)
2
R f (I)
Ls(I)
k 0
rj(I)

w sa ,max(I) (1-(I) ) R(I) Ls(I) R f (I) 2j(I) Ls(I)

where

nc
N s = Ls N T =Ls N i
i =1

Hence

nc
N i(I)
N s(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1
= = N T(I) + Ls(I) = N T(I) + Ls(I)
Ls(I) Ls(I) Ls(I) Ls(I) Ls(I)

444
nc
Ni(I)
= N T(I) + Ls(I) = N T(I)
i =1 Ls(I)

So finally we have

q i(I)
a 1 ( f w )
= c(I) inj

Ls(I) ( Vt )inj
3 k 0rj(I) k 0rj(I) j(I) k 0rj(I) (R f ,max(I) 1)M s(I) (I) N T(I)
( Pwf Pj(I) )
1

j=1 j(I) R f (I) Ls(I)

R f (I) 2j(I) Ls(I) j(I) R f2(I) w sa ,max(I) (1-(I) ) R(I)

D.6.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
Ls(I 1) Ls(I1) Ls(I 1) Ls(I1)

For the accumulation term, we have

Vb(I) (I) N i1 (I)



M accum t =0
=
Ls(I 1) Ls(I1)

For the cell to the left side of diagonal in x direction, the four scenarios are

M aconv Tiaj(I 1)
1. = 1 v j(I 1/ 2)
Ls(I1) Ls(I 1)

M aconv
2. =0
Ls(I1)

M aconv Tia1 j(I 1)


3. = v j(I 1/ 2)
Ls(I1) Ls(I 1)

M aconv
4. =0
Ls(I1)

445
Tia1 j(I 1)
Substituting (I) with (I-1) in Equation (D.6), we can get the terms for oil and gas
Ls(I1)
phases.

Similarly, for the cell to the right side of diagonal in x direction, we have

M aconv
1. =0
Ls(I+1)

M aconv Ti1 j(I +1)


a

2. = v j(I+1/ 2)
Ls(I+1) Ls(I+1)

M aconv Ti1 j(I +1)


a

3. = v j(I+1/ 2)
Ls(I+1) Ls(I+1)

M aconv
4. =0
Ls(I+1)

Tia1 j(I +1)


Substituting (I) with (I+1) in Equation (D.6), we can get the terms for oil and
Ls(I+1)
gas phases.

For the source term, we have

M source
a
q ia1 (I)
= =0
Ls(I 1) Ls(I 1)

446
Appendix E: Derivatives of Mass Conservation Equation for Water

E.1 DERIVATIVES WITH RESPECT TO lnK ig

E.1.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
ln K ig (I) ln K ig(I) ln K ig (I) ln K ig(I)

For the accumulation term, we have

Vb(I) (I) N w (I)



M accum t
= =0
ln K ig (I) ln K ig(I)

The derivative of the convection term of the water mass balance with respect to ln K ig
equation is zero.

M conv
=0
ln K ig(I)

For the source term, we have

k arj(I) j(I)
j(I) k arj(I)
q w (I) ( f w )inj ln K ig(I) ln K ig(I)
Pwf Pj(I) )
3

ln K ig(I)
= c(I)
( Vt )inj j(I)
2 (
j=1

Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

447
k 0rj(I)

R f (I) k 0
j(I) rj(I) j(I)

q w (I) ( f ) 3 ln K ig(I) R f (I) ln K ig(I)


( Pwf Pj(I) )
w inj
= c(I)
ln K ig(I) ( t )inj j=1
V 2

j(I)




k 0ro(I) R f (I)
f (I)
R k ro(I)
0

ln K ig(I) ln K ig(I) k rj(I) j(I)
0

j(I) 2
R f (I)
R f (I) ln K ig(I)

( f w )inj 3

= c(I)
( Vt )inj

2j(I)
( Pwf P )
j(I)
j=1




Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa ,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K ig(I) ln K ig(I) w sa ,max(I) ln K ig(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Therefore

448
N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
ln K ig(I) ln K ig(I) (1-(I) ) R(I) ln K ig(I)
where

nc
N s = Ls N T =Ls N i
i =1

Hence

Ns(I) N s(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K ig(I) ln K ig (I) ln K ig (I) ln K ig (I) ln K ig (I)
nc
Ni(I)
i =1 =L
nc
N i(I)
= Ls(I) s(I) =0
ln K ig(I) i =1 ln K ig(I)

Hence

R f (I) (R f ,max(I) 1) M s(I) N s(I)


= =0
ln K ig(I) w sa,max(I) (1- )
(I) R(I)
ln K ig (I)

And finally we have

k 0ro(I) j(I)
j(I) k 0rj(I)
q w (I) ( f w )inj 3
ln K ig(I) ln K i2g (I)
ln K ig(I)
= c(I)
( Vt )inj R f (I) j(I)
2 ( Pwf Pj(I) )
j=1

q w (I)
Note that in Peng's code = 0.
ln K ig(I)

E.1.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

449
M M accum M conv M source
= +
ln K ig (I 1) ln K ig(I 1) ln K ig(I1) ln K ig(I1)

For the accumulation term, we have

Vb(I) (I) N w (I)



M accum t
= =0
ln K ig(I 1) ln K ig(I 1)

The derivative of the convection term of the water mass balance equation with respect to
ln K ig is zero.

M conv
=0
ln K ig (I 1)

For the source term

M source q w (I)
= =0
ln K ig(I 1) ln K ig (I1)

E.2 DERIVATIVES WITH RESPECT TO N w AND N i

E.2.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
N w (I) N w (I) N w (I) N w (I)

For the accumulation term, we have

V N
b(I) (I) w (I)
M accum t = Vb(I) (I)
=
N w (I) N w (I) t

For the convection term we have

450
M conv
a ( Tw (I) v w (I 1/ 2) ) ( aw (I) w (I) v w (I 1/ 2) ) v w (I 1/ 2) k rw
a

= = = w (I) (I)

N w (I) N w (I) N w (I) w (I) N w (I)


v w (I1/ 2) k arw (I) Sw (I) v w (I 1/ 2) k arw (I) 1 v w (I 1/ 2) k rw
a

= w (I) = w (I) = (I)

w (I) Sw (I) N w (I) w (I) Sw (I) w (I) w (I) Sw (I)

Using the definition of permeability resistance factor to take into account the change of
the relative permeability due to asphaltene precipitation

k 0rj(I)
R f (I) =
k arj(I)

So we have

k 0rw (I)

R f (I)
k = 1 R k rw (I) k 0 R f (I) = 1 k rw (I) k rw (I) R f (I)
a 0 0 0

= f (I)
rw (I)

Sw (I) Sw (I) R f2(I) Sw (I) Sw (I) R f (I) Sw (I) R f2(I) Sw (I)


rw (I)

Using the linear model for permeability resistance factor

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

And

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I) w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Sw (I) Sw (I) w sa,max(I) Sw (I)

Hence

k arw (I) 1 k rw (I) k rw (I) (R f ,max(I) 1) w sa (I)


0 0

= 2
Sw (I) R f (I) Sw (I) R f (I) w sa,max(I) Sw (I)

w sa , mass of adsorbed asphaltene per mass of rock is defined as

451
Ns(I) M s(I) (I)
w sa(I) =
(1- )
(I) R(I)

Therefore

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
Sw (I) Sw (I) (1-(I) ) R(I) Sw (I)
Hence

k arw (I) 1 k rw (I) k rw (I) (R f ,max(I) 1)M s(I) (I) N s(I)


0 0

= 2
Sw (I) R f (I) Sw (I) R f (I) w sa,max(I) (1-(I) ) R(I) Sw (I)

Let N s be the moles of asphaltene that precipitate from the heaviest component n c in
crude oil. A material balance gives

nc
N s = Ls N T =Ls N i
i =1

Thus

nc
N i(I)
N s(I) (Ls(I) N T(I) ) Ls(I) N T(I) Ls(I) i =1
= = N T(I) + Ls(I) = N T(I) + Ls(I)
Sw (I) Sw (I) Sw (I) Sw (I) Sw (I) Sw (I)
Ls(I) nc
Ni(I)
= N T(I) + Ls(I) =0
Sw (I) i =1 Sw (I)

Hence, finally we have

k arw (I) 1 k rw (I)


0

=
Sw (I) R f (I) Sw (I)

There are four scenarios

452
M conv
a
v w (I +1/ 2) k arw (I)
1. =
N w (I) w (I) Sw (I)

M aconv v w (I1/ 2) k rw
a

=
(I)
2.
N w (I) w (I) Sw (I)

M aconv
3. =0
N w (I)

M aconv v w (I +1/ 2) k rw (I) v w (I 1/ 2) k rw (I)


a a

4. =
N w (I) w (I) Sw (I) w (I) Sw (I)

For the source term, the flow rate of each layer is

(q ) = (f ) (q )
a
w z w inj
a
t z

With

(Q ) w

(q ) (V )
a
t z =
t z

t inj

where

np

( Q ) = ( PI ) ( P ) ( P )
a
t z
a
j z wf z j z
j=1

PIaj is the productivity index of phase j with the effect of asphaltene precipitation and is
defined as

k x k y z rja
( PI )
a
j z =
r
25.145ln 0
rw

where rw is well radius and r0 is given by Peacemans equation

453
1 1

2
k x x 2 k x y 2
2

k k y
y
r0 = 0.28 1 1

ky 4 kx 4
+
kx ky

and

f w L L

( Vt )inj = + 1 ( f w )inj o + g
w inj inj
o inj g

Lo , Lg , o , and g are mole fractions and mole densities of oil and gas phases and are
obtained from flash calculation.

Then dropping the z index, we have

3
PI j(I) ( Pwf Pj(I) )
q w (I) ( f w )inj j=1 =c ( f w )inj k arw (I) Sw (I)
=
N w (I) ( Vt )inj N w (I)
(I)
( Vt )inj w (I) Sw (I) N w (I)
From the calculations in the convection section

k arw (I) 1 k rw (I)


0

=
Sw (I) R f (I) Sw (I)

and

Sw (I) (v w (I) N w (I) ) 1


= =
N w (I) N w (I) w (I)

and

k x (I) k y(I) z (I)


cz =
r
25.145ln 0
rw

454
Hence

q w (I) ( f w )inj 1 k rw (I) 1


0

= c(I)
N w (I) ( Vt )inj w (I) R f (I) Sw (I) w (I)

For the derivatives of the source term with respect to N i (hydrocarbon components), we
have

k arj(I) k arj(I) j(I)



k a

q aw (I) ( f w )inj 3 j ( f w )inj 3 Ni(I)
j(I) rj(I)
Ni(I)
= c(I) ( Pwf Pj(I) ) = c(I) ( Pwf Pj(I) )
N i(I) ( t )inj j=2
V N ( t )inj j= 2
V 2
i(I)
j(I)



Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

k0
rj(I)
q aw (I) ( f w )inj 3 R k 0 ( Pwf Pj(I) )
rj(I)
( Vt )inj
f (I)
= c(I) j(I) R N
j(I)

Ni(I) Ni(I) 2j(I)


j= 2
f (I) i(I)


k 0rj(I) R f (I)
0

N i(I) k 0rj(I) j(I) ( Pwf Pj(I) )
R k
( f w )inj 3 f (I)
N i(I)
rj(I)

( Vt )inj
= c(I) j(I)
R f2(I) R f (I) N i(I) 2j(I)
j= 2


Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

455
w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Ni(I) Ni(I) w sa,max(I) Ni(I)

Thus

k 0rj(I) (R 1) w sa (I)
R f (I) k 0rj(I) f ,max(I)
Ni(I) w sa,max(I) Ni(I)

q aw (I) ( f w )inj 3 j(I) ( Pwf Pj(I) )
( Vt )inj
2
= c(I) R f (I)

Ni(I) 2j(I)
j= 2
k 0
rj(I) j(I)
R f (I) Ni(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

and

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
N i(I) Ni(I) (1-(I) ) R(I) Ni(I)
Hence

k 0rj(I) (R f ,max(I) 1) M s(I) (I) N s(I)


R f (I) k rj(I)
0

Ni(I) w sa,max(I) (1-(I) ) R(I) N i(I)
q aw (I) ( f w )inj 3 j(I) ( Pwf Pj(I) )
( Vt )inj
= c(I)
2
R f (I)
N i(I) j= 2 2j(I)
k rj(I) j(I)
0

R N
f (I) i(I)

where

nc
N s = Ls N T =Ls N i
i =1

456
Thus

nc
N i(I)
N s(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =L
nc
N i(I)
= = N T(I) + Ls(I) = Ls(I) s(I) = Ls(I)
Ni(I) N i(I) Ni(I) N i(I) Ni(I) i =1 N i(I)

Hence, finally we have

k 0rj(I) k 0rj(I) (R f ,max(I) 1) M s(I) (I) Ls(I)


1

q aw (I) ( f w )inj 3 R f (I) j(I) Ni(I) j(I) R f2(I) w sa,max(I) (1-(I) ) R(I)
( Pwf Pj(I) )
( Vt )inj
= c(I)
N i(I) j= 2 k 0rj(I) j(I)

R f (I) j(I) N i(I)
2

q
Note that in Peng's code the term w (I) is zero.
N i(I)
i w

E.2.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
N w (I1) N w (I 1) N w (I1) N w (I 1)

For the accumulation term, we have

Vb(I) a(I) N w (I)



M accum t
= =0
N w (I1) N w (I1)

For the convection term, the derivatives of the four scenarios for the cell to the left side
of the diagonal in x direction are

M aconv v w (I 1/ 2) k arw (I)


1. =
N w (I1) w (I1) Sw (I) (I 1)

457
M aconv
2. =0
N w (I1)

M aconv v k a
3. = w (I 1/ 2) rw (I)
N w (I1) w (I1) Sw (I) (I 1)

M aconv
4. =0
N w (I1)

Similarly, the derivatives of the four scenarios for the cell to the left side of the diagonal
in x direction are

M aconv
1. =0
N w (I+1)

M aconv v + k a
2. = w (I 1/ 2) rw (I)
N w (I+1) w (I+1) Sw (I) (I+1)

M aconv v w (I+1/ 2) k arw (I)


3. =
N w (I+1) w (I+1) Sw (I) (I+1)

M aconv
4. =0
N w (I+1)

For the source term, we have

M source
a
q aw (I)
= =0
N w (I1) N w (I1)

E.3 DERIVATIVES WITH RESPECT TO P

E.3.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

458
M a M accum M conv
a
M source
a
= +
P(I) P(I) P(I) P(I)

For the accumulation term we have

V N
M accum
b(I) (I) w (I)
=
t V N
= b(I) w (I) (
r(I) 1 + cf (P(I) P(I) ) V N c
o

)
= b(I) w (I) r(I) f
P(I) P(I) t P(I) t

For the convection term of the water mass balance equation we have

v w (I +1/ 2) ~
= k (I+1/ 2)
P(I)

v w (I1/ 2) ~
= k (I 1/ 2)
P(I)

Twa (I+1)
=0
P(I)

Twa (I1)
=0
P(I)

Twa (I) ( arw (I) w (I) ) 1 k rw (I)


a
w (I) 1 k rw (I) Sw (I)
a
w (I)
= = + k a
= + k arw (I)
P(I) P(I) w (I) P(I) P(I) w (I) Sw (I) P(I) P(I)
w (I) rw (I)

1 k rw (I) ( N w (I) vw (I) ) w (I) 1 k rw (I) vw (I) w (I)


a a

= + k arw (I) = N w (I) + k arw (I)


w (I) Sw (I) P(I) P(I) w (I) Sw (I) P(I) P(I)

From the previous section, derivatives with respect to N w , we know that

k arw (I) 1 k rw (I)


0

=
Sw (I) R f (I) Sw (I)

Hence, finally we have

459
Twa (I) 1 1 k rw (I) vw (I) k 0rw w (I)
0

= N +
P(I) w (I) R f (I) Sw (I) P(I) R f P(I)
w (I)

v w (I) w
Note that is used in the code instead of .
P P

The derivatives for the four scenarios are

M aconv ( Tw (I) v w (I+1/ 2) Tw (I 1) v w (I1/ 2) )


a a

1. =
P(I) P(I)

Twa (I) v w (I +1/ 2) Twa (I 1) v w (I 1/ 2)


= v w (I +1/ 2) +T a
v w (I1/ 2) Twa (I1)
P(I) P(I) P(I) P(I)
w (I)

Twa (I) ~ ~
= v w (I +1/ 2) k (I +1/ 2) Twa (I) k (I1/ 2) Twa (I 1)
P(I)

M aconv T + a
~ T ~
a

2. = v w (I+1/ 2) w (I 1) k (I+1/ 2) Twa (I+1) v w (I 1/ 2) w (I) k (I1/ 2) Twa (I)


P(I) P(I) P(I)

~ Twa (I) ~
= k (I +1/ 2) Twa (I+1) v w (I1/ 2) k (I1/ 2) Twa (I)
P(I)

M aconv ~ ~
3. = k (I +1/ 2) Twa (I+1) k (I 1/ 2) Twa (I1)
P(I)

M conv
a
Twa (I) ~ Twa (I) ~
4. = v w (I +1/ 2) k (I+1/ 2) Tw (I) v w (I 1/ 2)
a
k (I1/ 2) Twa (I)
P(I) P(I) P(I)

Where

k arw 1 k 0rw
Twa = arw w = w = w
w R f w

For the source term, we have

460
k arj(I)
j(I) k arj(I) j(I)
q aw (I) ( f w )inj 3 P(I) P(I) k arj(I)
P(I)
= c(I)
( Vt )inj 2j(I)
( Pwf Po(I) )
j=1
j(I)

Using

k 0rj(I)
R f (I) =
k arj(I)

Hence

k 0rj(I)

R f (I) k 0 k 0rj(I)
rj(I) j(I)

q aw (I) ( f w )inj 3 j(I) P(I) R f (I) P(I) R f (I)


= c(I)
( Vt )inj
( P P )
P(I) j(I)
2 wf j(I)
j=1 o(I)




k rj(I)
0
R f (I)
R f (I) k 0rj(I)
P(I) P(I) k 0rj(I) j(I)
j(I)
2
R f (I) R f (I) P(I)

( f w )inj 3
k 0rj(I)
= c(I)
( Vt )inj
2j(I)
( Pwf Pj(I) ) R
j=1 f (I) j(I)




Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

and

461
w sa (I)
1.0 + (R f ,max(I) 1)
R f (I)
w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
P(I) P(I) w sa,max(I) P(I)

Thus

k 0rj(I) (R 1) w sa (I)
R f (I) k 0rj(I) f ,max(I)
P(I) w P(I) k 0rj(I) j(I)
sa,max(I)
j(I) 2
R f (I)
R f (I) P(I)
q aw (I) ( f w )inj 3
= c(I)




P(I) ( t )inj j=1
V
2j(I)
( Pwf Pj(I) )

k 0ro(I)
R
f (I) o(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

and

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) Ns(I)
P(I) P(I) (1-(I) ) R(I) P(I)
Thus

462
k 0 (R 1) M s(I) (I) N s(I)
R f (I) rj(I) k 0rj(I) f ,max(I)
P(I) w sa ,max(I) (1-(I) ) R(I) P(I) k 0
j(I) rj(I)

j(I)

R 2f(I) R f (I) P(I)


q aw (I) ( f w )inj 3
= c(I)
( Vt )inj j=1

P(I)
j(I)
2 ( Pwf Pj(I) )

0
k rj(I)

R f (I) j(I)

where

nc
N s = Ls N T =Ls N i
i =1

Thus

nc
Ni(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) Ls(I)
+ Ls(I) =0
i =1
= = N T(I) + Ls(I) = N T(I)
P(I) P(I) P(I) P(I) P(I) P(I)

Hence, finally we have

k 0
j(I) rj(I) k 0rj(I) j(I)
q aw (I) ( w )inj
f 3 P(I) P(I) 0
k rj(I)
P(I)
= c(I)
( Vt )inj R f (I) 2j(I)
( Pwf Pj(I) ) R
j=1
f (I) j(I)

E.3.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M a M accum M conv
a
M source
a
= +
P(I1) P(I1) P(I1) P(I1)

For the accumulation term

( o

M accum Vb(I) N w (I) r(I) 1 + cf (P(I) P(I) ) Vb(I) N w (I)
= =
)
r(I) cf
P(I)
=0
P(I1) t P(I 1) t P(I 1)

463
For the convection term, with the cell to the left side of the diagonal in x direction we
have

v w (I +1/ 2)
=0
P(I1)

v w (I 1/ 2) ~
= k (I 1/ 2)
P(I1)

Twa (I+1)
=0
P(I 1)

Twa (I)
=0
P(I1)

Twa (I 1) ( arw (I 1) w (I 1) ) 1 k arw (I1) w (I 1)


= = w (I 1) + k arw (I 1)
P(I1) P(I1) w (I 1) P(I1) P(I1)
1 k arw (I1) Sw (I1)
= + k arw (I 1) w (I 1)
w (I 1) Sw (I1) P(I1) P(I1)

The derivatives for the four scenarios are

M aconv Twa (I) v w (I+1/ 2) Twa (I1) v w (I 1/ 2)


1. = v w (I +1/ 2) + Tw (I)
a
v w (I1/ 2) Twa (I1)
P(I 1) P(I1) P(I1) P(I 1) P(I 1)

Twa (I 1) ~
= v w (I+1/ 2) + k (I1/ 2) Twa (I 1)
P(I 1)

M aconv Twa (I+1) v w (I+1/ 2) Twa (I) v w (I1/ 2)


2. = v w (I +1/ 2) + Twa (I+1) v w (I 1/ 2) Twa (I)
P(I 1) P(I 1) P(I 1) P(I1) P(I1)

~
= k (I1/ 2) Twa (I)

464
M aconv Twa (I+1) v w (I+1/ 2) Twa (I1) v w (I 1/ 2)
3. = v w (I +1/ 2) + Tw (I +1)
a
v w (I1/ 2) Twa (I+1)
P(I 1) P(I 1) P(I 1) P(I1) P(I 1)

Twa (I1) ~
= v w (I1/ 2) + k (I1/ 2) Twa (I 1)
P(I1)

M aconv Twa (I) v w (I +1/ 2) Twa (I) v w (I1/ 2)


4. = v w (I+1/ 2) + Twa (I+1) v w (I1/ 2) Twa (I)
P(I 1) P(I1) P(I1) P(I 1) P(I 1)

~
= k (I1/ 2) Twa (I)

where

k arw k0
Twa (I) = arw w = w = rw w
w R f w

Similarly, for the cell to the right side of the diagonal in x direction we have

v w (I+1/ 2) ~
= k (I+1/ 2)
P(I+1)

v w (I1/ 2)
=0
P(I +1)

Twa (I1)
=0
P(I +1)

Twa (I)
=0
P(I+1)

Twa (I +1) ( arw (I+1) w (I+1) ) 1 k arw (I+1) w (I+1)


= = w (I +1) + k arw (I+1)
P(I+1) P(I+1) w (I +1) P(I+1) P(I+1)

The derivatives for the four scenarios are

465
M aconv Twa (I) v w (I+1/ 2) Twa (I1) v w (I1/ 2)
1. = v w (I +1/ 2) + Tw (I)
a
v w (I1/ 2) Twa (I1)
P(I+1) P(I+1) P(I+1) P(I1) P(I+1)

~
= k (I+1/ 2) Twa (I)

M conv Twa (I+1) v w (I+1/ 2) Twa (I) v w (I 1/ 2)


2. = v w (I +1/ 2) + Twa (I+1) v w (I 1/ 2) Twa (I)
P(I+1) P(I+1) P(I+1) P(I+1) P(I+1)

~ Twa (I+1) ~
= k (I 1/ 2) T a
= v w (I +1/ 2) + k (I1/ 2) Twa (I+1)
P(I+1)
w (I)

M conv Twa (I+1) v w (I+1/ 2) Twa (I1) v w (I1/ 2)


3. = v w (I +1/ 2) + Tw (I +1)
a
v w (I1/ 2) Twa (I1)
P(I+1) P(I+1) P(I+1) P(I +1) P(I+1)

Twa (I+1) ~
= v w (I +1/ 2) + k (I+1/ 2) Twa (I +1)
P(I +1)

M conv v w (I +1/ 2) Twa (I) Twa (I) v w (I1/ 2)


4. = Twa (I) + v w (I+1/ 2) v w (I 1/ 2) Twa (I)
P(I 1) P(I+1) P(I +1) P(I+1) P(I+1)

~
= k (I+1/ 2) Twa (I)

where

k arw k0
Twa = rw
a
w = w = rw w
w R f w

For the source term

M source
a
q aw (I)
= =0
P(I1) P(I 1)

466
E.4 DERIVATIVES WITH RESPECT TO lnK n cs

E.4.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
ln K n cs(I) ln K ncs(I) ln K ncs(I) ln K n cs(I)

For the accumulation term, we have

Vb(I) (I) N w (I)



M accum t
= =0
ln K n cs(I) ln K n cs(I)

The derivative of the convection term of the water mass balance equation with respect to
ln K n cs is zero.

M conv
=0
ln K n cs(I)

For the source term, we have

k arj(I) j(I)
k arj(I)
q w (I) ( f w )inj 3

j(I)
ln K n cs(I) ln K n cs(I)
ln K n cs(I)
= c(I)
( Vt )inj 2j(I)
( Pwf Pj(I) )
j=1

Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

467
k 0rj(I)

R f (I) k 0
j(I) rj(I) j(I)

( f w )inj ln K n cs(I) R f (I) ln K n cs(I)


q w (I) 3

ln K n cs(I)
= c(I)
( Vt )inj
2j(I)
( Pwf Pj(I) )

j=1




k 0ro(I) R f (I)
R f (I) k ro(I)
0

ln K n cs(I) ln K n cs(I) k rj(I) j(I)
0

j(I) 2
R f (I) R ln K
f (I) n c s(I)
( f w )inj 3

= c(I)
( Vt )inj
2j(I)
( wf j(I) )
P P
j=1




Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I) w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
ln K n cs(I) ln K ncs(I) w sa ,max(I) ln K n cs(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- ) (I) R(I)

Therefore

468
N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
ln K n cs(I) ln K n cs(I) (1-(I) ) R(I) ln K ncs(I)
Where

nc
N s = Ls N T =Ls N i
i =1

Hence

N s(I) N s(I) (Ls(I) N T(I) ) Ls(I) N T(I)


= = = N T(I) + Ls(I)
ln K n cs(I) ln K ncs(I) ln K ncs(I) ln K ncs(I) ln K ncs(I)
nc
N i(I)
i =1 =L
nc
N i(I)
= Ls(I) s(I) =0
ln K n cs(I) i =1 ln K n cs(I)

Hence

R f (I) (R f ,max(I) 1) M s(I) Ns(I)


= =0
ln K n cs(I) w sa,max(I) (1- )
(I) R(I)
ln K n cs(I)

And finally we have

k 0ro(I) j(I)
k 0rj(I)
q w (I) ( f w )inj 3

j(I)
ln K n cs(I) ln K n cs(I)
ln K n cs(I)
= c(I)
( Vt )inj R f (I) 2j(I)
( Pwf Pj(I) )
j=1

E.4.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
ln K n cs(I1) ln K n cs(I1) ln K n cs(I1) ln K n cs(I1)

For the accumulation term, we have

469
Vb(I) (I) N w (I)

M accum t
= =0
ln K n cs(I 1) ln K n cs(I 1)

The derivative of the convection term of the water mass balance equation with respect to
ln K n cs is zero.

M conv
=0
ln K n cs(I 1)

For the source term

M source q w (I)
= =0
ln K n cs(I 1) ln K n cs(I1)

E.5 DERIVATIVES WITH RESPECT TO Lg

E.5.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
Lg(I) Lg (I) Lg(I) Lg(I)

For the accumulation term, we have

V N
b(I) (I) w (I)
M accum t
= =0
Lg(I) Lg (I)

For the convection term we have

M conv ( Tw (I) v w (I1/ 2) ) ( w (I) w (I) v w (I1/ 2) ) v w (I 1/ 2) k a


a

= = = w (I) rw (I)
Lg(I) Lg(I) Lg(I) w (I) Lg(I)

470
v w (I1/ 2) k arw (I) Sw (I)
= w (I) =0
w (I) Sw (I) Lg(I)

For the source term, we have

k arj(I) j(I)
k arj(I)
q w (I) ( f w )inj 3 Lg(I)
j(I)
Lg(I)
Lg(I)
= c(I)
( Vt )inj 2 ( Pwf Pj(I) )
j=1
j(I)

Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

k 0rj(I)

R f (I) k 0
j(I) rj(I) j(I)

q w (I) ( f w )inj
3 Lg(I) R f (I) Lg(I)
= c(I)
( Vt )inj
( wf j(I) )
P P
Lg(I) j=1 2j(I)




k 0rj(I) R f (I)
f (I)
R k 0rj(I)
Lg(I) Lg(I) k rj(I) j(I)
0

j(I)
2
R f (I) R f (I) Lg(I)

( f w )inj 3

= c(I)
( Vt )inj j=1
j(I)
2 ( Pwf Pj(I) )





Using

471
w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I) w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Lg(I) Lg(I) w sa,max(I) Lg(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Therefore

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
Lg(I) Lg(I) (1-(I) ) R(I) Lg(I)
where

nc
N s = Ls N T =Ls N i
i =1

Hence

nc
Ni(I)
Ns(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1 =L
nc
Ni(I)
= = N T(I) + Ls(I) = Ls(I) s(I) =0
Lg (I) Lg(I) Lg(I) Lg(I) Lg(I) i =1 L g(I)

Hence

R f (I) (R f ,max(I) 1) Ms(I) (I) N s(I)


= =0
L g(I) w sa,max(I) (1- )
(I) R(I)
Lg(I)

And finally we have

472
k 0rj(I) j(I)
j(I) k 0rj(I)
q w (I) ( f w )inj 3 Lg(I) Lg(I)
= c(I) ( Pwf Pj(I) )
Lg(I)
( Vt )inj j=1 R f (I) j(I)
2

E.5.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
Lg(I1) Lg(I1) L g(I1) Lg(I 1)

For the accumulation term, we have

V N
b(I) (I) w (I)
M accum t
= =0
Lg (I 1) Lg(I 1)

The derivative of the convection term of the water mass balance equation with respect to
Lg is zero.

M conv
=0
Lg(I1)

For the source term

M source q w (I)
= =0
Lg(I1) Lg(I1)

E.6 DERIVATIVES WITH RESPECT TO Ls

E.6.1 Derivatives for the On-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
Ls(I) Ls(I) Ls(I) Ls(I)

473
For the accumulation term, we have

V N
b(I) (I) w (I)
M accum t
= =0
Ls(I) Ls(I)

For the convection term, we have

M conv ( Tw (I) v w (I1/ 2) ) ( w (I) w (I) v w (I1/ 2) ) v w (I 1/ 2) k a


a

= = = w (I) rw (I)
Ls(I) Ls(I) Ls(I) w (I) Ls(I)
v w (I1/ 2) k arw (I) Sw (I)
= w (I) =0
w (I) Sw (I) Ls(I)

For the source term, we have

k arj(I) j(I)
j(I) k rj(I)
a

q w (I) ( f w )inj 3 Ls(I) Ls(I)
= c(I) ( Pwf Pj(I) )
Ls(I) V
( t )inj j=1 2
j(I)

Using

k 0rj(I)
R f (I) =
k arj(I)

Thus

k0
rj(I)
R f (I) k 0
rj(I) j(I)

q w (I) ( f w )inj 3 j(I) Ls(I) R f (I) Ls(I)


= c(I)
( Vt )inj
( Pwf Pj(I) )
Ls(I) j=1 2j(I)



474
k 0rj(I) R f (I)
R f (I) k 0rj(I)
Ls(I) Ls(I) k rj(I) j(I)
0

j(I) 2
R f (I) R f (I) Ls(I)

( f w )inj 3

= c(I)
( Vt )inj
2j(I)
( Pwf Pj(I) )
j=1




Using

w sa (I)
R f (I) = 1.0 + (R f ,max(I) 1)
w sa,max(I)

Hence

w sa (I)
1.0 + (R f ,max(I) 1)
R f (I) w sa,max(I) (R f ,max(I) 1) w sa (I)
= =
Ls(I) Ls(I) w sa,max(I) Ls(I)

with

Ns(I) M s(I) (I)


w sa(I) =
(1- )
(I) R(I)

Therefore

N M
s(I) s(I) (I)
w sa (I) (1-(I) ) R(I)
= = M s(I) (I) N s(I)
Ls(I) Ls(I) (1-(I) ) R(I) Ls(I)
Where

nc
N s = Ls N T =Ls N i
i =1

475
Hence

nc
N i(I)
N s(I) (Ls(I) N T(I) ) Ls(I) N T(I) i =1
= = N T(I) + Ls(I) = N T(I) + Ls(I)
Ls(I) Ls(I) Ls(I) Ls(I) Ls(I)
nc
Ni(I)
= N T(I) + Ls(I) = N T(I)
i =1 Ls(I)

Hence

R f (I) (R f ,max(I) 1) M s(I) (I)


= N T(I)
Ls(I) w sa,max(I) (1- )
(I) R(I)

k 0rj(I) (R 1)M s(I) (I) N T(I)


R f (I) k 0rj(I) f ,max(I)
Ls(I) w sa,max(I) (1-(I) ) R(I) k rj(I) j(I)
0


j(I) R L
R f2(I)
f (I) s(I)
q w (I) ( f w )inj 3


Ls(I)
= c(I)
( Vt )inj

2j(I)
( Pwf Pj(I) )
j=1




And finally we have

q w (I) ( f w )inj 3 1 k 0rj(I) k 0rj(I) j(I) k 0rj(I) (R f ,max(I) 1)M s(I) (I) N T(I)
= c (I)
( Vt )inj

j(I) R 2f (I) w sa,max(I) (1-(I) ) R(I)
( P P )
Ls(I) j=1 j(I) R f (I) Ls(I) 2j(I) R f (I) Ls(I)
wf j(I)

E.6.2 Derivatives for the Off-Diagonal Elements of the Jacobian Matrix

M M accum M conv M source


= +
Ls(I1) Ls(I1) Ls(I 1) Ls(I1)

For the accumulation term, we have

476
V N
b(I) (I) w (I)
M accum t
= =0
Ls(I 1) Ls(I1)

The derivative of the convection term of the water mass balance equation with respect to
Ls is zero.

M conv
=0
Ls(I1)

For the source term

M source q w (I)
= =0
Ls(I 1) Ls(I 1)

477
Appendix F: Derivatives of Solid-Oil Fugacity Equation

With asphaltene precipitation, the equation for thermodynamic equilibrium


between the oil and solid phases for component n c is

Fs = f n cs f n co = 0

( ) (
ln x n cs n cs ln x n co n co = 0 )
Hence

R fs = ln K n cs + ln n cs ln n c o = 0 (F.1)

F.1 DERIVATIVES WITH RESPECT TO lnK ig

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n co
= +
ln K ig G G ln K ig G G
ln K ig N,K
G G
m ,K ncs ,Lg ,Ls
N,K m ,K ncs ,Lg ,Ls ln K ig N,K m ,K ncs ,Lg ,Ls
G G
N,K m ,K ncs ,Lg ,Ls

With

ln n co nc
ln n co x jo
=
ln K x jo ln K ig G G
ig N,K m ,K ncs ,Lg ,Ls
G G j=1 N,K m ,K ncs ,Lg ,Ls

And

ln n cs
=0
ln K ig N,K m ,K ncs ,Lg ,Ls
G G

Since

478
fs fs
n cs = n cs (P) = = x n cs = 1
x n cs P P

and

fs = f s (P)

Since at isothermal condition we have

vs (P P* )
ln fs = ln fs* + T = constant
RT

Hence, finally we have

R fs nc
ln n c o x jo
=
x jo ln K ig G G
ln K ig N,K
G G
m ,K n cs ,Lg ,Ls
j=1 N,K m ,K ncs ,Lg ,Ls

F.2 DERIVATIVES WITH RESPECT TO N i

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n c o
G G = G G + G G G
N i Nm ,K,K ncs ,Lg ,Ls Ni Nm ,K,K ncs ,Lg ,Ls N i N m ,K,K ncs ,Lg ,Ls Ni NG m ,K,K n cs ,L g ,Ls

With

ln K n cs
r r =0
N k N m ,K,K ncs ,Lg ,Ls

ln n cs
r =0
N k Nr m ,K,K n cs ,L g ,Ls

Hence, finally we have

479
nc
R fs ln n c o ln n co x jo
= =
G G
N i Nm ,K,K ncs ,Lg ,Ls
G G x jo N i G G
Ni K,Nm ,K ncs ,Lg ,Ls j=1 K,Nm ,K ncs ,Lg ,Ls

F.3 DERIVATIVES WITH RESPECT TO P

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n c o
r r = r r + r r r r
P N,K m ,K ncs ,Lg ,Ls P N,K m ,K ncs ,Lg ,Ls P N,K m ,K ncs ,Lg ,Ls P N,K m ,K n cs ,L g ,Ls

ln n cs ln n c o
= r r r r
P N,K m ,K ncs ,Lg ,Ls P N,K m ,K n cs ,Lg ,Ls

ln n cs
At this point we need the term r r .
P N,K m ,K ncs ,Lg ,Ls

fs fs
n cs = n cs (P) = = x n cs = 1
x ncs P P

Hence

ln n cs ( ln f s ln P ) ln fs ln P
r r = r r = r r r r
P N,K,K ncs ,Lg ,Ls P N,K,K ncs ,Lg ,Ls P N,K,K ncs ,Lg ,Ls P N,K,K ncs ,Lg ,Ls

Using

vs (P P* )
ln fs = ln f +
*
s T = constant
RT

Therefore

ln n cs ln f s 1 v 1
r r = = s
P N,K,K ncs ,Lg ,Ls P N,K,K ncs ,Lg ,Ls P RT P
r r

Hence, finally we have

480
R fs v 1 ln n c o
r r = s r r
P N,K m ,K ncs ,Lg ,Ls RT P P N,K m ,K n cs ,L g ,Ls

F.4 DERIVATIVES WITH RESPECT TO lnK n cs

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n co ln n co
= + = 1
ln K n s r r ln K n s r r ln K n s r r ln K n s r r ln K n s r r
c N,K,L ,L
g s
c N,K,L ,L
g s
c N,K,L ,L
g s
c N,K,L ,L
g s
c N,K,L ,L
g s

Hence, finally we have

R fs nc
ln n co x jo

ln K n s

G G
= 1
x jo ln K n s G G
c N,K,Lg ,Ls j=1 c N,K,L ,L
g s

F.5 DERIVATIVES WITH RESPECT TO Lg

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n co
= +
Lg r r Lg r r Lg r r
Lg N,K,K
r r
n cs ,Ls
N,K,K n cs ,Ls N,K,K n cs ,Ls N,K,K ncs ,Ls
ln n c o nc
ln n c o x jo
= =
Lg r r x jo Lg r r
N,K,K ncs ,Ls j=1 N,K,K ncs ,Ls

With

ln n cs
=0
L g N,K,K
r r
ncs ,Ls

Since

fs fs
n cs = n cs (P) = = x n cs = 1
x n cs P P

481
and

fs = f s (P)

Since at isothermal conditions we have

vs (P P* )
ln fs = ln fs* + T = constant
RT

F.6 DERIVATIVES WITH RESPECT TO Ls

With asphaltene precipitation and from Equation (F.1), we can get

R fs ln K n cs ln n cs ln n c o
r r = r r + r r r r
Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg Ls N,K,K ncs ,Lg

nc
ln n c o ln n co x jo
= =
r r x jo Ls r r
Ls N,K,K ncs ,Lg j=1 N,K,K ncs ,Lg

with

ln n cs
r r =0
Ls N,K,K ncs ,L g

Since

fs fs
n cs = n cs (P) = = x n cs = 1
x n cs P P

And

fs = f s (P)

Since at isothermal conditions we have

vs (P P* )
ln fs = ln f + *
s T = constant
RT

482
Appendix G: Derivatives of Multiphase Flash Equation

G.1 DERIVATIVES WITH RESPECT TO lnK ig

nc z i (K ig 1) z i (K ig 1)

R fe i =1 1 + Lg (K ig 1) + Ls (K is 1) n c 1 + L g (K ig 1) + Ls (K is 1)
= =

ln K ig ln K ig i =1 ln K ig
zi (K ig 1)
n
zi [1 + Ls (K is 1) ]
1 + Lg (K ig 1) + Ls (K is 1) K ig
nc
=
c

= K ig
K ig ln K ig i =1 1 + L (K 1) + L (K 1)
2
i =1
g ig s is

Hence,

R fe nc
zi K ig [1 + Ls (K is 1) ]
=
ln K ig i =1 1 + L (K 1) + L (K 1) 2
g ig s is

G.2 DERIVATIVES WITH RESPECT TO N i

nc z k (K kg 1) z k (K kg 1)

R fe k =1 1 + L g (K kg 1) + Ls (K ks 1) n c 1 + Lg (K kg 1) + Ls (K ks 1)

= =

Ni Ni k =1 N i

Nk
(K kg 1)
NT

1 + Lg (K kg 1) + Ls (K ks 1) Nk

nc

nc
(K kg 1) N T
= =
k =1 Ni
k =1 1 + L g (K kg 1) + L s (K ks 1) Ni
1 (K ig 1) 1 nc N k (K kg 1)
=
N T 1 + Lg (K ig 1) + Ls (K is 1) N T2


k =1 1 + L g (K kg 1) + L s (K ks 1)

Hence,

483
R fe 1 (K ig 1) nc
z k (K kg 1)
=
Ni N T 1 + Lg (K ig 1) + Ls (K is 1) k =1 1 + Lg (K kg 1) + Ls (K ks 1)

Note that i and k represent component index.

G.3 DERIVATIVES WITH RESPECT TO P

R fe
=0
P

G.4 DERIVATIVES WITH RESPECT TO lnK n cs

nc zi (K ig 1) zi (K ig 1)

R fe i =1 1 + Lg (K ig 1) + Ls (K is 1) n c 1 + Lg (K ig 1) + Ls (K is 1)
= =

ln K is ln K is i =1 ln K is
zi (K ig 1)
n

1 + Lg (K ig 1) + Ls (K is 1) K is zi (K ig 1)Ls
nc
=
c

= K is
K is ln K is i =1 1 + L (K 1) + L (K 1)
2
i =1
g ig s is

Hence,

zi (K ig 1)Ls K is
R fe 2
i = nc
= 1 + L g (K ig 1) + Ls (K is 1)
ln K is
0 i nc

G.5 DERIVATIVES WITH RESPECT TO Lg

nc zi (K ig 1) zi (K ig 1)

R fe i =1 1 + L (K 1) + L (K 1) n c 1 + L (K 1) + L (K 1)
= =

g ig s is g ig s is

Lg Lg i =1 Lg

484
Hence,

R fe nc
zi (K ig 1)2
=
Lg i =1 1 + L (K 1) + L (K 1)
2
g ig s is

G.6 DERIVATIVES WITH RESPECT TO Ls

nc zi (K ig 1) zi (K ig 1)

R fe i =1 1 + Lg (K ig 1) + Ls (K is 1) n c 1 + Lg (K ig 1) + Ls (K is 1)

= =

Ls Ls i =1 Ls
nc
z i (K ig 1)(K is 1)
= 2
i =1 1 + L (K 1) + L (K 1)
g ig s is

485
Appendix H: Derivatives of Solid-Oil Equilibrium Ratio Equation

H.1 DERIVATIVES OF A SOLID-OIL SYSTEM

H.1.1 Derivatives with respect to lnK ig

R er
=0
lnK ig

H.1.2 Derivatives with respect to N i

1 1 x
nco

R er K x x Ni 1 x n c o
c = c =
n o n o
= =
ncs

N i Ni N i Ni x n co 2 x n co 2 N i

H.1.3 Derivatives with respect to P

1 1




x n c o
R er K n cs xn o xn o
= c = c = P 2 = 0
P P P P x n co

H.1.4 Derivatives with respect to lnK n cs

1 1 x n c o

R er K n cs xn o xn o ln K n cs x n co
c = K ncs c = K ncs +
1
= = K n cs +
ln K n cs ln K n cs ln K n cs ln K n cs x n co 2
x n co ln K n cs
2

486
H.1.5 Derivatives with respect to Lg

R er
=0
Lg

H.1.6 Derivatives with respect to Ls

1 1 x
nco

R er K x x Ls 1 x n c o
c = c =
n o n o
= =
ncs

Ls Ls Ls Ls x n co 2
x n co 2 Ls

H.2 DERIVATIVES OF A MULTIPHASE SYSTEM

H.2.1 Derivatives with respect to lnK ig

1 1 x n co

R er K n cs xn o xn o ln K ig 1 x n c o
= c = c = =
ln K ig ln K ig ln K ig ln K ig x n co 2
x n c o 2 ln K ig

H.2.2 Derivatives with respect to N i

1 1 x
nco

R er K n cs xn o xn o Ni 1 x n c o
= c = c = =
N i Ni N i Ni x n co 2
x n co 2 N i

487
H.2.3 Derivatives with respect to P

1 1




x n c o
R er K n cs xn o xn o
= c = c = P 2 = 0
P P P P x n co

H.2.4 Derivatives with respect to lnK n cs

1 1 x n c o

R er K n cs xn o xn o ln K n cs x n co
c = K ncs c = K ncs +
1
= = K n cs +
ln K n cs ln K n cs ln K n cs ln K n cs x n co 2
x n co ln K n cs
2

H.2.5 Derivatives with respect to Lg

1 1 x n o
c

R er K n cs x x Lg 1 x n c o
c = c =
n o n o
= =
Lg L g Lg Lg x n co 2
x n co 2 Lg

H.2.6 Derivatives with respect to Ls

1 1 x
nco

R er K x x Ls 1 x n c o
c = c =
n o n o
= =
ncs

Ls Ls Ls Ls x n co 2 x n co 2 Ls

488
Appendix I: Derivatives of Component Mole Fraction

I.1 DERIVATIVES OF SINGLE PHASE SYSTEM

For the case of a single gas phase, we have

x ig = z i i = 1, , nc

I.1.1 Derivatives with respect to lnK ig

N
i
x ig
= T =0
N

ln K kg N,K
r r
m ,K ncs ,Lg ,Ls
ln K kg

I.1.2 Derivatives with respect to N i

If i = k , then

N
i
x ig N N (1 zi )
= T= T 2 i =
N
r r
N i K,N m ,K n cs ,L g ,Ls
N i NT NT

If i k , then

N
i
x ig Ni
= T=
N z
r r = i
N k K,N N k 2
NT NT
m ,K n cs ,L g ,Ls

Hence,

489
(1 zi )
i=k
x ig NT
r =
N k Nr m ,K,K ncs ,Lg ,Ls zi ik
N T

I.1.3 Derivatives with respect to lnK n cs

N
i
x ig
= T =0
N

ln K n c N,K,L ,L
s r r ln K n cs
g s

I.1.4 Derivatives with respect to Lg

N
i
x ig
= T =0
N

L g N,K,K
r r Lg
n cs ,Ls

I.1.5 Derivatives with respect to Ls

N
i
x ig
= T =0
N
r r
Ls N,K,K n cs ,Lg
Ls

I.2 DERIVATIVES OF A TWO-PHASE SYSTEM

For the case of two-phase solid-oil compositions, we have

(1 Ls ) x io i nc
z i = Ls x is + (1 Ls ) x io =
Ls + (1 Ls ) x io i = nc

Note that the mole fraction of i th component in the solid phase is

490
0 i nc
x is =
1 i = nc

Hence,

zi
1 L i nc

x io =
s
(I.1)
z i Ls i = nc
1 Ls

I.2.1 Derivatives with respect to lnK ig

x io
=0
ln K kg N,K ,L ,L
r
n cs g s

I.2.2 Derivatives with respect to N i

Case 1: i = k and when i n c :

Ni
N
T

zi 1 L Ni
1
s

x io
=
1 L s
= = (1 Ls ) N T = N T Ls N T (1 Ls )N i
r r
N i K,N Ni N i N i ( N T Ls N T )
2
m ,K n cs ,Lg ,Ls

=
N T Ls N T N i + Ls N i
=
1 Ls z i + Ls z i
=
(1 Ls ) zi (1 Ls ) = 1 zi i nc
N T (1 Ls )
2 2
N T (1 Ls )
2
N T (1 Ls )
2
N T (1 Ls )

491
Case 2: i = k and when i = n c :

Ni
N Ls
T Ni Ls N T
zi Ls 1 Ls

x io 1 Ls

1
(1 Ls ) N T
r r = = =
N i K,N m ,K n cs ,Lg ,Ls
Ni N i N i

(1 Ls ) N T (1 Ls )( N i Ls N T ) (1 Ls ) NT ( Ni Ls N T ) = N T Ls NT Ni + Ls NT
2

= =
(1 Ls )
2
NT 2
(1 Ls ) N T 2 (1 Ls ) N T 2
N T Ni 1 zi
= = i = nc
(1 Ls ) NT N T (1 Ls )
2

Case 3: i k and when i n c :

Ni
N
T

zi 1 Ls Ni
1
x io
= 1 Ls
= = (1 Ls ) N T
r r
N k K,N m ,K n cs ,L g ,Ls
N k N k N k
(1 Ls ) N i zi zi
= = = i nc
N T (1 Ls )
2 2
N T (1 Ls ) N T (1 Ls )

Case 4: i k and when i = n c

Ni
N Ls
T N i Ls N T
z i Ls 1 Ls

x io 1 Ls

1
(1 Ls ) NT
r r = = =
N k K,N m ,K n cs ,L g ,Ls
N k N k N k
Ls (1 Ls ) N T (1 Ls )( Ni Ls N T ) Ls N T N i + Ls N T z i
= = = i = nc
N T 2 (1 Ls )
2
N T (1 Ls )
2
N T (1 Ls )

Hence,

492
1 zi
N (1 L ) i=k
x io T s
r =
N k Nr m ,K,K z i
n cs ,Lg ,Ls ik
N T (1 Ls )

I.2.3 Derivatives with respect to lnK n cs

Method 1

The solid-oil equilibrium ratio is defined by

0 i nc
x n cs
K is = = 1
x nco i = nc
x
n co

Hence

0 i nc
x io
= 1
i = nc
ln K n cs N,K,L
r r
K
g ,Ls
n cs

Since

1

x n c o K n s
= c =
1
ln K n cs ln K n cs K n cs

Using

1 de u
ln K n cs = u K n cs = e u = eu = e u
K n cs du

Method 2

Using Equation (I.1) we can get

493
x io
=0
ln K n c N,K,L ,L
s r r
g s

I.2.4 Derivatives with respect to Lg

x
io =0
Lg N,K,K
r r
n cs ,Ls

I.2.5 Derivatives with respect to Ls

z
i
x io 1 Ls
=
zi
r r = i nc
Ls N,K,K Ls (1 Ls )
2
ncs ,Lg

z Ls
i
x io 1 L s 1 + L s + z i L s z 1
r r = = = i i = nc
Ls N,K,K Ls (1 Ls ) (1 Ls )
2 2
ncs ,Lg

Hence

zi
i nc
(1 Ls )
2
x io
r r =
Ls N,K,K ncs ,Lg zi 1 i = nc
(1 Ls )2

I.3 DERIVATIVES OF A MULTIPHASE SYSTEM

For the case of three-phase compositions of oil, solid and gas, we have

zi
x io = i = 1, , nc
1 + Lg (K ig 1) + Ls (K is 1)

494
K ig zi
x ig = K ig x io = i = 1, , nc
1 + L g (K ig 1) + Ls (K is 1)

K is z i
x is = K is x io = =1 i = nc
1 + L g (K ig 1) + Ls (K is 1)

At constant pressure and temperature, the mole fraction is


r r
x ij = f (K g , K n cs , N, Lg , Ls ) i = 1,..., n c j = o, g

Taking total differential of the above equation, we have

x ij x ij
dx ij = d ln K kg + d ln K n cs
ln K kg ln K n s r r
N,K
r r
m ,K ncs ,Lg ,Ls
c N,K,Lg ,Ls

x ij x x
+ r r dN k + ij dLg + ij dLs
N k N m ,K,K ncs ,Lg ,Ls Lg
N,K,K ncs ,Ls
r r L s r r
N,K,K n cs ,Lg

I.3.1 Derivatives with respect to lnK ig

For oil phase

zi

x io 1 + Lg (K ig 1) + Ls (K is 1)

=
ln K kg N,K
r r
m ,K n cs ,Lg ,Ls
ln K kg

zi Lg K ig
i=k
= 1 + Lg ( K ig 1) + Ls (K is 1)
2



0 ik

495
For gas phase

zi K ig

x ig 1 + Lg (K ig 1) + Ls (K is 1)
=
ln K kg N,K
r r
m ,K n cs ,Lg ,Ls
ln K kg

z i K ig 1 Lg + Ls (K is 1)
i=k
= 1 + Lg (K ig 1) + Ls (K is 1)
2


0 ik

I.3.2 Derivatives with respect to N i

For oil phase, if i = k , then

zi N
i
x io 1 + L g (K ig 1) + Ls (K is 1)
= NT
1
r r =
N i K,N m ,K n c s ,L g ,Ls
N i 1 + Lg (K ig 1) + Ls (K is 1) N i

=
1 N T Ni
=
(1 zi )

1 + Lg (K ig 1) + Ls (K is 1) N T2 1 + Lg (K ig 1) + Ls (K is 1) N T

And if i k , then

zi N
i
x io 1 + Lg (K ig 1) + Ls (K is 1)
= NT
1
r r =
N k K,N m ,K n cs ,Lg ,Ls
N k 1 + Lg (K ig 1) + Ls (K is 1) N k

Ni 1 zi
= 2 =
1 + Lg (K ig 1) + Ls (K is 1) N T 1 + Lg (K ig 1) + Ls (K is 1) N T

Hence, finally for the oil phase

496
(1 zi ) i=k

x io 1 + Lg (K ig 1) + Ls (K is 1) N T
r =
N k Nr m ,K,K ncs ,L g ,Ls zi
ik
1 + Lg (K ig 1) + Ls (K is 1) N T

Similarly for the gas phase

K ig (1 zi )
i=k
x ig 1 + Lg (K ig 1) + Ls (K is 1) N T
r =
N k Nr m ,K,K K ig zi
ncs ,L g ,Ls
ik
1 + L (K 1) + L (K 1) N
g ig s is T

I.3.3 Derivatives with respect to lnK n cs

For oil phase

zi
z i Ls K is
x io i = nc
1 + Lg (K ig 1) + Ls (K is 1)
= 1 + Lg ( K ig 1) + Ls (K is 1)
2
=
ln K n s r r ln K n cs
c N,K,L ,L
g s
0 i nc

For gas phase

z i K ig
zi K ig Ls K is
x ig 1 + Lg (K ig 1) + Ls (K is 1) i = nc
= 1 + Lg ( K ig 1) + Ls (K is 1)
2
=

ln K n cs N,K,L
r r
g ,Ls
ln K n cs
0 i nc

I.3.4 Derivatives with respect to Lg

For oil phase

497
zi

x 1 + Lg (K ig 1) + Ls (K is 1) zi (K ig 1)
= =
io
Lg N,K,K Lg 2
r r
n cs ,Ls
1 + Lg (K ig 1) + Ls (K is 1)

For gas phase

zi K ig

x ig 1 + Lg (K ig 1) + Ls (K is 1) zi K ig (K ig 1)
= =
Lg L g 2
N,K,K
r r
n cs ,Ls
1 + Lg (K ig 1) + Ls (K is 1)

I.3.5 Derivatives with respect to Ls

For oil phase

zi

x io 1 + Lg (K ig 1) + Ls (K is 1) z i (K is 1)
= =
r r
Ls N,K,K Ls 2
n cs ,L g
1 + Lg (K ig 1) + Ls (K is 1)

For gas phase

z i K ig

x ig 1 + Lg (K ig 1) + Ls (K is 1) zi K ig (K is 1)
= =
r r
Ls N,K,K Ls 2
ncs ,L g
1 + Lg (K ig 1) + Ls (K is 1)

498
Appendix J: Derivatives of the Peng-Robinson EOS

Z Z
J.1 DERIVATION OF AND
x io P

The Peng-Robinson equation-of-state is

Z3 (1 B ) Z2 + ( A 3B2 2B ) Z ( AB B2 B3 ) = 0

Where

aP
A=
(RT) 2

bP
B=
RT

For a multicomponent mixture

nc nc
a = x io x jo (1 k ij ) a i a j
i =1 j=1

nc
b = x io bi
i =1

For a pure component we have

( RT )
2
c
ai = 0.45724 (T)
Pc

RTc
bi = 0.07780
Pc

where

499
T
= 1 + 1
Tc

0.37464+1.54226-0.26992 2
< 0.49
=
0.379640 + 1.485030 - 0.164423 + 0.016666 0.49
2 3

So we have

nc

(x )
P
A= x1o a i1 + x i x 2 a i2 + L + x io x n co a in c
( RT )
2 io
i =1

=
P
( ) (
x1o x1o a11 + x1o x 2o a12 + L + x1o x n o a1n + x 2o x1o a 21 + x 2o x 2o a 22 + L + x 2o x n o a 2n
)
( RT )
2 c c c c

(
+ L + x n co x1o a n c 1 + x n c o x 2o a n c 2 + L + x n co x n c o a n c n c )
Therefore,

A 2P nc
=
x io ( RT )2
x
m =1
a
mo mi

B Pbi
=
x io RT

and

Z Z Z B A B B
3Z2 2Z (1 B ) + ( A 3B2 2B ) + Z2 +Z 6BZ 2z
x io x io x io x io x io x io x io
A B B B
B +A + 2B + 3B2 =0
x io x io x io x io

From the above equation, we can get

Z A F
= ( B Z ) + A 2B 3B2 + 2 ( 3B + 1) Z Z 2
x io x io Z

And

500
Z 1 F
= A ( B Z ) + B ( A 2B 3B2 + 2 ( 3B + 1) Z Z2 )
P P Z

where

F
= 3Z2 2Z (1 B ) + ( A 3B2 2B )
Z

J.2 DERIVATIVES OF FUGACITY COEFFICIENT

J.2.1 Derivatives with respect to x ij

The Peng-Robinson equation-of-state is

ln ij =
bi
Z 1 ln Z B
A j 2 nc
( j ) ( j j ) 2 2B a mj im b x a ln
( )
bi Z j + 1 + 2 B j

b j j m =1 ( )
Z j + 1 2 B j
= ln Cij + Dij + E ij ln G j

where

1
Cij =
( Zj Bj )

Dij =
bi
bj
( Z j 1)

Aj 2 nc b
E ij = x mja im i
2 2B j a j m =1 b

Gj =
( )
Zj + 1+ 2 Bj
Z + (1 2 ) B
j j

Hence,

501
ln ij 1 2Cij Dij E E G j
= + + ln G j ij + ij
x kj Cij x kj x kj x kj G j x kj

where

Z j B j

Cij x kj x kj
=
x kj (Z Bj )
2
j

Dij Z j
b k ( Z j 1)
bi
= b j
x kj b j2 x kj

E ij 1 A j B j A j
nc
1
= j i a b 2b j x mg a mi

Bj Aj
x kj 2 2a jb jB j B j m =1 x kj x kj a jb j
2 nc nc
2
4bj x mja mi x mja mk 2a jb j a ik bi b k a j
2

m =1 m =1

and

G j 2 2 B j Z j
= Z B
x kj Z j + 1 2 B j x kj
( ) x kj
2 j j

Z j
is defined earlier, and
x kj

A j 2P nc
= x a
x kj ( RT )
2 mj mk
m =1

and

B j Pb k
=
x kj RT

502
J.2.2 Derivatives with respect to P

ln ij 1 Cij Dij E ij G j
= + + (Holding phase makes fraction constant)
P Cij P P G j P

where

Cij Z j B j
=
P P P

Dij bi Z j
=
P b j P

and

G j 2 2 B j Z j
= Zj Bj
P
( )
Z j + 1 2 B j P P
2

Z j
is defined earlier.
P

and

B j bj
=
P RT

503
Appendix K: Derivatives of the Compressibility Factor

At constant temperature

Z j = f(x1j , x 2j , ..., x n c j , P) j = o, g

Taking total differential of the above equation, we have

nc
Z j Z j
dZ j = dx ij + dP (K.1)
i =1 x ij P

K.1 DERIVATIVES WITH RESPECT TO lnK ig


r
Dividing Equation (K.1) by ln K kg while holding P, N, K n cs , Lg , Ls and
r
K m constant, we have

Z j nc
Z j x i1 j
= i = 1,..., n c
ln K ig i1 =1 x i1 j ln K ig

K.2 DERIVATIVES WITH RESPECT TO N i


r r
Dividing Equation (K.1) by N k while holding P, K , K n cs , Lg , Ls and N m

constant, we have

Z j nc
Z j x i1 j
= i = 1,..., n c
Ni i1 =1 x i1 j Ni

K.3 DERIVATIVES WITH RESPECT TO lnK n cs


r
Dividing Equation (K.1) by ln K n cs while holding P, N, Lg , Ls and
r
K m constant, we have

504
Z j nc
Z j x ij
=
ln K n cs i =1 x ij ln K n cs

K.4 DERIVATIVES WITH RESPECT TO Lg


r r
Dividing Equation (K.1) by Lg while holding P, K , K n cs , Ls and N constant,

we have

Z j nc
Z j x ij
=
Lg i =1 x ij Lg

K.5 DERIVATIVES WITH RESPECT TO Ls


r r
Dividing Equation (K.1) by Ls while holding P, K , Lg and N constant, we

have

Z j nc
Z j x ij
=
Ls i =1 x ij Ls

Z j Z j
K.6 RELATIONSHIP BETWEEN AND
x ij n ij

At constant P and T we have

(
Z j = f x1j , x 2 j ,..., x n c j )
(
x ij = f n1j , n 2 j ,..., n n c j )
nc
Z
dZ j = j dx kj (K.2)

k =1 x kj
n mj

Where

505
(
n mj = n1j , n 2 j ,..., n (k 1) j , n (k +1) j ,..., n n c j )
and

(
x mj = x1j , x 2 j ,..., x (k 1) j , x (k +1) j ,..., x n c j )
Dividing Equation (K.2) by n ij while holding n mj constant, we get

Z j nc
Z j x kj
=
n ij k =1 x kj n ij

nk nk
x kj = =
n j n1j + n 2 j + ... + n kj + ... + n n c j

1 n kj
2 i=k
x kj n j n j
=
n ij n kj
ik
n j2

Hence,

Z j Z j x1j Z j x 2 j Z j x ij Z j x n c j nc
Z j n kj 1 Z j
= + + ..... + + ..... + = +
n ij x1j n ij x 2 j n ij x ij n ij x n c j n ij k =1 x kj n j
2
n j x ij

506
Appendix L: Derivatives of Physical Properties

L.1 DERIVATIVES OF MOLAR DENSITY

P
j = j = o, g
RTZ j

j P Z j
=
x ij RTZ j2 x ij

L.1.1 Derivatives with respect to lnK ig

j P nc
Z j x i1 j
ln K ig
=
RTZ j2
x
i1 =1 ln K ig
i = 1...n c
i1 j

L.1.2 Derivatives with respect to N i

j P nc
Z j x i1 j
Ni
=
RTZ j2
x
i1 =1 N i
i = 1...n c
i1 j

L.1.3 Derivatives with respect to lnK n cs

j P nc
Z j x ij
ln K n cs
=
RTZ j2
x
i =1 ln K n cs
ij

L.1.4 Derivatives with respect to Lg

j P nc
Z j x ij
Lg
=
RTZ j2
x
i =1 L g
ij

507
L.1.5 Derivatives with respect to Ls

j P nc
Z j x ij
Ls
=
RTZ j2
x
i =1 Ls
ij

L.2 DERIVATIVES OF PHASE SATURATION

L.2.1 Derivatives with respect to lnK ig

S j
=
(
Nj vj ) = N (L v ) = N
j j
v
L j
+ L
v j

ln K ig ln K ig
T
ln K ig
T
j ln K ig j
ln K
ig
RTZ j L j RT Z j N T RT L j Z j
= NT + Lj = Zj + Lj
P ln K Pj ln K ig Pj ln K ig ln K ig
j ig

Hence,

Sw
=0
ln K ig

Sg N T RT Lg Zg N T RT Zg
= Zg + Lj = Lg
ln K ig Pg ln K ig ln K ig Pg ln K ig

So N RT Zo Lo
= T Lo + Zo
ln K ig Po ln K ig ln K ig

Since,

Lo + Lg + Ls = 1

So N RT Zo Lg Ls
= T (1 Lg Ls ) Zo Zo
ln K ig Po ln K ig ln K ig ln K ig

Hence,

508
So N RT Zo
= T (1 Lg Ls )
ln K ig Po ln K ig

L.2.2 Derivatives with respect to N i

S j
=
(
NT L j v j ) = L v + N L j
+ NT L j
v j RT
= L jZ j + NT Z j
L j
+ NT L j
Z j

vj
Ni Ni Ni N i Pj N i Ni
j j T

Thus

Sw
=0
N i

Sw 1
=
N w w (I)

So RT Lo Z
= L o Zo + N T Zo + N T Lo o
Ni Po Ni N i

Since

Lo + Lg + Ls = 1

Hence

So RT Lg Ls Zo RT Z
= L o Zo N T Z o + + N T Lo = L o Zo + N T o
Ni Po Ni Ni N i Po N i

Sg RT Z
= L g Zg + N T g
Ni Pg Ni

L.2.3 Derivatives with respect to P

509
S j
=
(
Nj vj ) = N (L v ) = N
j j L j
vj + Lj
v j

P P
T
P
T
P P

with

L j
=0
P

Hence,

Z RT
j
S j v j P RTN Z Z
= NT L j =
j
= NT L j j = o, g
j j j

P P P P P P

For water phase we have

Sw (N w v w ) v c
= = N w w = N w w 0 2w
P P P w

L.2.4 Derivatives with respect to lnK n cs

S j
=
(
Njvj ) = N (L v ) = N j j
vj
L j
+ Lj
v j

ln K n cs ln K n cs
T
ln K n cs
T
ln K n s ln K
c n c
s

RTZ j L j RT Z j N T RT L j Z j
= NT + Lj = Z j + Lj
Pj ln K n s Pj ln K n cs Pj ln K n cs ln K n cs
c

Therefore,

Sw
=0
ln K n cs

Sg N T RT Zg
= Lg
ln K n cs Pg ln K n cs

510
So N RT Zo Lo
= T L o + Zo
ln K n cs Po ln K n cs ln K n cs

Since

Lo + Lg + Ls = 1

N T RT Zo Lg Ls
= (1 Lg Ls ) Zo Zo
Po ln K n cs ln K n cs ln K n cs

Hence,

So N RT Zo
= T (1 Lg Ls )
ln K n cs Po ln K n cs

L.2.5 Derivatives with respect to Lg

S j ( )=N
L j
NT L j v j v j RTZ j L j RT Z j
= T vj + Lj = N T + Lj
Lg Lg Lg Lg
Pj Lg Pj Lg
N RT L j Z j
= T Z j + Lj j = o, g
Pj Lg Lg

Thus,

Sw
=0
Lg

So N T RT Lo Z
= Zo + Lo o
Lg Po Lg Lg

Since

Lo + Lg + Ls = 1

Therefore,

511
So N T RT (1 Lg Ls ) Z N RT Z
= Zo + Lo o = T Zo + Lo o
Lg Po Lg Lg Po Lg

Sg N T RT Lg Z N T RT Zg
= Zg + Lg g = Zg + Lg
Lg Pg Lg Lg Pg Lg

L.2.6 Derivatives with respect to Ls

S j
=
( v
)=N
L j
NT L j v j
+ L
v j
= N
RTZ j L j
+ L
RT Z j

T
Ls Ls j Ls Ls Pj Ls Pj Ls
T j j

N RT L j Z j
= T Zj + Lj j = o, g
Pj Ls Ls

Thus,

Sw
=0
Ls

So N T RT Lo Z
= Zo + Lo o
Ls Po Ls Ls

Since

Lo + Lg + Ls = 1

Therefore,

So N T RT (1 Lg Ls ) Z N RT Zo
= Zo + Lo o = T Zo + L o
Ls Po Ls Ls Po Ls

Sg N T RT Lg Zg N T RT Zg
= Zg + Lg = Lg
Ls Pg Ls Ls Pg Ls

512
L.3 DERIVATIVES OF RELATIVE PERMEABILITY

Because the derivatives of relative permeability with respect to the independent


variables are different for different models, here Stone's model II is used as an example.

k rw = k rw (S w )

k rg = k rg ( Sg )

k ro = k ro ( Sg ,So ,Sw )

L.3.1 Derivatives with respect to lnK ig

Sw
=0
ln K ig

k rw k Sw
= rw =0
ln K ig Sw ln K ig

k rg k rg Sg
=
ln K ig Sg ln K ig

k ro k Sw k So k Sg k So k Sg
= ro + ro + ro = ro + ro
ln K ig Sw ln K ig So ln K ig Sg ln K ig So ln K ig Sg ln K ig

L.3.2 Derivatives with respect to N i

k rw k rw Sw 1 k rw
= =
N w Sw N w w (I) Sw

k rw
=0
N i

513
k rg k rg Sg
=
N i S g N i

k ro k ro Sw k ro So k ro Sg k ro So k ro Sg
= + + = +
N i Sw N i So Ni Sg Ni So N i Sg N i

L.3.3 Derivatives with respect to P

k rg k rg S g
=
P S g P

k ro k ro Sg k ro So k ro Sw
= + +
P Sg P So P Sw P

k rw k rw Sw
=
P Sw P

L.3.4 Derivatives with respect to lnK n cs

Sw
=0
ln K n cs

k rw k Sw
= rw =0
ln K n cs Sw ln K n cs

k rg k rg Sg
=
ln K n cs Sg ln K n cs

k ro k Sw k So k Sg k So k Sg
= ro + ro + ro = ro + ro
ln K n cs Sw ln K n cs So ln K n cs Sg ln K n cs So ln K n cs Sg ln K n cs

514
L.3.5 Derivatives with respect to Lg

Sw
=0
Lg

k rw k rw Sw
= =0
Lg Sw Lg

k rg k rg Sg
=
Lg Sg Lg

k ro k ro Sw k ro So k ro Sg k ro So k ro Sg
= + + = +
Lg Sw Lg So Lg Sg Lg So Lg Sg Lg

L.3.6 Derivatives with respect to Ls

Sw
=0
Ls

k rw k rw Sw
= =0
Ls Sw Ls

k rg k rg Sg
=
Ls Sg Ls

k ro k ro Sw k ro So k ro Sg k ro So k ro Sg
= + + = +
Ls Sw Ls So Ls Sg Ls So Ls Sg Ls

L.4 DERIVATIVES OF VISCOSITY

The phase viscosity at a desired pressure is

515
* jr
j + 0.000205 jr 0.18
j
j = *
j + ( j 1)
4

104 jr > 0.18


j

where low-pressure viscosity of a mixture is defined as

nc
)
x ij i MWi
=
*
j
i =1
nc

x
i =1
ij MWi

And low-pressure, pure-component viscosity is

0.00034T0.94
ri Tri 1.5
) i
i =
0.0001776(4.58Tri 1.67)5 / 8
Tri > 1.5
i

where

1/ 6
5.44Tci
i =
MWi Pci2 / 3

The reduced phase molar density can be calculated from

nc
jr = j x ij Vci
i =1

and
1
nc 6
5.44 x ijTci
j = i =1
1 2
nc 2 nc 3
ij x MWi ij ci
x P
i =1 i=1

516
and

j = 1.023 + 0.2336 jr + 0.58533 jr 2 0.40758 jr 3 + 0.09332 jr 4

Hence


* j jr jr j
j x ij x ij
x + 0.00025 jr 0.18
j2
j ij

=
x ij
j + 4 3 j j * + ( 4 1)
*

x ij x ij x ij
j j j j

jr > 0.18
104 j2

where

( ) ( )
n n
) )
i MWi x ij MWi MWi x iji MWi
c c

*j
= i =1 i =1
x ij nc
2

x ij MWi
i=1

jr nc
j
= x ijVci + jr Vci
x ij i =1 x ij

nc
5 1 2

nc 2 nc
x ijMWi x ij Pci
6 3
0.907Tci x ijTci
i =1 i =1 i =1
j
=
x ij nc 1 2 2

x MW x P
2 nc 3


i =1
ij i ij ci
i=1

517
nc 1
nc 2


x ijPci

2 3

1 x ijMWi i=1
2 1
nc 6 i =1 nc
3 nc
2


5.44 x ijTci x ijPci + x ijMWi
i =1 x ij i =1 i =1 x ij



2 2
nc 1

x MW x P
2 nc 3

i =1
ij i ij ci
i =1

where

nc 1


x ijMWi

2

i=1
= MWi
x ij nc

x MW
i =1
ij i

And

nc 2


x ijPci

3

i=1 2
= P nc
3

ci x ij Pci
x ij i =1

Also

j jr
= ( 0.2336 + 1.17066 jr 1.22274 jr 2 + 0.28328 jr 3 )
x ij x ij

L.4.1 Derivatives with respect to lnK ig

j nc
j x ij
= k = 1,..., n c
ln K kg i =1 x ij ln K kg

518
L.4.2 Derivatives with respect to N i

j nc
j x ij
= k = 1,..., n c
N k i =1 x ij N k

L.4.3 Derivatives with respect to P

j
x ijVc 0.000205 / j j = 0 jr 0.18
P P

j
=
P
4 j
j P
104 jr > 0.18
j

L.4.4 Derivatives with respect to lnK n cs

j nc
j x ij
=
ln K n cs i =1 x ij ln K n cs

L.4.5 Derivatives with respect to Lg

j nc
j x ij
=
Lg i =1 x ij Lg

L.4.6 Derivatives with respect to Ls

j nc
j x ij
=
Ls i =1 x ij Ls

519
Appendix M: Code Variables for Modeling Asphaltene Precipitation in
GPAS

M.1 DESCRIPTION OF THE VARIABLES FOR ASPHALTENE PRECIPITATION CODE

The new variables for GPAS with the ability to model the effect of asphaltene
precipitation are given in this appendix. The three new primary independent variables are
ln K n cs , Lg and Ls so we will have a total of ( 2n c + 5 ) independent variables for each

gridblock and also three new governing equations.

M.1.1 Residuals of the Governing Equations

R if

Negative residual of the gas-oil fugacity equation for component i at a gridcell


which is represented by ARF(I,J,K,i) or RF(I,J,K,i) in the old code. Keyword: not
necessary but R if was modified.

Rv
Negative residual of volume constraint equation at a gridcell which is defined by
ARV(I,J,K) in the old code. Keyword: not necessary but R v was modified.

R im

Negative residual of the mass balance equation for component i at a gridcell that
is defined by ARM(I,J,K,i) in the old code. Keyword: not necessary but R im was

modified.

520
Rw
Negative residual of water mass balance equation at a gridcell defined by
ARW(I,J,K) in the old code. Keyword: not necessary but R w was modified.

R fs (new)
Negative residual of the solid-oil fugacity equation for n c th component at a

gridcell. Keyword: ARFS(I,J,K).

R fe (new)

Negative residual of multiphase flash equation for component i at a gridcell.


Keyword: ARFE(I,J,K,i).

R er (new)
Negative residual of the solid-oil equilibrium ratio equation for n c th component at

a gridcell. Keyword: ARER(I,J,K).

M.1.2 Derivatives of the Governing Equations

M.1.2.1 Derivatives of Gas-Oil Fugacity Equations

R fi R fi R if
, ,
ln K n cs ln L g ln Ls

Derivative of gas-oil fugacity equation for component i w.r.t. ln K n cs , Lg and Ls .

Keyword: AFKLL(I,J,K, i ,j).

521
1 derivative w.r.t. lnK n cs

j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

M.1.2.2 Derivatives of Volume Constraint Equation

R v R v R v
, ,
ln K n cs ln L g ln Ls

Derivative of volume constraint equation w.r.t. ln K n cs , Lg and Ls . Keyword:

AVKLL(I,J,K ,j).

1 derivative w.r.t. lnK n cs



j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

M.1.2.3 Derivatives of Mass Balance Equation for Hydrocarbon Components

R im R im R im
, ,
ln K n cs(I) Lg (I) Ls(I)

On-diagonal derivative of hydrocarbon component material balance w.r.t. ln K n cs ,


Lg and Ls . Note that M HC = M accum
HC
+ M conv
HC
M source
HC
and i = 1 n c . Keyword:

AMKLL(I,J,K,i,j).

1 derivative w.r.t. lnK n cs



j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

522
R im R im R im
, ,
ln K n cs(I 1) Lg (I 1) Ls(I 1)

Off-diagonal derivative of hydrocarbon component material balance w.r.t. ln K n cs ,


Lg and Ls . Keyword: AMKLL6(I,J,K,i,j,M).

1 derivative w.r.t. lnK n cs



j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

1 cell to the left of K in x-direction


2 cell to the right of K in x-direction

3 cell to the left of K in y-direction
M=
4 cell to the right of K in y-direction
5 cell to the top of K in z-direction

6 cell to the bottom of K in z-direction

M.1.2.4 Derivatives of Mass Balance Equation for Water Component

R w R w R w
, ,
ln K n cs(I) Lg(I) Ls(I)

On-diagonal derivative of water mass balance w.r.t. ln K n cs , Lg and Ls . Note that

M W = M accum
W
+ M conv
W
M source
W
. Keyword: AWKLL(I,J,K,j).

1 derivative w.r.t. lnK n cs



j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

523
R w R w R w
, ,
ln K n cs(I 1) Lg(I1) Ls(I1)

Off-diagonal derivative of water mass balance w.r.t. ln K n cs , Lg , Ls . Keyword:

AWKLL6(I,J,K,j,M).

1 derivative w.r.t. lnK n cs



j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

M.1.2.5 Derivatives of Solid-Oil Fugacity Equation (new)

R fs
ln K ig

Derivative of solid-oil fugacity equation for component n c w.r.t. ln K ig at a

gridcell. Keyword: AFSK(I,J,K, i ).

R fs R fs
,
ln N i P

Derivative of solid-oil fugacity equation for component n c w.r.t. N i and P at a

gridcell. Keyword: AFSNP(I,J,K, i + 1 ).

R fs R fs R fs
, ,
ln K n cs ln L g ln Ls

Derivative of solid-oil fugacity equation for component n c w.r.t. ln K n cs , Lg and

Ls . Keyword: AFSKLL(I,J,K, j).

524
1 derivative w.r.t. lnK n cs

j = 2 derivative w.r.t. L g

3 derivative w.r.t. Ls

M.1.2.6 Derivatives of Multiphase Flash Equation (new)

R fe R fe R fe R fe R fe
, , , ,
ln K ig N i ln K n cs ln L g ln Ls

Derivative of the flash equation w.r.t. ln K ig , N i , Lg , Ls and ln K n cs . Keyword:

AFEKNKLL(I,J,K,i).

1...n c derivative w.r.t. lnK ig



n c + 1...2n c derivative w.r.t. Ni

i = 2n c + 1 derivative w.r.t. Lg

2n c + 2 derivative w.r.t. Ls
2n c + 3 derivative w.r.t. lnK n cs

M.1.2.7 Derivatives of Solid-Oil Equilibrium Ratio Equation (new)

R er R er R er R er R er
, , , ,
ln K ig N i ln K n cs ln L g ln Ls

Derivative of the solid-oil K-value equation w.r.t. ln K ig , N i , Lg , Ls and ln K n cs .

Keyword: AERKNKLL(I,J,K,i).

525
1...n c derivative w.r.t. lnK ig

n c + 1...2n c derivative w.r.t. N i

i = 2n c + 1 derivative w.r.t. lnK n cs

2n c + 2 derivative w.r.t. Lg
2n + 3
c derivative w.r.t. Ls

M.1.3 Other Derivatives

Tij Tij Tij


, ,
lnK n cs Lg Ls

Derivative of transmissibility term for i th component w.r.t. ln K n cs , Lg and Ls for

phase j at a gridcell. Keyword: DTRANKLL(I,J,K,i, i1 ,j).

i = 1...n c

1 derivative w.r.t. lnK n cs



i1 = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

x ij x ij x ij
, ,
ln K n cs ln Lg ln Ls

Derivative of component mole fraction w.r.t. ln K n cs , Lg and Ls for phase j at a

gridcell. Keyword: DXYDKLL(I,J,K,i, i1 ,j).

526
i = 1...n c

1 derivative w.r.t. lnK n cs



i1 = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

Z j Z j Z j
, ,
ln K n cs Lg Ls

Derivatives of Z-factor for phase j w.r.t. ln K n cs , Lg and Ls at a gridcell.

Keyword: DZFKLL(I,J,K,i,j).

1 derivative w.r.t. lnK n cs



i = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

j j j
, ,
lnK n cs Lg Ls

Derivative of molar density for phase j w.r.t. ln K n cs , Lg and Ls at a gridcell.

Keyword: DROKLL(I,J,K,i,j).

527
1 derivative w.r.t. lnK n cs

i = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

S j S j S j
, ,
lnK n cs Lg Ls

Derivative of saturation for phase j w.r.t. ln K n cs , Lg and Ls at a gridcell.

Keyword: DSATKLL(I,J,K,i,j).

1 derivative w.r.t. lnK n cs



i = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

k rj k rj k rj
, ,
lnK n cs Lg Ls

Derivative of relative permeability for phase j w.r.t. ln K n cs , Lg and Ls at a

gridcell. Keyword: DRELKLL(I,J,K,i,j).

1 derivative w.r.t. lnK n cs



i = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

528
1 aqueous phase

j = 2 oil phase
3
gas phase

j j j
, ,
lnK n cs Lg Ls

Derivative of viscosity for phase j w.r.t. ln K n cs , Lg and Ls at a gridcell.

Keyword: DVISKLL(I,J,K,i,j).

1 derivative w.r.t. lnK n cs



i = 2 derivative w.r.t. Lg

3 derivative w.r.t. Ls

1 aqueous phase

j = 2 oil phase
3
gas phase

M.1.4 Other Grid Element Variables

K n cs (new)

Solid-oil equilibrium ratio for the asphaltene component. Keyword:


ZXYS(I,J,K,1).

ln K n cs (new)

Natural logarithm of the solid-oil equilibrium ratio for the asphaltene component.
Keyword: ZXYS(I,J,K,2).

Lg

529
Mole fraction of gas phase which is defined by RATIO(I,J,K,3) in the old code.
Keyword: already defined.

Ls (new)

Mole fraction of solid phase. Keyword: RATIOS(I,J,K).

z i , x ij , ln K i , K i

Representation of mole fractions and K-values. Keyword: already defined by


ZXY(I,J,K, i1 ).

1...n feed mole fraction


c

n +
c 1...2n c x io

i1 = 2n c + 1...3n c x ig

3n c + 1...4n c lnK ig
4n + 1...5n K ig values
c c

K ig

Gas-oil equilibrium ratio for component i which can be represented by the same
notation as of that for K i in the old code or ZXY(I,J,K, 4n c + 1...5n c ). Keyword: not

necessary.

ln K ig

Natural logarithm of gas-oil equilibrium ratio which is the same as ln K i and is


represented by ZXY(I,J,K, 3n c + 1...4n c ) in the old code. Keyword: not necessary.

NT

530
Total number of moles of all components per pore volume which is the same as
PVMOL(I,J,K,4) in the old code. Keyword: already defined.

k arj(I)

The relative permeability for phase j after the occurrence of asphaltene


k 0rj
precipitation which is related to the original relative permeability by: k rj =
a
. Keyword:
Rf
not necessary. Note that k 0rj(I) is the same as k rj(I) which is the original relative

permeability of phase j without the effect of asphaltene precipitation. In the old code,
k rj(I) is represented by REL(I,J,K,j).

R f (new)

Permeability resistance factor for phase j at a gridcell. Keyword: RKARY(I,J,K).

w as (new)

Mass of adsorbed solid asphaltene per mass of rock at a gridcell. Keyword:


WAS(I,J,K).

N s (new)

Total number of moles of asphaltene component in solid phase per pore volume.
Keyword: PVMOLS(I,J,K).

x n cs (new)

Mole fraction of asphaltene component in solid phase which is equal to 1 because


the solid phase contains only one component. Keyword: local variable.

ln n cs (new)

531
Fugacity coefficient of the asphaltene component in the solid phase. Keyword:
PHINCS(I,J,K).

f n cs (new)

Fugacity of asphaltene component in the solid phase. Keyword: not necessary.

ln f n cs (new)

Natural logarithm of fugacity of asphaltene component in the solid phase.


Keyword: FAS(I,J,K).

M.1.5 Scalar Variables for Modeling Asphaltene Precipitation

Ms

Molecular weight of asphaltene component which is the same as that for the
heaviest component in the oil phase, WM( n c ). Keyword: already defined.

R f ,max (new)

Maximum permeability resistance factor for phase j. Keyword: RFACTMAX.

w as,max (new)

Maximum mass fraction of adsorbed solid asphaltene. Keyword: WASMAX.

R (new)

Mass density of rock. Keyword: ROCKMDEN.

ln f n*cs (new)

532
Natural logarithm of reference fugacity. Keyword: FASS.

f n*cs (new)

Reference fugacity at reference pressure. Keyword: not necessary.

P* (new)

The highest pressure at which asphaltenes are first observed to be coming out of
solution or the reference pressure. Keyword: PSTAR.

vs (new)

Molar volume of the solid phase. Keyword: VBS.

533
M.2 LIST OF NEW GRID ELEMENT VARIABLES

Keyword Brief Description

ARFS(I,J,K) Negative residual of the solid-oil fugacity equation for


n c th component at a gridcell
ARFE(I,J,K) Negative residual of three-phase flash equation for
component i at a gridcell
ARER(I,J,K) Negative residual of the solid-oil equilibrium ratio
equation for n c th component at a gridcell
AFKLL(I,J,K, i ,j) Derivative of gas-oil fugacity equation for component i
w.r.t. ln K n cs , Lg and Ls
AVKLL(I,J,K,j) Derivative of volume constraint equation w.r.t.
ln K n cs , Lg and Ls
AMKLL(I,J,K,i,j) On-diagonal derivative of hydrocarbon component
material balance w.r.t. ln K n cs , Lg and Ls
AMKLL6(I,J,K,i,j,M) Off-diagonal derivative of hydrocarbon component
ln K n cs Lg
material balance w.r.t. , and Ls
AWKLL(I,J,K,j) On-diagonal derivative of water mass balance w.r.t.
ln K n cs Lg
, and Ls
AWKLL6(I,J,K,j,M) Off-diagonal derivative of water mass balance w.r.t.
ln K n cs Lg Ls
, ,
AFSK(I,J,K, i ) Derivative of solid-oil fugacity equation for component
n c w.r.t. ln K ig at a gridcell
AFSNP(I,J,K, i + 1 ) Derivative of solid-oil fugacity equation for component
n c w.r.t. N i and P at a gridcell
AFSKLL(I,J,K, j) Derivative of solid-oil fugacity equation for component
n c w.r.t. ln K n cs , Lg and Ls
AFEKNKLL(I,J,K,i) ln K ig N i Lg
Derivative of the flash equation w.r.t. , , ,
Ls and ln K n cs
AERKNKLL(I,J,K,i) Derivative of the solid-oil K-value equation w.r.t.
ln K ig N i Lg Ls ln K n cs
, , , and

534
i Derivative of transmissibility term for phase j at a
DTRANKLL(I,J,K,i, 1 ,j) gridcell

DXYDKLL(I,J,K,i, i1 ,j) Derivative of component mole fraction w.r.t. ln K n cs ,


Lg
and Ls for phase j at a gridcell
DZFKLL(I,J,K,i,j) ln K n cs Lg
Derivatives of Z-factor for phase j w.r.t. , and
Ls at a gridcell
DROKLL(I,J,K,i,j) ln K n cs
Derivative of molar density for phase j w.r.t. ,
Lg
and Ls at a gridcell
DSATKLL(I,J,K,i,j) ln K n cs Lg
Derivative of saturation for phase j w.r.t. ,
and Ls
DRELKLL(I,J,K,i,j) Derivative of relative permeability for phase j w.r.t.
ln K n cs Lg
, and Ls
DVISKLL(I,J,K,i,j) Derivative of viscosity for phase j at a gridcell w.r.t.
ln K n cs Lg
, and Ls
ZXYS(I,J,K,j) Natural logarithm of the solid-oil equilibrium ratio for
the asphaltene component
RATIOS(I,J,K) Mole fraction of solid phase

RKARY(I,J,K) Permeability resistance factor for phase j at a gridcell

WAS(I,J,K) Mass of adsorbed asphaltene per mass of rock at a


gridcell
PVMOLS(I,J,K) Total number of moles of asphaltene component in
solid phase per pore volume
PHINCS(I,J,K) Fugacity coefficient of the asphaltene component in the
solid phase
FAS(I,J,K) Natural logarithm of fugacity of asphaltene component
in the solid phase

535
M.3 LIST OF NEW SCALAR VARIABLES

Keyword Description

RFACTMAX Maximum permeability resistance factor for phase j

WASMAX Maximum mass fraction of adsorbed solid

ROCKMDEN Mass density of rock

FASS Natural logarithm of reference fugacity at reference pressure

PSTAR The highest pressure at which asphaltenes are first observed to be


coming out of solution, this is also called the reference pressure
VBS Molar volume of the solid phase

536
Appendix N: Sample Code Development Guide to Model Asphaltene
Precipitation in GPAS

In this appendix, sample code development procedures to model asphaltene


precipitation in GPAS are explained step-by-step. The initial steps of the development
can be found at the end of this appendix. Each modification section of this appendix
consists of the name of the file containing the GPAS subroutine required for the
development, the location of the file and the coding lines.

Filename: xstep.df
Location: GPAS\eoscomp\drive

New variables are already defined in xstep.df


-
-
-
CALL SOLVERS(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,NPH,P,REL,AWW6,AMK6,AMNP6,AFK,AFW,AFNP,AVK,AVW,
+ AVNP,RF,ARV,AMK,AMNP,AWW,ARM,ARW,IDX,AMW,AWKN,AMW6,AWKN6,
+ PVMOL,
C WALEED 6/8/2006 added asphaltene variables
+ AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
+ AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
-----------------------------------------------------------------------

Filename: xsolve.df
Location: GPAS\eoscomp\solver

SUBROUTINE SOLVERS(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,NPH,P,REL,AWW6,AMK6,AMNP6,AFK,AFW,AFNP,AVK,
> AVW,AVNP,RF,ARV,AMK,AMNP,AWW,ARM,ARW,IDX,AMW,AWKN,AMW6,AWKN6,
> PVMOL
C WALEED 6/8/2006 added asphaltene variables
> AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
> AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
-
-
-
C WALEED introduced asphaltene variables for solvers
REAL*8 AFKLL(IDIM,JDIM,KDIM,NC,3),
+ AVKLL(IDIM,JDIM,KDIM,3),
+ AMKLL(IDIM,JDIM,KDIM,NC,3),
+ AMKLL6(IDIM,JDIM,KDIM,NC,3,6),
+ AWKLL(IDIM,JDIM,KDIM,3),
+ AFSK(IDIM,JDIM,KDIM,NC),

537
+ AFSNP(IDIM,JDIM,KDIM,NC+1),
+ AFSKLL(IDIM,JDIM,KDIM,3),
+ AFEKNKLL(IDIM,JDIM,KDIM,2*NC+3),
+ AERKNKLL(IDIM,JDIM,KDIM,2*NC+3),
+ ARFS(IDIM,JDIM,KDIM),
+ ARFE(IDIM,JDIM,KDIM),
+ ARER(IDIM,JDIM,KDIM)
C WALEED ~END~
-
-
-
$PETSC CALL XSOLVER(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
$PETSC > AFK,AFW,AFNP,AVK,AVW,AVNP,RF,ARV,AMK,AMNP,AWW,ARM,ARW,
$PETSC > IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,KEYOUT,
$PETSC > IDX,AMW,AWKN,AMW6,AWKN6,PVMOL,
C WALEED 6/8/2006 added asphaltene variables
$PETSC > AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
$PETSC > AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
-----------------------------------------------------------------------

Filename: xsolver.df
Location: GPAS\eoscomp\solver

SUBROUTINE XSOLVER(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
+ AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
+ NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
+ AMW6,AWKN6,PVMOL,
C WALEED 6/2/2006
+ AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
+ AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
-
-
-
C WALEED 6/2/2006 introduced variables
REAL*8 AFKLL(NX,NY,NZ,NC,3),
+ AVKLL(NX,NY,NZ,3),
+ AMKLL(NX,NY,NZ,NC,3),
+ AMKLL6(NX,NY,NZ,NC,3,6),
+ AWKLL(NX,NY,NZ,3),
+ AFSK(NX,NY,NZ,NC),
+ AFSNP(NX,NY,NZ,NC+1),
+ AFSKLL(NX,NY,NZ,3),
+ AFEKNKLL(NX,NY,NZ,2*NC+3),
+ AERKNKLL(NX,NY,NZ,2*NC+3),
+ ARFS(NX,NY,NZ),
+ ARFE(NX,NY,NZ),
+ ARER(NX,NY,NZ)
C WALEED ~END~
-
-
-
C WALEED 5/25/2006
C IF(IMPSURF .EQ. .FALSE.) THEN
C CALL JPETSC3D(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
C + AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
C + NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
C + AMW6,AWKN6,NA)
C ELSE
C CALL JPETSC3DT(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
C + AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,

538
C + NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
C + AMW6,AWKN6,NA,PVMOL)
C ENDIF
IF(IMPSURF .EQ. .FALSE.) THEN
IF (IASPR .EQ. .TRUE.) THEN
CALL JPETSC3DA(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
+ AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
+ NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
+ AMW6,AWKN6,NA,
+ AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
+ AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
ELSE IF (IASPR .EQ. .FALSE.) THEN
CALL JPETSC3D(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
+ AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
+ NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
+ AMW6,AWKN6,NA)
END IF
ELSE IF (IMPSURF .EQ. .TRUE.)
CALL JPETSC3DT(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
+ AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
+ NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
+ AMW6,AWKN6,NA,PVMOL)
ENDIF
C WALEED ~END~
-
-
-
C WALEED 5/31/2006 added subroutine jpetsc3da
-
-
-
SUBROUTINE JPETSC3DA(NC,NP,NPH,P,REL,AWW6,AMK6,AMNP6,
+ AFK,AFW,AFNP,AVK,AVW,AVNP,ARF,ARV,AMK,AMNP,AWW,ARM,ARW,
+ NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,IDX,AMW,AWKN,
+ AMW6,AWKN6,NA,
C WALEED 6/2/2006
+ AFKLL,AVKLL,AMKLL,AMKLL6,AWKLL,AFSK,AFSNP,AFSKLL,
+ AFEKNKLL,AERKNKLL,ARFS,ARFE,ARER)
-
-
-
C WALEED 5/25/2006
C INTEGER LC(7*(2*NC+2)*(2*NC+2)),
C + IROW((2*NC+2)*NB),
INTEGER LC(7*(2*NC+6)*(2*NC+6)), ! changed lc & irow
+ IROW((2*NC+6)*NB),
C WALEED ~END~
-
-
-
C WALEED 5/25/2006
C REAL*8 BB(7*(2*NC+2)*(2*NC+2)),
C + RHS((2*NC+2)*NB)
REAL*8 BB(7*(2*NC+6)*(2*NC+6)), ! changed bb & rhs
+ RHS((2*NC+6)*NB)
C WALEED ~END~
-
-
-

539
C WALEED 6/2/2006 introduced variables
REAL*8 AFKLL(NX,NY,NZ,NC,3),
+ AVKLL(NX,NY,NZ,3),
+ AMKLL(NX,NY,NZ,NC,3),
+ AMKLL6(NX,NY,NZ,NC,3,6),
+ AWKLL(NX,NY,NZ,3),
+ AFSK(NX,NY,NZ,NC),
+ AFSNP(NX,NY,NZ,NC+1),
+ AFSKLL(NX,NY,NZ,3),
+ AFEKNKLL(NX,NY,NZ,2*NC+3),
+ AERKNKLL(NX,NY,NZ,2*NC+3),
+ ARFS(NX,NY,NZ),
+ ARFE(NX,NY,NZ),
+ ARER(NX,NY,NZ)
C WALEED ~END~
-
-
-
C WALEED 5/25/2006
C nblock = 2*NC+2
C NV = ITWO * NC + ITWO
nblock = 2*NC+6
NV = ITWO * NC + 6 ! changed nblock & nv
C WALEED ~END~
-
-
-
C WALEED 5/31/2006 ! no change in the section below
-
-
-
C WALEED 5/31/2006 added 3 variables to g/o f
L = L + IONE
BB(L) = AFKLL(I,J,K,IC,1) ! afkll
LC(L) = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AFKLL(I,J,K,IC,2)
LC(L) = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AFKLL(I,J,K,IC,3)
LC(L) = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 5/31/2006 added 3 variables to vc
L = L + IONE
BB(L) = AVKLL(I,J,K,1) ! avkll
LC(L) = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AVKLL(I,J,K,2)
LC(L) = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AVKLL(I,J,K,3)
LC(L) = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0

540
LC(L) = IDX(I,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,5)
LC(L) = IDX(I,J,K-1) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,5)
LC(L) = IDX(I,J,K-1) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,5)
LC(L) = IDX(I,J,K-1) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K-1) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,3)
LC(L) = IDX(I,J-1,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,3)
LC(L) = IDX(I,J-1,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,3)
LC(L) = IDX(I,J-1,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J-1,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,1)
LC(L) = IDX(I-1,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,1)
LC(L) = IDX(I-1,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,1)
LC(L) = IDX(I-1,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I-1,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL(I,J,K,IC,1) ! amkll
LC(L) = IDX(I,J,K) + (NC2+3) - IONE

541
L = L + IONE
BB(L) = AMKLL(I,J,K,IC,2)
LC(L) = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL(I,J,K,IC,3)
LC(L) = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,2)
LC(L) = IDX(I+1,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,2)
LC(L) = IDX(I+1,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,2)
LC(L) = IDX(I+1,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I+1,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,4)
LC(L) = IDX(I,J+1,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,4)
LC(L) = IDX(I,J+1,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,4)
LC(L) = IDX(I,J+1,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J+1,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to mass
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,1,6) ! amkll6
LC(L) = IDX(I,J,K+1) + (NC2+3) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,2,6)
LC(L) = IDX(I,J,K+1) + (NC2+4) - IONE
L = L + IONE
BB(L) = AMKLL6(I,J,K,IC,3,6)
LC(L) = IDX(I,J,K+1) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J+1,K) + (NC2+6) - IONE

542
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K-1) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J-1,K) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I-1,J,K) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
L = L + IONE
BB(L) = AWKLL(I,J,K,1) ! awkll
LC(L) = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AWKLL(I,J,K,2)
LC(L) = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AWKLL(I,J,K,3)
LC(L) = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + (NC2+6) - IONE
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I+1,J,K) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-

543
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J+1,K) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 added 3 variables to water
DO JC = 1 , 4
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K+1) + (NC2P2+JC) - IONE
END DO
C WALEED ~END~
-
-
-
C WALEED 5/25/2006 defined s/o fugacity eq. for solver
DO IC = 1 , NC
L = L+IONE
BB(L) = AFSK(I,J,K,IC) ! afsk
LC(L) = IDX(I,J,K) + IC - IONE
END DO
DO IC = 1 , NC
L = L+IONE
BB(L) = AFSNP(I,J,K,IC) ! afsnp
LC(L) = IDX(I,J,K) + NC + IC - IONE
END DO
L = L + IONE
BB(L) = AFSNP(I,J,K,NCP1)
LC(L) = IDX(I,J,K) + NC2P1 - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + NC2P2 - IONE
L = L + IONE
BB(L) = AFSKLL(I,J,K,1) ! afskll
LC = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AFSKLL(I,J,K,2)
LC = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AFSKLL(I,J,K,3)
LC = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC = IDX(I,J,K) + (NC2+6) - IONE

IROW(IW+IONE) = NV
N = N + IONE
RHS(N) = ARFS(I,J,K)
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 defined fe for solver
! need to fix the 2/3 phases

544
DO IC = 1 , NC
L = L+IONE
BB(L) = AFEKNKLL(I,J,K,IC) ! afeknkll
LC(L) = IDX(I,J,K) + IC - IONE
END DO
DO IC = 1 , NC
L = L+IONE
BB(L) = AFEKNKLL(I,J,K,IC+NC)
LC(L) = IDX(I,J,K) + NC + IC - IONE
END DO
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + NC2P1 - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + NC2P2 - IONE
L = L + IONE
BB(L) = AFEKNKLL(I,J,K,NC2P1)
LC = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AFEKNKLL(I,J,K,NC2P2)
LC = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE
BB(L) = AFEKNKLL(I,J,K,NC2+3)
LC = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC0
LC = IDX(I,J,K) + (NC2+6) - IONE

IROW(IW+ITWO) = NV
N = N + IONE
RHS(N) = ARFE(I,J,K)
C WALEED ~END~
-
-
-
C WALEED 6/1/2006 defined er for solver
DO IC = 1 , NC
L = L+IONE
BB(L) = AERKNKLL(I,J,K,IC) ! aerknkll
LC(L) = IDX(I,J,K) + IC - IONE
END DO
DO IC = 1 , NC
L = L+IONE
BB(L) = AERKNKLL(I,J,K,NC+IC)
LC(L) = IDX(I,J,K) + NC + IC - IONE
END DO
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + NC2P1 - IONE
L = L + IONE
BB(L) = RC0
LC(L) = IDX(I,J,K) + NC2P2 - IONE
L = L + IONE
BB(L) = AERKNKLL(I,J,K,NC2P1)
LC = IDX(I,J,K) + (NC2+3) - IONE
L = L + IONE
BB(L) = AERKNKLL(I,J,K,NC2P2)
LC = IDX(I,J,K) + (NC2+4) - IONE
L = L + IONE

545
BB(L) = AERKNKLL(I,J,K,NC2+3)
LC = IDX(I,J,K) + (NC2+5) - IONE
L = L + IONE
BB(L) = RC1
LC = IDX(I,J,K) + (NC2+6) - IONE

IROW(IW+3) = NV
N = N + IONE
RHS(N) = ARER(I,J,K)

IROW(IW+4) = NV
N = N + IONE
RHS(N) = RC0
C WALEED ~END~
-
-
-
C WALEED 6/8/2006 updating the primary variables
ARFS(I,J,K) = RHS(IDX(I,J,K)-RSTART+2*NC+3)
ARFE(I,J,K) = RHS(IDX(I,J,K)-RSTART+2*NC+4)
ARER(I,J,K) = RHS(IDX(I,J,K)-RSTART+2*NC+5)
C WALEED ~END~
-----------------------------------------------------------------------

This line should be added to some files:


include 'xgendat.h' see xflash for details

-----------------------------------------------------------------------

Filename: xstep.df
Location: GPAS\eoscomp\drive

CALL JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,POR,TCOFX,TCOFY,TCOFZ,SAT,P,PORI,VP,VB,RATIO,W,
+ NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,TRAPN,DTRAPN,
+ RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,AVK,AVW,
+ AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,X,ZXY,DEPTH,
+ ROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,DRELS,DVISS,
+ DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,ZPERM,
c print*, "out of Jacobian"
c Marcondes added cross transmisibilities 12/07/04
+ tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze,XPERM,YPERM,RKARY,^M
+ fpk,fpe,fpg,
C WALEED 2/14/2006 added asphaltene variables for calling jacobian
+ RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
+ DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL,
+ AFKLL,AVKLL,AERKNKLL,AFEKNKLL,AFSKLL,AFSNP,AFSK,
+ FAS)^M
-----------------------------------------------------------------------

Filename: jacobian.df
Location: GPAS\eoscomp\jcobian

SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,

546
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL
> AFKLL,AVKLL,AERKNKLL,AFEKNKLL,AFSKLL,AFSNP,AFSK,
> FAS)^M
-
-
-
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS(NX,NY,NZ),
> AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),
> AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2),
> DROKLL(NX,NY,NZ,3,3),
> DTRANKLL(NX,NY,NZ,NC,3,NP),
> AFKLL(NX,NY,NZ,NC,3),AVKLL(NX,NY,NZ,3),
> AERKNKLL(NX,NY,NZ,2*NC+3),
> AFEKNKLL(NX,NY,NZ,2*NC+3),
> AFSKLL(NX,NY,NZ,3),
> AFSNP(NX,NY,NZ,NC+1),AFSK(NX,NY,NZ,NC),
> FAS(NX,NY,NZ)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables for calling prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL,
> AFKLL,AVKLL,AERKNKLL,AFEKNKLL,AFSKLL,AFSNP,AFSK,
> FAS))^M
-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE PREROW(NP,NC,NPH,TEMP,P,VB,VP,TMOLR,PVMOL,ZXY,
> RATIO,ZF,DZF,
> TC,PC,VC,WT,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,
> AD,BD,PARACH,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,

547
> ARF,PHI,AFK,AFW,AFNP,DFV,AVK,AVW,AVNP,ARV,DTRAN,
> XTRM,YTRM,ZTRM,AMK,AMNP,AWW,AMK6,AMNP6,AWW6,NWELL,
> TD,X,POR,PORI,DEPTH,W,NX,NY,NZ,LDIM,I1,
> I2,J1,J2,K1,K2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,
> VISCW,DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,ZXYS,DROKLL,DTRANKLL,
> AFKLL,AVKLL,AERKNKLL,AFEKNKLL,AFSKLL,AFSNP,AFSK,
> FAS)^M
-
-
-
C WALEED 3/9/2006 added asphaltene variables to prerow
REAL*8 RATIOS(NX,NY,NZ),AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> ZXYS(NX,NY,NZ,2),DROKLL(NX,NY,NZ,3,NP),
> DTRANKLL(NX,NY,NZ,NC,3,NP),
> AFKLL(NX,NY,NZ,NC,3),AVKLL(NX,NY,NZ,3),
> AERKNKLL(NX,NY,NZ,2*NC+3),
> AFEKNKLL(NX,NY,NZ,2*NC+3),
> AFSKLL(NX,NY,NZ,3),
> AFSNP(NX,NY,NZ,NC+1),AFSK(NX,NY,NZ,NC),
> FAS(NX,NY,NZ)
C WALEED ~END~
-
-
-
CALL JACO1(ISTART,IEND,NC,NPH(I,J,K,1:NP),P(I,J,K),
> PVMOL(I,J,K,1:NP+2),VP(I,J,K),
> ZXY(I,J,K,1:5*NC),RATIO(I,J,K,1:NP),ZF(I,J,K,1:NP),
> DZF(I,J,K,1:NC+1,1:NP),DZN(1:NC,1:NP),
> DZFKN(1:2*NC+1,1:NP),PHI(I,J,K,1:NC,1:NP),
> DEN(I,J,K,1:NP),
> RR,DRR(1:2*NC+1),XYZ(1:NC),
> AFK(I,J,K,1:NC+NA,1:NC+NA),AFW(I,J,K,1:NC+NA),
> AFNP(I,J,K,1:NC+NA,1:NC+NA+1,1:NP),DFV(I,J,K,1:NC),
> AVK(I,J,K,1:NC+NA),AVW(I,J,K),
> AVNP(I,J,K,1:NC+NA+1),ARV(I,J,K),NP,NB,
> AQCDEN(I,J,K,1:NA+1),DDEN(I,J,K,1:2*NC+1,1:NP),
> X(I,J,K,1:NC+NA+1)
C WALEED 6/7/2006 added asphaltene variables
> DXYDKLL(I,J,K,1:NC,1:3,1:NP),
> AFKLL(I,J,K,1:NC,1:3),
> AVKLL(I,J,K,1:3),
> DZFKLL(I,J,K,1:3,1:NP),
> AERKNKLL(I,J,K,1:2*NC+3),
> AFEKNKLL(I,J,K,1:2*NC+3),
> ZXYS(I,J,K,1:2),
> RATIOS(I,J,K),AFSKLL(I,J,K,1:3),
> AFSNP(I,J,K,1:NC+1),
> AFSK(I,J,K,1:NC),FAS(I,J,K))

548
-----------------------------------------------------------------------

Filename: eos_jaco.f
Location: GPAS\eoscomp\jacobian

SUBROUTINE JACO1(ISTART,IEND,NC,NPH,P,PVMOL,VP,ZXY,RATIO,ZF,
+ DZF,DZN,DZFKN,PHI,DEN,RR,DRR,XYZ,AFK,AFW,AFNP,
+ DFV,AVK,AVW,AVNP,ARV,NP,NB,AQCDEN,DDEN,X,
C WALEED added asphaltene variables
+ DXYDKLL,AFKLL,AVKLL,DZFKLL,AERKNKLL,AFEKNKLL,
+ ZXYS,RATIOS,AFSKLL,AFSNP,AFSK,FAS)
-
-
-
C WALEED 6/7/2006 added variables
REAL*8 SUMC, EKM1, EKM2, TERM1, TERM2,
> C2,
> DXYDKLL(NC,3,NP,NB), AFKLL(NC,3,NB),
> AVKLL(3,NB), DZFKLL(3,NP,NB),
> AERKNKLL(2*NC+3,NB), AFEKNKLL(2*NC+3,NB),
> ZXYS(2,NB), RATIOS(NB),
> AFSKLL(3,NB), AFSNP(NC+1,NB),
> AFSK(NC,NB), FAS(NB)
C WALEED ~END~
-
-
-
C WALEED 4/10/2006 modified avnp for 1 phase
C no change for p
IF (IASPR) THEN
AVNP(I,K) = RTP*DZFKN(I+NC,J,K) + C1
GO TO 3
END IF
C WALEED ~END~
-
-
-
C WALEED 4/5/2006 defined afkll for 1 phase
C no change for afk/afnp for 1 phase
IF (IASPR) THEN
IF (NPH(2,K).NE.IZERO) THEN
SUMB = RC0
DO 5 J = 1 , NC
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,1,2,K)
5 CONTINUE
AFKLL(I,1,K) = -SUMB
SUMB = RC0
DO 6 J = 1 , NC
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,2,2,K)
6 CONTINUE
AFKLL(I,2,K) = -SUMB
SUMB = RC0
DO 7 J = 1 , NC
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,3,2,K)
7 CONTINUE
AFKLL(I,3,K) = -SUMB
END IF
IF (NPH(3,K).NE.IZERO) THEN
AFKLL(I,1,K) = RC0
AFKLL(I,2,K) = RC0

549
AFKLL(I,3,K) = RC0
END IF
END IF
C WALEED ~END~
-
-
-
C WALEED 4/11/2006 defined avkll for 1 phase
IF (IASPR) THEN
IF (NPH(3,K).EQ.IZERO) THEN
AVKLL(2,K) = RC0
ELSE IF (NPH(3,K).NE.IZERO) THEN
AVKLL(2,K)=RTP*(DZFKLL(2,3,K)-ZF(3,K))
END IF
IF (NPH(2,K).EQ.IZERO) THEN
AVKLL(1,K) = RC0
AVKLL(3,K) = RC0
ELSE IF (NPH(2,K).NE.IZERO) THEN
AVKLL(1,K) = RTP * DZFKLL(1,2,K)
AVKLL(3,K) = RTP * (RATIO(2,K)*DZFKLL(3,2,K)-
+ ZF(2,K)) + VBS
END IF
END IF
C WALEED ~END~
-
-
-
C WALEED 4/13/2006 defined aerknkll for 1 phase
IF (IASPR) THEN
DO 15 I = 1 , NC
AERKNKLL(I,K) = RC0
AERKNKLL(NC+I,K) = RC0
15 CONTINUE
AERKNKLL(NC2P1,K)= RC0
AERKNKLL(NC2P2,K)= RC0
AERKNKLL(NC2P2+1,K)= RC0
END IF
C WALEED ~END~
-
-
-
C WALEED 4/13/2006 defined afeknkll for 1 phase
IF (IASPR) THEN
IF (NPH(3,K).EQ.IONE) THEN
DO 16 I = 1 , NC
AFEKNKLL(I,K) = RC0
AFEKNKLL(NC+I,K) = RC0
16 CONTINUE
AFEKNKLL(NC2P1,K) = RC0
AFEKNKLL(NC2P2,K) = RC0
AFEKNKLL(NC2P2+1,K) = RC0
END IF
IF (NPH(2,K).EQ.IONE) THEN
DO 18 I = 1 , NC
AFEKNKLL(I,K) = RC0
SUMA = RC0
DO 17 JC = 1 , NC
IF (JC.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (JC.NE.NC) THEN

550
EKM2 = -RC1
END IF
TERM1 = ZXY(JC,K)*EKM2
TERM2 = 1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/TERM2
17 CONTINUE
IF (I.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (I.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = RC1/PVMOL(4,K)
TERM2 = 1 + RATIO(3,K)* EKM1 + RATIOS(K) * EKM2
AFEKNKLL(I,K) = TERM1 * ( EKM2/TERM2 - SUMA)
18 CONTINUE
EKM2 = EXP(ZXYS(2,K)) - RC1
TERM1 = ZXY(NC,K)*(EKM2+RC1)
TERM2 = 1 + RATIOS(K)*EKM2
AFEKNKLL(NC2P1,K) = TERM1/(TERM2*TERM2)
AFEKNKLL(NC2P2,K) = RC0

SUMA = RC0
DO 19 JC = 1 , NC
IF (JC.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (JC.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = ZXY(J,K) * EKM2 * EKM2
TERM2 = 1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/(TERM2*TERM2)
19 CONTINUE
AFEKNKLL(NC2P2+1,K) = -SUMA
END IF
END IF
C WALEED ~END~
-
-
-
C WALEED 4/10/2006 modified avk & avnp for 2 hc
IF (IASPR) THEN
AVK(I,K) = RTP * SUMA
TERM = (RC1-TMPV(1)/DEN(1,K)) / (TMPV(4)*TMPV(4))
AVNP(I,K) = RTP * SUMB + TERM
GO TO 50
END IF
C WALEED ~END~
-
-
-
C WALEED 4/5/2006 modified afk & afnp for 2 hc
IF (IASPR) THEN
DO 54 I = 1 , NC
DO 53 J = 1 , NC
AFK(I,J,K) = AFNP(I,J,NP,K)*DXYDKN(I,J,3,K)-
+ AFNP(I,J,NP-1,K)*DXYDKN(I,J,2,K)
IF ( I.EQ.J ) AFK(I,I,K) = AFK(I,I,K) + RC1
AFNP(I,J,1,K) = AFNP(I,J,NP,K)*DXYDKN(I,J,6,K)-
+ AFNP(I,J,NP-1,K)*DXYDKN(I,J,5,K)

551
53 CONTINUE
AFW(I,K) = RC0
AFNP(I,NC+1,1,K) = AFNP(I,NCP1,NP,K)-
+ AFNP(I,NCP1,NP-1,K)
54 CONTINUE
END IF
C WALEED ~END~
-
-
-
C WALEED 4/11/2006 defined afkll for 2 hc
IF (IASPR) THEN
DO 59 I = 1 , NC
AFKLL(I,1,K) = RC0
AFKLL(I,2,K) = RC0
AFKLL(I,3,K) = RC0
SUMA = RC0
SUMB = RC0
DO 55 J = 1 , NC
SUMA = SUMA + AFNP(I,J,3,K)*DXYDKLL(J,1,3,K)
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,1,2,K)
55 CONTINUE
AFKLL(I,1,K) = SUMA - SUMB
SUMA = RC0
SUMB = RC0
DO 56 J = 1 , NC
SUMA = SUMA + AFNP(I,J,3,K)*DXYDKLL(J,2,3,K)
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,2,2,K)
56 CONTINUE
AFKLL(I,2,K) = SUMA - SUMB
SUMA = RC0
SUMB = RC0
DO 57 J = 1 , NC
SUMA = SUMA + AFNP(I,J,3,K)*DXYDKLL(J,3,3,K)
SUMB = SUMB + AFNP(I,J,2,K)*DXYDKLL(J,3,2,K)
57 CONTINUE
AFKLL(I,3,K) = SUMA - SUMB
59 CONTINUE
END IF
C WALEED ~END~
-
-
-
C WALEED 4/6/2006 defined afsk, afsnp & afskll for 2 hc
C do i need this for 1 phase?
IF (IASPR) THEN
AFSKLL(1,K) = RC0
AFSKLL(2,K) = RC0
AFSKLL(3,K) = RC0
AFSNP(NC+1,K) = RC0
DO 62 I = 1 , NC
AFSK(I,K) = RC0
AFSNP(I,K) = RC0
SUMA = RC0
DO 60 J = 1 , NC
SUMA = SUMA + AFNP(NC,J,2,K)*DXYDKN(J,I,2,K)
60 CONTINUE
AFSK(I,K) = -SUMA
SUMA = 0
DO 61 J = 1 , NC

552
SUMA = SUMA + AFNP(NC,J,2,K)*DXYDKN(J,I,5,K)
61 CONTINUE
AFSNP(I,K) = -SUMA
62 CONTINUE
SUMA = VBS/(EXP(FAS(K))*RGASR*TEMPR)
AFSNP(NC+1,K) = SUMA-(RC1/P(K))-AFNP(NC,NCP1,2,K)
SUMA = RC0
DO 63 J = 1 , NC
SUMA = SUMA + AFNP(NC,J,2,K)*DXYDKLL(J,1,2,K)
63 CONTINUE
AFSKLL(1,K) = 1 - SUMA
SUMA = RC0
DO 64 J = 1 , NC
SUMA = SUMA + AFNP(NC,J,2,K)*DXYDKLL(J,2,2,K)
64 CONTINUE
AFSKLL(2,K) = -SUMA
SUMA = RC0
DO 65 J = 1 , NC
SUMA = SUMA + AFNP(NC,J,2,K)*DXYDKLL(J,3,2,K)
65 CONTINUE
AFSKLL(3,K) = -SUMA
GO TO 102
END IF
C WALEED ~END~
-
-
-
C WALEED 4/10/2006 defined avkll for 2 hc
IF (IASPR) THEN
SUMA = RC0
SUMB = RC0
SUMC = RC0
DO 125 J = 2 , NP
SUMA = SUMA + RATIO(J,K) * DZFKLL(1,J,K)
SUMB = SUMB + RATIO(J,K) * DZFKLL(2,J,K)
SUMC = SUMC + RATIO(J,K) * DZFKLL(3,J,K)
125 CONTINUE
AVKLL(1,K) = RTP * SUMA
AVKLL(2,K) = RTP * (SUMB + ZF(3,K) - ZF(2,K))
AVKLL(3,K) = RTP * (SUMC - ZF(2,K)) + VBS
END IF
C WALEED ~END~
-
-
-
C WALEED 4/13/2006 defined aerknkll for 2 hc
IF (IASPR) THEN
C2 = RC1/(ZXY(NC2,K)*ZXY(NC2,K))
DO 130 I = 1 , NC
AERKNKLL(I,K) = C2*DXYDKN(NC,I,2,K)
AERKNKLL(NC+I,K) = C2*DXYDKN(NC,I,5,K)
130 CONTINUE
AERKNKLL(NC2P1,K)= RC1/(EXP(ZXYS(2,K))+C2*DXYDKLL(NC,1,2,K)
AERKNKLL(NC2P2,K)= C2*DXYDKLL(NC,2,2,K)
AERKNKLL(NC2P2+1,K)= C2*DXYDKLL(NC,3,2,K)
END IF
C WALEED ~END~
-
-
-

553
C WALEED 4/13/20006 defined afeknkll for 2 hc
IF (IASPR) THEN
DO 135 I = 1 , NC
SUMA = RC0
DO 132 J = 1 , NC
EKM1 = EXP(ZXY(NC3+J,K)) - RC1
IF (J.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (J.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = ZXY(J,K)*(EKM1+RC1)*(1 + RATIOS(K)*EKM2)
TERM2 = 1 + RATIO(3,K)*EKM1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/(TERM2*TERM2)
132 CONTINUE
AFEKNKLL(I,K) = SUMA

SUMA = RC0
DO 133 J = 1 , NC
EKM1 = EXP(ZXY(NC3+J,K)) - RC1
IF (J.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (J.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = ZXY(J,K)*EKM1
TERM2 = 1 + RATIO(3,K)*EKM1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/TERM2
133 CONTINUE
EKM1 = EXP(ZXY(NC3+I,K)) - RC1
IF (I.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (I.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = RC1/PVMOL(4,K)
TERM2 = 1 + RATIO(3,K)* EKM1 + RATIOS(K) * EKM2
AFEKNKLL(NC+I,K) = TERM1 * (EKM1/TERM2 - SUMA)
135 CONTINUE
EKM1 = EXP(ZXY(NC3+NC,K)) - RC1
EKM2 = EXP(ZXYS(2,K)) - RC1
TERM1 = -ZXY(NC,K)*EKM1*RATIOS(K)*(EKM2+RC1)
TERM2 = 1 + RATIO(3,K)*EKM1 + RATIOS(K)*EKM2
AFEKNKLL(NC2P1,K) = TERM1/(TERM2*TERM2)

SUMA = RC0
DO 136 J = 1 , NC
EKM1 = EXP(ZXY(NC3+J,K)) - RC1
IF (J.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (J.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = ZXY(J,K) * EKM1 * EKM1
TERM2 = 1 + RATIO(3,K)*EKM1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/(TERM2*TERM2)
136 CONTINUE
AFEKNKLL(NC2P2,K) = -SUMA

SUMA = RC0

554
DO 137 J = 1 , NC
EKM1 = EXP(ZXY(NC3+J,K)) - RC1
IF (J.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (J.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = ZXY(J,K) * EKM1 * EKM2
TERM2 = 1 + RATIO(3,K)*EKM1 + RATIOS(K)*EKM2
SUMA = SUMA + TERM1/(TERM2*TERM2)
137 CONTINUE
AFEKNKLL(NC2P2+1,K) = -SUMA
END IF
C WALEED ~END~

found a new ARV in this file but it seems that it's not being used
-----------------------------------------------------------------------

Filename: xstep.df
Location: GPAS\eoscomp\drive

DTRANKLL is already defined for xstep


-
-
-
CALL JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,POR,TCOFX,TCOFY,TCOFZ,SAT,P,PORI,VP,VB,RATIO,W,
+ NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,TRAPN,DTRAPN,
+ RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,AVK,AVW,
+ AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,X,ZXY,DEPTH,
+ ROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,DRELS,DVISS,
+ DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,ZPERM,
c print*, "out of Jacobian"
c Marcondes added cross transmisibilities 12/07/04
+ tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze,XPERM,YPERM,RKARY,^M
+ fpk,fpe,fpg,
C WALEED 2/14/2006 added asphaltene variables for calling jacobian
+ RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
+ DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL)^M
-----------------------------------------------------------------------

Filename: jacobian.df
Location: GPAS\eoscomp\jcobian

SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL)
-
-
-

555
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS(NX,NY,NZ),
> AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),
> AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2),
> DROKLL(NX,NY,NZ,3,3),
> DTRANKLL(NX,NY,NZ,NC,3,NP)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables for calling prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL,DTRANKLL)^M
-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE PREROW(NP,NC,NPH,TEMP,P,VB,VP,TMOLR,PVMOL,ZXY,
> RATIO,ZF,DZF,
> TC,PC,VC,WT,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,
> AD,BD,PARACH,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,
> ARF,PHI,AFK,AFW,AFNP,DFV,AVK,AVW,AVNP,ARV,DTRAN,
> XTRM,YTRM,ZTRM,AMK,AMNP,AWW,AMK6,AMNP6,AWW6,NWELL,
> TD,X,POR,PORI,DEPTH,W,NX,NY,NZ,LDIM,I1,
> I2,J1,J2,K1,K2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,
> VISCW,DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,ZXYS,DROKLL,DTRANKLL)^M
-
-
-
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS(NX,NY,NZ),AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),

556
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> ZXYS(NX,NY,NZ,2),DROKLL(NX,NY,NZ,3,NP),
> DTRANKLL(NX,NY,NZ,NC,3,NP)
-
-
-
CALL JACO2(NC,NPH(I,J,K,1:NP),ZXY(I,J,K,1:5*NC),
> AMK6(I,J,K,1:NC,1:NC,1:6),DEN(I,J,K,1:NP),
> VIS(I,J,K,1:NP),DVIS(I,J,K,1:2*NC+1,1:NP),
> DROKN(1:2*NC+1,1:NP),REL(I,J,K,1:NP),
> DREL(I,J,K,1:2*NC+2,1:NP),
> DTRAN(I,J,K,1:2*NC+1,1:NC,1:NP),NP,1),
C WALEED 2/14/2006 added ashphaltene variables for calling jaco2
> RKARY(I,J,K),POR(I,J,K),WT(1:NC),RATIOS(I,J,K),
> DTRANKLL(I,J,K,1:NC,1:3,1:NP),
> DXYDKLL(I,J,K,1:NC,1:3,1:NP),
> DRELKLL(I,J,K,1:3,1:NP),DROKLL(I,J,K,1:3,1:NP),
> DVISKLL(I,J,K,1:3,1:NP))
-----------------------------------------------------------------------

Filename: jaco2pw.f
Location: GPAS\eoscomp\Jacobian

SUBROUTINE JACO2(NC,NPH,ZXY,DXYDKN,DEN,VISC,
> DVIS,DROKN,REL,DREL,DTRAN,NP,NB,
C WALEED 3/11/2006 added asphaltene variables to jaco2
> RKARY,POR,WM,RATIOS,DTRANKLL,DXYDKLL,
> DRELKLL,DROKLL,DVISKLL)
-
-
-
C WALEED 3/11/2006 added asphaltene variables to jaco2
> RKARY(NB), POR(NB),
> WM(NC), RATIOS(NB),
> DTRANKLL(NC,3,NP,NB), DXYDKLL(NC,3,NP,NB),
> DRELKLL(3,NP,NB), DROKLL(3,NP,NB),
> DVISKLL(3,NP,NB)
-
-
-
CALL FLOWLKN(TM,NC,ZXY(1,K),VISC(J,K),DEN(J,K),REL(J,K),
> DXP,DXYDKN(1,1,J,K),DXYDKN(1,1,JP,K),DREL(1,J,K),
> DROKN(1,J,K),DVIS(1,J,K),DTRAN(1,1,J,K),J,
> NTYPE,
C WALEED 3/10/2006 added asphaltene variables for calling
> RKARY(K),POR(K),WM(1),RATIOS(K),
> DTRANKLL(1,1,J,K),DXYDKLL(1,1,J,K),DRELKLL(1,J,K),
> DROKLL(1,J,K),DVISKLL(1,J,K))
-
-
-
C WALEED 3/10/2006 added variables
REAL*8 RKARY, POR,
> WM(NC), RATIOS,
> DTRANKLL(NC,3), DXYDKLL(NC,3),
> DRELKLL(3), DROKLL(3),
> DVISKLL(3)
-

557
-
-
C WALEED 3/10/2006 added variables
REAL*8 RKARY, POR,
> WM(NC), RATIOS,
> DTRANKLL(NC,3), DXYDKLL(NC,3),
> DRELKLL(3), DROKLL(3),
> DVISKLL(3)
-
-
-
C WALEED 4/4/2006 defined dtrankll for no hc
DTRANKLL(I,1) = RC0
DTRANKLL(I,2) = RC0
DTRANKLL(I,3) = RC0
C WALEED ~END~
-
-
-
C WALEED 4/4/2006 defined dtrankll for g only
IF (IASPR) THEN
UW3 = RC1/RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)
DTRANKLL(I,1) = RC0
DTRANKLL(I,2) = U * (ROTREL*DXYDKLL(I,2)*UW3+CONS1
> *DRELKLL(2)*UW3+CONS2*DROKLL(2)*UW3)-
> CONS3*DVISKLL(2)*UW3
DTRANKLL(I,2) = DTRANKLL(I,2) * RU2 * TM
DTRANKLL(I,3) = RC0
END IF
C WALEED ~END~
-
-
-
C WALEED 4/4/2006 defined dtrankll for o only
IF (IASPR) THEN
UW3 = RC1/RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)
DTRANKLL(I,1) = U * (ROTREL*DXYDKLL(I,1)*UW3+CONS1
> *DRELKLL(1)*UW3+CONS2*DROKLL(1)*UW3)-
> CONS3*DVISKLL(1)*UW3
DTRANKLL(I,1) = DTRANKLL(I,1) * RU2 * TM
DTRANKLL(I,2) = RC0
DTRANKLL(I,3) = U * (ROTREL*DXYDKLL(I,3)*UW3+CONS1
> *DRELKLL(3)*UW3+CONS2*DROKLL(3)*UW3)-
> X(JM1+I)*ROTREL*(RKMAX-
1)*WM(NC)*PVMOL(4)*UW3*UW3*UW5)
> - CONS3*DVISKLL(3)*UW3
DTRANKLL(I,3) = DTRANKLL(I,3) * RU2 * TM
END IF
C WALEED ~END~
-
-
-
C WALEED 4/2/2006 defined dtrankll for 2 hc
IF (IASPR) THEN
UW3 = RC1/RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)
DTRANKLL(I,1) = U * (ROTREL*DXYDKLL(I,1)*UW3+CONS1
> *DRELKLL(1)*UW3+CONS2*DROKLL(1)*UW3)-

558
> CONS3*DVISKLL(1)*UW3
DTRANKLL(I,1) = DTRANKLL(I,1) * RU2 * TM
DTRANKLL(I,2) = U * (ROTREL*DXYDKLL(I,2)*UW3+CONS1
> *DRELKLL(2)*UW3+CONS2*DROKLL(2)*UW3)-
> CONS3*DVISKLL(2)*UW3
DTRANKLL(I,2) = DTRANKLL(I,2) * RU2 * TM
DTRANKLL(I,3) = U * (ROTREL*DXYDKLL(I,3)*UW3+CONS1
> *DRELKLL(3)*UW3+CONS2*DROKLL(3)*UW3)-
> X(JM1+I)*ROTREL*(RKMAX-
1)*WM(NC)*PVMOL(4)*UW3*UW3*UW5)
> - CONS3*DVISKLL(3)*UW3
DTRANKLL(I,3) = DTRANKLL(I,3) * RU2 * TM
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: xstep.df
Location: GPAS\eoscomp\drive

-
-
-
CALL JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,POR,TCOFX,TCOFY,TCOFZ,SAT,P,PORI,VP,VB,RATIO,W,
+ NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,TRAPN,DTRAPN,
+ RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,AVK,AVW,
+ AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,X,ZXY,DEPTH,
+ ROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,DRELS,DVISS,
+ DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,ZPERM,
c print*, "out of Jacobian"
c Marcondes added cross transmisibilities 12/07/04
+ tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze,XPERM,YPERM,RKARY,^M
+ fpk,fpe,fpg,
C WALEED 2/14/2006 added asphaltene variables for calling jacobian
+ RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
+ DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL)^M

-----------------------------------------------------------------------

Filename: jacobian.df
Location: GPAS\eoscomp\jcobian

SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL)
-
-

559
-
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS(NX,NY,NZ),
> AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),
> AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2),
> DROKLL(NX,NY,NZ,3,3)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables for calling prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL)^M
-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE PREROW(NP,NC,NPH,TEMP,P,VB,VP,TMOLR,PVMOL,ZXY,
> RATIO,ZF,DZF,
> TC,PC,VC,WT,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,
> AD,BD,PARACH,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,
> ARF,PHI,AFK,AFW,AFNP,DFV,AVK,AVW,AVNP,ARV,DTRAN,
> XTRM,YTRM,ZTRM,AMK,AMNP,AWW,AMK6,AMNP6,AWW6,NWELL,
> TD,X,POR,PORI,DEPTH,W,NX,NY,NZ,LDIM,I1,
> I2,J1,J2,K1,K2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,
> VISCW,DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS,DROKLL)^M
-
-
-
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS(NX,NY,NZ),AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),

560
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2),
> DROKLL(NX,NY,NZ,3,3)
-
-
-
CALL RODER(NC,NPH(I,J,K,1:NP),P(I,J,K),
> ZXY(I,J,K,1:5*NC),ZF(I,J,K,1:NP),
> DZF(I,J,K,1:NCP1,1:NP),AMK6(I,J,K,1:NC,1:NC,1:6),
> DZN(1:NC,1:NP),
> DROKN(1:2*NC+1,1:NP),DROX(1:NC,1:NP),
> NP,NB,
C WALEED 6/6/6 added variables
> DROKLL(I,J,K,1:3,1:NP),DXYDKLL(I,J,K,1:NC,1:3,1:3))
-----------------------------------------------------------------------
Filename: roderiv.f
Location: GPAS\eoscomp\jacobian

SUBROUTINE RODER(NC,NPH,P,ZXY,ZF,DZF,DXYDKN,DZN,
+ DROKN,DROX,NP,NB,
C WALEED 6/6/6 added variables
+ DROKLL,DXYDKLL)
-
-
-
C WALEED 6/6/6 added variables
REAL*8 DROKLL(3,NP,NB), DXYDKLL(NC,3,3,NB)
-
-
-
C WALEED 4/17/2006 defined drokll for 1 phase
IF (IASPR) THEN
IF (NPH(3,K).EQ.IONE) THEN
DROKLL(1,J,K) = RC0
DROKLL(2,J,K) = RC0
DROKLL(3,J,K) = RC0
DO 41 I = 1 , NC
DROKLL(2,J,K) = DROKLL(2,J,K)+
> DROX(I,J,K)*DXYDKLL(I,2,J,K)
41 CONTINUE
END IF
IF (NPH(2,K).EQ.IONE) THEN
DROKLL(1,J,K) = RC0
DROKLL(2,J,K) = RC0
DROKLL(3,J,K) = RC0
DO 42 I = 1 , NC
DROKLL(1,J,K) = DROKLL(1,J,K)+
> DROX(I,J,K)*DXYDKLL(I,1,J,K)
DROKLL(3,J,K) = DROKLL(3,J,K)+
> DROX(I,J,K)*DXYDKLL(I,3,J,K)
42 CONTINUE
END IF
END IF
C WALEED ~END~
-
-

561
-
C WALEED 4/1/2006 defined drokll for 2 hc
IF (IASPR) THEN
DO 35 I = 1 , NC
DROKLL(1,J,K) = RC0
DROKLL(2,J,K) = RC0
DROKLL(3,J,K) = RC0
35 CONTINUE
DO 36 I1 = 1 , 3
DO 36 I = 1 , NC
DROKLL(I1,J,K) = DROKLL(I1,J,K)+
> DROX(I,J,K)*DXYDKLL(I,I1,J,K)
36 CONTINUE
END IF
C WALEED ~END~
-----------------------------------------------------------------------

Filename: xstep.df
Location: GPAS\eoscomp\drive

ZXYS is already defined in xstep.


-
-
-
CALL JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,POR,TCOFX,TCOFY,TCOFZ,SAT,P,PORI,VP,VB,RATIO,W,
+ NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,TRAPN,DTRAPN,
+ RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,AVK,AVW,
+ AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,X,ZXY,DEPTH,
+ ROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,DRELS,DVISS,
+ DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,ZPERM,
c print*, "out of Jacobian"
c Marcondes added cross transmisibilities 12/07/04
+ tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze,XPERM,YPERM,RKARY,^M
+ fpk,fpe,fpg,
C WALEED 2/14/2006 added asphaltene variables for calling jacobian
+ RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
+ DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS)^M
-----------------------------------------------------------------------

Filename: jacobian.df
Location: GPAS\eoscomp\jcobian

SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS)
-
-
-
C WALEED 3/9/2006 added asphaltene variables to jacobian

562
> RATIOS(NX,NY,NZ),
> AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),
> AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables for calling prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS)
-----------------------------------------------------------------------
Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE PREROW(NP,NC,NPH,TEMP,P,VB,VP,TMOLR,PVMOL,ZXY,
> RATIO,ZF,DZF,
> TC,PC,VC,WT,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,
> AD,BD,PARACH,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,
> ARF,PHI,AFK,AFW,AFNP,DFV,AVK,AVW,AVNP,ARV,DTRAN,
> XTRM,YTRM,ZTRM,AMK,AMNP,AWW,AMK6,AMNP6,AWW6,NWELL,
> TD,X,POR,PORI,DEPTH,W,NX,NY,NZ,LDIM,I1,
> I2,J1,J2,K1,K2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,
> VISCW,DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL,ZXYS)^
-
-
-
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS(NX,NY,NZ),AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),

563
> DVISKLL(NX,NY,NZ,3,NP),
> ZXYS(NX,NY,NZ,2)
-
-
-
CALL EOSBASIC(NP,NC,NPH(I,J,K,1:NP),RATIO(I,J,K,1:NP),
> ZXY(I,J,K,1:5*NC),XYZ(1:NC),YMXZ,
> RR,SXY2Z,AMK6(I,J,K,1:NC,1:NC,1:6),
> PVMOL(I,J,K,1:NP+2),NB,
C WALEED 6/6/6 added variables
> ZXYS(I,J,K,2),RATIOS(I,J,K),
> DXYDKLL(I,J,K,1:NC,1:3,1:3)
-----------------------------------------------------------------------

Filename: xeosbas.f
Location: GPAS\eoscomp\eos

SUBROUTINE EOSBASIC(NP,NC,NPH,RATIO,ZXY,XYZ,YMXZ,RR,SXY2Z,
+ DXYDKN,PVMOL,NB,
C WALEED 6/6/6 added variables
+ ZXYS,RATIOS,DXYDKLL)
-
-
-
C WALEED 6/6/6 added variables
REAL*8 ZXYS(2,NB),RATIOS(NB),DXYDKLL(NC,3,3,NB),EKM2
-
-
-
C WALEED 3/29/2006 defined dxydkll & modified dxydkn only 4 o+g
IF (IASPR) THEN
IF (NPH(2,K).EQ.IONE.AND.NPH(3,K).EQ.IONE) THEN
DO 5 I = 1 , NC
ZXY(NC4+I,K) = EXP ( ZXY(NC3+I,K) )
EKM1 = ZXY(NC4+I,K) - RC1
IF (I.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
ELSE IF (I.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = RC1+RATIO(3,K)*EKM1+RATIOS(K)*EKM2
DO 5 J = 1 , NC
IF ( I.EQ.J ) THEN
CTERM1 = RC1/(TERM1*TERM1)
DXYDKN(I,J,2,K) = -ZXY(I,K)*RATIO(3,K)*
+ ZXY(NC4+I,K)*CTERM1
TERM2 = RC1-RATIO(3,K)+RATIOS(K)*EKM2
DXYDKN(I,J,3,K) = -ZXY(I,K)*RATIO(3,K)*TERM2*
+ CTERM1

CONST = (RC1-ZXY(I,K))/PVMOL(4,K)
DXYDKN(I,J,5,K) = CONST/TERM1
DXYDKN(I,J,6,K) = ZXY(NC4+I,K)*CONST/TERM1
ELSE IF ( I.NE.J ) THEN
DXYDKN(I,J,2,K) = RC0
DXYDKN(I,J,3,K) = RC0
DXYDKN(I,J,5,K) = ZXY(I,K)/(TERM1*PVMOL(4,K))
DXYDKN(I,J,6,K) = ZXY(I,K)*ZXY(NC4+I,K)/
+ (TERM1*PVMOL(4,K))
END IF

564
5 CONTINUE
DO 6 I = 1 , NC
ZXY(NC4+I,K) = EXP ( ZXY(NC3+I,K) )
EKM1 = ZXY(NC4+I,K) - RC1
IF (I.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K)) - RC1
CONST = EXP(ZXYS(2,K))
ELSE IF (I.NE.NC) THEN
EKM2 = -RC1
CONST = RC0
END IF
TERM1 = RC1+RATIO(3,K)*EKM1+RATIOS(K)*EKM2
CTERM1 = RC1/(TERM1*TERM1)
DXYDKLL(I,3,2,K)= -ZXY(I,K)*EKM2*CTERM1
DXYDKLL(I,3,3,K)= -ZXY(I,K)*ZXY(NC4+I,K)*EKM2*CTERM1

DXYDKLL(I,2,2,K)= -ZXY(I,K)*EKM1*CTERM1
DXYDKLL(I,2,3,K)= -ZXY(I,K)*ZXY(NC4+I,K)*EKM1*CTERM1
DXYDKLL(I,1,2,K)= -ZXY(I,K)*RATIOS(K)*CONST
DXYDKLL(I,1,3,K)= -ZXY(I,K)*ZXY(NC4+I,K)*
+ RATIOS(K)*CONST*CTERM1
6 CONTINUE
ELSE IF (NPH(2,K).EQ.IZERO.OR.NPH(3,K).EQ.IZERO) THEN
DO 9 I = 1 , NC
ZXY(NC3+I,K) = 0.D0
ZXY(NC4+I,K) = 0.D0
XYZ(I,K) = 0.D0
YMXZ(I,K) = 0.D0
DXYDKLL(I,2,2,K)= 0.D0
DXYDKLL(I,2,3,K)= 0.D0
IF (NPH(2,K).EQ.IONE.AND.NPH(3,K).EQ.IZERO) THEN
IF (I.EQ.NC) THEN
EKM2 = EXP(ZXYS(2,K))-RC1
ELSE IF (I.NE.NC) THEN
EKM2 = -RC1
END IF
TERM1 = (RC1 + RATIOS(K)*EKM2)*PVMOL(4,K)
DO 7 J = 1 , NC
DXYDKN(I,J,2,K) = 0.D0
DXYDKN(I,J,3,K) = 0.D0
IF (J.EQ.I) THEN
DXYDKN(I,J,5,K) = (RC1-ZXY(I,K))/TERM1
ELSE IF (J.NE.I) THEN
DXYDKN(I,J,5,K) = -ZXY(I,K)/TERM1
END IF
DXYDKN(I,J,6,K) = 0.D0
7 CONTINUE

TERM1 = RC1 + RATIOS(K)*EKM2


IF (I.EQ.NC) THEN
CTERM1 = -ZXY(I,K)*RATIOS(K)*(EKM2+RC1)
DXYDKLL(I,1,2,K) = CTERM1/(TERM1*TERM1)
ELSE IF (I.NE.NC) THEN
DXYDKLL(I,1,2,K) = 0.D0
END IF
DXYDKLL(I,1,3,K) = 0.D0

CTERM1 = -ZXY(I,K)*EKM2
DXYDKLL(I,3,2,K)= CTERM1/(TERM1*TERM1)
DXYDKLL(I,3,3,K)= 0.D0

565
ELSE IF (NPH(2,K).EQ.IZERO.AND.NPH(3,K).EQ.1) THEN
DO 8 J = 1 , NC
DXYDKN(I,J,2,K) = 0.D0
DXYDKN(I,J,3,K) = 0.D0
IF (J.EQ.I) THEN
DXYDKN(I,J,6,K) = (RC1-ZXY(I,K))/PVMOL(4,K)
ELSE IF (J.NE.I) THEN
DXYDKN(I,J,6,K) = -ZXY(I,K)/PVMOL(4,K)
END IF
DXYDKN(I,J,5,K) = 0

DXYDKLL(I,1,2,K) = 0.D0
DXYDKLL(I,1,3,K) = 0.D0

DXYDKLL(I,3,2,K) = 0.D0
DXYDKLL(I,3,3,K) = 0.D0
8 CONTINUE
END IF
9 CONTINUE
END IF
GO TO 100
END IF
C WALEED ~END~
-
-
-
C WALEED found a bug here, xi instead of rc1
DXYDKN(I,J,5,K) = - ZXY(I,K) / PVMOL(4,K)
-
-
-
C WALEED found a bug here, yi instead of rc1
DXYDKN(I,J,6,K) = - ZXY(I,K) / PVMOL(4,K)
-----------------------------------------------------------------------

Filename: xstep.df
Location: GPAS\eoscomp\drive

CALL PROP(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,KEYOUT,
+ NBLK,SAT,P,NPH,DEN,VIS,DVIS,AMK6,VISCW,AQCOMPCD,POR,REL,CP,
+ DCP,DREL,ZXY,ROCK,X,PVMOL,TRAPN,RSAT,DSAT,DTRAPN,XPERM,YPERM,
+ ZPERM,CIJ,AQCDEN,CADS,RKARY,
C WALEED 3/28/2006
+ DXYDKLL,DVISKLL)
-----------------------------------------------------------------------

Filename: xprop.df
Location: GPAS\eoscomp\prop

SUBROUTINE PROP(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,SAT,P,NPH,DEN,VIS,DVIS,DXYDKN,VISCW,
> AQCOMPCD,POR,REL,CP,DCP,DREL,ZXY,KROCK,X,PVMOL,
> TRAPN,RSAT,DSAT,DTRAPN,XPERM,YPERM,ZPERM,CIJ,AQCDEN,CADS,
> RKARY,
C WALEED 3/28/2006
> DXYDKLL,DVISKLL)
-
-

566
-
> RKARY(IDIM,JDIM,KDIM), RK, RKMAX,
C WALEED 3/28/2005
> DXYDKLL(IDIM,JDIM,KDIM,NC,3,NP),
> DVISKLL(IDIM,JDIM,KDIM,3,NP)
-
-
-
CALL LVISC2(NC,NPH(I,J,K,1:NP),TC,PC,VC,WM,
> ZXY(I,J,K,1:5*NC),DEN(I,J,K,1:NP),VISPURE,
> VIS(I,J,K,1:NP),IDER,TEMPR,P(I,J,K),
> DROX(1:NC,1:NP),DXYDKN(I,J,K,1:NC,1:NC,1:6),
> DVIS(I,J,K,1:2*NC+1,1:NP),
> DROKN(1:2*NC+1,1:NP),NP,1,
C WALEED 3/28/2006
> DXYDKLL(I,J,K,1:NC,1:3,1:NP),DVISKLL(I,J,K,1:3,1:NP))

-----------------------------------------------------------------------
Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

CALL LVISC2(NC,NPH(I,J,K,1:NP),TC,PC,VC,WT,
> ZXY(I,J,K,1:5*NC),DEN(I,J,K,1:NP),
> VISPURE,VIS(I,J,K,1:NP),IDER,TEMPR,P(I,J,K),
> DROX(1:NC,1:NP),AMK6(I,J,K,1:NC,1:NC,1:6),
> DVIS(I,J,K,1:2*NC+1,1:NP),DROKN(1:2*NC+1,1:NP),
> NP,1,
C WALLED 3/28/2006
> DXYDKLL(I,J,K,1:NC,1:3,1:NP),DVISKLL(I,J,K,1:3,1:NP))

details below for rowpw.df modification


-----------------------------------------------------------------------

Filename: vis.f
Location: GPAS\eoscomp\prop

SUBROUTINE LVISC2(NC,NPH,TC,PC,VC,WT,ZXY,DEN,VISPURE,
+ VIS,IDER,T,P,DROX,DXYDKN,DVIS,DROKN,NP,NB,
C WALEED 3/28/2005
+ DXYDKLL,DVISKLL)
-
-
-
C WALEED 3/28/2006
> DXYDKLL(NC,3,NP,NB),DVISKLL(3,NP,NB)
-
-
-
C WALEED 3/27/2006 zero out dviskll
IF (IASPR) THEN
DVISKLL(1,J,K) = RC0
DVISKLL(2,J,K) = RC0
DVISKLL(3,J,K) = RC0
END IF
C WALEED ~END~
-
-
-

567
C WALEED 3/27/2006 defined dviskll
IF (IASPR) THEN
DO 330 I = 1 , 3
DVISKLL(I,J,K) = RC0
330 CONTINUE
DO 340 I = 1 , NC
DVISKLL(1,J,K) = DVISKLL(1,J,K)+
+ DVISX(I)*DXYDKLL(I,1,J,K)
DVISKLL(2,J,K) = DVISKLL(2,J,K)+
+ DVISX(I)*DXYDKLL(I,2,J,K)
DVISKLL(3,J,K) = DVISKLL(3,J,K)+
+ DVISX(I)*DXYDKLL(I,3,J,K)
340 CONTINUE
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

CALL ZDER(ISTART,IEND,NC,NPH(I,J,K,1:NP),
> PVMOL(I,J,K,1:NP+2),ZXY(I,J,K,1:5*NC),
> RATIO(I,J,K,1:NP),ZF(I,J,K,1:NP),
> DZF(I,J,K,1:NC+1,1:NP),DZN(1:NC,1:NP),
> XYZ(1:NC),YMXZ,
> AMK6(I,J,K,1:NC,1:NC,1:6),
> DRR(1:2*NC+1),DZFKN(1:2*NC+1,1:NP),NP,NB),
C WALEED 3/25/2006 added asphaltene varibales
> DZFKLL(I,J,K,1:3,1:NP),DXYDKLL(I,J,K,1:NC,1:3,1:NP)
-----------------------------------------------------------------------
Why we have this part only for single phase?

Filename: zderiv.f
Location: GPAS\eoscomp\jacobian

SUBROUTINE ZDER(ISTART,IEND,NC,NPH,PVMOL,ZXY,RATIO,ZF,DZF,
+ DZN,XYZ,YMXZ,DXYDKN,DRR,DZFKN,NP,NB,
C WALEED 3/25/2006 added asphaltene varibales
+ DZFKLL,DXYDKLL)
-
-
-
C WALEED 3/25/2006
+ DZFKLL(3,NP,NB), DXYDKLL(NC,3,NP,NB)
-
-
-
C WALEED 3/25/2006 defined dzfkll (seems 1 phase!)
IF (IASPR) THEN
DZFKLL(1,J,K) = RC0
DZFKLL(2,J,K) = RC0
DZFKLL(3,J,K) = RC0
DO 50 I = 1 , NC
DZFKLL(1,J,K) = DZFKLL(1,J,K) +
+ DZF(I,J,K) * DXYDKLL(I,1,J,K)
DZFKLL(2,J,K) = DZFKLL(2,J,K) +
+ DZF(I,J,K) * DXYDKLL(I,2,J,K)
DZFKLL(3,J,K) = DZFKLL(3,J,K) +

568
+ DZF(I,J,K) * DXYDKLL(I,3,J,K)
50 CONTINUE
END IF
C WALEED ~END~

-----------------------------------------------------------------------
Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

CALL RELDER(ISTART,IEND,NC,NPH(I,J,K,1:NP),
> PVMOL(I,J,K,1:NP+2),P(I,J,K),
> ZXY(I,J,K,1:5*NC),RATIO(I,J,K,1:NP),ZF(I,J,K,1:NP),
> DZF(I,J,K,1:NC+1,1:NP),DZN(1:NC,1:NP),
> DZFKN(1:2*NC+1,1:NP),DRR(1:2*NC+1),
> DSAT(I,J,K,1:2*NC+1,1:NP),DREL(I,J,K,1:2*NC+2,1:NP),
> SAT(I,J,K,1:NP),KROCK(I,J,K),NP,NB,
c > POR(I,J,K),PORI(I,J,K),TRAPN(I,J,K,1:NP)
c akjohn
> X(I,J,K,1:NC+NA+1),DEN(I,J,K,1:NP),TRAPN(I,J,K,1:NP),
> DTRAPN(I,J,K,1:NC2P1,1:NP),RSAT(I,J,K,1:NP),
> DDEN(I,J,K,1:NC2P1,1:NP),W(I,J,K,1:NP+1),
c akjohn
C WALEED 3/25/2006 added asphaltene variables
> DSATKLL(I,J,K,1:3,1:NP),DZFKLL(I,J,K,1:3,1:NP),
> DRELKLL(I,J,K,1:3,1:NP))
-
-
-
also added them to the prerow subroutine (details below).
-----------------------------------------------------------------------

Filename: relderiv.f
Location: GPAS\eoscomp\jacobian

SUBROUTINE RELDER(ISTART,IEND,NC,NPH,PVMOL,P,ZXY,RATIO,ZF,
+ DZF,DZN,DZFKN,DRR,DSAT,DREL,SAT,KROCK,NP,NB,
c + POR,PORI,TRAPN,DTRAPN,RSAT)
c akjohn
+ X,DEN,TRAPN,DTRAPN,RSAT,DDEN,W,
C WALEED 3/25/2006 added asphaltene variables
+ DSATKLL,DZFKLL,DRELKLL)
-
-
-
C WALEED 3/25/2006 added asphaltene variables
> DSATKLL(3,NP,NB),DZFKLL(3,NP,NB),DRELKLL(3,NP,NB)
-
-
-
C WALEED 3/21/2006 defined new terms for relperm for dlnkig
IF (IASPR) THEN
DSAT(I,J,K)=CON*(RATIO(J,K)*DZFKN(I,J,K))
GOTO 11
END IF
C WALEED ~END~
-
-
-
C WALEED 3/21/2006 defined new terms for relperm for dni

569
IF (IASPR) THEN
DSAT(NC+I,J,K)=RTP*(ZYV+TNV*DZFKN(NC+I,J,K))
GOTO 12
END IF
C WALEED ~END~
-
-
-
C WALEED 3/21/2006 defined dsatkll for 2 phases
IF (IASPR) THEN
IF (J.EQ.2) THEN
DSATKLL(1,J,K)=CON*(RATIO(J,K)*DZFKLL(I,J,K))
DSATKLL(2,J,K)=CON*(-ZF(J,K)+RATIO(J,K)*DZFKLL(2,J,K))
DSATKLL(3,J,K)=CON*(-ZF(J,K)+RATIO(J,K)*DZFKLL(3,J,K))

DRELKLL(1,J,K)=DREL(NC2P2,J,K)*DSATKLL(1,J,K)+ROSG*DSATKLL(1,J+1,K)

DRELKLL(2,J,K)=DREL(NC2P2,J,K)*DSATKLL(2,J,K)+ROSG*DSATKLL(2,J+1,K)

DRELKLL(3,J,K)=DREL(NC2P2,J,K)*DSATKLL(3,J,K)+ROSG*DSATKLL(3,J+1,K)
END IF
IF (J.EQ.3) THEN
DSATKLL(1,J,K)=CON*(RATIO(J,K)*DZFKLL(1,J,K))
DSATKLL(2,J,K)=CON*(ZF(J,K)+RATIO(J,K)*DZFKLL(2,J,K))
DSATKLL(3,J,K)=CON*(RATIO(J,K)*DZFKLL(3,J,K))

DRELKLL(1,J,K)=DREL(NC2P2,J,K)*DSATKLL(1,J,K)
DRELKLL(2,J,K)=DREL(NC2P2,J,K)*DSATKLL(2,J,K)
DRELKLL(3,J,K)=DREL(NC2P2,J,K)*DSATKLL(3,J,K)
END IF
END IF
C WALEED ~END~
-
-
-
C WALEED 3/23/2006 modification of dni for 1 phase
IF (IASPR) THEN
IF (J.EQ.2) THEN
DSAT(NC+I,J,K)=RTP*RATIO(J,K)*(ZF(J,K)+DZN(I,J,K))
DREL(I+NC,J,K) = DREL(NC2P2,J,K)*DSAT(NC+I,J,K)
GOTO 30
END IF
END IF
C WALEED ~END~
-
-
-
C WALEED 3/23/2006 defined dsatkll for 1 phase
IF (IASPR) THEN
IF (J.EQ.2) THEN
DSATKLL(1,J,K)=CON*(RATIO(J,K)*DZFKLL(I,J,K))
DSATKLL(2,J,K)=CON*(-ZF(J,K)+RATIO(J,K)*DZFKLL(2,J,K))
DSATKLL(3,J,K)=CON*(-ZF(J,K)+RATIO(J,K)*DZFKLL(3,J,K))
DRELKLL(1,J,K)=DREL(NC2P2,J,K)*DSATKLL(1,J,K)
DRELKLL(2,J,K)=DREL(NC2P2,J,K)*DSATKLL(2,J,K)
DRELKLL(3,J,K)=DREL(NC2P2,J,K)*DSATKLL(3,J,K)
END IF
END IF

570
C WALEED ~END~

-----------------------------------------------------------------------
needs careful attention
need to be defined for jmass

Filename: jmass.f
Location: GPAS\eoscomp\jacobian

C WALEED 3/14/2006 defined amkll for z conv terms


IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(I,J,L,IC,1,JP)
AMKLL(I,J,K-1,IC,1) = AMKLL(I,J,K-1,IC,1) - TKLL1
AMKLL6(I,J,K,IC,1,5) = AMKLL6(I,J,K,IC,1,5)+TKLL1

TKLL2 = DUMMY1 * DTRANKLL(I,J,L,IC,2,JP)


AMKLL(I,J,K-1,IC,2) = AMKLL(I,J,K-1,IC,2) - TKLL2
AMKLL6(I,J,K,IC,2,5) = AMKLL6(I,J,K,IC,2,5)+TKLL2
TKLL3 = DUMMY1 * DTRANKLL(I,J,L,IC,3,JP)
AMKLL(I,J,K-1,IC,3) = AMKLL(I,J,K-1,IC,3) - TKLL3
AMKLL6(I,J,K,IC,3,5) = AMKLL6(I,J,K,IC,3,5)+TKLL3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/14/2006 defined amkll for z conv terms
IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(I,J,L,IC,1,JP)
AMKLL(I,J,K,IC,1) = AMKLL(I,J,K,IC,1) + TKLL1
AMKLL6(I,J,K-1,IC,1,6) = AMKLL6(I,J,K-1,IC,1,6)-TKLL1

TKLL2 = DUMMY1 * DTRANKLL(I,J,L,IC,2,JP)


AMKLL(I,J,K,IC,2) = AMKLL(I,J,K,IC,2) + TKLL2
AMKLL6(I,J,K-1,IC,2,6) = AMKLL6(I,J,K-1,IC,2,6)-TKLL2

TKLL3 = DUMMY1 * DTRANKLL(I,J,L,IC,3,JP)


AMKLL(I,J,K,IC,3) = AMKLL(I,J,K,IC,3) + TKLL3
AMKLL6(I,J,K-1,IC,3,6) = AMKLL6(I,J,K-1,IC,3,6)-TKLL3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/14/2006 defined amkll for y conv terms
IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(I,L,K,IC,1,JP)
AMKLL(I,J-1,K,IC,1) = AMKLL(I,J-1,K,IC,1) - TKLL1
AMKLL6(I,J,K,IC,1,3) = AMKLL6(I,J,K,IC,1,3)+TKLL1

TKLL2 = DUMMY1 * DTRANKLL(I,L,K,IC,2,JP)


AMKLL(I,J-1,K,IC,2) = AMKLL(I,J-1,K,IC,2) - TKLL2
AMKLL6(I,J,K,IC,2,3) = AMKLL6(I,J,K,IC,2,3)+TKLL2
TKLL3 = DUMMY1 * DTRANKLL(I,L,K,IC,3,JP)
AMKLL(I,J-1,K,IC,3) = AMKLL(I,J-1,K,IC,3) - TKLL3
AMKLL6(I,J,K,IC,3,3) = AMKLL6(I,J,K,IC,3,3)+TKLL3
END IF
C WALEED ~END~

571
-
-
-
C WALEED 3/14/2006 defined amkll for y conv terms
IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(I,L,K,IC,1,JP)
AMKLL(I,J,K,IC,1) = AMKLL(I,J,K,IC,1) + TKLL1
AMKLL6(I,J-1,K,IC,1,4) = AMKLL6(I,J-1,K,IC,1,4)-TKLL1

TKLL2 = DUMMY1 * DTRANKLL(I,L,K,IC,2,JP)


AMKLL(I,J,K,IC,2) = AMKLL(I,J,K,IC,2) + TKLL2
AMKLL6(I,J-1,K,IC,2,4) = AMKLL6(I,J-1,K,IC,2,4)-TKLL2
TKLL3 = DUMMY1 * DTRANKLL(I,L,K,IC,3,JP)
AMKLL(I,J,K,IC,3) = AMKLL(I,J,K,IC,3) + TKLL3
AMKLL6(I,J-1,K,IC,3,4) = AMKLL6(I,J-1,K,IC,3,4)-TKLL3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/14/2006 defined amkll for x conv terms
IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(L,J,K,IC,1,JP)
AMKLL(I-1,J,K,IC,1) = AMKLL(I-1,J,K,IC,1) - TKLL1
AMKLL6(I,J,K,IC,1,1) = AMKLL6(I,J,K,IC,1,1)+TKLL1

TKLL2 = DUMMY1 * DTRANKLL(L,J,K,IC,2,JP)


AMKLL(I-1,J,K,IC,2) = AMKLL(I-1,J,K,IC,2) - TKLL2
AMKLL6(I,J,K,IC,2,1) = AMKLL6(I,J,K,IC,2,1)+TKLL2
TKLL3 = DUMMY1 * DTRANKLL(L,J,K,IC,3,JP)
AMKLL(I-1,J,K,IC,3) = AMKLL(I-1,J,K,IC,3) - TKLL3
AMKLL6(I,J,K,IC,3,1) = AMKLL6(I,J,K,IC,3,1)+TKLL3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/14/2006 defined amkll for x conv terms
IF (IASPR) THEN
TKLL1 = DUMMY1 * DTRANKLL(L,J,K,IC,1,JP)
AMKLL(I,J,K,IC,1) = AMKLL(I,J,K,IC,1) + TKLL1
AMKLL6(I-1,J,K,IC,1,2) = AMKLL6(I-1,J,K,IC,1,2)-TKLL1

TKLL2 = DUMMY1 * DTRANKLL(L,J,K,IC,2,JP)


AMKLL(I,J,K,IC,2) = AMKLL(I,J,K,IC,2) + TKLL2
AMKLL6(I-1,J,K,IC,2,2) = AMKLL6(I-1,J,K,IC,2,2)-TKLL2
TKLL3 = DUMMY1 * DTRANKLL(L,J,K,IC,3,JP)
AMKLL(I,J,K,IC,3) = AMKLL(I,J,K,IC,3) + TKLL3
AMKLL6(I-1,J,K,IC,3,2) = AMKLL6(I-1,J,K,IC,3,2)-TKLL3
END IF
C WALEED ~END~
-----------------------------------------------------------------------
new variables were added to jsource (AMKLL & AMKLL6)
Filename: jsource.df
Location: GPAS\eoscomp\jacobian

572
C WALEED 3/21/2006 initialization
DO IC = 1 , NC
AMKLL(I,J,K,IC,1) = RC0
AMKLL(I,J,K,IC,2) = RC0
AMKLL(I,J,K,IC,3) = RC0
END DO

AWKLL(I,J,K,1) = RC0
AWKLL(I,J,K,2) = RC0
AWKLL(I,J,K,3) = RC0

DO IC = 1 , NC
DO M = 1 , 6
AMKLL6(I,J,K,IC,1,M) = RC0
AMKLL6(I,J,K,IC,2,M) = RC0
AMKLL6(I,J,K,IC,3,M) = RC0
END DO
END DO
C WALEED ~END~
-
-
-
C WALEED 6/16/2006 defined amkll for constant p producer
IF (IASPR) THEN
DO IC = 1 , NC
AMKLL(LX,LY,LZ,IC,1) = -TERM*
+ ( DTRANKLL(LX,LY,LZ,IC,1,2) +
+ DTRANKLL(LX,LY,LZ,IC,1,3) )

AMKLL(LX,LY,LZ,IC,2) = -TERM*
+ ( DTRANKLL(LX,LY,LZ,IC,2,2) +
+ DTRANKLL(LX,LY,LZ,IC,2,3) )

AMKLL(LX,LY,LZ,IC,3) = -TERM*
+ ( DTRANKLL(LX,LY,LZ,IC,3,2) +
+ DTRANKLL(LX,LY,LZ,IC,3,3) )
END DO
END IF
C WALEED ~END~
-
-
-
C WALEED 3/13/2006 defined amkll for lnkncs.lg.ls for cons p inj
IF (IASPR) THEN
UW3 = RC1/RKARY(LX,LY,LZ)
UW4 = UW3 * UW3
UW5 = RC1/(WASMAX*(1-POR(LX,LY,LZ))*ROCKMDEN)
DO 126 JP = 1 , NP
DO 125 IC = 1 , NC
AMKLL(LX,LY,LZ,IC,1) = AMKLL(LX,LY,LZ,IC,1)-
+ ZW(IC,IW) * UT1 *
+ ( UW*DRELKLL(LX,LY,LZ,1,JP)/RKARY(LX,LY,LZ)
+ - UW2*REL(LX,LY,LZ,JP)*
+ DVISKLL(LX,LY,LZ,1,JP)/RKARY(LX,LY,LZ) )

AMKLL(LX,LY,LZ,IC,2) = AMKLL(LX,LY,LZ,IC,2)-
+ ZW(IC,IW) * UT1 *
+ ( UW*DRELKLL(LX,LY,LZ,2,JP)/RKARY(LX,LY,LZ)
+ - UW2*REL(LX,LY,LZ,JP)*

573
+ DVISKLL(LX,LY,LZ,2,JP)/RKARY(LX,LY,LZ) )

AMKLL(LX,LY,LZ,IC,3) = AMKLL(LX,LY,LZ,IC,3)-
+ ZW(IC,IW) * UT1 *
+ ( UW*DRELKLL(LX,LY,LZ,3,JP)/RKARY(LX,LY,LZ)
+ - UW2*REL(LX,LY,LZ,JP)*
+ DVISKLL(LX,LY,LZ,3,JP)/RKARY(LX,LY,LZ)
+ -UW*UW4*REL(LX,LY,LZ,JP)*(RKMAX-1)*WM(NC)
+ *PVMOLS(LX,LY,LZ)*UW5 )
125 CONTINUE
126 CONTINUE
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jaco2pw.f
Location: GPAS\eoscomp\jacobian
C WALEED 3/12/2006 added the effect on dtran for lnkig for 2 hc
C no change for dtran for oil only or gas only
IF (IASPR) THEN
UW3 = RC1/RKARY
DT(J,I) = U * (ROTREL*DX(I,J)*UW3+CONS1*DREL(J)*UW3+
> CONS2*DRO(J)*UW3)-
> CONS3*DU(J)*UW3
DT(J,I) = DT(J,I) * RU2 * TM
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/12/2006 seems for cons p prod for amk, amnp (ni+p) we need
dtran
-
-
-
C WALEED 3/12/2006 added the effect on amk for cons p inj
IF (IASPR) THEN
AMK(LX,LY,LZ,JC,IC) = AMK(LX,LY,LZ,JC,IC) -
+ ZW(IC,IW) * UT1 *
+ ( UW*DREL(LX,LY,LZ,JC,JP)
+ /RKARY(LX,LY,LZ)
+ - UW2*REL(LX,LY,LZ,JP)*
+ DVIS(LX,LY,LZ,JC,JP)
+ /RKARY(LX,LY,LZ) )

END IF
C WALEED ~END~

-----------------------------------------------------------------------
Filename: jaco2pw.f
Location: GPAS\eoscomp\Jacobian
C WALEED 3/13/2006 added the effect on dtran for p for gas only
IF (IASPR) THEN

574
UW3 = RC1/RKARY
DT(2*NC+1,I) = ( U * (ROTREL*DXP+CONS1*DREL(2*NC+1)+
> CONS2*DRO(2*NC+1))-
> CONS3*DU(2*NC+1) )*RU2*TM*UW3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/13/2006 added the effect on dtran for p for oil only
IF (IASPR) THEN
UW3 = RC1/RKARY
DT(2*NC+1,I) = ( U * (ROTREL*DXP+CONS1*DREL(2*NC+1)+
> CONS2*DRO(2*NC+1))-
> CONS3*DU(2*NC+1) )*RU2*TM*UW3
END IF
C WALEED ~END~
-
-
-
C WALEED 3/11/2006 added the effect on dtran for p for 2 hc
IF (IASPR) THEN
UW3 = RC1/RKARY
DT(2*NC+1,I) = ( U * (ROTREL*DXP+CONS1*DREL(2*NC+1)+
> CONS2*DRO(2*NC+1))-
> CONS3*DU(2*NC+1) )*RU2*TM*UW3
END IF
C WALEED ~END~

-----------------------------------------------------------------------
Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/12/2006 seems for cons p prod for amk, amnp (ni+p) we need
dtran
-
-
-
C WALEED 3/11/2006 added the effect on amnp for p for cons p inj
IF (IASPR) THEN
DO 110 JP = 1 , NP
IF ( VIS(LX,LY,LZ,JP) .LE. TOLSAT ) GO TO 110
SUMKU = SUMKU + REL(LX,LY,LZ,JP)*UD(JP)/
+ RKARY(LX,LY,LZ)
DUMKU = DUMKU + UD(JP)*DREL(LX,LY,LZ,NC2P1,JP)/
+ RKARY(LX,LY,LZ)-
+ UD(JP)*UD(JP)*REL(LX,LY,LZ,JP)*
+ DVIS(LX,LY,LZ,NC2P1,JP)/RKARY(LX,LY,LZ)
110 CONTINUE
END IF
C WALEED ~END~

-----------------------------------------------------------------------
Filename: jacobian.df
Location: GPAS\eoscomp\jacobian
SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,

575
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,RKARY)^M
-
-
-
> RKARY(NX,NY,NZ)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6)^M
-----------------------------------------------------------------------
WM is represented by WT in PREROW

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

CALL JACO2(NC,NPH(I,J,K,1:NP),ZXY(I,J,K,1:5*NC),
> AMK6(I,J,K,1:NC,1:NC,1:6),DEN(I,J,K,1:NP),
> VIS(I,J,K,1:NP),DVIS(I,J,K,1:2*NC+1,1:NP),
> DROKN(1:2*NC+1,1:NP),REL(I,J,K,1:NP),
> DREL(I,J,K,1:2*NC+2,1:NP),
> DTRAN(I,J,K,1:2*NC+1,1:NC,1:NP),NP,1),
C WALEED 2/14/2006 added ashphaltene variables for calling jaco2
> RKARY(I,J,K),POR(I,J,K),WM(1:NC),RATIOS(I,J,K)
-----------------------------------------------------------------------

Filename: jaco2pw.f
Location: GPAS\eoscomp\jacobian

SUBROUTINE JACO2(NC,NPH,ZXY,DXYDKN,DEN,VISC,
> DVIS,DROKN,REL,DREL,DTRAN,NP,NB,
C WALEED 3/11/2006 added asphaltene variables to jaco2
> RKARY,POR,WM,RATIOS)
-
-
-

576
REAL*8 ZXY(5*NC,NB), DXYDKN(NC,NC,6,NB),
> DEN(NP,NB),
> DVIS(2*NC+1,NP,NB), DROKN(2*NC+1,NP,NB),
> REL(NP,NB), DREL(2*NC+2,NP,NB),
> DTRAN(2*NC+1,NC,NP,NB), VISC(NP,NB),
C WALEED 3/11/2006 added asphaltene variables to jaco2
> RKARY(NB),POR(NB),WM(NC),RATIOS(NB)
-
-
-
CALL FLOWLKN(TM,NC,ZXY(1,K),VISC(J,K),DEN(J,K),REL(J,K),
> DXP,DXYDKN(1,1,J,K),DXYDKN(1,1,JP,K),DREL(1,J,K),
> DROKN(1,J,K),DVIS(1,J,K),DTRAN(1,1,J,K),J,
> NTYPE,
C WALEED 3/10/2006 added asphaltene variables
> RKARY(K),POR(K),WM,RATIOS(K))
-
-
-
C*********************************************************************
SUBROUTINE FLOWLKN(TM,NC,X,U,RO,REL,DXP,DX,DN,DREL,DRO,DU,
> DT,JP,NTYPE,
C WALEED 3/10/2006 added asphaltene variables
> RKARY,POR,WM,RATIOS)
C*********************************************************************
-
-
-
C WALEED 3/10/2006
> RKARY, POR,
> WM(NC), RATIOS
REAL*8 RU,RU2,ROTREL,CONS1,CONS2,CONS3,UW3,UW5
-
-
-
C WALEED 3/13/2006 added the effect on dtran for ni for gas only
IF (IASPR) THEN
UW3 = RC1/ RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)
DT(NC+J,I) = U * (ROTREL*UW3*DN(I,J)+CONS1*UW3*DREL(NC+J)+
> CONS2*UW3*DRO(NC+J)-
> X(JM1+I)*ROTREL*(RKMAX-1)*WM(NC)*RATIOS*UW3*UW3*UW5)
> - CONS3*DU(NC+J)
DT(NC+J,I) = DT(NC+J,I) * RU2 * TM
END IF
C WALEED ~END~
-
-
-
C WALEED 3/13/2006 added the effect on dtran for ni for oil only
IF (IASPR) THEN
UW3 = RC1/ RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)
DT(NC+J,I) = U * (ROTREL*UW3*DN(I,J)+CONS1*UW3*DREL(NC+J)+
> CONS2*UW3*DRO(NC+J)-
> X(JM1+I)*ROTREL*(RKMAX-1)*WM(NC)*RATIOS*UW3*UW3*UW5)
> - CONS3*DU(NC+J)
DT(NC+J,I) = DT(NC+J,I) * RU2 * TM

577
END IF
C WALEED ~END~
-
-
-
C WALEED 3/10/2006 added the effect on dtran for ni for 2 hc
IF (IASPR) THEN
UW3 = RC1/ RKARY
UW5 = RC1/(WASMAX*(1-POR)*ROCKMDEN)

DT(NC+J,I) = U * (ROTREL*UW3*DN(I,J)+CONS1*UW3*DREL(NC+J)+
> CONS2*UW3*DRO(NC+J)-
> X(JM1+I)*ROTREL*(RKMAX-1)*WM(NC)*RATIOS*UW3*UW3*UW5)
> - CONS3*DU(NC+J)
DT(NC+J,I) = DT(NC+J,I) * RU2 * TM
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jmass.f
Location: GPAS\eoscomp\jacobian

C WALEED 3/10/2006 the effect needs to reflected in dtran for x.y.z dir
TK1 = DUMMY1 * DTRAN(L,J,K,JC,IC,JP)
TN1 = DUMMY1 * DTRAN(L,J,K,NC+JC,IC,JP)

-----------------------------------------------------------------------

Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/12/2006 seems for cons p prod for amk, amnp (ni+p) we need
dtran
-
-
-
C WALEED 3/9/2006 added the effect on amnp for ni for cons p inj
IF (IASPR) THEN
UW3 = RC1/RKARY(LX,LY,LZ)
UW4 = UW3*UW3
UW5 = RC1/(WASMAX*(1-POR(LX,LY,LZ))*ROCKMDEN)
AMNP(LX,LY,LZ,JC,IC) = AMNP(LX,LY,LZ,JC,IC)
+ - ZW(IC,IW) * UT1 *
+ ( UW*UW3*DREL(LX,LY,LZ,JC+NC,JP)
+ - UW2*UW3*REL(LX,LY,LZ,JP)*
+ DVIS(LX,LY,LZ,JC+NC,JP)-
+ UW*UW4*REL(LX,LY,LZ,JP)*(RKMAX-1)*WM(NC)
+ *PVMOLS(LX,LY,LZ)*UW5 )
END IF
C WALEED ~END~

-----------------------------------------------------------------------

NOTE: need to be defined for the first time

Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/7/2006 added the effect on AWKN & AWKLL

578
C only one term for (cons p inj/prod) derivative of qw wrt lnkig
IF (IASPR) THEN
AWKLL(LX,LY,LZ,1) = RC0
AWKLL(LX,LY,LZ,2) = RC0
AWKLL(LX,LY,LZ,3) = RC0
UW3 = RC1/RKARY(LX,LY,LZ)
UW4 = UW3 * UW3
UW5 = RC1/(WASMAX*(1-POR(LX,LY,LZ))*ROCKMDEN)
AWKN(LX,LY,LZ,JC) = AWKN(LX,LY,LZ,JC) -
+ ZW(NCP1,IW) * UT1 *
+ ( UW*UW3*DREL(LX,LY,LZ,JC,JP) -
+ UW2*UW3*REL(LX,LY,LZ,JP)*
+ DVIS(LX,LY,LZ,JC,JP) )

AWKLL(LX,LY,LZ,1) = AWKLL(LX,LY,LZ,1) -
+ ZW(NCP1,IW) * UT1 *( UW*UW3*DRELKLL(LX,LY,LZ,1,JP) -
+ UW2*UW3*REL(LX,LY,LZ,JP)*
+ DVISKLL(LX,LY,LZ,1,JP) )
AWKLL(LX,LY,LZ,2) = AWKLL(LX,LY,LZ,2) -
+ ZW(NCP1,IW) * UT1 *
+ ( UW*UW3*DRELKLL(LX,LY,LZ,2,JP) -
+ UW2*UW3*REL(LX,LY,LZ,JP)*
+ DVISKLL(LX,LY,LZ,2,JP) )

AWKLL(LX,LY,LZ,3) = AWKLL(LX,LY,LZ,3) -
+ ZW(NCP1,IW) * UT1 *
+ ( UW*UW3*DRELKLL(LX,LY,LZ,3,JP) -
+ UW2*UW3*REL(LX,LY,LZ,JP)*
+ DVISKLL(LX,LY,LZ,3,JP)-
+ UW*UW4*REL(LX,LY,LZ,JP)*(RKMAX-1)*WM(NC)
+ *PVMOLS(LX,LY,LZ)*UW5 )

END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jmass.f
Location: GPAS\eoscomp\jacobian

C WALEED 3/6/2006 the effect for z-direction conv terms (on/off)


IF (IASPR) THEN
DKWDP = PVMOL(I,J,L,1) * DREL(I,J,L,NC2P2,1) *
> DZF(I,J,L,NCP1,1)*RKARY(I,J,L)
TMS = REL(I,J,L,JP)*DEN(I,J,L,JP)*DUMMY/RKARY(I,J,L)
TP1 = DUMMY * DPL * (DEN(I,J,L,JP)*DKWDP+REL(I,J,L,JP)*
> CW*DENW/RKARY(I,J,L))
END IF
C WALEED ~END~

C WALEED 3/6/2006 the effect for y-direction conv terms (on/off)


IF (IASPR) THEN
DKWDP = PVMOL(I,L,K,1) * DREL(I,L,K,NC2P2,1) *
> DZF(I,L,K,NCP1,1)*RKARY(I,L,K)
TMS = REL(I,L,K,JP)*DEN(I,L,K,JP)*DUMMY/RKARY(I,L,K)
TP1 = DUMMY * DPL * (DEN(I,L,K,JP)*DKWDP+REL(I,L,K,JP)*
> CW*DENW/RKARY(I,L,K))
END IF
C WALEED ~END~

579
-
-
-
C WALEED 3/3/2006 the effect for x-direction conv terms (on/off)
IF (IASPR) THEN
DKWDP = PVMOL(L,J,K,1) * DREL(L,J,K,NC2P2,1) *
> DZF(L,J,K,NCP1,1)*RKARY(L,J,K)
TMS = REL(L,J,K,JP)*DEN(L,J,K,JP)*DUMMY/RKARY(L,J,K)
TP1 = DUMMY * DPL * (DEN(L,J,K,JP)*DKWDP+REL(L,J,K,JP)*
> CW*DENW/RKARY(L,J,K))
END IF
C WALEED ~END~
-----------------------------------------------------------------------

Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/12/2006 the effect for constant p producer


IF (IASPR) THEN
AWW(LX,LY,LZ,2) = - WFC * UD(1) *
+ ( DENW*CW*REL(LX,LY,LZ,1)/RKARY(LX,LY,LZ)*(PWFZ(IZ,IW)
+ -P(LX,LY,LZ))
+ + DEN(LX,LY,LZ,1)*DREL(LX,LY,LZ,NC2P1,1)
+ *(PWFZ(IZ,IW)/RKARY(LX,LY,LZ)-P(LX,LY,LZ))
+ - DEN(LX,LY,LZ,1)*REL(LX,LY,LZ,1)/RKARY(LX,LY,LZ))
END IF
C WALEED ~END~
-
-
-
C WALEED 3/2/2006 the effect for const p injector
IF (IASPR) THEN
AWW(LX,LY,LZ,2) = AWW(LX,LY,LZ,2)-
+ ZW(NCP1,IW)*(UT1*DUMKU/RKARY(LX,LY,LZ)
+ -UT2*SUMKU/RKARY(LX,LY,LZ))
END IF
C WALEED ~END~

-----------------------------------------------------------------------
AMW! do I need to worry about this?

Filename: jsource.df
Location: GPAS\eoscomp\jacobian

C WALEED 3/1/2006 added the effect on AWKN


C only one term for cons p inj/prod for derivative of qw wrt ni
IF (IASPR) THEN
UW3 = RC1/RKARY(LX,LY,LZ)
UW4 = UW3 * UW3
AWKN(LX,LY,LZ,JC+NC) = AWKN(LX,LY,LZ,JC+NC) -
+ ZW(NCP1,IW) * UT1 *
+ ( UW*UW3*DREL(LX,LY,LZ,JC+NC,JP)
+ - UW2*UW3*REL(LX,LY,LZ,JP)*DVIS(LX,LY,LZ,JC+NC,JP)
+ - (UW*UW4*REL(LX,LY,LZ,JP)*(RKMAX-1)*WM(NC)*RATIOS(LX,LY,LZ)/
+ (WASMAX*(1-POR(LX,LY,LZ))*ROCKMDEN) ) )
END IF
C WALEED ~END~

-----------------------------------------------------------------------

580
Filename: xstep.df
Location: GPAS\eoscomp\drive
CALL JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,POR,TCOFX,TCOFY,TCOFZ,SAT,P,PORI,VP,VB,RATIO,W,
+ NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,TRAPN,DTRAPN,
+ RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,AVK,AVW,
+ AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,X,ZXY,DEPTH,
+ ROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,DRELS,DVISS,
+ DDENS,D ,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,ZPERM,
c print*, "out of Jacobian"
c Marcondes added cross transmisibilities 12/07/04
+ tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze,XPERM,YPERM,RKARY,^M
+ fpk,fpe,fpg,
C WALEED 2/14/2006 added asphaltene variables for calling jacobian
+ RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
+ DSATKLL,DZFKLL,DXYDKLL,DVISKLL)^M
-----------------------------------------------------------------------

Filename: jacobian.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE JACOBIAN(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,POR,XPERM,YPERM,ZPERM,SAT,P,PORI,VP,VB,
> RATIO,W,NPH,ZF,PHI,DZF,RF,DDEN,DEN,VIS,DVIS,TMOLR,PVMOL,
> TRAPN,DTRAPN,RSAT,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,
> AFNP,AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,
> AWW6,X,ZXY,DEPTH,KROCK,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,
> DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL)^M
-
-
-
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS(NX,NY,NZ),
> AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),
> DVISKLL(NX,NY,NZ,3,NP),
> PVMOLS(NX,NY,NZ),
> AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),
> DSATKLL(NX,NY,NZ,3,NP),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP)
-
-
-
CALL PREROW(NP,NC,NPH,TEMPR,P,VB,VP,TMOLR,PVMOL,ZXY,RATIO,ZF,DZF,
> TC,PC,VC,WM,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,AD,BD,
> PARA,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,RF,PHI,AFK,AFW,AFNP,DFV,AVK,
> AVW,AVNP,ARV,DTRAN,XPERM,YPERM,ZPERM,AMK,AMNP,AWW,AMK6,AMNP6,
> AWW6,NUMWEL,DELTIM,X,POR,PORI,DEPTH,W,IDIM,JDIM,KDIM,LDIM,IL1,

581
> IL2,JL1V,JL2V,KL1,KL2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,DTRANS,
> DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,VISCW,DPDZ,PERMZ,
c Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
c Marcondes 12/07/04
C WALEED 3/9/2006 added asphaltene variables to jacobian
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL)^M

-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

SUBROUTINE PREROW(NP,NC,NPH,TEMP,P,VB,VP,TMOLR,PVMOL,ZXY,
> RATIO,ZF,DZF,
> TC,PC,VC,WT,DEN,VISPURE,SAT,VIS,DVIS,SQADP,BDP,BIN,SQA,B,
> AD,BD,PARACH,RIFT,DIFT,REL,DSAT,DREL,CP,DCP,
> ARF,PHI,AFK,AFW,AFNP,DFV,AVK,AVW,AVNP,ARV,DTRAN,
> XTRM,YTRM,ZTRM,AMK,AMNP,AWW,AMK6,AMNP6,AWW6,NWELL,
> TD,X,POR,PORI,DEPTH,W,NX,NY,NZ,LDIM,I1,
> I2,J1,J2,K1,K2,KEYOUT,NBLK,IOFF,JOFF,KOFF,KROCK,DDEN,
> TRAPN,DTRAPN,RSAT,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,AQZ,
> DTRANS,DRELS,DVISS,DDENS,DZXYS,AQCDEN,CIJ,OWIFT,CADS,
> VISCW,DPDZ,PERMZ,
c added by Marcondes 12/07/04
> txe,txg,tyk,tyg,tzk,tze,PERMX,PERMY,RKARY,fpk,fpe,fpg,
C WALEED 3/9/2006 added asphaltene variables to prerow
> RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6,
> DSATKLL,DZFKLL,DXYDKLL,DVISKLL)^M
-
-
-
c Marcondes 12/07/04 - transmissibilities for cross terms
> PERMX(NX,NY,NZ),PERMY(NX,NY,NZ),RKARY(NX,NY,NZ),^M
> fpk(nx,ny,nz),fpe(nx,ny,nz),fpg(nx,ny,nz),^M

C WALEED 3/9/2006 added asphaltene variables to prerow


> RATIOS(NX,NY,NZ),AWKLL(NX,NY,NZ,3),
> DRELKLL(NX,NY,NZ,3,NP),DVISKLL(NX,NY,NZ,3,NP)
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),DSATKLL(NX,NY,NZ,3,N),
> DZFKLL(NX,NY,NZ,3,NP),
> DXYDKLL(NX,NY,NZ,NC,3,NP),
> DVISKLL(NX,NY,NZ,3,NP)

CALL JSOURCE(NC,NP,NPH,P,PVMOL,ZXY,DEN,DZF,
> VIS,DVIS,REL,DREL,NWELL,TEMP,
> SQADP,BDP,BIN,SQA,B,AD,BD,VC,WT,DTRAN,AMK,AMNP,
> AWW,AMK6,AMNP6,AWW6,VB,POR,TD,X,
> NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,NBLK,NB,
> IOFF,JOFF,KOFF,DDEN,AMW,AWKN,AMNPA,AWWA,
> AMW6,AWKN6,AQCDEN,AQZ,DRELS,DVISS,DDENS,DTRANS,
C WALEED 3/9/2006 added asphaltene variables to jsource
> RKARY,RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6)

-----------------------------------------------------------------------

Filename: jsource.df

582
Location: GPAS\eoscomp\jacobian

SUBROUTINE JSOURCE(NC,NP,NPH,P,PVMOL,ZXY,DEN,
> DZF,VIS,DVIS,REL,DREL,NWELL,
> T,SQADP,BDP,BIN,SQA,B,AD,BD,VC,WM,DTRAN,AMK,AMNP,
> AWW,AMK6,AMNP6,AWW6,VB,POR,TD,X,
> NX,NY,NZ,LDIM,I1,I2,J1,J2,K1,K2,KEYOUT,NBLK,NB,
> IOFF,JOFF,KOFF,DDEN,AMW,AWKN,AMNPA,AWWA,AMW6,AWKN6,
> AQCDEN,AQZ,DRELS,DVISS,DDENS,DTRANS
C WALEED added asphaltene variables
> RKARY,RATIOS,AWKLL,DRELKLL,DVISKLL,PVMOLS,AMKLL,AMKLL6)

REAL*8 UD(3), DKWDNW, DKWDP,


> HC, WZ,
> GAMA, UT1, UT2,
> TERM, ZF,
> DP, WFC, SUMKU,
> DUMKU, UW, UW2,
> CONST, ADD1, TE,
> T,
> ZMAX, AM, BM,
> ADD2, DUMKUP, DW, DSURF,
> UW3, UW4, UW5

C WALEED added asphaltene related variables


REAL*8 RKARY(NX,NY,NZ), RATIOS(NX,NY,NZ), AWKLL(NX,NY,NZ,3)
> DRELKLL(NX,NY,NZ,3,NP), DVISKLL(NX,NY,NZ,3,NP)
> PVMOLS(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6)

C WALEED 1/28/2006 the effect of asphaltene for constant p injector


IF (IASPR) THEN
AWW(LX,LY,LZ,1) = AWW(LX,LY,LZ,1)-
+ ZW(NCP1,IW)*UT1*( UD(1)*RKARY(LX,LY,LZ)*DREL(LX,LY,LZ,NC2P2,1)
+ / DEN(LX,LY,LZ,1) )
END IF
C WALEED ~END~

C WALEED 1/31/2006 the effect of asphaltene for constant p producer


IF (IASPR .EQ. TRUE) THEN
AWW(LX,LY,LZ,1) = -
CONST*RKARY(LX,LY,LZ)*DREL(LX,LY,LZ,NC2P2,1)
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jmass.f
Location: GPAS\eoscomp\jacobian

C WALEED 1/31/2006 the effect for z-direction conv (on/off)


IF (IASPR .EQ. TRUE) THEN
DKWDNW = RKARY(I,J,L)*DREL(I,J,L,NC2P2,1) /
DEN(I,J,L,1)
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jmass.f

583
Location: GPAS\eoscomp\jacobian

C WALEED 1/31/2006 the effect for y-direction conv (on/off)


IF (IASPR .EQ. TRUE) THEN
DKWDNW = RKARY(I,L,K)*DREL(I,L,K,NC2P2,1) / DEN(I,L,K,1)
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: jmass.f
Location: GPAS\eoscomp\jacobian
SUBROUTINE JXMASS(NC,NP,NPH,P,ZXY,DEN,VIS,REL,DTRAN,AMK,AMNP,
> AWW,AMK6,AMNP6,AWW6,VB,POR,PORI,CP,X,XTRM,DZF,PVMOL,
> DREL,DEPTH,W,NX,NY,NZ,I1,I2,J1,J2,K1,K2,KEYOUT,AMW6,AWKN6,
> AMW,AWKN,AQZ,DTRANS,
C WALEED 2/27/2006 asphaltene variables
> RKARY,AMKLL,AMKLL6,DTRANKLL)

C WALEED 2/27/2006 added asphaltene variables


> RKARY(NX,NY,NZ),AMKLL(NX,NY,NZ,NC,3),
> AMKLL6(NX,NY,NZ,NC,3,6),DTRANKLL(NX,NY,NZ,NC,3,3)

The same was done for JYMASS and JZMASS

--------------------------------------------------------------------

Filename: jmass.f
Location: GPAS\eoscomp\jacobian
C WALEED 1/31/2006 the effect for x-direction conv terms (on/off)
IF (IASPR .EQ. TRUE) THEN
DKWDNW = RKARY(L,J,K)*DREL(L,J,K,NC2P2,1) /
DEN(L,J,K,1)
END IF
C WALEED ~END~

-----------------------------------------------------------------------

This part was deleted from the file.

Filename: relderiv.f
Location: GPAS\eoscomp\jacobian

C WALEED 1/28/2006 the effect was reflected in jsource.df instead


C WALEED 1/27/2006 modified the derivative of relperm wrt Sw
C
C IF (IASPR.EQ.TRUE) THEN
C
C DREL(NC2P2,J,K) = RFACT*DREL(NC2P2,J,K)
C
C END IF
C
C WALEED ~END~

This was directly related to:


Filename: jsource.df
Location: GPAS\eoscomp\jacobian

584
Lines: 266 to 270

AWW(LX,LY,LZ,1) = AWW(LX,LY,LZ,1)-
+ ZW(NCP1,IW)*UT1*( UD(1)*DREL(LX,LY,LZ,NC2P2,1)
+ / DEN(LX,LY,LZ,1) )

Asphaltene will affect the term DREL of the water source.

-----------------------------------------------------------------------
RK will do the same work.

Filename: xprop.df
Location: GPAS\eoscomp\prop

C WALEED 1/27/2006 added permeability resistance factor


C
C IF (IASPR) THEN
C RFACT = 1.0 + ((RFACTMAX-1)*(WASMAX/WAS))
C ENDIF
C
C WALEED ~END~
-----------------------------------------------------------------------

Filename: rowpw.df
Location: GPAS\eoscomp\jacobian

176 C WALEED 2/14/2006 modifying the viscosity before calling jacobian


177 IF (IASPR) THEN
178 VIS(I,J,K,1) = VIS(I,J,K,1) / RKARY(I,J,K)
179 VIS(I,J,K,2) = VIS(I,J,K,2) / RKARY(I,J,K)
180 VIS(I,J,K,3) = VIS(I,J,K,3) / RKARY(I,J,K)
181 END IF
182 C WALEED ~END~

-----------------------------------------------------------------------
so at this point we are done with the residuals and will start the Jac.

Filename: xstep.df
Location: GPAS\eoscomp\drive

CALL RESIDUALS(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,KL2,
+ KEYOUT,NBLK,NPH,P,RATIO,ZF,DEN,PVMOL,VPOLD,XOLD,ZXY,PHI,RF,
+ ARV,ARW,ARM,X,AQCDEN,
C WALEED 2/27/6 added asphaltene variables to residuals in xstep
+ RATIOS,ARFS,FAS,ZXYS,ARER,ARFE,PHINCS)
-----------------------------------------------------------------------

Filename: xtrans.df
Location: GPAS\eoscomp\residual

SUBROUTINE RESIDUALS(IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,
> KL2,KEYOUT,NBLK,NPH,P,RATIO,ZF,DEN,PVMOL,VPOLD,XOLD,ZXY,PHI,RF,
> ARV,ARW,ARM,X,AQCDEN,
C WALEED added asphaltene variables to residuals
> RATIOS,ARFS,FAS,ZXYS,PHINCS,ARER,ARFE)

REAL*8 P(IDIM,JDIM,KDIM),
> RATIO(IDIM,JDIM,KDIM,NP),
> ZF(IDIM,JDIM,KDIM,NP),

585
> DEN(IDIM,JDIM,KDIM,NP),
> PVMOL(IDIM,JDIM,KDIM,NP+2),
> VPOLD(IDIM,JDIM,KDIM),
> XOLD(IDIM,JDIM,KDIM,NC+NA+1),
> ZXY(IDIM,JDIM,KDIM,5*NC),
> PHI(IDIM,JDIM,KDIM,NC,NP),
> RF(IDIM,JDIM,KDIM,NC+NA),
> ARV(IDIM,JDIM,KDIM),
> ARW(IDIM,JDIM,KDIM),
> ARM(IDIM,JDIM,KDIM,NC+NA),
> X(IDIM,JDIM,KDIM,NC+NA+1),
> AQCDEN(IDIM,JDIM,KDIM,NA+1),
C WALEED 2/27/2006 added asphaltene variables
> RATIOS(IDIM,JDIM,KDIM),
> ARFS(IDIM,JDIM,KDIM),
> FAS(IDIM,JDIM,KDIM),
> ZXYS(IDIM,JDIM,KDIM,2),
> ARER(IDIM,JDIM,KDIM),
> ARFE(IDIM,JDIM,KDIM),
> PHINCS(IDIM,JDIM,KDIM)

C WALEED added two local variables


REAL*8 EKM1,EKM2

-----------------------------------------------------------------------

Filename: xtrans.df
Location: GPAS\eoscomp\residual

C WALEED 2/19/2006 added residual of solid-oil fugacity eq.


IF (IASPR) THEN
ARFS(I,J,K) = 0.0D0
PHINCS(I,J,K) = FAS(I,J,K) LOG(P(I,J,K))
ARFS(I,J,K) = -ZXYS(I,J,K,2)-
PHINCS(I,J,K)+PHI(I,J,K,NC,2)
C WALEED ~END~

C WALEED 2/24/2006 added residual of solid-oil K-value eq. for nc only


ARER(I,J,K) = 0.0D0
ARER(I,J,K) = -ZXYS(I,J,K,1)+1/ZXY(I,J,K,2*NC)
C WALEED ~END~

C WALEED 2/26/2006 added residual of 3-phase flash eq.


ARFE(I,J,K) = 0.0D0
EKM2 = -1
DO 30 IC = 1 , NC
EKM1 = ZXY(I,J,K,NC4+IC) - RC1
IF IC = NC EKM2 = ZXYS(I,J,K,1)-RC1
ARFE(I,J,K)= -ARFE(I,J,K)-ZXY(I,J,K,IC)*EKM1/
> (RC1+RATIO(I,J,K,3)*EKM1+RATIOS(I,J,K)*EKM2)
30 CONTINUE
END IF
C WALEED ~END~

-----------------------------------------------------------------------

Filename: xtrans.df
Location: GPAS\eoscomp\residual

C WALEED 2/16/2006 modified ARV for 2 HC phases

586
ARV(I,J,K) = RC1/PRT*(RATIO(I,J,K,NP)*ZF(I,J,K,NP)+
> RATIO(I,J,K,NP-1)*ZF(I,J,K,NP-1))
ARV(I,J,K) = -ARV(I,J,K) -
> (PVMOL(I,J,K,1)/DEN(I,J,K,1)-
> RC1) / PVMOL(I,J,K,4)-VBS*RATIOS(I,J,K)
C WALEED ~END~
C WALEED 2/16/2006 modified ARV for single HC phase
IF (IASPR) THEN
DO 20 JP = 2 , NP
IF ( NPH(I,J,K,JP) .EQ. 0 ) GO TO 20
ARV(I,J,K) = RC1/PRT*ZF(I,J,K,JP)
ARV(I,J,K) = -ARV(I,J,K) -
> (PVMOL(I,J,K,1)/DEN(I,J,K,1)-
> RC1) / PVMOL(I,J,K,4)-
VBS*RATIOS(I,J,K)
RESIDT(2) = RESIDT(2) + ABS (ARV(I,J,K))
IF ( ABS(ARV(I,J,K)) .GT. RESIDM(2) )
> RESIDM(2) = ABS(ARV(I,J,K))

20 CONTINUE
END IF
C WALEED 2/16/2006 ~END~

-----------------------------------------------------------------------

This change was done only for the residuals in order to avoid changing
the material balance residuals, ARM and ARW.

Filename: xprop.df
Location: GPAS\eoscomp\prop

371 C WALEED 2/13/2006 added permeability resistance factor


372
373 IF (IASPR) THEN
374 RK = 1.0 + ((RKMAX-1)*(WASMAX/WAS))
375 VIS(I,J,K,1)= VIS(I,J,K,1) * RK
376 VIS(I,J,K,2)= VIS(I,J,K,2) * RK
377 VIS(I,J,K,3)= VIS(I,J,K,3) * RK
378 RKARY(I,J,K) = RK
379 ENDIF
380
381 C WALEED ~END~

-----------------------------------------------------------------------
Filename: xisdat.df
Location: GPAS\eoscomp\init
C WALEED 1/23/06 Asphaltene flag is added which is off by default

IASPR = .FALSE.
CALL GETVAL('IASPR ',IASPR ,'FG',0,0,0,0,NDUM,NERR)

C WALEED ~END~

Similar to:
c trapping number option by default off
ITRAP = .FALSE.

587
RELP=1 ! table lookup by default

CALL GETVAL('ITRAP ',ITRAP ,'FG',0,0,0,0,NDUM,NERR)


-----------------------------------------------------------------------

Filename: rock.dh
Location: GPAS\framework\input

C WALEED 1/23/6 added asphaltene flag

COMMON /ASPHAL3/ IASPR


C LOGICAL*4 ITRAP , OUTPUT_TRAP
LOGICAL*4 ITRAP , OUTPUT_TRAP , IASPR

C WALEED ~END~

-----------------------------------------------------------------------
Filename: xstep.df
Location: GPAS\eoscomp\drive

SUBROUTINE XSTEP (IDIM,JDIM,KDIM,LDIM,IL1,IL2,JL1V,JL2V,KL1,


+ KL2,KEYOUT,NBLK,POR,SAT,P,ZXY,PORI,VP,VB,RATIO,W,NPH,
+ ZF,PHI,DZF,RF,DEN,VIS,DVIS,TMOLR,TVOLR,PVMOL,PVVOL,
+ ROCK,TVOLS,RIFT,DIFT,REL,DSAT,CP,DCP,DREL,AFK,AFW,DFV,AFNP,
+ AVK,AVW,AVNP,ARV,DTRAN,ARM,ARW,AMK,AMK6,AMNP,AMNP6,AWW,AWW6,
+ VPOLD,XOLD,X,IDX,JACOFLAG,DDEN,RSAT,SURFCONC,AMW,AWKN,XPERM,
+ YPERM,ZPERM,TRAPN,DTRAPN,UPD,FLX,AQCOMPCD,VISCW,OWIFT,AQCOMPM,
+ CADS,TCOFX,TCOFY,TCOFZ,DEPTH,HCCD,POLD,SATOLD,AQCOMPCDO,
+ ARMA,ARMF,ARWA,ARWF,AMNPA,AWWA,AMW6,AWKN6,AQZ,ARFOLD,ARVOLD,
+ ARMOLD,ARWOLD,AQCDEN,CIJ,DTRANS,DRELS,DVISS,DDENS,DZXYS,DPDZ,
+ CADSOLD,ZXYOLD
+ ,tcofxe,tcofxg,tcofyk,tcofyg,tcofzk,tcofze
c Marcondes added new variables for evaluation of residual for
c corner-point
c Marcondes added new metrices for trapping number 12-22-04
+ ,xkk,xnk,xgk,yke,yne,yge,zkg,zng,zgg,
c new arrays for evaluation of normal velocities
C WALEED 2/21/6 added 32 asphaltene related variables to xstep
+ g11,g22,g33,vwk,vwe,vwg,vok,voe,vog,vgk,vge,vgg,
+ MSDEN,RKARY,fpk,fpe,fpg,AWKLL,AMKLL,AWKLL6,AMKLL6,
+ ARER,ARFE,ARFS,AERKNKLL
+ AFEKNKLL,AVKLL,
+ AFSKLL,AFSNP,AFSK,AFKLL
+ PHINCS,FAS,RATIOS,PVMOLS
+ WAS,RFACT,NPHS
+ DZFKLL,DVISKLL,DXYDKLL,DTRANKLL
+ DSATKLL,DROKLL,DRELKLL,DIFTKLL
+ DCPKLL,ZXYS,DENS)^M

C WALEED 2/21/6 added 32 asphaltene related variables to xstep


REAL*8 AWKLL(IDIM,JDIM,KDIM,3),
> AMKLL(IDIM,JDIM,KDIM,NC,3),
> AWKLL6(IDIM,JDIM,KDIM,3,6),
> AMKLL6(IDIM,JDIM,KDIM,NC,3,6),
> ARER(IDIM,JDIM,KDIM),
> ARFE(IDIM,JDIM,KDIM),
> ARFS(IDIM,JDIM,KDIM),
> AERKNKLL(IDIM,JDIM,KDIM,2*NC+3),

588
> AFEKNKLL(IDIM,JDIM,KDIM,2*NC+3),
> AVKLL(IDIM,JDIM,KDIM,3),
> AFSKLL(IDIM,JDIM,KDIM,3),
> AFSNP(IDIM,JDIM,KDIM,NC+1),
> AFSK(IDIM,JDIM,KDIM,NC),
> AFKLL(IDIM,JDIM,KDIM,NC,3),
> PHINCS(IDIM,JDIM,KDIM),
> FAS(IDIM,JDIM,KDIM),
> RATIOS(IDIM,JDIM,KDIM),
> PVMOLS(IDIM,JDIM,KDIM),
> WAS(IDIM,JDIM,KDIM),
> RFACT(IDIM,JDIM,KDIM),
> NPHS(IDIM,JDIM,KDIM),
> DZFKLL(IDIM,JDIM,KDIM,3,NP),
> DVISKLL(IDIM,JDIM,KDIM,3,NP),
> DXYDKLL(IDIM,JDIM,KDIM,NC,3,NP),
> DTRANKLL(IDIM,JDIM,KDIM,NC,3,NP),
> DSATKLL(IDIM,JDIM,KDIM,3,NP),
> DROKLL(IDIM,JDIM,KDIM,3,NP),
> DRELKLL(IDIM,JDIM,KDIM,3,NP),
> DIFTKLL(IDIM,JDIM,KDIM,3,3),
> DCPKLL(IDIM,JDIM,KDIM,3,3),
> ZXYS(IDIM,JDIM,KDIM,2),
> DENS(IDIM,JDIM,KDIM)
C WALEED ~END~

-----------------------------------------------------------------------

Filename: ipars.df
Location: GPAS\framework\drive
C WALEED 2/21/6 added 32 asphaltene related variables
INTEGER*4 IXSTEP(165)^M

IXSTEP(1)=164^M

C WALEED 2/21/6 added 32 asphaltene related variables


IXSTEP(134)=N_AWKLL
IXSTEP(135)=N_AMKLL
IXSTEP(136)=N_AWKLL6
IXSTEP(137)=N_AMKLL6
IXSTEP(138)=N_ARER
IXSTEP(139)=N_ARFE
IXSTEP(140)=N_ARFS
IXSTEP(141)=N_AERKNKLL
IXSTEP(142)=N_AFEKNKLL
IXSTEP(143)=N_AVKLL
IXSTEP(144)=N_AFSKLL
IXSTEP(145)=N_AFSNP
IXSTEP(146)=N_AFSK
IXSTEP(147)=N_AFKLL
IXSTEP(148)=N_PHINCS
IXSTEP(149)=N_FAS
IXSTEP(150)=N_RATIOS
IXSTEP(151)=N_PVMOLS
IXSTEP(152)=N_WAS
IXSTEP(153)=N_RFACT
IXSTEP(154)=N_NPHS
IXSTEP(155)=N_DZFKLL
IXSTEP(156)=N_DVISKLL

589
IXSTEP(157)=N_DXYDKLL
IXSTEP(158)=N_DTRANKLL
IXSTEP(159)=N_DSATKLL
IXSTEP(160)=N_DROKLL
IXSTEP(161)=N_DRELKLL
IXSTEP(162)=N_DIFTKLL
IXSTEP(163)=N_DCPKLL
IXSTEP(164)=N_ZXYS
IXSTEP(165)=N_DENS
C WALEED ~END~

-----------------------------------------------------------------------
Filename: memman2.dc
Location: GPAS\framework\memman

C WALEED 2/21/6 asphaltene related


case 176:^M
(*subadd)
(&(idim[nbcw]),&(jdim[nbcw]),&(kdim[nbcw]),&dimr,^M
&(iloc1[nbcw]),&(iloc2[nbcw]),jloc1[nbcw],jloc2[nbcw],^M
&(kloc1[nbcw]),&(kloc2[nbcw]),keyout[nbcw],&nbp,^M
*(a+d[1]),*(a+d[2]),*(a+d[3]),*(a+d[4]),*(a+d[5]),^M
*(a+d[6]),*(a+d[7]),*(a+d[8]),*(a+d[9]),*(a+d[10]),^M
*(a+d[11]),*(a+d[12]),*(a+d[13]),*(a+d[14]),*(a+d[15]),^M
*(a+d[16]),*(a+d[17]),*(a+d[18]),*(a+d[19]),*(a+d[20]),^M
*(a+d[21]),*(a+d[22]),*(a+d[23]),*(a+d[24]),*(a+d[25]),^M
*(a+d[26]),*(a+d[27]),*(a+d[28]),*(a+d[29]),*(a+d[30]),^M
*(a+d[31]),*(a+d[32]),*(a+d[33]),*(a+d[34]),*(a+d[35]),^M
*(a+d[36]),*(a+d[37]),*(a+d[38]),*(a+d[39]),*(a+d[40]),^M
*(a+d[41]),*(a+d[42]),*(a+d[43]),*(a+d[44]),*(a+d[45]),^M
*(a+d[46]),*(a+d[47]),*(a+d[48]),*(a+d[49]),*(a+d[50]),^M
*(a+d[51]),*(a+d[52]),*(a+d[53]),*(a+d[54]),*(a+d[55]),^M
*(a+d[56]),*(a+d[57]),*(a+d[58]),*(a+d[59]),*(a+d[60]),^M
*(a+d[61]),*(a+d[62]),*(a+d[63]),*(a+d[64]),*(a+d[65]),^M
*(a+d[66]),*(a+d[67]),*(a+d[68]),*(a+d[69]),*(a+d[70]),^M
*(a+d[71]),*(a+d[72]),*(a+d[73]),*(a+d[74]),*(a+d[75]),^M
*(a+d[76]),*(a+d[77]),*(a+d[78]),*(a+d[79]),*(a+d[80]),^M
*(a+d[81]),*(a+d[82]),*(a+d[83]),*(a+d[84]),*(a+d[85]),^M
*(a+d[86]),*(a+d[87]),*(a+d[88]),*(a+d[89]),*(a+d[90]),^M
*(a+d[91]),*(a+d[92]),*(a+d[93]),*(a+d[94]),*(a+d[95]),^M
*(a+d[96]),*(a+d[97]),*(a+d[98]),*(a+d[99]),^M
*(a+d[100]),*(a+d[101]),*(a+d[102]),*(a+d[103]),^M
*(a+d[104]),*(a+d[105]),*(a+d[106]),*(a+d[107]),^M
*(a+d[108]),*(a+d[109]),*(a+d[110]),*(a+d[111]),^M
*(a+d[112]),*(a+d[113]),*(a+d[114]),*(a+d[115]),^M
*(a+d[116]),*(a+d[117]),*(a+d[118]),*(a+d[119]),^M
*(a+d[120]),*(a+d[121]),*(a+d[122]),*(a+d[123]),^M
*(a+d[124]),*(a+d[125]),*(a+d[126]),*(a+d[127]),^M
*(a+d[128]),*(a+d[129]),*(a+d[130]),*(a+d[131]),^M
*(a+d[132]),*(a+d[133]),*(a+d[134]),*(a+d[135]);^M
*(a+d[136]),*(a+d[137]),*(a+d[138]),*(a+d[139]);^M
*(a+d[140]),*(a+d[141]),*(a+d[142]),*(a+d[143]);^M
*(a+d[144]),*(a+d[145]),*(a+d[146]),*(a+d[147]);^M
*(a+d[148]),*(a+d[149]),*(a+d[150]),*(a+d[151]);^M
*(a+d[152]),*(a+d[153]),*(a+d[154]),*(a+d[155]);^M
*(a+d[156]),*(a+d[157]),*(a+d[158]),*(a+d[159]);^M
*(a+d[160]),*(a+d[161]),*(a+d[162]),*(a+d[163]),*(a+d[164]));^M
break;^M

590
-----------------------------------------------------------------------

Filename: xarray.df
Location: GPAS\eoscomp\init

C WALEED 2/20/6 asphaltene related


KE=44
CALL ALCGEA ('AWKLL ',2,3,N_AWKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AMKLL ',2,3*NC,N_AMKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AWKLL6 ',2,6*3,N_AWKLL6,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AMKLL6 ',2,6*3*NC,N_AMKLL6,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('ARER ',2,0,N_ARER,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('ARFE ',2,0,N_ARFE,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('ARFS ',2,0,N_ARFS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AERKNKLL ',2,2*NC+3,N_AERKNKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AFEKNKLL ',2,2*NC+3,N_AFEKNKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AVKLL ',2,3,N_AVKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AFSKLL ',2,3,N_AFSKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AFSNP ',2,NC+1,N_AFSNP,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AFSK ',2,NC,N_AFSK,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('AFKLL ',2,3*NC,N_AFKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('PHINCS ',2,0,N_PHINCS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('FAS ',2,0,N_FAS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('RATIOS ',2,0,N_RATIOS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('PVMOLS ',2,0,N_PVMOLS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('WAS ',2,0,N_WAS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('RFACT ',2,0,N_RFACT,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('NPHS ',2,0,N_NPHS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DZFKLL ',2,3*3,N_DZFKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DVISKLL ',2,3*3,N_DVISKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DXYDKLL ',2,3*3*NC,N_DXYDKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DTRANKLL ',2,3*3*NC,N_DTRANKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DSATKLL ',2,3*3,N_DSATKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DROKLL ',2,3*3,N_DROKLL,KERR)

591
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DRELKLL ',2,3*3,N_DRELKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DIFTKLL ',2,3*3,N_DIFTKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DCPKLL ',2,3*3,N_DCPKLL,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('ZXYS ',2,2,N_ZXYS,KERR)
IF (KERR.GT.0) GO TO 99
CALL ALCGEA ('DENS ',2,0,N_DENS,KERR)
IF (KERR.GT.0) GO TO 99
C WALEED ~END~
-----------------------------------------------------------------------

Filename: xarydat.h
Location: GPAS\eoscomp\include

C WALEED 01/19/2006

COMMON /ASPHAL2/ N_AWKLL,N_AMKLL,N_AWKLL6,N_AMKLL6


1 ,N_ARER,N_ARFE,N_ARFS,N_AERKNKLL
4 ,N_AFEKNKLL,N_AVKLL
5 ,N_AFSKLL,N_AFSNP,N_AFSK,N_AFKLL
6 ,N_PHINCS,N_FAS,N_RATIOS,N_PVMOLS
7 ,N_WAS,N_RFACT,N_NPHS
8 ,N_DZFKLL,N_DVISKLL,N_DXYDKLL,N_DTRANKLL
9 ,N_DSATKLL,N_DROKLL,N_DRELKLL,N_DIFTKLL
10 ,N_DCPKLL,N_ZXYS,N_DENS

C WALEED ~END~

-----------------------------------------------------------------------

Filename: xgendat.dh
Location: GPAS\eoscomp\include

C WALEED 01/19/2006

COMMON /ASPHAL1/ RFACTMAX,WASMAX,ROCKMDEN,FASS,PSTAR,VBS

C WALEED ~END~

C WALEED 01/19/2006

REAL*8 RFACTMAX,WASMAX,ROCKMDEN,FASS,PSTAR,VBS

C WALEED ~END~

592
Appendix O: Sample Input File with Asphaltene for CMG GEM

In this appendix, a sample CMG GEM input file, which was used for one of the
cases in Chapter 3, is given. The following input file was used for the oil core flood
simulation case. This input file can be run to study the effects of asphaltene precipitation,
flocculation and deposition models on the properties of rock.

*RESULTS SIMULATOR GEM

*FILENAMES *OUTPUT *SRFOUT *RESTARTOUT *INDEXOUT *MAINRESULTSOUT


*TITLE1 '1-D OIL CORE-FLOOD FOR ASPHALTENE DEP.'
*TITLE2 'Fontainebleau sandstone with Weyburn oil'
*CASEID 'GF1-1'
**DEBUG *JDUMP 33:37 1:5 1:5 1
*INUNIT *SI
*WRST *TIME
*WPRN *WELL *TIME
*WPRN *GRID *TIME
*WSRF *WELL 1
*WSRF *GRID *TIME
*OUTPRN *WELL *ALL
*OUTPRN *GRID *PRES *SO *SIG *DENO *SOLID *KRO *KRG *VISO *VELOCRC
*OUTSRF *GRID *PRES *SO *SIG *SOLID *ADS 'C30B+' *KRO *KRG *POROS *DENO
*VISO *VELOCRC
*DIM *MDIMPL 100
**--------------------------RESERVOIR & GRID DATA----------------------
*GRID *CART 30 1 1
*DI *CON 2.0E-03
*DJ *CON 2.038322E-02
*DK *CON 2.038322E-02
*DEPTH 1 1 1 1.0
*POR *CON 0.131
*PERMI *CON 107
*PERMJ *CON 107
*PERMK *CON 107
**----------------------------FLUID PROPERTY DATA----------------------
*MODEL *PR
*NC 9 9
*TRES 50.000
*PVC3 1.4000000E+00
*COMPNAME
'N2 toC1 ' 'CO2 ' 'C2 toC3 ' 'IC4toNC5' 'C06toC09'
'C10toC19' 'C20toC29' 'C30A+ ' 'C30B+ '

593
*SG 3.5501348E-01 8.1800000E-01 4.5925843E-01 6.0331141E-01
7.6602581E-01 8.4445649E-01 9.1257161E-01 9.8894843E-01
9.8894843E-01
*TB -1.6690811E+02 -7.8476000E+01 -5.7398129E+01 1.3264147E+01
1.3386416E+02 2.8020018E+02 4.5893778E+02 7.0188060E+02
7.0188060E+02
*PCRIT 4.3600503E+01 7.2800000E+01 4.4075948E+01 3.5365704E+01
2.7600182E+01 1.8685735E+01 1.3007662E+01 8.7281817E+00
8.7281817E+00
*VCRIT 9.7481182E-02 9.4000000E-02 1.8370300E-01 2.7850658E-01
4.5747077E-01 7.6623642E-01 1.1736587E+00 1.7282959E+00
1.7282959E+00
*TCRIT 1.8002072E+02 3.0420000E+02 3.5021897E+02 4.4225586E+02
5.9291053E+02 7.3049476E+02 8.6541991E+02 1.0330349E+03
1.0330349E+03
*AC 1.3044585E-02 2.2500000E-01 1.3402370E-01 2.1288126E-01
3.3029816E-01 5.6896138E-01 8.8620979E-01 1.2553771E+00
1.2553771E+00
*MW 1.7929990E+01 4.4010000E+01 3.9447922E+01 6.4552350E+01
1.2449059E+02 2.1780834E+02 3.6417593E+02 6.2253772E+02
6.2253772E+02
*HCFLAG 0 0 0 0 0 0 0 0 0
*BIN
1.3000000E-01
7.7626974E-03 1.3500000E-01
2.1094499E-02 1.2500000E-01 3.3585930E-03
4.4931584E-02 1.0145797E-01 1.5995421E-02 4.7720063E-03
7.7883596E-02 1.0145797E-01 3.8529427E-02 1.9626948E-02
5.1530605E-03
1.1049057E-01 1.0145797E-01 6.3718053E-02 3.9069383E-02
1.7043088E-02
3.5259694E-03
1.4353897E-01 1.0145797E-01 9.1090493E-02 6.1824709E-02
3.3501399E-02
1.2743726E-02 2.9060764E-03
1.6228863E-01 1.8000000E-01 1.0340766E-01 7.0339110E-02
3.8194803E-02
1.4550953E-02 3.3205402E-03 0.0000000E+00
*VSHIFT
-1.5175000E-01 -1.5400000E-01 1.6664000E-01 1.5100000E-01
2.0097000E-01
4.8744281E-03 7.4820000E-02 1.4666000E-01 1.4666000E-01
*VISCOR *HZYT
*MIXVC 8.0000000E-01
*VISVC
7.8000000E-02 7.5200000E-02 2.2127000E-01 3.3462000E-01
5.5065000E-01
9.2398000E-01 1.3875964E+00 1.7286067E+00 1.9181226E+00
*VISCOEFF
1.0000000E-01 2.0000000E-03 5.0000000E-03 -2.6720000E-02
1.1200000E-02
*OMEGA

594
4.5723553E-01 3.6579000E-01 4.5723553E-01 4.5723553E-01
4.5723553E-01
4.5723553E-01 4.5723553E-01 4.5723553E-01 4.5723553E-01
*OMEGB
7.7796074E-02 6.2240000E-02 7.7796074E-02 7.7796074E-02
7.7796074E-02
7.7796074E-02 7.7796074E-02 7.7796074E-02 7.7796074E-02
*PCHOR
7.1324842E+01 7.8000000E+01 1.3604607E+02 2.0666813E+02
3.3739601E+02
6.0401815E+02 1.0222112E+03 1.7603878E+03 1.7603878E+03
*ENTHCOEF
-4.8099664E+00 5.1578014E-01 -2.4065776E-04 3.5357633E-07 -
1.2877792E-10
1.6487601E-14
4.7780500E+00 1.1443300E-01 1.0113200E-04 -2.6494000E-08
3.4706000E-12
-1.3140000E-16
-1.0679602E+00 2.1062857E-01 3.0119253E-05 2.6999919E-07 -
1.2875307E-10
1.9204208E-14
2.6299477E+01 -1.2123050E-03 3.2548260E-04 -7.5059391E-08
3.3624792E-12
5.2765926E-16
0.0000000E+00 -4.9287929E-02 4.3017465E-04 -6.5229320E-08
0.0000000E+00
0.0000000E+00
0.0000000E+00 -3.4383946E-02 4.1484790E-04 -6.1235316E-08
0.0000000E+00
0.0000000E+00
0.0000000E+00 -1.7552315E-02 4.0097771E-04 -5.7002975E-08
0.0000000E+00
0.0000000E+00
0.0000000E+00 -3.6723239E-03 3.9158777E-04 -5.3689530E-08
0.0000000E+00
0.0000000E+00
0.0000000E+00 -3.6723239E-03 3.9158777E-04 -5.3689530E-08
0.0000000E+00
0.0000000E+00
*SOLIDMODEL
-2.5205254E+01 9.0000000E-01 5.0000000E+04 9.0000000E-01
*PHASEID *OIL
*DERIVATIVEMETHOD *NUMERALL
*SOLID-CONV-RATE
50000.0 0.0
*SOLID_ALPHA 0.1
*SOLID_BETA 0.0
*SOLID_CRITVEL 0.0
*SOLID_GAMMA 0.3
*SOLID_SIGMA 150.0
*DENROCK 2650.0
*RFMAX 5.0
**WSLMAX 5.0E-04

595
*ADSCST 0.012
**--------------------------------ROCK FLUID DATA----------------------
*ROCKFLUID
*RPT 1
*SGT
0.0 0.0 1.00000 0.0
0.05000 0.0 0.88000 0.0
0.08890 0.00100 0.70230 0.0
0.17780 0.01000 0.47050 0.0
0.26670 0.03000 0.29630 0.0
0.35560 0.05000 0.17150 0.0
0.44440 0.10000 0.08780 0.0
0.53330 0.20000 0.03700 0.0
0.62220 0.35000 0.01100 0.0
0.65000 0.39000 0.0 0.0
0.71110 0.56000 0.0 0.0
0.80000 1.0 0.0 0.0
*SWT
0.2000 0.0 1.0 0.0
0.2899 0.00220 0.67690 0.0
0.3778 0.01800 0.41530 0.0
0.4667 0.06070 0.21780 0.0
0.5556 0.14380 0.08350 0.0
0.6444 0.28090 0.01230 0.0
0.7000 0.40890 0.0 0.0
0.7333 0.48550 0.0 0.0
0.8222 0.77090 0.0 0.0
0.9111 1.0 0.0 0.0
1.0 1.0 0.0 0.0
**---------------------INITIAL RESERVOIR CONDITION---------------------
*INITIAL
*VERTICAL *OFF
*PRES *CON 1000.0
*SW *CON 0.0
*ZGLOBAL *CON
0.00321 0.00409 1.75432 11.14261 36.27861 35.16170 11.54219
2.43375 1.67952
**---------------------------NUMERICAL METHOD--------------------------
*NUMERICAL
*AIM *OFF
**------------------------------WELL DATA------------------------------
*RUN
*TIME 0.0
*DTMIN 0.001
*DTMAX 0.025
*DTWELL 0.01
*WELLINIT *ITER
*AIMWELL *WELLN
*AIMSET *CON 1

*WELL 1 'INJ'
*WELL 2 'PROD'

596
*INJECTOR 1
*INCOMP *SOLVENT
0.00321 0.00409 1.75432 11.14261 36.27861 35.16170 11.54219
2.43375 1.67952

*OPERATE *MAX *BHF 1.20E-03


*PRODUCER 2
*OPERATE *MIN *BHP 1000.0
*GEOMETRY *K 0.1 0.64 0.25 0.0
*PERF *SLIMTUBE 1
1 1 1 1.0
*PERF *SLIMTUBE 2
30 1 1 1.0
*TIME 0.1423004 ** 10 PV
*TIME 0.2846008 ** 20 PV
*TIME 0.4269012 ** etc
*TIME 0.5692017
*TIME 0.7115021
*TIME 0.8538025
*TIME 0.9961029
*TIME 1.1384033
*STOP

597
Appendix P: Sample Input File with Asphaltene for GPAS

In this appendix, a sample input file that was used in Chapter 6 for compositional
simulation of asphaltene precipitation in GPAS is given. This input file can be run to
study the effects of considering the precipitation of asphaltenes in porous media.

TITLE(2)="1-D OIL CORE-FLOOD FOR ASPHALTENE"

DESCRIPTION()=
"THICKNESS (FT) : 0.0668740814"
"LENGTH (FT) : 0.196850394"
"WIDTH (FT) : 0.0668740814"
"GRID BLOCKS : 30x1x1"

COMPOSITIONAL_MODEL
$DEBUGS

TIMEEND = 2.0

$ I/O OPTIONS

OUTLEVEL = 1
$SPLINEOUT
$GEOMOUT
PROCOUT
OUTPUT_PRE
$OUTPUT_NPH
OUTPUT_SAT
OUTPUT_OIL
OUTPUT_GAS
$OUTPUT_DEN
OUTPUT_WEL
OUTPUT_HIS
WELLFILE = "WEL"

HISDATA_NUM = 100
OUTPUT_TIME() = 0.01 0.1423004 0.2846008 0.4269012 0.5692017 0.7115021
0.8538025 0.9961029 1.1384033

$OUTPUT FREQUENCY
ISTEP(,,)=1
JSTEP(,,)=1
KSTEP(,,)=1

598
$ FAULT BLOCK AND MESH DATA
METHOD = 2
DOWN() = 0 0 1
MES = "cart"
NX(1) = 30 NY(1) = 1 NZ(1) = 1
DX() = 0.0065616798 DY() = 0.0668740814 DZ() = 0.0668740814

$ COMPOUND NAMES
COMPOUND(1) = "N2-C1" COMPOUND(2) = "CO2"
COMPOUND(3) = "C2-C3" COMPOUND(4) = "IC4-NC5"
COMPOUND(5) = "C6-C9" COMPOUND(6) = "C10-C19"
COMPOUND(7) = "C20-C29" COMPOUND(8) = "C30+"

$ COMPOUND CRITICAL TEMPERATURES


CRIT()= 3.2403730E+02 5.4756000E+02 6.3039415E+02 7.9606055E+02
1.0672390E+03 1.3148906E+03 1.5577558E+03 1.8594628E+03

$ COMPOUND CRITICAL PRESSURES


CRIP()= 6.4075082E+02 1.0698652E+03 6.4773794E+02 5.1973263E+02
4.0561090E+02 2.7460463E+02 1.9115995E+02 1.2826892E+02

$ COMPOUND CRITICAL VOLUMES


CRIV()= 1.5614985E+00 1.5057353E+00 2.9426393E+00 4.4612467E+00
7.3279776E+00 1.2273928E+01 1.8800206E+01 2.7684640E+01

$ COMPOUND ACEN
ACEN()= 1.3044585E-02 2.2500000E-01 1.3402370E-01 2.1288126E-01
3.3029816E-01 5.6896138E-01 8.8620979E-01 1.2553771E+00

$ COMPOUND MOL WEIGHTS


MOLW()= 1.7929990E+01 4.4010000E+01 3.9447922E+01 6.4552350E+01
1.2449059E+02 2.1780834E+02 3.6417593E+02 6.2253772E+02

$ COMPOUND PARA
PARA()= 7.1324842E+01 7.8000000E+01 1.3604607E+02 2.0666813E+02
3.3739601E+02 6.0401815E+02 1.0222112E+03 1.7603878E+03

$ BINARY INTERACTION COEFFICIENTS


BINC(,) = 0.0000000E+00 1.3000000E-01 7.7626974E-03 2.1094499E-02
4.4931584E-02 7.7883596E-02 1.1049057E-01 1.5119478E-01
1.3000000E-01 0.0000000E+00 1.3500000E-01 1.2500000E-01
1.0145797E-01 1.0145797E-01 1.0145797E-01 1.1335281E-01
7.7626974E-03 1.3500000E-01 0.0000000E+00 3.3585930E-03
1.5995421E-02 3.8529427E-02 6.3718053E-02 9.6119808E-02
2.1094499E-02 1.2500000E-01 3.3585930E-03 0.0000000E+00
4.7720063E-03 1.9626948E-02 3.9069383E-02 6.5301288E-02
4.4931584E-02 1.0145797E-01 1.5995421E-02 4.7720063E-03
0.0000000E+00 5.1530605E-03 1.7043088E-02 3.5417798E-02
7.7883596E-02 1.0145797E-01 3.8529427E-02 1.9626948E-02
5.1530605E-03 0.0000000E+00 3.5259694E-03 1.3481648E-02
1.1049057E-01 1.0145797E-01 6.3718053E-02 3.9069383E-02
1.7043088E-02 3.5259694E-03 0.0000000E+00 3.0753090E-03

599
1.5119478E-01 1.1335281E-01 9.6119808E-02 6.5301288E-02
3.5417798E-02 1.3481648E-02 3.0753090E-03 0.0000000E+00

$ MAX NUMBER OF PHASES


NPHASE = 3

$ MAX NUMBER OF NEWTON ITERATION


MAXNEWT = 100

$ Initial rock & water properties


ROCKZ = 0.000005 ROCKP = 14.7
H2OZ = 2.99922E-006 H2OP = 14.6959 H2OD = 3.467
SURTF = 122.0 SURPS = 145.037738007
RESTF = 122.0

$ ASPHALTENE PRECIPITATION MODEL


ASPHALTENE
RFACTMAX = 5.0
WASMAX = 0.0005
ROCKMDEN = 165.4341
FASS = -22.51768239
PSTAR = 7251.886886510
VBS = 14.4166146774301

$ TOLERANCE
CVGOPT = 2
TOL_FLASH = 0.0001
TOL_VOLUME = 0.0001
TOL_MASS = 0.0001
TOL_WATER = 0.0001

$ POROSITY
POROSITY1() = 0.247

$ PERMEABILITIES
XPERM1() = 29.0
YPERM1() = 29.0
ZPERM1() = 29.0
XYPERM1() = 0
XZPERM1() = 0
YZPERM1() = 0

$ INITIAL WATER SATURATION


SWINI1() = 0.0000001

$ INITIAL WATER CELL PRESSURE


PINI1() = 145.037738007

$ INITIAL PHASE VISCOSITIES AT EACH CELL


VIS1() = 1.0

$ INITIAL COMPOSITIONS
ZXY1(,,,1) = .0000321

600
ZXY1(,,,2) = .0000409
ZXY1(,,,3) = .0175432
ZXY1(,,,4) = .1114261
ZXY1(,,,5) = .3627861
ZXY1(,,,6) = .3516170
ZXY1(,,,7) = .1154219
ZXY1(,,,8) = .0411327

$ RELPERM DATA
RELP 1
MODREL(1) = 3

KOSW(1) Block $ OIL RELATIVE PERMEABILITY VS Sw - ROCK TYPE 1


Interpolation Linear
Extrapolation Constant
Data
0.2000 1.0000
0.2899 0.6769
0.3778 0.4153
0.4667 0.2178
0.5556 0.0835
0.6444 0.0123
0.7000 0.0000
0.7333 0.0000
0.8222 0.0000
0.9111 0.0000
1.0000 0.0000
EndBlock

KWSW(1) Block $ WATER RELATIVE PERMEABILITY VS Sw - ROCK TYPE 1


Interpolation Linear
Extrapolation Constant
Data
0.2 0
0.2899 0.0022
0.3778 0.0180
0.4667 0.0607
0.5556 0.1438
0.6444 0.2809
0.7000 0.4089
0.7333 0.4855
0.8222 0.7709
0.9111 1.0000
1.00 1.0000
EndBlock

KOSG(1) Block $ OIL RELATIVE PERMEABILITY VS Sg - ROCK TYPE 1


Interpolation Linear
Extrapolation Constant
Data
0.0000 1.0000
0.0500 0.8800
0.0889 0.7023

601
0.1778 0.4705
0.2667 0.2963
0.3556 0.1715
0.4444 0.0878
0.5333 0.0370
0.6222 0.0110
0.6500 0.0000
0.7111 0.0000
0.8000 0.0000
EndBlock

KGSG(1) Block $ GAS RELATIVE PERMEABILITY VS Sg - ROCK TYPE 1


Interpolation Linear
Extrapolation Constant
Data
0.0000 0.00000
0.0500 0.00000
0.0889 0.00100
0.1778 0.01000
0.2667 0.03000
0.3556 0.05000
0.4444 0.10000
0.5333 0.20000
0.6222 0.35000
0.6500 0.39000
0.7111 0.56000
0.8000 1.00000
EndBlock

$ ======================== WELL SPECIFICATIONS=========================

NUMWELL = 2

$ --- The first well ---


WELLNAME(1) = "INJECTOR 1"
KINDWELL(1) = 2
WELLTOP(1 TO 3,1,1) = 0.0032808399 0.0334370407 0
WELLBOTTOM(1 TO 3,1,1) = 0.0032808399 0.0334370407 0.0668740814
DIAMETER(1,1) = 0.656167979
WELLPQ(1) Block
Interpolation Linear
Extrapolation Constant
Data 0. 0.0015096
EndBlock

$ --- The 2nd well ---


WELLNAME(2) = "PRODUCER 1"
KINDWELL(2) = 3
WELLTOP(1 TO 3,1,2) = 0.1935695541 0.0334370407 0
WELLBOTTOM(1 TO 3,1,2) = 0.1935695541 0.0334370407 0.0668740814
DIAMETER(1,2) = 0.656167979
WELLPQ(2) Block
Interpolation Linear

602
Extrapolation Constant
Data 0. 145.037738007
EndBlock

EndInitial

$ TRANSIENT DATA INPUT BLOCKS


BeginTime 0.0
TIME_CONTROL = 1
DELTIM = 0.01 DTIMMUL = 1.0 DTIMMAX = 0.025 DTIMMIN = 0.001
TUNE = 0.5 DCMAX = 0.5 DAQCMAX = 0.5 DPMAX = 0.5 DSMAX = 0.5
WZ() 0.0000321 0.0000409 0.0175432 0.1114261 0.3627861 0.3516170
0.1154219 0.0411327 0.0
EndTime

603
Nomenclature

A gridblock cross-sectional area, L2


bi EOS b parameter for component i
C sf
2
volumetric concentration of s 2 per volume of oil
Cs1 ,o concentration of suspended s1 in oil phase, mol/L3
Cs2 ,o concentration of suspended s 2 in oil phase, mol/L3
cf compressibility of formation, Lt2/m
D, d depth, L
Dik total dispersion coefficient for i th component in phase k, L2/t
f s*1 reference solid fugacity at P * , m/Lt2
fij fugacity of component i in phase j, m/Lt2
fig fugacity of component i in gas phase, m/Lt2
fio fugacity of component i in oil phase, m/Lt2
f nco fugacity of asphaltene component in oil phase, m/Lt2
fs1 fugacity of asphaltene component in solid s1 phase, m/Lt2
G Gibbs free energy, mL2/t2
g gravity acceleration, L/t2
Hi Henrys constant for i th component
J Jacobian matrix
J i, j Jacobian element for ith gridblock wrt to unknowns of jth gridblock
Ki equilibrium ratio of i th component
uur
uur
K ij dispersion tensor of i th component in phase j, L2
K ig gas-oil equilibrium ratio of i th component
K n cs solid-oil equilibrium ratio for component n c
k absolute or instantaneous permeability, L2
ko original permeability before asphaltene precipitation, L2
rr
k absolute permeability tensor
k 12 forward rate of formation of solid s 2 from solid s1 , t-1
k 21 reverse rate of formation of solid s1 from solid s 2 , t-1
k ij binary interaction coefficient between components i and j

604
k rj relative permeability of phase j
o
k rj relative permeability endpoint for phase j
k rjb relative permeability of phase j in the two-phase jb
kx absolute permeability in x direction, L2
ky absolute permeability in y direction, L2
kz absolute permeability in z direction, L2
Lj ratio of moles in jth phase to total number of moles in mixture
Lg mole fraction of gas phase
Ls mole fraction of solid phase
l length of gridblock, L
Mi molecular weight of ith component
Ms molecular weight of asphaltene component
Ni moles of i th component per gridblock volume, mol/L3
Ni moles of i th component per pore volume (GPAS), mol/L3
r
Ni flux vector of ith species in units of mass of i per surface area-time
N ij moles of component i in phase j per pore volume, mol/L3
No moles of oil phase per gridblock volume, mol/L3
N s2 moles of suspended solid phase, s 2 , per gridblock volume, mol/L3
N s1 moles of suspended solid phase, s1 , per gridblock volume, mol/L3
NT total number of moles in hydrocarbon phases per PV, mol/L3
N Tl trapping number for phase l
Nw moles of water per gridblock volume, mol/L3
nb total number of gridblocks
nc number of hydrocarbon components or index for asphaltene
nj relative permeability exponent of jth phase
np total number of phases
Pci critical pressure for a pure component i, m/Lt2
Po reference pressure, m/Lt2
P* pressure at which the asphaltene just starts to precipitate, m/Lt2
Pc capillary pressure, m/Lt2
Pcgo gas-oil capillary pressure, m/Lt2
Pj pressure of phase j, m/Lt2
Pwf flowing bottomhole pressure, m/Lt2

605
PI j productivity index for phase j
PI t total productivity index
p pressure, Lt2/m
Qj well volumetric flow rate for phase j, L3/t
Qt total well volumetric flow rate, L3/t
qi molar injection (+) or production rate (-) for component i, mol/t
R gas constant
r
R residual vector
r
Ri residual vector for ith gridblock
R er residual of solid-oil equilibrium ratio equation
R fe residual of multiphase flash equation
R fs residual of solid-oil fugacity equation for n c th component
R if residual of gas-oil fugacity equation for ith component
R im residual of mass conservation equation for i th component
Rv residual of volume constraint equation
Rw residual of water mass conservation equation
Rf permeability resistance factor
R f,max maximum permeability resistance factor
Ri mass rate of production in units of mass of i per bulk volume-time
r reaction rate for formation of solid s 2 , mol/L3t
r(v) residual of the Rachford-Rice equation
ro equivalent well gridblock radius, L
rw well radius, L
Sj saturation of jth phase
S jr residual saturation of phase j
Sj normalized phase saturation
s1 solid phase which is in equilibrium with oil and gas phases
s2 solid phase created from solid s1 via a chemical reaction
si dimensionless volume shift parameter for i th component
T reservoir temperature
Tci critical temperature for a pure component i
Tk transmissibility of phase k
Tri reduced temperature

606
Tw transmissibility of the water phase
t time, t
r
uj superficial velocity or flux of phase j, L/t
uo oil phase Darcy velocity, L/t
V gridblock volume, L3
Vb bulk volume of a cell, L3
Vp pore volume of a cell, L3
Vci critical volume of a pure component i, L3/mol
Vsd
2
volume of deposited solid s 2 per gridblock volume
v mole fraction of gas in absence of water
vj molar volume of phase j, L3/mol
vs1 solid molar volume, L3/mol
va molar volume of asphaltene, L3/mol
vj molar volume of phase j with volume shift, L3/mol
vcr,o critical oil phase interstitial velocity, L/t
vo oil phase interstitial velocity, L/t
Wi overall concentration of i th component, m/ L3
w as mass of adsorbed asphaltene per mass of rock
w as,max max. mass fraction of asphaltene that can precipitate from oil
r
x solution vector
r
xi solution vector for ith gridblock
xi mole fractions of i th component in oil phase
xij mole fraction of component i in phase j
x is mole fraction of component i in solid phase
x gridblock size in x direction, L
yi mole fractions of i th component in gas phase
yik mole fraction of i th component in phase k
yio mole fraction of i th component in oil phase
yig mole fraction of i th component in gas phase
yis1 mole fraction of i th component in suspended solid s1
yis2 mole fraction of i th component in suspended solid s 2
y gridblock size in y direction, L
Z compressibility factor

607
z elevation, L
zb bottom layer number
zi global mole fraction of i th component in feed
zt top layer number
z gridblock size in z direction, L

Greek Symbols

surface deposition rate coefficient, t-1


entrainment rate coefficient, L-1
difference operator
j flow potential of phase j, m/Lt2
rock porosity
r porosity at reference pressure
o initial porosity before asphaltene precipitation
ij fugacity coefficient of component i in phase j
pore throat plugging rate coefficient, L-1
i instantaneous pore-throat plugging rate coefficient, L-1
j specific gravity of jth phase, m/L2t
k gradient of phase k, m/L2t2
inj specific weight of injected fluid at well pressure, m/L2t2
j mobility for phase j, L3/mt3
rj relative mobility for phase j
)
i low-pressure pure-component viscosity, mt3/L
*j low-pressure viscosity, mt3/L
i chemical potential of component i
j viscosity of jth phase, mt3/L
j mass density of jth phase, m/L3
R mass density of rock, m/L3
snowball-effect deposition constant
jl interfacial tension between two hydrocarbon phases, m/t2
j trapping number model parameter of jth phase
i acentric factor of component i

608
j molar density of phase j, mol/L3
jr reduced molar density of phase j, mol/L3
i parachor of component i
ur
divergence operator
ur
gradient operator

Superscripts

n old time level


n +1 new time level
new after update by Newton iteration
old before update by Newton iteration

Subscripts

a asphaltene
b bulk
c critical
g gas
i index for component
j index for phase
k index for component or phase
o oil
p pore
R rock
s solid
t total
w water
x x direction
y y direction
x z direction

609
References

Ali, M.A. and Islam, M.R.: "The Effect of Asphaltene Precipitation on Carbonate Rock
Permeability: An Experimental and Numerical Approach," paper SPE 38856
presented at the 1997 SPE.
Al-Maamari, R.S.H. and Buckley, J.S.: "Asphaltene Precipitation and Alteration of
Wetting: Can Wettability Change during Oil Production?," paper SPE 59292
presented at the 2000 SPE/DOE Improved Oil Recovery Symposium, Tulsa,
Oklahoma, 3-5 April 2000.
Amroun, H. and Tiab, D.: "Alteration of Wettability Due to Asphaltene Deposition in
Rhourd-Npuss Sud Est Field, Algeria," paper SPE 71060 presented at the Rocky
Mountain Petroleum Technology Conference, Keystone, Colorado, 21-23 May 2001.
Avila, A., Russo, E., Flores, E., and Hidalgo, O.: "A Field Methodology to Estimate the
Zone of Maximum Probability of Asphaltene Precipitation Occurrence," paper SPE
69531 presented at the SPE Latin American and Caribbeen Petroleum Engineering
Conference, Buenos Aires, Argentina, 25-28 March 2001.
Buckley, J.S.: "Asphaltene Precipitation and Crude Oil Wetting," SPE Adv. Tech. Series,
Vol. 3, No. 1 (1995), 53-59.
Burke, N.E., Hobbs, R.E. and Kashou, S.F.: "Measurement and Modeling of Asphaltene
Precipitation," J. Pet. Tech. (Nov. 1990) 42, 1440-1446.
Chang, Y.B.: "Development and Application of an Equation of State Compositional
Simulator," Ph.D. dissertation, The University of Texas at Austin, 1990.

610
Chang, Y.B., Pope, G.A., and Sepehrnoori, K.: "A Higher-Order Finite-Difference
Compositional Simulator," Journal of Petroleum Science and Engineering, 5 (1990),
35-50.
Chung, T.: "Thermodynamic Modeling for Organic Solid Precipitation," paper SPE
24851 presented at the SPE Annual Technical Conference and Exhibition,
Washington, DC, 4-7 October 1992.
Cimino, R., Correra, S. and Sacomani, P.A.: "Thermodynamic Modelling for Prediction
of Asphaltene Deposition in Live Oil," paper SPE 28993, presented at 1995 SPE
International Symposium on Oilfield Chemistry, San Antonio, TX, 14-17 February
1995, 499-512.
Collins, D.A., Nghiem, L.X., Li. Y.K., and Grabenstetter, J.E.: "Implicit Compositional
Simulation With an Equation of State," SPE Res. Eng. J. (May 1992), 259-264.
Crocker, M.E. and Marchin, L.M.: "Wettability and Adsorption Characteristics of Crude
Oil Asphaltene and Polar Fractions," paper SPE/DOE 14885 presented at the
SPE/DOE Fifth Symposium on Enhanced Oil Recovery, Tulsa, OK, April 20-23
1986.
Danesh, A.: Text Book PVT and Phase Behaviour of Petroleum Reservoir Fluids,

Elsevier Science B.V., Amsterdam, The Netherlands, 1998.


Dubey, S.T. and Waxman, M.H.: "Asphaltene Adsorption and Desorption from Mineral
Surfaces," paper SPE 18462, 1991.
Ghanei, M., Edalat, M., Vaziri, H.H., and Islam, M.R.: "The Non-Regular Solubility
Parameter Term for Predicting Onset and Amount of Asphaltene Precipitation," paper
SPE 67329, presented at the SPE Production and Operations Symposium, Oklahoma
City, Oklahoma, 24-27 March 2001.

611
Gharrouch, A.A. and Al-Ruhaimani, F.A.: "Modeling Permeability Reduction Caused by
Asphaltene Deposition," paper SPE 96697, presented at the 2005 SPE Annual
Technical Conference and Exhibition, Dallas, TX, U.S.A., 9-12 October 2005.
Gharrouch, A.A. and Al-Ruhaimani, F.A.: "Predicting Asphaltene Deposition and
Assessing Formation Damage," paper SPE 82258, presented at the SPE European
Formation Damage Conference, The Hague, The Netherlands, 13-14 May 2003.
Gholoum, E.F., Oskui, G.P., and Salman, M.: "Investigation of Asphaltene Precipitation
Onset Conditions for Kuwaiti Reservoirs," paper SPE 81571, presented at the SPE
13th Middle East Oil Show & Conference, Bahrain, 5-8 April 2003.

Han, C., Delshad, M., Pope, G.A., and Sepehrnoori, K.: "Coupling EOS Compositioanl
and Surfactant Models in a Fully Implicit Parallel Reservoir Simulator Using EACN
Concept," paper SPE 103194 presented at the 2006 SPE Annual Technical
Conference and Exhibition, San Antonio, TX, U.S.A., 24-27 September 2006.
Han, C., Delshad, M., Sepehrnoori, K., and Pope, G.A.: "A Fully Implicit, Parallel,
Compositional Chemical Flooding Simulator," paper SPE 97217 presented at the
2005 SPE Annual Technical Conference and Exhibition, Dallas, TX, U.S.A., 9-12
October 2005.
Hirschberg, A., deJong, L.N.J., Schipper, B.A. and Meijer, J.G.: "Influence of
Temperature and Pressure on Asphaltene Flocculation," paper SPE 11202, June 1984.
Hongqi, L. and Wan, W.K.: "Investigation of the Asphaltene Precipitation Process from
Cold Lake Bitumen by Confocal Scanning Laser Microscopy," paper SPE 30321,
presented at the International Heavy Oil Symposium, Calgary, Canada, 19-21 June,
1995, 709-712.
Iwere, F.O., Apaydin, O.G., Moreno, J.E., Ventura, R.L., and Garcia, J.L.: "Simulation of
Asphaltene Precipitation in Fractured Reservoirs: A Case Study," paper SPE 74373

612
presented at the SPE International Petroleum Conference and Exhibition,
Villahermosa, Mexico, 10-12 February 2002.
Jacobs, I.C. and Throne, M.A.: "Asphaltene Precipitation During Acid Stimulation
Treatments," paper SPE 14823, presented at the Seventh SPE Symposium on
Formation Damage Control, Lafayette, LA, February 26-27 1986.
Jamaluddin, A.K.M.: "A Proactive Approach to Address Solids (Wax and Asphaltene)
Precipitation During Hydrocarbon Production," paper SPE 49465 presented at the 8th

Abu Dhabi International Pet. Exhibition and Conf., Abu Dhabi, U.A.E., 11-14
October 1998.
Jamaluddin, A.K.M., Nighswander, J.N., Kohse, B.F., El Mahdi, A., Binbrek, M.A. and
Hogg, P.F.: "Experimental and Theoretical Assessment of the Asphaltene
Precipitation Characteristics of the Sahil Field Under a Proposed Miscible Gas
Injection Scheme," paper SPE 87292 presented at the 9th Abu Dhabi International Pet.

Exhibition and Conf., Abu Dhabi, U.A.E., 15-18 October 2000.


John, A., Han, C., Delshad, M., Pope, G.A., and Sepehrnoori, K.: "A New Generation
Chemical Flooding Simulator," paper SPE 89436, presented at the 2004 SPE/DOE
Fourteenth Symposium on Improved Oil Recovery, Tulsa, Oklahoma, 17-21 April
2004.
Kamath, V.A., Yang, J. and Sharma, G.D.: "Effect of Asphaltene Deposition on Dynamic
Displacement of Oil by Water," paper SPE 26046, presented at 1993 Proc. SPE
Western Regional Meeting, Anchorage, Alaska, May 26-28, 179-187.
Kocabas, I.: "Characterization of Asphaltene Precipitation Effect on Reducing Carbonate
Rock Permeability," paper SPE 81572, presented at the SPE 13th Middle East Oil

Show & Conference, Bahrain, 5-8 April 2003.

613
Kohse, B.F. and Nghiem, L.X.: Modelling Asphaltene Precipitation and Deposition in a
Compositional Reservoir Simulator," paper SPE 89437, presented at the 2004
SPE/DOE Fourteenth Symposium on Improved Oil Recovery, Tulsa, Oklahoma,
U.S.A., 17-21 April 2004.
Kohse, B.F., Nghiem, L.X., Maeda, H., and Ohno, K.: Modelling Phase Behaviour
Including the Effect of Pressure and Temperature on Asphaltene Precipitation," paper
SPE 64465, presented at the SPE Asia Pacific Oil and Gas Conf. and Exhibition,
Brisbane, Australia, 16-18 October 2000.
Kokal, S., Al-Dokhi, M., and Al-Zubail, M.: "Asphaltene Precipitation in a Saturated
Gas-Cap Reservoir," paper SPE 89967 presented at the SPE Annual Technical
Conference and Exhibition, Houston, USA, 26-29 September 2004.
Kokal, S., Al-Ghamdi, A., and Krinis, D.: "Asphaltene Precipitation in High Gas-Oil
Ratio Wells," paper SPE 81567 presented at the SPE 13th Middle East Oil Show and

Conference, Bahrain, 5-8 April 2003.


Kokal, S. and Al-Juraid, J.: "Reducing Emulsion Problems By Controlling Asphaltene
Solubility and Precipitation," paper SPE 48995 presented at the 1998 SPE Annual
Technical Conference and Exhibition, New Orleans, Louisiana, 27-30 September
1998.
Kokal, S., Dawood, N., Fontanilla J., Al-Ghamdi, A., Nasr-El-Din, H., and Al-Rufaie, Y.:
"Productivity Decline in Oil Wells Related to Asphaltene Precipitation and Emulsion
Blocks," paper SPE 77767 presented at the SPE Annual Technical Conference and
Exhibition, San Antonio, TX, 29 September 2 October 2002.
Lake, L.W.: Text Book Enhanced Oil Recovery, Prentice-Hall, Englewood Cliffs, New

Jersey (1989).

614
Leontaritis, K.J., Amaefule, J.O., and Charles, R.E.: "A Systematic Approach for the
Prevention and Treatment of Formation Damage Caused by Asphaltene Deposition,"
SPE Prod. & Facilities J. (August 1994), 157-164.
Leontaritis, K.J.: "Asphaltene Deposition: A Comprehensive Description of Problem
Manifestations and Modeling Approaches," paper SPE 18892 presented at the
Production Operations Symposium, Oklahoma City, Oklahoma, 13-14 March 1989.
Li, M., Guo, P. and Li, S.: "Modeling Technique of Asphaltene Precipitation," paper SPE
70048 presented at the SPE Permian Basin Oil and Gas Recovery Conference,
Midland, TX, 15-16 May 2001.
MacMillan, D.J., Tackett, J.E., Jessee, M.A., and Monger-McClure, T.G.: "A Unified
Approach to Asphaltene Precipitation: Laboratory Measurement and Modeling," JPT
(September 1995), 788-793.
Marques, L.C.C., Gonzalez, G., and Monteiro, J.B.: "A Chemical Approach to Prevent
Asphaltenes Flocculation in Light Crude Oils: State-of-the-art," paper SPE 91019
presented at the SPE Annual Technical Conference and Exhibition, Houston, TX,
U.S.A., 26-29 September 2004.
Minssieux, L.: "Core Damage From Asphaltene Deposition," paper SPE 37250 presented
at the International Symposium on Oilfield Chemistry, Houston, TX, 18-21 February
1997.
Naimi-Tajdar, R., Han, C., Sepehrnoori, K., Arbogast, T.J., and Miller, M.A.: "A Fully
Implicit, Compositional, Parallel Simulator for IOR Processes in Fractured
Reservoirs," paper SPE 100079 presented at the 2006 SPE/DOE Symposium on
Improved Oil Recovery, Tulsa, Oklahoma, U.S.A., 22-26 April 2006.
Nikookar, M., Pazuki, G.H., and Masoudi, R.: "A New Approach in Modeling
Asphaltene Precipitation in Heavy Oil," paper SPE/PS-CIM/CHOA 97939 presented

615
at the 2005 SPE International Thermal Operations and Heavy Oil Symposium,
Calgary, Alberta, Canada, 1-3 November 2005.
Nghiem, L.X.: "A New Approach to Quasi-Newton Methods With Application to
Compositional Modeling," paper SPE 12242 presented at the Reservoir Simulation
Symposium, San Francisco, CA, 15-18 November 1983.
Nghiem, L.X., Aziz, K. and Li, Y.K.: "A Robust Iterative Method for Flash Calculations
Using the Soave-Redlich-Kwong or the Peng-Robinson Equation of State," Soc. Pet.
Eng. J. (June 1983), 521-530.
Nghiem, L.X.: "An Integral Approach for Discretizing the Reservoir Flow Equations,"
SPE Res. Eng. J. (May 1988), 685-690.
Nghiem, L.X., Kohse, B.F., Farouq-Ali, S.M., and Doan, Q.: "Asphaltene Precipitation:
Phase Behaviour Modelling and Compositional Simulation," paper SPE 59432,
presented at the 2000 SPE Asia Pacific Conf. on Integrated Modelling for Asset
Management, Yokohama, Japan, 25-26 April 2000.
Nghiem, L.X., Hassam, M.S., and Nutakki, R.: "Efficient Modelling of Asphaltene
Precipitation," paper SPE 26642, presented at 1993 SPE Annual Tech. Conf. and
Exhibition, Houston, TX, October 3-6, 375-384.
Nghiem, L.X., Fong, D.K., and Aziz, K.: "Compositional Modeling With an Equation of
State," Soc. Pet. Eng. J. (December 1981), 687-698.
Nghiem, L.X.: "Compositional Simulation of Asphaltene Deposition and Plugging,"
paper SPE 48996, presented at the 1998 SPE Annual Technical Conference and
Exhibition, New Orleans, Louisiana, 27-30 September 1998.
Nghiem, L.X., Sammon, P.H., and Kohse, B.F.: "Modelling Asphaltene Precipitation and
Dispersive Mixing in the Vapex Process," paper SPE 66361, presented at the SPE
Reservoir Simulation Symposium, Houston, TX, 11-14 February 2001.

616
Nghiem, L.X., and Dennis, A.: "Modelling Asphaltene Precipitation During Primary
Depletion," paper SPE 36106, presented at IV Latin American/Caribbean Pet. Eng.
Conf., Trinidad and Tobago, 23-26 April 1996, 321-334.
Nor-Azlan, N. and Adewumi, M.A.: "Development of Asphaltene Phase Equilibrium
Predictive Model," paper SPE 26905, presented at the 1993 Eastern Regional
Conference and Exhibition, Pittsburgh, PA, 2-4 November 1993, 159-171.
Ohen, H.A., Moreno T., Marcano, D., Acosta, A., Mengual, R., Gil, J., Velasquez, A.,
Daneshjou, D., Leontaritis, K., and Holmgren, M.: "Systematic Formation Damage
Evaluation of El Furrial Field," paper SPE 54722 presented at the 1999 SPE
European Formation Damage Conference, The Hague, The Netherlands, 31 May - 1
June 1999.
Omidkhah, M.R., Nikookar M., Pazuki, G.R., Sahranavard, L., and Emadi, M.A.:
"Calculation of Phase Behavior of Asphaltene Precipitation by Using a New EOS,"
paper SPE 101920 presented at the 2006 Abu Dhabi International Petroleum
Exhibition and Conference, Abu Dhabi, U.A.E., 5-8 November 2006.
Pan, H. and Firoozabadi, A.: "Thermodynamic Micellization Model for Asphaltene
Aggregation and Precipitation in Petroleum Fluids," SPE Production & Facilities
(May 1998), 118-127.
Parashar, M., Wheeler, J.A., Pope, G., Wang, K., and Wang, P.: "A New Generation EOS
Compositional Reservoir Simulator: Part II Framework and Multiprocessing," paper
SPE 37977, presented at the 1997 SPE Reservoir Simulation Symposium., Dallas,
TX, 8-11 June 1997.
Perschke, D.R.: "Equation of State Phase Behavior Modeling for Compositional
Simulation," Ph.D. Dissertation, The University of Texas at Austin, December 1988.

617
Piro, G., Canonico, L.B., Galbariggi, G., Bertero, L., and Carniani, C.: "Experimental
Study on Asphaltene Adsorption onto Formation Rock: An Approach to Asphaltene
formation Damage Prevention," paper SPE 30109, presented at 1995 Proc. European
Formation Damage Conf., The Hague, The Netherlands, 13-15 May, 317-330.
Qin, X.: "Modeling Asphaltene Precipitation and Implementation of Group Contribution
Equation of State into UTCOMP," MS thesis, The University of Texas at Austin,
August 1998.
Qin, X., Wang, P., Sepehrnoori, K., and Pope, G.A.: "Modeling Asphaltene Precipitation
in Reservoir Simulation," Ind. Eng. Chem. Res. 2000, 39, 2644 - 2654.
Shedid, S.A.: "Influences of Asphaltene Deposition on Rock/Fluid Properties of Low
Permeability Carbonate Reservoirs," paper SPE 68229 presented at the Middle East
Oil Show, Bahrain, 17-20 March 2001.
Shrivatsava, V.K., Nghiem, L.X. and Moore, R.G.: "A Novel Approach for Incorporating
Physical Dispersion in Miscible Displacement," paper SPE 77724 presented at the
SPE Annual Technical Conference and Exhibition, San Antonio, TX, 29 September -
2 October 2002.
Takahashi, S., Yoshihisa, H., Takahashi, S., Yazawa, N., and Sarma, H.: "Characteristics
and Impact of Asphaltene Precipitation During CO2 Injection in Sandstone and
Carbonate Cores: An Investigative Analysis Through Laboratory Tests and
Compositional Simulation," paper SPE 84895 presented at the SPE International
Improved Oil Recovery Conference, Kuala Lumpur, Malaysia, 20-21 October 2003.
Takhar, S., Ravenscroft, D.C., and Nicoll, A.: "Prediction of Asphaltene Deposition
During Production Model Description and Experimental Details," paper SPE 30108
presented at the European Formation Damage Conference, The Hague, The
Netherlands, 15-16 May 1995, 311-316.

618
Tejeda, P., Lira-Galeana, C., and Rodriguez, F.: "Analysis of a Thermodynamic
Micellization Model for Asphaltene Precipitation," paper SPE 38968 presented at the
Fifth Latin American and Caribbean Pet. Eng. Conf. and Exhibition, Rio de Janeiro,
Brazil, 30 August - 3 September 1997.
Wang, P., Balay, S., Sepehrnoori, K., Wheeler, J.A., Smith, B., and Pope, G.P.: "A Fully
Implicit Parallel Compositional Simulator for Large Scale Reservoir Simulation,"
paper SPE 51885, presented at the 1999 SPE 15th Reservoir Simulation Symposium,

14-17 February, Houston, TX.


Wang, P., Yotov, I., Wheeler, M., Arbogast, T., Dawson, C., Parashar, M., and
Sepehrnoori, K.: "A New Generation EOS Compositional Reservoir Simulator: Part I
Formulation and Discretization," paper SPE 37979, presented at the 1997 SPE
Reservoir Simulation Symposium, 1997.
Wang, S. and Civan, F.: "Productivity Decline of Vertical and Horizontal Wells by
Asphaltene Deposition in Petroleum Reservoirs," paper SPE 64991, presented at the
2001 SPE International Symposium on Oilfield Chemistry, Houston, TX, 13-16
February 2001.
Zekri, Y.A. and Shedid, S.A.: "The Effect of Fracture Characteristics on Reduction of
Permeability by Asphaltene Precipitation in Carbonate Formation," paper SPE 80542,
presented at the SPE Asia Pacific Oil and Gas Conference and Exhibition, Jakarta,
Indonesia, 15-17 April 2003.

619

Você também pode gostar