Documente Academic
Documente Profesional
Documente Cultură
GRADUATE COLLEGE
A THESIS
degree of
MASTER OF SCIENCE
(Petroleum Engineering)
By
Oluseyi Harris
Norman, Oklahoma
2004
EVALUATION OF EQUIVALENT CIRCULATING DENSITY OF
CONDITIONS
ENGINEERING
BY
Chair:
Dr. Samuel Osisanya
Member:
Dr. Subhash Shah
Member:
for Dr. Samuel Osisanya. His guidance, moral and financial support, and
encouragement were invaluable. The author would like to thank the members
Djebbar Tiab for their helpful comments and suggestions. Heartfelt thanks go
to Dr. Subhash Shah for his assistance in allowing use of WCTC facilities in
performing research for this thesis. The author wishes to extend special
The author wishes to thank his other half, Lola for always being there.
The author would also like to express immeasurable gratitude towards his
parents for their constant and unwavering support and faith. Last and most
importantly, thanks and praise are extended to God almighty who alone
Oluseyi Harris
Norman, Oklahoma
July, 2004
iv
TABLE OF CONTENTS
PAGE
ACKNOWLEDGEMENTS ..............................................................................iv
LIST OF FIGURES.........................................................................................ix
ABSTRACT....................................................................................................xi
CHAPTER PAGE
v
2.5.5 Ellis Model .....................................................................................31
2.5.6 Carreau Model...............................................................................32
2.6 Temperature and Pressure Dependent Rheological Parameters.......33
2.6.1 Temperature/Pressure Dependent Plastic Viscosity....................33
2.6.2 Temperature Dependent Yield point..............................................35
2.7 Bingham Plastic Pressure Loss Equations......................................36
vi
4.3.3 Equivalent Hydrostatic Head and ECD ........................................84
4.4 Model Validation..............................................................................84
4.5 Dynamic Density Estimation............................................................91
Summary..................................................................................................107
NOMENCLATURE ......................................................................................112
REFERENCES ............................................................................................115
APPENDIX ..................................................................................................119
Code for DDSimulator Program ...............................................................119
vii
LIST OF TABLES
TABLE PAGE
4.1 : Well and mud circulating properties for a gulf coast well…………….85
4.4 : Well simulation results for parameters detailed in Table 4.2 with
gG = 0.015 oF/ft……………………………….……………..……….…..96
4.5 : Well simulation results for parameters detailed in Table 4.2 with
gG = 0.025 oF/ft………………………………………………….….……96
4.6 : Well simulation results for parameters detailed in Table 4.2 with
4.7 : Well simulation results for parameters detailed in Table 4.2 with
viii
LIST OF FIGURES
FIGURE PAGE
ix
4.11 : Well Temperature Profile While Circulating Field Salt Water………89
x
ABSTRACT
compression. Failure to take these two opposing effects into account can lead
pressure dependent rheological behavior of the drilling fluids studied, with the
developed using visual basic to simulate the wellbore during circulation. This
profile.
xi
From the results of the DDSimulator, it was found that the geothermal
gradient has a great effect on the bottom-hole temperature and pressure, and
was also found that the inlet pipe temperature did not have a significant effect
on the bottom-hole temperature and pressure. This is even more the case in
deep wells, and in areas with high geothermal gradient. The circulation rate
plays an important role in the bottom-hole temperature and pressure that will
DDSimulator. The density and rheological properties of the drilling fluid in the
bottom-hole pressure taking into account the variation in the volumetric and
rheological properties of the drilling fluid under high temperature and high
pressure conditions in the wellbore. The effects of variation in the inlet fluid
xii
Chapter 1
1.1. Introduction
various types of base fluids and chemical additives that must remain stable
complex mixtures, such as equivalent static density (ESD) and the rheological
properties of the fluid mixture determine pressure losses in the system while
drilling. It is often assumed that these properties and thus the equivalent
activities. This assumption can prove to be quite wrong in cases where there
the mud column. These two factors have opposing effects on equivalent
1
these two effects cancel each other out. This is not always the case,
encountered in the riser, near the ocean bed. In deepwater wells1, the seabed
of the riser will be 2700 psi, with a mud density of 8.6 lb/gal and a water depth
6000-ft. The low temperature conditions can cause severe gelling of the
drilling fluid, especially in oil-base muds (OBM). Failure to take this effect into
especially disastrous effect when drilling through formations with a small gap
between pore pressure, and the pressure at which the formation will fracture.
In such cases, the margin for error is very small and thus, the equivalent
temperature effects in this case can lead to greater probability for the
overbalance pressure.
such as viscosity and yield stress affect frictional pressure losses during the
2
flow of drilling fluids. Failure to take into account the dependence of these
erroneous values for equivalent circulating density, which takes into account
the hydrostatic head of the drilling fluid as well as the pressure loss it
assumed that any change in density is due to density changes in the liquid
interactions between the solid and liquid phases in the drilling fluid, or that the
3
solid phase is inert. Hoberock et al4 proposed the following compositional
ρ o1 f vo + ρ w1 f vw + ρ s f vs + ρ c f vc
ρ (P2 , T2 ) = (1.1)
⎛ρ ⎞ ⎛ρ ⎞
1 + f vo ⎜⎜ o1 − 1⎟⎟ + f vw ⎜⎜ w1 − 1⎟⎟
⎝ ρ o2 ⎠ ⎝ ρ w2 ⎠
where,
f vo, fvw, fvs, fvc = fractional volume of oil, water, solid weighting
how the densities of each liquid phase in the mud, usually water and some
4
based drilling fluids. In their study, they measured the density of the individual
with Hoberock et al’s compositional model, they were able to predict the
The model predictions yielded an error of <1% over the range of temperature
for use with the compositional model with some success. Kutasov8 analyzed
equation, which was reported to yield very low error in predicting water
describe the volumetric behavior of the liquid phases in drilling fluids, which is
o
applicable in the range of 14.5-20,000 psi and 60-400 F. This model
characterizes the volumetric behavior of the liquid phases in the drilling fluid
assumes that all volumetric changes in the drilling fluid is due to the liquid
5
Kutasov8 proposed an empirical equation of state (EOS) model for
relationship. As is the case for the compositional model, mud density using
standard conditions (p= 14.7 psi, T = 60 oF). He applied the equation of state
proposed by Sorelle et al4 and Kutasov8 respectively, and the empirical model
OBM’s formulated using diesel oil No. 2, and 4 OBM’s formulated using
mineral oil. Babu9 found that the empirical model yielded more accurate
muds over the range of measured data more accurately than the
compositional model. He also concluded that the empirical model has more
widely with the location of the well, and sometimes with different stages in the
same well. This was especially apparent in the behavior of the drilling fluids
prepared with diesel oil No. 2. Different oils available under the category of
diesel oil No. 2 that were used in the preparation of OBM’s can exhibit
6
different compressibility and thermal expansion characteristics, which were
are fitted to shear stress/shear rate data directly without extracting rheological
parameters such as yield stress first. This eliminates the need to characterize
the effects of variation in all rheological parameters that describe fluid flow
fluid. The two most common models3 considered for such an analysis are the
acceptable description of oil based mud rheology. Of these two models, the
7
Herschel-Bulkley/Power and Casson models were considered. The behavior
into account the effects of temperature and pressure on fluid rheology. Two
taken into account for both models, and drilling fluid properties are allowed to
especially important in the case where circulation has been stopped for a
again as shown in Fig. 1.1, the lower part of the annulus will be cooled by
cold fluid from the drill string and the upper part of the annulus will be warmed
by hotter fluid coming from the bottom-hole. During this transient period, fluid
8
changes in temperature. Research on this effect is still at a very early stage
Drill Pipe
9
Alderman et al3 performed rheological experiments on water based
14,500 psi, using both weighted and unweighted drilling fluids. Rheograms
were obtained for the water based drilling fluids, holding temperature constant
and varying pressure, and vice versa. It was found that the Herschel-Bulkley
model yielded the best fit to the experimental data. Other models that were
investigated are the Bingham plastic model, and the Casson model which
some authors argue is the best model for characterizing oil-based drilling fluid
rheology.
For the Herschel-Bulkley model, it was found that the fluid viscosity at
high shear rates increased with pressure to an extent, which increases with
the fluid density, and decreases with temperature in a similar manner to pure
water. Alderman et al3 found the yield stress to vary little with pressure-
this threshold is reached, the yield stress increases exponentially with 1/T.
Alderman et al3 also found that the power law exponent increased with
temperature, and decreased with pressure. This lead them to conclude that
the Casson model will become increasingly inaccurate at these two extremes,
10
downhole. As the fluid is circulated in the wellbore, heat from the formation
flows into the wellbore causing the wellbore fluid temperature to rise. This
difference between the formation and the well-bore fluid is greater. The
intervals of time.
temperature of drilling fluid. The first is the analytical method. This method
heat transfer in a well bore for the case of hot-fluid injection for enhanced oil
recovery. His solution permits the estimation of the fluid, tubing and casing
bore is steady state, while heat transfer in the formation is unsteady radial
conduction.
Holmes and Swift14 solved the heat transfer equations analytically for
the case of flow in the drillpipe and annulus. They assumed the heat transfer
this assumption by asserting that the heat transfer from the formation is
negligible in comparison to the heat transfer between the drill pipe and
11
Arnold15,16 also solved the heat transfer equations analytically for both
the hot-fluid injection case and the fluid circulation case. However, in
circulation case, he did not assume steady state heat transfer in the
formation. He represented the transient nature of heat flow from the formation
also solved a similar set of equations, but for the case of flow down the
annulus and up the drill pipe. They also assumed transient heat flow in the
involves allowing the fluid properties such as heat capacity, viscosity, and
density to vary with the temperature conditions. This method involves solving
scheme. Marshal et al18 created a model to estimate the transient and steady-
state temperatures in a well bore during drilling, production and shut-in using
difference model to predict the well bore and formation transient temperature
behavior during drilling fluid circulation for wells with multiple temperature
12
1.3. Objectives and Scope of Work
by the composition of the drilling fluid. Specifically, the objectives of this work
are;
temperature-pressure conditions
Dynamic Density Simulator. This simulator was developed in the visual basic
language and will allow the estimation of the equivalent circulating density
13
1.4. Study Organization
frictional pressure loss are discussed in Chapter Two. The most commonly
with frictional pressure loss calculation methods are also discussed. The
will be discussed here. Chapter Three discusses the heat transfer equations
in the well bore and the analytical and numerical methods for estimating the
covers the modeling procedure, model validation, and discusses the results.
recommendations.
14
Chapter 2
being drilled. In order to maintain proper well control, prevent lost circulation,
to accurately predict the density of the drilling fluids used in drilling these
temperature. Hence, their down-hole densities are often quite different from
their surface densities, which are usually measured during drilling operations.
defined as the pressure exerted at any point by a vertical column of fluid. The
hydrostatic pressure is a function of the density of the fluid, and the height of
15
P = 0.052ρh (2.1)
Where,
P = pressure, psi
the temperature and pressure in the mud is low, the use of constant surface
mud density in conjunction with the above equation will yield a reasonable
Equivalent static density however, must take into account the effects of
wells, can yield figures that are in error by hundreds of psi. Figure 2.1 shows
the effects of temperature and pressure on the density of various base liquids
that can be used in drilling fluids. As expected, these figures show that
dominate pressure effects, so that the net result is decreasing mud density
16
o
F
17
2.2 Estimating Equivalent Static Density
that all solids present in the drilling fluid are incompressible. Consider a
drilling fluid that consists of oil and water phases, solid weighting material,
and chemical additives. The volume and weight of the drilling fluid at some
18
V1 = Vo + Vw + Vs (2.2)
Where,
W = weight
Ideal mixing is assumed in Eqs. 2.2 and 2.3. Once the drilling fluid is
volume of the fluid will change due to the compressibility of the liquid phases.
From the law of conservation of mass, the change in volume of the liquid
⎛ρ V ⎞
∆Vo = ⎜⎜ o1 o ⎟⎟ − Vo (2.5)
⎝ ρo2 ⎠
⎛ρ V ⎞
∆Vw = ⎜⎜ w1 w ⎟⎟ − Vw (2.6)
⎝ ρ w2 ⎠
From Eqs. 2.3 and 2.4, the new mud density at T2 and p2 will be as follows.
19
where the subscript m refers to the drilling mud. Substituting Eqs. 2.5 and 2.6
into Eq. 2.7 and dividing by the original total volume at pressure p1 and
Vo V V V
ρ o1 + ρ w1 w + ρ s s + ρ c c
V1 V1 V1 V1
ρ m ( p 2 , T2 ) = (2.8)
ρ o1 Vo ρ w1 Vw Vs Vc
+ + +
ρ o 2 V1 ρ w 2 V1 V1 V1
Vx
fx = (2.9)
V
V = total volume
fo + fw + fs = 1 (2.10)
ρo1 f o + ρ w1 f w + ρ s f s
ρ m ( p2 , T2 ) = (2.11)
⎛ρ ⎞ ⎛ρ ⎞
1 + f o ⎜⎜ o1 − 1⎟⎟ + f w ⎜⎜ w1 − 1⎟⎟
⎝ ρo 2 ⎠ ⎝ ρ w2 ⎠
ρ m1
ρ m ( p2 , T2 ) = (2.12)
⎛ρ ⎞ ⎛ρ ⎞
1 + f o ⎜⎜ o1 − 1⎟⎟ + f w ⎜⎜ w1 − 1⎟⎟
⎝ ρo2 ⎠ ⎝ ρ w2 ⎠
where ρm1 is the mud density at temperature T1 and pressure p1. From the
20
temperature and pressure. Various authors have proposed equations
expressing the volumetric behavior of water, and oil phases that may be
where
Ao = 7.24032 Bo = 8.63186
The equation for the water phase was obtained by curve fitting data from
tables of physical constants, while that of the diesel oil No. 2 was obtained by
where po and To represent standard temperature (59 oF) and pressure (14.7
psia).
21
Isambourg et al7 proposed a nine parameter model to express the
Volume ( p, T )
Volumetric ratio = (2.17)
Volume ( po , To )
Eq. 2.16 is valid in the range of 14.5 to 20,000 psia, and 68 to 392 oF and can
Vr ( po , To )
ρ f ( p, T ) = ρ f ( po , To ) (2.18)
Vr ( p , T )
temperature-pressure conditions.
ρ s ( po , To )
ρ s ( p, T ) = (2.19)
[1 + as (T − To )]* [1 + bs ( p − po )]
where
22
2.2.2 Empirical Models
where,
α, β, γ = empirical constants
Kutasov’s model applies to both water-based and oil-based drilling fluids, and
the volumetric behavior of each of the constituents of the drilling fluid is not
required.
the sum of the hydrostatic head of the fluid column, and the pressure loss in
the annulus due to fluid flow. It is expressed as density term at the point of
interest.
23
ρ ecd =
1
(∆Phydrostatic + ∆Pfriction ) (2.21)
0.052h
where,
As stated before, the hydrostatic pressure of the drilling fluid is affected by the
the well-bore. The frictional pressure loss term in the above equation however
is affected by the well-bore and drill string geometry, fluid rheology, and the
The frictional pressure loss is the loss in pressure during fluid flow due
to contact between the fluid and the walls of the flow conduit. When fluid
moves past the solid interface, a boundary layer is formed adjacent to the wall
of the flow conduit. The viscous property of the fluid creates a variation in the
flow velocity normal to the solid interface, ranging from zero at the pipe wall
with a no-slip assumption and maximum velocity at the edge of the boundary
24
length of the flow conduit, the fluid density, the square of the fluid velocity,
2 fρv 2
∆p = ∆L (2.22)
D
where
ρ = fluid density
∆L = conduit length
V = fluid velocity
D = pipe diameter
Af
De = 4 (2.23)
Pw
where
De = equivalent diameter
Af = cross-sectional area
Pw = wetted perimeter
The variable “f” in equation 2.22 is known as the Fanning friction factor. The
friction factor can be defined as the ratio between the force exerted on the
walls of a flow conduit as a result of fluid movement, and the product of the
characteristic area of the flow conduit and the kinetic energy per unit volume
of the fluid.
25
2.5 Fluid Rheology
and flow of matter, in this case drilling fluids. It is also the characteristic of the
shear stress, and the shear rate of the fluid. Based on the nature of this
Newtonian Fluids- Newtonian fluids are fluids in which the ratio between
applied shear stress, and the rate of shear is constant with respect to time
τ = µγ& (2.24)
where,
τ = shear stress
µ = viscosity
Examples of Newtonian fluids are water, light hydrocarbons, and all gases.
with time and shear history. This class of fluids can be further subdivided into
26
fluids, in which the viscosity varies with time at a constant shear rate, while
Visco-elastic Fluids- These are fluids which exhibit both viscous and elastic
behavior. When subjected to stress, they deform and flow like true fluids, but
once the stress is removed, they regain some of their original state like solids.
The following are the rheological models that characterize the various
rheological model that accounts for the stress required to initiate fluid flow in
viscous fluids. This initial stress is referred to as the yield stress. Once the
is shown by the linear relationship between the applied stress and the rate of
shear. The constitutive equation for the Bingham plastic model is given as
follows.
where
27
Although the Bingham plastic model does account for the yield stress, it can
rheological model like the Bingham plastic model. However, where the
and shear strain, the power law model uses a non-linear relationship which
drilling fluids. The following is the constitutive equation for the power law
model.
τ = kγ& n (2.26)
where
k = consistency index
consistency of the fluid, the higher the value of k the more viscous the fluid; n
where the flow behavior index is equal to 1, the power law model describes
the behavior of a Newtonian fluid. In situations where the flow behavior index
28
thinning. Shear-thinning refers to the reduction in viscosity with the shear rate.
The limiting viscosity is known as the viscosity at infinite shear, µ∞ (Fig. 2.2).
µο
µ∞
Yield Pseudo-plastic
Bingham Plastic
Pseudo-plastic
Shear
Stress
Newtonian
Dilatant
Shear Rate
29
When the flow behavior index is greater than 1 the fluid is referred to
as dilatant and shear thickening. This is shown in Fig. 2.3. The dimensions of
carry cuttings even while it is at rest due to the fluid thickness, and at the
same time lowers pumping costs because the fluid becomes thinner and
rheological model that accounts for both the yield stress, and the non-linear
relationship between shear stress and shear rate exhibited by most drilling
where
k = consistency index
τo = yield stress
30
The above three rheological models are the most commonly used in
the oil industry for the characterization of drilling fluids. There are, however,
various other rheological models that can and have been used. The following
τ = τ o + kγ& τ ≥ τo (2.28)
where
τo = yield stress
Power-law model
blood.
Newtonian region at low shear rates, while still expressing a power law type
dependence at higher shear rates. These are the initial flat plateau and
31
successive straight line segments of Fig. 2.2. The constitutive equation is
given as follows.
⎛ ⎞
⎜ ⎟
⎜ ⎟
τ ⎜ µo ⎟
µa = = ⎜ α −1 ⎟
γ& (2.29)
γ& ⎜ ⎟
τ
⎜1+ ⎟
⎜ τ1 ⎟
⎝ 2 ⎠
where
⎛µ ⎞ τ
From eq. 2.29, a plot of ln⎜⎜ o − 1⎟⎟ versus ln will yield a slope of (α-1).
⎝ µa ⎠ τ1
2
Hence, if µo and τ1/2 are known, α can be estimated. µo refers to the viscosity
account for the entire flow curve shown in Fig. 2.2, i.e. the two Newtonian-like
flow regions at very high shear rates and very low shear rates characterized
by flat plateaus and the power-law region in the middle. The constitutive
32
[ ]
µ − µ∞ ( n −1)
= 1 + (λγ& )
2 2
(2.30)
µo − µ∞
where
λ = time constant
n = exponential constant
The λ parameter is a time constant calculated from the point on the flow curve
where the flow behavior transitions from the lower Newtonian region to the
Parameters
Politte22 analyzed rheological data for diesel based drilling fluid and
found the plastic viscosity tracked the behavior of the base oil. Hence, the
plastic viscosity of the oil-based drilling fluid is normalized with the viscosity of
the base oil. The plastic viscosity will be normalized with the viscosity of the
33
base fluid at reference conditions. The steps of this method are detailed as
follows:
(PV0).
2. Calculate the base oil viscosity at the reference conditions (µo) and at
following equation.
µT , P
PVT , P = PVo (2.31)
µo
Politte22 concluded that this procedure will be valid regardless of the type of
base oil used. He obtained the following equations from the analysis of diesel
viscosity data.
⎛ A + B T + D TP + E P + F ρ + G1 ⎞
µ = P (TP ) 10
⎜ 1 1 ρ ⎟⎠
⎝
C1 1 1 1
(2.32)
1000 ≤ P ≤ 15000
75 ≤ T ≤ 300
A1 = -23.1888 A2 = 0.8807
B1 = -0.00148 B2 = 1.5235*10-9
C1 = -0.9501 C2 = 1.2806*10-6
D1 = -1.9776*10-8 D2 = 1.0719*10-10
E1 = 3.3416*10-5 E2 = -0.00036
F1 = 14.6767 F2 = -5.1670*10-8
34
G1 = 10.9973
Where
µ = viscosity (cp)
ρ = density (lb/gal)
T = temperature (oF)
P = pressure (psi)
Further analysis with other oils by Politte led to the conclusion that Eqs. 2.32
and 2.33 are applicable for estimating the downhole plastic viscosity
that the yield point is not a strong function of pressure, and becomes
the yield point are, however, hard to predict, as there are chemical as well as
where it may be important to know the precise behavior of the drilling fluid,
steps based on an empirical equation obtained from the analysis of diesel oil
35
1. Measure the yield value at the reference conditions (YVTo).
A3 + B3T −1 + C3T −2
τ y = τ yo (2.34)
A3 + B3To−1 + C3To− 2
90 ≤ T ≤ 300
A3 = -0.186
B3 = 145.054
C3 = -3410.322
Where
T = temperature (oF)
particles present in the drilling fluid, Eq. 2.34 cannot be used to estimate the
yield value of drilling fluids that have base fluids of significantly different
the flow is laminar or turbulent. The apparent viscosity of the fluid is first
36
Apparent Newtonian viscosity in pipes-
6.66τ y d
µa = µ p + (2.35)
v
5τ y d e
µa = µ p + (2.36)
v
where
928 ρ vd
N Re = (2.37)
µa
where
the flow regime, the frictional pressure drop can be calculated using the
following equations.
37
Laminar Flow
Pipe
⎛ µpv τ ⎞
∆Pf = ⎜ + y ⎟∆L (2.38)
⎜ 1500d 2
225d ⎟⎠
⎝
Annulus
⎛ µpv τy ⎞
∆Pf = ⎜ + ⎟∆L (2.39)
⎜ 1000(d 2 − d1 )2 200(d 2 − d1 ) ⎟
⎝ ⎠
Turbulent Flow
1
f
( )
= 4 log10 N Re f − 0.395 (Colebrook Equation) (2.40)
928ρ vd
where N Re = (2.41)
µp
If the flow regime is turbulent, once the friction factor has been obtained, the
38
2.8 Summary
2.12 will be applied in conjunction with Eqs. 2.14 and 2.33 to express the
parameters will be applied. The Bingham plastic model was chosen because
it is the most commonly used rheological model on the oil field and models
39
Chapter 3
causing a rise in its temperature. This rise in temperature in turn can lead to
changes in the fluid’s volumetric and rheological behavior, and thus the
properties11. Estimation of fluid temperature in the drill pipe and the annulus is
thus necessary in order to calculate the frictional pressure drop for a number
Fluid temperature within the wellbore will vary with depth and time with
that take place in the wellbore and the methods for estimating the
temperature profile.
40
3.1 Heat Transfer in the Wellbore
and the associated heat transfer process over a differential element of length
∆z. The figure shows heat flow from the formation into the annular section
through convection (qfa). This rate of heat flow by convection into the annulus
is much greater than the rate of heat conduction in the formation. This is due
to the relatively low heat conductivity of the formation. This fact will be
important when modeling the heat transfer process in the wellbore. The fluid
within the drillpipe receives heat from the annulus via convection on the pipe
surface on the inside and outside of the drill pipe, and conduction through the
drillpipe itself (qap). There is heat flow in and out of the differential elements
within the drillpipe and annulus due to the bulk flow of fluid (qp(z), qp(z+Dz),
the wellbore during circulation. They are the analytical method and the
governing heat transfer in the wellbore analytically, that is, assuming constant
simple geometry as in the case of a single casing string and inner drill pipe.
handled using this method, and it has the added advantage of allowing
41
qp(z)
qa(z) qa(z)
z
qfa
qap
Formation
z+
Tp
Drill
Pipe
42
3.2 Analytical Method
The temperature of the fluid within the drillpipe and the annulus is
transient formation heat conduction function, f(tD)13. The function accounts for
the un-steady state heat conduction in the formation. In order to solve these
Boundary Conditions
• The inlet fluid temperature coming into the drillpipe at the surface.
• The fluid temperature in the drillpipe and the annulus are equal at the
bottom-hole.
• The formation is radially symmetric and infinite with respect to heat flow.
• Heat flow within the wellbore is rapid compared to heat flow within the
formation. Hence, heat flow within and across the wellbore conduits is
43
assumed to be steady-state, and heat flow within the formation is
assumed to be transient.
Heat enters the differential element in the drillpipe from two sources;
bulk fluid flow qp(z), and from convection and conduction through the drillpipe
wall, qap. Heat leaves the differential element through bulk fluid flow qp(z+∆z).
The heat balance of the differential element in the drillpipe yields the following
equation
where,
qp(z) = mc fl Tp (3.2)
z
to yield
rearranging,
δTp
mc fl − 2πrpU p (Ta ( z ) − Tp ( z )) = 0 (3.6)
δz
where,
44
Tp = temperature of drillpipe fluid as a function of depth (oF)
(Btu/hr-ft2-oF)
z = depth (ft)
Heat enters the differential element in the annulus from the formation
by convection (qfa), and through bulk fluid flow (qa(z+∆z)). Heat leaves the
differential element through convection and conduction through the pipe wall
(q(ap)) and through bulk fluid flow (qa(z)). This process yields the following
equation.
where
qa(z+Dz) = mc fl Ta z + ∆z
(3.9)
qa(z) = mc fl Ta z
(3.11)
to yield
45
rearranging,
δTa
2πraU a (Ti ( z ) − Ta ( z ))dz − 2πrpU p (Ta ( z ) + Tp (z ))dz + mc fl =0 (3.13)
δz
where
interface (Btu/hr-ft2-oF)
The heat flow from the formation is given by the following equation.
2πk F
qf = (TF (z ) − Ti (z ))dz (3.14)
f (t D )
where
⎛ 1
⎜ ( )
⎛− r2
Ei⎜ a
2 ⎝
⎞⎞
⎟
4αt ⎟⎠ ⎟
f (t D ) = ⎜ (3.15)
⎜ ⎛ − ra2 ⎞ ⎟
⎜ exp ⎜ 4αt ⎟⎠ ⎟⎠
⎝ ⎝
kF
α= (3.16)
ρ F cF
46
where
It can be observed that the heat flow from the formation should be equal to
the heat flow into the annulus by convection. Thus, qf = qfa. The temperature
of the interface between the formation and the annulus can thus be eliminated
as follows.
2πk F
(TF (z ) − Ti (z ))dz = 2πraU a (Ti (z ) − Ta (z ))dz
f (t D )
rearranging,
dTp
Ta = β + Tp (3.18)
dz
where,
mc fl
β= (3.20)
2πrpU p
Inserting Eqs. 3.17, 3.18, and 3.19 into Eq. 3.13 will yield an equation that is
47
d 2Tp dTp
σβ 2
−β − Tp + TF = 0 (3.21)
dz dz
where,
⎛ k F + raU a f (t D ) ⎞
σ = mc fl ⎜⎜ ⎟⎟ (3.22)
⎝ 2πraU a k F ⎠
Where,
d 2Tp dT p
σβ 2
−β − Tp = −TFs − g G z (3.24)
dz dz
where
β + β 2 + 4αβ
γ1 = (3.26)
2αβ
β − β 2 + 4αβ
γ2 = (3.27)
2αβ
dTp ( z )
= γ 1C1eγ 1 z + γ 2C2eγ 2 z + gG (3.28)
dz
48
By inserting Eqs. 3.25 and 3.28 into Eq. 3.18, we obtain the following
In order to obtain the constants C1 and C2, the following boundary conditions
are applied16.
where,
g G − eγ 2 Lγ 2Tdiff
C1 = (3.30)
eγ 2 Lγ 2 − eγ 1 Lγ 1
− g G + eγ 1 Lγ 1Tdiff
C2 = (3.31)
eγ 2 Lγ 2 − eγ 1 Lγ 1
where,
49
3.3 Numerical Method
flow in the wellbore and formation, using finite difference technique. Heat
∂Tp ( z, t ) ∂Tp ( z , t )
[ ]
2πrpU p ( z , t ) Ta ( z , t ) − Tp ( z, t ) = mc fl
∂z
+ ρπrp2c fl
∂t
(3.33)
where
(Btu/hr-ft2-oF)
50
r
q1 q2
Control Control
Volume in Volume in
the Annulus the
51
The equation for conservation of energy for a control volume inside the
[ ] [ ]
2πraU a ( z , t ) T f (ra , z , t ) − Ta ( z , t ) − 2πrpU p ( z , t ) Ta ( z , t ) − Tp ( z , t )
∂Ta ( z , t ) o ∂T ( z , t )
(
= ρπ ra2 − rp2 c fl ) ∂t
− m c fl a
∂z
(3.34)
where
(Btu/hr-ft2-oF)
1 ∂ ⎛ ∂TF ( z , r , t ) ⎞ 1 ∂TF ( z , r , t )
⎜r ⎟= (3.35)
r ∂r ⎝ ∂r ⎠ α ∂t
where
kF = formation conductivity
ρ = formation density
Note that heat flow in the formation is assumed to occur radially only. At the
boundary of the formation, heat exchange between the formation and annulus
balance about a sufficiently small control volume within the formation adjacent
to the annulus.
52
@ r = ra
⎡ ∂T ( z , ra , t ) ⎤
− 2πraU a ( z , t ){TF ( z , ra , t ) − Ta ( z , t )} + 2πra k F ⎢ F ⎥
⎣ ∂r ⎦
∂TF (z , ra , t )
= 2πra ∆rρcF (3.36)
∂t
The first term on the left hand side of Eq. 3.36 represents the rate at which
heat is leaving the formation boundary by convection (q1 in Fig. 3.2b). The
second term on the left hand side of the equation represents the rate at which
heat enters the control volume by conduction (q2 in Fig. 3.2b). The right-hand
side of Eq. 3.36 represents the rate at which heat accumulates in or is lost
temperature.
and formation will be propagated across the formation and well bore using the
finite difference grid shown in Fig. 3.3. The solution will be advanced starting
at the outer boundary of the formation in the r-direction until the temperature
53
r
z
i=1
i=2
i=3
Wellbore Formatio
54
where,
heat flow in the wellbore (3.33 & 3.34). They were first discretized using
⎡ (Ta )n + (Ta )n (Tp )in + (Tp )in−1 ⎤ o (Tp )in − (Tp )in−1 (Tp )in +1 + (Tp )in
2πrp (U p )i ⎢ i −1
− ⎥ = m c fl + ρπ rp c fl
n i 2
⎢⎣ 2 2 ⎥⎦ ∆z ∆t
coordinate n+1, i.e. at the next time step, are not known. Equation 3.37 is
rearranged with the known parameters on right-hand side and the unknown
⎛ ⎛o ⎞⎞
⎜ ∆t ⎜ m c fl − ∆zπrpU p ⎟ ⎟
U p ∆t ∆
(T )n +1
= (Ta )in−1 + p (Ta )in + ⎜⎜ ⎝
U t ⎠ ⎟(T )n
⎟ p i −1
ρrp c fl ρrp c fl ∆zρπ rp c fl
p i 2
⎜ ⎟
⎝ ⎠
⎛ ⎛o ⎞⎞
⎜ ∆t ⎜⎜ m c fl + ∆zπr p U p ⎟⎟ ⎟
⎜ ⎝ ⎠⎟
+ ⎜1 − ⎟(T p ) n
(3.38)
∆zρπ r p2 c fl
i
⎜ ⎟
⎜ ⎟
⎝ ⎠
coordinates located nearby in the pipe and annulus, at the previous time-step.
55
Stability Criterion- The coefficients of the known pipe and annulus
would not make physical sense, because it would be saying that the hotter
interest for the present time-step, the colder the temperature will be at the
desirable to avoid zero coefficients. Application of this rule to Eq. 3.38, results
∆zρπ rp2c fl
∆t ≤ (3.39)
⎛o ⎞
⎜ m c fl + ∆zπrpU p ⎟
⎝ ⎠
o
m c fl ≥ ∆zπrpU p (3.40)
The equation describing heat flow in the annulus (Eq. 3.34) is discretized as
follows.
⎡ (TF )in + (TF )in−1 (Ta )in + (Ta )in−1 ⎤ n (Ta )i + (Ta )i −1
⎡ n n
(Tp )in + (Tp )in−1 ⎤
2πra (U ) − ⎥ − 2πrp (U p )i ⎢ − ⎥
n
a i ⎢
⎣⎢ 2 2 ⎦⎥ ⎢⎣ 2 2 ⎥⎦
∆z ∆t
a p
Equation 3.41 is rearranged, with known parameters on the right hand side of
the equation and unknown parameters on the left hand side as follows.
56
raU a ∆t r U ∆t r U ∆t
(Ta )in−+11 = (TF )in−1 + ra2U a ∆2t (TF )in + p2 p 2 (Tp )in−1 + p2 p 2 (Tp )in
( )
ρ ra − rp c fl
2 2
(
ρ ra − rp c fl ) ρ ra − rp c fl ( )
ρ ra − rp c fl ( )
⎛ ⎛o ⎞⎞
⎜ ∆t ⎜ m c fl + ∆zπraU a + ∆zπrpU p ⎟ ⎟
+ ⎜1 − ⎝ ⎠ ⎟(T )n
⎜ ∆zρπ ra − rp c fl
2 2
( )
⎟ a i −1
⎜ ⎟
⎝ ⎠
⎛ ⎛o ⎞⎞
⎜ ∆t ⎜ m c fl − ∆zπraU a − ∆zπrpU p ⎟ ⎟
+⎜ ⎝ ⎠ ⎟(T )n
⎜ (
∆zρπ ra − rp c fl
2 2
) ⎟ a i
(3.42)
⎜ ⎟
⎝ ⎠
∆t ≤
(
∆zρπ ra2 − rp2 c fl ) (3.43)
⎛o
⎞
⎜ m c fl + ∆zπraU a + ∆zπrpU p ⎟
⎝ ⎠
o
m c fl ≥ ∆zπraU a + ∆zπrpU p (3.44)
@ i = 0 (pipe inlet) (T )n
p i = Tps for all n.
@ i = imax (bottom-hole) (T ) = (T )
n
p i
n
a i for all n.
where
The second boundary condition states that at the bottom of the well, the pipe
and annulus fluid temperatures are equal. Note that Eq. 3.38 is solved from
57
the surface to the bottom in the direction of fluid flow, while Eq. 3.42 is solved
The explicit method detailed above was tested and found to be too
slow, that is, it took a longer time to converge on an answer. This was largely
scheme, the Crank-Nicolson method26, was then used. This scheme yields an
efficient, easy to use finite difference scheme which gives more accurate
2πrp (U p )i θ (Ta )i
n +1
{ n +1
− (Tp )i
n +1
}+ 2πr (U ) (1 − θ ){(T ) − (T ) }
p
n
p i
n
a i
n
p i
⎧⎪ (Tp )n +1 − (Tp )n +1 (Tp )in+1 − (Tp )in−1 ⎫⎪ (Tp )in +1 − (Tp )in
+ (1 − θ )
o
= m c fl ⎨θ i +1 i −1
⎬ + ρπ rp c fl
2
(3.45)
⎪⎩ 2∆z 2∆z ⎪⎭ ∆t
o o
⎛ ρπrp2c fl n +1 ⎞
θ (Tp )i −1 + 2πrp (U p )i θ ⎟(Tp )i + θ (Tp )in++11
m c fl m c fl
+⎜
n +1 n +1
−
2∆z ⎜ ∆t ⎟ 2∆z
⎝ ⎠
o o
⎛ ρπrp2c fl ⎞ n m c fl
(1 − θ )(Tp )i −1 + ⎜⎜ + 2πrp (U p )i (1 − θ )⎟(Tp )i − (1 − θ )(Tp )in+1
m c fl
=
n n
2∆z ⎟
⎝ ∆t ⎠ 2∆z
Note that in Eq. 3.46, all the terms on the left hand side are unknowns while
all the terms on the right-hand side are known except the last one which is the
temperature in the annulus at the depth of interest during the current time
profile in the annulus. This guess is the temperature profile at the previous
58
time-step. Hence, the last term on the right-hand side of Eq. 3.46 will be a
known term.
{
2πra (U a )i θ (TF )i , 0 − (Ta )i
n +1 n +1 n +1
}+ 2πr (U ) (1 − θ ){(T )
a
n
a i
n
F i ,0 − (Ta )i
n
} (3.47)
− 2πrp (U p )i θ (Ta )i
n +1
{ n +1
− (Tp )i
n +1
}− 2πr (U ) (1 − θ ){(T ) − (T ) }
p
n
p i
n
a i
n
p i
(
n
= ρπ ra2 − rp2 c fl a i
− m c fl ⎨θ + (1 − θ ) a i +1 ⎬
∆t ⎪⎩ 2 ∆z 2 ∆z ⎪⎭
⎛ ρπ (ra2 − rp2 )c fl
o o
n +1 ⎞
+ 2πrp (U p )i θ + 2πra (U a )i θ ⎟(Ta )i −
m c fl m c fl
θ (T )n +1
a i −1 +⎜
⎜
n +1
⎟
n +1
θ (Ta )in++11
2∆z ⎝ ∆t ⎠ 2∆z
( )
o
⎛ ρπ ra2 − rp2 c fl ⎞ n
− 2πrp (U p )i (1 − θ ) − 2πra (U a )i (1 − θ )⎟(Ta )i
m c fl
=− (1 − θ )(T ) n
a i −1 +⎜
⎜
n1 n
⎟
2∆z ⎝ ∆t ⎠
(1 − θ )(Ta )in+1 + 2πrp (U p )in1 (1 − θ )(Tp )in − 2πra (U a )in (1 − θ )(TF )in,0
m c fl
−
2 ∆z
Note that all the terms on the left hand side of Eq. 3.48 are unknowns while
all the terms on the right hand side are known with the exception of the last
term. The sixth term is already known because the temperature profile in the
drill pipe at any given time-step is evaluated before the temperature profile in
the annulus. The problem of the last term is solved by making an initial guess
59
of the temperature profile in the immediate adjacent formation. The initial
(T )
p i max −1
(T )i max
`
imax
60
Note,
∆z
m c fl (Tp )i max −1 − m c fl (T )i max + 2πraU a {(TF )i max − (T )i max } = ρπra2 ∆z c fl ∂T (3.49)
o o
2 2 ∂t
{ } { } {
m c flθ (Tp )i max −1 − (Tp )i max + m c fl (1 − θ ) (Tp )i max −1 − (Tp )i max + πraU a ∆zθ (TF )i max,0 − (Tp )i max }
o o
n +1 n +1 n n n +1 n +1
{ }
n
⎛ o ρπra2 ∆zc fl ⎞
m c flθ (Tp )i max −1 + − m c flθ − ⎟(Tp )n +1
o
n +1
⎜
⎜ 2 ∆t ⎟ i max
⎝ ⎠
⎛ o ρπra2 ∆zc fl ⎞
= m c fl (1 − θ )(Tp )i max −1 + ⎜ − m c fl (1 − θ ) − ⎟(Tp )n − πraU a ∆zθ (TF )inmax,
o
n +1
⎜ 2∆t ⎟ i max 0
⎝ ⎠
− πraU a ∆z (1 − θ )(TF )i max,0 + πraU a ∆zθ (Ta )i max + −πraU a ∆z (1 − θ )(Ta )i max
n n +1 n
(3.51)
Equation 3.46 in conjunction with Eq. 3.51, thus form a tridiagonal system of
algorithm26.
61
{ } { } {
m c flθ (Tp )i max −1 − (Ta )i max + m c fl (1 − θ ) (Tp )i max −1 − (Ta )i max + πraU a ∆zθ (TF )i max,0 − (Ta )i max }
o o
n +1 n +1 n n n +1 n +1
{ }
n
+ πraU a ∆z (1 − θ ) (T ) − (T ) = ρπr
n n 2
c fl (3.52)
∆t
F i max, 0 a i max a
2
⎛ ρπra2 ∆zc fl ⎞
+ πraU a ∆zθ + m c flθ ⎟(Ta )i max = m c flθ (Tp )i max −1 + m c fl (1 − θ )(Tp )i max −1
o o o
⎜ n +1 n +1 n
⎜ 2 ∆t ⎟
⎝ ⎠
⎛ o ρπra2 ∆zc fl ⎞
+ − m c fl (1 − θ ) − πraU a ∆z (1 − θ ) +
⎜ ⎟(Ta )inmax (3.53)
⎜ 2 ∆t ⎟
⎝ ⎠
Equation 3.47 is solved in conjunction with Eq. 3.53 to yield the temperature
62
(TF )in,+j1 − (TF )in, j α ⎛⎜ (TF )i , j −1 − 2(TF )i , j + (TF )i , j +1
n +1 n +1 n +1
(TF )in,1j −1 − 2(TF )in, j + (TF )in, j +1 ⎞⎟
= +
∆t 2 ⎜⎝ (∆r )2 (∆r )2 ⎟
⎠
+ + (3.54)
2 ⎜⎝ j∆r 2∆r j∆r 2∆r ⎟
⎠
where,
φin, j = ⎛⎜ − αar 4 j + αar 2 ⎞⎟(TF )in, j − i + (1 − αar )(TF )in, j + ⎛⎜ αar 4 j + αar 2 ⎞⎟(TF )in, j +1
⎝ ⎠ ⎝ ⎠
ar = ∆t
(∆r )2
Formation Boundary Conditions- At the formation and annulus interface, the
∂TF
− kF + U aTF = U aTa (3.56)
∂r
Rearranging Eq. 3.57 for time-steps n and n+1, we obtain the following.
(TF )in, −1 = U a {(Ta )in − (TF )in,0 }2∆r + (TF )in,1 (3.58)
kF
63
Note that there in Eqs. 3.49 and 3.50, there is a node j = -1. This is an
imaginary node located outside of the formation in the annulus. Near the
boundary, the equation describing internal heat flow in the formation (Eq.
∂TF ∂ 2TF
= 2α (3.60)
∂t ∂r 2
This is done to avoid the apparent singularity which occurs at the node j = 0.
= + (3.61)
2 ⎜⎝ (∆r )2 (∆r )2 ⎟
⎠
where
φin,0 = ar (TF )in, −i + (1 − 2αar )(TF )in, 0 + αar (TF )in,1 (3.63)
The temperatures at the imaginary node j = -1 are eliminated from Eqs. 3.62
⎛ 2∆r ⎞
U a ⎟⎟(TF )i , 0 − 2αar (TF )i ,1 = φin,0
n +1 n +1
⎜⎜1 + 2αar + αar (3.64)
⎝ kF ⎠
64
where
2 ∆r 2 ∆r
U a (Ta )i + αar U a (Ta )i
n +1
φin,0 = αar n
kF kF
⎛ 2∆r ⎞
+ ⎜⎜1 − 2αar + αar U a ⎟⎟(TF )i ,0 + 2αar (TF )i ,1
n n
(3.65)
⎝ kF ⎠
Equations 3.64 and 3.65 express the temperature in the formation at the
formation-annulus interface. Note that in Eq. 3.65, the first term on the right
hand side contains the annulus temperature for the future time step. This
does not create a problem because at the time when the temperature in the
formation is evaluated, the temperature in the wellbore for the future time-step
has already been evaluated. Hence, the temperature in the annulus for the
future time step is already known. At the outer boundary of the formation, a
disturbance caused by the flow of fluid in the wellbore is no longer felt in the
gradient.
Equations 3.55, 3.64, and 3.66 thus form a complete set of linear algebraic
65
⎡1 0 0 0⎤
0 K 0 ⎧(TF )in,+01 ⎫
⎢A 0 ⎥⎥ ⎪ n +1 ⎪
⎢ B C 0 ( )
⎪ F i ,1 ⎪
T
⎢M A B C M ⎥ ⎪⎪(T )n +1 ⎪⎪
[Ω] = ⎢ ⎥ {T } = ⎨ F i , 2 ⎬
⎢M M⎥
⎪ M ⎪
⎢0 A B C⎥ ⎪ M ⎪
⎢ ⎥ ⎪ n +1 ⎪
⎢⎣ 0 0 K K 0 0 1 ⎥⎦ ⎪⎩(TF )i , J ⎪⎭
⎧ φ in, 0 ⎫
⎪ n ⎪
⎪ φ i ,1 ⎪
⎪⎪ φ in, 2 ⎪⎪
{Ψ} = ⎨ ⎬
⎪ M ⎪
⎪φ in, J −1 ⎪
⎪ ⎪
⎪⎩ TG ⎪⎭
where
αa αa
A = ⎛⎜ r − r ⎞⎟ B = (1 + αar ) C = ⎛⎜ −
αar −
αar ⎞
⎝ 4j 2⎠ ⎝ 4j 2 ⎟⎠
Numerical Procedure-
1. The initial conditions of the system are specified (time t = 0). The initial
66
conform to the formation geothermal gradient. This condition is chosen
formation.
2. The temperature profile in the drill pipe is evaluated first using Eqs.
the annulus at the current time step in order to evaluate the drill-pipe.
temperature profile is evaluated using Eqs. 3.48 and 3.53. Note that it
current time step based on the newly evaluated annulus profile. The
results of the procedure are then compared with the initial guesses. If
67
3.4 Summary
profile within the wellbore and formation have been described. It is assumed
that heat flow in the wellbore occurs rapidly in comparison to heat flow in the
formation. Heat flow in the wellbore occurs by bulk fluid flow, convection
across surface films on the pipe conduit and on the outer wall of the annulus,
and conduction through the pipe wall. Heat flow in the formation occurs by
conduction in the radial direction only. For the numerical method, the
equations governing heat flow in the wellbore and formation are solved using
density Simulator.
68
Chapter 4
predict these downhole conditions and their impact on the drilling fluid
behavior. This allows for precise drilling fluid selection and preparation, and
validation of the Dynamic Density Simulator (DDS) and analysis of the results
pressure conditions. The DDS program is a predictive tool that will allow the
that will be encountered and the resultant change in drilling fluid rheological
behavior. The simulator was written using Visual Basic for applications
Excel and initiated with a command button that is integrated into the main
69
worksheet menu. This format was chosen because it allows ease of use and
will accept data pertaining to the well bore, drilling fluid, and formation
parameters and return the temperature profiles in the wellbore and formation,
pressure losses in the wellbore and the ECD of the circulating fluid. The user
can navigate between forms and input data at leisure using the “back” and
“next” buttons. Once all the parameter values have been entered into the
program, the results are displayed on a “results” form. The following is the
1. “frmStart”- This is the starting form and the form that is displayed
when the program is initiated. On this form, the option is given to initiate a
2. “frmWellProps”- This form allows input of the well bore parameters. These
include the total vertical depth of the well, drill string dimensions such as
inner and outer drill pipe diameters, drill bit dimensions, and information
70
4. “frmFormationProps”- This form allows input of the thermal properties of
6. “frmResults” - This form displays the frictional pressure losses and ECD
results.
results display.
The first form that is displayed once the program is executed is the
program title page. From this form, a new well profile can be initiated. Figure
4.2 shows a screen capture of the title form. The form is initiated by clicking
pipe and drill collars. The bit size, circulation rate, inlet pipe temperature and
total vertical depth are also specified. A screen capture of this form is shown
in Fig. 4.4.
71
START
(Initiate Well
Profile)
Drill String
Configuration/Geometry
Bit Configuration
INPUT WELL
PARAMETERS
TVD, Circulation
Rate, Inlet Pipe
Temperature
INPUT MUD
PARAMETERS
Rheological
Properties
INPUT FORMATION
PARAMETERS Density and
Constituents
Thermal Properties
INPUT HEAT TRANSFER
COEFFICIENTS
Reference Conditions
EVALUATE WELLBORE
TEMPERATURE PROFILE
CALCULATE BOTTOM-
HOLE PRESSURE & ECD
DISPLAY
STOP
72
Figure 4.2- Title Form
73
DDSimulator
Command
Button
74
Figure 4.4- Well Parameters Form
75
Figure 4.5- Mud Properties Form
76
4.2.2 Mud Properties Form
The properties of the drilling fluid are entered on this form. These
include the rheological properties such as plastic viscosity and yield strength,
the density and constituents, and the thermal properties such as thermal
conductivity and heat capacity. The density and rheological parameters are
conditions are also entered. Figure 4.5 shows a screen capture of the form.
introducing the drilling fluid into the well. This radius is usually about 10-ft
from the well-bore. Figure 4.6 shows a screen capture of the formation
properties form.
The overall heat transfer coefficients for heat transfer across the
annulus-formation interface, and across the drill-pipe wall are entered on this
form. Figure 4.7 shows a screen capture of the heat transfer coefficients form.
77
Figure 4.6- Formation Properties Form
78
Figure 4.7- Heat Transfer Coefficients Form
79
4.2.5 Results and Results Form
Once all the system parameters have been specified, the simulator can
then evaluate the temperature profile inside the drill-pipe and annulus and the
pressure drop in the annulus and drill-pipe, the bottom-hole pressure and the
ECD are then determined. The results are presented on the result form and
The result form is shown in Fig. 4.8 and a sample temperature profile is
80
Figure 4.9- A Sample Temperature Profile
Using Excel Graph Feature
81
4.3 Equations used in DDSimulator Program
hydrostatic head and frictional pressure loss in the wellbore during circulation.
ρ m1
ρ m ( p2 , T2 ) = (2.12)
⎛ρ ⎞ ⎛ρ ⎞
1 + f o ⎜⎜ o1 − 1⎟⎟ + f w ⎜⎜ w1 − 1⎟⎟
⎝ ρo2 ⎠ ⎝ ρ w2 ⎠
where
A2 = 0.8807 B2 = 1.5235*10-9
C2 = 1.2806*10-6 D2 = 1.0719*10-10
E2 = -0.00036 F2 = -5.1670*10-8
where
82
The density of the fluid in the annulus is computed for 200 discrete lengths of
the wellbore, that is, the total vertical depth is divided into 200 discrete
the fluid in the well bore is calculated according to the following equation.
⎛ A + B T + D TP + E P + F ρ + G1 ⎞
µ = P (TP ) 10
⎜ 1 1 ρ ⎟⎠
⎝
C1 1 1 1
(2.32)
1000 ≤ P ≤ 15000
75 ≤ T ≤ 300
where
G1 = 10.9973
The steps used in the DDSimulator to calculate the plastic viscosity and yield
value of the drilling fluid are detailed in Sections 2.6.1 and 2.6.2 of Chapter 2.
The apparent viscosity of the drilling fluid is calculated according to Eqs. 2.36
and 2.36. The apparent viscosity is calculated for 200 discrete lengths of the
drill pipe.
The temperature profiles in the drill pipe and annulus are evaluated
chosen because it is an efficient, easy to use scheme that allows for accurate
solutions without constraints on the time step used. The equations and
83
4.3.3 Equivalent Hydrostatic Head and ECD
The hydrostatic head for each of the discrete sections of the wellbore
for which the density is known is computed according to Eq. 2.1. In order to
compute the frictional pressure loss, the flow regime must first be known.
Thus, the Reynolds number is first computed according to Eq. 2.37. If the flow
regime is laminar, the frictional pressure drop is computed using Eq. 2.38 or
2.39. If the flow regime is turbulent, the friction factor is computed according
to Eq. 2.40 and 2.41. The frictional pressure loss is then computed according
Eq. 2.21.
chosen because it can model more complex geometries than the analytical
parameters are as detailed in Table 4.1. The numerical results from the
DDSimulator were compared with the results obtained using the analytical
method. Fig. 4.10 shows a plot of the temperature profile in the pipe and
84
Table 4.1 WELL AND MUD CIRCULATING PROPERTIES
FOR A GULF COAST WELL14
Well Geometry
Well Depth, ft 15000
Drill Stem OD, in. 6-5/8
Drill-Bit Size, in. 8-3/8
Circulation Rate, bbl/hour 300
Mud Properties
Inlet Temperature, oF 75
Plastic Viscosity, cp 20.9
Yield Strength, lbf/100 ft2 35.3
Thermal conductivity, Btu/ft-oF-hour 1
Specific Heat, Btu/lb-oF 0.4
Density, lb/gal 10
Formation Properties
Thermal conductivity, Btu/ft-oF-hour 1.3
Specific Heat, Btu/lb-oF 0.2
Density, lb/cu ft 165
Surface Earth Temperature, oF 59
Geothermal Gradient, oF/ft 0.0127
85
Temperature (oF)
0 50 100 150 200 250 300
0
2000
4000
6000
Depth (ft)
8000
10000
12000
14000
16000
Pipe Numerical Annulus Numerical
Geothermal Gradient Pipe Analytical
Annulus Analytical
86
Figure 4.10 shows the good agreement for the temperature profile
between the numerical model and the analytical method. The maximum
deviation between the two methods was less than 2%. The predicted flowing
hole temperature of 186 oF. Figure 4.10 also shows that the maximum
temperature in the well-bore may not occur at the bottom of the hole. As seen
in the figure, the maximum temperature in the well-bore for this particular
case occurs in the annulus several feet above the total vertical depth (TVD).
The shape of the temperature profile occurs as a result of the heat flow
equilibrium attained by the fluid as it flows down the drill-pipe and up the
annulus. As the fluid flows down the drill-pipe, it gains heat from the annular
fluid thereby increasing in temperature until it reaches the bottom of the hole.
Once the fluid enters the annulus, it starts to lose heat to the relatively cooler
drill pipe. However, for a certain length in the annulus, the formation is still
hotter and some heat is lost to the annular fluid. The annular fluid thus
increases in temperature, until the heat lost to the drill-pipe is greater than the
heat gained from the formation or the annular fluid temperature is actually
higher than the formation temperature, whichever occurs first. This process
length above the TVD, and the unique shape of the temperature profile.
The numerical model was also used to simulate reported field data.
The following data was obtained from a well in Matagorda County, Texas23.
87
The well had been drilled and cased with 5-1/2-in., 17 lbf/ft casing, and 2-1/2-
in. tubing was set without a packer at 8650-ft. Tests were conducted on the
temperature was 250 oF, with a temperature gradient of 2.03 oF/100 ft. The
well was circulated at 84 gal/min for 2 hours and 40 minutes. The bottom-hole
temperature of the fluid dropped to 213 oF. The well was then logged and
of the second circulation period was 224 oF. The well was circulated for 56
196 oF. These conditions were simulated using the numerical method, and
estimated to be 230 oF. This value has an 8% difference relative to the actual
measured value of 213 oF. The estimated bottom-hole temperature at the end
of the second circulation period was 199 oF. This is a 1.5 % difference from
88
Temperature
Depth (ft) (oF)
0 50 100 150 200 250 300
0
1000
2000
3000
T e m p e ra tu re ( o F )
4000
5000
6000
7000
Circulation Rate- 84 gal/min
8000 Circulation Time- 2 hrs 40 min
Fluid- Field Salt Water
9000
10000
89
Temperature
Depth (ft)
0 50 100 150 200 250 300
0
1000
2000
3000
Temperature (o F)
4000
5000
6000
7000
Circulation Rate- 252 gal/min
8000 Circulation Time- 56 min
Fluid- Field Salt Water
9000
10000
90
4.5 Dynamic Density Estimation
DDSimulator. The properties of the first well that was simulated are detailed
in Table 4.2. The temperature profile for the well is shown in Fig. 4.13. The
than the formation temperature for a large portion of the hole. As fluid moves
from the bottom of the hole upwards in the annulus, it looses heat to the pipe,
and for about 2000 ft up the annulus. It also gains heat from the formation.
Beyond this point, the annular temperature is higher than the formation
temperature. Thus, heat moves from the annulus into the formation as well as
into the drill-pipe. The rate of heat transfer across the pipe wall is very high
due to the high heat conductivity of steel and the high flow rate. Hence, the
temperature profiles in the annulus and drill pipe are very close.
The results of the ECD calculations are detailed in Table 4.3. The ECD
the fluid properties was 218 psi lower than the bottom-hole pressure obtained
using constant fluid properties. This is due to the volumetric behavior of the
drilling fluid. The decrease in the density of the fluid due to temperature is
more pronounced than the increase in density due to the pressure. Hence,
91
the bottom-hole pressure is less than one would expect if the density of the
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 22020 22238 -218
ECD (ppg) 24.6 24.9 -0.3
92
Figure 4.14 shows a plot of the bottom-hole pressure versus depth. It
increases with the final bottom-hole pressure obtained with constant fluid
o
Temperature ( F)
0 50 100 150 200 250 300 350 400 450
0
2000
4000
6000
8000
Depth (ft)
10000
12000
14000
Circulation Rate- 400 gal/min
16000
Circulation time- 5 hrs
Fluid- OBM
18000 Geothermal Grad- 0.02 oF/ft
20000
93
Annular Pressure
Annular Pressure (psi) (psi)
0 5000 10000 15000 20000 25000
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Circulation Rate- 400 gal/min
14000
Circulation time- 5 hrs
Fluid- OBM
16000
Geothermal Grad- 0.02 oF/ft
18000
Variable Fluid Properties Constant Fluid Properties
20000
Equivalent Equivalent
Circulating Density
Circulating Density (ppg)(ppg)
24 24.5 25 25.5 26 26.5 27 27.5 28 28.5
0
2000
4000
6000
8000
Depth (ft)
10000
12000
14000
Circulation Rate- 400 gal/min
Circulation time- 5 hrs
16000
Fluid- OBM
Geothermal Grad- 0.02 oF/ft
18000
Temperature/Pressure Dependent
Constant Fluid Properties
20000
94
The well parameters detailed in Table 4.2 were simulated using water
based drilling fluid. The results are shown in Table 4.4, and in Figs. 4.16 to
4.18. The results showed a similar trend to that obtained with oil-based drilling
fluid with the ECD obtained taking pressure and temperature conditions into
account being lower than the ECD calculated assuming constant fluid
properties.
studied. The same well properties as detailed in Table 4.2 were used. The
results are displayed in Tables 4.5 and 4.6, and in Figs. 4.19 to 4.24. As seen
in Tables 4.5 and 4.6, increase in the geothermal gradient results in a larger
assuming constant fluid density and viscosity with the constant property
results in a difference of 325 psi. These results show the higher fluid
expansion that occurs with a higher geothermal gradient. This trend is also
displayed in Figs. 4.21 and 4.24. Failure to take this effect into account during
drill operations could lead to the occurrence of a kick and possibly a blow-out.
95
Table 4.4 Well Simulation Results for
Parameters Detailed in Table 4.2
with Water-Based mud
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 18585 18792 -207
ECD (ppg) 20.8 21.0 -0.2
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 22128 22238 -110
ECD (ppg) 24.7 24.9 -0.2
96
Table 4.6 Well Simulation Results for
Parameters Detailed in Table 4.2
with gG = 0.025 oF/ft
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 21913 22238 -325
ECD (ppg) 24.5 24.9 -0.4
Temperature (oF)
0 50 100 150 200 250 300 350 400 450
0
2000
4000
6000
8000
D epth (ft)
10000
12000
14000
97
EquivalentEquivalent
Circulating Density
Circulating Density (ppg) (ppg)
20.5 21 21.5 22 22.5 23 23.5 24 24.5
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Circulation Rate- 400 bbl/hr
14000 Circulation time- 5 hrs
Fluid- WBM
16000 Geothermal Grad- 0.02 oF/ft
18000
Temperature/Pressure Dependent
Constant Fluid Properties
20000
Annular
AnnularPressure
Pressure (psi) (psi)
0 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000
0
2000
4000
6000
8000
Depth (ft)
10000
12000
20000
98
Temperature (oF)
0 50 100 150 200 250 300 350
0
2000
4000
6000
8000
Depth (ft)
10000
12000
14000
Circulation Rate- 400 bbl/hr
16000 Circulation time- 5 hrs
Fluid- OBM
18000 Geothermal Grad- 0.015 oF/ft
20000
2000
4000
6000
8000
Depth (ft)
10000
12000
20000
99
EquivalentEquivalent
Circulating Density
Circulating Density (ppg) (ppg)
24.5 25 25.5 26 26.5 27 27.5 28 28.5
0
2000
4000
6000
8000
Depth (ft)
10000
12000
o
Temperature ( F)
0 100 200 300 400 500 600
0
2000
4000
6000
8000
Depth (ft)
10000
12000
14000
Circulation Rate- 400 bbl/hr
16000 Circulation time- 5 hrs
Fluid- OBM
18000
Geothermal Grad- 0.025 oF/ft
20000
100
Annular Pressure
Annular Pressure (psi) (psi)
0 5000 10000 15000 20000 25000
0
2000
4000
6000
8000
Depth (ft)
10000
12000
20000
EquivalentEquivalent
Circulating Density
Circulating Density (ppg) (ppg)
24 24.5 25 25.5 26 26.5 27 27.5 28 28.5
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Circulation Rate- 400 bbl/hr
14000 Circulation time- 5 hrs
Fluid- OBM
16000 Geothermal Grad- 0.025 oF/ft
18000
Temperature/Pressure Dependent
Constant Fluid Properties
20000
101
The effect of varying the inlet temperature of the drilling fluid was also
studied. The well parameters detailed in Table 4.2 were simulated with an
inlet temperature into the drill pipe of 80 oF. Although the return temperature
and pressure after 5 hours of circulation did not change significantly from the
values obtained with an inlet temperature of 120 oF. The results are shown in
Table 4.7 and in Figs. 4.25 to 4.27. The ECD profile in the well during
circulation also did not change appreciably from the case of 120 oF pipe inlet
temperature. This trend indicates that the inlet temperature over a certain
range does not play an important role in the overall wellbore heat transfer
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 22029 22238 -209
ECD (ppg) 24.6 24.9 -0. 3
102
o
Temperature ( F)
0 50 100 150 200 250 300 350 400 450
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Annular Pressure
Annular Pressure (psi) (psi)
0 5000 10000 15000 20000 25000
0
2000
4000
6000
8000
Depth (ft)
10000
Circulation Rate- 400 bbl/hr
Circulation time- 5 hrs
12000
Fluid- OBM
14000
Geothermal Grad- 0.02 oF/ft
Inlet Temp = 80 oF
16000
18000
Variable Fluid Properties Constant Fluid Properties
20000
103
Equivalent Circulating
Equivalent Density
Circulating Density (ppg) (ppg)
24 24.5 25 25.5 26 26.5 27 27.5 28 28.5
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Circulation Rate- 400 bbl/hr
Circulation time- 5 hrs
14000
Fluid- OBM
Geothermal Grad- 0.02 oF/ft
16000
Inlet Temp = 80 oF
18000
Temperature/Pressure Dependent
Constant Fluid Properties
20000
also studied. The well parameters in Table 4.2 were simulated with a
circulation rate of 300 bbl/hr. The results are shown in Table 4.8 and Figs.
to 297 psi. This could be due to the fact that the bottom-hole temperature
increases slightly at the lower rate and will thus result in increased expansion
of the drilling fluid and a greater reduction in the fluid density. The circulation
rate thus plays a great role in the temperature and pressure profiles that will
104
Table 4.8 Well Simulation Results for
Parameters Detailed in Table 4.2
with Circulation Rate = 300 bbl/hr
Temperature/Pressure Constant
Dependent Property Difference
Bottom Hole Pressure
(psi) 18791 19089 -298
ECD (ppg) 21.0 21.3 -0.3
o
Temperature ( F)
0 50 100 150 200 250 300 350 400 450
0
2000
4000
6000
8000
D epth (ft)
10000
12000
20000
105
Annular
Annular Pressure
Pressure (psi) (psi)
0 5000 10000 15000 20000 25000
0
2000
4000
6000
8000
Depth (ft)
10000
12000
20000
EquivalentEquivalent
Circulating Density (ppg)
Circulating Density (ppg)
20.5 21 21.5 22 22.5 23 23.5 24 24.5 25
0
2000
4000
6000
8000
Depth (ft)
10000
12000
Circulation Rate- 300 bbl/hr
Circulation time- 5 hrs
14000 Fluid- OBM
Geothermal Grad- 0.02 oF/ft
16000 Inlet Temp = 120 oF
18000
Temperature/Pressure Dependent
Constant Fluid Properties
20000
106
Summary
Microsoft Visual Basic for Applications automated through Excel. This format
was chosen for ease of use and accessibility and access to Excel’s powerful
found that the bottom-pressure in the well is lower for the oil based mud that
well-bore during circulation are taken into account. This indicates that the
effect of the fluid expansion due to temperature was more pronounced than
Temperature thus plays a more pronounced role in this particular case. This
increasing geothermal gradient. The inlet temperature of the drilling fluid into
the drill-pipe was not found to have a significant effect on the bottom-hole
pressure even though it had an effect on the return temperature out of the
annulus. The circulation rate was found to play an important role in the
107
Chapter 5
5.1 Summary
pressure wells on the equivalent circulating density of the drilling fluid and on
of the drilling fluid while the high pressure conditions at deeper depths cause
cancel each other resulting in constant surface fluid density throughout the
hole pressure and ECD throughout the length of a circulating well-bore taking
into account the temperature and pressure conditions in the well-bore. The
well. The effects of temperature and pressure on the density and viscosity of
drilling fluids was studied in chapter 2, along with frictional pressure loss
108
estimation. Analytical and numerical methods for estimating the temperature
temperature profile into account the program then estimates the frictional
In the case of the oil based drilling fluid that was simulated, it was
temperature and pressure conditions, is lower than if the fluid properties are
5.2 Conclusions
109
3. The inlet pipe temperature does not have a significant effect on the
bottom-hole pressure.
5.3 Recommendations
problems such as
• Formation damage
• Unnecessary trips
including synthetic oil based drilling fluids, and drilling fluids with
110
chemical additives such as surfactants, flocculants, and fluid loss
encountered.
111
NOMENCLATURE
Af = Cross-sectional area
D = Pipe diameter
De = Equivalent diameter
f = Friction factor
f vo, fvw, fvs, fvc = Fractional volume of oil, water, solid weighting material, and
k = consistency index
L = Conduit length
P = pressure, psi
Pw = Wetted perimeter
V = Total volume
112
Vx = volume of component x
W = Weight
∆Pfriction = Pressure drop due to friction in the drill string and annulus
(psi)
λ = time constant
µa = apparent viscosity
µ = viscosity
µp = plastic viscosity
ρο1, ρw1 = Density of oil and water at temperature T1 and pressure P1,
respectively
ρο2, ρw2 = Density of oil and water at temperature T2 and pressure P2,
respectively
ρo1, ρw1 = Density of oil and water phases at reference conditions (p1,
T1)
113
ρs, ρc = Density of solids content and chemical additives
τ = shear stress
τo = yield stress
diesel
viscosity equation
diesel
density equation
114
REFERENCES
1. Davison, J.M., Clary, S., Saasen, A., Allouche, M., Bodin, D., Nguyen,
5. Peters, E.J., Chenevert, M.E. and Zhang, C.: “A Model for Predicting
115
8. Kutasov, I., and Sweetman, M.: “Method Predicts Equivalent Mud
During Deep Well Drilling”, SPE 27419, SPEDC, June 1996, pp. 91-97.
10. McMordie Jr., W.C., Bland, R.G. and Hauser, J.M.: “Effect of
on Drilling Fluid Rheology and ECD in Very Deep Wells”, SPE 39282,
13. Ramey, H.J., Jr: “Wellbore Heat Transimission,” JPT(April 1962) 427-
35
15. Arnold, F.C.: “Temperature Profile During Heated Liquid Injection,” Int.
116
17. Kabir, C.S., Hasan, A.R., Kouba, G.E., Ameen, M.M.: “Determining
25-227, 1992.
Difference Approach and Case History,” SPE 84583, Denver, Oct 5-8,
2003.
23. Tragasser, A.F., Crawford, P.B., Horace, R.: “A Method for Calculating
117
25. Muneer, T., Kubie, J., and Grassie, T.:Heat Transfer-A Problem
Solving Approach, Taylor & Francis Group, New York and London,
2003; pg 231.
27. Kraus, A.D., Aziz, A., and Welty, J.:Extended Surface Heat Transfer,
29. Welty, J.R., Wicks, C.E., Wilson, R.E., Rorrer, G.: Fundamentals of
Momentum Heat and Mass Transfer, John Wiley & Sons, 2001.
23, 103-106.
118
APPENDIX
Code for DDSimulator Program
119
Option Explicit
'This is a temperature profile object in which the methods to compute the pipe
and annular
'temperature profiles are contained
Dim Tax As WellProfile
'The following list conatins the depth coordinates at which temperature will be
computed
Dim Depth(200) As Double
Dim i As Integer
Dim imax As Integer
imax = Tax.iTotal
DppTotal = 0
DpaTotal = 0
If i > 0 Then
'compute plastic viscosity in cp
PlasticP = Tax.RefMudPlasticViscosity
PlasticA = Tax.RefMudPlasticViscosity
120
YieldA = Tax.RefMudYieldValue
Next i
End Sub
End Sub
Dim i As Integer
'The "Interval" refers to the distance between depths at which temperature will
be computed
121
Dim Interval As Double
For i = 0 To 200
Depth(i) = i * Interval
Tax.AnalyticalComputeTemp Depth(i)
Cells(i + 16, 8).Value = Tax.TPipe
Cells(i + 16, 9).Value = Tax.TAnnulus
End If
Next i
End Sub
'Note that terms bearing an "N" at the end signify data at the time step that
'is currently being evaluated.
'These matrices store the pressure profile with the pipe and annulus
Dim PipePressure() As Double
Dim AnnPressure() As Double
Dim PipePressureN() As Double
Dim AnnPressureN() As Double
122
Dim i As Integer
Dim j As Integer
Dim n As Integer
imax = Tax.iTotal
jMax = Tax.jTotal
nMax = Tax.nTotal
123
ReDim AnnPressure(imax)
ReDim rhoPipe(imax)
ReDim rhoAnnulus(imax)
'ReDim Uaaa(iMax)
'ReDim Uppp(iMax)
ReDim store1(imax)
ReDim store2(imax)
'Worksheets.Add.Name = "PipeTemperature"
'Worksheets.Add.Name = "AnnulusTemperature"
'Worksheets.Add.Name = "FormationTemperature"
Do
'Evaluate the pipe
Tax.EvaluatePipe FormTemperature(), FormTemperatureN(),
PipeTemperature() _
, PipeTemperatureN(), PipePressure(), PipePressureN(),
AnnTemperature() _
124
, AnnTemperatureN(), AnnPressure(), AnnPressureN(), imax
If i = 0 Then
PipePressureN(i) = 14.7
Else
rhoPipe(i - 1) = Tax.MudDensity(PipeTemperatureN(i - 1),
PipePressureN(i - 1))
PipePressureN(i) = PipePressureN(i - 1) + 0.052 * rhoPipe(i - 1) *
Tax.DeltaZ
End If
Next i
If i = 0 Then
AnnPressureN(i) = 14.7
Else
rhoAnnulus(i - 1) = Tax.MudDensity(AnnTemperatureN(i - 1),
AnnPressureN(i - 1))
AnnPressureN(i) = AnnPressureN(i - 1) + 0.052 * rhoAnnulus(i - 1) *
Tax.DeltaZ
End If
Next i
err = 0
'check for convergence
125
For i = 0 To imax
check1 = ((AnnTemperatureN(i) - store1(i)) ^ 2) ^ (1 / 2)
check2 = ((FormTemperatureN(i, 0) - store2(i)) ^ 2) ^ (1 / 2)
check3 = ((PipeTemperatureN(imax) - AnnTemperatureN(imax)) ^ 2) ^
(1 / 2)
If check1 > err Then
err = check1
End If
If check2 > err Then
err = check2
End If
If check3 > err Then
'err = check3
End If
Next i
Next n
126
Next i
DppTotal = 0
DpaTotal = 0
If i > 0 Then
'compute plastic viscosity in cp
PlasticP = Tax.MudPlasticViscosity(PipeTemperatureN(i),
PipePressureN(i))
PlasticA = Tax.MudPlasticViscosity(AnnTemperatureN(i),
AnnPressureN(i))
127
Worksheets("AnnulusTemperature").Cells((i + 2), 7).Value =
AnnPressureN(i)
Next i
End Sub
Option Explicit
'Formation Properties
Public kF As Double
Public cF As Double
Public FormationDensity As Double
Public alpha As Double
'The maximum formation radius that will be considered (ft)
'a.k.a r-infinity
Public rMax As Double
'Undisturbed formation temperature at the maximum depth considered
Public Tmax As Double
'annular radius
Public ra As Double
128
'outer pipe radius
Public rp As Double
'inner pipe radius
Public rpi As Double
'heat conduction coefficient of pipewall
Public kp As Double
'heat conduction coefficient of cement
Public kcement As Double
'equivalent diameter of the annulus
Public de As Double
'Heat Transfer coefficients across pipewall and across annulus/formation
interface
'in Btu/(hour-ft2-oF)
Public Ua As Double
Public Up As Double
'Analytical parameters
Public DTime As Double
Public DTimeFunc As Double
Public sigma As Double
Public gammaOne As Double
Public gammaTwo As Double
Public COne As Double
Public CTwo As Double
'Temperature in the annulus and pipe (oF) terms used in analytical analysis
Public TAnnulus As Double
Public TPipe As Double
129
Public az As Double
mRate = Range("B20").Value
cfl = Range("B11").Value
kfl = Range("B10").Value
kF = Range("B14").Value
cF = Range("B15").Value
FormationDensity = Range("B16").Value
ra = Range("B5").Value
rp = Range("B4").Value
rpi = Range("B34").Value
kp = Range("B25").Value
Ua = Range("B24").Value
Up = Range("B23").Value
rMax = Range("B22").Value
alpha = Range("B21").Value
time = Val(Application.Worksheets("Sheet1").CirculationTime.Value)
gG = Range("B18").Value
TVD = Range("B3").Value
TFs = Range("B17").Value
Tps = Range("B7").Value
kcement = 0.025
RefTemp = Range("B27").Value
RefPress = Range("B28").Value
RefMudDensity = Range("B29").Value
RefMudPlasticViscosity = Range("B30").Value
RefMudYieldValue = Range("B31").Value
OilFraction = Range("B32").Value
WaterFraction = Range("B33").Value
de = 2 * (ra - rp)
130
'Tdiff = Tps - TFs + beta * gG
'numerical intervals
DeltaT = 0.05
DeltaZ = TVD / 200
DeltaR = rMax / 100
'compute iTotal
If ((TVD / DeltaZ) - Int(TVD / DeltaZ)) < 0.5 Then
iTotal = Int(TVD / DeltaZ)
Else
nTotal = Int(TVD / DeltaZ) + 1
End If
'compute jTotal
If ((rMax / DeltaR) - Int(rMax / DeltaR)) < 0.5 Then
jTotal = Int(rMax / DeltaR)
Else
jTotal = Int(rMax / DeltaR) + 1
End If
'compute nTotal
If ((time / DeltaT) - Int(time / DeltaT)) < 0.5 Then
nTotal = Int(time / DeltaT)
Else
nTotal = Int(time / DeltaT) + 1
End If
End Sub
131
Rem IMPLICIT REAL*8(A-H,O-Z)
Rem COMMON AS,BS,S,ISTEP
Rem C IF (X.LE.0) WRITE(10,10) X
XX = Abs(X)
Rem C
Rem C 1<=X<infinity. 5.1.56 Abramowitz & Stegun.
Rem C
A1 = XX ^ 4
A = A1 + 8.5733287401 * XX ^ 3
A = A + 18.059016973 * XX ^ 2 + 8.6347608925 * XX
A = A + 0.2677737343
B = A1 + 9.5733223454 * XX ^ 3
B = B + 25.6329561486 * XX ^ 2 + 21.0996530827 * XX
B = B + 3.9584969228
ExpInt = A / B / XX / Exp(XX)
GoTo 2
Rem Return
Rem C
Rem C 0<=X<=1 5.1.53 Abramowitz & Stegun.
Rem C
1 A = -0.57721566 + 0.99999193 * XX - 0.24991055 * XX ^ 2
A = A + 0.05519968 * XX ^ 3 - 0.00976004 * XX ^ 4
A = A + 0.00107857 * XX ^ 5
132
ExpInt = A - Log(XX) / Log(Exp(1#))
Rem Return
Rem End
Rem C
End Function
Pie = Application.WorksheetFunction.Pi
End Function
Absolute = Application.WorksheetFunction.Abs(X)
End Function
NatLg = Application.WorksheetFunction.Ln(X)
End Function
'---------------------------TRIDIAGONAL ALGORITHM
Public Sub ThomasAlgorithm(A() As Double, B() As Double, C() As Double,
D() As Double, X() As Double, n As Integer)
Dim i As Integer
For i = 1 To n
B(i) = B(i) - A(i) * C(i - 1) / B(i - 1)
D(i) = D(i) - A(i) * D(i - 1) / B(i - 1)
Next i
' Back Substitution
X(n) = D(n) / B(n)
For i = n - 1 To 0 Step -1
X(i) = (D(i) - C(i) * X(i + 1)) / B(i)
Next i
End Sub
133
Public Sub AnalyticalConstants()
'The following code will calculate the constants "sigma", "gammaOne",
'"gammaTwo", "COne", and "CTwo"
'mRate = mass flow rate, cfl = fluid heat capacity, kF = formation
'conductivity, ra = annular radius, Ua = annular heat transfer coeff,
'aplha = k/(rho*cF), time = length of time of fluid circulation,
'beta = m*cfl/(2*Pi*rp*Up), gG = formatin temp grad. , TVD = Total
'vertical depth, Tdiff = (Tfs - Tps - beta*gG)
End Sub
TAnnulus = AnalyticalAnnularTemp(z)
TPipe = AnalyticalPipeTemp(z)
134
End Sub
End Function
End Function
End Function
If L = 0 Then
L = DeltaZ / 2
End If
135
NusseltNum = 6.49
End If
End Function
End Function
Public Function PressureDrop(Re As Double, Diameter As Double,
Roughness As Double _
, L As Double, rho As Double, v As Double) As Double
'Re- Reynold's #
'D - diameter in question (ft)
'e - Pipe roughness (ft)
Dim F As Double
136
End Function
End Function
End Function
Dim A As Double
Dim B As Double
Dim C As Double
Dim D As Double
Dim E As Double
Dim F As Double
Dim G As Double
A = -23.1888
B = -0.00148
C = -0.9501
D = -1.9776 * 10 ^ -8
E = 3.3416 * 10 ^ -5
F = 14.6767
G = 10.9973
137
OilViscosity = P * ((T * P) ^ C) * 10 ^ (A + B * T + D * T * P + E * P + F *
OilDensity(T, P) + G / OilDensity(T, P))
End Function
End Function
End Function
Dim A As Double
Dim B As Double
Dim C As Double
A = -0.186
B = 145.054
C = -3410.322
If T >= 90 Then
MudYieldValue = RefMudYieldValue * (A + B * (T ^ -1) + C * (T ^ -2)) / (A +
B * (RefTemp ^ -1) + C * (RefTemp ^ -2))
Else
MudYieldValue = RefMudYieldValue
138
End If
End Function
'Compute Reynold's #
Re = ReynoldsNum(rho, velocity, D1, mu)
'Compute Prandtl #
Pr = mu * cfl / kfl
'Compute Nusselt #
Nu = NusseltNum(Re, Pr, D1, L)
End Function
139
Dim i As Integer
Dim j As Integer
Dim hi As Double
Next i
End Sub
140
Dim D() As Double
Dim X() As Double
Dim i As Integer
Dim j As Integer
ReDim A(jMax)
ReDim B(jMax)
ReDim C(jMax)
ReDim D(jMax)
ReDim X(jMax)
ReDim E(jMax)
ReDim G(jMax)
ReDim K(jMax)
F = 1 + alpha * ar
L = 1 - alpha * ar
H = 1 + 2 * alpha * ar
Q = 1 - 2 * alpha * ar
For i = 0 To imax
141
+ (Pie * (4.892 ^ 2) * NatLg(6.108 / 5.5) / (2 * Pie * kcement * DeltaZ))) ^
(-1)
'Uaa = Ua
'construct matrix equation for formation at particular depth coordinate i
For j = 0 To jMax
If j = 0 Then
A(j) = 0
B(j) = H + alpha * ar * 2 * DeltaR * Uaa / kF
C(j) = -2 * alpha * ar
D(j) = (alpha * ar * 2 * DeltaR * Uaa / kF) * AnnTemp(i) _
+ (Q - alpha * ar * 2 * DeltaR * Uaa / kF) * FormTemp(i, j) _
+ (2 * alpha * ar) * FormTemp(i, (j + 1)) _
+ (alpha * ar * 2 * DeltaR * Uaa / kF) * AnnTempN(i)
'A(j) = 0
'B(j) = 1
'C(j) = 0
'D(j) = TFs + (gG * i * DeltaZ)
A(j) = E(j)
B(j) = F
C(j) = 0
D(j) = K(j) * FormTemp(i, (j - 1)) + L * FormTemp(i, j) _
+ (-G(j)) * (TFs + (gG * i * DeltaZ)) - G(j) * (TFs + (gG * i * DeltaZ))
Else
A(j) = E(j)
B(j) = F
C(j) = G(j)
D(j) = K(j) * FormTemp(i, (j - 1)) + L * FormTemp(i, j) _
+ (-G(j)) * FormTemp(i, (j + 1))
End If
142
Next j
ThomasAlgorithm A, B, C, D, X, jMax
'update the temperature in the formation grid
For j = 0 To jMax
FormTempN(i, j) = X(j)
Next j
Next i
End Sub
Dim E As Double
Dim F As Double
Dim G As Double
Dim H As Double
Dim L As Double
Dim M As Double
Dim i As Integer
143
'annular temperature
Dim Re As Double
Dim mi As Double
Dim fa As Double
Dim so As Double
Dim theta As Double
ReDim A(imax)
ReDim B(imax)
ReDim C(imax)
ReDim D(imax)
ReDim X(imax)
theta = 2 / 3
'UaaN = Ua
Re = mRate * cfl
144
/ (2 * DeltaT)
For i = 0 To (imax - 1)
145
ho = ConvectiveHeatTransCoeff(AnnTemp(i), Annpress(i) _
, ((100 - i) * DeltaZ), de, 2 * rp)
'Uaa = Ua
'UaaN = Ua
'Upp = Up
'UppN = Up
F = 2 * Pie * ra * UaaN
G = 2 * Pie * rp * UppN
L = 2 * Pie * ra * Uaa
M = 2 * Pie * rp * Upp
Select Case i
Case 0
A(i) = 0
B(i) = F * theta + G * theta + H
C(i) = -E * theta
D(i) = -E * (1 - theta) * (AnnTemp(i) - 2) _
+ (H - L * (1 - theta) - M * (1 - theta)) * AnnTemp(i) _
+ E * (1 - theta) * AnnTemp(i + 1) + L * (1 - theta) * FormTemp(i, 0) _
+ M * (1 - theta) * PipeTemp(i) + F * theta * FormTempN(i, 0) _
+ G * theta * PipeTempN(i) - E * theta * (AnnTempN(i) - 1)
146
Case (imax - 1)
A(i) = E * theta
B(i) = F * theta + G * theta + H
C(i) = 0
D(i) = -E * (1 - theta) * AnnTemp(i - 1) _
+ (H - L * (1 - theta) - M * (1 - theta)) * AnnTemp(i) _
+ E * (1 - theta) * AnnTemp(i + 1) + L * (1 - theta) * FormTemp(i, 0) _
+ M * (1 - theta) * PipeTemp(i) + F * theta * FormTempN(i, 0) _
+ G * theta * PipeTempN(i) + E * theta * AnnTempN(imax)
Case Else
A(i) = E * theta
B(i) = F * theta + G * theta + H
C(i) = -E * theta
D(i) = -E * (1 - theta) * AnnTemp(i - 1) _
+ (H - L * (1 - theta) - M * (1 - theta)) * AnnTemp(i) _
+ E * (1 - theta) * AnnTemp(i + 1) + L * (1 - theta) * FormTemp(i, 0) _
+ M * (1 - theta) * PipeTemp(i) + F * theta * FormTempN(i, 0) _
+ G * theta * PipeTempN(i)
End Select
Next i
ThomasAlgorithm A, B, C, D, X, (imax - 1)
'Update annulus temperature in finite difference grid
For i = 0 To (imax - 1)
AnnTempN(i) = X(i)
Next i
End Sub
147
Dim E As Double
Dim F As Double
Dim G As Double
Dim H As Double
Dim L As Double
Dim M As Double
Dim mi As Double
'This parameter is used to weight the numerical solution
' at the bottom of the hole. A value of half gives the
'Crank-Nicholoson scheme
Dim theta As Double
Dim i As Integer
ReDim A(imax)
ReDim B(imax)
ReDim C(imax)
ReDim D(imax)
ReDim X(imax)
theta = 2 / 3
E = mRate * cfl / (2 * DeltaZ)
For i = 1 To imax
148
hi = ConvectiveHeatTransCoeff(PipeTemp(i), PipePress(i), (i * DeltaZ), 2 *
rpi _
, 2 * rpi)
'Upp = Up
G = 2 * Pie * rp * Upp
H = 2 * Pie * rp * Upp
Select Case i
Case 1
A(i - 1) = 0
B(i - 1) = F + G * theta
C(i - 1) = E * theta
D(i - 1) = E * (1 - theta) * PipeTemp(i - 1) + (F - H * (1 - theta)) *
PipeTemp(i) _
- E * (1 - theta) * PipeTemp(i + 1) + H * (1 - theta) * AnnTemp(i) _
+ G * theta * AnnTempN(i) + E * theta * PipeTempN(i - 1)
Case imax
'Uaa = Ua
L = mRate * cfl
149
M = 7.48 * MudDensity(PipeTempN(i), PipePressN(i)) * Pie * (ra ^ 2) *
DeltaZ _
* cfl / 2 * DeltaT
'M = 7.48 * RefMudDensity * Pie * (ra ^ 2) * DeltaZ * cfl / 2 * DeltaT
A(i - 1) = theta * L
B(i - 1) = -theta * L - M
C(i - 1) = 0
D(i - 1) = -(1 - theta) * L * PipeTemp(i - 1) + ((1 - theta) * L - M) _
* PipeTemp(i) - mi * theta * FormTempN(i, 0) _
- mi * (1 - theta) * FormTemp(i, 0) + mi * theta * AnnTempN(i) _
+ mi * (1 - theta) * AnnTemp(i)
Case Else
A(i - 1) = -E * theta
B(i - 1) = F + G * theta
C(i - 1) = E * theta
D(i - 1) = E * (1 - theta) * PipeTemp(i - 1) _
+ (F - H * (1 - theta)) * PipeTemp(i) _
- E * (1 - theta) * PipeTemp(i + 1) _
+ H * (1 - theta) * AnnTemp(i) + G * theta * AnnTempN(i)
End Select
Next i
ThomasAlgorithm A, B, C, D, X, (imax - 1)
'Update pipe temperature in finite difference grid
For i = 0 To (imax - 1)
PipeTempN(i + 1) = X(i)
Next i
End Sub
150