Learn R Programming

weirs (version 0.25)

weirbos.broadcrest: Compute Open-Channel Flow over Broad-Crested Weir by Bos (1989)

Description

Compute open-channel flow (discharge) over a broad-crested weir in accordance with Bos (1989) [BOS] with extension into the coefficients $k_c$, $k_R$, and $k_s$ from Hulsing (1967). The weir crest of opening (width) $b$ in feet is $P$ feet above the channel bottom and $L$ feet long in the flow direction. A rectangular approach channel is specified by width $B$, but the area of the channel (and hence rectangular assumption) can be bypassed by function arguments, although $B$ is used in the contraction ratio $b/B$ unless this ratio is superceded. For the weirbos.broadcrest() function, the computations are exclusively based on the foot-second unit system and careful adherance by the user is required.

The discharge equation for an acceptable tail-water condition $h_t$ is $$Q = k_c k_R k_s C_v C b \frac{2}{3} \sqrt{\frac{2}{3}g} H^{1.5}$$ where $Q$ is discharge in cubic feet per second, $k_c$ is the contraction coefficient that also is a function of the abutment rounding $r$, $k_R$ is the approach rounding coefficient that is a function of the approach crest rounding $R$, $k_s$ is the downstream embankment slope coefficient, $C_v$ is the approach velocity coefficient, $C$ is the discharge coefficient, $b$ is the width in feet of the weir crest, and $H$ is total head in feet on the weir, which is computed by $$H = h + v_o = h + \alpha v^2/2g$$ where $h$ is static head in feet on the weir, $v_o$ is velocity head in feet in the approach section, $v$ is mean velocity in feet per second in the section computed by $v=Q/A$ for cross section area $A$ in square feet, which by default is computed by $A=(h + P)B$, but can be superceded. The quantity $g$ is the acceleration of gravity and is hardwired to 32.2 feet per square second. The dimensionless quantity $\alpha$ permits accommodation of a velocity head correction that is often attributable to cross section subdivision. The $\alpha$ is outside the scope of this documentation, is almost always $\alpha=1$, and is made available as an argument for advanced users.

The discharge equation is solved for two conditions that consider the approach velocity head. First, the equation is solved as shown above for $H$ through iteration and $C_v=1$. Second, the equation is solved using $h$ and $C_v$, which is determined by nomograph lookup.

The weirbos.broadcrest() function is vectorized meaning that optional vectors of $h$ can be specified along with an optional and equal length vector $h_t$. The function assumes rectangular approach conditions to compute approach area $A$ if not superceded by the optional A argument, which also can be a vector.

The weirbos.broadcrest() function also permits optional vectors of $L$ and $b/B$ (by the argument contractratio) so that tuning of the weir-computed discharge to a measured discharge potentially can be made. The crest length $L$ can be used to increase discharge slightly by shortening in say the circumstances of a slightly downward sloping crest. (Such potential “crest” sloping is distinct from the downstream embankment slope---do not confuse the two.) The $b/B$ can be used to decrease discharge by decreasing $k_R$ in say the circumstance of an inlet that is rougher or has asperities that slightly increase the expected contraction and reduce flow efficiency. To clarify, the fact that $L$ and $b/B$ can be vectorized as optional arguments shows a mechanism by which tuning of the computational results to measured $Q$ values can occur without replacing the fundamental $C$ and $C_v$ nomographs of BOS and nomograph and lookup tables for $k_c$, $k_R$, and $k_s$ of TWRI3A5 (Hulsing, 1967). In all cases, these coefficients can be superceded by user-specified scalars or vectors in various combinations.

Usage

weirbos.broadcrest(h, ht=NULL, b=NULL, B=NULL, P=NULL, L=NULL, R=0, r=0, A=NULL, alpha=1, slopeus="vertical", slopeds="vertical", kc=NULL, kr=NULL, ks=NULL, C=NULL, contractratio=NULL, hhptest=TRUE, extended=TRUE, header="", flowdigits=2, coedigits=3, verbose=FALSE, eps=0.001, maxit=20)

Arguments

