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 | ||
---|---|---|---|---|---|---|
logical, | intent(in), | optional | :: | FirstHVACIteration | ||
integer, | intent(in), | optional | :: | Iter | ||
logical, | intent(inout), | optional | :: | ResimulateAirZone |
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 ManageAirflowNetworkBalance(FirstHVACIteration, Iter, ResimulateAirZone)
! SUBROUTINE INFORMATION:
! AUTHOR Lixing Gu
! DATE WRITTEN July 28, 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine performs simulation of air distribution system.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataHVACGlobals, ONLY: TurnFansOn, TurnFansOff, VerySmallMassFlow
USE DataAirLoop, ONLY: LoopHeatingCoilMaxRTF,LoopONOffFanRTF,LoopDXCoilRTF,LoopOnOffFanPartLoadRatio, &
LoopSystemOnMassFlowrate,LoopFanOperationMode
USE DataAirSystems, ONLY: PrimaryAirSystem
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
LOGICAL, INTENT(IN), OPTIONAL :: FirstHVACIteration ! True when solution technique on first iteration
INTEGER, INTENT(IN), OPTIONAL :: Iter ! Iteration number
LOGICAL, INTENT(INOUT), OPTIONAL :: ResimulateAirZone ! True when solution technique on third iteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! na
if (AirflowNetworkGetInputFlag) then
CALL GetAirflowNetworkInput
AirflowNetworkGetInputFlag=.false.
Return
endif
If (PRESENT(ResimulateAirZone)) then
ResimulateAirZone = .FALSE.
End If
if (SimulateAirflowNetwork .lt. AirflowNetworkControlMultizone) return
IF (BeginEnvrnFlag) THEN
TurnFansOn = .FALSE. ! The FAN should be off when BeginEnvrnFlag = .True.
End If
CALL InitAirflowNetwork
NetworkNumOfNodes = NumOfNodesMultiZone
NetworkNumOfLinks = NumOfLinksMultiZone
AirflowNetworkFanActivated = .FALSE.
IF (PRESENT(FirstHVACIteration) .AND. SupplyFanInletNode > 0) THEN
If (FirstHVACIteration) then
LoopHeatingCoilMaxRTF =0.0d0
LoopONOffFanRTF =0.0d0
LoopDXCoilRTF =0.0d0
LoopOnOffFanPartLoadRatio =0.0d0
End If
! Revised to meet heat exchanger requirement
If ((Node(SupplyFanOutletNode)%MassFlowRate > VerySmallMassFlow) .AND. (.NOT. FirstHVACIteration)) then
If (LoopFanOperationMode .EQ. CycFanCycCoil) Then
If (LoopSystemOnMassFlowrate > 0) AirflowNetworkFanActivated = .TRUE.
Else If (SupplyFanType .EQ. FanType_SimpleVAV) Then
If (PRESENT(Iter) .AND. Iter > 1) AirflowNetworkFanActivated = .TRUE.
Else If (AirflowNetworkUnitarySystem) Then
If (PRESENT(Iter) .AND. Iter > 1) AirflowNetworkFanActivated = .TRUE.
Else
AirflowNetworkFanActivated = .TRUE.
End If
End If
End If
If (ALLOCATED(ZoneEquipConfig) .AND. NumHybridVentSysAvailMgrs > 0 .AND. ALLOCATED(PrimaryAirSystem)) &
CALL HybridVentilationControl
If (VentilationCtrl == 1 .AND. NumHybridVentSysAvailMgrs > 0) AirflowNetworkFanActivated = .FALSE.
If (PRESENT(Iter) .AND. PRESENT(ResimulateAirZone)) then
IF (AirflowNetworkFanActivated .and. Iter .LT. 3 .and. SupplyFanType .EQ. FanType_SimpleOnOff) then
ResimulateAirZone = .TRUE.
End If
IF (SupplyFanType .EQ. FanType_SimpleVAV) Then
IF (.NOT. AirflowNetworkFanActivated .AND. Iter .LT. 3) ResimulateAirZone = .TRUE.
End If
If (AirflowNetworkUnitarySystem) Then
IF (.NOT. AirflowNetworkFanActivated .AND. Iter .LT. 3) ResimulateAirZone = .TRUE.
End If
End If
if (AirflowNetworkFanActivated .and. SimulateAirflowNetwork > AirflowNetworkControlMultizone) then
NetworkNumOfNodes = AirflowNetworkNumOfNodes
NetworkNumOfLinks = AirflowNetworkNumOfLinks
End if
If (ALLOCATED(ZoneEquipConfig)) CALL ValidateExhaustFanInput
! VAV terminal set only
If (PRESENT(FirstHVACIteration) .AND. FirstHVACIteration) VAVTerminalRatio = 0.d0
if (AirflowNetworkFanActivated .and. SimulateAirflowNetwork > AirflowNetworkControlMultizone) then
CALL ValidateDistributionSystem
End If
Call CalcAirflowNetworkAirBalance
if (AirflowNetworkFanActivated .and. SimulateAirflowNetwork > AirflowNetworkControlMultizone) then
Call CalcAirflowNetworkHeatBalance
Call CalcAirflowNetworkMoisBalance
IF (Contaminant%CO2Simulation) Call CalcAirflowNetworkCO2Balance
IF (Contaminant%GenericContamSimulation) Call CalcAirflowNetworkGCBalance
endif
Call UpdateAirflownetwork(FirstHVACIteration)
RETURN
END SUBROUTINE ManageAirflowNetworkBalance