You are on page 1of 174

COEFFICIENT OF ISOTHERMAL OIL COMPRESSIBILITY

FOR RESERVOIR FLUIDS BY CUBIC

EQUATION-OF-STATE

by

OLAOLUWA OPEOLUWA ADEPOJU, B.Tech. Chem Engr.

A THESIS

IN

PETROLEUM ENGINEERING

Submitted to the Graduate Faculty


of Texas Tech University in
Partial Fulfillment of
the Requirements for
the Degree of

MASTER OF SCIENCE

IN

PETROLEUM ENGINEERING

Approved

Lloyd Heinze
Chairperson of the Committee

Shameem Siddiqui

Accepted

John Borrelli
Dean of the Graduate School

December, 2006
ACKNOWLEDGEMENTS

I extend my profound gratitude to Dr. Akanni Lawal for inspiring me into phase behavior

and into this research. Special thanks to Dr. Lloyd Heinze, the chair of my Masters committee

and Dr. Shameem Siddiqui for their support.

I would like to acknowledge the African Development Bank for awarding me the 2005-

2006 ADB/Japan Fellowship award.

I extend my profound appreciation to my family for their support and encouragement. I

also acknowledge my colleagues in Texas Tech University for their support.

To God be the glory.

ii
TABLE OF CONTENTS

ACKNOWLEDGEMENTS ii

ABSTRACT v

LIST OF TABLES vi

LIST OF FIGURES viii

LIST OF ABBREVIATIONS x

CHAPTER

1 INTRODUCTION

1.1 Background Information 1

1.2 Importance of isothermal Oil Compressibility 4

1.3 Scope of the Project 9

1.4 Objectives of the Project 9

2 COEFFIECIENT OF ISOTHERMAL OIL COMPRESSIBILITY

2.1 Defining Equations for Isothermal Oil Compressibility 10

2.2 Isothermal Oil Compressibility Correlation and Computation Methods 24

3 DESIGN OF CUBIC EQUATION OF STATE

3.1 Generalized Cubic Equation of State 35

3.2 Characterization of Heavy Petroleum Fractions 43

3.3 Cubic EOS Based Isothermal Compressibility Equation 43

4 ANALYSIS OF PREDICTION RESULTS

4.1 Computing Isothermal Oil Compressibility from Reservoir Fluid Study Report 56

4.2 Predicted Molar Volume from Cubic Equation of State 56

4.3 Predicted Coefficient of Isothermal Oil Compressibility from Cubic

iii
Equation of State 66

4.4 Discussion of Results 74

5 CONCLUSIONS AND RECOMMENDATIONS

5.1 Conclusions 77

5.2 Recommendations 78

REFERENCES 79

APPENDIX

A. DERIVATION OF PR EOS COMPRESSIBILITY FACTOR AND MOLAR


VOLUME EQUATION. 83

B. DERIVATION OF PR EOS BASED ISOTHERMAL COMPRESSIBILITY


EQUATION. 86

C. DERIVATION OF THE PR EOS ISOTHERMAL GAS COMPRESSIBILITY


EQUATION. 88

D. DERIVATION OF THE FLASH CALCULATION ALGORITHM 90

E. MATHEMATICAL CONSISITENCY OF ISOTHERMAL COMPRESSIBILITY


ADDITION BELOW BUBBLE POINT PRESSURE. 94

F. RESERVOIR FLUID STUDY REPORT AND ANALYSIS 97

G. RESERVOIR FLUIDS CRITICAL PROPERTIES TABLE 108

H. AVERAGE ABSOLUTE PERCENT DEVIATION (AAPD) 109

I. FORTRAN CODE DOCUMENTATION 116

J. DEVELOPED FORTRAN CODE 120

K. VITA 162

iv
ABSTRACT

Calculations of reservoir performance for petroleum reservoirs require accurate

knowledge of the volumetric behavior of hydrocarbon mixtures, both liquid and gaseous.

Coefficient of Isothermal oil compressibility is required in transient fluid flow problems,

extension of fluid properties from values at the bubble point pressure to higher pressures of

interest and in material balance calculations38, 35. Coefficient of Isothermal oil compressibility is a

measure of the fractional change in volume as pressure is changed at constant temperature29.

Coefficients of isothermal oil compressibility are usually obtained from reservoir fluid

analysis. Reservoir fluid analysis is an expensive and time consuming operation that is not always

available when the volumetric properties of reservoir fluids are needed. For this reason

correlations have been developed and are being developed for predicting fluid properties

including the coefficient of isothermal oil compressibility.

This project developed a mathematical model for predicting the coefficient of isothermal

oil compressibility based on Peng-Robinson Equation of State (PR EOS). A computer program

was developed to predict the coefficient of isothermal compressibility using the developed model.

The predicted coefficient of isothermal oil compressibility closely matches the experimentally

derived coefficient of isothermal compressibility.

v
LIST OF TABLES

2.1 Coefficients for the co Correlations 34

4.1 Predicted Molar Volume for Oil Well No. 4, Good Oil Company, Samson,
Texas, Bubble Point = 2619.7 psia 57

4.2 Predicted molar volume for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver,
Oklahoma. Bubble Point = 2666.7 psia 60

4.3 Predicted molar volume for Jacques Unit #5603, Rough Ride Field, A.C.T.
Operating Company, Fisher County, Texas. Bubble Point = 1689.7 psia 63

4.4 Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Good Oil Company. Samson, Texas. Bubble Point = 2619.7 psia 66

4.5 Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,


Wilshire Oil Co. of Texas, Beaver, Oklahoma. Bubble Point = 2666.7 psia. 69

4.6 Predicted Coefficient of Isothermal Oil Compressibility for Jacques


Unit #5603, Rough Ride Field, A.C.T. Operating Company, Fisher County,
Texas. Bubble Point = 1689.7 psia 72

F.1 Reservoir Fluid Composition for Oil Well No. 4 98

F.2 Molar Volume Determination from Pressure-Volume Relations for Oil Well
No. 4 99

F.3 Differential Vaporization data for Oil Well No. 4 100

F.4 Reservoir Fluid Composition for Jehlicka 1A 101

F.5 Molar Volume Determination from Pressure-Volume Relations for Jehlicka 1A 102

F.6 Differential Vaporization data for Jehlicka 1A 103

F.7 Reservoir Fluid Composition for Jacques Unit #5603 104

F.8 Molar Volume Determination from Pressure-Volume Relations for Jacques


Unit #5603 105

F.9 Differential Vaporization data for Jacques Unit #5603 106

G.1 Reservoir Fluids Critical Properties 107

vi
H.1 The AAPD for the Predicted Molar Volume for Oil Well No. 4, Good Oil
Company. Samson, Texas 108

H.2 The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility
For Oil Well No. 4, Good Oil Company. Samson, Texas. 109

H.3 The AAPD for the Predicted Molar Volume for Jacques Unit #5603, Rough
Ride Field, A.C.T. Operating Company, Fisher County, Texas. 110

H.4 The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility
for Jacques Unit #5603, Rough Ride Field, A.C.T. Operating Company,
Fisher County, Texas (Using 11 Components). 111

H.5 The AAPD for the Predicted Molar Volume for Jehlicka 1A, Wilshire Oil
Co. of Texas, Beaver, Oklahoma. 112

H.6 The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility
for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver, Oklahoma. 113

H.7 The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility
for Jacques Unit #5603, Rough Ride Field, A.C.T. Operating Company,
Fisher County, Texas (Using 11 Components). 114

vii
LIST OF FIGURES

1.1 Pressure-Volume/Compressibility Relationship 7

2.1 Typical Shape of the Isothermal Gas Compressibility of Gas as a Function


of Pressure at Constant Reservoir Temperature 11

2.2 Standing and Katz compressibility factors chart 15

2.3 Variation of Reduced Compressibility with Reduced Pressures for Various


Fixed values of Reduced Temperature for Natural Gases (0.1< cr <1.0) 18

2.4 Variation of Reduced Compressibility with Reduced Pressures for Various


Fixed values of Reduced Temperature for Natural Gases (0.01< cr < 0.1) 18

2.5 Typical Shape of the Isothermal Oil Compressibility as a Function of


Reservoir Pressure at Constant Temperatures at Pressures above the
Bubble Point Pressure 20

2.6 Typical Shape of the Coefficient of Isothermal Oil Compressibility as a


Function of Pressure at Constant Reservoir Temperature 24

2.7 Trubes Pseudo Reduced Compressibility of Undersaturated Crude Oils 25

2.8 Coefficient of Isothermal Compressibility of Undersaturated Black Oils 27

2.9 Coefficient of Isothermal Compressibility of Saturated Black Oils 29

3.1 Volumetric Behavior of Pure Compounds by Van der Waal Cubic EOS 37

3.2 Reservoir Oil at Pressure above the Bubble Point Pressure 44

3.3 Reservoir Oil at Pressure below the Bubble Point Pressure 47

3.4 Schematic diagram of Flash Liberation Experiment 49

4.1 Predicted Molar Volume for Oil Well No- 4, Good Oil Company. Samson,
Texas (Model Based on PR EOS). 58

4.2 Predicted Molar Volume for Oil Well No- 4, Good Oil Company. Samson,
Texas (Model Based on MPR EOS). 59

4.3 Predicted Molar Volume for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver,
Oklahoma. (Model Based on PR EOS). 61

viii
4.4 Predicted Molar Volume for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver,
Oklahoma. (Model Based on MPR EOS). 62

4.5 Predicted Molar Volume for Jacques Unit #5603, Rough Ride Field, Fisher
County, Texas. (Model Based on PR EOS). 64

4.6 Predicted Molar Volume for Jacques Unit #5603, Rough Ride Field, Fisher
County, Texas. (Model Based on MPR EOS). 65

4.7 Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Good Oil Company. Samson, Texas. (Model Based on PR EOS) 67

4.8 Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Oil Company. Samson, Texas. (Model Based on MPR EOS). 68

4.9 Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,


Wilshire Oil Co. of Texas, Beaver, Oklahoma. (Model Based on PR EOS). 70

4.10 Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,


Wilshire Oil Co. of Texas, Beaver, Oklahoma. (Model Based on MPR EOS) 71

4.11 Predicted Coefficient of Isothermal Oil Compressibility for Jacques


Unit #5603, Rough Ride Field, A.C.T. Operating Company, Fisher
County, Texas. (Model Based on PR EOS). 73

4.12 Predicted Coefficient of Isothermal Oil Compressibility for Jacques


Unit #5603, Rough Ride Field, A.C.T. Operating Company, Fisher
County, Texas. (Model Based on MPR EOS). 74

D.1 Schematic of the Flash Vaporization Process 90

E.1 Schematic Diagram of Volume and Isothermal Compressibility at Pressures


above and below the Bubble Point Pressure. 94

ix
LIST OF ABBREVIATIONS

Symbol Definition

a Attraction Parameter Term of EOS


aP
2 2
A Dimensionless Constant R T
1 Expt Predicted
AAPD Average Absolute Percent Deviation AAPD =
N Exptal
API Oil Gravity
b Van der Waals co-volume
bP
2 2
B Dimensionless Constant R T
Bg Formation Gas Volume Factor
Bo Formation Oil Volume Factor
Bw Formation Water Volume Factor
cf Formation Compressibility
cg Isothermal Gas Compressibility
cL Isothermal Liquid Compressibility
co Isothermal Oil Compressibility
ct Total System Isothermal Compressibility
C Characterization Factor
Ki Equilibrium Ratio
Mw Molecular Weight
p Pressure
ppc Pseudo-Critical Pressure
ppr Pseudo-Reduced Pressure
R Gas Constant
Rs Solution Gas-Oil Ratio
Sg Gas Saturation
So Oil Saturation
Sw Water Saturation
T Absolute Temperature
Tpc Pseudo-Critical Temperature
Tpr Pseudo-Reduced Temperature
V Molar Volume
z Compressibility Factor

Greek Letter

Parameter of LLS EOS


Parameter of LLS EOS

x
ij Binary Interaction Parameter
Specific Gravity
Density
Acentric Factor
[x (a a ) ]
0.5
i Fugacity Parameter i = j i j
j

= [x x (a a ) ]
0.5
Fugacity Parameter i j i j
i j
Dimensionless Parameter

Subscript

c Critical Property
g Gas
o Oil
r Reduced
i Component i

xi
CHAPTER I

INTRODUCTION

1.1.Background Information

The coefficient of isothermal compressibility is defined as the fractional change

of fluid volume per unit change in pressure at constant reservoir temperature1. The

coefficient of isothermal oil compressibility, co, is usually determined from the pressure-

volume measurements of reservoir fluids. These data are usually obtained from reservoir

fluid analysis. A convenient method of estimating the coefficient of isothermal

compressibility for reservoir fluids for a finite change in pressure and volume is to use

this simple equation41.

V1 V2
co = (1.1)
V1 (p 2 p1 )

Normally, an increase in fluid pressure (p2 > p1) causes the fluid volume to

decrease (V1 > V2). Hence the negative sign, to make the value of the isothermal

compressibility positive.

Isothermal compressibility is usually recorded for gas, oil, water and rock. In

order to have the number on the same basis, compressibility is recorded in 10-6 for

convenience. The unit of isothermal compressibility is the reciprocal of psi, psi-1,

sometimes called sip. A value of 10-6 psi-1 is called a microsip.

Equation 1.1 is useful in approximating the isothermal compressibility of single

phase gases and liquids undergoing small pressure changes. This assumption has a

1
definite limitation when the compressibility varies during small pressure changes. It is

further limited over large pressure changes by confusion over whether the denominator

should be V1 or V2, or some value in between41. To overcome this limitation, equation

1.1 is usually expressed in partial differential form at constant temperature, as follows

1 V
co = (1.2)
V p T

Equation 1.2, defines the instantaneous coefficient of isothermal compressibility

of a substance at a point on an isothermal pressure-volume curve for that substance.

Based on equation 1.2, the coefficient of isothermal compressibility is defined as the

fractional change of volume as pressure is changed at constant temperature.

The isothermal oil compressibility is a point function and it can be calculated

from the slope of a pressure versus specific volume curve, or from the differentiation of

an equation of state, or a correlation involving compressibility factor z, density or


26, 10
formation volume factor . There are also a number of correlations that are available

to calculate the isothermal compressibility.

To construct a curve of pressure versus specific volume, the pressure and volume

data required are acquired from laboratory studies on reservoir samples collected from

the bottom of the wellbore and from the surface. Such experimental data are not always

available because of one or more of the following reasons: (i) reservoir samples collected

are not reliable. (ii) samples have not been taken because of cost savings. (iii) PVT

analyses are not available when data are needed. (iv) obtaining an accurate PVT behavior

of each reservoir fluid encountered will be costly and time-consuming. In such cases

2
when the experimental data are not available, PVT properties such as the isothermal oil

compressibility are determined from empirically derived correlations or equation of state.

There has been a lot of work in the last 50 years on the derivation of PVT

correlations. However, each of these correlations is applicable to a good degree of

reliability only in a well-defined range of reservoir fluid characteristics. This is due to the

fact that each correlation has been developed based on fluid samples from a restricted

geographical area, with similar fluid compositions and API gravity16. Some correlations

are also applicable only at a well-defined range of temperature and pressure.

Methods of predicting reservoir properties and performance, particularly those

based on the compositional-material-balance depend on the capability of accurately

expressing reservoir fluid properties as functions of pressure, temperature and

composition10. An equation of state has been defined as an analytical expression relating

the pressure to the volume and temperature. Equation of state (EOS) is used to describe

the volumetric behavior, the vapor/liquid equilibra (VLE) and thermal properties of pure

substances and mixtures3.

The equation of state has to be expressed in the form of the defining equation for

the particular reservoir properties it is describing. For the isothermal compressibility, the

equation of state is expressed in volume and partially differentiated with respect to

pressure at constant temperature. Also, since the evaluation of the isothermal

compressibility involves the derivatives of the volumetric data, the possible deviation in

these quantities is much greater than is encountered with the volumetric data only.

3
Accordingly, if the derived quantities are to be obtained from an equation for volume, it

is essential that the error be reduced to a minimum10.

Since the introduction of the equation of state by Van der Waals, many equation

of state (EOS) having the form of Van der Waals equation have been proposed. Two of

the most common and popularly accepted EOS is the Redlich-Kwong (RK EOS) and

Peng Robinson (PR EOS) EOS. The Redlich-Kwong equation has been the most popular

basis for developing new EOSs. Several modifications of the Redlich-Kwong equation

have found acceptance, with Soaves modification (SRK EOS) being the simplest and the

most widely used. Another trend has been to propose generalized three-, four-, and five

constant cubic equations that can be simplified into the PR EOS, RK EOS and other

familiar forms44, pp 47
. The Lawal-Lake-Siberberg (LLS EOS) EOS is a four parameter

EOS, which can be reduced to both the PR EOS and the RK EOS. The equation of state

used in this study to generate the isothermal compressibility for reservoir fluids are the

PR EOS and modified PR EOS.

1.2 Importance of Isothermal Oil Compressibility

Isothermal compressibility is used in a wide range of calculations involving

production and exploration of hydrocarbon reservoirs. Some of the reservoir

engineering applications for the isothermal compressibility include well testing analysis

and metering18.

Isothermal compressibility is required in all solutions of transient flow problems.

Solutions of pressure buildup and drawdown problems contain a parameter called the

4
total system isothermal compressibility. Calculations of the total system isothermal

compressibility involve the evaluation of the isothermal compressibility coefficient for

reservoir fluids as well as the compressibility of the formation. The total system

isothermal compressibility is expressed as,

c t = c oSo + c w S w + c g Sg + c f (1.3)

ct= Total Isothermal Compressibility, psi-1

co= Coefficient of Isothermal Oil Compressibility, psi-1

cg= Coefficient of Isothermal Gas Compressibility, psi-1

cw= Coefficient of Isothermal Water Compressibility, psi-1

cf= Formation Compressibility, psi-1

So= Oil Saturation, fraction

Sw= Water Saturation, fraction

Sg= Gas Saturation, fraction

The use of accurate total system compressibility in a properly-executed buildup

and drawdown analyses includes35:

o Better planning of pressure build-ups may be achieved to avoid unnecessary


loss of revenue due to excessively long shut-in periods, or to shut-in periods too
short to yield useable data. For example the equation to estimate the time at
which the boundary effect can be felt in a pressure drawdown test is given as:

c t A
t eia = (t DA )eia (1.4)
0.0002637k

teia = Time to end the infinite-acting period, hours

A = Well drainage area, ft2

5
ct = Total Compressibility, psi-1

(tDA)eia = Dimensionless time to the end of the infinite-acting period

k = Permeability, md

= Porosity, fraction

= Viscosity, cp

o Better and more reliable estimates of the static reservoir pressure for reserves
estimate and rate performance estimates.

o Reliable information for evaluation of well completion effectiveness, and


planning and interpretation of well stimulation efforts.

The isothermal compressibility coefficient is also essentially the controlling factor

in identifying the type of reservoir fluid. Reservoir fluids are generally classified into

three groups:

o Incompressible fluids These are fluids whose volume does not change with
pressure i.e. the values of the coefficient of isothermal compressibility for these
fluids are constant. Incompressible fluid does not exist; however, this behavior
may be assumed in some cases to simplify the derivation and the final form of
flow equations.

o Slightly Compressible fluids These slightly compressible fluids exhibit


small changes in volume, or density, with changes in pressure i.e. there is a
slight change in the coefficient of isothermal compressibility with changes in
pressure. Crude oil and formation water are slightly compressible fluids.

o Compressible fluids These fluids experiences a large change in volume as a


function of a change in pressure i.e. the coefficient of isothermal compressibility
changes drastically with a change in pressure5.

6
Incompressible
Volume / Coefficient of
Isothermal Compressibility
Slightly Compressible

Compressible

Pressure

Figure 1.1: Pressure Volume/ Compressibility Relationship5.

Isothermal oil compressibility is also used in the material balance equation for

undersaturated oil reservoirs, i.e. reservoirs that the initial reservoir pressure is greater

than the bubble point pressure. This material balance equation can be used to estimate

the initial reserve and predict future production. The material balance equation for

undersaturated oil reservoir is expressed as:

NB oi c e (p i p ) = N p B o We + B w Wp
(1.5)

So c o + S w c w + c f
ce =
B oi (p i p ) (1.6)

N = Initial Oil in Place, STB

Boi = Initial Oil Formation Volume Factor, bbl/STB

ce= Effective Compressibility, psi-1

pi = Initial Reservoir Pressure, psi

7
p = Reservoir Pressure, psi

Np = Cumulative Oil Produced, STB

Bo = Formation Volume Factor, bbl/STB

Bw = Water Formation Volume Factor, bbl/STB

We = Water Influx, bbl

Wp = Water Produced, STB

The isothermal compressibility is used also for the extension of fluid properties

from correlations starting at the bubble point pressure to pressures above the bubble

point pressure. This application is used for black oil reservoir simulation38. The

coefficient of isothermal compressibility can be used to estimate the formation volume

factor and oil density at higher pressures from their calculated values at bubble point.

This can be shown by the following equations:

B o = B ob e (co (p b p )) (1.7)

o = ob e (co (p p b )) (1.8)

The isothermal compressibility is an important physical property in the design of

high-pressure surface equipments7. Compressibility is important in the design of

process equipment handling liquids at high pressure. The determination of the

isothermal compressibility has specific applications in the transfer of crude oil

containing dissolved gas components from a reservoir to a gas-oil separation plant and

the pipeline transportation of degassed liquids such as crude oils and refined products.

8
Experimental data for the isothermal compressibility of such mixtures are seldom

available11.

1.3 Scope of the Project

The scope of this project is to develop a mathematical model based on two cubic

equations of states (PR EOS and Modified PR EOS) that can predict the isothermal oil

compressibility with a good degree of accuracy at pressures below and above the

bubble point.

1.4 Objectives of the Project

The objective of this project is to design an equation of state based mathematical

model that be used to predict the coefficient of isothermal compressibility for reservoir

fluids. This equation will allow the coefficient of isothermal compressibility to vary

with both pressure and composition.

9
CHAPTER II

COEFFICIENT OF ISOTHERMAL OIL COMPRESSIBILITY

2.1 Defining Equations for Isothermal Oil Compressibility

In petroleum engineering calculations, the coefficient of isothermal

compressibility is required for oil, gas, water and the formation. These coefficients are

usually combined as the total system compressibility. The coefficient of isothermal

compressibility for oil, gas and water is defined as the fractional change in volume per

unit change in pressure at constant temperature.

2.1.1 The Coefficient of Isothermal Compressibility for Reservoir Gases

Fluid compressibility varies with pressure and temperature and the knowledge of

these variations is essential in reservoir engineering calculations. Liquid phase

compressibility is usually small and usually assumed constant. The coefficient of

isothermal compressibility for reservoir liquids tends to be pressure sensitive but not

nearly so much as the reservoir gas41. Therefore the gas phase compressibility is neither

small nor constant.

The isothermal gas compressibility is the change in volume per unit volume for a

unit change in pressure at constant temperature2 p. 106. This is expressed as29 p. 170,

1 V
cg =
V p T
(2.1)

10
1 v
c g =
v p T
(2.2)

1 Vm
cg =
Vm p T (2.3)

cg = Isothermal Gas Compressibility, psi-1

V = Gas Volume, cubic feet or bbl

v = Specific Volume, cubic feet/kg or bbl/lb

Vm = Molar Volume, bbl/lb-mole

The isothermal gas compressibility increases as the reservoir pressure decreases.

The typical relationship of the isothermal gas compressibility with reservoir pressure is

shown in the Figure 2.1.

Isothermal Gas
Compressibility, psi-1

Reservoir Pressure

Figure 2.1 Typical Shape of the Isothermal Gas Compressibility of gas as a function
of pressure at constant reservoir temperature29 p. 170.

11
The partial derivative is used in equation 2.1, 2.2 and 2.3 rather than the ordinary

derivative because the volume varies only with the pressure while the temperature is

held constant.

2.1.1.1 Isothermal Gas Compressibility of an Ideal Gas29 p. 172

Equation of state for ideal gas is usually combined with the equation for the

isothermal gas compressibility to increase its usefulness. The ideal gas equation is

given as:

pV = nRT (2.4)

In terms of volume,

nRT
V=
p (2.5)

Differentiating equation 2.5, with respect to pressure yields,

V nRT
= 2
p T p
(2.6)

Therefore the isothermal gas compressibility equation for ideal gases can be expressed

as;

1 nRT
c g = 2
V p (2.7)

Substituting for V in equation 2.7, yields;

12
p nRT 1
cg = 2 =
nRT p p (2.8)

where

n= Number of Moles, lb-mole

R = Universal Gas Constant, (psi, cu ft)/ (lb mole oR)

T = Temperature, oR

p = Pressure, psi

Equation 2.8 shows that the isothermal gas compressibility for ideal gas is

inversely proportional to pressure. Though the ideal gas equation does not adequately

describe the behavior of gases at the temperatures and pressures normally encountered

in reservoir engineering, equation 2.8 can be used to estimate the order of magnitude of

the isothermal gas compressibility.

2.1.1.2 Isothermal Gas Compressibility of Real Gas29, p. 173

The real gas equation of state is commonly used in petroleum engineering

calculations. The real gas equation can be used to model the isothermal gas

compressibility for real gases. The gas deviation factor or the compressibility factor (z)

varies with pressure, therefore it is considered as a variable.

The real gas equation of state is given as;

pV = znRT (2.9)

13
This real gas equation can be expressed in terms of volume, to yield;

z
V = nRT
p (2.10)

Differentiating equation 2.10 in terms of pressure at constant temperature yields;

V 1 z z
= nRT 2
p T p p T p (2.11)

Substituting equation 2.11 into equation 2.1 yields;

p 1 z z
c g = nRT
2
znRT p p T p
(2.12)

Simplifying equation 2.12 yields;

1 1 z
cg =
p z p T
(2.13)

z
The partial derivative can be determined from the slope of z-factor plotted
p T

against pressure at constant temperature. It can be observed from Figure 2.2 that at low

pressures, the z-factor decreases as pressure increases, causing the slope to be negative

thus making the cg larger than the case of an ideal gas. At high pressures, the z-factor

increases with increasing pressure, therefore the slope of the z-factor chart will be

positive; thus the values of cg will be smaller than the case of an ideal gas.

14
Figure 2.2: Standing and Katz compressibility factors chart. Courtesy of the Gas
Processors Suppliers Association. Published in the GPSA Engineering Data Book,
Tenth Edition, 1987.2 p. 92

15
For an ideal gas, z-factor is a constant with a value of 1.0. Therefore the value of

the partial derivative of z-factor with respect to pressure at constant temperature equal

to zero. Therefore equation 2.13 reduces to equation 2.8.

2.1.1.3 Isothermal Pseudo-reduced Compressibility29 p. 175

The law of corresponding state states that all pure gases have the same z-factor at

the same values of reduced pressure and reduced temperature. The reduced property of

a substance is the value of that property divided by the critical property for the

substance.

The law of corresponding states can be used to express the isothermal gas

compressibility equation in reduced form. The chain rule is used to express the partial

derivative of the z-factor with respect to pressure in reduced form.

z p z
= Pr (2.14)
p T p p Pr

The pseudo-reduced pressure is expressed as;

p = p pc p pr
(2.15)

The derivative of the pseudo-reduced pressure with respect to pressure is

expressed as;

p pr 1
=
p p pc (2.16)

Substituting equation 2.16 into equation 2.14 gives;

16
z 1 z

=
p T p pc p pr
(2.17)

Substituting equation 2.17 and equation 2.15 into equation 2.13 gives;

1 1 z

cg =
p pc p pr zp pc p pr
Tpr
(2.18)

This can be better expressed in dimensionless pseudo-reduced compressibility cpr

as;

1 1 z

c pr = c g p pc =
p pr z p pr
Tpr
(2.19)

Where

cpr = Isothermal Pseudo-reduced Compressibility

ppc = Pseudo-critical pressure, psi

ppr = Pseudo-reduced pressure

Tpr = Pseudo-reduced temperature

Trube41 (1957) presented graphs (Figures 2.3 and 2.4) from which the isothermal

compressibility of natural gases may be obtained. The graphs give the isothermal

pseudo-reduced compressibility as a function of pseudo-reduced temperature and

pressure.

17
Figure 2.3: Variation of reduced compressibility with reduced pressures for various
fixed values of reduced temperature for natural gases. (For cr between 1.0 and 0.1)
Trube41 (1957).

Figure 2.4: Variation of reduced compressibility with reduced pressures for various
fixed values of reduced temperature for natural gases. (For cr between 0.1 and 0.01)
Trube41 (1957)

18
2.1.2 The Coefficient of Isothermal Oil Compressibility29 p. 231

The isothermal oil compressibility is required in the determination of the physical

properties of the undersaturated crude oil. Isothermal oil compressibility is usually

determined from a laboratory reservoir fluid study. At pressures above the bubble point,

the isothermal oil compressibility is defined exactly as the coefficient of isothermal

compressibility of a gas. At pressures below the bubble point, there is the presence of

free gas in the reservoir; therefore an additional term must be added to account for the

volume of gas which evolves.

2.1.2.1 Isothermal Oil Compressibility at Pressures above the Bubble point

The isothermal oil compressibility, co at pressures above the bubble point is

defined as the fractional change in volume of oil as pressure is changed at constant

temperature. The isothermal oil compressibility is expressed as29 p. 231;

1 V
co =
V p T
(2.20)

where

co = Isothermal Oil Compressibility of crude oil, psi-1

The isothermal oil compressibility at pressures above the bubble point is virtually

constant except at pressures near the bubble point. The typical relationship of co with

pressure above the bubble point pressure is shown in Figure 2.5.

19
Isothermal Oil Compressibility, Co psi-1

pb

Reservoir Pressure

Figure 2.5: Typical shape of the isothermal oil compressibility as a function of reservoir
pressure at constant temperature at pressures above the bubblepoint29 p. 232.

Equation 2.20 can be expressed as;

ln V
c o =
p T (2.21)

Formation volume factor, Bo can be substituted directly into equation 2.20 as;

1 B o
co =
Bo p T (2.22)

Equation 2.22 can be integrated as co is assumed to be constant at pressures above

the bubble point.

p Bo
dB o
c o dp =
Bo
pb Bob
(2.23)

These results in;

B o = B ob e [c o (p b p )] (2.24)

20
Equation 2.24 is used to calculate the formation volume factor at pressures above

the bubble point.

The isothermal oil compressibility can also be written in terms of density. The

isothermal oil compressibility in terms of specific volume v is written as;

1 v
c o =
v p T
(2.25)

The density of oil, o is related to the specific volume, v by;

1
v=
o (2.26)

Chain rule can be used to obtain the partial derivative of the specific volume with

respect to pressure at constant temperature.

v v o
=
p T o p T (2.27)

Differentiating equation 2.26 with respect to density yields;

v 1
= 2
o o (2.28)

Substituting equations 2.28, 2.27 and 2.26 into equation 2.25 gives;

1 1 o
c o = 2
1 o o p T (2.29)

Thus,

1 o
co =
o p T (2.30)

21
Assuming constant co at pressures above the bubble point, equation 2.30 can be

integrated to give 29 p. 234;

o = ob e [c o (p p b )] (2.31)

Equation 2.31 can be used to calculate the density of oil at pressures above the

bubble point. The density at the bubble point is the starting point.

2.1.2.2. Isothermal Oil Compressibility at Pressures below the Bubble Point

When reservoir pressure is below the bubble point pressure, there is the presence

of free gas in the reservoir. These types of reservoir are called saturated oil reservoirs.

The total change in volume as pressure is changed must account for the effect of the

solution gas.

The fractional change in volume per unit pressure change at constant temperature

is expressed as:

1 V 1 B o
co = =
V p T Bo p T (2.32)

The oil formation volume factor (Bo) contains the effect of the solution gas (Rs)

on the change in liquid phase volume35. The effect of the change in the solution gas on

the liquid volume as pressure is reduced below the bubble point must be added to

equation 2.32.

The change in the solution gas oil ratio is expressed as:

B g R s

B o p T (2.33)

22
Thus the isothermal oil compressibility at pressures below the bubble point

pressure is expressed as27.

1 B o Bg R s
co = +
Bo p T Bo p T (2.34)

This is better expressed as;

1 B o R
co = B g s
Bo p T p T (2.35)

where

Rs= Solution gas-oil ratio, Scf/STB

Bg = Gas formation volume factor, res bbl/Scf

Bo = Oil formation volume factor, res bbl/STB

Equation 2.35 is consistent with the equation for calculating the isothermal

compressibility at pressures above the bubble point; because at pressures above the

bubble point pressure the gas solubility is constant and the derivative of Rs with

pressure is zero.

The typical relationship of the isothermal oil compressibility as a function of

reservoir pressure shows a discontinuity at the bubble point pressure (Figure 2.6). This

discontinuity is caused by the large increase in the value of the isothermal

compressibility at the evolution of the first bubble of gas.

23
Coefficient of Isothermal Oil Compressibility, psi-1

Pb

Figure 2.6: Typical shape of the coefficient ofReservoir


isothermal
Pressure, oil
psi compressibility as a
29 pp 236
function of pressure at constant reservoir temperature .

2.2 Isothermal Compressibility Correlation and Computation Methods

Laboratory PVT analysis is used to acquire data that are used in the estimation of

the isothermal compressibility from the equations given above. Values of the fluid

properties including the isothermal compressibility are often required when laboratory

PVT data are not available. Thus, there are a number of developed correlations for the

estimation of the isothermal compressibility using readily available fluid properties.

2.2.1 Trubes Correlation42

As shown in figures 2.3, 2.4 and 2.7, Trube42 (1957) presented a correlation for

estimating the pseudo reduced compressibility cr, for natural gases and undersaturated

crude oils. The pseudo reduced compressibility was correlated with the pseudo reduced

temperature and pressure, ppr and Tpr. Trubes graphical correlation can be used to

24
estimate the isothermal compressibility at any pseudo reduced temperature and

pressure. The relationship between the pseudo reduced isothermal compressibility and

the isothermal compressibility is expressed as:

c r = c o p pc (2.36)

where

cr = Pseudo reduced compressibility, dimensionless

co = Isothermal Oil Compressibility, psi-1

ppc = Pseudo-critical pressure, psi

Figure 2.7 Trubes pseudo reduced compressibility of undersaturated crude oils42

25
2.2.2 Vasquez-Beggs Correlation43

Vasquez and Beggs43 (1980) developed a correlation for the isothermal oil

compressibility with the gas solubility Rs, reservoir temperature T, APIo gravity, gas

specific gravity g and reservoir pressure p. They proposed the following expression:

1433 + 5R s + 17.2(T 460) 1180 gs + 12.61 API


co =
10 5 p (2.37)

Vasquez and Beggs proposed that the value of the gas specific gravity g obtained

at the separator pressure of 100 psig be used for the above equation. This reference

pressure was chosen because it represents the average reservoir field separator pressure.

They also proposed the relationship for adjustment of the gas gravity g to the reference

separator pressure gs.

p sep
gs = g 1 + 5.912(10 5 )( API )(Tsep 460)Log
114.7 (2.38)

where

gs = gas gravity at the reference separator pressure

g = gas gravity at the actual separator conditions of psep and Tsep

psep = actual separator pressure, psi

Tsep = actual separator temperature, oR

This correlation is also represented in a graphical form (Figure 2.8). This is the

best available correlation considering both accuracy and ease of use. The results are

generally low by as much as 50 percent at high pressures29. Accuracy is increased as

the bubble point pressure is approached.

26
Figure 2.8: Coefficients of isothermal compressibility of undersaturated black
oils29p. 327

27
2.2.3 McCain et al Correlation for Isothermal Oil Compressibility at Pressures above
the Bubble Point

The work of McCain30 (1988) presented a correlation for estimating the

isothermal oil compressibility at pressures below the bubble point. The correlation is

expressed as:

ln(c o ) = 7.633 1.497ln(p ) + 1.115ln(T ) + 0.533ln( API ) + 0.184ln(R sb ) (2.39)

The results are accurate to within 10% at pressures above 500 psia. Below 500

psia, the accuracy is within 20%. If the bubble point pressure is known, the accuracy of

the correlation can be improved by using this expression proposed by McCain28 :

ln(c o ) = 7.573 1.450ln(p ) 0.383ln(p b ) + 1.402ln(T ) + 0.256ln( API ) + 0.449ln(R sb )


(2.40)

This correlation is also expressed graphically in Figure 2.9:

28
Figure 2.9 Coefficient of Isothermal Compressibility of Saturated Black Oil.
McCain30 (1988)

29
2.2.4 Ahmeds Correlation

Ahmed4 (1985) used 245 experimental data points to propose a mathematical

expression for the isothermal oil compressibility using the gas solubility Rs as the only

correlating parameter. Other correlating parameter such as o, g, and T are

implemented in the equation through the gas solubility Rs5.

The correlation is expressed as:

1
co = e (a 3 p ) (2.41)
a1 + a 2R s

where

a1 = 24841.0822

a2 = 14.07428745

a3 = -0.00018473

The average absolute error of this expression is given as 3.9 percent when tested

against the experimental data used in developing the equation. The isothermal oil

compressibility can also be determined from this expression:

g 0.5
1.175

a + a R + 1.25(T 460)
s
1 2
o
co = e (a 3 p ) (2.42)
a 4 O + a 5R s g


where

a1 = 1.026638

a2 = 0.0001553

30
a3 = -0.0001847272

a4 = 62400

a5 = 13.6

This correlation only applies for isothermal oil compressibility at pressures above

the bubble point pressure.

2.2.5 De Ghetto et al Correlations15

De Ghetto et al15 (1994) evaluated the reliability of some PVT correlations and

came up with some modified correlations which they reported as being more accurate.

They characterized the fluid samples used in their studies as extra-heavy oils

(oAPI 10), heavy oils (10 < oAPI 22.3), medium oils (22.3 < oAPI 31.1) and light

oils (oAPI > 31.1). They reported that the errors on the correlations were decreased by

about five percentage points. The most significant improvements for the entire sample

of the oils were from 24.5% to 19.8%. The modified correlations were given as:

Extra-heavy oils: Modified Vasquez-Beggs correlation

889.6 + 3.1374R s + 20T 627.3 gcorr 81.4476 API


co =
p10 5 (2.43)

Heavy oils: Modified Vasquez-Beggs correlation

2841.8 + 2.9646R s + 25.5439T 1230.5 gcorr 41.91 API


co =
p10 5 (2.44)

31
Medium oils: Modified Vasquez-Beggs correlation

705.288 + 2.2246R s + 26.0644T 2080.823 gcorr 9.6807 API


co =
p10 5 (2.45)

Light oils: Modified Labedis Correlation

(
c o = 10 6.1646 B o
1.8789
0.3646
API T )
0.1966 p
1 b
p
8.98 3.9392 1.349
(
10 Bo T )
(2.46)

Where

p sp 4
gcorr = g p sp 1 + 0.5912 API Tsp Log 10
114.7 (2.47)

T = Reservoir temperature, oF

p = Reservoir pressure, psia

psp = Separator pressure, psia

2.2.6 Dinodruk-Christman Correlation for the Gulf of Mexico16

Dinodruk and Christman16 (2001) proposed a set of PVT correlations for the Gulf

of Mexico. The proposed oil compressibility correlation predicts the oil compressibility

values with an average relative error of -0.85% and average absolute relative error of

6.21%. The proposed isothermal oil compressibility is for undersaturated oil reservoirs.

(c o )bp (
= 4.487462368 + 0.005197040A + 0.000012580A 2 10 6 ) (2.48)

32
where

1.759732076
R s0.980922372 0.02100307 7



g
0.338486128
+ 20.0000635 8(T 60 )0.300001059
0.87681362 2R s


0
A= 2
1.713572145
2.749114986 + (T 60 ) 2R s
9.999932841
g
(2.49)

2.2.7 Spivey et al. Correlation38

Spivey et al.38 (2005) proposed a set of correlations for estimating the isothermal

oil compressibility for three applications in reservoir engineering. The applications and

the correlation for each application are given as follows:

o Correlation for Coefficient of Isothermal Compressibility from the Bubble point


to a Pressure of Interest

This correlation is used to estimate the isothermal oil compressibility when

the values of the isothermal oil compressibility will be used to extend the values

of some fluid properties from the bubble point pressure of the oil to higher

pressures.

ln (c ofb ) = 2.434 + 0.475z + 0.048z 2 (2.50)

6
z = zn
n =1 (2.51)

z n = C 0,n + C1,n x n + C 2,n x 2n


(2.52)

33
Table 2.1 Coefficients for the co correlation Equation. 2.52

n x C0,n C1,n C2,n

1 ln oAPI 3.011 -2.6254 0.497

2 ln gsp -0.0835 -0.259 0.382

3 ln pb 3.51 -0.0289 -0.0584

4 ln p/pb 0.327 -0.608 0.0911

5 ln Rsb -1.918 -0.642 0.154

6 ln TR 2.52 -2.73 0.429

o Correlation for Coefficient of Isothermal Compressibility from Initial Pressure


to a Pressure of Interest.

The value of the isothermal oil compressibility at initial pressure, cofb, can be

used to estimate the isothermal compressibility at lower pressure, cofi.

(p p b )c ofb p (p i p b )c ofb p i
c ofi =
p pi (2.53)

o Correlation for Coefficient of Isothermal Compressibility Tangent at Some


Pressure of Interest.

This gives the tangent or instantaneous compressibility, co.

p
0.608 + 0.1822ln
pb
c o = c ofb + (p p b )c ofb (0.475 + 0.096z )
p (2.54)

34
CHAPTER III

DESIGN OF CUBIC EQUATION OF STATE

3.1 Generalized Cubic Equation of State

3.1.1 Equation of state

Equation of state can be defined as a mathematical expression that relates pressure

p, volume V and Temperature T. The simplest form of an equation of state (EOS) is the

ideal gas equation.

RT
p=
V (3.1)

where V = gas volume in ft3 per mole of gas

The ideal gas equation is only used at pressures close to the atmospheric pressure

where real gas behavior can be assumed to be ideal.

The behavior of most real gases cannot be predicted by the ideal gas equation;

therefore a correction factor, called the compressibility factor or the gas deviation factor

is inserted into the ideal gas equation.

zRT
p=
V (3.2)

where, z = gas deviation factor.

35
3.1.2 Van der Waals (VDW) EOS

In developing the ideal gas equation of state, the following assumptions were

made;

o The volume occupied by the molecules of the gas is insignificant compared to


the volume occupied by the gas.

o There are no attractive and repulsive forces between the molecules of the gas or
between the molecules of the gas and the walls of the container.

o All collisions of the gas molecules are perfectly elastic.

In 1873, Van der Waal improved the ideal gas equation by attempting to eliminate

the first two assumptions of the ideal gas equation. Van der Wall introduced the

a
parameter and b to account for the intermolecular attractive and repulsive forces
V2

respectively.

RT a
p= 2
Vb V (3.3)

The Van der Waal EOS written in terms of volume or the compressibility factor

takes a cubic form and is often referred to as a cubic EOS.

RT 2 a ab
V 3 b + V + V =0
p p p (3.4)

z 3 (1 + B)z 2 + Az AB = 0 (3.5)

where the dimensionless parameter A and B are defined as,

aP
A=
(RT )2 (3.6)

36
bp
B=
RT (3.7)

The typical volumetric behavior of Van der Waal EOS is shown in the Figure 3.1.

T=Tc T2
T2 > T1

T1 Single Phase

Pressure

P1

Two Phase
Region

V3 V2 V1

Volume

Fig. 3.1: Volumetric Behavior of Pure Compounds by Van der Waal Cubic EOS13 pp 133.

The Van der Waal cubic EOS may give three real roots for volume V, or the

compressibility factor z, at pressure P1, as shown in Figure 3.1. The highest value, V1 or

z1, corresponds to the volume or the compressibility factor of the vapor, while the

lowest value, V3 or z3 corresponds to the volume or compressibility factor of the liquid.

The middle root within the two phase region, V2 or z2, is of no physical significance.

37
It can also be observed from Figure 3.1 that at the critical point C, the critical

temperature isotherm Tc has a horizontal point of inflection as it passes through the

critical pressure. Therefore at the critical point of a pure substance,

p
=0
V Tc
(3.8)

2p
2 = 0
V Tc (3.9)

Applying this condition at the critical point, the constant a and b of the Van

der Waal cubic EOS can be determined.

27 R 2 Tc2
a=
64 p c
(3.10)

1 RT
b = c
8 pc (3.11)

where the subscript c, refers to the values at the critical point.

3.1.3 Peng-Robinson (PR) Equation of State32.

Peng and Robinson proposed a slightly different form of EOS to predict liquid

densities and other volumetric properties of the fluid at the vicinity of the critical

region. Peng and Robinson proposed a slightly different attractive term compared to the

VDW EOS.

38
RT a
p=
V b V(V + b ) + b(V b ) (3.12)

The PR EOS in terms of volume is given as,

RT a 2bRT RTb 2 ab
V 3 b V 2 + 3b 2 V + b 3 + = 0
p p p p p
(3.13)

Or, in terms of the compressibility factor,

( ) ( )
z 3 (1 B)z 2 + A 3B 2 2B z AB B 2 B 3 = 0 (3.14)

The PR EOS constants are given as,

R 2 Tc2
a = a
pc (3.15)

where a = 0.45724

RTc
b = b
pc (3.16)

where b = 0.07780

[ (
= 1 + m 1 - Tr0.5 )]
2
(3.17)

and m = 0.374964 + 1.54226 0.26992 2 (3.18)

The value of m was later expanded by Robinson et al. for heavier components

( > 0.49) 44 p. 50.

m = 0.3796 + 1.485 0.1644 2 + 0.01667 3 (3.19)

Parameters A and B are as defined in equation 3.6 and 3.7 respectively.

39
3.1.4 Lawal-Lake-Silberberg (LLS) EOS

The LLS EOS is a four parameter cubic EOS defined by Lawal et al.25. The term

and were introduced to account for the shape of the components on the attractive

term. The general form of the LLS EOS is written as,

RT a
P= 2
V b V + V b 2 (3.20)

The LLS parameters a, b, and are defined as,

(RTc )2
a = a k
pc (3.21)

a = (1 + ( w 1)z c )
3
where (3.22)

[ (
k = 1 + m 1 Tr0.5 )]
2
(3.23)

m = 0.14443 + 1.06624 + 0.02756 2 0.1807 3 (3.24)

RTc
b = b
and pc (3.25)

b = zc w (3.26)

0.361
w =
where 1 + 0.274 (3.27)

1 + z c ( w 3)
=
zc w (3.28)

z c2 ( w 1) + 2 2w z c + w (1 3z c )
3

i =
z c 2w (3.29)

40
The LLS EOS can be written in terms of molar volume as,

RT a RT 3 RTT2 ab
V
3
+ b V 2 + b 2 b V + b + = 0
p p p p p

(3.30)

or, in terms of the compressibility factor

[ ] [ ( )]
z 3 + z 2 [B( 1) 1] z B 2 ( + ) + B A AB B 2 B 3 = 0 (3.31)

3.1.5 Modified Peng-Robinson Equation of State

The parameters a and b in the Peng-Robinson cubic EOS is constant, as

shown in equation 3.15 and equation 3.16. To account for the effect of each component

in the mixture on the parameters, the parameters a and b in the Peng-Robinson

cubic EOS is replaced with the parameters a and b in the LLS EOS to create a

Modified PR EOS.

3.1.6 Mixing Rules.

Equation of state are applied to multi-component systems by the use of mixing

rules to calculate the constant terms of the EOS (a, b, , ) that will represent the multi-

component system. The mixture parameters used in the study are defined as,

a m = x i x j (a i a j ) ij
n n
0.5

i j
(3.32)
3
n 1
b m = x i b i 3
i (3.33)

41
m = x i x j ( i j ) ij
n n
0.5

i j
(3.34)

m = x i x j ( i j ) ij
n n
0.5

i j
(3.35)

ij
The binary interaction parameter is generally determined by minimizing the

difference between predicted and experimental data. A binary interaction parameter

should therefore be considered as a fitting parameter and not a rigorous physical term13.

The interaction parameters between hydrocarbon systems with little difference in size

are generally considered to be unity, but values of the binary interaction parameters for

non-hydrocarbonhydrocarbon system may not be 1. For this study the binary

interaction parameter is taken as unity, because the reservoir fluids used in the study

does not have significant amount of non-hydrocarbons.

For multi- component systems that have significant amount of non-hydrocarbons

Lawal1 expressed the interaction parameter as,


0.5
T
ci 0.5
Pci
T
cj 0.5
Pcj (3.36)

Tci Tcj
0.5 <
0.5

where, Pci Pcj

42
3.2 Characterization of Heavy Petroleum Fractions

To determine the properties of the heptane-plus (C7+), which account for the

heavy component in the multi-component reservoir fluid system, we use a correlation

proposed by Lawal-Tododo-Heinze40.

The correlation expressed the critical pressure (Pc), critical temperature (Tc),

acentric factor (), boiling point (Tb) and critical z-factor (zc) as a function of the

pseudo-component as a function of apparent molecular weight (M) and specific gravity

(Sg) of the pseudo-component.

Pc (psia ) = 3.1839 * 10 4 M 0.93426S1.64074 Tb0.49447 C 2.39909


g
(3.37)

Tc ( R ) = 66.3775M
o 0.12286
S 0.47926
g Tb0.41286 C 0.35734
(3.38)

= 4.54949 * 10 9 M 0.02445S g2.08511Tb2.903798 C 1.54424


(3.39)

Tb ( R ) = 108.7017M
o 0.4225
S 0.4268
g
(3.40)

0.293
zc =
1 + 0.375 (3.41)

3.8501
C=
1.54057 0.02494 M (3.42)

3.3 Cubic EOS Based Isothermal Compressibility Equation

Coefficient of isothermal compressibility can be obtained by differentiating an

equation of state or any correlation involving compressibility factor z, density or

formation volume factor10. In 1968 Kennedy H. T. and Avasthi S. M10 proposed a

43
method to develop an equation for predicting the molar volume and the coefficient of

isothermal compressibility by differentiation a cubic EOS in terms of volume. They

developed a correlation to express the differentiated volume.

The approach in this research is to develop a mathematical model that can predict

the coefficient of isothermal compressibility based on a Peng-Robinson EOS.

3.3.1 Coefficient of Isothermal Compressibility at Pressures above the Bubble Point


Pressure.

The coefficient of Isothermal Compressibility oil compressibility is defined as the

fractional change in oil volume per unit change in pressure at constant temperature. At

pressures above the bubble point pressure, the reservoir fluid is undersaturated. At point

A in Figure 3.2 there is no free gas in the system.

A C

Pressure Bubble Point Curve


Dew Point Curve

Temperature
Figure 3.2: Reservoir Oil at Pressure above the Bubble Point Pressure

44
The coefficient of isothermal compressibility at this point is given as stated in

equation 2.20,

1 V
co =
V p T
(2.20)

The approach to this research is to express the EOS in the volume form (which is

cubic) to determine the molar volume of the reservoir oil at any given pressure. This

1
will enable us to determine part of equation 2.20. If the cubic EOS in terms of
V

volume gives three real roots, as explained in section 3.1.2 and Figure 3.1, the smallest

root corresponds to the volume of the oil.

V
The second step is to differentiate the EOS to obtain the term of
p T

equation 2.20. That is we differentiate the EOS in terms of volume with respect to

1 V
pressure at constant temperature. The two terms and are then
V p T

multiplied to give the coefficient of isothermal compressibility at pressures above the

bubble point.

3.3.1.1 Peng-Robinson (PR) EOS based Isothermal Compressibility Equation

The PR EOS is given in equation 3.12 as,

RT a
p=
V b V(V + b ) + b(V b ) (3.12)

The PR EOS in terms of volume is given as,

45
RT a 2bRT RTb 2 ab
V 3 b V 2 + 3b 2 V + b 3 + = 0
p p p p p
(3.13)

A computer algorithm was written to solve for the volume of the undersaturated

oil using equation 3.13. The procedure for calculating the volume is stated below.

o Read in the temperature T (oR), pressure p (psia) and the universal gas constant
R (psia cu ft/lb mole/oR).

o Calculate the EOS parameter a and b for the multi-component system.

o Determine the coefficient of the cubic equation (equation 3.13).

o Determine the roots equation 3.13. If there are three real roots, the smallest root
corresponds to the root of the multi-component oil system.

The differential of the volume with respect to pressure at constant temperature for

the PR EOS is given as,

V
=
( 2
(
V b ) V 2 + 2bV b 2 )
2

2
(
p T 2a (V + b )(V b ) RT V 2 + 2bV b 2 )
2
(3.43)

There are no unknowns in equation 3.43. The volume has already been

determined from equation 3.13. The universal gas constant R and the reservoir

temperature T are known. The PR EOS parameters a and b can be calculated using

the critical properties and the mixing rules.

Therefore the PR EOS based mathematical model for predicting the coefficient of

isothermal compressibility at pressures above the bubble point can be written as,

1
co =
2
(
(V b ) V 2 + 2bV b 2 )
2

