Calculate Darcy friction factor, using Haaland equation author: M Kovari, CCFE, Culham Science Centre reynolds : input real : Reynolds number darcy_friction : output real : Darcy friction factor Darcy friction factor, using Haaland equation, an approximation to the implicit Colebrook–White equationGnielinski correlation. https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | reynolds | |||
real(kind=dp), | intent(out) | :: | darcy_friction |
subroutine friction(reynolds, darcy_friction)
!! Calculate Darcy friction factor, using Haaland equation
!! author: M Kovari, CCFE, Culham Science Centre
!! reynolds : input real : Reynolds number
!! darcy_friction : output real : Darcy friction factor
!! Darcy friction factor, using Haaland equation, an approximation to the
!! implicit Colebrook–White equationGnielinski correlation.
!! https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation
!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
use fwbs_variables, only: roughness, afw
implicit none
real(dp), intent(in) :: reynolds
real(dp), intent(out) :: darcy_friction
! Local variables !
! !!!!!!!!!!!!!!!!!!
real(dp) :: bracket
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Bracketed term in Haaland equation
bracket = (roughness/afw/3.7)**1.11d0 + 6.9/reynolds
! Calculate Darcy friction factor
darcy_friction = (1.8d0 * log10(bracket))**(-2)
end subroutine friction