You are on page 1of 32

SPE-174749-MS

Formulation of a Transient Multi-Phase Thermal Compositional Wellbore


Model and its Coupling with a Thermal Compositional Reservoir Simulator
Fahim Forouzanfar, University of Tulsa; Adolfo P. Pires, Universidade Estadual do Norte Fluminense;
Albert C. Reynolds, University of Tulsa

Copyright 2015, Society of Petroleum Engineers

This paper was prepared for presentation at the SPE Annual Technical Conference and Exhibition held in Houston, Texas, USA, 28 –30 September 2015.

This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents
of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect
any position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written
consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may
not be copied. The abstract must contain conspicuous acknowledgment of SPE copyright.

Abstract
In this paper, we develop the detailed formulation of a transient multi-phase thermal compositional
wellbore model and couple it with a thermal compositional reservoir simulator. We consider the presence
of at most three phases which are an aqueous phase (water with dissolved CO2), a hydrocarbon liquid
phase and a hydrocarbon vapor phase. The volume of wellbore is divided into a set of 1-D control volume
grids. The mass balance equations for all components and the total energy balance equation are discretized
over the wellbore control volumes. The transient total momentum balance equation (along the wellbore)
and the drift-flux model equations for gas-liquid and oil-water systems are discretized over a set of
backward staggered grids with respect to the wellbore grids. Following the assumption that the hydro-
carbon phases inside a wellbore control volume are in equilibrium, a set of constraint equations are
introduced to enforce the equality of the fugacity of each component in both hydrocarbon phases. The
solution algorithm for the wellbore model is similar to the one for a compositional reservoir simulator,
where, the sets of simulation equations and unknowns are divided into the sets of primary and secondary
equations and unknowns which are solved sequentially. The appearance and disappearance of the
hydrocarbon phases follow the phase stability and two-phase flash calculations. The wellbore model is
fully coupled with a reservoir simulator at the bottom of the well. The interaction of wellbore with
reservoir is handled with definition of source terms in the mass and energy balance equations and is
obtained from continuity of force, energy and mass fluxes across the reservoir/wellbore interface. The
boundary conditions for the wellbore model depend on the well control which includes the specified
pressure or production rate at wellhead. Within the computational results section, the validation of the
wellbore model against the analytical solution for the shock tube problem is presented. Moreover, the
coupled wellbore/reservoir simulator is used to model the drawdown and buildup tests of a well in a
single-layer reservoir, and a relatively long period of production from a multi-layer volatile oil reservoir.
Introduction
Multiphase flow in wellbores takes place in several different field operations such as production/injection
and well tests. When a multi-phase multi-component mixture flows in the wellbore, phase compositions,
pressure, temperature and holdup profiles are related. First developed wellbore models only focused on
2 SPE-174749-MS

the pressure drop prediction, where the phase behavior calculations were based on empirical correlations
using a black oil model (Gould, 1979). However, reservoir fluids are complex mixtures of hydrocarbons
and contaminants such as carbon dioxide and hydrogen sulfide and a compositional model is required to
precisely calculate the volumetric, thermal and phase equilibrium properties of the mixtures (Pourafshary
et al., 2009).
The dynamic aspects of flow in the wellbore are modelled through the solution of the compressible
Navier-Stokes equations, i.e. the conservation equations for mass, momentum and energy of fluid. A
multi-dimensional formulation of wellbore model will be computationally expensive and will require
complex coupling conditions with reservoir which may need tuning using experimental data (Amara et al.,
2009). However, since the gradient of the properties in radial direction in the wellbore are usually
negligible, the dominant changes occur along the wellbore. In such case, a 1-D model is able to precisely
capture the complex wellbore behavior. Moreover, the conditions for coupling the reservoir and wellbore
can be simplified to the inclusion of proper source terms in the mass and energy balance equations. In
modeling a free flow medium (e.g., the wellbore), the individual phase velocities are obtained by the
solution of a set of phase momentum balance equations which include the momentum transfer between
phases (multi-fluid model). The momentum transferred between phases depends on the flow pattern in the
medium and is usually computed using correlations developed for the particular flow patterns. However,
using these correlations causes discontinuity in the definition of momentum transfer term when a
transition between flow patterns happens. This may cause numerical problems specially when a fully
implicit technique is used to solve the system of equations. A different approach, implemented in this
paper, is to use a drift-flux model (Zuber and Findlay, 1965; Ishii, 1977; Hasan and Kabir, 1999; Hibiki
and Ishii, 2003), which is continuous and does not depend on flow patterns. However, the drift-flux model
correlations are usually applicable for co-current, steady-state flow only.
The coupling of the wellbore and reservoir models has been investigated previously. Almehaideb et al.
(1989) developed a fully implicit isothermal black-oil reservoir simulator accounting for wellbore/
reservoir interactions in order to predict phase injectivities for multi-phase injection processes. In their
model, the segregation of phases was taken into account by applying a separated flow approach to
consider the slippage between liquid and gas phase, however, only co-current water-gas injection was
evaluated. A coupled wellbore/reservoir model considering only the near wellbore region was developed
by Hu et al. (2007), where the wellbore flow is modeled using a three-fluid approach for a specific flow
pattern. Krogstad and Durlofsky (2007) used a multi-scale mixed finite element technique to model
coupled wellbore/near-well flow. This technique was applied in heterogeneous reservoirs, and a drift-flux
model was used to solve the two-phase flow in the wellbore. A coupled wellbore/reservoir flow model for
pressure transient analysis of vertical wells in heterogeneous reservoirs was developed by Khadivi et al.
(2013). Their model uses the Darcy flow in the reservoir and the Navier Stokes equations in the wellbore
which are solved using a finite element technique. Pan and Oldenburg (2014) developed a two-phase
wellbore simulator using the drift-flux model in which a mixed implicit-explicit scheme was used for the
solution of the momentum balance equation. One of the first attempts to solve the coupled problem of
non-isothermal wellbore/reservoir flow was presented by Stone et al. (1989), where a fully implicit
two-phase thermal simulator was used to model a steam injection experiment. The heat transfer through
tubulars, cement and the formation were considered by adding a conduction term to the wellbore model.
Hasan et al. (1997) developed a non-isothermal wellbore model coupled with an analytical reservoir
model. Amara et al. (2006) developed a coupled wellbore/reservoir model using a mixed finite element
formulation which takes into account the energy transfer between the two mediums. In their work, the
reservoir model formulation was based on the Darcy-Forchheimer equation and the wellbore model
formulation was based on the compressible Navier-Stokes equations. Izgec et al. (2007) presented a
transient wellbore simulator capable of calculating temperature profiles along the wellbore. Livescu et al.
(2008) developed a coupled multi-phase black oil wellbore/reservoir model. This formulation was later
SPE-174749-MS 3

extended to treat multi-component systems (Livescu et al., 2009) and three-phase flow (Livescu et al.,
2010). Moreover, Pourafshary et al. (2009) developed a compositional coupled wellbore/reservoir model
and Shirdel and Sepehrnoori (2009) presents the implementation of such model for modeling the
distribution of pressure and temperature in horizontal wells. A fully implicit single phase non-isothermal
wellbore/reservoir simulator was developed by Bahonar et al. (2011a). This model was used to analyze
gas well testing problems showing storage effects, gas backflow and the importance of the heat capacity
of tubular and cement materials on the wellhead temperature behavior (Bahonar et al., 2011b).
This paper presents a transient multi-phase, thermal compositional model for simulating the wellbore
phenomena including wellbore storage and resolving the pressure, temperature, composition and phase
volume fraction changes along the wellbore. The wellbore model is coupled with a thermal compositional
reservoir simulator at the bottom of the well through the definition of mass and energy source terms in
the constitutive equations of both mediums. The wellbore model accurately simulates the wellbore effects
during transient and steady state production and shut-in periods. In the following, first the detailed
mathematical formulation of both wellbore and reservoir models and their coupling is presented followed
by the definition of the boundary conditions of the wellbore model. Secondly, the solution algorithm of
the coupled system is explained. In the computational results section, the validation of the wellbore model
for the shock tube problem and the application of the coupled model for simulating a well test run and
modeling the production from a volatile oil reservoir is presented.

Coupled Wellbore/Reservoir Model Formulation


