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 CalcSingZoneRhSetPoint(SetPtMgrNum)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! From the heating or cooling load of the control zone, calculate the supply air setpoint
! needed to meet that zone load
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEnergyDemands
USE DataHVACGlobals, ONLY: SmallMassFlow, SmallLoad
USE Psychrometrics, ONLY:PsyTdbFnHW
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) :: ZoneMassFlow ! zone inlet mass flow rate [kg/s]
REAL(r64) :: CpAir ! inlet air specific heat [J/kg-C]
INTEGER :: ZoneInletNode
INTEGER :: ZoneNode
INTEGER :: ZoneNum
REAL(r64) :: ZoneTemp
REAL(r64) :: ZoneLoadToCoolSetPt
REAL(r64) :: ZoneLoadToHeatSetPt
REAL(r64) :: TSetPt
REAL(r64) :: TSetPt1
REAL(r64) :: TSetPt2
Logical :: DeadBand
INTEGER :: FanNodeIn
INTEGER :: FanNodeOut
INTEGER :: RetNode
INTEGER :: OAMixOAInNode
REAL(r64) :: FanDeltaT
REAL(r64) :: TSupNoHC = 0.0d0 ! supply temperature with no heating or cooling
REAL(r64) :: TMixAtMinOA
REAL(r64) :: EnthMixAtMinOA
REAL(r64) :: HumRatMixAtMinOA
INTEGER :: AirLoopNum
REAL(r64) :: MinOAFrac
INTEGER :: LoopInNode
REAL(r64) :: ExtrRateNoHC = 0.0d0 ! the heating (>0) or cooling (<0) that can be done by supply air at TSupNoHC [W]
ZoneInletNode = SingZoneRhSetPtMgr(SetPtMgrNum)%ZoneInletNodeNum
ZoneNum = SingZoneRhSetPtMgr(SetPtMgrNum)%ControlZoneNum
ZoneNode = SingZoneRhSetPtMgr(SetPtMgrNum)%ZoneNodeNum
FanNodeIn = SingZoneRhSetPtMgr(SetPtMgrNum)%FanNodeIn
FanNodeOut = SingZoneRhSetPtMgr(SetPtMgrNum)%FanNodeOut
RetNode = SingZoneRhSetPtMgr(SetPtMgrNum)%RetNode
OAMixOAInNode = SingZoneRhSetPtMgr(SetPtMgrNum)%OAInNode
AirLoopNum = SingZoneRhSetPtMgr(SetPtMgrNum)%AirLoopNum
MinOAFrac = AirLoopFlow(AirLoopNum)%OAMinFrac
ZoneMassFlow = Node(ZoneInletNode)%MassFlowRate
ZoneLoad = ZoneSysEnergyDemand(ZoneNum)%TotalOutputRequired
ZoneLoadToCoolSetPt = ZoneSysEnergyDemand(ZoneNum)%OutputRequiredToCoolingSP
ZoneLoadToHeatSetPt = ZoneSysEnergyDemand(ZoneNum)%OutputRequiredToHeatingSP
DeadBand = DeadbandOrSetback(ZoneNum)
ZoneTemp = Node(ZoneNode)%Temp
LoopInNode = SingZoneRhSetPtMgr(SetPtMgrNum)%LoopInNode
IF (OAMixOAInNode > 0) THEN
HumRatMixAtMinOA = (1.0d0-MinOAFrac)*Node(RetNode)%HumRat + MinOAFrac*Node(OAMixOAInNode)%HumRat
EnthMixAtMinOA = (1.0d0-MinOAFrac)*Node(RetNode)%Enthalpy + MinOAFrac*Node(OAMixOAInNode)%Enthalpy
TMixAtMinOA = PsyTdbFnHW(EnthMixAtMinOA,HumRatMixAtMinOA)
ELSE
TMixAtMinOA = Node(LoopInNode)%Temp
END IF
IF (FanNodeOut > 0 .and. FanNodeIn > 0) THEN
FanDeltaT = Node(FanNodeOut)%Temp - Node(FanNodeIn)%Temp
ELSE
FanDeltaT = 0.0d0
END IF
TSupNoHC = TMixAtMinOA + FanDeltaT
CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode)%HumRat,Node(ZoneInletNode)%Temp)
ExtrRateNoHC = CpAir*ZoneMassFlow*(TSupNoHC - ZoneTemp)
IF (ZoneMassFlow.LE.SmallMassFlow) THEN
TSetPt = TSupNoHC
ELSE IF (Deadband .OR. ABS(ZoneLoad) < SmallLoad) THEN
! if air with no active heating or cooling provides cooling
IF (ExtrRateNoHC < 0.0d0) THEN
! if still in deadband, do no active heating or cooling;
! if below heating setpoint, set a supply temp that will cool to the heating setpoint
IF (ExtrRateNoHC >= ZoneLoadToHeatSetPt) THEN
TSetPt = TSupNoHC
ELSE
TSetPt = ZoneTemp + ZoneLoadToHeatSetPt/(CpAir*ZoneMassFlow)
END IF
! if air with no active heating or cooling provides heating
ELSE IF (ExtrRateNoHC > 0.0d0) THEN
! if still in deadband, do no active heating or cooling;
! if above cooling setpoint, set a supply temp that will heat to the cooling setpoint
IF (ExtrRateNoHC <= ZoneLoadToCoolSetPt) THEN
TSetPt = TSupNoHC
ELSE
TSetPt = ZoneTemp + ZoneLoadToCoolSetPt/(CpAir*ZoneMassFlow)
END IF
ELSE
TSetPt = TSupNoHC
END IF
ELSE IF (ZoneLoad < (-1.d0*SmallLoad)) THEN
TSetPt1 = ZoneTemp + ZoneLoad/(CpAir*ZoneMassFlow)
TSetPt2 = ZoneTemp + ZoneLoadToHeatSetPt/(CpAir*ZoneMassFlow)
IF (TSetPt1 > TSupNoHC) THEN
IF (TSetPt2 > TSupNoHC) THEN
TSetPt = TSetPt2
ELSE
TSetPt = TSupNoHC
END IF
ELSE
TSetPt = TSetPt1
END IF
ELSE IF (ZoneLoad > SmallLoad) THEN
TSetPt1 = ZoneTemp + ZoneLoad/(CpAir*ZoneMassFlow)
TSetPt2 = ZoneTemp + ZoneLoadToCoolSetPt/(CpAir*ZoneMassFlow)
IF (TSetPt1 < TSupNoHC) THEN
IF (TSetPt2 < TSupNoHC) THEN
TSetPt = TSetPt2
ELSE
TSetPt =TSupNoHC
END IF
ELSE
TSetPt = TSetPt1
END IF
ELSE
TSetPt = TSupNoHC
END IF
TSetPt = MAX(MIN(TSetPt,SingZoneRhSetPtMgr(SetPtMgrNum)%MaxSetTemp),SingZoneRhSetPtMgr(SetPtMgrNum)%MinSetTemp)
SingZoneRhSetPtMgr(SetPtMgrNum)%SetPt = TSetPt
RETURN
END SUBROUTINE CalcSingZoneRhSetPoint