View source: R/darcy_weisbach.R
darcyweisbach | R Documentation |
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).
darcyweisbach(
Q = NULL,
D = NULL,
hf = NULL,
L = NULL,
ks = NULL,
nu = NULL,
units = c("SI", "Eng"),
ret_units = FALSE
)
Q |
numeric vector that contains the flow rate [ |
D |
numeric vector that contains the pipe diameter [ |
hf |
numeric vector that contains the head loss through the pipe section [ |
L |
numeric vector that contains the pipe length [ |
ks |
numeric vector that contains the equivalent sand roughness height.
Units should be consistent with other input [ |
nu |
numeric vector that contains the kinematic viscosity of water,
[ |
units |
character vector that contains the system of units [options are
|
ret_units |
If set to TRUE the value(s) returned are of class |
The Darcy-Weisbach equation was developed to estimate the head loss, h_f
, due to friction over
a length of pipe. For circular pipes it is expressed as:
h_f = \frac{fL}{D}\frac{V^2}{2g} = \frac{8fL}{\pi^{2}gD^{5}}Q^{2}
where f
is the friction factor (calculated with the colebrook
function and g
is the gravitational acceleration (9.81\frac{m}{s^2}
or 32.2\frac{ft}{s^2}
).
Returns a list including the missing parameter (hf, Q, D, or ks):
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
colebrook
for friction factor calculation
#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'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.