Learn R Programming

hydraulics (version 0.2.0)

darcyweisbach: Solves the Darcy-Weisbach Equation for the either head loss (hf), flow rate (Q), diameter (D), or roughness height (ks).

Description

This function solves the Darcy-Weisbach friction loss equation for with water in circular pipes. the function solves for either head loss (hf), flow rate (Q), diameter (D),or roughness height, (ks) whichever is missing (not included as an argument). As with many parts of this package, techniques and formatting were drawn from Irucka Embry's iemisc package, which includes some methods with similar functionality.

Usage

darcyweisbach(
  Q = NULL,
  D = NULL,
  hf = NULL,
  L = NULL,
  ks = NULL,
  nu = NULL,
  units = c("SI", "Eng")
)

Arguments

Q

numeric vector that contains the flow rate [m^3/s or or ft^3/s]

D

numeric vector that contains the pipe diameter [m or ft]

hf

numeric vector that contains the head loss through the pipe section [m or ft]

L

numeric vector that contains the pipe length [m or ft],

ks

numeric vector that contains the equivalent sand roughness height. Units should be consistent with other input [m or ft]

nu

numeric vector that contains the kinematic viscosity of water, [m2 s-1 or ft2 s-1].

units

character vector that contains the system of units [options are SI for International System of Units and Eng for English (US customary) units. This is used for compatibility with iemisc package

Value

Returns a list including the missing parameter (hf, Q, or D):

  • Q - flow rate.

  • V - flow velocity.

  • L - pipe length.

  • hf - head loss due to friction

  • f - Darcy-Weisbach friction factor

  • ks - roughness height

  • Re - Reynolds number

Examples

Run this code
# NOT RUN {
#Type 2 (solving for flow rate, Q): SI Units
D <- .5
L <- 10
hf <- 0.006*L
T <- 20
ks <- 0.000046
darcyweisbach(D = D, hf = hf, L = L, ks = ks, nu = kvisc(T=T, units='SI'), units = c('SI'))

#Type 3 (solving for diameter, D): Eng (US) units
Q <- 37.5     #flow in ft^3/s
L <- 8000     #pipe length in ft
hf <- 215     #head loss due to friction, in ft
T <- 68       #water temperature, F
ks <- 0.0008  #pipe roughness, ft
darcyweisbach(Q = Q, hf = hf, L = L, ks = ks, nu = kvisc(T=T, units='Eng'), units = c('Eng'))

# }

Run the code above in your browser using DataLab