ConvertFlowUnits: Unit conversion for flow rates

Description Usage Arguments Details Value Author(s) Examples

View source: R/ConvertFlowUnits.R

Description

Converts volumetric flow (cfs, cms, cmd) to depth flow rate over a watershed (mm/d). Or, it converts a depth flow rate to volumetric (mm/d to cfs)

Usage

1
ConvertFlowUnits(cfs = NULL, cmd=NULL, cms = NULL, WA, mmd = NULL, AREAunits = "mi2")

Arguments

cfs

Input flow in cubic feet per second

cmd

Input flow in cubic meters per day

cms

Input flow in cubic meters per second

WA

Watershed area. Can be entered in square miles (default), or square km (in this case, change the AREAunits to "km2")

mmd

Input flow in mm/d

AREAunits

Units of the watershed area ("mi2" or "km2")

Details

Note, only one flow input should be used. (i.e., user should define cfs OR cmd OR cms OR mmd). Watershed area must always be defined.

Value

converted flow rate in either mm/d (if converting from volumetric flow) or cfs (if converting from flow depth in mm/d)

Author(s)

Josephine Archibald

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(OwascoInlet)
OwascoInlet$Streamflow_mmd<-ConvertFlowUnits(cms=OwascoInlet$Streamflow_m3s,WA=271.,AREAunits="km2")

##  The following commented example isn't currently working in Linux systems, but should 
##  work in windows/macs
##
##  Get some streamflow (reported in cubic meters per day here):
# OI <- get_usgs_gage("04235299", "2013-03-01", "2013-05-20")
# FC <- get_usgs_gage("04234000", "2013-03-01", "2013-05-20")

##  Convert to mm/d
# OwascoInlet_mmd <- ConvertFlowUnits(cmd=OI$flowdata$flow, WA=OI$area, AREAunits="km2")
# FallCreek_mmd <- ConvertFlowUnits(cmd=FC$flowdata$flow, WA=FC$area, AREAunits="km2")

##  Compare the watershed area normalized flow depth for two watersheds near Ithaca NY :
# hydrograph(streamflow=OwascoInlet_mmd, streamflow2=FallCreek_mmd, timeSeries=FC$flowdata$mdate, 
# stream.label="flow depth (mm/d)")
# legend("topright", legend=c("Owasco Inlet", "Fall Creek"), lty=c(1,2), col=c("black", "red"))

Example output

Loading required package: operators

Attaching package: 'operators'

The following objects are masked from 'package:base':

    options, strrep

Loading required package: topmodel
Loading required package: DEoptim
Loading required package: parallel

DEoptim package
Differential Evolution algorithm in R
Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich

Loading required package: XML

EcoHydRology documentation built on May 2, 2019, 8:28 a.m.