colebrook | R Documentation |
This function "provides the fast, accurate, and robust computation of the Colebrook-White equation" to determine the "Darcy-Weisbach friction factor F". This method is "more efficient than the solution of the Colebrook equation via the Lambert W-function, or the simple approximations." The solution is accurate to "around machine precision for all R > 3 and for all 0 <= K, i.e. in an interval exceeding all values of physical interest." Reference: Clamond
colebrook(Re, K = NULL)
Re |
numeric vector that contains the Reynolds number [dimensionless], which should be >= 2300. Reference: Clamond |
K |
numeric vector that contains the "equivalent sand roughness height sand roughness height (material specific roughness) divided by the hydraulic diameters", if known. If not known, the default value is 0. Reference: Clamond |
Colebrook-White equation is expressed as
\frac{1}{\sqrt{F}} = -2 * log10{\frac{K}{3.7} + \frac{2.51}{R * \sqrt{F}}}
Darcy-Weisbach friction factor
Equivalent sand roughness height (material specific roughness) divided by the hydraulic diameters
the Reynolds' number (dimensionless)
F Return a numeric vector containing the Darcy-Weisbach friction factor. Reference: Clamond
Didier Clamond (colebrook MATLAB function), Irucka Embry (colebrook R function)
Steven C. Chapra, Applied Numerical Methods with MATLAB for Engineers and Scientists, Second Edition, Boston, Massachusetts: McGraw-Hill, 2008, pages 157-161.
Didier Clamond, "Efficient resolution of the Colebrook equation", Ind. Eng. Chem. Res., 2009, 48 (7), pages 3665-3671 https://arxiv.org/abs/0810.5564 and https://math.univ-cotedazur.fr/~didierc/DidPublis/ICR_2009.pdf
Re1
, Re2
, Re3
, Re4
for the Reynolds number and
f1
, f2
, f3
, f4
, f5
, f6
, f7
,
and f8
for the Darcy friction factor
install.load::load_package("iemisc", "units")
# Example 1 (Reference: Clamond)
F <- colebrook(c(3e3, 7e5, 1e100), 0.01)
F
# Example 2
# 'Determine f for air flow through a smooth, thin tube. The parameters are
# rho = 1.23 kg/m^3, mu = 1.79 x 10^-5 N * s/m^2, D = 0.005 m, V = 40 m/s
# and epsilon = 0.0015 mm.' Reference: Chapra 158
# Determine R (the Reynolds number) first using the following parameters:
rho <- 1.23 # kg/m^3
V <- 40 # m/s
D <- 0.005 # m
mu <- 1.79 * 10^-5 # N * s/m^2
eps <- 0.0015 # mm
eps <- set_units(eps, "mm")
units(eps) <- make_units(m)
Re <- rho * V * D / mu
K <- drop_units(eps) / D
# with K
fr1 <- colebrook(Re, K); fr1
# without K
fr2 <- colebrook(Re); fr2
# The solution on Chapra 159 and 160 is 'f = 0.02896781017144' which was
# computed using the Newton-Raphson method, Swamee-Jain approximation
# equation, and MATLAB's fzero function.
# Thus,
fm <- 0.02896781017144
# Compute the relative error between fr[1 and 2] (this function) and fm (Chapra).
relerror(fr1, fm)
relerror(fr2, fm)
# compare the relative error with and without K
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.