Generating stretched cartesian grid for lid driven cavity numerical simulation
4 次查看(过去 30 天)
显示 更早的评论
Hi, I'm trying to generate a stretched cartesian grid for lid driven cavity numerical simulation in matlab. So, in a rectangular domain, points/nodes will be closer to each other near the wall compared to mid region of the domain.
How can I generate such a vector? If I have such a vector, then I can generate the grid either with delaunay or meshgrid functions.
Thank you.
0 个评论
回答(1 个)
Star Strider
2017-10-29
Here is one option:
t = linspace(-pi, pi, 50);
v = cos(t);
figure(1)
plot(t, v);
[X,Y] = meshgrid(v);
Z = ones(size(X));
figure(2)
mesh(X, Y, Z)
grid on
Experiment to get the result you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!