From 8650d43b4e5d7b7f98e9ab43a27e5ae2ebb2257b Mon Sep 17 00:00:00 2001 From: Michael Koohafkan Date: Thu, 27 Feb 2020 11:59:43 -0800 Subject: [PATCH] regenerated documentation --- NAMESPACE | 2 +- cran-comments.md | 4 +- man/channel_geom.Rd | 76 ++++++------ man/compute_profile.Rd | 156 +++++++++++++------------ man/conveyance.Rd | 56 ++++----- man/critical_depth.Rd | 78 ++++++------- man/demo_shiny.Rd | 52 ++++----- man/froude.Rd | 76 ++++++------ man/normal_depth.Rd | 88 +++++++------- man/rivr-package.Rd | 30 ++--- man/route_wave.Rd | 256 ++++++++++++++++++++++------------------- man/waterolympics.Rd | 76 ++++++------ 12 files changed, 489 insertions(+), 461 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 69b24a9..66eb6b6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2: do not edit by hand +# Generated by roxygen2: do not edit by hand S3method(head,rivr) S3method(plot,rivr) diff --git a/cran-comments.md b/cran-comments.md index 656abfb..b33010d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -7,7 +7,9 @@ a `stringsAsFactors = FALSE` default. ## Test environments * Local Windows 10 install, R 3.6.2 -* Ubuntu 14.04 (on travis-ci), R-oldrel, R-release, R-devel +* Ubuntu 14.04 (on travis-ci), R-oldrel, R-release, R-devel + +(confirmed R-devel on Travis was updated to r77865) ## R CMD check results diff --git a/man/channel_geom.Rd b/man/channel_geom.Rd index a8dace8..29e9d5b 100644 --- a/man/channel_geom.Rd +++ b/man/channel_geom.Rd @@ -1,38 +1,38 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R -\name{channel_geom} -\alias{channel_geom} -\title{Channel geometry} -\usage{ -channel_geom(y, B, SS) -} -\arguments{ -\item{y}{Flow depth [\eqn{L}].} - -\item{B}{Channel bottom width [\eqn{L}].} - -\item{SS}{Channel sideslope [\eqn{L L^{-1}}]. For a rectangular channel, \code{SS = 0}.} -} -\value{ -Named vector: - \item{A}{Flow area [\eqn{L^2}].} - \item{P}{Wetted perimeter [\eqn{L}].} - \item{R}{Hydraulic radius [\eqn{L}].} - \item{dAdy}{Water surface width [\eqn{L}].} - \item{dPdy}{First derivative of wetted perimeter w.r.t. flow depth.} - \item{dRdy}{First derivative of hydraulic radius w.r.t. flow depth.} - \item{DH}{Hydraulic depth [\eqn{L}].} - \item{ybar}{Vertical distance from water surface to centroid of flow area [\eqn{L}].} -} -\description{ -Compute geometry relations for trapezoidal channels. -} -\details{ -Channel geometry relations are routinely calculated in numerical solutions of steady, - gradually-varied and unsteady flows. This function is used extensively by internal - procedures and is made accessible to the user for convenience. -} -\examples{ -channel_geom(1.71, 100, 0) # rectangular channel -channel_geom(5.79, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{channel_geom} +\alias{channel_geom} +\title{Channel geometry} +\usage{ +channel_geom(y, B, SS) +} +\arguments{ +\item{y}{Flow depth [\eqn{L}].} + +\item{B}{Channel bottom width [\eqn{L}].} + +\item{SS}{Channel sideslope [\eqn{L L^{-1}}]. For a rectangular channel, \code{SS = 0}.} +} +\value{ +Named vector: + \item{A}{Flow area [\eqn{L^2}].} + \item{P}{Wetted perimeter [\eqn{L}].} + \item{R}{Hydraulic radius [\eqn{L}].} + \item{dAdy}{Water surface width [\eqn{L}].} + \item{dPdy}{First derivative of wetted perimeter w.r.t. flow depth.} + \item{dRdy}{First derivative of hydraulic radius w.r.t. flow depth.} + \item{DH}{Hydraulic depth [\eqn{L}].} + \item{ybar}{Vertical distance from water surface to centroid of flow area [\eqn{L}].} +} +\description{ +Compute geometry relations for trapezoidal channels. +} +\details{ +Channel geometry relations are routinely calculated in numerical solutions of steady, + gradually-varied and unsteady flows. This function is used extensively by internal + procedures and is made accessible to the user for convenience. +} +\examples{ +channel_geom(1.71, 100, 0) # rectangular channel +channel_geom(5.79, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V +} diff --git a/man/compute_profile.Rd b/man/compute_profile.Rd index af593aa..a52bf2b 100644 --- a/man/compute_profile.Rd +++ b/man/compute_profile.Rd @@ -1,72 +1,84 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/graduallyvariedflow_v2.r -\name{compute_profile} -\alias{compute_profile} -\title{Gradually-varied flow profiles} -\usage{ -compute_profile(So, n, Q, y0, Cm, g, B, SS, z0 = 0, x0 = 0, stepdist, - totaldist) -} -\arguments{ -\item{So}{Channel slope [\eqn{L L^{-1}}].} - -\item{n}{Manning's roughness coefficient.} - -\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} - -\item{y0}{The water depth at the control section [\eqn{L}].} - -\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} - -\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} - -\item{B}{Channel bottom width [\eqn{L}].} - -\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} - -\item{z0}{Elevation reference datum at control section [\eqn{L}]. Default is 0.} - -\item{x0}{Distance reference at control section [\eqn{L}]. Default is 0.} - -\item{stepdist}{The spatial interval used in the Standard step method [\eqn{L}].} - -\item{totaldist}{The total distance upstream (or downstream) to compute the profile [\eqn{L}].} -} -\value{ -data.frame with columns: - \item{x}{Along-channel distance.} - \item{z}{Elevation.} - \item{y}{Flow depth.} - \item{v}{Flow velocity.} - \item{A}{Flow area.} - \item{Sf}{Friction slope.} - \item{E}{Total energy.} - \item{Fr}{Froude Number.} -} -\description{ -Compute the gradually-varied flow profile of a prismatic channel. -} -\details{ -Computes the longitudinal water surface profile of a prismatic - channel using the standard step method by solving the non-linear ODE - \deqn{\frac{dy}{dx} = \frac{S_0 - S_f}{1 - Fr^2}} The standard-step - method operates by stepping along the channel by a constant distance - interval, starting from a cross-section where the flow depth is known - (the control section). The flow depth is computed at the adjacent - cross-section (target section). The computed value at the target is then - used as the basis for computing flow depth at the next cross-section, i.e. - the previous target section becomes the new control section for each step. - A Newton-Raphson scheme is used each step to compute the flow depth and - friction slope. Technically, the average friction slope of the control and - target section is used to compute the flow depth at the target section. -} -\examples{ -# example M1 profile -compute_profile(0.001, 0.045, 250, 2.7, 1.486, 32.2, 100, 0, stepdist = 10, totaldist = 3000) -# example M2 profile -compute_profile(0.001, 0.045, 250, 0.64, 1.486, 32.2, 100, 0, stepdist = 10, totaldist = 3000) -# example S2 profile -compute_profile(0.005, 0.01, 250, 2.65, 1.486, 32.2, 10, 0, stepdist = 10, totaldist = 2000) -# example S3 profile -compute_profile(0.005, 0.01, 250, 0.5, 1.486, 32.2, 10, 0, stepdist = 10, totaldist = 2000) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/graduallyvariedflow_v2.r +\name{compute_profile} +\alias{compute_profile} +\title{Gradually-varied flow profiles} +\usage{ +compute_profile( + So, + n, + Q, + y0, + Cm, + g, + B, + SS, + z0 = 0, + x0 = 0, + stepdist, + totaldist +) +} +\arguments{ +\item{So}{Channel slope [\eqn{L L^{-1}}].} + +\item{n}{Manning's roughness coefficient.} + +\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} + +\item{y0}{The water depth at the control section [\eqn{L}].} + +\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} + +\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} + +\item{B}{Channel bottom width [\eqn{L}].} + +\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} + +\item{z0}{Elevation reference datum at control section [\eqn{L}]. Default is 0.} + +\item{x0}{Distance reference at control section [\eqn{L}]. Default is 0.} + +\item{stepdist}{The spatial interval used in the Standard step method [\eqn{L}].} + +\item{totaldist}{The total distance upstream (or downstream) to compute the profile [\eqn{L}].} +} +\value{ +data.frame with columns: + \item{x}{Along-channel distance.} + \item{z}{Elevation.} + \item{y}{Flow depth.} + \item{v}{Flow velocity.} + \item{A}{Flow area.} + \item{Sf}{Friction slope.} + \item{E}{Total energy.} + \item{Fr}{Froude Number.} +} +\description{ +Compute the gradually-varied flow profile of a prismatic channel. +} +\details{ +Computes the longitudinal water surface profile of a prismatic + channel using the standard step method by solving the non-linear ODE + \deqn{\frac{dy}{dx} = \frac{S_0 - S_f}{1 - Fr^2}} The standard-step + method operates by stepping along the channel by a constant distance + interval, starting from a cross-section where the flow depth is known + (the control section). The flow depth is computed at the adjacent + cross-section (target section). The computed value at the target is then + used as the basis for computing flow depth at the next cross-section, i.e. + the previous target section becomes the new control section for each step. + A Newton-Raphson scheme is used each step to compute the flow depth and + friction slope. Technically, the average friction slope of the control and + target section is used to compute the flow depth at the target section. +} +\examples{ +# example M1 profile +compute_profile(0.001, 0.045, 250, 2.7, 1.486, 32.2, 100, 0, stepdist = 10, totaldist = 3000) +# example M2 profile +compute_profile(0.001, 0.045, 250, 0.64, 1.486, 32.2, 100, 0, stepdist = 10, totaldist = 3000) +# example S2 profile +compute_profile(0.005, 0.01, 250, 2.65, 1.486, 32.2, 10, 0, stepdist = 10, totaldist = 2000) +# example S3 profile +compute_profile(0.005, 0.01, 250, 0.5, 1.486, 32.2, 10, 0, stepdist = 10, totaldist = 2000) +} diff --git a/man/conveyance.Rd b/man/conveyance.Rd index 4d57524..9c9ecdc 100644 --- a/man/conveyance.Rd +++ b/man/conveyance.Rd @@ -1,28 +1,28 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R -\name{conveyance} -\alias{conveyance} -\title{Channel conveyance} -\usage{ -conveyance(n, A, R, Cm) -} -\arguments{ -\item{n}{Manning's roughness coefficient (dimensionless).} - -\item{A}{Flow area [\eqn{L^2}].} - -\item{R}{Hydraulic radius [\eqn{L}].} - -\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} -} -\value{ -The channel conveyance. -} -\description{ -Calculate the channel conveyance. -} -\details{ -Channel conveyance is routinely calculated in numerical solutions of steady, - gradually-varied and unsteady flows. This function is used extensively by internal - procedures and is made accessible to the user for convenience. -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{conveyance} +\alias{conveyance} +\title{Channel conveyance} +\usage{ +conveyance(n, A, R, Cm) +} +\arguments{ +\item{n}{Manning's roughness coefficient (dimensionless).} + +\item{A}{Flow area [\eqn{L^2}].} + +\item{R}{Hydraulic radius [\eqn{L}].} + +\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} +} +\value{ +The channel conveyance. +} +\description{ +Calculate the channel conveyance. +} +\details{ +Channel conveyance is routinely calculated in numerical solutions of steady, + gradually-varied and unsteady flows. This function is used extensively by internal + procedures and is made accessible to the user for convenience. +} diff --git a/man/critical_depth.Rd b/man/critical_depth.Rd index e138b04..1bc0c68 100644 --- a/man/critical_depth.Rd +++ b/man/critical_depth.Rd @@ -1,39 +1,39 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R -\name{critical_depth} -\alias{critical_depth} -\title{Critical depth} -\usage{ -critical_depth(Q, yopt, g, B, SS) -} -\arguments{ -\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} - -\item{yopt}{Initial guess for normal depth [\eqn{L}].} - -\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} - -\item{B}{Channel bottom width [\eqn{L}].} - -\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} -} -\value{ -The critical depth \eqn{y_c} [\eqn{L}]. -} -\description{ -Calculate the critical depth. -} -\details{ -The critical depth is the water depth at which a channel - flow regime will transition from supercritical to subcritical (or vice versa). - Calculation of the critical depth is based on a specific energy formulation, - i.e. \deqn{E = y + z + \frac{Q^2}{2gB^2y^2}} where \eqn{y} is the flow depth, \eqn{z} is - the elevation relative to some datum (assumed to be 0), and the last term - represents kinetic energy. More specifically, the function operates - by finding the point where the derivative of specific energy w.r.t. \eqn{y} is zero, i.e. - \eqn{y = y_c} when \deqn{\frac{dE}{dy} = 1 - \frac{Q^2}{gA^3}\frac{dA}{dy} = 0}. -} -\examples{ -critical_depth(250, 2, 32.2, 100, 0) # rectangular channel -critical_depth(126, 1, 9.81, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{critical_depth} +\alias{critical_depth} +\title{Critical depth} +\usage{ +critical_depth(Q, yopt, g, B, SS) +} +\arguments{ +\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} + +\item{yopt}{Initial guess for normal depth [\eqn{L}].} + +\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} + +\item{B}{Channel bottom width [\eqn{L}].} + +\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} +} +\value{ +The critical depth \eqn{y_c} [\eqn{L}]. +} +\description{ +Calculate the critical depth. +} +\details{ +The critical depth is the water depth at which a channel + flow regime will transition from supercritical to subcritical (or vice versa). + Calculation of the critical depth is based on a specific energy formulation, + i.e. \deqn{E = y + z + \frac{Q^2}{2gB^2y^2}} where \eqn{y} is the flow depth, \eqn{z} is + the elevation relative to some datum (assumed to be 0), and the last term + represents kinetic energy. More specifically, the function operates + by finding the point where the derivative of specific energy w.r.t. \eqn{y} is zero, i.e. + \eqn{y = y_c} when \deqn{\frac{dE}{dy} = 1 - \frac{Q^2}{gA^3}\frac{dA}{dy} = 0}. +} +\examples{ +critical_depth(250, 2, 32.2, 100, 0) # rectangular channel +critical_depth(126, 1, 9.81, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V +} diff --git a/man/demo_shiny.Rd b/man/demo_shiny.Rd index 0916b88..841ee9d 100644 --- a/man/demo_shiny.Rd +++ b/man/demo_shiny.Rd @@ -1,27 +1,27 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/shinydemos.r -\name{demo_shiny} -\alias{demo_shiny} -\title{Shiny Demonstrations} -\usage{ -demo_shiny(ex) -} -\arguments{ -\item{ex}{Example to run.} -} -\description{ -Demonstrate package functionality via Shiny apps -} -\details{ -Demonstrations available: - \code{"gvf"} Gradually-varied flow. -} -\examples{ -\dontrun{ -# get list of available demos -demo_shiny() -# run the gradually-varied flow demo -demo_shiny("gvf") -} - +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/shinydemos.r +\name{demo_shiny} +\alias{demo_shiny} +\title{Shiny Demonstrations} +\usage{ +demo_shiny(ex) +} +\arguments{ +\item{ex}{Example to run.} +} +\description{ +Demonstrate package functionality via Shiny apps +} +\details{ +Demonstrations available: + \code{"gvf"} Gradually-varied flow. +} +\examples{ +\dontrun{ +# get list of available demos +demo_shiny() +# run the gradually-varied flow demo +demo_shiny("gvf") +} + } diff --git a/man/froude.Rd b/man/froude.Rd index 1926c78..58bcb2c 100644 --- a/man/froude.Rd +++ b/man/froude.Rd @@ -1,38 +1,38 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R -\name{froude} -\alias{froude} -\title{Froude Number} -\usage{ -froude(Q, g, A, DH) -} -\arguments{ -\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} - -\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} - -\item{A}{Flow area [\eqn{L^2}].} - -\item{DH}{Hydraulic depth [\eqn{L}].} -} -\value{ -The Froude Number (dimensionless). -} -\description{ -Calculate the Froude Number. -} -\details{ -The Froude number is a dimensionless measure of bulk flow - characteristics that represents the relative importance of inertial - forces and gravitational forces. For open channel flow, the Froude - number of open channel flow is defined as \deqn{Fr = \frac{v}{\sqrt{gD_H}}} - where \eqn{v = \frac{Q}{A}} is the flow velocity, \eqn{g} is the gravitational - acceleration and \eqn{D_H} is the hydraulic depth. The Froude number is related - to the energy state of the flow and can be used to identify flows as - either supercritical (\eqn{Fr < 1}) or subcritical (\eqn{Fr > 1}). -} -\examples{ -froude(250, 32.2, 171, 1.71) # subcritical flow -froude(250, 32.2, 57.9, 0.579) # critical flow -froude(250, 32.2, 45, 0.45) # supercritical flow -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{froude} +\alias{froude} +\title{Froude Number} +\usage{ +froude(Q, g, A, DH) +} +\arguments{ +\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} + +\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} + +\item{A}{Flow area [\eqn{L^2}].} + +\item{DH}{Hydraulic depth [\eqn{L}].} +} +\value{ +The Froude Number (dimensionless). +} +\description{ +Calculate the Froude Number. +} +\details{ +The Froude number is a dimensionless measure of bulk flow + characteristics that represents the relative importance of inertial + forces and gravitational forces. For open channel flow, the Froude + number of open channel flow is defined as \deqn{Fr = \frac{v}{\sqrt{gD_H}}} + where \eqn{v = \frac{Q}{A}} is the flow velocity, \eqn{g} is the gravitational + acceleration and \eqn{D_H} is the hydraulic depth. The Froude number is related + to the energy state of the flow and can be used to identify flows as + either supercritical (\eqn{Fr < 1}) or subcritical (\eqn{Fr > 1}). +} +\examples{ +froude(250, 32.2, 171, 1.71) # subcritical flow +froude(250, 32.2, 57.9, 0.579) # critical flow +froude(250, 32.2, 45, 0.45) # supercritical flow +} diff --git a/man/normal_depth.Rd b/man/normal_depth.Rd index e525bc0..7edd2d8 100644 --- a/man/normal_depth.Rd +++ b/man/normal_depth.Rd @@ -1,44 +1,44 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/RcppExports.R -\name{normal_depth} -\alias{normal_depth} -\title{Normal depth} -\usage{ -normal_depth(So, n, Q, yopt, Cm, B, SS) -} -\arguments{ -\item{So}{Channel slope [\eqn{L L^{-1}}].} - -\item{n}{Manning's roughness coefficient.} - -\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} - -\item{yopt}{Initial guess for normal depth [\eqn{L}].} - -\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} - -\item{B}{Channel bottom width [\eqn{L}].} - -\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} -} -\value{ -The normal depth \eqn{y_n} [\eqn{L}]. -} -\description{ -Calculate the normal (equilibrium) depth using Manning's equation. -} -\details{ -The normal depth is the equilibrium depth of a channel for a given - flow rate, channel slope, geometry and roughness. - Manning's equation is used to calculate the equilibrium depth. Manning's - equation for normal flow is defined as \deqn{Q = \frac{C_m}{n} AR^{2/3}S_0^{1/2}} - where \eqn{Q} is the channel flow, \eqn{S_0} is the channel slope, \eqn{A} is the - cross-sectional flow area, \eqn{R} is the hydraulic depth and \eqn{C_m} is a conversion factor - based on the unit system used. This function uses a Newton-Raphson root-finding approach - to calculate the normal depth, i.e. - \eqn{y = y_n} when \deqn{f(y) = \frac{A^{5/3}}{P^{2/3}} - \frac{nQ}{C_mS_0^{1/2}} = 0}. -} -\examples{ -normal_depth(0.001, 0.045, 250, 3, 1.486, 100, 0) # rectangular channel -normal_depth(0.0008, 0.013, 126, 5, 1, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{normal_depth} +\alias{normal_depth} +\title{Normal depth} +\usage{ +normal_depth(So, n, Q, yopt, Cm, B, SS) +} +\arguments{ +\item{So}{Channel slope [\eqn{L L^{-1}}].} + +\item{n}{Manning's roughness coefficient.} + +\item{Q}{Flow rate [\eqn{L^3 T^{-1}}].} + +\item{yopt}{Initial guess for normal depth [\eqn{L}].} + +\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} + +\item{B}{Channel bottom width [\eqn{L}].} + +\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} +} +\value{ +The normal depth \eqn{y_n} [\eqn{L}]. +} +\description{ +Calculate the normal (equilibrium) depth using Manning's equation. +} +\details{ +The normal depth is the equilibrium depth of a channel for a given + flow rate, channel slope, geometry and roughness. + Manning's equation is used to calculate the equilibrium depth. Manning's + equation for normal flow is defined as \deqn{Q = \frac{C_m}{n} AR^{2/3}S_0^{1/2}} + where \eqn{Q} is the channel flow, \eqn{S_0} is the channel slope, \eqn{A} is the + cross-sectional flow area, \eqn{R} is the hydraulic depth and \eqn{C_m} is a conversion factor + based on the unit system used. This function uses a Newton-Raphson root-finding approach + to calculate the normal depth, i.e. + \eqn{y = y_n} when \deqn{f(y) = \frac{A^{5/3}}{P^{2/3}} - \frac{nQ}{C_mS_0^{1/2}} = 0}. +} +\examples{ +normal_depth(0.001, 0.045, 250, 3, 1.486, 100, 0) # rectangular channel +normal_depth(0.0008, 0.013, 126, 5, 1, 6.1, 1.5) # trapezoidal channel with sideslope 3H:2V +} diff --git a/man/rivr-package.Rd b/man/rivr-package.Rd index 85323c3..12aeaae 100644 --- a/man/rivr-package.Rd +++ b/man/rivr-package.Rd @@ -1,15 +1,15 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/graduallyvariedflow_v2.r -\docType{package} -\name{rivr-package} -\alias{rivr-package} -\alias{rivr} -\title{Steady and Unsteady Open-Channel Flow Computation} -\description{ -This package is designed as an educational tool for students and -instructors of undergraduate courses in open channel hydraulics. -Functions are provided for computing normal and critical depths, -steady (e.g. backwater curves) and unsteady (flood wave routing) -flow computations for prismatic trapezoidal channels. See the vignettes -to get started. -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/graduallyvariedflow_v2.r +\docType{package} +\name{rivr-package} +\alias{rivr-package} +\alias{rivr} +\title{Steady and Unsteady Open-Channel Flow Computation} +\description{ +This package is designed as an educational tool for students and +instructors of undergraduate courses in open channel hydraulics. +Functions are provided for computing normal and critical depths, +steady (e.g. backwater curves) and unsteady (flood wave routing) +flow computations for prismatic trapezoidal channels. See the vignettes +to get started. +} diff --git a/man/route_wave.Rd b/man/route_wave.Rd index 0eb9c46..d27c67d 100644 --- a/man/route_wave.Rd +++ b/man/route_wave.Rd @@ -1,121 +1,135 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/route_wave_v4.r -\name{route_wave} -\alias{route_wave} -\title{Flood wave routing} -\usage{ -route_wave(So, n, Cm, g, B, SS, initial.condition, boundary.condition, - downstream.condition, timestep, spacestep, numnodes, monitor.nodes, - monitor.times, engine = c("Dynamic", "Kinematic"), - scheme = c("MacCormack", "Lax"), boundary.type = c("QQ", "Qy", "yQ", - "yy")) -} -\arguments{ -\item{So}{Channel slope [\eqn{L L^{-1}}].} - -\item{n}{Manning's roughness coefficient.} - -\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} - -\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} - -\item{B}{Channel bottom width [\eqn{L}].} - -\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} - -\item{initial.condition}{The initial flow rate [\eqn{L^3 T^{-1}}], assumed constant -throughout the channel.} - -\item{boundary.condition}{Vector specifying the upstream boundary condition -for the full duration of the model. If \code{engine = "Kinematic"}, values are -assumed to be flow [\eqn{L^3 T^{-1}}]. If \code{engine = "Dynamic"}, the form of the -boundary condition is determined by the argument \code{boundary.type}.} - -\item{downstream.condition}{Only used if \code{engine = "Dynamic"}. Vector specifying -the upstream boundary condition for the full duration of the model. Must be the same -length as \code{boundary.condition}.} - -\item{timestep}{Temporal resolution of the model. Also the assumed time interval [\eqn{T}] -between elements of \code{boundary.condition} and \code{downstream.condition}. -The user is responsible for ensuring numerical stability.} - -\item{spacestep}{the spatial resolution of the model, interpreted as the distance [\eqn{L}] -between nodes in the model domain. The user is responsible for ensuring numerical stability.} - -\item{numnodes}{The number of nodes used to discretize the channel. The total channel extent is -computed as \code{spacestep*(numnodes - 1)}.} - -\item{monitor.nodes}{the nodes to be monitored every time step. Specified as a vector of node -indices, with 1 being the upstream boundary and \code{numnodes} being the downstream boundary.} - -\item{monitor.times}{the time steps at which to monitor every node. Specified as a vector of -indices of \code{boundary.condition}. Defaults to five equally-spaced time steps including -the first and last time steps.} - -\item{engine}{The engine to be used for routing the flood wave. -May be either "Kinematic" or "Dynamic".} - -\item{scheme}{Only used if \code{engine = "Dynamic"}. Specifies whether to use the -Lax Diffusive scheme or the MacCormack predictor-corrector scheme.} - -\item{boundary.type}{Only used if \code{engine = "Dynamic"}. Specifies what boundary data -is supplied. Possible characters are If \code{boundary.type = "QQ"}, both \code{boundary.condition} -and \code{downstream.condition} are assumed to be flows [\eqn{L^3 T^{-1}}]. If -\code{boundary.type = "Qy"} the upstream boundary is assumed to be flow -while the downstream boundary is assumed to be depth [\eqn{L}]. Other possibilities -are \code{"yQ"} and \code{"yy"}.} -} -\value{ -data.frame with columns: - \item{step}{Time step.} - \item{node}{Node index.} - \item{time}{Time since start.} - \item{distance}{Downstream distance.} - \item{flow}{Flow rate.} - \item{depth}{Flow depth.} - \item{velocity}{Flow velocity.} - \item{area}{Flow area.} - \item{monitor.type}{Row refers to a monitored node ("node") or timestep ("timestep").} -} -\description{ -Route a flood wave down a prismatic channel. -} -\details{ -Provides implementations of a Kinematic Wave Model (KWM) and - a Dynamic Wave Model (DWM) with the choice of two numerical schemes. The MacCormack - scheme is a second-order accurate predictor-corrector scheme that provides efficient - flood wave routing. The Lax diffusive scheme can be used to obtain smooth solutions for - problems with discontinuities in the boundary conditions, e.g. sudden gate closures. - The DWM implementation uses the Method of Characteristics (MOC) to compute the flow - regime at the model boundaries, and allows the user to specify boundaries in terms of - depths and/or flows. the KWM implementation assumes the normal depth at the upstream - boundary and is only first-order accurate. -} -\examples{ -\dontrun{ -# kinematic wave routing -times = seq(0, 30000, by = 25) -floodwave = ifelse(times >= 9000, 250, - 250 + (750/pi)*(1 - cos(pi*times/(60*75)))) -route_wave(0.001, 0.045, 1.486, 32.2, 100, 0, initial.condition = 250, - boundary.condition = floodwave, timestep = 25, spacestep = 50, - numnodes=301, monitor.nodes = c(1, 101, 201, 301), - monitor.times = seq(1, length(times), by = 10), engine = "Kinematic") -# dynamic wave routing with zero-gradient downstream condition using MacCormack scheme -route_wave(0.001, 0.045, 1.486, 32.2, 100, 0, initial.condition = 250, - boundary.condition = floodwave, downstream.condition = rep(-1, length(times)), - timestep = 25, spacestep = 500, numnodes = 31, engine = "Dynamic", - scheme = "MacCormack", monitor.nodes = c(1, 11, 21, 31), - monitor.times = seq(1, length(times), by = 10)) -# mixed boundary conditions (sudden gate closure) using Lax scheme -lax = route_wave(0.00008, 0.013, 1, 9.81, 6.1, 1.5, - initial.condition = 126, boundary.condition = rep(5.79, 2001), - downstream.condition = rep(0, 2001), timestep = 1, spacestep = 10, - numnodes = 501, monitor.nodes = c(1, 151, 251, 301, 501), - monitor.times = c(1, 501, 1001, 1501, 2001), - engine="Dynamic", scheme="Lax", boundary.type="yQ") -# extract data for a monitored point -require(dplyr) -filter(lax, monitor.type == "node", node == 151) -} -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/route_wave_v4.r +\name{route_wave} +\alias{route_wave} +\title{Flood wave routing} +\usage{ +route_wave( + So, + n, + Cm, + g, + B, + SS, + initial.condition, + boundary.condition, + downstream.condition, + timestep, + spacestep, + numnodes, + monitor.nodes, + monitor.times, + engine = c("Dynamic", "Kinematic"), + scheme = c("MacCormack", "Lax"), + boundary.type = c("QQ", "Qy", "yQ", "yy") +) +} +\arguments{ +\item{So}{Channel slope [\eqn{L L^{-1}}].} + +\item{n}{Manning's roughness coefficient.} + +\item{Cm}{Unit conversion coefficient for Manning's equation. For SI units, Cm = 1.} + +\item{g}{Gravitational acceleration [\eqn{L T^{-2}}].} + +\item{B}{Channel bottom width [\eqn{L}].} + +\item{SS}{Channel sideslope [\eqn{L L^{-1}}].} + +\item{initial.condition}{The initial flow rate [\eqn{L^3 T^{-1}}], assumed constant +throughout the channel.} + +\item{boundary.condition}{Vector specifying the upstream boundary condition +for the full duration of the model. If \code{engine = "Kinematic"}, values are +assumed to be flow [\eqn{L^3 T^{-1}}]. If \code{engine = "Dynamic"}, the form of the +boundary condition is determined by the argument \code{boundary.type}.} + +\item{downstream.condition}{Only used if \code{engine = "Dynamic"}. Vector specifying +the upstream boundary condition for the full duration of the model. Must be the same +length as \code{boundary.condition}.} + +\item{timestep}{Temporal resolution of the model. Also the assumed time interval [\eqn{T}] +between elements of \code{boundary.condition} and \code{downstream.condition}. +The user is responsible for ensuring numerical stability.} + +\item{spacestep}{the spatial resolution of the model, interpreted as the distance [\eqn{L}] +between nodes in the model domain. The user is responsible for ensuring numerical stability.} + +\item{numnodes}{The number of nodes used to discretize the channel. The total channel extent is +computed as \code{spacestep*(numnodes - 1)}.} + +\item{monitor.nodes}{the nodes to be monitored every time step. Specified as a vector of node +indices, with 1 being the upstream boundary and \code{numnodes} being the downstream boundary.} + +\item{monitor.times}{the time steps at which to monitor every node. Specified as a vector of +indices of \code{boundary.condition}. Defaults to five equally-spaced time steps including +the first and last time steps.} + +\item{engine}{The engine to be used for routing the flood wave. +May be either "Kinematic" or "Dynamic".} + +\item{scheme}{Only used if \code{engine = "Dynamic"}. Specifies whether to use the +Lax Diffusive scheme or the MacCormack predictor-corrector scheme.} + +\item{boundary.type}{Only used if \code{engine = "Dynamic"}. Specifies what boundary data +is supplied. Possible characters are If \code{boundary.type = "QQ"}, both \code{boundary.condition} +and \code{downstream.condition} are assumed to be flows [\eqn{L^3 T^{-1}}]. If +\code{boundary.type = "Qy"} the upstream boundary is assumed to be flow +while the downstream boundary is assumed to be depth [\eqn{L}]. Other possibilities +are \code{"yQ"} and \code{"yy"}.} +} +\value{ +data.frame with columns: + \item{step}{Time step.} + \item{node}{Node index.} + \item{time}{Time since start.} + \item{distance}{Downstream distance.} + \item{flow}{Flow rate.} + \item{depth}{Flow depth.} + \item{velocity}{Flow velocity.} + \item{area}{Flow area.} + \item{monitor.type}{Row refers to a monitored node ("node") or timestep ("timestep").} +} +\description{ +Route a flood wave down a prismatic channel. +} +\details{ +Provides implementations of a Kinematic Wave Model (KWM) and + a Dynamic Wave Model (DWM) with the choice of two numerical schemes. The MacCormack + scheme is a second-order accurate predictor-corrector scheme that provides efficient + flood wave routing. The Lax diffusive scheme can be used to obtain smooth solutions for + problems with discontinuities in the boundary conditions, e.g. sudden gate closures. + The DWM implementation uses the Method of Characteristics (MOC) to compute the flow + regime at the model boundaries, and allows the user to specify boundaries in terms of + depths and/or flows. the KWM implementation assumes the normal depth at the upstream + boundary and is only first-order accurate. +} +\examples{ +\dontrun{ +# kinematic wave routing +times = seq(0, 30000, by = 25) +floodwave = ifelse(times >= 9000, 250, + 250 + (750/pi)*(1 - cos(pi*times/(60*75)))) +route_wave(0.001, 0.045, 1.486, 32.2, 100, 0, initial.condition = 250, + boundary.condition = floodwave, timestep = 25, spacestep = 50, + numnodes=301, monitor.nodes = c(1, 101, 201, 301), + monitor.times = seq(1, length(times), by = 10), engine = "Kinematic") +# dynamic wave routing with zero-gradient downstream condition using MacCormack scheme +route_wave(0.001, 0.045, 1.486, 32.2, 100, 0, initial.condition = 250, + boundary.condition = floodwave, downstream.condition = rep(-1, length(times)), + timestep = 25, spacestep = 500, numnodes = 31, engine = "Dynamic", + scheme = "MacCormack", monitor.nodes = c(1, 11, 21, 31), + monitor.times = seq(1, length(times), by = 10)) +# mixed boundary conditions (sudden gate closure) using Lax scheme +lax = route_wave(0.00008, 0.013, 1, 9.81, 6.1, 1.5, + initial.condition = 126, boundary.condition = rep(5.79, 2001), + downstream.condition = rep(0, 2001), timestep = 1, spacestep = 10, + numnodes = 501, monitor.nodes = c(1, 151, 251, 301, 501), + monitor.times = c(1, 501, 1001, 1501, 2001), + engine="Dynamic", scheme="Lax", boundary.type="yQ") +# extract data for a monitored point +require(dplyr) +filter(lax, monitor.type == "node", node == 151) +} +} diff --git a/man/waterolympics.Rd b/man/waterolympics.Rd index d08ecd8..6ae542f 100644 --- a/man/waterolympics.Rd +++ b/man/waterolympics.Rd @@ -1,38 +1,38 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/route_wave_v4.r -\docType{data} -\name{waterolympics} -\alias{waterolympics} -\title{California Water Olympics} -\format{A data frame with 40 rows and 3 variables} -\usage{ -data(waterolympics) -} -\description{ -Digitized results from the California Water Olympics. The variables are as follows: -\itemize{ - \item t The time (in seconds) since the start of the model run. - \item Q The flow rate [\eqn{ft^3 s^{-1}}]. - \item x The distance downstream [\eqn{ft}] at which the hydrograph was recorded. -} -The data can be used to validate numerical solutions to flood wave routing for a channel -under the following conditions: -\itemize{ - \item Channel width is 100 feet. - \item Channel slope is 0.001. - \item Channel extent is 150,000 feet. - \item Channel roughness (Manning's n) is 0.045. - \item Channel sideslope is 0 (rectangular channel). - \item Initial flow rate is 250 cfs. - \item Upstream boundary condition is defined as - \deqn{Q(t < 9000) = 250 + \frac{750}{\pi}(1 - \cos{\frac{\pi t}{4500}})} - \deqn{Q(t >= 9000) = 250} -} -} -\references{ -Sobey, Rodney. "H11: Hydrograph Routing." - Review of One-Dimensional Hydrodynamic and Transport Models. Bay-Delta - Modeling Forum, 15 June 2001. Web. 13 Mar. 2015. - . -} -\keyword{datasets} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/route_wave_v4.r +\docType{data} +\name{waterolympics} +\alias{waterolympics} +\title{California Water Olympics} +\format{A data frame with 40 rows and 3 variables} +\usage{ +data(waterolympics) +} +\description{ +Digitized results from the California Water Olympics. The variables are as follows: +\itemize{ + \item t The time (in seconds) since the start of the model run. + \item Q The flow rate [\eqn{ft^3 s^{-1}}]. + \item x The distance downstream [\eqn{ft}] at which the hydrograph was recorded. +} +The data can be used to validate numerical solutions to flood wave routing for a channel +under the following conditions: +\itemize{ + \item Channel width is 100 feet. + \item Channel slope is 0.001. + \item Channel extent is 150,000 feet. + \item Channel roughness (Manning's n) is 0.045. + \item Channel sideslope is 0 (rectangular channel). + \item Initial flow rate is 250 cfs. + \item Upstream boundary condition is defined as + \deqn{Q(t < 9000) = 250 + \frac{750}{\pi}(1 - \cos{\frac{\pi t}{4500}})} + \deqn{Q(t >= 9000) = 250} +} +} +\references{ +Sobey, Rodney. "H11: Hydrograph Routing." + Review of One-Dimensional Hydrodynamic and Transport Models. Bay-Delta + Modeling Forum, 15 June 2001. Web. 13 Mar. 2015. + . +} +\keyword{datasets}