フィルターのクリア

Curl Function to Plot CFD output: Data - [x y x Ux Uy Uz]

3 ビュー (過去 30 日間)
Ben Brooke
Ben Brooke 2012 年 4 月 10 日
Hi,
I have a data set consisting of coordinates, x y z, and magnitudes of velocity Ux Uy Uz in a (26683 x 6) data set. This data has been produced by taking a cut through a 3D CFD simulation I have produced, so that the y coordinate is constant throughout the slice.
I have no experience with the curl function and would appreciate it if anyone could give me a hand with the code I'd have to write to plot angular velocity in a 2D plot, with shading and quiver on.
Thanks

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 4 月 10 日
So each columne of the 26683x6 matrix represents one of the coordinates or components?
Are x/y/z monotonic? If so, you should be able to reshape() each of the channels ino a three-d matrix and call curl directly. If they are not, you will need to generate monotonic coordinates (with meshgrid() or ndgrid() and interpolate to these values with TriScatteredInterp(). From here call curl directly.
More per comments:
Matrix was your 26683x6 matrix. I was assuming it was of the form [x y z u v w] or similar. Thus you extract the columns of it to figure out how to mesh the data.
So in the above you would have something like:
[xx yy zz] = meshgrid(0:238,120,0:148) %uses increments of 1, this could be refined.
Now create the interpolant object for each vector component:
Fu = TriScatteredInterp(Matrix(:,1),Matrix(:,2),Matrix(:,3), Matrix(:,4)); %u component
Then to get the results for curl, calculate the vector components with the corresponding interpolant on the above meshgrid output:
uu = Fu(xx,yy,zz); %interpolate to our grid
Then call curl after doing this:
curl(xx,yy,zz,uu,vv,ww)
  14 件のコメント
Sean de Wolski
Sean de Wolski 2012 年 4 月 12 日
I think quiver expects column vectors:
quiver(xx(:),yy(:),uu(:),ww(:))
Ben Brooke
Ben Brooke 2012 年 4 月 12 日
Thank you so much for all your help Sean!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by