Main Content

Temperature Distribution in Heat Sink

This example shows how to create a simple 3-D heat sink geometry and analyze heat transfer on the heat sink. The process has three steps.

Create 2-D Geometry in the PDE Modeler App

Create a geometry in the PDE Modeler app. First, open the PDE Modeler app with a geometry consisting of a rectangle and 12 circles.

pderect([0 0.01 0 0.008])
for i = 0.002:0.002:0.008
   for j = 0.002:0.002:0.006

Adjust the axes limits by selecting Options > Axes Limits. Select Auto to use automatic scaling for both axes.

Base of heat sink consisting of a rectangle and twelve circles

Export the geometry description matrix, set formula, and name-space matrix into the MATLAB® workspace by selecting Draw > Export Geometry Description, Set Formula, Labels. This data lets you reconstruct the geometry in the workspace.

Extrude 2-D Geometry into 3-D Geometry of Heat Sink

In the MATLAB Command Window, use the decsg function to decompose the exported geometry into minimal regions. Plot the result.

g = decsg(gd,sf,ns);

2-D geometry with face labels showing that face 1 is the rectangle, and faces from 2 to 13 are circles

Create a thermal model for transient analysis.

model = createpde('thermal','transient');

Create a 2-D geometry from decomposed geometry matrix and assign the geometry to the thermal model.

g = geometryFromEdges(model,g);

Extrude the 2-D geometry along the z-axis by 0.0005 units.

g = extrude(g,0.0005);

Plot the extruded geometry so that you can see the face labels on the top.

view([0 90])

Top view of the extruded geometry showing that the faces with the IDs from 15 to 26 must be extruded to form the fins

Extrude the circular faces (faces with IDs from 15 to 26) along the z-axis by 0.005 more units. These faces form the fins of the heat sink.

g = extrude(g,[15:26],0.005);

Assign the modified geometry to the thermal model and plot the geometry.

model.Geometry = g;
3-D geometry representing a heat sink with 12 round fins

Perform Thermal Analysis

Assuming that the heat sink is made of copper, specify the thermal conductivity, mass density, and specific heat.

thermalProperties(model,'ThermalConductivity',400, ...
                        'MassDensity',8960, ...

Specify the Stefan-Boltzmann constant.

model.StefanBoltzmannConstant = 5.670367e-8;

Apply temperature boundary condition on the bottom surface of the heat sink, which consists of 13 faces.


Specify the convection and radiation parameters on all other surfaces of the heat sink.

thermalBC(model,'Face',14:g.NumFaces, ...
                'ConvectionCoefficient',5, ...
                'AmbientTemperature',300, ...

Set the initial temperature of all the surfaces to the ambient temperature.


Generate a mesh.


Solve the transient thermal problem for times between 0 and 0.0075 seconds with a time step of 0.0025 seconds.

results = solve(model,0:0.0025:0.0075);

Plot the temperature distribution for each time step.

for i = 1:length(results.SolutionTimes)
  title({['Time = ' num2str(results.SolutionTimes(i)) 's']})

Temperature distribution in the heat sink at 0s

Temperature distribution in the heat sink at 0.0025s

Temperature distribution in the heat sink at 0.005s

Temperature distribution in the heat sink at 0.0075s