In this section we present the system of equations and unknowns for the coupled wellbore reservoir
simulator. The formulation of both reservoir and wellbore models are thermal compositional. We consider
the presence of at most three phases including a liquid hydrocarbon phase (o), a vapour hydrocarbon phase
(g) and an aqueous phase (a). The aqueous phase is composed of water and dissolved CO2 component.
However, we do not consider the solubility of water in hydrocarbon phases. By the same token, water is
not considered as a component in the thermodynamic equilibrium calculations. The hydrocarbon phases
inside a reservoir or wellbore grid are assumed to be thermodynamically in equilibrium. The formulation
is presented on ncom components (water is not included) present in both hydrocarbon phases. If a CO2
component is present in the mixture, it is considered soluble in the aqueous phase. Other hydrocarbon and
non-hydrocarbon components are insoluble in the aqueous phase.
Wellbore Simulator Formulation. We consider a 1-D grid system for the wellbore to discretize the
mass, momentum and energy balance equations. The wellbore grid system is shown in Fig. 1. Wellbore
grids start from the top of the well (wellhead) and ends at the bottom of the well. We use a backward
staggered grid system for the discretization of the total momentum balance equation. Moreover, the
drift-flux equations are also solved at the center of the staggered grids. For example for the wellbore grid
kw, the control volume for applying the mass and energy balance equations is shown with a gray color and
the control volume for applying the momentum balance equation is shown with a light blue color. The
constitutive equations which are solved in the wellbore model include the mass balance equation for each
component, the mass balance equation for water, the total energy balance equation and the total
momentum balance equation of all phases present in the control volume. The component mass balance
equation (Eq. 1), the mass balance equation for water (Eq. 2), and the total energy balance equation (Eq.
3) for the wellbore control volume kw are given by
4 SPE-174749-MS

Figure 1—The schematic of wellbore grid system. Wellbore grids are shown with solid lines and a staggered grid is shown with a
short-dashed line.

(1)

for C ⫽ 1,. . ., ncom,


(2)

and
(3)

In the above equations, rwb and ⌬z are the radius and the length of a wellbore grid, respectively; ␰p in
(lb-mole)/ft3 is the molar density of phase p; ␳p in lbm/ft3 is the mass density of phase p; ␣p is the volume
fraction of phase p; hp in Btu/lbm is the enthalpy of phase p; xc,p is the mole fraction of component c in
phase p; p in psi is the pressure, and vp and vsp both in ft/day are the actual and superficial velocities of
phase p, respectively; t in day is the simulation time; gz ⫽ g sin ␪ in ft/sec2 is the gravitational acceleration
in the direction of wellbore trajectory where ␪ is the angle of the control volume with horizon; gc ⫽ 32.174
(lbm · ft)/(lbf · sec2) is the conversion factor for force, ␥ ⫽ 1.285 ⫻ 10⫺3 Btu/(lbf · ft) is the conversion
SPE-174749-MS 5

factor for energy in the field unit system, 86400 sec/day is the conversion factor for time and 144 in2/ft2
is the conversion factor for length.
The terms qMc and qMw, in (lb-mole)/day, and qH, in Btu/day, are the internal sources for mass of
component c, mass of water, and the total energy, respectively. These source terms correspond to the flow
of mass and energy between the reservoir and wellbore, and will be defined later in the section
corresponding to the coupling of reservoir and wellbore models. Qloss is the heat loss from the wellbore
to the surrounding formations by conduction and it is defined based on the overall heat transfer coefficient
for a wellbore system composed of tubing, annulus, casing and cement. The general expression for Qloss
in Btu/day is given by
(4)

where Tf in °F is the temperature of the fluid inside the wellbore; Tew in °F is the temperature of the
surrounding formation at outer radius of the casing cement; Ut in Btu/(day · ft2 ° F) is the overall heat
transfer coefficient for the wellbore system (tubing, annulus, casing and cement), and rt in ft is the inner
radius of the tubing (based on the definition given below for Ut). The overall heat transfer coefficient for
a wellbore system with tubing, annulus, casing and cement is defined by (Hasan and Kabir (2012))
(5)

where ␬t, ␬c and ␬cem in Btu/ (day · ft °F) are the thermal conductivity coefficients of tubing, casing
and cement, respectively; rti and rto both in ft are the inner and outer radius of the tubing; rci and rco both
in ft are the inner and outer radius of the casing; hti in Btu/ (day · ft2 · °F) is the convection heat transfer
coefficient of the fluid inside the tubing and hc and hr both in Btu/ (day · ft2 · °F) are the heat transfer
coefficients by the convection and the radiation inside the annulus, respectively. Tew is computed using
the geothermal gradient of the earth and the depth of the wellbore control volume. Although we
considered a fixed temperature for the formation surrounding the wellbore (Tew), however, after producing
for some time the temperature of the earth around the wellbore changes and therefore assuming a constant
temperature for the formation around the wellbore may not be appropriate (Hasan and Kabir, 1991, 2012).
We consider a 1-D flow inside the wellbore, hence, only the momentum balance equation along the
wellbore is applied here. Moreover, the momentum balance equations of all phases are added together in
order to obtain a total momentum balance equation in which the momentum (and force) exchange between
phases are cancelled out. The total momentum balance equation is given in Eq. 6 and it is discretized over
the backward staggered grids.
(6)

In this equation, ␶w in lbf/ft2 is the overall wall shear stress acting on the mixture inside the control
volume and it is estimated using correlations for multi-phase flow in pipes. In this work, we use the
friction factor correlation developed by Beggs and Brill (1973) to compute the wall shear stress, ␶w, as a
function of overall volumetric flux.
In our formulation we use the drift-flux model in order to account for the slippage between phases and
solve for the velocity of individual phases. In the following, we present the equations of the drift-flux
model (in a consistent unit system) implemented in this work. From the drift-flux model for gas-liquid
system, the average gas phase velocity is given by
6 SPE-174749-MS

(7)

where vg is the average gas velocity; Co is the profile parameter to account for the effect of non-uniform
profiles of velocity and phase distributions; vd is the drift velocity which describes the buoyancy effect and
j is the volumetric flux (average velocity) of the mixture given by
(8)

Hasan and Kabir (1999) proposed a model for oil-water slip in pipes. The slip model is similar to the
one for gas-liquid and it is given by
(9)

where vl is the liquid velocity; vo is the oil phase velocity, and and are the profile parameter and
the drift velocity for the oil-water system, respectively. In this work, we use the drift-flux models
presented in Eqs. 8 and 9, where the parameters in these equations are obtained using correlations
presented in Shi et al. (2005) and Hasan and Kabir (1999).
We combine the drift-flux models for gas-liquid and oil-water systems to apply these equations to the
three phase flow as following. For a three phase system, the volumetric flux (j) and liquid velocity (vl) are
defined by
(10)

and
(11)

By rearranging the above equations and considering the definition of the superficial velocity of a phase
(i.e., vsp ⫽ ␣pvp), we define the final set of the drift-flux model equations given by
(12)

(13)

and
(14)

Note that the drift-flux model equations are also defined at the top boundary of the control volume (the
center of the backward staggered control volume). Eqs. 12, 13 and 14 combined with the total momentum
balance equation, Eq. 6, are solved for the superficial velocity of the aqueous, oil and gas phases and the
value of the total volumetric flux, J.
We consider that the liquid and vapour hydrocarbon phases inside the control volume are in thermo-
dynamic equilibrium. This implies the equality of fugacities of all components in both hydrocarbon phases
given by
(15)

for c ⫽ 1, . . ., ncom. Moreover, the fugacity constraint corresponding to the solubility of CO2
component in the aqueous phase is given by
(16)

Finally, the constraints on the mole fraction of components and volume fraction of phases are given by
SPE-174749-MS 7

(17)

for p ⫽ o, g and
(18)

The thermodynamic constraint equations combined with the drift-flux model equations are sufficient
to close the system of equations and unknowns. The system of equations for the thermal compositional
wellbore simulator consists of equations for each wellbore grid. is the
number of hydrocarbon phases and since we consider the presence of a liquid and a vapour hydrocarbon
phase, then . The set of equations for each grid consist of ncom mass balance equations for ncom
components, 1 mass balance equations for water, 1 total energy balance equation, 1 total momentum
balance equation, drift-flux model equations, fugacity equations, total mole
fraction constraint equations, 1 phase volume fraction constraint equation and 1 volumetric flux constraint
equation. Accordingly, there are simulation unknowns at each gridblock. The set
of unknowns for each gridblock includes: mole fractions of the hydrocarbon phases
, 1 for mole fraction of CO2 in the aqueous phase, volume
fraction of phases, velocity of phases, temperature (T), pressure (p) and the total volumetric
flux (j). This set of unknowns for a gridblock is called the set of natural variables, since every term in the
equations is an explicit function of these unknowns. Thus, forming the Jacobian matrix of the equations
with respect to the set of natural variables is easier compared to other choices of the set of unknowns. Note
that, if a hydrocarbon phase disappears in a gridlock, the set of unknowns of the gridblock is reduced and
accordingly, the set of corresponding equilibrium equations is reduced as well.
Reservoir Simulator Formulation. Various types of formulation based on considering the balance
equations on the mass of the components or on the pore volume of a grid (Cao, 2002) has been proposed
for the compositional reservoir simulation, e.g., Coats (1980); Acs et al. (1985); Chien et al. (1985); Watts
(1986); Wang et al. (1997); Cao (2002). The reservoir simulator in this work has a mass balance type
formulation which closely follows the wellbore formulation except that instead of applying the momen-
tum balance and the drift-flux model equations, the velocity of phases in the porous media is computed
by the generalized Darcy law given by
(19)

