How can I get velocity values for stream3 function

Hello,
I have a 3D flow domain in which I have created matrix format of x, y , z coordinates as well as u , v , w for my velocity vector. I would like to do a particle tracing for the particle release from a cetrain coodrnates. Then I would like to have x , y, z coordinates and u, v, w values of the particle along it's trajectory (my final aim is to calculate the particle travel time within the domain released from a specfic point).
I used the following codes to get the coordinates of the particle along it's path (x,y,z,u,v,w are known):
[sx,sy,sz] = meshgrid(2.6,2.6,-5);
XYZ_Data=stream3(x,y,z,u,v,w,sx,sy,sz);
However, I don't know how can I get the velocity vector of the corresponding coordinates of XYZ_Data! It would be really appreciated if anybody could help me in this issue.
Bests,

 採用された回答

darova
darova 2020 年 4 月 6 日

0 投票

A short example
clc,clear
cla
load wind
[sx sy sz] = meshgrid(80,20:10:50,0:5:15);
h = streamline(stream3(x,y,z,u,v,w,sx,sy,sz));
xx = get(h,'xdata');
yy = get(h,'ydata');
zz = get(h,'zdata');
ii = 10;
x1 = xx{ii};
y1 = yy{ii};
z1 = zz{ii};
u1 = interp3(x,y,z,u,x1,y1,z1);
v1 = interp3(x,y,z,v,x1,y1,z1);
w1 = interp3(x,y,z,w,x1,y1,z1);
hold on
jj = 1:30:length(x1);
quiver3(x1(jj),y1(jj),z1(jj),u1(jj),v1(jj),w1(jj),'r')
hold off

2 件のコメント

Brian Mojarrad
Brian Mojarrad 2020 年 4 月 6 日
Many thanks for your help! very efficient and straight forward!
darova
darova 2020 年 4 月 6 日
you are welcome

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeVector Fields についてさらに検索

質問済み:

2020 年 4 月 6 日

コメント済み:

2020 年 4 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by