Skip to content

Instantly share code, notes, and snippets.

@kcajf
Created February 21, 2014 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kcajf/c38178d9b736081ca314 to your computer and use it in GitHub Desktop.
Save kcajf/c38178d9b736081ca314 to your computer and use it in GitHub Desktop.
MATLAB Moody diagram function
function [ f ] = Moody( Re, r )
% Returns friction factor for Reynold's number Re, relative roughness r
% Uses Haaland equation
f = (1./(-1.8 *log10( (r/3.7)^(1.11) + 6.9./Re)).^2)./4;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment