A Transient Analytical Model for Predicting Wellbore/Reservoir Temperature and Stresses during Drilling with Fluid Circulation

: Accurate characterization of heat transfer in a wellbore during drilling, which includes ﬂuid circulation, is important for wellbore stability analysis. In this work, a pseudo-3D model is developed to simultaneously calculate the heat exchange between the ﬂowing ﬂuid and the surrounding media (drill pipe and rock formation) and the in-plane thermoelastic stresses. The cold drilling ﬂuid descends through the drill pipe at constant injection rates and returns to the ground surface via the annulus. The ﬂuid circulation will decrease the wellbore bottom temperature and reduce the near-wellbore high compressive stress, potentially leading to tensile fracturing of the well. The governing equations for the coupled heat transfer stress problem are formulated to ensure that the most important parameters are taken into account. The wellbore is subject to a non-hydrostatic in situ far-ﬁeld stress ﬁeld. In modeling heat exchange between ﬂuid and surrounding media, the heat transfer coefﬁcients are dependent on ﬂuid properties and ﬂow behavior. Analytical solutions in the Laplace space are obtained for the temperatures of the ﬂuid in both the drill pipe and annulus and for the temperature and stress changes in the formation. The numerical results in the time domain are obtained by using an efﬁcient inversion approach. In particular, the near-well stresses are compared for the cases with ﬁxed and time-dependent cooling wellbore conditions. This comparison indicates that the using a ﬁxed temperature wellbore conditions may over-estimate or under-estimate the bottom-hole stress change, potentially leading to wellbore stability problems.


