Downhole Temperature Modeling for Non-Newtonian Fluids in ERD Wells

Having precise information of fluids’ temperatures is a critical process during planning of drilling operations, especially for extended reach drilling (ERD). The objective of this paper is to develop an accurate temperature model that can precisely calculate wellbore temperature distributions. An established semitransient temperature model for vertical wellbores is extended and improved to include deviated wellbores and more realistic scenarios using non-Newtonian fluids. The temperature model is derived based on an energy balance between the formation and the wellbore. Heat transfer is considered steady-state in the wellbore and transient in the formation through the utilization of a formation cooling effect. In this paper, the energy balance is enhanced by implementing heat generation from the drill bit friction and contact friction force caused by drillpipe rotation. A nonlinear geothermal gradient as a function of wellbore inclination, is also introduced to extend the model to deviated wellbores. Additionally, the model is improved by considering temperature dependent drilling fluid transport and thermal properties. Transport properties such as viscosity and density are obtained by lab measurements, which allows for investigation of the effect of non-Newtonian fluid behavior on the heat transfer. Furthermore, applying a non-Newtonian pressure loss model enables an opportunity to evaluate the impact of viscous forces on fluid properties and thus the overall heat transfer. Results from sensitivity analysis of both drilling fluid properties and other relevant parameters will be presented. The main application area of this model is related to optimization of drilling fluid, hydraulics, and wellbore design parameters, ultimately leading to safe and cost efficient operations.


Introduction
Extended reach drilling (ERD) is a term that involves wells with large horizontal displacements.ERD wells have emerged in the early 1990's as technologies were improved to achieve optimized and cost efficient solutions.The improvement of technologies was necessary to access reservoirs that previously were not economically or technically feasible to produce.This gave an opportunity to extend the life of mature fields and to optimize field development through a reduction of drilling sites and structures, see Payne et al. (1994).Furthermore, ERD designs give the ability to increase the drainage capability of a reservoir by installing horizontal completions over large sections.
Compared to a conventional design, ERD wells often have longer sections with higher inclinations.An ERD design results in challenges that are less pronounced in the conventional design.For example, drilling fluid design is critical for ERD wells.Controlling drilling fluid properties can be an issue for deep and long wells, and problems related to borehole stability, lost circulation, barite sag, ECD management, torque and drag, and hole cleaning might occur, see Cameron (2001).Another important aspect of ERD designs is wellbore temperature effect.Drilling further and deeper comes with an increased formation temperature, and it is not unusual that ERD wells are exposed in high pressure and high temperature (HPHT) conditions.High temperatures have the potential to cause severe operational problems.For example, increasing temperatures will affect the ability of the drilling fluid to maintain its properties and thus ensure well control and avoid the problems listed above.Additionally, high temperatures can be a limiting factor for downhole drilling tools and the ability to perform directional control and logging.It is consequently critical to provide realistic estimations of wellbore temperatures.Therefore, the objective of this paper is to develop a sophisticated temperature model that can predict accurate wellbore temperature distributions for ERD applications.
In a drilling scenario, temperature differences between the wellbore and the formation result in a transfer of thermal energy.Heat may flow from the formation to the wellbore or vice versa depending on the relative temperatures.For example, if the formation temperature is higher than the wellbore temperature at a certain depth, the wellbore system will gain energy in terms of heat.By nature, the heat will continue to flow from the formation to the wellbore until a thermal equilibrium is reached.In our work, temperature dependent drilling fluids' transport and thermal properties are considered to improve the accuracy of the temperature model.Experiments have been performed to determine the behavior of drilling fluids' density and viscosity under high pressure and high temperature conditions.Measurements of viscosity allow the effect of non-Newtonian behavior to be included in the convective heat transfer processes.In addition, applying a non-Newtonian pressure loss model enables an opportunity to incorporate the impact of non-Newtonian behavior on the wellbore pressure distribution and thus pressure dependent drilling fluid properties.Another important aspect of the approach presented in this work, is the introduction of mechanical heat source terms.Mechanical heat generation that occurs during drilling processes has the potential to affect wellbore temperature distributions.To give a better estimation of wellbore heat transfer processes, heat generation due to drill pipe rotation, drill bit friction, frictional pressure losses, and the Joule-Thomson effect is considered in the model.
Results from a sensitivity analysis indicate that parameters related to the hydraulics of a wellbore system have a significant effect on temperature distributions.Circulation rate is found to be a major contributor.Drilling fluid viscosity, density, and specific heat capacity (SHC) have also shown significant effect on temperature distributions.On the other hand, mechanical processes and heat generation due to friction are found to be less dominant.The model presented in this paper provides an accurate calculation for wellbore temperature distribution with the possibility to enhance drilling performance and optimize well design for ERD wells.

