moody chart, m-file for finding friction factor using equation
TRANSCRIPT
![Page 1: Moody chart, M-File for finding Friction factor using equation](https://reader035.vdocuments.mx/reader035/viewer/2022071705/55addc5d1a28abf4338b4860/html5/thumbnails/1.jpg)
M-File for finding Friction factor using equation
rough = input('Enter Relative Roughness ');
re = input ('Enter Reynolds number ');
fst = 0;
f = 0.008;
while f ~= fst
disp (' Assumed value for trial and error ')
disp (f)
fst = f;
int1 = 2 * log10(1 / rough);
int2 = (9.3 /(re * rough * sqrt(fst)));
int3 = 2 * log10(1 + int2);
int4 = 1.14 + int1 - int3;
f = (1 / int4)^2;
end
disp (' Final value of friction factor ')
f
Programmed by:
Danial Sohail
Mechanical Engineering Department
NED University of Engineering and Technology