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

KSSV
KSSV 2021년 9월 2일
How about streamlines ?
Prashan Beddagana
Prashan Beddagana 2021년 9월 2일
@KSSV Since i have the given velocity field, is it possible to plot streamlines of the vortex flow?
Prashan Beddagana
Prashan Beddagana 2021년 9월 2일
@KSSV i have tried using it, but when i try run the code it gives me an error of u,v,w must all be a 3d arrays

댓글을 달려면 로그인하십시오.

 채택된 답변

Wan Ji
Wan Ji 2021년 9월 2일
편집: Wan Ji 2021년 9월 2일

0 개 추천

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

Prashan Beddagana
Prashan Beddagana 2021년 9월 2일
Hi @Wan Ji Thank you for your resposne,
Ive tried running the code youve given but i get an error of 'Error using scatteredInterpolant
Invalid interpolation type specified.'
Wan Ji
Wan Ji 2021년 9월 2일
If your X,Y,Z,U,V,W have the same length and are all of the same data type of double.
I dont think there will be any problem in my code
Wan Ji
Wan Ji 2021년 9월 2일
Hi, I have recieved your email but I dont know how to reply@Prashan Beddagana
Prashan Beddagana
Prashan Beddagana 2021년 9월 2일
@Wan Ji I sent you another message

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Airfoil tools에 대해 자세히 알아보기

태그

질문:

2021년 9월 2일

댓글:

2021년 9월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by