Thermal analysis excavated cylinder
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
I am super green at matlab. Most of the code is adapted from examples I have found.
I am trying to find the steady state temperature distribution of a cylinder. When I look at the 3D plot, I can see there 12 faces identified, but when I try to apply the BC for all, the code returns an error.
Error using pde.ThermalModel/thermalBC (line 130)
Face ID exceeds the number of faces in the Geometry.
Error in realcylinder (line 16)
thermalBC(thermalmodel,'Face',6,'Temperature',T2);
If I comment out the additional faces it seems to work but it does not show what I want because, as I understand it, the unspecified BC are taken as insulated.
Could anyone tell me what grave mistake I am making?
Note that the additional faces are generated by "Thinkercad"
However, when I use another stl file generated by Solidworks, the error is different:
Boundary condition must be specified on a face for 3-D geometry and on an edge of 2-D geometry.
Thank you for your help.
Max
thermalmodel = createpde('thermal','steadystate');
importGeometry(thermalmodel,'cylinder.stl');
pdegplot(thermalmodel,'FaceLabels','on','FaceAlpha',0.5)
axis equal
mesh=generateMesh(thermalmodel,'Hmax',5)
pdemesh(thermalmodel);
pdegplot(model,'FaceLabel','on','FaceAlpha',0.5)
axis equal
T1 =180;
T2 = 25;
thermalProperties(thermalmodel,'ThermalConductivity',0.15);
thermalBC(thermalmodel,'Face',2,'Temperature',T1);
thermalBC(thermalmodel,'Face',3,'Temperature',T1);
thermalBC(thermalmodel,'Face',4,'Temperature',T2);
%thermalBC(thermalmodel,'Face',5,'Temperature',T2);
thermalBC(thermalmodel,'Face',6,'Temperature',T2);
%thermalBC(thermalmodel,'Face',7,'Temperature',T2);
%thermalBC(thermalmodel,'Face',8,'Temperature',T2);
%thermalBC(thermalmodel,'Face',9,'Temperature',T2);
%thermalBC(thermalmodel,'Face',10,'Temperature',T2);
%thermalBC(thermalmodel,'Face',11,'Temperature',T2);
%thermalBC(thermalmodel,'Face',12,'Temperature',T2); %Temperature downside
results = solve(thermalmodel);
pdeplot3D(thermalmodel,'ColorMapData',results.Temperature)
UPDATE
Now, from this code:
thermalmodel = createpde('thermal','steadystate');
importGeometry(thermalmodel,'cylinder_2.stl');
pdegplot(thermalmodel,'FaceLabels','on','FaceAlpha',0.5)
axis equal
mesh=generateMesh(thermalmodel,'Hmax',5)
pdemesh(thermalmodel);
pdegplot(thermalmodel,'FaceLabel','on','FaceAlpha',0.5)
% axis equal
% T1 =90;%Temperature inside
% T2 = 25;%Room Temperature
thermalProperties(thermalmodel,'ThermalConductivity',0.386,'MassDensity',8.933*10^(3),'SpecificHeat',0.386);
thermalBC(thermalmodel,'Face',1,'Temperature',T2);
thermalBC(thermalmodel,'Face',2,'Temperature',T2);
thermalBC(thermalmodel,'Face',3,'Temperature',T2);
thermalBC(thermalmodel,'Face',4,'Temperature',T1);
thermalBC(thermalmodel,'Face',5,'Temperature',T1);
results = solve(thermalmodel);
pdeplot3D(thermalmodel,'ColorMapData',results.Temperature)
I get this figure:

But it yet does not show a real distribution. I feel that the BC set the outer temperature, but what I really would like to do is set th eroom temperature and allow the surface temperature be whatever it should be.
Thank you
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!