where is the vector of velocity of phase p in ft/day; k is the permeability tensor in md; krp is the
relative permeability of phase p; ␮p is the viscosity of phase p in cp; pp in psi is the pressure of phase p;
D in ft is the depth, and ␥p in psi/ft is the specific weight of phase p given by
(20)

␦p is the non-Darcy flow parameter tensor given by


(21)

where the non-Darcy coefficient (␤p), generally a tensor in ft⫺1, is a function of pore structure or flow
path and it is computed by empirical correlations. Li and Engler (2001) summarized the available
correlations for calculation of non-Darcy coefficient. For an isotropic medium, ␦p is a number and we
denote it by ␦p, however, in an anisotropic medium the permeability and non-Darcy flow parameter are
tensors. When ␦p ⫽ I, Eq. 19 reduces to the Darcy’s law. We consider the non-Darcy flow effect only for
the gas phase flow, hence, ␦p is set equal to 1 for the oil and water phases.
8 SPE-174749-MS

The constitutive equations which are solved in the reservoir simulator include the mass balance
equation for each component, the mass balance equation for water and the total energy balance equation.
The discretized form of these equations (using a two point flux approximation scheme) are given in Eqs.
22, 23 and 24. The discretized mass balance equation of a component is given by
(22)

for c ⫽ 1, . . ., ncom. The subscript i denotes the reservoir gridblock index. Nb is the number of
connections of this gridblock with other reservoir gridblocks. Vb is the bulk volume of the simulation
gridblock in ft3. ␾ is the porosity of the simulation gridblock and Sp is the saturation of phase p. In our
formulation, we consider the liquid hydrocarbon phase (oil) to be the reference phase for pressure, i.e., p
⫽ po. Accordingly, we define to be the “phase p/oil phase” capillary pressure as a
function of the phase p saturation. in our notation is equivalent to in common literature notation
and in our notation is equivalent to for a water-wet rock in common literature notation, i.e.,
and . ␭c,p is the mobility of component c in phase p and it is defined
by
(23)

ϒij is the transmissibility of the connection between gridblocks i and j and has the unit (ft3·cp)/(day·psi).
The definition of the trans-missibility term ϒij depends on the grid system of the reservoir, but it always
evaluates on the boundary between gridblocks i and j. For example, for a uniform Cartesian gridblock
system, the transmissibility term ϒij is given by
(24)

where Aij in ft2 is the area and kij in md is the harmonic average of the permeabilities of gridblocks i
and j; ⌬Ll in ft is the distance between the center points of gridblocks i and j.
ij

The discretized mass balance equation of water is given by


(25)

and the mobility for water is given by


(26)

In the energy balance equation, we ignore the heat transfer between the reservoir gridblocks by
conduction. The discretized total energy balance equation is given by
(27)

where up and urock both in Btu/lbm are the specific internal energy of phase p and the reservoir rock,
respectively, and hp in Btu/lbm is the specific enthalpy of phase p. Qloss represents the heat exchange
between the reservoir and the wellbore by conduction, and qCap represents the heat transfer between the
reservoir and the cap and base rocks of the reservoir by conduction.
SPE-174749-MS 9

The terms qMc, qMW and qH are the internal source terms corresponding to the mass of component c,
mass of water and total energy. These terms are added to represent the flow of mass and energy between
the reservoir and wellbore. The internal source terms are present in the mass and energy equations of a
gridblock only if there is an open perforation of a well inside that gridblock. If the reservoir simulator is
coupled with the wellbore model, these internal source terms are defined by the coupling conditions
explained in the following sections. However, if instead of a coupled wellbore system the reservoir
simulator uses a Peaceman type well model (Peaceman, 1978, 1983), the source terms corresponding to
the flow in the perforations of a well will be represented in terms of the flowing bottomhole pressure of
the well at a reference depth. For a bottomhole pressure-controlled well, the value of well bottomhole
pressure is specified, however, for a rate-controlled well, the bottomhole pressure of the well is computed
by solving a well equation (Aziz and Settari, 1979).
Following the assumption of thermodynamic equilibrium between the hydrocarbon phases in a
reservoir control volume, the ther-modynamic constraint equations given in Eqs. 15 through 18 will be
applied to each reservoir gridblock. Note that the volume fraction of a phase in the wellbore model, ␣p,
is the corresponding term to the saturation of a phase in the reservoir model, Sp.
The system of equations for the thermal compositional reservoir simulator consists of
equations for each reservoir simulation gridblock. If a well is represented in the
reservoir simulator using a Peaceman type well model, then a well equation will be required for each
rate-controlled well. The equations for each gridblock consist of ncom mass balance
equations for ncom components, 1 mass balance equations for water, 1 total energy balance equation,
fugacity equations, total mole fraction constraint equations and 1 saturation
constraint equation. Accordingly, there are simulation unknowns at each gridblock
and one unknown for each rate-specified well (the well reference flowing bottomhole pressure). The set
of unknowns for each gridblock includes: mole fractions of the hydrocarbon phases
, 1 for mole fraction of CO2 in the aqueous phase, saturation
of phases, temperature (T) and the reference pressure (p) (the individual phase pressures are replaced with
a reference pressure using capillary pressure constraints). As mentioned before, this set of unknowns for
a gridblock is called the set of natural variables, since every term in the equations is an explicit function
of these unknowns. If one of hydrocarbon phases disappears in a gridlock, the set of unknowns of the
gridblock is reduced and accordingly, the set of corresponding equilibrium equations is reduced as well.
We should mention that although the presented formulation of the reservoir simulator is thermal,
however, an almost isothermal simulation run can be obtained by specifying a very large value for the
specific internal energy of the reservoir rock, urock. In this case, the reservoir rock acts as a very large
energy source/sink for each gridblock and therefore the temperature of the reservoir gridblocks stay
constant.
Wellbore Reservoir Coupling. When modeling fluid flow in a reservoir, the Darcy’s law is used to
couple the velocity and pressure fields for the flow inside the porous media. In the wellbore, the
momentum balance equation is used to couple velocity and pressure fields for the flow, e.g., the
Navier-Stokes or Stokes equations. At the interface between the reservoir and wellbore, these two sets of
equations should be coupled by defining proper coupling conditions at the interface of the reservoir and
wellbore. Discacciati et al. (2002), Layton et al. (2003), Galvis and Sarkis (2007) and Amara et al. (2009)
among many other researchers, investigated the problem of coupling Stokes (or Navier-Stokes) and Darcy
flow for a single phase flow condition.
Here, we represent the flow between the wellbore (free flow medium) and reservoir (porous medium)
by defining internal source terms in the reservoir and wellbore model equations. This treatment of the
coupling between the reservoir and wellbore is possible mainly due to the assumption of a 1-D flow in
the wellbore. Following our treatment of the coupling between the wellbore and reservoir, we do not
directly use the interface conditions discussed by Layton et al. (2003) and Amara et al. (2009). However,
10 SPE-174749-MS

from these interface conditions, we define proper source terms for the wellbore and reservoir equations
which translates the interface coupling conditions.
The coupling of wellbore and reservoir mediums are defined based on the following considerations:
1. Balance of normal force at the interface: Following our assumption of ignoring the viscous
stresses in the wellbore, this condition reduces to the continuity of pressure across the interface.
Therefore, we consider pwb ⫽ prw where pwb is the wellbore pressure at the interface and prw is the
reservoir pressure at its interface with the wellbore. Since we assumed a 1-D wellbore grid with
a uniform pressure inside the gridblock, therefore, pwb is equal to the pressure of the wellbore grid.
2. Balance of tangential forces at the interface: The balance of tangential forces at the interface of
a free flow medium and porous media is usually defined by a boundary condition called the
“Beavers-Joseph-Saffman” condition (Beavers and Joseph, 1967; Saffman, 1971; Galvis and
Sarkis, 2007). However, for a 1-D gridblock system of the wellbore, since we do not consider the
momentum balance equations in the r and ␪ directions, no such condition is required.
3. Conservation of mass across the interface: This condition enforces the conservation of mass of
every component and water across the interface. Using this condition we define the internal source
terms in both wellbore and reservoir mass balance equations as following,
(28)

