From 5363b0acc414ceb7cc38c22563fd319558a102c3 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sun, 30 Aug 2020 18:28:10 -0700 Subject: [PATCH 01/25] transolar --- src/EnergyPlus/DaylightingDevices.cc | 2 ++ src/EnergyPlus/HeatBalanceSurfaceManager.cc | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index d7c39bc8500..29acdacc7f1 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1487,6 +1487,8 @@ namespace DaylightingDevices { // Add diffuse interior shortwave reflected from zone surfaces and from zone sources, lights, etc. QRefl += QS(Surface(DiffSurf).SolarEnclIndex) * Surface(DiffSurf).Area * transDiff; + int test = TDDPipe(PipeNum).Dome; + TotTDDPipeGain = SurfWinTransSolar(TDDPipe(PipeNum).Dome) - QRadSWOutIncident(DiffSurf) * Surface(DiffSurf).Area + QRefl * (1.0 - TDDPipe(PipeNum).TransSolIso / transDiff) + QRadSWwinAbs(1, TDDPipe(PipeNum).Dome) * Surface(DiffSurf).Area / 2.0 + diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 443d75684ab..759f016152d 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2587,8 +2587,6 @@ namespace HeatBalanceSurfaceManager { SurfWinBSDFBeamThetaRep(SurfNum) = 0.0; SurfWinBSDFBeamPhiRep(SurfNum) = 0.0; - - } } @@ -2632,6 +2630,10 @@ namespace HeatBalanceSurfaceManager { } if (NumOfTDDPipes > 0) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + SurfWinTransSolar(SurfNum) = 0.0; + SurfWinTransSolarEnergy(SurfNum) = 0.0; + } for (auto &e : TDDPipe) { e.TransSolBeam = 0.0; e.TransSolDiff = 0.0; From e82f4a2cbcd5118185617d78ab55431278c99565 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 2 Sep 2020 14:37:14 -0700 Subject: [PATCH 02/25] more surf win --- src/EnergyPlus/DataHeatBalSurface.cc | 152 ++-- src/EnergyPlus/DataHeatBalSurface.hh | 76 +- src/EnergyPlus/DataHeatBalance.cc | 114 ++- src/EnergyPlus/DataHeatBalance.hh | 87 +-- src/EnergyPlus/DaylightingDevices.cc | 6 +- src/EnergyPlus/EcoRoofManager.cc | 4 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 44 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 14 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 4 +- src/EnergyPlus/HeatBalanceManager.cc | 4 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 695 +++++++++--------- src/EnergyPlus/Photovoltaics.cc | 10 +- src/EnergyPlus/SolarShading.cc | 117 +-- src/EnergyPlus/SwimmingPool.cc | 6 +- src/EnergyPlus/WindowComplexManager.cc | 6 +- src/EnergyPlus/WindowManager.cc | 6 +- .../WindowManagerExteriorThermal.cc | 4 +- .../unit/HeatBalFiniteDiffManager.unit.cc | 18 +- .../unit/HeatBalanceManager.unit.cc | 16 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 34 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 6 +- 21 files changed, 700 insertions(+), 723 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalSurface.cc b/src/EnergyPlus/DataHeatBalSurface.cc index 07f8ea599ce..48a9a572cd4 100644 --- a/src/EnergyPlus/DataHeatBalSurface.cc +++ b/src/EnergyPlus/DataHeatBalSurface.cc @@ -159,88 +159,88 @@ namespace DataHeatBalSurface { Array1D QAirExtReport; // Surface Outside Face Thermal Radiation to Air Heat Transfer Rate [W] Array1D QHeatEmiReport; // Surface Outside Face Heat Emission to Air Rate [W] - Array1D OpaqSurfInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond + Array1D SurfOpaqInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond // when Opaq Surf Ins Face Cond >= 0 - Array1D OpaqSurfInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond + Array1D SurfOpaqInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond // when Opaq Surf Ins Face Cond < 0 - Array1D OpaqSurfInsFaceConduction; // Opaque surface inside face heat conduction flow (W) + Array1D SurfOpaqInsFaceConduction; // Opaque surface inside face heat conduction flow (W) // from inside of opaque surfaces, for reporting (W) - Array1D OpaqSurfInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) + Array1D SurfOpaqInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) // from inside of opaque surfaces, for reporting (W/m2) - Array1D OpaqSurfInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) + Array1D SurfOpaqInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) // from inside of opaque surfaces, for reporting (J) - Array1D OpaqSurfExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond + Array1D SurfOpaqExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond // when Opaq Surf Ext Face Cond >= 0 - Array1D OpaqSurfExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond + Array1D SurfOpaqExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond // when Opaq Surf Ext Face Cond < 0 - Array1D OpaqSurfOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W) + Array1D SurfOpaqOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W) // from inside of opaque surfaces, for reporting (W) - Array1D OpaqSurfOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2) + Array1D SurfOpaqOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2) // from outside of opaque surfaces, for reporting (W/m2) - Array1D OpaqSurfOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J) + Array1D SurfOpaqOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J) // from inside of opaque surfaces, for reporting (J) - Array1D OpaqSurfAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond + Array1D SurfOpaqAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond // when Opaq Surf average Face Cond >= 0 - Array1D OpaqSurfAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond + Array1D SurfOpaqAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond // when Opaq Surf average Face Cond < 0 - Array1D OpaqSurfAvgFaceConduction; // Opaque surface average heat conduction flow (W) + Array1D SurfOpaqAvgFaceConduction; // Opaque surface average heat conduction flow (W) // net conduction from outside environ toward inside zone // from inside of opaque surfaces, for reporting (W) - Array1D OpaqSurfAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2) + Array1D SurfOpaqAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2) // net conduction from outside environ to inside zone // from inside of opaque surfaces, for reporting (W/m2) - Array1D OpaqSurfAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J) + Array1D SurfOpaqAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J) // net conduction from outside environ toward inside zone // from inside of opaque surfaces, for reporting (J) - Array1D OpaqSurfStorageGainRep; // Equals Opaque surface stored heat conduction flow + Array1D SurfOpaqStorageGainRep; // Equals Opaque surface stored heat conduction flow // when Opaque surface stored heat conduction flow >= 0 - Array1D OpaqSurfStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow + Array1D SurfOpaqStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow // when Opaque surface stored heat conduction flow < 0 - Array1D OpaqSurfStorageConduction; // Opaque surface stored heat conduction flow (W) + Array1D SurfOpaqStorageConduction; // Opaque surface stored heat conduction flow (W) // storage of heat inside surface, positive is increasing in surf - Array1D OpaqSurfStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2) + Array1D SurfOpaqStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2) // storage of heat inside surface, positive is increasing in surf - Array1D OpaqSurfStorageConductionEnergy; // Opaque surface stored heat conduction flow (J) + Array1D SurfOpaqStorageConductionEnergy; // Opaque surface stored heat conduction flow (J) // storage of heat inside surface, positive is increasing in surf - Array1D OpaqSurfInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, + Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, // for reporting (W) - Array1D TempSurfOut; // Temperature of the Outside Surface for each heat transfer surface + Array1D SurfTempSurfOut; // Temperature of the Outside Surface for each heat transfer surface // used for reporting purposes only. Ref: TH(x,1,1) - Array1D QRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation + Array1D SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - Array1D QC; // Short-Wave Radiation Converted Direct To Convection - Array1D QD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D ZoneQC; // Short-Wave Radiation Converted Direct To Convection + Array1D ZoneQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - Array1D QDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D ZoneQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows //(considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - Array1D QDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D ZoneQDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows - Array1D VMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) - Array1D VCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection - Array1D NetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces + Array1D ZoneVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection + Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D ZoneMRT; // Zone Mean Radiant Temperature - Array1D QRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface + Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface // Variables that are used in both the Surface Heat Balance and the Moisture Balance - Array1D QRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface - Array1D QRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface - Array1D QRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface + Array1D SurfOpaqQRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface + Array1D SurfOpaqQRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface + Array1D SurfQRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface - Array1D QAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions at outside surface - Array1D QAdditionalHeatSourceInside; // Additional heat source term on boundary conditions at inside surface + Array1D SurfQAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions at outside surface + Array1D SurfQAdditionalHeatSourceInside; // Additional heat source term on boundary conditions at inside surface - Array1D InitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2] - Array1D InitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2] + Array1D SurfOpaqInitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2] + Array1D SurfWinInitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2] // REAL(r64) variables from BLDCTF.inc and only used in the Heat Balance Array3D TH; // Temperature History (SurfNum,Hist Term,In/Out) where: @@ -324,45 +324,45 @@ namespace DataHeatBalSurface { QRadOutReport.deallocate(); QdotRadOutRep.deallocate(); QdotRadOutRepPerArea.deallocate(); - OpaqSurfInsFaceCondGainRep.deallocate(); - OpaqSurfInsFaceCondLossRep.deallocate(); - OpaqSurfInsFaceConduction.deallocate(); - OpaqSurfInsFaceConductionFlux.deallocate(); - OpaqSurfInsFaceConductionEnergy.deallocate(); - OpaqSurfExtFaceCondGainRep.deallocate(); - OpaqSurfExtFaceCondLossRep.deallocate(); - OpaqSurfOutsideFaceConduction.deallocate(); - OpaqSurfOutsideFaceConductionFlux.deallocate(); - OpaqSurfOutsideFaceConductionEnergy.deallocate(); - OpaqSurfAvgFaceCondGainRep.deallocate(); - OpaqSurfAvgFaceCondLossRep.deallocate(); - OpaqSurfAvgFaceConduction.deallocate(); - OpaqSurfAvgFaceConductionFlux.deallocate(); - OpaqSurfAvgFaceConductionEnergy.deallocate(); - OpaqSurfStorageGainRep.deallocate(); - OpaqSurfStorageCondLossRep.deallocate(); - OpaqSurfStorageConduction.deallocate(); - OpaqSurfStorageConductionFlux.deallocate(); - OpaqSurfStorageConductionEnergy.deallocate(); - OpaqSurfInsFaceBeamSolAbsorbed.deallocate(); - TempSurfOut.deallocate(); - QRadSWOutMvIns.deallocate(); - QC.deallocate(); - QD.deallocate(); - QDforDaylight.deallocate(); - QDV.deallocate(); - VMULT.deallocate(); - VCONV.deallocate(); - NetLWRadToSurf.deallocate(); + SurfOpaqInsFaceCondGainRep.deallocate(); + SurfOpaqInsFaceCondLossRep.deallocate(); + SurfOpaqInsFaceConduction.deallocate(); + SurfOpaqInsFaceConductionFlux.deallocate(); + SurfOpaqInsFaceConductionEnergy.deallocate(); + SurfOpaqExtFaceCondGainRep.deallocate(); + SurfOpaqExtFaceCondLossRep.deallocate(); + SurfOpaqOutsideFaceConduction.deallocate(); + SurfOpaqOutsideFaceConductionFlux.deallocate(); + SurfOpaqOutsideFaceConductionEnergy.deallocate(); + SurfOpaqAvgFaceCondGainRep.deallocate(); + SurfOpaqAvgFaceCondLossRep.deallocate(); + SurfOpaqAvgFaceConduction.deallocate(); + SurfOpaqAvgFaceConductionFlux.deallocate(); + SurfOpaqAvgFaceConductionEnergy.deallocate(); + SurfOpaqStorageGainRep.deallocate(); + SurfOpaqStorageCondLossRep.deallocate(); + SurfOpaqStorageConduction.deallocate(); + SurfOpaqStorageConductionFlux.deallocate(); + SurfOpaqStorageConductionEnergy.deallocate(); + SurfOpaqInsFaceBeamSolAbsorbed.deallocate(); + SurfTempSurfOut.deallocate(); + SurfQRadSWOutMvIns.deallocate(); + ZoneQC.deallocate(); + ZoneQD.deallocate(); + ZoneQDforDaylight.deallocate(); + ZoneQDV.deallocate(); + ZoneVMULT.deallocate(); + ZoneVCONV.deallocate(); + SurfNetLWRadToSurf.deallocate(); ZoneMRT.deallocate(); - QRadSWLightsInAbs.deallocate(); - QRadSWOutAbs.deallocate(); - QRadSWInAbs.deallocate(); - QRadLWOutSrdSurfs.deallocate(); - QAdditionalHeatSourceOutside.deallocate(); - QAdditionalHeatSourceInside.deallocate(); - InitialDifSolInAbs.deallocate(); - InitialDifSolInTrans.deallocate(); + SurfOpaqQRadSWLightsInAbs.deallocate(); + SurfOpaqQRadSWOutAbs.deallocate(); + SurfOpaqQRadSWInAbs.deallocate(); + SurfQRadLWOutSrdSurfs.deallocate(); + SurfQAdditionalHeatSourceOutside.deallocate(); + SurfQAdditionalHeatSourceInside.deallocate(); + SurfOpaqInitialDifSolInAbs.deallocate(); + SurfWinInitialDifSolInTrans.deallocate(); TH.deallocate(); QH.deallocate(); THM.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index d426055533c..3a3b997180d 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -156,88 +156,88 @@ namespace DataHeatBalSurface { extern Array1D QHeatEmiReport; // Surface Outside Face Heat Emission to Air Rate [W] // Outside face surf - extern Array1D OpaqSurfInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond + extern Array1D SurfOpaqInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond // when Opaq Surf Ins Face Cond >= 0 - extern Array1D OpaqSurfInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond + extern Array1D SurfOpaqInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond // when Opaq Surf Ins Face Cond < 0 - extern Array1D OpaqSurfInsFaceConduction; // Opaque surface inside face heat conduction flow (W) + extern Array1D SurfOpaqInsFaceConduction; // Opaque surface inside face heat conduction flow (W) // from inside of opaque surfaces, for reporting (W) - extern Array1D OpaqSurfInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) + extern Array1D SurfOpaqInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2) // from inside of opaque surfaces, for reporting (W/m2) - extern Array1D OpaqSurfInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) + extern Array1D SurfOpaqInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J) // from inside of opaque surfaces, for reporting (J) - extern Array1D OpaqSurfExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond + extern Array1D SurfOpaqExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond // when Opaq Surf Ext Face Cond >= 0 - extern Array1D OpaqSurfExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond + extern Array1D SurfOpaqExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond // when Opaq Surf Ext Face Cond < 0 - extern Array1D OpaqSurfOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W) + extern Array1D SurfOpaqOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W) // from inside of opaque surfaces, for reporting (W) - extern Array1D OpaqSurfOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2) + extern Array1D SurfOpaqOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2) // from outside of opaque surfaces, for reporting (W/m2) - extern Array1D OpaqSurfOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J) + extern Array1D SurfOpaqOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J) // from inside of opaque surfaces, for reporting (J) - extern Array1D OpaqSurfAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond + extern Array1D SurfOpaqAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond // when Opaq Surf average Face Cond >= 0 - extern Array1D OpaqSurfAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond + extern Array1D SurfOpaqAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond // when Opaq Surf average Face Cond < 0 - extern Array1D OpaqSurfAvgFaceConduction; // Opaque surface average heat conduction flow (W) + extern Array1D SurfOpaqAvgFaceConduction; // Opaque surface average heat conduction flow (W) // net conduction from outside environ toward inside zone // from inside of opaque surfaces, for reporting (W) - extern Array1D OpaqSurfAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2) + extern Array1D SurfOpaqAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2) // net conduction from outside environ to inside zone // from inside of opaque surfaces, for reporting (W/m2) - extern Array1D OpaqSurfAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J) + extern Array1D SurfOpaqAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J) // net conduction from outside environ toward inside zone // from inside of opaque surfaces, for reporting (J) - extern Array1D OpaqSurfStorageGainRep; // Equals Opaque surface stored heat conduction flow + extern Array1D SurfOpaqStorageGainRep; // Equals Opaque surface stored heat conduction flow // when Opaque surface stored heat conduction flow >= 0 - extern Array1D OpaqSurfStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow + extern Array1D SurfOpaqStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow // when Opaque surface stored heat conduction flow < 0 - extern Array1D OpaqSurfStorageConduction; // Opaque surface stored heat conduction flow (W) + extern Array1D SurfOpaqStorageConduction; // Opaque surface stored heat conduction flow (W) // storage of heat inside surface, positive is increasing in surf - extern Array1D OpaqSurfStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2) + extern Array1D SurfOpaqStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2) // storage of heat inside surface, positive is increasing in surf - extern Array1D OpaqSurfStorageConductionEnergy; // Opaque surface stored heat conduction flow (J) + extern Array1D SurfOpaqStorageConductionEnergy; // Opaque surface stored heat conduction flow (J) // storage of heat inside surface, positive is increasing in surf - extern Array1D OpaqSurfInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, + extern Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, // for reporting (W) - extern Array1D TempSurfOut; // Temperature of the Outside Surface for each heat transfer surface + extern Array1D SurfTempSurfOut; // Temperature of the Outside Surface for each heat transfer surface // used for reporting purposes only. Ref: TH(x,1,1) - extern Array1D QRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation + extern Array1D SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - extern Array1D QC; // Short-Wave Radiation Converted Direct To Convection - extern Array1D QD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D ZoneQC; // Short-Wave Radiation Converted Direct To Convection + extern Array1D ZoneQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - extern Array1D QDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D ZoneQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows //(considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - extern Array1D QDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D ZoneQDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows - extern Array1D VMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) - extern Array1D VCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection - extern Array1D NetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces + extern Array1D ZoneVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + extern Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection + extern Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces extern Array1D ZoneMRT; // Zone Mean Radiant Temperature - extern Array1D QRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface + extern Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface // Variables that are used in both the Surface Heat Balance and the Moisture Balance - extern Array1D QRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface - extern Array1D QRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface - extern Array1D QRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface + extern Array1D SurfOpaqQRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface + extern Array1D SurfOpaqQRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface + extern Array1D SurfQRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface - extern Array1D QAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions - extern Array1D QAdditionalHeatSourceInside; // Additional heat source term on boundary conditions + extern Array1D SurfQAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions + extern Array1D SurfQAdditionalHeatSourceInside; // Additional heat source term on boundary conditions - extern Array1D InitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2] - extern Array1D InitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2] + extern Array1D SurfOpaqInitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2] + extern Array1D SurfWinInitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2] // REAL(r64) variables from BLDCTF.inc and only used in the Heat Balance extern Array3D TH; // Temperature History (SurfNum,Hist Term,In/Out) where: diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 417a395a8d1..06b71e0e235 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -631,39 +631,7 @@ namespace DataHeatBalance { Array1D ZoneOpaqSurfExtFaceCond; // Zone outside face opaque surface conduction (W) Array1D ZoneOpaqSurfExtFaceCondGainRep; // = Zone outside face opaque surface conduction when >= 0 Array1D ZoneOpaqSurfExtFaceCondLossRep; // = -Zone outside face opaque surface conduction when < 0 - Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces - Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers - Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers - // from inside(W/m2) - Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) - Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) - Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) - Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) - Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) - Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse - // reflection from ground (W/m2) - Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse - // reflection from ground (W/m2) - Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam - // reflection from obstructions (W/m2) - Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse - // reflection from obstructions (W/m2) - Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse - // reflection from obstructions (W/m2) - Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) - - Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] - Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] - Array1D SurfWinBSDFBeamPhiRep; // BSDF beam Phi angle (for reporting) [rad] - - Array1D QRadSWwinAbsTot; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) - Array2D QRadSWwinAbsLayer; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) - - Array2D FenLaySurfTempFront; // Front surface temperatures of fenestration layers - Array2D FenLaySurfTempBack; // Back surface temperatures of fenestration layers + Array1D ZoneTransSolarEnergy; // Energy of ZoneTransSolar [J] Array1D ZoneWinHeatGainRepEnergy; // Energy of ZoneWinHeatGainRep [J] Array1D ZoneWinHeatLossRepEnergy; // Energy of ZoneWinHeatLossRep [J] @@ -675,21 +643,45 @@ namespace DataHeatBalance { Array1D ZnOpqSurfInsFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] Array1D ZnOpqSurfExtFaceCondGnRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondGainRep [J] Array1D ZnOpqSurfExtFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] - Array1D BmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] - Array1D IntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] - Array1D QRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] - Array1D SWwinAbsTotalReport; // Report - Total interior/exterior shortwave - // absorbed in all glass layers of window (W) - Array1D InitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar - // absorbed on inside of surface (W) - Array1D InitialDifSolInTransReport; // Report - Initial transmitted diffuse solar - // transmitted out through inside of window surface (W) - Array1D SWInAbsTotalReport; // Report - Total interior/exterior shortwave - // absorbed on inside of surface (W) - Array1D SWOutAbsTotalReport; // Report - Total exterior shortwave/solar - // absorbed on outside of surface (W) - Array1D SWOutAbsEnergyReport; // Report - Total exterior shortwave/solar - // absorbed on outside of surface (j) + + + Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces + Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers + Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) + Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) + Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) + Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) + Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) + Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) + Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) + Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) + Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) + Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) + Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) + Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) + Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) + Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) + Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) + + + Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) + Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] + Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] + + Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] + Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] + Array1D SurfWinBSDFBeamPhiRep; // BSDF beam Phi angle (for reporting) [rad] + Array1D SurfWinQRadSWwinAbsTot; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) + Array2D SurfWinQRadSWwinAbsLayer; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) + Array2D SurfWinFenLaySurfTempFront; // Front surface temperatures of fenestration layers + Array2D SurfWinFenLaySurfTempBack; // Back surface temperatures of fenestration layers + Array1D SurfWinQRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] + Array1D SurfWinSWwinAbsTotalReport; // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W) + Array1D SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out through inside of window surface (W) + + Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) + Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) + Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions @@ -1009,10 +1001,10 @@ namespace DataHeatBalance { SurfWinBSDFBeamDirectionRep.deallocate(); SurfWinBSDFBeamThetaRep.deallocate(); SurfWinBSDFBeamPhiRep.deallocate(); - QRadSWwinAbsTot.deallocate(); - QRadSWwinAbsLayer.deallocate(); - FenLaySurfTempFront.deallocate(); - FenLaySurfTempBack.deallocate(); + SurfWinQRadSWwinAbsTot.deallocate(); + SurfWinQRadSWwinAbsLayer.deallocate(); + SurfWinFenLaySurfTempFront.deallocate(); + SurfWinFenLaySurfTempBack.deallocate(); ZoneTransSolarEnergy.deallocate(); ZoneWinHeatGainRepEnergy.deallocate(); ZoneWinHeatLossRepEnergy.deallocate(); @@ -1024,15 +1016,15 @@ namespace DataHeatBalance { ZnOpqSurfInsFaceCondLsRepEnrg.deallocate(); ZnOpqSurfExtFaceCondGnRepEnrg.deallocate(); ZnOpqSurfExtFaceCondLsRepEnrg.deallocate(); - BmIncInsSurfAmountRepEnergy.deallocate(); - IntBmIncInsSurfAmountRepEnergy.deallocate(); - QRadSWwinAbsTotEnergy.deallocate(); - SWwinAbsTotalReport.deallocate(); - InitialDifSolInAbsReport.deallocate(); - InitialDifSolInTransReport.deallocate(); - SWInAbsTotalReport.deallocate(); - SWOutAbsTotalReport.deallocate(); - SWOutAbsEnergyReport.deallocate(); + SurfBmIncInsSurfAmountRepEnergy.deallocate(); + SurfIntBmIncInsSurfAmountRepEnergy.deallocate(); + SurfWinQRadSWwinAbsTotEnergy.deallocate(); + SurfWinSWwinAbsTotalReport.deallocate(); + SurfInitialDifSolInAbsReport.deallocate(); + SurfWinInitialDifSolInTransReport.deallocate(); + SurfSWInAbsTotalReport.deallocate(); + SurfOpaqSWOutAbsTotalReport.deallocate(); + SurfOpaqSWOutAbsEnergyReport.deallocate(); NominalR.deallocate(); NominalRforNominalUCalculation.deallocate(); NominalU.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 4e3c51ff161..aee79777be8 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -478,39 +478,7 @@ namespace DataHeatBalance { extern Array1D ZoneOpaqSurfExtFaceCond; // Zone outside face opaque surface conduction (W) extern Array1D ZoneOpaqSurfExtFaceCondGainRep; // = Zone outside face opaque surface conduction when >= 0 extern Array1D ZoneOpaqSurfExtFaceCondLossRep; // = -Zone outside face opaque surface conduction when < 0 - extern Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces - extern Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers - extern Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers - // from inside(W/m2) - extern Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) - extern Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) - extern Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) - extern Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) - extern Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) - extern Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse - // reflection from ground (W/m2) - extern Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse - // reflection from ground (W/m2) - extern Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam - // reflection from obstructions (W/m2) - extern Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse - // reflection from obstructions (W/m2) - extern Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse - // reflection from obstructions (W/m2) - extern Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) - - extern Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] - extern Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] - extern Array1D SurfWinBSDFBeamPhiRep; // BSDF beam Phi angle (for reporting) [rad] - - extern Array1D QRadSWwinAbsTot; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) - extern Array2D QRadSWwinAbsLayer; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) - - extern Array2D FenLaySurfTempFront; // Front surface temperatures of fenestration layers - extern Array2D FenLaySurfTempBack; // Back surface temperatures of fenestration layers + extern Array1D ZoneTransSolarEnergy; // Energy of ZoneTransSolar [J] extern Array1D ZoneWinHeatGainRepEnergy; // Energy of ZoneWinHeatGainRep [J] extern Array1D ZoneWinHeatLossRepEnergy; // Energy of ZoneWinHeatLossRep [J] @@ -522,21 +490,44 @@ namespace DataHeatBalance { extern Array1D ZnOpqSurfInsFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] extern Array1D ZnOpqSurfExtFaceCondGnRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondGainRep [J] extern Array1D ZnOpqSurfExtFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] - extern Array1D BmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] - extern Array1D IntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] - extern Array1D QRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] - extern Array1D SWwinAbsTotalReport; // Report - Total interior/exterior shortwave - // absorbed in all glass layers of window (W) - extern Array1D InitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar - // absorbed on inside of surface (W) - extern Array1D InitialDifSolInTransReport; // Report - Initial transmitted diffuse solar - // transmitted out through inside of window surface (W) - extern Array1D SWInAbsTotalReport; // Report - Total interior/exterior shortwave - // absorbed on inside of surface (W) - extern Array1D SWOutAbsTotalReport; // Report - Total exterior shortwave/solar - // absorbed on outside of surface (W) - extern Array1D SWOutAbsEnergyReport; // Report - Total exterior shortwave/solar - // absorbed on outside of surface (j) + + extern Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces + extern Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers + extern Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) + extern Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) + extern Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) + extern Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) + extern Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) + extern Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) + extern Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) + extern Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) + extern Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) + extern Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) + extern Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) + extern Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) + extern Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) + extern Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) + extern Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) + + extern Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) + extern Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] + extern Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] + + extern Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] + extern Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] + extern Array1D SurfWinBSDFBeamPhiRep; // BSDF beam Phi angle (for reporting) [rad] + extern Array1D SurfWinQRadSWwinAbsTot; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) + extern Array2D SurfWinQRadSWwinAbsLayer; // Exterior beam plus diffuse solar absorbed in glass layers of window (W) + extern Array2D SurfWinFenLaySurfTempFront; // Front surface temperatures of fenestration layers + extern Array2D SurfWinFenLaySurfTempBack; // Back surface temperatures of fenestration layers + extern Array1D SurfWinQRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] + extern Array1D SurfWinSWwinAbsTotalReport; // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W) + extern Array1D SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out through inside of window surface (W) + + extern Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) + extern Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) + extern Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) + extern Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces extern Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 29acdacc7f1..d84b6da28d0 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1459,7 +1459,7 @@ namespace DaylightingDevices { // Using/Aliasing using DataHeatBalance::QRadSWOutIncident; using DataHeatBalance::QRadSWwinAbs; - using DataHeatBalance::QRadSWwinAbsTot; + using DataHeatBalance::SurfWinQRadSWwinAbsTot; using DataHeatBalance::QS; using DataSurfaces::SurfWinTransSolar; @@ -1482,13 +1482,11 @@ namespace DaylightingDevices { // Calculate diffuse solar reflected back up the pipe by the inside surface of the TDD:DIFFUSER // All solar arriving at the diffuser is assumed to be isotropically diffuse by this point - QRefl = (QRadSWOutIncident(DiffSurf) - QRadSWwinAbsTot(DiffSurf)) * Surface(DiffSurf).Area - SurfWinTransSolar(DiffSurf); + QRefl = (QRadSWOutIncident(DiffSurf) - SurfWinQRadSWwinAbsTot(DiffSurf)) * Surface(DiffSurf).Area - SurfWinTransSolar(DiffSurf); // Add diffuse interior shortwave reflected from zone surfaces and from zone sources, lights, etc. QRefl += QS(Surface(DiffSurf).SolarEnclIndex) * Surface(DiffSurf).Area * transDiff; - int test = TDDPipe(PipeNum).Dome; - TotTDDPipeGain = SurfWinTransSolar(TDDPipe(PipeNum).Dome) - QRadSWOutIncident(DiffSurf) * Surface(DiffSurf).Area + QRefl * (1.0 - TDDPipe(PipeNum).TransSolIso / transDiff) + QRadSWwinAbs(1, TDDPipe(PipeNum).Dome) * Surface(DiffSurf).Area / 2.0 + diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index ebe7810fbc9..81aa7999414 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -455,9 +455,9 @@ namespace EcoRoofManager { if (dataConstruction.Construct(ConstrNum).CTFCross(0) > 0.01) { QuickConductionSurf = true; F1temp = dataConstruction.Construct(ConstrNum).CTFCross(0) / (dataConstruction.Construct(ConstrNum).CTFInside(0) + HConvIn(SurfNum)); - Qsoilpart1 = -CTFConstOutPart(SurfNum) + F1temp * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + Qsoilpart1 = -CTFConstOutPart(SurfNum) + F1temp * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + dataConstruction.Construct(ConstrNum).CTFSourceIn(0) * QsrcHist(SurfNum, 1) + - HConvIn(SurfNum) * MAT(ZoneNum) + NetLWRadToSurf(SurfNum)); + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum)); } else { Qsoilpart1 = -CTFConstOutPart(SurfNum) + dataConstruction.Construct(ConstrNum).CTFCross(0) * TempSurfIn(SurfNum); F1temp = 0.0; diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index 8248ace3bc1..c6d562f0d4e 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -124,17 +124,17 @@ namespace HeatBalFiniteDiffManager { using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalSurface::MaxSurfaceTempLimit; using DataHeatBalSurface::MinSurfaceTempLimit; - using DataHeatBalSurface::NetLWRadToSurf; - using DataHeatBalSurface::OpaqSurfInsFaceConduction; - using DataHeatBalSurface::OpaqSurfInsFaceConductionFlux; - using DataHeatBalSurface::OpaqSurfOutsideFaceConduction; - using DataHeatBalSurface::OpaqSurfOutsideFaceConductionFlux; + using DataHeatBalSurface::SurfNetLWRadToSurf; + using DataHeatBalSurface::SurfOpaqInsFaceConduction; + using DataHeatBalSurface::SurfOpaqInsFaceConductionFlux; + using DataHeatBalSurface::SurfOpaqOutsideFaceConduction; + using DataHeatBalSurface::SurfOpaqOutsideFaceConductionFlux; using DataHeatBalSurface::QdotRadNetSurfInRep; using DataHeatBalSurface::QdotRadOutRepPerArea; using DataHeatBalSurface::QRadNetSurfInReport; - using DataHeatBalSurface::QRadSWInAbs; - using DataHeatBalSurface::QRadSWOutAbs; - using DataHeatBalSurface::QRadSWOutMvIns; + using DataHeatBalSurface::SurfOpaqQRadSWInAbs; + using DataHeatBalSurface::SurfOpaqQRadSWOutAbs; + using DataHeatBalSurface::SurfQRadSWOutMvIns; using DataHeatBalSurface::TempSource; using DataHeatBalSurface::TempUserLoc; using DataSurfaces::Ground; @@ -666,8 +666,8 @@ namespace HeatBalFiniteDiffManager { // And then initialize QHeatInFlux = 0.0; QHeatOutFlux = 0.0; - OpaqSurfInsFaceConductionFlux = 0.0; - OpaqSurfOutsideFaceConductionFlux = 0.0; + SurfOpaqInsFaceConductionFlux = 0.0; + SurfOpaqOutsideFaceConductionFlux = 0.0; // Setup Output Variables @@ -1437,8 +1437,8 @@ namespace HeatBalFiniteDiffManager { Tsky = OSCM(surface.OSCMPtr).TRad; QRadSWOutFD = 0.0; // eliminate incident shortwave on underlying surface } else { // Set the external conditions to local variables - QRadSWOutFD = QRadSWOutAbs(Surf); - QRadSWOutMvInsulFD = QRadSWOutMvIns(Surf); + QRadSWOutFD = SurfOpaqQRadSWOutAbs(Surf); + QRadSWOutMvInsulFD = SurfQRadSWOutMvIns(Surf); Tsky = SkyTemp; } @@ -1507,10 +1507,10 @@ namespace HeatBalFiniteDiffManager { SurfaceFD(Surf).CpDelXRhoS2(i) = surfaceFDEBC.CpDelXRhoS1(TotNodesPlusOne); // Save this for computing node flux values } - Real64 const QNetSurfFromOutside(OpaqSurfInsFaceConductionFlux(surface_ExtBoundCond)); // filled in InteriorBCEqns + Real64 const QNetSurfFromOutside(SurfOpaqInsFaceConductionFlux(surface_ExtBoundCond)); // filled in InteriorBCEqns // QFluxOutsideToOutSurf(Surf) = QnetSurfFromOutside - OpaqSurfOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; - OpaqSurfOutsideFaceConduction(Surf) = surface.Area * OpaqSurfOutsideFaceConductionFlux(Surf); + SurfOpaqOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; + SurfOpaqOutsideFaceConduction(Surf) = surface.Area * SurfOpaqOutsideFaceConductionFlux(Surf); QHeatOutFlux(Surf) = QNetSurfFromOutside; } else if (surface_ExtBoundCond <= 0) { // regular outside conditions @@ -1650,8 +1650,8 @@ namespace HeatBalFiniteDiffManager { Real64 const QNetSurfFromOutside(QRadSWOutFD + (hgnd * (-TDT_i + Tgnd) + (hconvo + hrad) * Toa_TDT_i + hsky * (-TDT_i + Tsky))); // Same sign convention as CTFs - OpaqSurfOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; - OpaqSurfOutsideFaceConduction(Surf) = surface.Area * OpaqSurfOutsideFaceConductionFlux(Surf); + SurfOpaqOutsideFaceConductionFlux(Surf) = -QNetSurfFromOutside; + SurfOpaqOutsideFaceConduction(Surf) = surface.Area * SurfOpaqOutsideFaceConductionFlux(Surf); // Report all outside BC heat fluxes QdotRadOutRepPerArea(Surf) = -(hgnd * (TDT_i - Tgnd) + hrad * (-Toa_TDT_i) + hsky * (TDT_i - Tsky)); @@ -2093,8 +2093,8 @@ namespace HeatBalFiniteDiffManager { int const ConstrNum(surface.Construction); // Set the internal conditions to local variables - Real64 const NetLWRadToSurfFD(NetLWRadToSurf(Surf)); // Net interior long wavelength radiation to surface from other surfaces - Real64 const QRadSWInFD(QRadSWInAbs(Surf)); // Short wave radiation absorbed on inside of opaque surface + Real64 const NetLWRadToSurfFD(SurfNetLWRadToSurf(Surf)); // Net interior long wavelength radiation to surface from other surfaces + Real64 const QRadSWInFD(SurfOpaqQRadSWInAbs(Surf)); // Short wave radiation absorbed on inside of opaque surface Real64 const QHtRadSysSurfFD( QHTRadSysSurf(Surf)); // Current radiant heat flux at a surface due to the presence of high temperature radiant heaters Real64 const QHWBaseboardSurfFD( @@ -2215,9 +2215,9 @@ namespace HeatBalFiniteDiffManager { Real64 const QNetSurfInside(-(QFac + hconvi * (-TDT_i + Tia))); // Pass inside conduction Flux [W/m2] to DataHeatBalanceSurface array - OpaqSurfInsFaceConductionFlux(Surf) = QNetSurfInside; + SurfOpaqInsFaceConductionFlux(Surf) = QNetSurfInside; // QFluxZoneToInSurf(Surf) = QNetSurfInside - OpaqSurfInsFaceConduction(Surf) = QNetSurfInside * surface.Area; // for reporting as in CTF, PT + SurfOpaqInsFaceConduction(Surf) = QNetSurfInside * surface.Area; // for reporting as in CTF, PT } void CheckFDSurfaceTempLimits(int const SurfNum, // surface number @@ -2365,7 +2365,7 @@ namespace HeatBalFiniteDiffManager { // so the arrays are all allocated to Totodes+1 // Heat flux at the inside face node (TotNodes+1) - surfaceFD.QDreport(TotNodes + 1) = OpaqSurfInsFaceConductionFlux(Surf); + surfaceFD.QDreport(TotNodes + 1) = SurfOpaqInsFaceConductionFlux(Surf); // Heat flux for remaining nodes. for (node = TotNodes; node >= 1; --node) { diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 7095cdbd711..8b3ead8d1f0 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -120,9 +120,9 @@ namespace HeatBalanceHAMTManager { using DataHeatBalSurface::MaxSurfaceTempLimitBeforeFatal; using DataHeatBalSurface::MinSurfaceTempLimit; using DataHeatBalSurface::MinSurfaceTempLimitBeforeFatal; - using DataHeatBalSurface::NetLWRadToSurf; - using DataHeatBalSurface::QRadSWInAbs; - using DataHeatBalSurface::QRadSWOutAbs; + using DataHeatBalSurface::SurfNetLWRadToSurf; + using DataHeatBalSurface::SurfOpaqQRadSWInAbs; + using DataHeatBalSurface::SurfOpaqQRadSWOutAbs; using namespace DataHeatBalance; using namespace Psychrometrics; using DataEnvironment::IsRain; @@ -1094,7 +1094,7 @@ namespace HeatBalanceHAMTManager { // na // Using/Aliasing - using DataHeatBalSurface::QAdditionalHeatSourceInside; + using DataHeatBalSurface::SurfQAdditionalHeatSourceInside; using DataSurfaces::OSCM; using DataSurfaces::OtherSideCondModeledExt; using General::RoundSigDigits; @@ -1194,7 +1194,7 @@ namespace HeatBalanceHAMTManager { } else { cells(ExtSkycell(sid)).temp = SkyTemp; - cells(Extcell(sid)).Qadds = Surface(sid).Area * QRadSWOutAbs(sid); + cells(Extcell(sid)).Qadds = Surface(sid).Area * SurfOpaqQRadSWOutAbs(sid); } cells(ExtGrncell(sid)).temp = TempOutsideAirFD(sid); @@ -1218,8 +1218,8 @@ namespace HeatBalanceHAMTManager { cells(IntConcell(sid)).htc = HConvInFD(sid); cells(Intcell(sid)).Qadds = - Surface(sid).Area * (QRadSWInAbs(sid) + NetLWRadToSurf(sid) + QHTRadSysSurf(sid) + QCoolingPanelSurf(sid) + QHWBaseboardSurf(sid) + - QSteamBaseboardSurf(sid) + QElecBaseboardSurf(sid) + QRadThermInAbs(sid) + QAdditionalHeatSourceInside(sid)); + Surface(sid).Area * (SurfOpaqQRadSWInAbs(sid) + SurfNetLWRadToSurf(sid) + QHTRadSysSurf(sid) + QCoolingPanelSurf(sid) + QHWBaseboardSurf(sid) + + QSteamBaseboardSurf(sid) + QElecBaseboardSurf(sid) + QRadThermInAbs(sid) + SurfQAdditionalHeatSourceInside(sid)); // Check, Is this per unit area or for the whole wall. // cells(Intcell(sid))%Qadds=QRadSWInAbs(sid)+NetLWRadToSurf(sid)+QHtRadSysSurf(sid)+QRadThermInAbs(sid) diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index 0965687cb60..f1b83cc63a2 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -370,7 +370,7 @@ namespace HeatBalanceKivaManager { bcs->diffuseHorizontalFlux = DataEnvironment::DifSolarRad; bcs->skyEmissivity = pow4(DataEnvironment::SkyTempKelvin) / pow4(bcs->outdoorTemp); - bcs->slabAbsRadiation = DataHeatBalSurface::QRadSWInAbs(floorSurface) + // solar + bcs->slabAbsRadiation = DataHeatBalSurface::SurfOpaqQRadSWInAbs(floorSurface) + // solar DataHeatBalance::QRadThermInAbs(floorSurface) + // internal gains DataHeatBalFanSys::QHTRadSysSurf(floorSurface) + DataHeatBalFanSys::QHWBaseboardSurf(floorSurface) + DataHeatBalFanSys::QCoolingPanelSurf(floorSurface) + DataHeatBalFanSys::QSteamBaseboardSurf(floorSurface) + @@ -389,7 +389,7 @@ namespace HeatBalanceKivaManager { Real64 TARadTotal = 0.0; Real64 TAConvTotal = 0.0; for (auto &wl : wallSurfaces) { - Real64 Q = DataHeatBalSurface::QRadSWInAbs(wl) + // solar + Real64 Q = DataHeatBalSurface::SurfOpaqQRadSWInAbs(wl) + // solar DataHeatBalance::QRadThermInAbs(wl) + // internal gains DataHeatBalFanSys::QHTRadSysSurf(wl) + DataHeatBalFanSys::QHWBaseboardSurf(floorSurface) + DataHeatBalFanSys::QCoolingPanelSurf(wl) + DataHeatBalFanSys::QSteamBaseboardSurf(floorSurface) + diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index c69e19a0596..136f497e2cf 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5876,8 +5876,8 @@ namespace HeatBalanceManager { if (thisSurface.Class == DataSurfaces::SurfaceClass_Window) { auto &thisConstruct(thisSurface.Construction); if (!dataConstruction.Construct(thisConstruct).WindowTypeBSDF && !dataConstruction.Construct(thisConstruct).TypeIsAirBoundaryInteriorWindow) { - FenLaySurfTempFront(1, SurfNum) = TH(1, 1, SurfNum); - FenLaySurfTempBack(dataConstruction.Construct(thisConstruct).TotLayers, SurfNum) = TH(2, 1, SurfNum); + SurfWinFenLaySurfTempFront(1, SurfNum) = TH(1, 1, SurfNum); + SurfWinFenLaySurfTempBack(dataConstruction.Construct(thisConstruct).TotLayers, SurfNum) = TH(2, 1, SurfNum); } } } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f7e64fabc88..3758a1f8d9a 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -386,34 +386,6 @@ namespace HeatBalanceSurfaceManager { // DERIVED TYPE DEFINITIONS: // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int SurfNum; // DO loop counter for surfaces - int SrdSurfsNum; // DO loop counter for srd surfaces - int SrdSurfNum; - Real64 SrdSurfsViewFactor; - - // RJH DElight Modification Begin - Real64 dPowerReducFac; // Return value Electric Lighting Power Reduction Factor for current Zone and Timestep - Real64 dHISKFFC; // double value for argument passing - Real64 dHISUNFFC; // double value for argument passing - Real64 dSOLCOS1; // double value for argument passing - Real64 dSOLCOS2; // double value for argument passing - Real64 dSOLCOS3; // double value for argument passing - Real64 dLatitude; // double value for argument passing - Real64 dCloudFraction; // double value for argument passing - int iErrorFlag; // Error Flag for warning/errors returned from DElight - int iReadStatus; // Error File Read Status - std::string cErrorMsg; // Each DElight Error Message can be up to 200 characters long - bool bEndofErrFile; // End of Error File flag - int iDElightRefPt; // Reference Point number for reading DElight Dump File (eplusout.delighteldmp) - Real64 dRefPtIllum; // tmp var for reading RefPt illuminance - // RJH DElight Modification End - - int MapNum; - bool errFlag; - bool elOpened; - // LOGICAL :: ShadowingSurf - // FLOW: assert(equal_dimensions(TH, QH)); @@ -441,7 +413,7 @@ namespace HeatBalanceSurfaceManager { // IF (Surface(SurfNum)%ExtWind) Surface(SurfNum)%WindSpeed = WindSpeedAt(Surface(SurfNum)%Centroid%z) // END DO if (AnyLocalEnvironmentsInModel) { - for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (Surface(SurfNum).HasLinkedOutAirNode) { Surface(SurfNum).OutDryBulbTemp = Node(Surface(SurfNum).LinkedOutAirNode).OutAirDryBulb; Surface(SurfNum).OutWetBulbTemp = Node(Surface(SurfNum).LinkedOutAirNode).OutAirWetBulb; @@ -450,15 +422,15 @@ namespace HeatBalanceSurfaceManager { } if (InitSurfaceHeatBalancefirstTime && Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; - SrdSurfsViewFactor = 0; + Real64 SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + Real64 SrdSurfsViewFactor = 0; if (SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor >= 0) { SrdSurfsViewFactor += SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; } if (SurroundingSurfsProperty(SrdSurfsNum).GroundViewFactor >= 0) { SrdSurfsViewFactor += SurroundingSurfsProperty(SrdSurfsNum).GroundViewFactor; } - for (SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { + for (int SrdSurfNum = 1; SrdSurfNum <= SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfsViewFactor += SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; } // Check if the sum of all defined view factors > 1.0 @@ -490,7 +462,7 @@ namespace HeatBalanceSurfaceManager { } // Overwriting surface and zone level environmental data with EMS override value if (AnyEnergyManagementSystemInModel) { - for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (Surface(SurfNum).OutDryBulbTempEMSOverrideOn) { Surface(SurfNum).OutDryBulbTemp = Surface(SurfNum).OutDryBulbTempEMSOverrideValue; } @@ -601,16 +573,22 @@ namespace HeatBalanceSurfaceManager { // Check if the sun is up and the current Thermal Zone hosts a Daylighting:DElight object if (SunIsUp && ZoneDaylight(NZ).TotalDaylRefPoints != 0 && (ZoneDaylight(NZ).DaylightMethod == DataDaylighting::DElightDaylighting)) { // Call DElight interior illuminance and electric lighting control subroutine - dPowerReducFac = 1.0; - dHISKFFC = HISKF * LUX2FC; - dHISUNFFC = HISUNF * LUX2FC; - dSOLCOS1 = SOLCOS(1); - dSOLCOS2 = SOLCOS(2); - dSOLCOS3 = SOLCOS(3); - dLatitude = Latitude; - dCloudFraction = CloudFraction; - // Init Error Flag to 0 (no Warnings or Errors) - iErrorFlag = 0; + Real64 dPowerReducFac = 1.0; // Return value Electric Lighting Power Reduction Factor for current Zone and Timestep + Real64 dHISKFFC = HISKF * LUX2FC; + Real64 dHISUNFFC = HISUNF * LUX2FC; + Real64 dSOLCOS1 = SOLCOS(1); + Real64 dSOLCOS2 = SOLCOS(2); + Real64 dSOLCOS3 = SOLCOS(3); + Real64 dLatitude = Latitude; + Real64 dCloudFraction = CloudFraction; + // Init Error Flag to 0 (no Warnings or Errors) (returned from DElight) + int iErrorFlag = 0; + bool elOpened; + + int iReadStatus; // Error File Read Status + std::string cErrorMsg; // Each DElight Error Message can be up to 200 characters long + bool bEndofErrFile; // End of Error File flag + DElightElecLtgCtrl(len(Zone(NZ).Name), Zone(NZ).Name, dLatitude, @@ -684,11 +662,11 @@ namespace HeatBalanceSurfaceManager { // Sequentially read lines in DElight Electric Lighting Dump File // and extract refpt illuminances for standard EPlus output handling bEndofErrFile = false; - iDElightRefPt = 0; + int iDElightRefPt = 0; // Reference Point number for reading DElight Dump File (eplusout.delighteldmp) iReadStatus = 0; while (!bEndofErrFile && elOpened) { auto line = iDElightErrorFile.read(); - dRefPtIllum = line.data; + Real64 dRefPtIllum = line.data; // tmp var for reading RefPt illuminance if (line.eof) { bEndofErrFile = true; continue; @@ -714,7 +692,6 @@ namespace HeatBalanceSurfaceManager { // RJH DElight Modification End - Call to DElight electric lighting control subroutine } - errFlag = false; for (int zoneNum = 1; zoneNum <= NumOfZones; ++zoneNum) { int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; @@ -729,7 +706,7 @@ namespace HeatBalanceSurfaceManager { } } - CalcInteriorRadExchange(TH(2, 1, _), 0, NetLWRadToSurf, _, "Main"); + CalcInteriorRadExchange(TH(2, 1, _), 0, SurfNetLWRadToSurf, _, "Main"); if (AirflowWindows) WindowGapAirflowControl(); @@ -750,7 +727,7 @@ namespace HeatBalanceSurfaceManager { } } } else if (mapResultsToReport && TimeStep == NumOfTimeStepInHour) { - for (MapNum = 1; MapNum <= TotIllumMaps; ++MapNum) { + for (int MapNum = 1; MapNum <= TotIllumMaps; ++MapNum) { ReportIllumMap(state.files, MapNum); } mapResultsToReport = false; @@ -1427,7 +1404,7 @@ namespace HeatBalanceSurfaceManager { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int loop; + // na // FLOW: @@ -1457,26 +1434,24 @@ namespace HeatBalanceSurfaceManager { HAirExtSurf.dimension(TotSurfaces, 0.0); HSkyExtSurf.dimension(TotSurfaces, 0.0); HGrdExtSurf.dimension(TotSurfaces, 0.0); - QRadLWOutSrdSurfs.dimension(TotSurfaces, 0.0); + TempSurfIn.dimension(TotSurfaces, 0.0); TempInsOld.dimension(TotSurfaces, 0.0); TempSurfInTmp.dimension(TotSurfaces, 0.0); TempSurfInTmp.dimension(TotSurfaces, 0.0); RefAirTemp.dimension(TotSurfaces, 0.0); - QRadSWOutAbs.dimension(TotSurfaces, 0.0); - QRadSWInAbs.dimension(TotSurfaces, 0.0); - InitialDifSolInAbs.dimension(TotSurfaces, 0.0); - InitialDifSolInTrans.dimension(TotSurfaces, 0.0); + SurfQRadLWOutSrdSurfs.dimension(TotSurfaces, 0.0); + QRadSWwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL + 1, TotSurfaces, 0.0); InitialDifSolwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL, TotSurfaces, 0.0); - QRadSWOutMvIns.dimension(TotSurfaces, 0.0); + SurfQRadSWOutMvIns.dimension(TotSurfaces, 0.0); QRadThermInAbs.dimension(TotSurfaces, 0.0); - QAdditionalHeatSourceOutside.dimension(TotSurfaces, 0.0); - QAdditionalHeatSourceInside.dimension(TotSurfaces, 0.0); + SurfQAdditionalHeatSourceOutside.dimension(TotSurfaces, 0.0); + SurfQAdditionalHeatSourceInside.dimension(TotSurfaces, 0.0); SUMH.dimension(TotSurfaces, 0); TH.dimension(2, Construction::MaxCTFTerms, TotSurfaces, 0.0); - TempSurfOut.dimension(TotSurfaces, 0.0); + SurfTempSurfOut.dimension(TotSurfaces, 0.0); TempSurfInRep.dimension(TotSurfaces, 0.0); TempSurfInMovInsRep.dimension(TotSurfaces, 0.0); QConvInReport.dimension(TotSurfaces, 0.0); @@ -1514,34 +1489,41 @@ namespace HeatBalanceSurfaceManager { QAirExtReport.dimension(TotSurfaces, 0.0); QHeatEmiReport.dimension(TotSurfaces, 0.0); - OpaqSurfInsFaceConduction.dimension(TotSurfaces, 0.0); - OpaqSurfInsFaceConductionFlux.dimension(TotSurfaces, 0.0); - OpaqSurfInsFaceCondGainRep.dimension(TotSurfaces, 0.0); - OpaqSurfInsFaceCondLossRep.dimension(TotSurfaces, 0.0); - OpaqSurfInsFaceConductionEnergy.dimension(TotSurfaces, 0.0); - - SWOutAbsTotalReport.dimension(TotSurfaces, 0.0); - SWOutAbsEnergyReport.dimension(TotSurfaces, 0.0); - - OpaqSurfOutsideFaceConduction.dimension(TotSurfaces, 0.0); - OpaqSurfOutsideFaceConductionFlux.dimension(TotSurfaces, 0.0); - OpaqSurfExtFaceCondGainRep.dimension(TotSurfaces, 0.0); - OpaqSurfExtFaceCondLossRep.dimension(TotSurfaces, 0.0); - OpaqSurfOutsideFaceConductionEnergy.dimension(TotSurfaces, 0.0); - - OpaqSurfAvgFaceCondGainRep.dimension(TotSurfaces, 0.0); - OpaqSurfAvgFaceCondLossRep.dimension(TotSurfaces, 0.0); - OpaqSurfAvgFaceConduction.dimension(TotSurfaces, 0.0); - OpaqSurfAvgFaceConductionFlux.dimension(TotSurfaces, 0.0); - OpaqSurfAvgFaceConductionEnergy.dimension(TotSurfaces, 0.0); - - OpaqSurfStorageGainRep.dimension(TotSurfaces, 0.0); - OpaqSurfStorageCondLossRep.dimension(TotSurfaces, 0.0); - OpaqSurfStorageConduction.dimension(TotSurfaces, 0.0); - OpaqSurfStorageConductionFlux.dimension(TotSurfaces, 0.0); - OpaqSurfStorageConductionEnergy.dimension(TotSurfaces, 0.0); - - OpaqSurfInsFaceBeamSolAbsorbed.dimension(TotSurfaces, 0.0); + SurfOpaqSWOutAbsTotalReport.dimension(TotSurfaces, 0.0); + SurfOpaqSWOutAbsEnergyReport.dimension(TotSurfaces, 0.0); + + SurfOpaqInsFaceConduction.dimension(TotSurfaces, 0.0); + SurfOpaqInsFaceConductionFlux.dimension(TotSurfaces, 0.0); + SurfOpaqInsFaceCondGainRep.dimension(TotSurfaces, 0.0); + SurfOpaqInsFaceCondLossRep.dimension(TotSurfaces, 0.0); + SurfOpaqInsFaceConductionEnergy.dimension(TotSurfaces, 0.0); + + SurfOpaqOutsideFaceConduction.dimension(TotSurfaces, 0.0); + SurfOpaqOutsideFaceConductionFlux.dimension(TotSurfaces, 0.0); + SurfOpaqExtFaceCondGainRep.dimension(TotSurfaces, 0.0); + SurfOpaqExtFaceCondLossRep.dimension(TotSurfaces, 0.0); + SurfOpaqOutsideFaceConductionEnergy.dimension(TotSurfaces, 0.0); + + SurfOpaqAvgFaceCondGainRep.dimension(TotSurfaces, 0.0); + SurfOpaqAvgFaceCondLossRep.dimension(TotSurfaces, 0.0); + SurfOpaqAvgFaceConduction.dimension(TotSurfaces, 0.0); + SurfOpaqAvgFaceConductionFlux.dimension(TotSurfaces, 0.0); + SurfOpaqAvgFaceConductionEnergy.dimension(TotSurfaces, 0.0); + + SurfOpaqStorageGainRep.dimension(TotSurfaces, 0.0); + SurfOpaqStorageCondLossRep.dimension(TotSurfaces, 0.0); + SurfOpaqStorageConduction.dimension(TotSurfaces, 0.0); + SurfOpaqStorageConductionFlux.dimension(TotSurfaces, 0.0); + SurfOpaqStorageConductionEnergy.dimension(TotSurfaces, 0.0); + + SurfOpaqInsFaceBeamSolAbsorbed.dimension(TotSurfaces, 0.0); + + SurfOpaqQRadSWOutAbs.dimension(TotSurfaces, 0.0); + SurfOpaqQRadSWInAbs.dimension(TotSurfaces, 0.0); + + SurfOpaqInitialDifSolInAbs.dimension(TotSurfaces, 0.0); + SurfWinInitialDifSolInTrans.dimension(TotSurfaces, 0.0); + QH.dimension(2, Construction::MaxCTFTerms, TotSurfaces, 0.0); THM.dimension(2, Construction::MaxCTFTerms, TotSurfaces, 0.0); QHM.dimension(2, Construction::MaxCTFTerms, TotSurfaces, 0.0); @@ -1556,9 +1538,6 @@ namespace HeatBalanceSurfaceManager { QsrcHistM.dimension(TotSurfaces, Construction::MaxCTFTerms, 0.0); } - NetLWRadToSurf.dimension(TotSurfaces, 0.0); - QRadSWLightsInAbs.dimension(TotSurfaces, 0.0); - RadSysTiHBConstCoef.dimension(TotSurfaces, 0.0); RadSysTiHBToutCoef.dimension(TotSurfaces, 0.0); RadSysTiHBQsrcCoef.dimension(TotSurfaces, 0.0); @@ -1594,13 +1573,15 @@ namespace HeatBalanceSurfaceManager { HGrndFD.dimension(TotSurfaces, 0.0); HAirFD.dimension(TotSurfaces, 0.0); + SurfNetLWRadToSurf.dimension(TotSurfaces, 0.0); + SurfOpaqQRadSWLightsInAbs.dimension(TotSurfaces, 0.0); SurfSkySolarInc.dimension(TotSurfaces, 0); SurfGndSolarInc.dimension(TotSurfaces, 0); DisplayString("Setting up Surface Reporting Variables"); // Setup surface report variables CurrentModuleObject='Opaque Surfaces' - for (loop = 1; loop <= TotSurfaces; ++loop) { + for (int loop = 1; loop <= TotSurfaces; ++loop) { if (!Surface(loop).HeatTransSurf) continue; SetupOutputVariable( "Surface Inside Face Temperature", OutputProcessor::Unit::C, TempSurfInRep(loop), "Zone", "State", Surface(loop).Name); @@ -1613,7 +1594,7 @@ namespace HeatBalanceSurfaceManager { if (Surface(loop).ExtBoundCond != KivaFoundation) { SetupOutputVariable( - "Surface Outside Face Temperature", OutputProcessor::Unit::C, TempSurfOut(loop), "Zone", "State", Surface(loop).Name); + "Surface Outside Face Temperature", OutputProcessor::Unit::C, SurfTempSurfOut(loop), "Zone", "State", Surface(loop).Name); } SetupOutputVariable( @@ -1832,19 +1813,19 @@ namespace HeatBalanceSurfaceManager { if (Surface(loop).Class != SurfaceClass_Window) { SetupOutputVariable("Surface Outside Face Solar Radiation Heat Gain Rate", OutputProcessor::Unit::W, - SWOutAbsTotalReport(loop), + SurfOpaqSWOutAbsTotalReport(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Solar Radiation Heat Gain Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutAbs(loop), + SurfOpaqQRadSWOutAbs(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Solar Radiation Heat Gain Energy", OutputProcessor::Unit::J, - SWOutAbsEnergyReport(loop), + SurfOpaqSWOutAbsEnergyReport(loop), "Zone", "Sum", Surface(loop).Name); @@ -1855,31 +1836,31 @@ namespace HeatBalanceSurfaceManager { // IF (DisplayAdvancedReportVariables) THEN !CurrentModuleObject='Opaque Surfaces(Advanced)' SetupOutputVariable("Surface Inside Face Conduction Heat Transfer Rate", OutputProcessor::Unit::W, - OpaqSurfInsFaceConduction(loop), + SurfOpaqInsFaceConduction(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Inside Face Conduction Heat Gain Rate", OutputProcessor::Unit::W, - OpaqSurfInsFaceCondGainRep(loop), + SurfOpaqInsFaceCondGainRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Inside Face Conduction Heat Loss Rate", OutputProcessor::Unit::W, - OpaqSurfInsFaceCondLossRep(loop), + SurfOpaqInsFaceCondLossRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Inside Face Conduction Heat Transfer Rate per Area", OutputProcessor::Unit::W_m2, - OpaqSurfInsFaceConductionFlux(loop), + SurfOpaqInsFaceConductionFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Inside Face Conduction Heat Transfer Energy", OutputProcessor::Unit::J, - OpaqSurfInsFaceConductionEnergy(loop), + SurfOpaqInsFaceConductionEnergy(loop), "Zone", "Sum", Surface(loop).Name); @@ -1887,89 +1868,89 @@ namespace HeatBalanceSurfaceManager { if (Surface(loop).ExtBoundCond != KivaFoundation) { SetupOutputVariable("Surface Outside Face Conduction Heat Transfer Rate", OutputProcessor::Unit::W, - OpaqSurfOutsideFaceConduction(loop), + SurfOpaqOutsideFaceConduction(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Conduction Heat Gain Rate", OutputProcessor::Unit::W, - OpaqSurfExtFaceCondGainRep(loop), + SurfOpaqExtFaceCondGainRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Conduction Heat Loss Rate", OutputProcessor::Unit::W, - OpaqSurfExtFaceCondLossRep(loop), + SurfOpaqExtFaceCondLossRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Conduction Heat Transfer Rate per Area", OutputProcessor::Unit::W_m2, - OpaqSurfOutsideFaceConductionFlux(loop), + SurfOpaqOutsideFaceConductionFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Conduction Heat Transfer Energy", OutputProcessor::Unit::J, - OpaqSurfOutsideFaceConductionEnergy(loop), + SurfOpaqOutsideFaceConductionEnergy(loop), "Zone", "Sum", Surface(loop).Name); SetupOutputVariable("Surface Average Face Conduction Heat Transfer Rate", OutputProcessor::Unit::W, - OpaqSurfAvgFaceConduction(loop), + SurfOpaqAvgFaceConduction(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Average Face Conduction Heat Gain Rate", OutputProcessor::Unit::W, - OpaqSurfAvgFaceCondGainRep(loop), + SurfOpaqAvgFaceCondGainRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Average Face Conduction Heat Loss Rate", OutputProcessor::Unit::W, - OpaqSurfAvgFaceCondLossRep(loop), + SurfOpaqAvgFaceCondLossRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Average Face Conduction Heat Transfer Rate per Area", OutputProcessor::Unit::W_m2, - OpaqSurfAvgFaceConductionFlux(loop), + SurfOpaqAvgFaceConductionFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Average Face Conduction Heat Transfer Energy", OutputProcessor::Unit::J, - OpaqSurfAvgFaceConductionEnergy(loop), + SurfOpaqAvgFaceConductionEnergy(loop), "Zone", "Sum", Surface(loop).Name); SetupOutputVariable( - "Surface Heat Storage Rate", OutputProcessor::Unit::W, OpaqSurfStorageConduction(loop), "Zone", "State", Surface(loop).Name); + "Surface Heat Storage Rate", OutputProcessor::Unit::W, SurfOpaqStorageConduction(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Heat Storage Gain Rate", OutputProcessor::Unit::W, - OpaqSurfStorageGainRep(loop), + SurfOpaqStorageGainRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Heat Storage Loss Rate", OutputProcessor::Unit::W, - OpaqSurfStorageCondLossRep(loop), + SurfOpaqStorageCondLossRep(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Heat Storage Rate per Area", OutputProcessor::Unit::W_m2, - OpaqSurfStorageConductionFlux(loop), + SurfOpaqStorageConductionFlux(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable("Surface Heat Storage Energy", OutputProcessor::Unit::J, - OpaqSurfStorageConductionEnergy(loop), + SurfOpaqStorageConductionEnergy(loop), "Zone", "Sum", Surface(loop).Name); @@ -1980,7 +1961,7 @@ namespace HeatBalanceSurfaceManager { SetupOutputVariable("Surface Inside Face Beam Solar Radiation Heat Gain Rate", OutputProcessor::Unit::W, - OpaqSurfInsFaceBeamSolAbsorbed(loop), + SurfOpaqInsFaceBeamSolAbsorbed(loop), "Zone", "State", Surface(loop).Name); @@ -2057,13 +2038,13 @@ namespace HeatBalanceSurfaceManager { SetupOutputVariable("Surface Inside Face Heat Source Gain Rate per Area", OutputProcessor::Unit::W_m2, - QAdditionalHeatSourceInside(loop), + SurfQAdditionalHeatSourceInside(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable("Surface Outside Face Heat Source Gain Rate per Area", OutputProcessor::Unit::W_m2, - QAdditionalHeatSourceOutside(loop), + SurfQAdditionalHeatSourceOutside(loop), "Zone", "Average", Surface(loop).Name); @@ -2077,10 +2058,10 @@ namespace HeatBalanceSurfaceManager { // unused ALLOCATE(QBV(NumOfZones)) // unused QBV=0.0 - QC.dimension(NumOfZones, 0.0); - QD.dimension(NumOfZones, 0.0); - QDforDaylight.dimension(NumOfZones, 0.0); - QDV.dimension(NumOfZones, 0.0); + ZoneQC.dimension(NumOfZones, 0.0); + ZoneQD.dimension(NumOfZones, 0.0); + ZoneQDforDaylight.dimension(NumOfZones, 0.0); + ZoneQDV.dimension(NumOfZones, 0.0); QL.dimension(NumOfZones, 0.0); // UCSD @@ -2089,7 +2070,7 @@ namespace HeatBalanceSurfaceManager { // Allocate Reporting Variables and set up tracking ZoneMRT.dimension(NumOfZones, 0.0); - for (loop = 1; loop <= NumOfZones; ++loop) { + for (int loop = 1; loop <= NumOfZones; ++loop) { // CurrentModuleObject='Zone' SetupOutputVariable("Zone Mean Radiant Temperature", OutputProcessor::Unit::C, ZoneMRT(loop), "Zone", "State", Zone(loop).Name); } @@ -2180,7 +2161,7 @@ namespace HeatBalanceSurfaceManager { HAirExtSurf(SurfNum) = 0.0; HSkyExtSurf(SurfNum) = 0.0; HGrdExtSurf(SurfNum) = 0.0; - TempSurfOut(SurfNum) = 0.0; + SurfTempSurfOut(SurfNum) = 0.0; TempSurfInRep(SurfNum) = 0.0; TempSurfInMovInsRep(SurfNum) = 0.0; QConvInReport(SurfNum) = 0.0; @@ -2209,11 +2190,16 @@ namespace HeatBalanceSurfaceManager { QdotRadOutRepPerArea(SurfNum) = 0.0; QAirExtReport(SurfNum) = 0.0; QHeatEmiReport(SurfNum) = 0.0; - OpaqSurfInsFaceConduction(SurfNum) = 0.0; - OpaqSurfInsFaceConductionFlux(SurfNum) = 0.0; - OpaqSurfInsFaceConductionEnergy(SurfNum) = 0.0; - OpaqSurfInsFaceBeamSolAbsorbed(SurfNum) = 0.0; - + } // end of Surf array + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; + if (firstSurfOpaq >= 0) { + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + SurfOpaqInsFaceConduction(SurfNum) = 0.0; + SurfOpaqInsFaceConductionFlux(SurfNum) = 0.0; + SurfOpaqInsFaceConductionEnergy(SurfNum) = 0.0; + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = 0.0; + } // end of Zone Surf } int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; @@ -2230,9 +2216,9 @@ namespace HeatBalanceSurfaceManager { // Initialize previous-timestep shading indicators SurfWinExtIntShadePrevTS(SurfNum) = 0; SurfWinShadingFlag(SurfNum) = NoShade; - } // end of Zone Surf array + } // end of Zone Surf } - } // end of Zone array + } // end of Zone // "Bulk" initializations of temperature arrays with dimensions (TotSurface,MaxCTFTerms,2) TH = 23.0; // module level array @@ -2437,19 +2423,16 @@ namespace HeatBalanceSurfaceManager { // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - QRadSWOutAbs(SurfNum) = 0.0; - QRadSWInAbs(SurfNum) = 0.0; - QRadSWLightsInAbs(SurfNum) = 0.0; - InitialDifSolInAbs(SurfNum) = 0.0; - InitialDifSolInTrans(SurfNum) = 0.0; - - QRadSWwinAbsTot(SurfNum) = 0.0; - SWwinAbsTotalReport(SurfNum) = 0.0; - InitialDifSolInAbsReport(SurfNum) = 0.0; - InitialDifSolInTransReport(SurfNum) = 0.0; - SWInAbsTotalReport(SurfNum) = 0.0; - SWOutAbsTotalReport(SurfNum) = 0.0; - SWOutAbsEnergyReport(SurfNum) = 0.0; + + + + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; + SurfInitialDifSolInAbsReport(SurfNum) = 0.0; + SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; + SurfSWInAbsTotalReport(SurfNum) = 0.0; + SurfOpaqSWOutAbsTotalReport(SurfNum) = 0.0; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = 0.0; BmIncInsSurfIntensRep(SurfNum) = 0.0; BmIncInsSurfAmountRep(SurfNum) = 0.0; @@ -2472,13 +2455,9 @@ namespace HeatBalanceSurfaceManager { BmIncInsSurfAmountRep(SurfNum) = 0.0; IntBmIncInsSurfIntensRep(SurfNum) = 0.0; IntBmIncInsSurfAmountRep(SurfNum) = 0.0; - QRadSWwinAbsTotEnergy(SurfNum) = 0.0; - BmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; - IntBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; - - OpaqSurfInsFaceBeamSolAbsorbed(SurfNum) = 0.0; - OpaqSurfInsFaceCondGainRep(SurfNum) = 0.0; - OpaqSurfInsFaceCondLossRep(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = 0.0; + SurfBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; + SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; SurfSkySolarInc(SurfNum) = 0.0; SurfGndSolarInc(SurfNum) = 0.0; @@ -2487,7 +2466,7 @@ namespace HeatBalanceSurfaceManager { for (int Lay = 1; Lay <= DataHeatBalance::MaxSolidWinLayers; Lay++) { for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - QRadSWwinAbsLayer(Lay, SurfNum) = 0.0; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = 0.0; } } for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { @@ -2521,6 +2500,20 @@ namespace HeatBalanceSurfaceManager { ZoneOpaqSurfExtFaceCondGainRep(zoneNum) = 0.0; ZoneOpaqSurfExtFaceCondLossRep(zoneNum) = 0.0; + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; + if (firstSurfOpaq >= 0) { + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = 0.0; + SurfOpaqInsFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqInsFaceCondLossRep(SurfNum) = 0.0; + SurfOpaqQRadSWOutAbs(SurfNum) = 0.0; + SurfOpaqQRadSWInAbs(SurfNum) = 0.0; + SurfOpaqQRadSWLightsInAbs(SurfNum) = 0.0; + SurfOpaqInitialDifSolInAbs(SurfNum) = 0.0; + } // end of Zone Surf + } + int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; if (firstSurfWin == -1) continue; @@ -2601,18 +2594,20 @@ namespace HeatBalanceSurfaceManager { SurfWinBSDFBeamThetaRep(SurfNum) = 0.0; SurfWinBSDFBeamPhiRep(SurfNum) = 0.0; + SurfWinInitialDifSolInTrans(SurfNum) = 0.0; } } if (!SunIsUp || (BeamSolarRad + GndSolarRad + DifSolarRad <= 0.0)) { // Sun is down - QD = 0.0; - QDforDaylight = 0.0; - QC = 0.0; - QDV = 0.0; + // unused QBV = 0.0 for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + ZoneQD(zoneNum) = 0.0; + ZoneQDforDaylight(zoneNum) = 0.0; + ZoneQC(zoneNum) = 0.0; + ZoneQDV(zoneNum) = 0.0; ZoneTransSolar(zoneNum) = 0.0; ZoneBmSolFrExtWinsRep(zoneNum) = 0.0; ZoneBmSolFrIntWinsRep(zoneNum) = 0.0; @@ -2724,7 +2719,7 @@ namespace HeatBalanceSurfaceManager { // 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) = + ZoneQDforDaylight(ZoneNum) = (DBZone(ZoneNum) - DBZoneIntWin(ZoneNum)) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); // RJH 08/30/07 - Substitute InitialZoneDifSolReflW(ZoneNum) for DSZone and DGZone here @@ -2735,14 +2730,14 @@ namespace HeatBalanceSurfaceManager { // QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad & // +DSZone(ZoneNum)*DifSolarRad & // +DGZone(ZoneNum)*GndSolarRad - QD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); + ZoneQD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); } // Flux of diffuse solar in each zone QSDifSol = 0.0; for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { - QSDifSol(enclNum) = QDforDaylight(enclNum); + QSDifSol(enclNum) = ZoneQDforDaylight(enclNum); } if (InterZoneWindow) { @@ -2752,7 +2747,7 @@ namespace HeatBalanceSurfaceManager { auto lZone(FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { if ((otherEnclNum != enclNum) && (RecDifShortFromZ(otherEnclNum))) { - QSDifSol_sum += FractDifShortZtoZ[lZone] * QDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) + QSDifSol_sum += FractDifShortZtoZ[lZone] * ZoneQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } QSDifSol(enclNum) += QSDifSol_sum; @@ -2762,9 +2757,9 @@ namespace HeatBalanceSurfaceManager { for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { if (InterZoneWindow) - QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * VMULT(enclNum); + QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * ZoneVMULT(enclNum); else - QSDifSol(enclNum) *= VMULT(enclNum); + QSDifSol(enclNum) *= ZoneVMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -2973,7 +2968,7 @@ namespace HeatBalanceSurfaceManager { } // End of check if window has shading device on - QRadSWwinAbsTot(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; for (Lay = 1; Lay <= TotGlassLay; ++Lay) { QRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; // AWinSurf is from InteriorSolarDistribution @@ -2994,12 +2989,12 @@ namespace HeatBalanceSurfaceManager { } // Total solar absorbed in solid layer (W), for reporting - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting - QRadSWwinAbsTot(SurfNum) += QRadSWwinAbsLayer(Lay, SurfNum); + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; // Need to do it this way for now beaucse of scheduled surface gains. They do work only with // BSDF windows and overwriting absorbtances will work only for ordinary windows // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && @@ -3033,17 +3028,17 @@ namespace HeatBalanceSurfaceManager { AWinSurf(Lay, SurfNum) * BeamSolar + AWinCFOverlap(Lay, SurfNum) * BeamSolar; } // Total solar absorbed in solid layer (W), for reporting - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting - QRadSWwinAbsTot(SurfNum) += QRadSWwinAbsLayer(Lay, SurfNum); + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; ShadeFlag = SurfWinShadingFlag(SurfNum); } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { - QRadSWwinAbsTot(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr TotSolidLay = CFS(dataConstruction.Construct(Surface(SurfNum).Construction).EQLConsPtr).NL; for (Lay = 1; Lay <= TotSolidLay; ++Lay) { @@ -3057,12 +3052,12 @@ namespace HeatBalanceSurfaceManager { AWinSurf(Lay, SurfNum) * BeamSolar + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); // Total solar absorbed in solid layer (W), for reporting - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting - QRadSWwinAbsTot(SurfNum) += QRadSWwinAbsLayer(Lay, SurfNum); + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - QRadSWwinAbsTotEnergy(SurfNum) = QRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { std::pair incomingAngle = getSunWCEAngles(dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); @@ -3080,10 +3075,10 @@ namespace HeatBalanceSurfaceManager { QRadSWwinAbs(Lay, SurfNum) = AbWinDiff * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; // Total solar absorbed in solid layer (W), for reporting - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting - QRadSWwinAbsTot(SurfNum) += QRadSWwinAbsLayer(Lay, SurfNum); + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } } @@ -3307,9 +3302,9 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque heat transfer surface - QRadSWOutAbs(SurfNum) = AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); - SWOutAbsTotalReport(SurfNum) = QRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SWOutAbsEnergyReport(SurfNum) = SWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + SurfOpaqQRadSWOutAbs(SurfNum) = AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + SurfOpaqSWOutAbsTotalReport(SurfNum) = SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; } } // Surface(SurfNum)%HeatTransSurf @@ -3319,16 +3314,16 @@ namespace HeatBalanceSurfaceManager { SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); if (SurfSolIncPtr == 0) { if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - QRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; if (InShelfSurf > 0) { // 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); + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum) * BeamSolarRad * (0.5 * Surface(SurfNum).Area); } else { // Regular surface - OpaqSurfInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; } } } else { - QRadSWInAbs(SurfNum) += AISurf(SurfNum); + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum); } } } // End of surface loop @@ -3421,7 +3416,7 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) = QD(enclosureNum) + sumZoneQLTSW; + QS(enclosureNum) = ZoneQD(enclosureNum) + sumZoneQLTSW; QSLights(enclosureNum) = sumZoneQLTSW; } @@ -3438,8 +3433,8 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(OtherenclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (QD(OtherenclosureNum) + sumZoneQLTSW); - ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * QD(OtherenclosureNum); + QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (ZoneQD(OtherenclosureNum) + sumZoneQLTSW); + ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * ZoneQD(OtherenclosureNum); ZoneDifSolFrIntWinsRepEnergy(enclosureNum) = ZoneDifSolFrIntWinsRep(enclosureNum) * TimeStepZoneSec; } } @@ -3458,7 +3453,7 @@ namespace HeatBalanceSurfaceManager { IntBmIncInsSurfIntensRep(SurfNum) = ZoneBmSolFrIntWinsRep(enclosureNum) / DataViewFactorInformation::ZoneSolarInfo(enclosureNum).TotalSurfArea; IntBmIncInsSurfAmountRep(SurfNum) = IntBmIncInsSurfIntensRep(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); - IntBmIncInsSurfAmountRepEnergy(SurfNum) = IntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = IntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; // IntDifIncInsSurfIntensRep(SurfNum) = ZoneDifSolFrIntWinsRep(ZoneNum)/Zone(ZoneNum)%TotalSurfArea // IntDifIncInsSurfAmountRep(SurfNum) = IntDifIncInsSurfIntensRep(SurfNum) * & // (Surface(SurfNum)%Area + SurfaceWindow(SurfNum)%DividerArea) @@ -3469,12 +3464,12 @@ namespace HeatBalanceSurfaceManager { // COMPUTE CONVECTIVE GAINS AND ZONE FLUX DENSITY. for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclosureNum) { if (InterZoneWindow) { - QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * VMULT(enclosureNum); + QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * ZoneVMULT(enclosureNum); // CR 8695, VMULT not based on visible - QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * VMULT(enclosureNum); + QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * ZoneVMULT(enclosureNum); } else { - QS(enclosureNum) *= VMULT(enclosureNum); - QSLights(enclosureNum) *= VMULT(enclosureNum); + QS(enclosureNum) *= ZoneVMULT(enclosureNum); + QSLights(enclosureNum) *= ZoneVMULT(enclosureNum); } } @@ -3497,8 +3492,8 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).MaterialMovInsulInt > 0) EvalInsideMovableInsulation(SurfNum, HMovInsul, AbsInt); if (HMovInsul > 0.0) AbsIntSurf = AbsInt; - QRadSWInAbs(SurfNum) += QS(solEnclosureNum) * AbsIntSurf; - QRadSWLightsInAbs(SurfNum) += QSLights(solEnclosureNum) * AbsIntSurfVis; + SurfOpaqQRadSWInAbs(SurfNum) += QS(solEnclosureNum) * AbsIntSurf; + SurfOpaqQRadSWLightsInAbs(SurfNum) += QSLights(solEnclosureNum) * AbsIntSurfVis; } if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque exterior surface @@ -3506,36 +3501,36 @@ namespace HeatBalanceSurfaceManager { HMovInsul = 0.0; if (Surface(SurfNum).MaterialMovInsulExt > 0) EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); if (HMovInsul > 0) { // Movable outside insulation in place - QRadSWOutMvIns(SurfNum) = QRadSWOutAbs(SurfNum) * AbsExt / dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + SurfQRadSWOutMvIns(SurfNum) = SurfOpaqQRadSWOutAbs(SurfNum) * AbsExt / dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; // For transparent insulation, allow some sunlight to get through the movable insulation. // The equation below is derived by taking what is transmitted through the layer and applying // the fraction that is absorbed plus the back reflected portion (first order reflection only) // to the plane between the transparent insulation and the exterior surface face. - QRadSWOutAbs(SurfNum) = dataMaterial.Material(Surface(SurfNum).MaterialMovInsulExt).Trans * QRadSWOutMvIns(SurfNum) * + SurfOpaqQRadSWOutAbs(SurfNum) = dataMaterial.Material(Surface(SurfNum).MaterialMovInsulExt).Trans * SurfQRadSWOutMvIns(SurfNum) * ((dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar / AbsExt) + (1 - dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar)); - SWOutAbsTotalReport(SurfNum) = QRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SWOutAbsEnergyReport(SurfNum) = SWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + SurfOpaqSWOutAbsTotalReport(SurfNum) = SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; } } // RJH 08/30/07 - Add InitialDifSolInAbs, InitialDifSolwinAbs, and InitialDifSolAbsByShade // calced in CalcWinTransDifSolInitialDistribution to QRadSWInAbs, QRadSWwinAbs, and IntSWAbsByShade here if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - QRadSWInAbs(SurfNum) += InitialDifSolInAbs(SurfNum); + SurfOpaqQRadSWInAbs(SurfNum) += SurfOpaqInitialDifSolInAbs(SurfNum); } // Report - SWwinAbsTotalReport(SurfNum) = 0.0; - SWInAbsTotalReport(SurfNum) = 0.0; - InitialDifSolInAbsReport(SurfNum) = 0.0; - InitialDifSolInTransReport(SurfNum) = 0.0; +// SWwinAbsTotalReport(SurfNum) = 0.0; + SurfSWInAbsTotalReport(SurfNum) = 0.0; + SurfInitialDifSolInAbsReport(SurfNum) = 0.0; +// SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; //TOCHECK if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - InitialDifSolInAbsReport(SurfNum) = InitialDifSolInAbs(SurfNum) * Surface(SurfNum).Area; + SurfInitialDifSolInAbsReport(SurfNum) = SurfOpaqInitialDifSolInAbs(SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SWInAbsTotalReport(SurfNum) = QRadSWInAbs(SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) = SurfOpaqQRadSWInAbs(SurfNum) * Surface(SurfNum).Area; } - } // end of opague + } // end of opaque int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; @@ -3778,11 +3773,11 @@ namespace HeatBalanceSurfaceManager { } // report variables for surface absorbed short wave radiation - SWwinAbsTotalReport(SurfNum) = 0.0; - SWInAbsTotalReport(SurfNum) = 0.0; - InitialDifSolInAbsReport(SurfNum) = 0.0; - InitialDifSolInTransReport(SurfNum) = 0.0; - InitialDifSolInTransReport(SurfNum) += InitialDifSolInTrans(SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; + SurfSWInAbsTotalReport(SurfNum) = 0.0; + SurfInitialDifSolInAbsReport(SurfNum) = 0.0; + SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; + SurfWinInitialDifSolInTransReport(SurfNum) += SurfWinInitialDifSolInTrans(SurfNum) * Surface(SurfNum).Area; if (SurfWinWindowModelType(SurfNum) != WindowEQLModel) { ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (SurfWinStormWinFlag(SurfNum) == 1) { @@ -3798,33 +3793,33 @@ namespace HeatBalanceSurfaceManager { if (ShadeFlag <= 0 || SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // No window shading for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - InitialDifSolInAbsReport(SurfNum) += + SurfInitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } else if (ShadeFlag == IntShadeOn || ShadeFlag >= 3) { // Interior, exterior or between-glass shade, screen or blind in place for (IGlass = 1; IGlass <= dataConstruction.Construct(ConstrNumSh).TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - InitialDifSolInAbsReport(SurfNum) += + SurfInitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - InitialDifSolInAbsReport(SurfNum) += + SurfInitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } // End of shading flag check } else { // IF (SurfaceWindow(SurfNum)%WindowModelType == WindowEQLModel) THEN @@ -3833,11 +3828,11 @@ namespace HeatBalanceSurfaceManager { for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - InitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfInitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SWInAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All solid Layers[W] - SWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; } } } // End of window @@ -4037,9 +4032,9 @@ namespace HeatBalanceSurfaceManager { // FLOW: - if (!allocated(VMULT)) { - VMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); - VCONV.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); + if (!allocated(ZoneVMULT)) { + ZoneVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); + ZoneVCONV.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); } if (ComputeIntSWAbsorpFactorsfirstTime) { FirstCalcZone.dimension(NumOfZones, true); @@ -4163,7 +4158,7 @@ namespace HeatBalanceSurfaceManager { } // End of loop over surfaces in zone if (SUM1 > SmallestAreaAbsProductAllowed) { // Everything is okay, proceed with the regular calculation - VMULT(enclosureNum) = 1.0 / SUM1; + ZoneVMULT(enclosureNum) = 1.0 / SUM1; } else { // the sum of area*solar absorptance for all surfaces in the zone is zero--either the user screwed up // or they really want to disallow any solar from being absorbed on the inside surfaces. Fire off a @@ -4176,7 +4171,7 @@ namespace HeatBalanceSurfaceManager { DataViewFactorInformation::ZoneSolarInfo(enclosureNum).Name); FirstCalcZone(enclosureNum) = false; } - VMULT(enclosureNum) = 0.0; + ZoneVMULT(enclosureNum) = 0.0; } } // End of zone/enclosure loop } @@ -4220,8 +4215,8 @@ namespace HeatBalanceSurfaceManager { if (!Zone(surfZoneNum).HasInterZoneWindow) continue; int NZ = Surface(SurfNum).SolarEnclIndex; int MZ = Surface(Surface(SurfNum).ExtBoundCond).SolarEnclIndex; - FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * VMULT(NZ) * Surface(SurfNum).Area; - if (VMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; + FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * ZoneVMULT(NZ) * Surface(SurfNum).Area; + if (ZoneVMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; } // Compute fractions for multiple passes. @@ -4774,21 +4769,21 @@ namespace HeatBalanceSurfaceManager { surface.Class == SurfaceClass_Roof || surface.Class == SurfaceClass_Door) { if (construct.SourceSinkPresent) { Real64 const QH_12s = QH[l21] = QH_12 + QsrcHist(SurfNum, 1) * construct.CTFSourceIn(0); - OpaqSurfInsFaceConduction(SurfNum) = surface.Area * QH_12s; - OpaqSurfInsFaceConductionFlux(SurfNum) = QH_12s; + SurfOpaqInsFaceConduction(SurfNum) = surface.Area * QH_12s; + SurfOpaqInsFaceConductionFlux(SurfNum) = QH_12s; } else { - OpaqSurfInsFaceConduction(SurfNum) = surface.Area * QH_12; - OpaqSurfInsFaceConductionFlux(SurfNum) = QH_12; // CR 8901 + SurfOpaqInsFaceConduction(SurfNum) = surface.Area * QH_12; + SurfOpaqInsFaceConductionFlux(SurfNum) = QH_12; // CR 8901 } // IF (Surface(SurfNum)%Class/=SurfaceClass_IntMass) & // ZoneOpaqSurfInsFaceCond(Surface(SurfNum)%Zone) = ZoneOpaqSurfInsFaceCond(Surface(SurfNum)%Zone) + & // OpaqSurfInsFaceConduction(SurfNum) - OpaqSurfInsFaceCondGainRep(SurfNum) = 0.0; - OpaqSurfInsFaceCondLossRep(SurfNum) = 0.0; - if (OpaqSurfInsFaceConduction(SurfNum) >= 0.0) { - OpaqSurfInsFaceCondGainRep(SurfNum) = OpaqSurfInsFaceConduction(SurfNum); + SurfOpaqInsFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqInsFaceCondLossRep(SurfNum) = 0.0; + if (SurfOpaqInsFaceConduction(SurfNum) >= 0.0) { + SurfOpaqInsFaceCondGainRep(SurfNum) = SurfOpaqInsFaceConduction(SurfNum); } else { - OpaqSurfInsFaceCondLossRep(SurfNum) = -OpaqSurfInsFaceConduction(SurfNum); + SurfOpaqInsFaceCondLossRep(SurfNum) = - SurfOpaqInsFaceConduction(SurfNum); } } @@ -4811,8 +4806,8 @@ namespace HeatBalanceSurfaceManager { } if (surface.Class == SurfaceClass_Floor || surface.Class == SurfaceClass_Wall || surface.Class == SurfaceClass_IntMass || surface.Class == SurfaceClass_Roof || surface.Class == SurfaceClass_Door) { - OpaqSurfOutsideFaceConductionFlux(SurfNum) = -QH[l11]; // switch sign for balance at outside face - OpaqSurfOutsideFaceConduction(SurfNum) = surface.Area * OpaqSurfOutsideFaceConductionFlux(SurfNum); + SurfOpaqOutsideFaceConductionFlux(SurfNum) = -QH[l11]; // switch sign for balance at outside face + SurfOpaqOutsideFaceConduction(SurfNum) = surface.Area * SurfOpaqOutsideFaceConductionFlux(SurfNum); } } // ...end of loop over all (heat transfer) surfaces... @@ -5437,15 +5432,15 @@ namespace HeatBalanceSurfaceManager { // Tuned Replaced by one line form below for speed // QdotRadNetSurfInRep( SurfNum ) = NetLWRadToSurf( SurfNum ) * surfaceArea; // QdotRadNetSurfInRepPerArea( SurfNum ) = NetLWRadToSurf( SurfNum ); - QdotRadNetSurfInRep(SurfNum) = (QdotRadNetSurfInRepPerArea(SurfNum) = NetLWRadToSurf(SurfNum)) * surfaceArea; + QdotRadNetSurfInRep(SurfNum) = (QdotRadNetSurfInRepPerArea(SurfNum) = SurfNetLWRadToSurf(SurfNum)) * surfaceArea; QRadNetSurfInReport(SurfNum) = QdotRadNetSurfInRep(SurfNum) * TimeStepZoneSec; if (Surface(SurfNum).Class != SurfaceClass_Window) { // not a window... - QdotRadSolarInRepPerArea(SurfNum) = QRadSWInAbs(SurfNum) - QRadSWLightsInAbs(SurfNum); + QdotRadSolarInRepPerArea(SurfNum) = SurfOpaqQRadSWInAbs(SurfNum) - SurfOpaqQRadSWLightsInAbs(SurfNum); QdotRadSolarInRep(SurfNum) = QdotRadSolarInRepPerArea(SurfNum) * surfaceArea; QRadSolarInReport(SurfNum) = QdotRadSolarInRep(SurfNum) * TimeStepZoneSec; - QdotRadLightsInRepPerArea(SurfNum) = QRadSWLightsInAbs(SurfNum); + QdotRadLightsInRepPerArea(SurfNum) = SurfOpaqQRadSWLightsInAbs(SurfNum); QdotRadLightsInRep(SurfNum) = QdotRadLightsInRepPerArea(SurfNum) * surfaceArea; QRadLightsInReport(SurfNum) = QdotRadLightsInRep(SurfNum) * TimeStepZoneSec; @@ -5483,50 +5478,50 @@ namespace HeatBalanceSurfaceManager { Surface(SurfNum).Class == SurfaceClass_Door) { // inside face conduction updates - OpaqSurfInsFaceConductionEnergy(SurfNum) = OpaqSurfInsFaceConduction(SurfNum) * TimeStepZoneSec; - ZoneOpaqSurfInsFaceCond(Surface(SurfNum).Zone) += OpaqSurfInsFaceConduction(SurfNum); - OpaqSurfInsFaceCondGainRep(SurfNum) = 0.0; - OpaqSurfInsFaceCondLossRep(SurfNum) = 0.0; - if (OpaqSurfInsFaceConduction(SurfNum) >= 0.0) { - OpaqSurfInsFaceCondGainRep(SurfNum) = OpaqSurfInsFaceConduction(SurfNum); + SurfOpaqInsFaceConductionEnergy(SurfNum) = SurfOpaqInsFaceConduction(SurfNum) * TimeStepZoneSec; + ZoneOpaqSurfInsFaceCond(Surface(SurfNum).Zone) += SurfOpaqInsFaceConduction(SurfNum); + SurfOpaqInsFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqInsFaceCondLossRep(SurfNum) = 0.0; + if (SurfOpaqInsFaceConduction(SurfNum) >= 0.0) { + SurfOpaqInsFaceCondGainRep(SurfNum) = SurfOpaqInsFaceConduction(SurfNum); } else { - OpaqSurfInsFaceCondLossRep(SurfNum) = -OpaqSurfInsFaceConduction(SurfNum); + SurfOpaqInsFaceCondLossRep(SurfNum) = - SurfOpaqInsFaceConduction(SurfNum); } // outside face conduction updates - OpaqSurfOutsideFaceConductionEnergy(SurfNum) = OpaqSurfOutsideFaceConduction(SurfNum) * TimeStepZoneSec; - ZoneOpaqSurfExtFaceCond(Surface(SurfNum).Zone) += OpaqSurfOutsideFaceConduction(SurfNum); - OpaqSurfExtFaceCondGainRep(SurfNum) = 0.0; - OpaqSurfExtFaceCondLossRep(SurfNum) = 0.0; - if (OpaqSurfOutsideFaceConduction(SurfNum) >= 0.0) { - OpaqSurfExtFaceCondGainRep(SurfNum) = OpaqSurfOutsideFaceConduction(SurfNum); + SurfOpaqOutsideFaceConductionEnergy(SurfNum) = SurfOpaqOutsideFaceConduction(SurfNum) * TimeStepZoneSec; + ZoneOpaqSurfExtFaceCond(Surface(SurfNum).Zone) += SurfOpaqOutsideFaceConduction(SurfNum); + SurfOpaqExtFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqExtFaceCondLossRep(SurfNum) = 0.0; + if (SurfOpaqOutsideFaceConduction(SurfNum) >= 0.0) { + SurfOpaqExtFaceCondGainRep(SurfNum) = SurfOpaqOutsideFaceConduction(SurfNum); } else { - OpaqSurfExtFaceCondLossRep(SurfNum) = -OpaqSurfOutsideFaceConduction(SurfNum); + SurfOpaqExtFaceCondLossRep(SurfNum) = -SurfOpaqOutsideFaceConduction(SurfNum); } // do average surface conduction updates - OpaqSurfAvgFaceConduction(SurfNum) = (OpaqSurfInsFaceConduction(SurfNum) - OpaqSurfOutsideFaceConduction(SurfNum)) / 2.0; - OpaqSurfAvgFaceConductionFlux(SurfNum) = (OpaqSurfInsFaceConductionFlux(SurfNum) - OpaqSurfOutsideFaceConductionFlux(SurfNum)) / 2.0; - OpaqSurfAvgFaceConductionEnergy(SurfNum) = OpaqSurfAvgFaceConduction(SurfNum) * TimeStepZoneSec; - OpaqSurfAvgFaceCondGainRep(SurfNum) = 0.0; - OpaqSurfAvgFaceCondLossRep(SurfNum) = 0.0; - if (OpaqSurfAvgFaceConduction(SurfNum) >= 0.0) { - OpaqSurfAvgFaceCondGainRep(SurfNum) = OpaqSurfAvgFaceConduction(SurfNum); + SurfOpaqAvgFaceConduction(SurfNum) = (SurfOpaqInsFaceConduction(SurfNum) - SurfOpaqOutsideFaceConduction(SurfNum)) / 2.0; + SurfOpaqAvgFaceConductionFlux(SurfNum) = (SurfOpaqInsFaceConductionFlux(SurfNum) - SurfOpaqOutsideFaceConductionFlux(SurfNum)) / 2.0; + SurfOpaqAvgFaceConductionEnergy(SurfNum) = SurfOpaqAvgFaceConduction(SurfNum) * TimeStepZoneSec; + SurfOpaqAvgFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqAvgFaceCondLossRep(SurfNum) = 0.0; + if (SurfOpaqAvgFaceConduction(SurfNum) >= 0.0) { + SurfOpaqAvgFaceCondGainRep(SurfNum) = SurfOpaqAvgFaceConduction(SurfNum); } else { - OpaqSurfAvgFaceCondLossRep(SurfNum) = -OpaqSurfAvgFaceConduction(SurfNum); + SurfOpaqAvgFaceCondLossRep(SurfNum) = - SurfOpaqAvgFaceConduction(SurfNum); } // do surface storage rate updates - OpaqSurfStorageConductionFlux(SurfNum) = -(OpaqSurfInsFaceConductionFlux(SurfNum) + OpaqSurfOutsideFaceConductionFlux(SurfNum)); - OpaqSurfStorageConduction(SurfNum) = -(OpaqSurfInsFaceConduction(SurfNum) + OpaqSurfOutsideFaceConduction(SurfNum)); - OpaqSurfStorageConductionEnergy(SurfNum) = OpaqSurfStorageConduction(SurfNum) * TimeStepZoneSec; - OpaqSurfStorageGainRep(SurfNum) = 0.0; - OpaqSurfStorageCondLossRep(SurfNum) = 0.0; - if (OpaqSurfStorageConduction(SurfNum) >= 0.0) { - OpaqSurfStorageGainRep(SurfNum) = OpaqSurfStorageConduction(SurfNum); + SurfOpaqStorageConductionFlux(SurfNum) = - (SurfOpaqInsFaceConductionFlux(SurfNum) + SurfOpaqOutsideFaceConductionFlux(SurfNum)); + SurfOpaqStorageConduction(SurfNum) = - (SurfOpaqInsFaceConduction(SurfNum) + SurfOpaqOutsideFaceConduction(SurfNum)); + SurfOpaqStorageConductionEnergy(SurfNum) = SurfOpaqStorageConduction(SurfNum) * TimeStepZoneSec; + SurfOpaqStorageGainRep(SurfNum) = 0.0; + SurfOpaqStorageCondLossRep(SurfNum) = 0.0; + if (SurfOpaqStorageConduction(SurfNum) >= 0.0) { + SurfOpaqStorageGainRep(SurfNum) = SurfOpaqStorageConduction(SurfNum); } else { - OpaqSurfStorageCondLossRep(SurfNum) = -OpaqSurfStorageConduction(SurfNum); + SurfOpaqStorageCondLossRep(SurfNum) = - SurfOpaqStorageConduction(SurfNum); } } // opaque heat transfer surfaces. @@ -5674,9 +5669,9 @@ namespace HeatBalanceSurfaceManager { } if (present(ZoneToResimulate)) { - CalcInteriorRadExchange(TH(2, 1, _), 0, NetLWRadToSurf, ZoneToResimulate, Outside); + CalcInteriorRadExchange(TH(2, 1, _), 0, SurfNetLWRadToSurf, ZoneToResimulate, Outside); } else { - CalcInteriorRadExchange(TH(2, 1, _), 0, NetLWRadToSurf, _, Outside); + CalcInteriorRadExchange(TH(2, 1, _), 0, SurfNetLWRadToSurf, _, Outside); } for (int zoneNum = 1; zoneNum <= NumOfZones; ++zoneNum) {// Loop through all surfaces... @@ -5704,12 +5699,12 @@ namespace HeatBalanceSurfaceManager { HAirExtSurf(SurfNum) = 0.0; HSkyExtSurf(SurfNum) = 0.0; HGrdExtSurf(SurfNum) = 0.0; - QRadLWOutSrdSurfs(SurfNum) = 0.0; + SurfQRadLWOutSrdSurfs(SurfNum) = 0.0; // Calculate heat extract due to additional heat flux source term as the surface boundary condition if (Surface(SurfNum).OutsideHeatSourceTermSchedule) { - QAdditionalHeatSourceOutside(SurfNum) = EnergyPlus::ScheduleManager::GetCurrentScheduleValue( + SurfQAdditionalHeatSourceOutside(SurfNum) = EnergyPlus::ScheduleManager::GetCurrentScheduleValue( Surface(SurfNum).OutsideHeatSourceTermSchedule); } @@ -6127,7 +6122,7 @@ namespace HeatBalanceSurfaceManager { } } // Calculate LWR from surrounding surfaces if defined for an exterior surface - QRadLWOutSrdSurfs(SurfNum) = 0; + SurfQRadLWOutSrdSurfs(SurfNum) = 0; if (Surface(SurfNum).HasSurroundingSurfProperties) { int SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; // Absolute temperature of the outside surface of an exterior surface @@ -6137,7 +6132,7 @@ namespace HeatBalanceSurfaceManager { Real64 SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; // Absolute temperature of a surrounding surface Real64 SrdSurfTempAbs = GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv; - QRadLWOutSrdSurfs(SurfNum) += StefanBoltzmann * AbsThermSurf * SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TSurf)); + SurfQRadLWOutSrdSurfs(SurfNum) += StefanBoltzmann * AbsThermSurf * SrdSurfViewFac * (pow_4(SrdSurfTempAbs) - pow_4(TSurf)); } } @@ -6478,7 +6473,7 @@ namespace HeatBalanceSurfaceManager { if (DataSurfaces::AnyHeatBalanceInsideSourceTerm) { for (int SurfNum : HTSurfs) { if (Surface(SurfNum).InsideHeatSourceTermSchedule) { - QAdditionalHeatSourceInside(SurfNum) = + SurfQAdditionalHeatSourceInside(SurfNum) = EnergyPlus::ScheduleManager::GetCurrentScheduleValue(Surface(SurfNum).InsideHeatSourceTermSchedule); } } @@ -6505,7 +6500,7 @@ namespace HeatBalanceSurfaceManager { } HeatBalanceIntRadExchange::CalcInteriorRadExchange( - TempSurfIn, InsideSurfIterations, NetLWRadToSurf, ZoneToResimulate, Inside); // Update the radiation balance + TempSurfIn, InsideSurfIterations, SurfNetLWRadToSurf, ZoneToResimulate, Inside); // Update the radiation balance if (DataHeatBalance::AnyKiva) { for (auto &kivaSurf : SurfaceGeometry::kivaManager.surfaceMap) { @@ -6579,10 +6574,10 @@ namespace HeatBalanceSurfaceManager { } // Pre-calculate a few terms // - Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + QRadSWInAbs(SurfNum) + - QAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + + Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + + SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + - QElecBaseboardSurf(SurfNum) + NetLWRadToSurf(SurfNum) + (QRadSurfAFNDuct(SurfNum) / TimeStepZoneSec)); + QElecBaseboardSurf(SurfNum) + SurfNetLWRadToSurf(SurfNum) + (QRadSurfAFNDuct(SurfNum) / TimeStepZoneSec)); Real64 const TempDiv(1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature if ((!surface.IsPool) || ((surface.IsPool) && (std::abs(QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && @@ -6679,10 +6674,10 @@ namespace HeatBalanceSurfaceManager { MoistureBalanceEMPDManager::CalcMoistureBalanceEMPD(ioFiles, SurfNum, TempSurfInTmp(SurfNum), MAT_zone, TempSurfInSat); } // Pre-calculate a few terms - Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + QRadSWInAbs(SurfNum) + - QAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + + Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + + SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + - QElecBaseboardSurf(SurfNum) + NetLWRadToSurf(SurfNum) + + QElecBaseboardSurf(SurfNum) + SurfNetLWRadToSurf(SurfNum) + (QRadSurfAFNDuct(SurfNum) / TimeStepZoneSec)); Real64 const TempDiv(1.0 / (construct.CTFInside(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature @@ -6792,8 +6787,8 @@ namespace HeatBalanceSurfaceManager { } else if (surface.HeatTransferAlgorithm == HeatTransferModel_Kiva) { // Read Kiva results for each surface TempSurfInTmp(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.Tconv - DataGlobals::KelvinConv; - OpaqSurfInsFaceConductionFlux(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.qtot; - OpaqSurfInsFaceConduction(SurfNum) = OpaqSurfInsFaceConductionFlux(SurfNum) * DataSurfaces::Surface(SurfNum).Area; + SurfOpaqInsFaceConductionFlux(SurfNum) = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.qtot; + SurfOpaqInsFaceConduction(SurfNum) = SurfOpaqInsFaceConductionFlux(SurfNum) * DataSurfaces::Surface(SurfNum).Area; TH11 = 0.0; } @@ -6816,15 +6811,15 @@ namespace HeatBalanceSurfaceManager { Real64 F1 = HMovInsul / (HMovInsul + HConvIn_surf + IterDampConst); TempSurfIn(SurfNum) = - (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + - F1 * (QRadThermInAbs(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + NetLWRadToSurf(SurfNum) + QHTRadSysSurf(SurfNum) + + (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + + F1 * (QRadThermInAbs(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + SurfNetLWRadToSurf(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + - QElecBaseboardSurf(SurfNum) + QAdditionalHeatSourceInside(SurfNum) + IterDampConst * TempInsOld(SurfNum))) / + QElecBaseboardSurf(SurfNum) + SurfQAdditionalHeatSourceInside(SurfNum) + IterDampConst * TempInsOld(SurfNum))) / (construct.CTFInside(0) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air TempSurfInTmp(SurfNum) = (construct.CTFInside(0) * TempSurfIn(SurfNum) + HMovInsul * TempSurfIn(SurfNum) - - QRadSWInAbs(SurfNum) - CTFConstInPart(SurfNum) - construct.CTFCross(0) * TH11) / - (HMovInsul); + SurfOpaqQRadSWInAbs(SurfNum) - CTFConstInPart(SurfNum) - construct.CTFCross(0) * TH11) / + (HMovInsul); // if any mixed heat transfer models in zone, apply limits to CTF result if (DataHeatBalSurface::Zone_has_mixed_HT_models[ZoneNum]) TempSurfInTmp(SurfNum) = @@ -6850,8 +6845,8 @@ namespace HeatBalanceSurfaceManager { // = QRadSWwinAbs(SurfNum,1)/2.0 Real64 const HConvIn_surf(HConvInFD(SurfNum) = HConvIn(SurfNum)); TempSurfIn(SurfNum) = TempSurfInTmp(SurfNum) = - (QRadThermInAbs(SurfNum) + QRadSWwinAbs(1, SurfNum) / 2.0 + QAdditionalHeatSourceInside(SurfNum) + - HConvIn_surf * RefAirTemp(SurfNum) + NetLWRadToSurf(SurfNum) + IterDampConst * TempInsOld(SurfNum) + + (QRadThermInAbs(SurfNum) + QRadSWwinAbs(1, SurfNum) / 2.0 + SurfQAdditionalHeatSourceInside(SurfNum) + + HConvIn_surf * RefAirTemp(SurfNum) + SurfNetLWRadToSurf(SurfNum) + IterDampConst * TempInsOld(SurfNum) + Ueff * TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and // solar | Convection from surface to zone air | Net radiant exchange with @@ -6977,7 +6972,7 @@ namespace HeatBalanceSurfaceManager { Real64 &TH11(TH(1, 1, SurfNum)); Real64 &TH12(TH(2, 1, SurfNum)); TH12 = TempSurfInRep(SurfNum) = TempSurfIn(SurfNum); - TempSurfOut(SurfNum) = TH11; // For reporting + SurfTempSurfOut(SurfNum) = TH11; // For reporting if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { // Tubular daylighting device // Tubular daylighting devices are treated as one big object with an effective R value. @@ -6992,7 +6987,7 @@ namespace HeatBalanceSurfaceManager { // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME - TH11 = TempSurfOut(SurfNum) = TempSurfOut(domeNum) = TH(1, 1, domeNum); + TH11 = SurfTempSurfOut(SurfNum) = SurfTempSurfOut(domeNum) = TH(1, 1, domeNum); } if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { @@ -7014,7 +7009,7 @@ namespace HeatBalanceSurfaceManager { // By going through all of the surfaces, this should pick up the other side as well as affect the next iteration. // [ SurfNum - 1 ] == ( 1, 1, SurfNum ) // [ l211 + surfExtBoundCond ] == ( 2, 1, surfExtBoundCond ) - TempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; + SurfTempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; } ++InsideSurfIterations; @@ -7101,7 +7096,7 @@ namespace HeatBalanceSurfaceManager { } else { OutputReportTabular::loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); OutputReportTabular::netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = - NetLWRadToSurf(surfNum) * Surface(surfNum).Area; + SurfNetLWRadToSurf(surfNum) * Surface(surfNum).Area; } } } @@ -7346,7 +7341,7 @@ namespace HeatBalanceSurfaceManager { if (DataSurfaces::AnyHeatBalanceInsideSourceTerm) { for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { if (Surface(surfNum).InsideHeatSourceTermSchedule) { - QAdditionalHeatSourceInside(surfNum) = + SurfQAdditionalHeatSourceInside(surfNum) = EnergyPlus::ScheduleManager::GetCurrentScheduleValue(Surface(surfNum).InsideHeatSourceTermSchedule); } } @@ -7361,10 +7356,10 @@ namespace HeatBalanceSurfaceManager { for (int surfNum = firstNonWinSurf; surfNum <= lastNonWinSurf; ++surfNum) { // Pre-calculate a few terms before the iteration loop - TempTermSurf(surfNum) = CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + QRadSWInAbs(surfNum) + - QAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + - QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + - QElecBaseboardSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); + TempTermSurf(surfNum) = CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + + QElecBaseboardSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); TempDivSurf(surfNum) = 1.0 / (CTFInside0(surfNum) - IsAdiabatic(surfNum) * CTFCross0(surfNum) + IsPoolSurf(surfNum) * PoolHeatTransCoefs(surfNum) + IsNotPoolSurf(surfNum) * HConvIn(surfNum) + iterDampConstant); @@ -7378,7 +7373,7 @@ namespace HeatBalanceSurfaceManager { TempInsOld = TempSurfIn; // Keep track of last iteration's temperature values HeatBalanceIntRadExchange::CalcInteriorRadExchange( - TempSurfIn, InsideSurfIterations, NetLWRadToSurf, ZoneToResimulate, Inside); // Update the radiation balance + TempSurfIn, InsideSurfIterations, SurfNetLWRadToSurf, ZoneToResimulate, Inside); // Update the radiation balance // Every 30 iterations, recalculate the inside convection coefficients in case // there has been a significant drift in the surface temperatures predicted. @@ -7397,7 +7392,7 @@ namespace HeatBalanceSurfaceManager { // this loop auto-vectorizes for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { TempTermSurf(surfNum) = - CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + QRadSWInAbs(surfNum) + QAdditionalHeatSourceInside(surfNum) + + CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); TempDivSurf(surfNum) = @@ -7454,7 +7449,7 @@ namespace HeatBalanceSurfaceManager { // Calculate the current inside surface temperature TempSurfInTmp(surfNum) = - (IsNotPoolSurf(surfNum) * (TempTermSurf(surfNum) + NetLWRadToSurf(surfNum)) + + (IsNotPoolSurf(surfNum) * (TempTermSurf(surfNum) + SurfNetLWRadToSurf(surfNum)) + IsSource(surfNum) * CTFSourceIn0(surfNum) * QsrcHistSurf1(surfNum) + IsPoolSurf(surfNum) * CTFConstInPart(surfNum) + IsPoolSurf(surfNum) * QPoolSurfNumerator(surfNum) + iterDampConstant * TempInsOld(surfNum) + IsNotAdiabatic(surfNum) * CTFCross0(surfNum) * TH11Surf(surfNum)) * @@ -7490,13 +7485,13 @@ namespace HeatBalanceSurfaceManager { Real64 F1 = HMovInsul / (HMovInsul + HConvIn(surfNum) + IterDampConst); TempSurfIn(surfNum) = - (CTFConstInPart(surfNum) + QRadSWInAbs(surfNum) + CTFCross0(surfNum) * TH11Surf(surfNum) + - F1 * (QRadThermInAbs(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + NetLWRadToSurf(surfNum) + + (CTFConstInPart(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + CTFCross0(surfNum) * TH11Surf(surfNum) + + F1 * (QRadThermInAbs(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + SurfNetLWRadToSurf(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + - QElecBaseboardSurf(surfNum) + QAdditionalHeatSourceInside(surfNum) + IterDampConst * TempInsOld(surfNum))) / + QElecBaseboardSurf(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + IterDampConst * TempInsOld(surfNum))) / (CTFInside0(surfNum) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air - TempSurfInTmp(surfNum) = (CTFInside0(surfNum) * TempSurfIn(surfNum) + HMovInsul * TempSurfIn(surfNum) - QRadSWInAbs(surfNum) - + TempSurfInTmp(surfNum) = (CTFInside0(surfNum) * TempSurfIn(surfNum) + HMovInsul * TempSurfIn(surfNum) - SurfOpaqQRadSWInAbs(surfNum) - CTFConstInPart(surfNum) - CTFCross0(surfNum) * TH11Surf(surfNum)) / (HMovInsul); } @@ -7506,10 +7501,10 @@ namespace HeatBalanceSurfaceManager { // Set the appropriate parameters for the radiant system // Radiant system does not need the damping coefficient terms (hopefully) Real64 const RadSysDiv(1.0 / (CTFInside0(surfNum) + HConvIn(surfNum))); - Real64 const TempTerm(CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + QRadSWInAbs(surfNum) + - QAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + + Real64 const TempTerm(CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + - QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + NetLWRadToSurf(surfNum) + + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + SurfNetLWRadToSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / TimeStepZoneSec)); RadSysTiHBConstCoef(surfNum) = TempTerm * RadSysDiv; // Constant portion of cond eq (history terms) | LW radiation from internal sources | SW @@ -7564,8 +7559,8 @@ namespace HeatBalanceSurfaceManager { // = QRadSWwinAbs(surfNum,1)/2.0 Real64 const HConvIn_surf(HConvInFD(surfNum) = HConvIn(surfNum)); TempSurfIn(surfNum) = TempSurfInTmp(surfNum) = - (QRadThermInAbs(surfNum) + QRadSWwinAbs(1, surfNum) / 2.0 + QAdditionalHeatSourceInside(surfNum) + - HConvIn_surf * RefAirTemp(surfNum) + NetLWRadToSurf(surfNum) + IterDampConst * TempInsOld(surfNum) + + (QRadThermInAbs(surfNum) + QRadSWwinAbs(1, surfNum) / 2.0 + SurfQAdditionalHeatSourceInside(surfNum) + + HConvIn_surf * RefAirTemp(surfNum) + SurfNetLWRadToSurf(surfNum) + IterDampConst * TempInsOld(surfNum) + Ueff * TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and // solar | Convection from surface to zone air | Net radiant exchange with @@ -7694,7 +7689,7 @@ namespace HeatBalanceSurfaceManager { Real64 &TH11(TH(1, 1, surfNum)); Real64 &TH12(TH(2, 1, surfNum)); TH12 = TempSurfInRep(surfNum) = TempSurfIn(surfNum); - TempSurfOut(surfNum) = TH11; // For reporting + SurfTempSurfOut(surfNum) = TH11; // For reporting if (SurfWinOriginalClass(surfNum) == SurfaceClass_TDD_Diffuser) { // Tubular daylighting device // Tubular daylighting devices are treated as one big object with an effective R value. @@ -7709,7 +7704,7 @@ namespace HeatBalanceSurfaceManager { // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME - TH11 = TempSurfOut(surfNum) = TempSurfOut(domeNum) = TH(1, 1, domeNum); + TH11 = SurfTempSurfOut(surfNum) = SurfTempSurfOut(domeNum) = TH(1, 1, domeNum); } if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { @@ -7731,8 +7726,8 @@ namespace HeatBalanceSurfaceManager { // By going through all of the surfaces, this should pick up the other side as well as affect the next iteration. // [ SurfNum - 1 ] == ( 1, 1, SurfNum ) // [ l211 + surfExtBoundCond ] == ( 2, 1, surfExtBoundCond ) - TempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; - TH11Surf(SurfNum) = TempSurfOut(SurfNum); + SurfTempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; + TH11Surf(SurfNum) = SurfTempSurfOut(SurfNum); } ++InsideSurfIterations; @@ -7804,7 +7799,7 @@ namespace HeatBalanceSurfaceManager { } else { OutputReportTabular::loadConvectedNormal(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = QdotConvInRep(surfNum); OutputReportTabular::netSurfRadSeq(DataSizing::CurOverallSimDay, TimeStepInDay, surfNum) = - NetLWRadToSurf(surfNum) * Surface(surfNum).Area; + SurfNetLWRadToSurf(surfNum) * Surface(surfNum).Area; } } } @@ -8149,9 +8144,9 @@ namespace HeatBalanceSurfaceManager { //+Construct(ConstrNum)%CTFSourceIn(0) & TDDs cannot be radiant systems // *QsrcHist(1,SurfNum) & TH11 = - (QRadSWwinAbs(1, SurfNum) / 2.0 + QRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + - QAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + - F1 * (QRadSWwinAbs(1, SurfNum2) / 2.0 + QRadThermInAbs(SurfNum2) + HConvIn(SurfNum2) * MAT(ZoneNum2) + NetLWRadToSurf(SurfNum2))) / + (QRadSWwinAbs(1, SurfNum) / 2.0 + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + + F1 * (QRadSWwinAbs(1, SurfNum2) / 2.0 + QRadThermInAbs(SurfNum2) + HConvIn(SurfNum2) * MAT(ZoneNum2) + SurfNetLWRadToSurf(SurfNum2))) / (Ueff + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * Ueff); // Instead of QRadSWOutAbs(SurfNum) | ODB used to approx ground surface temp | Use TDD:DIFFUSER surface | Use // TDD:DIFFUSER surface | Use TDD:DIFFUSER surface and zone | Use TDD:DIFFUSER surface @@ -8161,15 +8156,15 @@ namespace HeatBalanceSurfaceManager { // Add LWR from surrounding surfaces if (Surface(SurfNum).OSCMPtr == 0) { if (construct.SourceSinkPresent) { - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + construct.CTFCross(0) * TempSurfIn(SurfNum) + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1)) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); // ODB used to approx ground surface temp } else { - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + construct.CTFCross(0) * TempSurfIn(SurfNum)) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); // ODB used to approx ground surface temp @@ -8183,11 +8178,11 @@ namespace HeatBalanceSurfaceManager { // patterned after "No movable insulation, slow conduction," but with new radiation terms and no sun, if (construct.SourceSinkPresent) { - TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + + TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + construct.CTFCross(0) * TempSurfIn(SurfNum) + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1)) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad); } else { - TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + + TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + construct.CTFCross(0) * TempSurfIn(SurfNum)) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad); } @@ -8196,19 +8191,19 @@ namespace HeatBalanceSurfaceManager { } else if ((!MovInsulPresent) && (QuickConductionSurf)) { if (Surface(SurfNum).OSCMPtr == 0) { if (construct.SourceSinkPresent) { - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1) + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + - NetLWRadToSurf(SurfNum))) / + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models } else { - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + - NetLWRadToSurf(SurfNum))) / + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models } @@ -8219,16 +8214,16 @@ namespace HeatBalanceSurfaceManager { HRad = OSCM(Surface(SurfNum).OSCMPtr).HRad; // patterned after "No movable insulation, quick conduction," but with new radiation terms and no sun, if (construct.SourceSinkPresent) { - TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + + TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1) + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + - construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + HConvIn(SurfNum) * MAT(ZoneNum) + NetLWRadToSurf(SurfNum))) / + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models } else { - TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + - NetLWRadToSurf(SurfNum))) / + TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models } @@ -8238,8 +8233,8 @@ namespace HeatBalanceSurfaceManager { F2 = HMovInsul / (HMovInsul + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * TempSurfIn(SurfNum) + - F2 * (QRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + construct.CTFCross(0) * TempSurfIn(SurfNum) + + F2 * (SurfQRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul); // ODB used to approx ground surface temp @@ -8248,10 +8243,10 @@ namespace HeatBalanceSurfaceManager { F2 = HMovInsul / (HMovInsul + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); - TH11 = (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + - F1 * (CTFConstInPart(SurfNum) + QRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + - NetLWRadToSurf(SurfNum)) + - F2 * (QRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + QAdditionalHeatSourceOutside(SurfNum) + + TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + SurfNetLWRadToSurf(SurfNum)) + + F2 * (SurfQRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround)) / (construct.CTFOutside(0) + HMovInsul - F2 * HMovInsul - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp @@ -8299,7 +8294,7 @@ namespace HeatBalanceSurfaceManager { 1.0 / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum))); RadSysToHBConstCoef(SurfNum) = - (-CTFConstOutPart(SurfNum) + QRadSWOutAbs(SurfNum) + QRadLWOutSrdSurfs(SurfNum) + + (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround) * RadSysDiv; // ODB used to approx ground surface temp diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 6adfe2c9ec9..51f9918d962 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -967,7 +967,7 @@ namespace Photovoltaics { using DataHeatBalance::CosIncidenceAngle; using DataHeatBalance::QRadSWOutIncident; using DataHeatBalance::QRadSWOutIncidentBeam; - using DataHeatBalSurface::TempSurfOut; + using DataHeatBalSurface::SurfTempSurfOut; using DataSurfaces::Surface; using TranspiredCollector::GetUTSCTsColl; @@ -1024,7 +1024,7 @@ namespace Photovoltaics { } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { // get back-of-module temperature from elsewhere in EnergyPlus - PVarray(PVnum).SNLPVCalc.Tback = TempSurfOut(PVarray(PVnum).SurfacePtr); + PVarray(PVnum).SNLPVCalc.Tback = SurfTempSurfOut(PVarray(PVnum).SurfacePtr); PVarray(PVnum).SNLPVCalc.Tcell = SandiaTcellFromTmodule(PVarray(PVnum).SNLPVCalc.Tback, PVarray(PVnum).SNLPVinto.IcBeam, @@ -1306,7 +1306,7 @@ namespace Photovoltaics { using DataSurfaces::Surface; // USE DataPhotovoltaics, ONLY:CellTemp,LastCellTemp using DataHeatBalance::Zone; - using DataHeatBalSurface::TempSurfOut; + using DataHeatBalSurface::SurfTempSurfOut; using TranspiredCollector::GetUTSCTsColl; // Locals @@ -1404,7 +1404,7 @@ namespace Photovoltaics { (1.0 - std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep)); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = SurfTempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); CellTemp += KelvinConv; @@ -1477,7 +1477,7 @@ namespace Photovoltaics { (PVarray(PVnum).TRNSYSPVcalc.LastCellTempK - Tambient) * std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = TempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = SurfTempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); CellTemp += KelvinConv; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 5af6fc99322..65dc37d34b6 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -507,11 +507,11 @@ namespace SolarShading { QRadSWOutIncBmToDiffReflObs = 0.0; QRadSWOutIncSkyDiffReflObs = 0.0; CosIncidenceAngle = 0.0; - QRadSWwinAbsTot = 0.0; - SWwinAbsTotalReport = 0.0; - InitialDifSolInAbsReport = 0.0; - InitialDifSolInTransReport = 0.0; - SWInAbsTotalReport = 0.0; + SurfWinQRadSWwinAbsTot = 0.0; + SurfWinSWwinAbsTotalReport = 0.0; + SurfInitialDifSolInAbsReport = 0.0; + SurfWinInitialDifSolInTransReport = 0.0; + SurfSWInAbsTotalReport = 0.0; WindowRevealStatus = 0; ZoneTransSolarEnergy = 0.0; ZoneBmSolFrExtWinsRepEnergy = 0.0; @@ -522,11 +522,11 @@ namespace SolarShading { ZoneWinHeatLossRepEnergy = 0.0; ZnOpqSurfInsFaceCondGnRepEnrg = 0.0; ZnOpqSurfInsFaceCondLsRepEnrg = 0.0; - BmIncInsSurfAmountRepEnergy = 0.0; + SurfBmIncInsSurfAmountRepEnergy = 0.0; // DifIncInsSurfAmountRepEnergy=0.0 - IntBmIncInsSurfAmountRepEnergy = 0.0; + SurfIntBmIncInsSurfAmountRepEnergy = 0.0; // IntDifIncInsSurfAmountRepEnergy=0.0 - QRadSWwinAbsTotEnergy = 0.0; + SurfWinQRadSWwinAbsTotEnergy = 0.0; // Surface Win for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { @@ -1095,17 +1095,17 @@ namespace SolarShading { SurfWinBSDFBeamDirectionRep.dimension(TotSurfaces, 0); SurfWinBSDFBeamThetaRep.dimension(TotSurfaces, 0.0); SurfWinBSDFBeamPhiRep.dimension(TotSurfaces, 0.0); - QRadSWwinAbsTot.dimension(TotSurfaces, 0.0); + SurfWinQRadSWwinAbsTot.dimension(TotSurfaces, 0.0); - QRadSWwinAbsLayer.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); + SurfWinQRadSWwinAbsLayer.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); - FenLaySurfTempFront.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); - FenLaySurfTempBack.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); + SurfWinFenLaySurfTempFront.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); + SurfWinFenLaySurfTempBack.dimension(DataHeatBalance::MaxSolidWinLayers, TotSurfaces, 0.0); - SWwinAbsTotalReport.dimension(TotSurfaces, 0.0); - InitialDifSolInAbsReport.dimension(TotSurfaces, 0.0); - InitialDifSolInTransReport.dimension(TotSurfaces, 0.0); - SWInAbsTotalReport.dimension(TotSurfaces, 0.0); + SurfWinSWwinAbsTotalReport.dimension(TotSurfaces, 0.0); + SurfInitialDifSolInAbsReport.dimension(TotSurfaces, 0.0); + SurfWinInitialDifSolInTransReport.dimension(TotSurfaces, 0.0); + SurfSWInAbsTotalReport.dimension(TotSurfaces, 0.0); WindowRevealStatus.dimension(NumOfTimeStepInHour, 24, TotSurfaces, 0); // Weiler-Atherton @@ -1147,17 +1147,18 @@ namespace SolarShading { ZoneDifSolFrIntWinsRepEnergy.dimension(NumOfZones, 0.0); ZoneWinHeatGainRepEnergy.dimension(NumOfZones, 0.0); ZoneWinHeatLossRepEnergy.dimension(NumOfZones, 0.0); - BmIncInsSurfAmountRepEnergy.dimension(TotSurfaces, 0.0); + ZnOpqSurfInsFaceCondGnRepEnrg.dimension(NumOfZones, 0.0); ZnOpqSurfInsFaceCondLsRepEnrg.dimension(NumOfZones, 0.0); ZnOpqSurfExtFaceCondGnRepEnrg.dimension(NumOfZones, 0.0); ZnOpqSurfExtFaceCondLsRepEnrg.dimension(NumOfZones, 0.0); // ALLOCATE(DifIncInsSurfAmountRepEnergy(TotSurfaces)) // DifIncInsSurfAmountRepEnergy=0.0 - IntBmIncInsSurfAmountRepEnergy.dimension(TotSurfaces, 0.0); + SurfBmIncInsSurfAmountRepEnergy.dimension(TotSurfaces, 0.0); + SurfIntBmIncInsSurfAmountRepEnergy.dimension(TotSurfaces, 0.0); // ALLOCATE(IntDifIncInsSurfAmountRepEnergy(TotSurfaces)) // IntDifIncInsSurfAmountRepEnergy=0.0 - QRadSWwinAbsTotEnergy.dimension(TotSurfaces, 0.0); + SurfWinQRadSWwinAbsTotEnergy.dimension(TotSurfaces, 0.0); for (int SurfNum = 1; SurfNum <= TotSurfaces; SurfNum++) { SurfWinBmSolAbsdOutsReveal(SurfNum) = 0.0; @@ -1402,13 +1403,13 @@ namespace SolarShading { if (Surface(SurfLoop).ExtSolar) { SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Rate", OutputProcessor::Unit::W, - QRadSWwinAbsTot(SurfLoop), + SurfWinQRadSWwinAbsTot(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Shortwave Radiation Rate", OutputProcessor::Unit::W, - SWwinAbsTotalReport(SurfLoop), + SurfWinSWwinAbsTotalReport(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -1422,7 +1423,7 @@ namespace SolarShading { if (dataConstruction.Construct(Surface(SurfLoop).Construction).WindowTypeBSDF) { SetupOutputVariable("Surface Window Total Absorbed Shortwave Radiation Rate Layer " + RoundSigDigits(I) + "", OutputProcessor::Unit::W, - QRadSWwinAbsLayer(I, SurfLoop), + SurfWinQRadSWwinAbsLayer(I, SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -1430,7 +1431,7 @@ namespace SolarShading { if (dataConstruction.Construct(Surface(SurfLoop).Construction).WindowTypeBSDF || (I == 1)) { SetupOutputVariable("Surface Window Front Face Temperature Layer " + RoundSigDigits(I) + "", OutputProcessor::Unit::C, - FenLaySurfTempFront(I, SurfLoop), + SurfWinFenLaySurfTempFront(I, SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -1438,7 +1439,7 @@ namespace SolarShading { if (dataConstruction.Construct(Surface(SurfLoop).Construction).WindowTypeBSDF || (I == NumOfLayers)) { SetupOutputVariable("Surface Window Back Face Temperature Layer " + RoundSigDigits(I) + "", OutputProcessor::Unit::C, - FenLaySurfTempBack(I, SurfLoop), + SurfWinFenLaySurfTempBack(I, SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -1659,7 +1660,7 @@ namespace SolarShading { // Energy SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Energy", OutputProcessor::Unit::J, - QRadSWwinAbsTotEnergy(SurfLoop), + SurfWinQRadSWwinAbsTotEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); @@ -1938,14 +1939,14 @@ namespace SolarShading { if (SurfWinOriginalClass(SurfLoop) != SurfaceClass_TDD_Diffuser) { SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Rate", OutputProcessor::Unit::W, - QRadSWwinAbsTot(SurfLoop), + SurfWinQRadSWwinAbsTot(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); } SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Shortwave Radiation Rate", OutputProcessor::Unit::W, - SWwinAbsTotalReport(SurfLoop), + SurfWinSWwinAbsTotalReport(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -2064,7 +2065,7 @@ namespace SolarShading { if (SurfWinOriginalClass(SurfLoop) != SurfaceClass_TDD_Diffuser) { SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Energy", OutputProcessor::Unit::J, - QRadSWwinAbsTotEnergy(SurfLoop), + SurfWinQRadSWwinAbsTotEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); @@ -2318,7 +2319,7 @@ namespace SolarShading { // CurrentModuleObject='TDD Domes' SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Rate", OutputProcessor::Unit::W, - QRadSWwinAbsTot(SurfLoop), + SurfWinQRadSWwinAbsTot(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -2331,7 +2332,7 @@ namespace SolarShading { // energy SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Energy", OutputProcessor::Unit::J, - QRadSWwinAbsTotEnergy(SurfLoop), + SurfWinQRadSWwinAbsTotEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); @@ -2352,7 +2353,7 @@ namespace SolarShading { Surface(SurfLoop).Name); SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Rate", OutputProcessor::Unit::W, - QRadSWwinAbsTot(SurfLoop), + SurfWinQRadSWwinAbsTot(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -2365,7 +2366,7 @@ namespace SolarShading { // energy SetupOutputVariable("Surface Window Total Glazing Layers Absorbed Solar Radiation Energy", OutputProcessor::Unit::J, - QRadSWwinAbsTotEnergy(SurfLoop), + SurfWinQRadSWwinAbsTotEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); @@ -2407,32 +2408,32 @@ namespace SolarShading { Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Initial Transmitted Diffuse Absorbed Solar Radiation Rate", OutputProcessor::Unit::W, - InitialDifSolInAbsReport(SurfLoop), + SurfInitialDifSolInAbsReport(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Initial Transmitted Diffuse Transmitted Out Window Solar Radiation Rate", OutputProcessor::Unit::W, - InitialDifSolInTransReport(SurfLoop), + SurfWinInitialDifSolInTransReport(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Absorbed Shortwave Radiation Rate", OutputProcessor::Unit::W, - SWInAbsTotalReport(SurfLoop), + SurfSWInAbsTotalReport(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); // energy SetupOutputVariable("Surface Inside Face Exterior Windows Incident Beam Solar Radiation Energy", OutputProcessor::Unit::J, - BmIncInsSurfAmountRepEnergy(SurfLoop), + SurfBmIncInsSurfAmountRepEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Interior Windows Incident Beam Solar Radiation Energy", OutputProcessor::Unit::J, - IntBmIncInsSurfAmountRepEnergy(SurfLoop), + SurfIntBmIncInsSurfAmountRepEnergy(SurfLoop), "Zone", "Sum", Surface(SurfLoop).Name); @@ -8315,7 +8316,7 @@ namespace SolarShading { } } // End of check if back surface is opaque or window BmIncInsSurfAmountRep(BackSurfNum) += BOverlap; - BmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; } // End of loop over back surfaces } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // For complex window calculation goes over outgoing basis directions @@ -8584,7 +8585,7 @@ namespace SolarShading { } } // End of check if back surface is opaque or window BmIncInsSurfAmountRep(BackSurfNum) += BOverlap; - BmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; } // End of loop over back surfaces // ***************************** @@ -8683,7 +8684,7 @@ namespace SolarShading { for (int const SurfNum : thisEnclosure.SurfacePtr) { if (SolarDistribution == FullInteriorExterior) { BmIncInsSurfAmountRep(SurfNum) *= BeamSolarRad; - BmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; BmIncInsSurfIntensRep(SurfNum) = BmIncInsSurfAmountRep(SurfNum) / (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); } else { // Simple interior solar distribution. All beam falls on floor. if (ISABSF(SurfNum) > 0.0 && Surface(SurfNum).HeatTransSurf) { @@ -8698,7 +8699,7 @@ namespace SolarShading { } } BmIncInsSurfAmountRep(SurfNum) = Surface(SurfNum).Area * BmIncInsSurfIntensRep(SurfNum); - BmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; } if (Surface(SurfNum).Class == SurfaceClass_Window || Surface(SurfNum).Class == SurfaceClass_TDD_Dome) { @@ -8977,7 +8978,7 @@ namespace SolarShading { QRadSWwinAbs(Lay, SurfNum) = cplxState.WinSkyFtAbs(Lay) * SurfSkySolarInc(SurfNum2) + cplxState.WinSkyGndAbs(Lay) * SurfGndSolarInc(SurfNum2) + AWinSurf(Lay, SurfNum) * BeamSolarRad + AWinCFOverlap(Lay, SurfNum) * BeamSolarRad; - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; AWinSurfDiffFront(Lay, SurfNum) = cplxState.WinSkyGndAbs(Lay); } } else { @@ -8998,7 +8999,7 @@ namespace SolarShading { auto absBeam = AWinSurf(Lay, SurfNum) * BeamSolarRad; auto absDiff = AWinSurfDiffFront(Lay, SurfNum) * (SurfSkySolarInc(SurfNum2) + SurfGndSolarInc(SurfNum2)); QRadSWwinAbs(Lay, SurfNum) = (absBeam + absDiff); - QRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; } } } @@ -11838,8 +11839,8 @@ namespace SolarShading { using namespace DataViewFactorInformation; using DataHeatBalance::InitialDifSolwinAbs; using DataHeatBalance::InitialZoneDifSolReflW; - using DataHeatBalSurface::InitialDifSolInAbs; - using DataHeatBalSurface::InitialDifSolInTrans; + using DataHeatBalSurface::SurfOpaqInitialDifSolInAbs; + using DataHeatBalSurface::SurfWinInitialDifSolInTrans; using namespace DataWindowEquivalentLayer; Real64 AbsInt; // Tmp var for Inside surface short-wave absorptance @@ -11888,14 +11889,14 @@ namespace SolarShading { int Lay; // equivalent layer fenestration layer index // Init accumulators for absorbed diffuse solar for all surfaces for later heat balance calcs - InitialDifSolInAbs = 0.0; + SurfOpaqInitialDifSolInAbs = 0.0; InitialDifSolwinAbs = 0.0; // Init accumulator for total reflected diffuse solar within each zone for interreflection calcs InitialZoneDifSolReflW = 0.0; // Init accumulator for transmitted diffuse solar for all surfaces for reporting - InitialDifSolInTrans = 0.0; + SurfWinInitialDifSolInTrans = 0.0; // Loop over all zones doing initial distribution of diffuse solar to interior heat transfer surfaces for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfRadiantEnclosures; ++enclosureNum) { @@ -11995,7 +11996,7 @@ namespace SolarShading { DifSolarAbs = DifSolarAbsW * per_HTSurfaceArea; // Accumulate absorbed diffuse solar [W/m2] on this surface for heat balance calcs - InitialDifSolInAbs(HeatTransSurfNum) += DifSolarAbs; + SurfOpaqInitialDifSolInAbs(HeatTransSurfNum) += DifSolarAbs; // Reflected diffuse solar [W] = current window transmitted diffuse solar // * view factor from current (sending) window DifTransSurfNum to current (receiving) surface HeatTransSurfNum @@ -12111,7 +12112,7 @@ namespace SolarShading { ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; } else if (ConstrNumSh != 0 && (ShadeFlag == IntShadeOn || ShadeFlag >= 3)) { // Interior, exterior or between-glass shade, screen or blind in place @@ -12197,7 +12198,7 @@ namespace SolarShading { ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing // Init accumulator for transmittance calc below @@ -12242,7 +12243,7 @@ namespace SolarShading { ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; } // End of shading flag check @@ -12326,7 +12327,7 @@ namespace SolarShading { WinDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += DifSolarTransW * per_HTSurfaceArea; } // IF (SurfaceWindow(HeatTransSurfNum)%WindowModelType /= WindowEQLModel) THEN @@ -12423,8 +12424,8 @@ namespace SolarShading { using namespace DataViewFactorInformation; using DataHeatBalance::InitialDifSolwinAbs; using DataHeatBalance::InitialZoneDifSolReflW; - using DataHeatBalSurface::InitialDifSolInAbs; - using DataHeatBalSurface::InitialDifSolInTrans; + using DataHeatBalSurface::SurfOpaqInitialDifSolInAbs; + using DataHeatBalSurface::SurfWinInitialDifSolInTrans; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ConstrNumSh; // Shaded construction number @@ -12535,7 +12536,7 @@ namespace SolarShading { DifSolarAbs = DifSolarAbsW / Surface(HeatTransSurfNum).Area; // Accumulate absorbed diffuse solar [W/m2] on this surface for heat balance calcs - InitialDifSolInAbs(HeatTransSurfNum) += DifSolarAbs; + SurfOpaqInitialDifSolInAbs(HeatTransSurfNum) += DifSolarAbs; // Reflected diffuse solar [W] = current window transmitted diffuse solar // * view factor from current (sending) window IntWinSurfNum to current (receiving) surface HeatTransSurfNum @@ -12609,7 +12610,7 @@ namespace SolarShading { // ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); //----------------------------------------------------------------------------------- // ADD TRANSMITTED DIFFUSE SOLAR THROUGH INTERIOR WINDOW TO ADJACENT ZONE @@ -12717,7 +12718,7 @@ namespace SolarShading { // ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing // Init accumulator for transmittance calc below @@ -12759,7 +12760,7 @@ namespace SolarShading { // ZoneDifSolarDistTransmittedTotl += DifSolarTransW; // debug [W] // Accumulate transmitted diffuse solar for reporting - InitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolInTrans(HeatTransSurfNum) += (DifSolarTransW / Surface(HeatTransSurfNum).Area); } // End of shading flag check diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 2b8e41d1914..55779efeee8 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -825,13 +825,13 @@ namespace SwimmingPool { // LW and SW radiation term modification: any "excess" radiation blocked by the cover gets convected // to the air directly and added to the zone air heat balance Real64 LWsum = - (DataHeatBalance::QRadThermInAbs(SurfNum) + DataHeatBalSurface::NetLWRadToSurf(SurfNum) + DataHeatBalFanSys::QHTRadSysSurf(SurfNum) + + (DataHeatBalance::QRadThermInAbs(SurfNum) + DataHeatBalSurface::SurfNetLWRadToSurf(SurfNum) + DataHeatBalFanSys::QHTRadSysSurf(SurfNum) + DataHeatBalFanSys::QHWBaseboardSurf(SurfNum) + DataHeatBalFanSys::QSteamBaseboardSurf(SurfNum) + DataHeatBalFanSys::QElecBaseboardSurf(SurfNum)); // summation of all long-wavelenth radiation going to surface Real64 LWtotal = this->CurCoverLWRadFac * LWsum; // total flux from long-wavelength radiation to surface - Real64 SWtotal = this->CurCoverSWRadFac * DataHeatBalSurface::QRadSWInAbs(SurfNum); // total flux from short-wavelength radiation to surface + Real64 SWtotal = this->CurCoverSWRadFac * DataHeatBalSurface::SurfOpaqQRadSWInAbs(SurfNum); // total flux from short-wavelength radiation to surface this->RadConvertToConvect = - ((1.0 - this->CurCoverLWRadFac) * LWsum) + ((1.0 - this->CurCoverSWRadFac) * DataHeatBalSurface::QRadSWInAbs(SurfNum)); + ((1.0 - this->CurCoverLWRadFac) * LWsum) + ((1.0 - this->CurCoverSWRadFac) * DataHeatBalSurface::SurfOpaqQRadSWInAbs(SurfNum)); // Heat gain from people (assumed to be all convective to pool water) Real64 PeopleGain = diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index de193ae9437..01014f4b076 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -3491,7 +3491,7 @@ namespace WindowComplexManager { if (SunIsUp) { SurfWinSysSolTransmittance(SurfNum) = SurfWinTransSolar(SurfNum) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); - SurfWinSysSolAbsorptance(SurfNum) = (QRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / + SurfWinSysSolAbsorptance(SurfNum) = (SurfWinQRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolReflectance(SurfNum) = 1.0 - SurfWinSysSolTransmittance(SurfNum) - SurfWinSysSolAbsorptance(SurfNum); } else { @@ -3522,8 +3522,8 @@ namespace WindowComplexManager { SurfaceWindow(SurfNum).ThetaFace(2 * k) = theta(2 * k); // temperatures for reporting - FenLaySurfTempFront(k, SurfNum) = theta(2 * k - 1) - KelvinConv; - FenLaySurfTempBack(k, SurfNum) = theta(2 * k) - KelvinConv; + SurfWinFenLaySurfTempFront(k, SurfNum) = theta(2 * k - 1) - KelvinConv; + SurfWinFenLaySurfTempBack(k, SurfNum) = theta(2 * k) - KelvinConv; // thetas(k) = theta(k) } } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index e5525ce971e..4120140a3a4 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2082,7 +2082,7 @@ namespace WindowManager { using DataHeatBalSurface::QdotConvOutRepPerArea; using DataHeatBalSurface::QdotRadOutRep; using DataHeatBalSurface::QdotRadOutRepPerArea; - using DataHeatBalSurface::QRadLWOutSrdSurfs; + using DataHeatBalSurface::SurfQRadLWOutSrdSurfs; using DataHeatBalSurface::QRadOutReport; using DataLoopNode::Node; using DataZoneEquipment::ZoneEquipConfig; @@ -2703,7 +2703,7 @@ namespace WindowManager { Real64 const rad_out_sky_per_area = - emiss_sigma_product * AirSkyRadSplit(SurfNum) * surface.ViewFactorSkyIR * (Tsout_4 - pow_4(SkyTempKelvin)); Real64 const rad_out_per_area = rad_out_air_per_area + rad_out_sky_per_area + rad_out_ground_per_area + rad_out_lw_srd_per_area; - QRadLWOutSrdSurfs(SurfNum) = rad_out_lw_srd_per_area; + SurfQRadLWOutSrdSurfs(SurfNum) = rad_out_lw_srd_per_area; QdotRadOutRep(SurfNum) = surface.Area * rad_out_per_area; QdotRadOutRepPerArea(SurfNum) = rad_out_per_area; QRadOutReport(SurfNum) = QdotRadOutRep(SurfNum) * TimeStepZoneSec; @@ -3582,7 +3582,7 @@ namespace WindowManager { if (SunIsUp) { SurfWinSysSolTransmittance(SurfNum) = SurfWinTransSolar(SurfNum) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); - SurfWinSysSolAbsorptance(SurfNum) = (QRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / + SurfWinSysSolAbsorptance(SurfNum) = (SurfWinQRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolReflectance(SurfNum) = 1.0 - SurfWinSysSolTransmittance(SurfNum) - SurfWinSysSolAbsorptance(SurfNum); } else { diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index 487f670b062..461e3882e48 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -229,8 +229,8 @@ namespace WindowManager { SurfaceWindow(SurfNum).ThetaFace(2 * k) = dataWindowManager.thetas(2 * k); // temperatures for reporting - FenLaySurfTempFront(k, SurfNum) = dataWindowManager.thetas(2 * k - 1) - KelvinConv; - FenLaySurfTempBack(k, SurfNum) = dataWindowManager.thetas(2 * k) - KelvinConv; + SurfWinFenLaySurfTempFront(k, SurfNum) = dataWindowManager.thetas(2 * k - 1) - KelvinConv; + SurfWinFenLaySurfTempBack(k, SurfNum) = dataWindowManager.thetas(2 * k) - KelvinConv; } } diff --git a/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc b/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc index 1e08e1d2ecb..802fecba757 100644 --- a/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc @@ -75,7 +75,7 @@ TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_CalcNodeHeatFluxTest) SurfaceFD(SurfNum).TDT.allocate(numNodes + 1); SurfaceFD(SurfNum).CpDelXRhoS1.allocate(numNodes + 1); SurfaceFD(SurfNum).CpDelXRhoS2.allocate(numNodes + 1); - DataHeatBalSurface::OpaqSurfInsFaceConductionFlux.allocate(1); + DataHeatBalSurface::SurfOpaqInsFaceConductionFlux.allocate(1); DataGlobals::TimeStepZoneSec = 600.0; Real64 expectedResult1(0.0); @@ -85,41 +85,41 @@ TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_CalcNodeHeatFluxTest) Real64 expectedResult5(0.0); // Steady-state case - DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum) = 100.0; + DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum) = 100.0; nodeNum = 1; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 20.0; SurfaceFD(SurfNum).TDT(nodeNum) = 20.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 1000.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 2000.0; - expectedResult1 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult1 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); nodeNum = 2; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 22.0; SurfaceFD(SurfNum).TDT(nodeNum) = 22.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 1000.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 2000.0; - expectedResult2 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult2 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); nodeNum = 3; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 23.0; SurfaceFD(SurfNum).TDT(nodeNum) = 23.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 1000.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 2000.0; - expectedResult3 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult3 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); nodeNum = 4; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 26.0; SurfaceFD(SurfNum).TDT(nodeNum) = 26.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 1000.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 2000.0; - expectedResult4 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult4 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); nodeNum = 5; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 27.0; SurfaceFD(SurfNum).TDT(nodeNum) = 27.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 1000.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 2000.0; - expectedResult5 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult5 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); CalcNodeHeatFlux(SurfNum, numNodes); EXPECT_NEAR(SurfaceFD(SurfNum).QDreport(1), expectedResult1, 0.0001); @@ -138,14 +138,14 @@ TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_CalcNodeHeatFluxTest) // Unsteady-state case DataGlobals::TimeStepZoneSec = 600.0; - DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum) = -200.0; + DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum) = -200.0; nodeNum = 5; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 27.5; SurfaceFD(SurfNum).TDT(nodeNum) = 27.0; SurfaceFD(SurfNum).CpDelXRhoS1(nodeNum) = 0.0; SurfaceFD(SurfNum).CpDelXRhoS2(nodeNum) = 0.0; - expectedResult5 = DataHeatBalSurface::OpaqSurfInsFaceConductionFlux(SurfNum); + expectedResult5 = DataHeatBalSurface::SurfOpaqInsFaceConductionFlux(SurfNum); nodeNum = 4; SurfaceFD(SurfNum).TDpriortimestep(nodeNum) = 26.0; diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 7b53c8bd79b..080bcc075af 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1987,8 +1987,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_UpdateWindowFaceTempsNonBSDFWin) dataConstruction.Construct(2).TotLayers = SurfsForRegWindow; dataConstruction.Construct(3).TotLayers = 1; - FenLaySurfTempFront.dimension(10, DataSurfaces::TotSurfaces, 0.0); - FenLaySurfTempBack.dimension(10, DataSurfaces::TotSurfaces, 0.0); + SurfWinFenLaySurfTempFront.dimension(10, DataSurfaces::TotSurfaces, 0.0); + SurfWinFenLaySurfTempBack.dimension(10, DataSurfaces::TotSurfaces, 0.0); DataHeatBalSurface::TH.dimension(2, Construction::MaxCTFTerms, DataSurfaces::TotSurfaces, 0.0); DataHeatBalSurface::TH(1,1,1) = 21.0; @@ -2003,16 +2003,16 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_UpdateWindowFaceTempsNonBSDFWin) HeatBalanceManager::UpdateWindowFaceTempsNonBSDFWin(); // First surface is NOT a window so these should NOT be set - EXPECT_NEAR(FenLaySurfTempFront(1,1),ZeroResult,0.0001); - EXPECT_NEAR(FenLaySurfTempBack(1,1),ZeroResult,0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempFront(1,1),ZeroResult,0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempBack(1,1),ZeroResult,0.0001); // Second surface is a window so these should be set - EXPECT_NEAR(FenLaySurfTempFront(1,2),DataHeatBalSurface::TH(1,1,2),0.0001); - EXPECT_NEAR(FenLaySurfTempBack(SurfsForRegWindow,2),DataHeatBalSurface::TH(2,1,2),0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempFront(1,2),DataHeatBalSurface::TH(1,1,2),0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempBack(SurfsForRegWindow,2),DataHeatBalSurface::TH(2,1,2),0.0001); // Third surface is a window but is also a BSDF (complex window) so these should NOT be set - EXPECT_NEAR(FenLaySurfTempFront(1,3),ZeroResult,0.0001); - EXPECT_NEAR(FenLaySurfTempBack(1,3),ZeroResult,0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempFront(1,3),ZeroResult,0.0001); + EXPECT_NEAR(SurfWinFenLaySurfTempBack(1,3),ZeroResult,0.0001); } diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index eeedbb98e7f..109c583b7db 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -121,16 +121,16 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) DataHeatBalSurface::CTFConstOutPart.allocate(SurfNum); DataHeatBalSurface::CTFConstOutPart(SurfNum) = 1.0; - DataHeatBalSurface::QRadSWOutAbs.allocate(SurfNum); - DataHeatBalSurface::QRadSWOutAbs(SurfNum) = 1.0; + DataHeatBalSurface::SurfOpaqQRadSWOutAbs.allocate(SurfNum); + DataHeatBalSurface::SurfOpaqQRadSWOutAbs(SurfNum) = 1.0; DataHeatBalSurface::TempSurfIn.allocate(SurfNum); DataHeatBalSurface::TempSurfIn(SurfNum) = 1.0; - DataHeatBalSurface::QRadSWOutMvIns.allocate(SurfNum); - DataHeatBalSurface::QRadSWOutMvIns(SurfNum) = 1.0; - DataHeatBalSurface::QRadLWOutSrdSurfs.allocate(SurfNum); - DataHeatBalSurface::QRadLWOutSrdSurfs(SurfNum) = 1.0; - DataHeatBalSurface::QAdditionalHeatSourceOutside.allocate(SurfNum); - DataHeatBalSurface::QAdditionalHeatSourceOutside(SurfNum) = 0.0; + DataHeatBalSurface::SurfQRadSWOutMvIns.allocate(SurfNum); + DataHeatBalSurface::SurfQRadSWOutMvIns(SurfNum) = 1.0; + DataHeatBalSurface::SurfQRadLWOutSrdSurfs.allocate(SurfNum); + DataHeatBalSurface::SurfQRadLWOutSrdSurfs(SurfNum) = 1.0; + DataHeatBalSurface::SurfQAdditionalHeatSourceOutside.allocate(SurfNum); + DataHeatBalSurface::SurfQAdditionalHeatSourceOutside(SurfNum) = 0.0; DataHeatBalSurface::TH.allocate(2, 2, 1); DataSurfaces::Surface.allocate(SurfNum); @@ -1920,12 +1920,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) DataHeatBalSurface::HGrdExtSurf(1)); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::QRadLWOutSrdSurfs(1)); + EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::SurfQRadLWOutSrdSurfs(1)); EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * (0.3 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)) + 0.3 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv))), - DataHeatBalSurface::QRadLWOutSrdSurfs(2)); - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.5 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::QRadLWOutSrdSurfs(3)); - EXPECT_DOUBLE_EQ(0.0, DataHeatBalSurface::QRadLWOutSrdSurfs(4)); + DataHeatBalSurface::SurfQRadLWOutSrdSurfs(2)); + EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.9 * 0.5 * (pow_4(25.0 + KelvinConv) - pow_4(20.0 + KelvinConv)), DataHeatBalSurface::SurfQRadLWOutSrdSurfs(3)); + EXPECT_DOUBLE_EQ(0.0, DataHeatBalSurface::SurfQRadLWOutSrdSurfs(4)); } TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_SurfaceCOnstructionIndexTest) @@ -2462,10 +2462,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA // Test Additional Heat Source Calculation CalcHeatBalanceOutsideSurf(state.dataConvectionCoefficients, state.files); - EXPECT_EQ(-0.1, DataHeatBalSurface::QAdditionalHeatSourceOutside(1)); + EXPECT_EQ(-0.1, DataHeatBalSurface::SurfQAdditionalHeatSourceOutside(1)); CalcHeatBalanceInsideSurf(state); - EXPECT_EQ(0.1, DataHeatBalSurface::QAdditionalHeatSourceInside(6)); + EXPECT_EQ(0.1, DataHeatBalSurface::SurfQAdditionalHeatSourceInside(6)); DataZoneEquipment::ZoneEquipConfig.deallocate(); DataSizing::ZoneEqSizing.deallocate(); @@ -2570,10 +2570,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInterzoneRadFactorCalc) DataHeatBalance::Zone.allocate(DataGlobals::NumOfZones); DataSurfaces::Surface.allocate(DataSurfaces::TotSurfaces); dataConstruction.Construct.allocate(DataHeatBalance::TotConstructs); - DataHeatBalSurface::VMULT.allocate(DataGlobals::NumOfZones); + DataHeatBalSurface::ZoneVMULT.allocate(DataGlobals::NumOfZones); dataConstruction.Construct(1).TransDiff = 0.1; - DataHeatBalSurface::VMULT(1) = 1.0; - DataHeatBalSurface::VMULT(2) = 1.0; + DataHeatBalSurface::ZoneVMULT(1) = 1.0; + DataHeatBalSurface::ZoneVMULT(2) = 1.0; DataSurfaces::Surface(1).HeatTransSurf = true; DataSurfaces::Surface(1).Construction = 1; diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index fc09d79246b..99bbd91abe6 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -548,7 +548,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) DataHeatBalSurface::QdotRadOutRep.allocate(3); DataHeatBalSurface::QdotRadOutRepPerArea.allocate(3); DataHeatBalSurface::QRadOutReport.allocate(3); - DataHeatBalSurface::QRadLWOutSrdSurfs.allocate(3); + DataHeatBalSurface::SurfQRadLWOutSrdSurfs.allocate(3); DataHeatBalSurface::QAirExtReport.allocate(3); DataHeatBalSurface::QHeatEmiReport.allocate(3); @@ -2775,7 +2775,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) DataHeatBalSurface::QdotRadOutRep.allocate(3); DataHeatBalSurface::QdotRadOutRepPerArea.allocate(3); DataHeatBalSurface::QRadOutReport.allocate(3); - DataHeatBalSurface::QRadLWOutSrdSurfs.allocate(3); + DataHeatBalSurface::SurfQRadLWOutSrdSurfs.allocate(3); DataHeatBalSurface::QAirExtReport.allocate(3); DataHeatBalSurface::QHeatEmiReport.allocate(3); @@ -2799,7 +2799,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) WindowManager::CalcWindowHeatBalance(state.dataWindowComplexManager, state.dataWindowEquivalentLayer, state.dataWindowManager, surfNum2, DataHeatBalance::HConvIn(surfNum2), inSurfTemp, outSurfTemp); // Test if LWR from surrounding surfaces correctly calculated - EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(state.dataWindowManager.thetas(1))), DataHeatBalSurface::QRadLWOutSrdSurfs(surfNum2)); + EXPECT_DOUBLE_EQ(StefanBoltzmann * 0.84 * 0.6 * (pow_4(25.0 + KelvinConv) - pow_4(state.dataWindowManager.thetas(1))), DataHeatBalSurface::SurfQRadLWOutSrdSurfs(surfNum2)); EXPECT_NEAR(-24.9342, DataHeatBalSurface::QHeatEmiReport(surfNum2),3); } TEST_F(EnergyPlusFixture, WindowMaterialComplexShadeTest) From 147075ce8af540b989ba579236e241b039abed7e Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 3 Sep 2020 22:25:27 -0700 Subject: [PATCH 03/25] more surfwin --- src/EnergyPlus/DataHeatBalance.cc | 104 +++--- src/EnergyPlus/DataHeatBalance.hh | 36 +-- src/EnergyPlus/DataSurfaces.cc | 6 +- src/EnergyPlus/DaylightingDevices.cc | 12 +- src/EnergyPlus/EcoRoofManager.cc | 2 +- src/EnergyPlus/GeneralRoutines.cc | 4 +- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 4 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 2 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 4 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 295 +++++++++--------- src/EnergyPlus/InternalHeatGains.cc | 4 +- .../PhotovoltaicThermalCollectors.cc | 8 +- src/EnergyPlus/Photovoltaics.cc | 24 +- src/EnergyPlus/SolarCollectors.cc | 64 ++-- src/EnergyPlus/SolarShading.cc | 157 +++++----- src/EnergyPlus/SwimmingPool.cc | 2 +- src/EnergyPlus/TranspiredCollector.cc | 4 +- src/EnergyPlus/WindowComplexManager.cc | 12 +- src/EnergyPlus/WindowEquivalentLayer.cc | 6 +- src/EnergyPlus/WindowManager.cc | 14 +- .../WindowManagerExteriorThermal.cc | 4 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 4 +- tst/EnergyPlus/unit/ICSCollector.unit.cc | 6 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 24 +- 24 files changed, 400 insertions(+), 402 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 06b71e0e235..652d94b42b1 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -644,29 +644,26 @@ namespace DataHeatBalance { Array1D ZnOpqSurfExtFaceCondGnRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondGainRep [J] Array1D ZnOpqSurfExtFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] - - Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces - Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers - Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) - Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) - Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) - Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) - Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) - Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) - Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) - Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) - Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) - Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) - Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) - Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) - Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) - - - Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) - Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] - Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] + Array1D SurfQRadThermInAbs; // Thermal radiation absorbed on inside surfaces + Array1D SurfQRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) + Array1D SurfQRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) + Array1D SurfBmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) + Array1D SurfBmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) + Array1D SurfIntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) + Array1D SurfIntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) + Array1D SurfQRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) + Array1D SurfQRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) + Array1D SurfQRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) + Array1D SurfQRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) + Array1D SurfQRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) + Array1D SurfQRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) + Array1D SurfQRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) + Array1D SurfCosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) + + Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) + Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] + Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] + Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] @@ -678,10 +675,11 @@ namespace DataHeatBalance { Array1D SurfWinQRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] Array1D SurfWinSWwinAbsTotalReport; // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W) Array1D SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out through inside of window surface (W) + Array2D SurfWinQRadSWwinAbs; // Short wave radiation absorbed in window glass layers + Array2D SurfWinInitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) - Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions @@ -981,30 +979,7 @@ namespace DataHeatBalance { ZoneOpaqSurfExtFaceCond.deallocate(); ZoneOpaqSurfExtFaceCondGainRep.deallocate(); ZoneOpaqSurfExtFaceCondLossRep.deallocate(); - QRadThermInAbs.deallocate(); - QRadSWwinAbs.deallocate(); - InitialDifSolwinAbs.deallocate(); - QRadSWOutIncident.deallocate(); - QRadSWOutIncidentBeam.deallocate(); - BmIncInsSurfIntensRep.deallocate(); - BmIncInsSurfAmountRep.deallocate(); - IntBmIncInsSurfIntensRep.deallocate(); - IntBmIncInsSurfAmountRep.deallocate(); - QRadSWOutIncidentSkyDiffuse.deallocate(); - QRadSWOutIncidentGndDiffuse.deallocate(); - QRadSWOutIncBmToDiffReflGnd.deallocate(); - QRadSWOutIncSkyDiffReflGnd.deallocate(); - QRadSWOutIncBmToBmReflObs.deallocate(); - QRadSWOutIncBmToDiffReflObs.deallocate(); - QRadSWOutIncSkyDiffReflObs.deallocate(); - CosIncidenceAngle.deallocate(); - SurfWinBSDFBeamDirectionRep.deallocate(); - SurfWinBSDFBeamThetaRep.deallocate(); - SurfWinBSDFBeamPhiRep.deallocate(); - SurfWinQRadSWwinAbsTot.deallocate(); - SurfWinQRadSWwinAbsLayer.deallocate(); - SurfWinFenLaySurfTempFront.deallocate(); - SurfWinFenLaySurfTempBack.deallocate(); + ZoneTransSolarEnergy.deallocate(); ZoneWinHeatGainRepEnergy.deallocate(); ZoneWinHeatLossRepEnergy.deallocate(); @@ -1016,15 +991,44 @@ namespace DataHeatBalance { ZnOpqSurfInsFaceCondLsRepEnrg.deallocate(); ZnOpqSurfExtFaceCondGnRepEnrg.deallocate(); ZnOpqSurfExtFaceCondLsRepEnrg.deallocate(); + + SurfQRadThermInAbs.deallocate(); + SurfQRadSWOutIncident.deallocate(); + SurfQRadSWOutIncidentBeam.deallocate(); + SurfBmIncInsSurfIntensRep.deallocate(); + SurfBmIncInsSurfAmountRep.deallocate(); + SurfIntBmIncInsSurfIntensRep.deallocate(); + SurfIntBmIncInsSurfAmountRep.deallocate(); SurfBmIncInsSurfAmountRepEnergy.deallocate(); SurfIntBmIncInsSurfAmountRepEnergy.deallocate(); + SurfInitialDifSolInAbsReport.deallocate(); + SurfSWInAbsTotalReport.deallocate(); + + SurfQRadSWOutIncidentSkyDiffuse.deallocate(); + SurfQRadSWOutIncidentGndDiffuse.deallocate(); + SurfQRadSWOutIncBmToDiffReflGnd.deallocate(); + SurfQRadSWOutIncSkyDiffReflGnd.deallocate(); + SurfQRadSWOutIncBmToBmReflObs.deallocate(); + SurfQRadSWOutIncBmToDiffReflObs.deallocate(); + SurfQRadSWOutIncSkyDiffReflObs.deallocate(); + SurfCosIncidenceAngle.deallocate(); + + SurfWinBSDFBeamDirectionRep.deallocate(); + SurfWinBSDFBeamThetaRep.deallocate(); + SurfWinBSDFBeamPhiRep.deallocate(); + SurfWinQRadSWwinAbsTot.deallocate(); + SurfWinQRadSWwinAbsLayer.deallocate(); + SurfWinFenLaySurfTempFront.deallocate(); + SurfWinFenLaySurfTempBack.deallocate(); + SurfWinQRadSWwinAbs.deallocate(); + SurfWinInitialDifSolwinAbs.deallocate(); SurfWinQRadSWwinAbsTotEnergy.deallocate(); SurfWinSWwinAbsTotalReport.deallocate(); - SurfInitialDifSolInAbsReport.deallocate(); SurfWinInitialDifSolInTransReport.deallocate(); - SurfSWInAbsTotalReport.deallocate(); + SurfOpaqSWOutAbsTotalReport.deallocate(); SurfOpaqSWOutAbsEnergyReport.deallocate(); + NominalR.deallocate(); NominalRforNominalUCalculation.deallocate(); NominalU.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index aee79777be8..4dbfe32cf88 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -491,27 +491,26 @@ namespace DataHeatBalance { extern Array1D ZnOpqSurfExtFaceCondGnRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondGainRep [J] extern Array1D ZnOpqSurfExtFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] - extern Array1D QRadThermInAbs; // Thermal radiation absorbed on inside surfaces - extern Array2D QRadSWwinAbs; // Short wave radiation absorbed in window glass layers - extern Array2D InitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) - extern Array1D QRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) - extern Array1D BmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) - extern Array1D BmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) - extern Array1D IntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) - extern Array1D IntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) - extern Array1D QRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) - extern Array1D QRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) - extern Array1D QRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) - extern Array1D QRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) - extern Array1D QRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) - extern Array1D QRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) - extern Array1D CosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) + extern Array1D SurfQRadThermInAbs; // Thermal radiation absorbed on inside surfaces + extern Array1D SurfQRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) + extern Array1D SurfQRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) + extern Array1D SurfBmIncInsSurfIntensRep; // Beam sol irrad from ext wins on inside of surface (W/m2) + extern Array1D SurfBmIncInsSurfAmountRep; // Beam sol amount from ext wins incident on inside of surface (W) + extern Array1D SurfIntBmIncInsSurfIntensRep; // Beam sol irrad from int wins on inside of surface (W/m2) + extern Array1D SurfIntBmIncInsSurfAmountRep; // Beam sol amount from int wins incident on inside of surface (W) + extern Array1D SurfQRadSWOutIncidentSkyDiffuse; // Exterior sky diffuse solar incident on surface (W/m2) + extern Array1D SurfQRadSWOutIncidentGndDiffuse; // Exterior ground diffuse solar incident on surface (W/m2) + extern Array1D SurfQRadSWOutIncBmToDiffReflGnd; // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2) + extern Array1D SurfQRadSWOutIncSkyDiffReflGnd; // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2) + extern Array1D SurfQRadSWOutIncBmToBmReflObs; // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2) + extern Array1D SurfQRadSWOutIncBmToDiffReflObs; // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2) + extern Array1D SurfQRadSWOutIncSkyDiffReflObs; // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2) + extern Array1D SurfCosIncidenceAngle; // Cosine of beam solar incidence angle (for reporting) extern Array1D SurfSWInAbsTotalReport; // Report - Total interior/exterior shortwave absorbed on inside of surface (W) extern Array1D SurfBmIncInsSurfAmountRepEnergy; // energy of BmIncInsSurfAmountRep [J] extern Array1D SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J] + extern Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) extern Array1D_int SurfWinBSDFBeamDirectionRep; // BSDF beam direction number for given complex fenestration state (for reporting) [] extern Array1D SurfWinBSDFBeamThetaRep; // BSDF beam Theta angle (for reporting) [rad] @@ -523,10 +522,11 @@ namespace DataHeatBalance { extern Array1D SurfWinQRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] extern Array1D SurfWinSWwinAbsTotalReport; // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W) extern Array1D SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out through inside of window surface (W) + extern Array2D SurfWinQRadSWwinAbs; // Short wave radiation absorbed in window glass layers + extern Array2D SurfWinInitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) extern Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) extern Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) - extern Array1D SurfInitialDifSolInAbsReport; // Report - Initial transmitted diffuse solar absorbed on inside of surface (W) extern Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 85b980e1621..8533d88182a 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -981,7 +981,7 @@ namespace DataSurfaces { // PURPOSE OF THIS SUBROUTINE: // Return total short wave incident to the surface - return QRadSWOutIncident(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); + return SurfQRadSWOutIncident(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); } Real64 SurfaceData::getSWBeamIncident(const int t_SurfNum) @@ -995,7 +995,7 @@ namespace DataSurfaces { // PURPOSE OF THIS SUBROUTINE: // Return total short wave incident from outside beam - return QRadSWOutIncidentBeam(t_SurfNum); + return SurfQRadSWOutIncidentBeam(t_SurfNum); } Real64 SurfaceData::getSWDiffuseIncident(const int t_SurfNum) @@ -1009,7 +1009,7 @@ namespace DataSurfaces { // PURPOSE OF THIS SUBROUTINE: // Return total short wave diffuse incident to the surface - return QRadSWOutIncidentSkyDiffuse(t_SurfNum) + QRadSWOutIncidentGndDiffuse(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); + return SurfQRadSWOutIncidentSkyDiffuse(t_SurfNum) + SurfQRadSWOutIncidentGndDiffuse(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); } int SurfaceData::getTotLayers() const diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index d84b6da28d0..94382d7abdb 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1457,8 +1457,8 @@ namespace DaylightingDevices { // REFERENCES: na // Using/Aliasing - using DataHeatBalance::QRadSWOutIncident; - using DataHeatBalance::QRadSWwinAbs; + using DataHeatBalance::SurfQRadSWOutIncident; + using DataHeatBalance::SurfWinQRadSWwinAbs; using DataHeatBalance::SurfWinQRadSWwinAbsTot; using DataHeatBalance::QS; using DataSurfaces::SurfWinTransSolar; @@ -1482,15 +1482,15 @@ namespace DaylightingDevices { // Calculate diffuse solar reflected back up the pipe by the inside surface of the TDD:DIFFUSER // All solar arriving at the diffuser is assumed to be isotropically diffuse by this point - QRefl = (QRadSWOutIncident(DiffSurf) - SurfWinQRadSWwinAbsTot(DiffSurf)) * Surface(DiffSurf).Area - SurfWinTransSolar(DiffSurf); + QRefl = (SurfQRadSWOutIncident(DiffSurf) - SurfWinQRadSWwinAbsTot(DiffSurf)) * Surface(DiffSurf).Area - SurfWinTransSolar(DiffSurf); // Add diffuse interior shortwave reflected from zone surfaces and from zone sources, lights, etc. QRefl += QS(Surface(DiffSurf).SolarEnclIndex) * Surface(DiffSurf).Area * transDiff; - TotTDDPipeGain = SurfWinTransSolar(TDDPipe(PipeNum).Dome) - QRadSWOutIncident(DiffSurf) * Surface(DiffSurf).Area + + TotTDDPipeGain = SurfWinTransSolar(TDDPipe(PipeNum).Dome) - SurfQRadSWOutIncident(DiffSurf) * Surface(DiffSurf).Area + QRefl * (1.0 - TDDPipe(PipeNum).TransSolIso / transDiff) + - QRadSWwinAbs(1, TDDPipe(PipeNum).Dome) * Surface(DiffSurf).Area / 2.0 + - QRadSWwinAbs(1, DiffSurf) * Surface(DiffSurf).Area / 2.0; // Solar entering pipe | Solar exiting pipe | Absorbed due to + SurfWinQRadSWwinAbs(1, TDDPipe(PipeNum).Dome) * Surface(DiffSurf).Area / 2.0 + + SurfWinQRadSWwinAbs(1, DiffSurf) * Surface(DiffSurf).Area / 2.0; // Solar entering pipe | Solar exiting pipe | Absorbed due to // reflections on the way out | Inward absorbed solar from dome // glass | Inward absorbed solar from diffuser glass diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index 81aa7999414..b932bbe3b3b 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -455,7 +455,7 @@ namespace EcoRoofManager { if (dataConstruction.Construct(ConstrNum).CTFCross(0) > 0.01) { QuickConductionSurf = true; F1temp = dataConstruction.Construct(ConstrNum).CTFCross(0) / (dataConstruction.Construct(ConstrNum).CTFInside(0) + HConvIn(SurfNum)); - Qsoilpart1 = -CTFConstOutPart(SurfNum) + F1temp * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + Qsoilpart1 = -CTFConstOutPart(SurfNum) + F1temp * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + dataConstruction.Construct(ConstrNum).CTFSourceIn(0) * QsrcHist(SurfNum, 1) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum)); } else { diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 508ec730b4b..2f8e31308ba 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -1039,7 +1039,7 @@ void CalcPassiveExteriorBaffleGap(ConvectionCoefficientsData &dataConvectionCoef // USE DataLoopNode , ONLY: Node using ConvectionCoefficients::InitExteriorConvectionCoeff; using DataGlobals::BeginEnvrnFlag; - using DataHeatBalance::QRadSWOutIncident; + using DataHeatBalance::SurfQRadSWOutIncident; using DataHeatBalSurface::TH; using DataSurfaces::Surface; using DataSurfaces::SurfaceData; @@ -1217,7 +1217,7 @@ void CalcPassiveExteriorBaffleGap(ConvectionCoefficientsData &dataConvectionCoef // Tso = sum( TH( 1, 1, SurfPtrARR ) * Surface( SurfPtrARR ).Area ) / A; //Autodesk:F2C++ Array subscript usage: Replaced by below Tso = sum_product_sub(TH(1, 1, _), Surface, &SurfaceData::Area, SurfPtrARR) / A; // Autodesk:F2C++ Functions handle array subscript usage // Isc = sum( QRadSWOutIncident( SurfPtrARR ) * Surface( SurfPtrARR ).Area ) / A; //Autodesk:F2C++ Array subscript usage: Replaced by below - Isc = sum_product_sub(QRadSWOutIncident, Surface, &SurfaceData::Area, SurfPtrARR) / A; // Autodesk:F2C++ Functions handle array subscript usage + Isc = sum_product_sub(SurfQRadSWOutIncident, Surface, &SurfaceData::Area, SurfPtrARR) / A; // Autodesk:F2C++ Functions handle array subscript usage TmeanK = 0.5 * (TmpTsBaf + Tso) + KelvinConv; diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index c6d562f0d4e..4bcdf4ce9b7 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -110,7 +110,7 @@ namespace HeatBalFiniteDiffManager { using DataEnvironment::IsRain; using DataEnvironment::SkyTemp; using DataHeatBalance::Air; - using DataHeatBalance::QRadThermInAbs; + using DataHeatBalance::SurfQRadThermInAbs; using DataHeatBalance::RegularMaterial; using DataHeatBalance::TotConstructs; using DataHeatBalance::TotMaterials; @@ -2105,7 +2105,7 @@ namespace HeatBalFiniteDiffManager { QElecBaseboardSurf(Surf)); // Current radiant heat flux at a surface due to the presence of electric baseboard heaters Real64 const QCoolingPanelSurfFD( QCoolingPanelSurf(Surf)); // Current radiant heat flux at a surface due to the presence of simple cooling panels - Real64 const QRadThermInFD(QRadThermInAbs(Surf)); // Thermal radiation absorbed on inside surfaces + Real64 const QRadThermInFD(SurfQRadThermInAbs(Surf)); // Thermal radiation absorbed on inside surfaces // Boundary Conditions from Simulation for Interior Real64 hconvi(HConvInFD(Surf)); diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index 8b3ead8d1f0..e460f1942da 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -1219,7 +1219,7 @@ namespace HeatBalanceHAMTManager { cells(Intcell(sid)).Qadds = Surface(sid).Area * (SurfOpaqQRadSWInAbs(sid) + SurfNetLWRadToSurf(sid) + QHTRadSysSurf(sid) + QCoolingPanelSurf(sid) + QHWBaseboardSurf(sid) + - QSteamBaseboardSurf(sid) + QElecBaseboardSurf(sid) + QRadThermInAbs(sid) + SurfQAdditionalHeatSourceInside(sid)); + QSteamBaseboardSurf(sid) + QElecBaseboardSurf(sid) + SurfQRadThermInAbs(sid) + SurfQAdditionalHeatSourceInside(sid)); // Check, Is this per unit area or for the whole wall. // cells(Intcell(sid))%Qadds=QRadSWInAbs(sid)+NetLWRadToSurf(sid)+QHtRadSysSurf(sid)+QRadThermInAbs(sid) diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index f1b83cc63a2..bacb75cac9f 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -371,7 +371,7 @@ namespace HeatBalanceKivaManager { bcs->skyEmissivity = pow4(DataEnvironment::SkyTempKelvin) / pow4(bcs->outdoorTemp); bcs->slabAbsRadiation = DataHeatBalSurface::SurfOpaqQRadSWInAbs(floorSurface) + // solar - DataHeatBalance::QRadThermInAbs(floorSurface) + // internal gains + DataHeatBalance::SurfQRadThermInAbs(floorSurface) + // internal gains DataHeatBalFanSys::QHTRadSysSurf(floorSurface) + DataHeatBalFanSys::QHWBaseboardSurf(floorSurface) + DataHeatBalFanSys::QCoolingPanelSurf(floorSurface) + DataHeatBalFanSys::QSteamBaseboardSurf(floorSurface) + DataHeatBalFanSys::QElecBaseboardSurf(floorSurface); // HVAC @@ -390,7 +390,7 @@ namespace HeatBalanceKivaManager { Real64 TAConvTotal = 0.0; for (auto &wl : wallSurfaces) { Real64 Q = DataHeatBalSurface::SurfOpaqQRadSWInAbs(wl) + // solar - DataHeatBalance::QRadThermInAbs(wl) + // internal gains + DataHeatBalance::SurfQRadThermInAbs(wl) + // internal gains DataHeatBalFanSys::QHTRadSysSurf(wl) + DataHeatBalFanSys::QHWBaseboardSurf(floorSurface) + DataHeatBalFanSys::QCoolingPanelSurf(wl) + DataHeatBalFanSys::QSteamBaseboardSurf(floorSurface) + DataHeatBalFanSys::QElecBaseboardSurf(wl); // HVAC diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 3758a1f8d9a..68dbbce0865 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -1442,10 +1442,10 @@ namespace HeatBalanceSurfaceManager { RefAirTemp.dimension(TotSurfaces, 0.0); SurfQRadLWOutSrdSurfs.dimension(TotSurfaces, 0.0); - QRadSWwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL + 1, TotSurfaces, 0.0); - InitialDifSolwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL, TotSurfaces, 0.0); + SurfWinQRadSWwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL + 1, TotSurfaces, 0.0); + SurfWinInitialDifSolwinAbs.dimension(DataWindowEquivalentLayer::CFSMAXNL, TotSurfaces, 0.0); SurfQRadSWOutMvIns.dimension(TotSurfaces, 0.0); - QRadThermInAbs.dimension(TotSurfaces, 0.0); + SurfQRadThermInAbs.dimension(TotSurfaces, 0.0); SurfQAdditionalHeatSourceOutside.dimension(TotSurfaces, 0.0); SurfQAdditionalHeatSourceInside.dimension(TotSurfaces, 0.0); SUMH.dimension(TotSurfaces, 0); @@ -2424,38 +2424,30 @@ namespace HeatBalanceSurfaceManager { for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - - - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; SurfInitialDifSolInAbsReport(SurfNum) = 0.0; - SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; SurfSWInAbsTotalReport(SurfNum) = 0.0; - SurfOpaqSWOutAbsTotalReport(SurfNum) = 0.0; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = 0.0; - - BmIncInsSurfIntensRep(SurfNum) = 0.0; - BmIncInsSurfAmountRep(SurfNum) = 0.0; - IntBmIncInsSurfIntensRep(SurfNum) = 0.0; - IntBmIncInsSurfAmountRep(SurfNum) = 0.0; - - QRadSWOutIncident(SurfNum) = 0.0; - QRadSWOutIncidentBeam(SurfNum) = 0.0; - QRadSWOutIncidentSkyDiffuse(SurfNum) = 0.0; - QRadSWOutIncidentGndDiffuse(SurfNum) = 0.0; - - QRadSWOutIncBmToDiffReflGnd(SurfNum) = 0.0; - QRadSWOutIncSkyDiffReflGnd(SurfNum) = 0.0; - QRadSWOutIncBmToBmReflObs(SurfNum) = 0.0; - QRadSWOutIncBmToDiffReflObs(SurfNum) = 0.0; - QRadSWOutIncSkyDiffReflObs(SurfNum) = 0.0; - CosIncidenceAngle(SurfNum) = 0.0; - - BmIncInsSurfIntensRep(SurfNum) = 0.0; - BmIncInsSurfAmountRep(SurfNum) = 0.0; - IntBmIncInsSurfIntensRep(SurfNum) = 0.0; - IntBmIncInsSurfAmountRep(SurfNum) = 0.0; - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = 0.0; + + SurfBmIncInsSurfIntensRep(SurfNum) = 0.0; + SurfBmIncInsSurfAmountRep(SurfNum) = 0.0; + SurfIntBmIncInsSurfIntensRep(SurfNum) = 0.0; + SurfIntBmIncInsSurfAmountRep(SurfNum) = 0.0; + + SurfQRadSWOutIncident(SurfNum) = 0.0; + SurfQRadSWOutIncidentBeam(SurfNum) = 0.0; + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = 0.0; + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = 0.0; + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = 0.0; + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = 0.0; + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = 0.0; + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = 0.0; + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = 0.0; + SurfCosIncidenceAngle(SurfNum) = 0.0; + + SurfBmIncInsSurfIntensRep(SurfNum) = 0.0; + SurfBmIncInsSurfAmountRep(SurfNum) = 0.0; + SurfIntBmIncInsSurfIntensRep(SurfNum) = 0.0; + SurfIntBmIncInsSurfAmountRep(SurfNum) = 0.0; SurfBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = 0.0; @@ -2464,23 +2456,6 @@ namespace HeatBalanceSurfaceManager { } - for (int Lay = 1; Lay <= DataHeatBalance::MaxSolidWinLayers; Lay++) { - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = 0.0; - } - } - for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - QRadSWwinAbs(Lay, SurfNum) = 0.0; - } - } - - for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL; Lay++) { - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - InitialDifSolwinAbs(Lay, SurfNum) = 0.0; - } - } - for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { InitialZoneDifSolReflW(zoneNum) = 0.0; ZoneWinHeatGainRepEnergy(zoneNum) = 0.0; @@ -2502,17 +2477,18 @@ namespace HeatBalanceSurfaceManager { int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; - if (firstSurfOpaq >= 0) { - for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { - SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = 0.0; - SurfOpaqInsFaceCondGainRep(SurfNum) = 0.0; - SurfOpaqInsFaceCondLossRep(SurfNum) = 0.0; - SurfOpaqQRadSWOutAbs(SurfNum) = 0.0; - SurfOpaqQRadSWInAbs(SurfNum) = 0.0; - SurfOpaqQRadSWLightsInAbs(SurfNum) = 0.0; - SurfOpaqInitialDifSolInAbs(SurfNum) = 0.0; - } // end of Zone Surf - } + if (firstSurfOpaq == -1) continue; + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = 0.0; + SurfOpaqInsFaceCondGainRep(SurfNum) = 0.0; + SurfOpaqInsFaceCondLossRep(SurfNum) = 0.0; + SurfOpaqQRadSWOutAbs(SurfNum) = 0.0; + SurfOpaqQRadSWInAbs(SurfNum) = 0.0; + SurfOpaqQRadSWLightsInAbs(SurfNum) = 0.0; + SurfOpaqInitialDifSolInAbs(SurfNum) = 0.0; + SurfOpaqSWOutAbsTotalReport(SurfNum) = 0.0; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = 0.0; + } // end of ZoneSurf int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; @@ -2594,15 +2570,33 @@ namespace HeatBalanceSurfaceManager { SurfWinBSDFBeamThetaRep(SurfNum) = 0.0; SurfWinBSDFBeamPhiRep(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = 0.0; + SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; SurfWinInitialDifSolInTrans(SurfNum) = 0.0; + SurfWinInitialDifSolInTransReport(SurfNum) = 0.0; + + } + + for (int Lay = 1; Lay <= DataHeatBalance::MaxSolidWinLayers; Lay++) { + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = 0.0; + } + } + for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = 0.0; + } + } + for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL; Lay++) { + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { + SurfWinInitialDifSolwinAbs(Lay, SurfNum) = 0.0; + } } } if (!SunIsUp || (BeamSolarRad + GndSolarRad + DifSolarRad <= 0.0)) { // Sun is down - - // unused QBV = 0.0 - for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { ZoneQD(zoneNum) = 0.0; ZoneQDforDaylight(zoneNum) = 0.0; @@ -2653,26 +2647,29 @@ namespace HeatBalanceSurfaceManager { } if (CalcSolRefl) { - BmToBmReflFacObs = 0.0; - BmToDiffReflFacObs = 0.0; - BmToDiffReflFacGnd = 0.0; + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + BmToBmReflFacObs(SurfNum) = 0.0; + BmToDiffReflFacObs(SurfNum) = 0.0; + BmToDiffReflFacGnd(SurfNum) = 0.0; + } } } else { // Sun is up, calculate solar quantities assert(equal_dimensions(ReflFacBmToBmSolObs, ReflFacBmToDiffSolObs)); // For linear indexing assert(equal_dimensions(ReflFacBmToBmSolObs, ReflFacBmToDiffSolGnd)); // For linear indexing - Array2D::size_type lSH(CalcSolRefl ? ReflFacBmToBmSolObs.index(HourOfDay, 1) : 0u); - Array2D::size_type lSP(CalcSolRefl ? ReflFacBmToBmSolObs.index(PreviousHour, 1) : 0u); for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { SurfSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); SurfGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround; - // For Complex Fenestrations: SurfWinSkyGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); SurfWinBmGndSolarInc(SurfNum) = 0.0; - if (CalcSolRefl) { // Tuned Linear indexing // [ lSH ] == ( HourOfDay, SurfNum ) // [ lSP ] == ( PreviousHour, SurfNum ) - - // For Complex Fenestrations: + } + if (CalcSolRefl) { + // For Complex Fenestrations: + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + Array1D::size_type lSH = ReflFacBmToBmSolObs.index(HourOfDay, 1) + SurfNum - 1; + Array1D::size_type lSP = ReflFacBmToBmSolObs.index(PreviousHour, 1) + SurfNum - 1; + // [ lSH ] == ( HourOfDay, SurfNum ) // [ lSP ] == ( PreviousHour, SurfNum ) SurfWinSkyGndSolarInc(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); SurfWinBmGndSolarInc(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); BmToBmReflFacObs(SurfNum) = WeightNow * ReflFacBmToBmSolObs[lSH] + WeightPreviousHour * ReflFacBmToBmSolObs[lSP]; @@ -2685,8 +2682,6 @@ namespace HeatBalanceSurfaceManager { SurfGndSolarInc(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum) + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - ++lSH; - ++lSP; } } @@ -2836,51 +2831,51 @@ namespace HeatBalanceSurfaceManager { } // Cosine of incidence angle and solar incident on outside of surface, for reporting - CosIncidenceAngle(SurfNum) = CosInc; + SurfCosIncidenceAngle(SurfNum) = CosInc; // Report variables for various incident solar quantities // Incident direct (unreflected) beam - QRadSWOutIncidentBeam(SurfNum) = BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 + SurfQRadSWOutIncidentBeam(SurfNum) = BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - QRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; } else { - QRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); } // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - QRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; // Incident diffuse solar from beam-to-diffuse reflection from ground if (CalcSolRefl) { - QRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); } else { - QRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; } // Incident diffuse solar from sky diffuse reflection from ground if (CalcSolRefl) { - QRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); } else { - QRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; } // 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); + SurfQRadSWOutIncident(SurfNum) = SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); if (CalcSolRefl) { // Incident beam solar from beam-to-beam (specular) reflection from obstructions - QRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; // Incident diffuse solar from beam-to-diffuse reflection from obstructions - QRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; // Incident diffuse solar from sky diffuse reflection from obstructions - QRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); // TH2 CR 9056: Add reflections from obstructions to the total incident - QRadSWOutIncident(SurfNum) += - QRadSWOutIncBmToBmReflObs(SurfNum) + QRadSWOutIncBmToDiffReflObs(SurfNum) + QRadSWOutIncSkyDiffReflObs(SurfNum); + SurfQRadSWOutIncident(SurfNum) += + SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); } if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above @@ -2970,7 +2965,7 @@ namespace HeatBalanceSurfaceManager { SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; for (Lay = 1; Lay <= TotGlassLay; ++Lay) { - QRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; // AWinSurf is from InteriorSolarDistribution if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { @@ -2981,7 +2976,7 @@ namespace HeatBalanceSurfaceManager { SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); - QRadSWwinAbs(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) = SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + AWinSurf(Lay, SurfNum) * BeamSolar; @@ -2989,7 +2984,7 @@ namespace HeatBalanceSurfaceManager { } // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); @@ -3015,20 +3010,20 @@ namespace HeatBalanceSurfaceManager { if (SurfSolAbs != 0) { AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue(FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); // ABWin(Lay) = AWinSurf(SurfNum,Lay) - QRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); } 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(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) = SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + AWinSurf(Lay, SurfNum) * BeamSolar + AWinCFOverlap(Lay, SurfNum) * BeamSolar; } // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); @@ -3048,11 +3043,11 @@ namespace HeatBalanceSurfaceManager { // (3) diffuse short wave incident on the inside face of the fenestration. The short wave internal sources // include light, ... AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL(Lay); - QRadSWwinAbs(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); @@ -3072,10 +3067,10 @@ namespace HeatBalanceSurfaceManager { Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, ScatteringSimple::Diffuse, Theta, Phi); - QRadSWwinAbs(Lay, SurfNum) = AbWinDiff * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbWinDiff * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total solar absorbed in all glass layers (W), for reporting SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); @@ -3450,10 +3445,10 @@ namespace HeatBalanceSurfaceManager { //!!! Following may need to be removed or changed when shelves are considered in adjacent reflection calculations if (Surface(SurfNum).Class == SurfaceClass_Shading) continue; int const enclosureNum = Surface(SurfNum).SolarEnclIndex; - IntBmIncInsSurfIntensRep(SurfNum) = + SurfIntBmIncInsSurfIntensRep(SurfNum) = ZoneBmSolFrIntWinsRep(enclosureNum) / DataViewFactorInformation::ZoneSolarInfo(enclosureNum).TotalSurfArea; - IntBmIncInsSurfAmountRep(SurfNum) = IntBmIncInsSurfIntensRep(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); - SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = IntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfIntBmIncInsSurfAmountRep(SurfNum) = SurfIntBmIncInsSurfIntensRep(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); + SurfIntBmIncInsSurfAmountRepEnergy(SurfNum) = SurfIntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; // IntDifIncInsSurfIntensRep(SurfNum) = ZoneDifSolFrIntWinsRep(ZoneNum)/Zone(ZoneNum)%TotalSurfArea // IntDifIncInsSurfAmountRep(SurfNum) = IntDifIncInsSurfIntensRep(SurfNum) * & // (Surface(SurfNum)%Area + SurfaceWindow(SurfNum)%DividerArea) @@ -3553,7 +3548,7 @@ namespace HeatBalanceSurfaceManager { // These calculations are repeated from InitInternalHeatGains for the Zone Component Loads Report pulseMultipler = 0.01; // the W/sqft pulse for the zone if (!doLoadComponentPulseNow) { - QRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); } else { curQL = QL(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion @@ -3563,12 +3558,12 @@ namespace HeatBalanceSurfaceManager { // ITABSF is the Inside Thermal Absorptance // TMULT is a multiplier for each zone/enclosure // QRadThermInAbs is the thermal radiation absorbed on inside surfaces - QRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); } if (ShadeFlag <= 0) { // No window shading for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += + SurfWinQRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * dataConstruction.Construct(ConstrNum).AbsDiffBack(IGlass); } } else if (ConstrNumSh != 0 && (ShadeFlag == IntShadeOn || ShadeFlag >= 3)) { @@ -3576,14 +3571,14 @@ namespace HeatBalanceSurfaceManager { for (IGlass = 1; IGlass <= dataConstruction.Construct(ConstrNumSh).TotGlassLayers; ++IGlass) { if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) - QRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * + SurfWinQRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * dataConstruction.Construct(ConstrNumSh).AbsDiffBack( IGlass); if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn) { BlAbsDiffBk = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).BlAbsDiffBack(_, IGlass)); - QRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * BlAbsDiffBk; + SurfWinQRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * BlAbsDiffBk; } } BlNum = SurfWinBlindNumber(SurfNum); @@ -3613,7 +3608,7 @@ namespace HeatBalanceSurfaceManager { } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * + SurfWinQRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * InterpSw(SurfWinSwitchingFactor(SurfNum), dataConstruction.Construct(ConstrNum).AbsDiffBack( IGlass), dataConstruction.Construct( @@ -3675,7 +3670,7 @@ namespace HeatBalanceSurfaceManager { // These calculations are repeated from InitInternalHeatGains for the Zone Component Loads Report pulseMultipler = 0.01; // the W/sqft pulse for the zone if (!doLoadComponentPulseNow) { - QRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); } else { curQL = QL(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion @@ -3685,12 +3680,12 @@ namespace HeatBalanceSurfaceManager { // ITABSF is the Inside Thermal Absorptance // TMULT is a multiplier for each zone/radiant enclosure // QRadThermInAbs is the thermal radiation absorbed on inside surfaces - QRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); } // Radiations absorbed by the window layers coming from zone side EQLNum = dataConstruction.Construct(ConstrNum).EQLConsPtr; for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { - QRadSWwinAbs(Lay, SurfNum) += + SurfWinQRadSWwinAbs(Lay, SurfNum) += QS(solEnclosureNum) * dataConstruction.Construct(ConstrNum).AbsDiffBackEQL(Lay); } // Window frame has not been included for equivalent layer model yet @@ -3707,8 +3702,8 @@ namespace HeatBalanceSurfaceManager { if (SurfWinWindowModelType(SurfNumAdjZone) != WindowEQLModel) { for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNumAdjZone) += QS(solEnclosureNum) * - dataConstruction.Construct( + SurfWinQRadSWwinAbs(IGlass, SurfNumAdjZone) += QS(solEnclosureNum) * + dataConstruction.Construct( Surface(SurfNumAdjZone).Construction).AbsDiff( IGlass); // Note that AbsDiff rather than AbsDiffBack is used in the above since the @@ -3719,7 +3714,7 @@ namespace HeatBalanceSurfaceManager { ConstrNum = Surface(SurfNumAdjZone).Construction; EQLNum = dataConstruction.Construct(ConstrNum).EQLConsPtr; for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { - QRadSWwinAbs(Lay, SurfNumAdjZone) += QS(solEnclosureNum) * dataConstruction.Construct( + SurfWinQRadSWwinAbs(Lay, SurfNumAdjZone) += QS(solEnclosureNum) * dataConstruction.Construct( ConstrNum).AbsDiffFrontEQL(Lay); // Note that AbsDiffFrontEQL rather than AbsDiffBackEQL is used in the above // since the radiation from the current zone is incident on the outside of the @@ -3739,12 +3734,12 @@ namespace HeatBalanceSurfaceManager { ShadeFlag = SurfWinShadingFlag(SurfNum); if (ShadeFlag <= 0) { // No window shading for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum); + SurfWinQRadSWwinAbs(IGlass, SurfNum) += SurfWinInitialDifSolwinAbs(IGlass, SurfNum); } } else if (ShadeFlag == IntShadeOn || ShadeFlag >= 3) { // Interior, exterior or between-glass shade, screen or blind in place for (IGlass = 1; IGlass <= dataConstruction.Construct(ConstrNumSh).TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum); + SurfWinQRadSWwinAbs(IGlass, SurfNum) += SurfWinInitialDifSolwinAbs(IGlass, SurfNum); } if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) @@ -3754,13 +3749,13 @@ namespace HeatBalanceSurfaceManager { } } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum); + SurfWinQRadSWwinAbs(IGlass, SurfNum) += SurfWinInitialDifSolwinAbs(IGlass, SurfNum); } } // End of shading flag check } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { TotGlassLayers = dataConstruction.Construct(ConstrNum).TotGlassLayers; for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNum) += InitialDifSolwinAbs(IGlass, SurfNum); + SurfWinQRadSWwinAbs(IGlass, SurfNum) += SurfWinInitialDifSolwinAbs(IGlass, SurfNum); } } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { @@ -3768,7 +3763,7 @@ namespace HeatBalanceSurfaceManager { EQLNum = dataConstruction.Construct(ConstrNum).EQLConsPtr; for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { - QRadSWwinAbs(Lay, SurfNum) += InitialDifSolwinAbs(Lay, SurfNum); + SurfWinQRadSWwinAbs(Lay, SurfNum) += SurfWinInitialDifSolwinAbs(Lay, SurfNum); } } @@ -3794,32 +3789,32 @@ namespace HeatBalanceSurfaceManager { for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] SurfInitialDifSolInAbsReport(SurfNum) += - InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinInitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } else if (ShadeFlag == IntShadeOn || ShadeFlag >= 3) { // Interior, exterior or between-glass shade, screen or blind in place for (IGlass = 1; IGlass <= dataConstruction.Construct(ConstrNumSh).TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] SurfInitialDifSolInAbsReport(SurfNum) += - InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinInitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] SurfInitialDifSolInAbsReport(SurfNum) += - InitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinInitialDifSolwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All Glass Layers[W] - SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(IGlass, SurfNum) * Surface(SurfNum).Area; } } // End of shading flag check } else { // IF (SurfaceWindow(SurfNum)%WindowModelType == WindowEQLModel) THEN @@ -3828,11 +3823,11 @@ namespace HeatBalanceSurfaceManager { for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { // Initial Transmitted Diffuse Solar Absorbed on Inside of Surface[W] - SurfInitialDifSolInAbsReport(SurfNum) += InitialDifSolwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfInitialDifSolInAbsReport(SurfNum) += SurfWinInitialDifSolwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Radiation Absorbed on Inside of Surface[W] - SurfSWInAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfSWInAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; // Total Shortwave Absorbed:All solid Layers[W] - SurfWinSWwinAbsTotalReport(SurfNum) += QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinSWwinAbsTotalReport(SurfNum) += SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; } } } // End of window @@ -5455,7 +5450,7 @@ namespace HeatBalanceSurfaceManager { // Tuned Replaced by one line form below for speed // QdotRadIntGainsInRepPerArea( SurfNum ) = QRadThermInAbs( SurfNum ); // QdotRadIntGainsInRep( SurfNum ) = QdotRadIntGainsInRepPerArea( SurfNum ) * surfaceArea; - QdotRadIntGainsInRep(SurfNum) = (QdotRadIntGainsInRepPerArea(SurfNum) = QRadThermInAbs(SurfNum)) * surfaceArea; + QdotRadIntGainsInRep(SurfNum) = (QdotRadIntGainsInRepPerArea(SurfNum) = SurfQRadThermInAbs(SurfNum)) * surfaceArea; QRadIntGainsInReport(SurfNum) = QdotRadIntGainsInRep(SurfNum) * TimeStepZoneSec; QdotRadHVACInRepPerArea(SurfNum) = QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + @@ -6574,7 +6569,7 @@ namespace HeatBalanceSurfaceManager { } // Pre-calculate a few terms // - Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + + Real64 const TempTerm(CTFConstInPart(SurfNum) + SurfQRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + SurfNetLWRadToSurf(SurfNum) + (QRadSurfAFNDuct(SurfNum) / TimeStepZoneSec)); @@ -6674,7 +6669,7 @@ namespace HeatBalanceSurfaceManager { MoistureBalanceEMPDManager::CalcMoistureBalanceEMPD(ioFiles, SurfNum, TempSurfInTmp(SurfNum), MAT_zone, TempSurfInSat); } // Pre-calculate a few terms - Real64 const TempTerm(CTFConstInPart(SurfNum) + QRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + + Real64 const TempTerm(CTFConstInPart(SurfNum) + SurfQRadThermInAbs(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + SurfNetLWRadToSurf(SurfNum) + @@ -6812,7 +6807,7 @@ namespace HeatBalanceSurfaceManager { TempSurfIn(SurfNum) = (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + construct.CTFCross(0) * TH11 + - F1 * (QRadThermInAbs(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + SurfNetLWRadToSurf(SurfNum) + QHTRadSysSurf(SurfNum) + + F1 * (SurfQRadThermInAbs(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + SurfNetLWRadToSurf(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + SurfQAdditionalHeatSourceInside(SurfNum) + IterDampConst * TempInsOld(SurfNum))) / (construct.CTFInside(0) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air @@ -6845,7 +6840,7 @@ namespace HeatBalanceSurfaceManager { // = QRadSWwinAbs(SurfNum,1)/2.0 Real64 const HConvIn_surf(HConvInFD(SurfNum) = HConvIn(SurfNum)); TempSurfIn(SurfNum) = TempSurfInTmp(SurfNum) = - (QRadThermInAbs(SurfNum) + QRadSWwinAbs(1, SurfNum) / 2.0 + SurfQAdditionalHeatSourceInside(SurfNum) + + (SurfQRadThermInAbs(SurfNum) + SurfWinQRadSWwinAbs(1, SurfNum) / 2.0 + SurfQAdditionalHeatSourceInside(SurfNum) + HConvIn_surf * RefAirTemp(SurfNum) + SurfNetLWRadToSurf(SurfNum) + IterDampConst * TempInsOld(SurfNum) + Ueff * TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and @@ -7356,7 +7351,7 @@ namespace HeatBalanceSurfaceManager { for (int surfNum = firstNonWinSurf; surfNum <= lastNonWinSurf; ++surfNum) { // Pre-calculate a few terms before the iteration loop - TempTermSurf(surfNum) = CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + + TempTermSurf(surfNum) = CTFConstInPart(surfNum) + SurfQRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); @@ -7392,7 +7387,7 @@ namespace HeatBalanceSurfaceManager { // this loop auto-vectorizes for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { TempTermSurf(surfNum) = - CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + + CTFConstInPart(surfNum) + SurfQRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + (QRadSurfAFNDuct(surfNum) / timeStepZoneSeconds); TempDivSurf(surfNum) = @@ -7486,7 +7481,7 @@ namespace HeatBalanceSurfaceManager { TempSurfIn(surfNum) = (CTFConstInPart(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + CTFCross0(surfNum) * TH11Surf(surfNum) + - F1 * (QRadThermInAbs(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + SurfNetLWRadToSurf(surfNum) + + F1 * (SurfQRadThermInAbs(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + SurfNetLWRadToSurf(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + IterDampConst * TempInsOld(surfNum))) / (CTFInside0(surfNum) + HMovInsul - F1 * HMovInsul); // Convection from surface to zone air @@ -7501,7 +7496,7 @@ namespace HeatBalanceSurfaceManager { // Set the appropriate parameters for the radiant system // Radiant system does not need the damping coefficient terms (hopefully) Real64 const RadSysDiv(1.0 / (CTFInside0(surfNum) + HConvIn(surfNum))); - Real64 const TempTerm(CTFConstInPart(surfNum) + QRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + + Real64 const TempTerm(CTFConstInPart(surfNum) + SurfQRadThermInAbs(surfNum) + SurfOpaqQRadSWInAbs(surfNum) + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn(surfNum) * RefAirTemp(surfNum) + QHTRadSysSurf(surfNum) + QCoolingPanelSurf(surfNum) + QHWBaseboardSurf(surfNum) + QSteamBaseboardSurf(surfNum) + QElecBaseboardSurf(surfNum) + SurfNetLWRadToSurf(surfNum) + @@ -7559,7 +7554,7 @@ namespace HeatBalanceSurfaceManager { // = QRadSWwinAbs(surfNum,1)/2.0 Real64 const HConvIn_surf(HConvInFD(surfNum) = HConvIn(surfNum)); TempSurfIn(surfNum) = TempSurfInTmp(surfNum) = - (QRadThermInAbs(surfNum) + QRadSWwinAbs(1, surfNum) / 2.0 + SurfQAdditionalHeatSourceInside(surfNum) + + (SurfQRadThermInAbs(surfNum) + SurfWinQRadSWwinAbs(1, surfNum) / 2.0 + SurfQAdditionalHeatSourceInside(surfNum) + HConvIn_surf * RefAirTemp(surfNum) + SurfNetLWRadToSurf(surfNum) + IterDampConst * TempInsOld(surfNum) + Ueff * TH(1, 1, domeNum)) / (Ueff + HConvIn_surf + IterDampConst); // LW radiation from internal sources | SW radiation from internal sources and @@ -8144,9 +8139,9 @@ namespace HeatBalanceSurfaceManager { //+Construct(ConstrNum)%CTFSourceIn(0) & TDDs cannot be radiant systems // *QsrcHist(1,SurfNum) & TH11 = - (QRadSWwinAbs(1, SurfNum) / 2.0 + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + + (SurfWinQRadSWwinAbs(1, SurfNum) / 2.0 + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + - F1 * (QRadSWwinAbs(1, SurfNum2) / 2.0 + QRadThermInAbs(SurfNum2) + HConvIn(SurfNum2) * MAT(ZoneNum2) + SurfNetLWRadToSurf(SurfNum2))) / + F1 * (SurfWinQRadSWwinAbs(1, SurfNum2) / 2.0 + SurfQRadThermInAbs(SurfNum2) + HConvIn(SurfNum2) * MAT(ZoneNum2) + SurfNetLWRadToSurf(SurfNum2))) / (Ueff + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * Ueff); // Instead of QRadSWOutAbs(SurfNum) | ODB used to approx ground surface temp | Use TDD:DIFFUSER surface | Use // TDD:DIFFUSER surface | Use TDD:DIFFUSER surface and zone | Use TDD:DIFFUSER surface @@ -8194,7 +8189,7 @@ namespace HeatBalanceSurfaceManager { TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1) + - F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models @@ -8202,7 +8197,7 @@ namespace HeatBalanceSurfaceManager { TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround + - F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum) - F1 * construct.CTFCross(0)); // ODB used to approx ground surface temp | MAT use here is problem for room air models @@ -8216,13 +8211,13 @@ namespace HeatBalanceSurfaceManager { if (construct.SourceSinkPresent) { TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + construct.CTFSourceOut(0) * QsrcHist(SurfNum, 1) + - F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + construct.CTFSourceIn(0) * QsrcHist(SurfNum, 1) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models } else { TH11 = (-CTFConstOutPart(SurfNum) + HcExtSurf(SurfNum) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HRad * RadTemp + - F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum))) / (construct.CTFOutside(0) + HcExtSurf(SurfNum) + HRad - F1 * construct.CTFCross(0)); // MAT use here is problem for room air models @@ -8244,7 +8239,7 @@ namespace HeatBalanceSurfaceManager { F2 = HMovInsul / (HMovInsul + HcExtSurf(SurfNum) + HAirExtSurf(SurfNum) + HSkyExtSurf(SurfNum) + HGrdExtSurf(SurfNum)); TH11 = (-CTFConstOutPart(SurfNum) + SurfOpaqQRadSWOutAbs(SurfNum) + SurfQRadLWOutSrdSurfs(SurfNum) + - F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + QRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + + F1 * (CTFConstInPart(SurfNum) + SurfOpaqQRadSWInAbs(SurfNum) + SurfQRadThermInAbs(SurfNum) + HConvIn(SurfNum) * MAT(ZoneNum) + SurfNetLWRadToSurf(SurfNum)) + F2 * (SurfQRadSWOutMvIns(SurfNum) + (HcExtSurf(SurfNum) + HAirExtSurf(SurfNum)) * TempExt + SurfQAdditionalHeatSourceOutside(SurfNum) + HSkyExtSurf(SurfNum) * TSky + HGrdExtSurf(SurfNum) * TGround)) / diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index a8112282bcc..9fb0a8907d8 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -5566,7 +5566,7 @@ namespace InternalHeatGains { if (!Surface(SurfNum).HeatTransSurf) continue; // Skip non-heat transfer surfaces int const radEnclosureNum = Zone(zoneNum).RadiantEnclosureNum; if (!doLoadComponentPulseNow) { - QRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); } else { curQL = QL(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion @@ -5576,7 +5576,7 @@ namespace InternalHeatGains { // ITABSF is the Inside Thermal Absorptance // TMULT is a multiplier for each zone // QRadThermInAbs is the thermal radiation absorbed on inside surfaces - QRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); + SurfQRadThermInAbs(SurfNum) = adjQL * TMULT(radEnclosureNum) * ITABSF(SurfNum); // store the magnitude and time of the pulse radiantPulseTimestep(CurOverallSimDay, zoneNum) = (HourOfDay - 1) * NumOfTimeStepInHour + TimeStep; radiantPulseReceived(CurOverallSimDay, SurfNum) = diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 09a52fbca87..d6e7b623a7b 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -594,7 +594,7 @@ namespace PhotovoltaicThermalCollectors { if (SELECT_CASE_var == WorkingFluidEnum::LIQUID) { // heating only right now, so control flow requests based on incident solar; - if (DataHeatBalance::QRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { + if (DataHeatBalance::SurfQRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { this->MassFlowRate = this->MaxMassFlowRate; } else { this->MassFlowRate = 0.0; @@ -803,7 +803,7 @@ namespace PhotovoltaicThermalCollectors { if (this->WorkingFluidType == WorkingFluidEnum::AIR) { if (this->PVTModelType == SimplePVTmodel) { - if (DataHeatBalance::QRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { + if (DataHeatBalance::SurfQRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { // is heating wanted? // Outlet node is required to have a setpoint. if (DataLoopNode::Node(this->HVACOutletNodeNum).TempSetPoint > DataLoopNode::Node(this->HVACInletNodeNum).Temp) { @@ -831,7 +831,7 @@ namespace PhotovoltaicThermalCollectors { } else if (this->WorkingFluidType == WorkingFluidEnum::LIQUID) { if (this->PVTModelType == SimplePVTmodel) { - if (DataHeatBalance::QRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { + if (DataHeatBalance::SurfQRadSWOutIncident(this->SurfNum) > DataPhotovoltaics::MinIrradiance) { // is heating wanted? this->HeatingUseful = true; this->BypassDamperOff = true; @@ -895,7 +895,7 @@ namespace PhotovoltaicThermalCollectors { } } - Real64 PotentialHeatGain = DataHeatBalance::QRadSWOutIncident(this->SurfNum) * Eff * this->AreaCol; + Real64 PotentialHeatGain = DataHeatBalance::SurfQRadSWOutIncident(this->SurfNum) * Eff * this->AreaCol; if (this->WorkingFluidType == WorkingFluidEnum::AIR) { Real64 Winlet = DataLoopNode::Node(InletNode).HumRat; diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 51f9918d962..bde85fdfb63 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -816,7 +816,7 @@ namespace Photovoltaics { // Using/Aliasing using DataGlobals::SecInHour; - using DataHeatBalance::QRadSWOutIncident; + using DataHeatBalance::SurfQRadSWOutIncident; using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; using ScheduleManager::GetCurrentScheduleValue; @@ -841,7 +841,7 @@ namespace Photovoltaics { ThisSurf = PVarray(thisPV).SurfacePtr; - if (QRadSWOutIncident(ThisSurf) > MinIrradiance) { + if (SurfQRadSWOutIncident(ThisSurf) > MinIrradiance) { // get efficiency { @@ -864,7 +864,7 @@ namespace Photovoltaics { PVarray(thisPV).Report.DCPower = PVarray(thisPV).SimplePVModule.AreaCol * Eff * - QRadSWOutIncident(ThisSurf); // active solar cellsurface net area | solar conversion efficiency | solar incident + SurfQRadSWOutIncident(ThisSurf); // active solar cellsurface net area | solar conversion efficiency | solar incident // store sink term in appropriate place for surface heat transfer itegration PVarray(thisPV).SurfaceSink = PVarray(thisPV).Report.DCPower; @@ -964,9 +964,9 @@ namespace Photovoltaics { using DataEnvironment::Elevation; using DataEnvironment::SOLCOS; using DataGlobals::DegToRadians; - using DataHeatBalance::CosIncidenceAngle; - using DataHeatBalance::QRadSWOutIncident; - using DataHeatBalance::QRadSWOutIncidentBeam; + using DataHeatBalance::SurfCosIncidenceAngle; + using DataHeatBalance::SurfQRadSWOutIncident; + using DataHeatBalance::SurfQRadSWOutIncidentBeam; using DataHeatBalSurface::SurfTempSurfOut; using DataSurfaces::Surface; using TranspiredCollector::GetUTSCTsColl; @@ -991,9 +991,9 @@ namespace Photovoltaics { ThisSurf = PVarray(PVnum).SurfacePtr; // get input from elsewhere in Energyplus for the current point in the simulation - PVarray(PVnum).SNLPVinto.IcBeam = QRadSWOutIncidentBeam(ThisSurf); //(W/m2)from DataHeatBalance - PVarray(PVnum).SNLPVinto.IcDiffuse = QRadSWOutIncident(ThisSurf) - QRadSWOutIncidentBeam(ThisSurf); //(W/ m2)(was kJ/hr m2) - PVarray(PVnum).SNLPVinto.IncidenceAngle = std::acos(CosIncidenceAngle(ThisSurf)) / DegToRadians; // (deg) from dataHeatBalance + PVarray(PVnum).SNLPVinto.IcBeam = SurfQRadSWOutIncidentBeam(ThisSurf); //(W/m2)from DataHeatBalance + PVarray(PVnum).SNLPVinto.IcDiffuse = SurfQRadSWOutIncident(ThisSurf) - SurfQRadSWOutIncidentBeam(ThisSurf); //(W/ m2)(was kJ/hr m2) + PVarray(PVnum).SNLPVinto.IncidenceAngle = std::acos(SurfCosIncidenceAngle(ThisSurf)) / DegToRadians; // (deg) from dataHeatBalance PVarray(PVnum).SNLPVinto.ZenithAngle = std::acos(SOLCOS(3)) / DegToRadians; //(degrees), PVarray(PVnum).SNLPVinto.Tamb = Surface(ThisSurf).OutDryBulbTemp; //(deg. C) PVarray(PVnum).SNLPVinto.WindSpeed = Surface(ThisSurf).WindSpeed; // (m/s) @@ -1220,7 +1220,7 @@ namespace Photovoltaics { using DataGlobals::SecInHour; using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; - using DataHeatBalance::QRadSWOutIncident; + using DataHeatBalance::SurfQRadSWOutIncident; using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataSurfaces::Surface; @@ -1268,9 +1268,9 @@ namespace Photovoltaics { PVarray(PVnum).TRNSYSPVcalc.TimeElapsed = TimeElapsed; } - if (any_gt(QRadSWOutIncident, 0.0)) { + if (any_gt(SurfQRadSWOutIncident, 0.0)) { // Determine the amount of radiation incident on each PV - PVarray(PVnum).TRNSYSPVcalc.Insolation = QRadSWOutIncident(PVarray(PVnum).SurfacePtr); //[W/m2] + PVarray(PVnum).TRNSYSPVcalc.Insolation = SurfQRadSWOutIncident(PVarray(PVnum).SurfacePtr); //[W/m2] } else { PVarray(PVnum).TRNSYSPVcalc.Insolation = 0.0; } diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index dde8617f80b..b6135acfcde 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -979,9 +979,9 @@ namespace SolarCollectors { Real64 incidentAngleModifier; // Net incident angle modifier combining beam, sky, and ground radiation // Calculate incident angle modifier - if (DataHeatBalance::QRadSWOutIncident(SurfNum) > 0.0) { + if (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) > 0.0) { // Equivalent incident angle of sky radiation (radians) - Real64 ThetaBeam = std::acos(DataHeatBalance::CosIncidenceAngle(SurfNum)); + Real64 ThetaBeam = std::acos(DataHeatBalance::SurfCosIncidenceAngle(SurfNum)); // Calculate equivalent incident angles for sky and ground radiation according to Brandemuehl and Beckman (1980) // Surface tilt angle (degrees) @@ -993,10 +993,10 @@ namespace SolarCollectors { // Equivalent incident angle of ground radiation (radians) Real64 ThetaGnd = (90.0 - 0.5788 * tilt + 0.002693 * pow_2(tilt)) * DataGlobals::DegToRadians; - incidentAngleModifier = (DataHeatBalance::QRadSWOutIncidentBeam(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaBeam) + - DataHeatBalance::QRadSWOutIncidentSkyDiffuse(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaSky) + - DataHeatBalance::QRadSWOutIncidentGndDiffuse(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaGnd)) / - DataHeatBalance::QRadSWOutIncident(SurfNum); + incidentAngleModifier = (DataHeatBalance::SurfQRadSWOutIncidentBeam(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaBeam) + + DataHeatBalance::SurfQRadSWOutIncidentSkyDiffuse(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaSky) + + DataHeatBalance::SurfQRadSWOutIncidentGndDiffuse(SurfNum) * SolarCollectors::Parameters(ParamNum).IAM(ThetaGnd)) / + DataHeatBalance::SurfQRadSWOutIncident(SurfNum); } else { incidentAngleModifier = 0.0; } @@ -1099,7 +1099,7 @@ namespace SolarCollectors { // Calculate fluid heat gain (or loss) // Heat loss is possible if there is no incident radiation and fluid is still flowing. - Q = (FRTAN * incidentAngleModifier * DataHeatBalance::QRadSWOutIncident(SurfNum) + + Q = (FRTAN * incidentAngleModifier * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + FRULpTest * (inletTemp - DataSurfaces::Surface(SurfNum).OutDryBulbTemp)) * area * FlowMod; @@ -1115,9 +1115,9 @@ namespace SolarCollectors { Q = massFlowRate * Cp * (outletTemp - inletTemp); } - if (DataHeatBalance::QRadSWOutIncident(SurfNum) > 0.0) { // Calculate thermal efficiency + if (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) > 0.0) { // Calculate thermal efficiency // NOTE: Efficiency can be > 1 if Q > QRadSWOutIncident because of favorable delta T, i.e. warm outdoor temperature - efficiency = Q / (DataHeatBalance::QRadSWOutIncident(SurfNum) * area); // Q has units of W; QRadSWOutIncident has units of W/m2 + efficiency = Q / (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) * area); // Q has units of W; QRadSWOutIncident has units of W/m2 } else { efficiency = 0.0; } @@ -1130,7 +1130,7 @@ namespace SolarCollectors { Real64 A = -FRULT; Real64 B = -FRUL + 2.0 * FRULT * DataSurfaces::Surface(SurfNum).OutDryBulbTemp; Real64 C = -FRULT * pow_2(DataSurfaces::Surface(SurfNum).OutDryBulbTemp) + FRUL * DataSurfaces::Surface(SurfNum).OutDryBulbTemp - - FRTAN * incidentAngleModifier * DataHeatBalance::QRadSWOutIncident(SurfNum); + FRTAN * incidentAngleModifier * DataHeatBalance::SurfQRadSWOutIncident(SurfNum); Real64 qEquation = (pow_2(B) - 4.0 * A * C); if (qEquation < 0.0) { if (this->ErrIndex == 0) { @@ -1147,7 +1147,7 @@ namespace SolarCollectors { } if (FRULT == 0.0 || qEquation < 0.0) { // Linear, 1st order solution outletTemp = DataSurfaces::Surface(SurfNum).OutDryBulbTemp - - FRTAN * incidentAngleModifier * DataHeatBalance::QRadSWOutIncident(SurfNum) / FRUL; + FRTAN * incidentAngleModifier * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) / FRUL; } else { // Quadratic, 2nd order solution outletTemp = (-B + std::sqrt(qEquation)) / (2.0 * A); } @@ -1272,7 +1272,7 @@ namespace SolarCollectors { // Calculate transmittance-absorptance product of the system // Incident angle of beam radiation (radians) - Real64 ThetaBeam = std::acos(DataHeatBalance::CosIncidenceAngle(SurfNum)); + Real64 ThetaBeam = std::acos(DataHeatBalance::SurfCosIncidenceAngle(SurfNum)); this->CalcTransAbsorProduct(ThetaBeam); Real64 inletTemp = this->InletTemp; @@ -1315,12 +1315,12 @@ namespace SolarCollectors { Real64 ap = SolarCollectors::Parameters(ParamNum).ThermalMass * area; a1 = -area * (hConvCoefA2W + this->UTopLoss) / ap; a2 = area * hConvCoefA2W / ap; - a3 = area * (this->TauAlpha * DataHeatBalance::QRadSWOutIncident(SurfNum) + this->UTopLoss * TempOutdoorAir) / ap; + a3 = area * (this->TauAlpha * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + this->UTopLoss * TempOutdoorAir) / ap; } else { AbsPlateMassFlag = false; a1 = -area * (hConvCoefA2W + this->UTopLoss); a2 = area * hConvCoefA2W; - a3 = area * (this->TauAlpha * DataHeatBalance::QRadSWOutIncident(SurfNum) + this->UTopLoss * TempOutdoorAir); + a3 = area * (this->TauAlpha * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + this->UTopLoss * TempOutdoorAir); } // thermal mass of the collector water [J/K] @@ -1354,8 +1354,8 @@ namespace SolarCollectors { this->TempOfAbsPlate = TempAbsPlate; Real64 efficiency = 0.0; // Thermal efficiency of solar energy conversion - if (DataHeatBalance::QRadSWOutIncident(SurfNum) > 0.0) { - efficiency = (this->HeatGainRate + this->StoredHeatRate) / (DataHeatBalance::QRadSWOutIncident(SurfNum) * area); + if (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) > 0.0) { + efficiency = (this->HeatGainRate + this->StoredHeatRate) / (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) * area); if (efficiency < 0.0) efficiency = 0.0; } this->Efficiency = efficiency; @@ -1470,7 +1470,7 @@ namespace SolarCollectors { int SurfNum = this->Surface; int ParamNum = this->Parameters; - if (DataHeatBalance::QRadSWOutIncident(SurfNum) > 0.0) { + if (DataHeatBalance::SurfQRadSWOutIncident(SurfNum) > 0.0) { // cover system transmittance and reflectance from outer to inner cover this->CalcTransRefAbsOfCover(IncidAngle, TransSys, ReflSys, AbsCover1, AbsCover2); @@ -1485,25 +1485,25 @@ namespace SolarCollectors { CoversAbsBeam(2) = AbsCover2; // calc total solar radiation weighted transmittance-absorptance product - TuaAlpha = (DataHeatBalance::QRadSWOutIncidentBeam(SurfNum) * this->TauAlphaBeam + - DataHeatBalance::QRadSWOutIncidentSkyDiffuse(SurfNum) * this->TauAlphaSkyDiffuse + - DataHeatBalance::QRadSWOutIncidentGndDiffuse(SurfNum) * this->TauAlphaGndDiffuse) / - DataHeatBalance::QRadSWOutIncident(SurfNum); + TuaAlpha = (DataHeatBalance::SurfQRadSWOutIncidentBeam(SurfNum) * this->TauAlphaBeam + + DataHeatBalance::SurfQRadSWOutIncidentSkyDiffuse(SurfNum) * this->TauAlphaSkyDiffuse + + DataHeatBalance::SurfQRadSWOutIncidentGndDiffuse(SurfNum) * this->TauAlphaGndDiffuse) / + DataHeatBalance::SurfQRadSWOutIncident(SurfNum); if (SolarCollectors::Parameters(ParamNum).NumOfCovers == 1) { // calc total solar radiation weighted cover absorptance - this->CoverAbs(1) = (DataHeatBalance::QRadSWOutIncidentBeam(SurfNum) * CoversAbsBeam(1) + - DataHeatBalance::QRadSWOutIncidentSkyDiffuse(SurfNum) * this->CoversAbsSkyDiffuse(1) + - DataHeatBalance::QRadSWOutIncidentGndDiffuse(SurfNum) * this->CoversAbsGndDiffuse(1)) / - DataHeatBalance::QRadSWOutIncident(SurfNum); + this->CoverAbs(1) = (DataHeatBalance::SurfQRadSWOutIncidentBeam(SurfNum) * CoversAbsBeam(1) + + DataHeatBalance::SurfQRadSWOutIncidentSkyDiffuse(SurfNum) * this->CoversAbsSkyDiffuse(1) + + DataHeatBalance::SurfQRadSWOutIncidentGndDiffuse(SurfNum) * this->CoversAbsGndDiffuse(1)) / + DataHeatBalance::SurfQRadSWOutIncident(SurfNum); } else if (SolarCollectors::Parameters(ParamNum).NumOfCovers == 2) { // Num = 1 represents outer cover and Num = 2 represents inner cover for (int Num = 1; Num <= SolarCollectors::Parameters(ParamNum).NumOfCovers; ++Num) { - this->CoverAbs(Num) = (DataHeatBalance::QRadSWOutIncidentBeam(SurfNum) * CoversAbsBeam(Num) + - DataHeatBalance::QRadSWOutIncidentSkyDiffuse(SurfNum) * this->CoversAbsSkyDiffuse(Num) + - DataHeatBalance::QRadSWOutIncidentGndDiffuse(SurfNum) * this->CoversAbsGndDiffuse(Num)) / - DataHeatBalance::QRadSWOutIncident(SurfNum); + this->CoverAbs(Num) = (DataHeatBalance::SurfQRadSWOutIncidentBeam(SurfNum) * CoversAbsBeam(Num) + + DataHeatBalance::SurfQRadSWOutIncidentSkyDiffuse(SurfNum) * this->CoversAbsSkyDiffuse(Num) + + DataHeatBalance::SurfQRadSWOutIncidentGndDiffuse(SurfNum) * this->CoversAbsGndDiffuse(Num)) / + DataHeatBalance::SurfQRadSWOutIncident(SurfNum); } } @@ -1771,19 +1771,19 @@ namespace SolarCollectors { { auto const SELECT_CASE_var(NumCovers); if (SELECT_CASE_var == 1) { - tempnom = this->CoverAbs(1) * DataHeatBalance::QRadSWOutIncident(SurfNum) + TempOutdoorAir * (hConvCoefC2O + hRadCoefC2O) + + tempnom = this->CoverAbs(1) * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + TempOutdoorAir * (hConvCoefC2O + hRadCoefC2O) + TempAbsPlate * (hConvCoefA2C + hRadCoefA2C); tempdenom = (hConvCoefC2O + hRadCoefC2O) + (hConvCoefA2C + hRadCoefA2C); TempOuterCover = tempnom / tempdenom; } else if (SELECT_CASE_var == 2) { for (int Num = 1; Num <= NumCovers; ++Num) { if (Num == 1) { - tempnom = this->CoverAbs(Num) * DataHeatBalance::QRadSWOutIncident(SurfNum) + TempOutdoorAir * (hConvCoefC2O + hRadCoefC2O) + + tempnom = this->CoverAbs(Num) * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + TempOutdoorAir * (hConvCoefC2O + hRadCoefC2O) + TempInnerCover * (hConvCoefC2C + hRadCoefC2C); tempdenom = (hConvCoefC2O + hRadCoefC2O) + (hConvCoefC2C + hRadCoefC2C); TempOuterCover = tempnom / tempdenom; } else if (Num == 2) { - tempnom = this->CoverAbs(Num) * DataHeatBalance::QRadSWOutIncident(SurfNum) + TempAbsPlate * (hConvCoefA2C + hRadCoefA2C) + + tempnom = this->CoverAbs(Num) * DataHeatBalance::SurfQRadSWOutIncident(SurfNum) + TempAbsPlate * (hConvCoefA2C + hRadCoefA2C) + TempOuterCover * (hConvCoefC2C + hRadCoefC2C); tempdenom = (hConvCoefC2C + hRadCoefC2C + hConvCoefA2C + hRadCoefA2C); TempInnerCover = tempnom / tempdenom; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 65dc37d34b6..f868ca13b0c 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -489,29 +489,31 @@ namespace SolarShading { ZoneOpaqSurfInsFaceCond = 0.0; ZoneOpaqSurfInsFaceCondGainRep = 0.0; ZoneOpaqSurfInsFaceCondLossRep = 0.0; - QRadSWOutIncident = 0.0; - QRadSWOutIncidentBeam = 0.0; - BmIncInsSurfIntensRep = 0.0; - BmIncInsSurfAmountRep = 0.0; - // DifIncInsSurfIntensRep=0.0 - // DifIncInsSurfAmountRep=0.0 - IntBmIncInsSurfIntensRep = 0.0; - IntBmIncInsSurfAmountRep = 0.0; - // IntDifIncInsSurfIntensRep=0.0 - // IntDifIncInsSurfAmountRep=0.0 - QRadSWOutIncidentSkyDiffuse = 0.0; - QRadSWOutIncidentGndDiffuse = 0.0; - QRadSWOutIncBmToDiffReflGnd = 0.0; - QRadSWOutIncSkyDiffReflGnd = 0.0; - QRadSWOutIncBmToBmReflObs = 0.0; - QRadSWOutIncBmToDiffReflObs = 0.0; - QRadSWOutIncSkyDiffReflObs = 0.0; - CosIncidenceAngle = 0.0; + + SurfQRadSWOutIncident = 0.0; + SurfQRadSWOutIncidentBeam = 0.0; + SurfBmIncInsSurfIntensRep = 0.0; + SurfBmIncInsSurfAmountRep = 0.0; + SurfIntBmIncInsSurfIntensRep = 0.0; + SurfIntBmIncInsSurfAmountRep = 0.0; + SurfQRadSWOutIncidentSkyDiffuse = 0.0; + SurfQRadSWOutIncidentGndDiffuse = 0.0; + SurfQRadSWOutIncBmToDiffReflGnd = 0.0; + SurfQRadSWOutIncSkyDiffReflGnd = 0.0; + SurfQRadSWOutIncBmToBmReflObs = 0.0; + SurfQRadSWOutIncBmToDiffReflObs = 0.0; + SurfQRadSWOutIncSkyDiffReflObs = 0.0; + SurfCosIncidenceAngle = 0.0; + SurfSWInAbsTotalReport = 0.0; + SurfBmIncInsSurfAmountRepEnergy = 0.0; + SurfIntBmIncInsSurfAmountRepEnergy = 0.0; + SurfWinQRadSWwinAbsTot = 0.0; + SurfWinQRadSWwinAbsTotEnergy = 0.0; SurfWinSWwinAbsTotalReport = 0.0; SurfInitialDifSolInAbsReport = 0.0; SurfWinInitialDifSolInTransReport = 0.0; - SurfSWInAbsTotalReport = 0.0; + WindowRevealStatus = 0; ZoneTransSolarEnergy = 0.0; ZoneBmSolFrExtWinsRepEnergy = 0.0; @@ -522,11 +524,7 @@ namespace SolarShading { ZoneWinHeatLossRepEnergy = 0.0; ZnOpqSurfInsFaceCondGnRepEnrg = 0.0; ZnOpqSurfInsFaceCondLsRepEnrg = 0.0; - SurfBmIncInsSurfAmountRepEnergy = 0.0; - // DifIncInsSurfAmountRepEnergy=0.0 - SurfIntBmIncInsSurfAmountRepEnergy = 0.0; - // IntDifIncInsSurfAmountRepEnergy=0.0 - SurfWinQRadSWwinAbsTotEnergy = 0.0; + // Surface Win for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { @@ -1070,28 +1068,29 @@ namespace SolarShading { ZoneOpaqSurfExtFaceCondGainRep.dimension(NumOfZones, 0.0); ZoneOpaqSurfExtFaceCondLossRep.dimension(NumOfZones, 0.0); - QRadSWOutIncident.dimension(TotSurfaces, 0.0); - QRadSWOutIncidentBeam.dimension(TotSurfaces, 0.0); - BmIncInsSurfIntensRep.dimension(TotSurfaces, 0.0); - BmIncInsSurfAmountRep.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncident.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncidentBeam.dimension(TotSurfaces, 0.0); + SurfBmIncInsSurfIntensRep.dimension(TotSurfaces, 0.0); + SurfBmIncInsSurfAmountRep.dimension(TotSurfaces, 0.0); // ALLOCATE(DifIncInsSurfIntensRep(TotSurfaces)) // DifIncInsSurfIntensRep=0.0 // ALLOCATE(DifIncInsSurfAmountRep(TotSurfaces)) // DifIncInsSurfAmountRep=0.0 - IntBmIncInsSurfIntensRep.dimension(TotSurfaces, 0.0); - IntBmIncInsSurfAmountRep.dimension(TotSurfaces, 0.0); + SurfIntBmIncInsSurfIntensRep.dimension(TotSurfaces, 0.0); + SurfIntBmIncInsSurfAmountRep.dimension(TotSurfaces, 0.0); // ALLOCATE(IntDifIncInsSurfIntensRep(TotSurfaces)) // IntDifIncInsSurfIntensRep=0.0 // ALLOCATE(IntDifIncInsSurfAmountRep(TotSurfaces)) // IntDifIncInsSurfAmountRep=0.0 - QRadSWOutIncidentSkyDiffuse.dimension(TotSurfaces, 0.0); - QRadSWOutIncidentGndDiffuse.dimension(TotSurfaces, 0.0); - QRadSWOutIncBmToDiffReflGnd.dimension(TotSurfaces, 0.0); - QRadSWOutIncSkyDiffReflGnd.dimension(TotSurfaces, 0.0); - QRadSWOutIncBmToBmReflObs.dimension(TotSurfaces, 0.0); - QRadSWOutIncBmToDiffReflObs.dimension(TotSurfaces, 0.0); - QRadSWOutIncSkyDiffReflObs.dimension(TotSurfaces, 0.0); - CosIncidenceAngle.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncidentSkyDiffuse.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncidentGndDiffuse.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncBmToDiffReflGnd.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncSkyDiffReflGnd.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncBmToBmReflObs.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncBmToDiffReflObs.dimension(TotSurfaces, 0.0); + SurfQRadSWOutIncSkyDiffReflObs.dimension(TotSurfaces, 0.0); + SurfCosIncidenceAngle.dimension(TotSurfaces, 0.0); + SurfWinBSDFBeamDirectionRep.dimension(TotSurfaces, 0); SurfWinBSDFBeamThetaRep.dimension(TotSurfaces, 0.0); SurfWinBSDFBeamPhiRep.dimension(TotSurfaces, 0.0); @@ -1313,61 +1312,61 @@ namespace SolarShading { Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncident(SurfLoop), + SurfQRadSWOutIncident(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Beam Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncidentBeam(SurfLoop), + SurfQRadSWOutIncidentBeam(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Sky Diffuse Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncidentSkyDiffuse(SurfLoop), + SurfQRadSWOutIncidentSkyDiffuse(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Ground Diffuse Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncidentGndDiffuse(SurfLoop), + SurfQRadSWOutIncidentGndDiffuse(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Beam Solar Incident Angle Cosine Value", OutputProcessor::Unit::None, - CosIncidenceAngle(SurfLoop), + SurfCosIncidenceAngle(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Sky Diffuse Ground Reflected Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncSkyDiffReflGnd(SurfLoop), + SurfQRadSWOutIncSkyDiffReflGnd(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Sky Diffuse Surface Reflected Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncSkyDiffReflObs(SurfLoop), + SurfQRadSWOutIncSkyDiffReflObs(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Beam To Beam Surface Reflected Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncBmToBmReflObs(SurfLoop), + SurfQRadSWOutIncBmToBmReflObs(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Beam To Diffuse Surface Reflected Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncBmToDiffReflObs(SurfLoop), + SurfQRadSWOutIncBmToDiffReflObs(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Outside Face Incident Beam To Diffuse Ground Reflected Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncBmToDiffReflGnd(SurfLoop), + SurfQRadSWOutIncBmToDiffReflGnd(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -2347,7 +2346,7 @@ namespace SolarShading { // CurrentModuleObject='TDD Diffusers' SetupOutputVariable("Surface Outside Face Incident Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - QRadSWOutIncident(SurfLoop), + SurfQRadSWOutIncident(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -2384,25 +2383,25 @@ namespace SolarShading { // CurrentModuleObject='Surfaces' SetupOutputVariable("Surface Inside Face Exterior Windows Incident Beam Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - BmIncInsSurfIntensRep(SurfLoop), + SurfBmIncInsSurfIntensRep(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Exterior Windows Incident Beam Solar Radiation Rate", OutputProcessor::Unit::W, - BmIncInsSurfAmountRep(SurfLoop), + SurfBmIncInsSurfAmountRep(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Interior Windows Incident Beam Solar Radiation Rate per Area", OutputProcessor::Unit::W_m2, - IntBmIncInsSurfIntensRep(SurfLoop), + SurfIntBmIncInsSurfIntensRep(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); SetupOutputVariable("Surface Inside Face Interior Windows Incident Beam Solar Radiation Rate", OutputProcessor::Unit::W, - IntBmIncInsSurfAmountRep(SurfLoop), + SurfIntBmIncInsSurfAmountRep(SurfLoop), "Zone", "Average", Surface(SurfLoop).Name); @@ -8315,8 +8314,8 @@ namespace SolarShading { SurfWinBmSolTransThruIntWinRep(BackSurfNum) * TimeStepZoneSec; } } // End of check if back surface is opaque or window - BmIncInsSurfAmountRep(BackSurfNum) += BOverlap; - SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRep(BackSurfNum) += BOverlap; + SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = SurfBmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; } // End of loop over back surfaces } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { // For complex window calculation goes over outgoing basis directions @@ -8584,8 +8583,8 @@ namespace SolarShading { SurfWinBmSolTransThruIntWinRep(BackSurfNum) * TimeStepZoneSec; } } // End of check if back surface is opaque or window - BmIncInsSurfAmountRep(BackSurfNum) += BOverlap; - SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = BmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRep(BackSurfNum) += BOverlap; + SurfBmIncInsSurfAmountRepEnergy(BackSurfNum) = SurfBmIncInsSurfAmountRep(BackSurfNum) * TimeStepZoneSec; } // End of loop over back surfaces // ***************************** @@ -8683,23 +8682,23 @@ namespace SolarShading { // Variables for reporting for (int const SurfNum : thisEnclosure.SurfacePtr) { if (SolarDistribution == FullInteriorExterior) { - BmIncInsSurfAmountRep(SurfNum) *= BeamSolarRad; - SurfBmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; - BmIncInsSurfIntensRep(SurfNum) = BmIncInsSurfAmountRep(SurfNum) / (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); + SurfBmIncInsSurfAmountRep(SurfNum) *= BeamSolarRad; + SurfBmIncInsSurfAmountRepEnergy(SurfNum) = SurfBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfIntensRep(SurfNum) = SurfBmIncInsSurfAmountRep(SurfNum) / (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)); } else { // Simple interior solar distribution. All beam falls on floor. if (ISABSF(SurfNum) > 0.0 && Surface(SurfNum).HeatTransSurf) { if (thisEnclosure.FloorArea > 0.0) { // spread onto all floor surfaces, these may or may not be called "floor" - BmIncInsSurfIntensRep(SurfNum) = BeamSolarRad * BTOTZone / thisEnclosure.FloorArea; + SurfBmIncInsSurfIntensRep(SurfNum) = BeamSolarRad * BTOTZone / thisEnclosure.FloorArea; } else if (thisEnclosure.TotalSurfArea > 0.0) { // spread onto all interior surfaces - BmIncInsSurfIntensRep(SurfNum) = BeamSolarRad * BTOTZone / thisEnclosure.TotalSurfArea; + SurfBmIncInsSurfIntensRep(SurfNum) = BeamSolarRad * BTOTZone / thisEnclosure.TotalSurfArea; } else { // divide be zero otherwise - BmIncInsSurfIntensRep(SurfNum) = 0.0; + SurfBmIncInsSurfIntensRep(SurfNum) = 0.0; } } - BmIncInsSurfAmountRep(SurfNum) = Surface(SurfNum).Area * BmIncInsSurfIntensRep(SurfNum); - SurfBmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; + SurfBmIncInsSurfAmountRep(SurfNum) = Surface(SurfNum).Area * SurfBmIncInsSurfIntensRep(SurfNum); + SurfBmIncInsSurfAmountRepEnergy(SurfNum) = SurfBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; } if (Surface(SurfNum).Class == SurfaceClass_Window || Surface(SurfNum).Class == SurfaceClass_TDD_Dome) { @@ -8975,10 +8974,10 @@ namespace SolarShading { // is becuase BeamSolarRad is direct normal radiation (looking at the Sun) while QRadSWOutIncident // is normal to window incidence. Since BSDF coefficients are taking into account angle of incidence, // BeamSolarRad should be used in this case - QRadSWwinAbs(Lay, SurfNum) = cplxState.WinSkyFtAbs(Lay) * SurfSkySolarInc(SurfNum2) + + SurfWinQRadSWwinAbs(Lay, SurfNum) = cplxState.WinSkyFtAbs(Lay) * SurfSkySolarInc(SurfNum2) + cplxState.WinSkyGndAbs(Lay) * SurfGndSolarInc(SurfNum2) + AWinSurf(Lay, SurfNum) * BeamSolarRad + AWinCFOverlap(Lay, SurfNum) * BeamSolarRad; - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; AWinSurfDiffFront(Lay, SurfNum) = cplxState.WinSkyGndAbs(Lay); } } else { @@ -8998,8 +8997,8 @@ namespace SolarShading { // incidence is already taken into account auto absBeam = AWinSurf(Lay, SurfNum) * BeamSolarRad; auto absDiff = AWinSurfDiffFront(Lay, SurfNum) * (SurfSkySolarInc(SurfNum2) + SurfGndSolarInc(SurfNum2)); - QRadSWwinAbs(Lay, SurfNum) = (absBeam + absDiff); - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = QRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbs(Lay, SurfNum) = (absBeam + absDiff); + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; } } } @@ -11837,7 +11836,7 @@ namespace SolarShading { using General::InterpSw; using ScheduleManager::GetCurrentScheduleValue; using namespace DataViewFactorInformation; - using DataHeatBalance::InitialDifSolwinAbs; + using DataHeatBalance::SurfWinInitialDifSolwinAbs; using DataHeatBalance::InitialZoneDifSolReflW; using DataHeatBalSurface::SurfOpaqInitialDifSolInAbs; using DataHeatBalSurface::SurfWinInitialDifSolInTrans; @@ -11890,7 +11889,7 @@ namespace SolarShading { // Init accumulators for absorbed diffuse solar for all surfaces for later heat balance calcs SurfOpaqInitialDifSolInAbs = 0.0; - InitialDifSolwinAbs = 0.0; + SurfWinInitialDifSolwinAbs = 0.0; // Init accumulator for total reflected diffuse solar within each zone for interreflection calcs InitialZoneDifSolReflW = 0.0; @@ -12043,7 +12042,7 @@ namespace SolarShading { ZoneDifSolarDistAbsorbedTotl += WinDifSolLayAbsW; // debug // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; } // Calc diffuse solar reflected back to zone @@ -12145,7 +12144,7 @@ namespace SolarShading { ZoneDifSolarDistAbsorbedTotl += WinDifSolLayAbsW; // debug // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; } // Next calc diffuse solar reflected back to zone from window with shade or blind on @@ -12221,7 +12220,7 @@ namespace SolarShading { ZoneDifSolarDistAbsorbedTotl += WinDifSolLayAbsW; // debug // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; } // Calc diffuse solar reflected back to zone @@ -12268,7 +12267,7 @@ namespace SolarShading { ZoneDifSolarDistAbsorbedTotl += WinDifSolLayAbsW; // debug // Accumulate diffuse solar absorbed from the inside by each window layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(Lay, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; + SurfWinInitialDifSolwinAbs(Lay, HeatTransSurfNum) += WinDifSolLayAbsW * per_HTSurfaceArea; // ASHWAT equivalent layer model may require not the individual layer absorption but the flux // InitialDifSolwinEQL(HeatTransSurfNum) = WinDifSolar(DifTransSurfNum)* ViewFactor @@ -12422,7 +12421,7 @@ namespace SolarShading { using General::InterpSw; using ScheduleManager::GetCurrentScheduleValue; using namespace DataViewFactorInformation; - using DataHeatBalance::InitialDifSolwinAbs; + using DataHeatBalance::SurfWinInitialDifSolwinAbs; using DataHeatBalance::InitialZoneDifSolReflW; using DataHeatBalSurface::SurfOpaqInitialDifSolInAbs; using DataHeatBalSurface::SurfWinInitialDifSolInTrans; @@ -12579,7 +12578,7 @@ namespace SolarShading { DifSolarAbsW += WinDifSolLayAbsW; // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); } // Accumulate Window and Zone total distributed diffuse solar to check for conservation of energy // WinDifSolarDistAbsorbedTotl += DifSolarAbsW; // debug @@ -12659,7 +12658,7 @@ namespace SolarShading { DifSolarAbsW += WinDifSolLayAbsW; // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); } // Accumulate Window and Zone total distributed diffuse solar to check for conservation of energy // WinDifSolarDistAbsorbedTotl += DifSolarAbsW; // debug @@ -12734,7 +12733,7 @@ namespace SolarShading { DifSolarAbsW += WinDifSolLayAbsW; // Accumulate diffuse solar absorbed from the inside by each window glass layer [W/m2] for heat balance calcs - InitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); + SurfWinInitialDifSolwinAbs(IGlass, HeatTransSurfNum) += (WinDifSolLayAbsW / Surface(HeatTransSurfNum).Area); } // Accumulate Window and Zone total distributed diffuse solar to check for conservation of energy // WinDifSolarDistAbsorbedTotl += DifSolarAbsW; // debug diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 55779efeee8..7515fa45f94 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -825,7 +825,7 @@ namespace SwimmingPool { // LW and SW radiation term modification: any "excess" radiation blocked by the cover gets convected // to the air directly and added to the zone air heat balance Real64 LWsum = - (DataHeatBalance::QRadThermInAbs(SurfNum) + DataHeatBalSurface::SurfNetLWRadToSurf(SurfNum) + DataHeatBalFanSys::QHTRadSysSurf(SurfNum) + + (DataHeatBalance::SurfQRadThermInAbs(SurfNum) + DataHeatBalSurface::SurfNetLWRadToSurf(SurfNum) + DataHeatBalFanSys::QHTRadSysSurf(SurfNum) + DataHeatBalFanSys::QHWBaseboardSurf(SurfNum) + DataHeatBalFanSys::QSteamBaseboardSurf(SurfNum) + DataHeatBalFanSys::QElecBaseboardSurf(SurfNum)); // summation of all long-wavelenth radiation going to surface Real64 LWtotal = this->CurCoverLWRadFac * LWsum; // total flux from long-wavelength radiation to surface diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 8ecabda1f8e..325f4db2a7f 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -116,7 +116,7 @@ namespace TranspiredCollector { using DataGlobals::DegToRadians; using DataGlobals::KelvinConv; using DataGlobals::SecInHour; - using DataHeatBalance::QRadSWOutIncident; + using DataHeatBalance::SurfQRadSWOutIncident; using DataVectorTypes::Vector; // Data @@ -1117,7 +1117,7 @@ namespace TranspiredCollector { // Isc = sum( QRadSWOutIncident( UTSC( UTSCNum ).SurfPtrs ) * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / AreaSum; ////Autodesk:F2C++ Array subscript usage: Replaced by below - Isc = sum_product_sub(QRadSWOutIncident, Surface, &SurfaceData::Area, UTSC(UTSCNum).SurfPtrs) / + Isc = sum_product_sub(SurfQRadSWOutIncident, Surface, &SurfaceData::Area, UTSC(UTSCNum).SurfPtrs) / AreaSum; // Autodesk:F2C++ Functions handle array subscript usage // Tso = sum( TH( UTSC( UTSCNum ).SurfPtrs, 1, 1 ) * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / AreaSum; //Autodesk:F2C++ Array // subscript usage: Replaced by below diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 01014f4b076..7d0e0aa89fd 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -3132,13 +3132,13 @@ namespace WindowComplexManager { // direct solar radiation if (CalcCondition == noCondition) { ShadeFlag = SurfWinShadingFlag(SurfNum); - dir = QRadSWOutIncident(SurfNum) + QS(Surface(SurfNum).SolarEnclIndex); // TODO, check , ! + dir = SurfQRadSWOutIncident(SurfNum) + QS(Surface(SurfNum).SolarEnclIndex); // TODO, check , ! // currently using Exterior beam plus diffuse solar incident on surface // plus zone short wave. CHECK // if (dir.ne.0.0d0) then for (IGlass = 1; IGlass <= nlayer; ++IGlass) { // IF (dir > 0.0D0 ) THEN - asol(IGlass) = QRadSWwinAbs(IGlass, SurfNum); + asol(IGlass) = SurfWinQRadSWwinAbs(IGlass, SurfNum); // ELSE // asol(IGLASS) = 0.0D0 // ENDIF @@ -3147,7 +3147,7 @@ namespace WindowComplexManager { // Add contribution of IR from zone internal gains (lights, equipment and people). This is absorbed in zone-side layer and it // is assumed that nothing is transmitted through - asol(nlayer) += QRadThermInAbs(SurfNum); + asol(nlayer) += SurfQRadThermInAbs(SurfNum); presure = OutBaroPress; @@ -3363,7 +3363,7 @@ namespace WindowComplexManager { SurfOutsideTemp = theta(1) - KelvinConv; SurfOutsideEmiss = emis(1); - IncidentSolar = Surface(SurfNum).Area * QRadSWOutIncident(SurfNum); + IncidentSolar = Surface(SurfNum).Area * SurfQRadSWOutIncident(SurfNum); if (ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) { // Interior shade or blind ConvHeatFlowNatural = -qv(nlayer) * height * width; @@ -3490,9 +3490,9 @@ namespace WindowComplexManager { } if (SunIsUp) { SurfWinSysSolTransmittance(SurfNum) = - SurfWinTransSolar(SurfNum) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); + SurfWinTransSolar(SurfNum) / (SurfQRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolAbsorptance(SurfNum) = (SurfWinQRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / - (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); + (SurfQRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolReflectance(SurfNum) = 1.0 - SurfWinSysSolTransmittance(SurfNum) - SurfWinSysSolAbsorptance(SurfNum); } else { SurfWinSysSolTransmittance(SurfNum) = 0.0; diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 2e420f80a1c..5368ba7013b 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -831,7 +831,7 @@ namespace WindowEquivalentLayer { // The IR radiance of this window's "exterior" surround is the IR radiance // from surfaces and high-temp radiant sources in the adjacent zone outir = SurfWinIRfromParentZone(SurfNumAdj) + QHTRadSysSurf(SurfNumAdj) + QCoolingPanelSurf(SurfNumAdj) + - QHWBaseboardSurf(SurfNumAdj) + QSteamBaseboardSurf(SurfNumAdj) + QElecBaseboardSurf(SurfNumAdj) + QRadThermInAbs(SurfNumAdj); + QHWBaseboardSurf(SurfNumAdj) + QSteamBaseboardSurf(SurfNumAdj) + QElecBaseboardSurf(SurfNumAdj) + SurfQRadThermInAbs(SurfNumAdj); } else { // Exterior window (ExtBoundCond = 0) // Calculate LWR from surrounding surfaces if defined for an exterior window @@ -879,11 +879,11 @@ namespace WindowEquivalentLayer { // Indoor mean radiant temperature. // IR incident on window from zone surfaces and high-temp radiant sources rmir = SurfWinIRfromParentZone(SurfNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + - QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + QRadThermInAbs(SurfNum); + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum) + SurfQRadThermInAbs(SurfNum); TRMIN = root_4(rmir / StefanBoltzmann); // TODO check model equation. NL = CFS(EQLNum).NL; - QAllSWwinAbs({1, NL + 1}) = QRadSWwinAbs({1, NL + 1}, SurfNum); + QAllSWwinAbs({1, NL + 1}) = SurfWinQRadSWwinAbs({1, NL + 1}, SurfNum); // Solve energy balance(s) for temperature at each node/layer and // heat flux, including components, between each pair of nodes/layers ASHWAT_ThermalCalc(dataWindowEquivalentLayer, CFS(EQLNum), TIN, Tout, HcIn, HcOut, TRMOUT, TRMIN, QAllSWwinAbs({1, NL + 1}), TOL, QOCF, QOCFRoom, T, Q, JF, JB, H); diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 4120140a3a4..ee44e0368e5 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2332,14 +2332,14 @@ namespace WindowManager { // absorbed at each face. Assumes equal split between faces of short-wave absorbed in glass layer. for (IGlass = 1; IGlass <= TotGlassLay; ++IGlass) { - dataWindowManager.AbsRadGlassFace(2 * IGlass - 1) = QRadSWwinAbs(IGlass, SurfNum) / 2.0; - dataWindowManager.AbsRadGlassFace(2 * IGlass) = QRadSWwinAbs(IGlass, SurfNum) / 2.0; + dataWindowManager.AbsRadGlassFace(2 * IGlass - 1) = SurfWinQRadSWwinAbs(IGlass, SurfNum) / 2.0; + dataWindowManager.AbsRadGlassFace(2 * IGlass) = SurfWinQRadSWwinAbs(IGlass, SurfNum) / 2.0; } // IR from zone internal gains (lights, equipment and people) absorbed on zone-side face // (assumes inside glass layer is opaque to IR, so no contribution to other layers) - dataWindowManager.AbsRadGlassFace(2 * TotGlassLay) += QRadThermInAbs(SurfNum); + dataWindowManager.AbsRadGlassFace(2 * TotGlassLay) += SurfQRadThermInAbs(SurfNum); // Fill the layer properties needed for the thermal calculation. // For switchable glazing it is assumed that thermal properties, such @@ -2537,7 +2537,7 @@ namespace WindowManager { // Add long-wave radiation from adjacent zone absorbed by glass layer closest to the adjacent zone. - dataWindowManager.AbsRadGlassFace(1) += QRadThermInAbs(SurfNumAdj); + dataWindowManager.AbsRadGlassFace(1) += SurfQRadThermInAbs(SurfNumAdj); // The IR radiance of this window's "exterior" surround is the IR radiance // from surfaces and high-temp radiant sources in the adjacent zone @@ -3476,7 +3476,7 @@ namespace WindowManager { // For interior shade, add convective gain from glass/shade gap air flow to zone convective gain; // For all cases, get total window heat gain for reporting. See CalcWinFrameAndDividerTemps for // contribution of frame and divider. - IncidentSolar = Surface(SurfNum).Area * QRadSWOutIncident(SurfNum); + IncidentSolar = Surface(SurfNum).Area * SurfQRadSWOutIncident(SurfNum); if (ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) { // Interior shade or blind SurfWinConvHeatFlowNatural(SurfNum) = ConvHeatFlowNatural; @@ -3581,9 +3581,9 @@ namespace WindowManager { } if (SunIsUp) { SurfWinSysSolTransmittance(SurfNum) = - SurfWinTransSolar(SurfNum) / (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); + SurfWinTransSolar(SurfNum) / (SurfQRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolAbsorptance(SurfNum) = (SurfWinQRadSWwinAbsTot(SurfNum) + SurfWinShadingAbsorbedSolar(SurfNum)) / - (QRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); + (SurfQRadSWOutIncident(SurfNum) * (Surface(SurfNum).Area + SurfWinDividerArea(SurfNum)) + 0.0001); SurfWinSysSolReflectance(SurfNum) = 1.0 - SurfWinSysSolTransmittance(SurfNum) - SurfWinSysSolAbsorptance(SurfNum); } else { SurfWinSysSolTransmittance(SurfNum) = 0.0; diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index 461e3882e48..e39821a4c1e 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -455,9 +455,9 @@ namespace WindowManager { auto swRadiation = surface.getSWIncident(t_SurfNum); if (swRadiation > 0) { - auto absCoeff = QRadSWwinAbs(t_Index, t_SurfNum) / swRadiation; + auto absCoeff = SurfWinQRadSWwinAbs(t_Index, t_SurfNum) / swRadiation; if ((2 * t_Index - 1) == m_TotLay) { - absCoeff += QRadThermInAbs(t_SurfNum) / swRadiation; + absCoeff += SurfQRadThermInAbs(t_SurfNum) / swRadiation; } aSolidLayer->setSolarAbsorptance(absCoeff); diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 109c583b7db..f5d2964c427 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -3110,9 +3110,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) DataHeatBalance::ZoneBmSolFrIntWinsRep(1) = 10.0; DataEnvironment::SunIsUp = false; InitIntSolarDistribution(); - EXPECT_EQ(0.0, DataHeatBalance::IntBmIncInsSurfIntensRep(1)); + EXPECT_EQ(0.0, DataHeatBalance::SurfIntBmIncInsSurfIntensRep(1)); DataEnvironment::SunIsUp = true; InitIntSolarDistribution(); - EXPECT_NEAR(1.666667, DataHeatBalance::IntBmIncInsSurfIntensRep(1), 0.00001); + EXPECT_NEAR(1.666667, DataHeatBalance::SurfIntBmIncInsSurfIntensRep(1), 0.00001); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 40c3df1430d..f132fc49dee 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -126,8 +126,8 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest TH.allocate(NumOfSurf, 1, 2); TH(SurfNum, 1, 1) = 22.0; // allocate solar incident radiation variable data - QRadSWOutIncident.allocate(1); - QRadSWOutIncident(1) = 0.0; + SurfQRadSWOutIncident.allocate(1); + SurfQRadSWOutIncident(1) = 0.0; // set user defined conv. coeff. calculation to false state.dataConvectionCoefficients.GetUserSuppliedConvectionCoeffs = false; @@ -171,5 +171,5 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest ExtVentedCavity.deallocate(); Zone.deallocate(); TH.deallocate(); - QRadSWOutIncident.deallocate(); + SurfQRadSWOutIncident.deallocate(); } diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 99bbd91abe6..df7bd04d1bc 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -519,9 +519,9 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) DataHeatBalFanSys::QHWBaseboardSurf.allocate(3); DataHeatBalFanSys::QSteamBaseboardSurf.allocate(3); DataHeatBalFanSys::QElecBaseboardSurf.allocate(3); - DataHeatBalance::QRadSWwinAbs.allocate(1, 3); - DataHeatBalance::QRadThermInAbs.allocate(3); - DataHeatBalance::QRadSWOutIncident.allocate(3); + DataHeatBalance::SurfWinQRadSWwinAbs.allocate(1, 3); + DataHeatBalance::SurfQRadThermInAbs.allocate(3); + DataHeatBalance::SurfQRadSWOutIncident.allocate(3); DataSurfaces::SurfWinTransSolar.allocate(3); DataHeatBalance::ZoneWinHeatGain.allocate(1); DataHeatBalance::ZoneWinHeatGainRep.allocate(1); @@ -552,9 +552,9 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) DataHeatBalSurface::QAirExtReport.allocate(3); DataHeatBalSurface::QHeatEmiReport.allocate(3); - DataHeatBalance::QRadSWOutIncident = 0.0; - DataHeatBalance::QRadSWwinAbs = 0.0; - DataHeatBalance::QRadThermInAbs = 0.0; + DataHeatBalance::SurfQRadSWOutIncident = 0.0; + DataHeatBalance::SurfWinQRadSWwinAbs = 0.0; + DataHeatBalance::SurfQRadThermInAbs = 0.0; DataHeatBalFanSys::QHTRadSysSurf = 0.0; DataHeatBalFanSys::QHWBaseboardSurf = 0.0; @@ -2746,9 +2746,9 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) DataHeatBalFanSys::QHWBaseboardSurf.allocate(3); DataHeatBalFanSys::QSteamBaseboardSurf.allocate(3); DataHeatBalFanSys::QElecBaseboardSurf.allocate(3); - DataHeatBalance::QRadSWwinAbs.allocate(1, 3); - DataHeatBalance::QRadThermInAbs.allocate(3); - DataHeatBalance::QRadSWOutIncident.allocate(3); + DataHeatBalance::SurfWinQRadSWwinAbs.allocate(1, 3); + DataHeatBalance::SurfQRadThermInAbs.allocate(3); + DataHeatBalance::SurfQRadSWOutIncident.allocate(3); DataSurfaces::SurfWinTransSolar.allocate(3); DataHeatBalance::ZoneWinHeatGain.allocate(1); DataHeatBalance::ZoneWinHeatGainRep.allocate(1); @@ -2779,9 +2779,9 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) DataHeatBalSurface::QAirExtReport.allocate(3); DataHeatBalSurface::QHeatEmiReport.allocate(3); - DataHeatBalance::QRadSWOutIncident = 0.0; - DataHeatBalance::QRadSWwinAbs = 0.0; - DataHeatBalance::QRadThermInAbs = 0.0; + DataHeatBalance::SurfQRadSWOutIncident = 0.0; + DataHeatBalance::SurfWinQRadSWwinAbs = 0.0; + DataHeatBalance::SurfQRadThermInAbs = 0.0; DataHeatBalFanSys::QHTRadSysSurf = 0.0; DataHeatBalFanSys::QHWBaseboardSurf = 0.0; From b5d30ed61fbb1ae0597977798bc067ab8f2a638f Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 4 Sep 2020 10:34:37 -0700 Subject: [PATCH 04/25] fix tdd --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 126 ++++++++++++-------- 1 file changed, 73 insertions(+), 53 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 68dbbce0865..dae242b24a1 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2332,29 +2332,29 @@ namespace HeatBalanceSurfaceManager { using SolarShading::SurfaceScheduledSolarInc; using SolarShading::WindowScheduledSolarAbs; - Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) - int ConstrNum; // Index for the Construct derived type - int ConstrNumSh; // Shaded window construction - Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) - int RoughIndexMovInsul; // Roughness index of movable insulation - int SurfNum2; // TDD:DOME object number - int PipeNum; // TDD pipe object number - int ShelfNum; // Daylighting shelf object number - int InShelfSurf; // Inside daylighting shelf surface number - int OutShelfSurf; // Outside daylighting shelf surface number - Real64 ShelfSolarRad; // Shelf diffuse solar radiation - int ShadeFlag; // Window shading flag - Real64 SwitchFac; // Switching factor for switchable glazing - Real64 BeamSolar; // Local variable for BeamSolarRad - Real64 SkySolarInc; // Sky diffuse solar incident on a surface - Real64 GndSolarInc; // Ground diffuse solar incident on a surface - int TotGlassLay; // Number of glass layers - int TotSolidLay; // Number of solid layers in fenestration system (glass + shading) - int CurrentState; // Current state for Complex Fenestration +// Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) +// int ConstrNum; // Index for the Construct derived type +// int ConstrNumSh; // Shaded window construction +// Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) +// int RoughIndexMovInsul; // Roughness index of movable insulation +// int SurfNum2; // TDD:DOME object number +// int PipeNum; // TDD pipe object number +// int ShelfNum; // Daylighting shelf object number +// int InShelfSurf; // Inside daylighting shelf surface number +// int OutShelfSurf; // Outside daylighting shelf surface number +// Real64 ShelfSolarRad; // Shelf diffuse solar radiation +// int ShadeFlag; // Window shading flag +// Real64 SwitchFac; // Switching factor for switchable glazing +// Real64 BeamSolar; // Local variable for BeamSolarRad +// Real64 SkySolarInc; // Sky diffuse solar incident on a surface +// Real64 GndSolarInc; // Ground diffuse solar incident on a surface +// int TotGlassLay; // Number of glass layers +// int TotSolidLay; // Number of solid layers in fenestration system (glass + shading) +// int CurrentState; // Current state for Complex Fenestration static Array1D AbsDiffWin(CFSMAXNL); // Diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static - int Lay; // Layer number +// int Lay; // Layer number Real64 DividerAbs; // Window divider solar absorptance Real64 DividerRefl; // Window divider solar reflectance int MatNumGl; // Outer glass layer material number @@ -2407,7 +2407,7 @@ namespace HeatBalanceSurfaceManager { Real64 BeamDivVertFaceInc; // Beam solar on divider's vertical outside projection faces (W/m2) Real64 BeamDivHorFaceIncIn; // Beam solar on divider's horizontal inside projection faces (W/m2) Real64 BeamDivVertFaceIncIn; // Beam solar on divider's vertical inside projection faces (W/m2) - int BlNum; // Blind number +// int BlNum; // Blind number Real64 ProfAng; // Solar profile angle (rad) Real64 SlatAng; // Slat angle (rad) Real64 TBlBmBm; // Blind beam-beam solar transmittance @@ -2636,6 +2636,12 @@ namespace HeatBalanceSurfaceManager { for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { SurfWinTransSolar(SurfNum) = 0.0; SurfWinTransSolarEnergy(SurfNum) = 0.0; + SurfQRadSWOutIncident(SurfNum) = 0.0; + } + for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = 0.0; + } } for (auto &e : TDDPipe) { e.TransSolBeam = 0.0; @@ -2665,23 +2671,24 @@ namespace HeatBalanceSurfaceManager { SurfWinBmGndSolarInc(SurfNum) = 0.0; } if (CalcSolRefl) { + // [ lSH ] == ( HourOfDay, SurfNum ) // [ lSP ] == ( PreviousHour, SurfNum ) + Array1D::size_type lSH = ReflFacBmToBmSolObs.index(HourOfDay, 1) - 1; + Array1D::size_type lSP = ReflFacBmToBmSolObs.index(PreviousHour, 1) - 1; // For Complex Fenestrations: for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - Array1D::size_type lSH = ReflFacBmToBmSolObs.index(HourOfDay, 1) + SurfNum - 1; - Array1D::size_type lSP = ReflFacBmToBmSolObs.index(PreviousHour, 1) + SurfNum - 1; - // [ lSH ] == ( HourOfDay, SurfNum ) // [ lSP ] == ( PreviousHour, SurfNum ) SurfWinSkyGndSolarInc(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); SurfWinBmGndSolarInc(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - BmToBmReflFacObs(SurfNum) = WeightNow * ReflFacBmToBmSolObs[lSH] + WeightPreviousHour * ReflFacBmToBmSolObs[lSP]; - BmToDiffReflFacObs(SurfNum) = WeightNow * ReflFacBmToDiffSolObs[lSH] + WeightPreviousHour * ReflFacBmToDiffSolObs[lSP]; - BmToDiffReflFacGnd(SurfNum) = WeightNow * ReflFacBmToDiffSolGnd[lSH] + WeightPreviousHour * ReflFacBmToDiffSolGnd[lSP]; - + BmToBmReflFacObs(SurfNum) = WeightNow * ReflFacBmToBmSolObs[lSH + SurfNum] + + WeightPreviousHour * ReflFacBmToBmSolObs[lSP + SurfNum]; + BmToDiffReflFacObs(SurfNum) = WeightNow * ReflFacBmToDiffSolObs[lSH + SurfNum] + + WeightPreviousHour * ReflFacBmToDiffSolObs[lSP + SurfNum]; + BmToDiffReflFacGnd(SurfNum) = WeightNow * ReflFacBmToDiffSolGnd[lSH + SurfNum] + + WeightPreviousHour * ReflFacBmToDiffSolGnd[lSP + SurfNum]; // TH2 CR 9056 SurfSkySolarInc(SurfNum) += BeamSolarRad * (BmToBmReflFacObs(SurfNum) + BmToDiffReflFacObs(SurfNum)) + DifSolarRad * ReflFacSkySolObs(SurfNum); SurfGndSolarInc(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum) + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - } } @@ -2773,22 +2780,25 @@ namespace HeatBalanceSurfaceManager { // END DO for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + int ConstrNum = 0; if (Surface(SurfNum).HeatTransSurf) { ConstrNum = Surface(SurfNum).Construction; if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } else { - ConstrNum = 0; } - ShelfNum = Surface(SurfNum).Shelf; + int ShelfNum = Surface(SurfNum).Shelf; + int InShelfSurf = 0; + int OutShelfSurf = 0; if (ShelfNum > 0) { 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; } if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int PipeNum; + int SurfNum2; + Real64 BeamSolar; + Real64 SkySolarInc; + Real64 GndSolarInc; if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { PipeNum = SurfWinTDDPipeNum(SurfNum); @@ -2814,7 +2824,7 @@ namespace HeatBalanceSurfaceManager { BeamSolar = BeamSolarRad; SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); - ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + DifSolarRad * AnisoSkyMult(OutShelfSurf)) * Shelf(ShelfNum).OutReflectSol; @@ -2880,7 +2890,9 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above - RoughIndexMovInsul = 0; + int RoughIndexMovInsul = 0; + Real64 HMovInsul; + Real64 AbsExt; if (Surface(SurfNum).MaterialMovInsulExt > 0) EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); @@ -2891,25 +2903,26 @@ namespace HeatBalanceSurfaceManager { AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; } else { // Exterior window + int ShadeFlag = SurfWinShadingFlag(SurfNum); if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && SurfWinWindowModelType(SurfNum) != WindowEQLModel && !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); } ShadeFlag = SurfWinShadingFlag(SurfNum); if (ShadeFlag > 0) { // Shaded window - ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); } SurfWinExtDiffAbsByShade(SurfNum) = @@ -2917,7 +2930,7 @@ namespace HeatBalanceSurfaceManager { } if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { // Blind on - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), @@ -2954,8 +2967,8 @@ namespace HeatBalanceSurfaceManager { SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - SwitchFac = SurfWinSwitchingFactor(SurfNum); - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay)); } @@ -2964,10 +2977,11 @@ namespace HeatBalanceSurfaceManager { } // End of check if window has shading device on SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; // AWinSurf is from InteriorSolarDistribution if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { AbsDiffGlassLayGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), @@ -3001,12 +3015,12 @@ namespace HeatBalanceSurfaceManager { // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); // } } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - TotSolidLay = dataConstruction.Construct(ConstrNum).TotSolidLayers; - CurrentState = SurfaceWindow(SurfNum).ComplexFen.CurrentState; + int TotSolidLay = dataConstruction.Construct(ConstrNum).TotSolidLayers; + int CurrentState = SurfaceWindow(SurfNum).ComplexFen.CurrentState; // Examine for schedule surface gain SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum); - for (Lay = 1; Lay <= TotSolidLay; ++Lay) { + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { if (SurfSolAbs != 0) { AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue(FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); // ABWin(Lay) = AWinSurf(SurfNum,Lay) @@ -3030,13 +3044,13 @@ namespace HeatBalanceSurfaceManager { } SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - ShadeFlag = SurfWinShadingFlag(SurfNum); +// ShadeFlag = SurfWinShadingFlag(SurfNum); } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr - TotSolidLay = CFS(dataConstruction.Construct(Surface(SurfNum).Construction).EQLConsPtr).NL; - for (Lay = 1; Lay <= TotSolidLay; ++Lay) { + int TotSolidLay = CFS(dataConstruction.Construct(Surface(SurfNum).Construction).EQLConsPtr).NL; + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { // 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 @@ -3146,6 +3160,8 @@ namespace HeatBalanceSurfaceManager { TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; @@ -3185,6 +3201,8 @@ namespace HeatBalanceSurfaceManager { TransGl = dataMaterial.Material(MatNumGl).Trans; ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint(1); TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; @@ -3221,6 +3239,8 @@ namespace HeatBalanceSurfaceManager { TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; @@ -3252,7 +3272,7 @@ namespace HeatBalanceSurfaceManager { } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || ShadeFlag == ExtScreenOn) { if (ShadeFlag == ExtBlindOn) { // Exterior blind - BlNum = SurfWinBlindNumber(SurfNum); + int BlNum = SurfWinBlindNumber(SurfNum); ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); SlatAng = SurfWinSlatAngThisTS(SurfNum); TBlBmBm = BlindBeamBeamTrans( @@ -3269,7 +3289,7 @@ namespace HeatBalanceSurfaceManager { InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), Blind(BlNum).SolFrontDiffDiffTrans)); } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * (DivIncSolarOutBm + DivIncSolarOutDif); From aaa0d4c03bc36484fef0ba01ff5ff6ac12158e7e Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 4 Sep 2020 14:47:43 -0700 Subject: [PATCH 05/25] locals --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 260 ++++++++++---------- 1 file changed, 132 insertions(+), 128 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index dae242b24a1..07fc43ce783 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2355,70 +2355,70 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static // int Lay; // Layer number - Real64 DividerAbs; // Window divider solar absorptance - Real64 DividerRefl; // Window divider solar reflectance - int MatNumGl; // Outer glass layer material number - int MatNumGlSh; // Outer glass layer material number, switched construction - Real64 TransGl; // Outer glass solar transmittance, reflectance, absorptance - Real64 ReflGl; - Real64 AbsGl; - Real64 TransGlSh; // Outer glass solar trans, refl, absorptance if switched - Real64 ReflGlSh; - Real64 AbsGlSh; - Real64 TransDiffGl; // Diffuse solar transmittance - Real64 TransDiffGlSh; // Diffuse solar transmittance, switched construction - int FrDivNum; // Frame/divider number - Real64 FrArea; // Frame, divider area (m2) - Real64 DivArea; - Real64 FrWidth; // Frame, divider width (m) - Real64 DivWidth; - Real64 FrProjOut; // Frame, divider outside projection (m) - Real64 DivProjOut; - Real64 FrProjIn; // Frame, divider outside projection (m) - Real64 DivProjIn; - Real64 PhiWin; // Altitude and azimuth angle of outward window normal (radians) - Real64 ThWin; - Real64 PhiSun; // Altitude and azimuth angle of sun (radians) - Real64 ThSun; - Real64 CosInc; // Cosine of incidence angle of beam solar on glass - Real64 CosIncAngHorProj; // Cosine of incidence angle of sun on horizontal faces of a frame or - // divider projection - Real64 CosIncAngVertProj; // Cosine of incidence angle of sun on vertical faces of a frame or - // divider projection - Real64 FracSunLit; // Fraction of window sunlit this time step - Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) - Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) - Real64 FrIncSolarOut; // Total solar incident on outside offrame including solar - // on frame projection (W/m2) - Real64 FrIncSolarIn; // Total solar incident on inside offrame including solar - // on frame projection (W/m2) - - Real64 DivIncSolarOutBm; // Beam solar incident on outside of divider including beam on divider - // projection (W/m2) - Real64 DivIncSolarOutDif; // Diffuse solar incident on outside of divider including diffuse on divider - // projection (W/m2) - Real64 DivIncSolarInBm; // Beam solar incident on inside of divider including beam on divider - // projection (W/m2) - Real64 DivIncSolarInDif; // Diffuse solar incident on inside of divider including diffuse on divider - // projection (W/m2) - Real64 BeamFrHorFaceInc; // Beam solar on frame's horizontal projection faces (W/m2) - Real64 BeamFrVertFaceInc; // Beam solar on frame's vertical projection faces (W/m2) - Real64 BeamDivHorFaceInc; // Beam solar on divider's horizontal outside projection faces (W/m2) - Real64 BeamDivVertFaceInc; // Beam solar on divider's vertical outside projection faces (W/m2) - Real64 BeamDivHorFaceIncIn; // Beam solar on divider's horizontal inside projection faces (W/m2) - Real64 BeamDivVertFaceIncIn; // Beam solar on divider's vertical inside projection faces (W/m2) -// int BlNum; // Blind number - Real64 ProfAng; // Solar profile angle (rad) - Real64 SlatAng; // Slat angle (rad) - Real64 TBlBmBm; // Blind beam-beam solar transmittance - Real64 TBlBmDif; // Blind diffuse-diffuse solar transmittance - Real64 ACosTlt; // Absolute value of cosine of surface tilt angle - Real64 AbsDiffBlindGnd; // System blind front ground diffuse solar absorptance at a particular slat angle - Real64 AbsDiffBlindSky; // System blind front sky diffuse solar absorptance at a particular slat angle - Real64 AbsDiffGlassLayGnd; // System glass layer ground diffuse solar absorptance with blind on - Real64 AbsDiffGlassLaySky; // System glass layer sky diffuse solar absorptance with blind on - int SurfSolAbs; // Pointer to scheduled surface gains object for fenestration systems - int SurfSolIncPtr; // Pointer to schedule surface gain object for interior side of the surface +// Real64 DividerAbs; // Window divider solar absorptance +// Real64 DividerRefl; // Window divider solar reflectance +// int MatNumGl; // Outer glass layer material number +// int MatNumGlSh; // Outer glass layer material number, switched construction +// Real64 TransGl; // Outer glass solar transmittance, reflectance, absorptance +// Real64 ReflGl; +// Real64 AbsGl; +// Real64 TransGlSh; // Outer glass solar trans, refl, absorptance if switched +// Real64 ReflGlSh; +// Real64 AbsGlSh; +// Real64 TransDiffGl; // Diffuse solar transmittance +// Real64 TransDiffGlSh; // Diffuse solar transmittance, switched construction +// int FrDivNum; // Frame/divider number +// Real64 FrArea; // Frame, divider area (m2) +// Real64 DivArea; +// Real64 FrWidth; // Frame, divider width (m) +// Real64 DivWidth; +// Real64 FrProjOut; // Frame, divider outside projection (m) +// Real64 DivProjOut; +// Real64 FrProjIn; // Frame, divider outside projection (m) +// Real64 DivProjIn; +// Real64 PhiWin; // Altitude and azimuth angle of outward window normal (radians) +// Real64 ThWin; +// Real64 PhiSun; // Altitude and azimuth angle of sun (radians) +// Real64 ThSun; +// Real64 CosInc; // Cosine of incidence angle of beam solar on glass +// Real64 CosIncAngHorProj; // Cosine of incidence angle of sun on horizontal faces of a frame or +// // divider projection +// Real64 CosIncAngVertProj; // Cosine of incidence angle of sun on vertical faces of a frame or +// // divider projection +// Real64 FracSunLit; // Fraction of window sunlit this time step +// Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) +// Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) +// Real64 FrIncSolarOut; // Total solar incident on outside offrame including solar +// // on frame projection (W/m2) +// Real64 FrIncSolarIn; // Total solar incident on inside offrame including solar +// // on frame projection (W/m2) +// +// Real64 DivIncSolarOutBm; // Beam solar incident on outside of divider including beam on divider +// // projection (W/m2) +// Real64 DivIncSolarOutDif; // Diffuse solar incident on outside of divider including diffuse on divider +// // projection (W/m2) +// Real64 DivIncSolarInBm; // Beam solar incident on inside of divider including beam on divider +// // projection (W/m2) +// Real64 DivIncSolarInDif; // Diffuse solar incident on inside of divider including diffuse on divider +// // projection (W/m2) +// Real64 BeamFrHorFaceInc; // Beam solar on frame's horizontal projection faces (W/m2) +// Real64 BeamFrVertFaceInc; // Beam solar on frame's vertical projection faces (W/m2) +// Real64 BeamDivHorFaceInc; // Beam solar on divider's horizontal outside projection faces (W/m2) +// Real64 BeamDivVertFaceInc; // Beam solar on divider's vertical outside projection faces (W/m2) +// Real64 BeamDivHorFaceIncIn; // Beam solar on divider's horizontal inside projection faces (W/m2) +// Real64 BeamDivVertFaceIncIn; // Beam solar on divider's vertical inside projection faces (W/m2) +//// int BlNum; // Blind number +// Real64 ProfAng; // Solar profile angle (rad) +// Real64 SlatAng; // Slat angle (rad) +// Real64 TBlBmBm; // Blind beam-beam solar transmittance +// Real64 TBlBmDif; // Blind diffuse-diffuse solar transmittance +// Real64 ACosTlt; // Absolute value of cosine of surface tilt angle +// Real64 AbsDiffBlindGnd; // System blind front ground diffuse solar absorptance at a particular slat angle +// Real64 AbsDiffBlindSky; // System blind front sky diffuse solar absorptance at a particular slat angle +// Real64 AbsDiffGlassLayGnd; // System glass layer ground diffuse solar absorptance with blind on +// Real64 AbsDiffGlassLaySky; // System glass layer sky diffuse solar absorptance with blind on +// int SurfSolAbs; // Pointer to scheduled surface gains object for fenestration systems +// int SurfSolIncPtr; // Pointer to schedule surface gain object for interior side of the surface // Always initialize the shortwave quantities @@ -2637,6 +2637,7 @@ namespace HeatBalanceSurfaceManager { SurfWinTransSolar(SurfNum) = 0.0; SurfWinTransSolarEnergy(SurfNum) = 0.0; SurfQRadSWOutIncident(SurfNum) = 0.0; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; } for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2796,6 +2797,7 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { int PipeNum; int SurfNum2; + Real64 CosInc; Real64 BeamSolar; Real64 SkySolarInc; Real64 GndSolarInc; @@ -2947,11 +2949,11 @@ namespace HeatBalanceSurfaceManager { dataConstruction.Construct(ConstrNumSh).AbsDiffBlind) * (SkySolarInc + GndSolarInc); if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - ACosTlt = std::abs(Surface(SurfNum).CosTilt); - AbsDiffBlindGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffBlindGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); - AbsDiffBlindSky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + Real64 AbsDiffBlindSky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); SurfWinExtDiffAbsByShade(SurfNum) = @@ -2983,10 +2985,11 @@ namespace HeatBalanceSurfaceManager { if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - AbsDiffGlassLayGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffGlassLayGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, 19}, Lay)); - AbsDiffGlassLaySky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + Real64 AbsDiffGlassLaySky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); @@ -3018,7 +3021,7 @@ namespace HeatBalanceSurfaceManager { int TotSolidLay = dataConstruction.Construct(ConstrNum).TotSolidLayers; int CurrentState = SurfaceWindow(SurfNum).ComplexFen.CurrentState; // Examine for schedule surface gain - SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum); + Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum); for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { if (SurfSolAbs != 0) { @@ -3092,8 +3095,15 @@ namespace HeatBalanceSurfaceManager { } // Solar absorbed by window frame and dividers - FrDivNum = Surface(SurfNum).FrameDivider; - FrArea = SurfWinFrameArea(SurfNum); + int FrDivNum = Surface(SurfNum).FrameDivider; + Real64 FrArea = SurfWinFrameArea(SurfNum); + Real64 FrWidth = 0.0; + Real64 FrProjOut = 0.0; + Real64 FrProjIn = 0.0; + Real64 DivArea = 0.0; + Real64 DivWidth = 0.0; + Real64 DivProjOut = 0.0; + Real64 DivProjIn = 0.0; if (FrDivNum > 0) { FrWidth = FrameDivider(FrDivNum).FrameWidth; FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; @@ -3102,23 +3112,16 @@ namespace HeatBalanceSurfaceManager { DivWidth = FrameDivider(FrDivNum).DividerWidth; DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - } else { - FrWidth = 0.0; - FrProjOut = 0.0; - FrProjIn = 0.0; - DivArea = 0.0; - DivWidth = 0.0; - DivProjOut = 0.0; - DivProjIn = 0.0; } - CosIncAngHorProj = 0.0; - CosIncAngVertProj = 0.0; + Real64 CosIncAngHorProj = 0.0; + Real64 CosIncAngVertProj = 0.0; + Real64 FracSunLit = 0.0; + Real64 BeamFaceInc; + Real64 DifSolarFaceInc; if (FrArea > 0.0 || DivArea > 0.0) { FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; DifSolarFaceInc = SkySolarInc + GndSolarInc; - } else { - FracSunLit = 0.0; } if (FracSunLit > 0.0) { if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || @@ -3127,10 +3130,10 @@ namespace HeatBalanceSurfaceManager { // 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 = std::asin(Surface(SurfNum).OutNormVec(3)); - ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), Surface(SurfNum).OutNormVec(1)); - PhiSun = std::asin(SOLCOS(3)); - ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec(3)); + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin(SOLCOS(3)); + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); Real64 const cos_PhiWin(std::cos(PhiWin)); Real64 const cos_PhiSun(std::cos(PhiSun)); CosIncAngHorProj = @@ -3144,27 +3147,27 @@ namespace HeatBalanceSurfaceManager { // (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.0) { - FrIncSolarOut = BeamFaceInc; - FrIncSolarIn = 0.0; - TransDiffGl = 0.0; + Real64 FrIncSolarOut = BeamFaceInc; + Real64 FrIncSolarIn = 0.0; + Real64 TransDiffGl = 0.0; if (FrProjOut > 0.0 || FrProjIn > 0.0) { - BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * DivWidth) * FracSunLit / - FrArea; - BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) * FracSunLit / - FrArea; + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * DivWidth) + * FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) + * FracSunLit / FrArea; // Beam solar on outside of frame FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; if (FrProjIn > 0.0) { - TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; + Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); } // Beam solar on inside of frame @@ -3193,31 +3196,31 @@ namespace HeatBalanceSurfaceManager { // DivProjIn will be zero in this case.) if (DivArea > 0.0) { // Solar absorbed by window divider - DividerAbs = SurfWinDividerSolAbsorp(SurfNum); + Real64 DividerAbs = SurfWinDividerSolAbsorp(SurfNum); if (SurfWinDividerType(SurfNum) == Suspended) { // 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 = dataConstruction.Construct(ConstrNum).LayerPoint(1); - TransGl = dataMaterial.Material(MatNumGl).Trans; - ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - AbsGl = 1.0 - TransGl - ReflGl; + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint(1); + Real64 TransGl = dataMaterial.Material(MatNumGl).Trans; + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint(1); - TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; - AbsGlSh = 1.0 - TransGlSh - ReflGlSh; + Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint(1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - DividerRefl = 1.0 - DividerAbs; + Real64 DividerRefl = 1.0 - DividerAbs; DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / (1.0 - DividerRefl * ReflGl); } - BeamDivHorFaceInc = 0.0; - BeamDivVertFaceInc = 0.0; + Real64 BeamDivHorFaceInc = 0.0; + Real64 BeamDivVertFaceInc = 0.0; // Beam incident on horizontal and vertical projection faces of divider if no exterior shading if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn) { BeamDivHorFaceInc = BeamSolarRad * CosIncAngHorProj * FrameDivider(FrDivNum).HorDividers * DivProjOut * @@ -3227,30 +3230,30 @@ namespace HeatBalanceSurfaceManager { (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) * FracSunLit / DivArea; } - DivIncSolarOutBm = 0.0; - DivIncSolarOutDif = 0.0; - DivIncSolarInBm = 0.0; - DivIncSolarInDif = 0.0; + Real64 DivIncSolarOutBm = 0.0; + Real64 DivIncSolarOutDif = 0.0; + Real64 DivIncSolarInBm = 0.0; + Real64 DivIncSolarInDif = 0.0; if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; DivIncSolarOutDif = DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); if (DivProjIn > 0.0) { - TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; + Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); } // 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 = + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * FrameDivider(FrDivNum).HorDividers * DivProjIn * + (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * DivWidth) * + FracSunLit / DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * FrameDivider(FrDivNum).VertDividers * DivProjIn * (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) * FracSunLit / DivArea; DivIncSolarInBm = TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); @@ -3273,11 +3276,12 @@ namespace HeatBalanceSurfaceManager { if (ShadeFlag == ExtBlindOn) { // Exterior blind int BlNum = SurfWinBlindNumber(SurfNum); + Real64 ProfAng; // Solar profile angle (rad) ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); - SlatAng = SurfWinSlatAngThisTS(SurfNum); - TBlBmBm = BlindBeamBeamTrans( + Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); + Real64 TBlBmBm = BlindBeamBeamTrans( ProfAng, SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); - TBlBmDif = InterpProfSlatAng( + Real64 TBlBmDif = InterpProfSlatAng( ProfAng, SlatAng, SurfWinMovableSlats(SurfNum), Blind(BlNum).SolFrontBeamDiffTrans); SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + @@ -3326,7 +3330,7 @@ namespace HeatBalanceSurfaceManager { } // Surface(SurfNum)%ExtSolar if (Surface(SurfNum).HeatTransSurf && ConstrNum > 0) { - SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); + int SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); if (SurfSolIncPtr == 0) { if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; From 05e3b4e8f784d429e5819adc9e33524f28a64e0c Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 4 Sep 2020 18:17:29 -0700 Subject: [PATCH 06/25] test inithb --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 1240 ++++++++++--------- 1 file changed, 657 insertions(+), 583 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 07fc43ce783..9c7ac59ac06 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2332,93 +2332,9 @@ namespace HeatBalanceSurfaceManager { using SolarShading::SurfaceScheduledSolarInc; using SolarShading::WindowScheduledSolarAbs; -// Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) -// int ConstrNum; // Index for the Construct derived type -// int ConstrNumSh; // Shaded window construction -// Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) -// int RoughIndexMovInsul; // Roughness index of movable insulation -// int SurfNum2; // TDD:DOME object number -// int PipeNum; // TDD pipe object number -// int ShelfNum; // Daylighting shelf object number -// int InShelfSurf; // Inside daylighting shelf surface number -// int OutShelfSurf; // Outside daylighting shelf surface number -// Real64 ShelfSolarRad; // Shelf diffuse solar radiation -// int ShadeFlag; // Window shading flag -// Real64 SwitchFac; // Switching factor for switchable glazing -// Real64 BeamSolar; // Local variable for BeamSolarRad -// Real64 SkySolarInc; // Sky diffuse solar incident on a surface -// Real64 GndSolarInc; // Ground diffuse solar incident on a surface -// int TotGlassLay; // Number of glass layers -// int TotSolidLay; // Number of solid layers in fenestration system (glass + shading) -// int CurrentState; // Current state for Complex Fenestration static Array1D AbsDiffWin(CFSMAXNL); // Diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static -// int Lay; // Layer number -// Real64 DividerAbs; // Window divider solar absorptance -// Real64 DividerRefl; // Window divider solar reflectance -// int MatNumGl; // Outer glass layer material number -// int MatNumGlSh; // Outer glass layer material number, switched construction -// Real64 TransGl; // Outer glass solar transmittance, reflectance, absorptance -// Real64 ReflGl; -// Real64 AbsGl; -// Real64 TransGlSh; // Outer glass solar trans, refl, absorptance if switched -// Real64 ReflGlSh; -// Real64 AbsGlSh; -// Real64 TransDiffGl; // Diffuse solar transmittance -// Real64 TransDiffGlSh; // Diffuse solar transmittance, switched construction -// int FrDivNum; // Frame/divider number -// Real64 FrArea; // Frame, divider area (m2) -// Real64 DivArea; -// Real64 FrWidth; // Frame, divider width (m) -// Real64 DivWidth; -// Real64 FrProjOut; // Frame, divider outside projection (m) -// Real64 DivProjOut; -// Real64 FrProjIn; // Frame, divider outside projection (m) -// Real64 DivProjIn; -// Real64 PhiWin; // Altitude and azimuth angle of outward window normal (radians) -// Real64 ThWin; -// Real64 PhiSun; // Altitude and azimuth angle of sun (radians) -// Real64 ThSun; -// Real64 CosInc; // Cosine of incidence angle of beam solar on glass -// Real64 CosIncAngHorProj; // Cosine of incidence angle of sun on horizontal faces of a frame or -// // divider projection -// Real64 CosIncAngVertProj; // Cosine of incidence angle of sun on vertical faces of a frame or -// // divider projection -// Real64 FracSunLit; // Fraction of window sunlit this time step -// Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) -// Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) -// Real64 FrIncSolarOut; // Total solar incident on outside offrame including solar -// // on frame projection (W/m2) -// Real64 FrIncSolarIn; // Total solar incident on inside offrame including solar -// // on frame projection (W/m2) -// -// Real64 DivIncSolarOutBm; // Beam solar incident on outside of divider including beam on divider -// // projection (W/m2) -// Real64 DivIncSolarOutDif; // Diffuse solar incident on outside of divider including diffuse on divider -// // projection (W/m2) -// Real64 DivIncSolarInBm; // Beam solar incident on inside of divider including beam on divider -// // projection (W/m2) -// Real64 DivIncSolarInDif; // Diffuse solar incident on inside of divider including diffuse on divider -// // projection (W/m2) -// Real64 BeamFrHorFaceInc; // Beam solar on frame's horizontal projection faces (W/m2) -// Real64 BeamFrVertFaceInc; // Beam solar on frame's vertical projection faces (W/m2) -// Real64 BeamDivHorFaceInc; // Beam solar on divider's horizontal outside projection faces (W/m2) -// Real64 BeamDivVertFaceInc; // Beam solar on divider's vertical outside projection faces (W/m2) -// Real64 BeamDivHorFaceIncIn; // Beam solar on divider's horizontal inside projection faces (W/m2) -// Real64 BeamDivVertFaceIncIn; // Beam solar on divider's vertical inside projection faces (W/m2) -//// int BlNum; // Blind number -// Real64 ProfAng; // Solar profile angle (rad) -// Real64 SlatAng; // Slat angle (rad) -// Real64 TBlBmBm; // Blind beam-beam solar transmittance -// Real64 TBlBmDif; // Blind diffuse-diffuse solar transmittance -// Real64 ACosTlt; // Absolute value of cosine of surface tilt angle -// Real64 AbsDiffBlindGnd; // System blind front ground diffuse solar absorptance at a particular slat angle -// Real64 AbsDiffBlindSky; // System blind front sky diffuse solar absorptance at a particular slat angle -// Real64 AbsDiffGlassLayGnd; // System glass layer ground diffuse solar absorptance with blind on -// Real64 AbsDiffGlassLaySky; // System glass layer sky diffuse solar absorptance with blind on -// int SurfSolAbs; // Pointer to scheduled surface gains object for fenestration systems -// int SurfSolIncPtr; // Pointer to schedule surface gain object for interior side of the surface // Always initialize the shortwave quantities @@ -2779,573 +2695,731 @@ namespace HeatBalanceSurfaceManager { // DifIncInsSurfIntensRep(SurfNum) // DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec // END DO - - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - int ConstrNum = 0; - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; - int InShelfSurf = 0; - int OutShelfSurf = 0; - if (ShelfNum > 0) { - InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } - - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - int PipeNum; - int SurfNum2; - Real64 CosInc; - Real64 BeamSolar; - Real64 SkySolarInc; - Real64 GndSolarInc; - - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - PipeNum = SurfWinTDDPipeNum(SurfNum); - SurfNum2 = TDDPipe(PipeNum).Dome; - - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); - - // 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) / dataConstruction.Construct(ConstrNum).TransDiff; - - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; - - GndSolarInc = GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / - dataConstruction.Construct(ConstrNum).TransDiff; - - } else if (OutShelfSurf > 0) { // Outside daylighting shelf - SurfNum2 = SurfNum; - - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); - - BeamSolar = BeamSolarRad; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); - - Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + - 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(TimeStep, HourOfDay, SurfNum); - BeamSolar = BeamSolarRad; - SkySolarInc = SurfSkySolarInc(SurfNum); - GndSolarInc = SurfGndSolarInc(SurfNum); + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + int const firstSurf = Zone(zoneNum).SurfaceFirst; + int const lastSurf = Zone(zoneNum).SurfaceLast; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int InShelfSurf = 0; // Inside daylighting shelf surface number + int OutShelfSurf = 0; // Outside daylighting shelf surface number + if (ShelfNum > 0) { + InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 + OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 } - // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = CosInc; + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int PipeNum; // TDD pipe object number + int SurfNum2; // TDD:DOME object number + Real64 CosInc; // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar; // Local variable for BeamSolarRad + Real64 SkySolarInc; // Sky diffuse solar incident on a surface + Real64 GndSolarInc; // Ground diffuse solar incident on a surface + + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + PipeNum = SurfWinTDDPipeNum(SurfNum); + SurfNum2 = TDDPipe(PipeNum).Dome; + + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); + + // 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) / + dataConstruction.Construct(ConstrNum).TransDiff; + + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; + + GndSolarInc = + GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / + dataConstruction.Construct(ConstrNum).TransDiff; + + } else if (OutShelfSurf > 0) { // Outside daylighting shelf + SurfNum2 = SurfNum; + + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + + BeamSolar = BeamSolarRad; + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); + // Shelf diffuse solar radiation + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * + CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + 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(TimeStep, HourOfDay, SurfNum); + BeamSolar = BeamSolarRad; + SkySolarInc = SurfSkySolarInc(SurfNum); + GndSolarInc = SurfGndSolarInc(SurfNum); + } - // Report variables for various incident solar quantities + // Cosine of incidence angle and solar incident on outside of surface, for reporting + SurfCosIncidenceAngle(SurfNum) = CosInc; - // Incident direct (unreflected) beam - SurfQRadSWOutIncidentBeam(SurfNum) = BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 + // Report variables for various incident solar quantities - // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; - } else { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - } - // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; - // Incident diffuse solar from beam-to-diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - } else { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Incident diffuse solar from sky diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - } else { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included - // in SkySolarInc. - // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 - // TH2 CR 9056 - SurfQRadSWOutIncident(SurfNum) = SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); - - if (CalcSolRefl) { - // Incident beam solar from beam-to-beam (specular) reflection from obstructions - SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from beam-to-diffuse reflection from obstructions - SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from sky diffuse reflection from obstructions - SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); - // TH2 CR 9056: Add reflections from obstructions to the total incident - SurfQRadSWOutIncident(SurfNum) += - SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); - } + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; + } else { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + } + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; + // Incident diffuse solar from beam-to-diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + } else { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Incident diffuse solar from sky diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); + } else { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc + + // TH2 CR 9056 + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + + if (CalcSolRefl) { + // Incident beam solar from beam-to-beam (specular) reflection from obstructions + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from beam-to-diffuse reflection from obstructions + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from sky diffuse reflection from obstructions + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); + // TH2 CR 9056: Add reflections from obstructions to the total incident + SurfQRadSWOutIncident(SurfNum) += + SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); + } - if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above + if (Surface( + SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above - int RoughIndexMovInsul = 0; - Real64 HMovInsul; - Real64 AbsExt; + int RoughIndexMovInsul = 0; // Roughness index of movable insulation + Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) + Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) - if (Surface(SurfNum).MaterialMovInsulExt > 0) EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); + if (Surface(SurfNum).MaterialMovInsulExt > 0) + EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); - if (RoughIndexMovInsul <= 0) { // No movable insulation present + if (RoughIndexMovInsul <= 0) { // No movable insulation present - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + AbsExt = dataMaterial.Material( + dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; - } else { // Exterior window - int ShadeFlag = SurfWinShadingFlag(SurfNum); + } else { // Exterior window + int ShadeFlag = SurfWinShadingFlag(SurfNum); - if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && - SurfWinWindowModelType(SurfNum) != WindowEQLModel && !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && + SurfWinWindowModelType(SurfNum) != WindowEQLModel && + !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); - } + int TotGlassLay = dataConstruction.Construct( + ConstrNum).TotGlassLayers; // Number of glass layers + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); + } - ShadeFlag = SurfWinShadingFlag(SurfNum); + ShadeFlag = SurfWinShadingFlag(SurfNum); - if (ShadeFlag > 0) { // Shaded window - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; + if (ShadeFlag > 0) { // Shaded window + int ConstrNumSh = Surface( + SurfNum).ShadedConstruction; // Shaded window construction + if (SurfWinStormWinFlag(SurfNum) == 1) + ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; - if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || ShadeFlag == BGShadeOn || - ShadeFlag == ExtScreenOn) { // Shade/screen on + if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || + ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( + Lay); + } + SurfWinExtDiffAbsByShade(SurfNum) = + dataConstruction.Construct(ConstrNumSh).AbsDiffShade * + (SkySolarInc + GndSolarInc); } - SurfWinExtDiffAbsByShade(SurfNum) = - dataConstruction.Construct(ConstrNumSh).AbsDiffShade * (SkySolarInc + GndSolarInc); - } - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { // Blind on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - - AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiff({1, MaxSlatAngs}, Lay)); - AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, MaxSlatAngs}, Lay)); - AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, MaxSlatAngs}, Lay)); - } - SurfWinExtDiffAbsByShade(SurfNum) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlind) * - (SkySolarInc + GndSolarInc); - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - Real64 AbsDiffBlindGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); - Real64 AbsDiffBlindSky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { // Blind on + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + + AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiff( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffGnd( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffSky( + {1, MaxSlatAngs}, Lay)); + } SurfWinExtDiffAbsByShade(SurfNum) = - SkySolarInc * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + - GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + 0.5 * ACosTlt * AbsDiffBlindSky); + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).AbsDiffBlind) * + (SkySolarInc + GndSolarInc); + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffBlindGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); + Real64 AbsDiffBlindSky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); + SurfWinExtDiffAbsByShade(SurfNum) = SkySolarInc * (0.5 * ACosTlt * + AbsDiffBlindGnd + + (1.0 - + 0.5 * ACosTlt) * + AbsDiffBlindSky) + + GndSolarInc * + ((1.0 - 0.5 * ACosTlt) * + AbsDiffBlindGnd + + 0.5 * ACosTlt * + AbsDiffBlindSky); + } } - } - // Correct for shadowing of divider onto interior shading device (note that dividers are - // not allowed in windows with between-glass shade/blind) + // 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 || ShadeFlag == IntBlindOn) && SurfWinDividerArea(SurfNum) > 0.0) - SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); + if ((ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) && + SurfWinDividerArea(SurfNum) > 0.0) + SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = - InterpSw(SwitchFac, AbsDiffWin(Lay), dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay)); + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor( + SurfNum); // Switching factor for switchable glazing + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), + dataConstruction.Construct( + ConstrNumSh).AbsDiff(Lay)); + } } - } - - } // End of check if window has shading device on - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + - AWinSurf(Lay, SurfNum) * BeamSolar; // AWinSurf is from InteriorSolarDistribution - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - Real64 AbsDiffGlassLayGnd = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, 19}, Lay)); - Real64 AbsDiffGlassLaySky = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); + } // End of check if window has shading device on - SurfWinQRadSWwinAbs(Lay, SurfNum) = - SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + - GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + - AWinSurf(Lay, SurfNum) * BeamSolar; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * + BeamSolar; // AWinSurf is from InteriorSolarDistribution + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on + // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on + Real64 ACosTlt = std::abs( + Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle + Real64 AbsDiffGlassLayGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( + {1, 19}, Lay)); + Real64 AbsDiffGlassLaySky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( + {1, 19}, Lay)); + + SurfWinQRadSWwinAbs(Lay, SurfNum) = SkySolarInc * (0.5 * ACosTlt * + AbsDiffGlassLayGnd + + (1.0 - + 0.5 * ACosTlt) * + AbsDiffGlassLaySky) + + GndSolarInc * + ((1.0 - 0.5 * ACosTlt) * + AbsDiffGlassLayGnd + + 0.5 * ACosTlt * + AbsDiffGlassLaySky) + + AWinSurf(Lay, SurfNum) * + BeamSolar; + } } - } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - // Need to do it this way for now beaucse of scheduled surface gains. They do work only with - // BSDF windows and overwriting absorbtances will work only for ordinary windows - // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && - // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && - // inExtWindowModel->isExternalLibraryModel() ) { - // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; - // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { - // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * - // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); - // } - } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - int TotSolidLay = dataConstruction.Construct(ConstrNum).TotSolidLayers; - int CurrentState = SurfaceWindow(SurfNum).ComplexFen.CurrentState; - // Examine for schedule surface gain - Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum); - - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - if (SurfSolAbs != 0) { - AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue(FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); - // ABWin(Lay) = AWinSurf(SurfNum,Lay) - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); - } 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 - SurfWinQRadSWwinAbs(Lay, SurfNum) = - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + - AWinSurf(Lay, SurfNum) * BeamSolar + AWinCFOverlap(Lay, SurfNum) * BeamSolar; + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Need to do it this way for now beaucse of scheduled surface gains. They do work only with + // BSDF windows and overwriting absorbtances will work only for ordinary windows + // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && + // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && + // inExtWindowModel->isExternalLibraryModel() ) { + // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; + // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { + // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * + // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); + // } + } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { + int TotSolidLay = dataConstruction.Construct( + ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) + int CurrentState = SurfaceWindow( + SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration + // Examine for schedule surface gain + Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, + ConstrNum); // Pointer to scheduled surface gains object for fenestration systems + + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + if (SurfSolAbs != 0) { + AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( + FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); + // ABWin(Lay) = AWinSurf(SurfNum,Lay) + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); + } 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 + SurfWinQRadSWwinAbs(Lay, SurfNum) = + SurfaceWindow(SurfNum).ComplexFen.State( + CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + + SurfaceWindow(SurfNum).ComplexFen.State( + CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + + AWinSurf(Lay, SurfNum) * BeamSolar + + AWinCFOverlap(Lay, SurfNum) * BeamSolar; + } + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; // ShadeFlag = SurfWinShadingFlag(SurfNum); - } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr - int TotSolidLay = CFS(dataConstruction.Construct(Surface(SurfNum).Construction).EQLConsPtr).NL; - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL(Lay); - SurfWinQRadSWwinAbs(Lay, SurfNum) = - AWinSurf(Lay, SurfNum) * BeamSolar + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); - - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - std::pair incomingAngle = - getSunWCEAngles(dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); - Real64 Theta = incomingAngle.first; - Real64 Phi = incomingAngle.second; + } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr + int TotSolidLay = CFS(dataConstruction.Construct( + Surface(SurfNum).Construction).EQLConsPtr).NL; + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( + Lay); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + + AbsDiffWin(Lay) * + (SkySolarInc + GndSolarInc); + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + std::pair incomingAngle = getSunWCEAngles( + dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); + Real64 Theta = incomingAngle.first; + Real64 Phi = incomingAngle.second; - std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( - dataWindowManager, WavelengthRange::Solar, ConstrNum); + std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( + dataWindowManager, WavelengthRange::Solar, ConstrNum); - size_t totLayers = aLayer->getNumOfLayers(); - for (size_t Lay = 1; Lay <= totLayers; ++Lay) { + size_t totLayers = aLayer->getNumOfLayers(); + for (size_t Lay = 1; Lay <= totLayers; ++Lay) { - Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, ScatteringSimple::Diffuse, Theta, Phi); + Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, + ScatteringSimple::Diffuse, + Theta, Phi); - SurfWinQRadSWwinAbs(Lay, SurfNum) = AbWinDiff * (SkySolarInc + GndSolarInc) + AWinSurf(Lay, SurfNum) * BeamSolar; + SurfWinQRadSWwinAbs(Lay, SurfNum) = + AbWinDiff * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * BeamSolar; - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } } - } - // Solar absorbed by window frame and dividers - int FrDivNum = Surface(SurfNum).FrameDivider; - Real64 FrArea = SurfWinFrameArea(SurfNum); - Real64 FrWidth = 0.0; - Real64 FrProjOut = 0.0; - Real64 FrProjIn = 0.0; - Real64 DivArea = 0.0; - Real64 DivWidth = 0.0; - Real64 DivProjOut = 0.0; - Real64 DivProjIn = 0.0; - if (FrDivNum > 0) { - FrWidth = FrameDivider(FrDivNum).FrameWidth; - FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; - FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; - DivArea = SurfWinDividerArea(SurfNum); - DivWidth = FrameDivider(FrDivNum).DividerWidth; - DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; - DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - } - Real64 CosIncAngHorProj = 0.0; - Real64 CosIncAngVertProj = 0.0; - Real64 FracSunLit = 0.0; - Real64 BeamFaceInc; - Real64 DifSolarFaceInc; - if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); - BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; - DifSolarFaceInc = SkySolarInc + GndSolarInc; - } - if (FracSunLit > 0.0) { - if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || - (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { - // 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)) - Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec(3)); - Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), Surface(SurfNum).OutNormVec(1)); - Real64 PhiSun = std::asin(SOLCOS(3)); - Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); - Real64 const cos_PhiWin(std::cos(PhiWin)); - Real64 const cos_PhiSun(std::cos(PhiSun)); - CosIncAngHorProj = - std::abs(std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - cos_PhiWin * std::sin(PhiSun)); - CosIncAngVertProj = std::abs(cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); + // Solar absorbed by window frame and dividers + int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number + Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) + Real64 FrWidth = 0.0; // Frame, divider width (m) + Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) + Real64 FrProjIn = 0.0; + Real64 DivArea = 0.0; + Real64 DivWidth = 0.0; + Real64 DivProjOut = 0.0; + Real64 DivProjIn = 0.0; + if (FrDivNum > 0) { + FrWidth = FrameDivider(FrDivNum).FrameWidth; + FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; + FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; + DivArea = SurfWinDividerArea(SurfNum); + DivWidth = FrameDivider(FrDivNum).DividerWidth; + DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; + DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; } - } - - // 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.0) { - Real64 FrIncSolarOut = BeamFaceInc; - Real64 FrIncSolarIn = 0.0; - Real64 TransDiffGl = 0.0; - if (FrProjOut > 0.0 || FrProjIn > 0.0) { - Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * DivWidth) - * FracSunLit / FrArea; - Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) - * FracSunLit / FrArea; - // Beam solar on outside of frame - FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; - if (FrProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam solar on inside of frame - FrIncSolarIn = (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection + Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection + Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step + Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) + Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) + if (FrArea > 0.0 || DivArea > 0.0) { + FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); + BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + DifSolarFaceInc = SkySolarInc + GndSolarInc; + } + if (FracSunLit > 0.0) { + if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || + (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { + // 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)) + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( + 3)); // Altitude and azimuth angle of outward window normal (radians) + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), + Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin( + SOLCOS(3)); // Altitude and azimuth angle of sun (radians) + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 const cos_PhiWin(std::cos(PhiWin)); + Real64 const cos_PhiSun(std::cos(PhiSun)); + CosIncAngHorProj = std::abs( + std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - + cos_PhiWin * std::sin(PhiSun)); + CosIncAngVertProj = std::abs( + cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); } } - // Beam plus diffuse solar on outside of frame - FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); - SurfWinFrameQRadOutAbs(SurfNum) = FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window outside reveal surfaces - SurfWinFrameQRadOutAbs(SurfNum) += - BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * SurfWinFrameSolAbsorp(SurfNum); - - // Beam plus diffuse solar on inside of frame - FrIncSolarIn += DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); - SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window inside reveal surfaces - SurfWinFrameQRadInAbs(SurfNum) += - BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * SurfWinFrameSolAbsorp(SurfNum); - } - // 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.0) { // Solar absorbed by window divider - Real64 DividerAbs = SurfWinDividerSolAbsorp(SurfNum); - if (SurfWinDividerType(SurfNum) == Suspended) { - // 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) - int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint(1); - Real64 TransGl = dataMaterial.Material(MatNumGl).Trans; - Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - Real64 AbsGl = 1.0 - TransGl - ReflGl; - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint(1); - Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; - Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); - AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); + // 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.0) { + Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar + Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) + Real64 TransDiffGl = 0.0; // Diffuse solar transmittance + if (FrProjOut > 0.0 || FrProjIn > 0.0) { + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - + FrameDivider(FrDivNum).VertDividers * DivWidth) * + FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - + FrameDivider(FrDivNum).HorDividers * DivWidth) * + FracSunLit / FrArea; + // Beam solar on outside of frame + FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; + if (FrProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam solar on inside of frame + FrIncSolarIn = + (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + } } - Real64 DividerRefl = 1.0 - DividerAbs; - DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / (1.0 - DividerRefl * ReflGl); + // Beam plus diffuse solar on outside of frame + FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); + SurfWinFrameQRadOutAbs(SurfNum) = + FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window outside reveal surfaces + SurfWinFrameQRadOutAbs(SurfNum) += + BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + + // Beam plus diffuse solar on inside of frame + FrIncSolarIn += + DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); + SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window inside reveal surfaces + SurfWinFrameQRadInAbs(SurfNum) += + BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); } - Real64 BeamDivHorFaceInc = 0.0; - Real64 BeamDivVertFaceInc = 0.0; - // Beam incident on horizontal and vertical projection faces of divider if no exterior shading - if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn) { - 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; - } - Real64 DivIncSolarOutBm = 0.0; - Real64 DivIncSolarOutDif = 0.0; - Real64 DivIncSolarInBm = 0.0; - Real64 DivIncSolarInDif = 0.0; - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && - ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading - DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; - DivIncSolarOutDif = DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - if (DivProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); - Real64 TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + // 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.0) { // Solar absorbed by window divider + Real64 DividerAbs = SurfWinDividerSolAbsorp( + SurfNum); // Window divider solar absorptance + if (SurfWinDividerType(SurfNum) == Suspended) { + // 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) + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( + 1); // Outer glass layer material number + Real64 TransGl = dataMaterial.Material( + MatNumGl).Trans; // Outer glass layer material number, switched construction + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct(ConstrNumSh).TransSolBeamCoef); + Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( + 1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); + AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - // Beam plus diffuse solar on inside of divider - Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * FrameDivider(FrDivNum).HorDividers * DivProjIn * - (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * DivWidth) * - FracSunLit / DivArea; - Real64 BeamDivVertFaceIncIn = - BeamSolarRad * CosIncAngVertProj * FrameDivider(FrDivNum).VertDividers * DivProjIn * - (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * DivWidth) * FracSunLit / DivArea; - DivIncSolarInBm = TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); - DivIncSolarInDif = TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance + DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / + (1.0 - DividerRefl * ReflGl); } - } else { // Exterior shade, screen or blind present - - DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarOutDif = DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * dataConstruction.Construct(ConstrNum).TransDiff; - DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * dataConstruction.Construct(ConstrNum).TransDiff; - } - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && - ShadeFlag != BGBlindOn) { // No exterior or between-glass shade, screen or blind - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); - // Exterior shade, screen or blind - } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || ShadeFlag == ExtScreenOn) { - - if (ShadeFlag == ExtBlindOn) { // Exterior blind - int BlNum = SurfWinBlindNumber(SurfNum); - Real64 ProfAng; // Solar profile angle (rad) - ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); - Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); - Real64 TBlBmBm = BlindBeamBeamTrans( - ProfAng, SlatAng, Blind(BlNum).SlatWidth, Blind(BlNum).SlatSeparation, Blind(BlNum).SlatThickness); - Real64 TBlBmDif = InterpProfSlatAng( - ProfAng, SlatAng, SurfWinMovableSlats(SurfNum), Blind(BlNum).SolFrontBeamDiffTrans); - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + - DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), Blind(BlNum).SolFrontDiffDiffTrans)); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * - (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + - DivIncSolarInDif * - InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), Blind(BlNum).SolFrontDiffDiffTrans)); + Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) + Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) + // Beam incident on horizontal and vertical projection faces of divider if no exterior shading + if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn) { + 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; + } + Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) + Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && + ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading + DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + if (DivProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct( + ConstrNum).TransDiff; // Diffuse solar transmittance + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); // Outer glass solar trans, refl, absorptance if switched + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; // Diffuse solar transmittance, switched construction + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam plus diffuse solar on inside of divider + // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) + // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * + FrameDivider(FrDivNum).HorDividers * + DivProjIn * (Surface(SurfNum).Width - + FrameDivider( + FrDivNum).VertDividers * + DivWidth) * FracSunLit / + DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * + FrameDivider(FrDivNum).VertDividers * + DivProjIn * (Surface(SurfNum).Height - + FrameDivider( + FrDivNum).HorDividers * + DivWidth) * FracSunLit / + DivArea; + DivIncSolarInBm = + TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); + DivIncSolarInDif = + TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + } + } else { // Exterior shade, screen or blind present + + DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + } - } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * - dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarOutBm + DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * - dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarInBm + DivIncSolarInDif); - - } else if (ShadeFlag == ExtScreenOn) { // Exterior screen + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != + BGBlindOn) { // No exterior or between-glass shade, screen or blind SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * - (SurfaceScreens(SurfWinScreenNumber(SurfNum)).BmBmTrans + - SurfaceScreens(SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarOutBm + DivIncSolarOutDif); + DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * - (SurfaceScreens(SurfWinScreenNumber(SurfNum)).BmBmTrans + - SurfaceScreens(SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarInBm + DivIncSolarInDif); + DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); + // Exterior shade, screen or blind + } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || + ShadeFlag == ExtScreenOn) { + + if (ShadeFlag == ExtBlindOn) { // Exterior blind + int BlNum = SurfWinBlindNumber(SurfNum); + Real64 ProfAng; // Solar profile angle (rad) + ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); + Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) + // TBlBmBm - Blind beam-beam solar transmittance + // TBlBmDif - Blind diffuse-diffuse solar transmittance + Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, + Blind(BlNum).SlatWidth, + Blind(BlNum).SlatSeparation, + Blind(BlNum).SlatThickness); + Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, + SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontBeamDiffTrans); + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (DivIncSolarOutBm * + (TBlBmBm + TBlBmDif) + + DivIncSolarOutDif * + InterpSlatAng(SlatAng, + SurfWinMovableSlats( + SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (DivIncSolarInBm * + (TBlBmBm + TBlBmDif) + + DivIncSolarInDif * + InterpSlatAng(SlatAng, + SurfWinMovableSlats( + SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + + } else if (ShadeFlag == ExtShadeOn) { // Exterior shade + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarInBm + DivIncSolarInDif); + + } else if (ShadeFlag == ExtScreenOn) { // Exterior screen + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarInBm + DivIncSolarInDif); + } } } } - } - } // RoughIndexMovInsul <= 0, no movable insulation + } // RoughIndexMovInsul <= 0, no movable insulation - if (Surface(SurfNum).HeatTransSurf && - dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); - SurfOpaqSWOutAbsTotalReport(SurfNum) = SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } - } // Surface(SurfNum)%HeatTransSurf - - } // Surface(SurfNum)%ExtSolar - - if (Surface(SurfNum).HeatTransSurf && ConstrNum > 0) { - int SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); - if (SurfSolIncPtr == 0) { - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; - if (InShelfSurf > 0) { // Inside daylighting shelf - // Shelf surface area is divided by 2 because only one side sees beam (Area was multiplied by 2 during init) - SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum) * BeamSolarRad * (0.5 * Surface(SurfNum).Area); - } else { // Regular surface - SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= + 0.0) { // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } + } // Surface(SurfNum)%HeatTransSurf + + } // Surface(SurfNum)%ExtSolar + } + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; + if (firstSurfOpaq == -1) continue; + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + if (ConstrNum > 0) { + int SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); + if (SurfSolIncPtr == 0) { + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int InShelfSurf = 0; // Inside daylighting shelf surface number + if (ShelfNum > 0) { + InShelfSurf = Shelf( ShelfNum).InSurf; // Inside daylighting shelf present if > 0 + } + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; + if (InShelfSurf > 0) { // Inside daylighting shelf + // Shelf surface area is divided by 2 because only one side sees beam (Area was multiplied by 2 during init) + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = + AISurf(SurfNum) * BeamSolarRad * (0.5 * Surface(SurfNum).Area); + } else { // Regular surface + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = + AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; + } + } + } else { + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum); } } - } else { - SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum); } - } - } // End of surface loop + } // End of surface loop + } } // End of sun-up check } From 7618438742ea223d5909c3120912734a5053cee7 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 8 Sep 2020 11:26:38 -0700 Subject: [PATCH 07/25] test init --- src/EnergyPlus/DataGlobals.cc | 2 + src/EnergyPlus/DataGlobals.hh | 2 +- src/EnergyPlus/DataSurfaces.cc | 3 + src/EnergyPlus/DataSurfaces.hh | 2 + src/EnergyPlus/HeatBalanceManager.cc | 9 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 1229 ++++++++--------- src/EnergyPlus/SolarShading.cc | 2 + src/EnergyPlus/SurfaceGeometry.cc | 1 + src/EnergyPlus/api/EnergyPlusPgm.cc | 1 + third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh | 1 + 10 files changed, 630 insertions(+), 622 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 48ea9c2c8a4..5b09d153e0d 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -257,6 +257,7 @@ namespace DataGlobals { std::function errorCallback; bool eplusRunningViaAPI; + double timer_1(0.0); // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. @@ -358,6 +359,7 @@ namespace DataGlobals { ioFiles.mtr.close(); ioFiles.err_stream.reset(); eplusRunningViaAPI = false; + timer_1 = 0.0; } } // namespace DataGlobals diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index cdeab1091d8..b1be8aa0cf8 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -240,7 +240,7 @@ namespace DataGlobals { extern std::function messageCallback; extern std::function errorCallback; extern bool eplusRunningViaAPI; // a flag for capturing whether we are running via API - if so we can't do python plugins - + extern double timer_1; // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state(EnergyPlus::IOFiles &ioFiles); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 8533d88182a..7afb84fa561 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -441,6 +441,8 @@ namespace DataSurfaces { Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse and beam solar from exterior obstructions [W/m2] Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, accounts for shadowing of ground by building and obstructions [W/m2] + Array1D SurfConstrNum; + std::vector AllHTSurfaceList; // List of all heat transfer surfaces std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces std::vector AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces @@ -1252,6 +1254,7 @@ namespace DataSurfaces { SurfSunlitFrac.deallocate(); SurfSkySolarInc.clear(); SurfGndSolarInc.clear(); + SurfConstrNum.clear(); AllHTSurfaceList.clear(); AllIZSurfaceList.clear(); AllHTNonWindowSurfaceList.clear(); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 474776d458b..f4e7a41e755 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -424,6 +424,8 @@ namespace DataSurfaces { extern Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse and beam solar from exterior obstructions [W/m2] extern Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, accounts for shadowing of ground by building and obstructions [W/m2] + extern Array1D SurfConstrNum; + extern std::vector AllHTSurfaceList; // List of all heat transfer surfaces - simulation order extern std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces extern std::vector AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 136f497e2cf..1875b1b2116 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5233,6 +5233,10 @@ namespace HeatBalanceManager { for (SurfNum = 1; SurfNum <= TotSurfaces; SurfNum++) { DataSurfaces::SurfaceWindow(SurfNum).ThetaFace = 296.15; DataSurfaces::SurfWinEffInsSurfTemp(SurfNum) = 23.0; + DataSurfaces::SurfConstrNum(SurfNum) = 0; + if (DataSurfaces::Surface(SurfNum).HeatTransSurf) { + DataSurfaces::SurfConstrNum(SurfNum) = DataSurfaces::Surface(SurfNum).Construction; + } } } @@ -5253,6 +5257,11 @@ namespace HeatBalanceManager { } ChangeSet = true; } + for (StormWinNum = 1; StormWinNum <= TotStormWin; ++StormWinNum) { + if (DataSurfaces::SurfWinStormWinFlag(StormWinNum) == 1) { + DataSurfaces::SurfConstrNum(StormWinNum) = DataSurfaces::Surface(StormWinNum).StormWinConstruction; + } + } } if (BeginSimFlag && DoWeathSim && ReportExtShadingSunlitFrac) { diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 9c7ac59ac06..37edc0d85b4 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -49,6 +49,7 @@ #include #include #include +#include // ObjexxFCL Headers #include #include @@ -373,6 +374,7 @@ namespace HeatBalanceSurfaceManager { using InternalHeatGains::ManageInternalHeatGains; // RJH DElight Modification Begin using namespace DElightManagerF; + using namespace std::chrono; // RJH DElight Modification End // Locals @@ -714,8 +716,14 @@ namespace HeatBalanceSurfaceManager { // take the appropriate parts of these inits to the other heat balance managers if (InitSurfaceHeatBalancefirstTime) DisplayString("Initializing Solar Heat Gains"); + high_resolution_clock::time_point t1 = high_resolution_clock::now(); + InitSolarHeatGains(state.dataWindowComplexManager, state.dataWindowEquivalentLayer, state.dataWindowManager); + high_resolution_clock::time_point t2 = high_resolution_clock::now(); + duration time_span = duration_cast>(t2 - t1); + DataGlobals::timer_1 += time_span.count(); + if (SunIsUp && (BeamSolarRad + GndSolarRad + DifSolarRad > 0.0)) { for (int NZ = 1; NZ <= NumOfZones; ++NZ) { if (ZoneDaylight(NZ).TotalDaylRefPoints > 0) { @@ -2336,6 +2344,12 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static + + static Array1D CosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass + static Array1D BeamSolar(TotSurfaces); // Local variable for BeamSolarRad + static Array1D SkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface + static Array1D GndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface + // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2695,697 +2709,670 @@ namespace HeatBalanceSurfaceManager { // DifIncInsSurfIntensRep(SurfNum) // DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec // END DO - for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - int const firstSurf = Zone(zoneNum).SurfaceFirst; - int const lastSurf = Zone(zoneNum).SurfaceLast; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int InShelfSurf = 0; // Inside daylighting shelf surface number - int OutShelfSurf = 0; // Outside daylighting shelf surface number - if (ShelfNum > 0) { - InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - int PipeNum; // TDD pipe object number - int SurfNum2; // TDD:DOME object number - Real64 CosInc; // Cosine of incidence angle of beam solar on glass - Real64 BeamSolar; // Local variable for BeamSolarRad - Real64 SkySolarInc; // Sky diffuse solar incident on a surface - Real64 GndSolarInc; // Ground diffuse solar incident on a surface + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int OutShelfSurf = 0; // Outside daylighting shelf surface number + if (ShelfNum > 0) { + OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 + } - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - PipeNum = SurfWinTDDPipeNum(SurfNum); - SurfNum2 = TDDPipe(PipeNum).Dome; + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int PipeNum; // TDD pipe object number + int SurfNum2; // TDD:DOME object number - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); - // 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) / - dataConstruction.Construct(ConstrNum).TransDiff; + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + PipeNum = SurfWinTDDPipeNum(SurfNum); + SurfNum2 = TDDPipe(PipeNum).Dome; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; + CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); - GndSolarInc = - GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / + // 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(SurfNum) = BeamSolarRad * TransTDD(PipeNum, CosInc(SurfNum), SolarBeam) / dataConstruction.Construct(ConstrNum).TransDiff; - } else if (OutShelfSurf > 0) { // Outside daylighting shelf - SurfNum2 = SurfNum; - - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); - - BeamSolar = BeamSolarRad; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); - // Shelf diffuse solar radiation - Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * - CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + - 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(TimeStep, HourOfDay, SurfNum); - BeamSolar = BeamSolarRad; - SkySolarInc = SurfSkySolarInc(SurfNum); - GndSolarInc = SurfGndSolarInc(SurfNum); - } + SkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc(SurfNum), SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; + + GndSolarInc(SurfNum) = + GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / + dataConstruction.Construct(ConstrNum).TransDiff; + + } else if (OutShelfSurf > 0) { // Outside daylighting shelf + SurfNum2 = SurfNum; + + CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + + BeamSolar(SurfNum) = BeamSolarRad; + SkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + // Shelf diffuse solar radiation + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * + CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + 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(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + + ShelfSolarRad * Shelf(ShelfNum).ViewFactor; + + } else { // Regular surface + SurfNum2 = SurfNum; + CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + BeamSolar(SurfNum) = BeamSolarRad; + SkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); + GndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); + } - // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = CosInc; + // Cosine of incidence angle and solar incident on outside of surface, for reporting + SurfCosIncidenceAngle(SurfNum) = CosInc(SurfNum); - // Report variables for various incident solar quantities + // Report variables for various incident solar quantities - // Incident direct (unreflected) beam - SurfQRadSWOutIncidentBeam(SurfNum) = - BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + BeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc(SurfNum); // NOTE: SurfNum2 - // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; - } else { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - } - // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; - // Incident diffuse solar from beam-to-diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - } else { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Incident diffuse solar from sky diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - } else { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included - // in SkySolarInc. - // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc - - // TH2 CR 9056 - SurfQRadSWOutIncident(SurfNum) = - SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); - - if (CalcSolRefl) { - // Incident beam solar from beam-to-beam (specular) reflection from obstructions - SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from beam-to-diffuse reflection from obstructions - SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from sky diffuse reflection from obstructions - SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); - // TH2 CR 9056: Add reflections from obstructions to the total incident - SurfQRadSWOutIncident(SurfNum) += - SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + - SurfQRadSWOutIncSkyDiffReflObs(SurfNum); - } + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc(SurfNum); + } else { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + } + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc(SurfNum); + // Incident diffuse solar from beam-to-diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + } else { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Incident diffuse solar from sky diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); + } else { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc - if (Surface( - SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above + // TH2 CR 9056 + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + + if (CalcSolRefl) { + // Incident beam solar from beam-to-beam (specular) reflection from obstructions + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from beam-to-diffuse reflection from obstructions + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from sky diffuse reflection from obstructions + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); + // TH2 CR 9056: Add reflections from obstructions to the total incident + SurfQRadSWOutIncident(SurfNum) += + SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); + } + } + } // end of surface loop + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + int const firstSurf = Zone(zoneNum).SurfaceFirst; + int const lastSurf = Zone(zoneNum).SurfaceLast; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + if (Surface(SurfNum).HeatTransSurf) { + // Exclude special shading surfaces which required QRadSWOut calculations above - int RoughIndexMovInsul = 0; // Roughness index of movable insulation - Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) - Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) + int RoughIndexMovInsul = 0; // Roughness index of movable insulation + Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) + Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) - if (Surface(SurfNum).MaterialMovInsulExt > 0) - EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); + if (Surface(SurfNum).MaterialMovInsulExt > 0) + EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); - if (RoughIndexMovInsul <= 0) { // No movable insulation present + if (RoughIndexMovInsul <= 0) { // No movable insulation present - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - AbsExt = dataMaterial.Material( - dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; - } else { // Exterior window - int ShadeFlag = SurfWinShadingFlag(SurfNum); + } else { // Exterior window + int ShadeFlag = SurfWinShadingFlag(SurfNum); - if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && - SurfWinWindowModelType(SurfNum) != WindowEQLModel && - !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && + SurfWinWindowModelType(SurfNum) != WindowEQLModel && + !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int TotGlassLay = dataConstruction.Construct( - ConstrNum).TotGlassLayers; // Number of glass layers - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); - } + int TotGlassLay = dataConstruction.Construct( + ConstrNum).TotGlassLayers; // Number of glass layers + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); + } - ShadeFlag = SurfWinShadingFlag(SurfNum); + ShadeFlag = SurfWinShadingFlag(SurfNum); - if (ShadeFlag > 0) { // Shaded window - int ConstrNumSh = Surface( - SurfNum).ShadedConstruction; // Shaded window construction - if (SurfWinStormWinFlag(SurfNum) == 1) - ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; + if (ShadeFlag > 0) { // Shaded window + int ConstrNumSh = Surface( + SurfNum).ShadedConstruction; // Shaded window construction + if (SurfWinStormWinFlag(SurfNum) == 1) + ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; - if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || - ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on + if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || + ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( - Lay); - } - SurfWinExtDiffAbsByShade(SurfNum) = - dataConstruction.Construct(ConstrNumSh).AbsDiffShade * - (SkySolarInc + GndSolarInc); + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( + Lay); } + SurfWinExtDiffAbsByShade(SurfNum) = + dataConstruction.Construct(ConstrNumSh).AbsDiffShade * + (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); + } + + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { // Blind on + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { // Blind on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - - AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiff( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffGnd( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffSky( - {1, MaxSlatAngs}, Lay)); - } + AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiff( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffGnd( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffSky( + {1, MaxSlatAngs}, Lay)); + } + SurfWinExtDiffAbsByShade(SurfNum) = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( ConstrNumSh).AbsDiffBlind) * + (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffBlindGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); + Real64 AbsDiffBlindSky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); SurfWinExtDiffAbsByShade(SurfNum) = - InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).AbsDiffBlind) * - (SkySolarInc + GndSolarInc); - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - Real64 AbsDiffBlindGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); - Real64 AbsDiffBlindSky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); - SurfWinExtDiffAbsByShade(SurfNum) = SkySolarInc * (0.5 * ACosTlt * - AbsDiffBlindGnd + - (1.0 - - 0.5 * ACosTlt) * - AbsDiffBlindSky) + - GndSolarInc * - ((1.0 - 0.5 * ACosTlt) * - AbsDiffBlindGnd + - 0.5 * ACosTlt * - AbsDiffBlindSky); - } + SkySolarInc(SurfNum) * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + + GndSolarInc(SurfNum) * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + + 0.5 * ACosTlt * AbsDiffBlindSky); } + } - // Correct for shadowing of divider onto interior shading device (note that dividers are - // not allowed in windows with between-glass shade/blind) + // 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 || ShadeFlag == IntBlindOn) && - SurfWinDividerArea(SurfNum) > 0.0) - SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); + if ((ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) && + SurfWinDividerArea(SurfNum) > 0.0) + SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor( - SurfNum); // Switching factor for switchable glazing - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), - dataConstruction.Construct( - ConstrNumSh).AbsDiff(Lay)); - } + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor( + SurfNum); // Switching factor for switchable glazing + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), + dataConstruction.Construct( + ConstrNumSh).AbsDiff(Lay)); } + } - } // End of check if window has shading device on + } // End of check if window has shading device on - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = - AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + - AWinSurf(Lay, SurfNum) * - BeamSolar; // AWinSurf is from InteriorSolarDistribution - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on - // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on - Real64 ACosTlt = std::abs( - Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle - Real64 AbsDiffGlassLayGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( - {1, 19}, Lay)); - Real64 AbsDiffGlassLaySky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( - {1, 19}, Lay)); - - SurfWinQRadSWwinAbs(Lay, SurfNum) = SkySolarInc * (0.5 * ACosTlt * - AbsDiffGlassLayGnd + - (1.0 - - 0.5 * ACosTlt) * - AbsDiffGlassLaySky) + - GndSolarInc * - ((1.0 - 0.5 * ACosTlt) * - AbsDiffGlassLayGnd + - 0.5 * ACosTlt * - AbsDiffGlassLaySky) + - AWinSurf(Lay, SurfNum) * - BeamSolar; - } - } - - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)) + + AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); + // AWinSurf is from InteriorSolarDistribution + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on + // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on + Real64 ACosTlt = std::abs( + Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle + Real64 AbsDiffGlassLayGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( + {1, 19}, Lay)); + Real64 AbsDiffGlassLaySky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( + {1, 19}, Lay)); - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - // Need to do it this way for now beaucse of scheduled surface gains. They do work only with - // BSDF windows and overwriting absorbtances will work only for ordinary windows - // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && - // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && - // inExtWindowModel->isExternalLibraryModel() ) { - // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; - // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { - // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * - // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); - // } - } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - int TotSolidLay = dataConstruction.Construct( - ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) - int CurrentState = SurfaceWindow( - SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration - // Examine for schedule surface gain - Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, - ConstrNum); // Pointer to scheduled surface gains object for fenestration systems - - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - if (SurfSolAbs != 0) { - AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( - FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); - // ABWin(Lay) = AWinSurf(SurfNum,Lay) - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); - } 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 SurfWinQRadSWwinAbs(Lay, SurfNum) = - SurfaceWindow(SurfNum).ComplexFen.State( - CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + - SurfaceWindow(SurfNum).ComplexFen.State( - CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + - AWinSurf(Lay, SurfNum) * BeamSolar + - AWinCFOverlap(Lay, SurfNum) * BeamSolar; + SkySolarInc(SurfNum) * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + + GndSolarInc(SurfNum) * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + + AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + } + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Need to do it this way for now beaucse of scheduled surface gains. They do work only with + // BSDF windows and overwriting absorbtances will work only for ordinary windows + // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && + // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && + // inExtWindowModel->isExternalLibraryModel() ) { + // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; + // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { + // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * + // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); + // } + } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { + int TotSolidLay = dataConstruction.Construct( + ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) + int CurrentState = SurfaceWindow( + SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration + // Examine for schedule surface gain + Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, + ConstrNum); // Pointer to scheduled surface gains object for fenestration systems + + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + if (SurfSolAbs != 0) { + AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( + FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); + // ABWin(Lay) = AWinSurf(SurfNum,Lay) + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); + } 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 + SurfWinQRadSWwinAbs(Lay, SurfNum) = + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc(SurfNum) + + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc(SurfNum) + + AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum) + + AWinCFOverlap(Lay, SurfNum) * BeamSolar(SurfNum); } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; // ShadeFlag = SurfWinShadingFlag(SurfNum); - } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr - int TotSolidLay = CFS(dataConstruction.Construct( - Surface(SurfNum).Construction).EQLConsPtr).NL; - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( - Lay); - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + - AbsDiffWin(Lay) * - (SkySolarInc + GndSolarInc); - - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - std::pair incomingAngle = getSunWCEAngles( - dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); - Real64 Theta = incomingAngle.first; - Real64 Phi = incomingAngle.second; + } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr + int TotSolidLay = CFS(dataConstruction.Construct( + Surface(SurfNum).Construction).EQLConsPtr).NL; + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( + Lay); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum) + + AbsDiffWin(Lay) * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + int SurfNum2 = SurfNum; + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; + } + std::pair incomingAngle = getSunWCEAngles( + dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); + Real64 Theta = incomingAngle.first; + Real64 Phi = incomingAngle.second; - std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( - dataWindowManager, WavelengthRange::Solar, ConstrNum); + std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( + dataWindowManager, WavelengthRange::Solar, ConstrNum); - size_t totLayers = aLayer->getNumOfLayers(); - for (size_t Lay = 1; Lay <= totLayers; ++Lay) { + size_t totLayers = aLayer->getNumOfLayers(); + for (size_t Lay = 1; Lay <= totLayers; ++Lay) { - Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, - ScatteringSimple::Diffuse, - Theta, Phi); + Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, + ScatteringSimple::Diffuse, + Theta, Phi); - SurfWinQRadSWwinAbs(Lay, SurfNum) = - AbWinDiff * (SkySolarInc + GndSolarInc) + - AWinSurf(Lay, SurfNum) * BeamSolar; + SurfWinQRadSWwinAbs(Lay, SurfNum) = + AbWinDiff * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)) + + AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } + } - // Solar absorbed by window frame and dividers - int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number - Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) - Real64 FrWidth = 0.0; // Frame, divider width (m) - Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) - Real64 FrProjIn = 0.0; - Real64 DivArea = 0.0; - Real64 DivWidth = 0.0; - Real64 DivProjOut = 0.0; - Real64 DivProjIn = 0.0; - if (FrDivNum > 0) { - FrWidth = FrameDivider(FrDivNum).FrameWidth; - FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; - FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; - DivArea = SurfWinDividerArea(SurfNum); - DivWidth = FrameDivider(FrDivNum).DividerWidth; - DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; - DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - } - Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection - Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection - Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step - Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) - Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) - if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); - BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; - DifSolarFaceInc = SkySolarInc + GndSolarInc; + // Solar absorbed by window frame and dividers + int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number + Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) + Real64 FrWidth = 0.0; // Frame, divider width (m) + Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) + Real64 FrProjIn = 0.0; + Real64 DivArea = 0.0; + Real64 DivWidth = 0.0; + Real64 DivProjOut = 0.0; + Real64 DivProjIn = 0.0; + if (FrDivNum > 0) { + FrWidth = FrameDivider(FrDivNum).FrameWidth; + FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; + FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; + DivArea = SurfWinDividerArea(SurfNum); + DivWidth = FrameDivider(FrDivNum).DividerWidth; + DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; + DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; + } + Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection + Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection + Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step + Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) + Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) + if (FrArea > 0.0 || DivArea > 0.0) { + FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); + BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc(SurfNum); + DifSolarFaceInc = SkySolarInc(SurfNum) + GndSolarInc(SurfNum); + } + if (FracSunLit > 0.0) { + if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || + (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { + // 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)) + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( + 3)); // Altitude and azimuth angle of outward window normal (radians) + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), + Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin( + SOLCOS(3)); // Altitude and azimuth angle of sun (radians) + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 const cos_PhiWin(std::cos(PhiWin)); + Real64 const cos_PhiSun(std::cos(PhiSun)); + CosIncAngHorProj = std::abs( + std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - + cos_PhiWin * std::sin(PhiSun)); + CosIncAngVertProj = std::abs( + cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); } - if (FracSunLit > 0.0) { - if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || - (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { - // 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)) - Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( - 3)); // Altitude and azimuth angle of outward window normal (radians) - Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), - Surface(SurfNum).OutNormVec(1)); - Real64 PhiSun = std::asin( - SOLCOS(3)); // Altitude and azimuth angle of sun (radians) - Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); - Real64 const cos_PhiWin(std::cos(PhiWin)); - Real64 const cos_PhiSun(std::cos(PhiSun)); - CosIncAngHorProj = std::abs( - std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - - cos_PhiWin * std::sin(PhiSun)); - CosIncAngVertProj = std::abs( - cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); + } + + // 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.0) { + Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar + Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) + Real64 TransDiffGl = 0.0; // Diffuse solar transmittance + if (FrProjOut > 0.0 || FrProjIn > 0.0) { + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - + FrameDivider(FrDivNum).VertDividers * DivWidth) * + FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - + FrameDivider(FrDivNum).HorDividers * DivWidth) * + FracSunLit / FrArea; + // Beam solar on outside of frame + FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; + if (FrProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc(SurfNum), dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc(SurfNum), dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam solar on inside of frame + FrIncSolarIn = + (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; } } + // Beam plus diffuse solar on outside of frame + FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); + SurfWinFrameQRadOutAbs(SurfNum) = + FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window outside reveal surfaces + SurfWinFrameQRadOutAbs(SurfNum) += + BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + + // Beam plus diffuse solar on inside of frame + FrIncSolarIn += + DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); + SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window inside reveal surfaces + SurfWinFrameQRadInAbs(SurfNum) += + BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + } - // 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.0) { - Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar - Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) - Real64 TransDiffGl = 0.0; // Diffuse solar transmittance - if (FrProjOut > 0.0 || FrProjIn > 0.0) { - Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - - FrameDivider(FrDivNum).VertDividers * DivWidth) * - FracSunLit / FrArea; - Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - - FrameDivider(FrDivNum).HorDividers * DivWidth) * - FracSunLit / FrArea; - // Beam solar on outside of frame - FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; - if (FrProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam solar on inside of frame - FrIncSolarIn = - (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; - } + // 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.0) { // Solar absorbed by window divider + Real64 DividerAbs = SurfWinDividerSolAbsorp( + SurfNum); // Window divider solar absorptance + if (SurfWinDividerType(SurfNum) == Suspended) { + // 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) + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( + 1); // Outer glass layer material number + Real64 TransGl = dataMaterial.Material( + MatNumGl).Trans; // Outer glass layer material number, switched construction + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( + 1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); + AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - // Beam plus diffuse solar on outside of frame - FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); - SurfWinFrameQRadOutAbs(SurfNum) = - FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window outside reveal surfaces - SurfWinFrameQRadOutAbs(SurfNum) += - BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - - // Beam plus diffuse solar on inside of frame - FrIncSolarIn += - DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); - SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window inside reveal surfaces - SurfWinFrameQRadInAbs(SurfNum) += - BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); + Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance + DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / + (1.0 - DividerRefl * ReflGl); } - // 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.0) { // Solar absorbed by window divider - Real64 DividerAbs = SurfWinDividerSolAbsorp( - SurfNum); // Window divider solar absorptance - if (SurfWinDividerType(SurfNum) == Suspended) { - // 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) - int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( - 1); // Outer glass layer material number - Real64 TransGl = dataMaterial.Material( - MatNumGl).Trans; // Outer glass layer material number, switched construction - Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - Real64 AbsGl = 1.0 - TransGl - ReflGl; - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) + Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) + // Beam incident on horizontal and vertical projection faces of divider if no exterior shading + if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn) { + 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; + } + Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) + Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && + ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading + DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + if (DivProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc(SurfNum), dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct( + ConstrNum).TransDiff; // Diffuse solar transmittance if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( - 1); - Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; - Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc(SurfNum), dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); // Outer glass solar trans, refl, absorptance if switched TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); - AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); - } - Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance - DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / - (1.0 - DividerRefl * ReflGl); - } - - Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) - Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) - // Beam incident on horizontal and vertical projection faces of divider if no exterior shading - if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn) { - 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; - } - Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) - Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && - ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading - DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - if (DivProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - Real64 TransDiffGl = dataConstruction.Construct( - ConstrNum).TransDiff; // Diffuse solar transmittance - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); // Outer glass solar trans, refl, absorptance if switched - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; // Diffuse solar transmittance, switched construction - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam plus diffuse solar on inside of divider - // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) - // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) - Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * - FrameDivider(FrDivNum).HorDividers * - DivProjIn * (Surface(SurfNum).Width - - FrameDivider( - FrDivNum).VertDividers * - DivWidth) * FracSunLit / - DivArea; - Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * - FrameDivider(FrDivNum).VertDividers * - DivProjIn * (Surface(SurfNum).Height - - FrameDivider( - FrDivNum).HorDividers * - DivWidth) * FracSunLit / - DivArea; - DivIncSolarInBm = - TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); - DivIncSolarInDif = - TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; // Diffuse solar transmittance, switched construction + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); } - } else { // Exterior shade, screen or blind present - - DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; + // Beam plus diffuse solar on inside of divider + // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) + // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * + FrameDivider(FrDivNum).HorDividers * + DivProjIn * (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * + DivWidth) * FracSunLit / DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * + FrameDivider(FrDivNum).VertDividers * + DivProjIn * (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * + DivWidth) * FracSunLit / DivArea; + DivIncSolarInBm = + TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); + DivIncSolarInDif = + TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); } + } else { // Exterior shade, screen or blind present + + DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + } - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != - BGBlindOn) { // No exterior or between-glass shade, screen or blind + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != + BGBlindOn) { // No exterior or between-glass shade, screen or blind + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); + // Exterior shade, screen or blind + } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || + ShadeFlag == ExtScreenOn) { + + if (ShadeFlag == ExtBlindOn) { // Exterior blind + int BlNum = SurfWinBlindNumber(SurfNum); + Real64 ProfAng; // Solar profile angle (rad) + ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); + Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) + // TBlBmBm - Blind beam-beam solar transmittance + // TBlBmDif - Blind diffuse-diffuse solar transmittance + Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, + Blind(BlNum).SlatWidth, + Blind(BlNum).SlatSeparation, + Blind(BlNum).SlatThickness); + Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, + SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontBeamDiffTrans); SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); + DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + + DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); - // Exterior shade, screen or blind - } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || - ShadeFlag == ExtScreenOn) { - - if (ShadeFlag == ExtBlindOn) { // Exterior blind - int BlNum = SurfWinBlindNumber(SurfNum); - Real64 ProfAng; // Solar profile angle (rad) - ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); - Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) - // TBlBmBm - Blind beam-beam solar transmittance - // TBlBmDif - Blind diffuse-diffuse solar transmittance - Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, - Blind(BlNum).SlatWidth, - Blind(BlNum).SlatSeparation, - Blind(BlNum).SlatThickness); - Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, - SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontBeamDiffTrans); - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (DivIncSolarOutBm * - (TBlBmBm + TBlBmDif) + - DivIncSolarOutDif * - InterpSlatAng(SlatAng, - SurfWinMovableSlats( - SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (DivIncSolarInBm * - (TBlBmBm + TBlBmDif) + - DivIncSolarInDif * - InterpSlatAng(SlatAng, - SurfWinMovableSlats( - SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); - - } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarInBm + DivIncSolarInDif); - - } else if (ShadeFlag == ExtScreenOn) { // Exterior screen - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarInBm + DivIncSolarInDif); - } + DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + + DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + + } else if (ShadeFlag == ExtShadeOn) { // Exterior shade + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarInBm + DivIncSolarInDif); + + } else if (ShadeFlag == ExtScreenOn) { // Exterior screen + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarInBm + DivIncSolarInDif); } } } + } - } // RoughIndexMovInsul <= 0, no movable insulation + } // RoughIndexMovInsul <= 0, no movable insulation - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= - 0.0) { // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); - SurfOpaqSWOutAbsTotalReport(SurfNum) = - SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = - SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } - } // Surface(SurfNum)%HeatTransSurf + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= + 0.0) { // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } + } // Surface(SurfNum)%HeatTransSurf - } // Surface(SurfNum)%ExtSolar - } + } // Surface(SurfNum)%ExtSolar int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; if (firstSurfOpaq == -1) continue; @@ -3419,7 +3406,7 @@ namespace HeatBalanceSurfaceManager { } } } // End of surface loop - } + } // end of zone loop } // End of sun-up check } diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index f868ca13b0c..06cd0708c70 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -473,6 +473,7 @@ namespace SolarShading { MultIsoSky = 0.0; MultCircumSolar = 0.0; MultHorizonZenith = 0.0; + SurfConstrNum = 0.0; InsideGlassCondensationFlag = 0; InsideFrameCondensationFlag = 0; @@ -1010,6 +1011,7 @@ namespace SolarShading { CosIncAngHR.dimension(24, TotSurfaces, 0.0); CosIncAng.dimension(NumOfTimeStepInHour, 24, TotSurfaces, 0.0); AnisoSkyMult.dimension(TotSurfaces, 1.0); // For isotropic sky: recalculated in AnisoSkyViewFactors if anisotropic radiance + SurfConstrNum.dimension(TotSurfaces, 0.0); // ALLOCATE(WithShdgIsoSky(TotSurfaces)) // WithShdgIsoSky=0.0 // ALLOCATE(WoShdgIsoSky(TotSurfaces)) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 98ab7de71ef..283b8a1f587 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -11840,6 +11840,7 @@ namespace SurfaceGeometry { } // End of check if new window constructions have to be created } // End of loop over unshaded and shaded window constructions } // End of loop over storm window objects + } void ModifyWindow(int const SurfNum, // SurfNum has construction of glazing system from Window5 Data File; diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index d5e74da865b..210d3b464e3 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -399,6 +399,7 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const & filepat EnergyPlus::ShowSevereError(e.what()); return EnergyPlus::AbortEnergyPlus(state); } + std::cout << "Solar timer: " << EnergyPlus::DataGlobals::timer_1 << "\n"; return wrapUpEnergyPlus(state); } diff --git a/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh b/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh index 8087f4f5cbf..e03b7beae61 100644 --- a/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh +++ b/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh @@ -1169,6 +1169,7 @@ public: // Subscript T & operator ()( int const i ) { + assert( contains( i ) ); return sdata_[ i ]; } From df84b1ae095b1d2a7b3ef120b980c515ce3e43dc Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 8 Sep 2020 15:45:51 -0700 Subject: [PATCH 08/25] revert some tests --- src/EnergyPlus/DataSurfaces.cc | 3 - src/EnergyPlus/DataSurfaces.hh | 2 - src/EnergyPlus/HeatBalanceManager.cc | 9 - src/EnergyPlus/HeatBalanceSurfaceManager.cc | 1192 +++++++++---------- src/EnergyPlus/SolarShading.cc | 2 - src/EnergyPlus/SurfaceGeometry.cc | 1 - 6 files changed, 589 insertions(+), 620 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 7afb84fa561..8533d88182a 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -441,8 +441,6 @@ namespace DataSurfaces { Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse and beam solar from exterior obstructions [W/m2] Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, accounts for shadowing of ground by building and obstructions [W/m2] - Array1D SurfConstrNum; - std::vector AllHTSurfaceList; // List of all heat transfer surfaces std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces std::vector AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces @@ -1254,7 +1252,6 @@ namespace DataSurfaces { SurfSunlitFrac.deallocate(); SurfSkySolarInc.clear(); SurfGndSolarInc.clear(); - SurfConstrNum.clear(); AllHTSurfaceList.clear(); AllIZSurfaceList.clear(); AllHTNonWindowSurfaceList.clear(); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index f4e7a41e755..474776d458b 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -424,8 +424,6 @@ namespace DataSurfaces { extern Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse and beam solar from exterior obstructions [W/m2] extern Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, accounts for shadowing of ground by building and obstructions [W/m2] - extern Array1D SurfConstrNum; - extern std::vector AllHTSurfaceList; // List of all heat transfer surfaces - simulation order extern std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces extern std::vector AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 207f6cf2474..6e581cc554a 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5233,10 +5233,6 @@ namespace HeatBalanceManager { for (SurfNum = 1; SurfNum <= TotSurfaces; SurfNum++) { DataSurfaces::SurfaceWindow(SurfNum).ThetaFace = 296.15; DataSurfaces::SurfWinEffInsSurfTemp(SurfNum) = 23.0; - DataSurfaces::SurfConstrNum(SurfNum) = 0; - if (DataSurfaces::Surface(SurfNum).HeatTransSurf) { - DataSurfaces::SurfConstrNum(SurfNum) = DataSurfaces::Surface(SurfNum).Construction; - } } } @@ -5257,11 +5253,6 @@ namespace HeatBalanceManager { } ChangeSet = true; } - for (StormWinNum = 1; StormWinNum <= TotStormWin; ++StormWinNum) { - if (DataSurfaces::SurfWinStormWinFlag(StormWinNum) == 1) { - DataSurfaces::SurfConstrNum(StormWinNum) = DataSurfaces::Surface(StormWinNum).StormWinConstruction; - } - } } if (BeginSimFlag && DoWeathSim && ReportExtShadingSunlitFrac) { diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 07a8c8393b7..94a7d1288b5 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2344,14 +2344,7 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static - - static Array1D CosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass - static Array1D BeamSolar(TotSurfaces); // Local variable for BeamSolarRad - static Array1D SkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface - static Array1D GndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface - // Always initialize the shortwave quantities - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { SurfInitialDifSolInAbsReport(SurfNum) = 0.0; @@ -2709,669 +2702,662 @@ namespace HeatBalanceSurfaceManager { // DifIncInsSurfIntensRep(SurfNum) // DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec // END DO + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + int const firstSurf = Zone(zoneNum).SurfaceFirst; + int const lastSurf = Zone(zoneNum).SurfaceLast; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int OutShelfSurf = 0; // Outside daylighting shelf surface number + if (ShelfNum > 0) { + OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 + } - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int OutShelfSurf = 0; // Outside daylighting shelf surface number - if (ShelfNum > 0) { - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int PipeNum; // TDD pipe object number + int SurfNum2; // TDD: DOME object number + Real64 CosInc; // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar; // Local variable for BeamSolarRad + Real64 SkySolarInc; // Sky diffuse solar incident on a surface + Real64 GndSolarInc; // Ground diffuse solar incident on a surface - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - int PipeNum; // TDD pipe object number - int SurfNum2; // TDD:DOME object number + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + PipeNum = SurfWinTDDPipeNum(SurfNum); + SurfNum2 = TDDPipe(PipeNum).Dome; + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - PipeNum = SurfWinTDDPipeNum(SurfNum); - SurfNum2 = TDDPipe(PipeNum).Dome; + // 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) / + dataConstruction.Construct(ConstrNum).TransDiff; - CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; - // 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(SurfNum) = BeamSolarRad * TransTDD(PipeNum, CosInc(SurfNum), SolarBeam) / + GndSolarInc = + GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / dataConstruction.Construct(ConstrNum).TransDiff; - SkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc(SurfNum), SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; - - GndSolarInc(SurfNum) = - GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / - dataConstruction.Construct(ConstrNum).TransDiff; - - } else if (OutShelfSurf > 0) { // Outside daylighting shelf - SurfNum2 = SurfNum; - - CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - - BeamSolar(SurfNum) = BeamSolarRad; - SkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - // Shelf diffuse solar radiation - Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * - CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + - 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(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + - ShelfSolarRad * Shelf(ShelfNum).ViewFactor; - - } else { // Regular surface - SurfNum2 = SurfNum; - CosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - BeamSolar(SurfNum) = BeamSolarRad; - SkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); - GndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); - } + } else if (OutShelfSurf > 0) { // Outside daylighting shelf + SurfNum2 = SurfNum; + + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + + BeamSolar = BeamSolarRad; + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); + // Shelf diffuse solar radiation + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * + CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + 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(TimeStep, HourOfDay, SurfNum); + BeamSolar = BeamSolarRad; + SkySolarInc = SurfSkySolarInc(SurfNum); + GndSolarInc = SurfGndSolarInc(SurfNum); + } - // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = CosInc(SurfNum); + // Cosine of incidence angle and solar incident on outside of surface, for reporting + SurfCosIncidenceAngle(SurfNum) = CosInc; - // Report variables for various incident solar quantities + // Report variables for various incident solar quantities - // Incident direct (unreflected) beam - SurfQRadSWOutIncidentBeam(SurfNum) = - BeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc(SurfNum); // NOTE: SurfNum2 + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 - // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc(SurfNum); - } else { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - } - // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc(SurfNum); - // Incident diffuse solar from beam-to-diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - } else { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Incident diffuse solar from sky diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - } else { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; - } - // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included - // in SkySolarInc. - // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; + } else { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + } + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; + // Incident diffuse solar from beam-to-diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + } else { + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Incident diffuse solar from sky diffuse reflection from ground + if (CalcSolRefl) { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); + } else { + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; + } + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc + + // TH2 CR 9056 + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + + if (CalcSolRefl) { + // Incident beam solar from beam-to-beam (specular) reflection from obstructions + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from beam-to-diffuse reflection from obstructions + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from sky diffuse reflection from obstructions + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); + // TH2 CR 9056: Add reflections from obstructions to the total incident + SurfQRadSWOutIncident(SurfNum) += + SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); + } - // TH2 CR 9056 - SurfQRadSWOutIncident(SurfNum) = - SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); - - if (CalcSolRefl) { - // Incident beam solar from beam-to-beam (specular) reflection from obstructions - SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from beam-to-diffuse reflection from obstructions - SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from sky diffuse reflection from obstructions - SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); - // TH2 CR 9056: Add reflections from obstructions to the total incident - SurfQRadSWOutIncident(SurfNum) += - SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + - SurfQRadSWOutIncSkyDiffReflObs(SurfNum); - } - } - } // end of surface loop - for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - int const firstSurf = Zone(zoneNum).SurfaceFirst; - int const lastSurf = Zone(zoneNum).SurfaceLast; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - if (Surface(SurfNum).HeatTransSurf) { - // Exclude special shading surfaces which required QRadSWOut calculations above + if (Surface(SurfNum).HeatTransSurf) { + // Exclude special shading surfaces which required QRadSWOut calculations above - int RoughIndexMovInsul = 0; // Roughness index of movable insulation - Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) - Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) + int RoughIndexMovInsul = 0; // Roughness index of movable insulation + Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) + Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) - if (Surface(SurfNum).MaterialMovInsulExt > 0) - EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); + if (Surface(SurfNum).MaterialMovInsulExt > 0) + EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); - if (RoughIndexMovInsul <= 0) { // No movable insulation present + if (RoughIndexMovInsul <= 0) { // No movable insulation present - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; - } else { // Exterior window - int ShadeFlag = SurfWinShadingFlag(SurfNum); + } else { // Exterior window + int ShadeFlag = SurfWinShadingFlag(SurfNum); - if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && - SurfWinWindowModelType(SurfNum) != WindowEQLModel && - !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && + SurfWinWindowModelType(SurfNum) != WindowEQLModel && + !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int TotGlassLay = dataConstruction.Construct( - ConstrNum).TotGlassLayers; // Number of glass layers - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); - } + int TotGlassLay = dataConstruction.Construct( + ConstrNum).TotGlassLayers; // Number of glass layers + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); + } - ShadeFlag = SurfWinShadingFlag(SurfNum); + ShadeFlag = SurfWinShadingFlag(SurfNum); - if (ShadeFlag > 0) { // Shaded window - int ConstrNumSh = Surface( - SurfNum).ShadedConstruction; // Shaded window construction - if (SurfWinStormWinFlag(SurfNum) == 1) - ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; + if (ShadeFlag > 0) { // Shaded window + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; // Shaded window construction + if (SurfWinStormWinFlag(SurfNum) == 1) + ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; - if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || - ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on + if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || + ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( - Lay); + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( + Lay); + } + SurfWinExtDiffAbsByShade(SurfNum) = + dataConstruction.Construct(ConstrNumSh).AbsDiffShade * + (SkySolarInc + GndSolarInc); } - SurfWinExtDiffAbsByShade(SurfNum) = - dataConstruction.Construct(ConstrNumSh).AbsDiffShade * - (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); - } - - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { // Blind on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiff( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffGnd( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffSky( - {1, MaxSlatAngs}, Lay)); - } - SurfWinExtDiffAbsByShade(SurfNum) = - InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( ConstrNumSh).AbsDiffBlind) * - (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - Real64 AbsDiffBlindGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); - Real64 AbsDiffBlindSky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { // Blind on + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + + AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiff( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffGnd( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffSky( + {1, MaxSlatAngs}, Lay)); + } SurfWinExtDiffAbsByShade(SurfNum) = - SkySolarInc(SurfNum) * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + - GndSolarInc(SurfNum) * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + - 0.5 * ACosTlt * AbsDiffBlindSky); + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( ConstrNumSh).AbsDiffBlind) * + (SkySolarInc + GndSolarInc); + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffBlindGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); + Real64 AbsDiffBlindSky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); + SurfWinExtDiffAbsByShade(SurfNum) = + SkySolarInc * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + + GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + + 0.5 * ACosTlt * AbsDiffBlindSky); + } } - } - // Correct for shadowing of divider onto interior shading device (note that dividers are - // not allowed in windows with between-glass shade/blind) + // 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 || ShadeFlag == IntBlindOn) && - SurfWinDividerArea(SurfNum) > 0.0) - SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); + if ((ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) && + SurfWinDividerArea(SurfNum) > 0.0) + SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor( - SurfNum); // Switching factor for switchable glazing - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), - dataConstruction.Construct( - ConstrNumSh).AbsDiff(Lay)); + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor( + SurfNum); // Switching factor for switchable glazing + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), + dataConstruction.Construct( + ConstrNumSh).AbsDiff(Lay)); + } } - } - - } // End of check if window has shading device on - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)) + - AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); - // AWinSurf is from InteriorSolarDistribution - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on - // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on - Real64 ACosTlt = std::abs( - Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle - Real64 AbsDiffGlassLayGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( - {1, 19}, Lay)); - Real64 AbsDiffGlassLaySky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( - {1, 19}, Lay)); + } // End of check if window has shading device on - SurfWinQRadSWwinAbs(Lay, SurfNum) = - SkySolarInc(SurfNum) * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + - GndSolarInc(SurfNum) * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + - AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * BeamSolar; + // AWinSurf is from InteriorSolarDistribution + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on + // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on + Real64 ACosTlt = std::abs( + Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle + Real64 AbsDiffGlassLayGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( + {1, 19}, Lay)); + Real64 AbsDiffGlassLaySky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( + {1, 19}, Lay)); + + SurfWinQRadSWwinAbs(Lay, SurfNum) = + SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + + GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + + AWinSurf(Lay, SurfNum) * BeamSolar; + } } - } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - // Need to do it this way for now beaucse of scheduled surface gains. They do work only with - // BSDF windows and overwriting absorbtances will work only for ordinary windows - // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && - // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && - // inExtWindowModel->isExternalLibraryModel() ) { - // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; - // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { - // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * - // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); - // } - } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - int TotSolidLay = dataConstruction.Construct( - ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) - int CurrentState = SurfaceWindow( - SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration - // Examine for schedule surface gain - Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, - ConstrNum); // Pointer to scheduled surface gains object for fenestration systems - - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - if (SurfSolAbs != 0) { - AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( - FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); - // ABWin(Lay) = AWinSurf(SurfNum,Lay) - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); - } 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 - SurfWinQRadSWwinAbs(Lay, SurfNum) = - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc(SurfNum) + - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc(SurfNum) + - AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum) + - AWinCFOverlap(Lay, SurfNum) * BeamSolar(SurfNum); + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Need to do it this way for now beaucse of scheduled surface gains. They do work only with + // BSDF windows and overwriting absorbtances will work only for ordinary windows + // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && + // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && + // inExtWindowModel->isExternalLibraryModel() ) { + // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; + // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { + // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * + // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); + // } + } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { + int TotSolidLay = dataConstruction.Construct( + ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) + int CurrentState = SurfaceWindow( + SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration + // Examine for schedule surface gain + Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, + ConstrNum); // Pointer to scheduled surface gains object for fenestration systems + + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + if (SurfSolAbs != 0) { + AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( + FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); + // ABWin(Lay) = AWinSurf(SurfNum,Lay) + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); + } 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 + SurfWinQRadSWwinAbs(Lay, SurfNum) = + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + + AWinSurf(Lay, SurfNum) * BeamSolar + + AWinCFOverlap(Lay, SurfNum) * BeamSolar; + } + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - -// ShadeFlag = SurfWinShadingFlag(SurfNum); - - } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr - int TotSolidLay = CFS(dataConstruction.Construct( - Surface(SurfNum).Construction).EQLConsPtr).NL; - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( - Lay); - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum) + - AbsDiffWin(Lay) * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); - - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int SurfNum2 = SurfNum; - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; - } - std::pair incomingAngle = getSunWCEAngles( - dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); - Real64 Theta = incomingAngle.first; - Real64 Phi = incomingAngle.second; + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + + // ShadeFlag = SurfWinShadingFlag(SurfNum); + + } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr + int TotSolidLay = CFS(dataConstruction.Construct( + Surface(SurfNum).Construction).EQLConsPtr).NL; + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( + Lay); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + int SurfNum2 = SurfNum; + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; + } + std::pair incomingAngle = getSunWCEAngles( + dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); + Real64 Theta = incomingAngle.first; + Real64 Phi = incomingAngle.second; - std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( - dataWindowManager, WavelengthRange::Solar, ConstrNum); + std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( + dataWindowManager, WavelengthRange::Solar, ConstrNum); - size_t totLayers = aLayer->getNumOfLayers(); - for (size_t Lay = 1; Lay <= totLayers; ++Lay) { + size_t totLayers = aLayer->getNumOfLayers(); + for (size_t Lay = 1; Lay <= totLayers; ++Lay) { - Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, - ScatteringSimple::Diffuse, - Theta, Phi); + Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, + ScatteringSimple::Diffuse, + Theta, Phi); - SurfWinQRadSWwinAbs(Lay, SurfNum) = - AbWinDiff * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)) + - AWinSurf(Lay, SurfNum) * BeamSolar(SurfNum); + SurfWinQRadSWwinAbs(Lay, SurfNum) = + AbWinDiff * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * BeamSolar; - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } } - } - // Solar absorbed by window frame and dividers - int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number - Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) - Real64 FrWidth = 0.0; // Frame, divider width (m) - Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) - Real64 FrProjIn = 0.0; - Real64 DivArea = 0.0; - Real64 DivWidth = 0.0; - Real64 DivProjOut = 0.0; - Real64 DivProjIn = 0.0; - if (FrDivNum > 0) { - FrWidth = FrameDivider(FrDivNum).FrameWidth; - FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; - FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; - DivArea = SurfWinDividerArea(SurfNum); - DivWidth = FrameDivider(FrDivNum).DividerWidth; - DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; - DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - } - Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection - Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection - Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step - Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) - Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) - if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); - BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc(SurfNum); - DifSolarFaceInc = SkySolarInc(SurfNum) + GndSolarInc(SurfNum); - } - if (FracSunLit > 0.0) { - if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || - (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { - // 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)) - Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( - 3)); // Altitude and azimuth angle of outward window normal (radians) - Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), - Surface(SurfNum).OutNormVec(1)); - Real64 PhiSun = std::asin( - SOLCOS(3)); // Altitude and azimuth angle of sun (radians) - Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); - Real64 const cos_PhiWin(std::cos(PhiWin)); - Real64 const cos_PhiSun(std::cos(PhiSun)); - CosIncAngHorProj = std::abs( - std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - - cos_PhiWin * std::sin(PhiSun)); - CosIncAngVertProj = std::abs( - cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); + // Solar absorbed by window frame and dividers + int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number + Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) + Real64 FrWidth = 0.0; // Frame, divider width (m) + Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) + Real64 FrProjIn = 0.0; + Real64 DivArea = 0.0; + Real64 DivWidth = 0.0; + Real64 DivProjOut = 0.0; + Real64 DivProjIn = 0.0; + if (FrDivNum > 0) { + FrWidth = FrameDivider(FrDivNum).FrameWidth; + FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; + FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; + DivArea = SurfWinDividerArea(SurfNum); + DivWidth = FrameDivider(FrDivNum).DividerWidth; + DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; + DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; } - } - - // 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.0) { - Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar - Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) - Real64 TransDiffGl = 0.0; // Diffuse solar transmittance - if (FrProjOut > 0.0 || FrProjIn > 0.0) { - Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - - FrameDivider(FrDivNum).VertDividers * DivWidth) * - FracSunLit / FrArea; - Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - - FrameDivider(FrDivNum).HorDividers * DivWidth) * - FracSunLit / FrArea; - // Beam solar on outside of frame - FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; - if (FrProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc(SurfNum), dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc(SurfNum), dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam solar on inside of frame - FrIncSolarIn = - (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection + Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection + Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step + Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) + Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) + if (FrArea > 0.0 || DivArea > 0.0) { + FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); + BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + DifSolarFaceInc = SkySolarInc + GndSolarInc; + } + if (FracSunLit > 0.0) { + if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || + (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { + // 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)) + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( + 3)); // Altitude and azimuth angle of outward window normal (radians) + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), + Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin( + SOLCOS(3)); // Altitude and azimuth angle of sun (radians) + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 const cos_PhiWin(std::cos(PhiWin)); + Real64 const cos_PhiSun(std::cos(PhiSun)); + CosIncAngHorProj = std::abs( + std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - + cos_PhiWin * std::sin(PhiSun)); + CosIncAngVertProj = std::abs( + cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); } } - // Beam plus diffuse solar on outside of frame - FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); - SurfWinFrameQRadOutAbs(SurfNum) = - FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window outside reveal surfaces - SurfWinFrameQRadOutAbs(SurfNum) += - BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - - // Beam plus diffuse solar on inside of frame - FrIncSolarIn += - DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); - SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window inside reveal surfaces - SurfWinFrameQRadInAbs(SurfNum) += - BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - } - // 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.0) { // Solar absorbed by window divider - Real64 DividerAbs = SurfWinDividerSolAbsorp( - SurfNum); // Window divider solar absorptance - if (SurfWinDividerType(SurfNum) == Suspended) { - // 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) - int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( - 1); // Outer glass layer material number - Real64 TransGl = dataMaterial.Material( - MatNumGl).Trans; // Outer glass layer material number, switched construction - Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - Real64 AbsGl = 1.0 - TransGl - ReflGl; - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( - 1); - Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; - Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); - AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); + // 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.0) { + Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar + Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) + Real64 TransDiffGl = 0.0; // Diffuse solar transmittance + if (FrProjOut > 0.0 || FrProjIn > 0.0) { + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - + FrameDivider(FrDivNum).VertDividers * DivWidth) * + FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - + FrameDivider(FrDivNum).HorDividers * DivWidth) * + FracSunLit / FrArea; + // Beam solar on outside of frame + FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; + if (FrProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); + TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam solar on inside of frame + FrIncSolarIn = + (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + } } - Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance - DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / - (1.0 - DividerRefl * ReflGl); + // Beam plus diffuse solar on outside of frame + FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); + SurfWinFrameQRadOutAbs(SurfNum) = + FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window outside reveal surfaces + SurfWinFrameQRadOutAbs(SurfNum) += + BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + + // Beam plus diffuse solar on inside of frame + FrIncSolarIn += + DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); + SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window inside reveal surfaces + SurfWinFrameQRadInAbs(SurfNum) += + BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); } - Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) - Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) - // Beam incident on horizontal and vertical projection faces of divider if no exterior shading - if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn) { - 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; - } - Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) - Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && - ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading - DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - if (DivProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc(SurfNum), dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - Real64 TransDiffGl = dataConstruction.Construct( - ConstrNum).TransDiff; // Diffuse solar transmittance + // 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.0) { // Solar absorbed by window divider + Real64 DividerAbs = SurfWinDividerSolAbsorp( + SurfNum); // Window divider solar absorptance + if (SurfWinDividerType(SurfNum) == Suspended) { + // 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) + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( + 1); // Outer glass layer material number + Real64 TransGl = dataMaterial.Material( + MatNumGl).Trans; // Outer glass layer material number, switched construction + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc(SurfNum), dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); // Outer glass solar trans, refl, absorptance if switched + Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( + 1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; // Diffuse solar transmittance, switched construction - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); + AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - // Beam plus diffuse solar on inside of divider - // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) - // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) - Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * - FrameDivider(FrDivNum).HorDividers * - DivProjIn * (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * - DivWidth) * FracSunLit / DivArea; - Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * - FrameDivider(FrDivNum).VertDividers * - DivProjIn * (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * - DivWidth) * FracSunLit / DivArea; - DivIncSolarInBm = - TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); - DivIncSolarInDif = - TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance + DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / + (1.0 - DividerRefl * ReflGl); } - } else { // Exterior shade, screen or blind present - - DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - } - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != - BGBlindOn) { // No exterior or between-glass shade, screen or blind - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); - // Exterior shade, screen or blind - } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || - ShadeFlag == ExtScreenOn) { - - if (ShadeFlag == ExtBlindOn) { // Exterior blind - int BlNum = SurfWinBlindNumber(SurfNum); - Real64 ProfAng; // Solar profile angle (rad) - ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); - Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) - // TBlBmBm - Blind beam-beam solar transmittance - // TBlBmDif - Blind diffuse-diffuse solar transmittance - Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, - Blind(BlNum).SlatWidth, - Blind(BlNum).SlatSeparation, - Blind(BlNum).SlatThickness); - Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, - SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontBeamDiffTrans); + Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) + Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) + // Beam incident on horizontal and vertical projection faces of divider if no exterior shading + if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn) { + 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; + } + Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) + Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && + ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading + DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + if (DivProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct( + ConstrNum).TransDiff; // Diffuse solar transmittance + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( ConstrNumSh).TransSolBeamCoef); + // Outer glass solar trans, refl, absorptance if switched + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; + // Diffuse solar transmittance, switched construction + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam plus diffuse solar on inside of divider + // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) + // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * + FrameDivider(FrDivNum).HorDividers * + DivProjIn * (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * + DivWidth) * FracSunLit / DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * + FrameDivider(FrDivNum).VertDividers * + DivProjIn * (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * + DivWidth) * FracSunLit / DivArea; + DivIncSolarInBm = + TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); + DivIncSolarInDif = + TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + } + } else { // Exterior shade, screen or blind present + + DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + } + + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != + BGBlindOn) { // No exterior or between-glass shade, screen or blind SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + - DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); + DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + - DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); - - } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarInBm + DivIncSolarInDif); - - } else if (ShadeFlag == ExtScreenOn) { // Exterior screen - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarInBm + DivIncSolarInDif); + DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); + // Exterior shade, screen or blind + } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || + ShadeFlag == ExtScreenOn) { + + if (ShadeFlag == ExtBlindOn) { // Exterior blind + int BlNum = SurfWinBlindNumber(SurfNum); + Real64 ProfAng; // Solar profile angle (rad) + ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); + Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) + // TBlBmBm - Blind beam-beam solar transmittance + // TBlBmDif - Blind diffuse-diffuse solar transmittance + Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, + Blind(BlNum).SlatWidth, + Blind(BlNum).SlatSeparation, + Blind(BlNum).SlatThickness); + Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, + SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontBeamDiffTrans); + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + + DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + + DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + + } else if (ShadeFlag == ExtShadeOn) { // Exterior shade + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( + dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarInBm + DivIncSolarInDif); + + } else if (ShadeFlag == ExtScreenOn) { // Exterior screen + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarInBm + DivIncSolarInDif); + } } } } - } - - } // RoughIndexMovInsul <= 0, no movable insulation - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= - 0.0) { // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc(SurfNum) + GndSolarInc(SurfNum)); - SurfOpaqSWOutAbsTotalReport(SurfNum) = - SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = - SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } - } // Surface(SurfNum)%HeatTransSurf + } // RoughIndexMovInsul <= 0, no movable insulation + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= + 0.0) { // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } + } // Surface(SurfNum)%HeatTransSurf + } } // Surface(SurfNum)%ExtSolar int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 06cd0708c70..f868ca13b0c 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -473,7 +473,6 @@ namespace SolarShading { MultIsoSky = 0.0; MultCircumSolar = 0.0; MultHorizonZenith = 0.0; - SurfConstrNum = 0.0; InsideGlassCondensationFlag = 0; InsideFrameCondensationFlag = 0; @@ -1011,7 +1010,6 @@ namespace SolarShading { CosIncAngHR.dimension(24, TotSurfaces, 0.0); CosIncAng.dimension(NumOfTimeStepInHour, 24, TotSurfaces, 0.0); AnisoSkyMult.dimension(TotSurfaces, 1.0); // For isotropic sky: recalculated in AnisoSkyViewFactors if anisotropic radiance - SurfConstrNum.dimension(TotSurfaces, 0.0); // ALLOCATE(WithShdgIsoSky(TotSurfaces)) // WithShdgIsoSky=0.0 // ALLOCATE(WoShdgIsoSky(TotSurfaces)) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 283b8a1f587..98ab7de71ef 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -11840,7 +11840,6 @@ namespace SurfaceGeometry { } // End of check if new window constructions have to be created } // End of loop over unshaded and shaded window constructions } // End of loop over storm window objects - } void ModifyWindow(int const SurfNum, // SurfNum has construction of glazing system from Window5 Data File; From 48d009320aee3e65aa77617de18f6417d7ee7dc8 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 8 Sep 2020 23:11:15 -0700 Subject: [PATCH 09/25] reduce test 1 --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 55 +++++++++++++-------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 94a7d1288b5..f4a8e101c97 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2343,7 +2343,7 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWin(CFSMAXNL); // Diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static - + static Array1D SkyDiffReflFacGnd(TotSurfaces); // sky diffuse reflection view factors from ground // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2517,6 +2517,12 @@ namespace HeatBalanceSurfaceManager { } } } + if (InitSurfaceHeatBalancefirstTime) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + BmToDiffReflFacGnd(SurfNum) = Surface(SurfNum).ViewFactorGround; + SkyDiffReflFacGnd(SurfNum) = Surface(SurfNum).ViewFactorGround; + } + } if (!SunIsUp || (BeamSolarRad + GndSolarRad + DifSolarRad <= 0.0)) { // Sun is down @@ -2613,6 +2619,7 @@ namespace HeatBalanceSurfaceManager { BeamSolarRad * (BmToBmReflFacObs(SurfNum) + BmToDiffReflFacObs(SurfNum)) + DifSolarRad * ReflFacSkySolObs(SurfNum); SurfGndSolarInc(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum) + DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); + SkyDiffReflFacGnd(SurfNum) = ReflFacSkySolGnd(SurfNum); } } @@ -2702,6 +2709,28 @@ namespace HeatBalanceSurfaceManager { // DifIncInsSurfIntensRep(SurfNum) // DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec // END DO + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + if (Surface(SurfNum).Class != SurfaceClass_Shading) continue; + // Cosine of incidence angle and solar incident on outside of surface, for reporting + Real64 CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + SurfCosIncidenceAngle(SurfNum) = CosInc; + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = SurfGndSolarInc(SurfNum); + // Incident diffuse solar from beam-to-diffuse reflection from ground + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + // Incident diffuse solar from sky diffuse reflection from ground + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + + } for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { int const firstSurf = Zone(zoneNum).SurfaceFirst; int const lastSurf = Zone(zoneNum).SurfaceLast; @@ -2773,7 +2802,6 @@ namespace HeatBalanceSurfaceManager { SurfCosIncidenceAngle(SurfNum) = CosInc; // Report variables for various incident solar quantities - // Incident direct (unreflected) beam SurfQRadSWOutIncidentBeam(SurfNum) = BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 @@ -2787,21 +2815,10 @@ namespace HeatBalanceSurfaceManager { // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; // Incident diffuse solar from beam-to-diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - } else { - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * Surface(SurfNum).ViewFactorGround; - } + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + // Incident diffuse solar from sky diffuse reflection from ground - if (CalcSolRefl) { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * ReflFacSkySolGnd(SurfNum); - } else { - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * Surface(SurfNum).ViewFactorGround; - } + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included // in SkySolarInc. // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc @@ -2847,8 +2864,7 @@ namespace HeatBalanceSurfaceManager { SurfWinWindowModelType(SurfNum) != WindowEQLModel && !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int TotGlassLay = dataConstruction.Construct( - ConstrNum).TotGlassLayers; // Number of glass layers + int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; // Number of glass layers for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); } @@ -2864,8 +2880,7 @@ namespace HeatBalanceSurfaceManager { ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff( - Lay); + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); } SurfWinExtDiffAbsByShade(SurfNum) = dataConstruction.Construct(ConstrNumSh).AbsDiffShade * From ef6900a46dd16b71f04feb2053d006dd88bb7bc3 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 9 Sep 2020 11:11:51 -0700 Subject: [PATCH 10/25] shading --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 44 +++++++++++---------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f4a8e101c97..dab229e79bf 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2709,27 +2709,31 @@ namespace HeatBalanceSurfaceManager { // DifIncInsSurfIntensRep(SurfNum) // DifIncInsSurfAmountRepEnergy(SurfNum) = DifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec // END DO - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - if (Surface(SurfNum).Class != SurfaceClass_Shading) continue; - // Cosine of incidence angle and solar incident on outside of surface, for reporting - Real64 CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); - SurfCosIncidenceAngle(SurfNum) = CosInc; - // Incident direct (unreflected) beam - SurfQRadSWOutIncidentBeam(SurfNum) = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; - // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = SurfGndSolarInc(SurfNum); - // Incident diffuse solar from beam-to-diffuse reflection from ground - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - // Incident diffuse solar from sky diffuse reflection from ground - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); - // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included - // in SkySolarInc. - SurfQRadSWOutIncident(SurfNum) = - SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + if (BuildingShadingCount || FixedShadingCount || AttachedShadingCount) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + if (!Surface(SurfNum).ShadowingSurf) continue; + // Cosine of incidence angle and solar incident on outside of surface, for reporting + Real64 CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + SurfCosIncidenceAngle(SurfNum) = CosInc; + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = SurfGndSolarInc(SurfNum); + // Incident diffuse solar from beam-to-diffuse reflection from ground + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + // Incident diffuse solar from sky diffuse reflection from ground + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + } } for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { int const firstSurf = Zone(zoneNum).SurfaceFirst; From 1c47c9e8a49c571c8e696fddf5be44f25d23063b Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 9 Sep 2020 12:17:48 -0700 Subject: [PATCH 11/25] tdd --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 31 +++++++++++---------- src/EnergyPlus/api/EnergyPlusPgm.cc | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f4a8e101c97..c1aef28f3bc 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -716,13 +716,13 @@ namespace HeatBalanceSurfaceManager { // take the appropriate parts of these inits to the other heat balance managers if (InitSurfaceHeatBalancefirstTime) DisplayString("Initializing Solar Heat Gains"); - high_resolution_clock::time_point t1 = high_resolution_clock::now(); +// high_resolution_clock::time_point t1 = high_resolution_clock::now(); InitSolarHeatGains(state.dataWindowComplexManager, state.dataWindowEquivalentLayer, state.dataWindowManager); - high_resolution_clock::time_point t2 = high_resolution_clock::now(); - duration time_span = duration_cast>(t2 - t1); - DataGlobals::timer_1 += time_span.count(); +// high_resolution_clock::time_point t2 = high_resolution_clock::now(); +// duration time_span = duration_cast>(t2 - t1); +// DataGlobals::timer_1 += time_span.count(); if (SunIsUp && (BeamSolarRad + GndSolarRad + DifSolarRad > 0.0)) { for (int NZ = 1; NZ <= NumOfZones; ++NZ) { @@ -2562,23 +2562,24 @@ namespace HeatBalanceSurfaceManager { } if (NumOfTDDPipes > 0) { - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - SurfWinTransSolar(SurfNum) = 0.0; - SurfWinTransSolarEnergy(SurfNum) = 0.0; - SurfQRadSWOutIncident(SurfNum) = 0.0; - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - } - for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { - for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = 0.0; - } - } for (auto &e : TDDPipe) { e.TransSolBeam = 0.0; e.TransSolDiff = 0.0; e.TransVisBeam = 0.0; e.TransVisDiff = 0.0; e.TransmittedSolar = 0.0; + int SurfDome = e.Dome; + int SurfDiffuser = e.Diffuser; + SurfWinTransSolar(SurfDome) = 0.0; + SurfQRadSWOutIncident(SurfDome) = 0.0; + SurfWinQRadSWwinAbsTot(SurfDome) = 0.0; + SurfWinTransSolar(SurfDiffuser) = 0.0; + SurfQRadSWOutIncident(SurfDiffuser) = 0.0; + SurfWinQRadSWwinAbsTot(SurfDiffuser) = 0.0; + for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { + SurfWinQRadSWwinAbs(Lay, SurfDome) = 0.0; + SurfWinQRadSWwinAbs(Lay, SurfDiffuser) = 0.0; + } } } diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index fa9e813b832..580ba947576 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -405,7 +405,7 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const & filepat EnergyPlus::ShowSevereError(e.what()); return EnergyPlus::AbortEnergyPlus(state); } - std::cout << "Solar timer: " << EnergyPlus::DataGlobals::timer_1 << "\n"; +// std::cout << "Solar timer: " << EnergyPlus::DataGlobals::timer_1 << "\n"; return wrapUpEnergyPlus(state); } From d2451f6c02e74625f1dc59be4508cd49bc082ee5 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 9 Sep 2020 12:28:52 -0700 Subject: [PATCH 12/25] test reduce --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 173 ++++++++++++++++++-- 1 file changed, 158 insertions(+), 15 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 07332baad56..6c9cfdcbc6d 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2737,9 +2737,152 @@ namespace HeatBalanceSurfaceManager { } } for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - int const firstSurf = Zone(zoneNum).SurfaceFirst; - int const lastSurf = Zone(zoneNum).SurfaceLast; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int OutShelfSurf = 0; // Outside daylighting shelf surface number + if (ShelfNum > 0) { + OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 + } + + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int PipeNum; // TDD pipe object number + int SurfNum2; // TDD: DOME object number + Real64 CosInc; // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar; // Local variable for BeamSolarRad + Real64 SkySolarInc; // Sky diffuse solar incident on a surface + Real64 GndSolarInc; // Ground diffuse solar incident on a surface + + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + PipeNum = SurfWinTDDPipeNum(SurfNum); + SurfNum2 = TDDPipe(PipeNum).Dome; + + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); + + // 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) / + dataConstruction.Construct(ConstrNum).TransDiff; + + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; + + GndSolarInc = + GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / + dataConstruction.Construct(ConstrNum).TransDiff; + + } else if (OutShelfSurf > 0) { // Outside daylighting shelf + SurfNum2 = SurfNum; + + CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + + BeamSolar = BeamSolarRad; + SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); + // Shelf diffuse solar radiation + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * + CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + 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(TimeStep, HourOfDay, SurfNum); + BeamSolar = BeamSolarRad; + SkySolarInc = SurfSkySolarInc(SurfNum); + GndSolarInc = SurfGndSolarInc(SurfNum); + } + + // Cosine of incidence angle and solar incident on outside of surface, for reporting + SurfCosIncidenceAngle(SurfNum) = CosInc; + + // Report variables for various incident solar quantities + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 + + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; + } else { + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + } + // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; + // Incident diffuse solar from beam-to-diffuse reflection from ground + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + + // Incident diffuse solar from sky diffuse reflection from ground + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); + // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included + // in SkySolarInc. + // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc + + // TH2 CR 9056 + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); + + if (CalcSolRefl) { + // Incident beam solar from beam-to-beam (specular) reflection from obstructions + SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from beam-to-diffuse reflection from obstructions + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; + // Incident diffuse solar from sky diffuse reflection from obstructions + SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); + // TH2 CR 9056: Add reflections from obstructions to the total incident + SurfQRadSWOutIncident(SurfNum) += + SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); + } + + if (Surface(SurfNum).HeatTransSurf) { + // Exclude special shading surfaces which required QRadSWOut calculations above + + int RoughIndexMovInsul = 0; // Roughness index of movable insulation + Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) + Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) + + if (Surface(SurfNum).MaterialMovInsulExt > 0) + EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); + + if (RoughIndexMovInsul <= 0) { // No movable insulation present + + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + + AbsExt = dataMaterial.Material( + dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + + } + } + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= + 0.0) { // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } + } + } + } + int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; + int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { int ConstrNum = 0; // Index for the Construct derived type if (Surface(SurfNum).HeatTransSurf) { ConstrNum = Surface(SurfNum).Construction; @@ -2860,7 +3003,7 @@ namespace HeatBalanceSurfaceManager { if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; +// AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; } else { // Exterior window int ShadeFlag = SurfWinShadingFlag(SurfNum); @@ -3367,20 +3510,20 @@ namespace HeatBalanceSurfaceManager { } // RoughIndexMovInsul <= 0, no movable insulation - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= - 0.0) { // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); - SurfOpaqSWOutAbsTotalReport(SurfNum) = - SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = - SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } +// if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= +// 0.0) { // Opaque heat transfer surface +// SurfOpaqQRadSWOutAbs(SurfNum) = +// AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); +// SurfOpaqSWOutAbsTotalReport(SurfNum) = +// SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; +// SurfOpaqSWOutAbsEnergyReport(SurfNum) = +// SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; +// } } // Surface(SurfNum)%HeatTransSurf } } // Surface(SurfNum)%ExtSolar - int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; - int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; +// int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; +// int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; if (firstSurfOpaq == -1) continue; for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { int ConstrNum = 0; // Index for the Construct derived type From cb37a59967d34a0300762124c234b7d64d9b4e17 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 10 Sep 2020 10:16:49 -0700 Subject: [PATCH 13/25] revert --- src/EnergyPlus/DaylightingDevices.cc | 1 - src/EnergyPlus/HeatBalanceSurfaceManager.cc | 195 +++----------------- 2 files changed, 24 insertions(+), 172 deletions(-) diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 94382d7abdb..b8b5a0df351 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1493,7 +1493,6 @@ namespace DaylightingDevices { SurfWinQRadSWwinAbs(1, DiffSurf) * Surface(DiffSurf).Area / 2.0; // Solar entering pipe | Solar exiting pipe | Absorbed due to // reflections on the way out | Inward absorbed solar from dome // glass | Inward absorbed solar from diffuser glass - TDDPipe(PipeNum).PipeAbsorbedSolar = max(0.0, TotTDDPipeGain); // Report variable [W] for (TZoneNum = 1; TZoneNum <= TDDPipe(PipeNum).NumOfTZones; ++TZoneNum) { diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 6c9cfdcbc6d..aeb22006c3c 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2738,151 +2738,9 @@ namespace HeatBalanceSurfaceManager { } for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; - int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; - for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int OutShelfSurf = 0; // Outside daylighting shelf surface number - if (ShelfNum > 0) { - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } - - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - int PipeNum; // TDD pipe object number - int SurfNum2; // TDD: DOME object number - Real64 CosInc; // Cosine of incidence angle of beam solar on glass - Real64 BeamSolar; // Local variable for BeamSolarRad - Real64 SkySolarInc; // Sky diffuse solar incident on a surface - Real64 GndSolarInc; // Ground diffuse solar incident on a surface - - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - PipeNum = SurfWinTDDPipeNum(SurfNum); - SurfNum2 = TDDPipe(PipeNum).Dome; - - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); - - // 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) / - dataConstruction.Construct(ConstrNum).TransDiff; - - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; - - GndSolarInc = - GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / - dataConstruction.Construct(ConstrNum).TransDiff; - - } else if (OutShelfSurf > 0) { // Outside daylighting shelf - SurfNum2 = SurfNum; - - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); - - BeamSolar = BeamSolarRad; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); - // Shelf diffuse solar radiation - Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * - CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + - 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(TimeStep, HourOfDay, SurfNum); - BeamSolar = BeamSolarRad; - SkySolarInc = SurfSkySolarInc(SurfNum); - GndSolarInc = SurfGndSolarInc(SurfNum); - } - - // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = CosInc; - - // Report variables for various incident solar quantities - // Incident direct (unreflected) beam - SurfQRadSWOutIncidentBeam(SurfNum) = - BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 - - // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; - } else { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - } - // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; - // Incident diffuse solar from beam-to-diffuse reflection from ground - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = - BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); - - // Incident diffuse solar from sky diffuse reflection from ground - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = - DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); - // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included - // in SkySolarInc. - // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc - - // TH2 CR 9056 - SurfQRadSWOutIncident(SurfNum) = - SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); - - if (CalcSolRefl) { - // Incident beam solar from beam-to-beam (specular) reflection from obstructions - SurfQRadSWOutIncBmToBmReflObs(SurfNum) = BmToBmReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from beam-to-diffuse reflection from obstructions - SurfQRadSWOutIncBmToDiffReflObs(SurfNum) = BmToDiffReflFacObs(SurfNum) * BeamSolarRad; - // Incident diffuse solar from sky diffuse reflection from obstructions - SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = DifSolarRad * ReflFacSkySolObs(SurfNum); - // TH2 CR 9056: Add reflections from obstructions to the total incident - SurfQRadSWOutIncident(SurfNum) += - SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + - SurfQRadSWOutIncSkyDiffReflObs(SurfNum); - } - - if (Surface(SurfNum).HeatTransSurf) { - // Exclude special shading surfaces which required QRadSWOut calculations above - - int RoughIndexMovInsul = 0; // Roughness index of movable insulation - Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) - Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) - - if (Surface(SurfNum).MaterialMovInsulExt > 0) - EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); - - if (RoughIndexMovInsul <= 0) { // No movable insulation present - - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - - AbsExt = dataMaterial.Material( - dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; - - } - } - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= - 0.0) { // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); - SurfOpaqSWOutAbsTotalReport(SurfNum) = - SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = - SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } - } - } - } - int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; - int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; - for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { + int const firstSurf = Zone(zoneNum).SurfaceFirst; + int const lastSurf = Zone(zoneNum).SurfaceLast; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { int ConstrNum = 0; // Index for the Construct derived type if (Surface(SurfNum).HeatTransSurf) { ConstrNum = Surface(SurfNum).Construction; @@ -3003,7 +2861,7 @@ namespace HeatBalanceSurfaceManager { if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface -// AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; } else { // Exterior window int ShadeFlag = SurfWinShadingFlag(SurfNum); @@ -3104,16 +2962,14 @@ namespace HeatBalanceSurfaceManager { if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on - Real64 ACosTlt = std::abs( - Surface(SurfNum).CosTilt); // Absolute value of cosine of surface tilt angle - Real64 AbsDiffGlassLayGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd( - {1, 19}, Lay)); - Real64 AbsDiffGlassLaySky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky( - {1, 19}, Lay)); + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + // Absolute value of cosine of surface tilt angle + Real64 AbsDiffGlassLayGnd = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, 19}, Lay)); + Real64 AbsDiffGlassLaySky = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); SurfWinQRadSWwinAbs(Lay, SurfNum) = SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + @@ -3241,7 +3097,6 @@ namespace HeatBalanceSurfaceManager { // Solar absorbed by window frame and dividers int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) - Real64 FrWidth = 0.0; // Frame, divider width (m) Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) Real64 FrProjIn = 0.0; Real64 DivArea = 0.0; @@ -3249,7 +3104,6 @@ namespace HeatBalanceSurfaceManager { Real64 DivProjOut = 0.0; Real64 DivProjIn = 0.0; if (FrDivNum > 0) { - FrWidth = FrameDivider(FrDivNum).FrameWidth; FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; DivArea = SurfWinDividerArea(SurfNum); @@ -3510,21 +3364,20 @@ namespace HeatBalanceSurfaceManager { } // RoughIndexMovInsul <= 0, no movable insulation -// if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= -// 0.0) { // Opaque heat transfer surface -// SurfOpaqQRadSWOutAbs(SurfNum) = -// AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); -// SurfOpaqSWOutAbsTotalReport(SurfNum) = -// SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; -// SurfOpaqSWOutAbsEnergyReport(SurfNum) = -// SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; -// } + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= + 0.0) { // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } } // Surface(SurfNum)%HeatTransSurf } } // Surface(SurfNum)%ExtSolar -// int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; -// int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; - if (firstSurfOpaq == -1) continue; + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { int ConstrNum = 0; // Index for the Construct derived type if (Surface(SurfNum).HeatTransSurf) { @@ -3537,7 +3390,7 @@ namespace HeatBalanceSurfaceManager { int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number int InShelfSurf = 0; // Inside daylighting shelf surface number if (ShelfNum > 0) { - InShelfSurf = Shelf( ShelfNum).InSurf; // Inside daylighting shelf present if > 0 + InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 } SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; if (InShelfSurf > 0) { // Inside daylighting shelf From b227d8cff172c131a159cbef179711279e8772ed Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 10 Sep 2020 11:43:10 -0700 Subject: [PATCH 14/25] framediv --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 444 ++++++++++---------- 1 file changed, 221 insertions(+), 223 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 0b3340ae599..50bc6ceffe4 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -3034,8 +3034,6 @@ namespace HeatBalanceSurfaceManager { SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - // ShadeFlag = SurfWinShadingFlag(SurfNum); - } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr @@ -3096,226 +3094,225 @@ namespace HeatBalanceSurfaceManager { // Solar absorbed by window frame and dividers int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number - Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) - Real64 FrProjOut = 0.0; // Frame, divider outside projection (m) - Real64 FrProjIn = 0.0; - Real64 DivArea = 0.0; - Real64 DivWidth = 0.0; - Real64 DivProjOut = 0.0; - Real64 DivProjIn = 0.0; if (FrDivNum > 0) { - FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; - FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; - DivArea = SurfWinDividerArea(SurfNum); - DivWidth = FrameDivider(FrDivNum).DividerWidth; - DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; - DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - } - Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection - Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection - Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step - Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) - Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) - if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); - BeamFaceInc = BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; - DifSolarFaceInc = SkySolarInc + GndSolarInc; - } - if (FracSunLit > 0.0) { - if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || - (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { - // 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)) - Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( - 3)); // Altitude and azimuth angle of outward window normal (radians) - Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), - Surface(SurfNum).OutNormVec(1)); - Real64 PhiSun = std::asin( - SOLCOS(3)); // Altitude and azimuth angle of sun (radians) - Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); - Real64 const cos_PhiWin(std::cos(PhiWin)); - Real64 const cos_PhiSun(std::cos(PhiSun)); - CosIncAngHorProj = std::abs( - std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - - cos_PhiWin * std::sin(PhiSun)); - CosIncAngVertProj = std::abs( - cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); + Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) + Real64 FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; // Frame, divider outside projection (m) + Real64 FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; + Real64 DivArea = SurfWinDividerArea(SurfNum); + Real64 DivWidth = FrameDivider(FrDivNum).DividerWidth; + Real64 DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; + Real64 DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; + Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection + Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection + Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step + Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) + Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) + if (FrArea > 0.0 || DivArea > 0.0) { + FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); + BeamFaceInc = + BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + DifSolarFaceInc = SkySolarInc + GndSolarInc; } - } - - // 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.0) { - Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar - Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) - Real64 TransDiffGl = 0.0; // Diffuse solar transmittance - if (FrProjOut > 0.0 || FrProjIn > 0.0) { - Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - - FrameDivider(FrDivNum).VertDividers * DivWidth) * - FracSunLit / FrArea; - Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - - FrameDivider(FrDivNum).HorDividers * DivWidth) * - FracSunLit / FrArea; - // Beam solar on outside of frame - FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; - if (FrProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct(ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam solar on inside of frame - FrIncSolarIn = - (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + if (FracSunLit > 0.0) { + if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || + (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { + // 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)) + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( + 3)); // Altitude and azimuth angle of outward window normal (radians) + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), + Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin( + SOLCOS(3)); // Altitude and azimuth angle of sun (radians) + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 const cos_PhiWin(std::cos(PhiWin)); + Real64 const cos_PhiSun(std::cos(PhiSun)); + CosIncAngHorProj = std::abs( + std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - + cos_PhiWin * std::sin(PhiSun)); + CosIncAngVertProj = std::abs( + cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); } } - // Beam plus diffuse solar on outside of frame - FrIncSolarOut += DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); - SurfWinFrameQRadOutAbs(SurfNum) = - FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window outside reveal surfaces - SurfWinFrameQRadOutAbs(SurfNum) += - BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - - // Beam plus diffuse solar on inside of frame - FrIncSolarIn += - DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); - SurfWinFrameQRadInAbs(SurfNum) = FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window inside reveal surfaces - SurfWinFrameQRadInAbs(SurfNum) += - BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - } - - // 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.0) { // Solar absorbed by window divider - Real64 DividerAbs = SurfWinDividerSolAbsorp( - SurfNum); // Window divider solar absorptance - if (SurfWinDividerType(SurfNum) == Suspended) { - // 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) - int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( - 1); // Outer glass layer material number - Real64 TransGl = dataMaterial.Material( - MatNumGl).Trans; // Outer glass layer material number, switched construction - Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - Real64 AbsGl = 1.0 - TransGl - ReflGl; - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 MatNumGlSh = dataConstruction.Construct(ConstrNumSh).LayerPoint( - 1); - Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - Real64 ReflGlSh = dataMaterial.Material(MatNumGlSh).ReflectSolBeamFront; - Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); - AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); + // 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.0) { + Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar + Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) + Real64 TransDiffGl = 0.0; // Diffuse solar transmittance + if (FrProjOut > 0.0 || FrProjIn > 0.0) { + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - + FrameDivider(FrDivNum).VertDividers * + DivWidth) * FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - + FrameDivider(FrDivNum).HorDividers * + DivWidth) * FracSunLit / FrArea; + // Beam solar on outside of frame + FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; + if (FrProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam solar on inside of frame + FrIncSolarIn = + (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; + } } - Real64 DividerRefl = 1.0 - DividerAbs; // Window divider solar reflectance - DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / - (1.0 - DividerRefl * ReflGl); + // Beam plus diffuse solar on outside of frame + FrIncSolarOut += + DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); + SurfWinFrameQRadOutAbs(SurfNum) = + FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window outside reveal surfaces + SurfWinFrameQRadOutAbs(SurfNum) += + BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + + // Beam plus diffuse solar on inside of frame + FrIncSolarIn += + DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); + SurfWinFrameQRadInAbs(SurfNum) = + FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window inside reveal surfaces + SurfWinFrameQRadInAbs(SurfNum) += + BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); } - Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) - Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) - // Beam incident on horizontal and vertical projection faces of divider if no exterior shading - if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn) { - 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; - } - Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) - Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && - ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading - DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - if (DivProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - Real64 TransDiffGl = dataConstruction.Construct( - ConstrNum).TransDiff; // Diffuse solar transmittance + // 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.0) { // Solar absorbed by window divider + Real64 DividerAbs = SurfWinDividerSolAbsorp( + SurfNum); // Window divider solar absorptance + if (SurfWinDividerType(SurfNum) == Suspended) { + // 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) + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( + 1); // Outer glass layer material number + Real64 TransGl = dataMaterial.Material( + MatNumGl).Trans; // Outer glass layer material number, switched construction + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( ConstrNumSh).TransSolBeamCoef); - // Outer glass solar trans, refl, absorptance if switched + Real64 MatNumGlSh = dataConstruction.Construct( + ConstrNumSh).LayerPoint(1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material( + MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct(ConstrNumSh).TransDiff; - // Diffuse solar transmittance, switched construction - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); + AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - // Beam plus diffuse solar on inside of divider - // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) - // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) - Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * - FrameDivider(FrDivNum).HorDividers * - DivProjIn * (Surface(SurfNum).Width - FrameDivider(FrDivNum).VertDividers * - DivWidth) * FracSunLit / DivArea; - Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * - FrameDivider(FrDivNum).VertDividers * - DivProjIn * (Surface(SurfNum).Height - FrameDivider(FrDivNum).HorDividers * - DivWidth) * FracSunLit / DivArea; - DivIncSolarInBm = - TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); - DivIncSolarInDif = - TransDiffGl * DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum); + Real64 DividerRefl = + 1.0 - DividerAbs; // Window divider solar reflectance + DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / + (1.0 - DividerRefl * ReflGl); } - } else { // Exterior shade, screen or blind present - - DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - } - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != - BGBlindOn) { // No exterior or between-glass shade, screen or blind - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); - // Exterior shade, screen or blind - } else if (ShadeFlag == ExtShadeOn || ShadeFlag == ExtBlindOn || - ShadeFlag == ExtScreenOn) { - - if (ShadeFlag == ExtBlindOn) { // Exterior blind + Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) + Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) + // Beam incident on horizontal and vertical projection faces of divider if no exterior shading + if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && + ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn) { + 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; + } + Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) + Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && + ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading + DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + if (DivProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct( + ConstrNum).TransDiff; // Diffuse solar transmittance + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + // Outer glass solar trans, refl, absorptance if switched + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + // Diffuse solar transmittance, switched construction + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam plus diffuse solar on inside of divider + // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) + // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * + FrameDivider(FrDivNum).HorDividers * + DivProjIn * (Surface(SurfNum).Width - + FrameDivider( + FrDivNum).VertDividers * + DivWidth) * FracSunLit / + DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * + FrameDivider(FrDivNum).VertDividers * + DivProjIn * (Surface(SurfNum).Height - + FrameDivider( + FrDivNum).HorDividers * + DivWidth) * FracSunLit / + DivArea; + DivIncSolarInBm = + TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); + DivIncSolarInDif = TransDiffGl * DifSolarFaceInc * + SurfWinProjCorrDivIn(SurfNum); + } + } else { // Exterior shade, screen or blind present + + DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + } + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn) { + // No exterior or between-glass shade, screen or blind + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); + // Exterior shade, screen or blind + } else if (ShadeFlag == ExtBlindOn) { // Exterior blind int BlNum = SurfWinBlindNumber(SurfNum); Real64 ProfAng; // Solar profile angle (rad) ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); @@ -3332,7 +3329,7 @@ namespace HeatBalanceSurfaceManager { SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); + Blind(BlNum).SolFrontDiffDiffTrans)); SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), @@ -3340,23 +3337,24 @@ namespace HeatBalanceSurfaceManager { } else if (ShadeFlag == ExtShadeOn) { // Exterior shade int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * dataMaterial.Material( - dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarInBm + DivIncSolarInDif); + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarOutBm +DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarInBm +DivIncSolarInDif); } else if (ShadeFlag == ExtScreenOn) { // Exterior screen SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * (DivIncSolarOutBm + - DivIncSolarOutDif); + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarOutBm + + DivIncSolarOutDif); SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarInBm + DivIncSolarInDif); + (DivIncSolarInBm + + DivIncSolarInDif); } } } @@ -3364,8 +3362,8 @@ namespace HeatBalanceSurfaceManager { } // RoughIndexMovInsul <= 0, no movable insulation - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= - 0.0) { // Opaque heat transfer surface + if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { + // Opaque heat transfer surface SurfOpaqQRadSWOutAbs(SurfNum) = AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); SurfOpaqSWOutAbsTotalReport(SurfNum) = From aadcdd1bc5e2f334d0f69b435aec64c033a94b50 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 10 Sep 2020 22:27:19 -0700 Subject: [PATCH 15/25] reduce --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 66 +++++++++++++-------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 50bc6ceffe4..919a81ae719 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2344,6 +2344,11 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static static Array1D SkyDiffReflFacGnd(TotSurfaces); // sky diffuse reflection view factors from ground + + static Array1D SurfCosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass + static Array1D SurfBeamSolar(TotSurfaces); // Local variable for BeamSolarRad + static Array1D SurfSkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface + static Array1D SurfGndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2755,36 +2760,36 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { int PipeNum; // TDD pipe object number int SurfNum2; // TDD: DOME object number - Real64 CosInc; // Cosine of incidence angle of beam solar on glass - Real64 BeamSolar; // Local variable for BeamSolarRad - Real64 SkySolarInc; // Sky diffuse solar incident on a surface - Real64 GndSolarInc; // Ground diffuse solar incident on a surface +// Real64 CosInc; // Cosine of incidence angle of beam solar on glass +// Real64 BeamSolar; // Local variable for BeamSolarRad +// Real64 SkySolarInc; // Sky diffuse solar incident on a surface +// Real64 GndSolarInc; // Ground diffuse solar incident on a surface if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { PipeNum = SurfWinTDDPipeNum(SurfNum); SurfNum2 = TDDPipe(PipeNum).Dome; - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum2); + SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); // 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) / + SurfBeamSolar(SurfNum) = BeamSolarRad * TransTDD(PipeNum, SurfCosInc(SurfNum), SolarBeam) / dataConstruction.Construct(ConstrNum).TransDiff; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, CosInc, SolarAniso) / + SurfSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, SurfCosInc(SurfNum), SolarAniso) / dataConstruction.Construct(ConstrNum).TransDiff; - GndSolarInc = + SurfGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / dataConstruction.Construct(ConstrNum).TransDiff; } else if (OutShelfSurf > 0) { // Outside daylighting shelf SurfNum2 = SurfNum; - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); + SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - BeamSolar = BeamSolarRad; - SkySolarInc = DifSolarRad * AnisoSkyMult(SurfNum); + SurfBeamSolar(SurfNum) = BeamSolarRad; + SurfSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); // Shelf diffuse solar radiation Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + @@ -2793,38 +2798,40 @@ namespace HeatBalanceSurfaceManager { // 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 + + SurfGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + ShelfSolarRad * Shelf(ShelfNum).ViewFactor; } else { // Regular surface SurfNum2 = SurfNum; - CosInc = CosIncAng(TimeStep, HourOfDay, SurfNum); - BeamSolar = BeamSolarRad; - SkySolarInc = SurfSkySolarInc(SurfNum); - GndSolarInc = SurfGndSolarInc(SurfNum); + SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + SurfBeamSolar(SurfNum) = BeamSolarRad; + SurfSkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); + SurfGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); } // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = CosInc; + SurfCosIncidenceAngle(SurfNum) = SurfCosInc(SurfNum); // Report variables for various incident solar quantities // Incident direct (unreflected) beam SurfQRadSWOutIncidentBeam(SurfNum) = - BeamSolar * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * CosInc; // NOTE: SurfNum2 + SurfBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * SurfCosInc(SurfNum); // NOTE: SurfNum2 // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SkySolarInc; + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SurfSkySolarInc(SurfNum); } else { SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); } // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = GndSolarInc; + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = SurfGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground - SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = + BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); // Incident diffuse solar from sky diffuse reflection from ground - SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum) = + DifSolarRad * GndReflectance * SkyDiffReflFacGnd(SurfNum); // Total incident solar. Beam and sky reflection from obstructions, if calculated, is included // in SkySolarInc. // QRadSWOutIncident(SurfNum) = QRadSWOutIncidentBeam(SurfNum) + SkySolarInc + GndSolarInc @@ -2846,7 +2853,14 @@ namespace HeatBalanceSurfaceManager { SurfQRadSWOutIncBmToBmReflObs(SurfNum) + SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + SurfQRadSWOutIncSkyDiffReflObs(SurfNum); } - + } + } + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + Real64 CosInc = SurfCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar = SurfBeamSolar(SurfNum); // Local variable for BeamSolarRad + Real64 SkySolarInc = SurfSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface + Real64 GndSolarInc = SurfGndSolarInc(SurfNum); // Ground diffuse solar incident on a surface if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above @@ -2856,7 +2870,11 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).MaterialMovInsulExt > 0) EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); - + int ConstrNum = 0 ; + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } if (RoughIndexMovInsul <= 0) { // No movable insulation present if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface From 36ce354df4882d84f9bcbc6c3ca1f5088732b998 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 11 Sep 2020 09:36:31 -0700 Subject: [PATCH 16/25] scope --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 92 +++++++++++---------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 919a81ae719..047d78fab37 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2345,10 +2345,10 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static static Array1D SkyDiffReflFacGnd(TotSurfaces); // sky diffuse reflection view factors from ground - static Array1D SurfCosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass - static Array1D SurfBeamSolar(TotSurfaces); // Local variable for BeamSolarRad - static Array1D SurfSkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface - static Array1D SurfGndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface + static Array1D currCosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass + static Array1D currBeamSolar(TotSurfaces); // Local variable for BeamSolarRad + static Array1D currSkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface + static Array1D currGndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2746,50 +2746,48 @@ namespace HeatBalanceSurfaceManager { int const firstSurf = Zone(zoneNum).SurfaceFirst; int const lastSurf = Zone(zoneNum).SurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int OutShelfSurf = 0; // Outside daylighting shelf surface number - if (ShelfNum > 0) { - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + int ConstrNum = 0; // Index for the Construct derived type + if (Surface(SurfNum).HeatTransSurf) { + ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + } + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int OutShelfSurf = 0; // Outside daylighting shelf surface number + if (ShelfNum > 0) { + OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 + } + int PipeNum; // TDD pipe object number int SurfNum2; // TDD: DOME object number -// Real64 CosInc; // Cosine of incidence angle of beam solar on glass -// Real64 BeamSolar; // Local variable for BeamSolarRad -// Real64 SkySolarInc; // Sky diffuse solar incident on a surface -// Real64 GndSolarInc; // Ground diffuse solar incident on a surface if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { PipeNum = SurfWinTDDPipeNum(SurfNum); SurfNum2 = TDDPipe(PipeNum).Dome; - SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); // 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 - SurfBeamSolar(SurfNum) = BeamSolarRad * TransTDD(PipeNum, SurfCosInc(SurfNum), SolarBeam) / - dataConstruction.Construct(ConstrNum).TransDiff; + currBeamSolar(SurfNum) = BeamSolarRad * TransTDD(PipeNum, currCosInc(SurfNum), SolarBeam) / + dataConstruction.Construct(ConstrNum).TransDiff; - SurfSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * TransTDD(PipeNum, SurfCosInc(SurfNum), SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; + currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * + TransTDD(PipeNum, currCosInc(SurfNum), SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; - SurfGndSolarInc(SurfNum) = + currGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / dataConstruction.Construct(ConstrNum).TransDiff; } else if (OutShelfSurf > 0) { // Outside daylighting shelf SurfNum2 = SurfNum; - SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - SurfBeamSolar(SurfNum) = BeamSolarRad; - SurfSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + currBeamSolar(SurfNum) = BeamSolarRad; + currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); // Shelf diffuse solar radiation Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + @@ -2798,33 +2796,41 @@ namespace HeatBalanceSurfaceManager { // 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!! - SurfGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + - ShelfSolarRad * Shelf(ShelfNum).ViewFactor; + currGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + + ShelfSolarRad * Shelf(ShelfNum).ViewFactor; } else { // Regular surface SurfNum2 = SurfNum; - SurfCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - SurfBeamSolar(SurfNum) = BeamSolarRad; - SurfSkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); - SurfGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + currBeamSolar(SurfNum) = BeamSolarRad; + currSkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); + currGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); } + } + } + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { // Cosine of incidence angle and solar incident on outside of surface, for reporting - SurfCosIncidenceAngle(SurfNum) = SurfCosInc(SurfNum); + int SurfNum2 = SurfNum; + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; + } + SurfCosIncidenceAngle(SurfNum) = currCosInc(SurfNum); // Report variables for various incident solar quantities // Incident direct (unreflected) beam SurfQRadSWOutIncidentBeam(SurfNum) = - SurfBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * SurfCosInc(SurfNum); // NOTE: SurfNum2 + currBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * currCosInc(SurfNum); // NOTE: SurfNum2 // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = SurfSkySolarInc(SurfNum); + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = currSkySolarInc(SurfNum); } else { SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); } // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground - SurfQRadSWOutIncidentGndDiffuse(SurfNum) = SurfGndSolarInc(SurfNum); + SurfQRadSWOutIncidentGndDiffuse(SurfNum) = currGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) = BeamSolarRad * SOLCOS(3) * GndReflectance * BmToDiffReflFacGnd(SurfNum); @@ -2857,13 +2863,8 @@ namespace HeatBalanceSurfaceManager { } for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - Real64 CosInc = SurfCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass - Real64 BeamSolar = SurfBeamSolar(SurfNum); // Local variable for BeamSolarRad - Real64 SkySolarInc = SurfSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface - Real64 GndSolarInc = SurfGndSolarInc(SurfNum); // Ground diffuse solar incident on a surface if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above - int RoughIndexMovInsul = 0; // Roughness index of movable insulation Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) @@ -2882,6 +2883,11 @@ namespace HeatBalanceSurfaceManager { AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; } else { // Exterior window + Real64 CosInc = currCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar = currBeamSolar(SurfNum); // Local variable for BeamSolarRad + Real64 SkySolarInc = currSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface + Real64 GndSolarInc = currGndSolarInc(SurfNum); // Ground diffuse solar incident on a surface + int ShadeFlag = SurfWinShadingFlag(SurfNum); if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && @@ -3383,7 +3389,7 @@ namespace HeatBalanceSurfaceManager { if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque heat transfer surface SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (SkySolarInc + GndSolarInc); + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (currSkySolarInc(SurfNum) + currGndSolarInc(SurfNum)); SurfOpaqSWOutAbsTotalReport(SurfNum) = SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; SurfOpaqSWOutAbsEnergyReport(SurfNum) = From 15813fd444caf0db8a2d37668e7f065dd5a662b2 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 11 Sep 2020 15:33:01 -0700 Subject: [PATCH 17/25] tdd shelf tubular --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 136 +++++++++----------- 1 file changed, 59 insertions(+), 77 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 047d78fab37..b729949ca50 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2741,94 +2741,26 @@ namespace HeatBalanceSurfaceManager { } } - for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { int const firstSurf = Zone(zoneNum).SurfaceFirst; int const lastSurf = Zone(zoneNum).SurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - } - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int OutShelfSurf = 0; // Outside daylighting shelf surface number - if (ShelfNum > 0) { - OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 - } - - int PipeNum; // TDD pipe object number - int SurfNum2; // TDD: DOME object number - - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - PipeNum = SurfWinTDDPipeNum(SurfNum); - SurfNum2 = TDDPipe(PipeNum).Dome; - - currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); - - // 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 - currBeamSolar(SurfNum) = BeamSolarRad * TransTDD(PipeNum, currCosInc(SurfNum), SolarBeam) / - dataConstruction.Construct(ConstrNum).TransDiff; - - currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * - TransTDD(PipeNum, currCosInc(SurfNum), SolarAniso) / - dataConstruction.Construct(ConstrNum).TransDiff; - - currGndSolarInc(SurfNum) = - GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / - dataConstruction.Construct(ConstrNum).TransDiff; - - } else if (OutShelfSurf > 0) { // Outside daylighting shelf - SurfNum2 = SurfNum; - - currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - - currBeamSolar(SurfNum) = BeamSolarRad; - currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - // Shelf diffuse solar radiation - Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * - CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + - 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!! - currGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + - ShelfSolarRad * Shelf(ShelfNum).ViewFactor; - - } else { // Regular surface - SurfNum2 = SurfNum; - currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); - currBeamSolar(SurfNum) = BeamSolarRad; - currSkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); - currGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); - } - } - } - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { - - if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + if (Surface(SurfNum).ExtSolar) { + // Regular surface + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + currBeamSolar(SurfNum) = BeamSolarRad; + currSkySolarInc(SurfNum) = SurfSkySolarInc(SurfNum); + currGndSolarInc(SurfNum) = SurfGndSolarInc(SurfNum); // Cosine of incidence angle and solar incident on outside of surface, for reporting - - int SurfNum2 = SurfNum; - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; - } SurfCosIncidenceAngle(SurfNum) = currCosInc(SurfNum); // Report variables for various incident solar quantities // Incident direct (unreflected) beam SurfQRadSWOutIncidentBeam(SurfNum) = - currBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * currCosInc(SurfNum); // NOTE: SurfNum2 + currBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum) * currCosInc(SurfNum); // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = currSkySolarInc(SurfNum); - } else { - SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); - } + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground SurfQRadSWOutIncidentGndDiffuse(SurfNum) = currGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground @@ -2861,6 +2793,56 @@ namespace HeatBalanceSurfaceManager { } } } + } + for (int PipeNum = 1; PipeNum <= NumOfTDDPipes; ++PipeNum) { + int SurfNum = TDDPipe(PipeNum).Diffuser; // TDD: Diffuser object number + int SurfNum2 = TDDPipe(PipeNum).Dome; // TDD: DOME object number + int ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum2); + + // 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 + currBeamSolar(SurfNum) = BeamSolarRad * TransTDD(PipeNum, currCosInc(SurfNum), SolarBeam) / + dataConstruction.Construct(ConstrNum).TransDiff; + + currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum2) * + TransTDD(PipeNum, currCosInc(SurfNum), SolarAniso) / + dataConstruction.Construct(ConstrNum).TransDiff; + + currGndSolarInc(SurfNum) = + GndSolarRad * Surface(SurfNum2).ViewFactorGround * TDDPipe(PipeNum).TransSolIso / + dataConstruction.Construct(ConstrNum).TransDiff; + // Incident direct (unreflected) beam + SurfQRadSWOutIncidentBeam(SurfNum) = + currBeamSolar(SurfNum) * SunlitFrac(TimeStep, HourOfDay, SurfNum2) * + currCosInc(SurfNum); // NOTE: SurfNum2 + + // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = currSkySolarInc(SurfNum); + } + for (int ShelfNum = 1; ShelfNum <= NumOfShelf; ++ShelfNum) { + int SurfNum = Shelf(ShelfNum).Window; // Daylighting shelf object number + int OutShelfSurf = Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 + currCosInc(SurfNum) = CosIncAng(TimeStep, HourOfDay, SurfNum); + currBeamSolar(SurfNum) = BeamSolarRad; + currSkySolarInc(SurfNum) = DifSolarRad * AnisoSkyMult(SurfNum); + // Shelf diffuse solar radiation + Real64 ShelfSolarRad = (BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, OutShelfSurf) * + CosIncAng(TimeStep, HourOfDay, OutShelfSurf) + + 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!! + currGndSolarInc(SurfNum) = GndSolarRad * Surface(SurfNum).ViewFactorGround + + ShelfSolarRad * Shelf(ShelfNum).ViewFactor; + } + + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { + int const firstSurf = Zone(zoneNum).SurfaceFirst; + int const lastSurf = Zone(zoneNum).SurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { if (Surface(SurfNum).HeatTransSurf) { From c136df561f2587c71615f00109ad203b4a05a0f4 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 11 Sep 2020 16:28:18 -0700 Subject: [PATCH 18/25] test --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 110 +++++++++++--------- 1 file changed, 61 insertions(+), 49 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index b729949ca50..a02738ad71f 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2841,9 +2841,61 @@ namespace HeatBalanceSurfaceManager { } for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - int const firstSurf = Zone(zoneNum).SurfaceFirst; - int const lastSurf = Zone(zoneNum).SurfaceLast; - for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; + int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; + for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { + if (Surface(SurfNum).HeatTransSurf) { + int ConstrNum = Surface(SurfNum).Construction; + if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; + if (Surface(SurfNum).ExtSolar) { + // Exclude special shading surfaces which required QRadSWOut calculations above + int RoughIndexMovInsul = 0; // Roughness index of movable insulation + Real64 HMovInsul; // Resistance or "h" value of movable insulation (from EvalOutsideMovableInsulation, not used) + Real64 AbsExt; // Absorptivity of outer most layer (or movable insulation if present) + if (Surface(SurfNum).MaterialMovInsulExt > 0) + EvalOutsideMovableInsulation(SurfNum, HMovInsul, RoughIndexMovInsul, AbsExt); + + if (RoughIndexMovInsul <= 0) { // No movable insulation present + + AbsExt = dataMaterial.Material( + dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; + } + // Opaque heat transfer surface + SurfOpaqQRadSWOutAbs(SurfNum) = + AOSurf(SurfNum) * BeamSolarRad + AbsExt * (currSkySolarInc(SurfNum) + currGndSolarInc(SurfNum)); + SurfOpaqSWOutAbsTotalReport(SurfNum) = + SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; + SurfOpaqSWOutAbsEnergyReport(SurfNum) = + SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; + } + if (ConstrNum > 0) { + int SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); + if (SurfSolIncPtr == 0) { + if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int InShelfSurf = 0; // Inside daylighting shelf surface number + if (ShelfNum > 0) { + InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 + } + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; + if (InShelfSurf > 0) { // Inside daylighting shelf + // Shelf surface area is divided by 2 because only one side sees beam (Area was multiplied by 2 during init) + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = + AISurf(SurfNum) * BeamSolarRad * (0.5 * Surface(SurfNum).Area); + } else { // Regular surface + SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = + AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; + } + } + } else { + SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum); + } + } + } + } + int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; + int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { if (Surface(SurfNum).ExtSolar || SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { if (Surface(SurfNum).HeatTransSurf) { // Exclude special shading surfaces which required QRadSWOut calculations above @@ -2860,11 +2912,13 @@ namespace HeatBalanceSurfaceManager { } if (RoughIndexMovInsul <= 0) { // No movable insulation present - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - - AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; +// if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface +// +// AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; +// +// } else + { // Exterior window - } else { // Exterior window Real64 CosInc = currCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass Real64 BeamSolar = currBeamSolar(SurfNum); // Local variable for BeamSolarRad Real64 SkySolarInc = currSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface @@ -3367,51 +3421,9 @@ namespace HeatBalanceSurfaceManager { } } // RoughIndexMovInsul <= 0, no movable insulation - - if (Surface(SurfNum).HeatTransSurf && dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { - // Opaque heat transfer surface - SurfOpaqQRadSWOutAbs(SurfNum) = - AOSurf(SurfNum) * BeamSolarRad + AbsExt * (currSkySolarInc(SurfNum) + currGndSolarInc(SurfNum)); - SurfOpaqSWOutAbsTotalReport(SurfNum) = - SurfOpaqQRadSWOutAbs(SurfNum) * Surface(SurfNum).Area; - SurfOpaqSWOutAbsEnergyReport(SurfNum) = - SurfOpaqSWOutAbsTotalReport(SurfNum) * TimeStepZoneSec; - } } // Surface(SurfNum)%HeatTransSurf } } // Surface(SurfNum)%ExtSolar - int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; - int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; - for (int SurfNum = firstSurfOpaq; SurfNum <= lastSurfOpaq; ++SurfNum) { - int ConstrNum = 0; // Index for the Construct derived type - if (Surface(SurfNum).HeatTransSurf) { - ConstrNum = Surface(SurfNum).Construction; - if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; - if (ConstrNum > 0) { - int SurfSolIncPtr = SurfaceScheduledSolarInc(SurfNum, ConstrNum); - if (SurfSolIncPtr == 0) { - if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number - int InShelfSurf = 0; // Inside daylighting shelf surface number - if (ShelfNum > 0) { - InShelfSurf = Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 - } - SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum) * BeamSolarRad; - if (InShelfSurf > 0) { // Inside daylighting shelf - // Shelf surface area is divided by 2 because only one side sees beam (Area was multiplied by 2 during init) - SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = - AISurf(SurfNum) * BeamSolarRad * (0.5 * Surface(SurfNum).Area); - } else { // Regular surface - SurfOpaqInsFaceBeamSolAbsorbed(SurfNum) = - AISurf(SurfNum) * BeamSolarRad * Surface(SurfNum).Area; - } - } - } else { - SurfOpaqQRadSWInAbs(SurfNum) += AISurf(SurfNum); - } - } - } - } // End of surface loop } // end of zone loop } // End of sun-up check } From eeb94b5bab2a9a72417da4566cbbf47a46851f3e Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 12 Sep 2020 10:37:02 -0700 Subject: [PATCH 19/25] seperate --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 921 ++++++++++---------- 1 file changed, 456 insertions(+), 465 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index a02738ad71f..360ca15d438 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2911,511 +2911,502 @@ namespace HeatBalanceSurfaceManager { if (SurfWinStormWinFlag(SurfNum) == 1) ConstrNum = Surface(SurfNum).StormWinConstruction; } if (RoughIndexMovInsul <= 0) { // No movable insulation present + Real64 CosInc = currCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass + Real64 BeamSolar = currBeamSolar(SurfNum); // Local variable for BeamSolarRad + Real64 SkySolarInc = currSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface + Real64 GndSolarInc = currGndSolarInc(SurfNum); // Ground diffuse solar incident on a surface -// if (dataConstruction.Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface -// -// AbsExt = dataMaterial.Material(dataConstruction.Construct(ConstrNum).LayerPoint(1)).AbsorpSolar; -// -// } else - { // Exterior window + int ShadeFlag = SurfWinShadingFlag(SurfNum); - Real64 CosInc = currCosInc(SurfNum); // Cosine of incidence angle of beam solar on glass - Real64 BeamSolar = currBeamSolar(SurfNum); // Local variable for BeamSolarRad - Real64 SkySolarInc = currSkySolarInc(SurfNum); // Sky diffuse solar incident on a surface - Real64 GndSolarInc = currGndSolarInc(SurfNum); // Ground diffuse solar incident on a surface + if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && + SurfWinWindowModelType(SurfNum) != WindowEQLModel && + !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int ShadeFlag = SurfWinShadingFlag(SurfNum); + int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; // Number of glass layers + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); + } - if (SurfWinWindowModelType(SurfNum) != WindowBSDFModel && - SurfWinWindowModelType(SurfNum) != WindowEQLModel && - !dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + ShadeFlag = SurfWinShadingFlag(SurfNum); - int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; // Number of glass layers - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); - } + if (ShadeFlag > 0) { // Shaded window + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; // Shaded window construction + if (SurfWinStormWinFlag(SurfNum) == 1) + ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; - ShadeFlag = SurfWinShadingFlag(SurfNum); + if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || + ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - if (ShadeFlag > 0) { // Shaded window - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; // Shaded window construction - if (SurfWinStormWinFlag(SurfNum) == 1) - ConstrNumSh = Surface(SurfNum).StormWinShadedConstruction; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); + } + SurfWinExtDiffAbsByShade(SurfNum) = + dataConstruction.Construct(ConstrNumSh).AbsDiffShade * + (SkySolarInc + GndSolarInc); + } - if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || - ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { // Blind on + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); - } - SurfWinExtDiffAbsByShade(SurfNum) = - dataConstruction.Construct(ConstrNumSh).AbsDiffShade * - (SkySolarInc + GndSolarInc); + AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiff( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffGnd( + {1, MaxSlatAngs}, Lay)); + AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), + SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( + ConstrNumSh).BlAbsDiffSky( + {1, MaxSlatAngs}, Lay)); } - - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { // Blind on - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - - AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiff( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinGnd(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffGnd( - {1, MaxSlatAngs}, Lay)); - AbsDiffWinSky(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), - SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( - ConstrNumSh).BlAbsDiffSky( - {1, MaxSlatAngs}, Lay)); - } + SurfWinExtDiffAbsByShade(SurfNum) = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct( ConstrNumSh).AbsDiffBlind) * + (SkySolarInc + GndSolarInc); + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + Real64 AbsDiffBlindGnd = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); + Real64 AbsDiffBlindSky = InterpSlatAng( + SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); SurfWinExtDiffAbsByShade(SurfNum) = - InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct( ConstrNumSh).AbsDiffBlind) * - (SkySolarInc + GndSolarInc); - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - Real64 AbsDiffBlindGnd = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindGnd); - Real64 AbsDiffBlindSky = InterpSlatAng( - SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).AbsDiffBlindSky); - SurfWinExtDiffAbsByShade(SurfNum) = - SkySolarInc * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + - GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + - 0.5 * ACosTlt * AbsDiffBlindSky); - } + SkySolarInc * (0.5 * ACosTlt * AbsDiffBlindGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffBlindSky) + + GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffBlindGnd + + 0.5 * ACosTlt * AbsDiffBlindSky); } + } - // Correct for shadowing of divider onto interior shading device (note that dividers are - // not allowed in windows with between-glass shade/blind) + // 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 || ShadeFlag == IntBlindOn) && - SurfWinDividerArea(SurfNum) > 0.0) - SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); + if ((ShadeFlag == IntShadeOn || ShadeFlag == IntBlindOn) && + SurfWinDividerArea(SurfNum) > 0.0) + SurfWinExtDiffAbsByShade(SurfNum) *= SurfWinGlazedFrac(SurfNum); - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor( - SurfNum); // Switching factor for switchable glazing - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), - dataConstruction.Construct( - ConstrNumSh).AbsDiff(Lay)); - } - } - - } // End of check if window has shading device on - - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + - AWinSurf(Lay, SurfNum) * BeamSolar; - // AWinSurf is from InteriorSolarDistribution - if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || - ShadeFlag == BGBlindOn) { - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { - // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on - // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on - Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); - // Absolute value of cosine of surface tilt angle - Real64 AbsDiffGlassLayGnd = - InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, 19}, Lay)); - Real64 AbsDiffGlassLaySky = - InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), - dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); - - SurfWinQRadSWwinAbs(Lay, SurfNum) = - SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + - GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + - AWinSurf(Lay, SurfNum) * BeamSolar; - } + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor( + SurfNum); // Switching factor for switchable glazing + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = InterpSw(SwitchFac, AbsDiffWin(Lay), + dataConstruction.Construct( + ConstrNumSh).AbsDiff(Lay)); } + } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + } // End of check if window has shading device on + + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * BeamSolar; + // AWinSurf is from InteriorSolarDistribution + if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || + ShadeFlag == BGBlindOn) { + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { + // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on + // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on + Real64 ACosTlt = std::abs(Surface(SurfNum).CosTilt); + // Absolute value of cosine of surface tilt angle + Real64 AbsDiffGlassLayGnd = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffGnd({1, 19}, Lay)); + Real64 AbsDiffGlassLaySky = + InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), + dataConstruction.Construct(ConstrNumSh).BlAbsDiffSky({1, 19}, Lay)); - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - // Need to do it this way for now beaucse of scheduled surface gains. They do work only with - // BSDF windows and overwriting absorbtances will work only for ordinary windows - // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && - // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && - // inExtWindowModel->isExternalLibraryModel() ) { - // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; - // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { - // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * - // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); - // } - } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - int TotSolidLay = dataConstruction.Construct( - ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) - int CurrentState = SurfaceWindow( - SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration - // Examine for schedule surface gain - Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, - ConstrNum); // Pointer to scheduled surface gains object for fenestration systems - - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - if (SurfSolAbs != 0) { - AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( - FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); - // ABWin(Lay) = AWinSurf(SurfNum,Lay) - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); - } 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 SurfWinQRadSWwinAbs(Lay, SurfNum) = - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + - SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + - AWinSurf(Lay, SurfNum) * BeamSolar + - AWinCFOverlap(Lay, SurfNum) * BeamSolar; + SkySolarInc * (0.5 * ACosTlt * AbsDiffGlassLayGnd + (1.0 - 0.5 * ACosTlt) * AbsDiffGlassLaySky) + + GndSolarInc * ((1.0 - 0.5 * ACosTlt) * AbsDiffGlassLayGnd + 0.5 * ACosTlt * AbsDiffGlassLaySky) + + AWinSurf(Lay, SurfNum) * BeamSolar; } - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - - } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; - // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr - int TotSolidLay = CFS(dataConstruction.Construct( - Surface(SurfNum).Construction).EQLConsPtr).NL; - for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { - // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( - Lay); - SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + - AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); - - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } - SurfWinQRadSWwinAbsTotEnergy(SurfNum) = - SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; - } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { - int SurfNum2 = SurfNum; - if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { - SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + // Need to do it this way for now beaucse of scheduled surface gains. They do work only with + // BSDF windows and overwriting absorbtances will work only for ordinary windows + // } else if ( SurfaceWindow( SurfNum ).WindowModelType != WindowBSDFModel && + // SurfaceWindow( SurfNum ).WindowModelType != WindowEQLModel && + // inExtWindowModel->isExternalLibraryModel() ) { + // TotSolidLay = Construct( ConstrNum ).TotSolidLayers; + // for ( Lay = 1; Lay <= TotSolidLay; ++Lay ) { + // QRadSWwinAbs( Lay, SurfNum ) = AWinSurf( Lay, SurfNum ) * + // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); + // } + } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { + int TotSolidLay = dataConstruction.Construct( + ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) + int CurrentState = SurfaceWindow( + SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration + // Examine for schedule surface gain + Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, + ConstrNum); // Pointer to scheduled surface gains object for fenestration systems + + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + if (SurfSolAbs != 0) { + AWinSurf(Lay, SurfNum) = GetCurrentScheduleValue( + FenLayAbsSSG(SurfSolAbs).SchedPtrs(Lay)); + // ABWin(Lay) = AWinSurf(SurfNum,Lay) + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum); + } 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 + SurfWinQRadSWwinAbs(Lay, SurfNum) = + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyFtAbs(Lay) * SkySolarInc + + SurfaceWindow(SurfNum).ComplexFen.State(CurrentState).WinSkyGndAbs(Lay) * GndSolarInc + + AWinSurf(Lay, SurfNum) * BeamSolar + + AWinCFOverlap(Lay, SurfNum) * BeamSolar; } - std::pair incomingAngle = getSunWCEAngles( - dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); - Real64 Theta = incomingAngle.first; - Real64 Phi = incomingAngle.second; + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; - std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( - dataWindowManager, WavelengthRange::Solar, ConstrNum); + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + + } else if (SurfWinWindowModelType(SurfNum) == WindowEQLModel) { + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + // EQLNum = Construct(Surface(SurfNum)%Construction)%EQLConsPtr + int TotSolidLay = CFS(dataConstruction.Construct( + Surface(SurfNum).Construction).EQLConsPtr).NL; + for (int Lay = 1; Lay <= TotSolidLay; ++Lay) { + // 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) = dataConstruction.Construct(ConstrNum).AbsDiffFrontEQL( + Lay); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AWinSurf(Lay, SurfNum) * BeamSolar + + AbsDiffWin(Lay) * (SkySolarInc + GndSolarInc); + + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = + SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + } else if (dataWindowManager.inExtWindowModel->isExternalLibraryModel()) { + int SurfNum2 = SurfNum; + if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { + SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; + } + std::pair incomingAngle = getSunWCEAngles( + dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); + Real64 Theta = incomingAngle.first; + Real64 Phi = incomingAngle.second; - size_t totLayers = aLayer->getNumOfLayers(); - for (size_t Lay = 1; Lay <= totLayers; ++Lay) { + std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( + dataWindowManager, WavelengthRange::Solar, ConstrNum); - Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, - ScatteringSimple::Diffuse, - Theta, Phi); + size_t totLayers = aLayer->getNumOfLayers(); + for (size_t Lay = 1; Lay <= totLayers; ++Lay) { - SurfWinQRadSWwinAbs(Lay, SurfNum) = - AbWinDiff * (SkySolarInc + GndSolarInc) + - AWinSurf(Lay, SurfNum) * BeamSolar; + Real64 AbWinDiff = aLayer->getAbsorptanceLayer(Lay, Side::Front, + ScatteringSimple::Diffuse, + Theta, Phi); - // Total solar absorbed in solid layer (W), for reporting - SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = - SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbs(Lay, SurfNum) = + AbWinDiff * (SkySolarInc + GndSolarInc) + + AWinSurf(Lay, SurfNum) * BeamSolar; - // Total solar absorbed in all glass layers (W), for reporting - SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); - } + // Total solar absorbed in solid layer (W), for reporting + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = + SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + + // Total solar absorbed in all glass layers (W), for reporting + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); } + } - // Solar absorbed by window frame and dividers - int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number - if (FrDivNum > 0) { - Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) - Real64 FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; // Frame, divider outside projection (m) - Real64 FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; - Real64 DivArea = SurfWinDividerArea(SurfNum); - Real64 DivWidth = FrameDivider(FrDivNum).DividerWidth; - Real64 DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; - Real64 DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; - Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection - Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection - Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step - Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) - Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) - if (FrArea > 0.0 || DivArea > 0.0) { - FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); - BeamFaceInc = - BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; - DifSolarFaceInc = SkySolarInc + GndSolarInc; + // Solar absorbed by window frame and dividers + int FrDivNum = Surface(SurfNum).FrameDivider; // Frame/divider number + if (FrDivNum > 0) { + Real64 FrArea = SurfWinFrameArea(SurfNum); // Frame, divider area (m2) + Real64 FrProjOut = FrameDivider(FrDivNum).FrameProjectionOut; // Frame, divider outside projection (m) + Real64 FrProjIn = FrameDivider(FrDivNum).FrameProjectionIn; + Real64 DivArea = SurfWinDividerArea(SurfNum); + Real64 DivWidth = FrameDivider(FrDivNum).DividerWidth; + Real64 DivProjOut = FrameDivider(FrDivNum).DividerProjectionOut; + Real64 DivProjIn = FrameDivider(FrDivNum).DividerProjectionIn; + Real64 CosIncAngHorProj = 0.0; // Cosine of incidence angle of sun on horizontal faces of a frame or divider projection + Real64 CosIncAngVertProj = 0.0; // Cosine of incidence angle of sun on vertical faces of a frame or divider projection + Real64 FracSunLit = 0.0; // Fraction of window sunlit this time step + Real64 BeamFaceInc; // Beam solar incident window plane this time step (W/m2) + Real64 DifSolarFaceInc; // Diffuse solar incident on window plane this time step (W/m2) + if (FrArea > 0.0 || DivArea > 0.0) { + FracSunLit = SunlitFrac(TimeStep, HourOfDay, SurfNum); + BeamFaceInc = + BeamSolarRad * SunlitFrac(TimeStep, HourOfDay, SurfNum) * CosInc; + DifSolarFaceInc = SkySolarInc + GndSolarInc; + } + if (FracSunLit > 0.0) { + if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || + (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { + // 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)) + Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( + 3)); // Altitude and azimuth angle of outward window normal (radians) + Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), + Surface(SurfNum).OutNormVec(1)); + Real64 PhiSun = std::asin( + SOLCOS(3)); // Altitude and azimuth angle of sun (radians) + Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); + Real64 const cos_PhiWin(std::cos(PhiWin)); + Real64 const cos_PhiSun(std::cos(PhiSun)); + CosIncAngHorProj = std::abs( + std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - + cos_PhiWin * std::sin(PhiSun)); + CosIncAngVertProj = std::abs( + cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); } - if (FracSunLit > 0.0) { - if ((FrArea > 0.0 && (FrProjOut > 0.0 || FrProjIn > 0.0)) || - (DivArea > 0.0 && (DivProjOut > 0.0 || DivProjIn > 0.0))) { - // 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)) - Real64 PhiWin = std::asin(Surface(SurfNum).OutNormVec( - 3)); // Altitude and azimuth angle of outward window normal (radians) - Real64 ThWin = std::atan2(Surface(SurfNum).OutNormVec(2), - Surface(SurfNum).OutNormVec(1)); - Real64 PhiSun = std::asin( - SOLCOS(3)); // Altitude and azimuth angle of sun (radians) - Real64 ThSun = std::atan2(SOLCOS(2), SOLCOS(1)); - Real64 const cos_PhiWin(std::cos(PhiWin)); - Real64 const cos_PhiSun(std::cos(PhiSun)); - CosIncAngHorProj = std::abs( - std::sin(PhiWin) * cos_PhiSun * std::cos(ThWin - ThSun) - - cos_PhiWin * std::sin(PhiSun)); - CosIncAngVertProj = std::abs( - cos_PhiWin * cos_PhiSun * std::sin(ThWin - ThSun)); + } + // 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.0) { + Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar + Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) + Real64 TransDiffGl = 0.0; // Diffuse solar transmittance + if (FrProjOut > 0.0 || FrProjIn > 0.0) { + Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * + (Surface(SurfNum).Width - + FrameDivider(FrDivNum).VertDividers * + DivWidth) * FracSunLit / FrArea; + Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * + (Surface(SurfNum).Height - + FrameDivider(FrDivNum).HorDividers * + DivWidth) * FracSunLit / FrArea; + // Beam solar on outside of frame + FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; + if (FrProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); + } + // Beam solar on inside of frame + FrIncSolarIn = + (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; } } - // 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.0) { - Real64 FrIncSolarOut = BeamFaceInc; // Total solar incident on outside offrame including solar - Real64 FrIncSolarIn = 0.0; // Total solar incident on inside offrame including solar on frame projection (W/m2) - Real64 TransDiffGl = 0.0; // Diffuse solar transmittance - if (FrProjOut > 0.0 || FrProjIn > 0.0) { - Real64 BeamFrHorFaceInc = BeamSolarRad * CosIncAngHorProj * - (Surface(SurfNum).Width - - FrameDivider(FrDivNum).VertDividers * - DivWidth) * FracSunLit / FrArea; - Real64 BeamFrVertFaceInc = BeamSolarRad * CosIncAngVertProj * - (Surface(SurfNum).Height - - FrameDivider(FrDivNum).HorDividers * - DivWidth) * FracSunLit / FrArea; - // Beam solar on outside of frame - FrIncSolarOut += (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjOut; - if (FrProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam solar on inside of frame - FrIncSolarIn = - (BeamFrHorFaceInc + BeamFrVertFaceInc) * FrProjIn * TransGl; - } + // Beam plus diffuse solar on outside of frame + FrIncSolarOut += + DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); + SurfWinFrameQRadOutAbs(SurfNum) = + FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window outside reveal surfaces + SurfWinFrameQRadOutAbs(SurfNum) += + BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + + // Beam plus diffuse solar on inside of frame + FrIncSolarIn += + DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); + SurfWinFrameQRadInAbs(SurfNum) = + FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); + // Add diffuse from beam reflected from window inside reveal surfaces + SurfWinFrameQRadInAbs(SurfNum) += + BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * + SurfWinFrameSolAbsorp(SurfNum); + } + + // 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.0) { // Solar absorbed by window divider + Real64 DividerAbs = SurfWinDividerSolAbsorp( + SurfNum); // Window divider solar absorptance + if (SurfWinDividerType(SurfNum) == Suspended) { + // 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) + int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( + 1); // Outer glass layer material number + Real64 TransGl = dataMaterial.Material( + MatNumGl).Trans; // Outer glass layer material number, switched construction + Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; + Real64 AbsGl = 1.0 - TransGl - ReflGl; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + if (ShadeFlag == SwitchableGlazing) { // Switchable glazing + Real64 MatNumGlSh = dataConstruction.Construct( + ConstrNumSh).LayerPoint(1); + Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; + Real64 ReflGlSh = dataMaterial.Material( + MatNumGlSh).ReflectSolBeamFront; + Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; + TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); + ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); + AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); } - // Beam plus diffuse solar on outside of frame - FrIncSolarOut += - DifSolarFaceInc * (1.0 + 0.5 * SurfWinProjCorrFrOut(SurfNum)); - SurfWinFrameQRadOutAbs(SurfNum) = - FrIncSolarOut * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window outside reveal surfaces - SurfWinFrameQRadOutAbs(SurfNum) += - BeamSolarRad * SurfWinOutsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); - - // Beam plus diffuse solar on inside of frame - FrIncSolarIn += - DifSolarFaceInc * TransDiffGl * 0.5 * SurfWinProjCorrFrIn(SurfNum); - SurfWinFrameQRadInAbs(SurfNum) = - FrIncSolarIn * SurfWinFrameSolAbsorp(SurfNum); - // Add diffuse from beam reflected from window inside reveal surfaces - SurfWinFrameQRadInAbs(SurfNum) += - BeamSolarRad * SurfWinInsRevealDiffOntoFrame(SurfNum) * - SurfWinFrameSolAbsorp(SurfNum); + Real64 DividerRefl = + 1.0 - DividerAbs; // Window divider solar reflectance + DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / + (1.0 - DividerRefl * ReflGl); } - // 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.0) { // Solar absorbed by window divider - Real64 DividerAbs = SurfWinDividerSolAbsorp( - SurfNum); // Window divider solar absorptance - if (SurfWinDividerType(SurfNum) == Suspended) { - // 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) - int MatNumGl = dataConstruction.Construct(ConstrNum).LayerPoint( - 1); // Outer glass layer material number - Real64 TransGl = dataMaterial.Material( - MatNumGl).Trans; // Outer glass layer material number, switched construction - Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; - Real64 AbsGl = 1.0 - TransGl - ReflGl; - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) + Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) + // Beam incident on horizontal and vertical projection faces of divider if no exterior shading + if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && + ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn) { + 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; + } + Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) + Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) + Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && + ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading + DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + if (DivProjIn > 0.0) { + Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( + ConstrNum).TransSolBeamCoef); + Real64 TransDiffGl = dataConstruction.Construct( + ConstrNum).TransDiff; // Diffuse solar transmittance if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 MatNumGlSh = dataConstruction.Construct( - ConstrNumSh).LayerPoint(1); - Real64 TransGlSh = dataMaterial.Material(MatNumGlSh).Trans; - Real64 ReflGlSh = dataMaterial.Material( - MatNumGlSh).ReflectSolBeamFront; - Real64 AbsGlSh = 1.0 - TransGlSh - ReflGlSh; + Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( + ConstrNumSh).TransSolBeamCoef); + // Outer glass solar trans, refl, absorptance if switched TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - ReflGl = InterpSw(SwitchFac, ReflGl, ReflGlSh); - AbsGl = InterpSw(SwitchFac, AbsGl, AbsGlSh); + Real64 TransDiffGlSh = dataConstruction.Construct( + ConstrNumSh).TransDiff; + // Diffuse solar transmittance, switched construction + TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); } - Real64 DividerRefl = - 1.0 - DividerAbs; // Window divider solar reflectance - DividerAbs = AbsGl + TransGl * (DividerAbs + DividerRefl * AbsGl) / - (1.0 - DividerRefl * ReflGl); - } - - Real64 BeamDivHorFaceInc = 0.0; // Beam solar on divider's horizontal outside projection faces (W/m2) - Real64 BeamDivVertFaceInc = 0.0; // Beam solar on divider's vertical outside projection faces (W/m2) - // Beam incident on horizontal and vertical projection faces of divider if no exterior shading - if (DivProjOut > 0.0 && ShadeFlag != ExtShadeOn && - ShadeFlag != ExtBlindOn && ShadeFlag != ExtScreenOn) { - 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; - } - Real64 DivIncSolarOutBm = 0.0; // Diffuse solar incident on outside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarOutDif = 0.0; // Diffuse solar incident on outside of divider including diffuse on divider projection (W/m2) - Real64 DivIncSolarInBm = 0.0; // Diffuse solar incident on inside of divider including beam on divider projection (W/m2) - Real64 DivIncSolarInDif = 0.0; // Diffuse solar incident on inside of divider including diffuse on divider projection (W/m2) - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn && - ShadeFlag != ExtScreenOn) { // No exterior or between-glass shading - DivIncSolarOutBm = BeamFaceInc + BeamDivHorFaceInc + BeamDivVertFaceInc; - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - if (DivProjIn > 0.0) { - Real64 TransGl = POLYF(CosInc, dataConstruction.Construct( - ConstrNum).TransSolBeamCoef); - Real64 TransDiffGl = dataConstruction.Construct( - ConstrNum).TransDiff; // Diffuse solar transmittance - if (ShadeFlag == SwitchableGlazing) { // Switchable glazing - Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( - ConstrNumSh).TransSolBeamCoef); - // Outer glass solar trans, refl, absorptance if switched - TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); - Real64 TransDiffGlSh = dataConstruction.Construct( - ConstrNumSh).TransDiff; - // Diffuse solar transmittance, switched construction - TransDiffGl = InterpSw(SwitchFac, TransDiffGl, TransDiffGlSh); - } - // Beam plus diffuse solar on inside of divider - // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) - // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) - Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * - FrameDivider(FrDivNum).HorDividers * - DivProjIn * (Surface(SurfNum).Width - - FrameDivider( - FrDivNum).VertDividers * - DivWidth) * FracSunLit / - DivArea; - Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * - FrameDivider(FrDivNum).VertDividers * - DivProjIn * (Surface(SurfNum).Height - - FrameDivider( - FrDivNum).HorDividers * - DivWidth) * FracSunLit / - DivArea; - DivIncSolarInBm = - TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); - DivIncSolarInDif = TransDiffGl * DifSolarFaceInc * - SurfWinProjCorrDivIn(SurfNum); - } - } else { // Exterior shade, screen or blind present - - DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarOutDif = - DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); - DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * - dataConstruction.Construct(ConstrNum).TransDiff; - } - if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && - ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn) { - // No exterior or between-glass shade, screen or blind - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); - // Exterior shade, screen or blind - } else if (ShadeFlag == ExtBlindOn) { // Exterior blind - int BlNum = SurfWinBlindNumber(SurfNum); - Real64 ProfAng; // Solar profile angle (rad) - ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); - Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) - // TBlBmBm - Blind beam-beam solar transmittance - // TBlBmDif - Blind diffuse-diffuse solar transmittance - Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, - Blind(BlNum).SlatWidth, - Blind(BlNum).SlatSeparation, - Blind(BlNum).SlatThickness); - Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, - SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontBeamDiffTrans); - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + - DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + - DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), - Blind(BlNum).SolFrontDiffDiffTrans)); - - } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; - SurfWinDividerQRadOutAbs(SurfNum) = - DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarOutBm +DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = - DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * - (DivIncSolarInBm +DivIncSolarInDif); - - } else if (ShadeFlag == ExtScreenOn) { // Exterior screen - SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarOutBm + - DivIncSolarOutDif); - SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( - SurfWinScreenNumber(SurfNum)).BmDifTrans) * - (DivIncSolarInBm + - DivIncSolarInDif); + // Beam plus diffuse solar on inside of divider + // BeamDivHorFaceIncIn - Beam solar on divider's horizontal inside projection faces (W/m2) + // BeamDivVertFaceIncIn - Beam solar on divider's vertical inside projection faces (W/m2) + Real64 BeamDivHorFaceIncIn = BeamSolarRad * CosIncAngHorProj * + FrameDivider(FrDivNum).HorDividers * + DivProjIn * (Surface(SurfNum).Width - + FrameDivider( + FrDivNum).VertDividers * + DivWidth) * FracSunLit / + DivArea; + Real64 BeamDivVertFaceIncIn = BeamSolarRad * CosIncAngVertProj * + FrameDivider(FrDivNum).VertDividers * + DivProjIn * (Surface(SurfNum).Height - + FrameDivider( + FrDivNum).HorDividers * + DivWidth) * FracSunLit / + DivArea; + DivIncSolarInBm = + TransGl * (BeamDivHorFaceIncIn + BeamDivVertFaceIncIn); + DivIncSolarInDif = TransDiffGl * DifSolarFaceInc * + SurfWinProjCorrDivIn(SurfNum); } + } else { // Exterior shade, screen or blind present + + DivIncSolarOutBm = BeamFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarOutDif = + DifSolarFaceInc * (1.0 + SurfWinProjCorrDivOut(SurfNum)); + DivIncSolarInBm = BeamFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + DivIncSolarInDif = DifSolarFaceInc * SurfWinProjCorrDivIn(SurfNum) * + dataConstruction.Construct(ConstrNum).TransDiff; + } + if (ShadeFlag != ExtShadeOn && ShadeFlag != ExtBlindOn && + ShadeFlag != ExtScreenOn && ShadeFlag != BGShadeOn && ShadeFlag != BGBlindOn) { + // No exterior or between-glass shade, screen or blind + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * (DivIncSolarOutBm + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * (DivIncSolarInBm + DivIncSolarInDif); + // Exterior shade, screen or blind + } else if (ShadeFlag == ExtBlindOn) { // Exterior blind + int BlNum = SurfWinBlindNumber(SurfNum); + Real64 ProfAng; // Solar profile angle (rad) + ProfileAngle(SurfNum, SOLCOS, Blind(BlNum).SlatOrientation, ProfAng); + Real64 SlatAng = SurfWinSlatAngThisTS(SurfNum); // Slat angle (rad) + // TBlBmBm - Blind beam-beam solar transmittance + // TBlBmDif - Blind diffuse-diffuse solar transmittance + Real64 TBlBmBm = BlindBeamBeamTrans(ProfAng, SlatAng, + Blind(BlNum).SlatWidth, + Blind(BlNum).SlatSeparation, + Blind(BlNum).SlatThickness); + Real64 TBlBmDif = InterpProfSlatAng(ProfAng, SlatAng, + SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontBeamDiffTrans); + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * (DivIncSolarOutBm * (TBlBmBm + TBlBmDif) + + DivIncSolarOutDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * (DivIncSolarInBm * (TBlBmBm + TBlBmDif) + + DivIncSolarInDif * InterpSlatAng(SlatAng, SurfWinMovableSlats(SurfNum), + Blind(BlNum).SolFrontDiffDiffTrans)); + + } else if (ShadeFlag == ExtShadeOn) { // Exterior shade + int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + SurfWinDividerQRadOutAbs(SurfNum) = + DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarOutBm +DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = + DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * + (DivIncSolarInBm +DivIncSolarInDif); + + } else if (ShadeFlag == ExtScreenOn) { // Exterior screen + SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarOutBm + + DivIncSolarOutDif); + SurfWinDividerQRadInAbs(SurfNum) = DividerAbs * (SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmBmTrans + SurfaceScreens( + SurfWinScreenNumber(SurfNum)).BmDifTrans) * + (DivIncSolarInBm + + DivIncSolarInDif); } } } From 9291a8cb7cf10be068afefb0e1fefd8f4320e232 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 15 Sep 2020 18:46:53 -0700 Subject: [PATCH 20/25] fix dome --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 58 ++++++++++++++------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 360ca15d438..1847ce2d93f 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2402,7 +2402,8 @@ namespace HeatBalanceSurfaceManager { ZoneOpaqSurfExtFaceCond(zoneNum) = 0.0; ZoneOpaqSurfExtFaceCondGainRep(zoneNum) = 0.0; ZoneOpaqSurfExtFaceCondLossRep(zoneNum) = 0.0; - + } + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { int const firstSurfOpaq = Zone(zoneNum).NonWindowSurfaceFirst; int const lastSurfOpaq = Zone(zoneNum).NonWindowSurfaceLast; if (firstSurfOpaq == -1) continue; @@ -2435,6 +2436,8 @@ namespace HeatBalanceSurfaceManager { SurfWinIntLWAbsByShade(SurfNum) = 0.0; SurfWinConvHeatFlowNatural(SurfNum) = 0.0; SurfWinConvHeatGainToZoneAir(SurfNum) = 0.0; + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { SurfWinRetHeatGainToZoneAir(SurfNum) = 0.0; SurfWinDividerHeatGain(SurfNum) = 0.0; SurfWinBlTsolBmBm(SurfNum) = 0.0; @@ -2448,6 +2451,8 @@ namespace HeatBalanceSurfaceManager { SurfWinScGlSysTsolBmBm(SurfNum) = 0.0; SurfWinScGlSysTsolDifDif(SurfNum) = 0.0; SurfWinGlTsolBmBm(SurfNum) = 0.0; + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { SurfWinGlTsolBmDif(SurfNum) = 0.0; SurfWinGlTsolDifDif(SurfNum) = 0.0; SurfWinBmSolTransThruIntWinRep(SurfNum) = 0.0; @@ -2460,6 +2465,8 @@ namespace HeatBalanceSurfaceManager { SurfWinInsRevealDiffOntoGlazing(SurfNum) = 0.0; SurfWinInsRevealDiffIntoZone(SurfNum) = 0.0; SurfWinOutsRevealDiffOntoFrame(SurfNum) = 0.0; + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { SurfWinInsRevealDiffOntoFrame(SurfNum) = 0.0; SurfWinInsRevealDiffOntoGlazingReport(SurfNum) = 0.0; SurfWinInsRevealDiffIntoZoneReport(SurfNum) = 0.0; @@ -2470,9 +2477,10 @@ namespace HeatBalanceSurfaceManager { SurfWinBmSolRefldInsRevealRepEnergy(SurfNum) = 0.0; SurfWinProfileAngHor(SurfNum) = 0.0; SurfWinProfileAngVert(SurfNum) = 0.0; - SurfWinHeatGain(SurfNum) = 0.0; SurfWinHeatTransfer(SurfNum) = 0.0; + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { SurfWinHeatGainRep(SurfNum) = 0.0; SurfWinHeatLossRep(SurfNum) = 0.0; SurfWinGainConvGlazToZoneRep(SurfNum) = 0.0; @@ -2485,6 +2493,8 @@ namespace HeatBalanceSurfaceManager { SurfWinGapConvHtFlowRep(SurfNum) = 0.0; SurfWinShadingAbsorbedSolar(SurfNum) = 0.0; SurfWinSysSolTransmittance(SurfNum) = 0.0; + } + for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { SurfWinSysSolReflectance(SurfNum) = 0.0; SurfWinSysSolAbsorptance(SurfNum) = 0.0; SurfWinHeatGainRepEnergy(SurfNum) = 0.0; @@ -2493,11 +2503,9 @@ namespace HeatBalanceSurfaceManager { SurfWinHeatTransferRepEnergy(SurfNum) = 0.0; SurfWinShadingAbsorbedSolarEnergy(SurfNum) = 0.0; SurfWinOtherConvGainInsideFaceToZoneRep(SurfNum) = 0.0; - SurfWinBSDFBeamDirectionRep(SurfNum) = 0; SurfWinBSDFBeamThetaRep(SurfNum) = 0.0; SurfWinBSDFBeamPhiRep(SurfNum) = 0.0; - SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; SurfWinQRadSWwinAbsTotEnergy(SurfNum) = 0.0; SurfWinSWwinAbsTotalReport(SurfNum) = 0.0; @@ -2547,6 +2555,8 @@ namespace HeatBalanceSurfaceManager { ZoneBmSolFrIntWinsRepEnergy(zoneNum) = 0.0; ZoneDifSolFrExtWinsRepEnergy(zoneNum) = 0.0; ZoneDifSolFrIntWinsRepEnergy(zoneNum) = 0.0; + } + for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { int const firstSurfWin = Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = Zone(zoneNum).WindowSurfaceLast; if (firstSurfWin == -1) continue; @@ -2574,16 +2584,10 @@ namespace HeatBalanceSurfaceManager { e.TransVisDiff = 0.0; e.TransmittedSolar = 0.0; int SurfDome = e.Dome; - int SurfDiffuser = e.Diffuser; SurfWinTransSolar(SurfDome) = 0.0; SurfQRadSWOutIncident(SurfDome) = 0.0; - SurfWinQRadSWwinAbsTot(SurfDome) = 0.0; - SurfWinTransSolar(SurfDiffuser) = 0.0; - SurfQRadSWOutIncident(SurfDiffuser) = 0.0; - SurfWinQRadSWwinAbsTot(SurfDiffuser) = 0.0; for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { SurfWinQRadSWwinAbs(Lay, SurfDome) = 0.0; - SurfWinQRadSWwinAbs(Lay, SurfDiffuser) = 0.0; } } } @@ -2821,6 +2825,9 @@ namespace HeatBalanceSurfaceManager { // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = currSkySolarInc(SurfNum); + SurfQRadSWOutIncident(SurfNum) = + SurfQRadSWOutIncidentBeam(SurfNum) + SurfQRadSWOutIncidentSkyDiffuse(SurfNum) + + SurfQRadSWOutIncBmToDiffReflGnd(SurfNum) + SurfQRadSWOutIncSkyDiffReflGnd(SurfNum); } for (int ShelfNum = 1; ShelfNum <= NumOfShelf; ++ShelfNum) { int SurfNum = Shelf(ShelfNum).Window; // Daylighting shelf object number @@ -2936,7 +2943,7 @@ namespace HeatBalanceSurfaceManager { if (ShadeFlag == IntShadeOn || ShadeFlag == ExtShadeOn || ShadeFlag == BGShadeOn || ShadeFlag == ExtScreenOn) { // Shade/screen on - + // TODO: Duplicating? (XL) for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNumSh).AbsDiff(Lay); } @@ -2948,6 +2955,7 @@ namespace HeatBalanceSurfaceManager { if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { // Blind on for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + // TODO: InterpSlatAng AbsDiffWin(Lay) = InterpSlatAng(SurfWinSlatAngThisTS(SurfNum), SurfWinMovableSlats(SurfNum), @@ -3050,10 +3058,10 @@ namespace HeatBalanceSurfaceManager { // ( QRadSWOutIncident( SurfNum ) + QS( Surface( SurfNum ).Zone ) ); // } } else if (SurfWinWindowModelType(SurfNum) == WindowBSDFModel) { - int TotSolidLay = dataConstruction.Construct( - ConstrNum).TotSolidLayers; // Number of solid layers in fenestration system (glass + shading) - int CurrentState = SurfaceWindow( - SurfNum).ComplexFen.CurrentState; // Current state for Complex Fenestration + int TotSolidLay = dataConstruction.Construct(ConstrNum).TotSolidLayers; + // Number of solid layers in fenestration system (glass + shading) + int CurrentState = SurfaceWindow(SurfNum).ComplexFen.CurrentState; + // Current state for Complex Fenestration // Examine for schedule surface gain Real64 SurfSolAbs = WindowScheduledSolarAbs(SurfNum, ConstrNum); // Pointer to scheduled surface gains object for fenestration systems @@ -3412,10 +3420,24 @@ namespace HeatBalanceSurfaceManager { } } // RoughIndexMovInsul <= 0, no movable insulation - } // Surface(SurfNum)%HeatTransSurf - } - } // Surface(SurfNum)%ExtSolar + } // Surface(SurfNum)%HeatTransSurf + } // Surface(SurfNum)%ExtSolar + } // end of surface window loop } // end of zone loop + for (int PipeNum = 1; PipeNum <= NumOfTDDPipes; ++PipeNum) { + int SurfNum = TDDPipe(PipeNum).Dome; // TDD: DOME object number + int ConstrNum = Surface(SurfNum).Construction; + int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; // Number of glass layers + SurfWinQRadSWwinAbsTot(SurfNum) = 0.0; + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { + AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); + SurfWinQRadSWwinAbs(Lay, SurfNum) = AbsDiffWin(Lay) * (currSkySolarInc(SurfNum) + currGndSolarInc(SurfNum)) + + AWinSurf(Lay, SurfNum) * currBeamSolar(SurfNum); + SurfWinQRadSWwinAbsLayer(Lay, SurfNum) = SurfWinQRadSWwinAbs(Lay, SurfNum) * Surface(SurfNum).Area; + SurfWinQRadSWwinAbsTot(SurfNum) += SurfWinQRadSWwinAbsLayer(Lay, SurfNum); + } + SurfWinQRadSWwinAbsTotEnergy(SurfNum) = SurfWinQRadSWwinAbsTot(SurfNum) * TimeStepZoneSec; + } } // End of sun-up check } From c45388fc4ed221e459ccdf0738242f3da097cad9 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 18 Sep 2020 15:29:20 -0700 Subject: [PATCH 21/25] clean up --- src/EnergyPlus/DataSurfaces.cc | 2 ++ src/EnergyPlus/DataSurfaces.hh | 1 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 10 +++++----- src/EnergyPlus/SurfaceGeometry.cc | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 8533d88182a..b2194576337 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -411,6 +411,7 @@ namespace DataSurfaces { Array1D BmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl // from obstructions (W/m2)/(W/m2) Array1D BmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground + Array1D SkyDiffReflFacGnd; // sky diffuse reflection view factors from ground Array2D AWinSurf; // Time step value of factor for beam // absorbed in window glass layers @@ -1235,6 +1236,7 @@ namespace DataSurfaces { BmToBmReflFacObs.deallocate(); BmToDiffReflFacObs.deallocate(); BmToDiffReflFacGnd.deallocate(); + SkyDiffReflFacGnd.deallocate(); AWinSurf.deallocate(); AWinSurfDiffFront.deallocate(); AWinSurfDiffBack.deallocate(); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 474776d458b..43c1714b943 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -391,6 +391,7 @@ namespace DataSurfaces { extern Array1D BmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl // from obstructions (W/m2)/(W/m2) extern Array1D BmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground + extern Array1D SkyDiffReflFacGnd; // sky diffuse reflection view factors from ground extern Array2D AWinSurf; // Time step value of factor for beam // absorbed in window glass layers diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 1847ce2d93f..80730269ae5 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2343,12 +2343,11 @@ namespace HeatBalanceSurfaceManager { static Array1D AbsDiffWin(CFSMAXNL); // Diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinGnd(CFSMAXNL); // Ground diffuse solar absorptance of glass layers //Tuned Made static static Array1D AbsDiffWinSky(CFSMAXNL); // Sky diffuse solar absorptance of glass layers //Tuned Made static - static Array1D SkyDiffReflFacGnd(TotSurfaces); // sky diffuse reflection view factors from ground - static Array1D currCosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass - static Array1D currBeamSolar(TotSurfaces); // Local variable for BeamSolarRad - static Array1D currSkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface - static Array1D currGndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface + Array1D currCosInc(TotSurfaces); // Cosine of incidence angle of beam solar on glass + Array1D currBeamSolar(TotSurfaces); // Local variable for BeamSolarRad + Array1D currSkySolarInc(TotSurfaces); // Sky diffuse solar incident on a surface + Array1D currGndSolarInc(TotSurfaces); // Ground diffuse solar incident on a surface // Always initialize the shortwave quantities for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { @@ -2586,6 +2585,7 @@ namespace HeatBalanceSurfaceManager { int SurfDome = e.Dome; SurfWinTransSolar(SurfDome) = 0.0; SurfQRadSWOutIncident(SurfDome) = 0.0; + SurfWinQRadSWwinAbsTot(SurfDome) = 0.0; for (int Lay = 1; Lay <= DataWindowEquivalentLayer::CFSMAXNL + 1; Lay++) { SurfWinQRadSWwinAbs(Lay, SurfDome) = 0.0; } diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 98ab7de71ef..2a08d359a78 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -929,6 +929,7 @@ namespace SurfaceGeometry { BmToBmReflFacObs.dimension(TotSurfaces, 0.0); BmToDiffReflFacObs.dimension(TotSurfaces, 0.0); BmToDiffReflFacGnd.dimension(TotSurfaces, 0.0); + SkyDiffReflFacGnd.dimension(TotSurfaces, 0.0); AWinSurf.dimension(CFSMAXNL + 1, TotSurfaces, 0.0); AWinSurfDiffFront.dimension(CFSMAXNL + 1, TotSurfaces, 0.0); AWinSurfDiffBack.dimension(CFSMAXNL + 1, TotSurfaces, 0.0); From 3c58f505a266000910e633fda3bf827dd499c6bb Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sun, 4 Oct 2020 16:08:18 -0700 Subject: [PATCH 22/25] merge --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f4d1692f813..2034216c5ef 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2930,7 +2930,7 @@ namespace HeatBalanceSurfaceManager { SurfWinWindowModelType(SurfNum) != WindowEQLModel && !state.dataWindowManager->inExtWindowModel->isExternalLibraryModel()) { int TotGlassLay = dataConstruction.Construct(ConstrNum).TotGlassLayers; // Number of glass layers - for (Lay = 1; Lay <= TotGlassLay; ++Lay) { + for (int Lay = 1; Lay <= TotGlassLay; ++Lay) { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); } @@ -3018,7 +3018,7 @@ namespace HeatBalanceSurfaceManager { // AWinSurf is from InteriorSolarDistribution if (ShadeFlag == IntBlindOn || ShadeFlag == ExtBlindOn || ShadeFlag == BGBlindOn) { - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; if (Blind(SurfWinBlindNumber(SurfNum)).SlatOrientation == Horizontal) { // AbsDiffGlassLayGnd - System glass layer ground diffuse solar absorptance with blind on // AbsDiffGlassLaySky - System glass layer sky diffuse solar absorptance with blind on @@ -3124,14 +3124,13 @@ namespace HeatBalanceSurfaceManager { if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { SurfNum2 = TDDPipe(SurfWinTDDPipeNum(SurfNum)).Dome; } - std::pair incomingAngle = getSunWCEAngles( - dataWindowComplexManager, SurfNum2, BSDFHemisphere::Incoming); + std::pair incomingAngle = + getSunWCEAngles(state, SurfNum2, BSDFHemisphere::Incoming); Real64 Theta = incomingAngle.first; Real64 Phi = incomingAngle.second; std::shared_ptr aLayer = CWindowConstructionsSimplified::instance().getEquivalentLayer( state, WavelengthRange::Solar, ConstrNum); - size_t totLayers = aLayer->getNumOfLayers(); for (size_t Lay = 1; Lay <= totLayers; ++Lay) { @@ -3220,7 +3219,7 @@ namespace HeatBalanceSurfaceManager { TransDiffGl = dataConstruction.Construct(ConstrNum).TransDiff; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( ConstrNumSh).TransSolBeamCoef); TransGl = InterpSw(SwitchFac, TransGl, TransGlSh); @@ -3271,7 +3270,7 @@ namespace HeatBalanceSurfaceManager { Real64 ReflGl = dataMaterial.Material(MatNumGl).ReflectSolBeamFront; Real64 AbsGl = 1.0 - TransGl - ReflGl; Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; if (ShadeFlag == SwitchableGlazing) { // Switchable glazing Real64 MatNumGlSh = dataConstruction.Construct( ConstrNumSh).LayerPoint(1); @@ -3322,7 +3321,7 @@ namespace HeatBalanceSurfaceManager { ConstrNum).TransDiff; // Diffuse solar transmittance if (ShadeFlag == SwitchableGlazing) { // Switchable glazing Real64 SwitchFac = SurfWinSwitchingFactor(SurfNum); - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; Real64 TransGlSh = POLYF(CosInc, dataConstruction.Construct( ConstrNumSh).TransSolBeamCoef); // Outer glass solar trans, refl, absorptance if switched @@ -3396,7 +3395,7 @@ namespace HeatBalanceSurfaceManager { Blind(BlNum).SolFrontDiffDiffTrans)); } else if (ShadeFlag == ExtShadeOn) { // Exterior shade - int ConstrNumSh = Surface(SurfNum).ShadedConstruction; + int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; SurfWinDividerQRadOutAbs(SurfNum) = DividerAbs * dataMaterial.Material(dataConstruction.Construct(ConstrNumSh).LayerPoint(1)).Trans * (DivIncSolarOutBm +DivIncSolarOutDif); From 8a581b932c400d51d9c9ad1b8ff3b32de52605f6 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 9 Oct 2020 21:11:14 -0700 Subject: [PATCH 23/25] address review --- src/EnergyPlus/DataGlobals.cc | 2 - src/EnergyPlus/DataGlobals.hh | 1 - src/EnergyPlus/DataHeatBalSurface.cc | 27 +++---- src/EnergyPlus/DataHeatBalSurface.hh | 13 ++-- src/EnergyPlus/DataSurfaces.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 75 +++++++++---------- src/EnergyPlus/Photovoltaics.cc | 10 +-- src/EnergyPlus/api/EnergyPlusPgm.cc | 1 - third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh | 1 - .../unit/HeatBalanceSurfaceManager.unit.cc | 6 +- 10 files changed, 59 insertions(+), 79 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 2b874f38682..6f5904a4055 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -257,7 +257,6 @@ namespace DataGlobals { std::function errorCallback; bool eplusRunningViaAPI; - double timer_1(0.0); // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. @@ -350,7 +349,6 @@ namespace DataGlobals { ioFiles.mtr.close(); ioFiles.err_stream.reset(); eplusRunningViaAPI = false; - timer_1 = 0.0; } } // namespace DataGlobals diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 7a4546979fd..d1830c69af6 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -241,7 +241,6 @@ namespace DataGlobals { extern std::function messageCallback; extern std::function errorCallback; extern bool eplusRunningViaAPI; // a flag for capturing whether we are running via API - if so we can't do python plugins - extern double timer_1; // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state(EnergyPlus::IOFiles &ioFiles); diff --git a/src/EnergyPlus/DataHeatBalSurface.cc b/src/EnergyPlus/DataHeatBalSurface.cc index 48a9a572cd4..c1e46ff3354 100644 --- a/src/EnergyPlus/DataHeatBalSurface.cc +++ b/src/EnergyPlus/DataHeatBalSurface.cc @@ -208,26 +208,23 @@ namespace DataHeatBalSurface { Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, // for reporting (W) - Array1D SurfTempSurfOut; // Temperature of the Outside Surface for each heat transfer surface + Array1D SurfTempOut; // Temperature of the Outside Surface for each heat transfer surface // used for reporting purposes only. Ref: TH(x,1,1) Array1D SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - Array1D ZoneQC; // Short-Wave Radiation Converted Direct To Convection - Array1D ZoneQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D SolEnclQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - Array1D ZoneQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D SolEnclQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows - //(considered diffuse) + // (considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - Array1D ZoneQDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering - // through exterior windows - Array1D ZoneVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) - Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection + Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) +// Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D ZoneMRT; // Zone Mean Radiant Temperature Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface @@ -345,14 +342,12 @@ namespace DataHeatBalSurface { SurfOpaqStorageConductionFlux.deallocate(); SurfOpaqStorageConductionEnergy.deallocate(); SurfOpaqInsFaceBeamSolAbsorbed.deallocate(); - SurfTempSurfOut.deallocate(); + SurfTempOut.deallocate(); SurfQRadSWOutMvIns.deallocate(); - ZoneQC.deallocate(); - ZoneQD.deallocate(); - ZoneQDforDaylight.deallocate(); - ZoneQDV.deallocate(); - ZoneVMULT.deallocate(); - ZoneVCONV.deallocate(); + SolEnclQD.deallocate(); + SolEnclQDforDaylight.deallocate(); + SolEnclVMULT.deallocate(); +// ZoneVCONV.deallocate(); SurfNetLWRadToSurf.deallocate(); ZoneMRT.deallocate(); SurfOpaqQRadSWLightsInAbs.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index 3a3b997180d..5ebf090dae0 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -205,26 +205,23 @@ namespace DataHeatBalSurface { extern Array1D SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, // for reporting (W) - extern Array1D SurfTempSurfOut; // Temperature of the Outside Surface for each heat transfer surface + extern Array1D SurfTempOut; // Temperature of the Outside Surface for each heat transfer surface // used for reporting purposes only. Ref: TH(x,1,1) extern Array1D SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - extern Array1D ZoneQC; // Short-Wave Radiation Converted Direct To Convection - extern Array1D ZoneQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D SolEnclQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - extern Array1D ZoneQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D SolEnclQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows //(considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - extern Array1D ZoneQDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering - // through exterior windows - extern Array1D ZoneVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) - extern Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection + extern Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) +// extern Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection extern Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces extern Array1D ZoneMRT; // Zone Mean Radiant Temperature extern Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index d7db605bd0b..3ea428f7467 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -981,7 +981,7 @@ namespace DataSurfaces { // PURPOSE OF THIS SUBROUTINE: // Return total short wave incident to the surface - return SurfQRadSWOutIncident(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); + return SurfQRadSWOutIncident(t_SurfNum) + QS(Surface(t_SurfNum).SolarEnclIndex); } Real64 SurfaceData::getSWBeamIncident(const int t_SurfNum) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index ec095a65f42..5a8f6eced3d 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -374,7 +374,6 @@ namespace HeatBalanceSurfaceManager { using InternalHeatGains::ManageInternalHeatGains; // RJH DElight Modification Begin using namespace DElightManagerF; - using namespace std::chrono; // RJH DElight Modification End // Locals @@ -1461,7 +1460,7 @@ namespace HeatBalanceSurfaceManager { SUMH.dimension(TotSurfaces, 0); TH.dimension(2, Construction::MaxCTFTerms, TotSurfaces, 0.0); - SurfTempSurfOut.dimension(TotSurfaces, 0.0); + SurfTempOut.dimension(TotSurfaces, 0.0); TempSurfInRep.dimension(TotSurfaces, 0.0); TempSurfInMovInsRep.dimension(TotSurfaces, 0.0); QConvInReport.dimension(TotSurfaces, 0.0); @@ -1604,7 +1603,7 @@ namespace HeatBalanceSurfaceManager { if (Surface(loop).ExtBoundCond != KivaFoundation) { SetupOutputVariable(state, - "Surface Outside Face Temperature", OutputProcessor::Unit::C, SurfTempSurfOut(loop), "Zone", "State", Surface(loop).Name); + "Surface Outside Face Temperature", OutputProcessor::Unit::C, SurfTempOut(loop), "Zone", "State", Surface(loop).Name); } SetupOutputVariable(state, @@ -2068,10 +2067,8 @@ namespace HeatBalanceSurfaceManager { // unused ALLOCATE(QBV(NumOfZones)) // unused QBV=0.0 - ZoneQC.dimension(NumOfZones, 0.0); - ZoneQD.dimension(NumOfZones, 0.0); - ZoneQDforDaylight.dimension(NumOfZones, 0.0); - ZoneQDV.dimension(NumOfZones, 0.0); + SolEnclQD.dimension(NumOfZones, 0.0); + SolEnclQDforDaylight.dimension(NumOfZones, 0.0); QL.dimension(NumOfZones, 0.0); // UCSD @@ -2171,7 +2168,7 @@ namespace HeatBalanceSurfaceManager { HAirExtSurf(SurfNum) = 0.0; HSkyExtSurf(SurfNum) = 0.0; HGrdExtSurf(SurfNum) = 0.0; - SurfTempSurfOut(SurfNum) = 0.0; + SurfTempOut(SurfNum) = 0.0; TempSurfInRep(SurfNum) = 0.0; TempSurfInMovInsRep(SurfNum) = 0.0; QConvInReport(SurfNum) = 0.0; @@ -2539,10 +2536,8 @@ namespace HeatBalanceSurfaceManager { if (!SunIsUp || (BeamSolarRad + GndSolarRad + DifSolarRad <= 0.0)) { // Sun is down for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - ZoneQD(zoneNum) = 0.0; - ZoneQDforDaylight(zoneNum) = 0.0; - ZoneQC(zoneNum) = 0.0; - ZoneQDV(zoneNum) = 0.0; + SolEnclQD(zoneNum) = 0.0; + SolEnclQDforDaylight(zoneNum) = 0.0; ZoneTransSolar(zoneNum) = 0.0; ZoneBmSolFrExtWinsRep(zoneNum) = 0.0; ZoneBmSolFrIntWinsRep(zoneNum) = 0.0; @@ -2662,7 +2657,7 @@ namespace HeatBalanceSurfaceManager { // 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 - ZoneQDforDaylight(ZoneNum) = + SolEnclQDforDaylight(ZoneNum) = (DBZone(ZoneNum) - DBZoneIntWin(ZoneNum)) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); // RJH 08/30/07 - Substitute InitialZoneDifSolReflW(ZoneNum) for DSZone and DGZone here @@ -2673,14 +2668,14 @@ namespace HeatBalanceSurfaceManager { // QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad & // +DSZone(ZoneNum)*DifSolarRad & // +DGZone(ZoneNum)*GndSolarRad - ZoneQD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); + SolEnclQD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); } // Flux of diffuse solar in each zone QSDifSol = 0.0; for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { - QSDifSol(enclNum) = ZoneQDforDaylight(enclNum); + QSDifSol(enclNum) = SolEnclQDforDaylight(enclNum); } if (InterZoneWindow) { @@ -2690,7 +2685,7 @@ namespace HeatBalanceSurfaceManager { auto lZone(FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { if ((otherEnclNum != enclNum) && (RecDifShortFromZ(otherEnclNum))) { - QSDifSol_sum += FractDifShortZtoZ[lZone] * ZoneQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) + QSDifSol_sum += FractDifShortZtoZ[lZone] * SolEnclQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } QSDifSol(enclNum) += QSDifSol_sum; @@ -2700,9 +2695,9 @@ namespace HeatBalanceSurfaceManager { for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { if (InterZoneWindow) - QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * ZoneVMULT(enclNum); + QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * SolEnclVMULT(enclNum); else - QSDifSol(enclNum) *= ZoneVMULT(enclNum); + QSDifSol(enclNum) *= SolEnclVMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -2933,8 +2928,6 @@ namespace HeatBalanceSurfaceManager { AbsDiffWin(Lay) = dataConstruction.Construct(ConstrNum).AbsDiff(Lay); } - ShadeFlag = SurfWinShadingFlag(SurfNum); - if (ShadeFlag > 0) { // Shaded window int ConstrNumSh = Surface(SurfNum).activeShadedConstruction; // Shaded window construction @@ -3525,7 +3518,7 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) = ZoneQD(enclosureNum) + sumZoneQLTSW; + QS(enclosureNum) = SolEnclQD(enclosureNum) + sumZoneQLTSW; QSLights(enclosureNum) = sumZoneQLTSW; } @@ -3542,8 +3535,8 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(OtherenclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (ZoneQD(OtherenclosureNum) + sumZoneQLTSW); - ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * ZoneQD(OtherenclosureNum); + QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (SolEnclQD(OtherenclosureNum) + sumZoneQLTSW); + ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * SolEnclQD(OtherenclosureNum); ZoneDifSolFrIntWinsRepEnergy(enclosureNum) = ZoneDifSolFrIntWinsRep(enclosureNum) * TimeStepZoneSec; } } @@ -3573,12 +3566,12 @@ namespace HeatBalanceSurfaceManager { // COMPUTE CONVECTIVE GAINS AND ZONE FLUX DENSITY. for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclosureNum) { if (InterZoneWindow) { - QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * ZoneVMULT(enclosureNum); + QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * SolEnclVMULT(enclosureNum); // CR 8695, VMULT not based on visible - QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * ZoneVMULT(enclosureNum); + QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * SolEnclVMULT(enclosureNum); } else { - QS(enclosureNum) *= ZoneVMULT(enclosureNum); - QSLights(enclosureNum) *= ZoneVMULT(enclosureNum); + QS(enclosureNum) *= SolEnclVMULT(enclosureNum); + QSLights(enclosureNum) *= SolEnclVMULT(enclosureNum); } } @@ -4138,9 +4131,9 @@ namespace HeatBalanceSurfaceManager { // FLOW: - if (!allocated(ZoneVMULT)) { - ZoneVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); - ZoneVCONV.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); + if (!allocated(SolEnclVMULT)) { + SolEnclVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); +// ZoneVCONV.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); } if (ComputeIntSWAbsorpFactorsfirstTime) { FirstCalcZone.dimension(NumOfZones, true); @@ -4264,7 +4257,7 @@ namespace HeatBalanceSurfaceManager { } // End of loop over surfaces in zone if (SUM1 > SmallestAreaAbsProductAllowed) { // Everything is okay, proceed with the regular calculation - ZoneVMULT(enclosureNum) = 1.0 / SUM1; + SolEnclVMULT(enclosureNum) = 1.0 / SUM1; } else { // the sum of area*solar absorptance for all surfaces in the zone is zero--either the user screwed up // or they really want to disallow any solar from being absorbed on the inside surfaces. Fire off a @@ -4277,7 +4270,7 @@ namespace HeatBalanceSurfaceManager { DataViewFactorInformation::ZoneSolarInfo(enclosureNum).Name); FirstCalcZone(enclosureNum) = false; } - ZoneVMULT(enclosureNum) = 0.0; + SolEnclVMULT(enclosureNum) = 0.0; } } // End of zone/enclosure loop } @@ -4321,8 +4314,8 @@ namespace HeatBalanceSurfaceManager { if (!Zone(surfZoneNum).HasInterZoneWindow) continue; int NZ = Surface(SurfNum).SolarEnclIndex; int MZ = Surface(Surface(SurfNum).ExtBoundCond).SolarEnclIndex; - FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * ZoneVMULT(NZ) * Surface(SurfNum).Area; - if (ZoneVMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; + FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * SolEnclVMULT(NZ) * Surface(SurfNum).Area; + if (SolEnclVMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; } // Compute fractions for multiple passes. @@ -7064,7 +7057,7 @@ namespace HeatBalanceSurfaceManager { Real64 &TH11(TH(1, 1, SurfNum)); Real64 &TH12(TH(2, 1, SurfNum)); TH12 = TempSurfInRep(SurfNum) = TempSurfIn(SurfNum); - SurfTempSurfOut(SurfNum) = TH11; // For reporting + SurfTempOut(SurfNum) = TH11; // For reporting if (SurfWinOriginalClass(SurfNum) == SurfaceClass_TDD_Diffuser) { // Tubular daylighting device // Tubular daylighting devices are treated as one big object with an effective R value. @@ -7079,7 +7072,7 @@ namespace HeatBalanceSurfaceManager { // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME - TH11 = SurfTempSurfOut(SurfNum) = SurfTempSurfOut(domeNum) = TH(1, 1, domeNum); + TH11 = SurfTempOut(SurfNum) = SurfTempOut(domeNum) = TH(1, 1, domeNum); } if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { @@ -7101,7 +7094,7 @@ namespace HeatBalanceSurfaceManager { // By going through all of the surfaces, this should pick up the other side as well as affect the next iteration. // [ SurfNum - 1 ] == ( 1, 1, SurfNum ) // [ l211 + surfExtBoundCond ] == ( 2, 1, surfExtBoundCond ) - SurfTempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; + SurfTempOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; } ++InsideSurfIterations; @@ -7773,7 +7766,7 @@ namespace HeatBalanceSurfaceManager { Real64 &TH11(TH(1, 1, surfNum)); Real64 &TH12(TH(2, 1, surfNum)); TH12 = TempSurfInRep(surfNum) = TempSurfIn(surfNum); - SurfTempSurfOut(surfNum) = TH11; // For reporting + SurfTempOut(surfNum) = TH11; // For reporting if (SurfWinOriginalClass(surfNum) == SurfaceClass_TDD_Diffuser) { // Tubular daylighting device // Tubular daylighting devices are treated as one big object with an effective R value. @@ -7788,7 +7781,7 @@ namespace HeatBalanceSurfaceManager { // Set outside temp reporting variable of TDD:DOME (since it gets skipped otherwise) // Reset outside temp variables of TDD:DIFFUSER equal to outside temp of TDD:DOME - TH11 = SurfTempSurfOut(surfNum) = SurfTempSurfOut(domeNum) = TH(1, 1, domeNum); + TH11 = SurfTempOut(surfNum) = SurfTempOut(domeNum) = TH(1, 1, domeNum); } if ((TH12 > MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { @@ -7810,8 +7803,8 @@ namespace HeatBalanceSurfaceManager { // By going through all of the surfaces, this should pick up the other side as well as affect the next iteration. // [ SurfNum - 1 ] == ( 1, 1, SurfNum ) // [ l211 + surfExtBoundCond ] == ( 2, 1, surfExtBoundCond ) - SurfTempSurfOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; - TH11Surf(SurfNum) = SurfTempSurfOut(SurfNum); + SurfTempOut(SurfNum) = TH[SurfNum - 1] = TH[l211 + surfExtBoundCond]; + TH11Surf(SurfNum) = SurfTempOut(SurfNum); } ++InsideSurfIterations; diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index fbe0a658466..1d2d52af79e 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -974,7 +974,7 @@ namespace Photovoltaics { using DataHeatBalance::SurfCosIncidenceAngle; using DataHeatBalance::SurfQRadSWOutIncident; using DataHeatBalance::SurfQRadSWOutIncidentBeam; - using DataHeatBalSurface::SurfTempSurfOut; + using DataHeatBalSurface::SurfTempOut; using DataSurfaces::Surface; using TranspiredCollector::GetUTSCTsColl; @@ -1031,7 +1031,7 @@ namespace Photovoltaics { } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { // get back-of-module temperature from elsewhere in EnergyPlus - PVarray(PVnum).SNLPVCalc.Tback = SurfTempSurfOut(PVarray(PVnum).SurfacePtr); + PVarray(PVnum).SNLPVCalc.Tback = SurfTempOut(PVarray(PVnum).SurfacePtr); PVarray(PVnum).SNLPVCalc.Tcell = SandiaTcellFromTmodule(PVarray(PVnum).SNLPVCalc.Tback, PVarray(PVnum).SNLPVinto.IcBeam, @@ -1313,7 +1313,7 @@ namespace Photovoltaics { using DataSurfaces::Surface; // USE DataPhotovoltaics, ONLY:CellTemp,LastCellTemp using DataHeatBalance::Zone; - using DataHeatBalSurface::SurfTempSurfOut; + using DataHeatBalSurface::SurfTempOut; using TranspiredCollector::GetUTSCTsColl; // Locals @@ -1411,7 +1411,7 @@ namespace Photovoltaics { (1.0 - std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep)); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = SurfTempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = SurfTempOut(PVarray(PVnum).SurfacePtr) + KelvinConv; } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); CellTemp += KelvinConv; @@ -1484,7 +1484,7 @@ namespace Photovoltaics { (PVarray(PVnum).TRNSYSPVcalc.LastCellTempK - Tambient) * std::exp(-PVarray(PVnum).TRNSYSPVModule.HeatLossCoef / PVarray(PVnum).TRNSYSPVModule.HeatCapacity * PVTimeStep); } else if (SELECT_CASE_var == iSurfaceOutsideFaceCellIntegration) { - CellTemp = SurfTempSurfOut(PVarray(PVnum).SurfacePtr) + KelvinConv; + CellTemp = SurfTempOut(PVarray(PVnum).SurfacePtr) + KelvinConv; } else if (SELECT_CASE_var == iTranspiredCollectorCellIntegration) { GetUTSCTsColl(PVarray(PVnum).UTSCPtr, CellTemp); CellTemp += KelvinConv; diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index d0184c459de..a7a86df0587 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -404,7 +404,6 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const & filepat EnergyPlus::ShowSevereError(e.what()); return EnergyPlus::AbortEnergyPlus(state); } -// std::cout << "Solar timer: " << EnergyPlus::DataGlobals::timer_1 << "\n"; return wrapUpEnergyPlus(state); } diff --git a/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh b/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh index e03b7beae61..8087f4f5cbf 100644 --- a/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh +++ b/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh @@ -1169,7 +1169,6 @@ public: // Subscript T & operator ()( int const i ) { - assert( contains( i ) ); return sdata_[ i ]; } diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index f04270bed68..84ea9664c76 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -2569,10 +2569,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInterzoneRadFactorCalc) DataHeatBalance::Zone.allocate(DataGlobals::NumOfZones); DataSurfaces::Surface.allocate(DataSurfaces::TotSurfaces); dataConstruction.Construct.allocate(DataHeatBalance::TotConstructs); - DataHeatBalSurface::ZoneVMULT.allocate(DataGlobals::NumOfZones); + DataHeatBalSurface::SolEnclVMULT.allocate(DataGlobals::NumOfZones); dataConstruction.Construct(1).TransDiff = 0.1; - DataHeatBalSurface::ZoneVMULT(1) = 1.0; - DataHeatBalSurface::ZoneVMULT(2) = 1.0; + DataHeatBalSurface::SolEnclVMULT(1) = 1.0; + DataHeatBalSurface::SolEnclVMULT(2) = 1.0; DataSurfaces::Surface(1).HeatTransSurf = true; DataSurfaces::Surface(1).Construction = 1; From ca7d940bf20943383b0d50308974e31a3b74d524 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 9 Oct 2020 21:16:11 -0700 Subject: [PATCH 24/25] address review --- src/EnergyPlus/DataHeatBalSurface.cc | 2 -- src/EnergyPlus/DataHeatBalSurface.hh | 1 - src/EnergyPlus/HeatBalanceSurfaceManager.cc | 1 - 3 files changed, 4 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalSurface.cc b/src/EnergyPlus/DataHeatBalSurface.cc index c1e46ff3354..d83fc038863 100644 --- a/src/EnergyPlus/DataHeatBalSurface.cc +++ b/src/EnergyPlus/DataHeatBalSurface.cc @@ -224,7 +224,6 @@ namespace DataHeatBalSurface { // (considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) -// Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D ZoneMRT; // Zone Mean Radiant Temperature Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface @@ -347,7 +346,6 @@ namespace DataHeatBalSurface { SolEnclQD.deallocate(); SolEnclQDforDaylight.deallocate(); SolEnclVMULT.deallocate(); -// ZoneVCONV.deallocate(); SurfNetLWRadToSurf.deallocate(); ZoneMRT.deallocate(); SurfOpaqQRadSWLightsInAbs.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index 5ebf090dae0..a576adcd7e9 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -221,7 +221,6 @@ namespace DataHeatBalSurface { //(considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting extern Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) -// extern Array1D ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection extern Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces extern Array1D ZoneMRT; // Zone Mean Radiant Temperature extern Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 5a8f6eced3d..f3411c7b046 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -4133,7 +4133,6 @@ namespace HeatBalanceSurfaceManager { if (!allocated(SolEnclVMULT)) { SolEnclVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); -// ZoneVCONV.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); } if (ComputeIntSWAbsorpFactorsfirstTime) { FirstCalcZone.dimension(NumOfZones, true); From 96f3999c6765675e6983af1a9853ec8c12629225 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 10 Oct 2020 10:55:29 -0700 Subject: [PATCH 25/25] encl naming --- src/EnergyPlus/DataHeatBalSurface.cc | 12 ++--- src/EnergyPlus/DataHeatBalSurface.hh | 6 +-- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 46 +++++++++---------- .../unit/HeatBalanceSurfaceManager.unit.cc | 6 +-- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalSurface.cc b/src/EnergyPlus/DataHeatBalSurface.cc index d83fc038863..0a0f66a32b3 100644 --- a/src/EnergyPlus/DataHeatBalSurface.cc +++ b/src/EnergyPlus/DataHeatBalSurface.cc @@ -214,16 +214,16 @@ namespace DataHeatBalSurface { // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - Array1D SolEnclQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D EnclSolQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - Array1D SolEnclQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + Array1D EnclSolQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows // (considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D ZoneMRT; // Zone Mean Radiant Temperature Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface @@ -343,9 +343,9 @@ namespace DataHeatBalSurface { SurfOpaqInsFaceBeamSolAbsorbed.deallocate(); SurfTempOut.deallocate(); SurfQRadSWOutMvIns.deallocate(); - SolEnclQD.deallocate(); - SolEnclQDforDaylight.deallocate(); - SolEnclVMULT.deallocate(); + EnclSolQD.deallocate(); + EnclSolQDforDaylight.deallocate(); + EnclSolVMULT.deallocate(); SurfNetLWRadToSurf.deallocate(); ZoneMRT.deallocate(); SurfOpaqQRadSWLightsInAbs.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index a576adcd7e9..36095f69040 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -211,16 +211,16 @@ namespace DataHeatBalSurface { // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - extern Array1D SolEnclQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D EnclSolQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows and reflecting from interior surfaces, // beam from exterior windows reflecting from interior surfaces, // and beam entering through interior windows (considered diffuse) - extern Array1D SolEnclQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + extern Array1D EnclSolQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows //(considered diffuse) // Originally QD, now used only for QSDifSol calc for daylighting - extern Array1D SolEnclVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + extern Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) extern Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces extern Array1D ZoneMRT; // Zone Mean Radiant Temperature extern Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f3411c7b046..db5a446ee3e 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2067,8 +2067,8 @@ namespace HeatBalanceSurfaceManager { // unused ALLOCATE(QBV(NumOfZones)) // unused QBV=0.0 - SolEnclQD.dimension(NumOfZones, 0.0); - SolEnclQDforDaylight.dimension(NumOfZones, 0.0); + EnclSolQD.dimension(NumOfZones, 0.0); + EnclSolQDforDaylight.dimension(NumOfZones, 0.0); QL.dimension(NumOfZones, 0.0); // UCSD @@ -2536,8 +2536,8 @@ namespace HeatBalanceSurfaceManager { if (!SunIsUp || (BeamSolarRad + GndSolarRad + DifSolarRad <= 0.0)) { // Sun is down for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { - SolEnclQD(zoneNum) = 0.0; - SolEnclQDforDaylight(zoneNum) = 0.0; + EnclSolQD(zoneNum) = 0.0; + EnclSolQDforDaylight(zoneNum) = 0.0; ZoneTransSolar(zoneNum) = 0.0; ZoneBmSolFrExtWinsRep(zoneNum) = 0.0; ZoneBmSolFrIntWinsRep(zoneNum) = 0.0; @@ -2657,7 +2657,7 @@ namespace HeatBalanceSurfaceManager { // 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 - SolEnclQDforDaylight(ZoneNum) = + EnclSolQDforDaylight(ZoneNum) = (DBZone(ZoneNum) - DBZoneIntWin(ZoneNum)) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); // RJH 08/30/07 - Substitute InitialZoneDifSolReflW(ZoneNum) for DSZone and DGZone here @@ -2668,14 +2668,14 @@ namespace HeatBalanceSurfaceManager { // QD(ZoneNum) = DBZone(ZoneNum)*BeamSolarRad & // +DSZone(ZoneNum)*DifSolarRad & // +DGZone(ZoneNum)*GndSolarRad - SolEnclQD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); + EnclSolQD(ZoneNum) = DBZone(ZoneNum) * BeamSolarRad + DBZoneSSG(ZoneNum) + InitialZoneDifSolReflW(ZoneNum); } // Flux of diffuse solar in each zone QSDifSol = 0.0; for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { - QSDifSol(enclNum) = SolEnclQDforDaylight(enclNum); + QSDifSol(enclNum) = EnclSolQDforDaylight(enclNum); } if (InterZoneWindow) { @@ -2685,7 +2685,7 @@ namespace HeatBalanceSurfaceManager { auto lZone(FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { if ((otherEnclNum != enclNum) && (RecDifShortFromZ(otherEnclNum))) { - QSDifSol_sum += FractDifShortZtoZ[lZone] * SolEnclQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) + QSDifSol_sum += FractDifShortZtoZ[lZone] * EnclSolQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } QSDifSol(enclNum) += QSDifSol_sum; @@ -2695,9 +2695,9 @@ namespace HeatBalanceSurfaceManager { for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { if (InterZoneWindow) - QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * SolEnclVMULT(enclNum); + QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * EnclSolVMULT(enclNum); else - QSDifSol(enclNum) *= SolEnclVMULT(enclNum); + QSDifSol(enclNum) *= EnclSolVMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -3518,7 +3518,7 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) = SolEnclQD(enclosureNum) + sumZoneQLTSW; + QS(enclosureNum) = EnclSolQD(enclosureNum) + sumZoneQLTSW; QSLights(enclosureNum) = sumZoneQLTSW; } @@ -3535,8 +3535,8 @@ namespace HeatBalanceSurfaceManager { for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(OtherenclosureNum).ZoneNums) { sumZoneQLTSW += ZoneIntGain(zoneNum).QLTSW; } - QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (SolEnclQD(OtherenclosureNum) + sumZoneQLTSW); - ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * SolEnclQD(OtherenclosureNum); + QS(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * (EnclSolQD(OtherenclosureNum) + sumZoneQLTSW); + ZoneDifSolFrIntWinsRep(enclosureNum) += FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * EnclSolQD(OtherenclosureNum); ZoneDifSolFrIntWinsRepEnergy(enclosureNum) = ZoneDifSolFrIntWinsRep(enclosureNum) * TimeStepZoneSec; } } @@ -3566,12 +3566,12 @@ namespace HeatBalanceSurfaceManager { // COMPUTE CONVECTIVE GAINS AND ZONE FLUX DENSITY. for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclosureNum) { if (InterZoneWindow) { - QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * SolEnclVMULT(enclosureNum); + QS(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * EnclSolVMULT(enclosureNum); // CR 8695, VMULT not based on visible - QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * SolEnclVMULT(enclosureNum); + QSLights(enclosureNum) *= FractDifShortZtoZ(enclosureNum, enclosureNum) * EnclSolVMULT(enclosureNum); } else { - QS(enclosureNum) *= SolEnclVMULT(enclosureNum); - QSLights(enclosureNum) *= SolEnclVMULT(enclosureNum); + QS(enclosureNum) *= EnclSolVMULT(enclosureNum); + QSLights(enclosureNum) *= EnclSolVMULT(enclosureNum); } } @@ -4131,8 +4131,8 @@ namespace HeatBalanceSurfaceManager { // FLOW: - if (!allocated(SolEnclVMULT)) { - SolEnclVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); + if (!allocated(EnclSolVMULT)) { + EnclSolVMULT.dimension(DataViewFactorInformation::NumOfSolarEnclosures, 0.0); } if (ComputeIntSWAbsorpFactorsfirstTime) { FirstCalcZone.dimension(NumOfZones, true); @@ -4256,7 +4256,7 @@ namespace HeatBalanceSurfaceManager { } // End of loop over surfaces in zone if (SUM1 > SmallestAreaAbsProductAllowed) { // Everything is okay, proceed with the regular calculation - SolEnclVMULT(enclosureNum) = 1.0 / SUM1; + EnclSolVMULT(enclosureNum) = 1.0 / SUM1; } else { // the sum of area*solar absorptance for all surfaces in the zone is zero--either the user screwed up // or they really want to disallow any solar from being absorbed on the inside surfaces. Fire off a @@ -4269,7 +4269,7 @@ namespace HeatBalanceSurfaceManager { DataViewFactorInformation::ZoneSolarInfo(enclosureNum).Name); FirstCalcZone(enclosureNum) = false; } - SolEnclVMULT(enclosureNum) = 0.0; + EnclSolVMULT(enclosureNum) = 0.0; } } // End of zone/enclosure loop } @@ -4313,8 +4313,8 @@ namespace HeatBalanceSurfaceManager { if (!Zone(surfZoneNum).HasInterZoneWindow) continue; int NZ = Surface(SurfNum).SolarEnclIndex; int MZ = Surface(Surface(SurfNum).ExtBoundCond).SolarEnclIndex; - FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * SolEnclVMULT(NZ) * Surface(SurfNum).Area; - if (SolEnclVMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; + FractDifShortZtoZ(NZ, MZ) += dataConstruction.Construct(Surface(SurfNum).Construction).TransDiff * EnclSolVMULT(NZ) * Surface(SurfNum).Area; + if (EnclSolVMULT(NZ) != 0.0) RecDifShortFromZ(NZ) = true; } // Compute fractions for multiple passes. diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 84ea9664c76..c4e40a1626c 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -2569,10 +2569,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInterzoneRadFactorCalc) DataHeatBalance::Zone.allocate(DataGlobals::NumOfZones); DataSurfaces::Surface.allocate(DataSurfaces::TotSurfaces); dataConstruction.Construct.allocate(DataHeatBalance::TotConstructs); - DataHeatBalSurface::SolEnclVMULT.allocate(DataGlobals::NumOfZones); + DataHeatBalSurface::EnclSolVMULT.allocate(DataGlobals::NumOfZones); dataConstruction.Construct(1).TransDiff = 0.1; - DataHeatBalSurface::SolEnclVMULT(1) = 1.0; - DataHeatBalSurface::SolEnclVMULT(2) = 1.0; + DataHeatBalSurface::EnclSolVMULT(1) = 1.0; + DataHeatBalSurface::EnclSolVMULT(2) = 1.0; DataSurfaces::Surface(1).HeatTransSurf = true; DataSurfaces::Surface(1).Construction = 1;