Introduction
Drilling and completion of wells provides a direct way to extract the resources such as oil, gas and geothermal energy from beneath the earth's surface. Assessment of the wellbore stability issues is an important but very challenging topic related to safe and efficient drilling operations. Instability of wellbores historically costs the oil and gas industry billions of dollars worldwide annually [1]. During drilling, fluid is circulated through the drill pipe/annulus system and this fluid circulation process serves several fundamental functions: (1) removal of the large amount of drilled cuttings from the wellbore [2]; (2) prevention of breakdown (tensile failure) and breakout (shear failure) of the wellbore by adjusting the mud weight and circulation rate, thus controlling the pressure [3,4]; and (3) cooling and lubricating of the drill bit [5]. In addition, the heat exchange between drilling fluids and surrounding formation results in thermoelastic stress redistribution near the wellbore. Wellbore stability is affected by a variety of factors, such as mechanical impact as a result of drillstring vibration during drilling [6], formation material properties [7,8] and change in loading boundary conditions. Especially, with the exploration and development of unconventional energy resources such as shale gas/oil and geothermal energy, wells are being drilled deeper and at orientations with respect to the stress field that result in higher stress concentrations around the well. In such cases, the temperature and pressure conditions also become more extreme. For example, at a depth of 5 km in geothermal reservoirs, the rock temperature can be more than 270 • C [9]. Under high temperature and high pressure (HTHP) conditions, with cold fluid injected into the wellbore, the heat transfer behavior in both the fluid and rock formation must be accounted for in estimating the complex stress redistribution. Therefore, understanding the transient thermal behavior in the fluid and accounting for the interaction between the wellbore and reservoir rock must be included in the wellbore stability analysis.
A fully coupled well/reservoir (W/R) drilling system analysis generally contains three parts, i.e., fluid circulation (heat and mass) in the wellbore, energy exchange between the wellbore and the reservoir, and flow and deformation in rock formations. A comprehensive model for predicting the wellbore integrity should address these three parts at the same time. Most previous studies have focused on one or two of these parts. As for the first two processes, many models and approaches have been developed to describe heat diffusion, fluid flow and exchange behaviors in the system.
During the past several decades, many models and approaches have been developed to describe the heat exchange process and stress-associated wellbore stability in the oil, gas and geothermal industry. For example, Bullard [10] and Moss and White [11] used a line/source model to study the wellbore/reservoir (W/R) temperature. Edwardson [12] and Tragesser [13] obtained the formation temperature during mud circulation with an "exact method", which solved the differential equation of heat conduction. Approximate solutions were presented by Ramey [14] for the case where steady-state heat transfer in the wellbore is coupled with transient heat flow in the formation. Later, Raymond [15] derived the complete equations for the heat transfer in the W/R system, and since then a great deal of further work has been carried out. For example, Holmes and Swift [16], Keller [17], Sump [18], Arnold [19], Kabir et al. [20], Fomin et al. [21] and Wu et al. [22] studied similar problems using different approaches or extending Raymond's model to a more general case.
In addition, many models have also been developed to describe the rock deformation and wellbore stability. According to the effects to be considered, which are mechanical (M), hydro-(H), and thermal (T), these models are mainly divided into three types, i.e., classical elasticity (CM), poro-elasticity (HM) and thermo-poro-elasticity (THM). The well-known Kirsch solutions [23] for 2D cases, and those obtained by Hiramatsu and Oka [24] for 3D cases, belong to the first type. The second type of the wellbore models applied the HM theory developed by Biot [25]. For example, Carter and Booker [26] analyzed the consolidation of a linear elastic soil when a deep circular tunnel is cut. Detournay and Cheng [27] obtained the poroelastic (HM) response of a wellbore in a non-hydrostatic stress field. Rajapakse [28], Ekbote et al. [29] and Chen and Yu [30] studied similar two-dimensional cases in an isotropic HM media. In addition, Abousleiman and Cui [31] extended the loading decomposition scheme (LDS) and obtained analytical solutions for the cases where inclined wellbores are in transversely isotropic HM medium.
The third type takes into account the thermal effect on stress and deformation for analysis of wellbore stability and hydraulic fracturing, and is especially applicable to deep hot reservoirs. For example, Mctigue [32], Kurashige [33] and Charlez [34] derived similar theoretical formulations that can be used for studying coupled thermo-poro-elasticity wellbore problems. By using the above theories, Zhou et al. [35], Ghassemi and Diek [36], Wang and Dusseault [37], Choi et al. [38] and Wu et al. [39,40] studied the THM behaviors around a wellbore or sphere. Li et al. [41] and Abousleiman and Ekbote [42] and Gao et al. [43] applied the LDS to an inclined wellbore in an isotropic and transversely isotropic THM medium. The motivation of the present work arises for two reasons. First, most of the previous fluid circulation models, such as [10][11][12][13][14][15][16][17][18][19][20][21][22], consider only the heat transfer between the wellbore and the reservoir, without considering any mechanical responses of the system. In addition, most existing analytical solutions for the wellbore circulation system are based on the assumption that the heat transfer in the wellbore or rock formation is steady state [8][9][10][11][12][13][14]. Use of complete transient solutions requires resorting to fully numerical approaches [15].
Second, in nearly all of the existing wellbore stability models, such as , the boundary conditions at wellbore wall are assumed to be fixed (especially with a fixed wellbore temperature) or given in an arbitrary way. Obviously, this does not reflect the real wellbore conditions where the temperature changes with fluid circulation or drilling time. This simplification can lead to under-or over-estimation on the near-well stress field. Circulation of a fluid with a temperature lower than the formation temperature leads to a gradual reduction in both the bottom-hole temperature and the near-wellbore compressive stresses. The temperature at most locations along the wellbore also reduces with time. As different temperatures at the wellbore wall generate different heat transfer efficiencies in the formation, the time-dependent response of the wellbore wall temperature should be considered.
The purpose of the present work is both to obtain semi-analytical solutions for the temperature evolution in the injection string, annulus and rock formation during fluid circulation and to provide an accurate evaluation for near-well stress changes under the variable wellbore temperature, which is a more reasonable auxiliary condition for wellbore stability analysis during fluid circulation.

