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) | :: | SetPtMgrNum |
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 CalcWarmestSetPointTempFlow(SetPtMgrNum)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2002
! MODIFIED Haves, Oct 2004
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate the "warmest" supply air setpoint temperature that will satisfy the cooling
! requirements of all the zones served by a central air system.
! METHODOLOGY EMPLOYED:
! Zone sensible heat balance
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEquipment, ONLY: ZoneEquipConfig
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand
USE DataHVACGlobals, ONLY: SmallMassFlow, SmallLoad
USE DataAirLoop, ONLY: AirLoopControlInfo, AirLoopFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: SetPtMgrNum ! number of the current setpoint manager being simulated
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: ZoneLoad ! required zone load [W]
REAL(r64) :: ZoneMassFlowMax ! zone inlet maximum mass flow rate [kg/s]
REAL(r64) :: CpAir ! inlet air specific heat [J/kg-C]
INTEGER :: AirLoopNum ! the index of the air loop served by this setpoint manager
REAL(r64) :: TotCoolLoad ! sum of the zone cooling loads for this air loop [W]
INTEGER :: ZonesCooledIndex ! DO loop index for zones cooled by the air loop
INTEGER :: CtrlZoneNum ! the controlled zone index
INTEGER :: ZoneInletNode ! the zone inlet node number
REAL(r64) :: ZoneTemp ! zone temperature [C]
REAL(r64) :: ZoneSetPointTemp ! zone supply air temperature [C]
REAL(r64) :: SetPointTemp ! the system setpoint temperature [C]
INTEGER :: ZoneNode ! the zone node number of the current zone
INTEGER :: ZoneNum ! the actual zone number
REAL(r64) :: MinFracFlow
REAL(r64) :: ZoneFracFlow
REAL(r64) :: FracFlow
REAL(r64) :: MaxSetPointTemp
REAL(r64) :: MinSetPointTemp
INTEGER :: CritZoneNumTemp
INTEGER :: CritZoneNumFlow
INTEGER :: ControlStrategy
IF (.not. WarmestSetPtMgrTempFlow(SetPtMgrNum)%SimReady) RETURN
AirLoopNum = WarmestSetPtMgrTempFlow(SetPtMgrNum)%AirLoopNum
TotCoolLoad = 0.0d0
MaxSetPointTemp = WarmestSetPtMgrTempFlow(SetPtMgrNum)%MaxSetTemp
SetPointTemp = MaxSetPointTemp
MinSetPointTemp = WarmestSetPtMgrTempFlow(SetPtMgrNum)%MinSetTemp
MinFracFlow = WarmestSetPtMgrTempFlow(SetPtMgrNum)%MinTurndown
FracFlow = MinFracFlow
CritZoneNumTemp = 0
CritZoneNumFlow = 0
ControlStrategy = WarmestSetPtMgrTempFlow(SetPtMgrNum)%Strategy
DO ZonesCooledIndex=1,AirToZoneNodeInfo(AirLoopNum)%NumZonesCooled
CtrlZoneNum = AirToZoneNodeInfo(AirLoopNum)%CoolCtrlZoneNums(ZonesCooledIndex)
ZoneInletNode = AirToZoneNodeInfo(AirLoopNum)%CoolZoneInletNodes(ZonesCooledIndex)
ZoneNode = ZoneEquipConfig(CtrlZoneNum)%ZoneNode
ZoneNum = ZoneEquipConfig(CtrlZoneNum)%ActualZoneNum
ZoneMassFlowMax = Node(ZoneInletNode)%MassFlowRateMax
ZoneLoad = ZoneSysEnergyDemand(ZoneNum)%TotalOutputRequired
ZoneTemp = Node(ZoneNode)%Temp
ZoneSetPointTemp = MaxSetPointTemp
ZoneFracFlow = MinFracFlow
IF (ZoneLoad < 0.0d0) THEN
TotCoolLoad = TotCoolLoad + ABS(ZoneLoad)
CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode)%HumRat,Node(ZoneInletNode)%Temp)
IF (ZoneMassFlowMax > SmallMassFlow) THEN
IF (ControlStrategy == TempFirst) THEN
! First find supply air temperature required to meet the load at minimum flow. If this is
! below the minimum supply air temperature, calculate the fractional flow rate required to meet the
! load at the minimum supply air temperature.
ZoneSetPointTemp = ZoneTemp + ZoneLoad/(CpAir*ZoneMassFlowMax*MinFracFlow)
IF (ZoneSetPointTemp < MinSetPointTemp) THEN
ZoneFracFlow = (ZoneLoad/(CpAir*(MinSetPointTemp-ZoneTemp)) ) / ZoneMassFlowMax
ELSE
ZoneFracFlow = MinFracFlow
END IF
ELSE ! ControlStrategy = FlowFirst
! First find supply air flow rate required to meet the load at maximum supply air temperature. If this
! is above the maximum supply air flow rate, calculate the supply air temperature required to meet the
! load at the maximum flow.
ZoneFracFlow = (ZoneLoad/(CpAir*(MaxSetPointTemp-ZoneTemp)) ) / ZoneMassFlowMax
IF (ZoneFracFlow > 1.0d0 .OR. ZoneFracFlow < 0.0d0) THEN
ZoneSetPointTemp = ZoneTemp + ZoneLoad/(CpAir*ZoneMassFlowMax)
ELSE
ZoneSetPointTemp = MaxSetPointTemp
END IF
END IF
END IF
END IF
IF (ZoneSetPointTemp < SetPointTemp) THEN
SetPointTemp = ZoneSetPointTemp
CritZoneNumTemp = ZoneNum
END IF
IF (ZoneFracFlow > FracFlow) THEN
FracFlow = ZoneFracFlow
CritZoneNumFlow = ZoneNum
END IF
END DO
SetPointTemp = MAX(MinSetPointTemp,MIN(SetPointTemp,MaxSetPointTemp))
FracFlow = MAX(MinFracFlow,MIN(FracFlow,1.0d0))
IF (TotCoolLoad < SmallLoad) THEN
SetPointTemp = MaxSetPointTemp
FracFlow = MinFracFlow
END IF
WarmestSetPtMgrTempFlow(SetPtMgrNum)%SetPt = SetPointTemp
WarmestSetPtMgrTempFlow(SetPtMgrNum)%Turndown = FracFlow
IF (ControlStrategy == TempFirst) THEN
IF (CritZoneNumFlow /= 0) THEN
WarmestSetPtMgrTempFlow(SetPtMgrNum)%CritZoneNum = CritZoneNumFlow
ELSE
WarmestSetPtMgrTempFlow(SetPtMgrNum)%CritZoneNum = CritZoneNumTemp
END IF
ELSE ! ControlStrategy = FlowFirst
IF (CritZoneNumTemp /= 0) THEN
WarmestSetPtMgrTempFlow(SetPtMgrNum)%CritZoneNum = CritZoneNumTemp
ELSE
WarmestSetPtMgrTempFlow(SetPtMgrNum)%CritZoneNum = CritZoneNumFlow
END IF
END IF
RETURN
END SUBROUTINE CalcWarmestSetPointTempFlow