Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
fw 3/4/03 if(iter >= 1) hr(i) = 0.5*(hrprev(i)+hr(i))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | ConstrNum | ||||
real(kind=r64) | :: | hgap(5) |
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 WindowTempsForNominalCond(ConstrNum,hgap)
! SUBROUTINE INFORMATION:
! AUTHOR F. Winkelmann
! DATE WRITTEN September 2000
! MODIFIED Nov 2002, FW: increase MaxIterations from 15 to 100, add face
! temperature relaxation, and increase convergence tolerance by
! a factor of 10 if no convergence after MaxIterations,
! all for consistency with SolveForWindowTemperatures.
! Mar 2003, FW: increase convergence tolerance from 0.01 to 0.02;
! remove redundant relaxation on radiative conductances (both of
! these were also done in SolveForWindowTemperatures).
! Jan 2009, BG: changed interior convection coefficient correlation to match
! ISO 15099.
! Feb 2009, BG: extended coefficient to include absorbed radiation
! to cover summer conditions for SHGC determination.
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This is a shortened form of SolveForWindowTemperatures tailored
! for calculation of the nominal center-of-glass U-value for a window
! construction at ASHRAE winter conditions and for determining conditions at
! summer conditions for calculationg SHGC.
!
! Evaluates the coefficients Aface and Bface in the system of linear
! algebraic equations
!
! Sum [Aface(i,j)*thetas(j)] = Bface(i), i = 1,nglface
! j=1,nglface
!
! where
!
! nglface = number of glass faces (= 2 * number of layers) and
! thetas(j) = temperature of face j
! METHODOLOGY EMPLOYED:
! The Aface and Bface coefficients are determined by the equations for
! heat balance at the glass faces. The system of linear equations is solved
! by LU decomposition.
! REFERENCES:
! na
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW
!unused0909 USE DataEnvironment, ONLY: StdBaroPress
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: ConstrNum ! Construction number
REAL(r64) :: hgap(5) ! Gap gas conductive conductance (W/m2-K)
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIterations = 100 ! Maximum allowed number of iterations
REAL(r64), PARAMETER :: errtemptol = 0.02d0 ! Tolerance on errtemp for convergence
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: i ! Counter
REAL(r64) :: gr ! Grashof number of gas in a gap
REAL(r64) :: con ! Gap gas conductivity
REAL(r64) :: pr ! Gap gas Prandtl number
REAL(r64) :: nu ! Gap gas Nusselt number
REAL(r64) :: hr(10) ! Radiative conductance (W/m2-K)
REAL(r64) :: hrprev(10) ! Value of hr from previous iteration
REAL(r64) :: hcinprev ! Value of hcin from previous iteration
REAL(r64) :: d ! +1 if number of row interchanges is even,
! -1 if odd (in LU decomposition)
INTEGER :: indx(10) ! Vector of row permutations in LU decomposition
REAL(r64) :: Aface(10,10) ! Coefficient in equation Aface*thetas = Bface
REAL(r64) :: Bface(10) ! Coefficient in equation Aface*thetas = Bface
INTEGER :: iter ! Iteration number
REAL(r64) :: errtemp ! Absolute value of sum of face temperature differences
! between iterations, divided by number of faces
REAL(r64) :: TmeanFilm ! mean film temperature
REAL(r64) :: TmeanFilmKelvin ! mean film temperature for property evaluation
REAL(r64) :: rho ! density of (apparently dry) air [kg/m3]
REAL(r64) :: g ! acceleration due to gravity [m/s2]
REAL(r64) :: Height ! window cavity height [m]
REAL(r64) :: Cp ! specific heat of air [J/kg-K]
REAL(r64) :: lambda ! thermal conductivity of air [W/m-K]
REAL(r64) :: mu ! dynamic viscosity of air [kg/m-s]
REAL(r64) :: RaH ! Rayleigh number for cavity height [ Non dim]
REAL(r64) :: tiltDeg ! glazing tilt in degrees
REAL(r64) :: sineTilt ! sine of glazing tilt
REAL(r64) :: Nuint ! Nusselt number for interior surface convection
iter = 0
! Initialize face temperatures
CALL StartingWinTempsForNominalCond
! Calculate radiative conductance
errtemp=errtemptol*2.0d0
TiltDeg= 90.0D0
sineTilt = SIN(tiltDeg*DegToRadians) !degrees as arg
DO WHILE (iter < MaxIterations .and. errtemp > errtemptol)
DO i = 1,nglface
hr(i) = emis(i) * sigma * thetas(i)**3
!!fw 3/4/03 if(iter >= 1) hr(i) = 0.5*(hrprev(i)+hr(i))
hrprev(i) = hr(i)
END DO
Aface = 0.0d0
Bface = 0.0d0
! Inside convective film conductance for vertical window
if (iter >= 1) then
hcinprev = hcin
endif
! CR7670 BG this next correlation was used for hcin but is not "standard" for windows
! hcin = 1.31d0*((ABS(thetas(nglface)-tin))**0.3333d0)
! Begin calculating for ISO 15099 method.
! mean film temperature
TmeanFilmKelvin = tin + 0.25D0*(thetas(nglface) - tin) ! eq. 133 in ISO 15099
TmeanFilm = TmeanFilmKelvin - 273.15D0
! the following properties are constants or linear relations for "standard" type reporting
rho = PsyRhoAirFnPbTdbW(101325.0D0, TmeanFilm, 0.0D0, 'WindowTempsForNominalCond') ! dry air assumption
g = 9.81D0
Height = 1.0D0 ! standard window rating practice is to use 1 meter (rather than actual)
lambda = 2.873D-3 + 7.76D-5 * TmeanFilmKelvin ! Table B.1 in ISO 15099
mu = 3.723D-6 + 4.94D-8 * TmeanFilmKelvin ! Table B.2 in ISO 15099
Cp = 1002.737D0 + 1.2324D-2 * TmeanFilmKelvin ! Table B.3 in ISO 15099
RaH = ( rho**2 * Height**3 * g * Cp*(ABS(thetas(nglface)-tin) ) ) &
/ (TmeanFilmKelvin * mu * lambda) ! eq 132 in ISO 15099
Nuint = 0.56D0*(RaH * sineTilt)**0.25D0 ! eq. 135 in ISO 15099 (only need this one because tilt is 90 deg
hcin = Nuint * lambda / Height
! End calculations for ISO 15099 method.
if(iter >= 1) hcin = 0.5D0*(hcinprev+hcin)
iter = iter + 1
SELECT CASE(ngllayer)
CASE(1)
Bface(1) = outir*emis(1) + hcout*tout + AbsRadGlassFace(1)
Bface(2) = rmir*emis(2) + hcin*tin + AbsRadGlassFace(2)
Aface(1,1) = hr(1) + scon(1) + hcout
Aface(1,2) = -scon(1)
Aface(2,1) = -scon(1)
Aface(2,2) = hr(2) + scon(1) + hcin
CASE(2)
call WindowGasConductance(thetas(2),thetas(3),1,con,pr,gr)
call NusseltNumber(0,thetas(2),thetas(3),1,gr,pr,nu)
hgap(1) = con/gap(1)*nu
Bface(1) = outir*emis(1) + hcout*tout + AbsRadGlassFace(1)
Bface(2) = AbsRadGlassFace(2)
Bface(3) = AbsRadGlassFace(3)
Bface(4) = rmir*emis(4) + hcin*tin + AbsRadGlassFace(4)
Aface(1,1) = hr(1) + scon(1) + hcout
Aface(1,2) = -scon(1)
Aface(2,1) = -scon(1)
Aface(2,2) = scon(1) + hgap(1) - A23P*hr(2)
Aface(2,3) = -hgap(1) - A32P*hr(3)
Aface(3,2) = -hgap(1) + A23P*hr(2)
Aface(3,3) = hgap(1) + scon(2) + A32P*hr(3)
Aface(3,4) = -scon(2)
Aface(4,3) = -scon(2)
Aface(4,4) = hr(4) + scon(2) + hcin
CASE(3)
call WindowGasConductance(thetas(2),thetas(3),1,con,pr,gr)
call NusseltNumber(0,thetas(2),thetas(3),1,gr,pr,nu)
hgap(1) = con/gap(1)*nu
call WindowGasConductance(thetas(4),thetas(5),2,con,pr,gr)
call NusseltNumber(0,thetas(4),thetas(5),2,gr,pr,nu)
hgap(2) = con/gap(2)*nu
Bface(1) = outir*emis(1) + hcout*tout + AbsRadGlassFace(1)
Bface(2) = AbsRadGlassFace(2)
Bface(3) = AbsRadGlassFace(3)
Bface(4) = AbsRadGlassFace(4)
Bface(5) = AbsRadGlassFace(5)
Bface(6) = rmir*emis(6) + hcin*tin + AbsRadGlassFace(6)
Aface(1,1) = hr(1) + scon(1) + hcout
Aface(1,2) = -scon(1)
Aface(2,1) = -scon(1)
Aface(2,2) = scon(1) + hgap(1) - A23P*hr(2)
Aface(2,3) = -hgap(1) - A32P*hr(3)
Aface(3,2) = -hgap(1) + A23P*hr(2)
Aface(3,3) = hgap(1) + scon(2) + A32P*hr(3)
Aface(3,4) = -scon(2)
Aface(4,3) = -scon(2)
Aface(4,4) = scon(2) + hgap(2) - A45P*hr(4)
Aface(4,5) = -hgap(2) - A54P*hr(5)
Aface(5,4) = -hgap(2) + A45P*hr(4)
Aface(5,5) = hgap(2) + scon(3) + A54P*hr(5)
Aface(5,6) = -scon(3)
Aface(6,5) = -scon(3)
Aface(6,6) = hr(6) + scon(3) + hcin
CASE(4)
call WindowGasConductance(thetas(2),thetas(3),1,con,pr,gr)
call NusseltNumber(0,thetas(2),thetas(3),1,gr,pr,nu)
hgap(1) = con/gap(1)*nu
call WindowGasConductance(thetas(4),thetas(5),2,con,pr,gr)
call NusseltNumber(0,thetas(4),thetas(5),2,gr,pr,nu)
hgap(2) = con/gap(2)*nu
call WindowGasConductance(thetas(6),thetas(7),3,con,pr,gr)
call NusseltNumber(0,thetas(6),thetas(7),3,gr,pr,nu)
hgap(3) = con/gap(3)*nu
Bface(1) = outir*emis(1) + hcout*tout + AbsRadGlassFace(1)
Bface(2) = AbsRadGlassFace(2)
Bface(3) = AbsRadGlassFace(3)
Bface(4) = AbsRadGlassFace(4)
Bface(5) = AbsRadGlassFace(5)
Bface(6) = AbsRadGlassFace(6)
Bface(7) = AbsRadGlassFace(7)
Bface(8) = rmir*emis(8) + hcin*tin + AbsRadGlassFace(8)
Aface(1,1) = hr(1) + scon(1) + hcout
Aface(1,2) = -scon(1)
Aface(2,1) = -scon(1)
Aface(2,2) = scon(1) + hgap(1) - A23P*hr(2)
Aface(2,3) = -hgap(1) - A32P*hr(3)
Aface(3,2) = -hgap(1) + A23P*hr(2)
Aface(3,3) = hgap(1) + scon(2) + A32P*hr(3)
Aface(3,4) = -scon(2)
Aface(4,3) = -scon(2)
Aface(4,4) = scon(2) + hgap(2) - A45P*hr(4)
Aface(4,5) = -hgap(2) - A54P*hr(5)
Aface(5,4) = -hgap(2) + A45P*hr(4)
Aface(5,5) = hgap(2) + scon(3) + A54P*hr(5)
Aface(5,6) = -scon(3)
Aface(6,5) = -scon(3)
Aface(6,6) = scon(3) + hgap(3) - A67P*hr(6)
Aface(6,7) = -hgap(3) - A76P*hr(7)
Aface(7,6) = -hgap(3) + A67P*hr(6)
Aface(7,7) = hgap(3) + scon(4) + A76P*hr(7)
Aface(7,8) = -scon(4)
Aface(8,7) = -scon(4)
Aface(8,8) = hr(8) + scon(4) + hcin
END SELECT
call LUdecomposition(Aface,nglface,indx,d) ! Note that these routines change Aface;
call LUsolution(Aface,nglface,indx,Bface) ! face temperatures are returned in Bface
errtemp = 0.0d0
DO i = 1,nglface
errtemp = errtemp + ABS(thetas(i)-Bface(i))/nglface
END DO
DO i = 1,nglface
thetas(i) = 0.5d0*(thetas(i) + Bface(i))
END DO
END DO
! No convergence after MaxIterations; and/or error tolerance
IF (errtemp >= 10*errtemptol) THEN
! Fatal error: didn't converge
call ShowFatalError('Convergence error in WindowTempsForNominalCond for construction '&
//TRIM(Construct(ConstrNum)%Name))
END IF
return
END SUBROUTINE WindowTempsForNominalCond