3D conduction equation in cylinder

I want know if there is a way to solve the PDE for diffusion in a cylinder with 0.3 metre radius and 1.6 metre height. I am trying to create a cylindrical coordinate with this code.
%cylinder
% n = linspace(-pi,pi,30);
% m = linspace(0,1.6,20);
% [theta,z] = meshgrid(n,m);
% r = 1 .* cos(theta);
% [X,Y,Z] = pol2cart(theta,r,z);
% surf(X,Y,Z)
% axis equal
But this one I can't define the radius.
This is the equation that I have to work with (Unsteady state - 3d) I would like to work with with the discretization of partial differential equations. How I can solve this problem with Matlab? Thank you

Réponses (2)

Ravi Kumar
Ravi Kumar le 10 Avr 2018
You can solve the 3-D conduction equation on a cylindrical geometry using the thermal model workflow in PDE Toolbox. Here is an example which you can modify to suite your problem. Note that PDE Toolbox solves heat conduction equation in Cartesian coordinates, the results will be same as for the equation in cylindrical coordinates as you have written.
% Create a model object.
model = createpde('thermal','transient');
% Create a cylinder geometry and assign it to the model.
gm = multicylinder(0.3,1.6);
model.Geometry = gm;
generateMesh(model);
%Plot the geometry with face labes displayed.
figure
pdegplot(model,'FaceLabels','on')
%Define thermal material properties.
Cp = 920;
rho = 2700;
k = 210;
thermalProperties(model,'ThermalConductivity',k,'SpecificHeat',Cp,'MassDensity',rho)
%Define boundary conditions
thermalBC(model,'Face',1,'Temperature',100)
thermalBC(model,'Face',2,'Temperature',200)
% Set IC as 25 and solve for from 0 to 300 time units.
thermalIC(model,25)
tlist = 0:100:300;
R = solve(model,tlist);
figure
pdeplot3D(model,'ColorMapData',R.Temperature(:,4))

11 commentaires

KT TAgong
KT TAgong le 10 Avr 2018
Would it possible if I dont want to use PDE tool box and code it on my own?
Torsten
Torsten le 10 Avr 2018
"Method-of-lines" + ODE15S for the resulting system of ordinary differential equations.
But 3d ? Doesn't 2d (radial and axial coordinate) suffice ?
Best wishes
Torsten.
KT TAgong
KT TAgong le 10 Avr 2018
Actually, I have to combine with another equations so it would be 3d (r, ceta,z).
What you suggested me is working on cylindrical shape with method of lines (right eq.) and solving left eq by ode15S.
Please correct me if I misunderstand. Thank you
Torsten
Torsten le 11 Avr 2018
Modifié(e) : Torsten le 11 Avr 2018
Here is an 1d-example of what I mean:
You should work in cylindrical coordinates (like your equation from above indicates). This will make the spatial discretization of your equations easier.
Best wishes
Torsten.
KT TAgong
KT TAgong le 11 Avr 2018
Modifié(e) : KT TAgong le 11 Avr 2018
Thank you very much. I'll take a look.
Best
Thi Bang Tuyen Nguyen
Thi Bang Tuyen Nguyen le 23 Oct 2019
Thanks Ravi for your codes.
Could you please advise some lines for plotting the T contour inside of the cylinder? for example half vertical segment of the above rod? The 3D transient model is more challenging; my attempts do not help at all.
Regards
alok dhaundiyal
alok dhaundiyal le 8 Nov 2020
Your code did not work.
Ravi Kumar
Ravi Kumar le 9 Nov 2020
Can you eloborate? Did it error?
alok dhaundiyal
alok dhaundiyal le 15 Nov 2020
This kind of coding gives error in matlab 2015b
Ravi Kumar
Ravi Kumar le 16 Nov 2020
OK. Yes, you need a newer version of MATLAB this feature did not exist in R2015b.
alok dhaundiyal
alok dhaundiyal le 16 Nov 2020
:) It does exist. But you have to change your codes.

Connectez-vous pour commenter.

Kyrillos Atallah
Kyrillos Atallah le 9 Juin 2020

0 votes

Ravi Kumar , i'm trying to solve the same Problem with T=200 C° at a Point on the face (not all the Face, just a Point in the middel).
my you help me?
your help would be appreicaited

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by