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) | :: | ZonePlenumNum |
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 InitAirZoneReturnPlenum(ZonePlenumNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN November 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the ZonePlenum components.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger events.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEquipment, ONLY: ZoneEquipConfig
USE DataDefineEquip, ONLY: AirDistUnit, NumAirDistUnits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ZonePlenumNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: InletNode
INTEGER :: InducedNode = 0
INTEGER :: InletNodeLoop
INTEGER :: ZoneNodeNum
INTEGER :: NodeNum
INTEGER :: ZonePlenumLoop
INTEGER :: PlenumZoneNum
INTEGER :: ZoneEquipConfigLoop ! Loop number of ZoneEquipConfig derived type
INTEGER :: ADUNum ! air distribution unit index
INTEGER :: NumADUsToPlen ! number of ADUs that might leak to this plenum
INTEGER :: ADUsToPlenIndex ! index of an ADU that might leak to this plenum in the plenum ADU list
LOGICAL,SAVE :: MyEnvrnFlag = .TRUE.
LOGICAL,SAVE :: MyOneTimeFlag = .true.
! FLOW:
! Do the one time initializations
IF (MyOneTimeFlag) THEN
! For each zone with a return air plenum put the ZoneRetPlenCond number for the return air plenum
! in the ZoneEquipConfig array for the zone. This allows direct access of the zone's return air
! plenum conditions, such as plenum temperature and air flow. Also establish and save connections
! to the Air Distribution Units. This is needed for the simple duct leakage calculation.
DO ZonePlenumLoop = 1, NumZoneReturnPlenums
ADUsToPlenIndex = 0
NumADUsToPlen = 0
IF(ZoneRetPlenCond(ZonePlenumLoop)%NumInletNodes > 0) THEN
DO InletNodeLoop = 1, ZoneRetPlenCond(ZonePlenumLoop)%NumInletNodes
InletNode = ZoneRetPlenCond(ZonePlenumLoop)%InletNode(InletNodeLoop)
! Loop through ZoneEquipConfig's and look for return air node value = InletNode
DO ZoneEquipConfigLoop = 1, NumOfZones
IF (.not. ZoneEquipConfig(ZoneEquipConfigLoop)%IsControlled) CYCLE
IF(ZoneEquipConfig(ZoneEquipConfigLoop)%ReturnAirNode == InletNode) THEN
ZoneEquipConfig(ZoneEquipConfigLoop)%ReturnZonePlenumCondNum = ZonePlenumLoop
ZoneRetPlenCond(ZonePlenumLoop)%ZoneEqNum(InletNodeLoop) = ZoneEquipConfigLoop
END IF
END DO
! count the ADUs that can leak to this plenum
DO ADUNum=1,NumAirDistUnits
IF (AirDistUnit(ADUNum)%ZoneEqNum == ZoneRetPlenCond(ZonePlenumLoop)%ZoneEqNum(InletNodeLoop)) THEN
NumADUsToPlen = NumADUsToPlen + 1
END IF
END DO
END DO
END IF
ALLOCATE(ZoneRetPlenCond(ZonePlenumLoop)%ADUIndex(NumADUsToPlen))
ZoneRetPlenCond(ZonePlenumLoop)%NumADUs = NumADUsToPlen
! fill the list of air distribution units that can leak to this plenum
IF (NumADUsToPlen > 0) THEN
DO InletNodeLoop = 1, ZoneRetPlenCond(ZonePlenumLoop)%NumInletNodes
DO ADUNum=1,NumAirDistUnits
IF (AirDistUnit(ADUNum)%ZoneEqNum == ZoneRetPlenCond(ZonePlenumLoop)%ZoneEqNum(InletNodeLoop)) THEN
ADUsToPlenIndex = ADUsToPlenIndex + 1
ZoneRetPlenCond(ZonePlenumLoop)%ADUIndex(ADUsToPlenIndex) = ADUNum
END IF
END DO
END DO
END IF
END DO
MyOneTimeFlag = .false.
END IF
! Do the Begin Environment initializations
IF (MyEnvrnFlag .AND. BeginEnvrnFlag) THEN
DO PlenumZoneNum = 1, NumZoneReturnPlenums
ZoneNodeNum = ZoneRetPlenCond(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
!Transfer the node data to ZoneRetPlenCond data structure
DO NodeNum = 1, ZoneRetPlenCond(ZonePlenumNum)%NumInletNodes
InletNode = ZoneRetPlenCond(ZonePlenumNum)%InletNode(NodeNum)
! Set all of the inlet mass flow variables from the nodes
ZoneRetPlenCond(ZonePlenumNum)%InletMassFlowRate(NodeNum) = Node(InletNode)%MassFlowRate
ZoneRetPlenCond(ZonePlenumNum)%InletMassFlowRateMaxAvail(NodeNum) = Node(InletNode)%MassFlowRateMaxAvail
ZoneRetPlenCond(ZonePlenumNum)%InletMassFlowRateMinAvail(NodeNum) = Node(InletNode)%MassFlowRateMinAvail
! ! Set all of the inlet state variables from the inlet nodes
! ZoneRetPlenCond(ZonePlenumNum)%InletTemp(NodeNum) = Node(InletNode)%Temp
! ZoneRetPlenCond(ZonePlenumNum)%InletHumRat(NodeNum) = Node(InletNode)%HumRat
! ZoneRetPlenCond(ZonePlenumNum)%InletEnthalpy(NodeNum) = Node(InletNode)%Enthalpy
ZoneRetPlenCond(ZonePlenumNum)%InletPressure(NodeNum) = Node(InletNode)%Press
END DO
! Set the induced air flow rates
DO NodeNum = 1, ZoneRetPlenCond(ZonePlenumNum)%NumInducedNodes
InducedNode = ZoneRetPlenCond(ZonePlenumNum)%InducedNode(NodeNum)
ZoneRetPlenCond(ZonePlenumNum)%InducedMassFlowRate(NodeNum) = Node(InducedNode)%MassFlowRate
ZoneRetPlenCond(ZonePlenumNum)%InducedMassFlowRateMaxAvail(NodeNum) = Node(InducedNode)%MassFlowRateMaxAvail
ZoneRetPlenCond(ZonePlenumNum)%InducedMassFlowRateMinAvail(NodeNum) = Node(InducedNode)%MassFlowRateMinAvail
END DO
! Add stuff to calculate conduction inputs to the zone plenum
! Now load the zone conditions
ZoneNodeNum = ZoneRetPlenCond(ZonePlenumNum)%ZoneNodeNum
ZoneRetPlenCond(ZonePlenumNum)%ZoneTemp = Node(ZoneNodeNum)%Temp
ZoneRetPlenCond(ZonePlenumNum)%ZoneHumRat = Node(ZoneNodeNum)%HumRat
ZoneRetPlenCond(ZonePlenumNum)%ZoneEnthalpy = Node(ZoneNodeNum)%Enthalpy
RETURN
END SUBROUTINE InitAirZoneReturnPlenum