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

Risposte (2)

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 Commenti

Would it possible if I dont want to use PDE tool box and code it on my own?
"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.
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 il 11 Apr 2018
Modificato: Torsten il 11 Apr 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 il 11 Apr 2018
Modificato: KT TAgong il 11 Apr 2018
Thank you very much. I'll take a look.
Best
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
Your code did not work.
Can you eloborate? Did it error?
This kind of coding gives error in matlab 2015b
OK. Yes, you need a newer version of MATLAB this feature did not exist in R2015b.
:) It does exist. But you have to change your codes.

Accedi per commentare.

Kyrillos Atallah
Kyrillos Atallah il 9 Giu 2020

0 voti

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

Prodotti

Richiesto:

il 9 Apr 2018

Commentato:

il 16 Nov 2020

Community Treasure Hunt

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

Start Hunting!

Translated by