%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Finite-Difference Temperature Prediction}
\label{chap:finite_diff}

This appendix shows, in more detail, the numerical technic used in
Section~\ref{sec:temp_predict} to predict the temperatures at
different points of the tool for known tool-chip interface mean
temperature and dimensions; it uses the finite-difference method
applied for heat conduction. Information on finite-difference
theory applied to heat transfer problems can be found in
Reference~\cite{holman02}.

The cutting tool geometry was simplified to a rectangular block
with dimensions $X$, $Y$ and $Z$, and this block was further
divided into smaller rectangles, forming a grid of $m + 1$, $n +
1$, and $o + 1$ elements in the $x$, $y$ and $z$ direction,
respectively (Figure~\ref{fig:finite_diff}).
\begin{figure}[h]
   \center{\includegraphics{finite_diff.eps}}
   \caption{Three dimension geometry of cutting tool for the
   finite-difference prediction of the temperature distribution.}
   \label{fig:finite_diff}
\end{figure}
To start formulating the finite difference equations, one must
take into account the heat that flows into each element $(i, j,
k)$ ($i = 1\ldots m$, $j = 1\ldots n$, and $k = 1\ldots o$): $\dot
Q_1$ and $\dot Q_2$, with positive and negative directions along
the $x$-axis, respectively; $\dot Q_3$ and $\dot Q_4$, with
positive and negative directions along the $y$-axis, respectively;
$\dot Q_5$ and $\dot Q_6$, with positive and negative directions
along the $z$-axis, respectively; i.e. the heat flowing into
element $(i, j, k)$ from the 6 adjacent elements $(i - 1, j, k)$,
$(i + 1, j, k)$, $(i, j - 1, k)$, $(i, j + 1, k)$, $(i, j, k -
1)$, and $(i, j, k + 1)$. If no heat is generated inside the
element, the following energy balance applies:
\begin{eqnarray}
   \dot Q_1 + \dot Q_2 + \dot Q_3 + \dot Q_4 + \dot Q_5 + \dot Q_6 = 0
   \label{eq:energy_balance}
