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) | :: | UnitarySysNum | |||
integer, | intent(in) | :: | AirLoopNum | |||
integer, | intent(in) | :: | OutNode | |||
integer, | intent(in) | :: | ControlNode | |||
real(kind=R64), | intent(inout) | :: | OnOffAirFlowRatio | |||
real(kind=r64), | intent(in) | :: | OAUCoilOutletTemp | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=R64), | intent(inout), | optional | :: | ZoneLoad | ||
real(kind=R64), | intent(in), | optional | :: | MaxOutletTemp |
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 UpdateUnitarySystemControl(UnitarySysNum,AirLoopNum,OutNode,ControlNode,OnOffAirFlowRatio, &
OAUCoilOutletTemp,FirstHVACIteration, ZoneLoad,MaxOutletTemp)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for sizing unitary systems.
! METHODOLOGY EMPLOYED:
! Either CALL the coil model to get the size or size coil.
! Current method is to use same methodology as is used in coil objects.
! Future changes will include a common sizing algorithm and push the calculated
! size to the coil object prior to first call (so the coil will not autosize).
! REFERENCES:
! na
! USE STATEMENTS:
USE DataAirLoop, ONLY: AirLoopControlInfo
USE Psychrometrics, ONLY: PsyHfgAirFnWTdb
USE DataHeatBalFanSys, ONLY: TempControlType
USE DataZoneEnergyDemands
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: UnitarySysNum ! number of the current DX Sys being simulated
INTEGER, INTENT (IN) :: AirLoopNum ! number of the current air loop being simulated
INTEGER, INTENT (IN) :: OutNode ! coil outlet node number
INTEGER, INTENT (IN) :: ControlNode ! control node number
LOGICAL, INTENT (IN) :: FirstHVACIteration
REAL(r64), INTENT (IN) :: OAUCoilOutletTemp ! "ONLY" for zoneHVAC:OutdoorAirUnit
REAL(R64), INTENT (INOUT) :: OnOffAirFlowRatio
REAL(R64), INTENT (INOUT), OPTIONAL :: ZoneLoad
REAL(R64), INTENT (IN), OPTIONAL :: MaxOutletTemp ! limits heating coil outlet temp [C]
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ControlType
REAL(r64) :: H2OHtOfVap ! Heat of vaporization of air
ControlType = UnitarySystem(UnitarySysNum)%ControlType
! These initializations are done every iteration
SELECT CASE(ControlType)
CASE(LoadBased)
IF (AirLoopNum .EQ.-1) THEN ! This IF-THEN routine is just for ZoneHVAC:OutdoorAirUnit
CALL ShowWarningError(TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)// &
' "'//TRIM(UnitarySystem(UnitarySysNum)%Name)//'"')
CALL ShowFatalError('...Load based control is not allowed when used with ZoneHVAC:OutdoorAirUnit')
END IF
! here we need to deal with sequenced zone equip
HeatingLoad = .FALSE.
CoolingLoad = .FALSE.
IF (UnitarySystem(UnitarySysNum)%ZoneSequenceCoolingNum > 0 .AND. UnitarySystem(UnitarySysNum)%ZoneSequenceHeatingNum > 0)THEN
QToCoolSetPt = ZoneSysEnergyDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%&
SequencedOutputRequiredToCoolingSP(UnitarySystem(UnitarySysNum)%ZoneSequenceCoolingNum)
QToHeatSetPt = ZoneSysEnergyDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%&
SequencedOutputRequiredToHeatingSP(UnitarySystem(UnitarySysNum)%ZoneSequenceHeatingNum)
IF (QToHeatSetPt > 0.0d0 .AND. QToCoolSetPt > 0.0d0 .AND. &
TempControlType(UnitarySystem(UnitarySysNum)%ControlZoneNum) .NE. SingleCoolingSetPoint) THEN
ZoneLoad = QToHeatSetPt
HeatingLoad = .TRUE.
ELSEIF (QToHeatSetPt > 0.0d0 .AND. QToCoolSetPt > 0.0d0 .AND. &
TempControlType(UnitarySystem(UnitarySysNum)%ControlZoneNum) .EQ. SingleCoolingSetPoint) THEN
ZoneLoad = 0.0d0
ELSEIF (QToHeatSetPt < 0.0d0 .AND. QToCoolSetPt < 0.0d0 .AND. &
TempControlType(UnitarySystem(UnitarySysNum)%ControlZoneNum) .NE. SingleHeatingSetPoint) THEN
ZoneLoad = QToCoolSetPt
CoolingLoad = .TRUE.
ELSEIF (QToHeatSetPt < 0.0d0 .AND. QToCoolSetPt < 0.0d0 .AND. &
TempControlType(UnitarySystem(UnitarySysNum)%ControlZoneNum) .EQ. SingleHeatingSetPoint) THEN
ZoneLoad = 0.0d0
ELSEIF (QToHeatSetPt <= 0.0d0 .AND. QToCoolSetPt >= 0.0d0) THEN
ZoneLoad = 0.0d0
END IF
MoistureLoad = ZoneSysMoistureDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)% &
SequencedOutputRequiredToDehumidSP(UnitarySystem(UnitarySysNum)%ZoneSequenceCoolingNum)
ELSE
ZoneLoad= ZoneSysEnergyDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%RemainingOutputRequired
QToCoolSetPt=ZoneSysEnergyDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%OutputRequiredToCoolingSP
QToHeatSetPt=ZoneSysEnergyDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%OutputRequiredToHeatingSP
MoistureLoad = ZoneSysMoistureDemand(UnitarySystem(UnitarySysNum)%ControlZoneNum)%OutputRequiredToDehumidIFyingSP
END IF
IF ( UnitarySystem(UnitarySysNum)%DehumidControlType_Num .NE. DehumidControl_None)THEN
H2OHtOfVap = PsyHfgAirFnWTdb(Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%HumRat,&
Node(UnitarySystem(UnitarySysNum)%NodeNumofControlledZone)%Temp,'UpdateUnitarySystemControl')
! positive MoistureLoad means no dehumidification load
MoistureLoad = MIN(0.0d0,MoistureLoad * H2OHtOfVap)
ELSE
MoistureLoad = 0.0d0
END IF
CALL InitLoadBasedControl(UnitarySysNum,AirLoopNum,FirstHVACIteration,OnOffAirFlowRatio,ZoneLoad)
! EMS override point
IF (UnitarySystem(UnitarySysNum)%EMSOverrideSensZoneLoadRequest) &
ZoneLoad = UnitarySystem(UnitarySysNum)%EMSSensibleZoneLoadValue
IF (UnitarySystem(UnitarySysNum)%EMSOverrideMoistZoneLoadRequest) &
MoistureLoad = UnitarySystem(UnitarySysNum)%EMSMoistureZoneLoadValue
CASE(SetPointBased)
IF (AirLoopNum .EQ.-1) THEN ! This IF-THEN routine is just for ZoneHVAC:OutdoorAIRUNIT
IF (ControlNode.EQ.0) THEN
UnitarySystem(UnitarySysNum)%DesiredOutletTemp = OAUCoilOutletTemp
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = 1.0d0
ELSEIF (ControlNode.EQ.OutNode) THEN
UnitarySystem(UnitarySysNum)%DesiredOutletTemp =OAUCoilOutletTemp
END IF
! If the unitary system is an equipment of Outdoor Air Unit, the desired coil outlet humidity level is set to zero
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = 1.0d0
ELSE ! Not Outdoor Air Unit or zone equipment
IF(AirLoopNum .GT. 0)EconomizerFlag = AirLoopControlInfo(AirLoopNum)%EconoActive
IF (ControlNode.EQ.0) THEN
UnitarySystem(UnitarySysNum)%DesiredOutletTemp = 0.0d0
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = 1.0d0
ELSEIF (ControlNode.EQ.OutNode) THEN
IF (UnitarySystem(UnitarySysNum)%ISHundredPercentDOASDXCoil .AND. UnitarySystem(UnitarySysNum)%RunOnSensibleLoad) THEN
CALL FrostControlSetPointLimit(UnitarySysNum, Node(ControlNode)%TempSetPoint,Node(ControlNode)%HumRatMax,OutBaroPress, &
UnitarySystem(UnitarySysNum)%DOASDXCoolingCoilMinTout,1)
END IF
UnitarySystem(UnitarySysNum)%DesiredOutletTemp = Node(ControlNode)%TempSetPoint
! IF HumRatMax is zero, then there is no request from SetpointManager:SingleZone:Humidity:Maximum
IF ((UnitarySystem(UnitarySysNum)%DehumidControlType_Num .NE. DehumidControl_None) .AND. &
(Node(ControlNode)%HumRatMax .GT. 0.0d0)) THEN
IF (UnitarySystem(UnitarySysNum)%ISHundredPercentDOASDXCoil .AND. UnitarySystem(UnitarySysNum)%RunOnLatentLoad) THEN
CALL FrostControlSetPointLimit(UnitarySysNum,Node(ControlNode)%TempSetPoint,Node(ControlNode)%HumRatMax,OutBaroPress, &
UnitarySystem(UnitarySysNum)%DOASDXCoolingCoilMinTout,2)
END IF
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = Node(ControlNode)%HumRatMax
ELSE
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = 1.0d0
END IF
ELSE
IF (UnitarySystem(UnitarySysNum)%ISHundredPercentDOASDXCoil .AND. UnitarySystem(UnitarySysNum)%RunOnSensibleLoad) THEN
CALL FrostControlSetPointLimit(UnitarySysNum,Node(ControlNode)%TempSetPoint,Node(ControlNode)%HumRatMax,OutBaroPress, &
UnitarySystem(UnitarySysNum)%DOASDXCoolingCoilMinTout,1)
END IF
UnitarySystem(UnitarySysNum)%DesiredOutletTemp = Node(ControlNode)%TempSetPoint - &
(Node(ControlNode)%Temp - Node(OutNode)%Temp)
IF (UnitarySystem(UnitarySysNum)%DehumidControlType_Num .NE. DehumidControl_None) THEN
IF (UnitarySystem(UnitarySysNum)%ISHundredPercentDOASDXCoil .AND. UnitarySystem(UnitarySysNum)%RunOnLatentLoad) THEN
CALL FrostControlSetPointLimit(UnitarySysNum,Node(ControlNode)%TempSetPoint,Node(ControlNode)%HumRatMax,OutBaroPress, &
UnitarySystem(UnitarySysNum)%DOASDXCoolingCoilMinTout,2)
END IF
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = Node(ControlNode)%HumRatMax - &
(Node(ControlNode)%HumRat - Node(OutNode)%HumRat)
ELSE
UnitarySystem(UnitarySysNum)%DesiredOutletHumRat = 1.0d0
END IF
END IF
END IF
IF(PRESENT(MaxOutletTemp))UnitarySystem(UnitarySysNum)%DesiredOutletTemp = &
MIN(UnitarySystem(UnitarySysNum)%DesiredOutletTemp,MaxOutletTemp)
CASE DEFAULT
END SELECT
RETURN
END SUBROUTINE UpdateUnitarySystemControl