Thermal Analysis Workflow
Thermal Analysis Workflow
Calculate the transient solution. Perform a transient analysis from zero to five seconds. The toolbox
saves the solution every .1 seconds so that plots of the results as functions of time can be created.
tlist = 0:.1:5;
thermalIC(thermalmodelT,0);
R = solve(thermalmodelT,tlist);
T = R.Temperature;
Two plots are useful in understanding the results from this transient analysis. The first is a plot of the
temperature at the final time. The second is a plot of the temperature at a specific point in the block,
in this case near the center of the right edge, as a function of time. To identify a node near the center
of the right edge, it is convenient to define this short utility function.
getClosestNode = @(p,x,y) min((p(1,:) - x).^2 + (p(2,:) - y).^2);
Call this function to get a node near the center of the right edge.
[~,nid] = getClosestNode( msh.Nodes, .5, 0 );
The two plots are shown side-by-side in the figure below. The temperature distribution at this time is
very similar to that obtained from the steady-state solution above. At the right edge, for times less
than about one-half second, the temperature is less than zero. This is because heat is leaving the
block faster than it is arriving from the left edge. At times greater than about three seconds, the
temperature has essentially reached steady-state.
h = figure;
h.Position = [1 1 2 1].*h.Position;
subplot(1,2,1);
axis equal
pdeplot(thermalmodelT,"XYData",T(:,end),"Contour","on", ...
"ColorMap","hot");
axis equal
title("Temperature, Final Time, Transient Solution")
subplot(1,2,2);
axis equal
plot(tlist, T(nid,:));
grid on
title("Temperature at Right Edge as a Function of Time")
xlabel("Time, seconds")
ylabel("Temperature, degrees-Celsius")