# The transient heat transfer

## The dimensional thermal problem

The governing equation has the following form:

 ${\displaystyle \displaystyle k{\frac {\partial ^{2}u}{\partial x^{2}}}+f(x,t)=\rho c{\frac {\partial u}{\partial t}}}$ (1)

where ${\displaystyle \displaystyle k,\,c,\,\rho }$ are material thermal conductivity, specific heat and density proportionally.

The initial condition:

 ${\displaystyle \displaystyle u(x,t=0)=u_{0}}$ (2)

The boundary conditions:

 ${\displaystyle \displaystyle q(x=0,t)=q(x=L,t)=0}$ (3)

Using the Galerkin's Finite Element Method (FEM) as appendix 1 for a transient heat transfer problem, we obtain the global equations:

 ${\displaystyle \displaystyle \left[C\right]\left\{{\dot {U}}\right\}+\left[K\right]\left\{U\right\}=\left\{{F_{Q}}\right\}+\left\{{F_{g}}\right\}}$ (4)

where vector ${\displaystyle \left\{U\right\}=\left[{\begin{array}{*{20}c}{u_{1}}&\ldots &{u_{n}}\\\end{array}}\right]^{T}}$ is temperature at n nodes, that obtains by solving the original differential equation (4) with the initial condition (2).

We will demonstrate the above procedure through an example.

Example 1: Solving the 1D following heat equation in a cylindrical rod having diameter d and length L:

 ${\displaystyle \displaystyle k{\frac {\partial ^{2}u}{\partial x^{2}}}+f(x,t)=\rho c{\frac {\partial u}{\partial t}}\qquad 0\leq x\leq L,\,\,0\leq t\leq t_{end}=30s}$

with material parameters

${\displaystyle k=230\,W/m{}^{0}C,\,\,\,c=900\,J/kg{}^{0}C,\,\,\,\rho =2700kg/m^{3}}$

and geometric parameters

${\displaystyle L=0.1m,\,\,\,d=0.012m\,}$

Heat generation: ${\displaystyle f(x,t)={\begin{cases}Q=10^{7}\,\,\,\,\,\,\,\,\,\,\,\left({x,t}\right)\in \left[{0,{\frac {L}{2}}}\right]\times \left[{0,t_{1}}\right]\\0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,otherwise\end{cases}}}$

Initial condition:

 ${\displaystyle \displaystyle u(x,t=0)=u_{0}=30^{0}C}$

The boundary condition:

 ${\displaystyle \displaystyle q(x=0,t)=q(x=L,t)=0}$

Solution

Dividing the rod into four elements, each has length ${\displaystyle L_{e}={\frac {L}{4}}}$ . Thus, we have five nodes with five freedom degrees: ${\displaystyle \left\{U\right\}=\left[{\begin{array}{*{20}c}{u_{1}}&{u_{2}}&{u_{3}}&{u_{4}}&{u_{5}}\\\end{array}}\right]^{T}}$

FEM equations for each element are given as appendix 2

Subsituting numerical values into the global equation (4) we have:

 ${\displaystyle \displaystyle \left[K\right]=\left[{\begin{array}{*{20}c}{1.0403}&{-1.0403}&0&0&0\\{-1.0403}&{2.0806}&{-1.0403}&0&0\\0&{-1.0403}&{2.0806}&{-1.0403}&0\\0&0&{-1.0403}&{2.0806}&{-1.0403}\\0&0&0&{-1.0403}&{1.0403}\\\end{array}}\right]}$
 ${\displaystyle \displaystyle \left[C\right]=\left[{\begin{array}{*{20}c}{2.2898}&{1.1449}&0&0&0\\{1.1449}&{4.5796}&{1.1449}&0&0\\0&{1.1449}&{4.5796}&{1.1449}&0\\0&0&{1.1449}&{4.5796}&{1.1449}\\0&0&0&{1.1449}&{2.2898}\\\end{array}}\right]}$
 ${\displaystyle \displaystyle \left\{{F_{Q}}\right\}=\left\{{\begin{array}{*{20}c}{14.1345}\\{28.2690}\\{14.1345}\\0\\0\\\end{array}}\right\}\left\{{F_{g}}\right\}=\left\{{\begin{array}{*{20}c}0\\0\\0\\0\\0\\\end{array}}\right\}}$

To obtain solutions for first-order ordinary differential equations, we use the finite difference method or specifically the forward difference method. This method approximate the time derivative of the nodal temperature matrix as:

${\displaystyle \displaystyle \left\{{\dot {U}}\right\}\cong {\frac {\left\{{U(t+\Delta t}\right\}-\left\{{U(t)}\right\}}{\Delta t}}}$

Substituting the above equation, the global equation becomes

${\displaystyle \displaystyle \left\{{U(t_{i+1})}\right\}=\left\{{U(t_{i})}\right\}+\left[C\right]^{-1}\left({\left\{{F_{Q}(t_{i})}\right\}+\left\{{F_{q}(t_{i})}\right\}-\left[K\right]\left\{{U(t_{i})}\right\}}\right)\Delta t,\,\,\,\left\{{U(t_{0})}\right\}=\left\{{U_{0}}\right\}}$

In this example, this equation yields two cases:

a) From ${\displaystyle 0\leq t\leq t_{1}}$: heat generation is non-zero

