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) | :: | MSHeatPumpNum | |||
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) | :: | LoadMet | |||
real(kind=r64), | intent(in) | :: | QZnReq | |||
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 CalcMSHeatPump(MSHeatPumpNum,FirstHVACIteration,CompOp,SpeedNum,SpeedRatio,PartLoadFrac,LoadMet, &
QZnReq,OnOffAirFlowRatio,SupHeaterLoad)
! SUBROUTINE INFORMATION:
! AUTHOR: Lixing Gu, FSEC
! DATE WRITTEN: June 2007
! 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 DataEnvironment, ONLY: OutDryBulbTemp
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE DXCoils, ONLY: SimDXCoilMultiSpeed,DXCoilPartLoadRatio
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: MSHeatPumpNum ! Engine driven 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) :: LoadMet ! Load met by unit (W)
REAL(r64) , INTENT (IN) :: QZnReq ! Zone load (W)
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) :: OutsideDryBulbTemp ! Outdoor dry bulb temperature [C]
REAL(r64) :: AirMassFlow ! Air mass flow rate [kg/s]
INTEGER :: FanInletNode ! MSHP air outlet node
INTEGER :: FanOutletNode ! MSHP air inlet node
REAL(r64) :: SavePartloadRatio !
REAL(r64) :: SaveSpeedRatio
REAL(r64) :: QCoilActual ! coil load actually delivered returned to calling component
REAL(r64) :: MdotSupp ! suppleental coil hot water or steam flow rate
REAL(r64) :: MinWaterFlow ! minimum water flow rate
REAL(r64) :: ErrorToler ! supplemental heating coil convergence tollerance
! FLOW
OutletNode = MSHeatPump(MSHeatPumpNum)%AirOutletNodeNum
InletNode = MSHeatPump(MSHeatPumpNum)%AirInletNodeNum
OutsideDryBulbTemp = OutDryBulbTemp
FanOutletNode = MSHeatPump(MSHeatPumpNum)%FanOutletNode
FanInletNode = MSHeatPump(MSHeatPumpNum)%FanInletNode
SaveCompressorPLR = 0.0d0
SavePartloadRatio = 0.0d0
MinWaterFlow = 0.0d0
ErrorToler = 0.001d0
! Set inlet air mass flow rate based on PLR and compressor on/off air flow rates
CALL SetAverageAirFlow(MSHeatPumpNum, PartLoadFrac, OnOffAirFlowRatio, SpeedNum, SpeedRatio)
AirMassFlow = Node(InletNode)%MassFlowRate
! if blow through, simulate fan then coils
IF (MSHeatPump(MSHeatPumpNum)%FanPlaceType .EQ. BlowThru) THEN
CALL SimulateFanComponents(MSHeatPump(MSHeatPumpNum)%FanName,FirstHVACIteration,MSHeatPump(MSHeatPumpNum)%FanNum,FanSpeedRatio)
IF (QZnReq .LT. (-1.d0*SmallLoad)) THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor) THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
IF (MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. MultiSpeedHeatingCoil)THEN
IF (QZnReq .GT. SmallLoad) THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor)THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
ENDIF
ELSEIF(MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingElectric_MultiStage .OR. &
MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingGas_MultiStage)THEN
IF (QZnReq .GT. SmallLoad) THEN
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = PartLoadFrac, &
StageNum = SpeedNum, &
SpeedRatio = SpeedRatio)
ELSE
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = 0.0d0, &
StageNum = SpeedNum, &
SpeedRatio = 0.0d0)
ENDIF
ELSE
CALL CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,QZnReq,MSHeatPump(MSHeatPumpNum)%OpMode,QCoilActual, PartLoadFrac)
END IF
! Call twice to ensure the fan outlet conditions are updated
CALL SimulateFanComponents(MSHeatPump(MSHeatPumpNum)%FanName,FirstHVACIteration,MSHeatPump(MSHeatPumpNum)%FanNum,FanSpeedRatio)
IF (QZnReq .LT. (-1.d0*SmallLoad)) THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor) THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
IF (MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. MultiSpeedHeatingCoil)THEN
IF (QZnReq .GT. SmallLoad) THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor)THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
ELSEIF(MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingElectric_MultiStage .OR. &
MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingGas_MultiStage)THEN
IF (QZnReq .GT. SmallLoad) THEN
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = PartLoadFrac, &
StageNum = SpeedNum, &
SpeedRatio = SpeedRatio)
ELSE
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = 0.0d0, &
StageNum = SpeedNum, &
SpeedRatio = 0.0d0)
ENDIF
ELSE
CALL CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,QZnReq,MSHeatPump(MSHeatPumpNum)%OpMode,QCoilActual, PartLoadFrac)
END IF
! Simulate supplemental heating coil for blow through fan
IF(MSHeatPump(MSHeatPumpNum)%SuppHeatCoilNum .GT. 0)THEN
CALL CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,SupHeaterLoad,MSHeatPump(MSHeatPumpNum)%OpMode,QCoilActual)
ENDIF
ELSE ! otherwise simulate DX coils then fan then supplemental heater
IF(QZnReq .LT. (-1.d0*SmallLoad))THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor)THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXCoolCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXCoolCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
IF (MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. MultiSpeedHeatingCoil)THEN
IF (QZnReq .GT. SmallLoad) THEN
IF(OutsideDryBulbTemp .GT. MSHeatPump(MSHeatPumpNum)%MinOATCompressor)THEN
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,SpeedRatio,PartLoadFrac,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
SavePartloadRatio = PartLoadFrac
SaveSpeedRatio = SpeedRatio
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex)
ELSE
CALL SimDXCoilMultiSpeed(MSHeatPump(MSHeatPumpNum)%DXHeatCoilName,0.0d0,0.0d0,&
MSHeatPump(MSHeatPumpNum)%DXHeatCoilIndex,SpeedNum,MSHeatPump(MSHeatPumpNum)%OpMode,CompOp)
END IF
ELSEIF (MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingElectric_MultiStage .OR. &
MSHeatPump(MSHeatPumpNum)%HeatCoilType .EQ. Coil_HeatingGas_MultiStage)THEN
IF (QZnReq .GT. SmallLoad) THEN
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = PartLoadFrac, &
StageNum = SpeedNum, &
SpeedRatio = SpeedRatio)
ELSE
CALL SimulateHeatingCoilComponents(MSHeatPump(MSHeatPumpNum)%HeatCoilName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = MSHeatPump(MSHeatPumpNum)%OpMode, &
PartLoadRatio = 0.0d0, &
StageNum = SpeedNum, &
SpeedRatio = 0.0d0)
ENDIF
ELSE
CALL CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,QZnReq,MSHeatPump(MSHeatPumpNum)%OpMode,QCoilActual, PartLoadFrac)
END IF
CALL SimulateFanComponents(MSHeatPump(MSHeatPumpNum)%FanName,FirstHVACIteration,MSHeatPump(MSHeatPumpNum)%FanNum,FanSpeedRatio)
! Simulate supplemental heating coil for draw through fan
IF(MSHeatPump(MSHeatPumpNum)%SuppHeatCoilNum .GT. 0)THEN
CALL CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,SupHeaterLoad,MSHeatPump(MSHeatPumpNum)%OpMode,QCoilActual)
ENDIF
END IF
! calculate sensible load met using delta enthalpy at a constant (minimum) humidity ratio)
MinHumRat = Node(MSHeatPump(MSHeatPumpNum)%NodeNumofControlledZone)%HumRat
IF(Node(OutletNode)%Temp .LT. Node(MSHeatPump(MSHeatPumpNum)%NodeNumofControlledZone)%Temp ) &
MinHumRat = Node(OutletNode)%HumRat
LoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRat) &
- PsyHFnTdbW(Node(MSHeatPump(MSHeatPumpNum)%NodeNumofControlledZone)%Temp,MinHumRat))-MSHeatPump(MSHeatPumpNum)%LoadLoss
MSHeatPump(MSHeatPumpNum)%LoadMet = LoadMet
RETURN
END SUBROUTINE CalcMSHeatPump