Problem Description
The geometry configuration for the present model of a W/R system is shown in Figure 1. The origin of the cylindrical coordinate system is set to coincide with the centre of the well at the surface. The system is initially in an equilibrium state with the formation temperature distribution T 0 * = A 0 z + B 0 [21], where A 0 is the geothermal gradient and B 0 is the surface soil temperature.
At an arbitrary depth of z, the cross-sectional wellbore is subjected to maximum horizontal principal stress σ H (z), minimum horizontal principal stress σ h (z), vertical principal stress σ v (z) and wellbore pressure p w (z). The temperatures of the fluid inside the annulus and tubing are denoted as T a * and T d * , respectively, independent of the radius. The rock temperature is denoted as T r * . The temperature on the borehole wall is denoted as T w * . At time t > 0, a fluid with a given temperature T in * is injected into the tubing at a mass rate Q d and returns to the surface along the annulus when it reaches the bottom of the tubing string. The return mass flow rate is denoted as Q a . The motivation of the present work arises for two reasons. First, most of the previous fluid circulation models, such as [10][11][12][13][14][15][16][17][18][19][20][21][22], consider only the heat transfer between the wellbore and the reservoir, without considering any mechanical responses of the system. In addition, most existing analytical solutions for the wellbore circulation system are based on the assumption that the heat transfer in the wellbore or rock formation is steady state [8][9][10][11][12][13][14]. Use of complete transient solutions requires resorting to fully numerical approaches [15].
Second, in nearly all of the existing wellbore stability models, such as , the boundary conditions at wellbore wall are assumed to be fixed (especially with a fixed wellbore temperature) or given in an arbitrary way. Obviously, this does not reflect the real wellbore conditions where the temperature changes with fluid circulation or drilling time. This simplification can lead to under-or over-estimation on the near-well stress field. Circulation of a fluid with a temperature lower than the formation temperature leads to a gradual reduction in both the bottom-hole temperature and the near-wellbore compressive stresses. The temperature at most locations along the wellbore also reduces with time. As different temperatures at the wellbore wall generate different heat transfer efficiencies in the formation, the time-dependent response of the wellbore wall temperature should be considered.
The purpose of the present work is both to obtain semi-analytical solutions for the temperature evolution in the injection string, annulus and rock formation during fluid circulation and to provide an accurate evaluation for near-well stress changes under the variable wellbore temperature, which is a more reasonable auxiliary condition for wellbore stability analysis during fluid circulation.

Problem Description
The geometry configuration for the present model of a W/R system is shown in Figure 1. The origin of the cylindrical coordinate system is set to coincide with the centre of the well at the surface. The system is initially in an equilibrium state with the formation temperature distribution T0 * = A0 z + B0 [21], where A0 is the geothermal gradient and B0 is the surface soil temperature. At an arbitrary depth of z, the cross-sectional wellbore is subjected to maximum horizontal principal stress σH(z), minimum horizontal principal stress σh(z), vertical principal stress σv(z) and wellbore pressure pw(z). The temperatures of the fluid inside the annulus and tubing are denoted as Ta * and Td * , respectively, independent of the radius. The rock temperature is denoted as Tr * . The temperature on the borehole wall is denoted as Tw * . At time t > 0, a fluid with a given temperature Tin * is injected into the tubing at a mass rate Qd and returns to the surface along the annulus when it reaches the bottom of the tubing string. The return mass flow rate is denoted as Qa.   The wellbore radius is denoted by r w and the wellbore depth is H. The inner and outer radii of the tubing are r 0 and r d , respectively. Therefore, the tubing wall thickness is denoted as δ 0 = r d − r 0 and the effective width of the annulus is w a = r w − r d .
For simplicity, the following assumptions are made: (1) the fluid is incompressible and the rock formation is impermeable, homogeneous, isotropic, linear and elastic; (2) the material properties are constants, independent of temperature change; and (3) the heat conduction along the vertical direction in the formation is neglected.

Wellbore Heat Transfer
The fluid temperature in the tubing is determined by the heat exchange between the tubing and the annulus and the heat advection down the tubing. The fluid temperature in the annulus is determined by the heat exchange between the annular fluid and the surrounding rock, the heat exchange between the tubing and the annulus and the heat advection up along the annulus. According to Raymond [15], the advective heat transfer equations for fluids inside the tubing string and in the annulus are expressed as follows.
where c l is the fluid specific heat capacity; A m and T m * (m = d refers to tubing and m = a refers to annulus) denote the cross sectional area and the fluid temperature, respectively; h ad is the overall heat transfer coefficient (HTC) characterizing heat exchange between the fluids in the tubing and in the annulus through the tubing wall; and h w is the film HTC between the fluid in the annulus and the surrounding rock formation. The velocities v m (m = d or a) in the tubing and the annuls are expressed as

Heat Conduction in Rock
As for the heat transfer in the rock formation, two simplifications can be made. First, as the temperature gradient in the radial direction is much greater than that in the vertical direction, the derivative of the formation temperature with respect to z can be ignored [15]. Then, the governing equation to describe the heat flow in the formation is written as where ε v is the volumetric strain. Second, according to the analysis by Coussy [44] and Wu et al. [39], the deformation induced temperature change is very small so that it can be ignored. Therefore, the second term on the right side of Equation (2) is omitted in the present work.

