主要内容

Heat Transfer Problem with Temperature-Dependent Properties

此示例显示了如何使用温度依赖的热导率求解热方程。该示例显示了对中心矩形腔的矩形块的理想化热分析。

The partial differential equation for transient conduction heat transfer is:

ρ C p T t - ( k T ) = f

where T is the temperature, ρ 是材料密度, C p is the specific heat, and k is the thermal conductivity. f 在此示例中,体内产生的热量为零。

稳态溶液:恒定导热率

创建稳态热模型。

thermalmodelS = createpde('thermal','稳定状态');

Create a 2-D geometry by drawing one rectangle the size of the block and a second rectangle the size of the slot.

r1 = [3 4 -.5 .5 .5 -.5 -.8 -.8 .8 .8];r2 = [3 4 -.05 .05 .05 -.05 -.4 -.4 .4 .4];gdm = [r1;r2]';

Subtract the second rectangle from the first to create the block with a slot.

g = decsg(gdm,'r1-r2',[['R1';'R2']');

Convert thedecsg格式为几何对象。在模型中包括几何形状。

几何弗罗姆(Thermalmodels,g);

Plot the geometry with edge labels displayed. The edge labels will be used below in the function for defining boundary conditions.

图PDEGPLOT(热模型,'edgelabels','on');轴([ -  9 .9 -.9 .9]);标题'Block Geometry With Edge Labels Displayed'

图包含一个轴对象。带有带有边缘标签的标题块几何形状的轴对象包含9个类型行,文本的对象。

将左边缘的温度设置为100度。在右边缘,有一个规定的热通量从块中脱出。顶部和底部边缘和腔体内的边缘都是绝缘的,也就是说,没有热量在这些边缘上传递。

ThermalBC(热模型,'Edge',6,'Temperature',100); thermalBC(thermalmodelS,'Edge',1,'Heatflux',-10);

指定材料的导热率。首先,考虑恒定的导热率,例如等于一个。稍后,考虑一种导热率是温度函数的情况。

热植物(热模型,'ThermalConductivity',1);

Create a mesh with elements no larger than 0.2.

generateMesh(thermalmodelS,'hmax',0.2);图pdeplot(热模型);轴equal标题“显示有限元网格的块”

图包含一个轴对象。带有有限元网格的标题块的轴对象包含2个类型行的对象。

计算稳态解决方案。

R = solve(thermalmodelS); T = R.Temperature; figure pdeplot(thermalmodelS,'xydata',t,'轮廓','on','colormap','hot');轴equal标题“温度,稳态溶液”

图包含一个轴对象。The axes object with title Temperature, Steady State Solution contains 12 objects of type patch, line.

瞬态溶液:恒温电导率

创建瞬态热模型并包括几何形状。

thermalmodelT = createpde('thermal','transient');r1 = [3 4 -.5 .5 .5 -.5 -.8 -.8 .8 .8];r2 = [3 4 -.05 .05 .05 -.05 -.4 -.4 .4 .4];gdm = [r1;r2]';g = decsg(gdm,'r1-r2',[['R1';'R2']');几何弗罗姆(Thermalodelt,g);

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

Thermalproperties(热载体,'ThermalConductivity',1,...'MassDensity',1,...'femificheat',1);

定义边界条件。在瞬态情况下,左边缘的温度在时间= 0时为零,在0.5秒内升至100度。您可以找到助手功能瞬态布置undermatlab/R20XXx/examples/pde/main.

ThermalBC(热载体,'Edge',6,'Temperature',@TransientBcheatedBlock);

在右边缘,有一个规定的热通量从块中脱出。

ThermalBC(热载体,'Edge',1,'Heatflux',-10);

顶部和底部边缘以及腔体内的边缘都是绝缘的,没有热量在这些边缘上传递。

Create a mesh with elements no larger than 0.2.

msh = generateMesh(热modelT,'hmax',0.2);figure pdeplot(thermalmodelT); axisequal标题“显示有限元网格的块”

图包含一个轴对象。带有有限元网格的标题块的轴对象包含2个类型行的对象。

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;热(热载体,0);r = solve(ThermalModelt,tlist);t = r.temperature;

两个图可用于理解此瞬态分析的结果。第一个是最终温度的图。第二个是块中特定点的温度图,在这种情况下,在右边缘的中心附近,作为时间的函数。要识别右边缘中心附近的节点,可以方便地定义此简短的实用程序功能。

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); axisequalpdeplot(热载体,'xydata',T(:,end),'轮廓','on',...'colormap','hot');轴equal标题'Temperature, Final Time, Transient Solution'子图(1,2,2);轴equalplot(tlist, T(nid,:)); grid标题'Temperature at Right Edge as a Function of Time';XLABEL'Time, seconds'ylabel'Temperature, degrees-Celsius'

图包含2个轴对象。轴对象1具有标题温度,最终时间,瞬态解决方案包含12个类型补丁的对象。Axes object 2 with title Temperature at Right Edge as a Function of Time contains an object of type line.

稳态溶液:依赖温度的导热率

材料属性是因变量的函数并不少见。例如,假设导热率是温度的简单线性函数:

k = @(~,state) 0.3+0.003*state.u;

在这种情况下,变量U是温度。对于此示例,假设密度和比热不是温度的功能。

热植物(热模型,'ThermalConductivity',k);

计算稳态解决方案。与恒定率的情况相比,右边缘上的温度较低。这是由于温度较低的区域的电导率较低。

R = solve(thermalmodelS); T = R.Temperature; figure pdeplot(thermalmodelS,'xydata',t,'轮廓','on','colormap','hot');轴equal标题“温度,稳态溶液”

图包含一个轴对象。The axes object with title Temperature, Steady State Solution contains 12 objects of type patch, line.

Transient Solution: Temperature-Dependent Thermal Conductivity

Now perform a transient analysis with the temperature-dependent conductivity.

Thermalproperties(热载体,'ThermalConductivity',k,...'MassDensity',1,...'femificheat',1);

Use the same timespantlist = 0:.1:5至于线性情况。

热(热载体,0);r = solve(ThermalModelt,tlist);t = r.temperature;

Plot the temperature at the final time step and the temperature at the right edge as a function of time. The plot of temperature at the final time step is only slightly different from the comparable plot from the linear analysis: temperature at the right edge is slightly lower than the linear case. The plot of temperature as a function of time is considerably different from the linear case. Because of the lower conductivity at lower temperatures, the heat takes longer to reach the right edge of the block. In the linear case, the temperature is essentially constant at around three seconds but for this nonlinear case, the temperature curve is just beginning to flatten at five seconds.

h = figure; h.Position = [1 1 2 1].*h.Position; subplot(1,2,1); axisequalpdeplot(热载体,'xydata',T(:,end),'轮廓','on',...'colormap','hot');轴equal标题'Temperature, Final Time, Transient Solution'子图(1,2,2);轴equal绘图(tlist(1:size(t,2)),t(nid,:));网格标题“右边缘的温度随时间(非线性)的函数”;XLABEL'Time, seconds'ylabel'Temperature, degrees-Celsius'

图包含2个轴对象。轴对象1具有标题温度,最终时间,瞬态解决方案包含12个类型补丁的对象。轴对象2具有右边缘的标题温度作为时间(非线性)包含类型线的对象。