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) | :: | FurnaceNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | CompOp | |||
integer, | intent(in) | :: | SpeedNum | |||
real(kind=r64), | intent(in) | :: | SpeedRatio | |||
real(kind=r64), | intent(in) | :: | PartLoadFrac | |||
real(kind=r64), | intent(out) | :: | SensibleLoadMet | |||
real(kind=r64), | intent(out) | :: | LatentLoadMet | |||
real(kind=r64), | intent(in) | :: | QZnReq | |||
real(kind=r64), | intent(in) | :: | QLatReq | |||
real(kind=r64), | intent(inout) | :: | OnOffAirFlowRatio | |||
real(kind=r64), | intent(inout) | :: | SupHeaterLoad |
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 CalcVarSpeedHeatPump(FurnaceNum,FirstHVACIteration,CompOp,SpeedNum,SpeedRatio, &
PartLoadFrac,SensibleLoadMet, LatentLoadMet, &
QZnReq, QLatReq, OnOffAirFlowRatio,SupHeaterLoad)
! SUBROUTINE INFORMATION:
! AUTHOR: Bo Shen, based on HVACMultiSpeedHeatPump:CalcMSHeatPump
! DATE WRITTEN: March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine will calcultes MSHP performance based on given system load
! METHODOLOGY EMPLOYED:
! na
! REFERENCES: na
! USE STATEMENTS:
USE Fans, ONLY: SimulateFanComponents
USE VariableSpeedCoils, ONLY: SimVariableSpeedCoils, VarSpeedCoil
USE DataEnvironment, ONLY: OutDryBulbTemp
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: FurnaceNum ! Variable speed heat pump number
LOGICAL, INTENT (IN) :: FirstHVACIteration ! Flag for 1st HVAC iteration
INTEGER, INTENT (IN) :: SpeedNum ! Speed number
REAL(r64) , INTENT (IN) :: SpeedRatio ! Compressor speed ratio
REAL(r64) , INTENT (IN) :: PartLoadFrac ! Compressor part load fraction
REAL(r64), Intent(OUT) :: SensibleLoadMet ! Sensible cooling load met (furnace outlet with respect to control zone temp)
REAL(r64), Intent(OUT) :: LatentLoadMet ! Latent cooling load met (furnace outlet with respect to control zone humidity ratio)
REAL(r64) , INTENT (IN) :: QZnReq ! Zone load (W)
REAL(r64) , INTENT (IN) :: QLatReq ! Zone latent load []
REAL(r64) , INTENT (INOUT) :: OnOffAirFlowRatio ! Ratio of compressor ON airflow to AVERAGE airflow over timestep
REAL(r64) , INTENT (INOUT) :: SupHeaterLoad ! supplemental heater load (W)
INTEGER, INTENT(IN) :: CompOp ! Compressor on/off; 1=on, 0=off
! SUBROUTINE PARAMETER DEFINITIONS:
! INTEGER, PARAMETER :: On = 1 ! Compressor on flag
! INTEGER, PARAMETER :: Off = 2 ! Compressor off flag
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVMS TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: OutletNode ! MSHP air outlet node
INTEGER :: InletNode ! MSHP air inlet node
REAL(r64) :: MinHumRat ! Minimum humidity ratio for sensible capacity calculation (kg/kg)
REAL(r64) :: AirMassFlow ! Air mass flow rate [kg/s]
REAL(r64) :: SavePartloadRatio !part-load ratio
REAL(r64) :: SaveSpeedRatio !speed ratio
REAL(r64) :: QCoilActual ! coil load actually delivered returned to calling component
REAL(r64) :: ErrorToler ! supplemental heating coil convergence tollerance
Logical :: SuppHeatingCoilFlag !whether to turn on the supplemental heater
REAL(r64) :: MaxTemp ! Maximum temperature for calculating latent load at a constant temperature
REAL(r64) ::HeatCoilLoad ! REQUIRED HEAT COIL LOAD
! FLOW
InletNode = Furnace(FurnaceNum)%FurnaceInletNodeNum
OutletNode = Furnace(FurnaceNum)%FurnaceOutletNodeNum
HeatCoilLoad = 0.0d0
SaveCompressorPLR = 0.0d0
SavePartloadRatio = 0.0d0
ErrorToler = 0.001d0
! Set inlet air mass flow rate based on PLR and compressor on/off air flow rates
CALL SetVSHPAirFlow(FurnaceNum,PartLoadFrac,OnOffAirFlowRatio,SpeedNum,SpeedRatio)
IF ((SupHeaterLoad .GT. 1.0d-10) .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool) .AND. &
(Furnace(FurnaceNum)%SuppHeatCoilIndex .EQ. 0))THEN
! ONLY HEATING COIL, NO SUPPLEMENTAL COIL, USED FOR REHEAT DURING DUHMI
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * PartLoadFrac !REHEAT IN FAN ON TIME
IF( HeatCoilLoad > SupHeaterLoad) HeatCoilLoad = SupHeaterLoad !HEATING COIL RUN TIME < FAN ON TIME
ELSE IF ((QZnReq .GT. SmallLoad) .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
HeatCoilLoad = Furnace(FurnaceNum)%DesignHeatingCapacity * PartLoadFrac
ELSE
HeatCoilLoad = 0.0d0
END IF
AirMassFlow = Node(InletNode)%MassFlowRate
! if blow through, simulate fan then coils
IF (Furnace(FurnaceNum)%FanPlace .EQ. BlowThru) THEN
CALL SimulateFanComponents(Blank,FirstHVACIteration,Furnace(FurnaceNum)%FanIndex,FanSpeedRatio)
IF((.NOT. Furnace(FurnaceNum)%CoolingCoilUpstream) .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
IF (((QZnReq .LT. (-1.d0*SmallLoad)) .AND. (OutDryBulbTemp .GT. Furnace(FurnaceNum)%MinOATCompressor)) &
.OR. (QLatReq < (-1.d0*SmallLoad))) THEN !COOLING MODE or dehumidification mode
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%CoolingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
IF(Furnace(FurnaceNum)%FurnaceType_Num /= UnitarySys_HeatCool) THEN
IF (QZnReq .GT. SmallLoad)THEN
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%HeatingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
ELSE IF( Furnace(FurnaceNum)%CoolingCoilUpstream .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
! Call twice to ensure the fan outlet conditions are updated
CALL SimulateFanComponents(Blank,FirstHVACIteration,Furnace(FurnaceNum)%FanIndex,FanSpeedRatio)
IF((.NOT. Furnace(FurnaceNum)%CoolingCoilUpstream) .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
IF (((QZnReq .LT. (-1.d0*SmallLoad)) .AND. (OutDryBulbTemp .GT. Furnace(FurnaceNum)%MinOATCompressor)) &
.OR. (QLatReq < (-1.d0*SmallLoad))) THEN
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%CoolingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
IF(Furnace(FurnaceNum)%FurnaceType_Num /= UnitarySys_HeatCool) THEN
IF (QZnReq .GT. SmallLoad)THEN
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%HeatingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
ELSE IF( Furnace(FurnaceNum)%CoolingCoilUpstream .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
! Simulate supplemental heating coil for blow through fan
IF(Furnace(FurnaceNum)%SuppHeatCoilIndex .GT. 0)THEN
SuppHeatingCoilFlag = .TRUE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,SupHeaterLoad, &
Furnace(FurnaceNum)%OpMode,QCoilActual)
ENDIF
ELSE ! otherwise simulate DX coils then fan then supplemental heater
IF((.NOT. Furnace(FurnaceNum)%CoolingCoilUpstream) .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
IF(((QZnReq .LT. (-1.d0*SmallLoad)) .AND. (OutDryBulbTemp .GT. Furnace(FurnaceNum)%MinOATCompressor)) &
.OR. (QLatReq < (-1.d0*SmallLoad)))THEN
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%CoolingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%CoolingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
IF(Furnace(FurnaceNum)%FurnaceType_Num /= UnitarySys_HeatCool) THEN
IF(QZnReq .GT. SmallLoad)THEN
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, PartLoadFrac, OnOffAirFlowRatio,SpeedNum, SpeedRatio,QZnReq, QLatReq )
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum)%HeatingCoilIndex)%PartLoadRatio
ELSE
Call SimVariableSpeedCoils(Blank,Furnace(FurnaceNum)%HeatingCoilIndex,&
Furnace(FurnaceNum)%OpMode,Furnace(FurnaceNum)%MaxONOFFCyclesperHour, &
Furnace(FurnaceNum)%HPTimeConstant,Furnace(FurnaceNum)%FanDelayTime,&
CompOp, 0.0d0, OnOffAirFlowRatio,1, 0.0d0,0.0d0, 0.0d0 )
END IF
ELSE IF( Furnace(FurnaceNum)%CoolingCoilUpstream .AND. &
(Furnace(FurnaceNum)%FurnaceType_Num == UnitarySys_HeatCool))THEN
! simulate furnace heating coil
SuppHeatingCoilFlag = .FALSE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,HeatCoilLoad,&
Furnace(FurnaceNum)%OpMode,QCoilActual)
END IF
CALL SimulateFanComponents(Blank,FirstHVACIteration,Furnace(FurnaceNum)%FanIndex,FanSpeedRatio)
! Simulate supplemental heating coil for draw through fan
IF(Furnace(FurnaceNum)%SuppHeatCoilIndex .GT. 0)THEN
SuppHeatingCoilFlag = .TRUE. ! if true simulates supplemental heating coil
CALL CalcNonDXHeatingCoils(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,SupHeaterLoad, &
Furnace(FurnaceNum)%OpMode,QCoilActual)
ENDIF
END IF
! If the fan runs continually do not allow coils to set OnOffFanPartLoadRatio.
IF (Furnace(FurnaceNum)%OpMode.EQ.ContFanCycCoil)OnOffFanPartLoadFraction = 1.0d0
! Check delta T (outlet to space), if positive
! use space HumRat (next line), else outlet humrat (IF) so psyc routine gives good result
MinHumRat = Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%HumRat
IF(Node(OutletNode)%Temp .LT. Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%Temp ) &
MinHumRat = Node(OutletNode)%HumRat
! Calculate sensible load met (at constant humidity ratio)
SensibleLoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRat) &
- PsyHFnTdbW(Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%Temp,MinHumRat)) &
- Furnace(FurnaceNum)%SenLoadLoss
Furnace(FurnaceNum)%SensibleLoadMet = SensibleLoadMet
IF(Furnace(FurnaceNum)%Humidistat)THEN
MaxTemp = Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%Temp
! modified, why does switching between furnace outlet and control zone temp
! cause latent load to change when latent capacity is 0 ?
! IF(Node(FurnaceOutletNode)%Temp .GT. Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%Temp ) &
! MaxTemp = Node(FurnaceOutletNode)%Temp
! Calculate latent load met (at constant temperature)
LatentLoadMet = AirMassFlow * (PsyHFnTdbW(MaxTemp,Node(OutletNode)%HumRat) &
- PsyHFnTdbW(MaxTemp,Node(Furnace(FurnaceNum)%NodeNumofControlledZone)%HumRat)) &
- Furnace(FurnaceNum)%LatLoadLoss
ELSE
LatentLoadMet = 0.0d0
END IF
Furnace(FurnaceNum)%LatentLoadMet = LatentLoadMet
RETURN
END SUBROUTINE CalcVarSpeedHeatPump