${\displaystyle \displaystyle \left\{{U(t_{i+1})}\right\}=\left\{{U(t_{i})}\right\}+\left[C\right]^{-1}\left({\left\{{F_{Q}(t_{i})}\right\}-\left[K\right]\left\{{U(t_{i})}\right\}}\right)\Delta t,\,\,\,\left\{{U(t_{0})}\right\}=\left\{{U_{0}}\right\}}$

b) From ${\displaystyle t_{1}\leq t\leq t_{end}}$: heat generation is zero

${\displaystyle \displaystyle \left\{{{\tilde {U}}(t_{i+1})}\right\}=\left\{{{\tilde {U}}(t_{i})}\right\}-\left[C\right]^{-1}\left[K\right]\left\{{{\tilde {U}}(t_{i})}\right\}\Delta t,\,\,\,\left\{{{\tilde {U}}(t_{0})}\right\}=\left\{{U(t_{1})}\right\}}$

Therefore, nodal temperatures are:

${\displaystyle \displaystyle \left\{U\right\}=\left[{\begin{array}{*{20}c}{U(t_{0})}&{U(\Delta t)}&\ldots &{U(t_{1})}&{{\tilde {U}}(t_{1}+\Delta t)}&\ldots &{{\tilde {U}}(t_{end})}\\\end{array}}\right]}$

With ${\displaystyle t_{end}=30\,s,\,\,t_{1}={\frac {t_{end}}{3}}=10\,s,\,\,\Delta t=0.1\,s}$, we plot values ${\displaystyle \left\{{U(t)}\right\}}$ versus ${\displaystyle t}$.

## The nondimensional thermal problem

Now we nondimensionalize the heat transfer equation (1). For this equation, there are four fundamental units ${\displaystyle \left({F_{1},F_{2},F_{3},F_{4}}\right)=\left({m,s,K,W}\right)}$ and ten physical quantities which are listed below together with their corresponding dimensional formula for the unit in terms of the fundamental units:

Table 1: Heat transfer equation: Physical quantities
Physical quantity Symbol Dimensional formula
Initial temperature ${\displaystyle \displaystyle R_{1}=U_{0}}$ ${\displaystyle \displaystyle [R_{1}]=K=F_{3}}$
Temperature at time t ${\displaystyle \displaystyle R_{2}=U}$ ${\displaystyle \displaystyle [R_{2}]=K=F_{3}}$
The spatial coordinate ${\displaystyle \displaystyle R_{3}=L}$ ${\displaystyle \displaystyle [R_{3}]=m=F_{1}}$
The length of rod ${\displaystyle \displaystyle R_{4}=x}$ ${\displaystyle \displaystyle [R_{4}]=m=F_{1}}$
Time ${\displaystyle \displaystyle R_{5}=t_{end}}$ ${\displaystyle \displaystyle [R_{5}]=s=F_{2}}$
the last time ${\displaystyle \displaystyle R_{6}=t}$ ${\displaystyle \displaystyle [R_{6}]=s=F_{2}}$
The heat conductivity ${\displaystyle \displaystyle R_{7}=k}$ ${\displaystyle \displaystyle [R_{7}]=Wm^{-1}K^{-1}=F_{4}F_{1}^{-1}F_{3}^{-1}}$
The specific heat and mass density ${\displaystyle \displaystyle R_{8}=\rho c}$ ${\displaystyle \displaystyle [R_{8}]=Wsm^{-3}K^{-1}=F_{4}F_{2}F_{1}^{-3}F_{3}^{-1}}$
The heat flux ${\displaystyle \displaystyle R_{9}=q}$ ${\displaystyle \displaystyle [R_{9}]=Wm^{-2}=F_{4}F_{1}^{-2}}$
The heat source ${\displaystyle \displaystyle R_{10}=f(x,t)}$ ${\displaystyle \displaystyle [R_{10}]=Wm^{-3}=F_{4}F_{1}^{-3}}$

Thus, the dimension matrix is:

${\displaystyle \displaystyle A=\left[{\begin{array}{*{20}c}0&0&1&1&0&0&{-1}&{-3}&{-2}&{-3}\\0&0&0&0&1&1&0&1&0&0\\1&1&0&0&0&0&{-1}&{-1}&0&0\\0&0&0&0&0&0&1&1&1&1\\\end{array}}\right]_{4\times 10}}$

It can find the nullspace of matrix ${\displaystyle A}$:

${\displaystyle \displaystyle Null\left(A\right)=\left[{\begin{array}{*{20}c}{-1}&0&0&0&{-1}&{-1}\\1&0&0&0&0&0\\0&{-1}&0&2&1&2\\0&1&0&0&0&0\\0&0&{-1}&{-1}&0&0\\0&0&1&0&0&0\\0&0&0&{-1}&{-1}&{-1}\\0&0&0&1&0&0\\0&0&0&0&1&0\\0&0&0&0&0&1\\\end{array}}\right]_{10\times 6}}$

From the above result, we have six independent dimensionless groups of the original variables.

