Plotting a given velocity field (vortex flow)

88 ビュー (過去 30 日間)
Mammadbaghir Baghirzade
Mammadbaghir Baghirzade 2020 年 4 月 25 日
コメント済み: Monisha Srabanti 2024 年 1 月 3 日
Hi all,
I am trying to plot following u_x and u_y functions, which are the x and y components of a velocity field.
The results should look like a vortex, as can be seen in the attached picture which I took from "wolframalpha.com" when I tried to compare my results.
However, instead such a simle 2D vortex I get complex velocity field which is also attached here.
I suspect it is due to wrong initialiazing the domain or wrong usage domain values in the "for loop", which is shown in the end of this message.
Could you please suggest me any possible solution.
I appreciate your time.
  2 件のコメント
darova
darova 2020 年 4 月 25 日
You code works ok. Just try this
plot(u_x,u_y)
Mammadbaghir Baghirzade
Mammadbaghir Baghirzade 2020 年 4 月 25 日
Thank you for your reply.
I did plot these functions, however, I got complex result as in the attached.
But instead I need to get something like following. And I can not get such simple vortex flow.

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 25 日
編集済み: Ameer Hamza 2020 年 4 月 25 日
try this
x = 0:0.1:3;
y = 0:0.1:3;
[X,Y] = meshgrid(x,y);
Psi = (1/pi)*sin(pi*X).^2.*sin(pi*Y).^2;
u_x = 2*(sin(pi*X).^2).*(sin(pi*Y)).*(cos(pi*Y));
u_y = -2*(sin(pi*Y).^2).*(sin(pi*X)).*(cos(pi*X));
figure;
contourf(X,Y,Psi)
title('velocity field intensity')
figure;
quiver(X,Y,u_x,u_y)
title('velocity field direction')
  5 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 4 月 26 日
I am glad to be of help.
Monisha Srabanti
Monisha Srabanti 2024 年 1 月 3 日
Hi, I have a similar problem where I made hemodynamic 3d atlases and I want to calculate and plot the vortex in that atlas. How can I do that? Can anyone help me with that? I have the velocity fields of MRI images and have the atlas as .fig

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by