Convective heat transfer coefficient
Convection is defined as the heat transfer that occurs between a surface and a moving fluid at different temperatures, see Theodore et al. (2011).During circulation, since the fluid and the conduit surface have different temperatures, a convective heat transfer will occur.Close to the wall of a conduit, the fluid's velocity approaches zero and diffusion (conduction) dominates the heat transfer.Here, heat is transferred from the wall surface to the nearby fluid's layer by random molecular motion.The heat going into this layer is transferred further away from the wall by the bulk motion of the fluid, and into the high velocity region.The expression for the convective heat transfer process is given by Newton's law of cooling: where q is the heat flux, h is the convective heat transfer coefficient (CHTC), T s and T m represent the temperature of the conduit surface and the mean fluid's temperature respectively.In terms of the heat transfer process in the wellbore, there exists a convective heat transfer among drill pipe fluid, drill pipe wall, and annulus fluid.The same process occurs among annulus fluid, casing wall, cement layer, and formation.Instead of applying equation (1) to describe these processes individually, an overall heat transfer coefficient (OHTC) is used to consider the net resistance of heat flow over several layers.The convective heat transfer is modeled by the following equations, see Kabir et al. (1996) for more details: where q ap and q wa represent the overall rate of heat transfer from the annulus to the drill pipe and from the formation/wellbore interface to the annulus respectively; r pi is the inner radius of pipe; r ci is the inner radius of casing; T a and T p are fluid's temperature inside the annulus and drillpipe respectively; T w is the wellbore temperature and L is the volume length.The OHTC of fluids inside the pipe, U p , and the one of fluids inside the annulus, U a are given in Thompson and Burgess (1985) as where h a and h p are CHTC for fluids inside the annulus and the pipe respectively; r po is the outer radius of pipe; r co is the outer radius of casing; r w is the wellbore radius; k p is the thermal conductivity (TC) of pipe; k c is the TC of casing and k ct is the TC of cement.Inspecting the equations above reveals that the CHTC plays an important role for the heat rate and thus the wellbore temperature distribution.The CHTC is determined by the dimensionless Nusselt number, N u , and the TC of fluids, k f , as: where D is the diameter of the volume.N u gives a relationship between the convective and the conductive heat transfer, and a large Nusselt number indicates an efficient convection process.For laminar flow in the pipe, the Nusselt number takes a constant value: with the assumption of a uniform wall heat flux, see Theodore et al. (2011).In (7), Re is the Reynold's number to describe different flow regimes occurring in a flowing medium as where ρ is the fluid density, v is the fluid velocity , and µ app is the apparent viscosity of fluids.The laminar region is for R e ≤ 2300, the transitional region is for 2300 < R e ≤ 4000, and the turbulent region is for R e > 4000.For the laminar flow in the annulus, the following correlation in Seider and Tate (1936) is used to calculate N u : where P r is Prandtl number which approximates a number for the ratio of momentum diffusivity to thermal diffusivity.It is defined as where c p is specific heat capacity (SHC) of fluids.Estimating the Nusselt number for turbulent flow is more complex.It is shown that the CHTC is heavily affected by fluid properties and flow geometry.It is therefore common to use correlations to estimate the Nusselt number for turbulent flow.A summary of the most common correlations is for example given in Santoyo et al. (2003).In this study, the correlation in Gnielinski (1976) is used for transitional and turbulent flow in both pipe and annulus: where f D is the friction factor.Equations ( 7), ( 9) and (11) provide valuable information about which parameters control the CHTC and thus affect the wellbore temperature distribution.It is especially of interest to determine to what extent the impact of drilling fluid transport and thermal properties on heat transfer processes in a wellbore system.In the following subsections, the density, viscosity and pressure loss models which account for pressure and temperature information will be presented and discussed.

Density model
Drilling fluid is a critical factor for drilling operations to ensure borehole stability, drill bits' cooling, pressure and well control.These functions are maintained through controlling the wellbore pressure and thus the drilling fluids' density.Consequently, it becomes important to give accurate estimations of density distributions.Density of a drilling fluid varies with pressure and temperature.An increase of pressure will compress the drilling fluid and result in an increase of density.Increasing the temperature on the other hand, expands the drilling fluid and decreases the density.Variations in density with temperature and pressure are well-known effects, and the intention in this work is to investigate the effect of density on heat transfer processes.
The linearized equation of state as shown below, is applied to determine the density behavior with varying pressure and temperature, see Stamnes (2011) for deep details.
where ρ 0 , P 0 and T 0 represent the density, pressure, and temperature at the point of linearization.The cubical expansion coefficient and the isothermal bulk modulus of the drilling fluid are given by α and β respectively.In this work, the cubical expansion coefficient and the isothermal bulk modulus have been determined through a regression analysis of pressurevolume-temperature (PVT) data of an oil-based mud.

Viscosity model
Viscosity is a key parameter to consider when determining fluid's rheology and how it affects the rate of heat transfer in the wellbore.In increasing pressures and isothermal conditions, a general trend of increased viscosity is observed, and increasing the temperature during isobaric conditions results in a decrease of the viscosity, see Poling et al. (2001).It is therefore important to include pressure and temperature dependent viscosity behavior to show the effect of viscosity on wellbore heat transfer.
Another factor to consider is the non-Newtonian nature of drilling fluids.Santoyo et al. (2003) reported that temperature dependent viscosities of Newtonian and non-Newtonian fluids differ significantly in heat transfer process.Using a Newtonian viscosity model for non-Newtonian drilling fluids will overestimate the CHTC and the rate of heat transfer in the wellbore.In this study, a general Herschel-Bulkley (HB) fluid is considered, where τ is shear stress, τ 0 is yield stress, K is consistency index, γ is shear rate and n is flow index.The coefficients τ 0 , K and n are pressure and temperature dependent in this work and are also determined from the rheology lab data of fluids under different pressure and temperature conditions.The apparent viscosity of the HB-fluid can be determined as: Unlike Newtonian fluid, the apparent viscosity of non-Newtonian fluids depends on shear rate and thus fluid velocity.A relation between flow velocity and rheological behavior is consequently necessary to calculate the corresponding apparent viscosity.In Section 2.4, a pressure loss model for HB fluids is presented.This model also includes a relation between wall shear stress and flow rate that is taken advantage of to obtain the apparent viscosity.