h
Mandatory scalar or vector of static heads $h$ in feet on the weir;
ht
Optional scalar or vector of tail water heads $h_t$ in feet on the weir;
b
Mandatory scalar width of weir crest $b$ in feet normal to flow;
B
Mandatory scalar width (or top width) of approach channel $B$ in feet. Technically, it is possible with arguments contractratio and A to bypass any computations normally involving $B$. This would be the mechanism to bypass the $B$ as a scalar restriction;
P
Mandatory scalar height of weir crest $P$ in feet above channel bed;
L
Optional scalar or vector of lengths $L$ in feet of broad-crested weir in direction of flow;
R
Optional scalar radius of curvature $R$ in feet of vertical upstream face;
r
Optional scalar radius of curvature $r$ in feet on the vertical abutments at inlet of weir crest;
A
Optional scalar or vector of approach cross-section area $A$ in square feet for each $h$ that supersedes the rectangular channel computation $A=(h+P)B$;
alpha
Optional scalar or vector of velocity head correction term $\alpha$ dimensionless. The default is unity ($\alpha=1$), which is most certainly appropriate for the vast majority of weir computations;
slopeus
String signifying the approach embankment slope in the format “hz:vt”, thus, slope is defined as the ratio of the horizontal hz to vertical distance vt. (This is opposite of the more common convention for the trigometric function tan().) The string “vertical” must be provided as the value for slopeus for vertical slopes;
slopeds
String signifying the downstream embankment slope in the format “hz:vt”, thus, slope is defined as the ratio of the horizontal hz to vertical distance vt. (This is opposite of the more common convention for the trigometric function tan().) The string “vertical” must be provided as the value for slopeds for vertical slopes;
kc
Contraction coefficient $k_c$, if provided, supercedes nomograph lookup and interpolation by $h/P$ and $b/B$. Optionally, this coefficient may be a vector;
kr
Rounding coefficient $k_R$, if provided, supercedes tabular lookup and interpolation by $R/h$. Optionally, this coefficient may be a vector;
ks
Downstream embankment slope coefficient $k_s$, if provided supercedes tabular lookup and interpolation by $h/L$ and downstream slope slopeds. Optionally, this coefficient may be a vector;
C
Discharge coefficient, if provided, supercedes nomograph lookup and interpolation by $h/L$ and slopeus. Optionally, this coefficient may be a vector;
hhptest
Logical for test of $h/(h+P) \le 0.35$ to follow Bos (1989) to determine $C$, but the test can be ignored with this logical argument;
contractratio
Optional vector of user specified contraction ratios, if provided, supercedes use of $b/B$. For example, b.over.B[i] <- contractratio[i];
extended
A logical that controls the contents of the data frame on return;
header
A string (usually) or any other content to add to the attributes() of the returned data frame under the non-original label name of header;
flowdigits
The number of digits to report on flow, velocity head, and total head;
coedigits
The number of digits to report on weir coefficients;
verbose
A logical controlling intermediate messages. This might be reserved for development work and no verbose output in a released version of weirs could occur;
eps
An absolute error of discharge for convergence in cubic feet per second; and
maxit
Maximum number of iterations for the computation of the total head from summation of static and velocity head $H = h + \alpha v^2/2g$ for the final $Q_H$ in item flow of the returned data frame.

Value

An R data.frame() is returned and the extended=TRUE version is described below:
head
Echoed $h$ on the input in feet;
flow
Flow $Q_H$ in cubic feet per second based on total head $H$;
delta
First order difference of $Q_H$;
flowo
Flow $Q_h$ in cubic feet per second based on static head $h$;
flowcv
Flow $Q_{cv}$ in cubic feet per second based on $C_v \ne 1$ nomograph lookup by $h/L$ and static head $h$;
error
Absolute convergence error $\epsilon$ of $Q_H$ in cubic feet per second;
velhead
Velocity head $v_o = v^2/2g = (Q_H/A)^2/2g$ in feet;
H
Total head $H = h + v_o$;
ht
Echoed $h_t$ on the input in feet;
L
Echoed $L$ in feet;
b.over.B
Echoed $b/B$;
h.over.L
Echoed $h/L$;
h.over.P
Echoed $h/P$;
C
Discharge coefficient $C$;
Cv
Approach velocity coefficient;
kc
Contraction coefficient $k_c$;
kr
Rounding coefficient $k_R$;
ks
Downstream slope coefficient $k_s$;
message
Messages concerning the computation of $Q$ for each value of $h$; and
source
weirbos.broadcrest.
The extended=FALSE version is restricted to the most salient items including $Q_H$, $Q_h$, $Q_{cv}$, $v_o$, $C$, $C_v$, $k_c$, $k_R$, and $k_s$.

References

Bos, M.G., 1989, Discharge measurement structures: International Institute for Land Reclamation and Improvement Publication 20, Wageningen, The Netherlands, 401 p. http://content.alterra.wur.nl/Internet/webdocs/ilri-publicaties/publicaties/Pub20/pub20.pdf

Hulsing, Harry, 1967, Measurement of peak discharge at dams by indirect methods: U.S. Geological Survey Techniques of Water-Resources Investigations, Book 3, Chapter A5, 29 p., http://pubs.usgs.gov/twri/twri3-a5/

See Also

weir.broadcrest

Examples

Run this code

# Simple, scalar inputs and results
weir.broadcrest(type="BOS", 0.5, b=8, B=11, P=6, L=3.25);

# Vector of heads
weir.broadcrest(type="BOS", c(0.5,0.4,0.3), b=8, B=11, P=6, L=3.25);

# Now compare two solutions by weirbos.broadcrest() to weir3a5.broadcrest()
h <- seq(0.01,1.5, by=0.001)
Qtank     <- weir3a5.broadcrest(h, b=7.97, B=10.97, P=1.125, L=3.76, flowdigits=4)
QtankbosA <- weirbos.broadcrest(h, b=7.97, B=10.97, P=1.125, L=3.76, flowdigits=4)
QtankbosB <- weirbos.broadcrest(h, b=7.97, B=10.97, P=1.125, L=3.76,
                                   hhptest=FALSE, flowdigits=4)
plot(Qtank$flow, h, type="l", col=8, lwd=6,
     xlab="FLOW, CFS", ylab="HEAD, FEET")
lines(QtankbosA$flow, h, col=2, lwd=4) # see the trunction in the red line
lines(QtankbosB$flow, h, col=3, lwd=2)

# See examples for weir3a5.broadcrest() for additional examples that
# explore higher complexity of argument settings, which test the
# nomographs for k_c, k_R, and k_s

Run the code above in your browser using DataLab