You are on page 1of 70

ALFAsim

Artificial Lift and Flow Assurance Simulator

Technical Manual
Revision 01

This document presents the theory behind the development of ALFAsim

Written by: ESSS


Support Contact: alfasim-support@esss.co
CONTENTS 1

Contents

1 Hydrodynamic Model 5

1.1 Mass Balance Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.2 Momentum Balance Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.3 Energy Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Flow Patterns 10

2.1 Flow Regimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2 Unit Cell Model (UCM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.2.1 UCM Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3 Emulsion Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.1 Relative viscosity models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.2 Droplet Size Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.3.3 Phase Inversion Point Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Boundary Conditions and Process Equipment 19

3.1 Mass node and Mass source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.1.1 Mass Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2 Reservoir inflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2.1 Linear IPR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.2.2 Fetkovich IPR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
CONTENTS 2

3.2.3 Forchheimer IPR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2.4 Table IPR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3.2.5 Vogel IPR model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3.3 Pressure node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3.4 Pump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3.4.1 Constant Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.4.2 Table Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.4.3 Electric Submersible Pump (ESP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.4.4 Thermal Efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.5 Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.5.1 Perkins Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.5.2 Gas Lift Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.5.3 Choke Valve with C v table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.5.4 Check Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.6 Compressor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.7 Separator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.8 Pig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.9 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.10 Leak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4 Tracers 31

5 Fluid and PVT Models 32

5.1 PVT Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.2 Black oil Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.2.1 Standing Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
CONTENTS 3

5.2.2 Lasater et al. Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.2.3 Vazquez et al. Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.2.4 Glaso et al. Correlations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.2.5 Oil viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.2.6 Gas density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.2.7 Gas viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.2.8 Bubble point pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.2.9 Thermodynamic properties of Blackoil Model . . . . . . . . . . . . . . . . . . . . . . . . 38

5.3 Compositional Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.3.1 Equations of State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.3.2 Flash Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.3.3 Thermophysical Properties Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.3.4 Components Transport Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.4 Combined Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6 Steady State Solver 54

7 Wax Module 56

8 Hydrates Module 59

8.1 Single Formation Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

8.2 Population Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

8.3 Hydrocarbon Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

8.3.1 Calculated from PVT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

8.3.2 Partitioning table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

8.4 Heat of formation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

8.5 Thermodynamic Hydrate Inhibition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
CONTENTS 4

9 Assisted History Matching 64

9.1 Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

9.1.1 Local Sensitivity Analysis - Tornado Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

9.1.2 Global Sensitivity Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5

Chapter 1

Hydrodynamic Model

ALFAsim uses a multiphase model strategy that allows an arbitrary number of fields. phases and layers.
Provided that all closure terms are available. Currently, there are two hydrodynamic models available with
a complete set of closure relations: 4-field/2-phase/2-layer model and a 6-field/3-phase/3-layer model.

1.1 Mass Balance Equations

The one-dimensional nonlinear system of equations are obtained through an averaging process from
the 3d local instantaneous equations. The resulting mass balance equation for each field k is

NX
∂ ∂
sources

(αk ρk ) + (αk ρk uk ) = Γk,s , (1.1)


∂t ∂x s

where αk is the volume fraction, ρk is the mass density, uk is the velocity and Γk,s is the source the of field
k with respect to the source s, which may be mass transfer between fields due entrainment and deposition
of the dispersed fields (mechanical mass transfer) and due evaporation and condensation between phases
or any other mass source.

For convenience, as the main approach for calculating fluid properties is by the use of PVT tables, the

term ∂ t (αk ρk ) is expanded as

∂ ∂ αk ∂ ρk ∂p ∂ ρk ∂T
 ‹  ‹ 
(αk ρk ) = ρk + αk + , (1.2)
∂t ∂t ∂p T,Rs ∂t ∂ T p,Rs ∂ t

or
∂ ∂ αk ∂ ρk ∂p ∂ ρk ∂H
 ‹  ‹ 
(αk ρk ) = ρk + αk + , (1.3)
∂t ∂t ∂p H,Rs ∂t ∂ H p,Rs ∂ t

in cases where temperature or enthalpy is the primary variable of the system of equations, respectively.
∂ρ ∂ρ ∂ρ ∂ρ
€ Š € Š € Š € Š
where ∂ Pk , ∂ Pk , ∂ Tk and ∂ Hk are values obtained directly from the PVT table.
T,Rs H,Rs p,Rs p,Rs

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
1.2. MOMENTUM BALANCE EQUATIONS 6

1.2 Momentum Balance Equations

The momentum balance equation for each field k is given by:

∂ ∂  ∂ pk ∂ αk
(αk ρk uk ) + Cku αk ρk uk uk = −αk − αk ρk g sin θ + (pki − pk )
∂t ∂x ∂x ∂x
NX (1.4)
τwk Swk τi Si drag
sources

− ± + Fkvm + Fk + Γk,s ūk,s


A A s

τi Si
where θ is the pipe inclination, A is the cross section area, τwk Swk is the wall shear stress, A is the
interfacial shear stress, Swk is the wall wet perimeter, Si is the interface wet perimeter and Cu,k is the
distribution parameter of phase k which is set to 1 by default. ūk,s is the reference velocity that will
account for the momentum transported by the mass source Γk,s . In ALFAsim, momentum balance equations

Figure 1.1: Components of a 4-field/2-phase/2-layer model for horizontal and vertical pipe configurations.

are solved for each layer (Figure 1.1). Since a layer consists of the sum of all fields belonging to the same
layer (continuous field plus all the dispersed fields), the momentum equations for each field are summed
together for all fields in the same layer. This process cancels out drag and virtual mass terms, leaving only
closure terms related to wall and interfaces between layers. The resulting momentum equation for layer
L is

∂ X ∂ X u 
(αk ρk uk ) + Ck αk ρk uk uk
∂ t k∈L ∂ x k∈L
∂ pL ∂ αL
= −αL − αL ρL g sin θ + ∆pL i (1.5)
∂x ∂x
NX
τw Sw τi Si sources
 ‹ X  ‹ X
− ± + Γk,s ūk,L ,s
A L κ̸=L
A κ,L k∈L s

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
1.3. ENERGY EQUATION 7

1.3 Energy Equation

The total energy balance equation for each field L is expressed by:

∂ X u2k ∂ X u2k
     
αk ρk hk + + αk ρk uk hk +
∂ t k∈L 2 ∂ x k∈L 2
∂ pL X ∂ αL
= αL − (αk ρk uk ) g sin θ + ∆pL i (1.6)
∂t k∈L
∂t
X X NX
sources

+ Q̇ source,L + Q̇ wall,L + Q i,κ,L + Γk,s h̄k,L ,s .


κ̸=L k∈L s

The the right-hand side of eq. (1.7) contains terms related to energy variation due to pressure, heat sources,
heat transfer with external environment (through pipe wall) and interfacial heat transfer (through interface
between layers). ALFAsim has two approaches for solving energy: the first solves a single mixture energy
equation (same temperature for all fields) and the second solves one energy equation for each layer (one
temperature for each layer). The mixture (global) energy equation is obtained by summing eq. (1.7),
which cancels out all interfacial energy transfer terms. Therefore,

∂ X u2k ∂ X u2k
     
αk ρk hk + + αk ρk uk hk +
∂t k 2 ∂x k 2
(1.7)
∂p X
= − (αk ρk uk ) g sin θ + Q̇ source + Q̇ wall .
∂t k

Moreover, the solver can handle these equations using temperature or enthalpy as the independent vari-
ables of the problem. Providing a PVT table to the software these variables will be automatically chosen,
if a PH table is imported then the enthalpy will be used.

Wall Heat Transfer Term

There are three options for wall heat transfer: adiabatic, steady state and transient. For the adiabatic
model, no wall heat transfer is considered. For the steady state model, it is considered a global heat transfer
coefficient, which accounts all types of heat transport (external and internal convection and diffusion)
between the fluid inside the pipe and the external environment. Thus,

qwk = η ght c (Tk − T∞ ) (1.8)

where qwk is the heat transfer per unit area, T∞ is the external environment temperature, Tk is the layer
temperature and η ght c is the global heat transfer coefficient. It is important to point out that it is only
consider the steady state heat transfer through the wall.

This coefficient can be an user input or, yet, it is calculated in the simulator using the convection heat

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
1.3. ENERGY EQUATION 8

transfer coefficient of the external and internal (fluid) environment and the thermal conductivity of the
wall. The wall layer can be solid or fluid materials as this will affect the model used to evaluate the heat
flux resistances, as shown in Figure 1.2.

Figure 1.2: Wall steady-state temperature model.

Therefore, it can be written


η ght c = ηwk,e f f Aw , (1.9)

where
Aw = 2πrw L = πD L, (1.10)

and !−1
1
ηwk,e f f = Pn rw 1 , (1.11)
hwk + i=1 R i + rn henv

For solid materials,


rw
Ri = ri+1 , (1.12)
ki+1/2 ln ri

and for fluid materials (annulus),

hannulus = hradiation + hconvection . (1.13)

Expressions for hradiation and hconvection can be found in the literature (Hasan and Kabir, 1994, Bejan, 2004,
Simões et al., 2014).

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
1.3. ENERGY EQUATION 9

For the transient heat transfer model, a one dimensional heat transfer equation of the form

∂  1 ∂ ∂T
 ‹
ρc p T = rk + q̇, (1.14)
∂t r∂r ∂r

is solved. This model accounts for heat storage effects and it is the recommended model for most of the
simulation scenarios.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
10

Chapter 2

Flow Patterns

2.1 Flow Regimes

The software considers five flow patterns: stratified, annular, slug, bubbly and dispersed bubbly. The
Unit Cell Model is used as the central model for the flow pattern determination. If the model succeeds in
the evaluation of the slug flow variables then the flow regime is slug, otherwise (if it fails) the regime is
defined depending the type of failure.

The horizontal flow pattern map available in the software is shown in Figure 2.1.

In the case when no root is found for the film liquid volume fraction, the flow is defined as stratified
if θ ≤ 10, else it is bubbly.

Besides that, if
Ls
F= ≥1 (2.1)
Ls + L f

the flow is bubble. If F ≤ 0 the flow is separated defined as:

• stratified, if θ ≤ 10

• annular, if θ > 10

Furthermore, there is 2 more conditions for the stratified flow definition and 2 more for the annular

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.1. FLOW REGIMES 11

Figure 2.1: Flow pattern map horizontal flow using the UCM model

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.2. UNIT CELL MODEL (UCM) 12

flow definition. So, for transition to stratified regime, we have:


v
‹ u (ρ − ρ )gA cos θ
hl u l

g g
| u g − ul |≤ 1 − t
dA
(2.2)
D ρg l
dhl
v
hl
D ) cos θ
u
t g D(1 −
| ul |≤ (2.3)
f wl

For transition to annular regime, it is given by:

hL
h̃ L = < 0.35 (2.4)
D

in which h L is the liquid height.

If the flow is vertical downward, then the condition applies on the liquid volume fraction (αl < 0.35).

2.2 Unit Cell Model (UCM)

The UCM has the purpose of capturing the effects of a slug flow using a relatively coarse grid. The
slug pattern is characterized by unsteadiness, as regions of separated and mixed flow of varying lengths in
portions of the pipe. There are 2 mechanisms that may form slug regime:

• Slug flow is generated by intrinsic hydrodynamic instabilities originated from separated flow, and it
is commonly named "Hydrodynamic slugging";

• Slug flow is formed due sudden changes in pipe inclination, for example in a riser, which may promote
local accumulation of fluids. This slug flow category is often called "Terrain-slugging".

It is important to point out that the mechanism of Hydrodynamic Slugging may not be captured
through the sub-grid strategies of the UCM. This can be identified using the approach of Regime Cap-
turing available in the current simulator, where instabilities are intrinsically captured by the model due the
refined mesh.

Another important point is whenever using the UCM, the sub-grid modeling strategy implies that grid
sizes used should not be excessively refined. Otherwise, the implicit assumptions of the models break
down. Cell sizes of ∆x approximately equals to 10 – 100m are often utilized. However, note that the
choice of grid sizes may also be strongly dependent on the specific cases.

On the figures 2.2 and 2.3, it is shown a typical structure of the unit cell for horizontal and vertical
flows, respectively. It is divided into two main parts: a slug region and a film (or Taylor bubble) region.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.2. UNIT CELL MODEL (UCM) 13

Figure 2.2: Typical structure of the unit cell in horizontal or near-horizontal flows.

Figure 2.3: Typical structure of the unit cell in vertical flows.

2.2.1 UCM Modeling

The input of the UCM are the gas and liquid superficial velocities, pipe geometry, and fluid properties.
The UCM unknowns are: slug body and film region lengths Ls and L f ; the void fraction in the slug body

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.2. UNIT CELL MODEL (UCM) 14

α gs , the bubble and liquid velocities in the slug body u gs and uls ; the Taylor bubble velocity u b ; the film
holdup αl f ; the gas and liquid velocities in the film region u g b and ul f .

The mass balance for liquid and gas phases yields the following equations for the superficial velocities
of liquid (US L ) and gas (USG ):

Lf Ls
US L = U L f α f h f + (1 − αs )U Ls (2.5)
Lu Lu
  Lf Ls
USG = U g f α f (1 − h f ) + UG b α f + αs UGs (2.6)
Lu Lu

where the subscript f , s and b represent the film,. slug and Taylor bubble regions, respectively.

The mass balance relative to a moving reference frame is given by:

(U b − U L f )α f h f = (U b − U Ls )(1 − αs ) (2.7)
(U b − UG b )(1 − α f ) + (U b − UG f )α f (1 − h f ) = (U b − UGs )αs (2.8)

Besides that, it is obtained that the mixture velocity is

Um = US L + USG = U Ls (1 − αs ) + UGs αs (2.9)

The momentum balances for the bubble and aerated film are presented below:

∂  ∂ Pb τi Si τwb S b
(UG f − U b )2 (1 − α f ) + (1 − α f )

ρg =− − − ρG g(1 − α f ) sin θ (2.10)
∂x ∂x A A
∂  ∂ Pb ∂ τw f S f τi Si
(U L f − U b )2 α f h f + α f

ρm + ρm g cos θ (α f ε) = − + − α f g sin θ [ρ L h f + ρG (1 − h f )]
∂x ∂x ∂x A A
(2.11)

Combining eqs. 2.10 and 2.11 and assuming the case of a flat bubble, it is obtained:
τ S
τwb S b τi Si
 ‹ ‹
wf f
−α f − GG + (1 − α f ) − Gf − =0 (2.12)
A A A

in which G represents the gravitational term.

The shear stresses are expressed as:

1
τwb = f b ρG | UG f | UG f (2.13)
2
1
τw f = f f ρL | UL f | UL f (2.14)
2
1
τi = f i ρG | UG f − U L f | (UG f − U L f ) (2.15)
2

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.3. EMULSION MODEL 15

Furthermore, the UCM in ALFAsim uses closure relations to evaluated some unknowns variables, such
as friction factor, holdup in slug, void fractions, slug frequency, among others.

2.3 Emulsion Model

The Emulsion Model handles the interaction between oil and water phases. Currently the model
assumes no-slip between both phases and calculates the amount of dispersion of one phase into the other
one. In the Emulsion Model framework, user may select models for relative viscosity, droplet size, and
inversion point. There is also the possibility to set tuning coefficients to the relative viscosity model as a
function of the water cut.

2.3.1 Relative viscosity models

The effective viscosity of a dispersion is calculated through relative viscosity models:

µeff = µ r µc , (2.16)

where µ r and µc are the relative and the continuous phase viscosities. There are nine relative viscosity
models available in ALFAsim and it is also possible to use a custom model implemented in a plugin. These
models are detailed in the next sections using the nomenclature α, µc , and µd for the dispersed phase
volume fraction, continuous phase viscosity, and dispersed phase viscosity, respectively.

Taylor (1932)

µd + 0.4µc
µ r = 1 + 2.5α (2.17)
µd + µc

Brinkman (1952)

µ r = (1 − α)−2.5 ; (2.18)

Mooney (1951)

2.5α
 ‹
µ r = exp , (2.19)
1 − kα

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.3. EMULSION MODEL 16

where k is equal to 1.35 in model Mooney (1951a) and to 1.91 in model Mooney (1951b)

Pal and Rhodes (1989)

‹2.5
α/φ r el

µr = 1 + ) , (2.20)
(1.19 − α/φ r el
where φ r el is an user input parameter with default value 0.765.

Rønningsen (1995)

µ r = −0.06671 − 0.000775T + 0.03484α + 0.00005T α, (2.21)

where T is the fluid temperature in ◦ C. This model is intended to high viscous oils and is applied only if
water is the dispersed phase, otherwise the relative viscosity is set to one.

Barnea and Mizrahi (1976)

(µc + 2.5µd )α
 ‹
µ r = exp ; (2.22)
(µc + µd )(1 − α)

Woelflin (1942)

µ r = exp(aα2 + bα), (2.23)

where a and b are user inputs with default values 4.2 and 2.5, respectively.

Volumetric Weight

Viscosity is calculated using an arithmetic average weighted on the dispersed phase volume fraction:

αµd + (1 − α)µc
µr = (2.24)
µc

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.3. EMULSION MODEL 17

Table-Based

User inputs a table relating the relative viscosity to the water cut. The relative viscosity is calculated
interpolating from table using WC = α if water is the dispersed phase, or WC = 1 − α otherwise.

Tuning factor

Besides the relative viscosity model, user may also specify a tuning factor as a function of the water-cut.
The effective viscosity is will be given by:
µeff = ϕµ r µc , (2.25)

where ϕ is the tuning factor calculated from input table using WC = α for water in oil dispersion and
WC = 1 − α for oil in water dispersion.

2.3.2 Droplet Size Models

Droplet size models are used to calculate the average diameter of water in oil and oil in water disper-
sions. This parameter interfers directly in the determination of how much of a phase may be dispersed into
the other one and in the verification whether an emulsion is stable or not. There are four models available.

Hinze (1955)

d̄ = 0.3625 (σ/ρc )0.6 ε−0.4 , (2.26)

where
fw U 3
ε=2 , (2.27)
D
in which f w is the wall friction factor.

Sleicher (1962)

The average droplet size is

σ t σ µd U 0.7
v   ‹ 
d̄ = 14 1 + 0.7 (2.28)
ρc U 2 µc U σ

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
2.3. EMULSION MODEL 18

Brauner (2001)

Brauner (2001) droplet size is the maximum between


‹−0.4 
ρm f w α 0.6

d̄ = 1.182DWe−0.6 , (2.29)
c
ρc ∗ (1.0 − α) 1−α

where Wec = ρc U D/σ is the Webber number of the continuous phase, and the droplet size given by Hinze
(1955) model.

Boxall2012

d̄ = D min(0.077We−0.6 , 0.021 Rec /Wec ),


p
c (2.30)

in which Wec and Rec are the Webber and Reynolds numbers, respectively, of the continuous phase.

2.3.3 Phase Inversion Point Models

The phase inversion point is the water-cut at which the flow configuration changes from water dis-
persed in oil to oil dispersed in water. There are two models implemented in ALFAsim: Brauner and
Ullmann (2002), which is the default model, and Yeh, Haynie and Moses (1964).

Brauner and Ullmann (2002)

1
WCinv = , (2.31)
1 + ρ r ν0.4
r

having that

ρo
ρr = (2.32)
ρw
νo
νr = (2.33)
νw

are the relative density and relative kinematic viscosity, respectively.

Yeh, Haynie and Moses (1964)

1
WCinv = (2.34)
1 + µo /µw
p

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
19

Chapter 3

Boundary Conditions and Process


Equipment

3.1 Mass node and Mass source

The conversion from standard to local (p, T ) conditions is achieved by the use of the following PVT
table variables
mg
RS = , (3.1)
m g + mo
and,
mwg
RSW = , (3.2)
mg
where m g is the mass of the gas phase (dry-gas + vapor) and ml is the mass of liquid hydrocarbon phase
(oil). In the equation above, mwg represents the mass of water vapor in the gas phase. Since the total mass
is conserved between standard and local conditions, we have that
 p,T STD
m g + mo + mw = m g + mo + mw , (3.3)
 p,T STD
m g + mo = m g + mo + mSTD p,T
w − mw (3.4)
 p,T STD )
m g + mo = m g + mo − ∆mSTD→(p,T
w . (3.5)

Note that m g = m g g + mwg . Since the water mass variation between standard and local condition equals
minus the vapor variation between these two conditions, we have that
€ Š
) )
∆mSTD→(p,T
w = m p,T
w − mSTD
w = − m p,T
wg − m STD
wg = −∆mSTD→(p,T
wg (3.6)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.2. RESERVOIR INFLOW 20

then,
 p,T STD )
m g + mo = m g + mo + ∆mSTD→(p,T
wg ,
1 − RSSTD RSWSTD
 
 p,T STD
m g + mo = m g + mo × . (3.7)
1 − RS p,T RSW p,T

Using the relation above, prescribed flow rates at standard conditions are converted to local conditions by
accounting for the mass transfer between the standard and (p, T ) condition (STD → (p, T )). Therefore,

STD )
ṁ p,T
g = ṁ g + ∆mSTD→(p,T
g (3.8)
€ Š
STD→(p,T ) STD→(p,T )
ṁop,T = ṁSTD
o − ∆m g − ∆m wg (3.9)
STD→(p,T )
p,T
ṁw = ṁSTD
w − ∆mwg (3.10)

with,

)
 p,T STD
∆mSTD→(p,T
g = m g + mo RS p,T − m g + mo RSSTD , (3.11)
)
 p,T STD STD
∆mSTD→(p,T
wg = m g + mo RS p,T RSW p,T − m g + mo RS RSWSTD . (3.12)

Note that one difference between mass node and mass sources is that the latter does not take place in the
momentum conservation equation due to the hypothesis that the influx is orthogonal to the flow direction.

3.1.1 Mass Source

As explained above, the Mass Source model is very similar with the Well model. For this model, the
user must provide the mass flow rate of each phase (gas, liquid and water for the three phase modeling).

3.2 Reservoir inflow

Reservoir inflow is used to represent mass transfer between reservoir and wells. Even though it is
treated as a source term in the equations, it will effectively act as a boundary condition to the problem. It
is defined over a segment of a pipe and also does not take place in the momentum conservation equation
due to the hypothesis that the influx is orthogonal to the flow direction. Since the total mass flow rate
ṁtotal can be calculated from WC, GOR and GLR values, then for OIL phase we have

(1 − WC)(ρOSTD + GORρGSTD ) + ρW
STD
WC
ṁtotal = QSTD
OI L , (3.13)
1 − WC

whilst for GAS phase,

(1 − WC)(ρOSTD + GORρGSTD ) + ρW
STD
WC
ṁtotal = QSTD
GAS , (3.14)
GLR

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.2. RESERVOIR INFLOW 21

for LIQUID phase,


ṁtotal = QSTD STD STD STD
 
L IQU I D (1 − WC)(ρO + GORρ G ) + ρW WC , (3.15)

finally, for WATER phase,

(1 − WC)(ρOSTD + GORρGSTD ) + ρW
STD
WC
ṁtotal = QSTD
W AT ER . (3.16)
WC

By using the flowing mass fraction of each phase, x p , the partitioning of the total mass flow rate to each
phase is done by
ṁ p = x p ṁtotal (3.17)

All these terms are given by the user, except the flow rate QSTD
P HASE , where PHASE stands for gas, oil, liquid
(oil + water) or water. Traditionally, the flow rate is computed using an Inflow Performance Relationship
(IPR) model, a mathematical tool used to represent the relationship between wellbore flow rate and draw-
down pressure. This differs from one well to another, especially in heterogeneous reservoirs, leading to
several models used in the literature. The available IPR models are listed below:

• Linear IPR model ;

• Fetkovich IPR model ;

• Forchheimer IPR model ;

• Table IPR model ;

• Vogel IPR model ;

Additional details about each IPR model can be found in the sections 3.2.1, 3.2.2, 3.2.3, 3.2.4 and 3.2.5.

The reservoir flowing mass fraction of each phase is optional as it can be obtained from the PVT table.
Furthermore, it is also required as an input the reservoir temperature, the minimum pressure difference of
productivity/injectivity and the length of the well.

3.2.1 Linear IPR model

The linear reservoir inflow model is defined as

QSTD
PHASE = PI(pres − pwell ), (3.18)

where PI is an user input that represents the productivity/injectivity index, Pres is the reservoir pressure
and Pwell is the well pressure.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.2. RESERVOIR INFLOW 22

3.2.2 Fetkovich IPR model

The linear inflow relationship is not sufficient to represent the wellbore deliverability when the botttom
hole flowing pressure (pwell ) drops below the bubble point pressure (pb ). To overcome this issue, Fetkovich
developed an IPR that attempts to account for the non-linear flow behavior of wells under saturated and
undersaturated conditions. In this manner, the IPR is divided into three cases, such that (see Ahmed and
McKinney (2005))


PI(pres − pwell ), if pb ≤ pwell ≤ pres

 PI

2 2

STD p
Q PHASE = 2pb res − p well , if pb > pres > pwell (3.19)

 PI
pb2 − pwell
2

PI(pres − pb ) + if pwell ≤ pb and pres > pb

,

2pb

3.2.3 Forchheimer IPR model

This approach consists of using a pressure-squared quadratic form to express the total pressure drop
of gas reservoirs in terms of the pressure drop due to Darcy’s (laminar) flow and the additional pressure
drop due to turbulent flow, read as follow (see Ahmed and McKinney (2005)):

2 2
2
pres − pwell = BQST D ST D
P HASE + C Q P HASE (3.20)

with B and C being the laminar and inertial-turbulent flow coefficients, provided by the user or computed
using reservoir parameters, such that

1422T µ g Z
 •  ‹
re
˜
B= ln − 0.75 + s
kh rw
(3.21)
1422T µ g Z
 
C= D
kh

where T is temperature, µ g is gas viscosity, Z is gas z-factor, k is permeability, h is reservoir length, re is


drainage radius, rw is wellbore radius, s is skin factor and D is defined as follow
 ‹
F kh
D= , (3.22)
1422T

such that the parameter C becomes


C = µ g Z F, (3.23)

where F is the non-Darcy flow coefficient. In case the reservoir parameters are selected, the µ g , Z, re , rw , s, k, F
parameters are user input data.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.3. PRESSURE NODE 23

3.2.4 Table IPR model

A Table IPR model consists of a user-defined table relating the flow rate at standard conditions to the
pressure difference between the reservoir and wellbore. A second-order polynomial interpolation is used
to calculate the flow rate within the range of the table, while for values greater than the table limit is
employed a first-order extrapolation with slope given by the first derivative of the quadratic curve at the
table limit. If no value pressure difference related to zero flow rate is informed, it is added a new table
row with zero pressure difference for zero flow rate.

3.2.5 Vogel IPR model

Vogel (1968) proposed an empirical model designed to represent the inflow performance relationship
of saturated oil reservoirs, read as follow (see Ahmed and McKinney (2005)):

QSPTHAS
D
pwell pwell 2
 ‹  ‹
ST D
E = 1 − 0.2 − 0.8 (3.24)
Q P HAS E pres pres
ma x

where QSPTHAS D
E ma x is the maximum flow rate at zero wellbore pressure. It is important to note that
ST D

Q P HAS E ma x is user input that is measured in a steady flow test.

3.3 Pressure node

The pressure node is a prescribed pressure condition where, in case of inflow from the pressure node
to the pipe (Ppresc > Ppipe ) then the prescribed volumetric fractions are used.

3.4 Pump

Pumps are devices that introduce energy through increasing the fluid pressure. The pressure boost
depends fundamentally on the pump rotation and fluid flow rate. There are three ways of input for a pump:

• Constant pressure, where a constant pressure boost value is defined by the user;

• Table interpolation, which curves for each rotation relating pressure boost to the total flow rate and
to the void fraction are given by the user;

• Electric Submersible Pump (ESP), this model assumes a series of centrifugal pumps.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.4. PUMP 24

3.4.1 Constant Pressure

In this model the increasing pressure of the pump is simply the pressure boost set by the user. This
model is appropriate when there is not yet a specific model of pump, as for conceptual design.

3.4.2 Table Interpolation

The table interpolation pump model the pressure boost is calculated through performance curves (table
interpolation). The user inputs flow rate vs pressure boost curves for several speed and void fraction values
and the instantaneous pump pressure boost is calculated according to the local speed, void fraction and
flow rate conditions. Hence, this option gives the correct dynamics for each pump model that the user
requests. Any speed/rotation values (N ) that are not directly available in the table will be interpolated
through similarity relations as follows

∆P 2
 ‹
Q N
= = (3.25)
Q ref ∆Pref Nref

Note that this model is able to represent several pump types, except multiple stage scenarios.

3.4.3 Electric Submersible Pump (ESP)

The Electric Submersible Pump (ESP) uses the same base formulation as the table interpolation except
that it now allows the user to define multiple pump stages. Each stage uses the same pump table for pressure
boost calculations with the gas inlet corrected by assuming ideal gas and isothermal process between stages.
Therefore, for each stage n we have
αnG
αn+1
G = ∆P n
(3.26)
1+ Pn

Pump curves can be specified using either head or pressure boost and have a specific reference density
(usually water). If this value is provided by the user, then the pressure boost calculated by the model is
automatically corrected for the actual fluid density at the pump inlet according to

ρmix
 ‹
∆Pactual = ∆Pcurve (Q, αG , N ) (3.27)
ρref

3.4.4 Thermal Efficiency

Efficiency for all models is constant and affects the power generated:

ṁk ∆Pb
power = (3.28)
η

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.5. VALVE 25

where ṁk is the field mass flow rate, ∆Pb is the pressure boost and η is the pump efficiency.

3.5 Valve

Contrariwise to pumps, in valves the mass flow rate is a function of the pressure difference applied.
In ALFAsim, there are 4 types of valves models considered:

• Perkins Valve

• Gas Lift Valve

• Choke Valve with C v table

• Check Valve

3.5.1 Perkins Valve

Some considerations for this valve model are made:

• Temperature varies with position, but at any point, all phases are at the same temperature;

• Velocity varies with position, but at any point, all components are moving with the same velocity;

• Gas compressibility factor is constant;

• Liquids are incompressible, but gas are compressible;

• Elevation changes are negligible;

• Flow process is adiabatic and frictionless.

This assumptions are made, once as a flowing mixture passes through the valve, its velocity will in-
crease and the pressure will decay. Little time or area is available for heat transfer, so the gas expansion is
essentially adiabatic. Therefore, the temperature of the mixture will change.

It is required from the user the information about the valve diameter, the opening type and the opening
curve in case of Table Interpolation type.

3.5.2 Gas Lift Valve

The Gas Lift Valve is based on the Perkin’s choke valve model, and take in consideration all it’s as-
sumptions. The only difference is that it also behaves like a check valve, that is, no fluid flows from tubing

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.6. COMPRESSOR 26

to annulus - Only from annulus to tubing, and only when ∆P > ∆Pmin . Valve is assumed to be always fully
opened.

The discharge coefficient K will be used to limit the calculated flowrate as

ṁ = K ṁmodel

3.5.3 Choke Valve with C v table

This model of valve assume as an input the flow coefficient (C v ) value for each desired opening state
of the valve. Flow coefficient values for opening states not defined by the user will be obtained through
linear interpolation.

The difference pressure, volumetric flow rate and the flow coefficient are interrelated through the
definition of C v v
t SG
C v = Q̇ (3.29)
∆Pb
in which SG is the specific gravity of the fluid.

3.5.4 Check Valve

This type of valve acts on only allowing one direction flow and avoiding the total flow in the opposite
direction.

The valve will close if the dynamic pressure drop across the valve is negative, that is, the total volume
flow is in the wrong direction. Therefore, it will remain closed until the pressure difference across the valve
is large enough to give flow in the desired direction.

3.6 Compressor

Compressors are devices whose function is to increase the pressure of the gas. The pressure and
temperature increase over the compressor can be defined as a function of the flow through it and its
rotational speed. Also, the compressor characteristics give information about the minimum inlet flow
(surge flow) that the compressor can operate on. The compressor surge volume flow is the lowest volume
flow that the compressor can operate on without becoming unstable. Compressor data needed for the
model are found by linear interpolation in the compressor tables.

As a input in ALFAsim, it is required the Reference Pressure, Reference Temperature, Flow Direction,
the Speed Curve Interpolation Type and the Speed Curve. An important detail is that the mass flow rate in

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.7. SEPARATOR 27

the software is corrected to correspond typical compressor characteristic diagrams.

3.7 Separator

The gravity separator equipment is based on a scheme similar to Figure 3.1. The current model as-
sumes the inlet of a multiphase mixture and allows the three-phase (or two-phase) separation into different
downstream pipes. Three separator geometries are available: vertical cylinder, horizontal cylinder, and
sphere.

Figure 3.1: Scheme of a three-phase separator.

Currently the separator model assumes complete phase separation, which means that there is no fields
dispersed in other phases. When configuring a separator user specifies the position with respect to the
bottom each pipe is connected. There is no need to specify if a pipe is injecting to or receiving fluid from
the separator, since this is calculated physically solving mass, momentum, and energy equations.

The phase separation interfaces are calculated dynamically solving balance equations. Usually pipes
attached to the top or bottom of the separator receives the lighter or heavier phase, respectively, but there
is no such guarantee for pipes close to the middle of the separator. As a consequence, it is recommended
to use valves in the outlet pipes in order to adjust mass flow rates and control the phase interfaces.

3.8 Pig

Pig is a device that is launched in a pipeline and moves with the flow and may be used to remove
stagnated liquid or wax deposited on pipe walls. It works like a moving interface and fluid may pass only
at the gap between pig and pipe walls. The numerical model relies on moving grids solved together with

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.9. CONTROLLER 28

the pipe grid and, as pig switches from one control volume to another, user may find discontinuities in pig
trend plots, even though mass and momentum balance are strictly ensured.

User must set pig mass and diameter. If pig diameter is lower than pipe inner diameter, fluid may pass
through the gap between pig and pipe. The quality of the fluid that moves through the gap depends on the
flow pattern and holdup near the pig. The flow rate is determined assuming linear velocity profile in the
gap.

The forces acting on the pig, besides the pressure difference force, are the wall contact force

Fw = max(Fstatic − ffric U, 0), (3.30)

which vanishes above a certain pig velocity, and the viscous force, related to the fluid in the pig/pipe gap,

F v = U( flinear + fquadratic U). (3.31)

The parameters Fstatic , ffric , flinear , and fquadratic are all user inputs, which provide great degree of freedom
to the user to specify the forces acting on the pig. Furthermore, there may also be applied the wax removal
force, which has two components: the wax deposition breakage force and the viscous force due to the
increase of fluid viscosity due to solids suspension ahead of pig.

The route a pig will have in the network may be set to be automatic, in which the pig will following
the path of the highest mass flow rate, or user-defined, in which pig goes through an edge group. The trap
mode may also be automatic or user-defined, meaning that pig will move until find a boundary condition
or the specified trap position, respectively.

3.9 Controller

ALFAsim has support for PID controllers, which are feedback loop controllers that use a response
function of the form
Zt
 
1 de 
u(t) = K e(t) + e(t)d t + Td (3.32)
Ti dt
0

in which u is the control variable, K, Ti , and Td are the proportional, integral time, and derivative time
constant defined by user, and e is the error defined as below:

e(t) = S P − P V (t). (3.33)

P V is the process variable and SP is the desired setpoint. A PID control loop works reading the process
variable, comparing it to the setpoint, and producing an output response to control variable related to the
process variable such that the variation of the control variable will make the process variable smoothly
reach the setpoint.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.10. LEAK 29

In order to add a controller to a network, user should drag the control symbol of the equipment panel
and drop it in the workspace. The process variable is an output variable from a trend previously defined
in Output Options. Such variable is read using the unit defined in controller input signal tab. The control
variable is configured in the Output Signal tab. There it may be set the target element (like pumps, valves,
heat sources), the control variable itself (like valve opening, pump speed, heat source power), and the
unit, minimum value, maximum value, and maximum variation rate of the output signal. After selecting
the input trend and the target element, ALFAsim automatically draws arrows in the workspace to represent
the connection between the controller and the input and output elements.

The PID control parameters are set in the PID Configuration tab. The parameters to be set are the
gain (also named proportional constant) K, the integral time Ti , and the derivative time Td . Notice that
the integral and the derivative terms may be zeroed setting a huge value to Ti , like 1e50, and 0 to Td ,
respectively. Also, some variables are inversely related, like valve opening and upstream pressure: reducing
valve opening produces an increase in the upstream pressure. When user aim to control a variable that is
inversely related to the process variable, he/she must set a negative value for the gain.

3.10 Leak

Leak is a device that operates like a valve, but connects any two pipes from a network at any of their
positions or connects a pipe to the outer environment. For instance, it may be used to simulate gas lift
processes, blowdown lines, or fluid being leaked out of a pipe.

When setting up a leak, user must drag and drop a leak from the equipment panel to a pipe. It
must be specified in the Model Explorer the position of the leak in such pipe, the leak diameter and the
leak discharge coefficient. A leak may be of type "external", in which mass will flow out of a network,
or "internal", when it connect two pipes. For external leaks, it must be specified the backpressure: there
will be flow as long as the pipe inner pressure is greater than the backpressure. For inner leaks user must
specify whether backflow is allowed, otherwise flow will always be from reference to target pipe provided
that there is enough pressure difference.

There are three models to calculate mass flow rate through a leak: Orifice, Flow Coefficient, and Gas
Lift Valve. The Orifice Model is based on T. K. Perkins (1993) multiphase valve model to calculate the
multiphase mass flow rate through an orifice given a pressure difference, area ratio, and fluid properties.
In the Flow Coefficient Model, on the other hand, the total flow rate is calculated from the flow coefficient
definition: v
t ∆P
Q T = Cv (3.34)
ρm /ρw
in which the flow coefficient C v is a function of the leak opening, ρm is the mixture density, and ρw is the
water density. The flow rate of each phase is calculated splitting the total flow rate according to the amount
of each phase upstream to the leak. In both of these two models user inputs the opening as a function of
time.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
3.10. LEAK 30

The Gas Lift Valve (GLV) Model differs from the other two models because the opening is a function of
the pressure difference near the leak. There are two models to calculate the opening: Minimum Pressure
Difference and Pressure Operated. In the latter model, leak will open as long as the upstream pipe pressure
minus the target pipe pressure exceeds the value set by user. The former model is intended to Injection-
Pressure-Operated valves and is based on Faustinelli (2001). The opening depends on a force balance
between the tubing pressure, the casing pressure, and a pressurized gas at the valve dome. The valve
available area is
A v = min(Aport , max(N Aport , 0)), (3.35)

where
Pprod ∗ R + Pinj ∗ (1. − R) − PvcTb
N= , (3.36)
PvcTb
is the dimensionless stem position, R is the area ratio the port to the bellows, Aport is the port area calculated
from the valve diameter, and PvcTb is the dome pressure obtained applying constant volume ideal gas
process:
Pref
PvcTb = Tb , (3.37)
Tref
in which the bellows temperature Tb is obtained as in Shahri (2011)

Tb = 0.3Ttubing + 0.7Tannulus . (3.38)

The Pressure Operated opening type enables the simulation of all Gas-Lift Valve flow regimes, as illustrated
in figure 3.2.

Figure 3.2: Gas-Lift Valve flow regimes (adapted from Faustinelli (2001))

For both GLV opening models, the mass flow rate is calculated through orifice model based on T. K.
Perkins (1993). Furthermore, critical flow is accounted in all mass flow rate model so that the mass flow
rate never exceeds the critical mass flow rate not matter how low the downstream pressure is.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
31

Chapter 4

Tracers

Tracers can be used to track and simulate a distribution in space and time of mass fractions of species
that are of interest to the user. As an example, it can be cited KHI inhibitors that are used in hydrate
formation.

To track these scalars it is necessary to solve the transport equations for passive scalars that are ad-
vected by the flow field. A transport equation for a general scalar φi may be written as follows:

∂ ρφi φi ∂ ρφi Uφi φi


+ = Γφ i (4.1)
∂t ∂x

where

Uφi = Uφi (U, ρ, α) (4.2)


ρφi = ρφi (ρ, α) (4.3)

Above, the terms U, ρ, α are vectors representing the velocity, density and volume fraction values of each
field, respectively.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
32

Chapter 5

Fluid and PVT Models

In ALFAsim, it is possible to described the fluid through two main methods:

• PVT Tables;

• Black oil Correlations;

• Compositional;

5.1 PVT Tables

The PVT table file is based on a PVT calculation of thermodynamic and physical properties of a mixture.
A table file is normally generated by using a fluid property package. The file name extension convention
for this type of file is .tab.

A PVT table file contains basic fluid properties for gas and liquid, and optionally water as a separate
phase, varying pressure and temperature.

When applying the PVT table model, the software reads the table files and interpolates to obtain fluid
and related phase properties at every segment along a pipeline.

When importing a PVT table, it is important to pay attention on the following topics:

• The pressure and temperature ranges of the PVT table must include the expected ranges for the whole
pipeline system modeled in ALFAsim. Also, note that an wide range may result in lower accuracy for
properties that varies non-linearly and, consequently, could give less accurate simulations;

• Check if the tables for non-physical discontinuities or strange tendencies in the properties as functions
of P and T or P and H (Suggestion: plot some of the properties that you mistrusts).

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 33

• Check if the gas and liquid fractions are properly set for the single-phase regions. Gas mass fraction
should be zero to the left of the critical temperature and one to the right.

The software can handle two different types of tables: PT or PH. The PT table describes the thermody-
namic and physical properties of the fluid in terms of pressure and temperature, and the PH table describes
these properties in terms of pressure and enthalpy. For the majority of cases, the PT table will be capable
to describe the fluid, but there are specific cases such pure components simulations and mixtures close
to purity that the PH table will be necessary, since this approach allows a better resolution of the phase
envelope.

5.2 Black oil Correlations

For the correlations presented in next sections:

• Pressure is given in psi;

• Temperature is given in Rankine;

• Rsat is the gas solubility in oil at saturation point and it is a user input with default value 150m3 /m3 ;

• γ g is the gas gravity;

• γo is the oil gravity;

• γAP I is the API gravity.

5.2.1 Standing Correlations

The Standing Correlations ( McCain (1990)) are the default ones used in ALFAsim.

The oil volume formation factor is computed as


1.175
t γg
 v
−4
Bo = 0.972 + 1.47 × 10 Rs + 1.25T (5.1)
γo

and the gas solubility in oil as

P 1.205
¨
100.015γAP I −0.0011T

γ g 1.4 + if P ≤ Pbub
Rs = 18.2
(5.2)
Rsat if P > Pbub

where AP I is the oil API gravity and Rsat is a constant value defined as 150.0m3 /m3 .

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 34

5.2.2 Lasater et al. Correlations

The Lasater et al. (1958) correlation for gas solubility in oil is given by
( xg
1.32755 × 105 γo M if P ≤ Pbub
Rs = o (1−x g ) (5.3)
Rsat if P > Pbub

xg P
where x g is obtained by a parameter X p = T , such that

x g = 0.359l n 0.1187X p + 0.476 (5.4)

for X p ≤ 40.7, and


0.281
x g = 0.0098l n 0.1187X p − 0.236 (5.5)

for X p < 40.7.

The bubble point pressure is


pf T
Pb = γg (5.6)

where,
x g −0.15649
pf = e 0.33705 − 0.59162 (5.7)

and
Š−1
γo
€
xg = 1 + −6
7.521×10 Rs Mo
(5.8)

Mo i the effective molecular weight of tank oil, computed based on the oil API:

Mo = 630 − 10γAP I if γAP I ≤ 40.0


(5.9)
Mo = 73110 ∗ γ−1.562
AP I if γAP I > 40.0

5.2.3 Vazquez et al. Correlations

The Vazquez et al. (1977) for gas solubility in oil is defined as


¨ C3 γAP I
C1 γ g P C2 e T if P ≤ Pbub
Rs = (5.10)
Rsat if P > Pbub

and bubble point pressure


  C1
2
Rs
Pb = C3 γAP I
(5.11)
C1 γ g e T

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 35

where the constants depend on oil API


C1 = 0.0362
C2 = 1.0937 (5.12)
C3 = 25.724

for γAP I < 30.0 and


C1 = 0.0178
C2 = 1.187 (5.13)
C3 = 23.9310

for γAP I ≥ 30.0.

5.2.4 Glaso et al. Correlations

Glaso et al. (1980) correlations are listed below



1
xγo 0.989
€ Š 0.816
γg

if P ≤ Pbub
Rs = T 0.172 (5.14)
 R
sat if P > Pbub

and
log Pb = 1.7669 + 1.7447 log A − 0.30218(log A)2 (5.15)

where p
b+ b2 −4ac
log x = − 2a
(5.16)

and a = −0.30218, b = 1.7447 and c = 1.7669 − log P. In eq. (5.15), A is given by

Rs 0.816 T 0.172
€ Š
A= γg γo 0.989
(5.17)

5.2.5 Oil viscosity

The oil viscosity is computed by the Ng et al. (1983) correlation and it depends on the pressure below
or above the bubble-point. Thus, the oil viscosity is computed as

¨
µos if P ≤ Pbub
µoil = (5.18)
µou if P > Pbub

where µos and µou are the gas saturated and undersaturated oil viscosity, respectively. The gas saturated
oil viscosity is given by
µos = AµBod (5.19)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 36

the coefficients are computed as


A = 10.715 (RS + 100.0)−0.515
(5.20)
B = 5.44 (RS + 150.0)−0.338

and the dead oil viscosity (µod ) is computed using the Beggs and Robinson Viscosity Correlation,

l o g10 (µod + 1) = 1.8653 − 0.025086γo − 0.5644l o g10 (T ) (5.21)

Finally, the undersaturated oil viscosity is


 ‹C
P
µou = µod (5.22)
Pb

where Pb is the pressure at the bubble-point, which will be described later, and

−5
C = 2.6P 1.187 e−11.513−8.98·10 P
(5.23)

5.2.6 Gas density

The gas density is computed as


ρ gsc
ρg = (5.24)
Bg
where ρ gsc is the gas density at standard condition and B g is the gas volume formation factor. The gas
density at standard condition is computed as function of the density of air at standard conditions

ρ gsc = 0.0764γ g (5.25)

and the gas volume formation factor as


zT
B g = 0.0283 (5.26)
P
and, finally, the gas compressibility is computed using the Dranchuk and Abou-Kassem (Hall and Yarbor-
ough, 1973) equation of state,
   
A2 A3 A4 A5 A7 A8
z = 1 + A1 + + 3 + 4 + 5 ρ r + A6 + + 2 ρ r2
Tr Tr Tr Tr Tr Tr
(5.27)
 ρr
   2
A7 A8 2
− A9 + 2 ρ r5 + A10 1 + A11 ρ r2 3
e−A11 ρr
Tr Tr Tr

where Tr and Pr are the reduced temperature and reduced pressure, and ρ r is the gas density at Tr and
Pr ,
Pr
ρ r = 0.27 (5.28)
z Tr

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 37

and

A1 = 0.3265
A2 = −1.07
A3 = −0.5339
A4 = 0.01569
A5 = −0.05165
A6 = 0.5475 (5.29)
A7 = −0.7361
A8 = 0.1844
A9 = 0.1056
A10 = 0.6134
A11 = 0.721

5.2.7 Gas viscosity

Gas viscosity is computed using the Lasater et al. (1958) correlation


C
Ae Bρ g
µg = (5.30)
10000
(9.379 + 0.016M ) T 1.5
A= (5.31)
209.2 + 19.26M + T
986.4
B = 3.448 + + 0.01009M (5.32)
T
C = 2.447 − 0.2224B (5.33)
M = 29γ g (5.34)

where M is the apparent molecular weight.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.2. BLACK OIL CORRELATIONS 38

5.2.8 Bubble point pressure

The bubble point pressure is computed using the Lasater et al. (1958) correlation

T
Pb = A (5.35)
γg
¨
0.679e2.786x g − 0.323 if x g ≤ 0.6
A= (5.36)
8.26x 3.56
g + 1.95 if x g ≥ 0.6
RS
319.3
xg = RS 350γo
(5.37)
319.3 + Mo
¨
360.0 − 10.0AP I if AP I ≤ 40
Mo = −1.562
(5.38)
73110AP I if AP I ≥ 40

5.2.9 Thermodynamic properties of Blackoil Model

Specific heat of oil

The specific heat of oil is given by

c pl = 2.96 + 1.34γo + T (0.0062 − 0.00234γo ) (5.39)

Specific heat of gas

The specific heat of gas is computed based on data from Katz (1959), where a correlation was built as
follow
c p g = aT 3 + bT 2 + c T + d (5.40)

where coefficients a, b, c and d are tabulated values for gas gravity as shown in Table 5.1.

Table 5.1: Coefficients for the specific heat of gas equation.

Gas gravity A B C D
0.55 -2.268050e-10 3.105874e-07 3.481579e-04 5.029320e-01
0.6 -2.255820e-10 3.097324e-07 3.524049e-04 4.905769e-01
0.7 -2.308694e-10 2.986779e-07 3.771819e-04 4.692241e-01
0.8 -1.962902e-10 2.562293e-07 3.994981e-04 4.484994e-01
0.9 -1.980608e-10 2.409657e-07 4.220329e-04 4.280295e-01
1.04 -1.971790e-10 2.174552e-07 4.565484e-04 3.970725e-01
1.53 -1.701365e-10 1.453026e-07 5.010453e-04 3.733193e-01

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 39

Thermal conductivity of oil

Thermal conductivity of oil is a linear function given by

ko = a + bT (5.41)

The default values for a and b are 0.1385 W /mo C and 0.00005 W /mo C 2 .

Thermal conductivity of gas

Thermal conductivity of gas is computed as a function of gas molar weight and temperature as pre-
sented in Katz (1959) as

1.04
 ‹
kg = + 1.29c pg µ g (5.42)
M

Enthalpy of oil and gas

The enthalpy of oil and gas are calculated integrating the specific heat equations (Eqs. 5.39 and 5.40)
from zero to the desired temperature.

5.3 Compositional Model

The compositional approach is a more accurate model to predict petroleum fluid properties by using
concepts of phase equilibria. In this way, as the pressure and temperature change along the pipeline, the
mass, momentum and energy balances are solved and, consequently, the fluid composition will change
along with these. This affects directly the phase properties, such as density, viscosity, thermal conductivity,
enthalpy, heat capacity, among others.

Thus, as a consequence, the estimated data will also be more precise when compared to data obtained
through the black-oil and PVT tables approach, which assumes a constant composition and therefore only
considers changes in pressure and temperature for calculating fluid properties.

It is well known that when using a compositional model, hydraulic simulators can have its performance
considerably affected. This is because flash calculations are required together with the use of an Equation of
State (EoS) to solve phase equilibria and predict fluid properties. For each timestep in each control volume,
a local flash (which requires the solution of a nonlinear system of equations) is performed for the current
pressure, temperature and composition local values. Then fluid properties are calculated, the discretized

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 40

transport equations are solved to obtain the new values of pressure, temperature and component mass
fractions for the next iteration of the simulator. It is clear that this workflow will be considerably more
expensive that a simple PVT table interpolation. More details about the calculations with this approach are
presented in the next subsections.

5.3.1 Equations of State

Equations of State (EoS) are mathematical expressions that relate pressure, temperature and volume,
describing with accuracy the phase equilibria and the volumetric behavior of mixtures and pure com-
ponents. The cubic EoS are the most applied in PVT study analyzes due their easy evaluation and low
computational cost, being the most used the SRK (Soave-Redlich-Kwong) EoS and the PR (Peng-Robinson)
EoS (Whitson and Brulé, 2000). A generalized cubic EoS may be written as

RT a(T )
P= − , (5.43)
v − b (v + δ1 b)(v + δ2 b)
p p
with δ1 = 1 + 2, δ2 = 1 − 2 for the PR EoS and with δ1 = 0, δ2 = 1 for the SRK EoS. Thus, substituting
those coefficients into eq. 5.43, the PR EoS becomes

RT a(T )
P= − . (5.44)
v − b v(v + b) + b(v − b)

Similarly, the SRK EoS is written as


RT a(T )
P= − , (5.45)
v − b v(v + b)
in which R is the universal gas constant, v is the molar volume, a(T ) is the temperature-dependent attractive
parameter and b is the co-volume parameter. These two parameters, calculated for each pure component,
are determined as follows
R2 Tci2
ai = Ωoa αi , (5.46)
Pci
where Ωoa = 0.45724 for PR EoS and Ωoa = 0.42748 for SRK. bi is given by

RTci
bi = Ωob , (5.47)
Pci

with Ωob = 0.077796 for PR EoS and Ωob = 0.08664 for SRK. In the equations above, Tci and Pci are
the critical temperature and pressure of component i, respectively, and αi is a temperature dependent
parameter given by (Qiu et al., 2014)
 2
αi = 1 + mi (1 − Tr i ) ,
p
(5.48)

where Tr i is the reduced temperature defined as

T
Tr i = , (5.49)
Tci

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 41

For the PR EoS, mi was defined in a modification proposed by Robinson and Peng (1978),

mi = 0.37464 + 1.54226ωi − 0.26992ω2i f or ωi ≤ 0.49; (5.50)


mi = 0.3796 + 1.485ωi − 0.1644ω2i + 0.01667ω3i f or ωi > 0.49, (5.51)

For the SRK EoS, mi is evaluated as

mi = 0.480 + 1.574ωi − 0.176ω2i , (5.52)

where ωi is the acentric factor of the component i.

The EoS also needs to be evaluated coupled with mixing rules, once they describe the prevailing forces
between molecules of different components in the mixture. Thus, the parameters ai and bi of the mixture
are determined by using the one-fluid type mixing rules (Whitson and Brulé, 2000),

Nc X
X Nc
a= zi z j (1 − ki j ) ai a j ;
p
(5.53)
i=1 j=1
Nc
X
b= zi bi , (5.54)
i=1

where zi and z j are overall (molar) composition of the component i and j, respectively, Nc is the number
of components and ki j is the binary interaction parameter between components i and j. By defining

aP
A= ; (5.55)
R2 T 2
bP
B= . (5.56)
RT

Since these parameters are determined for the mixture, the compressibility factor can be obtained by solving
the EoS written in terms of Z. The PR EoS is given by:

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

and the SRK EoS by


Z 3 − Z 2 + (A − B − B 2 )Z − AB = 0. (5.58)

Note that A, B and Z are nondimensional parameters. Also, from eq. 5.57 and 5.58 it can be clearly seen
why the PR and SRK EoS are cubic equations.

The fugacity of component i in phase α can be evaluated through with PR EoS by

Nc
! p
fˆiα bi A 2 X bj Zα + (1 + 2)Bα
= (Zα − 1) − ln (Zα − Bα ) − p α x jα (1 − ki j ) ai a j −
p
ln ln p ,
x iα Pα bα 2 2Bα aα j=1 bα Zα + (1 − 2)Bα
(5.59)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 42

and for SRK,


!
N
fˆiα Bi A Bi 2 X B
ln = ln φi = (Z − 1) − ln (Z − B) + − yi Ai j ln 1 + . (5.60)
x iα Pα B B B A j=1 Z

The fugacities are required in order to solve the phase equilibria problem, which is the fundamental concept
of flash calculations, presented in the next subsection.

5.3.2 Flash Calculations

Given a mixture composition at certain pressure and temperature conditions, flash calculation algo-
rithms are used to determine the fraction of gas and liquid, as well as the composition of each phase.
Consider a two-phase equilibrium case of a mixture with overall composition z and Nc components, where
the mixture mole fractions of liquid and vapor phase are denoted as x and y, respectively. Thus, from a
thermodynamic viewpoint, it is necessary a condition of equilibrium, which is defined as the equality of
chemical potential of both phase for each component, that is (Prausnitz et al., 1998)

µli = µiv i = 1, 2, ..., Nc , (5.61)

in which µli andµiv are the chemical potential of the liquid and vapor phase, respectively and Nc is the
number of components of the mixture. An alternative approach is to write the equations in terms of
fugacities, i.e., for an isothermal system the fugacities of the individual components must be equal,

f il = f i v i = 1, 2, ..., Nc . (5.62)

As it can be observed in eqs. (5.59) and (5.60), component fugacities are functions of pressure (or volume),
temperature and phase composition, that is

f il = fˆi (T, P, x) f iv = fˆi (T, P, y). (5.63)

The main procedure to solve eq. (5.62) starts from some basic concepts. First it is introduced the liquid
mole fraction (L) and vapor mole fraction (V), the relation below can be defined

L + V = 1, (5.64)

Moreover, by the definition of molar fraction,

Nc
X Nc
X Nc
X
xi = yi = zi = 1. (5.65)
i=1 i=1 i=1

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 43

where x i and yi are the component molar fractions in the liquid and gas phases, respectively. zi is the
global molar composition. The well known partitioning coefficients (or K-values) are defined as

yi
Ki = . (5.66)
xi

A material balance for each component yields Nc relations as follows

V yi + (1 − V )x i = zi i = 1, 2, ..., Nc . (5.67)

Substituting eq. (5.66) into the equation above,

zi
xi = ; (5.68)
1 + V (Ki − 1)
Ki zi
yi = . (5.69)
1 + V (Ki − 1)

Therefore, the phase mole fractions x and y can be calculated from the equilibrium ratios and the phase
fraction V.

Since eq. (5.65) states that the liquid and vapor mole fractions must sum to unity. This yields to the
following relation
Nc
X
( yi − x i ) = 0. (5.70)
i=1

Which produces, together with eq. (5.68), the Rachford-Rice equation (Rachford Jr et al., 1952), given by

Nc c
X X zi (Ki − 1)
h(V ) = ( yi − x i ) = = 0. (5.71)
i=1 i=1
1 + V (Ki − 1)

This equation, once solved for V (and fixed values of zi and Ki ), allows the calculation of x i and yi through
a successive substitution technique:

1. From the given pressure, temperature and zi , estimate the K-values (Ki );

2. Solve eq. (5.71) in order to find V ;

3. Calculate x i and yi from eq. (5.68);

4. Calculate fugacities for the selected EoS, eq. (5.59) or (5.60);


g fl
5. If f il ̸= f i , update the K-values by Kin+1 = Kin f ig and go to step 1, otherwise finish.
i

The procedure stated above is a simplified version of the flash solver used in ALFAsim. Several enhance-
ments of the algorithm can be obtained by considering Newton-like or hybrid strategies for solving the
fugacity equality and material balance equations.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 44

5.3.3 Thermophysical Properties Calculation

In the following subsections, it will be described the calculation of the phase properties for a composi-
tional model utilized in ALFAsim. The process consist in evaluating the state and transport properties from
the current pressure, temperature, x i , yi and V conditions.

Density

The definition of a phase or mixture density is given by:

m
ρ= , (5.72)
V

with m being the mass in [kg] and V being the volume, in [m3 ], of the phase/mixture. In this way, ρ is
evaluate in [kg/m3]. Now, from the real gas law below

P v = ZRT, (5.73)

where P is pressure in [Pa], v is the specific volume, Z is the compressibility factor, R is the gas constant
J
equals to 8.31446 K mol and T is temperature in [K]. The number of moles can be written as

m
n= , (5.74)
MW,phase

with MW,phase being the molecular weight in [kg/mol]. Rearranging eq. (5.73) by replacing eq. (5.74) and
eq. (5.72), the phase density was calculated,

P MW,phase
ρ phase = . (5.75)
Z phase RT

Viscosity

There are several correlations available in literature to calculate the viscosity of a phase/mixture. The
viscosity was implemented using the Lohrenz-Bray-Clark (LBC) correlation (Lohrenz et al., 1964). Initially,
the component viscosity parameter of component i is evaluated from:

1/6
Tci
ζi = 1/2 2/3
, (5.76)
M Wi Pci

where Tci is the critical temperature in [K], Pci is the critical pressure in [atm] and M Wi is the molecular
weight in [g/mol] of component i. The low pressure viscosity for a pure component is given by

µ∗i ζi = 10−4 4.61Tr0.618 − 2.04e−0.449Tr i + 1.94e−4.058Tr i + 0.1 ,



i (5.77)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 45

with,
T
Tr i = , (5.78)
Tci
where T is the temperature in [K]. The equation for calculating the low pressure mixture viscosity is
PNc
x i µ∗i M Wi
p 
i=1
µ∗ = PNc p  . (5.79)
i=1
x i M Wi

In the equation above, Nc is the number of components of the mixture, x i is the molar fraction of component
i in [mol/mol] and µ∗i is obtained from eq. 5.79. The mixture viscosity parameter ζ is

€P Š1/6
Nc
i=1
(x T
i ci )
ζ = €P Š1/2 €P Š2/3 . (5.80)
Nc Nc
i=1
(x M
i i ) i=1
(x P
i ci )

And, the critical molar volume can be obtained from

Nc
X x i Zci RTci
vc = , (5.81)
i=1
Pci

thus,
Nc
X
vc = x i vci . (5.82)
i=1

For C7+ fractions, the critical molar volume of component in [m3 /mol] is calculated from:

vci = 62.42785786X 10−6 (21.573 + 0.015122M Wi − 27.656ρ + 0.070615M Wi ρi ) , (5.83)

with the molecular weight of component i, M Wi , in [g/mol] and the density of component i, ρi , in [g/cm3].
If the composition is defined in characterized form and densities are not available, the critical molar volume
in [m3 /mol] is given by the Riedel (1954) correlation, written as

RTci
vci = [3.72 + 0.26 (αci − 7.0)]−1 , (5.84)
Pci

with αci defined as  


T bi
Tci ln Pci
αci = 0.9076 1.0 + T bi
. (5.85)
1− Tci

In eq. 5.84 and 5.85, Pci is given in [atm], Tci is in [K] and Tbi is representing the normal boiling point of
each component i in the mixture and it is given in [K]. If Tbi is not available, the critical molar volume in
[m3 /mol] is computed from Poling et al. (2001), described below

(0.2918 − 0.0928ωi ) RTci


vci = , (5.86)
Pci

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 46

where ωi is the component acentric factor and, again, Pci is given in [atm], Tci is in [K].

The reduced density is defined as:


vc
ρr = , (5.87)
vphase

where vc is, in [m3 /mol], calculated from eq (5.82) and vphase is the phase molar volume, also in [m3 /mol].

Finally, the phase viscosity in [Pa.s] is evaluated as:

a0 + a1 ρ r + a2 ρ r2 + a3 ρ r3 + a4 ρ r4 − 10−4
–  ™
−3 ∗
µ = 10 +µ , (5.88)
ζ

where the coefficients are given by:

a0 = 0.1023;
a1 = 0.023364;
a2 = 0.058533;
a3 = −0.40758;
a4 = 0.0093324,

and µ∗ is calculated from equation 5.79, ζ from 5.80 and ρ r from 5.87.

Thermal Conductivity

Similarly to the viscosity calculation, the thermal conductivity is computed using the LBC model
(Lohrenz et al., 1964). From this model, the thermal conductivity is expressed in terms of two contri-
butions as the following expression:

ktotal = ktranslatoric + kinternal (5.89)

Thermal Conductivity Translatoric


The thermal conductivity translatoric (ktranslatoric ) is defined as:

ktranslatoric = C1 T C2 P C3 a1 + a2 ρ r + a3 ρ r2 + a4 ρ r3 + a5 ρ r4

(5.90)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 47

where the pressure P is in atm, ρ r is defined in eq. 5.87 and the constants are defined as

C1 = 2.30528 (5.91)
C2 = −0.59394 (5.92)
C3 = 0.06928 (5.93)
a1 = 270.28341 (5.94)
a2 = −148.95858 (5.95)
a3 = 408.63577 (5.96)
a4 = −127.74598 (5.97)
a5 = 13.52979 (5.98)

Note that the critical volume for C7+ components and the reduced density is calculated as shown in eq.
(5.83), eq. (5.84) and eq. (5.86).

Internal Thermal Conductivity


The internal thermal conductivity (kinternal ) is calculated from the expression below

ρ r′
kinternal = 1.1865ζC v (5.99)
MW

in which, C v is the phase specific heat capacity in [J/kg K] and MW is the phase molecular weight in
[g/mol]. Thus,
ρ r′ = 1 + 0.053432ρ r − 0.30182ρ r2 − 0.029725ρ r3 , (5.100)

and PNc
z ε MW i
p
i=1 i i
ζ= PNc p , (5.101)
z MW i
i=1 i

where εi of the individual components are defined as

1 0.94
εi = 34X 10−5 T , Tr i < 1.5, (5.102)
ξi r i
1
εi = 17.78X 10−5 (4.58Tr i − 1.67)5/8 , Tr i > 1.5, (5.103)
ξi

with ξi being
1/6
Tci
ξi = 1/2 2/3
. (5.104)
Mi Pci

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 48

Surface Tension

The surface tension can be evaluated with several empirical methods found in literature, such as
the ones presented in Weinaug and Katz (1943) and Schechter et al. (1998). The surface tension model
proposed by Weinaug and Katz (1943) is expressed as

Nc
X
1/4

σ = ρ L [P]i x i − ρ V [P]i yi . (5.105)
i=1

The Parachor of a C7+ component is calculated from

[P]i = 59.3 + 2.34Mi , (5.106)

in which the component molar mass Mi is given in [g/mol]. The variables ρ̄ L and ρ¯V are the molar densities
in [g/cm3] given by

ρL
ρL = , (5.107)
M wL
ρV
ρV = . (5.108)
M wV

Another formulation is given by Schechter et al. (1998), which calculates the surface tension as

Nc
X
1/E

σ = [P]i x Li ρ L − x V i ρ V , (5.109)
i=1

where x Li and x V i are the component molar fraction in the liquid and vapor phase, respectively. The
coefficient E is calculated as

E = 3.583 + 0.16 ρ L − ρ V . (5.110)

Specific Enthalpy

The specific enthalpy in [J/kg] is calculated through two contributions as follows

Hideal + Hresidual
h= , (5.111)
MW,phase

with Hideal being the ideal enthalpy in [J/mol], Hresidual the residual enthalpy in [J/mol] and MW,phase the
molecular weight of the mixture in [kg/mol].

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 49

Ideal Enthalpy
The ideal enthalpy (Hideal ) is given by:

Nc
X
Hideal = x i H iid , (5.112)
i=1

where H iid is the molar ideal gas enthalpy of component i defined as


Z T
H iid = id
C pi d T. (5.113)
Tref

In this equation, Tref is a reference temperature set as 273.15 K (= 0 o C). Thus, C pi


id
is the molar ideal gas
heat capacity of component i computed from

id
C pi = C1,i + C2,i T + C3,i T 2 + C4,i T 3 . (5.114)

The coefficients C1 - C4 are tabulated in Poling et al. (2001). For the C7+ fractions the coefficients are
evaluated from the Kesler (1976) procedure. The reduced boiling point and reduced atmospheric pressure,
which are dimensionless, are given by:

TB
TBr = ; (5.115)
Tc
Pat m
PBr = , (5.116)
Pc

with Pat m = 1 at m = 101325 Pa. The Watson characterization factor (K) is calculated from:

1/3
TB
K= , (5.117)
SG

where TB is the normal boiling point in ◦ R and SG is the specific gravity, which is approximately equals to
the liquid density in [g/cm3]. The dimensionless acentric factors for C7+ fractions, ω, are defined as

6.09649
ln PBr − 5.92714 + TBr + 1.28862 ln TBr − 0.16934TBr
6
ω= 15.6875
, TBr < 0.8; (5.118)
15.2518 − TBr − 13.4721 ln TBr + 0.43577TBr
6

1.408 − 0.01063K
ω = −7.904 + 0.1352K − 0.007465K 2 + 8.359TBr + , TBr > 0.8. (5.119)
TBr

For hydrocarbons with a molecular weight above 300, ω is replaced by 1.0 if ω < 1.0. Acentric factors
below 0.1 are replaced by ω= 0.1.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 50

The coefficients for the molar ideal gas heat capacity calculation of C7+ fractions in [Btu/lb] are:

C1 = −0.33886 + 0.02827K − 0.26105C F + 0.59332ωC F ; (5.120)


C2 = − 0.9291 − 1.1543K + 0.0368K 2 10−4 + C F (4.56 − 9.48ω) 10−4;

(5.121)
C3 = −1.6658X 10−7 + C F (0.536 − 0.6828ω) 10−7 ; (5.122)
C4 = 0, (5.123)

where,
(12.8 − K) (10 − K)
CF = . (5.124)
(10ω)2
To give the molar ideal gas heat capacity in SI units, these coefficients (eq. 5.120, 5.121, 5.122 and 5.123)
must be multiplied by 2326.000292.

Residual Enthalpy
The residual term of enthalpy is derived from the EoS using the following general thermodynamic rela-
tion:
Nc
r es 2
X ∂ ln φi
H = −RT xi , (5.125)
i=1
∂T

where R is the ideal gas constant in [J/K mol], T is the temperature in [K], Nc is the number of components,
x i is the molar fraction of component i in [mol/mol] and φi is the fugacity coefficient of the component i
as follows
fi
φi = , (5.126)
xi P
in which f i is the fugacity of the component and P is the pressure in [Pa].

Specific Heat Capacity

The specific heat capacity at constant pressure is calculated from

∂H
Cp = ; (5.127)
∂T
∂ H r es
C p = C pid + ; (5.128)
∂T
Cp
cp = , (5.129)
MW,phase

where MW,phase is in [kg/mol], C p is in [J/mol] and c p is in [J/kg] and

Nc
X
C pid = id
x i C pi , (5.130)
i=1

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 51

id
in which, C pi is given by the eq. 5.114. The heat capacity at constant volume is obtained from

∂v ∂P

‹  ‹
Cv = Cp − T (5.131)
∂T P ∂T v
Cv
cv = , (5.132)
MW,phase

where MW,phase is in [kg/mol], C v is in [J/mol] and c v is in [J/kg], v is the molar volume of the mixture in
[m3 /mol], P is the pressure in [Pa] and T is the temperature in [K]. Moreover, kappa κ is defined as

cp
κ= . (5.133)
cv

5.3.4 Components Transport Equations

An additional set of equations are required in order to properly couple a compositional model to a
hydraulic simulator. That is the transport equation for each component needs to be solved so that one is
able to track the global composition at each control volume for each timestep. The transport equation is

Nphases Nphases
! !
∂ X ∂ X
α p ρ p x̃ ip + α p ρ p u p x̃ ip = Γi , (5.134)
∂t p
∂x p

where x̃ i p is the mass fraction of component i in phase p. The equation that describes the evaluation of
each component mass fraction in phase is given by

x̃ ip = κip z̃i , (5.135)

where z̃i is the mass of each component in the mixture in [kg component / kg mixture], κip is the parti-
tioning coefficient for component i and phase p and x̃ ip is the mass fraction of component i in phase p.
Note that κi p is evaluated with the outputs of flash calculations and it will be shown later. The initial value
for z̃i is obtained through the initial global molar composition of the fluid zi :

MW i
z̃i = zi , (5.136)
MW mix

in which i represents the component and MW mix is the molecular weight of the fluid. It is also possible to
compute the global molar composition as a function of the mass fraction of each component. In this case,
the conversion is given by
z̃i
MW i
zi = P z̃ j
. (5.137)
j MW j

Note that it is still necessary to define an expression for κip . Recall that the K-values are Ki = x i g /x il
and that they are a result of flash calculations. κip can be calculated as a function of Ki , V (vapor fraction in
the mixture) and x i p (molar composition of each component on each phase p, which were used as x i = x il

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.3. COMPOSITIONAL MODEL 52

and yi = x i g in previous sections). The resulting expression is given as follows

Np MW mix
κi p = . (5.138)
V (Kip − 1) + 1 MW p

Note that the numerator Np in above equation is



1, for liquid, p = l,
Np = (5.139)
Ki , for gas, p = g.

Note that a special handling is required for the case of phase disappearance. In eq. (5.138), if the gas
phase disappears (single-phase liquid), that is, V = 0, hence Np = 1 and

MW mix
κip = (5.140)
MW p

This is a special case where the K-values can assume any value since κip is independent of it and, conse-
quently, eq. (5.135). Therefore in order to guarantee the mass balance in the system, it can be set for this
case

κil = 1 (5.141)
κi g = 0 (5.142)

Now, analyzing the opposite scenario in which he liquid phase disappears and it is only gas in the mixture,
that is, V = 1. Eq. 5.138 becomes
MW mix
κip = (5.143)
MW p
Which is identical to eq. (5.140). Finally, the following is set for this case

κil = 0 (5.144)
κi g = 1 (5.145)

The summarized coupled algorithm is given as follows

1. Given the initial conditions P, T and zi , perform flash, calculate fluid properties and partitioning
coefficients (eq. (5.138));

2. Solve transport equations (Mass, Momentum and Energy);

3. With the obtained velocity field, solve the component transport equations, eq. (5.134), to find z˜i ;

4. Calculate zi from z˜i using eq. (5.136);

5. With the new fields of P, T and zi , advance timestep and calculate fluid properties and partitioning
coefficients (eq. (5.138)).

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
5.4. COMBINED MODEL 53

5.4 Combined Model

The Combined PVT Model, allows the use of different pvt tables in a given point, by the combination
of one or more fluids along the production system in situations like well clean-up, bullhead operations,
alternate gas injection, inhibitor injection, etc...

Once the Combined PVT Model is activated, all Nodes and Edges under this model will include a fluid
field in which the user will select the one to be combined in the pipeline or the one to be considered in case
backflow is expected. The fluid associated is a way of properly defining boundary and initial conditions
and associating those to a pvt model.

A tracer will be created (internally) in order to track which fluid is present in a given control volume
at a given time hence the PVT properties of that point will be calculated based on the fluids fluids present
at that point and at that moment. So we are able to interpolate a state variable property based on the mass
fraction amount of each fluid:

X
ρ= (ρ ∗ Φ), (5.146)

where the tracers’ mass fractions are used as weights for this interpolation.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
54

Chapter 6

Steady State Solver

The simulation of the initial transient of the fluid flow development may be of little engineering in-
terest, since it may be relatively short in practice. However, this period of simulation is computationally
expensive: the value of the variables being solved changes too much, limiting the time step size, which
greatly contributes to increasing the overall simulation CPU time. Based on these two factors, it is interest-
ing to implement a steady-state solver for the case initialization. Such a solver would calculate the solution
of a fully developed flow and would set that as the initial condition of the case. The case configuration used
in the steady-state solver is the one for t = 0 s. The effects of change in operation conditions at t > 0 s,
like variations in valve opening or pump speed, are still captured in the transient simulation, which follows
the steady-state’s.

The steady-state solver solves mass flow rates instead of velocity and volume fractions. Pressure is
solved at the center of the control volumes and mass flow rates at the faces. The steady-state solver is
strongly coupled with the point and unit cell models, which are already used in the transient simulator to
calculate flow patterns and friction factors, respectively. The current approach of the steady-state solver
is based on the mass conservation equation and the unit cell model. The mass conservation equation is
solved for each pressure control volume. Since phase superficial velocities, and not superficial velocities of
the fields, are inputs of the unit cell model, the mass conservation equation is solved for each phase and
the phase mass flow rates are the unknowns. The mass conservation equation is given by

ṁ p,e − ṁ p,w = Γw + Γms + Γe/c , p = 1, . . . , Np (6.1)

where p denotes the phase, w and e, the west and east control volume faces, respectively, and Γw , Γms ,
and Γec are the mass sources from wells, mass source devices, and condensation/evaporation, respectively.
Note that because the unknowns are at the faces of the control volumes, but the equations are set to the
center of the control volumes, there would be more unknowns than equations. This is a fixed setting

ṁ p,0 = ṁp,presc , (6.2)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
55

where ṁp,presc is the mass flow rate of phase p prescribed at the mass source boundary condition.

The equation for the pressure comes from the unit cell/point model applied to the control volume
faces. At these points, the phase superficial velocities are calculated as

J p = ṁ p /(ρ p A), (6.3)

where ρ p is the phase density and A is the pipe transverse area. J p is an input of the unit cell model, which
returns the wall shear stress force per unit volume Γw,p . The equation for pressure is then

Np
X  
PP − PE = Γw,p + ρ p α p g sin(θ ) , (6.4)
p=1

where the volume fraction α p is also an output of the unit cell model.

The following procedure is used for solving the steady-state problem:

1. Guess solutions for pressure, phases mass flow rates, and temperature

2. Calculate fluid properties from pressure and temperature;

3. Calculate phase superficial velocities


dP
4. Compute α p , U p , using the flow pattern identification algorithm;
dx
5. Solve mass, pressure, and energy equations to obtain new solutions for pressure, phase mass flow
rates, and temperature;

6. Return to item 2 until convergence.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
56

Chapter 7

Wax Module

Wax deposition is a significant operational and economic concern in the oil and gas industry, leading
to decreased production rates, equipment breakdowns and production shutdowns. The precipitation of
paraffin (or wax) occurs when the wall temperature of a pipe through which paraffinic oil is transported
falls below the Wax Appearance Temperature (WAT), also called cloud point.

In ALFAsim, the deposition model of wax at pipe wall implemented was based on Matzain et al. (2000).
In this semi-empirical model, there are two main mechanisms responsible for wax deposition: molecular
diffusion, which is the primary, and shear dispersion.

The wax deposition process can be summarized in the following steps:

• Precipitation of dissolved wax molecules and formation of an incipient deposit layer on the pipe wall
surface;

• Generation of a radial concentration gradient of dissolved waxy components, which results in the
diffusion of paraffin molecules from the bulk oil toward the wall;

• Precipitation of wax components on the surface of the existing deposit, which contributes to the
growth of its thickness;

• Internal diffusion of paraffin molecules inside the deposit layer, which leads to an increase in the
solid wax fraction of the deposit;

• Counter-diffusion of dewaxed oil out of the deposit.

In the model implemented, the rate of wax build up is calculated through an empirical modification of
Fick’s law described below:
Π1 d Fw
• ˜

= Dwo , (7.1)
dt 1 + Π2 dr
where,

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
57

• δ is the wax deposition thickness at pipe wall;

• Fw is the wax mass fraction;

Also, Dwo is the diffusion coefficient of wax in oil evaluated with the Wilke and Chang (1955) corre-
lation shown below,
 p 0.0001
−8
Tmix x MW,oil
Dwo = 7.48e , (7.2)
µoil (Vwax )0.6
with x being an association parameter (multiple of nominal molecular weight of solvent (oil) to give ef-
fective value), Vwax being the wax volume in [cm3 ], µoil being the oil viscosity in [cP], MW,oil being the
molecular weight of oil in [g/mol] and Dwo in [cm2 /s].

The shear dispersion term is represented by:

Π1
, (7.3)
1 + Π2

in which,

C1
Π1 = CL
, (7.4)
1− 100

C1 = 15, (7.5)

In the equation above, C L is the porosity of wax deposit layer, that is, the amount of oil trapped in the wax
layer defined by  0.15 
NRe
C L = 100 1 − , (7.6)
8
where NRe is the Reynolds number. The other term in eq. (7.3) is defined as

C
Π2 = 1 + C2 NSR3 , (7.7)
C2 = 0.55, (7.8)
C3 = 1.4. (7.9)

The flow regime dependent Reynolds number (NSR ) is calculated for each regime as shown below,

ρoil voil δ
NSR = , Single phase and stratified wavy flow (7.10)
µoil
ρmi x voil δ
NSR = , Bubble and slug flow (7.11)
µoil
p
ρmix ρoil voil δ
NSR = , Annular flow (7.12)
µoil

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
58

d Fw
Furthermore, the term dr in eq. (7.1) can be rewritten as

d Fw d Cwax d T
= , (7.13)
dr dT dr

where Cwax is the concentration of wax in the oil. Moreover, the thermal gradient of the laminar wax
deposit layer is given by
dT Tbulk − Tws
= hinner . (7.14)
dr klayer
In the equation above, Tbulk and Tws represent the temperature of the bulk fluid and of the deposit layer
surface, respectively, hinner is the inner wall heat transfer coefficient and klayer is the thermal conductivity
of the wax deposit layer defined as

2kwax + koil + (kwax − koil )Fw,layer


klayer = koil , (7.15)
2kwax + koil − 2(kwax − koil )Fw,layer

where kwax and koil are the thermal conductivity of wax and oil, respectively, and Fw,layer is the wax mass
fraction.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
59

Chapter 8

Hydrates Module

Hydrate formation consists of the solidification of water around gas molecules that form a structure
that might obstruct a pipeline, decreasing its productivity or even completely plugging the production
pipeline. This process occurs in the subsea transport of oil and gas where the operational conditions are of
low temperatures and high pressures.

There are two hydrate formation frameworks implemented in the Hydrates plugin: The Single For-
mation Rate and the Population Balance. A brief explanation of the main equations of these approaches is
shown below.

8.1 Single Formation Rate

This approach calculates the hydrate formation rate by combining the nucleation and particle growth
phenomena into a single rate following the model proposed by Boxall (2009), which can be tuned by the
user. Furthermore, the hydrate particles’ mean diameter is assumed constant and it is user-given.

The formation source term is computed by

k2 M Mh
‹  ‹
Γ F = −k1 exp Ai ∆Tsub (8.1)
T M MF

where

• Γ F : Hydrate mass formation rate.

• ∆Tsub : Subcooling Temperature.

• M Mh : Hydrate Molecular Mass (18.01 g/mol).

• M M F : Hydrate Former Molucular Mass (16.04 g/mol).

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
8.2. POPULATION BALANCE 60

• Ai : Interfacial area between the water droplet and oil field and either the water droplets (during
formation) or hydrate particle and oil field (during dissociation).

• k1 : Conversion rate constant (7.3548 × 1017 /5 m/K)

• k2 : Conversion rate temperature constant (−13600 K)

The formation is considered when ∆Tsub > (∆Tsub )min or ∆Tsub < 0. In addition the dissociation
(Γ F = 0) is considered when 0 ≤ ∆Tsub ≤ (∆Tsub )min .

8.2 Population Balance

This approach uses a population balance equation to compute the hydrate particles’ mean diameter
accurately. To accomplish that, the hydrate formation rate is calculated considering separately the nu-
cleation and particle growth rates. Furthermore, the hydrate particles’ mean diameter is calculated from
the hydrate volume fraction and from the zeroth-order moment (From Population Balance) of the hydrate
particles (volumetric concentration), which accounts for the particles’ agglomeration and breakage rates.

The zeroth order moment (hydrate particles concentration) source term of the transport equation is
given by
1 2
Λ0D = Jo − Nh,o βo + Nh,o ωo (8.2)
2
The hydrate formation source term of the mass conservation equation is given by
€ Š
3
Γh = k v ρh αo Jo Dc,o + 3Nh,o g o Do2 (8.3)

where

• Jo : Nucleation Rate.

• βo : Agglomeration Kernel.

• ωo : Breakage Kernel.

• g o : Growth Rate.

• Dc,o : Critical Nuclei Diameter.

• ρh : Hydrate density.

• αo : Volume Fraction of Oil Layer (Contains the dispersed hydrate field)

• Nh,o : Hydrate Particle Concentration in Oil layer (Zeroth Order Moment)

The subcooling temperature ∆Tsub is taken into account during the Growth and Nucleation rates calcula-
tion.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
8.3. HYDROCARBON PARTITIONING 61

8.3 Hydrocarbon Partitioning

The hydrocarbon partitioning is the model applied when selecting the former component from the
components available in the system. The hydrates module supports the options: "Oil Only", "Gas Only",
"Calculated from PVT" and "From Table". The first two options are straightforward since it means that the
former is consumed or generated from the oil or gas phases only. The two last options use the partitioning
coefficients from the Rachford-Rice equation

N € N
X Š X zi (Ki − 1)
yi − x i = (8.4)
i=1 i=1
1 + F (Ki − 1)

where x i and yi are the mole fraction of component i in liquid phase and gas phases, respectively, zi is the
mole fraction of the component in the feed stream, Ki is the partitioning coefficient and F is the fraction
of feed that is vaporized.

8.3.1 Calculated from PVT

In this option of the partitioning model, the Rachford-Rice equation (eq. (8.4)) is simplified to have
two components: former and non-former, in which the non-former component are all the other components
put together. Hence, it’s only necessary the calculate of the K f partitioning coefficient of the former which
is used to compute the hydrate mass flux.

8.3.2 Partitioning table

On the other hand, the partitioning model "From Table" will use the partitioning coefficients that
should be computed previously in a PVT solver and be saved in a table with the .alfahyd extension. This
table must have the following information:

• EOS: the equation of state used to compute the K factors;

• COMPONENTS: names of the components;

• MOLES: global molar composition;

• MOLWEIGHT: components molecular weights;

• PRESSURE: the pressure points used to compute the table;

• TEMPERATURE: the temperature points used to compute the table;

• the tabular data composed of a pressure (PT) and temperature (TM) pair and the K values;

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
8.4. HEAT OF FORMATION 62

The K values of the table are expected to be mass based and should abide to the following rules:

• When there is no gas phase, the K-factor is 0.0;

• When there is no liquid phase, the K-factor is ∞, represented as inf.

• If the water component is present in the table, it’s K-factor should be NaN.

After importing the table in the plugin’s GUI, the user should specify which component is the former
component, which will automatically select the former molecular weight. The specification of the former
component must be equal to one of the names provided in the COMPONENTS entry of the table. Moreover,
even though the table might have the water component, it can not be selected as the former component.

8.4 Heat of formation

The hydrate formation process is a quasi-chemical reaction, which releases some quantity of heat
(exothermic). In this regard two approaches have been considered: 1) a model that computes it based on
the mass of hydrate former consumed and hydrate thermal properties; and 2) a user-given constant value.

1. Lo (2011) model: The expression used is


q̇ = ṁ f c ph y d Teq

2. The constant value (Heat of Formation per mol) informed by user: ∆Q h y d


q̇ = ṁ f ∆Q h y d /M M f

where

• q̇: Heat generation rate of hydrate formation

• ṁ f : Mass flow rate of hydrate former

• ∆Q h y d : Heat of formation constant value

• M M f : Molar mass of hydrate former

• c ph y d : Isobaric specific heat of hydrate

• Teq : Equilibrium temperature (from hydrate formation curve)

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
8.5. THERMODYNAMIC HYDRATE INHIBITION 63

8.5 Thermodynamic Hydrate Inhibition

Both hydrate formation models implemented in the module consider thermodynamic inhibition. It
acts directly in the subcooling temperature by considering a suppression temperature, which is

(∆Tsub )e f f = ∆Tsub − ∆Tsup (8.5)

where ∆Tsup is the suppression temperature that is computed using Hammerschmidt (1939) model.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
64

Chapter 9

Assisted History Matching

The Assisted History Matching is the feature that uses uncertainty quantification to evaluate any AL-
FAsim case considering statistics and probabilities. This kind of tool aggregates much more information to
the problem case than a simple simulation, helping the engineers make decisions more confidently since a
set of simulations will be performed instead of a single one.

This feature is based on Bayesian statistics which uses the Monte Carlo Method to evaluate statistically
the probability of an event to happen. It comprises three tools: Sensitivity Analysis, History Matching itself,
and uncertainty propagation. Each of these tools will be explained below.

9.1 Sensitivity Analysis

ALFAsim provides two types of sensibility analysis, Local Sensitivity Analysis and Global Sensitivity
Analysis. The first one is completely configured and controlled by the user. The second, is performed by a
stochastic procedure in which the algorithm controls the entire analysis.

9.1.1 Local Sensitivity Analysis - Tornado Plot

In this type, a local analysis is performed in specific perturbations of parameter values, positive and
negative. These perturbations are defined by the user and a specified number of simulations are run in
order to observe the sensibility of outputs depending on changes in the input parameters.

Once all simulations are performed, all output variables(simulation results) can be analyzed and com-
pared with the base simulation results in which there is no perturbation on input parameters. This com-
parative is made automatically by ALFAsim and a Tornado Plot is created for each output variable.

On Figure 9.1 a typical Tornado Plot for one output variable can be observed. In this kind of graph,

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
9.1. SENSITIVITY ANALYSIS 65

the horizontal bars represent the output variable change compared to the base value with respect to the
input parameter’s positive or negative perturbation.

Figure 9.1: Tornado Plot Illustration.

As can be noted in the Figure 9.1, the parameter A causes the biggest change in the output variable.
It implies that we output variable is more sensible for changes in parameter A. Also, note that the tornado
form of the graph comes from the output variable sensitivity order.

9.1.2 Global Sensitivity Analysis

The global sensitivity analysis is a type of analysis in which is possible to evaluate a specific model
(ALFAsim) to understand objectively which parameter has the most influence in the simulator outcomes and
in which conditions. It is called an objective analysis because its results are indexes calculated statistically
from the simulator output variables, differently from the local sensitivity analysis in which the output values
are observed directly without considering the order of magnitude of the variables.

The procedure of analysis is carried out using the Monte Carlo method, which generates possible
combinations of parameters’ values to run different scenarios. After that, some mathematical indexes are
calculated to be the basis of parameter comparisons and consequently sort the parameters with the most
importance.

One of the most prominent methods of global sensitivity analysis is the Morris Method, or Elementary

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
9.1. SENSITIVITY ANALYSIS 66

Effects Method (Saltelli et al., 2004). Because of that, ALFAsim uses this method to perform the analysis.
It consists of defining the Quantities of Interest(QoI) that will be used to calculate the indexes and the
range of values that each parameter can have. With that, the Morris Method samples combinations of
parameters’ values within defined ranges calculating indexes for each quantity of interest based on the
difference between changes obtained in the simulations’ results. Mathematical details can be found In
Saltelli et al. (2004) or in the original paper of the Morris’ Method (Morris, 1991).

Figure 9.2 shows a typical graph of global sensitivity analysis results. It is important to note that the
calculated indexes are normalized and its sum is equal to 1. Also, the calculated indexes are associated to
one time level and a specific quantity of interest (Temperature at position 150 m).

Figure 9.2: Global Sensibility Analysis Results.

In the illustration shown in Figure 9.2 we can see that the most influential parameter changes over
time, parameter C in the beginning and parameter A at the end of the simulated time. This kind of analysis
allows the user to identify which parameter influences most in a specific condition/time.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
BIBLIOGRAPHY 67

Bibliography

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

A. Bejan. Convection Heat Transfer. John Wiley & Sons, Inc., 3rd edition, 2004.

J. a. Boxall. Hydrate Plug Formation from <50% Water Content Water-in-Oil Emulsions. PhD thesis, Colorado
School of Mines, 2009.

J. G. Faustinelli. Dynamic flow performance modeling of a gas-lift valve. SPE Latin American and Caribbean
Petroleum Engineering Conference, 2001.

O. Glaso et al. Generalized pressure-volume-temperature correlations. Journal of Petroleum Technology, 32


(05):785–795, 1980.

K. R. Hall and L. Yarborough. A new equation of state for z-factor calculations. Oil and Gas journal, 71(7):
82–92, 1973.

E. G. Hammerschmidt. Gas hydrate formation: a further study on their prevention and elimination from
natural gas pipe lines. Gas, 15(5):30–34, 1939.

A. R. Hasan and C. S. Kabir. Aspects of wellbore heat transfer during two-phase flow. SPE Production &
Facilities, (SPE 22948), 1994.

D. L. V. Katz. Handbook of natural gas engineering. McGraw-Hill, 1959.

M. G. Kesler. Improve prediction of enthalpy of fractions. Hydrocarbon processing, 153, 1976.

J. Lasater et al. Bubble point pressure correlation. Journal of Petroleum Technology, 10(05):65–67, 1958.

S. Lo. Cfd modelling of hydrate formation in oil-dominated flows. In OTC Houston, May 2011.

J. Lohrenz, B. G. Bray, C. R. Clark, et al. Calculating viscosities of reservoir fluids from their compositions.
Journal of Petroleum Technology, 16(10):1–171, 1964.

A. Matzain, H. Zhang, M. Volk, C. Redus, J. Brill, M. Apte, and J. Creek. Multiphase flow wax deposition
modelling. In BHR Group Conference Series Publication, volume 40, pages 415–444. Bury St. Edmunds;
Professional Engineering Publishing; 1998, 2000.

W. D. McCain. The properties of petroleum fluids. PennWell Books, 1990.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
BIBLIOGRAPHY 68

M. D. Morris. Factorial sampling plans for preliminary computational experiments. Technometrics, (33):
161–174, 1991.

J. Ng, E. Egbogah, et al. An improved temperature-viscosity correlation for crude oil systems. In Annual
Technical Meeting. Petroleum Society of Canada, 1983.

B. E. Poling, J. M. Prausnitz, J. P. O’connell, et al. The properties of gases and liquids, volume 5. Mcgraw-hill
New York, 2001.

J. M. Prausnitz, R. N. Lichtenthaler, and E. G. de Azevedo. Molecular thermodynamics of fluid-phase equi-


libria. Pearson Education, 1998.

L. Qiu, Y. Wang, Q. Jiao, H. Wang, and R. D. Reitz. Development of a thermodynamically consistent, robust
and efficient phase equilibrium solver and its validations. Fuel, 115:1–16, 2014.

H. Rachford Jr, J. Rice, et al. Procedure for use of electronic digital computers in calculating flash vapor-
ization hydrocarbon equilibrium. Journal of Petroleum Technology, 4(10):19–3, 1952.

L. Riedel. A new universal vapor-pressure equation. i. the extension of the theorem of corresponding states.
Chem. Eng. Tech., 26:83–89, 1954.

D. Robinson and D. Peng. The characterization of the heptanes and heavier fractions. Reasearch Report,
28, 1978.

A. Saltelli, S. Tarantola, F. Campolongo, and M. Ratto. Sensitivity Analysis in Practice. John Wiley & Sons,
Ltd, 2004.

D. Schechter, B. Guo, et al. Parachors based on modern physics and their uses in ift prediction of reservoir
fluids. SPE Reservoir Evaluation & Engineering, 1(03):207–217, 1998.

M. A. Shahri. Simplified and Rapid Method for Determining Flow Characteristicsof Every Gas-Lift Valve (GLV).
PhD thesis, Texas Tech University, 2011.

E. F. Simões, J. N. Carneiro, and A. O. Nieckele. Numerical prediction of non-boiling heat transfer in


horizontal stratified and slug flow by the two-fluid model. International Journal of Heat and Fluid Flow,
47:135–145, 2014.

T. K. Perkins. Critical and Subcritical Flow of Multiphase Mixtures Through Chokes - 20633. SPE Drilling
and Completion, 8(04):271–276, 1993. ISSN 1064-6671. doi: http://dx.doi.org/10.2118/20633-PA.

M. Vazquez, H. D. Beggs, et al. Correlations for fluid physical property prediction. In SPE Annual Fall
Technical Conference and Exhibition. Society of Petroleum Engineers, 1977.

C. F. Weinaug and D. L. Katz. Surface tensions of methane-propane mixtures. Industrial & Engineering
Chemistry, 35(2):239–246, 1943.

C. H. Whitson and M. R. Brulé. Phase behavior. Henry L. Doherty Memorial Fund of AIME, Society of
Petroleum Engineers . . . , 2000.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co
BIBLIOGRAPHY 69

C. Wilke and P. Chang. Correlation of diffusion coefficients in dilute solutions. AIChE Journal, 1(2):264–
270, 1955.

Rua Orlando Phillipi, nº 100 - Edifício Techplan, 1º andar


Saco Grande – Florianópolis – SC – 88032-700
Tel: +55 (48) 3953-0000 – www.esss.co

You might also like