Main Content

Heat Conduction in Multidomain Geometry with Nonuniform Heat Flux

此示例显示了如何对由三个不同材料层制成的空心球进行3-D瞬态热传导分析。

球体受外部热通量不均匀。

The physical properties and geometry of this problem are described in Singh, Jain, and Rizwan-uddin (see Reference), which also has an analytical solution for this problem. The inner face of the sphere has a temperature of zero at all times. The outer hemisphere with positive y 值的热通量不均匀

o t e r = θ 2 (( π - θ 2 ϕ 2 (( π - ϕ 2

0 θ π ,,,, 0 ϕ π

θ and ϕ 是方位角和球体中点的高度角度。最初,球体中所有点的温度为零。

Create a thermal model for transient thermal analysis.

thermalmodel = createpde('热的',,,,'短暂的');

使用多球功能。将最终的几何形状分配给热模型。球体具有三层材料,带有一个空心的内核。

gm =多球([1,2,4,6],'空白',[true,false,false,false]);hytermodel.几何= gm;

Plot the geometry and show the cell labels and face labels. Use afacealpha0.25,以使内部层的标签可见。

数字('Position',[10,10,800,400]);子图(1,2,1)pdegplot(热模型,,'facealpha',0.25,'CellLabel',,,,'上')title('Geometry with Cell Labels')subplot(1,2,2) pdegplot(thermalmodel,'facealpha',0.25,'facelabel',,,,'上')title(“带面部标签的几何形状”

Figure contains 2 axes objects. Axes object 1 with title Geometry with Cell Labels contains 2 objects of type quiver, patch. Axes object 2 with title Geometry with Face Labels contains 2 objects of type quiver, patch.

生成几何形状的网格。选择一个足够粗的网格尺寸以加快溶液的速度,但足够细,可以合理地代表几何形状。

generateMesh(thermalmodel,'Hmax',1);

指定球体每一层的热导率,质量密度和比热。材料属性是无量纲的值,而不是由现实的材料特性给出。

Thermalproperties(热模型,'Cell',,,,1,'导热系数',,,,1,...“质量密度”,,,,1,...'SpecificHeat',1);Thermalproperties(热模型,'Cell',,,,2,,,,'导热系数',,,,2,,,,...“质量密度”,,,,1,...'SpecificHeat',,,,0。5); thermalProperties(thermalmodel,'Cell',,,,3,'导热系数',,,,4,...“质量密度”,,,,1,...'SpecificHeat',4/9);

指定边界条件。最里面的脸哈哈s a temperature of zero at all times.

ThermalBC(ThermalModel,'脸',,,,1,'温度',,,,0);

球的外表面具有外部热通量。使用热边界条件的功能形式来定义热通量。

function Qflux = externalHeatFlux(region,~)

[phi,theta,~] = cart2sph(region.x,region.y,region.z);

theta = pi/2 - theta; % transform to 0 <= theta <= pi

ids = phi> 0;

Qflux = zeros(size(region.x));

qflux(ids)= theta(ids)。^2。*(pi -theta(ids))。^2.*phi(ids)。^2。

结尾

在表面上绘制通量。

[phi,theta,r] = meshgrid(linspace(0,2*pi),linspace(-pi/2,pi/2),6); [x,y,z] = sph2cart(phi,theta,r); region.x = x; region.y = y; region.z = z; flux = externalHeatFlux(region,[]); figure surf(x,y,z,flux,'LineStyle',,,,'没有任何')轴平等的查看(130,10)Colorbar Xlabel'X'ylabel'y'Zlabel'z'title('External Flux'

Figure contains an axes object. The axes object with title External Flux contains an object of type surface.

在模型中包括此边界条件。

ThermalBC(ThermalModel,'脸',,,,4,...'HeatFlux',@externalHeatFlux,...“矢量化”,,,,'上');

Define the initial temperature to be zero at all points.

thermalIC(thermalmodel,0);

定义一个时步​​矢量并解决瞬态热问题。

tlist = [0,2,5:5:50]; R = solve(thermalmodel,tlist);

To plot contours at several times, with the contour levels being the same for all plots, determine the range of temperatures in the solution. The minimum temperature is zero because it is the boundary condition on the inner face of the sphere.

Tmin = 0;

Find the maximum temperature from the final time-step solution.

tmax=max(R.Temperature(:,end));

范围内的情节轮廓Tmintmaxat the times intlist

h =图;为了i = 1:numel(tlist)pdeplot3d(hyteralmodel,'ColorMapData',r.temperature(::,i))caxis([tmin,tmax])视图(130,10)标题([[['Temperature at Time 'num2str(tlist(i))]); M(i) = getframe;结尾

要在计算机上运行此示例时查看轮廓的电影,请执行以下行:

movie(M,2)

可视化横截面上的温度轮廓。首先,定义一个矩形网格 y - z plane where X = 0

[YG,ZG] = meshgrid(linspace(-6,6,100),linspace(-6,6,100));XG =零(size(yg));

在网格点处插入温度。执行几个时间步长执行插值,以观察温度轮廓的演变。

tindex=[2,3,5,7,9,11]; varNames = {'Time_index',,,,'Time_step'}; index_step = table(tIndex.',tlist(tIndex).','variablenames',varnames);disp(index_step);
time_index time_step __________ _________ 2 2 3 5 5 15 7 25 9 35 11 45
tg =插际植物(R,XG,YG,ZG,TINDEX);

Define the geometric spherical layers on the cross-section.

t = linspace(0,2*pi);ylayer1 = cos(t);zlayer1 = sin(t);ylayer2 = 2*cos(t);zlayer2 = 2*sin(t);ylayer3 = 4*cos(t);zlayer3 = 4*sin(t);ylayer4 = 6*cos(t);zlayer4 = 6*sin(t);

在范围内绘制轮廓Tmintmax对于与时间索引相对应的时间步骤tindex

数字('Position',,,,[10,10,1000,550]);为了i = 1:numel(tindex)子图(2,3,i)轮廓(yg,zg,reshape(tg(:,i),size(yg)),'ShowText',,,,'上')colorbar title(['Temperature at Time 'num2str(tlist(tIndex(i)))]); holdon卡克西斯([tmin,tmax])轴平等的% Plot boundaries of spherical layers for reference.plot(ylayer1,zlayer1,'k',,,,'行宽',,,,1.5) plot(ylayer2,zlayer2,'k',,,,'行宽',1.5)图(ylayer3,zlayer3,'k',,,,'行宽',,,,1.5) plot(ylayer4,zlayer4,'k',,,,'行宽',,,,1.5)结尾

图包含6个轴对象。轴对象1在时间2处具有标题温度,包含5个类型轮廓,行的对象。轴对象2在时间5处具有标题温度,包含5个类型轮廓,行的对象。轴对象3在时间15处具有标题温度的对象包含5个类型轮廓,线的对象。轴对象4具有标题温度的时间25包含5个类型轮廓,线的对象。轴对象5具有标题温度的时间35包含5个类型轮廓,线的对象。轴对象6带有标题温度的时间45包含5个类型轮廓,线的对象。

Reference

[1] Singh, Suneet, P. K. Jain, and Rizwan-uddin. "Analytical Solution for Three-Dimensional, Unsteady Heat Conduction in a Multilayer Sphere." ASME. J. Heat Transfer. 138(10), 2016, pp. 101301-101301-11.