Note: If you wish to replicate the R code below, then you will need to copy and paste the following commands in R first (to make sure you have all the packages and their dependencies):

install.packages(c("install.load", "sessioninfo", "iemisc", "units", "IAPWS95", 
    "fpCompare", "assertthat", "flextable"))
# install the packages and their dependencies, including the extra system
# dependencies (this process may take a while depending on the number of
# dependencies)



# load the required packages and provide the session information
install.load::load_package("iemisc", "units", "IAPWS95", "fpCompare", "assertthat", 
    "flextable")
# load needed packages using the load_package function from the install.load
# package (it is assumed that you have already installed these packages)


import::from(pracma, newtonRaphson)
# import newtonRaphson from the pracma package


sessinfo <- setDT(sessioninfo::session_info()$packages)
sessinfo <- sessinfo[, -c("ondiskversion", "loadedpath", "path", "attached", 
    "is_base", "md5ok", "library")]
setkey(sessinfo, package)
sessinfo
##          package loadedversion       date         source
##  1:       CHNOSZ         1.3.2 2019-04-21 CRAN (R 3.6.0)
##  2:      IAPWS95         1.1.0 2018-06-18 CRAN (R 3.6.0)
##  3:           R6         2.4.0 2019-02-14 CRAN (R 3.6.0)
##  4:         Rcpp         1.0.1 2019-03-17 CRAN (R 3.6.0)
##  5:   assertthat         0.2.1 2019-03-21 CRAN (R 3.6.0)
##  6:    base64enc         0.1-3 2015-07-28 CRAN (R 3.6.0)
##  7:          cli         1.1.0 2019-03-19 CRAN (R 3.6.0)
##  8:       crayon         1.3.4 2017-09-16 CRAN (R 3.6.0)
##  9:   data.table        1.11.8 2018-09-30 CRAN (R 3.6.0)
## 10:       digest        0.6.18 2018-10-10 CRAN (R 3.6.0)
## 11:     evaluate          0.13 2019-02-12 CRAN (R 3.6.0)
## 12:    flextable         0.5.4 2019-05-14 CRAN (R 3.6.0)
## 13:      formatR           1.6 2019-03-05 CRAN (R 3.6.0)
## 14:    fpCompare         0.2.2 2018-06-12 CRAN (R 3.6.0)
## 15:      gdtools         0.1.8 2019-04-02 CRAN (R 3.6.0)
## 16:         glue         1.3.1 2019-03-12 CRAN (R 3.6.0)
## 17:       gsubfn           0.7 2018-03-16 CRAN (R 3.6.0)
## 18:    htmltools         0.3.6 2017-04-28 CRAN (R 3.6.0)
## 19:       iemisc         0.9.7 2018-05-16 CRAN (R 3.6.0)
## 20:   iemiscdata         0.6.1 2016-07-22 CRAN (R 3.6.0)
## 21:       import         1.1.0 2015-06-22 CRAN (R 3.6.0)
## 22: install.load         1.2.1 2016-07-12 CRAN (R 3.6.0)
## 23:        knitr          1.22 2019-03-08 CRAN (R 3.6.0)
## 24:      lattice       0.20-38 2018-11-04 CRAN (R 3.6.0)
## 25:     listless         0.0-2 2016-08-12 CRAN (R 3.6.0)
## 26:     magrittr           1.5 2014-11-22 CRAN (R 3.6.0)
## 27:      officer         0.3.4 2019-04-30 CRAN (R 3.6.0)
## 28:       pillar         1.4.0 2019-05-11 CRAN (R 3.6.0)
## 29:    pkgconfig         2.0.2 2018-08-16 CRAN (R 3.6.0)
## 30:       pracma         2.2.5 2019-04-09 CRAN (R 3.6.0)
## 31:        proto         1.0.0 2016-10-29 CRAN (R 3.6.0)
## 32:        purrr         0.3.2 2019-03-15 CRAN (R 3.6.0)
## 33:        rgdal        1.2-20 2018-05-07 CRAN (R 3.6.0)
## 34:        rlang         0.3.4 2019-04-07 CRAN (R 3.6.0)
## 35:    rmarkdown          1.12 2019-03-14 CRAN (R 3.6.0)
## 36:  sessioninfo         1.1.1 2018-11-05 CRAN (R 3.6.0)
## 37:           sp         1.3-1 2018-06-05 CRAN (R 3.6.0)
## 38:      stringi         1.4.3 2019-03-12 CRAN (R 3.6.0)
## 39:      stringr         1.4.0 2019-02-10 CRAN (R 3.6.0)
## 40:       testit           0.9 2018-12-05 CRAN (R 3.6.0)
## 41:       tibble         2.1.1 2019-03-16 CRAN (R 3.6.0)
## 42:        tidyr         0.8.3 2019-03-01 CRAN (R 3.6.0)
## 43:        units         0.6-2 2018-12-05 CRAN (R 3.6.0)
## 44:         uuid         0.1-2 2015-07-28 CRAN (R 3.6.0)
## 45:        withr         2.1.2 2018-03-15 CRAN (R 3.6.0)
## 46:         xfun           0.6 2019-04-02 CRAN (R 3.6.0)
## 47:         xml2         1.2.0 2018-01-24 CRAN (R 3.6.0)
## 48:         yaml         2.2.0 2018-07-25 CRAN (R 3.6.0)
## 49:          zip         2.0.1 2019-03-11 CRAN (R 3.6.0)
## 50:          zoo         1.8-5 2019-03-21 CRAN (R 3.6.0)
##          package loadedversion       date         source



