MATLAB Answers

How can I get velocity values for stream3 function

조회 수: 3(최근 30일)
Brian Mojarrad
Brian Mojarrad 6 Apr 2020
댓글: darova 6 Apr 2020
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);
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.

  댓글 수: 0

로그인 to comment.

채택된 답변

darova 6 Apr 2020
A short example
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);
hold off

  댓글 수: 2

Brian Mojarrad
Brian Mojarrad 6 Apr 2020
Many thanks for your help! very efficient and straight forward!
darova 6 Apr 2020
you are welcome

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by