FEATool Multiphysics
v1.10 Finite Element Analysis Toolbox |

Transient Heat Diffusion in a Rod

Transient heat diffusion problem where a unit length rod is kept at fixed temperature *T = 25* at the right end and losing heat from a constant outward heat flux *q _{n} = 1* at the other end. The computed results are compared with the analytic solution

\[ T_{ref} = (24+x) + \sum_{n=1}^\infty 8/(1-2n)^2/\pi^2cos((n-1/2)\pi x)e^{-((n-1/2)^2\pi^2)t} \]

This model is available as an automated tutorial by selecting **Model Examples and Tutorials...** > **Heat Transfer** > **Transient Heat Diffusion in a Rod** from the **File** menu. Or alternatively, follow the step-by-step instructions below.

- To start a new model click the
**New Model**toolbar button, or select*New Model...*from the*File*menu. - Select the
**1D**radio button. Select the

**Heat Transfer**physics mode from the*Select Physics*drop-down menu.- Press
**OK**to finish the physics mode selection. - Press the
**Create line***Toolbar*button. Press

**OK**to finish and close the dialog box.- Switch to
**Grid**mode by clicking on the corresponding*Mode Toolbar*button. Press the

**Generate**button to call the grid generation algorithm.- Switch to
**Equation**mode by clicking on the corresponding*Mode Toolbar*button. Enter

`25`

into the*Initial condition for T*edit field.- Press
**OK**to finish the equation and subdomain settings specification.

A convenient way to to define and store coefficients, variables, and expressions is using the *Model Constants and Expressions* functionality. The defined expressions can then be used in point, equation, boundary coefficients, as well as postprocessing expressions, and can easily be changed and updated in a single place. Enter an the expression for the reference temperature *T _{ref}* with two terms (n = 2).

- Press the
**Constants***Toolbar*button. - Enter
`Tref`

into the edit field for the variable name. Enter

`(24+x) + 8/pi^2*cos(pi/2*x)*exp(-pi^2/4*t) + 8/9/pi^2*cos(3*pi/2*x)*exp(-(9/4*pi^2)*t)`

into the edit field for the expression.- Press
**OK**to finish and close the dialog box. - Switch to
**Boundary**mode by clicking on the corresponding*Mode Toolbar*button. - Select
**1**in the*Boundaries*list box. - Select
**Heat flux**from the*Heat Transfer*drop-down menu. Enter

`-1`

into the*Inward heat flux*edit field.- Select
**2**in the*Boundaries*list box. - Select
**Temperature**from the*Heat Transfer*drop-down menu. Enter

`25`

into the*Temperature*edit field.- Press
**OK**to finish the boundary condition specification. - Switch to
**Solve**mode by clicking on the corresponding*Mode Toolbar*button. - Press the
**Settings***Toolbar*button. - Select
**Time-Dependent**from the*Solution and solver type*drop-down menu. - Enter
`0.01`

into the*Time step size*edit field. Enter

`0.2`

into the*Duration of time-dependent simulation (maximum time)*edit field.Press the

**Solve**button.- Press the
**Plot Options***Toolbar*button.

The temperature at the final time is shown where one can see that the temperature is a constant 25 degrees at the right end and is losing heat towards the left.

Plot and visualize the difference between the computed and reference temperature fields.

Enter

`T-Tref`

into the*User defined surface plot expression*edit field.- Press
**OK**to plot and visualize the selected postprocessing options. - Select
**Axis/Grid Settings...**from the*Options*menu. - Select the
**Axis equal**radio button. - Clear the
**Bounding box**check box. - Select the
**Axis limits**radio button. Enter

`0 1 -1e-3 1e-3`

into the*Manual axis settings [xmin xmax ymin ymax]*edit field.Press

**OK**to finish and close the dialog box.

The error already has a small magnitude of *10 ^{-3}* but could be improved with a smaller grid size, higher element order, and smaller time step size.

The *transient heat diffusion in a rod* heat transfer model has now been completed and can be saved as a binary (.fea) model file, or exported as a programmable MATLAB m-script text file, or GUI script (.fes) file.