Pressure loss
As discussed above, thermal properties of drilling fluids are sensitive to transport properties such as density and viscosity.It was also suggested that the effect of non-Newtonian behavior on viscosity should not be ignored.The transport properties are functions of both pressure and temperature, thus pressure loss calculations will ultimately influence the thermal properties and the accuracy of the temperature distribution.Additionally, the pressure losses through a wellbore serve as an energy source which adds the heat to the system.It is therefore important to choose an appropriate pressure loss model.Many works have addressed the topic of non-Newtonian flow and frictional pressure losses.One of the most cited articles is a study by Metzner and Reed (1955).They performed experiments with power-law fluids and defined how the friction factor varies with Reynolds number for laminar, transitional, and turbulent flow.Four decades later, Reed and Pilehvari (1993) presented an analytical procedure to determine frictional pressure losses for power-law, Bingham plastic, and HB fluids based on the work of Metzner and Reed (1955).A more recent study by Fan et al. (2014) that provides an improved model for HB fluids is considered in our work.It follows the similar approach given in Reed and Pilehvari (1993) and Pilehvari (1993) and Fan et al. (2014), is defined as where D ef f is the generalized effective diameter.The generalized Reynolds number is applied to the fanning friction factor to determine the pressure drop of laminar flow: For transitional and turbulent flow, the friction factor is obtained by implementing a modified version of Colebrook's equation.It is valid for any time-independent fluids flowing through pipes and concentric annuli, see Reed and Pilehvari (1993): where ε is the pipe roughness and n is the generalized flow index which will be discussed later.The expression for the pressure loss is then given as

Pipe flow
For the flow in the pipe, the generalized effective diameter is defined as where n p is the generalized flow index for pipe flow which is calculated by In Metzner and Reed (1955), they presented a generalized expression for the wall shear rate, γ w,p , as In Fan et al. (2014), a relationship for pipe flow rate and wall shear stress for HB fluids is given as: where Q is flow rate.If Q is given, the wall shear stress τ w,p can be easily solved from ( 22).Considering HBfluids, the wall shear rate can be obtained from ( 13) as Due to the limited space, the detailed computational procedure for calculating the apparent viscosity and the pressure drop for HB-fluids is given in Appendix A.

Annular flow
For the flow in the annulus, the generalized effective diameter is defined in Metzner and Reed (1955) as where D h is the hydraulic diameter and n a is the generalized flow index for annular flow which is given as The generalized expression for the wall shear rate, γ w,a , is defined in Metzner and Reed (1955) as Fan et al. ( 2014) also derived a relationship for annular flow rate and wall shear stress for HB-fluids: where r θ is the annular clearance.The wall shear stress, τ w,a can be easily calculated from ( 27).Similar as ( 23), the wall shear rate regarding annular flow can be obtained as 3 Energy Sources There are many mathematical models that describe temperature distributions of drilling fluids.Raymond (1969) presented numerical solutions of temperature profile for a circulating fluid system during transient and pseudo steady-state conditions.One year later, Holmes and Swift (1970) presented an analytical solution of temperature distributions assuming steadystate heat transfer between annulus and drill pipe.Another similar study on the temperature of drilling fluids during circulation was given by Kabir et al. (1996).The intention of these models is to provide estimates of temperatures and a better understanding of downhole conditions that might occur during drilling operations.However, these models do not consider processes during a drilling operation that introduce additional heat to the wellbore system.Heat generation from mechanical energy sources present during drilling may have significant effect on the temperature distributions, see Keller et al. (1973).To provide a more realistic solution, the energy sources, e.g., mechanical energy and heat transfer due to the pressure change are included in this work.

Mechanical energy
Friction refers to the force that resists relative motion of two solid objects in contact.The mechanical energy that exists in the process where two solid objects slide against each other is converted to heat.The energy dissipation which is termed frictional heating, results in a temperature increase at the interface between the two objects.In a deviated wellbore, the drill pipe tends to lay at the low side of the wellbore.Consequently, friction occurs at the drill pipe and casing/formation interface and heat is generated during rotation.The frictional force is proportional to the normal force applied by the drill pipe.In highly deviated sections or sharp bends and doglegs where the normal force may be large, an amount of heat can be generated.To quantify the amount of heat that is generated because of wellbore friction, the equation proposed by Kumar and Samuel (2013) is applied in this work: where q p is downhole power loss, τ q is the torque acting on the drill pipe due to wellbore friction and RPS represents the drill pipe rotations per second.In this paper, τ q is calculated by a 3D wellbore friction model given by Aadnoy et al. (2010).This model gives an analytical solution of torque and drag that applies for straight sections, build-up-bends, drop-off-bends, side bends, and any combination of these situations.Additionally, it offers the opportunity to include the effect of combined axial motion and rotation.The equations to calculate the torque is presented in Appendix B.
When the drill bit works on the formation to crush the rock, friction occurs at the interface of the bit and the formation, thus the heat is generated.As stated previously, it is reasonable to assume that all the energy dissipation in this process is converted to thermal energy.However, there seems to be a lack of research on how to quantify the amount of mechanical energy that is necessary to crush the rock and thus how large the potential of heat generation is.Keller et al. (1973) suggested that 40% of the mechanical input used to rotate the drill pipe is spent on penetrating the formation.Corre et al. (1984) stated that depending on the lithology, about 10% of the mechanical input would be enough.Still, none of them gave any reason behind the proposed percentages, making it hard to assess accuracy of the estimations.The intention of this work therefore shifts from quantifying the exact amount of heat generated from crushing the rock to evaluating the actual effect heat generation from the bit impose on the temperature distribution.
Alternatively, mechanical specific energy (MSE) might be a good indicator for having an idea to estimate the heat generated from the bit friction.MSE is a term that gives the energy required to remove a unit volume of rock.It is defined by the general expression in Hamrick (2011): where W OB is weight on bit, RP M is rotation per minute, Area is wellbore area, τ b is torque bit and ROP is rate of penetration.The heat generated from penetrating the rock can be possibly estimated as where RP S b is drill bit rotations per second and λ b is the model coefficient to describe the efficiency of the work.
Another source of heat occurs as drilling fluids are circulated through drill pipe and annulus.Whenever a fluid flows through a pipe, a velocity gradient is present in the fluid.The velocity gradient appears because the fluid in contact with the pipe surface has zero velocity according to the no-slip condition, see Munson et al. (2006).Close to the wall, the velocity gradient will be large and layers of fluid will move relative to each other.The friction that occurs between these layers because of fluid viscosity, results in a pressure drop and consequently heat generation during circulation.The heat due to the friction of fluid circulation is given as

