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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | VRFTUNum |
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 ReportVRFTerminalUnit(VRFTUNum)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN August 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine updates the report variables for the VRF Terminal Units.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DXCoils, ONLY: DXCoilTotalCooling, DXCoilTotalHeating
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: VRFTUNum ! index to VRF terminal unit
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: DXCoolingCoilIndex !- index to DX cooling coil
INTEGER :: DXHeatingCoilIndex !- index to DX heating coil
REAL(r64) :: TotalConditioning !- sum of sensible and latent rates
REAL(r64) :: SensibleConditioning !- sensible rate
REAL(r64) :: LatentConditioning !- latent rate
REAL(r64) :: ReportingConstant !- used to convert watts to joules
INTEGER :: VRFCond !- index to VRF condenser
REAL(r64) :: H2OHtOfVap !- Heat of vaporization of air (J/kg)
INTEGER :: TUListIndex !- index to terminal unit list
INTEGER :: IndexToTUInTUList !- index to the TU in the list
LOGICAL :: HRHeatRequestFlag !- indicates TU could be in heat mode
LOGICAL :: HRCoolRequestFlag !- indicates TU could be in cool mode
DXCoolingCoilIndex = VRFTU(VRFTUNum)%CoolCoilIndex
DXHeatingCoilIndex = VRFTU(VRFTUNum)%HeatCoilIndex
VRFCond = VRFTU(VRFTUNum)%VRFSysNum
TUListIndex = VRF(VRFCond)%ZoneTUListPtr
IndexToTUInTUList = VRFTU(VRFTUNum)%IndexToTUInTUList
HRHeatRequestFlag = TerminalUnitList(TUListIndex)%HRHeatRequest(IndexToTUInTUList)
HRCoolRequestFlag = TerminalUnitList(TUListIndex)%HRCoolRequest(IndexToTUInTUList)
ReportingConstant = TimeStepSys*SecInHour
! account for terminal unit parasitic On/Off power use
! account for heat recovery first since these flags will be FALSE otherwise, each TU may have different operating mode
IF(HRCoolRequestFlag)THEN
IF(VRFTU(VRFTUNum)%CoolingCoilPresent)THEN
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticElec * LoopDXCoolCoilRTF + &
VRFTU(VRFTUNum)%ParasiticOffElec * (1.d0 - LoopDXCoolCoilRTF)
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
VRFTU(VRFTUNum)%ParasiticHeatElecPower = 0.d0
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = 0.d0
ELSE
! cooling parasitic power report variable is not even available when there is no cooling coil, report for heating
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
END IF
ELSE IF(HRHeatRequestFlag)THEN
IF(VRFTU(VRFTUNum)%HeatingCoilPresent)THEN
VRFTU(VRFTUNum)%ParasiticCoolElecPower = 0.d0
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = 0.d0
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticElec * LoopDXHeatCoilRTF + &
VRFTU(VRFTUNum)%ParasiticOffElec * (1.d0 - LoopDXHeatCoilRTF)
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
ELSE
! heating parasitic power report variable is not even available when there is no heating coil, report for cooling
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
END IF
ELSE IF(CoolingLoad(VRFCond) .OR. (.NOT. HeatingLoad(VRFCond) .AND. LastModeCooling(VRFTU(VRFTUNum)%VRFSysNum)))THEN
IF(VRFTU(VRFTUNum)%CoolingCoilPresent)THEN
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticElec * LoopDXCoolCoilRTF + &
VRFTU(VRFTUNum)%ParasiticOffElec * (1.d0 - LoopDXCoolCoilRTF)
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
VRFTU(VRFTUNum)%ParasiticHeatElecPower = 0.d0
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = 0.d0
ELSE
! cooling parasitic power report variable is not even available when there is no cooling coil, report for heating
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
END IF
ELSE IF(HeatingLoad(VRFCond) .OR. (.NOT. CoolingLoad(VRFCond) .AND. LastModeHeating(VRFTU(VRFTUNum)%VRFSysNum)))THEN
IF(VRFTU(VRFTUNum)%HeatingCoilPresent)THEN
VRFTU(VRFTUNum)%ParasiticCoolElecPower = 0.d0
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = 0.d0
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticElec * LoopDXHeatCoilRTF + &
VRFTU(VRFTUNum)%ParasiticOffElec * (1.d0 - LoopDXHeatCoilRTF)
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
ELSE
! heating parasitic power report variable is not even available when there is no heating coil, report for cooling
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
END IF
ELSE
! happens when there is no cooling or heating load
IF(.NOT. VRFTU(VRFTUNum)%CoolingCoilPresent)THEN
! report all for heating
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
ELSE IF(.NOT. VRFTU(VRFTUNum)%HeatingCoilPresent)THEN
! report all for cooling
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticOffElec
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
ELSE
! split parasitic between both reporting variables
VRFTU(VRFTUNum)%ParasiticCoolElecPower = VRFTU(VRFTUNum)%ParasiticOffElec / 2.d0
VRFTU(VRFTUNum)%ParasiticElecCoolConsumption = VRFTU(VRFTUNum)%ParasiticCoolElecPower*ReportingConstant
VRFTU(VRFTUNum)%ParasiticHeatElecPower = VRFTU(VRFTUNum)%ParasiticOffElec / 2.d0
VRFTU(VRFTUNum)%ParasiticElecHeatConsumption = VRFTU(VRFTUNum)%ParasiticHeatElecPower*ReportingConstant
END IF
END IF
SensibleConditioning = VRFTU(VRFTUNum)%TerminalUnitSensibleRate
LatentConditioning = VRFTU(VRFTUNum)%TerminalUnitLatentRate
! convert latent in kg/s to watts
H2OHtOfVap = PsyHfgAirFnWTdb(Node(VRFTU(VRFTUNum)%VRFTUOutletNodeNum)%HumRat,&
Node(VRFTU(VRFTUNum)%VRFTUOutletNodeNum)%Temp,'ReportVRFTerminalUnit')
TotalConditioning = SensibleConditioning + (LatentConditioning*H2OHtOfVap)
IF(TotalConditioning .LE. 0.d0)THEN
VRFTU(VRFTUNum)%TotalCoolingRate = ABS(TotalConditioning)
VRFTU(VRFTUNum)%TotalHeatingRate = 0.d0
ELSE
VRFTU(VRFTUNum)%TotalCoolingRate = 0.d0
VRFTU(VRFTUNum)%TotalHeatingRate = TotalConditioning
END IF
IF(SensibleConditioning .LE. 0.d0)THEN
VRFTU(VRFTUNum)%SensibleCoolingRate = ABS(SensibleConditioning)
VRFTU(VRFTUNum)%SensibleHeatingRate = 0.d0
ELSE
VRFTU(VRFTUNum)%SensibleCoolingRate = 0.d0
VRFTU(VRFTUNum)%SensibleHeatingRate = SensibleConditioning
END IF
IF(LatentConditioning .LE. 0.d0)THEN
VRFTU(VRFTUNum)%LatentCoolingRate = ABS(LatentConditioning) * H2OHtOfVap
VRFTU(VRFTUNum)%LatentHeatingRate = 0.d0
ELSE
VRFTU(VRFTUNum)%LatentCoolingRate = 0.d0
VRFTU(VRFTUNum)%LatentHeatingRate = LatentConditioning * H2OHtOfVap
END IF
VRFTU(VRFTUNum)%TotalCoolingEnergy = VRFTU(VRFTUNum)%TotalCoolingRate * ReportingConstant
VRFTU(VRFTUNum)%SensibleCoolingEnergy = VRFTU(VRFTUNum)%SensibleCoolingRate * ReportingConstant
VRFTU(VRFTUNum)%LatentCoolingEnergy = VRFTU(VRFTUNum)%LatentCoolingRate * ReportingConstant
VRFTU(VRFTUNum)%TotalHeatingEnergy = VRFTU(VRFTUNum)%TotalHeatingRate * ReportingConstant
VRFTU(VRFTUNum)%SensibleHeatingEnergy = VRFTU(VRFTUNum)%SensibleHeatingRate * ReportingConstant
VRFTU(VRFTUNum)%LatentHeatingEnergy = VRFTU(VRFTUNum)%LatentHeatingRate * ReportingConstant
RETURN
END SUBROUTINE ReportVRFTerminalUnit