%
% Plot corner flows
%
theta=[0:0.1:2*pi,2*pi];
np=size(theta,2)
r=[0:10/(np-1):10];
size(r)

theta=repmat(theta,np,1);
figure
pcolor(theta);shading interp;colorbar

r=r';
r=repmat(r,1,np);
figure
pcolor(r);shading interp;colorbar

figure
for n=1:6,
  phi=r.^n.*cos(n.*theta);
  subplot(2,3,n)
  pcolor(r.*cos(theta),r.*sin(theta),phi); shading interp;colorbar
  title(['N= ', num2str(n)])
  orient landscape
end
orient landscape
suptitle('PHI')

figure
for n=1:6,
  psi=r.^n.*sin(n.*theta);
  subplot(2,3,n)
  pcolor(r.*cos(theta),r.*sin(theta),psi); shading interp;colorbar
  title(['N= ', num2str(n)])
end
orient landscape
suptitle('PSI')

theta=[0:0.4:2*pi,2*pi];
np=size(theta,2)
r=[0:10/(np-1):10];
figure
for n=1:6,
  ur=n*r.^(n-1).*cos(n.*theta);
  utheta=-n*r.^(n-1).*sin(n.*theta);
  psi=r.^n.*sin(n.*theta);
  subplot(2,3,n)
  pcolor(r.*cos(theta),r.*sin(theta),psi); shading interp;colorbar
  hold on;grid on
  quiver(r.*cos(theta),r.*sin(theta),ur.*cos(theta)-utheta.*sin(theta),...
     ur.*sin(theta)+utheta.*cos(theta))
  title(['N= ', num2str(n)])
end
orient landscape
suptitle('PSI')