\end{eqnarray}
Depending on the location of the element, two mechanisms oh heat
transfer can be considered: heat conduction between neighbouring
elements ($\dot Q_\mr{cond}$) and heat convection between the
peripheral elements and the air surrounding the block ($\dot
Q_\mr{conv}$). The equation for $\dot Q_\mr{cond}$ is as follows:
\begin{eqnarray}
   \dot Q_\mr{cond} = \frac{A}{d}\kappa(T - T')
   \label{eq:q_cond}
\end{eqnarray}
where $A$ is the common heat transfer area between elements, $d$
is the distance between elements, $\kappa$ is the thermal
conductivity of the material, $T$ is the temperature of the
element of interest, and $T'$ is the temperature of the
neighbouring element. The equation for $\dot Q_\mr{conv}$ is
defined as follows:
\begin{eqnarray}
   \dot Q_\mr{conv} = Ah(T - T_\infty)
   \label{eq:q_conv}
\end{eqnarray}
where $A$ is the area of contact between the element and the
surrounding air, $h$ is the convective heat transfer coefficient,
$T$ is the temperature of the element, and $T_\infty$ is the air
temperature far away from the element. Moreover, by using
Equation~\ref{eq:energy_balance}, a general relationship that
relates the temperature of any element $(i, j, k)$ with the
temperatures from the six neighbouring elements can be
established:
\begin{eqnarray}
   \begin{array}{l}
      T^{N + 1, i, j, k} = \frac{
      C_1^{i, j, k}T^{N, i - 1, j, k} + C_2^{i, j, k}T^{N, i + 1, j, k} +
      C_3^{i, j, k}T^{N, i, j - 1, k} + C_4^{i, j, k}T^{N, i, j + 1, k} +
      C_5^{i, j, k}T^{N, i, j, k - 1} + C_6^{i, j, k}T^{N, i, j, k + 1}}
      {C_1^{i, j, k} + C_2^{i, j, k} + C_3^{i, j, k} +
      C_4^{i, j, k} + C_5^{i, j, k} + C_6^{i, j, k}}
   \end{array}
    \label{eq:finite_diff}
\end{eqnarray}
Before starting the numerical process, and since the temperatures
of the elements are still unknown, some initial value must be
assigned to the temperatures of each element $(i, j, k)$.
Subsequently, Equation~\ref{eq:finite_diff} can be used to predict
the values of $T^{N + 1, i, j, k}$ one iteration ahead ($N + 1$)
from the temperature of its neighbouring elements ($N$). This
procedure may be repeated until the temperatures start to converge
to its final values, i.e.\ when the convergence criterium that
follows is met:
\begin{eqnarray}
   \left| \frac{T^{N + 1, i, j, k} - T^{N, i, j, k}}
   {T^{N, i, j, k}}\right| \leq e
   \label{eq:conv_criterium}
\end{eqnarray}
where $e$ is the convergence error criterium. Moreover, since the
values of $C_1^{i, j, k}$, $C_2^{i, j, k}$, $C_3^{i, j, k}$,
$C_4^{i, j, k}$, $C_5^{i, j, k}$, and $C_6^{i, j, k}$ are
associated with the heat flows $\dot Q_1$, $\dot Q_2$, $\dot Q_3$,
$\dot Q_4$, $\dot Q_5$, and $\dot Q_6$, their values are dependent
on the location of the element $(i, j, k)$ in the block. Next, the
values of $C_1$ and $C_2$ that involve convection are stated:
\begin{eqnarray}
   \begin{array}{lll}
      C_1^{1, n + 1, 1} =
      C_2^{m + 1, 1, 1} =
      C_2^{m + 1, n + 1, 1} & = &
      \frac{\Delta y \Delta z_1}{4}h
      \\
      C_1^{1, 1, o + 1} =
      C_1^{1, n + 1, o + 1} =
      C_2^{m + 1, 1, o + 1} =
      C_2^{m + 1, n + 1, o + 1} & = &
      \frac{\Delta y \Delta z}{4}h
      \\
      C_1^{1, 2\ldots n, 1} =
      C_2^{m + 1, 2\ldots n, 1} & = &
      \frac{\Delta y \Delta z_1}{2}h
      \\
      C_1^{1, 2\ldots n, o + 1} =
      C_1^{1, 1, 3\dots o} =
      C_1^{1, n + 1, 3\ldots o} & = & \\
      C_2^{m + 1, 2\ldots n, o + 1} =
      C_2^{m + 1, 1, 3\ldots o} =
      C_2^{m + 1, n + 1, 3\ldots o} & = &
      \frac{\Delta y \Delta z}{2}h
      \\
      C_1^{1, n + 1, 2} =
      C_2^{m + 1, 1, 2} =
      C_2^{m + 1, n + 1, 2} & = &
      \frac{\Delta y (\Delta z_1 + \Delta z)}{4}h
      \\
      C_1^{1, 2\ldots n, 3\ldots o} =
      C_2^{m + 1, 2\ldots n, 3\ldots o} & = &
      \Delta y \Delta z h
      \\
      C_1^{1, 2\ldots n, 2} =
      C_2^{m + 1, 2\ldots n, 2} & = &
      \frac{\Delta y (\Delta z_1 + \Delta z)}{2}h
   \end{array}
   \label{eq:}
\end{eqnarray}
The values of $C_1$ and $C_2$ that involve conduction:
\begin{eqnarray}
   \begin{array}{lll}
      C_1^{m_1 + 2\ldots m + 1, 1, 1} =
      C_1^{2\ldots m + 1, n + 1, 1} =
      C_2^{m_1 + 2\ldots m, 1, 1} =
      C_2^{1\ldots m, n + 1, 1} & = &
      \frac{\Delta y \Delta z_1}{4\Delta x}
      \\
      C_1^{2\ldots m + 1, 1, o + 1} =
      C_1^{2\ldots m + 1, n + 1, o + 1} =
      C_2{1\ldots m, 1, o + 1} =
      C_2^{1\ldots m, n + 1, o + 1} & = &
      \frac{\Delta y \Delta z}{4\Delta x}\kappa
      \\
      C_1^{2\ldots m + 1, 2\ldots n, 1} =
      C_2^{1\ldots m, 2\ldots n, 1} & = &
      \frac{\Delta y \Delta z_1}{2\Delta x}\kappa
      \\
      C_1^{2\ldots m + 1, 2\ldots n, o + 1} =
      C_1^{2\ldots m + 1, 1, 3\ldots o} =
      C_1^{2\ldots m + 1, n + 1,3\ldots o} & = & \\
      C_2^{1\ldots m, 2\ldots n, o + 1} =
      C_2^{1\ldots m, 1, 3\ldots o} =
      C_2^{1\ldots m, n + 1, 3\ldots o} & = &
      \frac{\Delta y \Delta z}{2\Delta x}\kappa
      \\
      C_1^{m_1 + 2\ldots m + 1, 1, 2} =
      C_1^{2\ldots m + 1, n + 1, 2} =
      C_2^{m_1 + 2\ldots m, 1, 2} =
      C_2^{1\ldots m, n + 1, 2} & = &
      \frac{\Delta y (\Delta z_1 + \Delta z)}{4\Delta x}\kappa
      \\
      C_1^{2\ldots m + 1, 2\ldots n, 3\ldots o} =
      C_2^{1\ldots m, 2\ldots n, 3\ldots o} & = &
      \frac{\Delta y \Delta z}{\Delta x}\kappa
      \\
      C_1^{2\ldots m + 1, 2\ldots n, 2} =
      C_2^{1\ldots m, 2\ldots n, 2} & = &
      \frac{\Delta y (\Delta z_1 \Delta z)}{2\Delta x}\kappa
   \end{array}
\end{eqnarray}
The values of $C_3$ and $C_4$ that involve convection:
\begin{eqnarray}
   \begin{array}{lll}
      C_3^{m + 1, 1, 1} =
      C_4^{1, n + 1, 1} =
      C_4^{m + 1, n + 1} & = &
      \frac{\Delta x \Delta z_1}{4}h
      \\
      C_3^{1, 1, o + 1} =
      C_3^{m + 1, 1, o + 1} =
      C_4^{1, n + 1, o + 1} =
      C_4^{m + 1, n + 1, o + 1} & = &
      \frac{\Delta x \Delta z}{4}h
      \\
      C_3^{m_1 + 2\ldots m, 1, 1} =
      C_4^{2\ldots m, n + 1, 1} & = &
      \frac{\Delta x \Delta z_1}{2}h
      \\
      C_3^{2\ldots m, 1, o + 1} =
      C_3^{1, 1, 3\ldots o} =
      C_3^{m + 1, 1, 3\ldots o} & = & \\
      C_4^{2\ldots m, n + 1, o + 1} =
      C_4^{1, n + 1, 3\ldots o} =
      C_4^{m + 1, n + 1, 3\ldots o} & = &
      \frac{\Delta x \Delta z}{2}h
      \\
      C_3^{m + 1, 1, 2} =
      C_4^{1, n + 1, 2} =
      C_4^{m + 1, n + 1, 2} & = &
      \frac{\Delta x (\Delta z_1 + \Delta z)}{4}h
      \\
      C_3^{2\ldots m, 1, 3\ldots o} =
      C_4^{2\ldots m, n + 1, 3\ldots o} & = &
      \Delta x \Delta x h
      \\
      C_3^{m_1 + 2\ldots m, 1, 2} =
      C_4^{2\ldots m, n + 1, 2} & = &
      \frac{\Delta x (\Delta z_1 + \Delta z)}{2}h
   \end{array}
\end{eqnarray}
The values of $C_3$ and $C_4$ that involve conduction:
\begin{eqnarray}
   \begin{array}{lll}
      C_3^{1, 2\ldots n + 1, 1} =
      C_3^{m + 1, 2\ldots n + 1, 1} =
      C_4^{1, 2\ldots n, 1} =
      C_4^{m + 1, 1\ldots n, 1} & = &
      \frac{\Delta x \Delta z_1}{4\Delta}
      \\
      C_3^{1, 2\ldots  n + 1, o + 1} =
      C_3^{m + 1, 2\ldots  n + 1, o + 1} =
      C_4^{1, 1\ldots n, o + 1} =
      C_4^{m + 1, 1\ldots n, o + 1} & = &
      \frac{\Delta x \Delta z}{4\Delta y}\kappa
      \\
      C_3^{2\ldots m, 2\ldots n + 1, 1} =
      C_4^{2\ldots m_1 + 1, 2\ldots n, 1} =
      C_4^{m_1 + 2\ldots m, 1\ldots n, 1} & = &
      \frac{\Delta x \Delta z_1}{\Delta y}\kappa
      \\
      C_3^{2\ldots m, 2\ldots n + 1, o + 1} =
      C_3^{1, 2\ldots n + 1, 3\ldots o} =
      C_3^{m + 1, 2\ldots n + 1,   3\ldots o} & = & \\
      C_4^{2\ldots m, 1\ldots n, o + 1} =
      C_4^{1, 1\ldots n, 3\ldots o} =
      C_4^{m + 1, 1\ldots n, 3\ldots o} & = &
      \frac{\Delta x \Delta z}{2\Delta y}\kappa
      \\
      C_3^{1, 2\ldots n + 1, 2} =
      C_3^{m + 1, 2\ldots n + 1, 2} =
      C_4^{1, 2\ldots n, 2} =
      C_4^{m + 1, 1\ldots n, 2} & = &
      \frac{\Delta x (\Delta z_1 + \Delta z)}{4\Delta y}\kappa
      \\
      C_3^{2\ldots m, 2\ldots n + 1, 3\ldots o} =
      C_4^{2\ldots m, 1\ldots n, 3\ldots o} & = &
      \frac{\Delta x \Delta z}{\Delta y}\kappa
      \\
      C_3^{2\ldots m, 2\ldots n + 1, 2} =
      C_4^{2\ldots m1 + 1, 2\ldots n, 2} =
      C_4^{m1 + 2\ldots m, 1\ldots n, 2} & = &
      \frac{\Delta x (\Delta z_1 \Delta z)}{2\Delta y}\kappa
   \end{array}
\end{eqnarray}
The values of $C_5$ and $C_6$ that involve convection:
\begin{eqnarray}
   \begin{array}{lll}
       C_5^{m + 1, 1, 1} =
       C_5^{1, n + 1, 1} =
       C_5^{m + 1, n + 1, 1} & = & \\
       C_6^{1, 1, o + 1} =
       C_6^{m + 1, 1, o + 1} =
       C_6^{1, n + 1, o + 1} =
       C_6^{m + 1, n + 1, o + 1} & = &
       \frac{\Delta x \Delta y}{4}h
       \\
      C_5^{m_1 + 2\ldots m, 1, 1} =
      C_5^{2\ldots m, n + 1, 1} =
      C_5^{1, 2\ldots n, 1} =
      C_5^{m + 1, 2\ldots n, 1} & = & \\
      C_6^{2\ldots m, 1, o + 1} =
      C_6^{2\ldots m, n + 1, o + 1} =
      C_6^{1, 2\ldots n, o + 1} =
      C_6^{m + 1, 2\ldots n, o + 1} & = &
      \frac{\Delta x \Delta y}{2}h
      \\
      C_5^{2\ldots m, 2\ldots n, 1} =
      C_6^{2\ldots m, 2\ldots n, o + 1} & = &
      \Delta z \Delta y h
   \end{array}
\end{eqnarray}
Finally, the values of $C_5$ and $C_6$ that involve conduction:
\begin{eqnarray}
   \begin{array}{lll}
      C_5^{1, 1, 3\ldots o + 1} =
      C_5^{m + 1, 1, 3\ldots o + 1} =
      C_5^{1, n + 1, 3\ldots o + 1} =
      C_5^{m + 1, n + 1, 3\ldots o + 1} & = & \\
      C_6^{1, 1, 3\ldots o} =
      C_6^{m + 1, 1, 2\ldots o} =
      C_6^{1, n + 1, 2\ldots o} =
      C_6^{m + 1, n + 1, 2\ldots o} & = &
      \frac{\Delta x \Delta y}{4\Delta z}\kappa
      \\
      C_5^{m + 1, 1, 2} =
      C_5^{1, n + 1, 2} =
      C_5^{m + 1, n + 1, 2} & = & \\
      C_6^{m + 1, 1, 1} =
      C_6^{1, n + 1, 1} =
      C_6^{m + 1, n + 1, 1} & = &
      \frac{\Delta x \Delta y}{4 \Delta z_1}\kappa
      \\
      C_5^{2\ldots m, 1, 3\ldots o + 1} =
      C_5^{2\ldots m, n + 1, 3\ldots o + 1} =
      C_5^{1, 2\ldots n, 3\ldots o + 1} =
      C_5^{m + 1, 2\ldots n, 3\ldots o + 1} & = & \\
      C_6^{2\ldots m, 1, 3\ldots o} =
      C_6^{2\ldots m, n + 1, 2\ldots o} =
      C_6^{1, 2\ldots n, 2\ldots o} =
      C_6^{m + 1, 2\ldots n, 2\ldots o} & = &
      \frac{\Delta x \Delta y}{2\Delta z}\kappa
      \\
      C_5^{m_1 + 2\ldots m, 1, 2} =
      C_5^{2\ldots m, n + 1, 2} =
      C_5^{1, 2\ldots n, 2} =
      C_5^{m + 1, 2\ldots n, 2} & = & \\
      C_6^{m_1 + 2\ldots m, 1, 1\ldots 2} =
      C_6^{2\ldots m, n + 1, 1} =
      C_6^{1, 2\ldots n, 1} =
      C_6^{m + 1, 2\ldots n, 1} & = &
      \frac{\Delta x \Delta y}{2\Delta z_1}\kappa
      \\
      C_5^{2\ldots m, 2\ldots n, 3\ldots o + 1} =
      C_6^{2\ldots m, 2\ldots n, 2\ldots o} & = &
      \frac{\Delta x \Delta y}{\Delta z}\kappa
      \\
      C_5^{2\ldots m, 2\ldots n, 2} =
      C_6^{2\ldots m, 2\ldots n, 1} & = &
      \frac{\Delta x \Delta y}{\Delta z_1}\kappa
   \end{array}
\end{eqnarray}
where $\Delta x = \frac{X}{m}$, $\Delta y = \frac{Y}{n}$, $\Delta
z_1 = l_\mr{int}$, $\Delta z = \frac{Z - l_\mr{int}}{o - 1}$, $m_1
= \frac{w}{\Delta x}$. In addition, since the temperature of the
tool-chip contact area remains constant during the whole process,
the following equation must be combined with
Equation~\ref{eq:finite_diff}:
\begin{eqnarray}
   \begin{array}{lll}
      T^{N + 1, i, j, k} = T_\mr{int} & \mbox{for} &
      i \leq \frac{w}{\Delta x} + 0.5 \mbox{ and } j = 1 \mbox{ and } k \leq 2
   \end{array}
   \label{eq:finite_diff_aux}
\end{eqnarray}
Finally, it must be noted that Equations~\ref{eq:finite_diff}
and~\ref{eq:finite_diff} solely define $T^{i, j, k}$ for the
rectangular block shown in Figure~\ref{fig:finite_diff}, i.e. $i =
1\ldots m + 1$, $j = 1\ldots n + 1$, and $k = 1\ldots o + 1$.
However, in order to complete the model, the convective heat that
flows between the air and the boundaries of the block must also be
specified; this is done as follows:
\begin{eqnarray}
   \begin{array}{lll}
      T^{0, 0\ldots n + 2, 0\ldots o + 2} =
      T^{m + 2, 0\ldots n + 2, 0\ldots o + 2} & = & \\
      T^{1\ldots m + 1, 0, 0\ldots o + 2} =
      T^{1\ldots m + 1, n + 2, 0\ldots o + 2} & = & \\
      T^{1\ldots m + 1, 1\ldots n + 1, 0} =
      T^{1\ldots m + 1, 1\ldots n + 1, o +2} & = & T_\infty
   \end{array}
   \label{eq:air_temp}
\end{eqnarray}

\begin{figure}[h]
   \center{\includegraphics{temp_example.eps}}
   \caption{Example of temperature predictions using the
   finite-difference method. (a)~Variation of temperature $T_1$
   with $N$ until convergence is reached. (b)~Two-dimensional
   temperature distribution on plane $z = 0 \mbox{ mm}$
   (temperature units: $^\circ$C).}
   \label{fig:finite_diff_example}
\end{figure}
Figure~\ref{fig:finite_diff_example} shows an example of the
temperatures predicted by the finite-difference method described
above for $T_\mr{int} = 1000^\circ$C, $T_\infty = 25^\circ$C, $w =
1$~mm, $l_\mr{int} = 0.1$~mm, $X = 20$~mm, $Y = 20$~mm, $Z =
20$~mm. The values of $\kappa$ and $h$ were estimated:
\mbox{50~W$/$m-$^\circ$C} and \mbox{100~W$/$m$^2$-$^\circ$C},
respectively. Convergence was attained for $e = 10^{-7}$
(Equation~\ref{eq:conv_criterium}) for the successive calculated
temperatures obtained at location $x = 0\mbox{ mm}$, $y = 5\mbox{
mm}$, and $z = 0\mbox{ mm}$, temperature $T_1$.
Figure~\ref{fig:finite_diff_example}a shows the variation of $T_1$
for each iteration during the finite-difference computation
procedure. It can also be observed that $T_1$ rises initially
quickly from the initial value given to the unknown elements of
the block (150$^\circ$C), converging later slowly to its final
value (234$^\circ$C). Figure~\ref{fig:finite_diff_example}b shows
the temperature distribution after convergence on the $xy$-face of
the block that is under the tool-chip interface.