Joule-Thomson effect
As a liquid or a gas is either compressed or expanded, a subsequent change of temperature is experienced.
Whether the temperature decreases or increases depends on the original state of the fluid.To consider this effect in the temperature model, the Joule-Thomson (JT) coefficient is implemented.The JT coefficient describes how the temperature of a fluid is affected by changes in pressure at constant enthalpy, see Maghari and Safaei (2007).The change of temperature due to pressure changes is mathematically described as where µ JT is the JT coefficient.The approach in Alves et al. (1992) has been employed to calculate the JT coefficient for the drilling fluid as By introducing the linearized density model given in ( 12), the equation becomes The heat due to the JT effect can be finally expressed as where m is the mass rate.The JT coefficient may take a positive or negative sign.The point at which the sign changes is referred to as the inversion point.A negative sign indicates that the drilling fluid will heat as it expands and cool as it compresses.Consequently, the reduction in pressure with the flow direction in the annulus will introduce heat to the system.However, a reduction of temperature occurs in the drill pipe as the pressure increases with the flow direction.In summary, the total amount of energy for fluids in drillpipe calculated in the work is and the total amount of energy for fluids in annulus is then given as 4 Temperature Model

Mathematical model
The temperature model is developed here based on an energy balance between the formation and the wellbore.The detailed derivations with notations are given in Appendix C. The following equation shows the fluid temperature distribution in pipes: with For the annulus fluids, the equation for the temperature distribution is, with Substituting T a in equation ( 41) and solving for T p gives The coefficients in ( 43) are not constant throughout the wellbore which are temperature dependent parameters such as drilling fluids' density and viscosity.An analytical solution is consequently not achievable.A numerical approach is instead implemented to obtain the solution.Using a numerical approach allows the wellbore to be divided into a certain number of boxes.
For each box, all the parameters that vary throughout the wellbore are updated and treated as constants over the box length, which allows equation ( 43) to be solved by the undetermined coefficients method.In the following, i refers to a random box in the discretized wellbore.
The formation temperature T f in (43) varies with depth.For a deviated wellbore, the following function has been implemented to calculate the formation temperature distribution: where T f (i−1) refers to the formation temperature at box i − 1, G (i) is the geothermal gradient at box i, I (i) represents the angle of inclination for box i, and is the box length.Equation ( 43) is now expressed by discretizing the well: Solving the second order inhomogeneous differential equation above yields the general expression for the temperature distribution in the drill pipe: Substituting T p(i) in (41) gives the general solution of the temperature distribution of fluids in the annulus. with .
Equations ( 45) and ( 46) have to be solved for each box in the wellbore.Note that the following coefficients that are not constant, must be determined for each box: In the next section, the detailed computational procedure to calculate the temperature profiles is presented.