(
V 2a (V + b )(V b )2 RT V 2 + 2bV b 2 )
2
(3.44)

46
3.3.1.2 Modified Peng-Robinson (PR) EOS based Isothermal Compressibility Equation

In order to modify the PR EOS, the constant parameters in the PR EOS, that is the

parameters a and b are calculated using the LLS EOS definition for the parameters

a and b. The definitions for these constant parameters are given in equations 3.21,

3.22, 3.23, 3.24, 3.25, 3.26 and 3.27.

3.3.2 Coefficient of Isothermal Compressibility at Pressures below the Bubble Point


Pressure.

At pressures below the bubble point curve (point B on Figure 3.3), there are free
gases in the reservoir fluids and the system is described as a saturated system.

Pressure Bubble Point Curve B


Dew Point Curve

Temperature

Figure 3.3: Reservoir Oil at Pressure below the Bubble Point Pressure

For saturated system the total volume of the system is the sum of the volume of

the gas and the volume of the liquid. Therefore the total system isothermal

compressibility has to account for the free gas in the system.

47
At pressures below the bubble point pressure the volume of liquid decreases with

reduction in pressure, contrary to the behavior at pressures above the bubble. Therefore

the coefficient for isothermal oil compressibility at pressure below the bubble point

pressure can be expressed as point29 p. 235,

1 B o B g R s
co = + (3.45)
Bo p T B o p T

Equation 3.45 was used to analyze the experimental differential liberation data to

calculate the coefficient of isothermal compressibility at pressures below the bubble

point pressure.

3.3.2.1 Molar Volume Prediction below the Bubble Point Pressure

At pressures below the bubble point pressure there is a distinct gas phase in the

system as shown by Figure 3.4.

Gas Gas Gas Gas

Oil Oil Oil Oil Oil

Oil

P1>Pb P2=Pb P3<Pb P4<<Pb Pi<<Pb Pn<<<Pb

Figure 3.4: Schematic Diagram of Flash Liberation Experiment

48
To determine the volume of the gas and the volume of the liquid at pressures

below the bubble point, flash calculations were conducted to simulate the flash

liberation (or constant composition experiment).

The flash liberation experiment involves putting a sample of reservoir fluid in a

laboratory cell. The pressure and temperature of the cell is set at the initial condition of

the reservoir. The pressure in the laboratory cell is reduced in increments and the

volume of the cell is measured. The measured volume is then plotted against pressure.

The bubble point pressure is the pressure at which the slope of the graph changes. The

volume at the bubble point pressure is the saturation volume Vsat. Flash calculations

were used to determine the amount (in moles) and the composition of hydrocarbon

liquid and gas co-existing at the same temperature and pressure.

The criterion for thermodynamic equilibrium between two phases is determined

by the fugacities of the components in each of the phases. The fugacity of a component

in one phase with respect to the fugacity of the component in another is a measure of

the potential for the transfer of the component from one phase to the other. The

component moves from the phase with the lower fugacity to the phase with the higher

fugacity. When the fugacities of the component in the two phases are equal, there is no

net transfer of the component between the two phases. The condition for

thermodynamic equilibrium is achieved when there is zero net transfer between the two

phases2 pp 305.

The procedure for calculating the equilibrium amount (in moles) and the

equilibrium composition of the vapor and liquid phase at temperatures below the

49
bubble point is stated below. The procedure is also referred to a two phase flash

calculations.

o Calculate the initial equilibrium ratio values (K-values) using Wilson45 (1968)
correlation.

Tci
p 5.37 (1+ i ) 1 T
K i = ci e
(3.46)
p

o Calculate Nvmin (minimum number of moles of the vapor phase) and Nvmax
(maximum number of moles of the vapor phase). Nvmin should be less than zero,
while Nvmax should be greater than one.

1
N vmin =
1 K imax (3.47)

1
N vmax =
1 K imin (3.48)

o Solve the Rachford-Rice flash algorithm to calculate Nv (total number of moles


in the vapor phase), limited between Nvmin and Nvmax.

o Assume an initial value for Nv (say Nv = 0.5)

o Evaluate Nv by using Newton-Raphson iteration technique.

f (n v )
N nv +1 = N nv
f ' (n v ) (3.49)

z i (K i 1)
f (n v ) =
i n v (K i 1) + 1 (3.50)

z i (K i 1)2
f ' (n v ) = 2
[n v (K i 1) + 1]
i
(3.51)

Where zi is the mole fraction component i in the original mixture and n, is the

iteration counter. If f(nv) is equal to zero use bisection method to evaluate Nv.

50
o Calculate the mole fraction of component i in the liquid phase xi

zi
xi =
1 + n v (K i 1) (3.52)

o Calculate the mole fraction of the component in the vapor phase yi.

ziK i
yi =
1 + n v (K i 1) (3.53)

o Calculate the compressibility factor (z-factor) of the vapor and the liquid phase
using the compressibility factor form of the PR EOS. Using equation 3.14
( ) ( )
z (1 B)z 2 + A 3B 2 2B z AB B 2 B 3 = 0
3
(3.14)

The mole fraction of the vapor is used in the calculation of the z-factor of the

vapor. If three real roots are obtained from equation 3.14, the largest root

corresponds to the root of the vapor. The mole fraction of the liquid is used in the

calculation of the z-factor of the liquid. It three real roots are obtained for the z-

factor of the liquid; the smallest real root corresponds to the root of the liquid.

o The component fugacities of the liquid fLi and the vapor phase fVi are
calculated from the EOS.

2 i Bi z L + 2.414B
ln
f Li B i L
=
xip B
( ) (
z 1 ln z B
L
) A
2.82843B
ln L
B z 0.414B

(3.54)

2 i Bi z v + 2.414B
ln
f vi Bi v
=
yi p B
( ) ( )
z 1 ln z v B
A
2.82843B
ln v
B z 0.414B

(3.55)

The parameters of the PR EOS are calculated using the appropriate mole

fractions.

o Check for convergence of the fugacities

51
2
n
f Li

i =1 f Vi
1 <
(3.56)

where is a convergence tolerance.

o If the convergence criteria is satisfied, the mole fraction of the liquid xi, the
mole fraction of the vapor yi, the total number in the vapor phase Nv and the
z-factor for both the liquid and vapor are returned as the equilibrium properties
the multi-component system.

o If the convergence criterion is not satisfied, the equilibrium ratios (K-values) are
updated.
(n )
( n +1) ( n ) f Li
Ki = K i (n )
f Vi (3.57)

where the superscripts (n) and (n+1) indicate the iteration level.

o Check for convergence into a trivial solution (Ki is tending towards 1) using,

(ln K )
2
i < 10 4
i =1 (3.58)

o If a trivial solution is not detected, return to step 2. Otherwise, confirm the


trivial solution with a stability test 44, 2.

o When the convergence criterion is satisfied, the volumes of the liquid and gas
phases can then be calculated from the expressions

(1 N v )z L RT
VL =
p (3.59)

Vg =
(N v )z v RT
p (3.60)

o The total volume VT is calculated using,

VT = VL + Vg
(3.61)

52
3.3.2.2 Coefficient of Isothermal Gas compressibility below Bubble Point Pressure

The defining equation for the coefficient of isothermal gas compressibility is

given in equation 2.13,

1 1 z
cg =
p z p T
(2.13)

The partial differential of compressibility factor with respect to pressure at

constant temperature for the PR EOS is derived as,

bp
(2a 3pb ) +
2 1
(6zpb 2
) (RT
2pb 2 za +
zb
)
(2 z )
z
=
(RT ) 3
(RT ) 2

p T p
( )
a 3pb 2 +
2bp
(RT )
(z 1) + z(3z 2)
(RT ) 2
(3.62)

Equation 2.13 can thus be used to calculate the coefficient of isothermal gas

compressibility, since the pressure p is known and the z-factor z has already been

calculated.

6zpb 2 2zb 2abp z 2 b za 2pb 2 3p 2 b 3


+ +
1 1 (RT )2 RT (RT )3 RT (RT )2 (RT )2 (RT )3
c = (3.63)
g p z
2 bp ap 3(bp )2 2bp
3z 2z + 2z +
RT (RT )2 (RT )2 RT

53
3.3.2.3 Coefficient of Isothermal Oil compressibility below Bubble Point Pressure

Below the bubble point the coefficient of isothermal oil compressibility can be

calculated using,

1 V
co =
V p T
(1.2)

Experimental data shows that at pressures below the bubble point pressure, the

volume of the liquid decreases as the pressure decreases. This behavior is also noticed

in the result of the flash calculations. It was therefore suggested that there is no need for

the negative sign, because the purpose of the negative sign is to make the isothermal

compressibility positive. The observation is not used in this report because it has not

been rigorously proved.

Using the actual volume of liquid calculated form the flash calculations, the liquid

part of the coefficient of isothermal compressibility at pressures below the bubble point

can be calculated as,

z L RT
V=
p (3.64)

1
c o =
2
(
(V b ) V 2 + 2bV b 2 )2

(
V 2a (V + b )(V b )2 RT V 2 + 2bV b 2 )
2
(3.43)

The constant parameters of the PR EOS are calculated using the mole fraction of

the liquid xi.

54
3.3.2.4 Total Coefficient of Isothermal Compressibility below the Bubble Point
Pressure

The total coefficient of isothermal compressibility below the bubble point will be

the combination of the coefficient of isothermal gas compressibility below the bubble

point pressure and the coefficient of the isothermal oil compressibility below the bubble

point pressure.

This combination is achieved by using the volume fraction of the gas to multiple

the isothermal compressibility of the gas and the volume fraction of the oil to multiply

the isothermal compressibility of the oil.

Vg VL
co = cg + (3.66)
(V
L + Vg ) (VL + Vg ) c L

55
CHAPTER IV

ANALYSIS OF PREDICTION RESULTS

4.1 Computing Isothermal Oil Compressibility from Reservoir Fluid Study Report

The coefficient of isothermal compressibility is not directly measured in the

laboratory. They are usually obtained from reservoir fluid study data. The constant

composition expansion experiment (also called Pressure-Volume relations) gives the

behavior of the reservoir fluid at pressures above the bubble point pressure.

The relative volume data from the constant composition expansion is used to

calculate the coefficient of isothermal oil compressibility at pressures above the bubble

point.

At pressures below the bubble point pressure, the reservoir behavior is simulated

by the differential liberation experiment. The solution gas-oil ratio RsD, the relative oil

volume BoD and the gas formation volume factor from the differential vaporization

experiment are used in the coefficient of isothermal compressibility at pressures below

the bubble point pressure.

4.2 Predicted Molar Volume from Cubic Equation of State

The predicted molar volumes from the Peng-Robinson cubic EOS and the

modified Peng-Robinson cubic EOS are reported in Table 4.1, 4.2 and 4.3. A good

degree of accuracy are observed between the experimental molar volumes and the

predicted molar volumes as shown in Figures 4.1, 4.2 4.3 4.4 4.5 and 4.6

56
Table 4.1: Predicted molar volume for Oil Well No. 4, Good Oil Company. Samson,
Texas. Bubble Point = 2619.7 psia 29 pp 259-269
Volume (ft3/lb mole)
Pressure(psia) Exptal PR EOS MPR EOS
5014.7 2.2058 2.2047 2.2672
4514.7 2.2204 2.2201 2.2816
4014.7 2.2360 2.2371 2.2974
3514.7 2.2531 2.2559 2.3148
3014.7 2.2721 2.2770 2.3341
2914.7 2.2760 2.2815 2.3382
2814.7 2.2801 2.2861 2.3424
2714.7 2.2845 2.2909 2.3468
2634.7 2.2884 2.2948 2.3503
2619.7 2.2934 2.2033 2.6633
2605.7 2.2978 2.2083 2.6655
2530.7 2.3236 2.2427 2.6804
2415.7 2.3685 2.2897 2.7081
2267.7 2.4360 2.3597 2.7531
2104.7 2.5264 2.4519 2.8157
1911.7 2.6621 2.5878 2.9152
1712.7 2.8435 2.7688 3.0547
1491.7 3.1163 3.0482 3.2799
1306.7 3.4353 3.3596 3.5454
1054.7 4.0738 3.9944 4.1111
844.7 4.9482 4.8609 4.9103
654.7 6.2960 6.1895 6.1702
486.7 8.5187 8.3257 8.2369

57
Molar Volume Prediction for Oil Well No-4,Good Oil Company, Samson,TX. Pb =2619.7 psia

9.0

8.0

7.0

6.0
Molar Volume (ft3/lbmol)

5.0
Exptal
Model Based on PR EOS
4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Pressure (psia)

Figure 4.1: Predicted Molar Volume for Oil Well No- 4, Good Oil Company. Samson,
Texas (Model Based on PR EOS).

58
Molar Volume Predictionfor Oil Well No-4,Good Oil Company, Samson,TX. Pb =2619.7 psia

9.0

8.0

7.0

6.0
Molar volume (ft3/lbmol)

5.0
Exptal
Model Based on MPR EOS
4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Pressure (psia)

Figure 4.2: Predicted Molar Volume for Oil Well No- 4, Good Oil Company. Samson,
Texas (Model Based on MPR EOS).

59
Table 4.2: Predicted molar volume for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver,
Oklahoma. Bubble Point = 2666.7 psia 37
Volume (ft3/lb mole)
Pressure
(psia) Exptal PR EOS MPR EOS
5014.7 2.2110 2.2956 2.2779
4514.7 2.2226 2.3087 2.2892
4014.7 2.2351 2.3229 2.3015
3514.7 2.2487 2.3386 2.3149
3014.7 2.2633 2.3560 2.3296
2914.7 2.2662 2.3596 2.3327
2814.7 2.2694 2.3634 2.3359
2714.7 2.2726 2.3673 2.3391
2677.7 2.2737 2.3688 2.3403
2653.7 2.2794 2.2131 2.5787
2591.7 2.2949 2.2308 2.5899
2507.7 2.3181 2.2569 2.6056
2365.7 2.3645 2.3070 2.6378
2192.7 2.4575 2.3949 2.6874
2012.7 2.5282 2.4780 2.7570
1811.7 2.6644 2.6147 2.8618
1604.7 2.8558 2.8039 3.0107
1392.7 3.1289 3.0740 3.2342
1193.7 3.4998 3.4411 3.5483
949.7 4.2155 4.1399 4.1746
760.7 5.1473 5.0465 5.0142
591.7 6.5507 6.4199 6.3198
435.7 8.8958 8.7522 8.5807

60
Molar Volume Prediction for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver, Oklahoma. (MPR
EOS) Bubble Point = 2666.7 psia.

10.0

9.0

8.0

7.0
Molar Volume (ft3/lbmol)

6.0

Exptal
5.0
Model Based on PR EOS

4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Pressure (psia)

Figure 4.3: Predicted Molar Volume for Jehlicka 1A, Wilshire Oil Co. of Texas,
Beaver, Oklahoma. (Model Based on PR EOS).

61
Molar Volume Prediction for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver, Oklahoma. (MPR
EOS) Bubble Point = 2666.7 psia.

10.0

9.0

8.0

7.0
Molar Volume (ft3/lbmol)

6.0

Exptal
5.0
Model Based on MPR EOS

4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Pressure (psia)

Figure 4.4: Predicted Molar Volume for Jehlicka 1A, Wilshire Oil Co. of Texas,
Beaver, Oklahoma. (Model Based on MPR EOS).

62
Table 4.3: Predicted molar volume for Jacques Unit #5603, Rough Ride Field, A.C.T.
Operating Company, Fisher County, Texas. Bubble Point = 1689.7 psia 36
Volume (ft3/lb mole)
Pressure (psia) Exptal PR EOS MPR EOS
5014.7 2.2175 2.2330 2.3248
4514.7 2.2269 2.2426 2.3345
4014.7 2.2368 2.2528 2.3451
3514.7 2.2474 2.2640 2.3565
3014.7 2.2586 2.2761 2.3689
2514.7 2.2707 2.2893 2.3824
2014.7 2.2838 2.3039 2.3974
1914.7 2.2866 2.3070 2.4006
1814.7 2.2893 2.3102 2.4038
1714.7 2.2921 2.3134 2.4071
1689.7 2.2928 2.3142 2.4079
1680.7 2.2969 2.1812 2.4891
1670.7 2.3015 2.1860 2.4929
1660.7 2.3063 2.1909 2.4968
1650.7 2.3111 2.1959 2.5008
1627.7 2.3223 2.2076 2.5106
1541.7 2.3693 2.2565 2.5506
1402.7 2.4636 2.3549 2.6325
1244.7 2.6080 2.5060 2.7595
1064.7 2.8460 2.7572 2.9765
900.7 3.1745 3.0966 3.2800
747.7 3.6485 3.5832 3.7261
631.7 4.1962 4.1440 4.2506
501.7 5.1681 5.1419 5.2026
390.7 6.5871 6.6222 6.6328
287.7 8.9929 9.1869 9.1431

63
Molar Volume Prediction for Jacques Unit #5603, Rough Ride Field, A.C.T. Operating
Company, Fisher County, Texas. Bubble Point = 1689.7 psia

10.0

9.0

8.0

7.0
Molar Volume (ft3/lbmol)

6.0

Exptal
5.0
Model based on PR EOS

4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Pressure (psia)

Figure 4.5: Predicted Molar Volume for Jacques Unit #5603, Rough Ride Field, Fisher
County, Texas. (Model Based on PR EOS).

64
Molar Volume Prediction for Jacques Unit #5603, Rough Ride Field, A.C.T. Operating
Company, Fisher County, Texas. Bubble Point = 1689.7 psia

10.0

9.0

8.0

7.0
Molar Volume (ft3/lbmol)

6.0

Exptal
5.0
Model Based on MPR EOS

4.0

3.0

2.0

1.0

0.0
0 1000 2000 3000 4000 5000 6000
Presssure (psia)

Figure 4.6: Predicted Molar Volume for Jacques Unit #5603, Rough Ride Field, Fisher
County, Texas.(Model based on MPR EOS).

65
4.3 Predicted Coefficient of Isothermal Oil Compressibility from Cubic Equation of
State

The developed mathematical models predicted the isothermal oil compressibility


with a good degree of accuracy as shown in Tables 4.4, 4.5 and 4.6. It can be observed
from Figures 4.7, 4.8, 4.9, 4.10, 4.11 and 4.12 that the developed model gave a very
good prediction at pressures above the bubble point pressure. At pressures below the
bubble point pressure, the predicted values also gave a good degree of accuracy
considering the difference between the experimental and the predicted values.

Table 4.4: Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Good Oil Company. Samson, Texas. Bubble Point = 2619.7 psia 29 pp 259 - 269
Isothermal Compressibility (psia-1)
Pressure(psia) Exptal PR EOS MPR EOS
5014.7 1.33E-05 1.21E-05
4514.7 1.32E-05 1.45E-05 1.32E-05
4014.7 1.40E-05 1.59E-05 1.44E-05
3514.7 1.53E-05 1.76E-05 1.58E-05
3014.7 1.68E-05 1.96E-05 1.75E-05
2914.7 1.71E-05 2.01E-05 1.79E-05
2814.7 1.81E-05 2.05E-05 1.83E-05
2714.7 1.91E-05 2.10E-05 1.87E-05
2634.7 2.13E-05 2.14E-05 1.90E-05
2364.7 1.55E-04 2.35E-04 2.06E-04
2114.7 1.83E-04 2.74E-04 2.44E-04
1864.7 2.09E-04 3.26E-04 2.95E-04
1614.7 2.53E-04 3.96E-04 3.65E-04
1364.7 3.15E-04 4.95E-04 4.65E-04
1114.7 4.17E-04 6.44E-04 6.16E-04
864.7 5.76E-04 8.84E-04 8.63E-04
614.7 8.87E-04 1.33E-03 1.32E-03
364.7 1.83E-03 2.42E-03 2.44E-03
173.7 5.20E-03 5.42E-03 5.47E-03

66
Coefficient of Isothermal Oil Compressibility for Oil Well No-4,Good Oil Company,
Samson,TX. Pb =2619.7 psia

0.006

0.005

0.004
Co (1/psi)

Exptal
0.003
Model Based on PR EOS

0.002

0.001

0.000
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Pressure (psia)

Figure 4.7: Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Good Oil Company. Samson, Texas. (Model Based on PR EOS).

67
Coefficient of Isothermal Oil Compressibility for Oil Well No-4,Good Oil Company,
Samson,TX. Pb =2619.7 psia

0.006

0.005

0.004
Co (1/psia)

Exptal MPR
0.003
Model Based on MPR EOS

0.002

0.001

0.000
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Pressure (psia)

Figure 4.8: Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4,
Good Oil Company. Samson, Texas. (Model Based on MPR EOS).

68
Table 4.5: Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,
Wilshire Oil Co. of Texas, Beaver, Oklahoma. Bubble Point = 2666.7 psia. 37
Isothermal Compressibility (psia-1)
Pressure
(psia) Exptal PR EOS MPR EOS
5014.7 1.09E-05 9.56E-06
4514.7 1.05E-05 1.18E-05 1.03E-05
4014.7 1.12E-05 1.29E-05 1.11E-05
3514.7 1.22E-05 1.41E-05 1.21E-05
3014.7 1.29E-05 1.55E-05 1.32E-05
2914.7 1.31E-05 1.59E-05 1.35E-05
2814.7 1.40E-05 1.62E-05 1.37E-05
2714.7 1.40E-05 1.65E-05 1.40E-05
2677.7 1.35E-05 1.67E-05 1.41E-05
2414.7 1.34E-04 2.12E-04 1.88E-04
1914.7 1.89E-04 2.96E-04 2.69E-04
1664.7 2.27E-04 3.60E-04 3.33E-04
1414.7 3.07E-04 4.50E-04 4.23E-04
1164.7 4.09E-04 5.82E-04 5.58E-04
914.7 5.57E-04 7.95E-04 7.76E-04
664.7 8.69E-04 1.18E-03 1.17E-03
414.7 1.61E-03 2.05E-03 2.07E-03
197.7 4.58E-03 4.66E-03 4.72E-03

69
Coefficient of isothermal Oil Compressibility for Jehlicka 1A, Wilshire Oil Co. of Texas,
Beaver, Oklahoma. (PR EOS) Bubble Point = 2666.7 psia.

5.00E-03

4.50E-03

4.00E-03

3.50E-03

3.00E-03
Co (1/psia)

Exptal
2.50E-03
Model Based on PR EOS

2.00E-03

1.50E-03

1.00E-03

5.00E-04

0.00E+00
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Pressure (psia)

Figure 4.9: Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,
Wilshire Oil Co. of Texas, Beaver, Oklahoma. (Model Based on PR EOS).

70
Coefficient of Isothermal Oil Compressibility for Jehlicka 1A, Wilshire Oil Co. of Texas,
Beaver, Oklahoma. (MPR EOS) Bubble Point = 2666.7 psia.

0.005

0.005

0.004

0.004

0.003
Co (1/psia)

Exptal
0.003
Model Based on MPR EOS

0.002

0.002

0.001

0.001

0.000
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Pressure (psia)

Figure 4.10: Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A,
Wilshire Oil Co. of Texas, Beaver, Oklahoma. (Model Based on MPR EOS).

71
Table 4.6: Predicted Coefficient of Isothermal Oil Compressibility for Jacques Unit
#5603, Rough Ride Field, A.C.T. Operating Company, Fisher County, Texas. Bubble
Point = 1689.7 psia 36
Isothermal Compressibility (psia-1)
Pressure
(psia) Exptal PR EOS MPR EOS
5014.7 8.24E-06 8.10E-06
4514.7 8.46E-06 8.83E-06 8.68E-06
4014.7 8.83E-06 9.49E-06 9.34E-06
3514.7 9.41E-06 1.03E-05 1.01E-05
3014.7 9.97E-06 1.11E-05 1.09E-05
2514.7 1.07E-05 1.21E-05 1.19E-05
2014.7 1.15E-05 1.33E-05 1.31E-05
1914.7 1.20E-05 1.36E-05 1.34E-05
1814.7 1.20E-05 1.38E-05 1.36E-05
1714.7 1.20E-05 1.41E-05 1.39E-05
1689.7 1.20E-05 1.42E-05 1.40E-05
1514.7 2.39E-04 4.32E-04 4.00E-04
1364.7 2.72E-04 4.98E-04 4.65E-04
1214.7 3.32E-04 5.82E-04 5.49E-04
1064.7 3.99E-04 6.91E-04 6.58E-04
914.7 4.98E-04 8.38E-04 8.08E-04
614.7 9.05E-04 1.36E-03 1.34E-03
464.7 1.38E-03 1.88E-03 1.87E-03
314.7 2.48E-03 2.91E-03 2.91E-03
174.7 5.98E-03 5.47E-03 5.50E-03

72
Coefficient of Isothermal Oil compressibility for Jacques Unit #5603, Rough Ride Field, A.C.T.
Operating Company, Fisher County, Texas. Bubble Point = 1689.7 psia

0.007

0.006

0.005

0.004
Co (1/psia)

Exptal
Model Based on PR EOS
0.003

0.002

0.001

0.000
0.0 500.0 1000.0 1500.0 2000.0 2500.0 3000.0 3500.0 4000.0 4500.0 5000.0
Pressure (psia)

Figure 4.11: Predicted Coefficient of Isothermal Oil Compressibility for Jacques Unit
#5603, Rough Ride Field, A.C.T. Operating Company, Fisher County, Texas. (Model
Based on PR EOS).

73
Coefficient of Isothermal Oil Compressibility for Jacques Unit #5603, Rough Ride Field, A.C.T.
Operating Company, Fisher County, Texas. Bubble Point = 1689.7 psia

0.007

0.006

0.005

0.004
Co (1/psia)

Exptal
Model Based on MPR EOS
0.003

0.002

0.001

0.000
0.0 500.0 1000.0 1500.0 2000.0 2500.0 3000.0 3500.0 4000.0 4500.0 5000.0
Pressure (psia)

Figure 4.12: Predicted Coefficient of Isothermal Oil Compressibility for Jacques Unit
#5603, Rough Ride Field, A.C.T. Operating Company, Fisher County, Texas. (Model
Based on MPR EOS).

4.4 Discussion of Result

The reservoir fluid used in this project can be classified as black oil because their API

gravity was less than 450API.29, p. 151

The developed model based on the PR EOS and the Modified PR EOS predicted

the coefficient of isothermal oil compressibility above the bubble point with a near

perfect match. At pressures below the bubble point the developed model also gave a good

prediction of the coefficient of isothermal oil compressibility.

74
The average absolute percent deviation (AAPD) as shown in Appendix H, for the

developed model based on the MPR EOS was smaller than the model based on the PR

EOS. The AAPD for the predicted models above the bubble point was smaller than the

AAPD for the total system. The smallest AAPD (of 1.9% deviation) above the bubble

