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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | CompLoadFlag | |||
integer, | intent(in) | :: | AirLoopNum | |||
character(len=*), | intent(in) | :: | CompType | |||
integer, | intent(in) | :: | EnergyType | |||
real(kind=r64), | intent(in) | :: | CompLoad | |||
real(kind=r64), | intent(in) | :: | CompEnergy |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CalcSystemEnergyUse(CompLoadFlag,AirLoopNum,CompType,EnergyType,CompLoad,CompEnergy)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN Nov. 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! accumulate system loads and energy to report variables
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
USE Psychrometrics, ONLY: PsyHFnTdbW
USE DataZoneEnergyDemands
USE DataGlobalConstants
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: CompType
INTEGER, INTENT(IN) :: AirLoopNum
INTEGER, INTENT(IN) :: EnergyType
REAL(r64), INTENT(IN) :: CompLoad
REAL(r64), INTENT(IN) :: CompEnergy
LOGICAL, INTENT(IN) :: CompLoadFlag
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: SmallLoad = 0.1d0 !(W)
REAL(r64), PARAMETER :: KJperJ = 0.001d0 !kilojoules per joules
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
TYPE CompTypeError
CHARACTER(len=MaxNameLength) :: CompType=' '
INTEGER :: CompErrIndex
END TYPE
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER,SAVE :: NumCompTypes=0
TYPE (CompTypeError), ALLOCATABLE, SAVE, DIMENSION(:) :: CompTypeErrors
LOGICAL, SAVE :: firsttime=.true.
INTEGER :: Found
IF (.not. AirLoopLoadsReportEnabled) RETURN
! following for debug
! CHARACTER(len=60) :: cEnergyType
! cEnergyType=cRT_ValidTypes(EnergyType-ResourceTypeInitialOffset)
IF (firsttime) THEN
ALLOCATE(CompTypeErrors(100))
firsttime=.false.
ENDIF
SELECT CASE(CompType)
! Outside Air System
CASE('AIRLOOPHVAC:OUTDOORAIRSYSTEM')
IF (CompLoadFlag) THEN
IF(CompLoad > 0.0d0)THEN
SysOALoadCLNG(AirLoopNum) = SysOALoadCLNG(AirLoopNum) + ABS(CompLoad)
ELSE
SysOALoadHTNG(AirLoopNum) = SysOALoadHTNG(AirLoopNum) + ABS(CompLoad)
ENDIF
ENDIF
! Outdoor Air Mixer
CASE('OUTDOORAIR:MIXER')
CONTINUE !No energy transfers to account for
CASE('AIRTERMINAL:SINGLEDUCT:INLETSIDEMIXER')
CONTINUE !No energy transfers to account for
CASE('AIRTERMINAL:SINGLEDUCT:SUPPLYSIDEMIXER')
CONTINUE !No energy transfers to account for
! Fan Types for the air sys simulation
CASE('FAN:CONSTANTVOLUME', &
'FAN:VARIABLEVOLUME', &
'FAN:ONOFF','FAN:COMPONENTMODEL') !cpw22Aug2010 Add 'FAN:COMPONENTMODEL')
IF(CompLoadFlag)SysFANCompHTNG(AirLoopNum) = SysFANCompHTNG(AirLoopNum) + ABS(CompLoad)
SysFANCompElec(AirLoopNum) = SysFANCompElec(AirLoopNum) + CompEnergy
! Cooling Coil Types for the air sys simulation
CASE('COILSYSTEM:COOLING:DX:HEATEXCHANGERASSISTED', &
'COIL:COOLING:DX:SINGLESPEED', &
'COIL:COOLING:DX:TWOSPEED', &
'COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE', &
'COIL:COOLING:DX:MULTISPEED', &
'COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT', &
'COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION', &
'COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT', &
'COIL:COOLING:DX:VARIABLESPEED', &
'COILSYSTEM:COOLING:WATER:HEATEXCHANGERASSISTED', &
'COIL:COOLING:WATER:DETAILEDGEOMETRY', &
'COIL:COOLING:WATER', &
'COIL:COOLING:DX:SINGLESPEED:THERMALSTORAGE')
IF(CompLoadFlag)SysCCCompCLNG(AirLoopNum) = SysCCCompCLNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_PlantLoopCoolingDemand, iRT_DistrictCooling)
SysCCCompH2OCOLD(AirLoopNum) = SysCCCompH2OCOLD(AirLoopNum) + CompEnergy
CASE (iRT_Electricity)
SysCCCompElec(AirLoopNum) = SysCCCompElec(AirLoopNum) + CompEnergy
END SELECT
! Heating Coil Types for the air sys simulation
CASE('COIL:HEATING:WATER', &
'COIL:HEATING:DX:SINGLESPEED', &
'COIL:HEATING:DX:MULTISPEED', &
'COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT', &
'COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION', &
'COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT', &
'COIL:HEATING:DX:VARIABLESPEED', &
'COIL:HEATING:STEAM', &
'COIL:HEATING:GAS', &
'COIL:HEATING:GAS:MULTISTAGE', &
'COIL:HEATING:DESUPERHEATER')
IF(CompLoadFlag)SysHCCompHTNG(AirLoopNum) = SysHCCompHTNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_PlantLoopHeatingDemand, iRT_DistrictHeating)
SysHCCompH2OHOT(AirLoopNum) = SysHCCompH2OHOT(AirLoopNum) + CompEnergy
CASE (iRT_Steam)
SysHCCompSteam(AirLoopNum) = SysHCCompSteam(AirLoopNum) + CompEnergy
CASE (iRT_Electricity)
SysHCCompElec(AirLoopNum) = SysHCCompElec(AirLoopNum) + CompEnergy
CASE (iRT_Natural_Gas, iRT_Propane)
SysHCCompGas(AirLoopNum) = SysHCCompGas(AirLoopNum) + CompEnergy
END SELECT
CASE('COIL:HEATING:ELECTRIC', &
'COIL:HEATING:ELECTRIC:MULTISTAGE')
IF(CompLoadFlag)SysHCCompHTNG(AirLoopNum) = SysHCCompHTNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_Electricity)
SysHCCompElecRes(AirLoopNum) = SysHCCompElecRes(AirLoopNum) + CompEnergy
CASE DEFAULT
END SELECT
CASE ('COIL:USERDEFINED')
IF(CompLoadFlag) THEN
IF (CompLoad > 0.d0) THEN
SysCCCompCLNG(AirLoopNum) = SysCCCompCLNG(AirLoopNum) + ABS(CompLoad)
ELSE
SysHCCompHTNG(AirLoopNum) = SysHCCompHTNG(AirLoopNum) + ABS(CompLoad)
ENDIF
ENDIF
SELECT CASE(EnergyType)
CASE (iRT_PlantLoopHeatingDemand, iRT_DistrictHeating)
SysHCCompH2OHOT(AirLoopNum) = SysHCCompH2OHOT(AirLoopNum) + CompEnergy
CASE (iRT_PlantLoopCoolingDemand, iRT_DistrictCooling)
SysCCCompH2OCOLD(AirLoopNum) = SysCCCompH2OCOLD(AirLoopNum) + CompEnergy
CASE (iRT_Steam)
SysHCCompSteam(AirLoopNum) = SysHCCompSteam(AirLoopNum) + CompEnergy
CASE (iRT_Electricity)
IF (CompLoad > 0.d0) THEN
SysCCCompElec(AirLoopNum) = SysCCCompElec(AirLoopNum) + CompEnergy
ELSE
SysHCCompElec(AirLoopNum) = SysHCCompElec(AirLoopNum) + CompEnergy
ENDIF
CASE (iRT_Natural_Gas, iRT_Propane)
SysHCCompGas(AirLoopNum) = SysHCCompGas(AirLoopNum) + CompEnergy
END SELECT
!DX Systems
CASE('AIRLOOPHVAC:UNITARYSYSTEM')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATPUMP:AIRTOAIR')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATPUMP:WATERTOAIR')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('COILSYSTEM:COOLING:DX')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('COILSYSTEM:HEATING:DX')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARY:FURNACE:HEATONLY')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARY:FURNACE:HEATCOOL')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATONLY')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATCOOL')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATCOOL:VAVCHANGEOVERBYPASS')
CONTINUE !All energy transfers accounted for in subcomponent models
CASE('AIRLOOPHVAC:UNITARYHEATPUMP:AIRTOAIR:MULTISPEED')
CONTINUE !All energy transfers accounted for in subcomponent models
! Humidifier Types for the air system simulation
CASE('HUMIDIFIER:STEAM:ELECTRIC')
IF(CompLoadFlag)SysHumidHTNG(AirLoopNum) = SysHumidHTNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_Water)
SysDomesticH20(AirLoopNum) = SysDomesticH20(AirLoopNum) + ABS(CompEnergy)
CASE (iRT_Electricity)
SysHumidElec(AirLoopNum) = SysHumidElec(AirLoopNum) + CompEnergy
END SELECT
! Evap Cooler Types for the air system simulation
CASE('EVAPORATIVECOOLER:DIRECT:CELDEKPAD', &
'EVAPORATIVECOOLER:INDIRECT:CELDEKPAD', &
'EVAPORATIVECOOLER:INDIRECT:WETCOIL', &
'EVAPORATIVECOOLER:DIRECT:RESEARCHSPECIAL', &
'EVAPORATIVECOOLER:INDIRECT:RESEARCHSPECIAL')
IF(CompLoadFlag)SysEvapCLNG(AirLoopNum) = SysEvapCLNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_Water)
SysDomesticH20(AirLoopNum) = SysDomesticH20(AirLoopNum) + ABS(CompEnergy)
CASE (iRT_Electricity)
SysEvapElec(AirLoopNum) = SysEvapElec(AirLoopNum) + CompEnergy
END SELECT
! Desiccant Dehumidifier Types for the air system simulation
CASE('DEHUMIDIFIER:DESICCANT:NOFANS', &
'DEHUMIDIFIER:DESICCANT:SYSTEM')
IF(CompLoadFlag)DesDehumidCLNG(AirLoopNum) = DesDehumidCLNG(AirLoopNum) + ABS(CompLoad)
SELECT CASE(EnergyType)
CASE (iRT_Electricity)
DesDehumidElec(AirLoopNum) = DesDehumidElec(AirLoopNum) + CompEnergy
END SELECT
! Heat Exchanger Types
CASE('HEATEXCHANGER:AIRTOAIR:FLATPLATE', &
'HEATEXCHANGER:AIRTOAIR:SENSIBLEANDLATENT', &
'HEATEXCHANGER:DESICCANT:BALANCEDFLOW')
IF (CompLoadFlag) THEN
IF(CompLoad > 0.0d0 )THEN
SysHeatExCLNG(AirLoopNum) = SysHeatExCLNG(AirLoopNum) + ABS(CompLoad)
ELSE
SysHeatExHTNG(AirLoopNum) = SysHeatExHTNG(AirLoopNum) + ABS(CompLoad)
ENDIF
ENDIF
! Air Terminal Types
CASE('AIRTERMINAL:DUALDUCT:CONSTANTVOLUME:COOL', &
'AIRTERMINAL:DUALDUCT:CONSTANTVOLUME:HEAT', &
'AIRTERMINAL:DUALDUCT:VAV:COOL', &
'AIRTERMINAL:DUALDUCT:VAV:HEAT', &
'AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR:OUTDOORAIR', &
'AIRTERMINAL:DUALDUCT:VAV:OUTDOORAIR:RECIRCULATEDAIR', &
'AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:FOURPIPEINDUCTION', &
'AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:REHEAT', &
'AIRTERMINAL:SINGLEDUCT:PARALLELPIU:REHEAT', &
'AIRTERMINAL:SINGLEDUCT:SERIESPIU:REHEAT', &
'AIRTERMINAL:SINGLEDUCT:UNCONTROLLED', &
'AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:NOREHEAT', &
'AIRTERMINAL:SINGLEDUCT:VAV:HEATANDCOOL:REHEAT', &
'AIRTERMINAL:SINGLEDUCT:VAV:NOREHEAT', &
'AIRTERMINAL:SINGLEDUCT:VAV:REHEAT', &
'AIRTERMINAL:SINGLEDUCT:VAV:REHEAT:VARIABLESPEEDFAN', &
'AIRTERMINAL:SINGLEDUCT:CONSTANTVOLUME:COOLEDBEAM', &
'ZONEHVAC:AIRDISTRIBUTIONUNIT')
CONTINUE !All energy transfers accounted for in component models
! Duct Types
CASE('DUCT')
CONTINUE ! duct losses should be accounted for here ???
! requires addition of a new variable to sum duct losses
! Example:
! IF(CompLoad > 0.0d0)THEN
! SysDuctHTNG(AirLoopNum) = SysDuctHTNG(AirLoopNum) + ABS(CompLoad)
! ELSE
! SysDuctCLNG(AirLoopNum) = SysDuctCLNG(AirLoopNum) + ABS(CompLoad)
! ENDIF
! Solar Collector Types
CASE('SOLARCOLLECTOR:FLATPLATE:PHOTOVOLTAICTHERMAL', &
'SOLARCOLLECTOR:UNGLAZEDTRANSPIRED')
IF (CompLoadFlag) THEN
IF(CompLoad > 0.0d0 ) THEN
SysSolarCollectCooling(AirLoopNum) = SysSolarCollectCooling(AirLoopNum) + ABS(CompLoad)
ELSE
SysSolarCollectHeating(AirLoopNum) = SysSolarCollectHeating(AirLoopNum) + ABS(CompLoad)
ENDIF
ENDIF
CASE('AIRTERMINAL:SINGLEDUCT:USERDEFINED')
! User component model energy use should be accounted for here
IF (CompLoadFlag) THEN
IF(CompLoad > 0.0d0 )THEN
SysUserDefinedTerminalCooling(AirLoopNum) = SysUserDefinedTerminalCooling(AirLoopNum) + ABS(CompLoad)
ELSE
SysUserDefinedTerminalHeating(AirLoopNum) = SysUserDefinedTerminalHeating(AirLoopNum) + ABS(CompLoad)
ENDIF
ENDIF
SELECT CASE(EnergyType)
CASE (iRT_PlantLoopHeatingDemand, iRT_DistrictHeating)
SysHCCompH2OHOT(AirLoopNum) = SysHCCompH2OHOT(AirLoopNum) + CompEnergy
CASE (iRT_PlantLoopCoolingDemand, iRT_DistrictCooling)
SysCCCompH2OCOLD(AirLoopNum) = SysCCCompH2OCOLD(AirLoopNum) + CompEnergy
CASE (iRT_Steam)
SysHCCompSteam(AirLoopNum) = SysHCCompSteam(AirLoopNum) + CompEnergy
CASE (iRT_Electricity)
IF (CompLoad > 0.d0) THEN
SysCCCompElec(AirLoopNum) = SysCCCompElec(AirLoopNum) + CompEnergy
ELSE
SysHCCompElec(AirLoopNum) = SysHCCompElec(AirLoopNum) + CompEnergy
ENDIF
CASE (iRT_Natural_Gas, iRT_Propane)
SysHCCompGas(AirLoopNum) = SysHCCompGas(AirLoopNum) + CompEnergy
END SELECT
! Recurring warning for unaccounted equipment types
! (should never happen, when this does happen enter appropriate equipment CASE statement above)
CASE DEFAULT
Found=0
IF (NumCompTypes > 0) THEN
Found=FindItemInList(CompType,CompTypeErrors%CompType,NumCompTypes)
ENDIF
IF (Found == 0) THEN
NumCompTypes=NumCompTypes+1
CompTypeErrors(NumCompTypes)%CompType=CompType
Found=NumCompTypes
ENDIF
CALL ShowRecurringSevereErrorAtEnd('CalcSystemEnergyUse: Component Type='//trim(CompType)// &
' not logged as one of allowable Component Types.',CompTypeErrors(Found)%CompErrIndex)
END SELECT
RETURN
END SUBROUTINE CalcSystemEnergyUse