Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | tleft | |||
real(kind=r64), | intent(in) | :: | tright | |||
integer, | intent(in) | :: | IGap | |||
real(kind=r64), | intent(out) | :: | con | |||
real(kind=r64), | intent(out) | :: | pr | |||
real(kind=r64), | intent(out) | :: | gr |
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 WindowGasConductance(tleft,tright,IGap,con,pr,gr)
! SUBROUTINE INFORMATION:
! AUTHOR Adapted by Fred Winkelmann from Window5 subroutine gasses
! DATE WRITTEN September 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Find the coefficient of convective/conductive heat transfer in the gas-filled gap
! between isothermal solid layers. The gap may be filled with a single gas or a gas mixture.
! METHODOLOGY EMPLOYED:
! Based on methodology in Chapter 5 of the July 18, 2001 draft of ISO 15099,
! "Thermal Performance of Windows, Doors and Shading Devices--Detailed Calculations."
! The equation numbers below correspond to those in the standard.
! REFERENCES:
! Window5 source code; ISO 15099
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: tleft ! Temperature of gap surface closest to outside (K)
REAL(r64), INTENT(IN) :: tright ! Temperature of gap surface closest to zone (K)
INTEGER, INTENT(IN) :: IGap ! Gap number
REAL(r64) , INTENT(OUT) :: con ! Gap gas conductance (W/m2-K)
REAL(r64) , INTENT(OUT) :: pr ! Gap gas Prandtl number
REAL(r64) , INTENT(OUT) :: gr ! Gap gas Grashof number
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: pres = 1.0d5 ! Gap gas pressure (Pa)
REAL(r64), PARAMETER :: gaslaw = 8314.51d0 ! Molar gas constant (J/kMol-K)
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: tmean ! Average gap gas temperature (K)
INTEGER :: IMix,i,j ! Counters of gases in a mixture
INTEGER :: NMix ! Number of gases in a mixture
REAL(r64) :: molmix ! Molecular weight of mixture
REAL(r64) :: kprime(10) ! Monotonic thermal conductivity
REAL(r64) :: kdblprm(10) ! Conductivity term accounting for additional energy moved by
! the diffusional transport of internal energy in polyatomic gases.
REAL(r64) :: kpmix,kdpmix ! Monotonic thermal conductivity of mixture
REAL(r64) :: mukpdwn(10) ! Denominator term
REAL(r64) :: kpdown(10),kdpdown(10) ! Denominator terms
REAL(r64) :: kmix ! For accumulating conductance of gas mixture
REAL(r64) :: mumix ! For accumulating viscosity of gas mixture
REAL(r64) :: visc ! Dynamic viscosity of mixture at tmean (g/m-s)
REAL(r64) :: cp ! Specific heat of mixture at tmean (J/m3-K)
REAL(r64) :: dens ! Density of mixture at tmean (kg/m3)
REAL(r64) :: cpmixm ! Gives cp when divided by molmix
REAL(r64) :: phimup ! Numerator factor
REAL(r64) :: downer ! Denominator factor
REAL(r64) :: psiup ! Numerator factor
REAL(r64) :: psiterm ! Factor
REAL(r64) :: phikup ! Numerator factor
REAL(r64) :: rhomix ! Density of gas mixture (kg/m3)
REAL(r64) :: frct(10) ! Fraction of each gas in a mixture
REAL(r64) :: fvis(10) ! Viscosity of each gas in a mixture (g/m-s)
REAL(r64) :: fcon(10) ! Conductance of each gas in a mixture (W/m2-K)
REAL(r64) :: fdens(10) ! Density of each gas in a mixture (kg/m3)
REAL(r64) :: fcp(10) ! Specific heat of each gas in a mixture (J/m3-K)
NMix = gnmix(IGap) !Objexx:Logic Either assert NMix>0 or handle NMix<=0 in logic so that con and locals guar. initialized before use
DO IMix = 1,NMix
frct(IMix) = gfract(IGap,IMix)
END DO
tmean = 0.5d0*(tleft+tright)
fcon(1) = gcon(IGap,1,1) + gcon(IGap,1,2)*tmean + gcon(IGap,1,3)*tmean**2
fvis(1) = gvis(IGap,1,1) + gvis(IGap,1,2)*tmean + gvis(IGap,1,3)*tmean**2
fcp(1) = gcp(IGap,1,1) + gcp(IGap,1,2) *tmean + gcp(IGap,1,3) *tmean**2
fdens(1) = pres*gwght(IGap,1)/(gaslaw*tmean) ! Density using ideal gas law:
! rho=(presure*molecweight)/(gasconst*tmean)
IF(NMix == 1) then ! Single gas
con =fcon(1)
visc =fvis(1)
cp =fcp(1)
dens =fdens(1)
elseif (NMix >1) then ! Multiple gases; calculate mixture properties
molmix = frct(1)*gwght(IGap,1) ! initialize eq. 56
cpmixm = molmix*fcp(1) ! initialize eq. 58
kprime(1) = 3.75d0*(gaslaw/gwght(IGap,1))*fvis(1) ! eq. 67
kdblprm(1) = fcon(1)-kprime(1) ! eq. 67
! Initialize summations for eqns 60-66
mumix = 0.0d0
kpmix = 0.0d0
kdpmix = 0.0d0
mukpdwn(1) = 1.0d0
kpdown(1) = 1.0d0
kdpdown(1) = 1.0d0
! Calculate properties of mixture constituents
do i = 2, NMix
fcon(i) = gcon(IGap,i,1) + gcon(IGap,i,2)*tmean + gcon(IGap,i,3)*tmean**2
fvis(i) = gvis(IGap,i,1) + gvis(IGap,i,2)*tmean + gvis(IGap,i,3)*tmean**2
fcp(i) = gcp(IGap,i,1) + gcp(IGap,i,2)*tmean + gcp(IGap,i,3) *tmean**2
fdens(i) = pres*gwght(IGap,i)/(gaslaw*tmean)
molmix = molmix+frct(i)*gwght(IGap,i) ! eq. 56
cpmixm = cpmixm+frct(i)*fcp(i)*gwght(IGap,i) ! eq. 58-59
kprime(i) = 3.75d0*gaslaw/gwght(IGap,i)*fvis(i) ! eq. 67
kdblprm(i) = fcon(i)-kprime(i) ! eq. 68
mukpdwn(i) = 1.0d0 ! initialize denomonator of eq. 60
kpdown(i) = 1.0d0 ! initialize denomonator of eq. 63
kdpdown(i) = 1.0d0 ! initialize denomonator of eq. 65
end do
do i = 1,NMix
do j = 1,NMix
! numerator of equation 61
phimup = (1.0d0 + (fvis(i)/fvis(j))**0.5d0*(gwght(IGap,j)/gwght(IGap,i))**0.25d0)**2
! denomonator of eq. 61, 64 and 66
downer = 2.d0 * sqrt(2.d0) * (1+(gwght(IGap,i)/gwght(IGap,j)))**0.5d0
! calculate the denominator of eq. 60
if (i /= j) mukpdwn(i) = mukpdwn(i) + phimup/downer*frct(j)/frct(i)
! numerator of eq. 64; psiterm is the multiplied term in backets
psiup = (1.d0 + (kprime(i)/kprime(j))**0.5d0*(gwght(IGap,i)/gwght(IGap,j))**0.25d0)**2
psiterm = 1.d0 + 2.41d0*(gwght(IGap,i)-gwght(IGap,j))*(gwght(IGap,i)-0.142d0*gwght(IGap,j)) &
/(gwght(IGap,i) + gwght(IGap,j))**2
! using the common denominator, downer, calculate the denominator for eq. 63
if (i.ne.j) kpdown(i) = kpdown(i) + psiup*(psiterm/downer)*(frct(j)/frct(i))
! calculate the numerator of eq. 66
phikup = (1.d0+(kprime(i)/kprime(j))**0.5d0 * (gwght(IGap,i)/gwght(IGap,j))**0.25d0)**2
! using the common denominator, downer, calculate the denomonator for eq. 65
if (i.ne.j) kdpdown(i) = kdpdown(i) + (phikup/downer)*(frct(j)/frct(i))
end do
mumix = mumix + fvis(i)/mukpdwn(i) ! eq. 60
kpmix = kpmix + kprime(i)/kpdown(i) ! eq. 63
kdpmix = kdpmix + kdblprm(i)/kdpdown(i) ! eq. 65
end do
! Calculate the density of the mixture assuming an ideal gas
rhomix = pres * molmix / (gaslaw * tmean) ! eq. 57
kmix = kpmix + kdpmix ! eq. 68-a
! Final mixture properties
visc=mumix
con=kmix
dens=rhomix
cp=cpmixm/molmix
endif ! End of check if single or multiple gases in gap
pr = cp * visc / con
gr = 9.807d0 * gap(IGap)**3 * ABS(tleft-tright) * dens**2 / (tmean * visc**2)
RETURN
END SUBROUTINE WindowGasConductance