R/resistance_coefficient.R

Defines functions resistance_coefficient

Documented in resistance_coefficient

#' @title  Resistance coefficients of all fittings attached to the control valve
#' @description  The algebraic sum of all effective resistance coefficients of
#' all fittings attached to the control valve.
#' @param dn valve diameter (mm).
#' @param d1 downstream pipe diameter (mm).
#' @param d2 upstream pipe diameter (mm)
#' @return Resistance coefficient.
#' @export
resistance_coefficient <- function(dn, d1, d2){
  reducer  =  0.5 * ((1-(dn/d1)^2)^2)
  diffuser =  ((1-(dn/d2)^2)^2)
  bernulli =  (dn/d2)^4 - (dn/d1)^4
  result = reducer + diffuser + bernulli
  return(result)
}
ratral/hyd4gpv documentation built on Feb. 5, 2022, 10:30 p.m.