${\displaystyle \displaystyle R_{1}^{-1}R_{2}^{1}={\frac {U}{U_{0}}}={\prod }_{1},\,\,R_{3}^{-1}R_{4}^{1}\,={\frac {x}{L}}={\prod }_{2},\,\,\,R_{5}^{-1}R_{6}^{1}={\frac {t}{t_{end}}}={\prod }_{3},\,\,\,}$
${\displaystyle \displaystyle R_{3}^{2}R_{5}^{-1}R_{7}^{-1}R_{8}^{1}={\frac {L^{2}\rho c}{kt_{end}}}={\prod }_{4},\,\,\,R_{1}^{-1}R_{3}^{1}R_{7}^{-1}R_{9}^{1}={\frac {Lq}{kU_{0}}}={\prod }_{5},\,\,\,R_{1}^{-1}R_{3}^{2}R_{7}^{-1}R_{10}^{1}={\frac {L^{2}f(x,t)}{kU_{0}}}={\prod }_{6}}$

Alternatively we have 6 nondimensional variables which are provided as below:

${\displaystyle \displaystyle {\frac {U}{U_{0}}}=\Gamma \,\,\,\,\,\,(5)\,\,\,\,\,\,\,\,{\frac {x}{L}}=\xi \,\,\,\,\,\,(6)\,\,\,\,\,\,\,\,{\frac {t}{t_{end}}}=\tau \,\,\,\,\,\,(7)}$
${\displaystyle {\frac {kt_{end}}{L^{2}\rho c}}=\beta \,\,\,\,\,\,(8)\,\,\,\,\,\,\,\,{\frac {Lq_{i}\left(t\right)}{kU_{0}}}=\varphi \left(t\right)\,\,\,\,\,\,(9)\,\,\,\,\,\,{\frac {f\left({x,t}\right)t_{end}}{\rho cU_{0}}}=\Phi \left({\xi ,\tau }\right)\,\,\,\,\,\,(10)}$

In terms of these nondimensional variables the simplified thermal problem can be written in the following nondimensional form (the details of nondimensionalizing the heat problem are found in appendix 3):

Heat conduction equation:

${\displaystyle \beta {\frac {\partial ^{2}\Gamma }{\partial \xi ^{2}}}+\Phi \left({\xi ,\tau }\right)={\frac {\partial \Gamma }{\partial \tau }}\,\,\,\,\,\,(11),\,\,\left({\xi ,\tau }\right)\in \left[{0,1}\right]\times \left[{0,1}\right]}$

Initial condition:

${\displaystyle \displaystyle \Gamma \left({\xi ,\tau =0}\right)=1\,\,\,\,\,\,(12)}$

Boundary condition:

${\displaystyle \displaystyle \left.{-{\frac {\partial \Gamma }{\partial \xi }}}\right|_{\xi =0}=\varphi _{in},\,\,\left.{-{\frac {\partial \Gamma }{\partial \xi }}}\right|_{\xi =1}=\varphi _{out}\,\,\,\,\,\,(13)}$

where

${\displaystyle \varphi _{in}={\frac {Lq\left({x=0,t}\right)}{kU_{0}}},\,\,\,\,\,\,\varphi _{out}={\frac {Lq\left({x=L,t}\right)}{kU_{0}}}\,\,\,\,\,\,(14)}$

The complete set of nondimensional variables needed for the problem is given in equations (5)-(10). The nondimensional temperature ${\displaystyle \Gamma }$ can be expressed function of the nondimensional distance ${\displaystyle \xi }$ and the nondimensional time ${\displaystyle \tau }$ as well as function of four other nondimensional parameters.

The physical interpretation of the remaining four nondimensional parameters in equations (8)-(10) is the following. ${\displaystyle \beta }$, the Fourier number or a nondimensional thermal diffusivity, is the ratio of the rate of heat conduction and the rate of heat storage(thermal energy storage). ${\displaystyle \varphi }$ is the ratio of the incident heat flux and the rate of heat conduction, or can be seen as effective heat flux. Finally, ${\displaystyle \Phi }$ is the ratio of the heat source and the rate of heat storage, can interpreted as effective heat source.

Example 2: Solving the problem in example 1 with the nondimensional form. Using Galerkin's FEM, similarly to dimensional form, we have the desired FEM equation for one element:

${\displaystyle \displaystyle \left[{K^{\left(e\right)}}\right]\left\{{\begin{array}{*{20}c}{\Gamma _{1}\left(\tau \right)}\\{\Gamma _{2}\left(\tau \right)}\\\end{array}}\right\}+\left[{C^{\left(e\right)}}\right]\left\{{\begin{array}{*{20}c}{{\dot {\Gamma }}_{1}\left(\tau \right)}\\{{\dot {\Gamma }}_{2}\left(\tau \right)}\\\end{array}}\right\}=\left\{{F_{Q}^{\left(e\right)}}\right\}+\left\{{F_{g}^{\left(e\right)}}\right\}}$

where

