% converts U (rho), V (theta) and W in polar coords into % proper u,v, and w in cartesian coords, plus into theta and % rho vector components in a more physical annulus layout if (1) % load data Wwhole=rdmds('W'); %Twhole=rdmds('T'); W=Wwhole(:,:,15); % set null-space areas to NaN (makes interpolation happier) W(find(W==0))=NaN; %T(find(T==0))=NaN; %W(120,:)=0.005; [ydim xdim]=size(W); else xdim=31; ydim=120; [X Y ]=meshgrid(1:xdim,1:ydim); W=X; W(:,1:8)=nan; W(:,31)=nan; %W(:,9)=26; end % this determines resolution of interpolated fields % 0.5 is perhaps a bit fine, but it looks pretty %step=0.5; % good for quiver plots % step=1; step=(xdim*2+1)/(xdim*2); rhoi=1:31; thetai=1:120; z=1; % convert w (effectively a scalar) w=cyl2cart(W,-xdim:step:xdim,-xdim:step:xdim); Wback=cart2cyl(w,thetai,rhoi); % Tc=cyl2cart(T,-30:step:30,-30:step:30); figure(1);imagesc(W(:,:,z));colorbar; figure(2);imagesc(w(:,:,z));colorbar; figure(3);imagesc(Wback(:,:,z));colorbar; Werr=Wback-W; figure(4);imagesc(Werr(:,:,z));colorbar;