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 | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
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 | |||
logical, | intent(in) | :: | HXUnitOn |
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 CalcPTUnit(PTUnitNum,FirstHVACIteration,PartLoadFrac,LoadMet,QZnReq,OnOffAirFlowRatio,SupHeaterLoad, HXUnitOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN July 2005
! MODIFIED B. Nigusse, Jan 2012, added hot water and steam heating coils to PTHP and WSHP
! Chandan Sharma, July 2012 : Added zone sys avail managers
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate the components making up the packaged terminal heat pump.
! METHODOLOGY EMPLOYED:
! Simulates the unit components sequentially in the air flow direction.
! REFERENCES:
! na
! USE STATEMENTS:
USE Fans, ONLY: SimulateFanComponents
USE DXCoils, ONLY: SimDXCoil
USE MixedAir, ONLY: SimOAMixer
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE SteamCoils, ONLY: SimulateSteamCoilComponents
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE InputProcessor, ONLY: SameString
USE HVACHXAssistedCoolingCoil, ONLY: SimHXAssistedCoolingCoil
USE Psychrometrics, ONLY: PsyHFnTdbW, PsyCpAirFnWTdb
USE DataEnvironment, ONLY: OutDryBulbTemp
USE WatertoAirheatPumpSimple, ONLY: SimWatertoAirHPSimple
USE PlantUtilities, ONLY: SetComponentFlowRate
USE General, ONLY: SolveRegulaFalsi, RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: PTUnitNum ! Unit index in fan coil array
LOGICAL, INTENT (IN) :: FirstHVACIteration ! flag for 1st HVAC iteration in the time step
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) unused1208
REAL(r64), INTENT (INOUT) :: OnOffAirFlowRatio ! ratio of compressor ON airflow to AVERAGE airflow over timestep
REAL(r64), INTENT (INOUT) :: SupHeaterLoad ! supplemental heater load (W)
LOGICAL, INTENT (IN) :: HXUnitOn ! flag to enable heat exchanger
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIte = 500 ! maximum number of iterations
CHARACTER(len=*), PARAMETER :: Blank = ' ' ! subroutine argument when coil index is known
REAL(r64), PARAMETER :: ErrTolerance = 0.001d0 ! convergence limit for hotwater coil
INTEGER, PARAMETER :: SolveMaxIter=50
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: OutletNode ! PTHP air outlet node
INTEGER :: InletNode ! PTHP air inlet node
REAL(r64):: AirMassFlow ! total supply air mass flow through the PTHP [m3/s]
REAL(r64):: MinHumRat ! minimum humidity ratio for sensible capacity calculation (kg/kg)
REAL(r64):: OutsideDryBulbTemp ! Outdoor air temperature at external node height
REAL(r64):: QCoilReq ! load passed to heating coil (W)
REAL(r64):: QActual ! actual heating coil output (W)
INTEGER :: OpMode ! fan operating mode, CycFanCycCoil or ContFanCycCoil
LOGICAL :: errflag ! subroutine error flag
REAL(r64):: WSHPRuntimeFrac ! RTF variable for WSHP's
REAL(r64) :: mdot !local temporary for mass flow rate
REAL(r64) :: MinWaterFlow ! minimum water mass flow rate
REAL(r64) :: PartLoadFraction ! heating or cooling part load fraction
REAL(r64) :: MaxHotWaterFlow ! coil maximum hot water mass flow rate, kg/s
REAL(r64) :: HotWaterMdot ! actual hot water mass flow rate
REAL(r64), DIMENSION(3) :: Par
INTEGER :: SolFlag
REAL(r64) :: MinFlow ! minimum fluid flow rate, kg/s
INTEGER :: ControlCompTypeNum ! temporary component index number
! FLOW
OutletNode = PTUnit(PTUnitNum)%AirOutNode
InletNode = PTUnit(PTUnitNum)%AirInNode
OpMode = PTUnit(PTUnitNum)%OpMode
IF(PTUnit(PTUnitNum)%CondenserNodeNum .EQ. 0)THEN
OutsideDryBulbTemp = OutDryBulbTemp
ELSE
OutsideDryBulbTemp = Node(PTUnit(PTUnitNum)%CondenserNodeNum)%Temp
END IF
SaveCompressorPLR = 0.0d0
! Set inlet air mass flow rate based on PLR and compressor on/off air flow rates
CALL SetAverageAirFlow(PTUnitNum, PartLoadFrac, OnOffAirFlowRatio)
AirMassFlow = Node(InletNode)%MassFlowRate
IF(PTUnit(PTUnitNum)%OutsideAirNode .GT. 0)&
CALL SimOAMixer(PTUnit(PTUnitNum)%OAMixName,FirstHVACIteration,PTUnit(PTUnitNum)%OAMixIndex)
! if blow through, simulate fan then coils
IF (PTUnit(PTUnitNum)%FanPlace .EQ. BlowThru) THEN
CALL SimulateFanComponents(PTUnit(PTUnitNum)%FanName,FirstHVACIteration,PTUnit(PTUnitNum)%FanIndex,FanSpeedRatio,&
ZoneCompTurnFansOn,ZoneCompTurnFansOff)
END IF
IF (CoolingLoad .AND. OutsideDryBulbTemp .GT. PTUnit(PTUnitNum)%MinOATCompressor)THEN
SELECT CASE(PTUnit(PTUnitNum)%UnitType_Num)
CASE(PTACUnit, PTHPUnit)
IF (PTUnit(PTUnitNum)%DXCoolCoilType_Num == CoilDX_CoolingHXAssisted) THEN
CALL SimHXAssistedCoolingCoil(PTUnit(PTUnitNum)%DXCoolCoilName,FirstHVACIteration,On,PartLoadFrac,&
PTUnit(PTUnitNum)%CoolCoilCompIndex, PTUnit(PTUnitNum)%OpMode, &
HXUnitEnable=HXUnitOn)
ELSE
CALL SimDXCoil(PTUnit(PTUnitNum)%DXCoolCoilName,On,FirstHVACIteration,PartLoadFrac,PTUnit(PTUnitNum)%CoolCoilCompIndex, &
PTUnit(PTUnitNum)%OpMode,OnOffAirFlowRatio)
END IF
SaveCompressorPLR = DXCoilPartLoadRatio(PTUnit(PTUnitNum)%DXCoolCoilIndexNum)
CASE(PTWSHPUnit)
CALL HeatPumpRunFrac(PTUnitNum,PartLoadFrac,errflag,WSHPRuntimeFrac)
CALL SimWatertoAirHPSimple(Blank, &
PTUnit(PTUnitNum)%DXCoolCoilIndexNum, &
QZnReq, 1.0d0, &
OpMode,WSHPRuntimeFrac, PTUnit(PTUnitNum)%MaxONOFFCyclesperHour, &
PTUnit(PTUnitNum)%HPTimeConstant, PTUnit(PTUnitNum)%FanDelayTime, 1, PartLoadFrac, FirstHVACIteration, &
OnOffAirFlowRat=OnOffAirFlowRatio)
SaveCompressorPLR = PartLoadFrac
CASE DEFAULT
END SELECT
ELSE ! cooling coil is off
SELECT CASE(PTUnit(PTUnitNum)%UnitType_Num)
CASE(PTACUnit, PTHPUnit)
IF (PTUnit(PTUnitNum)%DXCoolCoilType_Num == CoilDX_CoolingHXAssisted) THEN
CALL SimHXAssistedCoolingCoil(PTUnit(PTUnitNum)%DXCoolCoilName,FirstHVACIteration,Off,0.0d0, &
PTUnit(PTUnitNum)%CoolCoilCompIndex, PTUnit(PTUnitNum)%OpMode, &
HXUnitEnable=HXUnitOn)
ELSE
CALL SimDXCoil(PTUnit(PTUnitNum)%DXCoolCoilName,Off,FirstHVACIteration,0.0d0, &
PTUnit(PTUnitNum)%CoolCoilCompIndex,PTUnit(PTUnitNum)%OpMode,OnOffAirFlowRatio)
END IF
CASE(PTWSHPUnit)
CALL SimWatertoAirHPSimple(Blank, &
PTUnit(PTUnitNum)%DXCoolCoilIndexNum, &
0.0d0, 0.0d0, &
OpMode,0.0d0, PTUnit(PTUnitNum)%MaxONOFFCyclesperHour, &
PTUnit(PTUnitNum)%HPTimeConstant, PTUnit(PTUnitNum)%FanDelayTime, 0, 0.0d0, FirstHVACIteration )
CASE DEFAULT
END SELECT
END IF
IF (HeatingLoad)THEN
IF(PTUnit(PTUnitNum)%UnitType_Num .EQ. PTACUnit)THEN
QCoilReq = PTUnit(PTUnitNum)%ACHeatCoilCap * PartLoadFrac
IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingGas .OR. &
PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingElectric)THEN
CALL SimulateHeatingCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName,FirstHVACIteration,QCoilReq, &
PTUnit(PTUnitNum)%ACHeatCoilIndex, QActual, .FALSE., OpMode, PartLoadFrac)
ELSE IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingWater)THEN
! set water inlet node mass flow rate proportional to PLR. Limit water flow rate based on "available" upper limit.
mdot = PTUnit(PTUnitNum)%MaxHeatCoilFluidFlow * PartLoadFrac
CALL SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HotWaterControlNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateWaterCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName,FirstHVACIteration, &
PTUnit(PTUnitNum)%ACHeatCoilIndex, QActual, PTUnit(PTUnitNum)%OpMode, PartLoadFrac)
ELSE IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingSteam)THEN
! set steam inlet node mass flow rate proportional to PLR. Limit steam flow rate based on "available" upper limit.
mdot = PTUnit(PTUnitNum)%MaxHeatCoilFluidFlow * PartLoadFrac
CALL SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HWCoilSteamInletNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateSteamCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName, FirstHVACIteration, QCoilReq, &
PTUnit(PTUnitNum)%ACHeatCoilIndex, QActual, PTUnit(PTUnitNum)%OpMode, PartLoadFrac)
END IF
ELSE
IF(OutsideDryBulbTemp .GT. PTUnit(PTUnitNum)%MinOATCompressor)THEN
SELECT CASE(PTUnit(PTUnitNum)%UnitType_Num)
CASE(PTHPUnit)
CALL SimDXCoil(PTUnit(PTUnitNum)%DXHeatCoilName,On,FirstHVACIteration,PartLoadFrac,PTUnit(PTUnitNum)%DXHeatCoilIndex, &
PTUnit(PTUnitNum)%OpMode,OnOffAirFlowRatio)
SaveCompressorPLR = DXCoilPartLoadRatio(PTUnit(PTUnitNum)%DXHeatCoilIndexNum)
CASE(PTWSHPUnit)
CALL HeatPumpRunFrac(PTUnitNum,PartLoadFrac,errflag,WSHPRuntimeFrac)
CALL SimWatertoAirHPSimple(Blank, &
PTUnit(PTUnitNum)%DXHeatCoilIndex, &
QZnReq, 0.0d0, &
OpMode,WSHPRuntimeFrac, PTUnit(PTUnitNum)%MaxONOFFCyclesperHour, &
PTUnit(PTUnitNum)%HPTimeConstant, PTUnit(PTUnitNum)%FanDelayTime, 1, PartLoadFrac, FirstHVACIteration, &
OnOffAirFlowRat=OnOffAirFlowRatio)
SaveCompressorPLR = PartLoadFrac
CASE DEFAULT
END SELECT
ELSE
SELECT CASE(PTUnit(PTUnitNum)%UnitType_Num)
CASE(PTHPUnit)
CALL SimDXCoil(PTUnit(PTUnitNum)%DXHeatCoilName,Off,FirstHVACIteration,0.0d0,PTUnit(PTUnitNum)%DXHeatCoilIndex, &
PTUnit(PTUnitNum)%OpMode,OnOffAirFlowRatio)
CASE(PTWSHPUnit)
CALL SimWatertoAirHPSimple(Blank, &
PTUnit(PTUnitNum)%DXHeatCoilIndex, &
0.0d0, 0.0d0, &
OpMode, 0.0d0, PTUnit(PTUnitNum)%MaxONOFFCyclesperHour, &
PTUnit(PTUnitNum)%HPTimeConstant, PTUnit(PTUnitNum)%FanDelayTime, 0, 0.0d0, FirstHVACIteration)
CASE DEFAULT
END SELECT
END IF
END IF
ELSE
! heating coil is off
IF(PTUnit(PTUnitNum)%UnitType_Num .EQ. PTACUnit)THEN
QCoilReq = 0.0d0
IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingGas .OR. &
PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingElectric)THEN
CALL SimulateHeatingCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName,FirstHVACIteration,QCoilReq, &
PTUnit(PTUnitNum)%ACHeatCoilIndex)
ELSE IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingWater)THEN
mdot = 0.d0
Call SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HotWaterControlNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateWaterCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName,FirstHVACIteration, &
PTUnit(PTUnitNum)%ACHeatCoilIndex)
ELSE IF(PTUnit(PTUnitNum)%ACHeatCoilType_Num == Coil_HeatingSteam)THEN
mdot = 0.d0
Call SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HWCoilSteamInletNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateSteamCoilComponents(PTUnit(PTUnitNum)%ACHeatCoilName, &
FirstHVACIteration, &
QCoilReq, &
PTUnit(PTUnitNum)%ACHeatCoilIndex, &
QActual, PTUnit(PTUnitNum)%OpMode, PartLoadFrac)
END IF
ELSE
SELECT CASE(PTUnit(PTUnitNum)%UnitType_Num)
CASE(PTHPUnit)
CALL SimDXCoil(PTUnit(PTUnitNum)%DXHeatCoilName,Off,FirstHVACIteration,0.0d0,PTUnit(PTUnitNum)%DXHeatCoilIndex, &
PTUnit(PTUnitNum)%OpMode,OnOffAirFlowRatio)
CASE(PTWSHPUnit)
CALL SimWatertoAirHPSimple(Blank, &
PTUnit(PTUnitNum)%DXHeatCoilIndex, &
0.0d0, 0.0d0, &
OpMode, 0.0d0, PTUnit(PTUnitNum)%MaxONOFFCyclesperHour, &
PTUnit(PTUnitNum)%HPTimeConstant, PTUnit(PTUnitNum)%FanDelayTime, 0, 0.0d0, FirstHVACIteration )
CASE DEFAULT
END SELECT
END IF
END IF
! if draw through, simulate coils then fan
IF (PTUnit(PTUnitNum)%FanPlace .EQ. DrawThru) THEN
CALL SimulateFanComponents(PTUnit(PTUnitNum)%FanName,FirstHVACIteration,PTUnit(PTUnitNum)%FanIndex,FanSpeedRatio,&
ZoneCompTurnFansOn,ZoneCompTurnFansOff)
END IF
IF(PTUnit(PTUnitNum)%SuppHeatCoilIndex .GT. 0)THEN
IF ( SupHeaterLoad < SmallLoad ) THEN
Select Case (PTUnit(PTUnitNum)%SuppHeatCoilType_Num)
Case (Coil_HeatingGas,Coil_HeatingElectric )
CALL SimulateHeatingCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName,FirstHVACIteration, &
SupHeaterLoad, PTUnit(PTUnitNum)%SuppHeatCoilIndex, &
QActual, .TRUE., PTUnit(PTUnitNum)%OpMode)
Case (Coil_HeatingWater)
mdot = 0.0d0
Call SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HotWaterControlNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateWaterCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName,FirstHVACIteration, &
PTUnit(PTUnitNum)%SuppHeatCoilIndex, SupHeaterLoad, &
PTUnit(PTUnitNum)%OpMode)
Case (Coil_HeatingSteam)
mdot = 0.0d0
Call SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HWCoilSteamInletNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
CALL SimulateSteamCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName, &
FirstHVACIteration, SupHeaterLoad, &
PTUnit(PTUnitNum)%SuppHeatCoilIndex, &
QActual, PTUnit(PTUnitNum)%OpMode)
END Select
ELSE
Select Case (PTUnit(PTUnitNum)%SuppHeatCoilType_Num)
Case (Coil_HeatingGas,Coil_HeatingElectric )
CALL SimulateHeatingCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName,FirstHVACIteration, &
SupHeaterLoad, PTUnit(PTUnitNum)%SuppHeatCoilIndex, &
QActual, .TRUE., PTUnit(PTUnitNum)%OpMode)
Case (Coil_HeatingWater)
MaxHotWaterFlow = PTUnit(PTUnitNum)%MaxSuppCoilFluidFlow
Call SetComponentFlowRate( MaxHotWaterFlow , &
PTUnit(PTUnitNum)%HotWaterControlNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
QActual = SupHeaterLoad
! simulate the hot water supplemental heating coil
CALL SimulateWaterCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName,FirstHVACIteration, &
PTUnit(PTUnitNum)%SuppHeatCoilIndex, QActual, &
PTUnit(PTUnitNum)%OpMode)
IF( QActual > (SupHeaterLoad + SmallLoad)) THEN
! control water flow to obtain output matching SupHeaterLoad
SolFlag = 0
MinWaterFlow = 0.0d0
Par(1) = REAL(PTUnitNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = SupHeaterLoad
MaxHotWaterFlow = PTUnit(PTUnitNum)%MaxSuppCoilFluidFlow
CALL SolveRegulaFalsi(ErrTolerance, SolveMaxIter, SolFlag, HotWaterMdot, HotWaterCoilResidual, &
MinWaterFlow, MaxHotWaterFlow, Par)
IF (SolFlag == -1) THEN
IF (PTUnit(PTUnitNum)%HotWaterCoilMaxIterIndex == 0) THEN
CALL ShowWarningMessage('CalcPTUnit: Hot water coil control failed for '// &
trim(PTUnit(PTUnitNum)%UnitType)//'="'// &
TRIM(PTUnit(PTUnitNum)%Name)//'"')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError(' Iteration limit ['//trim(RoundSigDigits(SolveMaxIter))// &
'] exceeded in calculating hot water mass flow rate')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('CalcPTUnit: Hot water coil control failed (iteration limit ['// &
trim(RoundSigDigits(SolveMaxIter))//']) for '//trim(PTUnit(PTUnitNum)%UnitType)//'="'// &
TRIM(PTUnit(PTUnitNum)%Name),PTUnit(PTUnitNum)%HotWaterCoilMaxIterIndex)
ELSE IF (SolFlag == -2) THEN
IF (PTUnit(PTUnitNum)%HotWaterCoilMaxIterIndex2 == 0) THEN
CALL ShowWarningMessage('CalcPTUnit: Hot water coil control failed (maximum flow limits) for '// &
trim(PTUnit(PTUnitNum)%UnitType)//'="'// &
TRIM(PTUnit(PTUnitNum)%Name)//'"')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('...Bad hot water maximum flow rate limits')
CALL ShowContinueError('...Given minimum water flow rate='//trim(RoundSigDigits(MinWaterFlow,3))//' kg/s')
CALL ShowContinueError('...Given maximum water flow rate='//trim(RoundSigDigits(MaxHotWaterFlow,3))//' kg/s')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('CalcPTUnit: Hot water coil control failed (flow limits) for '// &
trim(PTUnit(PTUnitNum)%UnitType)//'="'// &
TRIM(PTUnit(PTUnitNum)%Name)//'"', &
PTUnit(PTUnitNum)%HotWaterCoilMaxIterIndex2, &
ReportMinOf=MinWaterFlow,ReportMaxOf=MaxHotWaterFlow,ReportMinUnits='[kg/s]',ReportMaxUnits='[kg/s]')
END IF
QActual = SupHeaterLoad
! simulate the hot water supplemental heating coil
CALL SimulateWaterCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName,FirstHVACIteration, &
PTUnit(PTUnitNum)%SuppHeatCoilIndex, QActual, &
PTUnit(PTUnitNum)%OpMode)
ENDIF
Case (Coil_HeatingSteam)
mdot = PTUnit(PTUnitNum)%MaxSuppCoilFluidFlow
Call SetComponentFlowRate( mdot , &
PTUnit(PTUnitNum)%HWCoilSteamInletNode, &
PTUnit(PTUnitNum)%PlantCoilOutletNode, &
PTUnit(PTUnitNum)%LoopNum, &
PTUnit(PTUnitNum)%LoopSide, &
PTUnit(PTUnitNum)%BranchNum, &
PTUnit(PTUnitNum)%CompNum)
! simulate the steam supplemental heating coil
CALL SimulateSteamCoilComponents(PTUnit(PTUnitNum)%SuppHeatCoilName, &
FirstHVACIteration, SupHeaterLoad, &
PTUnit(PTUnitNum)%SuppHeatCoilIndex, &
QActual, PTUnit(PTUnitNum)%OpMode)
END Select
ENDIF
ENDIF
! calculate sensible load met using delta enthalpy at a constant (minimum) humidity ratio)
MinHumRat = MIN(Node(InletNode)%HumRat,Node(OutletNode)%HumRat)
LoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRat) - PsyHFnTdbW(Node(InletNode)%Temp,MinHumRat))
RETURN
END SUBROUTINE CalcPTUnit