${\displaystyle \displaystyle \left[{K^{\left(e\right)}}\right]={\frac {\beta }{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\,\,\,\,\,\,\,\,\,\,\left[{C^{\left(e\right)}}\right]={\frac {L_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]}$
${\displaystyle \displaystyle \left\{{F_{Q}^{\left(e\right)}}\right\}=\left\{{\begin{array}{*{20}c}{\int \limits _{0}^{L_{e}}{\Phi \left({\xi ,\tau }\right)N_{1}\left(\xi \right)d\xi }}\\{\int \limits _{0}^{L_{e}}{\Phi \left({\xi ,\tau }\right)N_{2}\left(\xi \right)d\xi }}\\\end{array}}\right\}={\frac {\Phi L_{e}}{2}}\left\{{\begin{array}{*{20}c}1\\1\\\end{array}}\right\}\left({if\,\,\,\Phi =const}\right)\,\,\,\,\,\,\,\,\,\,\,\left\{{F_{g}^{\left(e\right)}}\right\}=\beta \left\{{\begin{array}{*{20}c}{\left.{-{\frac {\partial \Gamma }{\partial \xi }}}\right|_{\xi =0}}\\{\left.{\frac {\partial \Gamma }{\partial \xi }}\right|_{\xi =1}}\\\end{array}}\right\}=\beta \left\{{\begin{array}{*{20}c}{\varphi _{1}}\\{-\varphi _{2}}\\\end{array}}\right\}}$

Using assembly procedure to obtain the global equations:

${\displaystyle \displaystyle \left[C\right]\left\{{{\dot {\Gamma }}(\tau )}\right\}+\left[K\right]\left\{\Gamma (\tau )\right\}=\left\{{F_{Q}}\right\}+\left\{{F_{g}}\right\}\,\,\,\,\,\,(15)}$

Dividing the rod into four element, each element has length ${\displaystyle L_{e}={\frac {1}{4}}}$, we have 5 nodes with 5 freedom degree:

${\displaystyle \left\{\Gamma \right\}=\left[{\Gamma _{1}}\,\,\,{\Gamma _{2}}\,\,\,{\Gamma _{3}}\,\,\,{\Gamma _{4}}\,\,\,{\Gamma _{5}}\,\,\,\right]^{T}\,\,\,\,and\,\,\,\left\{{\dot {\Gamma }}\right\}=\left[{{\dot {\Gamma }}_{1}}\,\,\,{{\dot {\Gamma }}_{2}}\,\,\,{{\dot {\Gamma }}_{3}}\,\,\,{{\dot {\Gamma }}_{4}}\,\,\,{{\dot {\Gamma }}_{5}}\,\,\,\right]^{T}}$

where

${\displaystyle \left[K\right]={\frac {\beta }{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}&0&0&0\\{-1}&2&{-1}&0&0\\0&{-1}&2&{-1}&0\\0&0&{-1}&2&{-1}\\0&0&0&{-1}&1\\\end{array}}\right]\,\,\,\,\,\,(16)}$
${\displaystyle \left[C\right]={\frac {L_{e}}{6}}\left[{\begin{array}{*{20}c}2&1&0&0&0\\1&4&1&0&0\\0&1&4&1&0\\0&0&1&4&1\\0&0&0&1&2\\\end{array}}\right]\,\,\,\,\,\,(17)}$
${\displaystyle \left[F_{Q}\right]={\frac {\Phi L_{e}}{2}}\left\{{\begin{array}{*{20}c}1\\2\\1\\0\\0\\\end{array}}\right\}\,\,\,\,\,\,(18)\,\,\,\,\,\,\left[F_{g}\right]=\beta \left\{{\begin{array}{*{20}c}{\varphi _{1}}\\0\\0\\0\\{-\varphi _{5}}\\\end{array}}\right\}\,\,\,\,\,\,(19)}$

Substituting the values of parameters, it can easily calculate conductance and capacitance matrix, forcing function vectors as

${\displaystyle \left[K\right]=\left[{\begin{array}{*{20}c}{{\rm {3}}{\rm {.0288}}}&{-{\rm {3}}{\rm {.0288}}}&0&0&0\\{-{\rm {3}}{\rm {.0288}}}&{{\rm {6}}{\rm {.0576}}}&{-{\rm {3}}{\rm {.0288}}}&0&0\\0&{-{\rm {3}}{\rm {.0288}}}&{{\rm {6}}{\rm {.0576}}}&{-{\rm {3}}{\rm {.0288}}}&0\\0&0&{-{\rm {3}}{\rm {.0288}}}&{{\rm {6}}{\rm {.0576}}}&{-{\rm {3}}{\rm {.0288}}}\\0&0&0&{-{\rm {3}}{\rm {.0288}}}&{{\rm {3}}{\rm {.0288}}}\\\end{array}}\right],\,\,\,\,\,\,\,\,}$
${\displaystyle \left[C\right]=\left[{\begin{array}{*{20}c}{{\rm {0}}{\rm {.0833}}}&{{\rm {0}}{\rm {.0417}}}&0&0&0\\{{\rm {0}}{\rm {.0417}}}&{{\rm {0}}{\rm {.1667}}}&{{\rm {0}}{\rm {.0417}}}&0&0\\0&{{\rm {0}}{\rm {.0417}}}&{{\rm {0}}{\rm {.1667}}}&{{\rm {0}}{\rm {.0417}}}&0\\0&0&{{\rm {0}}{\rm {.0417}}}&{{\rm {0}}{\rm {.1667}}}&{1.1449}\\0&0&0&{1.1449}&{{\rm {0}}{\rm {.0833}}}\\\end{array}}\right]}$
${\displaystyle \left\{{F_{Q}}\right\}=\left\{{\begin{array}{*{20}c}{{\rm {1}}{\rm {.3717}}}\\{{\rm {2}}{\rm {.7435}}}\\{{\rm {1}}{\rm {.3717}}}\\0\\0\\\end{array}}\right\},\,\,\,\left\{{F_{g}}\right\}=\beta \left\{{\begin{array}{*{20}c}{\varphi _{1}}\\{\rm {0}}\\{\rm {0}}\\0\\{-\varphi _{5}}\\\end{array}}\right\}=\left\{{\begin{array}{*{20}c}0\\0\\0\\0\\0\\\end{array}}\right\}\,\,\,\,\,\,\left({\varphi _{1}=\varphi _{in}=0,\,\,\varphi _{5}=\varphi _{out}=0}\right)}$

The graph of nondimensional temperature versus nondimensional time is below:

Example 3: Now we want to generate a graph that will give us the maximum value of the temperature in a rod as the example 1(max temperature over both time and space) for any value of ${\displaystyle \displaystyle k,c,\rho ,L,U_{0},Q,t_{1}}$ . We do this this by solving the non-dimensional equation (11)-(13) for a range of these values. It can easily find that the maximum value of the nondimensional temperature ${\displaystyle \displaystyle \Gamma _{\max }}$ depends on three independent nondimensional variables:

${\displaystyle \beta ={\frac {kt_{end}}{L^{2}\rho c}},\,\,\,\,\,\,{\bar {Q}}={\frac {Qt_{end}}{\rho cU_{0}}},\,\,\,\,\,\,\tau _{1}={\frac {t_{1}}{t_{end}}}}$.

From equation (15), we can note that the maximum temperature ${\displaystyle \displaystyle \Gamma _{\max }}$ will be linear in ${\displaystyle \displaystyle \Phi ={\bar {Q}}=const}$ so that we do not need this as a parameter. To prove this conclusion, we scale the solution by changing variable:

${\displaystyle \Lambda ={\frac {\Gamma -1}{\bar {Q}}}}$

At that time, the global equation (15) becomes:

${\displaystyle {\bar {Q}}\left[C\right]\left\{{{\dot {\Lambda }}(\tau )}\right\}+\left[K\right]\left\{{{\bar {Q}}\Lambda (\tau )+\left\{1\right\}}\right\}=\left\{F\right\}}$

or

${\displaystyle {\bar {Q}}\left[C\right]\left\{{{\dot {\Lambda }}(\tau )}\right\}+{\bar {Q}}\left[K\right]\left\{{\Lambda (\tau )}\right\}=\left\{{F_{Q}}\right\}\,-\left[K\right]\left\{1\right\}=\left\{{F_{Q}}\right\}\,\,\,\,\,\,(because\left[K\right]\left\{1\right\}=\left\{0\right\})}$

Thus, dividing both sides of above equation to ${\displaystyle {\bar {Q}}\neq 0}$, we get

${\displaystyle \left[C\right]\left\{{{\dot {\Lambda }}(\tau )}\right\}+\left[K\right]\left\{{\Lambda (\tau )}\right\}=\left\{F\right\}}$

where ${\displaystyle K,\,C}$ is determined as equations (16),(17) and ${\displaystyle \displaystyle F={\frac {L_{e}}{2}}\left[{1\,\,2\,\,1\,\,0\,\,0}\right]^{T}}$ with the initial condition ${\displaystyle \Lambda (0)=0}$

Summing up, the maximum nondimensional temperature ${\displaystyle \displaystyle \Gamma _{\max }}$ only depends on two independent nondimensional variables ${\displaystyle \displaystyle \beta ,\tau _{1}}$ The graph of ${\displaystyle \displaystyle \Gamma _{\max }}$ for a range of these two parameters is below:

## Appendix

### Appendix 1: Finite element procedures for a thermal problem

Here the Galerkin's Finite Element Method (FEM) is applied for the heat transfer equation to obtain the element equations. A two-node element with linear interpolation functions is used and the temperature distribution in an element expressed as

 ${\displaystyle \displaystyle u(x,t)=N_{1}(x)u_{1}(t)+N_{2}(x)u_{2}(t)}$ (20)

where ${\displaystyle \displaystyle u_{1}(t)}$ and ${\displaystyle \displaystyle u_{2}(t)}$ are the temperature at nodes 1 and 2, which define the element, and the interpolation functions ${\displaystyle \displaystyle N_{1}(x)}$ and ${\displaystyle \displaystyle N_{2}(x)}$ are given by ${\displaystyle \displaystyle N_{1}(x)=(1-{\frac {x}{L}})}$, ${\displaystyle \displaystyle N_{2}(x)={\frac {x}{L}}}$

Substitution of the discretized solution into the governing differential Equation results in the residual intergrals:

 ${\displaystyle \displaystyle \int _{0}^{L}\left(k{\frac {\partial ^{2}u}{\partial x^{2}}}+f(x,t)-\rho c{\frac {\partial u}{\partial t}}\right)N_{i}(x)A\,dx=0\quad i=1,\,2}$ (21)

where we note that the integration is over the volume of the element, that is, the domain of the problem, with ${\displaystyle \displaystyle dV=Adx}$

or

 ${\displaystyle \displaystyle kA\int _{0}^{L}N_{i}(x){\frac {\partial ^{2}u}{\partial x^{2}}}\,dx+A\int _{0}^{L}N_{i}(x)f(x,t)\,dx-\rho cA\int _{0}^{L}N_{i}(x){\frac {\partial u}{\partial t}}\,dx=0\quad i=1,\,2}$ (22)

Intergratig the first term by parts and rearranging,

 ${\displaystyle \displaystyle kA\int _{0}^{L}{\frac {dN_{i}(x)}{dx}}{\frac {\partial u}{\partial x}}\,dx+\rho cA\int _{0}^{L}N_{i}(x){\frac {\partial u}{\partial t}}\,dx=A\int _{0}^{L}N_{i}(x)f(x,t)\,dx+\left.{kAN_{i}\left(x\right){\frac {\partial u}{\partial x}}}\right|_{x=0}^{x=L}}$ (23)

Substituting for ${\displaystyle \displaystyle u(x,t)}$ from (20) yields

 ${\displaystyle \displaystyle kA\int _{0}^{L}{\frac {dN_{i}(x)}{dx}}\left({\frac {dN_{1}(x)}{dx}}u_{1}(t)+{\frac {dN_{2}(x)}{dx}}u_{2}(t)\right)\,dx+\rho cA\int _{0}^{L}N_{i}(x)\left(N_{1}(x){\dot {u}}_{1}(t)+N_{2}(x){\dot {u}}_{2}(t)\right)\,dx}$
 ${\displaystyle \displaystyle =A\int _{0}^{L}N_{i}(x)f(x,t)\,dx+\left.{kAN_{i}\left(x\right){\frac {\partial u}{\partial x}}}\right|_{x=0}^{x=L}\quad i=1,\,2}$ (24)

The two equations represented by equation (24) are conveniently combined into a matrix form by rewriting as

 ${\displaystyle \displaystyle u(x,t)=[N_{1}(x)N_{2}(x)]{\begin{Bmatrix}u_{1}(t)\\u_{2}(t)\end{Bmatrix}}}$ (25)

and substituting to obtain

 ${\displaystyle \displaystyle kA\int _{0}^{L}{\begin{bmatrix}{\dot {N}}_{1}(x)\\{\dot {N}}_{2}(x)\end{bmatrix}}\left[{\dot {N}}_{1}(x){\dot {N}}_{2}(x)\right]dx\,{\begin{Bmatrix}u_{1}(t)\\u_{2}(t)\end{Bmatrix}}+\rho cA\int _{0}^{L}{\begin{bmatrix}N_{1}(x)\\N_{2}(x)\end{bmatrix}}\left[N_{1}(x)N_{2}(x)\right]dx\,{\begin{Bmatrix}{\dot {u}}_{1}(t)\\{\dot {u}}_{2}(t)\end{Bmatrix}}}$
 ${\displaystyle \displaystyle =A\int _{0}^{L}{\begin{bmatrix}N_{1}(x)\\N_{2}(x)\end{bmatrix}}f(x,t)\,dx+kA{\begin{Bmatrix}\left.{-{\frac {\partial u}{\partial x}}}\right|_{x=0}\\\left.{\frac {\partial u}{\partial x}}\right|_{^{x=L}}\end{Bmatrix}}}$ (26)

Equation (26) is in the desired finite element form:

 ${\displaystyle \displaystyle \left[{k^{\left(e\right)}}\right]\left\{{\begin{array}{*{20}c}{u_{1}\left(t\right)}\\{u_{2}\left(t\right)}\\\end{array}}\right\}+\left[{c^{\left(e\right)}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{1}\left(t\right)}\\{{\dot {u}}_{2}\left(t\right)}\\\end{array}}\right\}=\left\{{f_{Q}^{\left(e\right)}}\right\}+\left\{{f_{g}^{\left(e\right)}}\right\}}$ (27)

where ${\displaystyle \left[{k^{\left(e\right)}}\right]}$ is the conductance matrix defined as

 ${\displaystyle \displaystyle {\begin{array}{l}\left[{k^{\left(e\right)}}\right]=kA\int \limits _{0}^{L}{\left[{\begin{array}{*{20}c}{\frac {dN_{1}}{dx}}\\{\frac {dN_{2}}{dx}}\\\end{array}}\right]}\left[{\begin{array}{*{20}c}{\frac {dN_{1}}{dx}}&{\frac {dN_{2}}{dx}}\\\end{array}}\right]dx=kA\int \limits _{0}^{L}{\left[{\begin{array}{*{20}c}{-{\frac {1}{L}}}\\{\frac {1}{L}}\\\end{array}}\right]}\left[{\begin{array}{*{20}c}{-{\frac {1}{L}}}&{\frac {1}{L}}\\\end{array}}\right]dx\\\,\,\,\,\,\,\,\,\,\,\,\,={\frac {kA}{L}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\\\end{array}}}$ (28)

and ${\displaystyle \left[{c^{\left(e\right)}}\right]}$ is the element capacitance matrix defined by

 ${\displaystyle \displaystyle {\begin{array}{l}\left[{c^{\left(e\right)}}\right]=c\rho A\int _{0}^{L}{\left[{\begin{array}{*{20}c}{N_{1}}\\{N_{2}}\\\end{array}}\right]\left[{\begin{array}{*{20}c}{N_{1}}&{N_{2}}\\\end{array}}\right]}dx=c\rho A\int _{0}^{L}{\left[{\begin{array}{*{20}c}{1-{\frac {x}{L}}}\\{\frac {x}{L}}\\\end{array}}\right]\left[{\begin{array}{*{20}c}{1-{\frac {x}{L}}}&{\frac {x}{L}}\\\end{array}}\right]}dx\\\,\,\,\,\,\,\,\,\,\,\,=c\rho AL\int _{0}^{1}{\left[{\begin{array}{*{20}c}{1-\xi }\\\xi \\\end{array}}\right]\left[{\begin{array}{*{20}c}{1-\xi }&\xi \\\end{array}}\right]}d\xi ={\frac {c\rho AL}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\\\end{array}}}$ (29)

The forcing function vectors on the right-hand side of equation (27) include the internal heat generation and boundary flux terms. These are given by

 ${\displaystyle \displaystyle \left[{f_{Q}^{\left(e\right)}}\right]=A\left\{{\begin{array}{*{20}c}{\int _{0}^{L}{f(x,t)N_{1}(x)}dx}\\{\int _{0}^{L}{f(x,t)N_{2}(x)}dx}\\\end{array}}\right\}}$ (30)
 ${\displaystyle \displaystyle \left[{f_{g}^{\left(e\right)}}\right]=kA\left\{{\begin{array}{*{20}c}{\left.{-{\frac {\partial u}{\partial x}}}\right|_{x=0}}\\{\left.{\frac {\partial u}{\partial x}}\right|_{x=L}}\\\end{array}}\right\}=A\left\{{\begin{array}{*{20}c}{\left.q\right|_{x=0}}\\{\left.{-q}\right|_{x=L}}\\\end{array}}\right\}=A\left\{{\begin{array}{*{20}c}{q_{1}}\\{-q_{2}}\\\end{array}}\right\}}$ (31)

Using assembly procedure for a transient heat transfer problem, we obtain the global equations:

 ${\displaystyle \displaystyle \left[C\right]\left\{{\dot {U}}\right\}+\left[K\right]\left\{U\right\}=\left\{{F_{Q}}\right\}+\left\{{F_{g}}\right\}}$ (32)

where vector ${\displaystyle \left\{U\right\}=\left[{\begin{array}{*{20}c}{u_{1}}&\ldots &{u_{n}}\\\end{array}}\right]^{T}}$ is temperature at n nodes, that obtains by solving the differential equation (32) with the initial condition (2).

### Appendix 2: Finite element implementation of a dimensional problem

FEM equations for each element are given as (27)

Element 1:

 ${\displaystyle \displaystyle {\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{u_{1}}\\{u_{2}}\\\end{array}}\right\}+{\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{1}}\\{{\dot {u}}_{2}}\\\end{array}}\right\}=QA\left\{{\begin{array}{*{20}c}{\int \limits _{0}^{L_{e}}{N_{1}(x)dx}}\\{\int \limits _{0}^{L_{e}}{N_{2}(x)dx}}\\\end{array}}\right\}+A\left\{{\begin{array}{*{20}c}{q_{1}}\\{-q_{2}}\\\end{array}}\right\}}$

