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) | :: | UnitarySysNum | |||
integer, | intent(in) | :: | AirLoopNum |
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 ReportUnitarySystem(UnitarySysNum, AirLoopNum)
! SUBROUTINE INFORMATION:
! AUTHOR Chandan Sharma
! DATE WRITTEN July 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine updates the report variable for the coils.
! METHODOLOGY EMPLOYED:
!
! REFERENCES:
! na
! USE STATEMENTS:
USE Psychrometrics, ONLY: PsyHFnTdbW
USE DataAirLoop, ONLY: LoopSystemOnMassFlowrate,LoopSystemOffMassFlowrate,LoopFanOperationMode,LoopOnOffFanPartLoadRatio, &
LoopCompCycRatio, AirLoopFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: UnitarySysNum
INTEGER, INTENT(IN) :: AirLoopNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: OutletNode
INTEGER :: InletNode
REAL(r64) :: QSensUnitOut
REAL(r64) :: QTotUnitOut
REAL(r64) :: AirMassFlow
REAL(r64) :: MinHumRatio
REAL(r64) :: CompPartLoadFrac
REAL(r64) :: ReportingConstant
ReportingConstant = TimeStepSys*SecInHour
QTotUnitOut = 0.0d0
QSensUnitOut = 0.0d0
UnitarySystem(UnitarySysNum)%PartLoadFrac = 0.0d0
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = 0.0d0
UnitarySystem(UnitarySysNum)%CycRatio = 0.0d0
UnitarySystem(UnitarySysNum)%SpeedRatio = 0.0d0
UnitarySystem(UnitarySysNum)%FanPartLoadRatio = 0.0d0
UnitarySystem(UnitarySysNum)%TotalAuxElecPower = 0.0d0
UnitarySystem(UnitarySysNum)%HeatingAuxElecConsumption = 0.0d0
UnitarySystem(UnitarySysNum)%CoolingAuxElecConsumption = 0.0d0
UnitarySystem(UnitarySysNum)%ElecPower = 0.0d0
UnitarySystem(UnitarySysNum)%ElecPowerConsumption = 0.0d0
OutletNode = UnitarySystem(UnitarySysNum)%UnitarySystemOutletNodeNum
AirMassFlow = Node(OutletNode)%MassFlowRate
SELECT CASE(UnitarySystem(UnitarySysNum)%ControlType)
CASE(SetPointBased)
InletNode = UnitarySystem(UnitarySysNum)%UnitarySystemInletNodeNum
MinHumRatio = Node(InletNode)%HumRat
QSensUnitOut = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRatio) &
- PsyHFnTdbW(Node(InletNode)%Temp,MinHumRatio)) &
- UnitarySystem(UnitarySysNum)%SenLoadLoss
QTotUnitOut = AirMassFlow * (Node(OutletNode)%Enthalpy - &
Node(InletNode)%Enthalpy)
CASE(LoadBased)
MinHumRatio = Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%HumRat
QSensUnitOut = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRatio) &
- PsyHFnTdbW(Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%Temp,MinHumRatio)) &
- UnitarySystem(UnitarySysNum)%SenLoadLoss
QTotUnitOut = AirMassFlow * (Node(OutletNode)%Enthalpy - &
Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%Enthalpy)
CASE DEFAULT
END SELECT
! set the system part-load ratio report variable
UnitarySystem(UnitarySysNum)%PartLoadFrac = MAX(UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac, &
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac)
! set the compressor part-load ratio report variable
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE(CoilDX_HeatingEmpirical, CoilDX_MultiSpeedHeating, Coil_HeatingWaterToAirHP, &
Coil_HeatingWaterToAirHPSimple, Coil_HeatingWaterToAirHPVSEquationFit, Coil_HeatingAirToAirVariableSpeed)
! wasn't this already set in the calc routine?
! they look wrong anyway since the compressor can be off when the fan is on
! UnitarySystem(UnitarySysNum)%CompPartLoadRatio = UnitarySystem(UnitarySysNum)%PartLoadFrac
CASE DEFAULT
! UnitarySystem(UnitarySysNum)%CompPartLoadRatio = UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac
END SELECT
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = MAX(UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio, &
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio)
IF (HeatingLoad) THEN
UnitarySystem(UnitarySysNum)%TotCoolEnergyRate = 0.0d0
UnitarySystem(UnitarySysNum)%SensCoolEnergyRate = 0.0d0
UnitarySystem(UnitarySysNum)%LatCoolEnergyRate = 0.0d0
UnitarySystem(UnitarySysNum)%TotHeatEnergyRate = ABS(MAX(0.0d0, QTotUnitOut))
UnitarySystem(UnitarySysNum)%SensHeatEnergyRate = ABS(MAX(0.0d0, QSensUnitOut))
UnitarySystem(UnitarySysNum)%LatHeatEnergyRate = ABS(MAX(0.0d0, (QTotUnitOut - QSensUnitOut)))
ELSE
UnitarySystem(UnitarySysNum)%TotCoolEnergyRate = ABS(MIN(0.0d0, QTotUnitOut))
UnitarySystem(UnitarySysNum)%SensCoolEnergyRate = ABS(MIN(0.0d0, QSensUnitOut))
UnitarySystem(UnitarySysNum)%LatCoolEnergyRate = ABS(MIN(0.0d0, (QTotUnitOut - QSensUnitOut)))
UnitarySystem(UnitarySysNum)%TotHeatEnergyRate = 0.0d0
UnitarySystem(UnitarySysNum)%SensHeatEnergyRate = 0.0d0
UnitarySystem(UnitarySysNum)%LatHeatEnergyRate = 0.0d0
END IF
IF (UnitarySystem(UnitarySysNum)%FanExists) THEN
IF (CompOnMassFlow .GT. 0.0d0) THEN
UnitarySystem(UnitarySysNum)%FanPartLoadRatio = Node(OutletNode)%MassFlowRate / CompOnMassFlow
ELSE
UnitarySystem(UnitarySysNum)%FanPartLoadRatio = 0.0d0
END IF
IF(AirLoopNum .GT. 0)THEN
IF(UnitarySystem(UnitarySysNum)%FanOpMode == CycFanCycCoil)THEN
AirLoopflow(AirLoopNum)%FanPLR = UnitarySystem(UnitarySysNum)%FanPartLoadRatio
ELSE
AirLoopflow(AirLoopNum)%FanPLR = 0.0d0
END IF
END IF
END IF
SELECT CASE(UnitarySystem(UnitarySysNum)%CoolingCoilType_Num)
CASE(CoilDX_CoolingTwoSpeed)
! need to make sure these are 0 for non-variable speed coils (or not report these variables)
UnitarySystem(UnitarySysNum)%CycRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingCycRatio, &
UnitarySystem(UnitarySysNum)%HeatingCycRatio)
UnitarySystem(UnitarySysNum)%SpeedRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio)
UnitarySystem(UnitarySysNum)%SpeedNum = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedNum, &
UnitarySystem(UnitarySysNum)%HeatingSpeedNum)
CASE(CoilDX_MultiSpeedCooling)
UnitarySystem(UnitarySysNum)%CycRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingCycRatio, &
UnitarySystem(UnitarySysNum)%HeatingCycRatio)
UnitarySystem(UnitarySysNum)%SpeedRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio)
UnitarySystem(UnitarySysNum)%SpeedNum = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedNum, &
UnitarySystem(UnitarySysNum)%HeatingSpeedNum)
CompPartLoadFrac = UnitarySystem(UnitarySysNum)%CompPartLoadRatio
IF (CoolingLoad) THEN
UnitarySystem(UnitarySysNum)%TotalAuxElecPower = UnitarySystem(UnitarySysNum)%AncillaryOnPower * CompPartLoadFrac + &
UnitarySystem(UnitarySysNum)%AncillaryOffPower * (1.0d0-CompPartLoadFrac)
UnitarySystem(UnitarySysNum)%CoolingAuxElecConsumption = UnitarySystem(UnitarySysNum)%AncillaryOnPower * &
CompPartLoadFrac * ReportingConstant
END IF
IF (UnitarySystem(UnitarySysNum)%LastMode .EQ. CoolingMode) THEN
UnitarySystem(UnitarySysNum)%CoolingAuxElecConsumption = UnitarySystem(UnitarySysNum)%CoolingAuxElecConsumption + &
UnitarySystem(UnitarySysNum)%AncillaryOffPower*(1.0d0-CompPartLoadFrac)*ReportingConstant
END IF
UnitarySystem(UnitarySysNum)%ElecPower = FanElecPower + DXElecCoolingPower + DXElecHeatingPower + &
ElecHeatingCoilPower + UnitarySystem(UnitarySysNum)%TotalAuxElecPower
UnitarySystem(UnitarySysNum)%ElecPowerConsumption = UnitarySystem(UnitarySysNum)%ElecPower * ReportingConstant
CASE DEFAULT
END SELECT
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE(CoilDX_MultiSpeedHeating)
UnitarySystem(UnitarySysNum)%CycRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingCycRatio, &
UnitarySystem(UnitarySysNum)%HeatingCycRatio)
UnitarySystem(UnitarySysNum)%SpeedRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio)
CompPartLoadFrac = UnitarySystem(UnitarySysNum)%CompPartLoadRatio
IF (HeatingLoad) THEN
UnitarySystem(UnitarySysNum)%TotalAuxElecPower = UnitarySystem(UnitarySysNum)%AncillaryOnPower * CompPartLoadFrac + &
UnitarySystem(UnitarySysNum)%AncillaryOffPower * (1.0d0-CompPartLoadFrac)
UnitarySystem(UnitarySysNum)%HeatingAuxElecConsumption = UnitarySystem(UnitarySysNum)%AncillaryOnPower * &
CompPartLoadFrac * ReportingConstant
END IF
IF (UnitarySystem(UnitarySysNum)%LastMode .EQ. HeatingMode) THEN
UnitarySystem(UnitarySysNum)%HeatingAuxElecConsumption = UnitarySystem(UnitarySysNum)%HeatingAuxElecConsumption + &
UnitarySystem(UnitarySysNum)%AncillaryOffPower*(1.0d0-CompPartLoadFrac)*ReportingConstant
END IF
UnitarySystem(UnitarySysNum)%ElecPower = FanElecPower + DXElecCoolingPower + DXElecHeatingPower + &
UnitarySystem(UnitarySysNum)%TotalAuxElecPower
UnitarySystem(UnitarySysNum)%ElecPowerConsumption = UnitarySystem(UnitarySysNum)%ElecPower * ReportingConstant
CASE(Coil_HeatingGas_MultiStage, Coil_HeatingElectric_MultiStage)
UnitarySystem(UnitarySysNum)%CycRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingCycRatio, &
UnitarySystem(UnitarySysNum)%HeatingCycRatio)
UnitarySystem(UnitarySysNum)%SpeedRatio = MAX(UnitarySystem(UnitarySysNum)%CoolingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio)
UnitarySystem(UnitarySysNum)%ElecPower = FanElecPower + DXElecCoolingPower + &
ElecHeatingCoilPower + UnitarySystem(UnitarySysNum)%TotalAuxElecPower
UnitarySystem(UnitarySysNum)%ElecPowerConsumption = UnitarySystem(UnitarySysNum)%ElecPower * ReportingConstant
CASE DEFAULT
END SELECT
LoopSystemOnMassFlowrate = CompOnMassFlow
LoopSystemOffMassFlowrate = CompOffMassFlow
LoopFanOperationMode = UnitarySystem(UnitarySysNum)%FanOpMode
LoopOnOffFanPartLoadRatio = UnitarySystem(UnitarySysNum)%FanPartLoadRatio
LoopCompCycRatio = UnitarySystem(UnitarySysNum)%CycRatio
IF(CurOASysNum > 0)THEN
OASysEqSizing(CurOASysNum)%AirFlow = .FALSE.
OASysEqSizing(CurOASysNum)%Capacity = .FALSE.
ELSE IF(CurSysNum > 0)THEN
UnitarySysEqSizing(CurSysNum)%AirFlow = .FALSE.
UnitarySysEqSizing(CurSysNum)%Capacity = .FALSE.
AirLoopControlInfo(CurSysNum)%UnitarySysSimulating = .FALSE.
ELSE IF(CurZoneEqNum > 0)THEN
ZoneEqSizing(CurZoneEqNum)%AirFlow = .FALSE.
ZoneEqSizing(CurZoneEqNum)%Capacity = .FALSE.
END IF
RETURN
END SUBROUTINE ReportUnitarySystem