How to see geometry edge numbers that are crowded for multilayered geometries with layers of significantly different thicknesses

7 views (last 30 days)
I have defined a geometry for a heat transfer problem using pde modeling. The geometry is a multi-layered configuration. Code below
I need to identify the edges so that I can assign appropriate boundary conditions. The problem that I have is that the thicknesses of the layers differ dramatically. Therefore when I use the pdeplot with labels on, I get some parts of the geometry where the edge numbers are all crowded together. I tried to use axis commands and the daspect command to “zoom in” on the thinnest layers so as to see the edge definitions clearly. I have not been successful. Is there a way to see these bunched up edge numbers?
Thanks
thermalmodel = createpde("thermal","transient");
% Top coverslip
Rtcs= [3,4,[-5.55,5.55,5.55,-5.55,0.012,0.012,0.177,0.177]/1000]';
% Specimen
Rspec= [3,4,[-5.55,5.55,5.55,-5.55,0,0,0.012,0.012]/1000]';
% Bottom coverslip
Rbcs= [3,4,[-5.55,5.55,5.55,-5.55,-0.165,-0.165,0,0]/1000]';
% Thin film heater left OFF area
Rtfh= [3,4,[-5.55,-3.18,-3.18,-5.55-0.166,-0.166,-0.165,-0.165]/1000]';
% Thin film heater ON area
Rtfh= [3,4,[-3.18,3.18,3.18,-3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
% Thin film heater right OFF area
Rtfh= [3,4,[3.18,5.55,5.55,3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
% Left manifold
Rlman= [3,4,[-5.55,-1.14,-1.14,-5.55,-0.673,-0.673,-0.166,-0.166]/1000]';
% Right manifold
Rrman= [3,4,[1.14, 5.55, 5.55, 1.14, -0.673, -0.673, -0.166, -0.166]/1000]';
gdm =[Rtcs Rspec Rbcs Rtfh Rlman Rrman];
ns = char('Rtcs','Rspec','Rbcs','Rtfh','Rlman','Rrman');
g = decsg(gdm,'Rtcs + Rspec + Rbcs + Rtfh + Rlman + Rrman',ns');
geometryFromEdges(thermalmodel,g);
figure
pdegplot(thermalmodel,"EdgeLabels","on","FaceLabels","off")
%xlim([-0.007 0.007]) %Overall view
%ylim([-0.0007 0.0002])
%xlim([-0.007 0.007]) %Top half of system
%ylim([-0.0002 0.0002])
%xlim([-0.007 0.007])
%ylim([-0.0002 0.00017])
xlim([-0.007 0.007])
ylim([-0.1659e-3- 0.1662e-3])
%xlim([-0.007 0.007]) % Htr area-somewhat useful but not magnified %enough
%ylim([-0.00015 0.00017])
%xlim([-0.007 0.007])
%ylim([-0.0002 0.0002])
%xlim([-0.007 0.007]) %squished- not very useful
%ylim([-0.001 0.001])
%axis equal
daspect([50 1 1])

Accepted Answer

Shishir Reddy
Shishir Reddy on 29 Aug 2024
Hi John
It appears that the variable Rtfh has been overwritten in the code. It should be ensured that each part of the geometry, such as Rtfh1, Rtfh2, and Rtfh3, should be defined uniquely to prevent overwriting issues.
Due to the significant variation in layer thickness, it is challenging to view all the layers simultaneously. The outer layers may obscure the inner layers in a complete plot.
1. If the priority is to view the larger portion of the plot, xlim, ylim, daspect can be set as follows
%% Create a thermal model for transient analysis
thermalmodel = createpde("thermal","transient");
% Define the geometry components
Rtcs = [3,4,[-5.55,5.55,5.55,-5.55,0.012,0.012,0.177,0.177]/1000]';
Rspec = [3,4,[-5.55,5.55,5.55,-5.55,0,0,0.012,0.012]/1000]';
Rbcs = [3,4,[-5.55,5.55,5.55,-5.55,-0.165,-0.165,0,0]/1000]';
Rtfh1 = [3,4,[-5.55,-3.18,-3.18,-5.55,-0.166,-0.166,-0.165,-0.165]/1000]';
Rtfh2 = [3,4,[-3.18,3.18,3.18,-3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
Rtfh3 = [3,4,[3.18,5.55,5.55,3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
Rlman = [3,4,[-5.55,-1.14,-1.14,-5.55,-0.673,-0.673,-0.166,-0.166]/1000]';
Rrman = [3,4,[1.14,5.55,5.55,1.14,-0.673,-0.673,-0.166,-0.166]/1000]';
% Combine the geometry data
gdm = [Rtcs Rspec Rbcs Rtfh1 Rtfh2 Rtfh3 Rlman Rrman];
ns = char('Rtcs','Rspec','Rbcs','Rtfh1','Rtfh2','Rtfh3','Rlman','Rrman');
g = decsg(gdm, 'Rtcs + Rspec + Rbcs + Rtfh1 + Rtfh2 + Rtfh3 + Rlman + Rrman', ns');
% Create geometry from edges
geometryFromEdges(thermalmodel, g);
% Create a larger figure window
figure('Position', [100, 100, 1200, 800]);
% Plot with edge labels
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "off");
% Adjust limits and aspect ratio for better visibility
xlim([-0.007 0.007]);
ylim([-0.00017 0.00017])
daspect([50 1 1]);
2.Likewise, to examine the innermost layer, xlim, ylim, daspect can be set as follows
%% Create a thermal model for transient analysis
thermalmodel = createpde("thermal","transient");
% Define the geometry components
Rtcs = [3,4,[-5.55,5.55,5.55,-5.55,0.012,0.012,0.177,0.177]/1000]';
Rspec = [3,4,[-5.55,5.55,5.55,-5.55,0,0,0.012,0.012]/1000]';
Rbcs = [3,4,[-5.55,5.55,5.55,-5.55,-0.165,-0.165,0,0]/1000]';
Rtfh1 = [3,4,[-5.55,-3.18,-3.18,-5.55,-0.166,-0.166,-0.165,-0.165]/1000]';
Rtfh2 = [3,4,[-3.18,3.18,3.18,-3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
Rtfh3 = [3,4,[3.18,5.55,5.55,3.18,-0.166,-0.166,-0.165,-0.165]/1000]';
Rlman = [3,4,[-5.55,-1.14,-1.14,-5.55,-0.673,-0.673,-0.166,-0.166]/1000]';
Rrman = [3,4,[1.14,5.55,5.55,1.14,-0.673,-0.673,-0.166,-0.166]/1000]';
% Combine the geometry data
gdm = [Rtcs Rspec Rbcs Rtfh1 Rtfh2 Rtfh3 Rlman Rrman];
ns = char('Rtcs','Rspec','Rbcs','Rtfh1','Rtfh2','Rtfh3','Rlman','Rrman');
g = decsg(gdm, 'Rtcs + Rspec + Rbcs + Rtfh1 + Rtfh2 + Rtfh3 + Rlman + Rrman', ns');
% Create geometry from edges
geometryFromEdges(thermalmodel, g);
% Create a larger figure window
figure('Position', [100, 100, 1200, 800]);
% Plot with edge labels
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "off");
% Adjust limits and aspect ratio for better visibility
xlim([-0.007 0.007]);
ylim([-0.00017 -0.00016])
daspect([500 1 1]
In both these cases, zoom and pan can be used to navigate through the complete geometry of the plot.
I hope this helps.
  2 Comments
John McGrath
John McGrath on 31 Aug 2024
My overall program produces a 2D color temperature plot for all of these domains. I am interested in plotting temperature along a given line/plane. For example, for the geometry described above I would like to be able to plot the temperature at a given time along Edge 8 in the bottom plot.
Do you know how to do that?
thanks

Sign in to comment.

More Answers (0)

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!