point pressure was obtained by the model based on the MPR EOS for the Jehlicka 1A

well of Wilshire Oil Co. of Texas. The largest AAPD (of 12.39% deviation) above the

bubble point pressure was obtained by the model based on the PR EOS for the Jacques

Unit #5603 of the A.C.T Operating Company.

The smallest AAPD (of 19.10% deviation) for the predicted coefficient of

isothermal oil compressibility for the whole system (i.e. at pressures above and below the

bubble point pressure) was obtained from the model based on the MPR EOS for the

Jehlicka 1A well of Wilshire Oil Co. of Texas. The largest AAPD (of 32.44% deviation)

for the predicted coefficient of isothermal oil compressibility for the whole system (i.e. at

pressures above and below the bubble point pressure) was obtained from the model based

on the PR EOS for the Jacques Unit #5603 of the A.C.T Operating Company.

The suggested reason for the larger deviation in the predicted result for the

Jacques Unit #5603 of the A.C.T Operating Company is because the reservoir fluid

composition used was a recombination of the well stream production. The error acquired

through the recombination could be magnified by the EOS model.

This study used the components given in the fluid study report and lumped

together the heptane-plus (C7+). In order to quantify the effect of using more components,

the developed model was run using 24 components for the Jacques Unit #5603 of the

75
A.C.T Operating Company. The AAPD above the bubble point pressure was 2.84%

deviation above the bubble point pressure and 22.30% deviation for the total system for

the model based on the MPR EOS. This was smaller than the 10.66% deviation above the

bubble point pressure and 28.75% deviation for the total system for the model based on

MPR EOS when the C7+ was lumped together. For the model based on the PR EOS, the

AAPD increased from 12.39% to 49.92% deviation at pressures above the bubble point

and from 32.44% to 48.05% deviation for the total system at pressures above and below

the bubble point pressure.

The increase in the error in the model based on the PR EOS could be due to the

correlation used to calculate the critical parameter of the Eicosanes-plus (C20+). The

effect of this correlation was believed to be minimized in the model based on the MPR

EOS because the constant parameter a which is dependent of the components critical

parameter.

The number of iterations recorded in predicting the coefficient of isothermal oil

compressibility using 11 components of the Jacques Unit #5603 of the A.C.T. Operating

Company was 9,791. When the same reservoir fluid data was used to predict the

isothermal oil compressibility using the 24 components, the number of iterations recorded

was 24,961. This shows a 155 % increase in the number of iterations. This increase in the

number of iterations will translate into a higher computing cost when calculating the

isothermal compressibility for each grid cell in a compositional reservoir simulation.

76
CHAPTER V

CONCLUSIONS AND RECOMMENDATIONS

5.1 Conclusions

The following conclusions can be drawn from this project:

1. A mathematical model based on Peng-Robinson equation of state for calculating the

coefficient of isothermal oil compressibility was developed.

2. The mathematical model was extended to pressures below the bubble point, using the

two phase flash calculations.

3. A mathematical model based on Peng-Robinson equation of state was also developed

to predict the coefficient of isothermal gas compressibility at pressures below the

bubble point.

4. A mathematically consistent additive technique was developed to add the resultant

coefficient of isothermal oil compressibility and the coefficient of isothermal gas

compressibility at pressures below the bubble point.

5. A good degree of accuracy was obtained between the predicted coefficient of

isothermal oil compressibility from the developed EOS based mathematical model

and the experimentally derived coefficient of isothermal compressibility.

6. The predicted molar volume from the two phase calculation was reported and

compared with the experimental measured molar volume from Pressure-Volume

relations; a good degree of accuracy was achieved.

77
7. A computer algorithm (using FORTRAN) was developed to compute the coefficient

of isothermal oil compressibility using the developed mathematical model.

5.2 Recommendations

1. Research is very active in the area of two phase calculation to determine the

equilibrium quantity and composition of liquid and vapor in the two phase region. A

more robust two phase flash algorithm is recommended to increase the accuracy of

the predicted coefficient of isothermal oil compressibility at pressures below the

bubble point pressure.

2. A further work is recommended in tuning the developed mathematical model, using

the constant parameters of the Peng-Robinson EOS (i.e. a and b) and the binary

interaction parameter in order to achieve a higher level of accuracy.

3. In order to predict the isothermal compressibility of gas condensate reservoirs, it is

recommended that the developed mathematical model be coupled with the simulation

of constant volume depletion experiment.

4. Observations bothering on the analysis of the differential vaporization experiment

suggested that the accuracy of equation 3.45 be validated. The reason for this

validation is the slope change observed in the graph of the formation volume factor

and the pressure, at pressures above and below the bubble point pressure.

5. The developed model can also be extended to gas fields to predict the coefficient of

isothermal gas compressibility.

78
REFERENCES

1. Adetunji, L. A., Thermodynamically Equivalent Pseudo-components validated for


Compositional Reservoir Models. Ph.D. Dissertation, Texas Tech University,
Lubbock, Texas (May 2006).

2. Ahmed, T. H., Hydrocarbon Phase Behavior, Gulf Publishing Company, Vol. 7,


(1989).

3. Ahmed, T., A Practical Equation of State, paper SPE 18532, SPE Reservoir
Engineering, pp 137, February (1991).

4. Ahmed. T., Compositional Modeling of Tyler and Mission Canyon Formation Oils
with Co2 and Lean Gases, final report submitted to Montanans on a New Track
Science (MONTS) (Montana National Science Foundation Gran Program), 1985-
1988.

5. Ahmed, T. and McKinney, P. D., Advanced Reservoir Engineering, Gulf Professional


Publishing,pp1-4 (2005).

6. Alani, G. H. and Kennedy, H. T., Volumes of Liquid Hydrocarbons at High


Temperatures and Pressures, JPT, pp 272, November (1960).

7. Alani, G. H. and Kennedy, H. T., Volumes of Liquid Hydrocarbons at High


Temperatures and Pressures, Petroleum Transactions, AIME, Vol. 219, 288, (1960).

8. Al-Marhoun, M. A., The Coefficient of Isothermal Compressibility of Black Oils,


paper SPE 81432 presented at the SPE 13th Middle East Oil Show & Conference,
Bahrain, April 5-8 (2003).

9. Arbabi, S. and Firoozabadi, A., Near-Critical Phase Behavior of Reservoir Fluids


Using Equation of State, paper SPE 24491, SPE Advanced Technology Series,Vol 3,
No.1, pp 139, (1995).

10. Avasthi, S. M. and Kennedy, H. T., The Prediction of Volumes, Compressibilities


and Thermal Expansion Coefficients of Hydrocarbon Mixtures, Society of
Petroleum Journals, Vol. 234, pp 95, June (1958).

11. Brelvi, S. W., Correlations developed for compressibility, Oil & Gas Journal, pp
60, January 29 (2001).

12. Cameron, A., The Isothermal and Adiabatic Compressibility of Oil, Journal of the
Institute of Petroleum, Vol. 31, No. 263, November (1945).

79
13. Danesh, A., PVT and Phase Behavior of Petroleum Reservoir Fluids., Elsevier
Science, 2nd Edition, (2001).

14. De Ghetto, G., Paone, F. and Villa, M., Pressure-Volume-Temperature Correlations


for Heavy and Extra Heavy Oils, paper SPE 303316 presented at the 1995
International Heavy Oil Symposium, Calgary, Alberta, Canada, June 19-21.

15. De Ghetto, G., Paone, F. and Villa, M., Reliability Analysis on PVT Correlations,
paper SPE 28904 presented at the 1994 European Petroleum Conference, London,
U.K, October 25-27.

16. Dindoruk, B. and Christman, P. G., PVT Properties and Viscosity Correlations for
Gulf of Mexico Oils, SPEREE, pp 427-437, December, (2004).

17. Downer, L. and Gardiner, E. S., The Compressibility of Crude Oils, Journal of the
Institute of Petroleum, Vol. 58, No. 559, January (1972).

18. Firoozabadi, A. and Huanquan, P., Two-Phase Isentropic Compressibility and Two-
Phase Sonic Velocity for Multi component-Hydrocarbon Mixtures, paper SPE 38844
presented at the 1997 Annual Technical Conference and Exhibition, San Antonio,
Texas, October 5-8.

19. Firoozabadi, A. and Kashchiev, D., Pressure and Volume Evolution During Gas
Phase Formation in Solution Gas Drive Process, paper SPE 26286, SPE Journal, pp
219, September (1996).

20. Firoozabadi, A., Reservoir-Fluid Phase Behavior and Volumetric Prediction with
Equations of State, JPT, 397, (April, 1988).

21. Firoozabadi, A., Thermodynamics of Hydrocarbon Reservoirs., McGraw-Hill, (1999).

22. Glas, ., Generalized Pressure-Volume-Temperature Correlations, JPT, pp 785,


May (1980).

23. Hawkins, M. F., Material Balance in Expansion Type Reservoirs above Bubble
Point, paper SPE 499-G, Petroleum Transactions, AIME ,204, pp 267 (1955).

24. Lawal, A. S., Revival of the van der Waals Classical Theory via Silberberg
Constant, paper SPE 22712 presented at the 1991 Annual Technical Conference and
Exhibition, Dallas, Texas, October 6-9.

80
25. Lawal, A. S., Van der Laan, E. T., and Thambynayagam, R. K. M., Four-Parameter
Modification of the Lawal-Lake-Silberberg Equation of State for Calculating Gas-
Condensate Phase Equilibria, paper SPE 14269 presented at the 1985 Annual
Technical Conference and Exhibition, Las Vegas, Nevada, September 22-25.

26. Macias, L. C. Multiphase, Multicomponent Compressibility in Petroleum Reservoir


Engineering, paper SPE 15538, presented at the 1986 Annual Technical Conference
and Exhibition, New Orleans, LA, October 5-8.

27. Martin, J. C., Simplified Equations of Flow in Gas Drive Reservoirs and the
Theoretical Foundation of Multiphase Buildup Analyses, paper SPE 1235-G,
Petroleum Transactions, Vol. 216, 321 (1959).

28. McCain, W. D., Reservoir-Fluid Property Correlations-State of the Art, SPE


Reservoir Engineering, pp 266, May (1991).

29. McCain, W. D., Jr., The Properties of Petroleum Fluids., PennWell Books, 2nd
Edition, (1990).

30. McCain, W. D., Rollins, J. B. and Villena Lanzi, A. J., The Coefficient of Isothermal
Compressibility of Black Oils at Pressures Below the Bubble Point, SPE Formation
Evaluation, pp 659, September (1988).

31. Nghiem, L. X. and Li, Y. K., Approximate Flash Calculations for Equation-of-State
Compositional Models, SPE Reservoir Engineering, pp 107, February (1990).

32. Peng, D. Y. and Robinson, D. B.,A New Two-Constant Equation of State, Ind. Eng.
Chem. Fundamentals, 15, 59 (1976).

33. Petrosky, G. E., Jr. Pressure-Volume-Temperature Correlations for Gulf of Mexico


Crude Oils, SPE Reservoir Evaluation & Engineering, pp 416, October (1998).

34. Rachford, H. H., Jr. and Rice, J. D., Procedure for Use of Electronic Digital
Computers in Calculating Flash vaporization Hydrocarbon Equilibrium, Petroleum
Transactions, AIME, Vol. 195, 327, (1952).

35. Ramey, H. J., Rapid Methods for Estimating Reservoir Compressibilites, paper
SPE 772, JPT, 447, April (1964).

36. Reservoir Fluid Study on Jacques Unit #5603, Rough Ride Field, Core Laboratories,
Inc. Report (Aug 1999).

81
37. Reservoir Fluid Study on Jehlicka 1A Well, Core Laboratories, Inc. Report (May
1984).

38. Spivey, J. P., Valko, P. P. and McCain, W. D., Applications of the Coefficient of the
Isothermal Compressibility to Various Reservoir Situations with New Correlation for
Each Situation, paper SPE 96415 presented at the 2005 Annual Technical
Conference and Exhibition, Dallas, Texas, October 9-12.

39. Standing, M. B., Volumetric and Phase Behavior of Oil Field Hydrocarbon Systems. ,
Society of Petroleum Engineers of AIME, Dallas, Texas (1977).

40. Tododo, A. O., Thermodynamically Equivalent Pseudocomponents for Compositional


Reservoir Simulation Models. Ph.D. Dissertation, Texas Tech University, Lubbock,
Texas (May 2005).

41. Trube, A. S., Compressibility of Natural Gases, paper SPE-697-G, Technical Note,
398, pp 69, January (1957).

42. Trube, A. S., Compressibility of Undersaturated Hydrocarbon Reservoir Fluids,


paper SPE 899-G, Petroleum Transactions, Vol. 210, pp 341, (1957).

43. Vasquez, M. and Beggs, H. D., Correlations for Fluid Physical Property Prediction,
JPT, pp. 968-970, June (1980).

44. Whitson, C. H. and Brule, M. R., Phase Behavior., Monograph Series, SPE,
Richardson, Texas (2000).

45. Wilson, G., A Modified Redlich-Kwong EOS, Application to General Physical Data
Calculations, paper 15C, presented at the Annual AIChE National Meeting held in
Cleveland, Ohio, May 4-7 (1968).

46. Yale, D. P., Nabor, G. W. and Russell, J. A., Application of Variable Formation
Compressibility for Improved Reservoir Analysis, paper SPE 26647 presented at the
1993 Annual Technical Conference and Exhibition, Houston, Texas, October 3-6.

47. Young, L. C., Continuous Compositional Volume-Balance Equations, paper 66346


presented at the 2001 SPE Reservoir Simulation Symposium, Houston, Texas,
February 11-14 (2001).

82
APPENDIX A

DERIVATION OF PR EOS COMPRESSIBILITY

FACTOR AND MOLAR VOLUME

EQUATION

A.1 Derivation of PR EOS Compressibility Factor Equation

The PR EOS is expressed as (ref),

RT a
P=
V b V(V + b) + b(V b) (A.1)

Multiplying both sides by (V b),

a(V b)
P(V b) = RT
V(V + b) + b(V b) (A.2)

Simplifying,

a(V b)
P(V b) = RT
V + 2Vb b 2
2
(A.3)

P(V b)(V 2 + 2Vb b 2 ) = RT(V 2 + 2Vb b 2 ) a(V b) (A.4)

Expanding,

P(V 3 + 2bV 2 Vb 2 bV 2 2Vb 2 + b 3 ) = RT(V 2 + 2Vb b 2 ) a(V b) (A.5)

Dividing by RT,

P a
(V 3 + bV 2 3Vb 2 + b 3 ) = (V 2 + 2Vb b 2 ) (V b)
RT RT (A.6)

83
ZRT
V=
But P (Real gas equation), hence (A.6) becomes,

P Z3 (RT)3 3 Z 2 (RT) Z(RT) 2 a Z(RT)


2
Z 2 (RT)2 2 Z(RT)
3
+ b 2
3b + b = 2
+ 2b b b
RT P P P P P RT P

(A.7)

Simplifying equation A.7 gives,

Z 3 (RT) 2 Z 2 (RT) 3 P Z 2 (RT) 2 Z(RT) Z ba


2
+ b 3b 2
Z + b 2
2b + b2 + a =0
P P RT P P P RT (A.8)

Multiplying by P2 gives,

P3 aPbP
Z 3 (RT) 2 + bZ 2 (RT)P 3P 2 b 2 Z + b 3 Z 2 (RT) 2 2bZ(RT)P + P 2 b 2 + aZP =0
RT RT

(A.9)

Dividing by (RT)2 gives,

bP Pb Pb P3 Pb Pb Pb aP aP bP
Z3 + Z 2 3Z + b3 3
Z 2 2Z + +Z 2
=0
RT RT RT (RT) RT RT RT (RT) (RT) 2 RT

(A.10)

bP aP
B= A= 2 2
But RT and R T , therefore,

Z 3 + Z 2 B 3ZB 2 + B 3 Z 2 2ZB + B 2 + AZ AB = 0 (A.13)

Z 3 (1 B)Z 2 + (A 3B 2 2B)Z (AB B 2 B 3 ) = 0 (A.14)

84
A.2 Derivation of PR EOS Molar Volume Equation

The PR EOS is expressed as,

RT a
P=
V b V(V + b ) + b(v b) (A.15)

Multiplying through by (V b) gives,

a (V b )
P(V b ) = RT
V(V + b ) + b(v b) (A.16)

Simplifying,

P(V b )(V(V + b ) + b(v b) ) = RT (V(V + b ) + b(v b) ) a (v b ) (A.17)

( ) ( )
P V 3 + 2V 2 b Vb 2 bV 2 2Vb 2 + b 3 = RT V 2 + 2Vb b 2 a (v b ) (A.18)

( ) ( )
P V 3 + V 2 b 3Vb 2 + b 3 RT V 2 + 2Vb b 2 + a (v b ) = 0 (A.19)

Dividing by p and simplifying gives,

RT 2 a RT 3 RT 2 aP
V3 + b V + 3b 2b
2
V + b + b =0
P P P P b (A.20)

85
APPENDIX B

DERIVATION OF PR EOS BASED ISOTHERMAL

COMPRESSIBILITY EQUATION

The coefficient of isothermal compressibility (c) is defined by

1 V
c=
V p T
(B.1)

The Peng-Robinson EOS is expressed as,

RT a
p=
V b V(V + b ) + b(V b ) (B.2)

Differentiating equation (B.2) gives,

p RT 2a (V + b )
= +
V T (V b )
2
(
V + 2bV b 2
2
)
2
(B.3)

Simplifying equation B.3 gives,

p
=
2
(
2a (V + b )(V b ) RT V 2 + 2bV b 2 )
2

V T (
(V b )2 V 2 + 2bV b 2 2) (B.4)

Inverting equation B.4 gives,

V
=
( 2
(
V b ) V 2 + 2bV b 2 )
2

2
(
p T 2a (V + b )(V b ) RT V 2 + 2bV b 2 )
2
(B.5)

Therefore the PR EOS based coefficient of isothermal compressibility equation is

expressed as,

86
1
co =
2
(
(V b ) V 2 + 2bV b 2 )2


(
V 2a (V + b )(V b )2 RT V 2 + 2bV b 2 )
2
(B.6)

The molar volume V in equation B.6 is determined from the cubic molar volume

equation of the PR EOS. The cubic molar volume equation of the PR EOS is expressed

as,

RT a RT RTb 2 ap
V 3 b V 2 + 3b 2 2b V + b 3 + = 0
p p p p b
(B.7)

87
APPENDIX C

DERIVATION OF THE PR EOS ISOTHERMAL

GAS COMPRESSIBILITY EQUATION

The compressibility factor equation of the PR EOS is given as,

Z 3 (1 B)Z 2 + (A 3B 2 2B)Z (AB B 2 B 3 ) = 0 (C.1)

bP aP
B= A= 2 2
where RT and R T

Replacing A and B in equation C.1 gives,

bp 2 ap bp ap bp bp 2 bp 3
2
bp
Z 3 1 Z + 3 2 Z
RT RT RT = 0
(RT ) (RT )
2 2
RT RT RT

(C.2)

The coefficient of isothermal gas compressibility is expressed as,

1 1 z
cg =
p z p T
(C.3)

Differentiating equation C.2 implicitly gives,

z z bp z z 2 b ap z za

3z 2z + 2z
2
+ + + 2
p T p T RT p T RT (RT ) p T (RT )
2

3(bp )2 z 6zpb 2 2bp z 2zb 2abp 2pb 2 3p 2 b 3


+ 2
+
=0
(RT )
2
p T (RT ) RT p T RT (RT ) (RT )
3 2
(RT )3
(C.4)

88
Simplifying equation C.4 gives,

z 2 bp ap 3(bp )2 2bp
3z 2z + 2z + =
p RT (RT )2 (RT )2 RT

6zpb 2 2zb 2abp z 2 b za 2pb 2 3p 2 b 3


+ +
(RT )2 RT (RT )3 RT (RT )2 (RT )2 (RT )3 (C.5)

6zpb 2 2zb 2abp z 2 b za 2pb 2 3p 2 b 3


+ +
z (RT ) 2 RT (RT ) 3 RT (RT ) (RT ) (RT )3
2 2
=
p bp ap 3(bp )2 2bp
3z 2 2z + 2z +
RT (RT )2 (RT )2 RT

(C.6)

Therefore the PR EOS based equation for the isothermal gas compressibility is

expressed as,

6zpb 2 2zb 2abp z 2 b za 2pb 2 3p 2 b 3


+ +
1 1 (RT )2 RT (RT )3 RT (RT )2 (RT )2 (RT )3
c = (C.7)
g p z bp ap 3(bp )2 2bp
3z 2 2z + 2z +
RT (RT )2 (RT )2 RT

89
APPENDIX D

DERIVATION OF THE FLASH CALCULATION ALGORITHM 2 pp 244-247

Flash calculation is used to calculate the equilibrium quantity and composition of

vapor and liquid below the bubble point pressure. Flash calculation is a simulation of

the flash vaporization process.

nv (y i)

n (z i)

nL (x i)

Figure D.1: Schematic of the Flash Vaporization Process

where,

n = total number of moles of the hydrocarbon mixture, lb-mole

nL = total number of moles of the liquid phase, lb-mole

nV = total number of moles in the vapor (gas) phase, lb-mole

zi = mole fraction of component i in the entire hydrocarbon mixture

xi = mole fraction of component i in the liquid phase

yi = mole fraction of component i in the vapor phase

90
Considering the mole balance,

n = nL + nV (D.1)

A component based material balance gives,

zi n = xi nL + yi nV (D.2)

By definition of mole fraction,

x i =1
(D.3)

y i =1
(D.4)

z i =1
(D.5)

For simplicity phase-equilibra calculations are based on one mole of the

hydrocarbon mixture, i.e., n =1. Therefore,

nL + nV = 1 (D.6)

zi = xi nL + yi nV (D.7)

Mathematically, the equilibrium ration K for component i is defined as,

yi
Ki =
xi (D.8)

Combining equation D.8 and equation D.7, gives,

z =x n +x K n
i i L i i V (D.9)

Solving for xi from equation D.9 gives,

zi
xi =
nL + KinV (D.10)

Solving for yi, gives,

91
ziKi
yi =
nL + KinV (D.11)

Combining equation D.10 and D.3 gives,

zi
x = n
i
+ nVKi
=1
i i L (D.12)

Combining equation D.11 and D.4 gives,

ziKi
y = n
i =1
i i L + nVKi (D.13)

But x i =1
and y i =1

Hence, y x
i i =0

ziKi zi
n =0
i L + nVKi i nL + nVKi
(D.14)

Simplifying equation D.14,

z i (K i 1)
n =0
i L + nVKi (D.15)

From equation D.6

nL = 1 - nV (D.16)

Combining equations D.15 and D.16 gives,

z i (K i 1)
n (K =0
i V i 1) + 1 (D.17)

92
In order to determine the moles and the compositions of the vapor and liquid

phases in the reservoir at temperatures below the bubble point pressure, equation D.17

is solved numerically to obtain nV. The calculated mole fraction of the vapor phase can

then be used to calculate the mole fraction of the individual component in the vapor and

liquid phase using equations D.10 and D.11.

In this study equation D.15 is solved using the Newton Raphsons method. The

mole fraction of the vapor phase is calculated by an iterative process using,

(n v )
(n V )n +1 = (n V )n f
f' (n v ) (D.18)

where n and n+1 indicates the iterative steps and the functions are defined as,

z i (K i 1)
f (n V ) =
i n V (K i 1) + 1 (D.19)

z i (K i 1)2
f' (n V ) = 2
[n V (K i 1) + 1]
i
(D.20)

This iteration is carried performed till the desired convergence is achieved.

93
APPENDIX E

MATHEMATICAL CONSISTENCY OF ISOTHERMAL

COMPRESSIBILITY ADDITION BELOW

BUBBLE POINT PRESSURE

At pressures below the bubble point pressure the hydrocarbon mixture is in the

two phase region (Figure E.1), containing hydrocarbon liquid and vapor. Each of these

phases has an isothermal compressibility effect on the total system.

Gas Vg; cg
Oil
Vt Vt
co co
Oil VL; cL

P > Pb P < Pb

Figure E.1: Schematic Diagram of Volume and Isothermal Compressibility at pressures


above and below the bubble point pressure.

From figure E.1, the total volume of the system can be represented by,

Vt = VL + Vg
(E.1)

Differentiating equation E.1 in terms of pressure as constant temperature gives,

94
Vt V Vg
= L +
p T p T p T (E.2)

The coefficients of isothermal compressibility are defined as,

1 Vt
ct =
Vt p T (E.3)

1 VL
cL =
VL p T (E.4)

1 Vg
cg =
Vg p T (E.5)

The proposed method for adding the coefficient of isothermal oil compressibility

and the coefficient of isothermal gas compressibility is described as,

Vg VL
ct = cg + cL
Vt Vt (E.6)

Combining equations E.3, E.4, E.5 and E.6 gives,

1 Vt V 1 VL Vg 1 Vg
= L +
Vt p T Vt VL p T Vt Vg p T (E.7)

V
Substituting for t in equation E.7, using equation E.2 gives,
p T

1 VL Vg VL 1 VL Vg 1 Vg
+ = +
Vt p T p T Vt VL p T Vt Vg p T (E.8)

Simplifying,

95
1 VL 1 Vg 1 VL 1 Vg
+ = +
Vt p T Vt p T Vt p T Vt p T (E.9)

This shows that equation E.6 is mathematically consistent.

96
APPENDIX F

RESERVOIR FLUID STUDY REPORT AND ANALYSIS

The coefficient of isothermal oil compressibility of not measured directly in the

laboratory. It is calculated from the experimental data reported in the reservoir fluid

study report.

The coefficient of isothermal oil compressibility is calculated from the Pressure-

Volume Relations at pressures above the bubble point pressure. The expressions used to

calculate the coefficient of isothermal oil compressibility at pressures above the bubble

point pressure is given as29 pp 288 ,

Vt

Vb 2
ln
V
t
Vb 1
co = (F.1)
p1 p 2

V
where t are Pressure-Volume Relations data at different pressures of interest.
Vb

At pressures below the bubble point pressure, the coefficient of isothermal oil

compressibility is calculated from the experimental Differential Vaporization data. This

expression is given as 27, 35

1 B o Bg R s
co = +
Bo p T Bo p T (F.2)

97
Equation F.2 is further simplified by McCain 29 p. 290, to give

1 R SD B
co = B g OD
B oD p T p T (F.3)

The subscript D shows that the data are from the differential vaporization

experiment.

The experimental molar volume and isothermal oil compressibility are determined

in the Tables below.

98
F.1 Reservoir Fluid Study Field Report 129 pp 259-269

