# How to plot a 3D vortex flow

27 ビュー (過去 30 日間)
Prashan Beddagana 2021 年 9 月 2 日
コメント済み: Prashan Beddagana 2021 年 9 月 2 日
I have been given a set of large data for an airfoil. Where i have a mesh file of X,Y,Z Coordinates and data file of its velocity map as Xi,Yi,Zi,Ui,Vi,Wi at a given timestep. I want to be able to plot a 3D Vortex structure on the suction side of the airfoil ( something similar to the images below) but i am unsure how to do this. I have tried using the curl function but i think my code is wrong and gives me an error saying 'contour not rendered for non-finite Zdata). Please could someone guide me in the right direction to how to approach this.  ##### 5 件のコメント表示非表示 4 件の古いコメント
KSSV 2021 年 9 月 2 日

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

### 採用された回答

Wan Ji 2021 年 9 月 2 日

If you donot have a mesh, then you need to reconstruct your mesh!
X = X(:); Y = Y(:); Z = Z(:); U = U(:); V= V(:); W=W(:);
minX = min(X);
maxX = max(X);
minY = min(Y);
maxY = max(Y);
minZ = min(Z);
maxZ = max(Z);
n = ceil(numel(X)^(1/3))+1;
x = linspace(minX,maxX,n);
y = linspace(minY,maxY,n);
z = linspace(minZ,maxZ,n);
[Xr,Yr,Zr] = meshgrid(x,y,z);
Ur = zeros(size(Xr));
Vr = Ur;
Wr = Ur;
Fu = scatteredInterpolant(X,Y,Z,U,'linear');
Fv = scatteredInterpolant(X,Y,Z,V,'linear');
Fw = scatteredInterpolant(X,Y,Z,W,'linear');
Ur(:) = Fu(Xr(:),Yr(:),Zr(:));
Vr(:) = Fv(Xr(:),Yr(:),Zr(:));
Wr(:) = Fw(Xr(:),Yr(:),Zr(:));
[sx,sy,sz] = meshgrid(linspace(minX,maxX,11),linspace(minY,maxY,11),linspace(minZ,maxZ,11));
streamline(stream3(Xr,Yr,Zr,Ur,Vr,Wr,sx,sy,sz))
##### 4 件のコメント表示非表示 3 件の古いコメント
Prashan Beddagana 2021 年 9 月 2 日
@Wan Ji I sent you another message

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

### Community Treasure Hunt

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

Start Hunting!