for c ⫽ 1,. . .,ncom, and


(29)

The subscript v in these equations refers to the index of the perforation which is shared between
the reservoir and wellbore grids. PI is the productivity index of the perforation and has the unit
(ft3·cp)/(day·psi). The estimation of PI for a perforation of a well depends on the grid type. The
subindexes “wb” and “res” for pressure terms shows their correspondence to a wellbore or
reservoir gridblock, respectively.
4. Conservation of energy across the interface: This condition enforces the conservation of energy
which is being transported by the flow of mass between two mediums. Accordingly, we define the
internal source term in both wellbore and reservoir energy balance equations by
(30)

We should note that the energy transferred between reservoir and wellbore by heat conduction is
represented in the term Qloss in Eqs. 3 and 27.
Wellbore Boundary Conditions. As we explained above, we consider a 1-D grid for the wellbore
model. We state the proper boundary conditions to define the values of the simulation variables at the top
and bottom of the well. Since the flow of mass and energy between wellbore and reservoir are considered
by introducing internal source terms in the wellbore model mass and energy balance equations, we
consider a no flow boundary at the bottom of the well. The no flow boundary at the bottom of the well
is defined by setting the individual phase superficial velocities to zero. These boundary conditions are
given by
(31)

Since the flow through the bottom boundary of the well is zero, no additional condition is needed.
SPE-174749-MS 11

The boundary condition at the top of the well depends on the type of the well (injection or production)
and also on the well control (specified pressure or specified rate). For a producing or an injecting well,
we need the temperature and mole fractions at the wellbore fictitious grid centered at 0, see Fig. 2.

Figure 2—The schematic of the top of the well (wellhead). The wellbore fictitious grid is shown with a long-dashed line.

For a producing well with specified wellhead pressure, the boundary conditions are defined as
following. To define the values of simulation variables for the fictitious grid, we assume a linear change
for pressure, temperature and compositions along the wellbore. This boundary condition is represented by
defining the second derivative of these parameters equal to zero. The pressure of the fictitious grid is
defined by
(32)

where is the wellhead pressure. The boundary conditions for temperature, compositions and phase
volume fractions are defined by
(33)

The values of the above simulation variables for the fictitious grid are defined by
(34)

where m is the temperature or the mole fraction of a component in a phase or a phase volume fraction.
The boundary conditions for the phase velocities follow the linear change assumption. These boundary
conditions and the values of the phase velocities for the staggered grid 1 are defined by
(35)

The wellbore boundary conditions for a producing well with specified wellhead oil rate are defined as
following. To specify the oil rate at the wellhead, the total momentum balance equation of the staggered
grid 1 (centered at wellhead) is replaced with the following equation.
(36)

where qo in bbl/day is the specified oil rate at the wellhead condition. Since the other phase velocities
are obtained by the drift-flux model equations, then no other boundary condition is required for the phase
velocities. The specification of pressure, temperature, phase volume fractions and compositions of the
fictitious grid follows the assumption of linear change of these quantities along the wellbore. These
boundary conditions are the same as the ones given in Eq. 34, where m is the pressure, temperature, mole
fraction of a component in a phase or a phase volume fraction. For a shut-in well, the top boundary of the
12 SPE-174749-MS

wellbore is a no flow boundary. The corresponding boundary conditions for a shut-in well is defined by
setting all the individual phase velocities at the wellhead equal to zero. These boundary conditions are
given in Eq. 37. The definition of the boundary conditions for an injection well are analogous to the ones
presented for the producing wells.
(37)

Solution Algorithm
In our compositional coupled reservoir/welbore simulator, the properties of the hydrocarbon phases and
the fugacity of the components are obtained using the Peng-Robinson equation of state (Peng and
Robinson, 1976). The aqueous phase properties are estimated using the correlations from Wagner and
Pruss (1993) and the fugacity of the dissolved CO2 in the aqueous phase is estimated using correlations
from Harvey (1996).
In this work, we adopt a fully implicit discretization of the equations for both reservoir and wellbore
models. The solution algorithm of the coupled system of equations for the wellbore and reservoir closely
follows the solution algorithm of the compositional reservoir simulators. Among the set of equations of
a wellbore grid, the ncom ⫹ 1 mass balance equations, the total energy balance equation and the total
momentum balance equation relate one wellbore grid to its neighboring gridblocks through the transfer of
mass, energy and momentum between gridblocks. Therefore, these equations are a function of the
simulation variables of the gridblock itself as well as the simulation variables of the neighboring
gridblocks. Similarly, the drift-flux model equations are applied on the boundaries of the wellbore control
volumes and therefore their definitions involve the simulation variables of neighboring gridblocks. The
rest of the equations of a gridblock, including the thermodynamic equilibrium equations and other
constraints, are a function of the simulation variables of only that specific gridblock. The system of the
equations is divided into sets of primary and secondary equations. The set of primary (ncom ⫹ 5) equations
for the wellbore model includes: ncom ⫹ 1 mass balance equations, 1 total energy balance equation, 1 total
momentum balance equation and 2 drift-flux model equations (Eqs. 12 and 13). The set of secondary ncom
⫹ 5 equations includes: ncom ⫹ 1 fugacity equations, 2 mole fraction constraints, 1 phase fraction
constraint and 1 volumetric flux constraint (j). Correspondingly, the set of wellbore variables are divided
into two sets of primary and secondary variables. The set of primary (ncom ⫹ 5) variables includes: ncom
⫺ 2 compositions of the hydrocarbon gas phase (xc,g, c ⫽ 3, . . ., ncom), 2 phase volume fractions (␣o and
␣g), pressure, temperature, 3 superficial velocities for the oil phase (vso), the aqueous phase (vsa), and the
gas phase (vsg). The set of secondary ncom ⫹ 5 variables includes: ncom ⫹ 3 mole fractions
, 1 phase volume fraction (␣a), and the total volumetric flux, j.
In our reservoir simulator, for easier handling of phase appearance and disappearances, we choose a
different set of simulation variables than the set of natural variables explained above. This selected set of
simulation variables for each gridblock includes: ncom overall mole fraction of components in hydrocarbon
phases (zc, c ⫽ 1,. . .,ncom); ncom mole fractions of the liquid hydrocarbon phase (xc,o, c ⫽ 1,. . ., ncom);
mole fraction of CO2 in the aqueous phase ; Lo, Lg and La which are the number of moles of the
oil, gas and aqueous phases per unit pore volume, respectively; the temperature (T); the reference pressure
(p). Lp for a phase (the number of moles of phase p per unit pore volume of a gridblock) is a function of
the saturation and molar density of the phase and its given by
(38)

The overall composition of the component c in hydrocarbon phases is defined by


(39)
SPE-174749-MS 13

Similarly and for the reservoir model, the set of equations and unknowns are divided into sets of
primary and secondary equations and unknowns. The set of primary (ncom ⫹ 2) equations for the reservoir
model includes: ncom ⫹ 1 mass balance equations and 1 total energy balance equation. The set of
secondary ncom ⫹ 3 equations includes: ncom ⫹ 1 fugacity equations, 2 mole fraction constraints and 1
phase fraction constraint. Correspondingly, the set of reservoir simulation variables are divided into two
sets of primary and secondary variables. The set of primary (ncom ⫹ 2) variables includes: ncom — 1
overall compositions of the hydrocarbon phases (zc, c ⫽ 1, . . .,ncom — 1), pressure, temperature and La.
The set of secondary ncom ⫹ 3 variables includes: 1 overall mole fraction mole fractions
corresponding to the composition of the oil phase (xc, o, c ⫽ 1, . . ., ncom), mole fraction of CO2 in the
aqueous phase , and Lg. The formation of the Jacobian of the set of reservoir simulator residual
equations with respect to the set of selected variables follows the implementation of the Chain rule and
using the Eqs. 38 and 39. The details of such computations can be found in Cao (2002).
The system of equations for the coupled wellbore and reservoir models comprises of the primary and
secondary equations of all reservoir and wellbore grids. We write the finite-volume equations and other
constraint equations for each simulation gridblock in the formR ⫽ 0, where R represents the set of residual
simulation equations. The Newton-Raphson algorithm is used to solve for the system of residual
equations. In a Newton-Raphson iteration, first the secondary equations and variables of the reservoir and
wellbore grids are eliminated from the system of equations using the Gaussian elimination. The result will
be a reduced Jacobian matrix with its dimension equal to the number of primary equations of the reservoir
system plus the number of the primary equations of the wellbore system. The details of the Gaussian
elimination operation for eliminating the secondary equations of a compositional reservoir simulator is
given in Cao (2002).
The Newton-Raphson method iteration for a system of equations, RP ⫽ 0, at iteration ᐉ ⫹ 1 is given
by
(40)