Rock Deformation
The following governing equations in a polar coordinate system (r, θ) are used to describe the mechanical responses of the rock formation, whose temperature distribution is disturbed by the circulating fluid.

•
Equations of equilibrium ∂σ rr ∂r Energies 2018, 11, 42 • Linear TM constitutive equation for isotropic medium In the above equations, σ ij is the stress change tensor (positive is tension) and is equal to the difference between the total stress σ ij * and the initial stress σ ij R ; ε v is the volumetric strain and ε ij the strain tensor; T r = T r * − T 0 * denotes the rock temperature change; G, v and K = 2G(1 + v)/3(1 − 2v) are shear modulus, Poisson's ratio and bulk modulus for the rock formation, respectively; α is the coefficient of volumetric thermal expansion of the rock formation; γ = αK; and δ ij is Kronecker's delta.

Boundary Conditions
The fluid temperature at the inlet of the tubing is specified during drilling. In order to satisfy the continuity condition, the temperature of fluids in the tubing and in the annulus at the bottomhole should be identical. Thus, we have In addition, at the wellbore wall, the heat flux from the formation is equal to the heat flux into the wellbore, i.e., the following continuity condition must be met The pressure at the wellbore wall at a depth z is assumed to be time-independent and is approximated by where g is the gravitational acceleration. The initial condition of the system is given as where T m = T m * − T R (m = d refers to tubing, m = a refers to annulus and m = r refers to formation). The remote boundary conditions are expressed in terms of changes of temperature and stresses while at the wellbore wall, the stress boundary conditions are where

Heat Transfer Coefficients (HTCs)
In the present paper, the value of the HTC for forced advection along a pipe is calculated by where k l is the fluid thermal conductivity, D is the hydraulic diameter (a characteristic length) and N u is the dimensionless Nusselt number. If the Nusselt number is known, the HTC value can be obtained. When Re ≤ 2320, the flow is laminar and N u is equal to be 3.66. When Re ≥ 10,000, the flow is turbulent and the Nusselt number is calculated with the Mikheev equation [45] which is reported to be the reliable formula for estimating the HTC for the flow of Newtonian fluids in a tube. In particular, the Nusselt numbers for turbulent flow at the inner tubing and wellbore walls, respectively, are given by Isachenko and Osipova [46] as follows where µ is the fluid dynamic viscosity, and k j , ρ j and c j are the thermal conductivity, mass density and specific heat capacity (here the symbol j = l, d or r denotes the liquid, tubing or rock), respectively. The Reynolds number for fluid flow in the tubing and annulus and the Prandtl number are defined below When 2320 < Re < 10,000 (for transition flow), a linear interpolation method is used, as show in Figure 2. where kl is the fluid thermal conductivity, D is the hydraulic diameter (a characteristic length) and Nu is the dimensionless Nusselt number. If the Nusselt number is known, the HTC value can be obtained. When Re ≤ 2320, the flow is laminar and Nu is equal to be 3.66. When Re ≥ 10,000, the flow is turbulent and the Nusselt number is calculated with the Mikheev equation [45] which is reported to be the reliable formula for estimating the HTC for the flow of Newtonian fluids in a tube. In particular, the Nusselt numbers for turbulent flow at the inner tubing and wellbore walls, respectively, are given by Isachenko and Osipova [46] as follows where μ is the fluid dynamic viscosity, and kj, ρj and cj are the thermal conductivity, mass density and specific heat capacity (here the symbol j = l, d or r denotes the liquid, tubing or rock), respectively. The Reynolds number for fluid flow in the tubing and annulus and the Prandtl number are defined below When 2320 < Re < 10,000 (for transition flow), a linear interpolation method is used, as show in Figure 2. The overall HTC across the tubing wall is determined by the empirical formula derived by Willhite [47], which gives

Dimensional Analysis
By using the following transformation The overall HTC across the tubing wall is determined by the empirical formula derived by Willhite [47], which gives Energies 2018, 11, 42 7 of 18

Dimensional Analysis
By using the following transformation the governing Equation (1) for heat transfer in the wellbore and heat exchange with reservoir is rewritten as where the coefficients are defined as The stress-strain correlation (5) is given as and the strain-displacement relationship is rewritten as In addition, heat conduction in the rock formation becomes The boundary and initial conditions for the wellbore become and the boundary conditions for the reservoir are rewritten as While, at the wellbore wall, the stress boundary conditions are where

