About the examples

The following examples only cover open channel flow problems using the Gauckler-Manning-Strickler equation (commonly called Manning’s equation) [Wikimedia] to calculate the missing parameters and the critical depth.

Other examples using the Gauckler-Manning-Strickler equation can be found in Open Channel Flow Examples using the Gauckler-Manning-Strickler equation written by the author.


Examples

rectangular cross-section

install.load::load_package("iemisc", "iemiscdata", "rivr")
# load needed packages using the load_package function from the install.load
# package (it is assumed that you have already installed these packages)


# 1) Practice Problem 14.10 from Mott (page 391-392)

# What is the Q (discharge) for this cross-section?

# See nchannel in iemiscdata for the Manning's n table that the following
# example uses Use the normal Manning's n value for Natural streams - minor
# streams (top width at floodstage < 100 ft), Lined or Constructed Channels,
# Concrete, and unfinished.

# The 1st heading is 'Manning's n for Channels' The 2nd heading is 'Natural
# streams - minor streams (top width at floodstage < 100 ft)' The 3rd
# heading is 'Lined or Constructed Channels,' The 4th heading is 'Concrete'
# The 5th heading is 'unfinished'


data(nchannel)
# load the data set nchannel from iemiscdata

nlocation <- grep("unfinished", nchannel$"Type of Channel and Description")
# search for the term 'unfinished' in the 'Type of Channel and Description'
# column in the nchannel data set

nlocation
## [1] 72
n <- nchannel[nlocation, 3]  # 3 for column 3 - Normal n
# the value of n will be found in column 3 at the location specified by
# nlocation

n
## [1] 0.017
Q <- Manningrect(b = 3.5, y = 2, Sf = 0.1/100, n = n, units = "SI")
## 
## Flow is NOT in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is not acceptable to use.
## 
## 
## This is subcritical flow.
# b = 3.5 m, y = 2 m, Sf = 0.1 percent m/m, n = 0.017, units = SI units This
# will solve for Q since it is missing and Q will be in m^3/s

# Note: Q (discharge), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

Q
## $Q
## [1] 12.4358
## 
## $V
## [1] 1.776542
## 
## $A
## [1] 7
## 
## $P
## [1] 7.5
## 
## $R
## [1] 0.9333333
## 
## $B
## [1] 3.5
## 
## $D
## [1] 2
## 
## $Re
## [1] 1651.825
## 
## $Fr
## [1] 0.401144
# What is the critical depth for this given discharge?

critical_depth(Q$Q, 2, 9.80665, 3.5, 0)
## [1] 1.087836
# 2) Problem 1 from Hauser (page 88)

# What is the Sf (slope) for this cross-section?

Sf <- Manningrect(Q = 6.25 * 8 * 14.9, b = 8, y = 6.25, n = 0.01, units = "Eng")
## 
## Flow IS in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is acceptable to use.
## 
## 
## This is supercritical flow.
# Q = 6.25 ft * 8 ft * 14.9 ft/sec, b = 8 ft, y = 6.25 ft, n = 0.01, units =
# Eng units This will solve for Sf since it is missing and Sf will be in
# ft/ft

# Note: Sf (slope), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

Sf
## $Sf
## [1] 0.003062629
## 
## $V
## [1] 14.9
## 
## $A
## [1] 50
## 
## $P
## [1] 20.5
## 
## $R
## [1] 2.439024
## 
## $B
## [1] 8
## 
## $D
## [1] 6.25
## 
## $Re
## [1] 3233750
## 
## $Fr
## [1] 1.050737
# What is the critical depth for this given discharge?

critical_depth(6.25 * 8 * 14.9, 6.25, 9.80665 * (3937/1200), 8, 0)
## [1] 6.459654



trapezoidal cross-section

install.load::load_package("iemisc", "iemiscdata", "rivr")
# load needed packages using the load_package function from the install.load
# package (it is assumed that you have already installed these packages)


# 3) Practice Problem 14.17 from Mott (page 392)

# What is the y (flow depth) for this cross-section?

# See nchannel in iemiscdata for the Manning's n table that the following
# example uses Use the normal Manning's n value for Natural streams - minor
# streams (top width at floodstage < 100 ft), Lined or Constructed Channels,
# Concrete, and unfinished.

# The 1st heading is 'Manning's n for Channels' The 2nd heading is 'Natural
# streams - minor streams (top width at floodstage < 100 ft)' The 3rd
# heading is 'Lined or Constructed Channels,' The 4th heading is 'Concrete'
# The 5th heading is 'unfinished'

data(nchannel)
# load the data set nchannel from iemiscdata

