#' @title Colebrook–White equation (Darcy friction factor formula)
#' @description The phenomenological Colebrook–White equation
#' (or Colebrook equation) expresses the Darcy friction factor f as a function
#' of Reynolds number Re and pipe relative roughness, fitting the data
#' of experimental studies of turbulent flow in smooth and rough pipes.
#' The equation can be used to (iteratively) solve for the Darcy–Weisbach
#' friction factor f. See more about the Colebrook–White equation at the
#' [Colebrook–White equation](https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Colebrook%E2%80%93White_equation)
#'
#' @param flow cubic meter per second (m3/s)
#' @param dn diameter in meter (m)
#' @param roughness roughness in (m)
#' @param temp temp is in °C
#'
#' @return the output from \code{\link{uniroot}} for the calculation of the
#' root from the ecuation of Colebrook-White
#' @export
#' @examples
#' friction_colebrook(flow = 0.042, dn = 0.150, roughness = 1.5e-6, temp = 14.5)
#'
friction_colebrook <- function(flow, dn, roughness, temp = 15.6){
re <- reynolds_number(flow,dn,temp)
r_roughness <- roughness/dn
(-2*log10((r_roughness/3.7)-(5.02/re)*log10(r_roughness-(5.02/re)*log10(r_roughness/3.7+13/re))))^(-2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.