Numerical solutions
For each box, all the parameters that vary throughout the wellbore are updated and treated as constants over the box length.The coefficients H 1(i) , H 2(i) are required to be determined which are dependent on the boundary conditions.Their calculation starts from the bottom box i = n.Suppose the bottom hole temperature is known, defined as T b .Applying it to ( 45) and ( 46), we have Then H 1(n) , H 2(n) can be easily solved from the above equations.Assuming H 1(n) , H 2(n) are constant for box n, T p(n) ((n − 1) ) and T a(n) ((n − 1) ) are calculated at the boundary between box n and box n − 1 by using H 1(n) , H 2(n) in equations ( 45) and ( 46) respectively.After they have been determined, they will serve as the boundary temperatures for box number n − 1 as Then H 1(n−1) and H 2(n−1) are calculated with the same approach as above to obtain T p(n−1) ((n − 2) ) and T a(n−1) ((n − 2) ).This procedure is repeated for the remaining boxes to get the total wellbore temperature distribution.To summarize it, the following stepwise approach is considered as a representation of the algorithm for calculating the wellbore temperature distribution: Algorithm 1(Temperature distribution) Step 1, give a guess for the bottom hole temperature 47) and (48); Step 4, calculate temperatures T p(n) ((n − 1) ) and T a(n) ((n − 1) ) at the boundary; Step 5, set the new boundary T p(n−1) ((n − 1) ) and T a(n−1) ((n − 1) ) for box n − 1 and let i = n − 1; Step 6, update θ 1(i) , θ 2(i) , A (i) , B (i) , C (i) , D (i) , m p(i) , m a(i) , ∆q tq(i) , ∆q ta(i) for box i; Step 8, calculate T p(i−1) ((i−1) ) and T a(i−1) ((i−1) ); Step 9, set i = i − 1 and go to step 6; Step 10, stop when i = 1.
Downhole temperature profiles can be numerically calculated using Algorithm 1 when the bottom hole temperature T b is given.However bottomhole temperature T b is not always available, which may give the difficulty to determine the whole temperature profile.On the other hand, the inlet fluid temperature T s is always available which is equal to the temperature of fluid in the first box at the depth x = 0, or If the calculated temperature T p(1) (0) using Algorithm 1 based on the guess T b is the same as the surface temperature T s , such initial guess T b is then considered to be the true bottom hole temperature for determining the downhole temperature distribution in Algorithm 1. Otherwise, a new initial guess for T b will be given for matching the boundary condition as (49).To make such searching approach more efficient, in this work the shooting method is applied.The idea of shooting method is that an initial guess is made of the unknown boundary conditions at one end of the interval.Using this guess, the terminal conditions obtained from the numerical integration are compared to the known terminal conditions and if the integrated terminal conditions differ from the known terminal conditions by more than a specified tolerance, the unknown initial conditions are adjusted and the process is repeated until the difference between the integrated terminal conditions and the required terminal conditions is less than some specified threshold.The shooting method for determining the bottom hole temperature T b is summarized below: Algorithm 2 (Shooting method for temperature distribution) Step 1, give two initial guesses for the bottom hole temperature T 1 b and T 2 b ; Step 2, calculate temperature distributions (T 1 p(i) , T 1 a(i) ) and (T 2 p(i) , T 2 a(i) ) based on T 1 b and T 2 b respectively using Algorithm 1; Step 3, check the sign of e 1 * e 2 where e 1 = T 1 p(1) (0)−T s and e 2 = T 2 p(1) (0) − T s ; Step 3.1, if e 1 * e 2 > 0, choose new initial guesses and go back to step 2; Step 3.2, if e 1 * e 2 < 0, go to step 4; Step 7, calculate temperature distributions (T p(i) , T a(i) ) using Algorithm 1, and stop.
In Algorithm 1, for each box i, the parameters to calculate (T p(i) , T a(i) ) in ( 45) and ( 46) are pressure and temperature dependent which will be updated based on the corresponding pressure and temperature information in the box i.Similar to determine the temperature distribution using shooting method, the pressure profiles of fluids in pipe and annulus can be calculated using shooting method as well since the surface pressure is known.To save the space, the related algorithm is given in Appendix D. Using the numerical procedure to determine temperature and pressure, the procedure will be terminated when both temperature and pressure distributions are convergent.The numerical procedure to achieve it is summarized in the following Algorithm.
Algorithm 3 (Temperature and pressure calculation) Step 1, give one initial pressure distributions (P 0 p(i) , P 0 a(i) ); Step 2, set iteration index k = 1; Step 3, calculate temperature distributions (T k p(i) , T k a(i) ) using Algorithm 2; Step 4, calculate pressure distributions (P k p(i) , P k a(i) ) using Algorithm A2 in Appendix D; Step 5, calculate errors Step 5.1, if e = max(e p1 , e p2 , e t1 , e t2 ) < ς (ς is threshold), go to step 6; Step 5.2, else set k=k+1, go to step 3; Step 6, set temperature distributions as (T k p(i) , T k a(i) ) and pressure distributions (P k p(i) , P k a(i) ), and stop.

Simulations and Discussions
In this section, a sensitivity analysis of the developed temperature model is presented with respect to drilling operations.The objective is to determine to what extent a set of parameters of the temperature model will impact the temperature distribution.Results are compared to a base case to illustrate the effect of each parameter.For the analysis of a given parameter, all other parameters of the base case remain constant while investigating a range of the given parameter unless specified otherwise.The set of parameters for the base case is given in Table 1.The sensitivity analysis is based on a scenario where an 8.5-inch section is drilled using a 5-inch drill pipe.The wellbore trajectory for the base case starts with a vertical section before kicking off to a deviated section with a constant inclination of 45 degrees from vertical.The total length of the wellbore is 2500 meters and there is no change in azimuth.

Base case
For the base case, the resulting wellbore temperature distribution is shown in  Another observation is that the maximum temperature in the wellbore occurs further up in the annulus and not at the bottom, which is a consequence of the boundary condition.The temperature distribution in the annulus is a result of heat transfer with both the formation and the drill pipe.Consider the depth of 1000 meters in Figure 1.Here, the annulus fluid will gain heat from the formation and give heat to the drill pipe.Close to the top of the wellbore on the other hand, the temperature in the annulus exceeds both the formation and the drill pipe temperature, resulting in a heat loss from the annulus to both interfaces.Inspecting the results reveals that the flow rate imposes a significant effect.The bottom hole temperature for a flow rate of 500 l/min has increased with more than 13 • C compared to the base case results given in Figure 1.On the contrary, increasing the flow rate results in a decrease of bottom hole temperature as illustrated by the results of 2000 l/min.The results also reveal that for a general reduction in flowrate, the entire temperature distribution will shift towards higher temperatures, and increasing the flow rate will shift the temperature distribution towards lower temperatures.Another effect is that for increasing flow rates, the temperature distributions in the drill pipe and the annulus approach each other.Increasing the flow rate will increase the CHTC, the overall heat transfer and thus the rate of heat transfer between the annulus and the drill pipe.This will lead to less thermal resistance between the annulus and the drill pipe and less difference in the temperature distributions.The simulation results for the entire range of flow rates from 100 l/min to 2250 l/min are given in Figure 4. Figure 4 shows the variation in maximum, bottom hole, and annulus outlet temperature with flow rate.This plot indicates that the change in maximum and bottom hole temperature in the wellbore is significant for varying flow rates.The variation is less pronounced for the outlet temperature.