Company: Good Oil Company


Well: Oil Well No. 4
Field: Productive
County and State: Samson, Texas.
Bubble Point Pressure: 2620 psig @ 220 oF
Specific Volume at saturation Pressure: 0.02441 (ft 3/lb) @ 220 oF

Table F.1: Reservoir Fluid Composition for Oil Well No. 4


1 2 (1/100) x 2
Molecular Weight
Component Mol % (lbm/lbm mol) App Mol Weight
H2S 0.00 34.08 0.0000
CO2 0.91 44.01 0.4005
N2 0.16 28.02 0.0448
CH4 36.47 16.04 5.8498
C2H6 9.67 30.07 2.9078
C3H8 6.95 44.09 3.0643
i-C4H10 1.44 58.12 0.8369
n-C4 3.93 58.12 2.2841
i-C5 1.44 72.15 1.0390
n-C5 1.41 72.15 1.0173
C6 4.33 86.17 3.7312
C7+ 33.29 218.00 72.5722
Total 100 93.7478
Sp Gr C7+
= 0.8515
Source: McCain29 p. 260

99
Table F.2: Molar Volume Determination from Pressure-Volume Relations for Oil Well No. 4

Vt *ft3/lbmol)
Pressure (1) Rel Vol (2) Vsat * Rel = App Mol
(psig) (Vt/Vo) Vol ( ft3/lb) Wt * (2) co(psi-1)
5000 0.9639 0.0235 2.2058
4500 0.9703 0.0237 2.2204 1.32E-05
4000 0.9771 0.0239 2.2360 1.40E-05
3500 0.9846 0.0240 2.2531 1.53E-05
3000 0.9929 0.0242 2.2721 1.68E-05
2900 0.9946 0.0243 2.2760 1.71E-05
2800 0.9964 0.0243 2.2801 1.81E-05
2700 0.9983 0.0244 2.2845 1.91E-05
2620 1.0000 0.0244 2.2884 2.13E-05
2605 1.0022 0.0245 2.2934
2591 1.0041 0.0245 2.2978
2516 1.0154 0.0248 2.3236
2401 1.0350 0.0253 2.3685
2253 1.0645 0.0260 2.4360
2090 1.1040 0.0269 2.5264
1897 1.1633 0.0284 2.6621
1698 1.2426 0.0303 2.8435
1477 1.3618 0.0332 3.1163
1292 1.5012 0.0366 3.4353
1040 1.7802 0.0435 4.0738
830 2.1623 0.0528 4.9482
640 2.7513 0.0672 6.2960
472 3.7226 0.0909 8.5187

100
Table F.3: Differential Vaporization data for Oil Well No. 4
Pressure Bg (res cu Bg(res
(psig) Rsd BoD ft/ bbl) dRsd/dp dBod/dRsd bbl/scf) co(p<pb)
2620 854 1.6000
2350 763 1.5540 0.0069 0.3370 0.0005 0.0012 1.55E-04
2100 684 1.5150 0.0077 0.3160 0.0005 0.0014 1.83E-04
1850 612 1.4790 0.0088 0.2880 0.0005 0.0016 2.09E-04
1600 544 1.4450 0.0103 0.2720 0.0005 0.0018 2.53E-04
1350 479 1.4120 0.0125 0.2600 0.0005 0.0022 3.15E-04
1100 416 1.3820 0.0155 0.2520 0.0005 0.0028 4.17E-04
850 354 1.3510 0.0204 0.2480 0.0005 0.0036 5.76E-04
600 292 1.3200 0.0293 0.2480 0.0005 0.0052 8.87E-04
350 223 1.2830 0.0507 0.2760 0.0005 0.0090 1.83E-03
159 157 1.2440 0.1083 0.3455 0.0006 0.0193 5.20E-03

101
F.2 Reservoir Fluid Study Report 2 37

Company: Wilshire Oil Co. of Texas


Well: Jehlicka 1A
Field: S. Elmwood
County and State: Beaver, Oklahoma.
Bubble Point Pressure: 2663 psig @ 162 oF
Specific Volume at saturation Pressure: 0.02380 (ft 3/lb) @ 162 oF

Table F.4: Reservoir Fluid Composition for Jehlicka 1A


Molecular
Weight App. Mol.
Component Mol % (lbm/lbm mol) Weight
H2S 0.00 34.08 0.00
CO2 0.49 44.01 0.22
N2 0.53 28.02 0.15
CH4 38.83 16.04 6.23
C2H6 9.86 30.07 2.96
C3H8 9.53 44.09 4.20
i-C4H10 1.23 58.12 0.71
n-C4 4.31 58.12 2.50
i-C5 1.20 72.15 0.87
n-C5 1.87 72.15 1.35
C6 2.82 86.17 2.43
C7+ 29.33 252.00 73.91
Total 100.00 95.54
Sp Gr C7+
= 0.8413

102
Table F.5: Molar Volume Determination from Pressure-Volume Relations for Jehlicka 1A
Vsat *
Pressure RelVol Rel Vt (ft3 /
(psig) (Vt/Vo) Vol lb mol) co(psi-1)
5000 0.9724 0.0231 2.2110
4500 0.9775 0.0233 2.2226 1.05E-05
4000 0.9830 0.0234 2.2351 1.12E-05
3500 0.9890 0.0235 2.2487 1.22E-05
3000 0.9954 0.0237 2.2633 1.29E-05
2900 0.9967 0.0237 2.2662 1.31E-05
2800 0.9981 0.0238 2.2694 1.40E-05
2700 0.9995 0.0238 2.2726 1.40E-05
2663 1.0000 0.0238 2.2737 1.35E-05
2639 1.0025 0.0239 2.2794
2577 1.0093 0.0240 2.2949
2493 1.0195 0.0243 2.3181
2351 1.0399 0.0247 2.3645
2178 1.0808 0.0257 2.4575
1998 1.1119 0.0265 2.5282
1797 1.1718 0.0279 2.6644
1590 1.2560 0.0299 2.8558
1378 1.3761 0.0328 3.1289
1179 1.5392 0.0366 3.4998
935 1.8540 0.0441 4.2155
746 2.2638 0.0539 5.1473
577 2.8810 0.0686 6.5507
421 3.9124 0.0931 8.8958

103
Table F.6: Differential Vaporization data for Jehlicka 1A
Pressure Bg (res cu Bg(res
(PSIG) Rsd BoD ft/ bbl) dRsd/dp dBod/dRsd bbl/scf) co(1/psia)
2663 928 1.5150
2400 840 1.4750 0.0059 0.3346 0.0005 0.0010 1.34E-04
2150 765 1.4410 0.0065 0.3000 0.0005 0.0012 1.48E-04
1900 690 1.4080 0.0075 0.3000 0.0004 0.0013 1.89E-04
1650 619 1.3760 0.0087 0.2840 0.0005 0.0015 2.27E-04
1400 547 1.3450 0.0105 0.2880 0.0004 0.0019 3.07E-04
1150 476 1.3150 0.0130 0.2840 0.0004 0.0023 4.09E-04
900 407 1.2850 0.0170 0.2760 0.0004 0.0030 5.57E-04
650 336 1.2530 0.0241 0.2840 0.0005 0.0043 8.69E-04
400 262 1.2180 0.0398 0.2960 0.0005 0.0071 1.61E-03
183 183 1.1760 0.0861 0.3641 0.0005 0.0153 4.58E-03

104
F.3 Reservoir Fluid Study Report 3 36

Company: A.C.T. Operating Company


Well: Jacques Unit #5603
Field: Rough Ride Field
County and State: Fisher County, Texas.
Bubble Point Pressure: 1675 psig @ 138 oF
Specific Volume at saturation Pressure: 0.022584 (ft 3/lb) @ 138 oF

Table F.7: Reservoir Fluid Composition for Jacques Unit #5603


Molecular
Weight
(lbm/lbm App. Mol.
Component Mol % mol) Weight
H2S 0.00 34.08 0.00
CO2 0.16 44.01 0.07
N2 1.94 28.02 0.54
CH4 25.50 16.04 4.09
C2H6 7.37 30.07 2.22
C3H8 11.21 44.09 4.94
i-C4H10 3.49 58.12 2.03
n-C4 4.17 58.12 2.42
i-C5 2.18 72.15 1.57
n-C5 2.76 72.15 1.99
C6 3.67 86.17 3.16
C7+ 37.55 209.00 78.48
Total 100 101.52
Sp Gr C7+
= 0.8467

105
Table F.8: Molar Volume Determination from Pressure-Volume Relations for Jacques Unit #5603
Pressure Rel Vol Vsat * Vt(ft3/lb
(psig) (Vt/Vo) Rel Vol mole) co(psi-1)
5000 0.9672 0.0218 2.2175
4500 0.9713 0.0219 2.2269 8.46E-06
4000 0.9756 0.0220 2.2368 8.83E-06
3500 0.9802 0.0221 2.2474 9.41E-06
3000 0.9851 0.0222 2.2586 9.97E-06
2500 0.9904 0.0224 2.2707 1.07E-05
2000 0.9961 0.0225 2.2838 1.15E-05
1900 0.9973 0.0225 2.2866 1.20E-05
1800 0.9985 0.0226 2.2893 1.20E-05
1700 0.9997 0.0226 2.2921 1.20E-05
1675 1.0000 0.0226 2.2928 1.20E-05
1666 1.0018 0.0226 2.2969
1656 1.0038 0.0227 2.3015
1646 1.0059 0.0227 2.3063
1636 1.0080 0.0228 2.3111
1613 1.0129 0.0229 2.3223
1527 1.0334 0.0233 2.3693
1388 1.0745 0.0243 2.4636
1230 1.1375 0.0257 2.6080
1050 1.2413 0.0280 2.8460
886 1.3846 0.0313 3.1745
733 1.5913 0.0359 3.6485
617 1.8302 0.0413 4.1962
487 2.2541 0.0509 5.1681
376 2.8730 0.0649 6.5871
273 3.9223 0.0886 8.9929

106
Table F.9: Differential Vaporization data for Jacques Unit #5603
Bg (res
Pressure cu ft/ Bg(res
(psig) Rsd BoD bbl) dRsd/dp dBod/dRsd bbl/scf) co(p<pb)
1675 691 1.3980
1500 646 1.3800 0.0095 0.2571 0.0004 0.0017 2.39E-04
1350 608 1.3640 0.0106 0.2533 0.0004 0.0019 2.72E-04
1200 569 1.3480 0.0120 0.2600 0.0004 0.0021 3.32E-04
1050 530 1.3320 0.0138 0.2600 0.0004 0.0025 3.99E-04
900 490 1.3150 0.0162 0.2667 0.0004 0.0029 4.98E-04
750 448 1.2980 0.0195 0.2800 0.0004 0.0035 6.63E-04
600 404 1.2790 0.0246 0.2933 0.0004 0.0044 9.05E-04
450 356 1.2580 0.0330 0.3200 0.0004 0.0059 1.38E-03
300 301 1.2320 0.0495 0.3667 0.0005 0.0088 2.48E-03
160 237 1.2000 0.0909 0.4571 0.0005 0.0162 5.98E-03

107
APPENDIX G

RESERVOIR FLUIDS CRITICAL PROPERTIES TABLE

The critical properties used in calculating the constant parameters of the Peng-
Robinson EOS are given in Table G.1. 44 pp 162, 13 pp 354

Table G.1: Reservoir Fluids Critical Properties.


Critical Critical
Temperature Pressure Acentric Critical Molecular
Component (oR) (psia) Factor z Weight
CO2 547.60 1070.60 0.2301 0.2742 44.01
N2 227.30 493.00 0.0450 0.2916 28.02
C1 343.00 667.80 0.0115 0.2884 16.04
C2 549.80 707.80 0.0908 0.2843 30.07
C3 665.70 616.30 0.1454 0.2804 44.09
i-C4 734.70 529.10 0.1756 0.2824 58.12
n-C4 765.30 550.70 0.1928 0.2736 58.12
i-C5 828.80 490.40 0.2273 0.2701 72.15
n-C5 845.40 488.60 0.2510 0.2623 72.15
C6 913.40 436.90 0.2900 0.2643 86.17
C7 972.36 397.30 0.3495 0.2611 100.20
C8 1023.66 361.05 0.3996 0.2559 114.23
C9 1070.28 332.05 0.4435 0.2520 128.26
C10 1111.86 305.95 0.4923 0.2465 142.29
C11 1150.20 282.61 0.5303 0.2419 156.31
C12 1184.40 263.90 0.5764 0.2382 170.34
C13 1215.00 243.60 0.6174 0.2320 184.37
C14 1247.40 227.65 0.6430 0.2262 198.39
C15 1274.40 214.60 0.6863 0.2235 212.42
C16 1301.40 203.00 0.7174 0.2199 226.45
C17 1324.80 194.30 0.7697 0.2190 240.47
C18 1344.60 184.15 0.8114 0.2168 254.50
C19 1364.40 175.45 0.8522 0.2150 268.53

108
APPENDIX H

AVERAGE ABSOLUTE PERCENT DEVIATION (AAPD)

The relative errors of the predicted molar volumes and the isothermal oil compressibility
are given in the Tables below.

Table H.1: The AAPD for the Predicted Molar Volume for Oil Well No. 4, Good Oil
Company. Samson, Texas.
Volume (ft3/lb mole) ERROR
AAPD AAPD
Pressure(psia) Exptal PR EOS MPR EOS PR EOS MPR EOS
5014.7 2.2058 2.2047 2.2672 0.05 2.79
4514.7 2.2204 2.2201 2.2816 0.01 2.76
4014.7 2.2360 2.2371 2.2974 0.05 2.75
3514.7 2.2531 2.2559 2.3148 0.12 2.73
3014.7 2.2721 2.2770 2.3341 0.21 2.73
2914.7 2.2760 2.2815 2.3382 0.24 2.73
2814.7 2.2801 2.2861 2.3424 0.26 2.73
2714.7 2.2845 2.2909 2.3468 0.28 2.73
2634.7 2.2884 2.2948 2.3503 0.28 2.71
2619.7 2.2934 2.2033 2.6633 3.93 16.13
2605.7 2.2978 2.2083 2.6655 3.89 16.00
2530.7 2.3236 2.2427 2.6804 3.48 15.35
2415.7 2.3685 2.2897 2.7081 3.33 14.34
2267.7 2.4360 2.3597 2.7531 3.13 13.02
2104.7 2.5264 2.4519 2.8157 2.95 11.45
1911.7 2.6621 2.5878 2.9152 2.79 9.51
1712.7 2.8435 2.7688 3.0547 2.63 7.42
1491.7 3.1163 3.0482 3.2799 2.19 5.25
1306.7 3.4353 3.3596 3.5454 2.21 3.21
1054.7 4.0738 3.9944 4.1111 1.95 0.92
844.7 4.9482 4.8609 4.9103 1.76 0.77
654.7 6.2960 6.1895 6.1702 1.69 2.00
486.7 8.5187 8.3257 8.2369 2.27 3.31
Avg = 1.73 6.23

109
Table H.2: The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility for Oil Well No. 4, Good Oil Company.
Samson, Texas.
Isothermal Compressibility (psia-1) ERROR
AAPD AAPD
PR MPR
Pressure(psia) Exptal PR EOS MPR EOS EOS EOS
5014.7 1.33E-05 1.21E-05
4514.7 1.32E-05 1.45E-05 1.32E-05 9.86 0.42
4014.7 1.40E-05 1.59E-05 1.44E-05 14.12 2.95
3514.7 1.53E-05 1.76E-05 1.58E-05 15.09 3.32
3014.7 1.68E-05 1.96E-05 1.75E-05 16.74 4.18
2914.7 1.71E-05 2.01E-05 1.79E-05 17.20 4.46
2814.7 1.81E-05 2.05E-05 1.83E-05 13.49 0.99
2714.7 1.91E-05 2.10E-05 1.87E-05 10.23 2.00
2634.7 2.13E-05 2.14E-05 1.90E-05 0.67 10.62
2364.7 1.55E-04 2.35E-04 2.06E-04 51.36 32.74
2114.7 1.83E-04 2.74E-04 2.44E-04 49.50 33.11
1864.7 2.09E-04 3.26E-04 2.95E-04 56.44 41.59
1614.7 2.53E-04 3.96E-04 3.65E-04 57.00 44.63
1364.7 3.15E-04 4.95E-04 4.65E-04 57.34 47.75
1114.7 4.17E-04 6.44E-04 6.16E-04 54.26 47.63
864.7 5.76E-04 8.84E-04 8.63E-04 53.61 49.84
614.7 8.87E-04 1.33E-03 1.32E-03 50.41 49.26
364.7 1.83E-03 2.42E-03 2.44E-03 32.84 33.52
173.7 5.20E-03 5.42E-03 5.47E-03 4.37 5.20
Avg = 31.36 23.01

110
Table H.3: The AAPD for the Predicted Molar Volume for Jacques Unit #5603, Rough Ride Field, A.C.T. Operating
Company, Fisher County, Texas.
Volume (ft3/lb mole) ERROR
Pressure (psia) Exptal PR EOS MPR EOS AAPD PR EOS AAPD MPR EOS
5014.7 2.2175 2.2330 2.3248 0.70 4.83
4514.7 2.2269 2.2426 2.3345 0.70 4.83
4014.7 2.2368 2.2528 2.3451 0.72 4.84
3514.7 2.2474 2.2640 2.3565 0.74 4.86
3014.7 2.2586 2.2761 2.3689 0.78 4.88
2514.7 2.2707 2.2893 2.3824 0.82 4.92
2014.7 2.2838 2.3039 2.3974 0.88 4.97
1914.7 2.2866 2.3070 2.4006 0.89 4.99
1814.7 2.2893 2.3102 2.4038 0.91 5.00
1714.7 2.2921 2.3134 2.4071 0.93 5.02
1689.7 2.2928 2.3142 2.4079 0.94 5.02
1680.7 2.2969 2.1812 2.4891 5.04 8.37
1670.7 2.3015 2.1860 2.4929 5.02 8.32
1660.7 2.3063 2.1909 2.4968 5.00 8.26
1650.7 2.3111 2.1959 2.5008 4.99 8.21
1627.7 2.3223 2.2076 2.5106 4.94 8.11
1541.7 2.3693 2.2565 2.5506 4.76 7.65
1402.7 2.4636 2.3549 2.6325 4.41 6.86
1244.7 2.6080 2.5060 2.7595 3.91 5.81
1064.7 2.8460 2.7572 2.9765 3.12 4.59
900.7 3.1745 3.0966 3.2800 2.45 3.32
747.7 3.6485 3.5832 3.7261 1.79 2.13
631.7 4.1962 4.1440 4.2506 1.24 1.30
501.7 5.1681 5.1419 5.2026 0.51 0.67
390.7 6.5871 6.6222 6.6328 0.53 0.69
287.7 8.9929 9.1869 9.1431 2.16 1.67
Avg = 2.26 5.00

111
Table H.4: The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility for Jacques Unit #5603, Rough Ride
Field, A.C.T. Operating Company, Fisher County, Texas (Using 11 components).
Isothermal Compressibility (psia-1) ERROR
AAPD PR AAPD
Pressure (psia) Exptal PR EOS MPR EOS EOS MPR EOS
5014.7 8.24E-06 8.10E-06
4514.7 8.46E-06 8.83E-06 8.68E-06 4.36 2.61
4014.7 8.83E-06 9.49E-06 9.34E-06 7.43 5.66
3514.7 9.41E-06 1.03E-05 1.01E-05 8.95 7.14
3014.7 9.97E-06 1.11E-05 1.09E-05 11.40 9.70
2514.7 1.07E-05 1.21E-05 1.19E-05 12.94 11.17
2014.7 1.15E-05 1.33E-05 1.31E-05 15.79 14.05
1914.7 1.20E-05 1.36E-05 1.34E-05 12.54 10.88
1814.7 1.20E-05 1.38E-05 1.36E-05 14.92 13.26
1714.7 1.20E-05 1.41E-05 1.39E-05 17.39 15.73
1689.7 1.20E-05 1.42E-05 1.40E-05 18.15 16.40
1514.7 2.39E-04 4.32E-04 4.00E-04 80.37 67.07
1364.7 2.72E-04 4.98E-04 4.65E-04 83.21 71.19
1214.7 3.32E-04 5.82E-04 5.49E-04 75.18 65.26
1064.7 3.99E-04 6.91E-04 6.58E-04 73.29 65.20
914.7 4.98E-04 8.38E-04 8.08E-04 68.34 62.22
614.7 9.05E-04 1.36E-03 1.34E-03 50.23 47.89
464.7 1.38E-03 1.88E-03 1.87E-03 36.18 35.36
314.7 2.48E-03 2.91E-03 2.91E-03 17.29 17.46
174.7 5.98E-03 5.47E-03 5.50E-03 8.45 7.95
Avg = 32.44 28.75

112
Table H.5: The AAPD for the Predicted Molar Volume for Jehlicka 1A, Wilshire Oil Co. of Texas, Beaver, Oklahoma.
Volume (ft3/lb mole) ERROR
Pressure (psia) Exptal PR EOS MPR EOS AAPD PR EOS AAPD MPR EOS
5014.7 2.2110 2.2956 2.2779 3.83 3.03
4514.7 2.2226 2.3087 2.2892 3.87 3.00
4014.7 2.2351 2.3229 2.3015 3.93 2.97
3514.7 2.2487 2.3386 2.3149 4.00 2.94
3014.7 2.2633 2.3560 2.3296 4.09 2.93
2914.7 2.2662 2.3596 2.3327 4.12 2.93
2814.7 2.2694 2.3634 2.3359 4.14 2.93
2714.7 2.2726 2.3673 2.3391 4.17 2.93
2677.7 2.2737 2.3688 2.3403 4.18 2.93
2653.7 2.2794 2.2131 2.5787 2.91 13.13
2591.7 2.2949 2.2308 2.5899 2.79 12.86
2507.7 2.3181 2.2569 2.6056 2.64 12.40
2365.7 2.3645 2.3070 2.6378 2.43 11.56
2192.7 2.4575 2.3949 2.6874 2.55 9.36
2012.7 2.5282 2.4780 2.7570 1.99 9.05
1811.7 2.6644 2.6147 2.8618 1.86 7.41
1604.7 2.8558 2.8039 3.0107 1.82 5.42
1392.7 3.1289 3.0740 3.2342 1.75 3.37
1193.7 3.4998 3.4411 3.5483 1.67 1.39
949.7 4.2155 4.1399 4.1746 1.79 0.97
760.7 5.1473 5.0465 5.0142 1.96 2.59
591.7 6.5507 6.4199 6.3198 2.00 3.52
435.7 8.8958 8.7522 8.5807 1.61 3.54
Avg = 2.87 5.35
113
Table H.6: The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility for Jehlicka 1A, Wilshire Oil Co. of
Texas, Beaver, Oklahoma.
Isothermal Compressibility (psia-1) ERROR

AAPD PR AAPD MPR


Pressure (psia) Exptal PR EOS MPR EOS EOS EOS
5014.7 1.09E-05 9.56E-06
4514.7 1.05E-05 1.18E-05 1.03E-05 4.19 1.55
4014.7 1.12E-05 1.29E-05 1.11E-05 5.24 0.73
3514.7 1.22E-05 1.41E-05 1.21E-05 5.67 0.58
3014.7 1.29E-05 1.55E-05 1.32E-05 9.14 2.55
2914.7 1.31E-05 1.59E-05 1.35E-05 18.99 3.28
2814.7 1.40E-05 1.62E-05 1.37E-05 12.92 2.11
2714.7 1.40E-05 1.65E-05 1.40E-05 15.43 0.12
2677.7 1.35E-05 1.67E-05 1.41E-05 22.29 4.31
2414.7 1.34E-04 2.12E-04 1.88E-04 87.57 40.45
1914.7 1.89E-04 2.96E-04 2.69E-04 12.29 42.55
1664.7 2.27E-04 3.60E-04 3.33E-04 30.43 46.68
1414.7 3.07E-04 4.50E-04 4.23E-04 17.17 37.66
1164.7 4.09E-04 5.82E-04 5.58E-04 9.90 36.35
914.7 5.57E-04 7.95E-04 7.76E-04 4.50 39.26
664.7 8.69E-04 1.18E-03 1.17E-03 8.58 34.84
414.7 1.61E-03 2.05E-03 2.07E-03 26.66 28.70
197.7 4.58E-03 4.66E-03 4.72E-03 55.23 2.90
Avg = 20.37 19.10

114
Table H.7: The AAPD for the Predicted Coefficient of Isothermal Oil Compressibility for Jacques Unit #5603, Rough Ride
Field, A.C.T. Operating Company, Fisher County, Texas (Using 24 components).
Pressure AAPD MPR
(psia) Exptal PR EOS MPR EOS AAPD PR EOS EOS
5014.7 9.93E-06 7.33E-06
4514.7 8.46016E-06 1.08E-05 7.84E-06 27.78 7.31
4014.7 8.83457E-06 1.18E-05 8.42E-06 33.79 4.67
3514.7 9.40793E-06 1.30E-05 9.08E-06 38.29 3.49
3014.7 9.97305E-06 1.44E-05 9.83E-06 44.69 1.41
2514.7 1.07315E-05 1.61E-05 1.07E-05 50.40 0.29
2014.7 1.14775E-05 1.82E-05 1.17E-05 58.92 2.03
1914.7 1.20397E-05 1.87E-05 1.19E-05 55.49 0.83
1814.7 1.20253E-05 1.92E-05 1.22E-05 59.83 1.20
1714.7 1.20108E-05 1.97E-05 1.24E-05 64.35 3.24
1689.7 1.20018E-05 1.99E-05 1.25E-05 65.64 3.90
1514.7 2.39E-04 4.05E-04 3.81E-04 69.10 59.23
1364.7 2.72E-04 4.65E-04 4.44E-04 71.12 63.45
1214.7 3.32E-04 5.42E-04 5.25E-04 63.19 58.14
1064.7 3.99E-04 6.43E-04 6.32E-04 61.23 58.50
914.7 4.98E-04 7.80E-04 7.77E-04 56.64 56.11
614.7 9.05E-04 1.27E-03 1.30E-03 40.71 43.51
464.7 1.38E-03 1.78E-03 1.82E-03 28.54 32.04
314.7 2.48E-03 2.78E-03 2.86E-03 12.01 15.34
174.7 5.98E-03 5.31E-03 5.44E-03 11.21 8.98
Avg = 48.05 22.30

115
APPENDIX I

FORTRAN CODE DOCUMENTATION

This is a short documentation to accompany the FORTRAN program developed

to compute the coefficient of isothermal oil compressibility based on the developed

model.

The input data required to run the program are listed below;

1. Number of components in the hydrocarbon fluid.

