Ploting Results from CFD (streamline,quiver)

Hi, I have some results from a CFD program that I am trying to plot. The mesh in the CFD program is a uniform 2d Mesh, it is 1350 units long in the X direction and 260 units high in the Y. The output I get from the program is two notepads, with the U and V velocities at each node. I can import both of them into matlab and have two 351000X1 arrays. The U and V ouputs are along the X meaning the Y co-ordinate does not change for 1350 values. How do i plot these? When i try use the streamline function it says that my X&Y array arent long enough? How do i set up my X and Y arrays?

 채택된 답변

Walter Roberson
Walter Roberson 2011년 10월 23일

0 개 추천

You cannot pass in a vector for U: you must pass in a 2D or 3D array. You probably need to reshape() your U data.

댓글 수: 3

Marek
Marek 2011년 10월 23일
So your saying that i need to get my U and V data into something that is 1350X260? Is there anyway matlab can change that about? I know i could certainly swap it all about in excel then put it back into matlab but i dont fancy changning it all by hand.
Walter Roberson
Walter Roberson 2011년 10월 23일
U = reshape(YourUData,1350,260);
Marek
Marek 2011년 10월 29일
Using both of the answers given I was able to plot the data how i wanted. The next step is automating the import of all my files!
Thanks for the hlp!

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

추가 답변 (1개)

bym
bym 2011년 10월 23일

0 개 추천

[xx,yy] = meshgrid(X,Y);
streamline(xx,yy,u,v,startx,starty)

댓글 수: 1

Marek
Marek 2011년 10월 23일
Yeah i have tried something like that, meshgrid gives me sensible xx yy arrays, but streamline then tell me my U and V arrays are wrong.
??? Error using ==> stream2 at 47
U,V must all be size 2x2 or greater.
Error in ==> streamline at 63
verts =
stream2(x,y,u,v,sx,sy,options);
Error in ==> Untitled2 at 2
streamline(xx,yy,u,v,0,0)
As I said my u and v arrays are both 35100X1,

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

카테고리

도움말 센터File Exchange에서 Computational Fluid Dynamics (CFD)에 대해 자세히 알아보기

제품

질문:

2011년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by