Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
%% Plot RMS spatial profiles for error and uncertainty
clear;
casename='WS32';
outdir=['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\spatial_RMS_profiles_2D\',casename,filesep];
if ~exist(outdir,'dir');
mkdir(outdir);
end
savemat=0;
saveplot=0;
% keyboard;
%% 2003B
A1=load(['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\',casename,'\matfiles\PivChal03B.mat']);
% error_prana=cat(3,A1.err_up,A1.err_vp);
% error_davis=cat(3,A1.err_ud,A1.err_vd);
% UMC=cat(3,A1.UMCx,A1.UMCy);
% UIM=cat(3,A1.UIMx,A1.UIMy);
% UCS=cat(3,A1.UCSx,A1.UCSy);
error_prana=A1.err_up;
error_davis=A1.err_ud;
UMC=A1.UMCx;
UIM=A1.UIMx;
UCS=A1.UCSx;
[yig,xig]=meshgrid(linspace(12,500,62),linspace(12,1524,190));
locx=192/2;% 768
locx1=locx-1;%764
EP=squeeze(error_prana(end:-1:1,locx,:));
ED=squeeze(error_davis(end:-1:1,locx1,:));
MC=squeeze(UMC(end:-1:1,locx,:));
IM=squeeze(UIM(end:-1:1,locx,:));
CS=squeeze(UCS(end:-1:1,locx1,:));
thresh=1;
[indx1,indy1]=find(abs(EP)>thresh);
[indx2,indy2]=find(abs(ED)>thresh);
for i=1:62
k=1;
l=1;
for j=1:size(error_prana,3)
if ismember(i,indx1) && ismember(j,indy1)
continue;
else
tempstoreEP(k)=EP(i,j);
tempstoreMC(k)=MC(i,j);
tempstoreIM(k)=IM(i,j);
k=k+1;
end
if ismember(i,indx2) && ismember(j,indy2)
continue;
else
tempstoreED(l)=ED(i,j);
tempstoreCS(l)=CS(i,j);
l=l+1;
end
end
RMSerrorprana(i)=rms(tempstoreEP);
RMSerrordavis(i)=rms(tempstoreED);
RMSUMC(i)=rms(tempstoreMC);
RMSUIM(i)=rms(tempstoreIM);
RMSUCS(i)=rms(tempstoreCS);
end
% yax=[8:8:504 8:8:504]';
% yax1=[8:8:502 8:8:502]';
yax=(8:8:503)';
yax1=(12:8:500)';
yax=yax/max(yax(:));
yax1=yax1/max(yax1(:));
lw=2;
figure;hold on;set(gcf,'DefaultLineLineWidth',lw);
% plot(RMSerrorprana,yax,'k-');
% plot(RMSerrordavis,yax1,'k--');
% plot(RMSUMC,yax,'r-');
% plot(RMSUIM,yax,'c-');
% plot(RMSUCS,yax1,'m-');
plot(yax,RMSerrorprana,'k-');
plot(yax1,RMSerrordavis,'k--');
plot(yax,RMSUMC,'r-');
plot(yax,RMSUIM,'c-');
plot(yax1,RMSUCS,'m-');
hold off;
axis([0 1 0 0.2]);
error_prana(abs(error_prana)>thresh)=nan;
rmserrprana=nanmean(error_prana,3);
figure;imagesc(rmserrprana);
if saveplot==1
print(gcf,'-dpng',fullfile(outdir,'2003B_spatial_profile.png'),'-r360');
end
if savemat==1
save(fullfile(outdir,'2003B_spatial_profilemat.mat'),'yax','yax1','RMSerrorprana','RMSerrordavis','RMSUMC','RMSUIM','RMSUCS');
end
%% 2005B
clear RMSerrorprana RMSerrordavis RMSUMC RMSUIM RMSUCS;
clear tempstoreEP tempstoreMC tempstoreIM tempstoreED tempstoreCS;
A1=load(['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\',casename,'\matfiles\PivChal05B.mat']);
% error_prana=cat(3,A1.err_up,A1.err_vp);
% error_davis=cat(3,A1.err_ud,A1.err_vd);
% UMC=cat(3,A1.UMCx,A1.UMCy);
% UIM=cat(3,A1.UIMx,A1.UIMy);
% UCS=cat(3,A1.UCSx,A1.UCSy);
error_prana=A1.err_up;
error_davis=A1.err_ud;
UMC=A1.UMCx;
UIM=A1.UIMx;
UCS=A1.UCSx;
locx=44;% 712
locx1=44;%712
EP=squeeze(error_prana(:,locx,:));
ED=squeeze(error_davis(:,locx1,:));
MC=squeeze(UMC(:,locx,:));
IM=squeeze(UIM(:,locx,:));
CS=squeeze(UCS(:,locx1,:));
thresh=1;
[indx1,indy1]=find(abs(EP)>thresh);
[indx2,indy2]=find(abs(ED)>thresh);
for i=1:41
k=1;
l=1;
for j=1:size(error_prana,3)
if ismember(i,indx1) && ismember(j,indy1)
continue;
else
tempstoreEP(k)=EP(i,j);
tempstoreMC(k)=MC(i,j);
tempstoreIM(k)=IM(i,j);
k=k+1;
end
if ismember(i,indx2) && ismember(j,indy2)
continue;
else
tempstoreED(l)=ED(i,j);
tempstoreCS(l)=CS(i,j);
l=l+1;
end
end
RMSerrorprana(i)=rms(tempstoreEP);
RMSerrordavis(i)=rms(tempstoreED);
RMSUMC(i)=rms(tempstoreMC);
RMSUIM(i)=rms(tempstoreIM);
RMSUCS(i)=rms(tempstoreCS);
end
% yax=[8:8:504 8:8:504]';
% yax1=[8:8:502 8:8:502]';
yax=(24:16:664)';
yax1=(24:16:664)';
yax=yax/max(yax(:));
yax1=yax1/max(yax1(:));
lw=2;
figure;hold on;set(gcf,'DefaultLineLineWidth',lw);
plot(yax,RMSerrorprana,'k-');
plot(yax1,RMSerrordavis,'k--');
plot(yax,RMSUMC,'r-');
plot(yax,RMSUIM,'c-');
plot(yax1,RMSUCS,'m-');
hold off;
if saveplot==1
print(gcf,'-dpng',fullfile(outdir,'2005B_spatial_profile.png'),'-r360');
end
if savemat==1
save(fullfile(outdir,'2005B_spatial_profilemat.mat'),'yax','yax1','RMSerrorprana','RMSerrordavis','RMSUMC','RMSUIM','RMSUCS');
end
%% stagnation flow
clear RMSerrorprana RMSerrordavis RMSUMC RMSUIM RMSUCS;
clear tempstoreEP tempstoreMC tempstoreIM tempstoreED tempstoreCS;
A1=load(['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\',casename,'\matfiles\stagnation_flow.mat']);
% error_prana=cat(3,A1.err_up,A1.err_vp);
% error_davis=cat(3,A1.err_ud,A1.err_vd);
% UMC=cat(3,A1.UMCx,A1.UMCy);
% UIM=cat(3,A1.UIMx,A1.UIMy);
% UCS=cat(3,A1.UCSx,A1.UCSy);
error_prana=A1.err_up;
error_davis=A1.err_ud;
UMC=A1.UMCx;
UIM=A1.UIMx;
UCS=A1.UCSx;
locx=40;% 632
locx1=40;%632
EP=squeeze(error_prana(:,locx,:));
ED=squeeze(error_davis(:,locx1,:));
MC=squeeze(UMC(:,locx,:));
IM=squeeze(UIM(:,locx,:));
CS=squeeze(UCS(:,locx1,:));
thresh=1;
[indx1,indy1]=find(abs(EP)>thresh);
[indx2,indy2]=find(abs(ED)>thresh);
for i=1:64
k=1;
l=1;
for j=1:size(error_prana,3)
if ismember(i,indx1) && ismember(j,indy1)
continue;
else
tempstoreEP(k)=EP(i,j);
tempstoreMC(k)=MC(i,j);
tempstoreIM(k)=IM(i,j);
k=k+1;
end
if ismember(i,indx2) && ismember(j,indy2)
continue;
else
tempstoreED(l)=ED(i,j);
tempstoreCS(l)=CS(i,j);
l=l+1;
end
end
RMSerrorprana(i)=rms(tempstoreEP);
RMSerrordavis(i)=rms(tempstoreED);
RMSUMC(i)=rms(tempstoreMC);
RMSUIM(i)=rms(tempstoreIM);
RMSUCS(i)=rms(tempstoreCS);
end
% yax=[8:8:504 8:8:504]';
% yax1=[8:8:502 8:8:502]';
yax=(8:16:1016)';
yax1=(8:16:1016)';
yax=yax/max(yax(:));
yax1=yax1/max(yax1(:));
lw=2;
figure;hold on;set(gcf,'DefaultLineLineWidth',lw);
plot(yax,RMSerrorprana,'k-');
plot(yax1,RMSerrordavis,'k--');
plot(yax,RMSUMC,'r-');
plot(yax,RMSUIM,'c-');
plot(yax1,RMSUCS,'m-');
hold off;
axis([0 1 0 0.2])
if saveplot==1
print(gcf,'-dpng',fullfile(outdir,'stagnation_spatial_profile.png'),'-r360');
end
if savemat==1
save(fullfile(outdir,'stagnation_spatial_profilemat.mat'),'yax','yax1','RMSerrorprana','RMSerrordavis','RMSUMC','RMSUIM','RMSUCS');
end
%% Vortex Ring
clear RMSerrorprana RMSerrordavis RMSUMC RMSUIM RMSUCS;
clear tempstoreEP tempstoreMC tempstoreIM tempstoreED tempstoreCS;
A1=load(['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\',casename,'\matfiles\Vortex_Ring.mat']);
% error_prana=cat(3,A1.err_up,A1.err_vp);
% error_davis=cat(3,A1.err_ud,A1.err_vd);
% UMC=cat(3,A1.UMCx,A1.UMCy);
% UIM=cat(3,A1.UIMx,A1.UIMy);
% UCS=cat(3,A1.UCSx,A1.UCSy);
error_prana=A1.err_up;
error_davis=A1.err_ud;
UMC=A1.UMCx;
UIM=A1.UIMx;
UCS=A1.UCSx;
locy=17;% 632
locy1=17;%632
EP=squeeze(error_prana(locy,:,:));
ED=squeeze(error_davis(locy,:,:));
MC=squeeze(UMC(locy,:,:));
IM=squeeze(UIM(locy,:,:));
CS=squeeze(UCS(locy,:,:));
thresh=1;
[indx1,indy1]=find(abs(EP)>thresh);
[indx2,indy2]=find(abs(ED)>thresh);
for i=1:80
k=1;
l=1;
for j=1:size(error_prana,3)
if ismember(i,indx1) && ismember(j,indy1)
continue;
else
tempstoreEP(k)=EP(i,j);
tempstoreMC(k)=MC(i,j);
tempstoreIM(k)=IM(i,j);
k=k+1;
end
if ismember(i,indx2) && ismember(j,indy2)
continue;
else
tempstoreED(l)=ED(i,j);
tempstoreCS(l)=CS(i,j);
l=l+1;
end
end
RMSerrorprana(i)=rms(tempstoreEP);
RMSerrordavis(i)=rms(tempstoreED);
RMSUMC(i)=rms(tempstoreMC);
RMSUIM(i)=rms(tempstoreIM);
RMSUCS(i)=rms(tempstoreCS);
end
% yax=[8:8:504 8:8:504]';
% yax1=[8:8:502 8:8:502]';
yax=(1:1:80)';
yax1=(1:1:80)';
yax=yax/max(yax(:));
yax1=yax1/max(yax1(:));
lw=2;
figure;hold on;set(gcf,'DefaultLineLineWidth',lw);
plot(yax,RMSerrorprana,'k-');
plot(yax1,RMSerrordavis,'k--');
plot(yax,RMSUMC,'r-');
plot(yax,RMSUIM,'c-');
plot(yax1,RMSUCS,'m-');
hold off;
%axis([0 0.2 0 1016])
if saveplot==1
print(gcf,'-dpng',fullfile(outdir,'vortexring_spatial_profile.png'),'-r360');
end
if savemat==1
save(fullfile(outdir,'vortexring_spatial_profilemat.mat'),'yax','yax1','RMSerrorprana','RMSerrordavis','RMSUMC','RMSUIM','RMSUCS');
end
%% Jetdata
clear RMSerrorprana RMSerrordavis RMSUMC RMSUIM RMSUCS;
clear tempstoreEP tempstoreMC tempstoreIM tempstoreED tempstoreCS;
A1=load(['Z:\Planar_Uncertainty_work\Results\final_plots\03_21_2017\',casename,'\matfiles\Jetdata.mat']);
% error_prana=cat(3,A1.err_up,A1.err_vp);
% error_davis=cat(3,A1.err_ud,A1.err_vd);
% UMC=cat(3,A1.UMCx,A1.UMCy);
% UIM=cat(3,A1.UIMx,A1.UIMy);
% UCS=cat(3,A1.UCSx,A1.UCSy);
error_prana=A1.err_up;
error_davis=A1.err_ud;
UMC=A1.UMCx;
UIM=A1.UIMx;
UCS=A1.UCSx;
locx=16;% 632
locx1=locx;%632
EP=squeeze(error_prana(:,locx,:));
ED=squeeze(error_davis(:,locx1,:));
MC=squeeze(UMC(:,locx,:));
IM=squeeze(UIM(:,locx,:));
CS=squeeze(UCS(:,locx1,:));
% RMSerrorprana=rms(EP,2);
% RMSerrordavis=rms(ED,2);
% RMSUMC=rms(MC,2);
% RMSUIM=rms(IM,2);
% RMSUCS=rms(CS,2);
thresh=1;
[indx1,indy1]=find(abs(EP)>thresh);
[indx2,indy2]=find(abs(ED)>thresh);
for i=1:31
k=1;
l=1;
for j=1:size(error_prana,3)
if ismember(i,indx1) && ismember(j,indy1)
continue;
else
tempstoreEP(k)=EP(i,j);
tempstoreMC(k)=MC(i,j);
tempstoreIM(k)=IM(i,j);
k=k+1;
end
if ismember(i,indx2) && ismember(j,indy2)
continue;
else
tempstoreED(l)=ED(i,j);
tempstoreCS(l)=CS(i,j);
l=l+1;
end
end
RMSerrorprana(i)=rms(tempstoreEP);
RMSerrordavis(i)=rms(tempstoreED);
RMSUMC(i)=rms(tempstoreMC);
RMSUIM(i)=rms(tempstoreIM);
RMSUCS(i)=rms(tempstoreCS);
end
% yax=[8:8:504 8:8:504]';
% yax1=[8:8:502 8:8:502]';
% yax=(1:1:31)';
% yax1=(1:1:31)';
Yd=A1.Yd(:,1);
yax=-((Yd-254)./(10.2*7.2));
yax1=yax;
lw=2;
figure;hold on;set(gcf,'DefaultLineLineWidth',lw);
plot(yax,RMSerrorprana,'k-');
plot(yax1,RMSerrordavis,'k--');
plot(yax,RMSUMC,'r-');
plot(yax,RMSUIM,'c-');
plot(yax1,RMSUCS,'m-');
hold off;
axis([-1 1 0 0.2])
if saveplot==1
print(gcf,'-dpng',fullfile(outdir,'jet_spatial_profile.png'),'-r360');
end
if savemat==1
save(fullfile(outdir,'jet_spatial_profilemat.mat'),'yax','yax1','RMSerrorprana','RMSerrordavis','RMSUMC','RMSUIM','RMSUCS');
end