Specific heat capacity
Specific heat capacity is defined as an amount of heat per unit mass required to increase the temperature of an object by one degree.A material with a low specific heat capacity will therefore need less energy to increase its temperature by a given amount compared to a material with a high specific heat capacity.To determine how sensitive the wellbore temperature distribution is to drilling fluid's specific heat capacity, simulations are performed with values in the range of 2000-4500J/kg • C. Figures 5 and 6 show the results for SHC of 3000 and 2000J/kg • C respectively.Comparing these results to the base case, it is evident that decreasing the specific heat capacity will increase the temperatures in the wellbore.The maximum temperatures for the given cases have increased with 38 • C and 16 • C compared to the base case, indicating that the SHC has a significant effect on the temperature distribution.An-other trend is that the annulus temperature distribution approaches the formation temperature and higher annulus temperature gradients are observed as the specific heat capacity is decreased.As discussed above, an object with a low specific heat capacity will need less energy to increase its temperature by a certain amount.Since the formation temperature remains the same compared to the base case and has the same potential of heat transfer, a drilling fluid on the low end of the simulation range will therefore gain heat from the formation more easily and thus approach the formation temperature.To show this effect more clearly, the results for a specific heat capacity of 2000J/kg • C and a flow rate of 500 l/min is given in Figure 6.Additionally, if the annulus temperature exceeds that of the formation, a drilling fluid with a low SHC will lose heat more easily to the formation and the temperature difference between the annulus and formation will decline, which is well explained by Figure 8.When the fluid is circulating back to the topside, from the measured depth 700 m, the fluid temperature in the annulus is above the formation temperature and fluid temperature in the pipe.Then the fluid in the annulus will lose the heat to the formation and the fluid in the pipe until the annulus temperature approaches the surface formation temperature.
Results for the entire range of specific heat capacities with respect to maximum, bottom hole, and outlet temperatures, are presented in Figure 8. Similar to the results for flow rate, the maximum and bottom hole temperature is highly sensitive to changes in specific heat capacity.The outlet temperature demonstrates little to practically no effect.It varies with only a few degrees from a value of 30 • C, which is because the annulus temperature will approach the initial formation temperature of 30 • C. TC of fluids affects the CHTC, the overall heat transfer coefficient, and ultimately the rate of heat transfer between the annulus and the drill pipe fluid.Intuitively, increasing the thermal conductivity will decrease the resistance to heat flow and thus increase the rate of heat transfer at the annulus/formation interface and the annulus/drill pipe interface.A range of thermal conductivity from 0.3 to 0.9W/m • C has been considered in the simulations.The base case value of 0.6W/m • C represents water.The selected range will therefore account for any low conductivity oil-based mud (OBM) and drilling fluids with high solids content.
The results for thermal conductivities of 0.4 and 0.8W/m • C are presented in Figures 9 and 10.For the first case, a decrease of temperatures is seen compared to the base case.An increase of temperatures is found in the results with a conductivity of 0.8W/m • C. For example, the difference between the maximum temperature of the base case and the case with 0.9W/m • C is about 3 • C.This indicates that the drilling fluid's thermal conductivity makes a difference, but not as pronounced as the flow rate's effects.Consequently, the energy transfer by the bulk motion of the fluid is what dominates the overall convective heat transfer in the wellbore.The results for the entire range of considered thermal conductivity values are presented in Figure 11.

Viscosity
In this work, drilling fluid viscosity is treated as a function of both pressure and temperature.The apparent viscosity is determined by utilizing rheology data from experiments on an OBM as explained in Section 2, and the viscosity will thus vary for each box in the wellbore.The viscosity for the base case varies within the range of 30-75cP.It is hard to determine the exact effect of viscosity on the wellbore temperature distribution when it is changing throughout the wellbore.To make the effect clearer, simulations are performed by assuming a constant viscosity instead.The simulations cover a range of viscosity from 1cP to 100cP.Results are presented in Figures 12 to 13.
At first sight, it is obvious that decreasing the viscosity will increase the bottom hole temperature and result in a larger temperature gradient.Decreasing the viscosity from 100cP to 1cP gives a 28 • C increase of bottom hole temperature.A low viscosity results in a large CHTC and ultimately an efficient overall heat transfer rate from the formation to the wellbore system.It is therefore crucial to include the non-Newtonian viscosity behavior of drilling fluids.Simplifying calculations by using a Newtonian viscosity  Another effect of decreasing viscosity is the reduction of difference between the temperatures in the drill pipe and the annulus.The trend is seen by comparing Figures 12 to 13.The results of Figure 13 with a viscosity of 1cP show that the temperatures of the drill pipe and the annulus fluids are much closer than in Figure 12.A decrease of viscosity leads to an increase of the CHTC and ultimately a larger heat transfer rate between the annulus and the drill pipe fluids.As the heat transfer increases, the differences in temperature will diminish and the results obtained in Figure 13 will occur.Also, inspecting the mentioned figures reveals that maximum temperature in the wellbore occurs further down in the wellbore when the viscosity is decreased.This is a consequence of the increased heat flow between the annulus and the drill pipe.As the drill pipe fluid becomes warmer, the bottom hole temperature will increase.
The results of the full range of viscosities are presented in Figure 14.These results indicate the effect of the viscosity is more pronounced at the low end of the range.In fact, the effect fades with increasing viscosity.The statement that the maximum temperature in the wellbore moves further down with decreasing viscosity is also obvious in this figure as the bottom hole and maximum temperature approach each other for lower viscosities.An interesting observation is that the outlet temperature decreases with decreasing viscosities, which is the opposite effect of the bottom hole temperature.The increased heat transfer rate will move the outlet temperature towards the drill pipe inlet temperature.