or

 ${\displaystyle \displaystyle {\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{u_{1}}\\{u_{2}}\\\end{array}}\right\}+{\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{1}}\\{{\dot {u}}_{2}}\\\end{array}}\right\}={\frac {QAL_{e}}{2}}\left\{{\begin{array}{*{20}c}{1}\\{1}\\\end{array}}\right\}+A\left\{{\begin{array}{*{20}c}{q_{1}}\\{-q_{2}}\\\end{array}}\right\}}$

Element 2:

 ${\displaystyle \displaystyle {\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{u_{2}}\\{u_{3}}\\\end{array}}\right\}+{\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{2}}\\{{\dot {u}}_{3}}\\\end{array}}\right\}={\frac {QAL_{e}}{2}}\left\{{\begin{array}{*{20}c}{1}\\{1}\\\end{array}}\right\}+A\left\{{\begin{array}{*{20}c}{q_{2}}\\{-q_{3}}\\\end{array}}\right\}}$

Element 3:

 ${\displaystyle \displaystyle {\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{u_{3}}\\{u_{4}}\\\end{array}}\right\}+{\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{3}}\\{{\dot {u}}_{4}}\\\end{array}}\right\}={\frac {QAL_{e}}{2}}\left\{{\begin{array}{*{20}c}{1}\\{1}\\\end{array}}\right\}+A\left\{{\begin{array}{*{20}c}{q_{3}}\\{-q_{4}}\\\end{array}}\right\}}$

