!! Following may need to be removed or changed when shelves are considered in adjacent reflection calculations
SUBROUTINE InitSolarHeatGains
! SUBROUTINE INFORMATION:
! AUTHOR Anonymous
! DATE WRITTEN July 1977
! MODIFIED Mar99 (FW): handle movable interior shades and
! switchable glazing
! Oct99 (FW): account for Window5 glass calculation approach
! May01 (FW): handle interior and exterior blinds
! Sep03 (FW): initialize SurfaceWindow%FrameQRadOutAbs
! May06 (RR): handle exterior window screens
! RE-ENGINEERED Feb98 (RKS)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine initializes the arrays associated with solar heat
! gains for both individual surfaces and for zones. As a result,
! this routine sets the following variable arrays:
! QBV(unused), QDV, QC, QD; QRadSWOutAbs and QRadSWInAbs (for opaque surfaces);
! QRadSWwinAbs (for windows)
! METHODOLOGY EMPLOYED:
! If the sun is down, all of the pertinent arrays are zeroed. If the
! sun is up, various calculations are made.
! REFERENCES:
! (I)BLAST legacy routine QSUN
! USE STATEMENTS:
USE SolarShading, ONLY: CalcInteriorSolarDistribution
USE HeatBalanceMovableInsulation
USE General, ONLY: POLYF, InterpSw, InterpBlind, InterpProfAng, InterpSlatAng, InterpProfSlatAng, BlindBeamBeamTrans
USE DataDaylightingDevices
USE DaylightingDevices, ONLY: FindTDDPipe, TransTDD
USE DataWindowEquivalentLayer
USE SolarShading, ONLY: SurfaceScheduledSolarInc, WindowScheduledSolarAbs
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: AbsExt ! Absorptivity of outer most layer (or movable insulation if present)
INTEGER :: ConstrNum ! Index for the Construct derived type
INTEGER :: ConstrNumSh ! Shaded window construction
REAL(r64) :: HMovInsul ! Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used)
INTEGER :: RoughIndexMovInsul ! Roughness index of movable insulation
INTEGER :: SurfNum ! DO loop counter for surfaces
INTEGER :: SurfNum2 ! TDD:DOME object number
INTEGER :: PipeNum ! TDD pipe object number
INTEGER :: ShelfNum ! Daylighting shelf object number
INTEGER :: InShelfSurf ! Inside daylighting shelf surface number
INTEGER :: OutShelfSurf ! Outside daylighting shelf surface number
REAL(r64) :: ShelfSolarRad ! Shelf diffuse solar radiation
INTEGER :: ShadeFlag ! Window shading flag
REAL(r64) :: SwitchFac ! Switching factor for switchable glazing
INTEGER :: ZoneNum ! DO loop counter for zones
REAL(r64) :: BeamSolar ! Local variable for BeamSolarRad
REAL(r64) :: SkySolarInc ! Sky diffuse solar incident on a surface
REAL(r64) :: GndSolarInc ! Ground diffuse solar incident on a surface
INTEGER :: TotGlassLay ! Number of glass layers
INTEGER :: TotSolidLay ! Number of solid layers in fenestration system (glass + shading)
INTEGER :: CurrentState ! Current state for Complex Fenestration
REAL(r64) :: AbsDiffWin(CFSMAXNL) ! Diffuse solar absorptance of glass layers
REAL(r64) :: AbsDiffWinGnd(CFSMAXNL) ! Ground diffuse solar absorptance of glass layers
REAL(r64) :: AbsDiffWinSky(CFSMAXNL) ! Sky diffuse solar absorptance of glass layers
INTEGER :: Lay ! Layer number
REAL(r64) :: DividerAbs ! Window divider solar absorptance
REAL(r64) :: DividerRefl ! Window divider solar reflectance
INTEGER :: MatNumGl ! Outer glass layer material number
INTEGER :: MatNumGlSh ! Outer glass layer material number, switched construction
REAL(r64) :: TransGl,ReflGl,AbsGl ! Outer glass solar transmittance, reflectance, absorptance
REAL(r64) :: TransGlSh,ReflGlSh,AbsGlSh ! Outer glass solar trans, refl, absorptance if switched
REAL(r64) :: TransDiffGl ! Diffuse solar transmittance
REAL(r64) :: TransDiffGlSh ! Diffuse solar transmittance, switched construction
INTEGER :: FrDivNum ! Frame/divider number
REAL(r64) :: FrArea,DivArea ! Frame, divider area (m2)
REAL(r64) :: FrWidth, DivWidth ! Frame, divider width (m)
REAL(r64) :: FrProjOut, DivProjOut ! Frame, divider outside projection (m)
REAL(r64) :: FrProjIn, DivProjIn ! Frame, divider outside projection (m)
REAL(r64) :: PhiWin,ThWin ! Altitude and azimuth angle of outward window normal (radians)
REAL(r64) :: PhiSun,ThSun ! Altitude and azimuth angle of sun (radians)
REAL(r64) :: CosInc ! Cosine of incidence angle of beam solar on glass
REAL(r64) :: CosIncAngHorProj ! Cosine of incidence angle of sun on horizontal faces of a frame or
! divider projection
REAL(r64) :: CosIncAngVertProj ! Cosine of incidence angle of sun on vertical faces of a frame or
! divider projection
REAL(r64) :: FracSunLit ! Fraction of window sunlit this time step
REAL(r64) :: BeamFaceInc ! Beam solar incident window plane this time step (W/m2)
REAL(r64) :: DifSolarFaceInc ! Diffuse solar incident on window plane this time step (W/m2)
REAL(r64) :: FrIncSolarOut ! Total solar incident on outside offrame including solar
! on frame projection (W/m2)
REAL(r64) :: FrIncSolarIn ! Total solar incident on inside offrame including solar
! on frame projection (W/m2)
REAL(r64) :: DivIncSolarOutBm ! Beam solar incident on outside of divider including beam on divider
! projection (W/m2)
REAL(r64) :: DivIncSolarOutDif ! Diffuse solar incident on outside of divider including diffuse on divider
! projection (W/m2)
REAL(r64) :: DivIncSolarInBm ! Beam solar incident on inside of divider including beam on divider
! projection (W/m2)
REAL(r64) :: DivIncSolarInDif ! Diffuse solar incident on inside of divider including diffuse on divider
! projection (W/m2)
REAL(r64) :: BeamFrHorFaceInc ! Beam solar on frame's horizontal projection faces (W/m2)
REAL(r64) :: BeamFrVertFaceInc ! Beam solar on frame's vertical projection faces (W/m2)
REAL(r64) :: BeamDivHorFaceInc ! Beam solar on divider's horizontal outside projection faces (W/m2)
REAL(r64) :: BeamDivVertFaceInc ! Beam solar on divider's vertical outside projection faces (W/m2)
REAL(r64) :: BeamDivHorFaceIncIn ! Beam solar on divider's horizontal inside projection faces (W/m2)
REAL(r64) :: BeamDivVertFaceIncIn ! Beam solar on divider's vertical inside projection faces (W/m2)
INTEGER :: BlNum ! Blind number
REAL(r64) :: ProfAng ! Solar profile angle (rad)
REAL(r64) :: SlatAng ! Slat angle (rad)
REAL(r64) :: TBlBmBm ! Blind beam-beam solar transmittance
REAL(r64) :: TBlBmDif ! Blind diffuse-diffuse solar transmittance
REAL(r64) :: ACosTlt ! Absolute value of cosine of surface tilt angle
REAL(r64) :: AbsDiffBlindGnd ! System blind front ground diffuse solar absorptance at a particular slat angle
REAL(r64) :: AbsDiffBlindSky ! System blind front sky diffuse solar absorptance at a particular slat angle
REAL(r64) :: AbsDiffGlassLayGnd ! System glass layer ground diffuse solar absorptance with blind on
REAL(r64) :: AbsDiffGlassLaySky ! System glass layer sky diffuse solar absorptance with blind on
INTEGER :: OtherZoneNum ! Adjacent zone number
INTEGER :: SurfSolAbs ! Pointer to scheduled surface gains object for fenestration systems
INTEGER :: SurfSolIncPtr ! Pointer to schedule surface gain object for interior side of the surface
! Always initialize the shortwave quantities
QRadSWOutAbs = 0.0d0
QRadSWInAbs = 0.0d0
QRadSWLightsInAbs = 0.d0
QRadSWwinAbs = 0.0d0
InitialDifSolInAbs = 0.0d0
InitialDifSolInTrans = 0.0d0
InitialDifSolwinAbs = 0.0d0
InitialZoneDifSolReflW = 0.0d0
QRadSWwinAbsTot = 0.0d0
QRadSWwinAbsLayer = 0.0d0
SWwinAbsTotalReport = 0.0d0
InitialDifSolInAbsReport = 0.0d0
InitialDifSolInTransReport = 0.0d0
SWInAbsTotalReport = 0.0d0
SWOutAbsTotalReport = 0.d0
SWOutAbsEnergyReport = 0.d0
QRadSWOutIncident = 0.0d0
QRadSWOutIncidentBeam = 0.0d0
BmIncInsSurfIntensRep = 0.0d0
BmIncInsSurfAmountRep = 0.0d0
IntBmIncInsSurfIntensRep = 0.0d0
IntBmIncInsSurfAmountRep = 0.0d0
QRadSWOutIncidentSkyDiffuse = 0.0d0
QRadSWOutIncidentGndDiffuse = 0.0d0
QRadSWOutIncBmToDiffReflGnd = 0.0d0
QRadSWOutIncSkyDiffReflGnd = 0.0d0
QRadSWOutIncBmToBmReflObs = 0.0d0
QRadSWOutIncBmToDiffReflObs = 0.0d0
QRadSWOutIncSkyDiffReflObs = 0.0d0
CosIncidenceAngle = 0.0d0
BSDFBeamDirectionRep = 0
BSDFBeamThetaRep = 0.0d0
BSDFBeamPhiRep = 0.0d0
OpaqSurfInsFaceBeamSolAbsorbed = 0.0d0
DO SurfNum = 1, TotSurfaces
SurfaceWindow(SurfNum)%FrameQRadOutAbs = 0.0d0
SurfaceWindow(SurfNum)%FrameQRadInAbs = 0.0d0
SurfaceWindow(SurfNum)%DividerQRadOutAbs = 0.0d0
SurfaceWindow(SurfNum)%DividerQRadInAbs = 0.0d0
SurfaceWindow(SurfNum)%ExtBeamAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%ExtDiffAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%IntBeamAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%IntSWAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%InitialDifSolAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%IntLWAbsByShade = 0.0d0
SurfaceWindow(SurfNum)%ConvHeatFlowNatural = 0.0d0
SurfaceWindow(SurfNum)%ConvHeatGainToZoneAir = 0.0d0
SurfaceWindow(SurfNum)%RetHeatGainToZoneAir = 0.0d0
SurfaceWindow(SurfNum)%DividerConduction = 0.0d0
SurfaceWindow(SurfNum)%BlTsolBmBm = 0.0d0
SurfaceWindow(SurfNum)%BlTsolBmDif = 0.0d0
SurfaceWindow(SurfNum)%BlTsolDifDif = 0.0d0
SurfaceWindow(SurfNum)%BlGlSysTsolBmBm = 0.0d0
SurfaceWindow(SurfNum)%BlGlSysTsolDifDif = 0.0d0
SurfaceWindow(SurfNum)%ScTsolBmBm = 0.0d0
SurfaceWindow(SurfNum)%ScTsolBmDif = 0.0d0
SurfaceWindow(SurfNum)%ScTsolDifDif = 0.0d0
SurfaceWindow(SurfNum)%ScGlSysTsolBmBm = 0.0d0
SurfaceWindow(SurfNum)%ScGlSysTsolDifDif = 0.0d0
SurfaceWindow(SurfNum)%GlTsolBmBm = 0.0d0
SurfaceWindow(SurfNum)%GlTsolBmDif = 0.0d0
SurfaceWindow(SurfNum)%GlTsolDifDif = 0.0d0
SurfaceWindow(SurfNum)%BmSolTransThruIntWinRep = 0.0d0
SurfaceWindow(SurfNum)%BmSolAbsdOutsReveal = 0.0d0
SurfaceWindow(SurfNum)%BmSolRefldOutsRevealReport = 0.0d0
SurfaceWindow(SurfNum)%BmSolAbsdInsReveal = 0.0d0
SurfaceWindow(SurfNum)%BmSolRefldInsReveal = 0.0d0
SurfaceWindow(SurfNum)%BmSolRefldInsRevealReport = 0.0d0
SurfaceWindow(SurfNum)%OutsRevealDiffOntoGlazing = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffOntoGlazing = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffIntoZone = 0.0d0
SurfaceWindow(SurfNum)%OutsRevealDiffOntoFrame = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffOntoFrame = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffOntoGlazingReport = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffIntoZoneReport = 0.0d0
SurfaceWindow(SurfNum)%InsRevealDiffOntoFrameReport = 0.0d0
SurfaceWindow(SurfNum)%BmSolAbsdInsRevealReport = 0.0d0
SurfaceWindow(SurfNum)%BmSolTransThruIntWinRepEnergy = 0.0d0
SurfaceWindow(SurfNum)%BmSolRefldOutsRevealRepEnergy = 0.0d0
SurfaceWindow(SurfNum)%BmSolRefldInsRevealRepEnergy = 0.0d0
SurfaceWindow(SurfNum)%ProfileAngHor = 0.0d0
SurfaceWindow(SurfNum)%ProfileAngVert = 0.0d0
SurfaceWindow(SurfNum)%SkySolarInc = 0.0d0
SurfaceWindow(SurfNum)%GndSolarInc = 0.0d0
end DO
WinHeatGain = 0.0d0
WinHeatGainRep = 0.0d0
WinHeatLossRep = 0.0d0
WinGainConvGlazToZoneRep = 0.0D0
WinGainIRGlazToZoneRep = 0.0D0
WinLossSWZoneToOutWinRep = 0.0D0
WinGainFrameDividerToZoneRep = 0.0D0
WinGainConvGlazShadGapToZoneRep = 0.0D0
WinGainConvShadeToZoneRep = 0.0D0
WinGainIRShadeToZoneRep = 0.0D0
OtherConvGainInsideFaceToZoneRep= 0.0d0
WinGapConvHtFlowRep = 0.0d0
OpaqSurfInsFaceCondGainRep = 0.0d0
OpaqSurfInsFaceCondLossRep = 0.0d0
ZoneWinHeatGain = 0.0d0
ZoneWinHeatGainRep = 0.0d0
ZoneWinHeatLossRep = 0.0d0
ZoneOpaqSurfInsFaceCond = 0.0d0
ZoneOpaqSurfInsFaceCondGainRep = 0.0d0
ZoneOpaqSurfInsFaceCondLossRep = 0.0d0
ZoneOpaqSurfExtFaceCond = 0.d0
ZoneOpaqSurfExtFaceCondGainRep = 0.d0
ZoneOpaqSurfExtFaceCondLossRep = 0.d0
WinShadingAbsorbedSolar = 0.0d0
WinSysSolTransmittance = 0.0d0
WinSysSolReflectance = 0.0d0
WinSysSolAbsorptance = 0.0d0
IF (NumOfTDDPipes > 0) THEN
TDDPipe%HeatGain = 0.0d0
TDDPipe%HeatLoss = 0.0d0
ENDIF
BmIncInsSurfIntensRep = 0.0d0
BmIncInsSurfAmountRep = 0.0d0
IntBmIncInsSurfIntensRep = 0.0d0
IntBmIncInsSurfAmountRep = 0.0d0
!energy
QRadSWwinAbsTotEnergy = 0.0d0
BmIncInsSurfAmountRepEnergy = 0.0d0
IntBmIncInsSurfAmountRepEnergy = 0.0d0
WinHeatGainRepEnergy = 0.0d0
WinHeatLossRepEnergy = 0.0d0
WinGapConvHtFlowRepEnergy = 0.0d0
ZoneWinHeatGainRepEnergy = 0.0d0
ZoneWinHeatLossRepEnergy = 0.0d0
ZnOpqSurfInsFaceCondGnRepEnrg = 0.0d0
ZnOpqSurfInsFaceCondLsRepEnrg = 0.0d0
ZnOpqSurfExtFaceCondGnRepEnrg = 0.d0
ZnOpqSurfExtFaceCondLsRepEnrg = 0.d0
WinShadingAbsorbedSolarEnergy = 0.0d0
BmIncInsSurfAmountRepEnergy = 0.0d0
IntBmIncInsSurfAmountRepEnergy = 0.0d0
IF (.not. SunIsUp .or. (BeamSolarRad+GndSolarRad+DifSolarRad <= 0.0d0)) THEN ! Sun is down
QD = 0.0d0
QDforDaylight = 0.0d0
QC = 0.0d0
QDV = 0.0d0
!unused QBV = 0.0
ZoneTransSolar = 0.0d0
ZoneBmSolFrExtWinsRep = 0.0d0
ZoneBmSolFrIntWinsRep = 0.0d0
ZoneDifSolFrExtWinsRep = 0.0d0
ZoneDifSolFrIntWinsRep = 0.0d0
WinTransSolar = 0.0d0
WinBmSolar = 0.0d0
WinBmBmSolar = 0.0d0
WinBmDifSolar = 0.0d0
WinDifSolar = 0.0d0
WinDirSolTransAtIncAngle = 0.0d0
!energy
ZoneTransSolarEnergy = 0.0d0
ZoneBmSolFrExtWinsRepEnergy = 0.0d0
ZoneBmSolFrIntWinsRepEnergy = 0.0d0
ZoneDifSolFrExtWinsRepEnergy = 0.0d0
ZoneDifSolFrIntWinsRepEnergy = 0.0d0
WinTransSolarEnergy = 0.0d0
WinBmSolarEnergy = 0.0d0
WinBmBmSolarEnergy = 0.0d0
WinBmDifSolarEnergy = 0.0d0
WinDifSolarEnergy = 0.0d0
IF (NumOfTDDPipes > 0) THEN
TDDPipe%TransSolBeam = 0.0d0
TDDPipe%TransSolDiff = 0.0d0
TDDPipe%TransVisBeam = 0.0d0
TDDPipe%TransVisDiff = 0.0d0
TDDPipe%TransmittedSolar = 0.0d0
ENDIF
IF(CalcSolRefl) THEN
BmToBmReflFacObs = 0.0d0
BmToDiffReflFacObs = 0.0d0
BmToDiffReflFacGnd = 0.0d0
END IF
ELSE ! Sun is up, calculate solar quantities
DO SurfNum = 1,TotSurfaces
SurfaceWindow(SurfNum)%SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum)
SurfaceWindow(SurfNum)%GndSolarInc = GndSolarRad * Surface(SurfNum)%ViewFactorGround
!For Complex Fenestrations:
SurfaceWindow(SurfNum)%SkyGndSolarInc = SurfaceWindow(SurfNum)%GndSolarInc
SurfaceWindow(SurfNum)%BmGndSolarInc =0.0d0
!
IF(CalcSolRefl) THEN
!For Complex Fenestrations:
SurfaceWindow(SurfNum)%SkyGndSolarInc = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum)
SurfaceWindow(SurfNum)%BmGndSolarInc =BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum)
!
BmToBmReflFacObs(SurfNum) = (WeightNow * ReflFacBmToBmSolObs(SurfNum,HourOfDay) + &
WeightPreviousHour * ReflFacBmToBmSolObs(SurfNum,PreviousHour))
BmToDiffReflFacObs(SurfNum) = (WeightNow * ReflFacBmToDiffSolObs(SurfNum,HourOfDay) + &
WeightPreviousHour * ReflFacBmToDiffSolObs(SurfNum,PreviousHour))
BmToDiffReflFacGnd(SurfNum) = (WeightNow * ReflFacBmToDiffSolGnd(SurfNum,HourOfDay) + &
WeightPreviousHour * ReflFacBmToDiffSolGnd(SurfNum,PreviousHour))
! TH2 CR 9056
SurfaceWindow(SurfNum)%SkySolarInc = SurfaceWindow(SurfNum)%SkySolarInc + &
BeamSolarRad * (BmToBmReflFacObs(SurfNum) + BmToDiffReflFacObs(SurfNum)) + &
DifSolarRad * ReflFacSkySolObs(SurfNum)
SurfaceWindow(SurfNum)%GndSolarInc = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum) + &
DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum)
END IF
END DO
CALL CalcWindowProfileAngles
IF(CalcWindowRevealReflection) CALL CalcBeamSolarOnWinRevealSurface
CALL CalcInteriorSolarDistribution
DO ZoneNum = 1, NumOfZones
! TH 3/24/2010 - QBV is not used!
!unused QBV(ZoneNum) = (CBZone(ZoneNum) + DBZone(ZoneNum))*BeamSolarRad
! RJH 08/30/07 - QDV does not seem to ever be used. NOT USED!
!QDV(ZoneNum) = DSZone(ZoneNum)*DifSolarRad &
! +DGZone(ZoneNum)*GndSolarRad
! Original QD calc used only for QSDifSol and daylighting calcs
!QDforDaylight(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad &
! +DSZone(ZoneNum)*DifSolarRad &
! +DGZone(ZoneNum)*GndSolarRad
! TH 3/23/2010. CR 7869 and CR 7999. QDforDaylight in W
! Beam from interior windows (DBZoneIntWin) reflected from floor is counted in DayltgInterReflIllFrIntWins,
! DBZone needs to subtract this part since it is already counted in DBZone.
! Use InitialZoneDifSolReflW (Rob's previous work) as it better counts initial distribution of
! diffuse solar rather than using weighted area*absorptance
QDforDaylight(ZoneNum) = (DBZone(ZoneNum) - DBZoneIntWin(ZoneNum)) * BeamSolarRad + DBZoneSSG(ZoneNum) &
+ InitialZoneDifSolReflW(ZoneNum)
! RJH 08/30/07 - Substitute InitialZoneDifSolReflW(ZoneNum) for DSZone and DGZone here
! to exclude diffuse solar now absorbed/transmitted in CalcWinTransDifSolInitialDistribution
! DBZone(ZoneNum) is Diffuse Solar from beam reflected from interior surfaces
! and transmitted through interior windows
! DBZone is a factor that when multiplied by BeamSolarRad [W/m2] gives Watts
!QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad &
! +DSZone(ZoneNum)*DifSolarRad &
! +DGZone(ZoneNum)*GndSolarRad
QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad + DBZoneSSG(ZoneNum) &
+ InitialZoneDifSolReflW(ZoneNum)
END DO
! Flux of diffuse solar in each zone
QSDifSol = 0.0d0
DO ZoneNum = 1, NumOfZones
QSDifSol(ZoneNum) = QDforDaylight(ZoneNum)
END DO
IF (InterZoneWindow) THEN
DO ZoneNum = 1, NumOfZones
IF (RecDifShortFromZ(ZoneNum)) THEN
DO OtherZoneNum = 1, NumOfZones
IF ((OtherZoneNum /= ZoneNum) .AND. (RecDifShortFromZ(OtherZoneNum))) THEN
QSDifSol(ZoneNum) = QSDifSol(ZoneNum) + FractDifShortZtoZ(OtherZoneNum,ZoneNum) * QDforDaylight(OtherZoneNum)
END IF
END DO
END IF
END DO
END IF
DO ZoneNum = 1, NumOfZones
QSDifSol(ZoneNum) = QSDifSol(ZoneNum) * FractDifShortZtoZ(ZoneNum,ZoneNum) * VMULT(ZoneNum)
END DO
! RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method
! DO SurfNum = 1, TotSurfaces
! IF (.NOT. Surface(SurfNum)%HeatTransSurf) CYCLE
!!!! Following may need to be removed or changed when shelves are considered in adjacent reflection calculations
! IF (Surface(SurfNum)%Class == SurfaceClass_Shading) CYCLE
! ZoneNum = Surface(SurfNum)%Zone
! Diffuse solar entering zone through exterior windows is assumed to be uniformly
! distributed on inside face of surfaces of zone
! DifIncInsSurfIntensRep(SurfNum) = (DSZone(ZoneNum)*DifSolarRad + DGZone(ZoneNum)*GndSolarRad) / &
! Zone(ZoneNum)%TotalSurfArea
! DifIncInsSurfAmountRep(SurfNum) = (Surface(SurfNum)%Area + SurfaceWindow(SurfNum)%DividerArea) * &
! DifIncInsSurfIntensRep(SurfNum)
! DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZone * SecInHour
! END DO
DO SurfNum = 1, TotSurfaces
IF (Surface(SurfNum)%HeatTransSurf) THEN
ConstrNum = Surface(SurfNum)%Construction
IF(SurfaceWindow(SurfNum)%StormWinFlag==1) ConstrNum = Surface(SurfNum)%StormWinConstruction
ELSE
ConstrNum=0
END IF
ShelfNum = Surface(SurfNum)%Shelf
IF (ShelfNum > 0) THEN
InShelfSurf = Shelf(ShelfNum)%InSurf ! Inside daylighting shelf present if > 0
OutShelfSurf = Shelf(ShelfNum)%OutSurf ! Outside daylighting shelf present if > 0
ELSE
InShelfSurf = 0
OutShelfSurf = 0
END IF
IF (Surface(SurfNum)%ExtSolar .OR. SurfaceWindow(SurfNum)%OriginalClass == SurfaceClass_TDD_Diffuser) THEN
IF (SurfaceWindow(SurfNum)%OriginalClass == SurfaceClass_TDD_Diffuser) THEN
PipeNum = FindTDDPipe(SurfNum)
SurfNum2 = TDDPipe(PipeNum)%Dome
CosInc = CosIncAng(SurfNum2,HourOfDay,TimeStep)
! Reconstruct the beam, sky, and ground radiation transmittance of just the TDD:DOME and TDD pipe
! by dividing out diffuse solar transmittance of TDD:DIFFUSER
BeamSolar = BeamSolarRad * TransTDD(PipeNum, CosInc, SolarBeam) &
/ Construct(ConstrNum)%TransDiff
SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) &
/ Construct(ConstrNum)%TransDiff
GndSolarInc = GndSolarRad * Surface(SurfNum2)%ViewFactorGround * TDDPipe(PipeNum)%TransSolIso &
/ Construct(ConstrNum)%TransDiff
ELSE IF (OutShelfSurf > 0) THEN ! Outside daylighting shelf
SurfNum2 = SurfNum
CosInc = CosIncAng(SurfNum,HourOfDay,TimeStep)
BeamSolar = BeamSolarRad
SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum)
ShelfSolarRad = (BeamSolarRad * SunlitFrac(OutShelfSurf,HourOfDay,TimeStep) &
* CosIncAng(OutShelfSurf,HourOfDay,TimeStep) + DifSolarRad * AnisoSkyMult(OutShelfSurf)) &
* Shelf(ShelfNum)%OutReflectSol
! Add all reflected solar from the outside shelf to the ground solar
! NOTE: If the shelf blocks part of the view to the ground, the user must reduce the ground view factor!!
GndSolarInc = GndSolarRad * Surface(SurfNum)%ViewFactorGround + ShelfSolarRad * Shelf(ShelfNum)%ViewFactor
ELSE ! Regular surface
SurfNum2 = SurfNum
CosInc = CosIncAng(SurfNum,HourOfDay,TimeStep)
BeamSolar = BeamSolarRad
SkySolarInc = SurfaceWindow(SurfNum)%SkySolarInc
GndSolarInc = SurfaceWindow(SurfNum)%GndSolarInc
END IF
! Cosine of incidence angle and solar incident on outside of surface, for reporting
CosIncidenceAngle(SurfNum) = CosInc
! Report variables for various incident solar quantities
! Incident direct (unreflected) beam
QRadSWOutIncidentBeam(SurfNum) = BeamSolar * SunlitFrac(SurfNum2,HourOfDay,TimeStep) * CosInc ! NOTE: SurfNum2
! Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently
IF (SurfaceWindow(SurfNum)%OriginalClass == SurfaceClass_TDD_Diffuser) THEN
QRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc
ELSE
QRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum)
END IF
! Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground
QRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc
! Incident diffuse solar from beam-to-diffuse reflection from ground
IF(CalcSolRefl) THEN
QRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * &
BmToDiffReflFacGnd(SurfNum)
ELSE
QRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * &
Surface(SurfNum)%ViewFactorGround
END IF
! Incident diffuse solar from sky diffuse reflection from ground
IF(CalcSolRefl) THEN
QRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum)
ELSE
QRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * Surface(SurfNum)%ViewFactorGround
END IF
! Total incident solar. Beam and sky reflection from obstructions, if calculated, is included
! in SkySolarInc.
! QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc
! TH2 CR 9056
QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + QRadSWOutIncidentSkyDiffuse(SurfNum) + &
QRadSWOutIncBmToDiffReflGnd(SurfNum) + QRadSWOutIncSkyDiffReflGnd(SurfNum)
IF(CalcSolRefl) THEN
! Incident beam solar from beam-to-beam (specular) reflection from obstructions
QRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad
! Incident diffuse solar from beam-to-diffuse reflection from obstructions
QRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad
! Incident diffuse solar from sky diffuse reflection from obstructions
QRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum)
! TH2 CR 9056: Add reflections from obstructions to the total incident
QRadSWOutIncident(SurfNum) = QRadSWOutIncident(SurfNum) + QRadSWOutIncBmToBmReflObs(SurfNum) + &
QRadSWOutIncBmToDiffReflObs(SurfNum) + QRadSWOutIncSkyDiffReflObs(SurfNum)
END IF
IF (Surface(SurfNum)%HeatTransSurf) THEN ! Exclude special shading surfaces which required QRadSWOut calculations above
RoughIndexMovInsul = 0
IF (Surface(SurfNum)%MaterialMovInsulExt > 0) &
CALL EvalOutsideMovableInsulation(SurfNum,HMovInsul,RoughIndexMovInsul,AbsExt)
IF (RoughIndexMovInsul <= 0) THEN ! No movable insulation present
IF (Construct(ConstrNum)%TransDiff <= 0.0d0) THEN ! Opaque surface
AbsExt = Material(Construct(ConstrNum)%LayerPoint(1))%AbsorpSolar
ELSE ! Exterior window
IF (SurfaceWindow(SurfNum)%WindowModelType /= WindowBSDFModel .AND. &
SurfaceWindow(SurfNum)%WindowModelType /= WindowEQLModel) THEN
TotGlassLay = Construct(ConstrNum)%TotGlassLayers
DO Lay = 1,TotGlassLay
AbsDiffWin(Lay) = Construct(ConstrNum)%AbsDiff(Lay)
END DO
ShadeFlag = SurfaceWindow(SurfNum)%ShadingFlag
IF(ShadeFlag > 0) THEN ! Shaded window
ConstrNumSh = Surface(SurfNum)%ShadedConstruction
IF(SurfaceWindow(SurfNum)%StormWinFlag==1) ConstrNumSh = Surface(SurfNum)%StormWinShadedConstruction
IF(ShadeFlag==IntShadeOn .OR. ShadeFlag==ExtShadeOn .OR. &
ShadeFlag==BGShadeOn .OR. ShadeFlag==ExtScreenOn) THEN ! Shade/screen on
DO Lay = 1,TotGlassLay
AbsDiffWin(Lay) = Construct(ConstrNumSh)%AbsDiff(Lay)
END DO
SurfaceWindow(SurfNum)%ExtDiffAbsByShade = Construct(ConstrNumSh)%AbsDiffShade * &
(SkySolarInc + GndSolarInc)
END IF
IF(ShadeFlag==IntBlindOn .OR. ShadeFlag==ExtBlindOn .OR. ShadeFlag==BGBlindOn) THEN ! Blind on
DO Lay = 1,TotGlassLay
AbsDiffWin(Lay) = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%BlAbsDiff(Lay,1:MaxSlatAngs))
AbsDiffWinGnd(Lay) = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%BlAbsDiffGnd(Lay,1:MaxSlatAngs))
AbsDiffWinSky(Lay) = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%BlAbsDiffSky(Lay,1:MaxSlatAngs))
END DO
SurfaceWindow(SurfNum)%ExtDiffAbsByShade = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%AbsDiffBlind) * &
(SkySolarInc + GndSolarInc)
IF(Blind(SurfaceWindow(SurfNum)%BlindNumber)%SlatOrientation==Horizontal) THEN
ACosTlt = ABS(Surface(SurfNum)%CosTilt)
AbsDiffBlindGnd = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%AbsDiffBlindGnd)
AbsDiffBlindSky = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%AbsDiffBlindSky)
SurfaceWindow(SurfNum)%ExtDiffAbsByShade = &
SkySolarInc*(0.5d0*ACosTlt*AbsDiffBlindGnd + (1.0d0-0.5d0*ACosTlt)*AbsDiffBlindSky) + &
GndSolarInc*((1.0d0-0.5d0*ACosTlt)*AbsDiffBlindGnd + 0.5d0*ACosTlt*AbsDiffBlindSky)
END IF
END IF
! Correct for shadowing of divider onto interior shading device (note that dividers are
! not allowed in windows with between-glass shade/blind)
IF((ShadeFlag == IntShadeOn .OR. ShadeFlag == IntBlindOn) .AND. SurfaceWindow(SurfNum)%DividerArea > 0.0d0) &
SurfaceWindow(SurfNum)%ExtDiffAbsByShade = SurfaceWindow(SurfNum)%ExtDiffAbsByShade * &
SurfaceWindow(SurfNum)%GlazedFrac
IF(ShadeFlag == SwitchableGlazing) THEN ! Switchable glazing
SwitchFac = SurfaceWindow(SurfNum)%SwitchingFactor
DO Lay = 1,TotGlassLay
AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), Construct(ConstrNumSh)%AbsDiff(Lay))
END DO
END IF
END IF ! End of check if window has shading device on
QRadSWwinAbsTot(SurfNum) = 0.0d0
DO Lay = 1,TotGlassLay
QRadSWwinAbs(SurfNum,Lay) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) &
+ AWinSurf(SurfNum,Lay) * BeamSolar ! AWinSurf is from InteriorSolarDistribution
IF(ShadeFlag==IntBlindOn.OR.ShadeFlag==ExtBlindOn.OR.ShadeFlag==BGBlindOn) THEN
IF(Blind(SurfaceWindow(SurfNum)%BlindNumber)%SlatOrientation==Horizontal) THEN
AbsDiffGlassLayGnd = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%BlAbsDiffGnd(Lay,1:19))
AbsDiffGlassLaySky = InterpSlatAng(SurfaceWindow(SurfNum)%SlatAngThisTs, &
SurfaceWindow(SurfNum)%MovableSlats,Construct(ConstrNumSh)%BlAbsDiffSky(Lay,1:19))
QRadSWwinAbs(SurfNum,Lay) = &
SkySolarInc*(0.5d0*ACosTlt*AbsDiffGlassLayGnd + (1.0d0-0.5d0*ACosTlt)*AbsDiffGlassLaySky) + &
GndSolarInc*((1.0d0-0.5d0*ACosTlt)*AbsDiffGlassLayGnd + 0.5d0*ACosTlt*AbsDiffGlassLaySky) + &
AWinSurf(SurfNum,Lay) * BeamSolar
END IF
END IF
! Total solar absorbed in solid layer (W), for reporting
QRadSWwinAbsLayer(SurfNum,Lay) = QRadSWwinAbs(SurfNum,Lay) * Surface(SurfNum)%Area
! Total solar absorbed in all glass layers (W), for reporting
QRadSWwinAbsTot(SurfNum) = QRadSWwinAbsTot(SurfNum) + QRadSWwinAbsLayer(SurfNum,Lay)
END DO
QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZone * SecInHour
ELSE IF (SurfaceWindow(SurfNum)%WindowModelType == WindowBSDFModel) THEN
TotSolidLay = Construct(ConstrNum)%TotSolidLayers
CurrentState = SurfaceWindow(SurfNum)%ComplexFen%CurrentState
! Examine for schedule surface gain
SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum)
DO Lay = 1, TotSolidLay
IF (SurfSolAbs /= 0) THEN
AWinSurf(SurfNum,Lay) = GetCurrentScheduleValue(FenLayAbsSSG(SurfSolAbs)%SchedPtrs(Lay))
!ABWin(Lay) = AWinSurf(SurfNum,Lay)
QRadSWwinAbs(SurfNum,Lay) = AWinSurf(SurfNum,Lay)
ELSE
! Several notes about this equation. First part is accounting for duffuse solar radiation for the ground and
! from the sky. Second item (AWinSurf(SurfNum,Lay) * BeamSolar) is accounting for absorbed solar radiation
! originating from beam on exterior side. Third item (AWinCFOverlap(SurfNum,Lay)) is accounting for
! absorptances from beam hitting back of the window which passes through rest of exterior windows
QRadSWwinAbs(SurfNum,Lay) = SurfaceWindow(SurfNum)%ComplexFen%State(CurrentState)%WinSkyFtAbs(Lay) * &
& SkySolarInc + SurfaceWindow(SurfNum)%ComplexFen%State(CurrentState)%WinSkyGndAbs(Lay) * GndSolarInc &
& + AWinSurf(SurfNum,Lay) * BeamSolar &
& + AWinCFOverlap(SurfNum,Lay) * BeamSolar
END IF
! Total solar absorbed in solid layer (W), for reporting
QRadSWwinAbsLayer(SurfNum,Lay) = QRadSWwinAbs(SurfNum,Lay) * Surface(SurfNum)%Area
! Total solar absorbed in all glass layers (W), for reporting
QRadSWwinAbsTot(SurfNum) = QRadSWwinAbsTot(SurfNum) + QRadSWwinAbsLayer(SurfNum,Lay)
END DO
QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZone * SecInHour
ShadeFlag = SurfaceWindow(SurfNum)%ShadingFlag
ELSE IF (SurfaceWindow(SurfNum)%WindowModelType == WindowEQLModel) THEN
QRadSWwinAbsTot(SurfNum) = 0.0d0
!EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr
TotSolidLay = CFS(Construct(Surface(SurfNum)%Construction)%EQLConsPtr)%NL
DO Lay = 1, TotSolidLay
! Absorbed window components include:
! (1) beam solar radiation absorbed by all layers in the fenestration
! (2) sky and ground reflected duffuse solar radiation absorbed by all layers
! (3) diffuse short wave incident on the inside face of the fenestration. The short wave internal sources
! include light, ...
AbsDiffWin(Lay) = Construct(ConstrNum)%AbsDiffFrontEQL(Lay)
QRadSWwinAbs(SurfNum,Lay) = AWinSurf(SurfNum,Lay) * BeamSolar &
+ AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc)
! Total solar absorbed in solid layer (W), for reporting
QRadSWwinAbsLayer(SurfNum,Lay) = QRadSWwinAbs(SurfNum,Lay) * Surface(SurfNum)%Area
! Total solar absorbed in all glass layers (W), for reporting
QRadSWwinAbsTot(SurfNum) = QRadSWwinAbsTot(SurfNum) + QRadSWwinAbsLayer(SurfNum,Lay)
END DO
QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZone * SecInHour
END IF ! IF (SurfaceWindow(SurfNum)%WindowModelType /= WindowBSDFModel) THEN
! Solar absorbed by window frame and dividers
FrDivNum = Surface(SurfNum)%FrameDivider
FrArea = SurfaceWindow(SurfNum)%FrameArea
IF (FrDivNum > 0) THEN
FrWidth = FrameDivider(FrDivNum)%FrameWidth
FrProjOut = FrameDivider(FrDivNum)%FrameProjectionOut
FrProjIn = FrameDivider(FrDivNum)%FrameProjectionIn
DivArea = SurfaceWindow(SurfNum)%DividerArea
DivWidth = FrameDivider(FrDivNum)%DividerWidth
DivProjOut = FrameDivider(FrDivNum)%DividerProjectionOut
DivProjIn = FrameDivider(FrDivNum)%DividerProjectionIn
ELSE
FrWidth=0.0d0
FrProjOut=0.0d0
FrProjIn=0.0d0
DivArea=0.0d0
DivWidth=0.0d0
DivProjOut=0.0d0
DivProjIn=0.0d0
ENDIF
CosIncAngHorProj = 0.0d0
CosIncAngVertProj = 0.0d0
IF(FrArea > 0.0d0 .OR. DivArea > 0.0d0) THEN
FracSunLit = SunLitFrac(SurfNum,HourOfDay,TimeStep)
BeamFaceInc = BeamSolarRad * SunLitFrac(SurfNum,HourOfDay,TimeStep)*CosInc
DifSolarFaceInc = SkySolarInc + GndSolarInc
ELSE
FracSunLit=0.0d0
END IF
IF(FracSunLit > 0.0d0) THEN
IF((FrArea > 0.0d0 .AND. (FrProjOut > 0.0d0 .OR. FrProjIn > 0.0d0)) &
.OR. (DivArea > 0.0d0 .AND. (DivProjOut > 0.0d0 .OR. DivProjIn > 0.0d0))) THEN
! Dot products used to calculate beam solar incident on faces of
! frame and divider perpendicular to the glass surface.
! Note that SOLCOS is the current timestep's solar direction cosines.
! PhiWin = ASIN(WALCOS(3,SurfNum))
PhiWin = ASIN(Surface(SurfNum)%OutNormVec(3))
ThWin = ATAN2(Surface(SurfNum)%OutNormVec(2),Surface(SurfNum)%OutNormVec(1))
PhiSun = ASIN(SOLCOS(3))
ThSun = ATAN2(SOLCOS(2),SOLCOS(1))
CosIncAngHorProj = ABS(SIN(PhiWin)*COS(PhiSun)*COS(ThWin-ThSun) - COS(PhiWin)*Sin(PhiSun))
CosIncAngVertProj = ABS(COS(PhiWin)*COS(PhiSun)*SIN(Thwin-ThSun))
END IF
END IF
! Frame solar
! (A window shade or blind, if present, is assumed to not shade the frame, so no special
! treatment of frame solar needed if window has an exterior shade or blind.)
IF(FrArea > 0.0d0) THEN
FrIncSolarOut = BeamFaceInc
FrIncSolarIn = 0.0d0
TransDiffGl = 0.0d0
IF(FrProjOut > 0.0d0 .OR. FrProjIn > 0.0d0) THEN
BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * &
(Surface(SurfNum)%Width - FrameDivider(FrDivNum)%VertDividers*DivWidth)*FracSunLit/FrArea
BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * &
(Surface(SurfNum)%Height - FrameDivider(FrDivNum)%HorDividers*DivWidth)*FracSunLit/FrArea
! Beam solar on outside of frame
FrIncSolarOut = FrIncSolarOut + (BeamFrHorFaceInc + BeamFrVertFaceInc)*FrProjOut
IF(FrProjIn > 0.0d0) THEN
TransGl = POLYF(CosInc,Construct(ConstrNum)%TransSolBeamCoef(1:6))
TransDiffGl = Construct(ConstrNum)%TransDiff
IF(ShadeFlag == SwitchableGlazing) THEN ! Switchable glazing
TransGlSh = POLYF(CosInc,Construct(ConstrNumSh)%TransSolBeamCoef(1:6))
TransGl = InterpSw(SwitchFac,TransGl,TransGlSh)
TransDiffGlSh = Construct(ConstrNumSh)%TransDiff
TransDiffGl = InterpSw(SwitchFac,TransDiffGl,TransDiffGlSh)
END IF
! Beam solar on inside of frame
FrIncSolarIn = (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl
END IF
END IF
! Beam plus diffuse solar on outside of frame
FrIncSolarOut = FrIncSolarOut + DifSolarFaceInc*(1.0d0+0.5d0*SurfaceWindow(SurfNum)%ProjCorrFrOut)
SurfaceWindow(SurfNum)%FrameQRadOutAbs = FrIncSolarOut*SurfaceWindow(SurfNum)%FrameSolAbsorp
! Add diffuse from beam reflected from window outside reveal surfaces
SurfaceWindow(SurfNum)%FrameQRadOutAbs = SurfaceWindow(SurfNum)%FrameQRadOutAbs + BeamSolarRad * &
SurfaceWindow(SurfNum)%OutsRevealDiffOntoFrame * SurfaceWindow(SurfNum)%FrameSolAbsorp
! Beam plus diffuse solar on inside of frame
FrIncSolarIn = FrIncSolarIn + DifSolarFaceInc * TransDiffGl * &
0.5d0 * SurfaceWindow(SurfNum)%ProjCorrFrIn
SurfaceWindow(SurfNum)%FrameQRadInAbs = FrIncSolarIn*SurfaceWindow(SurfNum)%FrameSolAbsorp
! Add diffuse from beam reflected from window inside reveal surfaces
SurfaceWindow(SurfNum)%FrameQRadInAbs = SurfaceWindow(SurfNum)%FrameQRadInAbs + BeamSolarRad * &
SurfaceWindow(SurfNum)%InsRevealDiffOntoFrame * SurfaceWindow(SurfNum)%FrameSolAbsorp
END IF
! Divider solar
! (An exterior shade or blind, when in place, is assumed to completely cover the divider.
! Dividers are not allowed on windows with between-glass shade/blind so DivProjOut and
! DivProjIn will be zero in this case.)
IF(DivArea > 0.0d0) THEN ! Solar absorbed by window divider
DividerAbs = SurfaceWindow(SurfNum)%DividerSolAbsorp
IF(SurfaceWindow(SurfNum)%DividerType == Suspended) THEN
! Suspended (between-glass) divider; account for effect glass on outside of divider
! (note that outside and inside projection for this type of divider are both zero)
MatNumGL = Construct(ConstrNum)%LayerPoint(1)
TransGl = Material(MatNumGl)%Trans
ReflGl = Material(MatNumGl)%ReflectSolBeamFront
AbsGl = 1.0d0-TransGl-ReflGl
IF(ShadeFlag == SwitchableGlazing) THEN ! Switchable glazing
MatNumGlSh = Construct(ConstrNumSh)%LayerPoint(1)
TransGlSh = Material(MatNumGlSh)%Trans
ReflGlSh = Material(MatNumGlSh)%ReflectSolBeamFront
AbsGlSh = 1.0d0-TransGlSh-ReflGlSh
TransGl = InterpSw(SwitchFac,TransGl,TransGlSh)
ReflGl = InterpSw(SwitchFac,ReflGl,ReflGlSh)
AbsGl = InterpSw(SwitchFac,AbsGl,AbsGlSh)
END IF
DividerRefl = 1.0d0-DividerAbs
DividerAbs = AbsGl + TransGl*(DividerAbs + DividerRefl*AbsGl)/(1.0d0-DividerRefl*ReflGl)
END IF
BeamDivHorFaceInc = 0.0d0
BeamDivVertFaceInc = 0.0d0
! Beam incident on horizontal and vertical projection faces of divider if no exterior shading
IF(DivProjOut > 0.0d0 .and. ShadeFlag /= ExtShadeOn .and. &
ShadeFlag /= ExtBlindOn .and. ShadeFlag /= ExtScreenOn)THEN
BeamDivHorFaceInc = BeamSolarRad * CosIncAngHorProj * FrameDivider(FrDivNum)%HorDividers * &
DivProjOut * (Surface(SurfNum)%Width - FrameDivider(FrDivNum)%VertDividers*DivWidth) * &
FracSunLit / DivArea
BeamDivVertFaceInc = BeamSolarRad * CosIncAngVertProj * FrameDivider(FrDivNum)%VertDividers * &
DivProjOut * (Surface(SurfNum)%Height - FrameDivider(FrDivNum)%HorDividers*DivWidth) * &
FracSunLit / DivArea
END IF
DivIncSolarOutBm = 0.0d0
DivIncSolarOutDif = 0.0d0
DivIncSolarInBm = 0.0d0
DivIncSolarInDif = 0.0d0
IF(ShadeFlag /= ExtShadeOn .and. ShadeFlag /= ExtBlindOn .AND. ShadeFlag /= BGShadeOn &
.AND. ShadeFlag /= BGBlindOn .and. ShadeFlag /= ExtScreenOn) THEN ! No exterior or between-glass shading
DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc
DivIncSolarOutDif = DifSolarFaceInc*(1.0d0+SurfaceWindow(SurfNum)%ProjCorrDivOut)
IF(DivProjIn > 0.0d0) THEN
TransGl = POLYF(CosInc,Construct(ConstrNum)%TransSolBeamCoef(1:6))
TransDiffGl = Construct(ConstrNum)%TransDiff
IF(ShadeFlag == SwitchableGlazing) THEN ! Switchable glazing
TransGlSh = POLYF(CosInc,Construct(ConstrNumSh)%TransSolBeamCoef(1:6))
TransGl = InterpSw(SwitchFac,TransGl,TransGlSh)
TransDiffGlSh = Construct(ConstrNumSh)%TransDiff
TransDiffGl = InterpSw(SwitchFac,TransDiffGl,TransDiffGlSh)
END IF
! Beam plus diffuse solar on inside of divider
BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * FrameDivider(FrDivNum)%HorDividers * &
DivProjIn * (Surface(SurfNum)%Width - FrameDivider(FrDivNum)%VertDividers*DivWidth) * &
FracSunLit / DivArea
BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * FrameDivider(FrDivNum)%VertDividers * &
DivProjIn * (Surface(SurfNum)%Height - FrameDivider(FrDivNum)%HorDividers*DivWidth) * &
FracSunLit / DivArea
DivIncSolarInBm = TransGl*(BeamDivHorFaceIncIn + BeamDivVertFaceIncIn)
DivIncSolarInDif = TransDiffGl * DifSolarFaceInc * SurfaceWindow(SurfNum)%ProjCorrDivIn
END IF
ELSE ! Exterior shade, screen or blind present
DivIncSolarOutBm = BeamFaceInc * (1.0d0+SurfaceWindow(SurfNum)%ProjCorrDivOut)
DivIncSolarOutDif = DifSolarFaceInc * (1.0d0+SurfaceWindow(SurfNum)%ProjCorrDivOut)
DivIncSolarInBm = BeamFaceInc * SurfaceWindow(SurfNum)%ProjCorrDivIn * &
Construct(ConstrNum)%TransDiff
DivIncSolarInDif = DifSolarFaceInc * SurfaceWindow(SurfNum)%ProjCorrDivIn * &
Construct(ConstrNum)%TransDiff
END IF
IF(ShadeFlag /= ExtShadeOn .and. ShadeFlag /= ExtBlindOn .and. ShadeFlag /= ExtScreenOn .and. &
ShadeFlag /= BGShadeOn .and. ShadeFlag /= BGBlindOn) THEN ! No exterior or between-glass shade, screen or blind
SurfaceWindow(SurfNum)%DividerQRadOutAbs = DividerAbs*(DivIncSolarOutBm+DivIncSolarOutDif)
SurfaceWindow(SurfNum)%DividerQRadInAbs = DividerAbs*(DivIncSolarInBm+DivIncSolarInDif)
! Exterior shade, screen or blind
ELSE IF(ShadeFlag == ExtShadeOn .OR. ShadeFlag == ExtBlindOn .OR. ShadeFlag == ExtScreenOn) THEN
IF(ShadeFlag == ExtBlindOn) THEN ! Exterior blind
BlNum = SurfaceWindow(SurfNum)%BlindNumber
CALL ProfileAngle(SurfNum,SOLCOS,Blind(BlNum)%SlatOrientation,ProfAng)
SlatAng = SurfaceWindow(SurfNum)%SlatAngThisTS
TBlBmBm = BlindBeamBeamTrans(ProfAng,SlatAng,Blind(BlNum)%SlatWidth,Blind(BlNum)%SlatSeparation, &
Blind(BlNum)%SlatThickness)
TBlBmDif= InterpProfSlatAng(ProfAng,SlatAng,SurfaceWindow(SurfNum)%MovableSlats, &
Blind(BlNum)%SolFrontBeamDiffTrans)
SurfaceWindow(SurfNum)%DividerQRadOutAbs = DividerAbs * (DivIncSolarOutBm * &
(TBlBmBm+TBlBmDif) + DivIncSolarOutDif* &
InterpSlatAng(SlatAng,SurfaceWindow(SurfNum)%MovableSlats,Blind(BlNum)%SolFrontDiffDiffTrans))
SurfaceWindow(SurfNum)%DividerQRadInAbs = DividerAbs * (DivIncSolarInBm * &
(TBlBmBm+TBlBmDif) + DivIncSolarInDif* &
InterpSlatAng(SlatAng,SurfaceWindow(SurfNum)%MovableSlats,Blind(BlNum)%SolFrontDiffDiffTrans))
ELSE IF(ShadeFlag == ExtShadeOn) THEN ! Exterior shade
SurfaceWindow(SurfNum)%DividerQRadOutAbs = DividerAbs * &
Material(Construct(ConstrNumSh)%LayerPoint(1))%Trans * &
(DivIncSolarOutBm + DivIncSolarOutDif)
SurfaceWindow(SurfNum)%DividerQRadInAbs = DividerAbs * &
Material(Construct(ConstrNumSh)%LayerPoint(1))%Trans * &
(DivIncSolarInBm + DivIncSolarInDif)
ELSE IF(ShadeFlag == ExtScreenOn) THEN ! Exterior screen
SurfaceWindow(SurfNum)%DividerQRadOutAbs = DividerAbs * &
(SurfaceScreens(SurfaceWindow(SurfNum)%ScreenNumber)%BmBmTrans + &
SurfaceScreens(SurfaceWindow(SurfNum)%ScreenNumber)%BmDifTrans) * &
(DivIncSolarOutBm + DivIncSolarOutDif)
SurfaceWindow(SurfNum)%DividerQRadInAbs = DividerAbs * &
(SurfaceScreens(SurfaceWindow(SurfNum)%ScreenNumber)%BmBmTrans + &
SurfaceScreens(SurfaceWindow(SurfNum)%ScreenNumber)%BmDifTrans) * &
(DivIncSolarInBm + DivIncSolarInDif)
END IF
END IF
END IF
END IF
END IF ! RoughIndexMovInsul <= 0, no movable insulation
IF (Surface(SurfNum)%HeatTransSurf .AND. Construct(ConstrNum)%TransDiff <= 0.0d0) THEN ! Opaque heat transfer surface
QRadSWOutAbs(SurfNum) = AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc)
SWOutAbsTotalReport(SurfNum) = QRadSWOutAbs(SurfNum) * Surface(SurfNum)%Area
SWOutAbsEnergyReport(SurfNum) = SWOutAbsTotalReport(SurfNum) * SecInHour * TimeStepZone
ENDIF
END IF ! Surface(SurfNum)%HeatTransSurf
END IF ! Surface(SurfNum)%ExtSolar
IF (Surface(SurfNum)%HeatTransSurf .and. ConstrNum > 0) THEN
SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum)
IF (SurfSolIncPtr == 0) THEN
IF (Construct(ConstrNum)%TransDiff <= 0.0d0) THEN ! Opaque surface
QRadSWInAbs(SurfNum) = QRadSWInAbs(SurfNum) + AISurf(SurfNum)*BeamSolarRad
IF (InShelfSurf > 0) THEN ! Inside daylighting shelf
! Shelf surface area is divided by 2 because only one side sees beam (Area was multiplied by 2 during init)
OpaqSurfInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum)*BeamSolarRad*(0.5*Surface(SurfNum)%Area)
ELSE ! Regular surface
OpaqSurfInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum)*BeamSolarRad*Surface(SurfNum)%Area
END IF
ENDIF
ELSE
QRadSWInAbs(SurfNum) = QRadSWInAbs(SurfNum) + AISurf(SurfNum)
END IF
END IF
END DO !End of surface loop
END IF ! End of sun-up check
RETURN
END SUBROUTINE InitSolarHeatGains