R/velocity.R

Defines functions velocity

Documented in velocity

#' @title  Velocity in a pipe
#'
#' @description This function calculates the velocity of the fluid in a
#'   circular pipe.
#'
#' @author Dr. Raúl Trujillo Álvarez \email{dr.ing.trujillo@gmail.com}
#'
#' @param flow cubic meter per second (m³/s)
#' @param dn diameter in meter (m)
#'
#' @return velocity in meter per second (m/s)
#' @export
#'
#' @examples
#' velocity(flow = 0.4, dn = 0.2)

velocity <- function(flow, dn){
  velocity <- flow/((pi*dn^2)/4)
  return(velocity)
}
ratral/hyd4gpv documentation built on Feb. 5, 2022, 10:30 p.m.