% Plots for channel flow
function result(nx,ny,x,y,u,v,uo,rho)
% for j=1:ny
% Tm1(j)=u(101,j)/uo;
% Tm2(j)=u(201,j)/uo;
% Tm3(j)=u(301,j)/uo;
% Tm4(j)=u(401,j)/uo;
% Tm5(j)=u(501,j)/uo;
% end
% figure
% plot(Tm1,y,Tm2,y,Tm3,y,Tm4,y,Tm5,y,'LineWidth',1.5)
xlabel('U')
ylabel('Y')
for j=1:ny
for i=1:nx
xp(i,j)=x(i);
yp(i,j)=y(j);
end
end
% [x,y]=meshgrid(0:2241,0:41);
% x=u;
% y=-v;
% figure
% quiver(x,y,u,v)
%新加入的方腔流矢量图
% for j=1:ny
% um(j)=u((nx-1),j)/uo;
% end
% for i=1:nx
% vm(i)=v(i,(ny-1))/uo;
% end
% figure
% quiver(x,y,v/uo,u/uo, 1)
%Stream function calculation
% for j=1:ny
% sx(:,j)=x(:);
% end
% for i=1:nx
% sy(i,:)=y(:);
% end
% str=zeros(nx,ny);
% for i=1:nx
% for j=2:ny
% str(i,j)=str(i,j-1)+0.5*(u(i,j)+u(i,j-1));
% end
% end
% figure
% contour(sx,sy,str)
% Stream function calculation
% str=zeros(nx,ny);
% for i=1:nx
% for j=2:ny
% str(i,j)=str(i,j-1)+0.25*(rho(i,j)+rho(i,j-1))*(u(i,j)+u(i,j-1));
% end
% end
% figure
% contour(xp,yp,u,20)
% 咸鱼来的
date=0;
save_data={};
yy=ones(size(x'));
for i=1:length(y)
disp(['纵坐标y' num2str(y(i))]);
y_ts=y(i).*yy;
save_data=[save_data; x' y_ts u(:,i) v(:,i)];
end
% csvwrite('csvlist.dat',save_data);
% type csvlist.dat;
save_data=cell2mat(save_data);
save channel flow.dat -ascii save_data
end