Fluid Viscosity
% For an air studied problem
clc
clear
N=100;
%Assigning values for the Constants
for i=1:N;
T0(i)=291.15;
C(i)=120;
myu0(i)=18.27;
end
% Generating a set of temperature Data
T(1)=291.15;
for i=1:N-1;
T(i+1)=T(i)+10;
end
%Algebric Operations and simplifications
for i=1:N;
%addition Process
a(i)=T0(i)+C(i);
b(i)=T(i)+C(i);
%division Process
c(i)=a(i)/b(i);
d(i)=(T(i)/T0(i))^(1.5);
end
%output section
for i=1:N;
myu(i)=myu0(i)*c(i)*d(i);
end
%storing the produced data into a 2D matrix
for i=1:2;
for j=1:N;
if (i==1)
e(i,j)=T(i);
elseif (i==2)
e(i,j)=myu(i);
end
end
end
display('Temeprature Table')
T'
display('viscosity Table')
myu'
display('Table');
e'
plot(myu,T,'r');
grid on
figure(1)
xlabel('myu')
ylabel('T')
Title('Viscosity vs Temperature')
clc
clear
N=100;
%Assigning values for the Constants
for i=1:N;
T0(i)=291.15;
C(i)=120;
myu0(i)=18.27;
end
% Generating a set of temperature Data
T(1)=291.15;
for i=1:N-1;
T(i+1)=T(i)+10;
end
%Algebric Operations and simplifications
for i=1:N;
%addition Process
a(i)=T0(i)+C(i);
b(i)=T(i)+C(i);
%division Process
c(i)=a(i)/b(i);
d(i)=(T(i)/T0(i))^(1.5);
end
%output section
for i=1:N;
myu(i)=myu0(i)*c(i)*d(i);
end
%storing the produced data into a 2D matrix
for i=1:2;
for j=1:N;
if (i==1)
e(i,j)=T(i);
elseif (i==2)
e(i,j)=myu(i);
end
end
end
display('Temeprature Table')
T'
display('viscosity Table')
myu'
display('Table');
e'
plot(myu,T,'r');
grid on
figure(1)
xlabel('myu')
ylabel('T')
Title('Viscosity vs Temperature')
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com