*2.2. Numerical Scheme*

In this study, we derive the numerical transient heat transfer model in a two-dimensional r-z domain to derive the TDR (Figure 2). The finite volume method is implemented for the discretization, which is known for satisfying the heat energy balance of each element. The backward difference approximation for temporal discretization is used. For spatial discretization, we calculate the first derivatives with the forward difference approximation

and the second derivatives with the central difference approximation. The governing equations in Equation (9) are discretized as

*Ahρmcm Tn*+<sup>1</sup> 1,*<sup>j</sup>* − *<sup>T</sup><sup>n</sup>* 1,*j* <sup>Δ</sup>*<sup>t</sup>* <sup>=</sup> *hh*,*<sup>a</sup> Tn*+<sup>1</sup> 2,*<sup>j</sup>* <sup>−</sup> *<sup>T</sup>n*+<sup>1</sup> 1,*j* + *Ahλ<sup>m</sup> Tn*+<sup>1</sup> 1,*j*+<sup>1</sup> <sup>−</sup> <sup>2</sup>*Tn*+<sup>1</sup> 1,*<sup>j</sup>* <sup>+</sup> *<sup>T</sup>n*+<sup>1</sup> 1,*j*−1 <sup>Δ</sup>*z*<sup>2</sup> <sup>+</sup> *ρmcmq Tn*+<sup>1</sup> 1,*j*+<sup>1</sup> <sup>−</sup> *<sup>T</sup>n*+<sup>1</sup> 1,*j* <sup>Δ</sup>*<sup>z</sup>* <sup>−</sup> *<sup>Q</sup>n*+<sup>1</sup> *<sup>h</sup>*,*a*,*<sup>j</sup>* (drilling hole), *Aaρmcm Tn*+<sup>1</sup> 2,*<sup>j</sup>* − *<sup>T</sup><sup>n</sup>* 2,*j* <sup>Δ</sup>*<sup>t</sup>* <sup>=</sup> *hh*,*<sup>a</sup> Tn*+<sup>1</sup> 1,*<sup>j</sup>* <sup>−</sup> *<sup>T</sup>n*+<sup>1</sup> 2,*j* <sup>−</sup> *Lc*,*rλ<sup>f</sup> <sup>β</sup>n*+<sup>1</sup> *<sup>j</sup>* + *Aaλ<sup>m</sup> Tn*+<sup>1</sup> 2,*j*+<sup>1</sup> <sup>−</sup> <sup>2</sup>*Tn*+<sup>1</sup> 2,*<sup>j</sup>* <sup>+</sup> *<sup>T</sup>n*+<sup>1</sup> 2,*j*−1 <sup>Δ</sup>*z*<sup>2</sup> − *ρmcmq Tn*+<sup>1</sup> 2,*j*+<sup>1</sup> <sup>−</sup> *<sup>T</sup>n*+<sup>1</sup> 2,*j* <sup>Δ</sup>*<sup>z</sup>* <sup>+</sup> *<sup>Q</sup>n*+<sup>1</sup> *<sup>h</sup>*,*a*,*<sup>j</sup>* (annulus), *ρ<sup>f</sup> c <sup>f</sup> Tn*+<sup>1</sup> *<sup>i</sup>*,*<sup>j</sup>* − *<sup>T</sup><sup>n</sup> i*,*j* <sup>Δ</sup>*<sup>t</sup>* <sup>=</sup> *<sup>λ</sup><sup>f</sup>* (*ri*−1/2 + *ri*<sup>+</sup>1/2)/2 *ri*+1/2*Tn*+<sup>1</sup> *<sup>i</sup>*+1,*<sup>j</sup>* <sup>−</sup> (*ri*<sup>+</sup>1/2 <sup>+</sup> *ri*−1/2)*Tn*+<sup>1</sup> *<sup>i</sup>*,*<sup>j</sup>* <sup>+</sup> *ri*−1/2*Tn*+<sup>1</sup> *i*−1,*j* <sup>Δ</sup>*r*<sup>2</sup> <sup>+</sup> *λf Tn*+<sup>1</sup> *<sup>i</sup>*,*j*+<sup>1</sup> <sup>−</sup> <sup>2</sup>*Tn*+<sup>1</sup> *<sup>i</sup>*,*<sup>j</sup>* <sup>+</sup> *<sup>T</sup>n*+<sup>1</sup> *i*,*j*−1 <sup>Δ</sup>*z*<sup>2</sup> (reservoir : *<sup>i</sup>* <sup>≥</sup> <sup>3</sup>). (13)

**Figure 2.** Scheme for numerical simulation of drill pipe, annulus, and formation.

Note that *Th* = *Ti*=1, *Ta* = *Ti*=2, and *Tf* = *Ti*≥3. The subscripts *i* and *j* and the superscript *n* indicate indices for *r*, *z*, and *t*, respectively. The discretization sizes Δ*r*, Δ*z*, and Δ*t* are defined as

$$\begin{aligned} \Delta r &= \frac{r\_\varepsilon - r\_\varepsilon}{n\_r - 2}, \\ \Delta z &= \frac{\left| z\_{\text{left,tot}} \right|}{n\_z}, \\ \Delta t &= \frac{t\_{\text{tot}}}{n\_t}, \end{aligned} \tag{14}$$

where *nt* is the total number of time steps, *nr* and *nz* are the total number of grid cells in r and z directions, and *ri* and *zj* are represented as

$$r\_i = \begin{cases} r\_h/2, & \text{, } i = 1\\ \left(r\_p + r\_a\right)/2 & \text{, } i = 2, \\ r\_c + (i - 5/2)\Delta r \text{, } i > 2 \end{cases} \tag{15}$$
 
$$r\_{i+1/2} = (r\_i + r\_{i+1})/2, \\ z\_j = z\_{hth,hot} + (j - 1/2)\Delta z,$$

*βn*+<sup>1</sup> *<sup>j</sup>* and *<sup>Q</sup>n*+<sup>1</sup> *<sup>h</sup>*,*a*,*<sup>j</sup>* in Equation (13) are approximated as

$$\begin{split} \beta\_{j}^{n+1} &\approx \frac{1}{r\_{7/2} - r\_{5/2}} \left( r\_{7/2} \frac{T\_{4,j}^{n+1} - T\_{3,j}^{n+1}}{\Delta r} - r\_{5/2} \frac{T\_{3,j}^{n+1} - T\_{2,j}^{n+1}}{r\_3 - r\_2} \right), \\ Q\_{h,a,j}^{n+1} &\approx \rho\_m c\_m q \frac{T\_{2,j}^{n+1} - T\_{1,j}^{n+1}}{\Delta r} \chi\_{z\_{\text{left}}}(z\_j). \end{split} \tag{16}$$

We developed a MATLAB-based in-house simulator to solve the numerical systems with Equations (13) and (16). With the simulator, we can derive the temperature profile at each time step. In this study, we estimate TDR from the numerical transient simulation, where

$$\frac{|T(r = TDR) - T(r = r\_c)|}{T(r = r\_c)} < 0.001. \tag{17}$$

Figure 3 indicates a simplified flowchart of the calculation process obtaining the temperature distribution and TDR. The temperature distribution and TDR are computed for each time step.

**Figure 3.** The flow chart of calculation.