Density
The density model employed in this paper is based on an OBM with a reference point of 1205kg/m 3 at ambient conditions.The fluid behavior with respect to pressure and temperature has been established through a PVT analysis.To determine the effect of drilling fluid density on the temperature distribution, the reference point is varied over a range of 1000-1900kg/m 3 .Figures 15 and 16 give the results for drilling fluids with a density of 1000 and 1700kg/m 3 respectively.Increasing the density results in an overall reduction of wellbore temperature.Comparing the maximum temperature of the base case with the results of 1700 kg/m 3 gives a reduction of 14 • C. The effect is much like the one experienced with flow rate, but less significant.Increasing the density will increase the mass flow rate.This results in a larger heat transfer rate over an annulus element.Therefore, the heat that is introduced to the system will also leave the system faster and thus leaving less impact on the temperatures in the system.Figure 17 shows the variation in temperatures with density over the entire simulation range.It is obvious that drilling fluid density has a noticeable effect on the wellbore temperature distribution.

Joule-Thomson effect
The JT coefficient determines the change in drilling fluid temperature with changes in pressure.The wellbore pressure distribution will therefore have a direct impact on the temperature distribution.Varying the flow rate will affect the frictional pressure losses and ultimately the pressure distribution.Therefore, simulations are performed with change of flow rates.All other parameters of the base case remain constant.The depth of the wellbore is also kept constant and the contribution from hydrostatic effects will remain the same.Results are shown in Figures 18 to 19.
Figure 18 gives a plot of bottom hole temperature versus flow rate for the base case and a case where the Table 2: Torque model parameters JT coefficient is included.The comparison reveals that the bottom hole temperature decreases when the effect of the JT coefficient is considered.This is because as pressure increases in the drill pipe with flow direction, the drilling fluid compresses and cools.The reduction in drill pipe temperature will consequently decrease the bottom hole temperature.For the base case flow rate of 1500 l/min, comparing the results without the effect of the JT coefficient and with the effect gives a reduction of bottom hole temperature by 4%.Furthermore, the effect diminishes with increasing flow rate.
A comparison of the outlet temperature with and without the effect of the JT coefficient is given in Figure 19.
The results indicate the opposite effect for the outlet temperature.Including the effect of the JT coefficient increases the outlet temperature compared to the base case and the effect increases with increasing flow rate.Again, the pressure decreases with the flow direction in the annulus and the drilling fluid will expand and become warmer.The increase of outlet temperature for the base case flow rate is by 3%.Consequently, the effect of the JT coefficient will impact the temperature distribution, but it is not a dominating factor for the wellbore temperature distribution.