2. Number of pressure steps required; including pressures below and above the

bubble point.

3. The list of the pressure steps.

4. The list of the component properties in this order; critical temperature (oR),

critical pressure (psia), component mole fraction, acentric factor, molecular

weight, critical compressibility factor and the specific gravity. It should be noted

that the specific gravity values of the component are not required in the

calculations except for the plus fraction where it is used to calculate the critical

parameters. Therefore the specific gravity values inputted into the program are

zeros except for the plus fraction. The critical parameters of the plus fraction are

also inputted as zeros.

5. The reservoir temperature in degree Rankine

6. The bubble point pressure in psia.


A sample of the input data is displayed below;

11

19

5014.7
4514.7
4014.7
3514.7
3014.7
2914.7
2814.7
2714.7
2677.7
2414.7
1914.7
1664.7
1414.7
1164.7
914.7
664.7
414.7
197.7
114.7

547.6 1070.6 0.0049 0.2301 44.01 0.2742 0


227.3 493 0.0053 0.045 28.02 0.2916 0
343 667.8 0.3883 0.0115 16.04 0.2884 0
549.8 707.8 0.0986 0.0908 30.07 0.2843 0
665.7 616.3 0.0953 0.1454 44.09 0.2804 0
734.7 529.1 0.0123 0.1756 58.12 0.2824 0
765.3 550.7 0.0431 0.1928 58.12 0.2736 0
828.8 490.4 0.012 0.2273 72.15 0.2701 0
845.4 488.6 0.0187 0.251 72.15 0.2623 0
913.4 436.9 0.0282 0.29 86.17 0.2643 0
0 0 0.2933 0 252 0 0.8413

622

2677.7

117
The program was originally designed for four different EOS (Soave-Redlich-

Kwong (S.R.K.) EOS, Modified SRK EOS, Peng-Robinson (P.R.) EOS and Modified PR

EOS). Due to the problem of convergence in the fugacities and the observed error in the

SRK EOS and modified SRK EOS, the predicted values of these two EOS were not

reported. It was observed that the SRK EOS and the Modified SRK EOS gave good

predictions at pressures above the bubble point pressure.

The program reads in the pressure and check if the pressure is above or below the

bubble point pressure. If the pressure is above the bubble point pressure, the molar

volume is calculated and the partial derivative of the molar volume with respect to

pressure at constant temperature is calculated. These two answers are combined to

calculate the coefficient of isothermal oil compressibility.

If the pressure is below the bubble point pressure, the two phase flash calculation

algorithm is called and the isothermal compressibility of the liquid and gas phases are

calculated and combined to give the coefficient of isothermal oil compressibility at

pressures below the bubble point pressure.

It was observed that convergence could not be achieved at a reasonable length of

time for some desired pressures. The two pressures at which this lack of convergence was

observed are at the input pressure 764.7 psia for the reservoir fluid sample from A.C.T

Operating Company and at the input pressure of 2164.7 psia.

The output of the program is formatted to give the calculated molar volumes and

the calculated coefficient of isothermal oil compressibility above the bubble point

pressure. At pressures below the bubble point pressure, the molar volume and the

118
coefficient of isothermal oil compressibility of both the liquid and the vapor phases are

reported.

119
APPENDIX J

DEVELOPED FORTRAN CODE

This is the developed FORTRAN Code to compute the Coefficient of Isothermal


Oil Compressibility for Reservoir Fluids based on the developed model.
Program Flash_Iso_Comp

Implicit None

REAL :: M_W(99), S_GC7 ,Tci(99), Ci, Pci(99)


REAL :: OWi(99),A_Fi(99), Zci(99),S_G(99)
REAL :: Api(99), Bti(99), M_F(99), B_PtC7
REAL :: PR, T,PB, TRi(99), PRi(99),R,PS(99)
REAL :: kij
REAL :: ai_LLS(99),ai_SRK(99),ai_PR(99), bi_LLS(99),bi_SRK(99)
REAL :: ai_MPR(99),bi_MPR(99),ai_MSRK(99),bi_MSRK(99),am_MPR
REAL :: am_MSRK,bm_MPR,bm_MSRK
REAL :: am_LLS,am_SRK, am_Pr,bm_LLS,bm_SRK,bm_PR ,bi_PR(99)
REAL :: ami_LLS,ami_SRK,ami_PR,bmi_LLS,bmi_SRK,bmi_PR,TF_PR(99)
REAL :: mi_LLS(99), mi_SRK(99), mi_PR(99), TF_LLS(99), TF_SRK(99)
REAL :: A_PR, B_PR, C_PR, D_PR,A_SRK, B_SRK, C_SRK, D_SRK
REAL :: A_MPR, B_MPR, C_MPR, D_MPR,A_MSRK, B_MSRK, C_MSRK, D_MSRK
REAL :: OBi(99), OAi(99),Coeff(4),RT(3)

REAL :: V_PR, V_SRK, V_LLS, DVPT_PR, DVPT_SRK, DVPT_LLS


REAL :: V_MPR,V_MSRK,CO_MPR,CO_MSRK,V_PRG,V_MPRG,V_SRKG
REAL :: V_PRL,V_MPRL,V_SRKL,V_MSRKL,V_MSRKG
REAL :: CO_PR, CO_SRK, CO_LLS
REAL ::CO_PRG,CO_PRL,CT_PR,CO_SRKG,CO_SRKL,CT_SRK,CO_MPRG
REAL :: CO_MPRL,CT_MPR,CO_MSRKG,CO_MSRKL,CT_MSRK

REAL :: NLLS1, NLLS2, DLLS1, DLLS2,NSRK1,NSRK2,DSRK1,DSRK2


REAL :: NPR1,NPR2,DPR1,DPR2,NMPR1,NMPR2,DMPR1,DMPR2
REAL :: NMSRK1,NMSRK2,DMSRK1,DMSRK2,DVPT_MPR, DVPT_MSRK
REAL :: VTPR,VTSRK,VTMPR,VTMSRK,Mtype

INTEGER :: i,j, NCOMP, NPSTEPS,II


REAL :: g

R=10.7315
Mtype = 0
g =1.0

open(UNIT=5,FILE='INPUT10.txt',STATUS='old')
open(UNIT=6,FILE='OUTPUT10.txt',STATUS='unknown')

Read(5,*) NCOMP !Number of Components


Read(5,*) NPSTEPS !Number of Pressure Steps

Do i=1,NPSTEPS
Read(5,*) PS(i) !Reading Pressures
end do

120
Do i=1,NCOMP
Read(5,*) Tci(i),Pci(i),M_F(i),A_Fi(i),M_W(i),Zci(i),S_G(i)
end do

Read(5,*) T !Reading Reservoir Temperature


Read(5,*) PB ! Reading Bubble Point

! Computing the Properties of the plus fraction - Pc=0

Do i=1,NCOMP
if (Pci(i).EQ.0) Then
Ci = 3.8501/(1.54057-(0.02494*(M_W(i)**0.5)))

B_PtC7 = 108.7017*(M_W(i)**0.4225)*(S_G(i)**0.4268)

A_Fi(i) = 4.5494E-9*(M_W(i)**0.02445)*(S_G(i)**(-2.08511))
& * (B_PtC7**2.903798)*(Ci**(-1.54424))

Zci(i)=0.293/(1+(0.375*A_Fi(i)))

Tci(i)=66.3775*(M_W(i)**0.12286)*(S_G(i)**0.47926)
& *(B_PtC7**0.41286)*(Ci**(-0.35734))

Pci(i) =31839*(M_W(i)**(-0.93426))*(S_G(i)**(1.64074))
& * (B_PtC7**0.49447) * (Ci**(-2.39909))

end if

end do

Write (6,10)"P", "VSRK","VMSRK","VPR","VMPR","CoSRK","CoMSRK"


& ,"CoPR","CoMPR"
10 Format(A8,2x,A7,2x,A7,2x,A7,2x,A7,A10,2x,A10,2x,A10,2x,A10)

Do II=1,NPSTEPS
If (PS(II).GE.PB) Then
PR = PS(II)

CALL Comp_EOS(PR,V_SRK,V_MSRK,V_PR,V_MPR,CO_SRK,CO_MSRK
& ,CO_PR,CO_MPR)
Write(6,20)PR,V_SRK,V_MSRK,V_PR,V_MPR,CO_SRK,CO_MSRK,CO_PR,CO_MPR
20 Format(1x,F7.2,1x,F10.6,1x,F10.6,1x,F10.6,1x,F10.6,2x,E20.4,2x
& ,E20.4,2x,E20.4,2x,E20.4)

Else

If (g.EQ.1.0) Then
g=2.0

Write(6,40)"PR","V_SRKL","V_SRKG","VTSRK","V_MSRKL","V_MSRKG"
& ,"VTMSRK","V_PRL","V_PRG","VTPR","V_MPRL","V_MPRG","VTMPR"
& ,"CO_SRKL","CO_SRKG","CT_SRK","CO_MSRKL","CO_MSRKG","CT_MSRK"
& ,"CO_PRL","CO_PRG","CT_PR","CO_MPRL","CO_MPRG","CT_MPR"

121
40 Format (A8,2x,A7,2x,A7,2x,A7,2x,A7,2x,A7,2x,A7,2x,A7,2x,A7,2x,A7
&,2x,A7,2x,A7,2x,A7,2x,A10,2x,A10,2x,A10,2x,A10,2x,A10,2x,A10,2x
&,A10,2x,A10,2x,A10,2x,A10,2x,A10,2x,A10)
end if

PR = PS(II)
CALL Flash(PR,V_SRKL,V_SRKG,VTSRK,V_MSRKL,V_MSRKG,VTMSRK
& ,V_PRL,V_PRG,VTPR,V_MPRL,V_MPRG,VTMPR,CO_SRKL,CO_SRKG,CT_SRK
& ,CO_MSRKL,CO_MSRKG,CT_MSRK,CO_PRL,CO_PRG,CT_PR,CO_MPRL,CO_MPRG
& ,CT_MPR)

Write(6,30)PR,V_SRKL,V_SRKG,VTSRK,V_MSRKL,V_MSRKG,VTMSRK
& ,V_PRL,V_PRG,VTPR,V_MPRL,V_MPRG,VTMPR,CO_SRKL,CO_SRKG,CT_SRK
& ,CO_MSRKL,CO_MSRKG,CT_MSRK,CO_PRL,CO_PRG,CT_PR,CO_MPRL,CO_MPRG
& ,CT_MPR

30 Format(F10.2,2x,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x
& ,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x,F10.6,2x
& ,E20.6,2x,E20.6,2x,E20.6,2x,E20.6,2x,E20.6,2x,E20.6,2x,E20.6,2x
& ,E20.6,2x,E20.6,2x,E20.6,2x,E20.6,2x,E20.6)

end if

end do

!*******Subroutine Comp EOS*****************************************

contains

Subroutine Comp_EOS(PR,V_SRK,V_MSRK,V_PR,V_MPR,CO_SRK,CO_MSRK
& ,CO_PR,CO_MPR)

REAL, INTENT(IN) :: PR

REAL, INTENT(OUT) ::CO_SRK,CO_MSRK,CO_PR,CO_MPR,V_SRK


REAL, INTENT(OUT) ::V_MSRK,V_PR,V_MPR
!****************************************************************!
Do i=1,NCOMP

OWi(i) = 0.361/(1+(0.274*A_Fi(i)))

mi_LLS(i) = 0.14443 + 1.0662*A_Fi(i) + 0.02756*A_Fi(i)


& *A_Fi(i) - 0.18074*(A_Fi(i)**3)

TRi(i)=T/Tci(i)
PRi(i)=PR/Pci(i)

OBi(i)=Zci(i)*OWi(i)
OAi(i)=(1+(OWi(i)-1)*Zci(i))**3

TF_LLS(i)=(1+mi_LLS(i)*(1-TRi(i)**0.5))**2

mi_SRK(i) = 0.480 + 1.574*A_Fi(i) - 0.176*A_Fi(i)**2

mi_PR(i) = 0.37464 + 1.54226*A_Fi(i) - 0.26992*A_Fi(i)**2

122
TF_SRK(i)=(1+(mi_SRK(i))*(1- TRi(i)**0.5))**2

TF_PR(i)=(1+(mi_PR(i))*(1- TRi(i)**0.5))**2

ai_LLS(i) = (TF_LLS(i)*OAi(i)*(R*Tci(i))**2)/Pci(i)
bi_LLS(i) = ((OBi(i)*R*Tci(i))/Pci(i))

ai_SRK(i)= (0.42748*TF_SRK(i)*(R*Tci(i))**2)/pci(i)
bi_SRK(i) = (0.08664*R*Tci(i))/pci(i)

ai_PR(i) = 0.45724*TF_PR(i)*(R*Tci(i))**2/pci(i)
bi_PR(i) = 0.07780*R*Tci(i)/pci(i)
ai_MPR(i) = ai_LLS(i)
bi_MPR(i) = bi_LLS(i)
ai_MSRK(i) = ai_LLS(i)
bi_MSRK(i)= bi_LLS(i)

END DO

! Solving for Mixture Parameters

am_LLS = 0
am_SRK = 0
am_Pr = 0
bmi_LLS = 0
bmi_SRK = 0
bmi_PR = 0

DO i=1,NCOMP

DO j=1,NCOMP
IF ( (Tci(i)/Pci(i)**0.5) < (Tci(j)/Pci(j)**0.5) ) THEN
kij = ((Tci(i)/Pci(i)**0.5) / (Tci(j)/Pci(j)**0.5) )**0.5

ELSE
kij = ((Tci(j)/Pci(j)**0.5) / (Tci(i)/Pci(i)**0.5) )**0.5
END IF

kij =1

ami_LLS=M_F(i)*M_F(j)*(ai_LLS(i)*ai_LLS(j))**0.5*kij

ami_SRK=M_F(i)*M_F(j)*(ai_SRK(i)*ai_SRK(j))**0.5*kij

ami_PR =M_F(i)*M_F(j)*(ai_PR(i)*ai_PR(j))**0.5*kij

am_LLS = am_LLS + ami_LLS


am_SRK = am_SRK + ami_SRK

am_PR = am_PR + ami_PR


am_MSRK=am_LLS
am_MPR = am_LLS
END DO

123
bmi_LLS = bmi_LLS + ( M_F(i)*bi_LLS(i) )
bmi_SRK = bmi_SRK + ( M_F(i)*bi_SRK(i) )
bmi_PR = bmi_PR + ( M_F(i)*bi_PR(i) )

END Do

bm_LLS = bmi_LLS
bm_SRK = bmi_SRK
bm_PR = bmi_PR
bm_MPR = bm_LLS
bm_MSRK=bm_LLS
!****************************************************************!

A_PR= 1
A_MPR=1
A_SRK = 1
A_MSRK=1

A_PR= 1
A_MPR=1

B_PR=bm_PR-R*T/PR

C_PR=(am_PR/PR)-3*bm_PR**2-2*bm_PR*R*T/PR

D_PR=bm_PR**3+(bm_PR**2)*R*T/PR-am_PR*bm_PR/PR

B_MPR=bm_MPR-R*T/PR

C_MPR=(am_MPR/PR)-3*bm_MPR**2-2*bm_MPR*R*T/PR

D_MPR=bm_MPR**3+(bm_MPR**2)*R*T/PR-am_MPR*bm_MPR/PR

B_SRK=-1*R*T/PR

C_SRK=am_SRK/PR-bm_SRK**2-R*T*bm_SRK/PR

D_SRK=-1*am_SRK*bm_SRK/PR

B_MSRK=-1*R*T/PR

C_MSRK=am_MSRK/PR-bm_MSRK**2-R*T*bm_MSRK/PR

D_MSRK=-1*am_MSRK*bm_MSRK/PR

!***Calculating the total molar volume using PR EOS*********

Coeff(1)=A_PR
Coeff(2)=B_PR
Coeff(3)=C_PR
Coeff(4)=D_PR

124
Call Cubic_Solver(Mtype,Coeff,RT)

If (RT(3).EQ.0.0) then
RT(3)=RT(1)
endif
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
endif
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
V_PR = RT(1)
else
V_PR=RT(2)
endif
If (V_PR.LE.RT(3)) Then
V_PR = V_PR
else
V_PR=RT(3)
endif

!***Calculating the total molar volume using Modified PR EOS*********


Coeff(1)=A_MPR
Coeff(2)=B_MPR
Coeff(3)=C_MPR
Coeff(4)=D_MPR

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
V_MPR = RT(1)
else
V_MPR=RT(2)
endif
If (V_MPR.LE.RT(3)) Then
V_MPR = V_MPR
else
V_MPR=RT(3)
endif

!***Calculating the total molar volume using SRK EOS*********

Coeff(1)=A_SRK
Coeff(2)=B_SRK
Coeff(3)=C_SRK
Coeff(4)=D_SRK

Call Cubic_Solver(Mtype,Coeff,RT)

125
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
V_SRK = RT(1)
else
V_SRK=RT(2)
endif
If (V_SRK.LE.RT(3)) Then
V_SRK = V_SRK
else
V_SRK=RT(3)
endif

!***Calculating the total molar volume using Modified PR EOS*********


Coeff(1)=A_MSRK
Coeff(2)=B_MSRK
Coeff(3)=C_MSRK
Coeff(4)=D_MSRK

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
V_MSRK = RT(1)
else
V_MSRK=RT(2)
endif
If (V_MSRK.LE.RT(3)) Then
V_MSRK = V_MPR
else
V_MSRK=RT(3)
endif
!*********************************************************************
NSRK1=(V_SRK-bm_SRK)**2
NSRK2=(V_SRK**2+V_SRK*bm_SRK)**2

DSRK1=am_SRK*(2*V_SRK+bm_SRK)*(V_SRK-bm_SRK)**2
DSRK2=R*T*(V_SRK**2+bm_SRK*V_SRK)**2

DVPT_SRK=NSRK1*NSRK2/(DSRK1-DSRK2)

NMSRK1=(V_MSRK-bm_MSRK)**2
NMSRK2=(V_MSRK**2+V_MSRK*bm_MSRK)**2

126
DMSRK1=am_MSRK*(2*V_MSRK+bm_MSRK)*(V_MSRK-bm_MSRK)**2
DMSRK2=R*T*(V_MSRK**2+bm_MSRK*V_MSRK)**2

DVPT_MSRK=NMSRK1*NMSRK2/(DMSRK1-DMSRK2)

NPR1=(V_PR-bm_PR)**2
NPR2=(V_PR**2+2*bm_PR*V_PR-bm_PR**2)**2

DPR1=2*am_PR*(V_PR+bm_PR)*(V_PR-bm_PR)**2
DPR2=R*T*(V_PR**2+2*bm_PR*V_PR-bm_PR**2)**2

DVPT_PR=NPR1*NPR2/(DPR1-DPR2)

NMPR1=(V_MPR-bm_MPR)**2
NMPR2=(V_MPR**2+2*bm_MPR*V_MPR-bm_MPR**2)**2

DMPR1=2*am_MPR*(V_MPR+bm_MPR)*(V_MPR-bm_MPR)**2
DMPR2=R*T*(V_MPR**2+2*bm_MPR*V_MPR-bm_MPR**2)**2

DVPT_MPR=NMPR1*NMPR2/(DMPR1-DMPR2)

CO_SRK=-1*DVPT_SRK/V_SRK
CO_PR=-1*DVPT_PR/V_PR
CO_MSRK=-1*DVPT_MSRK/V_MSRK
CO_MPR=-1*DVPT_MPR/V_MPR

END Subroutine Comp_EOS

!*************Subroutine Flash Calculations***********************

Subroutine Flash(PR,V_SRKL,V_SRKG,VTSRK,V_MSRKL,V_MSRKG,VTMSRK
& ,V_PRL,V_PRG,VTPR,V_MPRL,V_MPRG,VTMPR,CO_SRKL,CO_SRKG,CT_SRK
& ,CO_MSRKL,CO_MSRKG,CT_MSRK,CO_PRL,CO_PRG,CT_PR,CO_MPRL,CO_MPRG
& ,CT_MPR)

Implicit None

Real, Intent (IN) :: PR


Real, Intent (OUT) :: V_PRG,V_MPRG,V_SRKG,V_MSRKG,V_PRL,V_MPRL

Real, Intent (OUT) :: V_SRKL,V_MSRKL,CO_SRKG,CO_SRKL,CT_SRK


Real, Intent (OUT) :: CO_MSRKL,CT_MSRK,CO_PRG,CO_PRL,CT_PR
Real, Intent (OUT) :: CO_MPRG,CO_MPRL,CT_MPR,CO_MSRKG
Real, Intent (OUT) :: VTPR,VTSRK,VTMPR,VTMSRK

Real :: Zi(99),Ki(99),Kimin,Kimax,NVmin,NVmax,NV,FNV,FPNV
Real :: Ai(99),Bi(99),SAi,SBi,TOL,maxx,minn,Liqxi(99),Vapyi(99)
Real :: ZLPR,ZGPR,ZLSRK,ZGSRK,ZLMPR,ZGMPR,ZLMSRK,ZGMSRK
Real :: FLPR(99),FGPR(99),FLMPR(99),FGMPR(99),FLSRK(99),FGSRK(99)
Real ::FLMSRK(99),FGMSRK(99),SFPR,SFSRK,SFMPR,SFMSRK,CHECK,Counter
Real :: LiPR(99),ViPR(99),LiSRK(99),ViSRK(99),LiMPR(99),ViMPR(99)
Real :: LiMSRK(99),ViMSRK(99),ORIGXI(99),ORIGYI(99)

Real :: BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK
Real :: BBMSRK,NV1,NVPR,NVMPR

127
TOL=0.001
Zi = M_F
Kimin=50
Kimax=0
SAi = 0
SBi = 0
FNV = 0
FPNV = 0
SFPR=0
SFSRK=0
SFMSRK=0
SFMPR=0
CHECK=0
Counter = 0

!write(6,*) " Zi = " , Zi , M_F

Do i=1,NCOMP
Ki(i)=Pci(i)*exp(5.371*(1+A_Fi(i))*(1-(Tci(i)/T)))/PR
Ai(i)= Zi(i)*(Ki(i)-1)
Bi(i)=Zi(i)*(Ki(i)-1)/Ki(i)
SAi=SAi + Ai(i)
SBi=SBI + Bi(i)
end do

!write (6,*) " Ki = ", Ki

Do j=2,NCOMP
If (Ki(j-1).LT.Ki(j)) Then
minn=Ki(j-1)
maxx=Ki(j)
else
minn=Ki(j)
maxx=Ki(j-1)
end if
If (Kimin.LT.minn) then
Kimin=Kimin
else
Kimin=minn
endif
If (Kimax.GT.maxx) then
Kimax=Kimax
else
Kimax=maxx
endif

end do

NVmin=1/(1-Kimax)
NVmax=1/(1-Kimin)

If (NVmin.GT.0.0) then
Write(6,*) "NVmin is > 0.0-May converge at trivial Soln"
endif

128
If (NVmax.LT.1.0) then
Write(6,*) "NVmax is < 1.0-May converge at trivial Soln"
endif

! NV = SAi/(SAi-SBi)
NV=0.5
!Write(6,*) " NVmin = ", NVmin, "NVmax = " , NVmax

!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

!*******Using Newton Raphson*********************************

100 Do i=1,NCOMP
FNV= FNV + Zi(i)*(Ki(i)-1)/(NV*(Ki(i)-1)+1)
FPNV = FPNV + (1)*Zi(i)*(Ki(i)-1)**2/((NV*(Ki(i)-1)+1)**2)
enddo

NV1= NV - (FNV/(-1)*FPNV)

If (ABS(NV1-NV).GT.TOL) then
NV= NV1

Counter = Counter + 1
If (Counter .GT. 80000000) then
Write(6,*) " Newton Raphson Called 80 million times"
Stop
endif
FNV=0
FPNV = 0
Goto 100

endif
!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

Do i=1,NCOMP
Liqxi(i)= Zi(i)/(1+NV*(Ki(i)-1))
Vapyi(i)= Zi(i)*Ki(i)/(1+NV*(Ki(i)-1))
Enddo

ORIGXI = Liqxi
ORIGYI = Vapyi

!write (6,*) "NV = ", NV


!write (6,*) "NVmin = ", NVmin
!write (6,*) "NVmax = ", NVmax

129
!**********Checking Fugacity Constraint for PR EOS**************

Call Zfactor_FugacPR(PR,Liqxi,Vapyi,NV,ZLPR,ZGPR,FLPR,FGPR,BAPR
&,BBPR)

Do j=1,NCOMP
SFPR = SFPR + (((FLPR(j)/FGPR(j))-1)**2)
end do
LiPR = Liqxi
ViPR = Vapyi

!write (6,*) " SFPR = ", SFPR

111 IF(Abs(SFPR).GT. TOL) Then


!write (6,*) " SFPR = ", SFPR

!Write (6,*) " Function Called"


SFPR = 0.0
Do i=1, NCOMP
Ki(i) = Ki(i)*FLPR(i)/FGPR(i)
Ai(i)= Zi(i)*(Ki(i)-1)
Bi(i)=Zi(i)*(Ki(i)-1)/Ki(i)
SAi=SAi + Ai(i)
SBi=SBI + Bi(i)
end do

!write (6,*) " Ki = ", Ki

!*****Check if Ki is Converging to a trivial Solution***********

Do i=1, NCOMP
CHECK = CHECK + (Alog(Ki(i)))**2
end do
If (CHECK.LT.0.0001) Then
Write(6,*) " Trivial Solution is Detected"
end if
CHECK =0.0

Do j = 2, NCOMP

If (Ki(j-1).LT.Ki(j)) Then
minn=Ki(j-1)
maxx=Ki(j)
else
minn=Ki(j)
maxx=Ki(j-1)
end if
If (Kimin.LT.minn) then
Kimin=Kimin
else
Kimin=minn
endif
If (Kimax.GT.maxx) then
Kimax=Kimax
else
Kimax=maxx

130
endif

end do

NVmin=1/(1-Kimax)
NVmax=1/(1-Kimin)

!write (6,*) " NVmin = ", NVmin , "NVmax = ", NVmax

If (NVmin.GT.0.0) then
Write(6,*) "NVmin is > 0.0-May converge at trivial Soln"
endif

If (NVmax.LT.1.0) then
Write(6,*) "NVmax is < 1.0-May converge at trivial Soln"
endif

! NV = SAi/(SAi-SBi)

!write(6,*) " NV initial = " , NV

!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

!*******Using Newton Raphson*********************************

FNV = 0
FPNV = 0

1000 Do i=1,NCOMP
FNV= FNV + Zi(i)*(Ki(i)-1)/(NV*(Ki(i)-1)+1)
FPNV = FPNV + (1)*Zi(i)*((Ki(i)-1)**2)/((NV*(Ki(i)-1)+1)**2)

