Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ZonePlenumNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
logical, | intent(in) | :: | FirstCall |
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 InitAirZoneSupplyPlenum(ZonePlenumNum, FirstHVACIteration, FirstCall)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN March 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the ZonePlenum components.
! METHODOLOGY EMPLOYED:
! Similar to the Zone Splitter component but with interactions to the plenum zone.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ZonePlenumNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
LOGICAL, INTENT(IN) :: FirstCall
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: InletNode
INTEGER :: OutletNode
INTEGER :: ZoneNodeNum
INTEGER :: PlenumZoneNum
INTEGER :: NodeIndex
LOGICAL,SAVE :: MyEnvrnFlag = .TRUE.
! FLOW:
! Do the Begin Environment initializations
IF (MyEnvrnFlag .AND. BeginEnvrnFlag) THEN
DO PlenumZoneNum = 1, NumZoneSupplyPlenums
ZoneNodeNum = ZoneSupPlenCond(PlenumZoneNum)%ZoneNodeNum
Node(ZoneNodeNum)%Temp = 20.0d0
Node(ZoneNodeNum)%MassFlowRate = 0.0d0
Node(ZoneNodeNum)%Quality = 1.0d0
Node(ZoneNodeNum)%Press = OutBaroPress
Node(ZoneNodeNum)%HumRat = OutHumRat
Node(ZoneNodeNum)%Enthalpy = PsyHFnTdbW(Node(ZoneNodeNum)%Temp,Node(ZoneNodeNum)%HumRat)
END DO
MyEnvrnFlag=.FALSE.
END IF
IF (.NOT. BeginEnvrnFlag) THEN
MyEnvrnFlag=.TRUE.
END IF
! Do the following initializations (every time step): This should be the info from
! the previous components outlets or the node data in this section.
InletNode = ZoneSupPlenCond(ZonePlenumNum)%InletNode
ZoneNodeNum = ZoneSupPlenCond(ZonePlenumNum)%ZoneNodeNum
IF (FirstHVACIteration .AND. FirstCall) THEN
IF (Node(InletNode)%MassFlowRate > 0.0d0) THEN
Node(ZoneNodeNum)%MassFlowRate = Node(InletNode)%MassFlowRate
DO NodeIndex=1,ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
OutletNode = ZoneSupPlenCond(ZonePlenumNum)%OutletNode(NodeIndex)
Node(OutletNode)%MassFlowRate = Node(InletNode)%MassFlowRate / ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
END DO
END IF
IF (Node(InletNode)%MassFlowRateMaxAvail > 0.0d0) THEN
Node(ZoneNodeNum)%MassFlowRateMaxAvail = Node(InletNode)%MassFlowRateMaxAvail
DO NodeIndex=1,ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
OutletNode = ZoneSupPlenCond(ZonePlenumNum)%OutletNode(NodeIndex)
Node(OutletNode)%MassFlowRateMaxAvail = Node(InletNode)%MassFlowRateMaxAvail / &
ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
END DO
END IF
END IF !For FirstHVACIteration and FirstCall
IF (FirstCall) THEN
IF(Node(InletNode)%MassFlowRateMaxAvail == 0.0d0) THEN !For Node inlet Max Avail = 0.0
DO NodeIndex=1,ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
OutletNode = ZoneSupPlenCond(ZonePlenumNum)%OutletNode(NodeIndex)
Node(OutletNode)%MassFlowRate = 0.0d0
Node(OutletNode)%MassFlowRateMaxAvail = 0.0d0
Node(OutletNode)%MassFlowRateMinAvail = 0.0d0
END DO
Node(ZoneNodeNum)%MassFlowRate = 0.0d0
Node(ZoneNodeNum)%MassFlowRateMaxAvail = 0.0d0
Node(ZoneNodeNum)%MassFlowRateMinAvail = 0.0d0
END IF !For Node inlet Max Avail = 0.0
! Add stuff to calculate conduction inputs to the zone plenum
! Now load the zone conditions
ZoneSupPlenCond(ZonePlenumNum)%ZoneTemp = Node(ZoneNodeNum)%Temp
ZoneSupPlenCond(ZonePlenumNum)%ZoneHumRat = Node(ZoneNodeNum)%HumRat
ZoneSupPlenCond(ZonePlenumNum)%ZoneEnthalpy = Node(ZoneNodeNum)%Enthalpy
DO NodeIndex=1,ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
OutletNode = ZoneSupPlenCond(ZonePlenumNum)%OutletNode(NodeIndex)
Node(OutletNode)%Press = Node(InletNode)%Press
Node(OutletNode)%Quality = Node(InletNode)%Quality
END DO
Node(ZoneNodeNum)%Press = Node(InletNode)%Press
Node(ZoneNodeNum)%Quality = Node(InletNode)%Quality
ELSE ! On the second call from the ZoneEquipManager this is where the flows are passed back to
! the supply plenum inlet.
DO NodeIndex=1,ZoneSupPlenCond(ZonePlenumNum)%NumOutletNodes
OutletNode = ZoneSupPlenCond(ZonePlenumNum)%OutletNode(NodeIndex)
ZoneSupPlenCond(ZonePlenumNum)%OutletMassFlowRate(NodeIndex) = Node(OutletNode)%MassFlowRate
ZoneSupPlenCond(ZonePlenumNum)%OutletMassFlowRateMaxAvail(NodeIndex) = Node(OutletNode)%MassFlowRateMaxAvail
ZoneSupPlenCond(ZonePlenumNum)%OutletMassFlowRateMinAvail(NodeIndex) = Node(OutletNode)%MassFlowRateMinAvail
END DO
END IF !For FirstCall
RETURN
END SUBROUTINE InitAirZoneSupplyPlenum