R/dynamic_viscosity.R

Defines functions dynamic_viscosity

Documented in dynamic_viscosity

#' @title Water Dynamic Viscosity
#' @description Viscosity of the fluid is the internal resistance to flow. Fluid experiences
#' resistance over each layer of it when subjected to deformation.
#' viscosity is the measure of a fluid's resistance to flow
#' Dynamic vsicosity is the force required to maintain the fluid flow at a
#' particular rate. Dynamic viscosity is usually used when the fluid is
#' subjected to any external force. The unit of dynamic viscosit is Pa.s
#' where Pa is N/m^2 - SI unit of pressure
#' https://en.wikipedia.org/wiki/Temperature_dependence_of_viscosity
#' https://www.omnicalculator.com/physics/water-viscosity#:~:text=What%20is%20the%20kinematic%20viscosity,0.8%20mm2%20per%20second.
#' @author Dr. Raúl Trujillo Álvarez
#' @param temp is in °C
#' @return Dynamic Viscosity (mPa*s)
#' @export
#' @examples
#' dynamic_viscosity(14.5)
#'
#'@section Last Updated By:
#'Dr. Trujillo
#'
#'@section Last Update Date:
#'2021/10/24

dynamic_viscosity <- function(temp = 20){
  stopifnot("The temperature must be between 3C and 60C !" = dplyr::between(temp, 3, 90))
  a <- 1.856e-11
  b <- 4209
  c <- 0.04527
  d <- -3.376e-05
  temp <- temp + 273.15  #T must be in K for approximation
  visc <- a * exp(b/temp + c * temp + d * temp^2)  # /1000 converts from  mPa·s to Pa-s (N s m-2)
  return(visc)
}
ratral/hyd4gpv documentation built on Feb. 5, 2022, 10:30 p.m.