Element 4:

 ${\displaystyle \displaystyle {\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}\\{-1}&1\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{u_{4}}\\{u_{5}}\\\end{array}}\right\}+{\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1\\1&2\\\end{array}}\right]\left\{{\begin{array}{*{20}c}{{\dot {u}}_{4}}\\{{\dot {u}}_{5}}\\\end{array}}\right\}={\frac {QAL_{e}}{2}}\left\{{\begin{array}{*{20}c}{1}\\{1}\\\end{array}}\right\}+A\left\{{\begin{array}{*{20}c}{q_{4}}\\{-q_{5}}\\\end{array}}\right\}}$

The global equation (4) on the system assembly is:

 ${\displaystyle \displaystyle \left[C\right]\left\{{\dot {U}}\right\}+\left[K\right]\left\{U\right\}=\left\{{F_{Q}}\right\}+\left\{{F_{g}}\right\}}$

where

 ${\displaystyle \displaystyle \left[K\right]={\frac {kA}{L_{e}}}\left[{\begin{array}{*{20}c}1&{-1}&0&0&0\\{-1}&2&{-1}&0&0\\0&{-1}&2&{-1}&0\\0&0&{-1}&2&{-1}\\0&0&0&{-1}&1\\\end{array}}\right]\displaystyle \left[C\right]={\frac {c\rho AL_{e}}{6}}\left[{\begin{array}{*{20}c}2&1&0&0&0\\1&4&1&0&0\\0&1&4&1&0\\0&0&1&4&1\\0&0&0&1&2\\\end{array}}\right]}$
 ${\displaystyle \displaystyle \left\{{F_{Q}}\right\}={\frac {QAL_{e}}{2}}\left\{{\begin{array}{*{20}c}1\\2\\1\\0\\0\\\end{array}}\right\}\displaystyle \left\{{F_{g}}\right\}=A\left\{{\begin{array}{*{20}c}{q_{1}}\\0\\0\\0\\{-q_{5}}\\\end{array}}\right\}}$