Solution Method
From Equations (1)- (11) we find that the heat transfer and deformation process represent a linear system. By using the same approach as that in [27,39], the non-hydrostatic remote stresses are decomposed into isotropic and deviatoric components, i.e., p 0 and s 0 . According to the superposition principle, the present problem can be solved by studying two loading modes, i.e., isotropic (Mode 1) and anti-symmetric (Mode 2). In Mode 1, the fluid circulates in the wellbore that is subjected to the isotropic far-field stress p 0 , wellbore pressure and initial temperature conditions, while in Mode 2 the wellbore is subjected to the anti-symmetric far-field stress s 0 and homogenous boundary conditions. The final solutions of near-well stress fields are the combination of the above results. It should be mentioned that the wellbore temperature varies with circulation time. In addition, the temperature evolution in the pipe and annulus can be obtained analytically in Laplace space.
The Laplace transformation is defined aŝ where s is a complex number and the symbolˆdenotes the Laplace transform of a quantity (Θ a ,Θ d , Θ r ,Σ RR ,Σ θθ andΣ Rθ for example).
The stress boundary condition for the Mode 1 and Mode 2 problems are respectively.
In Mode 1, it should be noted that Ω θ = 0 and Σ Rθ = 0. Substitution of Equation (16) into the dimensionless forms of Equations (2) and (3) leads to the volumetric strain where the constant C 0 is equal to zero as δ v vanishes at infinity. After putting δ v into Equation (19), we obtain ∇ 2 Θ r = ∂Θ r ∂τ By applying the Laplace transformation to the above equation, the following ordinary differential equation (ODE) is obtained for the rock temperature change whose solution in Laplace space is obtained aŝ where I n and K n denote the modified Bessel functions of the first and second kind of order n, respectively; and F 1 (s) and F 2 (s) are unknowns to be determined by the boundary conditions. Considering zero rock temperature change at infinity, the function F 2 (Z, s) = 0 and then By using the first boundary condition in Equation (20), the annulus temperature change is found After applying the Laplace transformation to Equation (16), we obtain the following ODEs whose solutions are found to be and then we haveΘ where the coefficients are defined as Based on the boundary conditions, the coefficients Q 1 (s) and Q 2 (s) are calculated to be .
From Equation (18), we obtain the induced stresses for Mode 1 if the radial displacement is known Based on Equations (3), (25) and the second of Equation (31), we obtain the radial displacement where W(s) is an unknown function and is calculated by the stress boundary condition Equation (22) at the wellbore wall The solution to the Mode 2 loading provides the temperature, deformation and stress induced by the anti-symmetric far-field stress.
Again, substitution of Equation (16) into the dimensionless forms of Equations (2) and (3) leads to the following equations Here the rotation displacement is defined as The Laplace transforms of the variables δ v , Ω R , Σ RR , Σ θθ , Θ r , and Ω θ are defined in the same way in Equation (23) in terms of δ v , Ω R , Σ RR , Σ θθ , Θ r , and Ω θ . Under Mode 2 loading, these Laplace transformed quantities are expressed as follows where δ v , Ω R , Σ RR , Σ θθ , Θ r , and Ω θ are all functions of R and s only. By Laplace transformation, Equation (34) are changed into the following two ODEs The solutions of above ODE are found to bê where F(s) is an unknown function to be calculated and thus the induced stresses are obtained from Equation (18) For Mode 2, the Laplace transforms of the governing Equation (19) is simplified to be whose solution, combined with the far-field boundary conditions, is found to bê AsΘ r = 0 at R = 1, the function G(s) is Therefore, the induced temperature and volumetric strain arê where m 1 = ca In addition,Ξ v andˆ can be expressed through the geometric relationships in Laplace space as followsΞ By using Equations (38), (42) and (43), the displacements are obtained to bê where m 4 = −β 2 . Thus, from the constitutive Equation (18), the stresses are obtained where the function F(s) and Q(s) are calculated via the stress boundary conditions at R = 1 where As the temperature, displacements, and stresses induced by both modes are known, complete solutions are easily obtained by superposition.

Results and Discussions
In this section, the physical solutions to the temperature and stresses are obtained by applying the Stehfest method [48]. The parameters used in the following calculations are listed in Table 1 unless otherwise specified.

