Information about meshgrid in pdetool. How can I define specific mesh?
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am developing a project to study a heat transfer in a plate. I am using pdetool to solve the EDP.
I would like to know a little bit more about the mesh...
Now, I have this mesh:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169127/image.png)
But I would like the mesh like squares:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169128/image.png)
Is it possible?
Cheers
0 个评论
回答(2 个)
Ravi Kumar
2017-11-3
Hi Yogan,
PDE Toolbox does not support quadrilateral elements as shown in your second picture. If your purpose is the find the solution on a rectangular grid, then you can first solve using the PDE Toolbox triangular mesh and then interpolate the solution onto a rectangular grid. Refer to the documentation following documentation page for examples:
https://www.mathworks.com/help/pde/ug/pde.steadystatethermalresults.interpolatetemperature.html
Also, I would suggest use the programmatic approach as shown in the documentation not the PDE App.
0 个评论
Precise Simulation
2017-11-4
If you prefer to set up and solve heat transfer plate and other PDE problems with a structured quadrilateral mesh, it is possible to use the rectgrid function included in the finite element FEA toolbox . The following code shows a small example of defining and solving heat conduction in a rectangular 2D domain with structured quadrilateral mesh cells (alternatively, you can use the GUI at first, and then save you model as an editable m-file script file to see how the FEA script modeling and definition works):
% Define geometry and grid.
nx = 20;
ny = 5;
dim = [ 0, 4; 0, 1 ];
fea.grid = rectgrid( nx, ny, dim );
fea.sdim = { 'x' 'y' };
% Add heattransfer multiphysics mode.
fea = addphys( fea, @heattransfer );
rho = 1;
k = '1e-3*(1 + x)';
cp = 'cos(x)';
fea.phys.ht.eqn.coef{1,end} = { rho };
fea.phys.ht.eqn.coef{2,end} = { cp };
fea.phys.ht.eqn.coef{3,end} = { k };
% Use temperature boundary conditions (1)
% on the left (4) and right (2) edges.
fea.phys.ht.bdr.sel([2 4]) = 1;
Tl = 300;
Tr = 450;
fea.phys.ht.bdr.coef{1,end}{2} = Tr;
fea.phys.ht.bdr.coef{1,end}{4} = Tl;
% Check, parse, and solve stationary problem.
fea = parsephys( fea );
fea = parseprob( fea );
fea.sol.u = solvestat( fea );
% Plot grid and solution.
postplot( fea, 'surfexpr', 'T', 'linestyle', '-' )
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geometry and Mesh 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!