### Appendix 3: Nondimensionalize the thermal problem

To clarify the nondimensionalizing process, we change variables:

${\displaystyle \displaystyle U\left({x,t}\right)=U_{0}\Gamma \left({\xi ,\tau }\right),\,\,{\frac {x}{L}}=\xi ,\,\,\,{\frac {t}{t_{end}}}=\tau }$

Therefore:

${\displaystyle \displaystyle {\frac {\partial U}{\partial x}}=U_{0}{\frac {\partial \Gamma }{\partial x}}=U_{0}{\frac {\partial \Gamma }{\partial \xi }}{\frac {\partial \xi }{\partial x}}={\frac {U_{0}}{L}}{\frac {\partial \Gamma }{\partial \xi }}}$
${\displaystyle \displaystyle \,{\frac {\partial ^{2}U}{\partial x^{2}}}={\frac {\partial }{\partial x}}\left({\frac {\partial U}{\partial x}}\right)={\frac {\partial }{\partial x}}\left({{\frac {U_{0}}{L}}{\frac {\partial \Gamma }{\partial \xi }}}\right)={\frac {U_{0}}{L}}{\frac {\partial }{\partial x}}\left({\frac {\partial \Gamma }{\partial \xi }}\right)={\frac {U_{0}}{L}}{\frac {\partial }{\partial \xi }}\left({\frac {\partial \Gamma }{\partial \xi }}\right){\frac {\partial \xi }{\partial x}}={\frac {U_{0}}{L^{2}}}{\frac {\partial ^{2}\Gamma }{\partial \xi ^{2}}}}$
${\displaystyle \displaystyle {\frac {\partial U}{\partial t}}=U_{0}{\frac {\partial \Gamma }{\partial t}}=U_{0}{\frac {\partial \Gamma }{\partial \tau }}{\frac {\partial \tau }{\partial t}}={\frac {U_{0}}{t_{end}}}{\frac {\partial \Gamma }{\partial \tau }}}$