Parameters Value
Pipe internal radius r 0 and thickness δ 0 (m) 0.0462, 0.01 Wellbore radius r w and height H (m) 0.0762, 4131 Injection rate Q d and pump out rate Q a (Kg/s) 23

Wellbore Temperature Responses
The temperature responses in the wellbore/reservoir system can be calculated based on Equations (30) and (31). Figure 3 shows the outlet and bottom-hole temperature changes for a range of injection rates. In Figure 3a, it can be seen that the outlet temperature change increases quickly (in about 2 h) to a certain value and then change very slowly after that time. In addition, when the injection rate increases from 3 Kg/s to 23 Kg/s, there is only a less than 3 • C difference between the outlet temperature changes. However, by increasing the injection rate, the bottom-hole temperature can be decreased quickly and by a significant amount as shown in Figure 3b. Therefore, changing the injection rate can be an efficient way to control the bottom-hole temperature and therefore the stress conditions near the wellbore, as shown by these simulations.
The temperature responses in the wellbore/reservoir system can be calculated based on Equations (30) and (31). Figure 3 shows the outlet and bottom-hole temperature changes for a range of injection rates. In Figure 3a, it can be seen that the outlet temperature change increases quickly (in about 2 h) to a certain value and then change very slowly after that time. In addition, when the injection rate increases from 3 Kg/s to 23 Kg/s, there is only a less than 3 °C difference between the outlet temperature changes. However, by increasing the injection rate, the bottom-hole temperature can be decreased quickly and by a significant amount as shown in Figure 3b. Therefore, changing the injection rate can be an efficient way to control the bottom-hole temperature and therefore the stress conditions near the wellbore, as shown by these simulations.
In Figure 4, the outlet and bottom-hole temperature changes for different injection temperatures are displayed. The injection rate is kept as a constant of 23 Kg/s. The bottom-hole temperature change decreases by 6 °C when the injection fluid temperature varies from 56.5 °C to 16.5 °C, even after a significant injection period, as shown in Figure 4b. This demonstrates that, to manage bottom-hole temperature and bottom-hole stress conditions, it is more effective to control the injection rate, rather than control injection fluid temperature for a deep wellbore.  In Figure 4, the outlet and bottom-hole temperature changes for different injection temperatures are displayed. The injection rate is kept as a constant of 23 Kg/s. The bottom-hole temperature change decreases by 6 • C when the injection fluid temperature varies from 56.5 • C to 16.5 • C, even after a significant injection period, as shown in Figure 4b. This demonstrates that, to manage bottom-hole temperature and bottom-hole stress conditions, it is more effective to control the injection rate, rather than control injection fluid temperature for a deep wellbore.  In contrast, for a constant injection rate, the outlet fluid temperature is determined to a certain degree by the injection fluid temperature. In addition to the heat carried by fluid flowing up the annulus, the region near the outlet undergoes a quick heat exchange with the injection fluid. Therefore, if the injection temperature is lower than the surface soil/rock temperature, the outlet region is in a cooled. This can be seen in Figure 4a, where the outlet fluid temperature change varies from about −6 °C to 31 °C when the injection fluid temperature changes from 16.5 °C to 56.5 °C and the initial surface temperature B0 is fixed as 27 °C.
The fluid temperature profiles along the wellbore for two injection fluid temperatures (16.5 °C and 56.5 °C) are plotted in Figure 5. It should be mentioned that Z in the y axis denotes the if the injection temperature is lower than the surface soil/rock temperature, the outlet region is in a cooled. This can be seen in Figure 4a, where the outlet fluid temperature change varies from about −6 • C to 31 • C when the injection fluid temperature changes from 16.5 • C to 56.5 • C and the initial surface temperature B 0 is fixed as 27 • C.
The fluid temperature profiles along the wellbore for two injection fluid temperatures (16.5 • C and 56.5 • C) are plotted in Figure 5. It should be mentioned that Z in the y axis denotes the dimensionless depth, i.e., Z = z/H. In both cases, the rock temperature in the lower portion of the wellbore decreases with time while that in the upper portion of the wellbore depends greatly on the injection fluid temperature. This makes the wellbore behave in a relatively complicated thermal manner and leads to the stress increasing or decreasing at different depths along the wellbore through heat exchange with the surrounding rock. Therefore, a transient analysis of coupled heat exchange for the W/R system is required.  In contrast, for a constant injection rate, the outlet fluid temperature is determined to a certain degree by the injection fluid temperature. In addition to the heat carried by fluid flowing up the annulus, the region near the outlet undergoes a quick heat exchange with the injection fluid. Therefore, if the injection temperature is lower than the surface soil/rock temperature, the outlet region is in a cooled. This can be seen in Figure 4a, where the outlet fluid temperature change varies from about −6 °C to 31 °C when the injection fluid temperature changes from 16.5 °C to 56.5 °C and the initial surface temperature B0 is fixed as 27 °C.
The fluid temperature profiles along the wellbore for two injection fluid temperatures (16.5 °C and 56.5 °C) are plotted in Figure 5. It should be mentioned that Z in the y axis denotes the dimensionless depth, i.e., Z = z/H. In both cases, the rock temperature in the lower portion of the wellbore decreases with time while that in the upper portion of the wellbore depends greatly on the injection fluid temperature. This makes the wellbore behave in a relatively complicated thermal manner and leads to the stress increasing or decreasing at different depths along the wellbore through heat exchange with the surrounding rock. Therefore, a transient analysis of coupled heat exchange for the W/R system is required.  Figure 6 shows the contours for the temperature changes around the circular well at different times. Here Z and R denote the dimensionless depth and radial distance from the center of the wellbore, respectively, i.e., Z = z/H and R = r/rw. It can be seen that the near-well region at the bottom of the well is greatly impacted by the circulation. The low temperature area near the bottom of the  Figure 6 shows the contours for the temperature changes around the circular well at different times. Here Z and R denote the dimensionless depth and radial distance from the center of the wellbore, respectively, i.e., Z = z/H and R = r/r w . It can be seen that the near-well region at the bottom of the well is greatly impacted by the circulation. The low temperature area near the bottom of the well extends into the formation to a depth of one wellbore radius after 120 h. This cooled zone will induce thermo-elastic stresses that may be useful in helping initiate fractures and to enhance the permeability of certain natural fracture sets during stimulation.

Temperature Change Near the Wellbore in the Rock
It should be noted that, at the initial time of circulation, the upper part of the well is heated due to the hotter fluid flowing upwards, thus leading to enhanced compressive stress in the near-wellbore region. This may cause wellbore failure in terms of breakout. Therefore, some measure needs to be taken to prevent heat from loss into the formation by using casing with low thermal conductivity during the initial stage.
permeability of certain natural fracture sets during stimulation.
It should be noted that, at the initial time of circulation, the upper part of the well is heated due to the hotter fluid flowing upwards, thus leading to enhanced compressive stress in the near-wellbore region. This may cause wellbore failure in terms of breakout. Therefore, some measure needs to be taken to prevent heat from loss into the formation by using casing with low thermal conductivity during the initial stage.

Comparisons of Near-Well Temperature and Stresses for a System Subject to Fixed and Variable Wellbore Temperature
In this section, a comparison of near-well temperature and stress change is made for two cases, i.e., one with constant wellbore temperature (Case 1, the wellbore wall experiences a step temperature change) and the other with varying temperature that is dependent on the fluid circulation history (Case 2). Figure 7 shows the temperature and hoop stress variations in the σHmax direction at the wellbore bottom for Case 1 where the bottom-hole temperature is assumed to take a step change and be equal to the bottom-hole temperature after circulating for five days, and Case 2 where the circulation rate is equal to 28 Kg/s. Obviously, for Case 1, the rock temperature starts from the same point as the temperature on the wall that is fixed and increases with the distance away from the wellbore at a specific time. However, for Case 2, the rock temperature at the near-well region decreases with circulation time. There exists a region where the temperature predicted from the circulation case is higher than that from the fixed wellbore temperature case before the time t = 5 days. If we increase the circulation time (to say 25 days), the rock temperature will further decrease, thus leading to a region where the temperature predicted from the circulation case will be lower than that from the constant wellbore temperature case.