enddo

!write (6,*) " FNV =" , FNV , "FPNV = ", FPNV, "NV = " , NV

NV1= NV - (FNV/((-1)*FPNV))

If (((-1)*FPNV) .EQ.0) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
!write(6,*) "Bisection Called"
NV1 = NV
endif

If (ABS(ABS(NV1)-ABS(NV)).GT.TOL) then
NV = NV1

Counter = Counter + 1
If (Counter .GT. 40000) then
!Write(6,*) " Newton Raphson Called 40,000 times"

endif
FNV=0

131
FPNV = 0
Goto 1000
continue

Endif

!write (6,*) " NV = ", NV , " Ki = ", Ki

Do i=1,NCOMP
Liqxi(i)= Zi(i)/(1+NV*(Ki(i)-1))
Vapyi(i)= Zi(i)*Ki(i)/(1+NV*(Ki(i)-1))
Enddo

!write (6,*) " Got to this point"

Call Zfactor_FugacPR(PR,Liqxi,Vapyi,NV,ZLPR,ZGPR,FLPR,FGPR,BAPR
&,BBPR)

!Write(6,*) " Function Called 22 "

Do i=1,NCOMP
SFPR = SFPR + ((FLPR(i)/FGPR(i))-1)**2
end do
!write (6,*) " SFPR = ", SFPR

LiPR = Liqxi
ViPR = Vapyi

Goto 111

End if
!write (6,*) "Liqxi = " , Liqxi
!write (6,*) "Vapyi = " , Vapyi
!write (6,*) " ki = ", Ki
!write (6,*) " NV = " , NV
!write (6,*) " SFPR = ", SFPR
!write (6,*) " Counter = " , counter
!write (6,*) "ZGPR = ", ZGPR ,"ZLPR = " , ZLPR
!STOP
Liqxi = ORIGXI
Vapyi = ORIGYI
NVPR = NV

!write (6,*) " Got to point close to 222"

!*******MPR EOS Fugacity Constraint***************************


Call Zfactor_FugacMPR(PR,Liqxi,Vapyi,NV,ZLMPR,ZGMPR,FLMPR,FGMPR
& ,BAMPR,BBMPR)

Do i=1,NCOMP
SFPR = SFPR + ((FLMPR(i)/FGMPR(i))-1)**2
end do

132
LiMPR = Liqxi
ViMPR = Vapyi
!**********Checking Fugacity Constraint for PR EOS**************
222 If (SFMPR.GT. TOL) Then
SFMPR = 0.0
Do i=1, NCOMP
Ki(i) = Ki(i)*FLMPR(i)/FGMPR(i)
Ai(i)= Zi(i)*(Ki(i)-1)
Bi(i)=Zi(i)*(Ki(i)-1)/Ki(i)
SAi=SAi + Ai(i)
SBi=SBI + Bi(i)
end do

!*****Check if Ki is Converging to a trivial Solution***********

Do i=1, NCOMP
CHECK = CHECK + (Alog(Ki(i)))**2
end do
If (CHECK.LT.0.0001) Then
Write(6,*) " Trivial Solution is Detected"
end if
CHECK =0.0

Do j = 2, NCOMP

If (Ki(j-1).LT.Ki(j)) Then
minn=Ki(j-1)
maxx=Ki(j)
else
minn=Ki(j)
maxx=Ki(j-1)
end if
If (Kimin.LT.minn) then
Kimin=Kimin
else
Kimin=minn
endif
If (Kimax.GT.maxx) then
Kimax=Kimax
else
Kimax=maxx
endif

end do

NVmin=1/(1-Kimax)
NVmax=1/(1-Kimin)

If (NVmin.GT.0.0) then
Write(6,*) "NVmin is > 0.0-May converge at trivial Soln"
endif

If (NVmax.LT.1.0) then
Write(6,*) "NVmax is < 1.0-May converge at trivial Soln"
endif

! NV = SAi/(SAi-SBi)

133
!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

!*******Using Newton Raphson*********************************

!write (6,*) " Goto to 2000"

2000 Do i=1,NCOMP
FNV= FNV + Zi(i)*(Ki(i)-1)/(NV*(Ki(i)-1)+1)
FPNV = FPNV + Zi(i)*(Ki(i)-1)**2/((NV*(Ki(i)-1)+1)**2)
end do

If ((-1)*FPNV .EQ.0) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

NV1= NV - (FNV/((-1)*FPNV))

If (ABS(NV1-NV).GT.TOL) then
NV= NV1

FNV=0
FPNV = 0
Counter = Counter + 1
If (Counter .GT. 800000000) then
Write(6,*) " Newton Raphson Called 80,000 times"
Stop
endif
Goto 2000

Endif

Do i=1,NCOMP
Liqxi(i)= Zi(i)/(1+NV*(Ki(i)-1))
Vapyi(i)= Zi(i)*Ki(i)/(1+NV*(Ki(i)-1))
Enddo

Call Zfactor_FugacMPR(PR,Liqxi,Vapyi,NV,ZLMPR,ZGMPR,FLMPR,FGMPR
& ,BAMPR,BBMPR)

Do i=1,NCOMP
SFMPR = SFMPR + ((FLMPR(i)/FGMPR(i))-1)**2
end do

LiMPR = Liqxi
ViMPR = Vapyi

Goto 222

134
Endif

Liqxi = ORIGXI
Vapyi = ORIGYI
NVMPR = NV

!*******SRK EOS Fugacity Constraint***************************


Call Zfactor_FugacSRK(PR,Liqxi,Vapyi,NV,ZLSRK,ZGSRK,FLSRK,FGSRK
& ,BBSRK,BASRK)

Do i=1,NCOMP
SFSRK = SFSRK + ((FLSRK(i)/FGSRK(i))-1)**2
end do

LiSRK = Liqxi
ViSRK = Vapyi
SFSRK = 0.0

!**********Checking Fugacity Constraint for PR EOS**************


333 If (SFSRK.GT. TOL) Then
SFSRK = 0.0
Do i=1, NCOMP
Ki(i) = Ki(i)*FLSRK(i)/FGSRK(i)
Ai(i)= Zi(i)*(Ki(i)-1)
Bi(i)=Zi(i)*(Ki(i)-1)/Ki(i)
SAi=SAi + Ai(i)
SBi=SBI + Bi(i)
end do

!*****Check if Ki is Converging to a trivial Solution***********

Do i=1, NCOMP
CHECK = CHECK + (Alog(Ki(i)))**2
end do
If (CHECK.LT.0.0001) Then
Write(6,*) " Trivial Solution is Detected"
end if
CHECK =0.0
Do j = 2, NCOMP
If (Ki(j-1).LT.Ki(j)) Then
minn=Ki(j-1)
maxx=Ki(j)
else
minn=Ki(j)
maxx=Ki(j-1)
end if
If (Kimin.LT.minn) then
Kimin=Kimin
else
Kimin=minn
endif
If (Kimax.GT.maxx) then
Kimax=Kimax
else
Kimax=maxx
endif

end do

135
NVmin=1/(1-Kimax)
NVmax=1/(1-Kimin)

If (NVmin.GT.0.0) then
Write(6,*) "NVmin is > 0.0-May converge at trivial Soln"
endif

If (NVmax.LT.1.0) then
Write(6,*) "NVmax is < 1.0-May converge at trivial Soln"
endif

! NV = SAi/(SAi-SBi)

!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

!*******Using Newton Raphson*********************************

3000 Do i=1,NCOMP
FNV= FNV + Zi(i)*(Ki(i)-1)/((NV*(Ki(i)-1)+1))
FPNV = FPNV + (1)*Zi(i)*(Ki(i)-1)**2/((NV*(Ki(i)-1)+1)**2)
enddo

If ((-1)*FPNV .EQ.0) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

NV1= NV - (FNV/((-1)*FPNV))

If (ABS(NV1-NV).GT.TOL) then
NV= NV1

FNV=0
FPNV = 0
Counter = Counter + 1
If (Counter .GT. 80000000) then
Write(6,*) " Newton Raphson Called 80,000 times"
Stop
endif
Goto 3000
Counter = Counter + 1
If (Counter .GT. 80000000) then
Write(6,*) " Newton Raphson Called 80,000 times"
Stop
endif
Endif

Do i=1,NCOMP
Liqxi(i)= Zi(i)/(1+NV*(Ki(i)-1))
Vapyi(i)= Zi(i)*Ki(i)/(1+NV*(Ki(i)-1))
Enddo

Call Zfactor_FugacSRK(PR,Liqxi,Vapyi,NV,ZLSRK,ZGSRK,FLSRK,FGSRK
& ,BBSRK,BASRK)

136
Do i=1,NCOMP
SFSRK = SFSRK + ((FLSRK(i)/FGSRK(i))-1)**2
end do

LiSRK = Liqxi
ViSRK = Vapyi

Goto 333

End if

Liqxi = ORIGXI
Vapyi = ORIGYI

!******************MSRK EOS***********************************************

Call Zfactor_FugacMSRK(PR,Liqxi,Vapyi,NV,ZLMSRK,ZGMSRK,FLMSRK
& ,FGMSRK,BAMSRK,BBMSRK)

Do i=1,NCOMP
SFMSRK = SFMSRK + ((FLMSRK(i)/FGMSRK(i))-1)**2
end do

LiMSRK = Liqxi
ViMSRK = Vapyi
SFMSRK = 0.0
!**********Checking Fugacity Constraint for PR EOS**************
444 If (SFMSRK.GT. TOL) Then
SFMSRK = 0.0
Do i=1, NCOMP
Ki(i) = Ki(i)*FLMSRK(i)/FGMSRK(i)
Ai(i)= Zi(i)*(Ki(i)-1)
Bi(i)=Zi(i)*(Ki(i)-1)/Ki(i)
SAi=SAi + Ai(i)
SBi=SBI + Bi(i)
end do

!*****Check if Ki is Converging to a trivial Solution***********

Do i=1, NCOMP
CHECK = CHECK + (Alog(Ki(i)))**2
end do
If (CHECK.LT.0.0001) Then
Write(6,*) " Trivial Solution is Detected"
end if
CHECK =0.0
Do j = 2, NCOMP
If (Ki(j-1).LT.Ki(j)) Then
minn=Ki(j-1)
maxx=Ki(j)
else
minn=Ki(j)
maxx=Ki(j-1)
end if
If (Kimin.LT.minn) then
Kimin=Kimin
else
Kimin=minn

137
endif
If (Kimax.GT.maxx) then
Kimax=Kimax
else
Kimax=maxx
endif

end do

NVmin=1/(1-Kimax)
NVmax=1/(1-Kimin)

If (NVmin.GT.0.0) then
Write(6,*) "NVmin is > 0.0-May converge at trivial Soln"
endif

If (NVmax.LT.1.0) then
Write(6,*) "NVmax is < 1.0-May converge at trivial Soln"
endif

! NV = SAi/(SAi-SBi)

!***** Bisection Method *************************************

If ((NV.LT.NVmin) .OR. (NV.GT.NVmax)) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

!*******Using Newton Raphson*********************************

4000 Do i=1,NCOMP
FNV= FNV + Zi(i)*(Ki(i)-1)/((NV*(Ki(i)-1)+1))
FPNV = FPNV + (1)*Zi(i)*(Ki(i)-1)**2/((NV*(Ki(i)-1)+1)**2)
enddo

If ((-1)*FPNV .EQ.0) then


Call bisect(NVmin,NVmax,Zi,Ki,NV)
endif

NV1= NV - (FNV/((-1)*FPNV))

If (ABS(NV1-NV).GT.TOL) then
NV= NV1

FNV=0
FPNV = 0
Counter = Counter + 1
If (Counter .GT. 80000000) then
Write(6,*) " Newton Raphson Called 80000,000 times"
Stop
endif
Goto 4000
Counter = Counter + 1
If (Counter .GT. 80000000) then
Write(6,*) " Newton Raphson Called 80000,000 times"
Stop
endif
Endif

138
Do i=1,NCOMP
Liqxi(i)= Zi(i)/(1+NV*(Ki(i)-1))
Vapyi(i)= Zi(i)*Ki(i)/(1+NV*(Ki(i)-1))
Enddo

Call Zfactor_FugacMSRK(PR,Liqxi,Vapyi,NV,ZLMSRK,ZGMSRK,FLMSRK
& ,FGMSRK,BAMSRK,BBMSRK)

Do i=1,NCOMP
SFMSRK = SFMSRK + ((FLMSRK(i)/FGMSRK(i))-1)**2
end do

LiMSRK = Liqxi
ViMSRK = Vapyi

goto 444
End if

Call CompValue(PR,LiPR,ViPR,NVPR,NVMPR,LiSRK,ViSRK,LiMPR,ViMPR
&,LiMSRK,ViMSRK,ZLPR,ZGPR,ZLSRK,ZGSRK,ZLMPR,ZGMPR,ZLMSRK,ZGMSRK
&,V_PRL,V_PRG,V_SRKL,V_SRKG,V_MPRL,V_MPRG,V_MSRKL,V_MSRKG,CO_PRL
&,CO_PRG,CT_PR,CO_SRKL,CO_SRKG,CT_SRK,CO_MPRL,CO_MPRG,CT_MPR
&,CO_MSRKL,CO_MSRKG,CT_MSRK,VTPR,VTSRK,VTMPR,VTMSRK)
End Subroutine Flash

!**************************Subroutine CompValue******************************
Subroutine CompValue(PR,LiPR,ViPR,NVPR,NVMPR,LiSRK,ViSRK,LiMPR
&,ViMPR,LiMSRK,ViMSRK,ZLPR,ZGPR,ZLSRK,ZGSRK,ZLMPR,ZGMPR,ZLMSRK
&,ZGMSRK,V_PRL,V_PRG,V_SRKL,V_SRKG,V_MPRL,V_MPRG,V_MSRKL,V_MSRKG
&,CO_PRL,CO_PRG,CT_PR,CO_SRKL,CO_SRKG,CT_SRK,CO_MPRL,CO_MPRG,CT_MPR
&,CO_MSRKL,CO_MSRKG,CT_MSRK,VTPR,VTSRK,VTMPR,VTMSRK)

Implicit None

Real, Intent (IN) :: PR,LiPR(99),ViPR(99),LiSRK(99),ViSRK(99)


&,LiMPR(99),ViMPR(99),LiMSRK(99),ViMSRK(99),ZLPR,ZGPR,ZLSRK,ZGSRK
&,ZLMPR,ZGMPR,ZLMSRK,ZGMSRK,NVPR,NVMPR

Real, Intent (OUT) ::V_PRL,VTPR,VTSRK,VTMPR,VTMSRK


&,V_PRG,V_SRKL,V_SRKG,V_MPRL,V_MPRG,V_MSRKL,V_MSRKG,CO_PRL,CO_PRG
&,CT_PR,CO_SRKL,CO_SRKG,CT_SRK,CO_MPRL,CO_MPRG,CT_MPR,CO_MSRKL
&,CO_MSRKG,CT_MSRK

Real :: am_PR,bm_PR,am_SRK,bm_SRK,am_MPR,bm_MPR,am_MSRK,bm_MSRK
REAL :: NMPR1,NMPR2,DMPR1,DMPR2,DVPT_MPR
Real :: NPR1,NPR2,DPR1,DPR2,DVPT_PR,NSRK1,NSRK2,DSRK1,DSRK2
Real :: DVPT_SRK,NMSRK1,NMSRK2,DMSRK1,DMSRK2,DVPT_MSRK

Real :: BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK
Real :: BBMSRK,BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK

Real :: NGG,NGG1,NGG2,NGG3,NGG4,DGG,DGG1,DGG2,DGG3,DZP

139
!****Using PR EOS Liquid***********************************************
Call ParaMix(PR,LiPR,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_PRL = ZLPR*R*T/PR
V_PRG = ZGPR*R*T/PR
am_PR = (BAPR*(R*T)**2)/PR
bm_PR = (BBPR*R*T)/PR
NPR1=(V_PRL-bm_PR)**2
NPR2=(V_PRL**2+2*bm_PR*V_PRL-bm_PR**2)**2

DPR1=2*am_PR*(V_PRL+bm_PR)*(V_PRL-bm_PR)**2
DPR2=R*T*(V_PRL**2+2*bm_PR*V_PRL-bm_PR**2)**2

DVPT_PR=NPR1*NPR2/(DPR1-DPR2)
CO_PRL=-1*DVPT_PR/V_PRL

!*****Using PR EOS for Gas Properties************************************


Call ParaMix(PR,ViPR,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_PRG = ZGPR*R*T/PR
am_PR = (BAPR*(R*T)**2)/PR
bm_PR = (BBPR*R*T)/PR

!***************************************************************************
NGG1= (6*ZGPR*PR*bm_PR**2)/((R*T)**2) + ZGPR*2*bm_PR/(R*T)
NGG2=(2*am_PR*bm_PR*PR)/((R*T)**3)-(2*PR*bm_PR**2)/((R*T)**2)
NGG3= (bm_PR*ZGPR**2)/(R*T) + (ZGPR*am_PR)/((R*T)**2)
NGG4= 3*(bm_PR**3)*(PR**2)/(R*T)**3

NGG= NGG1 + NGG2-NGG3-NGG4

DGG1= 3*ZGPR - 2*ZGPR + 2*ZGPR*bm_PR*PR/(R*T)


DGG2= am_PR*PR/(R*T)**2 - 2*bm_PR*PR/(R*T)
DGG3= 3*(bm_PR*PR/(R*T))**2

DGG = DGG1 + DGG2 - DGG3

DZP = NGG/DGG

!write(6,*) "NGG =", NGG, "DGG=",DGG

CO_PRG = 1/PR - DZP/ZGPR

!***************************************************************************

140
! NPR1=(V_PRG-bm_PR)**2
! NPR2=(V_PRG**2+2*bm_PR*V_PRG-bm_PR**2)**2

! DPR1=2*am_PR*(V_PRG+bm_PR)*(V_PRG-bm_PR)**2
! DPR2=R*T*(V_PRG**2+2*bm_PR*V_PRG-bm_PR**2)**2

! DVPT_PR=NPR1*NPR2/(DPR1-DPR2)
! CO_PRG=-1*DVPT_PR/V_PRG

VTPR = V_PRL + V_PRG

CT_PR = (V_PRG/VTPR)*(CO_PRG) + (V_PRL/VTPR)*(CO_PRL)

V_PRL=(1-NVPR)*V_PRL
V_PRG= NVPR*V_PRG
VTPR = V_PRL + V_PRG
!*******Using MPR EOS for Liquid Properties*************************
Call ParaMix(PR,LiMPR,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_MPRL = ZLMPR*R*T/PR
am_MPR = (BAMPR*(R*T)**2)/PR
bm_MPR = (BBMPR*R*T)/PR

NMPR1=(V_MPRL-bm_MPR)**2
NMPR2=(V_MPRL**2+2*bm_MPR*V_MPRL-bm_MPR**2)**2

DMPR1=2*am_MPR*(V_MPRL+bm_MPR)*(V_MPRL-bm_MPR)**2
DMPR2=R*T*(V_MPRL**2+2*bm_MPR*V_MPRL-bm_MPR**2)**2

DVPT_MPR=NMPR1*NMPR2/(DMPR1-DMPR2)
CO_MPRL=-1*DVPT_MPR/V_MPRL

!*****Using MPR EOS for Gas Properties************************************


Call ParaMix(PR,ViMPR,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_MPRG = ZGMPR*R*T/PR
am_MPR = (BAMPR*(R*T)**2)/PR
bm_MPR = (BBMPR*R*T)/PR

!***************************************************************************
NGG1= (6*ZGMPR*PR*bm_MPR**2)/((R*T)**2) + ZGMPR*2*bm_MPR/(R*T)
NGG2=2*am_MPR*bm_MPR*PR/((R*T)**3)-(2*PR*bm_MPR**2)/((R*T)**2)
NGG3= (bm_MPR*ZGMPR**2)/(R*T) + (ZGMPR*am_MPR)/((R*T)**2)
NGG4= 3*(bm_MPR**3)*(PR**2)/(R*T)**3

NGG= NGG1 + NGG2-NGG3-NGG4

DGG1= 3*ZGMPR - 2*ZGMPR + 2*ZGMPR*bm_MPR*PR/(R*T)


DGG2= am_MPR*PR/(R*T)**2 - 2*bm_MPR*PR/(R*T)
DGG3= 3*(bm_MPR*PR/(R*T))**2

DGG = DGG1 + DGG2 - DGG3

141
DZP = NGG/DGG

CO_MPRG = 1/PR - DZP/ZGMPR

!***************************************************************************

! NMPR1=(V_MPRG-bm_MPR)**2
! NMPR2=(V_MPRG**2+2*bm_MPR*V_MPRG-bm_MPR**2)**2

! DMPR1=2*am_MPR*(V_MPRG+bm_MPR)*(V_MPRG-bm_MPR)**2
! DMPR2=R*T*(V_MPRG**2+2*bm_MPR*V_MPRG-bm_MPR**2)**2

! DVPT_MPR=NMPR1*NMPR2/(DMPR1-DMPR2)
! CO_MPRG=-1*DVPT_MPR/V_MPRG

VTMPR = V_MPRL + V_MPRG


CT_MPR = (V_MPRG/VTMPR)*(CO_MPRG) + (V_MPRL/VTMPR)*(CO_MPRL)

V_MPRL=(1-NVMPR)*V_MPRL
V_MPRG= NVMPR*V_MPRG
VTMPR = V_MPRL + V_MPRG

!***********Using SRK for Liquid Properties*******************


Call ParaMix(PR,LiSRK,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_SRKL = ZLSRK*R*T/PR
am_SRK = (BASRK*(R*T)**2)/PR
bm_SRK = (BBSRK*R*T)/PR

NSRK1=(V_SRKL-bm_SRK)**2
NSRK2=(V_SRKL**2+V_SRKL*bm_SRK)**2

DSRK1=am_SRK*(2*V_SRKL+bm_SRK)*(V_SRKL-bm_SRK)**2
DSRK2=R*T*(V_SRKL**2+bm_SRK*V_SRKL)**2

DVPT_SRK=NSRK1*NSRK2/(DSRK1-DSRK2)

CO_SRKL=-1*DVPT_SRK/V_SRKL

!*******Using SRK EOS for Gas Properties***********************

Call ParaMix(PR,ViSRK,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_SRKG = ZGSRK*R*T/PR
am_SRK = (BASRK*(R*T)**2)/PR

142
bm_SRK = (BBSRK*R*T)/PR

NSRK1=(V_SRKG-bm_SRK)**2
NSRK2=(V_SRKG**2+V_SRKG*bm_SRK)**2

DSRK1=am_SRK*(2*V_SRKG+bm_SRK)*(V_SRKG-bm_SRK)**2
DSRK2=R*T*(V_SRKG**2+bm_SRK*V_SRKG)**2

DVPT_SRK=NSRK1*NSRK2/(DSRK1-DSRK2)

CO_SRKG=-1*DVPT_SRK/V_SRKG

VTSRK = V_SRKL + V_SRKG


CT_SRK = (V_SRKG/VTSRK)*CO_SRKG + (V_SRKL/VTSRK)*CO_SRKL

!***********Using MSRK for Liquid Properties*******************


Call ParaMix(PR,LiMSRK,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_MSRKL = ZLMSRK*R*T/PR
am_MSRK = (BAMSRK*(R*T)**2)/PR
bm_MSRK = (BBMSRK*R*T)/PR

NMSRK1=(V_MSRKL-bm_MSRK)**2
NMSRK2=(V_MSRKL**2+V_MSRKL*bm_MSRK)**2

DMSRK1=am_MSRK*(2*V_MSRKL+bm_MSRK)*(V_MSRKL-bm_MSRK)**2
DMSRK2=R*T*(V_MSRKL**2+bm_MSRK*V_MSRKL)**2

DVPT_MSRK=NMSRK1*NMSRK2/(DMSRK1-DMSRK2)

CO_MSRKL=-1*DVPT_MSRK/V_MSRKL

!*******Using MSRK EOS for Gas Properties***********************

Call ParaMix(PR,ViMSRK,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

V_MSRKG = ZGMSRK*R*T/PR
am_MSRK = (BAMSRK*(R*T)**2)/PR
bm_MSRK = (BBMSRK*R*T)/PR

NMSRK1=(V_MSRKG-bm_MSRK)**2
NMSRK2=(V_MSRKG**2+V_MSRKG*bm_MSRK)**2

DMSRK1=am_MSRK*(2*V_MSRKG+bm_MSRK)*(V_MSRKG-bm_MSRK)**2
DMSRK2=R*T*(V_MSRKG**2+bm_MSRK*V_MSRKG)**2

DVPT_MSRK=NMSRK1*NMSRK2/(DMSRK1-DMSRK2)

CO_MSRKG=-1*DVPT_MSRK/V_MSRKG

143
VTMSRK = V_MSRKL + V_MSRKG
CT_MSRK = (V_MSRKG/VTMSRK)*CO_MSRKG + (V_MSRKL/VTMSRK)*CO_MSRKL
End Subroutine CompValue

!***************Bisection Method Subroutine********************

Subroutine bisect(A,B,MF,Ki,C)

Implicit None

Real, Intent(In) :: A,B,MF(99),Ki(99)


Real, Intent(Out) :: C
Real :: DNV,CONV,AA,BB, k,KMAX

DNV=0.0
CONV=0.001
KMAX = 40000
K=1

AA=B
BB=A

C = (AA+BB)/2

Do i=1,NCOMP
DNV=DNV + MF(i)*(Ki(i)-1)/(C*(Ki(i)-1)+1)
end do

2345 If (K .LE. Kmax) Then


K=K + 1
If (ABS(AA-BB).GE.CONV) Then
If (DNV.GT.0.0) Then
AA=AA
BB=C
else
AA=C
BB=BB
endif

!write(6,*) " Counter = " , K , "NV = " , C, "FPV =", DNV

C = (AA+BB)/2
DNV = 0
Do i=1,NCOMP
DNV=DNV + MF(i)*(Ki(i)-1)/(C*(Ki(i)-1)+1)
end do

goto 2345
endif
end if

C=C

If (K .GE. Kmax) Then


C=0
end if

144
End Subroutine bisect

!**********Z Factor Subroutine ***********************************

Subroutine Zfactor_FugacPR(PR,Li,Vi,NV,ZLPR,ZGPR,FLPR,FGPR
&,BAPR,BBPR)

Implicit None

Real, Intent (In) :: PR,Li(99),Vi(99),NV


Real , Intent (Out) :: ZLPR,ZGPR,FLPR(99),FGPR(99)
Real,Intent(OUT) :: BAPR,BBPR

Real :: ZGMSRK,FLMPR(99),FGMPR(99),ZLSRK,ZGSRK,ZLMPR,ZGMPR,ZLMSRK
Real :: FLMSRK(99),FGMSRK(99),FLSRK(99),FGSRK(99)

Real :: BBSRK,BASRK,BAMPR,BBMPR,BAMSRK
Real :: BBMSRK,BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK
Real :: JPR,JMPR,JSRK,JMSRK,JPR1,JPR2,JPR3
Real :: SYAIJPR,SYAIJSRK,SYAIJMSRK,SYAIJMPR,Mtype

Double Precision FGGPR(99)

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0
Mtype =0

! Solving for Mixture Parameters

Call ParaMix(PR,Li,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for PR Z factor Liquid********

Coeff(1)=1
Coeff(2)= -1*(1-BBPR)
Coeff(3)= BAPR -3*BBPR**2-2*BBPR
Coeff(4)= -1*(BAPR*BBPR-BBPR**2-BBPR**3)

!Write(6,*) " Called ParaMix"


!write (6,*) " Li = " , Li , "Vi = ", Vi , "PR = " , PR
!Write(6,*) "YAIJPR =" , YAIJPR
!write(6,*) " BAPR = " , BAPR
!write (6,*) "BBPR = " , BBPR
!write (6,*) "Coeff = " , Coeff

Call Cubic_Solver(Mtype,Coeff,RT)

145
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
ZLPR = RT(1)
else
ZLPR=RT(2)
endif
If (ZLPR.LE.RT(3)) Then
ZLPR = ZLPR
else
ZLPR =RT(3)
endif

! write (6,*) " ZLPR = " , ZLPR

!******Liquid Fugacity************************************************

Do i = 1,NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Li(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Li(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Li(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Li(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

!********Liquid Fugacity for PR EOS************************************


JPR1=(BiPR(i)*(ZLPR-1)/BBPR)-Alog(ZLPR-BBPR)
JPR2 = (BAPR/(2.828427*BBPR))*((BiPR(i)/BBPR)-2*YAIJPR/BAPR)
JPR3 = Alog((ZLPR+2.414214*BBPR)/(ZLPR-0.414214*BBPR))
JPR = JPR1 + JPR2*JPR3

FLPR(i)= Li(i)*PR*exp(JPR)

!Write(6,*) "FLPR =" , FLPR(i)


!write (6,*) "YAIJPR = " , YAIJPR

end do

146
!********Mol * Z factor*******************
!ZLPR = ZLPR * (1-NV)

!**********Vapor Z Factor********************************************

Call ParaMix(PR,Vi,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for PR Z factor Vapor********

Coeff(1)=1
Coeff(2)= -1*(1-BBPR)
Coeff(3)= BAPR -3*BBPR**2-2*BBPR
Coeff(4)= -1*(BAPR*BBPR-BBPR**2-BBPR**3)

!Write (6,*) " Gas Values"


!Write(6,*) "YAIJPR =" , YAIJPR
!write(6,*) " BAPR = " , BAPR
!write (6,*) "BBPR = " , BBPR

!write (6,*) "Coeff = " , Coeff

If (NV.LT.0) Then
Mtype = 1.0
end if

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).GT.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).GT.RT(2)) Then
ZGPR = RT(1)
else
ZGPR=RT(2)
endif
If (ZGPR.GT.RT(3)) Then
ZGPR = ZGPR
else
ZGPR = RT(3)
endif
!write (6,*) "ZGPR = ", ZGPR, "NV = ", NV
!write(6,*) " BBPR =", BBPR

!******Vapor Fugacity************************************************

Do i = 1,NCOMP

YAIJPR = 0

147
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Vi(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Vi(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Vi(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Vi(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

!********Vapor Fugacity for PR EOS************************************


JPR1=(BiPR(i)*(ZGPR-1)/BBPR)-Alog(ZGPR-BBPR)
JPR2 = (BAPR/(2.828427*BBPR))*((BiPR(i)/BBPR)-2*YAIJPR/BAPR)
JPR3 = Alog((ZGPR+2.414214*BBPR)/(ZGPR-0.414214*BBPR))
JPR = JPR1 + JPR2*JPR3

!Write(6,*) "JPR =" , JPR

FGPR(i)= Vi(i)*PR*exp(JPR)

!write (6,*) "FGPR =" , FGPR(i)


!write (6,*) "YAIJPR = " , YAIJPR
end do

!************Imaginary Root********************
!If (NV .LT.0) then
!If (RT(1).GT.RT(2)) Then
!ZGPR = RT(2)
!else
!ZGPR=RT(1)
! endif
!end if

!***************************************************
!********Mol * Z factor*******************
!ZGPR = ZGPR * NV

End Subroutine Zfactor_FugacPR

!***********************Subroutine Z factor Fugacity MPR EOS*******************

Subroutine Zfactor_FugacMPR(PR,Li,Vi,NV,ZLMPR,ZGMPR,FLMPR,FGMPR
&,BAMPR,BBMPR)

Implicit None

Real, Intent (In) :: PR,Li(99),Vi(99),NV


Real, Intent (Out) :: ZLMPR,ZGMPR,FLMPR(99),FGMPR(99)
Real, Intent(OUT):: BAMPR,BBMPR
Real :: ZGMSRK,FLPR(99),FGPR(99),ZLSRK,ZGSRK,ZLMSRK
Real :: FLMSRK(99),FGMSRK(99),FLSRK(99),FGSRK(99),ZLPR,ZGPR

148
Real :: BAPR,BBPR,BBSRK,BASRK,BAMSRK,BBMSRK
Real :: BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK
Real :: JPR,JMPR,JSRK,JMSRK,Mtype

Mtype =0

Call ParaMix(PR,Li,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for MPR Z factor Liquid********

Coeff(1)=1
Coeff(2)= -1*(1-BBMPR)
Coeff(3)= BAMPR -3*BBMPR**2-2*BBMPR
Coeff(4)= -1*(BAMPR*BBMPR-BBMPR**2-BBMPR**3)

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
ZLMPR = RT(1)
else
ZLMPR=RT(2)
endif
If (ZLMPR.LE.RT(3)) Then
ZLMPR = ZLMPR
else
ZLMPR =RT(3)
endif

!********Liquid Fugacity for MPR EOS************************************


Do i=1, NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Li(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Li(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Li(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Li(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

149
End do

JMPR=(BiMPR(i)*(ZLMPR-1)/BBMPR)-Alog(ZLMPR-BBMPR)+(BAMPR/(2.828427
& *BBMPR))*((BiMPR(i)/BBMPR)-2*YAIJMPR/BAMPR)*Alog((ZLMPR+2.414214
& *BBMPR)/(ZLMPR-0.414214*BBMPR))

FLMPR(i)= Li(i)*PR*exp(JMPR)
end do

!ZLMPR = ZLMPR*(1-NV)

Call ParaMix(PR,Vi,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for MPR Z factor Vapor********

Coeff(1)=1
Coeff(2)= -1*(1-BBMPR)
Coeff(3)= BAMPR -3*BBMPR**2-2*BBMPR
Coeff(4)= -1*(BAMPR*BBMPR-BBMPR**2-BBMPR**3)

If (NV.LT.0) Then
Mtype = 1.0
end if

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).GT.RT(2)) Then
ZGMPR = RT(1)
else
ZGMPR=RT(2)
endif
If (ZGMPR.GT.RT(3)) Then
ZGMPR = ZGMPR
else
ZGMPR =RT(3)
endif

!********Vapor Fugacity for MPR EOS************************************


Do i=1,NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

150
Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Vi(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Vi(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Vi(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Vi(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

JMPR=(BiMPR(i)*(ZGMPR-1)/BBMPR)-Alog(ZGMPR-BBMPR)+(BAMPR/(2.828427
& *BBMPR))*((BiMPR(i)/BBMPR)-2*YAIJMPR/BAMPR)*Alog((ZGMPR+2.414214
& *BBMPR)/(ZGMPR-0.414214*BBMPR))

FGMPR(i)= Vi(i)*PR*exp(JMPR)

end do

!************Imaginary Root********************
!If (NV .LT.0) then
!If (RT(1).GT.RT(2)) Then
! ZGMPR = RT(2)
! else
! ZGMPR=RT(1)
! endif
!end if

!***************************************************
!ZGMPR = ZGMPR*NV

End Subroutine Zfactor_FugacMPR

!***********************Subroutine Z factor Fugacity SRK*******************

Subroutine Zfactor_FugacSRK(PR,Li,Vi,NV,ZLSRK,ZGSRK,FLSRK,FGSRK
&,BBSRK,BASRK)

Implicit None

Real, Intent (In) :: PR,Li(99),Vi(99),NV


Real, Intent (Out) :: ZLSRK,ZGSRK,FLSRK(99),FGSRK(99),BBSRK,BASRK
Real :: ZGMSRK,FLPR(99),FGPR(99),FLMPR(99),FGMPR(99),ZLMPR,ZGMPR
Real :: FLMSRK(99),FGMSRK(99),ZLPR,ZGPR,ZLMSRK

Real :: BAPR,BBPR,BAMPR,BBMPR,BAMSRK,BBMSRK
Real :: BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK
Real :: JPR,JMPR,JSRK,JMSRK,Mtype

Mtype =0

Call ParaMix(PR,Li,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR

151
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for SRK EOS Z factor Liquid********

Coeff(1)=1
Coeff(2)= -1
Coeff(3)= BASRK - BBSRK - BBSRK**2
Coeff(4)= -1*BASRK*BBSRK

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).LE.0.01) then
RT(3)=RT(1)
end if
If (RT(2).LE.0.01) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
ZLSRK = RT(1)
else
ZLSRK=RT(2)
endif
If (ZLSRK.LE.RT(3)) Then
ZLSRK = ZLSRK
else
ZLSRK =RT(3)
endif

!********Liquid Fugacity for SRK EOS************************************


Do i=1, NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Li(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Li(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Li(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Li(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

JSRK=(BiSRK(i)*(ZLSRK-1)/BBSRK)-Alog(ZLSRK-BBSRK)+(BASRK/BBSRK)*
& ((BiSRK(i)/BBSRK)-2*YAIJSRK/BASRK)*Alog(1+(BBSRK/ZLSRK))

FLSRK(i) = Li(i)*PR*EXP(JSRK)
end do

ZLSRK = ZLSRK*(1-NV)

Call ParaMix(PR,Vi,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR

152
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for SRK EOS Z factor Vapor********

Coeff(1)=1
Coeff(2)= -1
Coeff(3)= BASRK - BBSRK - BBSRK**2
Coeff(4)= -1*BASRK*BBSRK

If (NV.LT.0) Then
Mtype = 1.0
end if

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).GT.RT(2)) Then
ZGSRK = RT(1)
else
ZGSRK=RT(2)
endif
If (ZGSRK.GT.RT(3)) Then
ZGSRK = ZGSRK
else
ZGSRK =RT(3)
endif

!********Vapor Fugacity for SRK EOS************************************


Do i=1,NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Vi(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Vi(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Vi(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Vi(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

JSRK=(BiSRK(i)*(ZGSRK-1)/BBSRK)-Alog(ZGSRK-BBSRK)+(BASRK/BBSRK)*
& ((BiSRK(i)/BBSRK)-2*YAIJSRK/BASRK)*Alog(1+(BBSRK/ZGSRK))

FGSRK(i) = Vi(i)*PR*EXP(JSRK)

153
end do

!************Imaginary Root********************
!If (NV .LT.0) then
!If (RT(1).GT.RT(2)) Then
!ZGSRK = RT(2)
! else
!ZGSRK =RT(1)
!endif
!end if

ZGSRK = ZGSRK*NV

!***************************************************
End Subroutine Zfactor_FugacSRK

!***********Subroutine for MSRK Z factor & Fugacity**************************

Subroutine Zfactor_FugacMSRK(PR,Li,Vi,NV,ZLMSRK,ZGMSRK,FLMSRK
& ,FGMSRK,BAMSRK,BBMSRK)

Implicit None

Real, Intent (In) :: PR,Li(99),Vi(99),NV


Real, Intent (OUT) :: ZLMSRK,ZGMSRK,FLMSRK(99),FGMSRK(99),BAMSRK
Real, Intent (OUT) :: BBMSRK
Real :: ZLPR,ZGPR,ZLSRK,ZGSRK,ZLMPR,ZGMPR,FLSRK(99)
Real :: FLPR(99),FGPR(99),FLMPR(99),FGMPR(99),FGSRK(99)

Real :: BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR
Real :: BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK
Real :: JPR,JMPR,JSRK,JMSRK

Mtype =0

Call ParaMix(PR,Li,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for MSRK EOS Z factor Liquid********

Coeff(1)=1
Coeff(2)= -1
Coeff(3)= BAMSRK - BBMSRK - BBMSRK**2
Coeff(4)= -1*BAMSRK*BBMSRK

Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).LE.0.01) then
RT(3)=RT(1)
end if
If (RT(2).LE.0.01) then
RT(2)=RT(1)

154
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).LE.RT(2)) Then
ZLMSRK = RT(1)
else
ZLMSRK=RT(2)
endif
If (ZLMSRK.LE.RT(3)) Then
ZLMSRK = ZLMSRK
else
ZLMSRK =RT(3)
endif

!********Liquid Fugacity for MSRK EOS************************************


Do i=1,NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Li(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Li(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Li(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Li(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

JMSRK=(BiMSRK(i)*(ZLMSRK-1)/BBMSRK)-Alog(ZLMSRK-BBMSRK)+(BAMSRK
& /BBMSRK)*((BiMSRK(i)/BBMSRK)-2*YAIJMSRK/BAMSRK)*Alog(1+(BBMSRK
& /ZLMSRK))

FLMSRK(i) = Li(i)*PR*EXP(JMSRK)

end do

ZLMSRK = ZLMSRK*(1-NV)

Call ParaMix(PR,Vi,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

!***Calculating Coeff for MSRK EOS Z factor Vapor********

Coeff(1)=1
Coeff(2)= -1
Coeff(3)= BAMSRK - BBMSRK - BBMSRK**2
Coeff(4)= -1*BAMSRK*BBMSRK

If (NV.LT.0) Then
Mtype = 1.0
end if

155
Call Cubic_Solver(Mtype,Coeff,RT)
If (RT(3).EQ.0.0) then
RT(3)=RT(1)
end if
If (RT(2).EQ.0.0) then
RT(2)=RT(1)
end if
If (RT(1).EQ.0.0) then
Write(6,*)"Error All roots are zeros"
endif
If (RT(1).GT.RT(2)) Then
ZLMSRK = RT(1)
else
ZLMSRK=RT(2)
endif
If (ZGMSRK.GT.RT(3)) Then
ZGMSRK = ZGMSRK
else
ZGMSRK =RT(3)
endif

!*****Vapor Fugacity for MSRK EOS************************************


Do i= 1, NCOMP

YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

Do j = 1, NCOMP
Kij = 1
YAIJPR = YAIJPR + Vi(j)*(AiPR(j)*AiPR(i))**0.5*kij
YAIJSRK = YAIJSRK + Vi(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
YAIJMPR = YAIJMPR + Vi(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
YAIJMSRK = YAIJMSRK + Vi(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

End do

JMSRK=(BiMSRK(i)*(ZGMSRK-1)/BBMSRK)-Alog(ZGMSRK-BBMSRK)+(BAMSRK
& /BBMSRK)*((BiMSRK(i)/BBMSRK)-2*YAIJMSRK/BAMSRK)*Alog(1+(BBMSRK
& /ZGMSRK))

FGMSRK(i) = Vi(i)*PR*EXP(JMSRK)

end do

!************Imaginary Root********************
!If (NV .LT.0) then
!If (RT(1).GT.RT(2)) Then
!ZGMSRK = RT(2)
! else
!ZGMSRK =RT(1)
!endif

156
!end if

ZGMSRK = ZGMSRK*NV

!***************************************************

End Subroutine Zfactor_FugacMSRK

!***********Subroutine Parameter Mixture*******************

Subroutine ParaMix(PR,Ji,BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK,
& BBMSRK,AiPR,BiPR,AiMPR,BiMPR,AiMSRK,BiMSRK,AiSRK,BiSRK,YAIJPR
& ,YAIJSRK,YAIJMPR,YAIJMSRK)

Real, Intent (In) :: PR, Ji(99)


Real, Intent (OUT) :: BAPR,BBPR,BBSRK,BASRK,BAMPR,BBMPR,BAMSRK
Real, Intent (OUT) :: BBMSRK,BiPR(99),AiPR(99),BiMPR(99),AiMPR(99)
Real, Intent (OUT) :: AiMSRK(99),BiMSRK(99),BiSRK(99),AiSRK(99)
Real, Intent (OUT) :: YAIJPR,YAIJSRK,YAIJMPR,YAIJMSRK

Real :: SYAIJPR(99,99),SYAIJSRK(99,99),SYAIJMPR(99,99)
Real :: SYAIJMSRK(99,99),LLi(99)

am_LLS = 0
am_SRK = 0
am_Pr = 0
bmi_LLS = 0
bmi_SRK = 0
bmi_PR = 0
YAIJPR = 0
YAIJSRK = 0
YAIJMPR = 0
YAIJMSRK = 0

LLi = Ji

!****************************************************************************!
Do i=1,NCOMP

OWi(i) = 0.361/(1+(0.274*A_Fi(i)))

mi_LLS(i) = 0.14443 + 1.0662*A_Fi(i) + 0.02756*A_Fi(i)


& *A_Fi(i) - 0.18074*(A_Fi(i)**3)

TRi(i)=T/Tci(i)
PRi(i)=PR/Pci(i)

OBi(i)=Zci(i)*OWi(i)
OAi(i)=(1+(OWi(i)-1)*Zci(i))**3

TF_LLS(i)=(1+mi_LLS(i)*(1-TRi(i)**0.5))**2

157
mi_SRK(i) = 0.480 + 1.574*A_Fi(i) - 0.176*A_Fi(i)**2

mi_PR(i) = 0.37464 + 1.54226*A_Fi(i) - 0.26992*A_Fi(i)**2

TF_SRK(i)=(1+(mi_SRK(i))*(1- TRi(i)**0.5))**2

TF_PR(i)=(1+(mi_PR(i))*(1- TRi(i)**0.5))**2

ai_LLS(i) = (TF_LLS(i)*OAi(i)*(R*Tci(i))**2)/Pci(i)
bi_LLS(i) = ((OBi(i)*R*Tci(i))/Pci(i))

ai_SRK(i)= (0.42748*TF_SRK(i)*(R*Tci(i))**2)/pci(i)
bi_SRK(i) = (0.08664*R*Tci(i))/pci(i)

ai_PR(i) = 0.45724*TF_PR(i)*(R*Tci(i))**2/pci(i)
bi_PR(i) = 0.07780*R*Tci(i)/pci(i)
ai_MPR(i) = ai_LLS(i)
bi_MPR(i) = bi_LLS(i)
ai_MSRK(i) = ai_LLS(i)
bi_MSRK(i)= bi_LLS(i)

END DO

!****************************************************************************!

DO i=1,NCOMP

AiPR(i)= ai_PR(i)*PR/(R*T)**2
BiPR(i)= bi_PR(i)*PR/ (R*T)

AiSRK(i)= ai_SRK(i)*PR/(R*T)**2
BiSRK(i)= bi_SRK(i)*PR/ (R*T)

AiMPR(i)= ai_MPR(i)*PR/(R*T)**2
BiMPR(i)= bi_MPR(i)*PR/ (R*T)

AiMSRK(i)= ai_MSRK(i)*PR/(R*T)**2
BiMSRK(i)= bi_MSRK(i)*PR/ (R*T)

DO j=1,NCOMP
IF ( (Tci(i)/Pci(i)**0.5) < (Tci(j)/Pci(j)**0.5) ) THEN
kij = ((Tci(i)/Pci(i)**0.5)/(Tci(j)/Pci(j)**0.5))**0.5

ELSE
kij = ((Tci(j)/Pci(j)**0.5)/(Tci(i)/Pci(i)**0.5) )**0.5
END IF

kij=1

ami_LLS=LLi(i)*LLi(j)*(ai_LLS(i)*ai_LLS(j))**0.5*kij

ami_SRK=LLi(i)*LLi(j)*(ai_SRK(i)*ai_SRK(j))**0.5*kij

158
ami_PR =LLi(i)*LLi(j)*(ai_PR(i)*ai_PR(j))**0.5*kij
am_LLS = am_LLS + ami_LLS
am_SRK = am_SRK + ami_SRK

am_PR = am_PR + ami_PR


am_MSRK= am_LLS
am_MPR = am_LLS

END DO

bmi_LLS = bmi_LLS + ( LLi(i)*bi_LLS(i) )


bmi_SRK = bmi_SRK + ( LLi(i)*bi_SRK(i) )
bmi_PR = bmi_PR + ( LLi(i)*bi_PR(i) )

END Do

do i= 1, NCOMP

Do j = 1, NCOMP
Kij = 1
SYAIJPR (i,j) = YAIJPR + LLi(j)*(AiPR(j)*AiPR(i))**0.5*kij
SYAIJSRK(i,j) = YAIJSRK + LLi(j)*(AiSRK(j)*AiSRK(i))**0.5*kij
SYAIJMPR(i,j) = YAIJMPR + LLi(j)*(AiMPR(j)*AiMPR(i))**0.5*kij
SYAIJMSRK(i,j) = YAIJMSRK + LLi(j)*(AiMSRK(j)*AiMSRK(i))**0.5*kij

YAIJPR = SYAIJPR (I,J)


YAIJSRK = SYAIJSRK(I,J)
YAIJMPR = SYAIJMPR (I,J)
YAIJMSRK = SYAIJMSRK (I,J)

End do
end do

bm_LLS = bmi_LLS
bm_SRK = bmi_SRK
bm_PR = bmi_PR
bm_MPR = bm_LLS
bm_MSRK=bm_LLS

BAPR=am_PR*PR/(R*T)**2
BBPR=bm_PR*PR/(R*T)

BASRK=am_SRK*PR/(R*T)**2
BBSRK=bm_SRK*PR/(R*T)

BAMPR=am_MPR*PR/(R*T)**2
BBMPR=bm_MPR*PR/(R*T)

BAMSRK=am_MSRK*PR/(R*T)**2
BBMSRK=bm_MSRK*PR/(R*T)

End Subroutine ParaMix

159
!**************Subroutine Cubic Solver******************************

!*****************************Cubic Solver 2******************************

SUBROUTINE Cubic_Solver(Mtype,Coeff,X)

IMPLICIT NONE

!REAL :: X1,X2,X3

REAL :: F,G,H,I,J,K,L,M,N,P,RI
REAL :: K1,K2,K3,K4
Real :: A,B,C,D

REAL :: U_D , T, S

REAL , INTENT (IN) :: Mtype, Coeff(4)


REAL , INTENT (OUT) :: X(3)

X(1)=0.0
X(2)=0.0
X(3)=0.0

A= Coeff(1)
B = Coeff(2)
C = Coeff(3)
D = Coeff(4)

F = (( 3*C/A) - (B*B)/(A*A) ) /3

G = (2*B**3/A**3 - 9*B*C/(A*A) + 27*D/A ) / 27

H = ((G*G)/4) + ((F**3)/27)

K1=F-G
K2=H-G
K3=ABS(K2-K1)
K4=0.0000001

IF (abs(K3).LT.K4) THEN

X(1) = (D/A)**0.3333 * (-1)

END IF
IF (H.LE.0) THEN

I = ((G*G)/4 - H )**0.5

J = I**0.3333

K = ACOS ( (-1 * G)/ (2*I) )

L = -1 * J

160
M = COS (K/3)

N = 3**0.5 * SIN (K/3)

P = B/(3*A) * ( -1)

X(1) = 2*J* COS (K/3) - b/(3*A)

X(2) = L * ( M + N ) + P

X(3) = L * (M -N ) + P

ENDIF

IF (H .GT.0) THEN
RI = ((-1*G)/2) + H**0.5

S = RI**(0.33333)

T = ((-1*G)/2) - H**0.5
If (T.LE.0) Then
T = -1*T
U_D =T**0.33333
U_D = -1 * U_D
Else
U_D =T**0.33333
End If

X(1) = S + U_D - B/(3*A)

!****Looking for imaginary root for gas***********************

If (Mtype .EQ. 1.0) then


X(2) = -1* (S + U_D)/2 - ( B/(3*A))

end if

!**************************************************

! " One Real Root And 2 Imaginary "

! X1 - Real Root
!Imaginary roots
! -1* (S + U_D)/2 - ( B/(3*A)),"+i",(S-U_D)*3**0.5/2
! -1* (S + U_D)/2- ( B/(3*A) ), "- i",(S-U_D)*3**0.5/2
END IF

END subroutine Cubic_solver

!***************End of Program******************************

End Program Flash_Iso_Comp

161
APPENDIX K

VITA

Olaoluwa Adepoju was born in Ibadan, Nigeria. He attended Mayflower

secondary school, Ikenne, Ogun State Nigeria where he graduated with distinctions in

mathematics and chemistry. Ola Adepoju is a Chemical Engineering Graduate from

Ladoke Akintola University of Technology, Ogbomosho, Nigeria, where he graduated

with a first class and was awarded the best graduating student in the faculty of

engineering and technology.

Ola has exemplified himself as a hardworking and dedicated student. He placed

second during the Texas Tech SPE Student paper contest and went ahead to present the

same paper at the 2006 SPE Gulf Coast Student paper contest at Texas A&M, College

Station, Texas. He also presented a Poster at the Graduate School Poster Competition.

Ola worked comfortably in research teams. He worked closely with a Ph.D.

student (Lukeman Adetunji) in his dissertation titled Thermodynamically Equivalent

Pseudo-Components Validated for Compositional Reservoir Models.

Olas research interest is in Reservoir Engineering and Phase Behavior; he carried

out reservoir simulation and well testing analysis using ECLIPSE Software and Weltest

200.

Ola worked with as a graduate assistant with Dr Lloyd Heinze in the

undergraduate drilling engineering class.

162
PERMISSION TO COPY

In presenting this thesis in partial fulfillment of the requirements for a masters

degree at Texas Tech University or Texas Tech University Health Sciences Center, I

agree that the Library and my major department shall make it freely available for research

purposes. Permission to copy this thesis for scholarly purposes may be granted by the

Director of the Library or my major professor. It is understood that any copying or

publication of this thesis for financial gain shall not be allowed without my further

written permission and that any user may be liable for copyright infringement.

Agree (Permission is granted.)

Adepoju, Olaoluwa Opeoluwa November 28, 2006


Student Signature Date

Disagree (Permission is not granted.)

_______________________________________________ _________________
Student Signature Date

You might also like