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 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
       pdecirc(i,j,0.0005)
   end
end

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);
pdegplot(g,FaceLabels="on")

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

Create a 2-D geometry from the decomposed geometry matrix.

g = fegeometry(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.

figure
pdegplot(g,FaceLabels="on")
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);

Plot the geometry.

figure
pdegplot(g)
3-D geometry representing a heat sink with 12 round fins

Perform Thermal Analysis

Create an femodel object for transient thermal analysis and include the geometry.

model = femodel(AnalysisType="thermalTransient", ...
                Geometry = g);

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

model.MaterialProperties = ...
    materialProperties(ThermalConductivity=400, ...
                       MassDensity=8960, ...
                       SpecificHeat=386);

Specify the Stefan-Boltzmann constant.

model.StefanBoltzmann = 5.670367e-8;

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

model.FaceBC(1:13) = faceBC(Temperature=1000);

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

model.FaceLoad(14:g.NumFaces) = ...
    faceLoad(ConvectionCoefficient=5, ...
             AmbientTemperature=300, ...
             Emissivity=0.8);

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

model.CellIC = cellIC(Temperature=300);

Generate a mesh.

model = generateMesh(model);

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

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

Plot the temperature distribution for each time step.

for i = 1:length(results.SolutionTimes)
  figure
  pdeplot3D(results.Mesh,ColorMapData=results.Temperature(:,i))
  title({['Time = ' num2str(results.SolutionTimes(i)) 's']})
end

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

You also can plot the same results by using the Visualize PDE Results Live Editor task. First, create a new live script by clicking the New Live Script button in the File section on the Home tab.

Button that creates a new live script

On the Live Editor tab, select Task > Visualize PDE Results. This action inserts the task into your script.

Visualize PDE Results task located in the Partial Differential Equations group of live tasks

To plot the temperature distribution for each time step, follow these steps.

  1. In the Select results section of the task, select results from the drop-down list.

  2. In the Specify data parameters section of the task, set Type to Temperature, and set the time steps to 1, 2, 3, and 4. These time steps correspond to the four time values that you used to solve the problem. You also can animate the solution by selecting Animate.

    Visualize PDE Results live task showing the temperature distribution for the fourth time step, which is 0.0075 seconds