3D diffusion equation in cylinder
27 ビュー (過去 30 日間)
古いコメントを表示
Ahmed Aldohbeyb
2017 年 5 月 29 日
コメント済み: Precise Simulation
2021 年 11 月 5 日
Hi everyone, I am new in Matlab and I need some help. I want know if there is a way to solve the PDE for diffusion in a cylinder with 2 cm radius and 10 cm height.
thanks
0 件のコメント
採用された回答
Precise Simulation
2017 年 11 月 22 日
編集済み: Precise Simulation
2017 年 11 月 22 日
Modelling and simulation of convection and diffusion for a 3D cylindrical (and other) domains is possible with the Matlab Finite Element FEM Toolbox , either by using the built-in GUI or as a m-script file as shown below.
% Set up 3D cylindric domain.
fea.sdim = { 'x' 'y' 'z' };
fea.grid = cylgrid( 4, 3, 20, 0.02, 0.1 );
% plotgrid( fea ) % Plot mesh.
% Add covection and diffusion physics mode.
fea = addphys( fea, @convectiondiffusion, {'C'} );
% Define diffusion coefficient.
fea.phys.cd.eqn.coef{2,end} = {'d_coef'};
fea.expr = { 'c', {'1.23'} ;
'd_coef', {'(1+c)^2/((1+c)^2+1)'} };
% Set reaction source term to 1e3.
fea.phys.cd.eqn.coef{6,end} = {1e3};
% Use C = -1 on side boundaries, and insulation
% flux boundary conditions on the top and bottom.
fea.phys.cd.bdr.sel = [ 3 1 1 1 1 3 ];
[fea.phys.cd.bdr.coef{1,end}{2:5}] = deal(-1);
% Check, parse, and solve problem with stationary solver.
fea = parsephys( fea );
fea = parseprob( fea );
fea.sol.u = solvestat( fea );
% Postprocessing.
postplot( fea, 'sliceexpr', 'C' )
title( 'Concentration, C' )
6 件のコメント
Rae K.
2021 年 9 月 10 日
編集済み: Rae K.
2021 年 9 月 10 日
@Precise Simulation The cylgrid function doesn't appear to be part of the Matlab Finite Element FEM Toolbox, or appear anywhere in MATLAB Help/Answers other than this post.
Precise Simulation
2021 年 11 月 5 日
The cylgrid function is available as part of the toolbox installation:
その他の回答 (1 件)
Torsten
2017 年 5 月 30 日
If you have experience with the discretization of partial differential equations, you can write your own MATLAB code.
Otherwise, I'd suggest you use the PDE toolbox.
Best wishes
Torsten.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Boundary Conditions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!