Program 2: Air at 25°C and 1 atm flows through a 4 mm diameter tube with an average velocity of
50 m/s. The roughness is = 0.0015 mm. Calculate the friction factor using the Colebrook equation:
Determine the pressure drop in a 1 m section of the tube using the relation
Density of air at 25°C and 1 atm is 1.23 kg/m and viscosity is kg/m-s.
Scilab codes:
function value=fn(f, a, b);
value=1/sqrt(f)+2.0*log10(a+b*f^(-0.5));
endfunction
function value=fnDash(f, a, b);
value=-0.5*f^(-1.5)+(b*(-0.5)*f^(-1.5))*log(10)/(a+b*f^(-0.5));
endfunction
function delta_p=get_pressure_drop(fricFact, l, v, rho, d);
delta_p=fricFact*l*v*v*rho/(2*d);
endfunction
function value=getFricFact(nRe, k);
a=k/3.7;
b=2.51/nRe;
fNew=0.01;
f=fNew;
while (1)
f=fNew;
fNew=f-fn(f,a,b)/fnDash(f,a,b);
if(abs(fNew-f)<1.0e-6) then
break;
end
end // while loop
value=fNew;
endfunction
rho=1.23;//kg/cubm
mu=1.79e-5//kg/m-s
d=0.004;//m (4 mm dia pipe)
l=1; // 1 m length
v=50;//m/sec
e=0.0015e-3; //m
// // relative roughness
k=e/d;
// // Raynolds num
nRe=rho*v*d/mu;
fricFact=getFricFact(nRe,k)
get_pressure_drop(fricFact, l, v, rho, d)
Result
friction factor = 0.029099
pressure drop = 11185.097 N/m2.
data generated:
sn f fNew
1 0.010000 0.017503
2 0.017503 0.024358
3 0.024358 0.027878
4 0.027878 0.028870
5 0.028870 0.029061
6 0.029061 0.029093
7 0.029093 0.029099
8 0.029099 0.029099