clear format compact % This script imports and plots up the velocity profile map for the % sample pictures from the heated wire experiment. It also compares % it to the theoretical profile. Note that it is necessary for the % data file produced from the theoretical program to be in this directory. %We have the base name of the data files: basename='sample' %We load in the velocity data set: name=[basename,'vel.mat']; load(name,'-mat') % We plot up the identified particle locations with symbols. For the % quiver plot we shift things back to the original (laboratory) reference % frame. We also move the lateral center to the peak velocity at the % middle height. ycshift = yc+[zeros(size(xc)),xc-median(xc)]*xfit; drift = xfit(2) %The slope of the drift of the centerline figure(1) plot(ycshift,xc,'ok') axis('equal') ylabel('x (cm)') xlabel('y (cm)') title('Velocity Profile Quiver Plot') labels=name; %We set up a list of labels. %Now we add in the quiver velocity plot: figure(1) hold on quiver(ycshift,xc,v,u,'.') hold off % We can also plot up the dimensional velocities as a function of y. % Because it's also a function of x, we restrict ourselves to values of x % close to the median of the data set. Note that there is -a lot- more % data in the file, so we can use the quiver plot (figure 1) to see what % other values of x we can look at! You will want to play with both xmed % (the center of the data you are looking at for figures 2 and 3) and xd % (the half-width of the vertical region you are looking at) to see how the % profile varies with height for this data set. You may even want to have % xmed be negative (e.g., below the wire), although the theory isn't valid % in that region, and only the horizontal velocity is of interest in that % region. Note that figures 4 and 5 are the dimensionless, scaled data and % theory: they include all the data more than 1mm above the wire. xmed=round(median(xc*10))/10 %We round off to the nearest mm. xd=.2; ii=find(abs(xc-xmed).1); %We restrict these to partilces more than 1mm above the wire figure(4) plot(ys(kk),us(kk),'o') xlabel('scaled dimensionless lateral position') ylabel('scaled dimensionless vertical velocity') title('Dimensionless Scaled Vertical Velocity') axis([-10 10 -.25 1.25]) grid on figure(5) plot(ys(kk),vs(kk),'o') xlabel('scaled dimensionless lateral position') ylabel('scaled dimensionless horizontal velocity') title('Dimensionless Scaled Horizontal Velocity') labels2='Data'; % We can also compare to the theoretical velocity profile. The data for % This is stored in the file prXX.txt where XX is the prantl number: pr=26; name=['pr',num2str(pr)]; load([name,'.txt']) data=eval(name); eta=data(:,1); ut=data(:,2); vt=data(:,3); eta=[-eta;eta]; ut=[ut;ut]; vt=[-vt;vt]; [eta,i]=sort(eta); ut=ut(i); vt=vt(i); labels2=str2mat(labels2,'Theory'); %We add this profile to the dimensionless plots: figure(4) hold on % We can introduce "scale factors" which scale the theoretical velocity and % width by an arbitrary amount. This is useful in determining the % centerline velocity of the data which is often difficult to get if we % don't have a measured velocity "right there". yscale = 1; %These should be changed to match your data uscale = 1; plot(eta,ut,'k',eta*yscale,ut*uscale,'r') legend(char(labels2,'Scaled Theory')) text(2,.6,char(['velocity scale = ',num2str(uscale)],['width scale = ',num2str(yscale)])) hold off figure(5) hold on plot(eta,vt,'k') legend(labels2) hold off %And we can add the profile to the dimensional plots as well: etadim=eta*Ly*xmed^0.4; udim=ut*Uc*xmed^.2; vdim=vt*Vc/xmed^.4; figure(2) hold on plot(etadim,udim) plot(etadim*((xmed+xd)/xmed)^.4,udim*((xmed+xd)/xmed)^.2,':') plot(etadim*((xmed-xd)/xmed)^.4,udim*((xmed-xd)/xmed)^.2,':') plot(etadim*yscale,udim*uscale,'b--') hold off figure(3) hold on plot(etadim,vdim) plot(etadim*((xmed+xd)/xmed)^.4,vdim/((xmed+xd)/xmed)^.4,':') plot(etadim*((xmed-xd)/xmed)^.4,vdim/((xmed-xd)/xmed)^.4,':') hold off %We also estimate the slope of the horizontal velocity near the origin: ikeep=find((abs(yc)<2*Ly*abs(xmed)^.4)&(xc>xmed-xd)&(xc