R/sigma_2.R

Defines functions sigma_2

Documented in sigma_2

#' @title cavitation index VAG (Reference downstream pressure P2):
#' @description The value for the operating service conditions of a valve.
#' Reference downstream pressure and Adding the cavitation caused by surface
#' roughness, an isolated roughness, an offset in the boundary, or by any
#' device for which it is not possible or convenient to evaluate a pressure
#' differential), the velocity head can be used in adding the DP in
#' the Equation.
#'
#' @param p1 Gauge Inlet pressure (bar).
#' @param p2 Gauge outlet pressure (bar).
#' @param flow flow in (m³/s).
#' @param dn valve diameter (mm).
#' @param masl meters above sea level (m).
#' @param temp The temperature is in Celsius.
#'
#' @return sigma
#' @export
#'
sigma_2 <- function(p1, p2, flow, dn, masl, temp){
  pv <- vapour_pressure(temp)
  p1 = (p1 + atm_pressure(masl))
  p2 = (p2 + atm_pressure(masl))
  vfactor <- velocity(flow, dn/1000)^2/(2*9.807)
  return((p2-pv)/(p1-p2+vfactor))
}
ratral/hyd4gpv documentation built on Feb. 5, 2022, 10:30 p.m.