Created
March 23, 2019 16:41
-
-
Save ewancook/aa4082446842efb85c5b94f814957872 to your computer and use it in GitHub Desktop.
Darcy Friction Factor (VBA)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function f(e, D, Re) | |
' Returns: Darcy friction factor | |
' Parameters: | |
' e: absolute roughness | |
' D: duct diameter | |
' Re: Reynold's number | |
A = -2 * Log10(e / D / 3.7 + 12 / Re) | |
B = -2 * Log10(e / D / 3.7 + 2.51 * A / Re) | |
C = -2 * Log10(e / D / 3.7 + 2.51 * B / Re) | |
f = (A - (B - A) ^ 2 / (C - 2 * B + A)) ^ -2 | |
End Function | |
Private Function Log10(x) | |
Log10 = Log(x) / Log(10) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment