# Overview

## Introduction

The temperature evolution is simulated in the well during any stage of well construction and under production/injection. The temperature simulation is coupled with the flow simulation (pressure distribution, holdups, slip etc.) in tubing and/or annulus. The temperature computation is done for all the elements of the well (drillholes, tubing, casings, cement, muds etc.) as well as the surrounding rock, including the reservoir. The computation can also be done in the wellhead and take into account the riser.

## Assumptions

### Bi-dimensional Computation

The temperature computation is done in a two-dimension space (2D). It is assumed that the computational domain can be mapped to a straight circular cylinder, with a common center line to that of the well. This is a good approximation as long as the radius of curvature of the well trajectory is much larger than the radius of the cylinder, and that only the rock close to the drilling will be affected by the temperature change. The radius of the cylinder will for most applications be of the order of 10 m. Thus, most of the computational domain consists of reservoir rock outside the well. For the temperature computation, the inclination angle is neglected. For the flow computations and natural convection effects, where gravity is important, the real trajectory and the local inclination angle of the well are however taken into account.

Rotational symmetry is furthermore assumed. This means that the three-dimensional computational domain (cylinder) reduces to a two-dimensional rectangle with a radial an axial coordinate (the measured depth). In case of horizontal well, the temperature below and above the horizontal parts are close from each other, so the symmetry assumption is still a good approximation. For instance with a 9 5/8 production casing, and a geothermal gradient of 3C per 100 m, the temperature difference will only be of 0.007C which is negligible.

For the flow computations and natural convection effects, where gravity is important, the real trajectory and the local inclination angle of the well are however taken into account.

## Supported Scenarios

The program supports individual scenario for all given stages of the well construction. It is also possible to combine the scenarios, and to add elements of the well in between each scenario. Doing so it is then possible to model the temperature evolution during the entire construction of the well. The well construction consists usually in repeating successively those three types of simulations: a drilling simulation, a no flow simulation while the casing is set up, and a cementation simulation.

When the well is ready, the temperature and flow during production (flow from the reservoir) or injection (flow from the well top) can be simulated.

### Drilling

During drilling it is assumed that there is a circulating flow that goes through the drillpipe, then goes up through the annulus, and then through a mudpit at ambient temperature, before being reinjected in the drillpipe.

The user can define drillpipe positions and material. When simulating a drilling operation the user chooses the drillpipe to be inserted into the well. The dynamic temperature evolution is then simulated for an arbitrary time while circulating fluid through the drillpipe. After the simulation, the drillpipe is removed and the construction of the well can continue with additional temperature simulations.

The hole to drill is considered as a cylinder. The position of he hole to drill, mud type, flow model, mud mass flow, pump pressure and drilling speed must also be provided as arguments.

During a driling operation it is also possible to set up a heat source that represents the total heat generating by friction.

### No Flow

During a no-flow simulation, there is no thermal convection. Only thermal conduction modify the temperature. It is considered that any drillpipe are removed from the well when simulating a no-flow operation. The user needs to define the duration of the simulation. The no-flow simulation can be used for exemple while running the casing.

### Cementation

The cementation simulation is similar to the no flow simulation, except that there is in addition heat generation while the cement cures (hydration heat).

### Production Flow

During the production simulation it is assumed that the fluid is produced at given depths (through an open hole or through perforations in a casing/liner/tubing). The perforations depths, the produced fluid properties and the production flowrate must be given as arguments. It is possible to choose to simulate an annular production or a tubing production, or both at the same time.

### Injection Flow

During the injection simulation it is assumed that the fluid is injected by a pump at the top of the drilling. The injected fluid properties, its temperature and the flowrate must be given as arguments.

### Circulating flow

During the circulation simulation it is assumed that the fluid is injected by a pump at the top of the drilling through a drillpipe, from the center to the annulus, or in the opposite direction, from the annulus to the center. At the surface, the fluid might go through a mudpit. The computed outlet conditions for the downflow is used as inlet conditions for the return flow.  The injected fluid properties, its temperature or that of the mudpit and the flowrate must be given as arguments.

### Shut-in

A shut-in operation can be done after an injection or production operation. The top of the well is considered as closed.The phases of the injected/produced fluid are redistributed in the following order: water at the bottom, then oil and finally gas on top. Some fluid may flow out/in the reservoir when the pressure/temperature change. The user needs only to define the duration of the simulation; the fluid properties are that of the fluid previously used when injecting/producing.

## Coupling of the Flow and Temperature Computations

The coupled flow-temperature simulation consists of steady state 1D flow computation(s) coupled to the 2D dynamic temperature integration. The pressures and flow(s) computed in the flow computation are again input to the dynamic temperature computation.&#x20;

Two main types of flow situations within the well are supported. The first type is a center flow: this is flow within a production tubing, within a drillpipe or flow in the casing enclosure. The second type is an annular flow: this is flow outside a production tubing or a drillpipe. In case of fluid circulation (with or without drilling), both an annular flow and a tubing flow are computed. The pressure and mixture velocity along the pipe can be done with either one-phase or three-phase models. For three-phase models holdups and phase velocities are also computed. For one-phase models, the density depends on the temperature and computed pressure.

&#x20;The 2D temperature grid is used to define the geometry of the 1D flow computation(s). The discretization in the axial direction is the same as in the temperature grid. The flow cross section and the hydraulic diameter are computed. This is done for each box in the axial direction by using the 2D temperature grid.&#x20;

The mass flow is then used for the 2D temperature computation. The 1D pressure and mass flow have to be 'distributed' back to the 2D temperature grid. The pressure in a flow box is simply copied to all the fluid filled grid cells which are contained in that 1D box. The total mass flow is distributing assuming plug flow and partition of the mass flows based on the flow cross section of each grid cell.

## Highlights

&#x20;Some main points for the dynamic temperature integration are:&#x20;

* The dynamic temperature equation is based on applying an integral energy balance for each grid cell volume.
* The equation includes the accumulation term, the terms for conductive and convective energy flows between grid cells, and the source term.
* The heat conduction is corrected due to the turbulent mixing and the wall heat transfer number in the flow path and is also modified due to the thermally induced free convection in the annuli.
* This correction uses published and recognized correlations.&#x20;
* The convective energy flow between grid volumes includes flow of internal energy and $$p\,\text{d}V$$-work (enthalpy) plus flow of potential energy minus flow of kinetic energy.
* The flow of potential energy is very important. Failure to include this energy flow would typically lead to a serious overestimation of the temperatures (of the order of $$10 \degree \text{C}$$) in the upper part of a production well.
* The equations are assembled into a system of O.D.E.s. This system is integrated in time using implicit Euler integration.