nlocation <- grep("unfinished", nchannel$"Type of Channel and Description")
# search for the term 'unfinished' in the 'Type of Channel and Description'
# column in the nchannel data set

nlocation
## [1] 72
n <- nchannel[nlocation, 3]  # 3 for column 3 - Normal n
# the value of n will be found in column 3 at the location specified by
# nlocation

n
## [1] 0.017
y <- Manningtrap(Q = 15, b = 3, m = 1/tand(40), Sf = 0.1/100, n = n, units = "SI")
## 
## Flow is NOT in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is not acceptable to use.
## 
## 
## This is subcritical flow.
# Q = 15, b = 3 m, m = 1 / tand(40), Sf = 0.1 percent m/m, n = 0.017, units
# = SI units This will solve for y since it is missing and y will be in m

# Note: y (flow depth), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

y
## $y
## [1] 1.631874
## 
## $V
## [1] 1.858903
## 
## $A
## [1] 8.069276
## 
## $P
## [1] 8.07749
## 
## $R
## [1] 0.9989831
## 
## $B
## [1] 6.889583
## 
## $D
## [1] 1.171228
## 
## $Re
## [1] 1849.978
## 
## $Fr
## [1] 0.5484986
# What is the critical depth for this given discharge?

critical_depth(15, y$y, 9.80665, 3, 1/tand(40))
## [1] 1.16226
# 4) Example 2 from FHWA

# What is the y (flow depth) for this cross-section?

y <- Manningtrap(Q = 150, b = 4, m = 2, Sf = 2/100, n = 0.03, units = "Eng")
## 
## Flow IS in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is acceptable to use.
## 
## 
## This is supercritical flow.
# Q = 150 cfs, b = 4 ft, m = 2, Sf = 2/100 ft/ft, n = 0.030, units = Eng
# units This will solve for y since it is missing and y will be in ft

# Note: y (flow depth), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

y
## $y
## [1] 2.152071
## 
## $V
## [1] 8.393437
## 
## $A
## [1] 17.87111
## 
## $P
## [1] 13.62436
## 
## $R
## [1] 1.311703
## 
## $B
## [1] 12.60828
## 
## $D
## [1] 1.41741
## 
## $Re
## [1] 979668.9
## 
## $Fr
## [1] 1.24291
# What is the critical depth for this given discharge?

critical_depth(150, y$y, 9.80665 * (3937/1200), 4, 2)
## [1] 2.40582



triangular cross-section

install.load::load_package("iemisc", "rivr")
# load needed packages using the load_package function from the install.load
# package (it is assumed that you have already installed these packages)


# 5) Problem 17 from Hauser (page 89)

# What is the Q (discharge) for this cross-section?

Q <- Manningtri(y = 6, m = 4, Sf = 0.006, n = 0.025, units = "Eng")
## 
## Flow IS in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is acceptable to use.
## 
## 
## This is subcritical flow.
# y = 6 ft, m = 4 ft/ft, Sf = 0.006 ft/ft, n = 0.025, units = Eng units This
# will solve for Q since it is missing and Q will be in ft^3/s

# Note: Q (discharge), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

Q
## $Q
## [1] 1351.443
## 
## $V
## [1] 9.385019
## 
## $A
## [1] 144
## 
## $P
## [1] 49.47727
## 
## $R
## [1] 2.910428
## 
## $B
## [1] 48
## 
## $D
## [1] 3
## 
## $Re
## [1] 2430502
## 
## $Fr
## [1] 0.9552611
# What is the critical depth for this given discharge?

critical_depth(Q$Q, 6, 9.80665 * (3937/1200), 0, 4)
## [1] 5.89115
# 6) Example 2 from FHWA

# What is the y (flow depth) for this cross-section?

y <- Manningtri(Q = 150, m = 2, Sf = 2/100, n = 0.03, units = "Eng")
## 
## Flow IS in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is acceptable to use.
## 
## 
## This is supercritical flow.
# Q = 150 cfs, m = 2, Sf = 2/100 ft/ft, n = 0.030, units = Eng units This
# will solve for y since it is missing and y will be in ft

# Note: y (flow depth), velocity (V), area (A), wetted perimeter (P), R
# (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are
# returned as an R list

y
## $y
## [1] 2.975079
## 
## $V
## [1] 8.473527
## 
## $A
## [1] 17.70219
## 
## $P
## [1] 13.30496
## 
## $R
## [1] 1.330496
## 
## $B
## [1] 11.90032
## 
## $D
## [1] 1.48754
## 
## $Re
## [1] 1003187
## 
## $Fr
## [1] 1.224835
# What is the critical depth for this given discharge?

