Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE ReportSystemEnergyUse
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN November 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! calculate and report system loads and energy
! METHODOLOGY EMPLOYED:
!Accumulate meter data to appropriate report variables
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEnergyDemands
USE Psychrometrics, ONLY: PsyHFnTdbW
USE DataGlobalConstants
USE DataEnvironment, ONLY: OutDryBulbTemp
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompType
CHARACTER(len=MaxNameLength) :: CompName
INTEGER :: Index !loop counter
INTEGER :: nodes !loop counter
INTEGER :: CtrlZoneNum !ZONE counter
INTEGER :: ZoneInNum !counter for zone air distribution inlets
INTEGER :: AirLoopNum !counter for zone air distribution inlets
INTEGER :: BranchNum !counter for zone air distribution inlets
INTEGER :: EquipListNum !counter for zone air distribution inlets
INTEGER :: VarNum !counter for zone air distribution inlets
INTEGER :: CompNum
INTEGER :: SubCompNum
INTEGER :: SubSubCompNum
INTEGER :: CompMode
INTEGER :: InletNodeNum
INTEGER :: OutletNodeNum
INTEGER :: ADUNum
INTEGER :: ADUCoolNum
INTEGER :: ADUHeatNum
INTEGER :: AirDistCoolInletNodeNum
INTEGER :: AirDistHeatInletNodeNum
INTEGER :: EnergyType
INTEGER :: ActualZoneNum
REAL(r64) :: CompEnergyUse
REAL(r64) :: ZoneLoad
REAL(r64) :: CompLoad
REAL(r64) :: ADUCoolFlowrate
REAL(r64) :: ADUHeatFlowrate
LOGICAL :: CompLoadFlag
IF (.not. AirLoopLoadsReportEnabled) RETURN
!SYSTEM LOADS REPORT
SysTotZoneLoadHTNG = 0.0d0
SysTotZoneLoadCLNG = 0.0d0
SysOALoadHTNG = 0.0d0
SysOALoadCLNG = 0.0d0
SysTotHTNG = 0.0d0
SysTotCLNG = 0.0d0
!SYSTEM ENERGY USE REPORT
SysTotElec = 0.0d0
SystotGas = 0.0d0
SysTotSteam = 0.0d0
SysTotH2OCOLD = 0.0d0
SysTotH2OHOT = 0.0d0
!SYSTEM COMPONENT LOADS REPORT
SysFANCompHTNG = 0.0d0
SysCCCompCLNG = 0.0d0
SysHCCompHTNG = 0.0d0
SysHeatExHTNG = 0.0d0
SysHeatExCLNG = 0.0d0
SysSolarCollectHeating = 0.d0
SysSolarCollectCooling = 0.d0
SysUserDefinedTerminalHeating = 0.d0
SysUserDefinedTerminalCooling = 0.d0
SysHumidHTNG = 0.0d0
SysEvapCLNG = 0.0d0
DesDehumidCLNG = 0.0d0
SysDomesticH20 = 0.0d0
!SYSTEM COMPONENT ENERGY REPORT
SysFANCompElec = 0.0d0
SysHCCompH2OHOT = 0.0d0
SysCCCompH2OCOLD = 0.0d0
SysHCCompElec = 0.0d0
SysCCCompElec = 0.0d0
SysHCCompElecRes = 0.0d0
SysHCCompGas = 0.0d0
SysHCCompSteam = 0.0d0
SysHumidElec = 0.0d0
DesDehumidElec = 0.0d0
SysEvapElec = 0.0d0
DO AirLoopNum = 1, NumPrimaryAirSys
DO BranchNum = 1, PrimaryAirSystem(AirLoopNum)%NumBranches
IF(Node(PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%NodeNumOut)%massflowrate <= 0.0d0)CYCLE
DO CompNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%TotalComponents
CompName = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%Name
CompType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%TypeOf
InletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%NodeNumIn
OutletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%NodeNumOut
IF (InletNodeNum <= 0 .OR. OutletNodeNum <= 0) CYCLE
CompLoad = Node(OutletNodeNum)%massflowrate* &
(PsyHFnTdbW(Node(InletNodeNum)%Temp, Node(InletNodeNum)%HumRat) - &
PsyHFnTdbW(Node(outletNodeNum)%Temp, Node(outletNodeNum)%HumRat))
CompLoad = CompLoad * TimeStepSys * SecInHour
CompEnergyUse = 0.0d0
EnergyType = iRT_None
CompLoadFlag=.TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%NumMeteredVars
CompMode = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%MeteredVar(VarNum)%EndUse_CompMode
CompEnergyUse = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%MeteredVar(VarNum)%CurMeterReading
EnergyType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
END DO
DO SubCompNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%NumSubComps
CompName = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%Name
CompType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%TypeOf
InletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%NodeNumIn
IF (InletNodeNum <= 0 .OR. OutletNodeNum <= 0) CYCLE
OutletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%NodeNumOut
CompLoad = Node(OutletNodeNum)%massflowrate* &
(PsyHFnTdbW(Node(InletNodeNum)%Temp, Node(InletNodeNum)%HumRat) - &
PsyHFnTdbW(Node(outletNodeNum)%Temp, Node(outletNodeNum)%HumRat))
CompLoad = CompLoad * TimeStepSys * SecInHour
CompEnergyUse = 0.0d0
EnergyType = iRT_None
CompLoadFlag=.TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%NumMeteredVars
CompMode = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
MeteredVar(VarNum)%EndUse_CompMode
CompEnergyUse = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
MeteredVar(VarNum)%CurMeterReading
EnergyType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
END DO
DO SubSubCompNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)%NumSubSubcomps
CompName = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%Name
CompType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%TypeOf
InletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%NodeNumIn
OutletNodeNum = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%NodeNumOut
IF (InletNodeNum <= 0 .OR. OutletNodeNum <= 0) CYCLE
CompLoad = Node(OutletNodeNum)%massflowrate*(PsyHFnTdbW(Node(InletNodeNum)%Temp, &
Node(InletNodeNum)%HumRat) - PsyHFnTdbW(Node(outletNodeNum)%Temp, Node(outletNodeNum)%HumRat))
CompLoad = CompLoad * TimeStepSys * SecInHour
CompEnergyUse = 0.0d0
EnergyType = iRT_None
CompLoadFlag=.TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%NumMeteredVars
CompMode = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%MeteredVar(VarNum)%EndUse_CompMode
CompEnergyUse = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%MeteredVar(VarNum)%CurMeterReading
EnergyType = PrimaryAirSystem(AirLoopNum)%Branch(BranchNum)%Comp(CompNum)%SubComp(SubCompNum)% &
SubSubComp(SubSubCompNum)%MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
END DO
ENDDO
ENDDO
ENDDO
ENDDO
ENDDO
DO CtrlZoneNum=1,NumOfZones
IF (.not. ZoneEquipConfig(CtrlZoneNum)%IsControlled) CYCLE
!retrieve the zone load for each zone
ActualZoneNum=ZoneEquipConfig(CtrlZoneNum)%ActualZoneNum
ZoneLoad= ZoneSysEnergyDemand(ActualZoneNum)%TotalOutputRequired
!if system operating in deadband reset zone load
IF (DeadbandOrSetback(ActualZoneNum)) ZoneLoad = 0.0d0
! retrieve air loop indexes
AirLoopNum = ZoneEquipConfig(CtrlZoneNum)%AirLoopNum
IF(AirLoopNum == 0 ) CYCLE
!Zone cooling load
IF(ZoneLoad < -SmallLoad)THEN
SysTotZoneLoadCLNG(AirLoopNum) = SysTotZoneLoadCLNG(AirLoopNum) + ABS(ZoneLoad)
!Zone heating load
ELSEIF(ZoneLoad > SmallLoad)THEN
SysTotZoneLoadHTNG(AirLoopNum) = SysTotZoneLoadHTNG(AirLoopNum) + ABS(ZoneLoad)
ENDIF
!loop over the zone supply air path inlet nodes
DO ZoneInNum=1,ZoneEquipConfig(CtrlZoneNum)%NumInletNodes
AirDistCoolInletNodeNum = MAX(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitCool(ZoneInNum)%InNode,0)
AirDistHeatInletNodeNum = MAX(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitHeat(ZoneInNum)%InNode,0)
! Set for cooling or heating path
IF(AirDistCoolInletNodeNum > 0 .AND. AirDistHeatInletNodeNum == 0)THEN
ADUCoolFlowrate = MAX(Node(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitCool(ZoneInNum)%InNode)%MassFlowRate,0.0d0)
ELSEIF(AirDistHeatInletNodeNum > 0 .AND. AirDistCoolInletNodeNum == 0)THEN
ADUHeatFlowrate = MAX(Node(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitHeat(ZoneInNum)%InNode)%MassFlowRate,0.0d0)
ELSE
ADUCoolFlowrate = 0.0d0
ADUHeatFlowrate = 0.0d0
END IF
DO Index =1,2
EquipListNum = ZoneEquipConfig(CtrlZoneNum)%EquipListIndex
IF (Index ==1)THEN
ADUCoolNum = MAX(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitCool(ZoneInNum)%AirDistUnitIndex,0)
IF (ADUCoolNum == 0) CYCLE
ADUNum=ADUCoolNum
ELSE !(Index =2)THEN
ADUHeatNum = MAX(ZoneEquipConfig(CtrlZoneNum)%AirDistUnitHeat(ZoneInNum)%AirDistUnitIndex,0)
IF (ADUHeatNum == 0) CYCLE
ADUNum=ADUHeatNum
ENDIF
CompLoad = 0.0d0
IF(ZoneEquipList(EquipListNum)%EquipData(ADUNum)%NumInlets > 0)THEN
DO nodes = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%NumInlets
InletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%InletNodeNums(index)
CompLoad = CompLoad + (PsyHFnTdbW(Node(InletNodeNum)%Temp, &
Node(InletNodeNum)%HumRat)*Node(InletNodeNum)%massflowrate)
END DO
DO nodes = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%NumOutlets
OutletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%OutletNodeNums(index)
CompLoad = CompLoad - (PsyHFnTdbW(Node(OutletNodeNum)%Temp, &
Node(OutletNodeNum)%HumRat)*Node(OutletNodeNum)%massflowrate)
END DO
ENDIF
CompLoad = CompLoad * TimeStepSys * SecInHour
CompName = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%Name
CompType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%TypeOf
CompEnergyUse =0.0d0
EnergyType = iRT_None
CompLoadFlag = .TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%NumMeteredVars
CompEnergyUse = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%MeteredVar(VarNum)%CurMeterReading
EnergyType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
ENDDO
DO SubCompNum = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%NumSubEquip
CompName = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%Name
CompType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%TypeOf
InletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%InletNodeNum
OutletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%OutletNodeNum
IF (InletNodeNum <= 0 .OR. OutletNodeNum <= 0) CYCLE
CompLoad = Node(InletNodeNum)%massflowrate*(PsyHFnTdbW(Node(InletNodeNum)%Temp, Node(InletNodeNum)%HumRat) &
- PsyHFnTdbW(Node(OutletNodeNum)%Temp, Node(OutletNodeNum)%HumRat))
CompLoad = CompLoad * TimeStepSys * SecInHour
CompEnergyUse =0.0d0
EnergyType = iRT_None
CompLoadFlag = .TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%NumMeteredVars
CompEnergyUse = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
MeteredVar(VarNum)%CurMeterReading
CompMode = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
MeteredVar(VarNum)%EndUse_CompMode
EnergyType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
ENDDO
DO SubSubCompNum = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)%NumSubSubEquip
CompName = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%Name
CompType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%TypeOf
InletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%InletNodeNum
OutletNodeNum = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%OutletNodeNum
IF (InletNodeNum <= 0 .OR. OutletNodeNum <= 0) CYCLE
CompLoad = Node(InletNodeNum)%massflowrate*(PsyHFnTdbW(Node(InletNodeNum)%Temp, Node(InletNodeNum)%HumRat) &
- PsyHFnTdbW(Node(OutletNodeNum)%Temp, Node(OutletNodeNum)%HumRat))
CompLoad = CompLoad * TimeStepSys * SecInHour
CompEnergyUse =0.0d0
EnergyType = iRT_None
CompLoadFlag = .TRUE.
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
CompLoadFlag = .FALSE.
DO VarNum = 1, ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%NumMeteredVars
CompEnergyUse = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%MeteredVar(VarNum)%CurMeterReading
CompMode = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%MeteredVar(VarNum)%EndUse_CompMode
EnergyType = ZoneEquipList(EquipListNum)%EquipData(ADUNum)%SubEquipData(SubCompNum)% &
SubSubEquipData(SubSubCompNum)%MeteredVar(VarNum)%ResourceType
CALL CalcSystemEnergyUse(CompLoadFlag, AirLoopNum,CompType,EnergyType,CompLoad,CompEnergyUse)
ENDDO
ENDDO !SubSubCompNum
ENDDO !SubCompNum
ENDDO !Index
END DO ! ZoneInNum
END DO ! Controlled Zone Loop
DO AirLoopNum = 1, NumPrimaryAirSys
SysTotHTNG(AirLoopNum) = SysFANCompHTNG(AirLoopNum) + SysHCCompHTNG(AirLoopNum) + &
SysHeatExHTNG(AirLoopNum) + SysHumidHTNG(AirLoopNum) + &
SysSolarCollectHeating(AirLoopNum) + SysUserDefinedTerminalHeating(AirLoopNum)
SysTotCLNG(AirLoopNum) = SysCCCompCLNG(AirLoopNum) + SysHeatExCLNG(AirLoopNum) + &
SysEvapCLNG(AirLoopNum) + DesDehumidCLNG(AirLoopNum) + &
SysSolarCollectCooling(AirLoopNum) + SysUserDefinedTerminalCooling(AirLoopNum)
SysTotElec(AirLoopNum) = SysFANCompElec(AirLoopNum) + SysHCCompElec(AirLoopNum) + &
SysCCCompElec(AirLoopNum) + SysHCCompElecRes(AirLoopNum) + &
SysHumidElec(AirLoopNum) + DesDehumidElec(AirLoopNum) + &
SysEvapElec(AirLoopNum)
SystotGas(AirLoopNum) = SysHCCompGas(AirLoopNum)
SysTotSteam(AirLoopNum) = SysHCCompSteam(AirLoopNum)
SysTotH2OCOLD(AirLoopNum) = SysCCCompH2OCOLD(AirLoopNum)
SysTotH2OHOT(AirLoopNum) = SysHCCompH2OHOT(AirLoopNum)
END DO
RETURN
END SUBROUTINE ReportSystemEnergyUse