Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | tilt | |||
real(kind=r64), | intent(in) | :: | ra | |||
real(kind=r64), | intent(in) | :: | asp | |||
real(kind=r64), | intent(out) | :: | gnu | |||
integer, | intent(inout) | :: | nperr | |||
character(len=*), | intent(inout) | :: | ErrorMessage |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
subroutine nusselt(tilt, ra, asp, gnu, nperr, ErrorMessage)
!***********************************************************************
! purpose to calculate nusselt modulus for air gaps (ISO15099)
!***********************************************************************
! Input
! tilt tilt in degrees
! ra rayleigh number
! asp Aspect ratio
!
! Output
! gnu nusselt number
! nperr
real(r64), intent(in) :: tilt, ra, asp
real(r64), intent(out) :: gnu
integer, intent(inout) :: nperr
character(len=*), intent(inout) :: ErrorMessage
real(r64) :: subNu1, subNu2, subNu3, Nu1, Nu2, G, Nu60, Nu90, tiltr
subNu1 = 0.0d0
subNu2 = 0.0d0
subNu3 = 0.0d0
Nu1 = 0.0d0
Nu2 = 0.0d0
Nu90 = 0.0d0
Nu60 = 0.0d0
G = 0.0d0
tiltr = tilt*2.0d0*pi/360.0d0 ! convert tilt in degrees to radians
if ((tilt.ge.0.0d0).and.(tilt.lt.60.0d0)) then !ISO/DIS 15099 - chapter 5.3.3.1
subNu1 = 1.0d0 - 1708.0d0 / (ra * cos(tiltr))
subNu1 = pos(subNu1)
subNu2 = 1.0d0 - (1708.0d0 * (sin(1.8d0 * tiltr)) ** 1.6d0) / (ra * cos(tiltr))
subNu3 = ((ra * cos(tiltr) / 5830.0d0) ** (1.0d0/3.0d0)) - 1.0d0
subNu3 = pos(subNu3)
gnu = 1.0d0 + 1.44d0 * subNu1 * subNu2 + subNu3 !equation 42
if (ra.ge.1.0d5) then
nperr = 1001 ! Rayleigh number is out of range
ErrorMessage = 'Rayleigh number out of range in Nusselt num. calc. for gaps (angle between 0 and 60 deg).'
end if
if (asp.le.20.0d0) then
nperr = 1002 ! Aspect Ratio is out of range
ErrorMessage = 'Aspect Ratio out of range in Nusselt num. calc. for gaps (angle between 0 and 60 deg).'
end if
else if (tilt.eq.60.0d0) then !ISO/DIS 15099 - chapter 5.3.3.2
G = 0.5d0 / ((1.0d0 + (ra / 3160.0d0) ** 20.6d0) ** 0.1d0) !equation 47
Nu1 = (1.0d0 + ((0.0936d0 * ra ** 0.314d0)/(1.0d0 + G)) ** 7) ** (0.1428571d0) !equation 45
Nu2 = (0.104d0 + 0.175d0 / asp) * (ra ** 0.283d0) !equation 46
gnu = Max(Nu1, Nu2) !equation 44
else if ((tilt.gt.60.0d0).and.(tilt.lt.90.0d0)) then !ISO/DIS 15099 - chapter 5.3.3.3
if ((ra.gt.100.0d0).and.(ra.lt.2.0d7).and.(asp.gt.5.0d0).and.(asp.lt.100.0d0)) then
G = 0.5d0 / ((1.0d0 + (ra / 3160.0d0) ** 20.6d0) ** 0.1d0) !equation 47
Nu1 = (1.0d0 + ((0.0936d0 * ra ** 0.314d0)/(1.0d0 + G)) ** 7) ** (0.1428571d0) !equation 45
Nu2 = (0.104d0 + 0.175d0 / asp) * (ra ** 0.283d0) !equation 46
Nu60 = Max(Nu1, Nu2) !equation 44
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
if (ra.gt.5.0d4) then
Nu1 = 0.0673838d0 * ra ** (1.0d0/3.0d0) !equation 49
else if ((ra.gt.1.0d4).and.(ra.le.5.0d4)) then
Nu1 = 0.028154d0 * ra ** 0.4134d0 !equation 50
else if (ra.le.1.0d4) then
Nu1 = 1.0d0 + 1.7596678d-10 * ra ** 2.2984755d0 !equation 51
end if
else if (ra.le.100.0d0) then
G = 0.5d0 / ((1.0d0 + (ra / 3160.0d0) ** 20.6d0) ** 0.1d0) !equation 47
Nu1 = (1.0d0 + ((0.0936d0 * ra ** 0.314d0)/(1.0d0 + G)) ** 7) ** (0.1428571d0) !equation 45
Nu2 = (0.104d0 + 0.175d0 / asp) * (ra ** 0.283d0) !equation 46
Nu60 = Max(Nu1, Nu2) !equation 44
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
Nu1 = 1.0d0 + 1.7596678d-10 * ra ** 2.2984755d0 !equation 51
nperr = 1003 ! Rayleigh number is less than 100
ErrorMessage = 'Rayleigh number is less than 100 in Nusselt number calculations for gaps '// &
'(angle between 60 and 90 degrees).'
else if (ra.gt.2.0d7) then
G = 0.5d0 / ((1.0d0 + (ra / 3160.0d0) ** 20.6d0) ** 0.1d0) !equation 47
Nu1 = (1.0d0 + ((0.0936d0 * ra ** 0.314d0)/(1.0d0 + G)) ** 7) ** (0.1428571d0) !equation 45
Nu2 = (0.104d0 + 0.175d0 / asp) * (ra ** 0.283d0) !equation 46
Nu60 = Max(Nu1, Nu2) !equation 44
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
Nu1 = 0.0673838d0 * ra ** (1.0d0/3.0d0) !equation 49
nperr = 1004 ! Rayleigh number is great from 2e7
ErrorMessage = 'Rayleigh number is greater than 2e7 in Nusselt number calculations for gaps'// &
' (angle between 60 and 90 degrees).'
else if ((asp.le.5.0d0).or.(asp.ge.100.0d0)) then
G = 0.5d0 / ((1.0d0 + (ra / 3160.0d0) ** 20.6d0) ** 0.1d0) !equation 47
Nu1 = (1.0d0 + ((0.0936d0 * ra ** 0.314d0)/(1.0d0 + G)) ** 7) ** (0.1428571d0) !equation 45
Nu2 = (0.104d0 + 0.175d0 / asp) * (ra ** 0.283d0) !equation 46
Nu60 = Max(Nu1, Nu2) !equation 44
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
if (ra.gt.5.0d4) then
Nu1 = 0.0673838d0 * ra ** (1.0d0/3.0d0) !equation 49
else if ((ra.gt.1.0d4).and.(ra.le.5.0d4)) then
Nu1 = 0.028154d0 * ra ** 0.4134d0 !equation 50
else if (ra.le.1.0d4) then
Nu1 = 1.0d0 + 1.7596678d-10 * ra ** 2.2984755d0 !equation 51
end if
nperr = 1005 ! Aspect Ratio is out of range
ErrorMessage = 'Aspect Ratio is out of range in Nusselt number calculations for gaps (angle between 60 and 90 degrees).'
end if
Nu90 = Max(Nu1, Nu2) !equation 48
gnu = ((Nu90 - Nu60) / (90.0d0 - 60.0d0)) * (tilt - 60.0d0) + Nu60 !linear interpolation between 60 and 90 degrees
else if (tilt.eq.90.0d0) then !ISO/DIS 15099 - chapter 5.3.3.4
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
if (ra.gt.5.0d4) then
Nu1 = 0.0673838d0 * (ra ** (1.0d0/3.0d0)) !equation 49
else if ((ra.gt.1.0d4).and.(ra.le.5.0d4)) then
Nu1 = 0.028154d0 * ra ** 0.4134d0 !equation 50
!Nu1 = 0.028154 * ra ** 0.414d0 !equation 50 - DISCONTINUITY CORRECTED
else if (ra.le.1.0d4) then
Nu1 = 1.0d0 + 1.7596678d-10 * ra ** 2.2984755d0 !equation 51
end if
gnu = Max(Nu1, Nu2) !equation 48
else if ((tilt.gt.90.0d0).and.(tilt.le.180.0d0)) then
Nu2 = 0.242d0 * (ra / asp) ** 0.272d0 !equation 52
if (ra.gt.5.0d4) then
Nu1 = 0.0673838d0 * ra ** (1.0d0/3.0d0) !equation 49
else if ((ra.gt.1.0d4).and.(ra.le.5.0d4)) then
Nu1 = 0.028154d0 * ra ** 0.4134d0 !equation 50
else if (ra.le.1.0d4) then
Nu1 = 1.0d0 + 1.7596678d-10 * ra ** 2.2984755d0 !equation 51
end if
gnu = Max(Nu1, Nu2) !equation 48
gnu = 1.0d0 + (gnu - 1.0d0) * SIN(tiltr) !equation 53
else
nperr = 10 !error flag: angle is out of range
ErrorMessage = 'Window tilt angle is out of range.'
return
end if
end subroutine nusselt