Substituting the above quantities into the heat transfer problem (1):

${\displaystyle \displaystyle k{\frac {U_{0}}{L^{2}}}{\frac {\partial ^{2}\Gamma }{\partial \xi ^{2}}}+f\left({x,t}\right)=\rho c{\frac {U_{0}}{t_{end}}}{\frac {\partial \Gamma }{\partial \tau }}}$

or

${\displaystyle \displaystyle {\frac {kt_{end}}{L^{2}\rho c}}{\frac {\partial ^{2}\Gamma }{\partial \xi ^{2}}}+{\frac {f\left({x,t}\right)t_{end}}{\rho cU_{0}}}={\frac {\partial \Gamma }{\partial \tau }}}$

and the final form is:

${\displaystyle \displaystyle \beta {\frac {\partial ^{2}\Gamma }{\partial \xi ^{2}}}+\Phi \left({\xi ,\tau }\right)={\frac {\partial \Gamma }{\partial \tau }}}$

where

${\displaystyle \displaystyle \beta ={\frac {kt_{end}}{L^{2}\rho c}},\,\,\,\,\,\,\Phi \left({\xi ,\tau }\right)={\frac {f\left({x,t}\right)t_{end}}{\rho cU_{0}}}}$

The initial condition:

${\displaystyle \displaystyle U\left({x,t=0}\right)=U_{0}\Rightarrow \Gamma \left({\xi ,\tau =0}\right)=1}$

From

${\displaystyle q=-k{\frac {\partial U}{\partial x}}=-{\frac {kU_{0}}{L}}{\frac {\partial \Gamma }{\partial \xi }}\Rightarrow -{\frac {\partial \Gamma }{\partial \xi }}={\frac {Lq}{kU_{0}}}=\varphi }$

we have boundary conditions:

${\displaystyle \displaystyle \left.{-{\frac {\partial \Gamma }{\partial \xi }}}\right|_{\xi =0}={\frac {Lq\left({x=0,t}\right)}{kU_{0}}}={\frac {Lq_{in}}{kU_{0}}}=\varphi _{in},\,\,\,\,\,\,\left.{-{\frac {\partial \Gamma }{\partial \xi }}}\right|_{\xi =1}={\frac {Lq\left({x=L,t}\right)}{kU_{0}}}={\frac {Lq_{out}}{kU_{0}}}=\varphi _{out}}$