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) | :: | PTUnitNum | |||
integer, | intent(in) | :: | ZoneNum | |||
real(kind=r64), | intent(in) | :: | PartLoadRatio | |||
real(kind=r64), | intent(inout) | :: | OnOffAirFlowRatio | |||
integer, | intent(in), | optional | :: | SpeedNum | ||
real(kind=r64), | intent(in), | optional | :: | SpeedRatio |
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 SetVSHPAirFlow(PTUnitNum,ZoneNum, PartLoadRatio,OnOffAirFlowRatio,SpeedNum,SpeedRatio)
! SUBROUTINE INFORMATION:
! AUTHOR Bo Shen, based on HVACMultiSpeedHeatPump:SetAverageAirFlow
! DATE WRITTEN March, 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Set the average air mass flow rates using the part load fraction of the heat pump for this time step
! Set OnOffAirFlowRatio to be used by DX coils
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEnergyDemands, ONLY: CurDeadBandOrSetback
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: PTUnitNum ! Unit index
INTEGER, INTENT (IN) :: ZoneNum ! Zone index
REAL(r64) , INTENT (IN) :: PartLoadRatio ! unit part load ratio
REAL(r64) , INTENT (INOUT) :: OnOffAirFlowRatio ! ratio of compressor ON airflow to average airflow over timestep
INTEGER, INTENT (IN),OPTIONAL :: SpeedNum ! Speed number
REAL(r64), INTENT (IN),OPTIONAL :: SpeedRatio ! Speed ratio
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVMS TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: InletNode ! inlet node number for PTUnitNum
INTEGER :: OutsideAirNode ! outside air node number in PTHP loop
INTEGER :: AirRelNode ! relief air node number in PTHP loop
REAL(r64) :: AverageUnitMassFlow = 0.0d0 ! average supply air mass flow rate over time step
REAL(r64) :: AverageOAMassFlow = 0.0d0 ! average outdoor air mass flow rate over time step
MSHPMassFlowRateLow = 0.0d0 ! Mass flow rate at low speed
MSHPMassFlowRateHigh = 0.0d0 ! Mass flow rate at high speed
InletNode = PTUnit(PTUnitNum)%AirInNode
OutsideAirNode = PTUnit(PTUnitNum)%OutsideAirNode
AirRelNode = PTUnit(PTUnitNum)%AirReliefNode
AverageOAMassFlow = (PartLoadRatio * OACompOnMassFlow) + ((1-PartLoadRatio) * OACompOffMassFlow)
IF (PTUnit(PTUnitNum)%OpMode .EQ. ContFanCycCoil) THEN
CompOffMassFlow = PTUnit(PTUnitNum)%IdleMassFlowRate
CompOffFlowRatio = PTUnit(PTUnitNum)%IdleSpeedRatio
ELSE
CompOffMassFlow = 0.0d0
CompOffFlowRatio = 0.0d0
END IF
IF (HeatingLoad .AND. (PTUnit(PTUnitNum)%UnitType_Num .EQ. PTACUnit))THEN
CompOnMassFlow = PTUnit(PTUnitNum)%CoolMassFlowRate(PTUnit(PTUnitNum)%NumOfSpeedCooling)
CompOnFlowRatio = PTUnit(PTUnitNum)%MSCoolingSpeedRatio(PTUnit(PTUnitNum)%NumOfSpeedCooling)
MSHPMassFlowRateLow = PTUnit(PTUnitNum)%CoolMassFlowRate(PTUnit(PTUnitNum)%NumOfSpeedCooling)
MSHPMassFlowRateHigh = PTUnit(PTUnitNum)%CoolMassFlowRate(PTUnit(PTUnitNum)%NumOfSpeedCooling)
AverageUnitMassFlow = (PartLoadRatio * CompOnMassFlow) + ((1-PartLoadRatio) * CompOffMassFlow)
IF(CompOffFlowRatio .GT. 0.0d0)THEN
FanSpeedRatio = (PartLoadRatio * CompOnFlowRatio) + ((1-PartLoadRatio) * CompOffFlowRatio)
ELSE
FanSpeedRatio = CompOnFlowRatio
END IF
ELSE
If (Present(SpeedNum)) Then
If (HeatingLoad) Then
If (SpeedNum .eq. 1) Then
CompOnMassFlow = PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum)
CompOnFlowRatio = PTUnit(PTUnitNum)%MSHeatingSpeedRatio(SpeedNum)
MSHPMassFlowRateLow = PTUnit(PTUnitNum)%HeatMassFlowRate(1)
MSHPMassFlowRateHigh = PTUnit(PTUnitNum)%HeatMassFlowRate(1)
Else If (SpeedNum .GT. 1) Then
CompOnMassFlow = SpeedRatio*PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum) + &
(1.0-SpeedRatio)*PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum-1)
CompOnFlowRatio = SpeedRatio*PTUnit(PTUnitNum)%MSHeatingSpeedRatio(SpeedNum) + &
(1.0-SpeedRatio)*PTUnit(PTUnitNum)%MSHeatingSpeedRatio(SpeedNum-1)
MSHPMassFlowRateLow = PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum-1)
MSHPMassFlowRateHigh = PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum)
End If
Else If (PTUnit(PTUnitNum)%HeatCoolMode == CoolingMode) Then
If (SpeedNum .eq. 1) Then
CompOnMassFlow = PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum)
CompOnFlowRatio = PTUnit(PTUnitNum)%MSCoolingSpeedRatio(SpeedNum)
MSHPMassFlowRateLow = PTUnit(PTUnitNum)%CoolMassFlowRate(1)
MSHPMassFlowRateHigh = PTUnit(PTUnitNum)%CoolMassFlowRate(1)
Else If (SpeedNum .GT. 1) Then
CompOnMassFlow = SpeedRatio*PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum) + &
(1.0-SpeedRatio)*PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum-1)
CompOnFlowRatio = SpeedRatio*PTUnit(PTUnitNum)%MSCoolingSpeedRatio(SpeedNum) + &
(1.0-SpeedRatio)*PTUnit(PTUnitNum)%MSCoolingSpeedRatio(SpeedNum-1)
MSHPMassFlowRateLow = PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum-1)
MSHPMassFlowRateHigh = PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum)
End If
End If
END IF
! Set up fan flow rate during compressor off time
If (PTUnit(PTUnitNum)%OpMode .EQ. ContFanCycCoil .AND. Present(SpeedNum)) Then
IF (PTUnit(PTUnitNum)%AirFlowControl .EQ. UseCompressorOnFlow .AND. CompOnMassFlow > 0.0d0) THEN
IF(SpeedNum == 1) THEN !LOWEST SPEED USE IDLE FLOW
CompOffMassFlow = PTUnit(PTUnitNum)%IdleMassFlowRate
CompOffFlowRatio = PTUnit(PTUnitNum)%IdleSpeedRatio
Else IF (PTUnit(PTUnitNum)%LastMode .EQ. HeatingMode) THEN
CompOffMassFlow = PTUnit(PTUnitNum)%HeatMassFlowRate(SpeedNum)
CompOffFlowRatio = PTUnit(PTUnitNum)%MSHeatingSpeedRatio(SpeedNum)
ELSE
CompOffMassFlow = PTUnit(PTUnitNum)%CoolMassFlowRate(SpeedNum)
CompOffFlowRatio = PTUnit(PTUnitNum)%MSCoolingSpeedRatio(SpeedNum)
END IF
END IF
End If
If (Present(SpeedNum)) Then
If (SpeedNum > 1) Then
AverageUnitMassFlow = CompOnMassFlow
FanSpeedRatio = CompOnFlowRatio
Else
AverageUnitMassFlow = (PartLoadRatio * CompOnMassFlow) + ((1-PartLoadRatio) * CompOffMassFlow)
IF(CompOffFlowRatio .GT. 0.0d0)THEN
FanSpeedRatio = (PartLoadRatio * CompOnFlowRatio) + ((1-PartLoadRatio) * CompOffFlowRatio)
ELSE
FanSpeedRatio = CompOnFlowRatio
END IF
End If
Else
AverageUnitMassFlow = (PartLoadRatio * CompOnMassFlow) + ((1-PartLoadRatio) * CompOffMassFlow)
IF(CompOffFlowRatio .GT. 0.0d0)THEN
FanSpeedRatio = (PartLoadRatio * CompOnFlowRatio) + ((1-PartLoadRatio) * CompOffFlowRatio)
ELSE
FanSpeedRatio = CompOnFlowRatio
END IF
End If
END IF
IF ( GetCurrentScheduleValue(PTUnit(PTUnitNum)%SchedPtr) .GT. 0.0d0 &
.AND. ((GetCurrentScheduleValue(PTUnit(PTUnitNum)%FanAvailSchedPtr) .GT. 0.0d0 .OR. &
ZoneCompTurnFansOn) .AND. .NOT. ZoneCompTurnFansOff))THEN
Node(InletNode)%MassFlowRate = AverageUnitMassFlow
Node(InletNode)%MassFlowRateMaxAvail = AverageUnitMassFlow
IF(OutsideAirNode .GT. 0)THEN
Node(OutsideAirNode)%MassFlowRate = AverageOAMassFlow
Node(OutsideAirNode)%MassFlowRateMaxAvail = AverageOAMassFlow
Node(AirRelNode)%MassFlowRate = AverageOAMassFlow
Node(AirRelNode)%MassFlowRateMaxAvail = AverageOAMassFlow
END IF
IF (AverageUnitMassFlow .GT. 0.0d0) THEN
OnOffAirFlowRatio = CompOnMassFlow / AverageUnitMassFlow
ELSE
OnOffAirFlowRatio = 0.0d0
END IF
ELSE
Node(InletNode)%MassFlowRate = 0.0d0
IF(OutsideAirNode .GT. 0)THEN
Node(OutsideAirNode)%MassFlowRate = 0.0d0
Node(AirRelNode)%MassFlowRate = 0.0d0
END IF
OnOffAirFlowRatio = 0.0d0
END IF
RETURN
END SUBROUTINE SetVSHPAirFlow