Problem Statement

Problem 174 [Lindeburg Practice]

“1.5 ft3/sec (40 L/s) of 70°F (20°C) water flows through 1200 ft (355 m) of 6 in (nominal) diameter new schedule-40 steel pipe. What is the friction loss?”

From Appendix 16.B Dimensions of Welded and Seamless Steel Pipe [Lindeburg Manual], the internal diameter for a 6 inch nominal diameter new schedule-40 steel pipe is 0.5054 ft with an internal area of 0.2006 ft2.

From Table 17.2 Values of Specific Roughness for Common Pipe Materials [Lindeburg Manual], the specific roughness, \(\epsilon\), for a steel pipe is 0.0002 (\(2e-04\)) ft.



Solution in US Customary units

## [1] 1.5
## [1] 70
## [1] 1200
## 9.80665 [m/s^2]
## 32.17398 [ft/s^2]
## 70 [degree_F]
## 70 [degree_F]
## 294.2611 [K]
## 997.926216 [kg/m^3]
## 62.2984985 [lbm/ft^3]
## 9.76973797e-07 [m^2/s]
## 1.05160584e-05 [ft^2/s]
## 0.000974947765 [Pa*s]
## 2.03622074e-05 [lbf*s/ft^2]
## 2e-04 [ft]
## 0.5054 [ft]
## 0.000395726157 [1]
## 0.200613593 [ft^2]
## 1.5 [ft^3/s]
## 7.47706063 [ft/s]
## [1] 359346.277
## 1200 [ft]
# Darcy friction factor (f) for steel pipe Moody equation
fr2_Eng <- f2(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Romeo, et. al. equation
fr3_Eng <- f3(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Žarko Ćojbašića and Dejan Brkić equation
fr4_Eng <- f4(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Colebrook-White equation
fr5_Eng <- f5(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Colebrook-White equation from Didier Clamond
colebrook_Eng <- colebrook(Re_Eng, K = drop_units(rel_roughness_Eng))

# Swamee-Jaine equation
fr6_Eng <- f6(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Zigrang-Sylvester equation
fr7_Eng <- f7(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)

# Vatankhah equation
fr8_Eng <- f8(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng)


# friction loss for steel pipe
hf_Eng1 <- (f2(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng2 <- (f3(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng3 <- (f4(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng4 <- (f5(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng5 <- (colebrook(Re_Eng, K = drop_units(rel_roughness_Eng)) * drop_units(L_Eng) * 
    drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng6 <- (f6(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng7 <- (f7(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))

hf_Eng8 <- (f8(eps = drop_units(epsilon_Eng), D = drop_units(Di_Eng), Re = Re_Eng) * 
    drop_units(L_Eng) * drop_units(V_Eng)^2)/(2 * drop_units(Di_Eng) * drop_units(g_Eng))


# result table
result_table_Eng <- data.table(V1 = c("Moody equation", "Romeo, et. al. equation", 
    "Žarko Ćojbašića and Dejan Brkić equation", "Colebrook-White equation", 
    "Colebrook-White equation from Didier Clamond", "Swamee-Jaine equation", 
    "Zigrang-Sylvester equation", "Vatankhah equation"), V2 = c(fr2_Eng, fr3_Eng, 
    fr4_Eng, fr5_Eng, colebrook_Eng, fr6_Eng, fr7_Eng, fr8_Eng), V3 = c(hf_Eng1, 
    hf_Eng2, hf_Eng3, hf_Eng4, hf_Eng5, hf_Eng6, hf_Eng7, hf_Eng8))

setnames(result_table_Eng, c("Darcy friction factor equation", "Darcy friction factor (f) for steel pipe", 
    "Friction loss for steel pipe over total length"))

prettyEng <- flextable(result_table_Eng)
colkeys <- c("Darcy friction factor equation", "Darcy friction factor (f) for steel pipe", 
    "Friction loss for steel pipe over total length")
prettyEng <- colformat_num(x = prettyEng, col_keys = colkeys, big.mark = ",", 
    digits = 4, na_str = "N/A")
autofit(prettyEng)

Darcy friction factor equation

Darcy friction factor (f) for steel pipe

Friction loss for steel pipe over total length

Moody equation

0.0176

36.3451

Romeo, et. al. equation

0.0151

31.0821

Žarko Ćojbašića and Dejan Brkić equation

0.0151

31.0567

Colebrook-White equation

0.0174

35.7912

Colebrook-White equation from Didier Clamond

0.0174

35.7912

Swamee-Jaine equation

0.0175

36.0133

Zigrang-Sylvester equation

0.0151

31.0551

Vatankhah equation

0.0173

35.7780


Michael Lindeburg used the Moody Diagram to determine that f is 0.0174 and calculated the head loss to be 35.9 feet.





Solution in SI units

## 21.1111111 [°C]
## 294.261111 [K]
## [1] TRUE
## 2e-04 [ft]
## 6.096e-05 [m]
## 0.5054 [ft]
## 0.15404592 [m]
## 0.000395726157 [1]
## 0.0186376127 [m^2]
## 42.4752699 [L/s]
## 2279.00808 [L/m^2/s]
## 2.27900808 [m/s]
## 9.76973797e-07 [m^3*Pa*s/kg]
## 9.76973797e-07 [m^2/s]
## [1] TRUE
## [1] 359346.277
## 1200 [ft]
## 365.76 [m]
# Darcy friction factor (f) for steel pipe Moody equation
fr2_SI <- f2(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Romeo, et. al. equation
fr3_SI <- f3(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Žarko Ćojbašića and Dejan Brkić equation
fr4_SI <- f4(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Colebrook-White equation
fr5_SI <- f5(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Colebrook-White equation from Didier Clamond
colebrook_SI <- colebrook(Re_SI, K = drop_units(rel_roughness_SI))

# Swamee-Jaine equation
fr6_SI <- f6(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Zigrang-Sylvester equation
fr7_SI <- f7(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)

# Vatankhah equation
fr8_SI <- f8(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI)


# friction loss for steel pipe
hf_SI1 <- (f2(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI2 <- (f3(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI3 <- (f4(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI4 <- (f5(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI5 <- (colebrook(Re_SI, K = drop_units(rel_roughness_SI)) * drop_units(L_SI) * 
    drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI6 <- (f6(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI7 <- (f7(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))

hf_SI8 <- (f8(eps = drop_units(epsilon_SI), D = drop_units(Di_SI), Re = Re_SI) * 
    drop_units(L_SI) * drop_units(V_SI)^2)/(2 * drop_units(Di_SI) * drop_units(g_SI))


# result table
result_table_SI <- data.table(V1 = c("Moody equation", "Romeo, et. al. equation", 
    "Žarko Ćojbašića and Dejan Brkić equation", "Colebrook-White equation", 
    "Colebrook-White equation from Didier Clamond", "Swamee-Jaine equation", 
    "Zigrang-Sylvester equation", "Vatankhah equation"), V2 = c(fr2_SI, fr3_SI, 
    fr4_SI, fr5_SI, colebrook_SI, fr6_SI, fr7_SI, fr8_SI), V3 = c(hf_SI1, hf_SI2, 
    hf_SI3, hf_SI4, hf_SI5, hf_SI6, hf_SI7, hf_SI8))

setnames(result_table_SI, c("Darcy friction factor equation", "Darcy friction factor (f) for steel pipe", 
    "Friction loss for steel pipe over total length"))

prettySI <- flextable(result_table_SI)
colkeys <- c("Darcy friction factor equation", "Darcy friction factor (f) for steel pipe", 
    "Friction loss for steel pipe over total length")
prettySI <- colformat_num(x = prettySI, col_keys = colkeys, big.mark = ",", 
    digits = 4, na_str = "N/A")
autofit(prettySI)

Darcy friction factor equation

Darcy friction factor (f) for steel pipe

Friction loss for steel pipe over total length

Moody equation

0.0176

11.0780

Romeo, et. al. equation

0.0141

8.8682

Žarko Ćojbašića and Dejan Brkić equation

0.0141

8.8596

Colebrook-White equation

0.0174

10.9091

Colebrook-White equation from Didier Clamond

0.0174

10.9091

Swamee-Jaine equation

0.0175

10.9768

Zigrang-Sylvester equation

0.0141

8.8524

Vatankhah equation

0.0173

10.9051


Michael Lindeburg used the Moody Diagram to determine that f is 0.0175 and calculated the head loss to be 9.45 meters.





Works Cited

Michael R. Lindeburg, PE, Civil Engineering Reference Manual for the PE Exam, Twelfth Edition, Belmont, California: Professional Publications, Inc., 2011, page 17-4, 17-7, and A-22.

Michael R. Lindeburg, PE, Practice Problems for the Civil Engineering PE Exam: A Companion to the “Civil Engineering Reference Manual”, Twelfth Edition, Belmont, California: Professional Publications, Inc., 2011, pages 17-1 and 17-8 - 17-9.

The NIST Reference on Constants, Units, and Uncertainty, Fundamental Constants Data Center of the NIST Physical Measurement Laboratory, “standard acceleration of gravity g_n”, https://physics.nist.gov/cgi-bin/cuu/Value?gn.

Wikimedia Foundation, Inc. Wikipedia, 15 May 2019, “Conversion of units”, https://en.wikipedia.org/wiki/Conversion_of_units.



LS0tCnRpdGxlOiAiQ2FsY3VsYXRpbmcgdGhlIEZyaWN0aW9uIExvc3MgZm9yIGEgTmV3IFN0ZWVsIFBpcGUiCmF1dGhvcjogIklydWNrYSBFbWJyeSwgRS5JLlQuIChFY29DMlMpIgpkYXRlOiAiYHIgU3lzLkRhdGUoKWAiCm91dHB1dDoKICBodG1sX2RvY3VtZW50OgogICAgc2VsZl9jb250YWluZWQ6IG5vCiAgICBtYXRoamF4OiBkZWZhdWx0Ci0tLQoKPGJyIC8+CgpOb3RlOiBJZiB5b3Ugd2lzaCB0byByZXBsaWNhdGUgdGhlIFIgY29kZSBiZWxvdywgdGhlbiB5b3Ugd2lsbCBuZWVkIHRvIGNvcHkgYW5kIHBhc3RlIHRoZSBmb2x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