where is the vector of reduced residual equations and is the vector of unknowns. The vector
,
(41)

is the vector of updates for the simulation variables at iteration ᐉ ⫹ 1. After solving the system of
reduced primary equations, the secondary variables are solved using the set of secondary equations and
the values of the primary variables. The computation of the secondary variables of reservoir and wellbore
models is sequential and on a grid by grid basis.
In Eq. 42, we show the general structure of the Jacobian of the primary equations of the coupled
reservoir and wellbore models which is obtained by implementing the Gaussian elimination to eliminate
the secondary equations of the reservoir and wellbore. In this equation, RP is the vector of reduced
residuals corresponding to the set of primary equations of the reservoir and wellbore grids, and mP is the
vector of primary variables of the reservoir and wellbore models.
14 SPE-174749-MS

(42)

ng and nwg are the number of reservoir gridblocks and the number of wellbore grids, respectively. In
Eq. 42, ARij is the matrix which represents the Jacobian of the primary equations of reservoir gridblock
i with respect to the primary simulation variables of reservoir gridblock j; is the matrix representing
the Jacobian of the primary equations of wellbore grid i with respect to the primary simulation variables
of wellbore grid j; is the matrix that represents the Jacobian of the primary equations of reservoir
gridblock k with respect to the primary simulation variables of wellbore block kw; and is the
matrix representing the Jacobian matrix of the primary equations of wellbore grid kw with respect to the
primary simulation variables of reservoir gridblock k. Note that all these matrices are obtained by
performing the reduction step on the Jacobian of the full set of equations of the coupled wellbore/reservoir
system in order to reduce it to a Jacobian for the system of only primary equations and variables. The
Jacobian sub-matrix is nonzero only if these two gridblocks are connected. Similarly, the Jacobian
sub-matrix is nonzero only if these two grids are connected (adjacent). The Jacobian sub-matrices
and are nonzero only if the reservoir gridblock k and wellbore grid kw are connected
through a well perforation.
The procedure for doing one time step of the compositional simulation is shown in Fig. 3. At the
beginning of the time step, all the simulation variables are known for every reservoir and wellbore grid,
i.e., the pressure, temperature, phase volume fractions and compositions of both reservoir and wellbore
gridblocks as well as the phase superficial velocities for wellbore grids are known. For the first time step,
these variables are determined from an initialization routine whereas in a later time step, the solution of
the previous time step is used. Based on the phases which are present in a gridblock, the set of variables
are chosen for each simulation grid (wellbore and reservoir) and the Jacobian of the system is formed.
Then the Gaussian elimination ia applied to reduce the full Jacobian matrix to the Jacobian matrix of the
primary variables. This reduced system of equations are solved for primary variables using a linear solver.
Once the primary variables are computed, the secondary variables are updated accordingly. Then, the
stability/flash calculations are performed for every gridblock of the reservoir and wellbore in order to
make sure that the phases which are currently present in the gridblock are thermodynamically stable at the
given pressure and temperature. This procedure, shown in Fig. 3, is repeated until the convergence of the
Newton-Raphson iteration is achieved. If the convergence is not achieved within the specified maximum
number of Newton iterations, then the time step size is cut in half and the process is repeated until
convergence.
SPE-174749-MS 15

Figure 3—The procedure for doing one time step of the compositional simulation.

The flowchart showing the stability/flash calculation steps in our simulator is shown in Fig. 4. The
implementation of stability/flash calculations in our work follows the ones presented in Michelsen
(1982a,b). We are considering the presence of at most two hydrocarbon phases inside a simulation
gridblock which are a liquid hydrocarbon phase (oil phase) and a gaseous hydrocarbon phase (gas phase).
For all two-phase gridblocks, we check for the disappearance of the phase during each Newton iteration.
For a reservoir gridblock, if the updated value of the variable corresponding to the number of moles of
a phase, Lo or Lg, is negative, then the corresponding phase has disappeared and the updated status of the
reservoir gridblock is single-phase. Similarly for a wellbore grid, if the phase volume fraction, ␣o or ␣g,
corresponding to a phase is negative, then the corresponding phase has disappeared and the updated status
of the wellbore grid is single phase. In such cases, the phase that has disappeared is recombined with the
present phase inside the grid (using Eq. 39) in order to obtain the overall composition of the single phase.
If none of the hydrocarbon phases of a two-phase gridblock disappeared, then there is no further
flash/stability analysis for this gridblock. For a single-phase gridblock, we check the stability of the phase
at the updated pressure, temperature and composition. If a phase is thermodynamically unstable, then a
flash calculation is performed to determine the number of moles and compositions of the appearing gas/oil
phase.
16 SPE-174749-MS

Figure 4 —The steps of the stability/flash calculations.

Computational Results
Example 1: Wellbore Model Validation by the Shock Tube Problem. The first computational example
is designed to benchmark the formulation of our wellbore model. We consider the 1-D shock tube
problem, a well known gas dynamic problem with a known analytical solution, which we use to compare
with our simulation results. The details of the shock tube problem and its analytical solution is given in
Anderson (2003); Emanuel (1986). The schematic of the shock tube problem we consider here is given
in Fig. 5. The problem consists of a tube initially filled with two quiescent gasses which are separated by
a diaphragm. The two gasses have different pressures initially but have similar temperature and compo-
sitions. After the diaphragm ruptures, the shock wave propagates into the low pressure region and the
reflection waves propagate into the high pressure region.

Figure 5—The schematic of the shock tube problem.

To use the coupled wellbore/reservoir simulator for modeling the shock tube problem, we consider that
the wellbore model is isolated from the reservoir model, i.e., there is no flow between the wellbore and
reservoir models, and the wellhead is set to no flow condition (shut-in well). The wellbore model for the
shock tube problem is horizontal, frictionless and single phase gas. Here we consider a gas mixture of C1
and C2 with the overall mole fractions of 0.9 and 0.1, respectively. The specific settings of the shock tube
SPE-174749-MS 17

problem investigated here is given in Table 1. The initial temperature and pressure of the system is chosen
so that the condition of the problem is close to an ideal gas condition.

Table 1—The shock tube problem settings.


Initial Condition
LHS pressure (pLHS), psi 40
RHS pressure (pRHS), psi 20
LHS and RHS temperature (TLHS ⫽ TRHS), °F 60
LHS and RHS velocity (vLHS ⫽ vRHS), ft/sec 0
LHS and RHS composition of C1 and C2 ({zLHS} ⫽ {zRHS}) (0.9,0.1)

Tube Specifications
Length, ft 4
Diameter, ft 0.1
Inclination angel, degrees 90 (horizontal)
x location of the diaphragm, ft 2

Numerical Settings
No. of grids 1000
No. of time steps 1000
Time step length, sec 10⫺6

The model is run for 1000 time steps which is corresponding to the total simulation time of 10⫺3
seconds at which we compare the pressure, temperature and velocity profiles along the tube with their
corresponding analytical solutions. The analytical solution for this problem, given in Anderson (2003), is
based on an ideal gas assumption and it requires the value of the specific heat capacity ratio of the gas,
. Here we computed the specific heat capacity ratio of the mixture gas as a weighted average of the
specific heat capacity ratios of Methane, C1, and Ethane, C2, and it is equal to ␥ ⫽ 1.2838. Figs. 6, 7 and
8 show the profiles of pressure, temperature and gas velocity along the tube at t ⫽ 10⫺3 seconds. Despite
some numerical diffusion in our results, the numerical solution is in perfect agreement with the analytical
solution of the problem. These results validate our formulation of the wellbore including the coupling of
the mass, momentum and energy balance equations.

Figure 6 —Pressure profile at t ⴝ 10ⴚ3 seconds for the shock tube problem.
18 SPE-174749-MS

