Find Your Way Around :)
Home
Sample Labview VI's

Technical Papers

Simple piece of Matlab code to process the data recorded by the Labview VI :


%********************
noc=473;
for i=1:noc
filename1=int2str(i);
filename2='.kat';
filename=[filename1,filename2];
arr=textread(filename,'%*f %f %*f','headerlines',8);
totaltemp=0;
for j=1:30000
totaltemp=arr(j)+totaltemp;
end
avg_case=totaltemp/30000;
stdsum=0;
for k=1:30000
stdsum=stdsum+(arr(k)-avg_case)^2;
end
std_deviation=sqrt((1/29999)*stdsum);
delta_t=std_deviation/sqrt(30000);
% hold on;
% plot(arr,'r.');
results(i,1)=avg_case;
results(i,2)=std_deviation;
results(i,3)=delta_t;
end
dlmwrite('results.kat',results(),'newline','pc')
clear;
% n = # of test cases
%****************
noc=473;
% u = free stream velocity in m/s , d = dia. of cylinder in metres
%(small cyl=0.00625, large cyl=0.00942)
% t_inf=free stream temp
%*****************
u=0.07;
d=0.00942;
t_inf=25.9;
%cdelt =c_delta value by calibration(sml cyl=0.00024, large cyl=0.00055)
% **the value u enter in the code SHUD BE positive even though its actually
% negative. check Pg.35 of Pottebaum thesis for values and eq.2.5 on Pg.28 for
% formula
%******************
cdelt=0.00055;
%R_d = radius in m (sml_cyl = 0.003125 , big_cyl = 0.00471)
R_d=0.00471;
%L=cylinder length (0.15875m)
L=0.15875;
%P= voltage * Current (calculate for each test run)!!!
P=59.20;
%*******************
load results.kat;
% tc_temp = average of thermocouple temp
tc_temp=results(:,1);
load parameters.txt;
%amp_inp= input amplitude , amp = actual amplitude of oscillation
amp_inp=parameters(:,1);
freq=parameters(:,2);
amp=amp_inp*2;
%amp_rads = amplitude in radians
amp_rads=amp*(pi()/180);
%f_star= non-dimensional frequency
f_star=freq*(d/u);
for i=1:noc
h(i)=1/(((2*pi()*R_d*L*(tc_temp(i)-t_inf))/P)-cdelt);
Nu(i)=h(i)*d/0.612;
end
%n_freq = no. of unique frequencies tested, n_amp= # of amplitudes tested
%***********************
n_freq=43;
n_amp=11;
Nu0=0;
for i=1:n_freq
Nu0=Nu0+Nu(i);
end
%Nu0=avg.Nu for amplitude=0 degrees case
Nu0=Nu0/n_freq;
%NHT=Normalized Heat Transfer
for i=1:noc
NHT(i)=Nu(i)/Nu0;
results_final(i,1)=tc_temp(i);
results_final(i,2)=amp(i);
results_final(i,3)=amp_rads(i);
results_final(i,4)=h(i);
results_final(i,5)=Nu(i);
results_final(i,6)=NHT(i);
results_final(i,7)=f_star(i);
c1(i,1)=1/f_star(i);
c1(i,2)=amp_rads(i);
c1(i,3)=NHT(i);
end
dlmwrite('results_final.kat',results_final(),'newline','pc')
dlmwrite('c1.kat',c1(),'newline','pc')
ii=0;
for j=1:n_amp
for i=1:n_freq
x(i)=f_star(i);
ii=ii+1;
y(i)=NHT(ii);
end
plot(x,y,'.-');
hold all;
% legend(j);
end
xlabel('f*');
ylabel('Nu / Nu0');
title('normalized heat transfer vs. f*');
grid on;
clear


 


 
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees