Main Content

Heat Distribution in Circular Cylindrical Rod

This example shows how to simplify a 3-D axisymmetric thermal problem to a 2-D problem using the symmetry around the axis of rotation of the body.

This example analyzes heat transfer in a rod with a circular cross section. There is a heat source at the bottom of the rod and a fixed temperature at the top. The outer surface of the rod exchanges heat with the environment because of convection. In addition, the rod itself generates heat because of radioactive decay. The goal is to find the temperature in the rod as a function of time.

The model geometry, material properties, and boundary conditions must all be symmetric about the axis of rotation. The toolbox assumes that the axis of rotation is the vertical axis passing through r = 0.

Steady-State Solution

First, compute the steady-state solution. If the final time in the transient analysis is sufficiently large, the transient solution at the final time must be close to the steady state solution. By comparing these two results, you can check the accuracy of the transient analysis.

Create a steady-state thermal model for solving an axisymmetric problem.

thermalModelS = createpde('thermal','steadystate-axisymmetric');

The 2-D model is a rectangular strip whose x-dimension extends from the axis of symmetry to the outer surface and y-dimension extends over the actual length of the rod (from -1.5 m to 1.5 m). Create the geometry by specifying the coordinates of its four corners.

g = decsg([3 4 0 0 .2 .2 -1.5 1.5 1.5 -1.5]');

Include the geometry in the model.


Plot the geometry with the edge labels.

axis equal

Figure contains an axes. The axes contains 5 objects of type line, text.

The rod is composed of a material with these thermal properties.

k = 40; % Thermal conductivity, W/(m*C)
rho = 7800; % Density, kg/m^3
cp = 500; % Specific heat, W*s/(kg*C)
q = 20000; % Heat source, W/m^3

For a steady-state analysis, specify the thermal conductivity of the material.


Specify the internal heat source.


Define the boundary conditions. There is no heat transferred in the direction normal to the axis of symmetry (edge 1). You do not need to change the default boundary condition for this edge. Edge 2 is kept at a constant temperature T = 100 °C.


Specify the convection boundary condition on the outer boundary (edge 3). The surrounding temperature at the outer boundary is 100 °C, and the heat transfer coefficient is 50W/(mC).


The heat flux at the bottom of the rod (edge 4) is 5000W/m2.


Generate the mesh.

msh = generateMesh(thermalModelS);
axis equal

Figure contains an axes. The axes contains 2 objects of type line.

Solve the model and plot the result.

result = solve(thermalModelS);
T = result.Temperature;
axis equal
title 'Steady-State Temperature'

Figure contains an axes. The axes with title Steady-State Temperature contains 12 objects of type patch, line.

Transient Solution

Create a transient thermal model for solving an axisymmetric problem.

thermalModelT = createpde('thermal','transient-axisymmetric');

Use the same geometry and mesh as for the steady-state analysis.

g = decsg([3 4 0 0 .2 .2 -1.5 1.5 1.5 -1.5]');

thermalModelT.Mesh = msh;

Specify the thermal conductivity, mass density, and specific heat of the material.


Specify the internal heat source and boundary conditions.



Specify that the Initial temperature in the rod is 0 °C.


Compute the transient solution for solution times from t = 0 to t = 50000 seconds.

tfinal = 50000;
tlist = 0:100:tfinal;
result = solve(thermalModelT,tlist);

Plot the temperature distribution at t = 50000 seconds.

T = result.Temperature;

axis equal
title(sprintf('Transient Temperature at Final Time (%g seconds)',tfinal))

Figure contains an axes. The axes with title Transient Temperature at Final Time (50000 seconds) contains 12 objects of type patch, line.

Find the temperature at the bottom surface of the rod: first, at the center axis and then on the outer surface.

Tcenter = interpolateTemperature(result,[0.0;-1.5],1:numel(tlist));
Touter = interpolateTemperature(result,[0.2;-1.5],1:numel(tlist));

Plot the temperature at the left end of the rod as a function of time. The outer surface of the rod is exposed to the environment with a constant temperature of 100 °C. When the surface temperature of the rod is less than 100 °C, the environment heats the rod. The outer surface is slightly warmer than the inner axis. When the surface temperature is greater than 100 °C, the environment cools the rod. The outer surface becomes cooler than the interior of the rod.

hold on
title 'Temperature at the Bottom as a Function of Time'
xlabel 'Time, s'
ylabel 'Temperature, C'
grid on
legend('Center Axis','Outer Surface','Location','SouthEast')

Figure contains an axes. The axes with title Temperature at the Bottom as a Function of Time contains 2 objects of type line. These objects represent Center Axis, Outer Surface.