critical_depth(150, y$y, 9.80665 * (3937/1200), 4, 2)
## [1] 2.40582



circular cross-section

library(iemisc)

# 7) Modified Practice Problem 14.32/14.34 from Mott (page 393)

# What is the Q (discharge) for this cross-section?

Q <- Manningcirc(d = 375/1000, y = 225/1000, Sf = 0.12/100, n = 0.015, units = "SI")
## 
## Flow is NOT in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is not acceptable to use.
## 
## 
## This is subcritical flow.
# d = 375/1000 m, y = 225/1000 m, Sf = 0.12/100 m/m, n = 0.015, units = SI units
# This will solve for Q since it is missing and Q will be in m^3/s

# Note: Q (discharge), velocity (V), area (A), wetted perimeter (P), R (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are returned as an R list

Q
## $Q
## [1] 0.03536432
## 
## $V
## [1] 0.5111079
## 
## $A
## [1] 0.06919149
## 
## $P
## [1] 0.6645578
## 
## $R
## [1] 0.1041166
## 
## $Re
## [1] 53.01321
## 
## $Fr
## [1] 0.3761052
# 8) Problem 18 from Hauser (page 89)

# What is the Q (discharge) for this cross-section?

Q <- Manningcirc(d = 10/12, y = 3/12, Sf = 2/100, n = 0.025, units = "Eng")
## 
## Flow IS in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is acceptable to use.
## 
## 
## This is subcritical flow.
# d = 10/12 ft, y = 3/12 ft, Sf = 2/100 ft/ft, n = 0.025, units = Eng units
# This will solve for Q since it is missing and Q will be in ft

# Note: Q (discharge), velocity (V), area (A), wetted perimeter (P), R (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are returned as an R list

Q
## $Q
## [1] 0.3155138
## 
## $V
## [1] 2.292697
## 
## $A
## [1] 0.1376169
## 
## $P
## [1] 0.9660662
## 
## $R
## [1] 0.1424508
## 
## $Re
## [1] 29061.33
## 
## $Fr
## [1] 0.9522204



parabolic cross-section

library(iemisc)

# 9) Modified Exercise 4.3 from Sturm (page 153)

# What is the B1 ("bank-full width") for this cross-section?

B1 <- Manningpara(Q = 32.2, y = 8, y1 = 5.1, Sf = 0.0092, n = 0.025, units = "SI")
## 
## Flow is NOT in the rough turbulent zone so the Gauckler-Manning-Strickler equation
##  is not acceptable to use.
## 
## 
## This is subcritical flow.
# Q = 32.2 m^3/s, y = 8 m, y1 = 5.1 m, Sf = 0.0092 m/m, n = 0.025, units = SI units
# This will solve for B1 since it is missing and B1 will be in m

# Note: B1 ("bank-full width"), velocity (V), area (A), wetted perimeter (P), R (hydraulic radius), Re (Reynolds number), and Fr (Froude number) are returned as an R list

B1
## $B1
## [1] 0.982228
## 
## $V
## [1] 4.907778
## 
## $A
## [1] 6.561014
## 
## $P
## [1] 16.10527
## 
## $R
## [1] 0.407383
## 
## $B
## [1] 1.23019
## 
## $D
## [1] 5.333333
## 
## $Re
## [1] 1991.771
## 
## $Fr
## [1] 0.6786177



Works Cited

Barbara A. Hauser, Practical Hydraulics Handbook, Second Edition, Boca Raton, Florida: CRC Press, Inc., 1996, page 88-89.

Robert L. Mott and Joseph A. Untener, Applied Fluid Mechanics, Seventh Edition, New York City, New York: Pearson, 2015, page 392-393.

Terry W. Sturm, Open Channel Hydraulics, 2nd Edition, New York City, New York: The McGraw-Hill Companies, Inc., 2010, page 153.

U.S. Department of Transportation Federal Highway Administration (FHWA), “Design Charts for Open-Channel Flow HDS 3”, August 1961, http://www.fhwa.dot.gov/engineering/hydraulics/pubs/hds3.pdf.

Wikimedia Foundation, Inc. Wikipedia, 5 May 2016, “Gravitational acceleration”, https://en.wikipedia.org/wiki/Gravitational_acceleration.

Wikimedia Foundation, Inc. Wikipedia, 26 November 2015, “Manning formula”, https://en.wikipedia.org/wiki/Manning_formula.

LS0tCnRpdGxlOiAiaWVtaXNjOiBPcGVuIENoYW5uZWwgRmxvdyBFeGFtcGxlcyBpbnZvbHZpbmcgR2VvbWV0cmljIFNoYXBlcyIKYXV0aG9yOiAiSXJ1Y2thIEVt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