Figure 7—Temperature profile at t ⴝ 10ⴚ3 seconds for the shock tube problem.

Figure 8 —Velocity profile at t ⴝ 10ⴚ3 seconds for the shock tube problem.

Example 2: Oil Reservoir Well Testing. For the second example, we consider modeling a drawdown/
buildup test of a single-layer oil reservoir in order to validate the formulation of our reservoir and wellbore
models. The reservoir model has a radial gridding (Jr and Aziz, 1986) with 50 radial gridblocks and the
inner and outer radii of the model are 0.5 and 104 ft, respectively. The thickness of the reservoir is 100
ft. The reservoir model has homogeneous porosity of 0.2, and homogeneous isotropic permeability of 50
md. The endpoint relative permeability of oil at irreducible water saturation (Swirr ⫽ 0.2) is equal to 0.8.
The reservoir properties including the initial reservoir pressure, temperature, water saturation and fluid
composition are given in Table 2.
SPE-174749-MS 19

Table 2—The properties of the reservoir in Example 2.


Reservoir properties Composition

Property Value Component Mole fraction Component Mole fraction

Reservoir depth (ft) 9950 CO2 9.1 ⫻ 10⫺3 NC5 1.41 ⫻ 10⫺2
Pressure (psi) 5500 N2 1.6 ⫻ 10⫺3 FC6 4.33 ⫻ 10⫺2
Temperature (°F) 180 C1 3.647 ⫻ 10⫺1 FC9 1.32 ⫻ 10⫺1
Water saturation 0.2 C2 9.67 ⫻ 10⫺2 FC15 7.57 ⫻ 10⫺2
Thickness (ft) 100 C3 6.95 ⫻ 10⫺2 FC16 5.1 ⫻ 10⫺2
Porosity 0.2 IC4 1.44 ⫻ 10⫺2 FC30 3.15 ⫻ 10⫺2
Permeability (md) 50 NC4 3.93 ⫻ 10⫺2 FC45 4.27 ⫻ 10⫺2
kro at So ⫽ 0.8 0.8 IC5 1.44 ⫻ 10⫺2 - -

In order to simulate the damage zone around the well, we alter the permeability of 5 radial girdblocks
around the well (rs ⫽ 1.346 ft) from 50 md to 5 md. The resulted skin from the Hawkins formula
(Hawkins, 1956) is equal to
(43)

where, kres and ks are the reservoir radial permeability and the skin zone permeability, respectively; and
rs and rw are the radius of the skin zone and the radius of the well, respectively.
The total length of the wellbore is 10,000 ft and it is discretized into 100 gridblocks of 100 ft. The
wellbore radius is equal to 0.5 ft for the length of the wellbore. The wellbore model is connected to the
reservoir model at its bottom grid where we measure the pressure for the drawdown and buildup tests. The
wellbore model is initialized with a constant composition and gravity equilibrium, where all the wellbore
grid compositions are set equal to the initial reservoir composition given in Table 2. The temperature
profile along the wellbore is initialized using the initial reservoir temperature and the geothermal gradient
of 1 °F/(100 ft). The initial pressure profile along the wellbore is computed sequentially from bottom to
the top of the wellbore. The initial pressure of the bottom grid is set equal to the initial reservoir pressure
and the initial pressure of the other wellbore grids are computed using the density of the wellbore fluid.
In this example, we do not consider the heat gain/loss through the casing. This is done by setting the value
of Ut in Eq. 4 equal to zero.
The well test schedule comprises of a production period of 2 days with the specified wellhead rate of
1000 bbl/day and it is followed by a shut-in period of 3 days. The downhole pressure (the pressure of the
wellbore grid 100) is measured during both drawdown and buildup periods. We should note that the fluid
in the wellbore and reservoir always stay single phase throughout the test. Next, we use these pressure data
to estimate the permeability of the reservoir and the well skin factor which is presented in the following.
Fig. 9 shows the diagnostic plot of the drawdown test. One observation in this plot is the very clear
wellbore storage effect captured by the wellbore model. The characteristic of the wellbore storage in a
diagnostic plot is the unit slope of both pressure and pressure derivative curves in the log-log plot. The
sandface rate during the drawdown period is plotted in Fig. 10.
20 SPE-174749-MS

Figure 9 —The diagnostic plot of the drawdown test.

Figure 10 —Sandface rate during the drawdown test.

The signature of the transient radial flow is a stabilized constant value of pressure derivative. However,
the pressure derivative in Fig. 9 is not constant for the time period after 1 hr which corresponds to the
transient radial flow. The reason is that the sandface production rate is still slightly changing; see Fig. 10.
In the early times after 1 hr, the slight variations in the production rate is mainly due to the remaining
effects of the wellbore storage. However towards the end of the flow period, there is another reason for
altering the sandface rate. The warmer fluid from the reservoir reaches the wellhead towards the end of
the flow period and this changes the condition (temperature) of the wellhead. Since the rate of the well
is specified at the wellhead condition, the change in the wellhead temperature alters the density of the fluid
and consequently the sandface production rate will change; see Fig. 10 for flow times after 10 hours. To
correct for the variations in the production rate of the well, we construct the diagnostic plot of the
drawdown test by plotting the and its derivative instead of the pressure. The corrected diagnostic plot
for the transient radial flow period of the drawdown test q is given in Fig. 11. The flat derivative clearly
shows the transient radial flow.
SPE-174749-MS 21

Figure 11—The modified diagnostic plot of the drawdown test.

Next we compute the reservoir permeability and the well skin factor using the drawdown test data. The
permeability of the reservoir is computed by
(44)

where, ␮ ⫽ 0.166 cp is the viscosity of oil at reservoir condition, h ⫽ 100 ft is the reservoir thickness,
kro ⫽ 0.8 is the relative permeability of oil at irreducible water saturation, and m= is the value of the
derivative in the data in the diagnostic plot given in Fig. 11. Note that the value of the permeability
estimated from well testing is in an excellent agreement with the specified reservoir permeability (50 md).
The total compressibility of the reservoir is equal to
(45)

The skin factor computed from the drawdown test is equal to


(46)

which is also in an excellent agreement with the true skin of the well which is 8.91.
The drawdown test is followed by a buildup test which lasts for 3 days. Fig. 12 shows the diagnostic
plot of the buildup test, which is the plot of the pressure buildup and the derivative of the pressure buildup
with respect to the equivalent shut-in time in a log-log scale. Similarly, the wellbore storage effect and also
the positive skin factor of the well are apparent from this diagnostic plot. The sandface rate during the
shut-in period is shown in Fig. 13 and clearly shows the wellbore storage effect.
22 SPE-174749-MS

Figure 12—The diagnostic plot of the buildup test.

Figure 13—Sandface rate during the buildup test.

In the following, we present the analysis of the buildup data for estimation of reservoir permeability
and the well skin factor. The zero slope line of the pressure derivative in the diagnostic plot shown in Fig.
12 corresponds to the transient radial flow. The estimated permeability and skin factor from the buildup
test are
(47)

and
(48)

In Eqs. 47 and 48, m corresponds to the value of the derivative of the pressure drop for the transient
radial period. It is important to note that in Eq. 47, we used the value of the rate at the instant of shut-in
SPE-174749-MS 23

at reservoir condition (957.1 bbl/day) which is different than the specified rate at the wellhead condition
(1000 bbl/day); see Fig. 10.
The summary of the estimated permeability and skin factor from both drawdown and buildup tests are
presented in Table 3. The computed values for permeability and skin factor are in an excellent agreement
with the true values.

Table 3—The summary of the estimated permeability and skin factor from both drawdown and buildup tests.
True value Drawdown test analysis Buildup test analysis

Permeability, md 50.00 49.58 49.42


Skin 8.91 8.96 8.86

Example 3: Production from a Volatile Oil Reservoir. In this example, we consider modeling
production from a multi-layer volatile oil reservoir. The schematic of the reservoir and wellbore model is
given in Fig. 14. The reservoir model has a radial gridding with 50 radial gridblocks and 5 simulation
layers. The inner and outer radii of the model are 0.5 and 104 ft, respectively, and the thickness of the
reservoir is 5 ⫻ 100 ⫽ 500 ft. The depth of the top of the reservoir (the top of the first simulation layer)
is 9500 ft. The reservoir has a homogenous porosity of 0.1. Each simulation layer has homogeneous
permeability, and the horizontal permeability of simulation layers 2, 3,4 and 5 are 20, 10, 50, 30 and 40
md, respectively. The vertical permeability of each layer is 0.1 times its horizontal permeability.