Rotation energy
The amount of heat generation from drill pipe rotation is governed by the wellbore torque and the drill pipe rotational speed.Two critical factors for torque in an ERD well are wellbore inclination and friction.A section with a high inclination gives a large normal force because a large portion of the drill pipe weight will lay on the low side of the wellbore, ultimately leading to significant frictional forces.Also, a high friction factor increases the frictional forces.Therefore, the sensitivity analysis is performed with respect to these two parameters together with the rotational speed of the drill pipe.Some of the most important input parameters of this model and the corresponding values used in this work, are given in Table 2.The wellbore inclination, pipe rotational speed, and friction factor have been varied to obtain the results in Figures 20 and 21.
Figure 20 shows the effect of pipe rotation on the temperature distribution.The effect is compared to the base case, only now the base case includes varying wellbore inclination.Maximum temperatures obtained by simulating the effect of pipe rotation are compared to the maximum temperatures of the base case and given in Figure 20 as a percentage increases.The friction factor used for the simulations shown in Figure 20 is 0.3.Result reveal that heat generation from pipe rotation is not a contributing factor to the overall temperature distribution.The largest increase of maximum temperature occurs at an inclination of 80 degrees with 150 RPM, yielding a 3% increase.Compared to a handful of the other parameters investigated before, these results are insignificant.However, note that the wellbore in the base case is only 2500 meters measured depth (MD).A longer section will increase the total torque losses and a more pronounced effect might occur.Even though the drill pipe rotation does not generate a significant amount of heat, the temperature model in this paper can be used to determine how parameters in the torque model affect the wellbore temperature.For example, in Figure 21 a friction factor of 0.15 has been used to estimate the results.The largest increase of maximum temperature is now less than 1.6%, which is a reduction of almost 50% compared to the largest increase in Figure 21.Also, it is obvious from both figures that increasing the wellbore inclination and RPM will increase the effect of pipe rotation on the temperature distribution.It is also possible to determine the effect of the other parameters given in Table 2, but since it has been established that pipe rotation does not generate a significant amount of heat, investigation of other parameters related to the torque model is not a part of the objective in this work.Another parameter that produces a noticeable impact on the temperature distribution is the drilling fluid specific heat capacity.Results indicate that drilling fluids with a low specific heat capacity tend to have temperatures much closer to the formation temperature.Decreasing the specific heat capacity of the fluid will increase its ability to gain heat and thus increase its temperature.Furthermore, the maximum and bottom hole temperatures are highly sensitive to this parameter.It is therefore critical to have correct estimations of the specific heat capacity to avoid any unforeseen high wellbore temperatures.
Drilling fluid viscosity is also found to be a dominant factor for the temperature distribution.Results from the simulations show that drilling fluids with viscosities close to that of water give significantly higher wellbore temperatures compared to more viscous fluids.A low viscosity fluid yields a higher CHTC and consequently a more efficient heat transfer with the formation.This emphasizes that it is important to apply an appropriate model and to ensure accurate estimations of the viscos-ity.Including the non-Newtonian behavior of drilling fluids to determine the viscosity is therefore of great importance, and the use of viscosity measurements to determine the rheological behavior of the considered OBM in this paper has provided a more accurate temperature model.
The effects of energy source terms that occur during drilling is also investigated in this work.In general, results show that the overall contribution from these terms is not predominant.For example, the JT coefficient will impact the bottom hole pressure but to a much less extent than the flow rate or the viscosity.Heat generation due to friction is also found to produce little effect on the temperature distribution.However, considering a wellbore with a longer horizontal section might give a more pronounced impact.From another perspective, including heat generation due to frictional forces offers the ability to determine how wellbore design and operational parameters such as RPM and WOB impact the temperature distribution.Also, considering energy source terms will improve the accuracy of the temperature model and it is suggested that they are not neglected.After all, ERD wells may encounter conditions where only a small increase of temperature makes a difference.bined motion is included here.For a straight section, the torque that is acting on the drill pipe is expressed as τ q = µr pi β f w∆L sin φ cos ψ, where µ is friction factor, β f is buoyancy factor, w is unit pipe weight, ∆L is volume length, φ is inclination angle and ψ is angle between axial and tangential pipe velocities.For any type of bend, the axial force in the drill pipe is determined by (51) where F is axial force, θ is dogleg angle, and the subscripts 1 and 2 represent two successive survey measurements.In (51), the sign + indicates tripping out and − indicates tripping in.The parameters F 2 and F 1 refer to the axial force at the top and bottom of a drill pipe element of the length ∆L.The torque for a curved section is determined by For all the equations above, ψ is obtained from the following relationship: where V h is axial pipe velocity and RP M is rotary pipe speed.More details regarding the model and corresponding theory is found in Aadnoy et al. (2010).

Appendix C
The temperature model is derived based on an energy balance between the formation and the wellbore.In the drill pipe, the flow direction is set downwards and heat will therefore enter the system at x and leave the system at x + dx.Heat will also enter the system due to heat transfer from the annulus and heat generation from mechanical energy sources within the drill pipe.Consequently, the energy balance for the wellbore element is expressed by: q p(x+dx) − q p(x) = q ap + q tp , (54) where q ap represents the rate of heat transfer from the annulus and q tp represents the energy sources present within the drill pipe.The change in thermal energy over the element is given by Theodore et al. (2011) as: q p(x+dx) − q p(x) = m p c p (T p (x + dx) − T p (x)), ( 55) where m p is the mass rate in pipes, c p is SHC of fluids and T p is temperature of fluids in pipes.Recalling equation (2), we have Combining equations ( 55)-( 56) gives the following differential equation for the drill pipe temperature distribution: where For the annulus, the flow direction is set upwards and heat will consequently enter the system at x + dx and leave the system at x.Additional heat enters the system by heat transfer from the formation and heat generation due to energy sources in the annulus, and heat will also leave the system through the interface with the drill pipe.The energy balance for the wellbore element becomes: q a(x+dx) − q a(x) = q ap − q f − q ta , (59) where q f gives the heat transfer from the formation to the wellbore interface and q ta represents the energy sources in the annulus.Following Kabir et al. (1996), the heat flow from the formation to the annulus is expressed by: where k f o is TC of formation, T f is formation temperature, T a is fluids' temperature inside annulus and T D is dimensionless temperature proposed by Ramey (1962) as Here, α f is formation heat diffusivity, c pf is SHC of formation, ρ f is formation density and t is circulation time.Following Theodore et al. (2011), the thermal energy over the annulus element can be expressed by: q a(x+dx) − q a(x) = m a c p (T a (x + dx) − T a (x)).( 61) Updating the energy balance in equation ( 59) with the expressions in equations ( 60) and ( 61) yields the differential equation for the annulus temperature distribution as shown below. where ) and e 3 = T 3 p(1) (0) − T s ; Step 5.1, if e 3 < ζ (ζ is threshold), go to step 6; Step 5.2, if e 1 * e 3 < 0, set T 2 b = T 3 b , else set T 1 b = T 3 b ; and go to step 4; Step 6, set T b = T 3 b ; Figure 1.The temperature of the fluid at the drill pipe inlet is 20 • C.This satisfies the boundary value problem discussed in Section 4, where the condition of T p(1) (0) = T s was set.Moving down the drill pipe, the temperature increases due to heat flow from the relatively warmer annulus fluid.At the bottom of the wellbore, the temperatures in the drill pipe and the annulus are equal, indicating that the other boundary condition of T p(n) = T a(n) is satisfied.

Table 1 :
Base case parameters