The Darcy friction factor is used to calculate flow loss through pipes. The Reynolds number is also a unitless quantity used in fluid flow computations. Write a MATLAB function M-file named DarcyFricFact to compute the Darcy friction factor using the formula shown below. The input arguements are pipe roughness, pipe diameter, and Reynolds number. The output argument is the friction factor. It is not possible to determine the friction factor explicitly—there are many approximations. You must use the Goudar equation to compute the friction factor, f. https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Goudar.E2.80.93Sonnad_equation. The function should halt and return a red error message if the following conditions are not met: • Scalar input for pipe roughness and pipe diameter • Pipe roughness and pipe diameter must be positive numbers. • (optional) Reynolds number must be greater than 4000. The function must be vectorized to allow array input for Reynolds number & corresponding array output for the friction factor Solution MATLAB 3400 WITH ROUND TABLE 36 .
The Darcy friction factor is used to calculate flow loss through pipes. The Reynolds number is also a unitless quantity used in fluid flow computations. Write a MATLAB function M-file named DarcyFricFact to compute the Darcy friction factor using the formula shown below. The input arguements are pipe roughness, pipe diameter, and Reynolds number. The output argument is the friction factor. It is not possible to determine the friction factor explicitly—there are many approximations. You must use the Goudar equation to compute the friction factor, f. https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Goudar.E2.80.93Sonnad_equation. The function should halt and return a red error message if the following conditions are not met: • Scalar input for pipe roughness and pipe diameter • Pipe roughness and pipe diameter must be positive numbers. • (optional) Reynolds number must be greater than 4000. The function must be vectorized to allow array input for Reynolds number & corresponding array output for the friction factor Solution MATLAB 3400 WITH ROUND TABLE 36 .