Figure 14 —The schematic of the reservoir and wellbore model in Example 3.

The reservoir is initialized based on a capillary-gravity equilibrium approach for the initial water
saturation and the compositional gradient approach for the initial composition and pressure. The pressure
and temperature at the reference depth of 10,000 ft are given by 5500 psi and 180 °F, respectively. The
initial temperature of the reservoir is initialized using the geothermal gradient of 1 °F/(100 ft). The initial
pressure and the initial composition of the simulation gridblocks are initialized using a compositional
gradient approach (Faissat et al., 1994; Høier and Whitson, 2001). The saturation of the aqueous phase is
initialized based on the gravity-capillary equilibrium. The reservoir properties including the depth of
24 SPE-174749-MS

water-oil contact, and the reference depth pressure and temperature are given in Table 4. The composition
of the reservoir fluid at the reference depth is given in Table 5. The aqueous phase - oil phase and the
liquid phase - gas phase relative permeability and capillary pressure curves are given in Fig. 15. The
capillary pressure for the gas phase is set to zero.

Table 4 —The properties of the reservoir in Example 3.


Property Value

Reservoir reference depth (ft) 10,000


Reference pressure (psi) 5500
Reference temperature (°F) 180
WOC depth (ft) 10,000
Geothermal gradient (°F/100 ft) 1
Porosity 0.1
Horizontal permeability of layers 1,2,3,4,5 (md) 20, 10, 50, 30, 40

Table 5—The composition of the reservoir fluid at the reference


depth in Example 3.
Component Mole fraction Component Mole fraction

N2 1.02 ⫻ 10⫺2 NC5 1.26 ⫻ 10⫺2


CO2 2.30 ⫻ 10⫺3 FC6 1.92 ⫻ 10⫺2
C1 5.48 ⫻ 10⫺1 C07-C10 7.90 ⫻ 10⫺2
C2 8.30 ⫻ 10⫺2 C11-C13 4.73 ⫻ 10⫺2
C3 4.48 ⫻ 10⫺2 C14-C17 3.63 ⫻ 10⫺2
IC4 9.97 ⫻ 10⫺3 C18-C21 2.59 ⫻ 10⫺2
NC4 2.29 ⫻ 10⫺2 C22-C26 1.75 ⫻ 10⫺2
IC5 8.44 ⫻ 10⫺3 C27⫹ 3.25 ⫻ 10⫺2

Figure 15—The aqueous phase - oil phase and the liquid phase - gas phase relative permeability and capillary pressure curves.
SPE-174749-MS 25

The reservoir is only perforated at layer three. Accordingly, we discretize the length of the wellbore
into 98 grids of length 100 ft, where the wellbore grid 98 is connected to the third reservoir layer. The
temperature, pressure and composition of wellbore grid 98 is set equal to the ones of the reservoir
gridblock perforated by the well in the third simulation layer. The initialization of the wellbore follows
the procedure explained in the Example 2, which is based on the constant composition for the wellbore
fluid. We also consider the geothermal gradient of 1 °F/(100 ft) for assigning the initial temperature of the
wellbore grids. However and similar to Example 2, we neglect the heat gain/loss through the casing, which
is done by setting the value of Ut in Eq. 4 equal to zero.
We run the coupled reservoir/wellbore model for 10,000 days where the specified well control is the
constant oil production rate of 5000 bbl/day at the wellhead condition. Figs. 16a and 16b show the changes
in the aqueous phase and the gas phase saturations of the reservoir gridblocks adjacent to the well in layers
1 through 5, respectively. Figs. 17a and 17b show the spatial profiles of the aqueous phase and the gas
phase saturations of layers 1 through 5 at 10,000 days. The initial values for the water saturation shown
in Fig. 16a is obtained by the initialization of the reservoir model according to the capillary-gravity
equilibrium. As shown in this figure, the initial water saturation in each of the top three layers of the
reservoir is equal to the connate water saturation (0.2). By producing from the reservoir, we clearly see
the water is moving up and toward the perforated layer (water coning); see also Fig. 17a. From Fig. 16b,
we see that the gas appears as the reservoir pressure falls below its bubble point pressure around the
perforation of the well. As the production continues and the reservoir pressure drops, more gas is being
released from the reservoir fluid, starting from the top layers of the reservoir; see Fig. 17b.
26 SPE-174749-MS

Figure 16 —The changes in the aqueous phase and the gas phase saturations of the reservoir gridblocks adjacent to the well in layers
1 through 5.
SPE-174749-MS 27

Figure 17—The spatial profiles of the aqueous phase and the gas phase saturations of reservoir layers 1 through 5 at 10,000 days.

The aqueous phase, and the oil and gas phase rates at the sandface are shown in Fig. 18. Initially only
the oil phase is being produced as the well is perforated in layer 3 which is initially at the irreducible water
saturation. The wellbore storage effect can also be observed in this figure. After some production time,
water raises to the third layer of the reservoir and the perforation starts producing water. Once the pressure
of the reservoir falls below the saturation pressure of the reservoir fluid, the perforation starts to produce
gas. The production rates of the phases at the wellhead are shown in Fig. 19. Note that the oil rate is
specified and equal to 5000 bbl/day and since at the wellhead condition the pressure is below the bubble
point pressure of the reservoir fluid, the well produces gas from the onset of production. However, the
production of water in the well starts shortly after the water reaches the well perforation in layer 3.
28 SPE-174749-MS

Figure 18 —The aqueous phase, and the oil and gas phase rates at sandface.

Figure 19 —The aqueous phase, and the oil and gas rates at wellhead.

Figs. 20a and 20b shows the profiles of aqueous and gas phase saturations at wellbore grids of 98
(bottomhole grid), 90, 50 and 1 (wellhead grid). Note that we initialize the wellbore grids by assigning
an initial aqueous phase saturation of 0.001. After 3 days ofproduction, the well perforation starts
producing some water and this small amount of water reaches the wellhead after about 80 days; see Fig.
20a. Moreover, the well produces gas at the wellhead from the onset of production, however, the gas phase
does not appear in the bottomhole grid until around 1000 days after production; see Fig. 20b. In Fig. 21
the bottomhole and wellhead pressure of the well are plotted versus the production time.
SPE-174749-MS 29

Figure 20 —The profiles of the aqueous and the gas phase saturations at wellbore grids 98 (bottomhole grid), 90, 50 and 1 (wellhead
grid).

Figure 21—The plot of bottomhole and wellhead pressures versus the production time.
30 SPE-174749-MS

Summary and Conclusions


In this paper we presented the detailed formulation of a thermal compositional coupled wellbore/reservoir
simulator. The formulation and implementation of the wellbore model is validated against the analytical
solution for the shock tube problem. The reservoir simulator formulation and implementation is validated
through a single phase well testing example. In example 3, we consider the simulation of production from
a volatile oil reservoir and the water coning process, where the appearance of the gas phase in both
wellbore and reservoir, due to the production from the reservoir, has been captured.

