熱モデルのGeometryの設定にimportGeometry関数とmultisphere関数とを使うのでシミュレーションの挙動が異なるのはなぜですか?
Show older comments
私はPartial Differential Equation Toolboxを使って二層の球からなるジオメトリを持つ熱モデルのシミュレーションをしています. 内側の球を内部熱源として機能させています.その中で, importGeometry関数でGeometryを設定した熱モデルとmultisphere関数でGeometryを設定した熱モデルとでシミュレーションの挙動が異なることを確認しました. 内側の球の境界条件が変化しているように思えます. multisphere関数で設定した方は, 内側の球の熱をそのまま伝えているのに対し, importGeometry関数で設定した方は, 内側の球の境界で断熱が起きているような挙動になります. どうしてこのようなことが起きるのでしょうか.
%Using multisphere function
%Create thermalmodel
thermalmodel = createpde('thermal','transient');
gm = multisphere([3.15*10^-3,1*10^-2]);
thermalmodel.Geometry = gm;
%Visualize geometry
figure
subplot(1,2,1)
pdegplot(thermalmodel,'FaceAlpha',0.25,'CellLabel','on')
title('Geometry with Cell Labels')
subplot(1,2,2)
pdegplot(thermalmodel,'FaceAlpha',0.25,'FaceLabel','on')
title('Geometry with Face Labels')
%Set physical parameter
generateMesh(thermalmodel,'Hmax',1*10^-3);
thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',0.778,'MassDensity',1.66*10^3,'SpecificHeat',2.54*10^3);
thermalProperties(thermalmodel,'Cell',2,'ThermalConductivity',0.642,'MassDensity',1*10^3,'SpecificHeat',3.72*10^3);
internalHeatSource(thermalmodel,6.15*10^6,'cell',1);
thermalBC(thermalmodel,'Face',2,'ConvectionCoefficient',25,'AmbientTemperature',25);
thermalIC(thermalmodel,25);
%Calculate PDE
tlist=0:1:300;
result = solve(thermalmodel,tlist);
Tmin=0;
Tmax=max(result.Temperature(:,end));
%Visualize by contour
[YG,ZG] = meshgrid(linspace(-1*10^-2,1*10^-2,100),linspace(-1*10^-2,1*10^-2,100));
XG = zeros(size(YG));
tIndex = [6,51,101,151,201,301];
varNames = {'Time_index','Time_step'};
index_step = table(tIndex.',tlist(tIndex).','VariableNames',varNames);
disp(index_step);
TG = interpolateTemperature(result,XG,YG,ZG,tIndex);
t = linspace(0,2*pi);
ylayer1 = 3.15*10^-3*cos(t); zlayer1 = 3.15*10^-3*sin(t);
ylayer2 = 1*10^-2*cos(t); zlayer2 = 1*10^-2*sin(t);
figure('Position',[10,10,1000,550]);
for i = 1:numel(tIndex)
subplot(2,3,i)
contour(YG,ZG,reshape(TG(:,i),size(YG)),'ShowText','on')
colormap turbo
c=colorbar;
c.Label.String = 'Temperature(℃)';
title(['Temperature at Time ' num2str(tlist(tIndex(i)))]);
hold on
caxis([Tmin,Tmax])
axis equal
plot(ylayer1,zlayer1,'k','LineWidth',1.5)
plot(ylayer2,zlayer2,'k','LineWidth',1.5)
end
↓Result

%Using importGeometry function
%Create thermalmodel
thermalmodel = createpde('thermal','transient');
gm = importGeometry('ball_simu.stl');
thermalmodel.Geometry = gm;
%Visualize geometry
figure
subplot(1,2,1)
pdegplot(thermalmodel,'FaceAlpha',0.25,'CellLabel','on')
title('Geometry with Cell Labels')
subplot(1,2,2)
pdegplot(thermalmodel,'FaceAlpha',0.25,'FaceLabel','on')
title('Geometry with Face Labels')
%Set physical parameter
generateMesh(thermalmodel,'Hmax',1*10^-3);
thermalProperties(thermalmodel,'Cell',2,'ThermalConductivity',0.778,'MassDensity',1.66*10^3,'SpecificHeat',2.54*10^3);
thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',0.642,'MassDensity',1*10^3,'SpecificHeat',3.72*10^3);
internalHeatSource(thermalmodel,6.15*10^6,'cell',2);
thermalBC(thermalmodel,'Face',1,'ConvectionCoefficient',25,'AmbientTemperature',25);
thermalIC(thermalmodel,25);
%Calculate PDE
tlist=0:1:300;
result = solve(thermalmodel,tlist);
Tmin=0;
Tmax=max(result.Temperature(:,end));
%Visualize by contour
[YG,ZG] = meshgrid(linspace(-1*10^-2,1*10^-2,100),linspace(-1*10^-2,1*10^-2,100));
XG = zeros(size(YG));
tIndex = [6,51,101,151,201,301];
varNames = {'Time_index','Time_step'};
index_step = table(tIndex.',tlist(tIndex).','VariableNames',varNames);
disp(index_step);
TG = interpolateTemperature(result,XG,YG,ZG,tIndex);
t = linspace(0,2*pi);
ylayer1 = 3.15*10^-3*cos(t); zlayer1 = 3.15*10^-3*sin(t);
ylayer2 = 1*10^-2*cos(t); zlayer2 = 1*10^-2*sin(t);
figure('Position',[10,10,1000,550]);
for i = 1:numel(tIndex)
subplot(2,3,i)
contour(YG,ZG,reshape(TG(:,i),size(YG)),'ShowText','on')
colormap turbo
c=colorbar;
c.Label.String = 'Temperature(℃)';
title(['Temperature at Time ' num2str(tlist(tIndex(i)))]);
hold on
caxis([Tmin,Tmax])
axis equal
plot(ylayer1,zlayer1,'k','LineWidth',1.5)
plot(ylayer2,zlayer2,'k','LineWidth',1.5)
end
↓Result

Accepted Answer
More Answers (0)
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!