Comparisons of Near-Well Temperature and Stresses for a System Subject to Fixed and Variable Wellbore Temperature
In this section, a comparison of near-well temperature and stress change is made for two cases, i.e., one with constant wellbore temperature (Case 1, the wellbore wall experiences a step temperature change) and the other with varying temperature that is dependent on the fluid circulation history (Case 2). Figure 7 shows the temperature and hoop stress variations in the σ Hmax direction at the wellbore bottom for Case 1 where the bottom-hole temperature is assumed to take a step change and be equal to the bottom-hole temperature after circulating for five days, and Case 2 where the circulation rate is equal to 28 Kg/s. Obviously, for Case 1, the rock temperature starts from the same point as the temperature on the wall that is fixed and increases with the distance away from the wellbore at a specific time. However, for Case 2, the rock temperature at the near-well region decreases with circulation time. There exists a region where the temperature predicted from the circulation case is higher than that from the fixed wellbore temperature case before the time t = 5 days. If we increase the circulation time (to say 25 days), the rock temperature will further decrease, thus leading to a region where the temperature predicted from the circulation case will be lower than that from the constant wellbore temperature case.
permeability of certain natural fracture sets during stimulation.
It should be noted that, at the initial time of circulation, the upper part of the well is heated due to the hotter fluid flowing upwards, thus leading to enhanced compressive stress in the near-wellbore region. This may cause wellbore failure in terms of breakout. Therefore, some measure needs to be taken to prevent heat from loss into the formation by using casing with low thermal conductivity during the initial stage.

Comparisons of Near-Well Temperature and Stresses for a System Subject to Fixed and Variable Wellbore Temperature
In this section, a comparison of near-well temperature and stress change is made for two cases, i.e., one with constant wellbore temperature (Case 1, the wellbore wall experiences a step temperature change) and the other with varying temperature that is dependent on the fluid circulation history (Case 2). Figure 7 shows the temperature and hoop stress variations in the σHmax direction at the wellbore bottom for Case 1 where the bottom-hole temperature is assumed to take a step change and be equal to the bottom-hole temperature after circulating for five days, and Case 2 where the circulation rate is equal to 28 Kg/s. Obviously, for Case 1, the rock temperature starts from the same point as the temperature on the wall that is fixed and increases with the distance away from the wellbore at a specific time. However, for Case 2, the rock temperature at the near-well region decreases with circulation time. There exists a region where the temperature predicted from the circulation case is higher than that from the fixed wellbore temperature case before the time t = 5 days. If we increase the circulation time (to say 25 days), the rock temperature will further decrease, thus leading to a region where the temperature predicted from the circulation case will be lower than that from the constant wellbore temperature case. Due to different temperature responses predicted from the above two cases, the stress responses in the rock formation near the wellbore are also different. In Figure 7b, it can be seen that for a very small circulation time, the difference of the hoop stresses near the wellbore predicted from the two cases is significant. With time elapsed, the region with significant stress difference expands. At the time t = 5 days, the hoop stresses predicted from both cases are very close as the temperature changes in both cases have a similar profile. After five days, the difference of the hoop stresses for both cases becomes larger as the bottom-hole temperature in the circulation case continues to decrease with time.
Therefore, based on the circulation time, the conventional wellbore stability model with constant well temperature assumptions may over-or under-estimate the breakdown pressure (or mud weight) of the wellbore.

Conclusions
This paper presents a transient analysis of temperature and stress changes inside the wellbore and in the formation during fluid circulation. In particular, the solutions are derived for simultaneously solving fluid circulation along the wellbore and elastic deformation in the formation, through a unique temperature profile. By using the Laplace transformation and superposition method, the analytical solutions in the Laplace space are obtained. Numerical inversion is carried out to obtain the solutions in the time domain. The following conclusions are drawn based on the numerical results:

•
The fluid circulation rate plays a dominant role in the temperature evolution of the W/R system. The higher circulation rates (say cooling), the larger bottom-hole temperature change and thus the larger induced tensile stresses around the wellbore.

•
The effect of the injection fluid temperature on the outlet rock temperature change occurs rapidly. The outlet rock temperature change reaches a value quickly and is almost unchanged after that time.

•
The rock temperature of the upper part of the wellbore is determined mainly by the injection condition. It is possible for the upper open-hole section to develop breakouts due to the thermal stresses induced by the heating. Therefore, both wellbore cooling and heating should be taken into account during wellbore stability analysis.

•
This work provides a more consistent prediction on the temperature evolution and stress distribution along the wellbore resulting from the variable well temperature profiles associated with fluid circulation, thus making possible a more accurate wellbore stability analysis. The analysis for fixed boundary condition may over-or under-estimate the stress conditions around the wellbore, thus leading to inaccurate prediction of the mud weight density required to maintain a stable well. • Based on the first two points, varying circulation rates may be a more efficient way to manage bottom-hole temperature and bottom-hole stress conditions, rather than changing injection fluid temperature.