%The sample code below plots the mean velocity, Reynolds stress (from both probes) at the %first anchor point, additionally it plots the autospectra from the moving %probe, at a sample point % NOTE : Circumferential correlations can be plotted by modifying this code % accordingly; Change the filename on line 15 to Velocity_CircumferentialCorrelations_Hotwire.mat %Author :Neehar Agastya Balantrapu % agastyab@vt.edu clear all close all %Load Radial correlation data file load('Velocity_RadialCorrelations_Hotwire.mat') %Generate Polar co-ordinates for ii = 1:4 Stats(ii).RoverD_f = sqrt(Stats(ii).ZoverD_f.^2 + Stats(ii).YoverD_f.^2); Stats(ii).RoverD_m = sqrt(Stats(ii).ZoverD_m.^2 + Stats(ii).YoverD_m.^2); Stats(ii).theta_f = atan2(Stats(ii).ZoverD_f,Stats(ii).YoverD_f); Stats(ii).theta_m = atan2(Stats(ii).ZoverD_f,Stats(ii).YoverD_m); Stats(ii).radial_separation = (Stats(ii).RoverD_m - Stats(ii).RoverD_f); end %% Plot mean velocities figure for mm = 1:4 plot(Stats(mm).Us_f,Stats(mm).RoverD_f) hold on plot(Stats(mm).Us_m,Stats(mm).RoverD_m) end %Plot settings ------------ xlabel('U_s/U_{ref}') ylabel('r/D') title('Mean Velocity from 2-pt Radial correlation') legend('Fixed, 0.4\delta','Moving, 0.4\delta','Fixed, 0.65\delta','Moving, 0.65\delta','Fixed, 0.75\delta','Moving, 0.75\delta','Fixed, 0.85\delta','Moving, 0.85\delta') %--------------------------- %% Plot Re stresses figure for mm = 1:4 plot(Stats(mm).us2_f,Stats(mm).RoverD_f) hold on plot(Stats(mm).us2_m,Stats(mm).RoverD_m) end xlabel('u_s^2/U_{ref}^2') ylabel('r/D') title('Turbulence from 2-pt Radial correlation ') legend('Fixed, 0.4\delta','Moving, 0.4\delta','Fixed, 0.65\delta','Moving, 0.65\delta','Fixed, 0.75\delta','Moving, 0.75\delta','Fixed, 0.85\delta','Moving, 0.85\delta') hold off %% Plot cross-correlation magnitude as a function of separation (normalized on BOR diameter) figure for mm = 1:4 plot( Stats(mm).radial_separation, Stats(mm).us2_fm) hold on end % PLot setting--------------- xlabel('\Deltar/D') ylabel('us_fus_m/U_{ref}^2') title('Cross-correlation - Radial') hleg = legend('0.40','0.65','0.75','0.85'); title(hleg,'(r-r_s)/delta)') hold off % ----------------------------- %% Plot sample auto-spectral density, say for the fixed probe, at the first anchor point % generate frequency vector sampling_f = SamplingScheme.Frequency; record_L = SamplingScheme.RecordSize; f_max = sampling_f/2 - 1; % inferring data only to half the sampling frequency (Nyquist theorem) frequency_vec = 0 : sampling_f/record_L:f_max; %Plot auto-spectra from moving probe, for the first anchor position aa = 1; %first anchor position figure loglog(frequency_vec',squeeze(Spectra(aa).G_usus(3,:,:))) %Plot settings xlabel('Frequency [Hz]') title('x/D = 3.1717') ylabel('G_{u_s_mu_s_m/U_{ref}^2}') hleg = legend(num2str(Stats(aa).RoverD_m)) htitle=get(hleg,'Title'); set(htitle,'String','r/D') % The above snippet can be modified to plot any spectral information; For % assistance please refer the attached excel document describing the data % organization