---
title: "iemiscdata: Examples Using Manning&#8217;s n"
date: today
date-format: D MMMM YYYY  
author:
  - name: Irucka Embry
    affiliation: 
      - name: EcoC&sup2;S
        city: Nashville
        state: TN
        url: https://www.ecoccs.com
    degrees:
      - EIT
      - ME
lang: en-US
dir: ltr
format:
  pdf:
    pdf-standard: a-3u
    toc: true
    toc-title: Table of Contents
    papersize: letter
    margin-left: 0.79in
    margin-right: 0.79in
    mainfont: FreeSerif
    sansfont: FreeSans
    monofont: FreeMono
    code-line-numbers: true
    syntax-highlighting: kate
    colorlinks: true
    fontsize: 12pt
    author-meta: "Irucka Embry, Eco-Creative Consulting Services, EcoC^2^S"
vignette: >
  %\VignetteIndexEntry{iemiscdata Examples Using Manning's n}
  %\VignetteEngine{quarto::pdf}
  %\VignetteEncoding{UTF-8}
---

\bigskip

# Examples

The following examples show how to locate Manning&#8217;s n using the nchannel, npartfull, nmetalpipe, and nsheetflow tables provided in this package.  

The examples make more sense if you have familiarized yourself with the nchannel, npartfull, and nmetalpipe tables. There are instructions to view the tables, as a .pdf, in the [View-PDF-table-vignette](<https://CRAN.R-project.org/package=iemiscdata/vignettes/View-PDF-table-vignette.html>).  

\bigskip
\bigskip

# Load the required packages

```{r}
#| warning: false
#| message: false
#| tidy: true
install.load::load_package("iemiscdata", "data.table", "iemisc", "rivr", "units")
# load needed packages using the load_package function from the install.load package (it is assumed that you have already installed these packages)
```

\bigskip
\bigskip

# Example 1 (nchannel)

What is the maximum Manning&#8217;s n value for a channel that has the following classification: &ldquo;Natural streams - minor streams (top width at floodstage < 100 ft), Mountain streams, no vegetation in channel, banks usually steep, trees and brush along banks submerged at high stages and bottom: gravels, cobbles, and few boulders?&rdquo;  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true
# Use grep to find the row number matching the given description
# Use nchannel$"Type of Channel and Description" to select the column to search through
# Use nchannel[nlocation, 4] to select the row number from nlocation and column 4
# Similar steps are performed for each of these examples


# 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 "Mountain streams, no vegetation in channel, banks usually steep, trees and brush along banks submerged at high stages"
# The 4th heading is "bottom: gravels, cobbles, and few boulders"

data(nchannel, package = "iemiscdata")

# locate the row where "Type of Channel and Description" == "bottom: gravels, cobbles, and few boulders"
nlocation1 <- nchannel[nchannel$"Type of Channel and Description" %like%
"bottom: gravels, cobbles, and few boulders", ]


n1 <- nlocation1$"Maximum n"

n1
```

\bigskip
\bigskip

# Example 2 (npartfull)

What is the minimum Manning&#8217;s n value for a channel that has the following classification: &ldquo;Closed Conduits Flowing Partly Full, Wood and Stave?&rdquo;  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true


# The 1st heading is "Manning's n for Closed Conduits Flowing Partly Full"
# The 2nd heading is "Wood"
# The 3rd heading is "Stave"

data(npartfull, package = "iemiscdata")

# locate the row where "Type of Conduit and Description" %like% "Stave"
nlocation2 <- npartfull[npartfull$"Type of Conduit and Description" %like% "Stave", ]

n2 <- nlocation2$"Minimum n"

n2
```

\bigskip
\bigskip

# Example 3 (nmetalpipe)

What is the Manning&#8217;s n value for a channel that has the following classification: &ldquo;Corrugated Metal Pipe, Corrugations 6x2 inches and 60" diameter?&rdquo;  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# The 1st heading is "Manning's n for Corrugated Metal Pipe"
# The 2nd heading is "Corrugations 6x2 inches"
# The 3rd heading is "Corrugations 6x2 inches --- 60\"\" diameter"

data(nmetalpipe, package = "iemiscdata")

# locate the row where "Type of Pipe and Diameter and Corrugation Dimension" %like% "Corrugations 6x2 inches --- 60\"\" diameter"
nlocation3 <- nmetalpipe[nmetalpipe$"Type of Pipe and Diameter and Corrugation Dimension"
%like% "Corrugations 6x2 inches --- 60\"\" diameter", ]

n3 <- nlocation3$"n"

n3
```

\bigskip
\bigskip

# Example 4 (nchannel) -- From Reference 1 (compute_profile function)

Example to compute the &ldquo;gradually-varied flow profile of a prismatic channel&rdquo; with these channel conditions used to find Manning&#8217;s n (normal): &ldquo;Natural streams - minor streams (top width at floodstage < 100 ft), Excavated or Dredged Channels, Earth, straight, and uniform, & clean, recently completed.&rdquo;  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# 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 "Excavated or Dredged Channels"
# The 4th heading is "Earth, straight, and uniform"
# The 5th heading is "clean, recently completed"


# Using the data for the M1 profile example in rivr's compute_profile, except for the value of n to find the channel condition

# locate the row where "Type of Channel and Description" == "bottom: gravels, cobbles, and few boulders"
nlocation4 <- nchannel[nchannel$"Type of Channel and Description" %like% "clean, recently completed", ]


n4 <- nlocation4$"Maximum n"

n4


compute_profile(0.001, n4, 250, 2.7, 1.486, 32.2, 100, 0, stepdist = 50, totaldist = 3000)
```

\bigskip
\bigskip

# Example 5

What is the critical y (critical flow depth) for this cross-section (from Example 4)?  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# Let's assume that the channel from Example 4 has a trapezoidal shape with a
# slope of m (see below).

m <- 1 / 0.8390996

critical_y <- Manningtrap_critical(Q = 250, b = 100, m = m, Sf = 0.001, n = n4, units = "Eng",
type = "symmetrical", critical = "accurate", output = "data.table")
```

\bigskip

The critical flow depth is `r units::set_units(as.numeric(critical_y[Parameters ==
"Flow depth (y)", "Critical Value"][[1]]), ft)`.  

\bigskip
\bigskip

# Example 6 (nsheetflow) -- Modified from Example 3-1 of Reference 2

&ldquo;Segment AB: Sheet flow; dense grass; slope (s) = 0.01 ft/ft; and length (L) = 100 ft. Segment BC: Shallow concentrated flow; unpaved; s = 0.01 ft/ft; and L = 1,400 ft. Segment CD: Channel flow; Manning's n = .05; flow area (a) = 27 ft2; wetted perimeter (pw) = 28.2 ft; s = 0.005 ft/ft; and L = 7,300 ft.&rdquo;  

Obtain Manning&#8217;s n for Segment AB.  

\bigskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# Given "dense grass", the table has "Dense grasses"

# locate the row where "Surface description" %like% "Dense grass"
nlocation5 <- nsheetflow[nsheetflow$"Surface description" %like% "Dense grass", ]


n5 <- nlocation5$"n *1"

n5
```

\bigskip
\bigskip

# References

Reference 1  
`rivr`: Steady and Unsteady Open-Channel Flow Computation, <https://CRAN.R-project.org/package=rivr>  

\bigskip

Reference 2  
United States Department of Agriculture Natural Resources Conservation Service Conservation Engineering Division, &ldquo;Urban Hydrology for Small Watersheds Technical Release 55 (TR-55),&rdquo; June 1986, page 3-4, <https://web.archive.org/web/20230810204711/https://directives.sc.egov.usda.gov/OpenNonWebContent.aspx?content=22162.wba> [Recovered with the Internet Archive: Wayback Machine]  

\bigskip
\bigskip

# EcoC^2^S Links

EcoC^2^S Home --- <https://www.ecoccs.com>  
About EcoC^2^S --- <https://www.ecoccs.com/about-ecoc2s.html>  
Services --- <https://www.ecoccs.com/services.html>  
EcoC²S / QUP Shop --- <https://www.ecoccs.com/shopeq/>  
Media --- <https://www.ecoccs.com/media.html>  
Book Search --- <https://www.ecoccs.com/book-search.html>  
R Trainings and Resources provided by EcoC^2^S (Irucka Embry, EIT) --- <https://www.ecoccs.com/rtraining.html>  

\bigskip
\bigskip

# Donations accepted with Liberapay

If you would like to contribute to the continued development of [Irucka Embry&#8217;s R packages](https://www.ecoccs.com/rtraining.html#repos) and/or [Irucka Embry&#8217;s R Examples](https://www.ecoccs.com/rtraining.html#examp), please feel free to donate via the link below:  

[https://liberapay.com/iaembry/donate](https://liberapay.com/iaembry/donate)  

Please feel free to review [Irucka Embry (iaembry)&#8217;s profile](https://liberapay.com/iaembry/) on [Liberapay](https://liberapay.com).  

\bigskip
\bigskip

# Copyright and License

All R code written by Irucka Embry is distributed under the GPL-3 (or later) license, see the [GNU General Public License {GPL} page](https://www.gnu.org/licenses/gpl-3.0.html).  

All written content originally created by Irucka Embry is copyrighted under the Creative Commons Attribution-ShareAlike 4.0 International license. All other written content retains the copyright of the original author(s).  

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/).  
