axial symmetry pde toolbox

1 view (last 30 days)
Heinrich Villinger
Heinrich Villinger on 13 Mar 2019
I have a disk which consists of two differnt materials which have different thermal conductivities. The symmetry axis is the y-axis. As described in the documentation, I multiply the conductivities in each face with the radial coordinate x. However the solution is not influenced by the thermal conductivity contrast. My code is as below:
%% set geometry up and solve
model = createpde('thermal','steadystate');
R1=[3 4 0 1 1 0 0 0 1 1]';
R2=[3 4 0.5 1 1 0.5 0.5 0.5 1 1]';
gm=[R1,R2];
sf='R1+R2';
ns=char('R1','R2')
ns=ns';
g=decsg(gm,sf,ns);
figure(1)
pdegplot(g,'FaceLabels','on','EdgeLabels','on')
%% create mesh
geometryFromEdges(model,g)
generateMesh(model,'Hmax',0.025);
figure(2)
pdemesh(model);
%% set boundary conditions
thermalBC(model,'Edge',[1],'Temperature',0);
thermalBC(model,'Edge',[7:8],'Temperature',1);
thermalBC(model,'Edge',[2],'HeatFlux',0);
thermalBC(model,'Edge',[5:6],'HeatFlux',0);
k1=@(location,~) 1*location.x;
k2=@(location,~) 20*location.x;
thermalProperties(model,'Face',2,'ThermalConductivity',k1);
thermalProperties(model,'Face',1,'ThermalConductivity',k2);
thermalProperties(model,'Face',2,'ThermalConductivity',2);
thermalProperties(model,'Face',1,'ThermalConductivity',1);
%% solve model
result = solve(model);
temp = result.Temperature;
figure(3)
pdeplot(model,'XYData',temp,'Contour','on');
set(gca,'box','on')
What am I doing wrong? Thanks for your help.
  1 Comment
Heinrich Villinger
Heinrich Villinger on 13 Mar 2019
Sorry I forgot to delete two lines in the code example above - this is the correct code example:
%% set geometry up and solve
model = createpde('thermal','steadystate');
R1=[3 4 0 1 1 0 0 0 1 1]';
R2=[3 4 0.5 1 1 0.5 0.5 0.5 1 1]';
gm=[R1,R2];
sf='R1+R2';
ns=char('R1','R2')
ns=ns';
g=decsg(gm,sf,ns);
figure(1)
pdegplot(g,'FaceLabels','on','EdgeLabels','on')
%% create mesh
geometryFromEdges(model,g)
generateMesh(model,'Hmax',0.025);
figure(2)
pdemesh(model);
%% set boundary conditions
thermalBC(model,'Edge',[1],'Temperature',0);
thermalBC(model,'Edge',[7:8],'Temperature',1);
thermalBC(model,'Edge',[2],'HeatFlux',0);
thermalBC(model,'Edge',[5:6],'HeatFlux',0);
%% set thermal parameter
k1=@(location,~) 1*location.x;
k2=@(location,~) 20*location.x;
thermalProperties(model,'Face',2,'ThermalConductivity',k1);
thermalProperties(model,'Face',1,'ThermalConductivity',k2);
%% solve model
result = solve(model);
temp = result.Temperature;
figure(3)
pdeplot(model,'XYData',temp,'Contour','on');
set(gca,'box','on')

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!