SUBROUTINE DayltgInterReflectedIllum(ISunPos,IHR,ZoneNum,IWin)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Winkelmann
! DATE WRITTEN July 1997
! MODIFIED FCW December 1998
! FCW June 2001: Add blind calculations
! FCW Jan 2001: Add blinds with movable slats
! FCW Jan 2003: Add between-glass blinds
! FCW Jul 2003: account for transmittance of shading surfaces
! (previously these were assumed opaque even if transmittance schedule
! value was non-zero)
! FCW Aug 2003: modify initialization of WLUMSK from WLUMSK = 0. TO
! WLUMSK(:,:,IHR) = 0. Otherwise values calculated in previous
! call are incorrectly zeroed. Result was that window luminance with
! shade or blind included only contribution from first window element
! in window element loop in CalcDayltgCoefficients, thus seriously
! undercalculating window luminance for windows with more than one
! window element. Similarly, modified initialization of WLUMSU from
! WLUMSU = 0. to WLUMSU(:,IHR) = 0., and of WLUMSUdisk from
! WLUMSUdisk = 0. to WLUMSUdisk(:,IHR) = 0.
! PGE Aug 2003: Add daylighting shelves.
! FCW Nov 2003: Add beam solar and sky solar reflected from obstructions;
! add beam solar reflected from ground accounting for obstructions.
! FCW Nov 2003: increase NPHMAX from 9 to 10 to avoid rays with altitude angle = 0
! for vertical surfaces.
! FCW Nov 2003: fix the expression for min and max limits of azimuth; old expression
! broke down for window normals with negative altitude angle
! FCW Nov 2003: add specular reflection from exterior obstructions
! FCW Apr 2004: add light well efficiency multiplying window transmittance
! FCW Apr 2004: add diffusing glazing
! RAR (FSEC) May 2006: add exterior window screen
! B. Griffith NREL April 2010: CR7869 add adjacent zone area if window is not on this zone
! apply interior window transmission and blocking to beam transmission from ext win
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Called from CalcDayltgCoefficients for each window and reference point in a daylit
! space, for each sun position. Calculates illuminance (EINTSK and EINTSU) at reference point due
! to internally reflected light by integrating to determine the amount of flux from
! sky and ground (and beam reflected from obstructions) transmitted through
! the center of the window and then reflecting this
! light from the inside surfaces of the space. The "split-flux" method is used
! (Lynes, Principles of Natural Lighting, 1968). EINT is determined for
! different sky types and for window with and without shades, screens or blinds.
!
! Also finds luminance (WLUMSK and WLUMSU) of window with shade or blind, &
! or with diffusing glass, for different sky types.
! METHODOLOGY EMPLOYED:na
! REFERENCES:
! Based on DOE-2.1E subroutine DREFLT.
! USE STATEMENTS:
USE General, ONLY: InterpProfAng, POLYF, BlindBeamBeamTrans
USE DaylightingDevices, ONLY: FindTDDPipe, TransTDD
USE DataSystemVariables, ONLY: DetailedSkyDiffuseAlgorithm
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: ISunPos ! Sun position counter; used to avoid calculating various
! quantities that do not depend on sun position.
INTEGER :: IHR ! Hour of day
INTEGER :: ZoneNum ! Zone number
INTEGER :: IWin ! Window index
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: NPHMAX = 10 ! Number of sky/ground integration steps in altitude
INTEGER, PARAMETER :: NTHMAX = 16 ! Number of sky/ground integration steps in azimuth
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! In the following I,J arrays:
! I = sky type;
! J = 1 for bare window, 2 and above for window with shade or blind.
REAL(r64) :: FLFWSK(4,MaxSlatAngs+1) ! Sky-related downgoing luminous flux
REAL(r64) :: FLFWSU(MaxSlatAngs+1) ! Sun-related downgoing luminous flux, excluding entering beam
REAL(r64) :: FLFWSUdisk(MaxSlatAngs+1) ! Sun-related downgoing luminous flux, due to entering beam
REAL(r64) :: FLCWSK(4,MaxSlatAngs+1) ! Sky-related upgoing luminous flux
REAL(r64) :: FLCWSU(MaxSlatAngs+1) ! Sun-related upgoing luminous flux
INTEGER :: ISKY ! Sky type index: 1=clear, 2=clear turbid,
! 3=intermediate, 4=overcast
REAL(r64) :: TransMult(MaxSlatAngs) ! Transmittance multiplier
REAL(r64) :: TransBmBmMult(MaxSlatAngs)! Isolated blind beam-beam transmittance
REAL(r64) :: DPH,DTH ! Sky/ground element altitude and azimuth increments (radians)
INTEGER :: IPH,ITH ! Sky/ground element altitude and azimuth indices
REAL(r64) :: PH,TH ! Sky/ground element altitude and azimuth (radians)
REAL(r64) :: SPH,CPH ! Sine and cosine of PH
REAL(r64) :: PHMIN,PHMAX ! Limits of altitude integration (radians)
REAL(r64) :: THMIN,THMAX ! Limits of azimuth integration (radians)
REAL(r64) :: PhWin,ThWin ! Altitude, azimuth angle of window normal (radians)
REAL(r64) :: ACosTanTan ! ACOS(-TAN(Ph)*TAN(PhWin))
INTEGER :: IConst ! Construction pointer
REAL(r64) :: DA ! CPH*DTH*DPH
REAL(r64) :: COSB ! Cosine of angle of incidence of light from sky or ground
REAL(r64) :: TVISBR ! Transmittance of window without shading at COSB
! (times light well efficiency, if appropriate)
REAL(r64) :: ZSK(4),ZSU ! Sky-related and sun-related illuminance on window from sky/ground
! element for clear and overcast sky
REAL(r64) :: U(3) ! Unit vector in (PH,TH) direction
REAL(r64) :: ObTrans ! Product of solar transmittances of obstructions seen by a light ray
REAL(r64), SAVE :: ObTransM(NTHMAX,NPHMAX) ! ObTrans value for each (TH,PH) direction
!!unused REAL(r64) :: HitPointLumFrClearSky ! Luminance of obstruction from clear sky (cd/m2)
!!unused REAL(r64) :: HitPointLumFrOvercSky ! Luminance of obstruction from overcast sky (cd/m2)
!!unused REAL(r64) :: HitPointLumFrSun ! Luminance of obstruction from sun (cd/m2)
INTEGER :: ICtrl ! Window control pointer
INTEGER :: IConstShaded ! Pointer to shaded construction for a window
INTEGER :: JSH ! Shading index: JSH=1 is bare window, JSH=2 is shaded window
REAL(r64) :: COSBSun ! Cosine of angle of incidence of direct sun on window
REAL(r64) :: TVISBSun ! Window's visible transmittance at COSBSun
! (times light well efficiency, if appropriate)
REAL(r64) :: ZSU1 ! Transmitted direct normal illuminance (lux)
! CHARACTER(len=32) :: ShType ! Window shading device type
INTEGER :: ShType ! Window shading device type
LOGICAL :: ShadeOn ! True if exterior or interior window shade present
LOGICAL :: BlindOn ! True if exterior or interior window blind present
LOGICAL :: ScreenOn ! True if exterior window screen present
INTEGER :: BlNum ! Blind number
INTEGER :: ScNum ! Screen 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) :: TransBlBmDiffFront ! Isolated blind vis beam-diffuse front transmittance
REAL(r64) :: TransScBmDiffFront ! Isolated screen vis beam-diffuse front transmittance
REAL(r64) :: TransScDiffDiffFront ! Isolated screen vis diffuse-diffuse front transmittance
REAL(r64) :: ReflGlDiffDiffBack ! Bare glazing system vis diffuse back reflectance
REAL(r64) :: ReflGlDiffDiffFront ! Bare glazing system vis diffuse front reflectance
REAL(r64) :: ReflBlBmDiffFront ! Isolated blind vis beam-diffuse front reflectance
REAL(r64) :: TransBlDiffDiffFront ! Isolated blind vis diffuse-diffuse front transmittance
REAL(r64) :: ReflBlDiffDiffFront ! Isolated blind vis diffuse-diffuse front reflectance
REAL(r64) :: ReflBlDiffDiffBack ! Isolated blind vis diffuse-diffuse back reflectance
REAL(r64) :: ReflScDiffDiffBack ! Isolated screen vis diffuse-diffuse back reflectance
REAL(r64) :: ProfAng ! Solar profile angle (radians)
REAL(r64) :: SlatAng ! Blind slat angle
INTEGER :: JB ! Blind slat angle index
REAL(r64) :: t1,t2 ! Beam-beam vis trans of bare glass layers 1 and 2
REAL(r64) :: td2,td3 ! Diffuse-diffuse vis trans of bare glass layers 2 and 3
REAL(r64) :: rbd1,rbd2 ! Beam-diffuse back vis reflectance of bare glass layers 1 and 2
REAL(r64) :: rfd2,rfd3 ! Beam-diffuse front vis reflectance of bare glass layers 2 and 3
REAL(r64) :: tfshBd ! Beam-diffuse front vis trans of bare blind
REAL(r64) :: rfshB ! Beam-diffuse front vis reflectance of bare blind
REAL(r64) :: tfshd ! Diffuse-diffuse front vis trans of bare blind
REAL(r64) :: rbshd ! Diffuse-diffuse back vis reflectance of bare blind
!!unused REAL(r64) :: A ! Intermediate value for azimuth limits calculation
REAL(r64) :: ZSUObsRefl ! Illuminance on window from beam solar reflected by an
! obstruction (for unit beam normal illuminance)
INTEGER :: NearestHitSurfNum ! Surface number of nearest obstruction
INTEGER :: NearestHitSurfNumX ! Surface number to use when obstruction is a shadowing surface
REAL(r64) :: NearestHitPt(3) ! Hit point of ray on nearest obstruction (m)
REAL(r64) :: LumAtHitPtFrSun ! Luminance at hit point on obstruction from solar reflection
! for unit beam normal illuminance (cd/m2)
REAL(r64) :: SunObstructionMult ! = 1 if sun hits a ground point; otherwise = 0
REAL(r64), SAVE :: SkyObstructionMult(NTHMAX,NPHMAX) ! Ratio of obstructed to unobstructed sky diffuse at
! a ground point for each (TH,PH) direction
REAL(r64) :: Alfa,Beta ! Direction angles for ray heading towards the ground (radians)
REAL(r64) :: HorDis ! Distance between ground hit point and proj'n of window center onto ground (m)
REAL(r64) :: GroundHitPt(3) ! Coordinates of point that ray from window center hits the ground (m)
INTEGER :: ObsSurfNum ! Obstruction surface number
INTEGER :: IHitObs ! = 1 if obstruction is hit, = 0 otherwise
REAL(r64) :: ObsHitPt(3) ! Coordinates of hit point on an obstruction (m)
INTEGER :: ObsConstrNum ! Construction number of obstruction
REAL(r64) :: ObsVisRefl ! Visible reflectance of obstruction
REAL(r64) :: SkyReflVisLum ! Reflected sky luminance at hit point divided by unobstructed sky
! diffuse horizontal illuminance [(cd/m2)/lux]
REAL(r64) :: dReflObsSky ! Contribution to sky-related illuminance on window due to sky diffuse
! reflection from an obstruction
REAL(r64) :: SkyGndUnObs ! Unobstructed sky irradiance at a ground point
REAL(r64) :: SkyGndObs ! Obstructed sky irradiance at a ground point
REAL(r64) :: Phi,Theta ! Altitude and azimuth angle of ray from a ground point (radians)
INTEGER :: IPhi,ITheta ! Phi and Theta indices
REAL(r64) :: DPhi,DTheta ! Phi and Theta increment (radians)
REAL(r64) :: SPhi,CPhi ! Sin and cos of Phi
REAL(r64) :: dOmega ! Solid angle element of ray from ground point (steradians)
REAL(r64) :: URay(3) ! Unit vector in (Phi,Theta) direction
REAL(r64) :: CosIncAngURay ! Cosine of incidence angle of URay on ground plane
REAL(r64) :: IncAngSolidAngFac ! CosIncAngURay*dOmega/Pi
REAL(r64) :: TVisSunRefl ! Diffuse vis trans of bare window for beam reflection calc
! (times light well efficiency, if appropriate)
REAL(r64) :: ZSU1refl ! Beam normal illuminance times ZSU1refl = illuminance on window
! due to specular reflection from exterior surfaces
INTEGER :: ZoneNumThisWin ! temporary to check if this window is actually in adjacent zone
INTEGER :: ExtWinType ! Exterior window type (InZoneExtWin, AdjZoneExtWin, NotInOrAdjZoneExtWin)
REAL(r64) :: ZoneInsideSurfArea ! temporary for calculations, total surface area of zone surfaces m2
INTEGER :: IntWinAdjZoneExtWinNum ! the index of the exterior window in IntWinAdjZoneExtWin nested struct
INTEGER :: AdjExtWinLoop ! loop index for searching IntWinAdjZoneExtWin
INTEGER :: IntWinLoop ! loop index for searching interior windows
INTEGER :: IntWinNum ! window index for interior windows associated with exterior windows
REAL(r64) :: COSBintWin
ZoneNumThisWin = Surface(Surface(IWin)%BaseSurf)%Zone
! The inside surface area, ZoneDaylight(ZoneNum)%TotInsSurfArea was calculated in subr DayltgAveInteriorReflectance
IF(ZoneNumThisWin == ZoneNum) THEN
ExtWinType = InZoneExtWin
ZoneInsideSurfArea = ZoneDaylight(ZoneNum)%TotInsSurfArea
IntWinAdjZoneExtWinNum = 0
ELSE
ExtWinType = AdjZoneExtWin
! If window is exterior window in adjacent zone, then use areas of both zones
ZoneInsideSurfArea = ZoneDaylight(ZoneNum)%TotInsSurfArea + ZoneDaylight(ZoneNumThisWin)%TotInsSurfArea
! find index in IntWinAdjZoneExtWin
Do AdjExtWinLoop = 1, ZoneDaylight(ZoneNum)%NumOfIntWinAdjZoneExtWins
IF (IWin == ZoneDaylight(ZoneNum)%IntWinAdjZoneExtWin(AdjExtWinLoop)%SurfNum) THEN ! found it
IntWinAdjZoneExtWinNum = AdjExtWinLoop
EXIT ! added TH 4/13/2010
ENDIF
ENDDO
END IF
! FLOW:
! Initialize window luminance and fluxes for split-flux calculation
WLUMSK(:,:,IHR) = 0.0d0
WLUMSU(:,IHR) = 0.0d0
WLUMSUdisk(:,IHR) = 0.0d0
FLFWSK = 0.0d0
FLFWSU = 0.0d0
FLFWSUdisk = 0.0d0
FLCWSK = 0.0d0
FLCWSU = 0.0d0
IConst = Surface(IWin)%Construction
IF(SurfaceWindow(IWin)%StormWinFlag==1) IConst = Surface(IWin)%StormWinConstruction
BlindOn = .FALSE.
ShadeOn = .FALSE.
ScreenOn = .FALSE.
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
PipeNum = FindTDDPipe(IWin)
END IF
ShelfNum = Surface(IWin)%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
! Divide sky and ground into elements of altitude PH and
! azimuth TH, and add the contribution of light coming from each
! element to the transmitted flux at the center of the window
!
! Azimuth ranges over a maximum of 2 Pi radians.
! Altitude ranges over a maximum of Pi/2 radians between -Pi/2 < PH < +Pi/2, so that elements are not counted twice
! PH = 0 at the horizon; PH = Pi/2 at the zenith
PHMIN = MAX(-PIOVR2, SurfaceWindow(IWin)%Phi - PIOVR2)
PHMAX = MIN(PIOVR2, SurfaceWindow(IWin)%Phi + PIOVR2)
DPH = (PHMAX - PHMIN) / REAL(NPHMAX,r64)
! Sky/ground element altitude integration
DO IPH = 1,NPHMAX
PH = PHMIN + (REAL(IPH,r64) - 0.5d0) * DPH
SPH = SIN(PH)
CPH = COS(PH)
! Third component of unit vector in (TH,PH) direction
U(3) = SPH
! Limits of azimuth integration
PhWin = SurfaceWindow(IWin)%Phi
ThWin = SurfaceWindow(IWin)%Theta
IF(PhWin >= 0.0d0) THEN
IF(Ph >= PiOvr2 - PhWin) THEN
ThMin = -Pi
ThMax = Pi
ELSE
ACosTanTan = ACOS(-TAN(Ph)*TAN(PhWin))
ThMin = ThWin - ABS(ACosTanTan)
ThMax = ThWin + ABS(ACosTanTan)
END IF
ELSE ! PhiSurf < 0.0
IF(Ph <= -PhWin - PiOvr2) THEN
ThMin = -Pi
ThMax = Pi
ELSE
ACosTanTan = ACOS(-TAN(Ph)*TAN(PhWin))
ThMin = ThWin - ABS(ACosTanTan)
ThMax = ThWin + ABS(ACosTanTan)
END IF
END IF
DTH = (THMAX - THMIN) / REAL(NTHMAX,r64)
DA = CPH * DTH * DPH
! Sky/ground element azimuth integration
DO ITH = 1,NTHMAX
TH = THMIN + (REAL(ITH,r64) - 0.5d0) * DTH
U(1) = CPH * COS(TH)
U(2) = CPH * SIN(TH)
! Cosine of angle of incidence of light from sky or ground element
COSB = SPH * SIN(SurfaceWindow(IWin)%Phi) + CPH * COS(SurfaceWindow(IWin)%Phi) &
* COS(TH-SurfaceWindow(IWin)%Theta)
IF (COSB < 0.0d0) CYCLE ! Sky/ground elements behind window (although there shouldn't be any)
! Initialize illuminance on window for this sky/ground element
ZSK = 0.0d0
ZSU = 0.0d0
! Initialize illuminance on window from beam solar reflection if ray hits an obstruction
ZSUObsRefl = 0.0d0
IF (ISunPos == 1) THEN ! Intersection calculation has to be done only for first sun position
! Determine net transmittance of obstructions that the ray hits. ObTrans will be 1.0
! if no obstructions are hit.
CALL DayltgHitObstruction(IHr,IWin,SurfaceWindow(IWin)%WinCenter,U,ObTrans)
ObTransM(ITH,IPH) = ObTrans
END IF
! SKY AND GROUND RADIATION ON WINDOW
! Contribution is from sky if PH > 0 (ray goes upward), and from ground if PH < 0 (ray goes downward)
! (There may also be contributions from reflection from obstructions; see 'BEAM SOLAR AND SKY SOLAR
! REFLECTED FROM NEAREST OBSTRUCTION,' below.)
IF(ISunPos == 1) SkyObstructionMult(ITH,IPH) = 1.0d0
IF (PH > 0.0d0) THEN ! Contribution is from sky
DO ISKY = 1,4
ZSK(ISKY) = DayltgSkyLuminance(ISky,TH,PH) * COSB * DA * ObTransM(ITH,IPH)
END DO
ELSE ! PH <= 0.0; contribution is from ground
IF(CalcSolRefl .AND. ObTransM(ITH,IPH) > 1.d-6 .AND. ISunPos == 1) THEN
! Calculate effect of obstructions on shading of sky diffuse reaching the ground point hit
! by the ray. This effect is given by the ratio SkyObstructionMult =
! (obstructed sky diffuse at ground point)/(unobstructed sky diffuse at ground point).
! This ratio is calculated for an isotropic sky.
! Ground point hit by the ray:
Alfa = ACOS(-U(3))
Beta = ATAN2(U(2),U(1))
HorDis = (SurfaceWindow(IWin)%WinCenter(3)-GroundLevelZ)*TAN(Alfa)
GroundHitPt(3) = GroundLevelZ
GroundHitPt(1) = SurfaceWindow(IWin)%WinCenter(1) + HorDis*COS(Beta)
GroundHitPt(2) = SurfaceWindow(IWin)%WinCenter(2) + HorDis*SIN(Beta)
SkyObstructionMult(ITH,IPH) = CalcObstrMultiplier(GroundHitPt, AltAngStepsForSolReflCalc, AzimAngStepsForSolReflCalc)
END IF ! End of check if solar reflection calc is in effect
DO ISKY = 1,4
! Below, luminance of ground in cd/m2 is illuminance on ground in lumens/m2
! times ground reflectance, divided by pi, times obstruction multiplier.
ZSK(ISKY) = (GILSK(ISKY,IHR) * GndReflectanceForDayltg / PI) * COSB * DA * ObTransM(ITH,IPH) * &
SkyObstructionMult(ITH,IPH)
END DO
! Determine if sun illuminates the point that ray hits the ground. If the solar reflection
! calculation has been requested (CalcSolRefl = .TRUE.) shading by obstructions, including
! the building itself, is considered in determining whether sun hits the ground point.
! Otherwise this shading is ignored and the sun always hits the ground point.
SunObstructionMult = 1.0d0
IF(CalcSolRefl .AND. ObTransM(ITH,IPH) > 1.d-6) THEN
! Sun reaches ground point if vector from this point to the sun is unobstructed
IHitObs = 0
DO ObsSurfNum = 1,TotSurfaces
IF(.NOT.Surface(ObsSurfNum)%ShadowSurfPossibleObstruction) CYCLE
CALL DayltgPierceSurface(ObsSurfNum,GroundHitPt,SunCosHr(1:3,IHr),IHitObs,ObsHitPt)
IF(IHitObs > 0) EXIT
END DO
IF(IHitObs > 0) SunObstructionMult = 0.0d0
END IF
ZSU = (GILSU(IHR) * GndReflectanceForDayltg / PI) * COSB * DA * ObTransM(ITH,IPH) * &
SunObstructionMult
END IF
! BEAM SOLAR AND SKY SOLAR REFLECTED FROM NEAREST OBSTRUCTION
IF(CalcSolRefl .AND. ObTransM(ITH,IPH) < 1.0d0) THEN
! Find obstruction whose hit point is closest to the center of the window
CALL DayltgClosestObstruction(SurfaceWindow(IWin)%WinCenter,U,NearestHitSurfNum,NearestHitPt)
IF(NearestHitSurfNum > 0) THEN
! Beam solar reflected from nearest obstruction.
CALL DayltgSurfaceLumFromSun(IHr,U,NearestHitSurfNum,NearestHitPt,LumAtHitPtFrSun)
ZSUObsRefl = LumAtHitPtFrSun * COSB * DA
ZSU = ZSU + ZSUObsRefl
! Sky solar reflected from nearest obstruction.
ObsConstrNum = Surface(NearestHitSurfNum)%Construction
IF(ObsConstrNum > 0) THEN
! Exterior building surface is nearest hit
IF(.NOT.Construct(ObsConstrNum)%TypeIsWindow) THEN
! Obstruction is not a window, i.e., is an opaque surface
ObsVisRefl = 1.0d0- Material(Construct(ObsConstrNum)%LayerPoint(1))%AbsorpVisible
ELSE
! Obstruction is a window; assume it is bare
IF(SurfaceWindow(NearestHitSurfNum)%StormWinFlag==1) &
ObsConstrNum = Surface(NearestHitSurfNum)%StormWinConstruction
ObsVisRefl = Construct(ObsConstrNum)%ReflectVisDiffFront
END IF
ELSE
! Shadowing surface is nearest hit
IF(Surface(NearestHitSurfNum)%Shelf > 0) THEN
! Skip daylighting shelves, whose reflection is separately calculated
ObsVisRefl = 0.0d0
ELSE
ObsVisRefl = Surface(NearestHitSurfNum)%ShadowSurfDiffuseVisRefl
IF(Surface(NearestHitSurfNum)%ShadowSurfGlazingConstruct > 0) &
ObsVisRefl = ObsVisRefl + Surface(NearestHitSurfNum)%ShadowSurfGlazingFrac * &
Construct(Surface(NearestHitSurfNum)%ShadowSurfGlazingConstruct)%ReflectVisDiffFront
! Note in the above that ShadowSurfDiffuseVisRefl is the reflectance of opaque part of
! shadowing surface times (1 - ShadowSurfGlazingFrac)
END IF
END IF
NearestHitSurfNumX = NearestHitSurfNum
! Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction.
! The following gets the correct side of a shadowing surface for reflection.
IF(Surface(NearestHitSurfNum)%ShadowingSurf) THEN
IF(DOT_PRODUCT(U,Surface(NearestHitSurfNum)%OutNormVec) > 0.0d0) NearestHitSurfNumX = &
NearestHitSurfNum + 1
END IF
IF (.not. DetailedSkyDiffuseAlgorithm .or. .not. ShadingTransmittanceVaries .or. &
SolarDistribution == MinimalShadowing) THEN
SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX)%ViewFactorSky * &
DifShdgRatioIsoSky(NearestHitSurfNumX) / Pi
ELSE
SkyReflVisLum = ObsVisRefl * Surface(NearestHitSurfNumX)%ViewFactorSky * &
DifShdgRatioIsoSkyHRTS(NearestHitSurfNumX,IHR,1) / Pi
ENDIF
dReflObsSky = SkyReflVisLum * COSB * DA
DO ISky = 1,4
ZSK(ISky) = ZSK(ISky) + GILSK(ISky,IHr) * dReflObsSky
END DO
END IF
END IF ! End of check if exterior solar reflection calculation is active
! ===Bare window (no shade or blind; non-diffusing glass)===
! Increment flux entering space and window luminance (cd/m2).
! FLCW--(I,J) = part of incoming flux (in lumens) that goes up to ceiling and upper part of walls.
! FLFW--(I,J) = part that goes down to floor and lower part of walls
IF (SurfaceWindow(IWIN)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
! Unshaded visible transmittance of TDD for a single ray from sky/ground element
TVISBR = TransTDD(PipeNum, COSB, VisibleBeam) * SurfaceWindow(IWin)%GlazedFrac
! Make all transmitted light diffuse for a TDD with a bare diffuser
DO ISKY = 1,4
WLUMSK(ISKY,1,IHR) = WLUMSK(ISKY,1,IHR) + ZSK(ISKY) * TVISBR / PI
FLFWSK(ISKY,1) = FLFWSK(ISKY,1) + ZSK(ISKY) * TVISBR * (1.0d0- SurfaceWindow(IWin)%FractionUpgoing)
FLCWSK(ISKY,1) = FLCWSK(ISKY,1) + ZSK(ISKY) * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
! For later calculation of diffuse visible transmittance
TDDFluxInc(PipeNum,ISKY,IHR) = TDDFluxInc(PipeNum,ISKY,IHR) + ZSK(ISKY)
TDDFluxTrans(PipeNum,ISKY,IHR) = TDDFluxTrans(PipeNum,ISKY,IHR) + ZSK(ISKY) * TVISBR
IF(ISky == 1) THEN
WLUMSU(1,IHR) = WLUMSU(1,IHR) + ZSU * TVISBR / PI
FLFWSU(1) = FLFWSU(1) + ZSU * TVISBR * (1.0d0 - SurfaceWindow(IWin)%FractionUpgoing)
FLCWSU(1) = FLCWSU(1) + ZSU * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
! For later calculation of diffuse visible transmittance
TDDFluxInc(PipeNum,ISKY,IHR) = TDDFluxInc(PipeNum,ISKY,IHR) + ZSU
TDDFluxTrans(PipeNum,ISKY,IHR) = TDDFluxTrans(PipeNum,ISKY,IHR) + ZSU * TVISBR
END IF
END DO
ELSE ! Bare window
! Transmittance of bare window for this sky/ground element
TVISBR = POLYF(COSB,Construct(IConst)%TransVisBeamCoef(1:6)) * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
IF (InShelfSurf > 0) THEN ! Inside daylighting shelf
! Daylighting shelf simplification: All light is diffuse
! SurfaceWindow(IWin)%FractionUpgoing is already set to 1.0 earlier
DO ISKY = 1,4
FLCWSK(ISKY,1) = FLCWSK(ISKY,1) + ZSK(ISKY) * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
IF(ISky == 1) THEN
FLCWSU(1) = FLCWSU(1) + ZSU * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
END IF
END DO
ELSE ! Normal window
! CR 7869 correct TVISBR if disk beam passes thru interior window
IF (ExtWinType ==AdjZoneExtWin) THEN
! modify TVISBR by second window transmission
! first determine if ray from point passes thru any interior window
IHitObs = 0
DO IntWinLoop = 1, ZoneDaylight(ZoneNum)%IntWinAdjZoneExtWin(IntWinAdjZoneExtWinNum)%NumOfIntWindows
IntWinNum = ZoneDaylight(ZoneNum)%IntWinAdjZoneExtWin(IntWinAdjZoneExtWinNum)%IntWinNum(IntWinLoop)
Call DayltgPierceSurface(IntWinNum, SurfaceWindow(IntWinNum)%WinCenter,SunCosHr(1:3,IHr),IHitObs, ObsHitPt)
IF (IHitObs == 1) THEN ! disk passes thru
! cosine of incidence angle of light from sky or ground element for
COSBintWin = SPH * SIN(SurfaceWindow(IntWinNum)%Phi) + CPH * COS(SurfaceWindow(IntWinNum)%Phi) &
* COS(TH-SurfaceWindow(IntWinNum)%Theta)
TVISBR = TVISBR * POLYF(COSBintWin,Construct(Surface(IntWinNum)%Construction)%TransVisBeamCoef(1:6))
EXIT
ENDIF
ENDDO
IF (IHitObs == 0) THen ! blocked by opaque parts, beam does not actually pass thru interior window to reach zone
TVISBR = 0.0D0
ENDIF
ENDIF
DO ISKY = 1,4
!IF (PH < 0.) THEN
!Fixed by FCW, Nov. 2003:
IF (PH > 0.0d0) THEN
FLFWSK(ISKY,1) = FLFWSK(ISKY,1) + ZSK(ISKY) * TVISBR
IF (ISky == 1) FLFWSU(1) = FLFWSU(1) + ZSU * TVISBR
ELSE
FLCWSK(ISKY,1) = FLCWSK(ISKY,1) + ZSK(ISKY) * TVISBR
IF (ISky == 1) FLCWSU(1) = FLCWSU(1) + ZSU * TVISBR
END IF
END DO
END IF ! End of check if window with daylighting shelf or normal window
END IF ! End of check if TDD:DOME or bare window
! Check if window has shade or blind
ICtrl = Surface(IWin)%WindowShadingControlPtr
IF (ICtrl > 0) THEN
ShType = WindowShadingControl(ICtrl)%ShadingType
BlNum = SurfaceWindow(IWin)%BlindNumber
ScNum = SurfaceWindow(IWin)%ScreenNumber
ShadeOn = (ShType == WSC_ST_InteriorShade .OR. ShType == WSC_ST_ExteriorShade.OR. ShType == WSC_ST_BetweenGlassShade)
BlindOn = (ShType == WSC_ST_InteriorBlind .OR. ShType == WSC_ST_ExteriorBlind.OR. ShType == WSC_ST_BetweenGlassBlind)
ScreenOn = (ShType == WSC_ST_ExteriorScreen)
END IF
IF (ShadeOn .OR. BlindOn .OR. ScreenOn .OR. SurfaceWindow(IWin)%SolarDiffusing) THEN
! ===Window with interior or exterior shade or blind, exterior screen, or with diffusing glass===
! Increment flux entering space and window luminance. Shades and diffusing glass are
! assumed to be perfect diffusers, i.e., the transmittance is independent of angle of
! incidence and the transmitted light is isotropic. The transmittance of a blind is
! assumed to depend on profile angle and slat angle; the diffuse light entering the room from
! the slats of the blind is assumed to be isotropic. With blinds, light can also enter
! the room by passing between the slats without reflection. The beam transmittance of a screen
! is assumed to depend on sun azimuth and azimuth angle.
! For light from a shade, or from diffusing glass, or from the slats of a blind, a flux fraction,
! SurfaceWindow(IWin)%FractionUpgoing (determined by window tilt), goes up toward
! ceiling and upper part of walls, and 1-Surfacewindow(iwin)%FractionUpgoing
! goes down toward floor and lower part of walls. For a blind, the light passing
! between the slats goes either up or down depending on the altitude angle of the
! element from which the light came. For a screen, the light passing
! between the screen's cylinders goes either up or down depending on the altitude angle of the
! element from which the light came.
IConstShaded = Surface(IWin)%ShadedConstruction
IF(SurfaceWindow(IWin)%StormWinFlag==1) IConstShaded = Surface(IWin)%StormWinShadedConstruction
IF(SurfaceWindow(IWin)%SolarDiffusing) IConstShaded = Surface(IWin)%Construction
! Transmittance of window including shade, screen or blind
TransBmBmMult = 0.0d0
TransMult = 0.0d0
IF (ShadeOn) THEN ! Shade
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
! Shaded visible transmittance of TDD for a single ray from sky/ground element
TransMult(1) = TransTDD(PipeNum, COSB, VisibleBeam) * SurfaceWindow(IWin)%GlazedFrac
ELSE ! Shade only, no TDD
! Calculate transmittance of the combined window and shading device for this sky/ground element
TransMult(1) = POLYF(COSB,Construct(IConstShaded)%TransVisBeamCoef(1)) * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
END IF
ELSE IF(ScreenOn) THEN ! Screen: get beam-beam, beam-diffuse and diffuse-diffuse vis trans/ref of screen and glazing system
CALL CalcScreenTransmittance(IWin, Phi=(PH-SurfaceWindow(IWin)%Phi), Theta=(TH-SurfaceWindow(IWin)%Theta))
ReflGlDiffDiffFront = Construct(IConst)%ReflectVisDiffFront
ReflScDiffDiffBack = SurfaceScreens(SurfaceWindow(IWin)%ScreenNumber)%DifReflectVis
TransScBmDiffFront = SurfaceScreens(SurfaceWindow(IWin)%ScreenNumber)%BmDifTransVis
TransMult(1) = TransScBmDiffFront * SurfaceWindow(IWin)%GlazedFrac * &
Construct(IConst)%TransDiffVis/(1-ReflGlDiffDiffFront*ReflScDiffDiffBack) * &
SurfaceWindow(IWin)%LightWellEff
TransBmBmMult(1) = SurfaceScreens(SurfaceWindow(IWin)%ScreenNumber)%BmBmTransVis
ELSE IF(BlindOn) THEN ! Blind: get beam-diffuse and beam-beam vis trans of blind+glazing system
! PETER: As long as only interior blinds are allowed for TDDs, no need to change TransMult calculation
! for TDDs because it is based on TVISBR which is correctly calculated for TDDs above.
CALL ProfileAngle(IWin,U,Blind(BlNum)%SlatOrientation,ProfAng)
DO JB = 1, MaxSlatAngs
IF (.NOT. SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
TransBlBmDiffFront = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffTrans(1:37,JB))
IF (ShType == WSC_ST_InteriorBlind) THEN ! Interior blind
ReflGlDiffDiffBack = Construct(IConst)%ReflectVisDiffBack
ReflBlBmDiffFront = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffRefl(1:37,JB))
ReflBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffRefl(JB)
TransBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffTrans(JB)
TransMult(JB) = TVISBR*(TransBlBmDiffFront + ReflBlBmDiffFront*ReflGlDiffDiffBack*TransBlDiffDiffFront/ &
(1.d0 - ReflBlDiffDiffFront*ReflGlDiffDiffBack))
ELSE IF (ShType == WSC_ST_ExteriorBlind) THEN ! Exterior blind
ReflGlDiffDiffFront = Construct(IConst)%ReflectVisDiffFront
ReflBlDiffDiffBack = Blind(BlNum)%VisBackDiffDiffRefl(JB)
TransMult(JB) = TransBlBmDiffFront * SurfaceWindow(IWin)%GlazedFrac * &
Construct(IConst)%TransDiffVis/(1.d0-ReflGlDiffDiffFront*ReflBlDiffDiffBack) * &
SurfaceWindow(IWin)%LightWellEff
ELSE ! Between-glass blind
t1 = POLYF(COSB,Construct(IConst)%tBareVisCoef(1,1:6))
td2 = Construct(IConst)%tBareVisDiff(2)
rbd1 = Construct(IConst)%rbBareVisDiff(1)
rfd2 = Construct(IConst)%rfBareVisDiff(2)
tfshBd = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffTrans(1:37,JB))
tfshd = Blind(BlNum)%VisFrontDiffDiffTrans(JB)
rfshB = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffRefl(1:37,JB))
rbshd = Blind(BlNum)%VisFrontDiffDiffRefl(JB)
IF (Construct(IConst)%TotGlassLayers == 2) THEN ! 2 glass layers
TransMult(JB) = t1*(tfshBd*(1.d0 + rfd2*rbshd) + rfshB*rbd1*tfshd)*td2 * SurfaceWindow(IWin)%LightWellEff
ELSE ! 3 glass layers; blind between layers 2 and 3
t2 = POLYF(COSB,Construct(IConst)%tBareVisCoef(2,1:6))
td3 = Construct(IConst)%tBareVisDiff(3)
rfd3 = Construct(IConst)%rfBareVisDiff(3)
rbd2 = Construct(IConst)%rbBareVisDiff(2)
TransMult(JB) = t1*t2*(tfshBd*(1.d0 + rfd3*rbshd) + rfshB*(rbd2*tfshd + td2*rbd1*td2*tfshd))*td3 * &
SurfaceWindow(IWin)%LightWellEff
END IF
END IF
IF (SurfaceWindow(IWin)%MovableSlats) THEN
SlatAng = (JB-1)*PI/(MaxSlatAngs-1)
ELSE
SlatAng = Blind(BlNum)%SlatAngle * DegToRadians
END IF
TransBmBmMult(JB) = TVISBR * BlindBeamBeamTrans(ProfAng,SlatAng,Blind(BlNum)%SlatWidth, &
Blind(BlNum)%SlatSeparation,Blind(BlNum)%SlatThickness)
END DO ! End of loop over slat angles
ELSE ! Diffusing glass
TransMult(1) = POLYF(COSB,Construct(IConstShaded)%TransVisBeamCoef(1)) * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
END IF ! End of check if shade, blind or diffusing glass
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
! No beam is transmitted. This takes care of all types of screens and blinds.
TransBmBmMult = 0.0d0
END IF
! Daylighting shelf simplification: No beam makes it past end of shelf, all light is diffuse
IF (InShelfSurf > 0) THEN ! Inside daylighting shelf
TransBmBmMult = 0.0d0! No beam, diffuse only
END IF
! TransBmBmMult is used in the following for windows with blinds or screens to get contribution from light
! passing directly between slats or between screen material without reflection.
DO ISKY=1,4
DO JB = 1, MaxSlatAngs
! EXIT after first pass if not movable slats or exterior window screen
IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
WLUMSK(ISKY,JB+1,IHR) = WLUMSK(ISKY,JB+1,IHR) + ZSK(ISKY) * TransMult(JB) / PI
FLFWSK(ISKY,JB+1) = FLFWSK(ISKY,JB+1) + ZSK(ISKY) * TransMult(JB) * (1.0d0-SurfaceWindow(IWin)%FractionUpgoing)
IF (PH > 0.0d0.AND. (BlindOn .OR. ScreenOn)) FLFWSK(ISKY,JB+1) = FLFWSK(ISKY,JB+1) + ZSK(ISKY) * TransBmBmMult(JB)
FLCWSK(ISKY,JB+1) = FLCWSK(ISKY,JB+1) + ZSK(ISKY) * TransMult(JB) * SurfaceWindow(IWin)%FractionUpgoing
IF (PH <= 0.0d0.AND. (BlindOn .OR. ScreenOn)) FLCWSK(ISKY,JB+1) = FLCWSK(ISKY,JB+1) + ZSK(ISKY) * TransBmBmMult(JB)
IF (ISky == 1) THEN
WLUMSU(JB+1,IHR) = WLUMSU(JB+1,IHR) + ZSU * TransMult(JB) / PI
FLFWSU(JB+1) = FLFWSU(JB+1) + ZSU * TransMult(JB) * (1.0d0-SurfaceWindow(IWin)%FractionUpgoing)
IF (PH > 0.0d0.AND. (BlindOn .OR. ScreenOn)) FLFWSU(JB+1) = FLFWSU(JB+1) + ZSU * TransBmBmMult(JB)
FLCWSU(JB+1) = FLCWSU(JB+1) + ZSU * TransMult(JB) * SurfaceWindow(IWin)%FractionUpgoing
IF (PH <= 0.0d0.AND. (BlindOn .OR. ScreenOn)) FLCWSU(JB+1) = FLCWSU(JB+1) + ZSU * TransBmBmMult(JB)
END IF
END DO
END DO
END IF ! End of window with shade, screen, blind or diffusing glass
END DO ! End of azimuth integration loop, ITH
END DO ! End of altitude integration loop, IPH
IF (OutShelfSurf > 0) THEN ! Outside daylighting shelf
! Add exterior diffuse illuminance due to outside shelf
! Since all of the illuminance is added to the zone as upgoing diffuse, it can be added as a lump sum here
TVISBR = Construct(IConst)%TransDiffVis ! Assume diffuse transmittance for shelf illuminance
DO ISKY = 1,4
! This is only an estimate because the anisotropic sky view of the shelf is not yet taken into account.
! AnisoSkyMult would be great to use but it is not available until the heat balance starts up.
ZSK(ISKY) = GILSK(ISKY,IHR) * 1.0d0* Shelf(ShelfNum)%OutReflectVis * Shelf(ShelfNum)%ViewFactor
! SurfaceWindow(IWin)%FractionUpgoing is already set to 1.0 earlier
FLCWSK(ISKY,1) = FLCWSK(ISKY,1) + ZSK(ISKY) * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
IF(ISky == 1) THEN
ZSU = GILSU(IHR) * SunLitFracHR(OutShelfSurf,IHR) * Shelf(ShelfNum)%OutReflectVis * Shelf(ShelfNum)%ViewFactor
FLCWSU(1) = FLCWSU(1) + ZSU * TVISBR * SurfaceWindow(IWin)%FractionUpgoing
END IF
END DO ! ISKY
END IF
! Sky-related portion of internally reflected illuminance.
! The inside surface area, ZoneDaylight(ZoneNum)%TotInsSurfArea, and ZoneDaylight(ZoneNum)%AveVisDiffReflect,
! were calculated in subr DayltgAveInteriorReflectance.
DO ISKY = 1,4
DO JSH = 1,MaxSlatAngs+1
IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JSH > 2) EXIT
! Full area of window is used in following since effect of dividers on reducing
! effective window transmittance has already been accounted for in calc of FLFWSK and FLCWSK.
EINTSK(ISKY,JSH,IHR) = (FLFWSK(ISKY,JSH) * SurfaceWindow(IWin)%RhoFloorWall &
+ FLCWSK(ISKY,JSH) * SurfaceWindow(IWin)%RhoCeilingWall) &
* (Surface(IWin)%Area/SurfaceWindow(IWin)%GlazedFrac) &
/ (ZoneInsideSurfArea * (1.0d0 - ZoneDaylight(ZoneNum)%AveVisDiffReflect))
END DO ! JSH
END DO ! ISKY
! BEAM SOLAR RADIATION ON WINDOW
! Beam reaching window directly (without specular reflection from exterior obstructions)
IF (SunLitFracHR(IWin,IHR) > 0.0d0) THEN
! Cos of angle of incidence
COSBSun = SPHSUN * SIN(SurfaceWindow(IWin)%Phi) + CPHSUN * COS(SurfaceWindow(IWin)%Phi) &
* COS(THSUN - SurfaceWindow(IWin)%Theta)
IF (COSBSun > 0.0d0) THEN
! Multiply direct normal illuminance (normalized to 1.0 lux)
! by incident angle factor and by fraction of window that is sunlit.
! Note that in the following SunLitFracHR accounts for possibly non-zero transmittance of
! shading surfaces.
ZSU1 = COSBSun * SunLitFracHR(IWin,IHR)
! Contribution to window luminance and downgoing flux
! -- Bare window
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
! Unshaded visible transmittance of TDD for collimated beam from the sun
TVISBSun = TransTDD(PipeNum, COSBSun, VisibleBeam) * SurfaceWindow(IWin)%GlazedFrac
TDDTransVisBeam(PipeNum, IHR) = TVISBSun
FLFWSUdisk(1) = 0.0d0! Diffuse light only
WLUMSU(1,IHR) = WLUMSU(1,IHR) + ZSU1 * TVISBSun / PI
FLFWSU(1) = FLFWSU(1) + ZSU1 * TVISBSun * (1.0d0 - SurfaceWindow(IWin)%FractionUpgoing)
FLCWSU(1) = FLCWSU(1) + ZSU1 * TVISBSun * SurfaceWindow(IWin)%FractionUpgoing
ELSE ! Bare window
TVISBSun = POLYF(COSBSun,Construct(IConst)%TransVisBeamCoef(1)) * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
! Daylighting shelf simplification: No beam makes it past end of shelf, all light is diffuse
IF (InShelfSurf > 0) THEN ! Inside daylighting shelf
FLFWSUdisk(1) = 0.0d0! Diffuse light only
! SurfaceWindow(IWin)%FractionUpgoing is already set to 1.0 earlier
!WLUMSU(1,IHR) = WLUMSU(1,IHR) + ZSU1 * TVISBSun / PI
!FLFWSU(1) = FLFWSU(1) + ZSU1 * TVISBSun * (1.0 - SurfaceWindow(IWin)%FractionUpgoing)
FLCWSU(1) = FLCWSU(1) + ZSU1 * TVISBSun * SurfaceWindow(IWin)%FractionUpgoing
ELSE ! Normal window
FLFWSUdisk(1) = ZSU1 * TVISBSun
END If
END IF
! -- Window with shade, screen, blind or diffusing glass
IF (ShadeOn .OR. BlindOn .OR. ScreenOn .OR. SurfaceWindow(IWin)%SolarDiffusing) THEN
TransBmBmMult = 0.0d0
TransMult = 0.0d0
! TH 7/7/2010 moved from inside the loop: DO JB = 1,MaxSlatAngs
IF (BlindOn) CALL ProfileAngle(IWin,SUNCOSHR(1:3,IHR),Blind(BlNum)%SlatOrientation,ProfAng)
DO JB = 1,MaxSlatAngs
IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
IF (ShadeOn .OR. ScreenOn .OR. SurfaceWindow(IWin)%SolarDiffusing) THEN ! Shade or screen on or diffusing glass
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
! Shaded visible transmittance of TDD for collimated beam from the sun
TransMult(1) = TransTDD(PipeNum, COSBSun, VisibleBeam) * SurfaceWindow(IWin)%GlazedFrac
ELSE
IF(ScreenOn)THEN
TransMult(1) = SurfaceScreens(SurfaceWindow(IWin)%ScreenNumber)%BmBmTransVis * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
ELSE
TransMult(1) = POLYF(COSBSun,Construct(IConstShaded)%TransVisBeamCoef(1)) * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
END IF
END IF
ELSE ! Blind on
! PETER: As long as only interior blinds are allowed for TDDs, no need to change TransMult calculation
! for TDDs because it is based on TVISBSun which is correctly calculated for TDDs above.
! TH 7/7/2010: This call is moved outside the loop - DO JB = 1,MaxSlatAngs
!CALL ProfileAngle(IWin,SUNCOSHR(1:3,IHR),Blind(BlNum)%SlatOrientation,ProfAng)
TransBlBmDiffFront = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffTrans(1:37,JB))
IF (ShType == WSC_ST_InteriorBlind) THEN ! Interior blind
! TH CR 8121, 7/7/2010
!ReflBlBmDiffFront = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffRefl)
ReflBlBmDiffFront = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffRefl(1:37,JB))
! TH added 7/12/2010 for CR 8121
ReflBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffRefl(JB)
TransBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffTrans(JB)
TransMult(JB) = TVISBSun * (TransBlBmDiffFront + ReflBlBmDiffFront*ReflGlDiffDiffBack*TransBlDiffDiffFront / &
(1.d0 - ReflBlDiffDiffFront*ReflGlDiffDiffBack))
ELSE IF (ShType == WSC_ST_ExteriorBlind) THEN ! Exterior blind
TransMult(JB) = TransBlBmDiffFront * (Construct(IConst)%TransDiffVis / &
(1.d0-ReflGlDiffDiffFront*Blind(BlNum)%VisBackDiffDiffRefl(JB))) &
* SurfaceWindow(IWin)%GlazedFrac * SurfaceWindow(IWin)%LightWellEff
ELSE ! Between-glass blind
t1 = POLYF(COSBSun,Construct(IConst)%tBareVisCoef(1,1:6))
tfshBd = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffTrans(1:37,JB))
rfshB = InterpProfAng(ProfAng,Blind(BlNum)%VisFrontBeamDiffRefl(1:37,JB))
IF (Construct(IConst)%TotGlassLayers == 2) THEN ! 2 glass layers
TransMult(JB) = t1*(tfshBd*(1.d0 + rfd2*rbshd) + rfshB*rbd1*tfshd)*td2 * SurfaceWindow(IWin)%LightWellEff
ELSE ! 3 glass layers; blind between layers 2 and 3
t2 = POLYF(COSBSun,Construct(IConst)%tBareVisCoef(2,1:6))
TransMult(JB) = t1*t2*(tfshBd*(1.d0 + rfd3*rbshd) + rfshB*(rbd2*tfshd + td2*rbd1*td2*tfshd))*td3 * &
SurfaceWindow(IWin)%LightWellEff
END IF
END IF
IF (SurfaceWindow(IWin)%MovableSlats) THEN
SlatAng = (JB - 1) * PI/(MaxSlatAngs - 1)
ELSE
SlatAng = Blind(BlNum)%SlatAngle * DegToRadians
END IF
TransBmBmMult(JB) = TVISBSun * BlindBeamBeamTrans(ProfAng,SlatAng,Blind(BlNum)%SlatWidth, &
Blind(BlNum)%SlatSeparation,Blind(BlNum)%SlatThickness)
END IF ! ShadeOn/ScreenOn/BlindOn/Diffusing glass
IF (SurfaceWindow(IWin)%OriginalClass .EQ. SurfaceClass_TDD_Dome) THEN
TransBmBmMult = 0.0d0! No beam, diffuse only
END IF
! Daylighting shelf simplification: No beam makes it past end of shelf, all light is diffuse
IF (InShelfSurf > 0) THEN ! Inside daylighting shelf
TransBmBmMult = 0.0d0! No beam, diffuse only (Not sure if this really works)
! SurfaceWindow(IWin)%FractionUpgoing is already set to 1.0 earlier
END IF
WLUMSU(JB+1,IHR) = WLUMSU(JB+1,IHR) + ZSU1 * TransMult(JB) / PI
WLUMSUdisk(JB+1,IHR) = ZSU1 * TransBmBmMult(JB) / PI
FLFWSU(JB+1) = FLFWSU(JB+1) + ZSU1 * TransMult(JB) * (1.0d0 - SurfaceWindow(IWin)%FractionUpgoing)
FLFWSUdisk(JB+1) = ZSU1 * TransBmBmMult(JB)
FLCWSU(JB+1) = FLCWSU(JB+1) + ZSU1 * TransMult(JB) * SurfaceWindow(IWin)%FractionUpgoing
END DO ! End of loop over slat angles
END IF ! End of window with shade or blind
END IF ! COSBSun > 0
END IF ! SunLitFracHR > 0
! Beam reaching window after specular reflection from exterior obstruction
! In the following, Beam normal illuminance times ZSU1refl = illuminance on window due to
! specular reflection from exterior surfaces
IF(CalcSolRefl .AND. SurfaceWindow(IWin)%OriginalClass /= SurfaceClass_TDD_Dome) THEN
ZSU1refl = ReflFacBmToBmSolObs(IWin,IHr)
IF(ZSU1refl > 0.0d0) THEN
! Contribution to window luminance and downgoing flux
! -- Bare window. We use diffuse-diffuse transmittance here rather than beam-beam to avoid
! complications due to specular reflection from multiple exterior surfaces
TVisSunRefl = Construct(IConst)%TransDiffVis * SurfaceWindow(IWin)%GlazedFrac * SurfaceWindow(IWin)%LightWellEff
! In the following it is assumed that all reflected beam is going downward, as it would be in the
! important case of reflection from a highly glazed facade of a neighboring building. However, in
! rare cases (such as upward specular reflection from a flat horizontal skylight) it may
! actually be going upward.
FLFWSUdisk(1) = FLFWSUdisk(1) + ZSU1refl * TVisSunRefl
! -- Window with shade, blind or diffusing glass
IF(ShadeOn .OR. BlindOn .OR. ScreenOn .OR. SurfaceWindow(IWin)%SolarDiffusing) THEN
TransBmBmMult = 0.0d0
TransMult = 0.0d0
DO JB = 1, MaxSlatAngs
IF(.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JB > 1) EXIT
IF(ShadeOn .OR. SurfaceWindow(IWin)%SolarDiffusing) THEN ! Shade on or diffusing glass
TransMult(1) = Construct(IConstShaded)%TransDiffVis * SurfaceWindow(IWin)%GlazedFrac * &
SurfaceWindow(IWin)%LightWellEff
ELSEIF (ScreenOn) THEN ! Exterior screen on
TransScDiffDiffFront = SurfaceScreens(SurfaceWindow(IWin)%ScreenNumber)%DifDifTransVis
TransMult(1) = TransScDiffDiffFront * (Construct(IConst)%TransDiffVis / &
(1.d0-ReflGlDiffDiffFront*ReflScDiffDiffBack)) &
* SurfaceWindow(IWin)%GlazedFrac * SurfaceWindow(IWin)%LightWellEff
ELSE ! Blind on
TransBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffTrans(JB)
IF(ShType == WSC_ST_InteriorBlind) THEN ! Interior blind
ReflBlDiffDiffFront = Blind(BlNum)%VisFrontDiffDiffRefl(JB)
TransMult(JB) = TVISSunRefl * (TransBlDiffDiffFront + &
ReflBlDiffDiffFront*ReflGlDiffDiffBack*TransBlDiffDiffFront / &
(1.d0 - ReflBlDiffDiffFront*ReflGlDiffDiffBack))
ELSE IF(ShType == WSC_ST_ExteriorBlind) THEN ! Exterior blind
TransMult(JB) = TransBlDiffDiffFront * (Construct(IConst)%TransDiffVis / &
(1.d0-ReflGlDiffDiffFront*Blind(BlNum)%VisBackDiffDiffRefl(JB))) &
* SurfaceWindow(IWin)%GlazedFrac * SurfaceWindow(IWin)%LightWellEff
ELSE ! Between-glass blind
t1 = Construct(IConst)%tBareVisDiff(1)
tfshBd = Blind(BlNum)%VisFrontDiffDiffTrans(JB)
rfshB = Blind(BlNum)%VisFrontDiffDiffRefl(JB)
IF (Construct(IConst)%TotGlassLayers == 2) THEN ! 2 glass layers
TransMult(JB) = t1*(tfshBd*(1.d0 + rfd2*rbshd) + rfshB*rbd1*tfshd)*td2 * SurfaceWindow(IWin)%LightWellEff
ELSE ! 3 glass layers; blind between layers 2 and 3
t2 = Construct(IConst)%tBareVisDiff(2)
TransMult(JB) = t1*t2*(tfshBd*(1.d0 + rfd3*rbshd) + rfshB*(rbd2*tfshd + td2*rbd1*td2*tfshd))*td3 * &
SurfaceWindow(IWin)%LightWellEff
END IF
END IF ! End of check of interior/exterior/between-glass blind
END IF ! ShadeOn/BlindOn
WLUMSU(JB+1,IHR) = WLUMSU(JB+1,IHR) + ZSU1refl * TransMult(JB) / PI
FLFWSU(JB+1) = FLFWSU(JB+1) + ZSU1refl * TransMult(JB) * (1.0d0 - SurfaceWindow(IWin)%FractionUpgoing)
FLCWSU(JB+1) = FLCWSU(JB+1) + ZSU1refl * TransMult(JB) * SurfaceWindow(IWin)%FractionUpgoing
END DO ! End of loop over slat angles
END IF ! End of check if window has shade, blind or diffusing glass
END IF ! End of check if ZSU1refl > 0.0
END IF ! End of check if solar reflections are in effect
! Sun-related portion of internally reflected illuminance
DO JSH = 1,MaxSlatAngs + 1
IF (.NOT.SurfaceWindow(IWin)%MovableSlats .AND. JSH > 2) EXIT
! Full area of window is used in following since effect of dividers on reducing
! effective window transmittance already accounted for in calc of FLFWSU and FLCWSU
! CR 7869 added effect of intervening interior windows on transmittance and
! added inside surface area of adjacent zone
EINTSU(JSH,IHR) = (FLFWSU(JSH) * SurfaceWindow(IWin)%RhoFloorWall &
+ FLCWSU(JSH) * SurfaceWindow(IWin)%RhoCeilingWall) * &
(Surface(IWin)%Area/SurfaceWindow(IWin)%GlazedFrac) / &
(ZoneInsideSurfArea*(1.d0-ZoneDaylight(ZoneNum)%AveVisDiffReflect))
EINTSUdisk(JSH,IHR) = FLFWSUdisk(JSH) * SurfaceWindow(IWin)%RhoFloorWall * &
(Surface(IWin)%Area/SurfaceWindow(IWin)%GlazedFrac) / &
(ZoneInsideSurfArea*(1.d0-ZoneDaylight(ZoneNum)%AveVisDiffReflect))
END DO
RETURN
END SUBROUTINE DayltgInterReflectedIllum