References
Gabor Acs, Sandor Doleschall, and Eva Farkas. General purpose compositional model. SPE Journal,
25(4):543–553, 1985
R. A. Almehaideb, K. Aziz, and O. A. Pedrosa, Jr. A reservoir/wellbore model for mutiphase injection
and pressure transient analysis. In Proceedings of the Proceedings of the SPE Middle East
Technical Conference and Exhibition, 1989
M. Amara, D. Capatina, and L. Lizaik. Numerical coupling of petroleum wellbore and reservoir
models with heat transfer. In Proceedings of the European Conference on Computational Fluid
Dynamics ECCOMAS CFD 2006, 2006
M. Amara, D. Capatina, and L. Lizaik. Coupling of Darcy-Forchheimer and compressible Navier-
Stokes equations with heat transfer. SIAMJ. Sci. Comput., 31(2):1470 –1499, January 2009. ISSN
1064-8275.
John D. Anderson. Modern Compressible Flow. McGraw-Hill, 3rd edition, 2003
K. Aziz and A. Settari. Petroleum Reservoir Simulation. Applied Science Publishers Ltd., 1979
M. Bahonar, J. Azaiez, and Z. Chen. Transient nonisothermal fully coupled wellbore/reservoir model
for gas-well testing, part 1: Modelling. Journal of Canadian Petroleum Technology, pages 37–50,
September/October 2011a
M. Bahonar, J. Azaiez, and Z. Chen. Transient nonisothermal fully coupled wellbore/reservoir model
for gas-well testing, part 2: Applications. Journal of Canadian Petroleum Technology, pages
51–70, September/October 2011b
Gordon S. Beavers and Daniel D. Joseph. Boundary conditions at a naturally permeable wall. Journal
of Fluid Mechanics, 30:197–2007, 1967
D. H. Beggs and J. P. Brill. A study of two-phase flow in inclined pipes. Journal of Petroleum
Technology, 25:607–617, 1973
Hui Cao. Development of Techniques for General Purpose Simulators. PhD thesis, Stanford Univer-
sity, Stanford, California, USA, 2002
M. C. H. Chien, S. T. Lee, and W. H. Chen. A new fully implicit compositional simulator. In
Proceedings of SPE Reservoir Simulation Symposium, 10-13 February 1985, Dallas, Texas, 1985
Keith H. Coats. An equation of state compositional model. SPE Journal, 20(5):363–376, 1980
Marco Discacciati, Edie Miglio, and Alfio Quarteroni. Mathematical and numerical models for
coupling surface and groundwater flows. Applied Numerical Mathematics, 43(12):57–74, 2002
George Emanuel. Gasdynamics: Theory and Applications. AIAA Education Series, 1986
B. Faissat, K. Knudsen, E.H. Stenby, and F. Montel. Fundamental statements about thermal diffusion
for a multicomponent mixture in a porous medium. Fluid phase equilibria, 100:209 –222, 1994
Juan Galvis and Marcus Sarkis. Balancing domain decomposition methods for mortar coupling
stokes-darcy systems. In Olof B. Widlund and David E. Keyes, editors, Domain Decomposition
Methods in Science and Engineering XVI, volume 55 of Lecture Notes in Computational Science
and Engineering, pages 373–380. Springer Berlin Heidelberg, 2007. ISBN 978-3-540-34468-1.
SPE-174749-MS 31

T. L. Gould. Compositional two-phase flow in pipelines. Journal of Petroleum Technology, pages


373–384, March 1979
Allan H. Harvey. Semiempirical correlation for henry’s constants over large temperature ranges. Ind.
Eng. Chem. Fundamen, 42: 1491–1494, 1996
A. R. Hasan and C. S. Kabir. Heat transfer during two-phase flow in wellbores:part I-formation
temperature. In Proceedings of the 1991 SPE Annual Technical Conference and Exibition Held in
Dallas, TX, 6-9 October 1991, 1991
A. R. Hasan and C. S. Kabir. Wellbore heat-transfer modeling and applications. Journal of Petroleum
Science and Engineering, 8687 (0):127–136, 2012. ISSN 0920-4105.
R. Hasan, C. S. Kabir, and X. Wang. Development and application of a wellbore/reservoir simulator
for testing oil wells. SPE Formation Evaluation, pages 182–188, September 1997
Rashid Hasan and C. Shah Kabir. A simplified model for oil/water flow in vertical and deviated
wellbores. SPE Production and Facilities, 14(1), February 1999
M. F.Jr. Hawkins. A note on the skin effect. Trans. AIME, 207:356 –357, 1956
Takashi Hibiki and Mamoru Ishii. One-dimensional drift-flux model and constitutive equations for
relative motion between phases in various two-phase flow regimes. International Journal of Heat
and Mass Transfer, 46(25):4935–4948, 2003
Lars Høier and C. H. Whitson. Compositional grading-theory and practice. SPE Reservoir Evaluation
& Engineering, 4(6):525–535, 2001
Hu, J. Sagen, G. Chupin, T. Haugset, A. Ek, T. Sommersel, Z. G. Xu, and J. C. Mantecon. Integrated
wellbore/reservoir dynamic simulation. In Proceedings of the SPE Asia Pacific Oil & Gas
Conference and Exhibition, 2007
M Ishii. One-dimensional drift-flux model and constitutive equations for relative motion between
phases in various two-phase flow regimes. Technical report, Argonne National Lab., 1977
Izgec, C. S. Kabir, D. Zhu, and A. R. Hasan. Transient fluid and heat flow modeling in coupled
wellbore/reservoir systems. SPE Reservoir Evaluation & Engineering, pages 294 –301, June 2007
Oswaldo A. Pedrosa Jr and Khalid Aziz. Use of a hybrid grid in reservoir simulation. SPE Reservoir
Engineering, 1(06):611–621, 1986
K. Khadivi, M. Soltanieh, and F. A. Farhadpour. A coupled wellborereservoir flowmodel for
numerical pressure transient analysis in vertically heterogeneous reservoirs. Journal of Porous
Media, 16(5):395–409, 2013
S. Krogstad and L. J. Durlofsky. Multiscale mixed-finite-element modeling of coupled wellbore/near-
well flow. In Proceedings of the SPE Reservoir Simulation Symposium, 2007
William J. Layton, Friedhelm Schieweck, and Ivan Yotov. Coupling fluid flow with porous media
flow. SIAM Journal on Numerical Analysis, 40(6), 2003
D. Li and T. W. Engler. Literature review on correlations of the non-Darcy coefficient. In Proceedings
of Basin Oil and Gas Recovery Conference, 15-16 May 2001, Midland, Texas, 2001
S. Livescu, L. J. Durlofsky, K. Aziz, and J. C. Ginestra. Application of a new fully coupled thermal
multiphase wellbore flow model. In Proceedings of the SPE/DOE Improved Oil Recovery
Symposium, 2008.
S. Livescu, K. Aziz, and L. J. Durlofsky. Development and application of a fully coupled thermal
compositional wellbore flow model. In Proceedings of the SPE Western Regional Meeting, 2009
S. Livescu, L. J. Durlofsky, K. Aziz, and J. C. Ginestra. A fully-coupled thermalmultiphase wellbore
flowmodel for use in reservoir simulation. Journal of Petroleum Science and Engineering,
71:138 –146, 2010
Michael L. Michelsen. The isothermal flash problem. part i. stability. Fluid Phase Equilibria,
9(1):1–19, 1982a
32 SPE-174749-MS

Michael L. Michelsen. The isothermal flash problem. part ii. phase-split calculation. Fluid Phase
Equilibria, 9(1):21–40, 1982b
L. Pan and C. M. Oldenburg. T2well-an integrated wellbore-reservoir simulator. Computers &
Geosciences, 65:46 –55, 2014
D. W. Peaceman. Interpretation of well block pressures in numerical reservoir simulation. SPE
Journal, 18(6):183–194, 1978
D. W. Peaceman. Interpretation of well-block pressures in numerical reservoir simulation with
non-square grid blocks and anisotropic permeability. SPE Journal, 23(6):531–543, 1983
Ding-Yu Peng and Donald B. Robinson. A new two-constant equation of state. Ind. Eng. Chem.
Fundamen, 15:59 –64, 1976
P. Pourafshary, A. Varavei, K. Sepehrnoori, and A. Podio. A compositional wellbore/reservoir
simulator to model multiphase flow and temperature distribution. Journal of Petroleum Science
and Engineering, 69:40 –52, 2009.
P. Saffman. On the boundary condition at the surface of a porous media. Stud. Appl. Math., 50:93–101,
1971.
H. Shi, J. A. Holmes, L. J. Durlofsky, K. Aziz, L. R. Diaz, B. Alkaya, and G. Oddie. Drift-flux
modeling of two-phase flow in wellbores. SPE Journal, 10(1), March 2005
Mahdy Shirdel and Kamy Sepehrnoori. Development of a coupled compositional wellbore/reservoir
simulator for modeling pressure and temperature distribution in horizontal wells. In Proceedings
of SPE Annual Technical Conference and Exhibition, 4-7 October, New Orleans, Louisiana, 2009
T. W. Stone, N. R. Edmunds, and B. J. Kristoff. A comprehensive wellbore/reservoir simulator. In
Proceedings of the SPE Symposium on Reservoir Simulation, 1989.
W. Wagner and A. Pruss. International equations for the saturation properties of ordinary water
substance. revised according to the international temperature scale of 1990. J. Phys. Chem. Ref.
Data, 22:783–787, 1993
P. Wang, I. Yotov, M. Wheeler, T. Arbogast, C. Dawson, M. Parashar, and K. Sepehrnoori. A new
generation eos compositional reservoir simulator: Part i - formulation and discretization. In
Proceedings of the SPE Reservoir Simulation Symposium, 8-11 June, Dallas, Texas, 1997
J. W. Watts. A compositional formulation of the pressure and saturation equations. SPE Reservoir
Engineering, 1(3):243–252, 1986
N. Zuber and J. A. Findlay. Average volumetric concentration in two-phase flow systems. Journal of
Heat Transfer, 87(4):453–468, 1965

You might also like