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.
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 CalcAirflowNetworkAirBalance
! SUBROUTINE INFORMATION:
! AUTHOR Lixing Gu
! DATE WRITTEN Oct. 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine performs simulations of nodal pressures and linkage airflows.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
Use DataAirLoop , Only: AirToZoneNodeInfo
USE DataHVACGlobals, ONLY: TurnFansOn, TurnFansOff
USE InputProcessor, ONLY: SameString ! NEEDS TO BE CHANGED after V1.3 release!!!
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
integer I,j,N
REAL(r64) Vref
LOGICAL,SAVE :: OneTimeFlag = .True.
LOGICAL :: ErrorsFound=.false.
REAL(r64) GlobalOpenFactor
! Validate supply and return connections
if (OneTimeFlag) then
OneTimeFlag = .False.
IF (ErrorsFound) THEN
CALL ShowFatalError('GetAirflowNetworkInput: Program terminates for preceding reason(s).')
ENDIF
end if
DO N=1,NetworkNumOfNodes
if (AirflowNetworkNodeData(N)%NodeTypeNum.EQ.0) then
AirflowNetworkNodeSimu(N)%PZ = 0.0d0
else
! Assing ambient conditions to external nodes
i = AirflowNetworkNodeData(N)%ExtNodeNum
if (i > 0) then
If (i .LE. AirflowNetworkNumOfExtNode) then
Vref = WindSpeedAt(MultizoneExternalNodeData(i)%height)
AirflowNetworkNodeSimu(N)%PZ = CalcWindPressure(MultizoneExternalNodeData(i)%CPVNum,Vref, &
AirflowNetworkNodeData(N)%NodeHeight)
End if
AirflowNetworkNodeSimu(N)%TZ = OutDryBulbTempAt(AirflowNetworkNodeData(N)%NodeHeight)
AirflowNetworkNodeSimu(N)%WZ = OutHumRat
else
CALL ShowSevereError('GetAirflowNetworkInput: AIRFLOWNETWORK:DISTRIBUTION:NODE: Invalid external node = ' &
//TRIM(AirflowNetworkNodeData(N)%Name))
ErrorsFound=.true.
end if
end if
END DO
Do i=1,AirflowNetworkNumOfSurfaces
MultizoneSurfaceData(i)%OpenFactor = 0.0d0
j = MultizoneSurfaceData(i)%SurfNum
If (SurfaceWindow(j)%OriginalClass == SurfaceClass_Window .OR. SurfaceWindow(j)%OriginalClass == SurfaceClass_Door &
.OR. SurfaceWindow(j)%OriginalClass == SurfaceClass_GlassDoor) then
Call AirflowNetworkVentingControl(i,MultizoneSurfaceData(i)%OpenFactor)
MultizoneSurfaceData(i)%OpenFactor = MultizoneSurfaceData(i)%OpenFactor*MultizoneSurfaceData(i)%WindModifier
If (MultizoneSurfaceData(i)%HybridVentClose) MultizoneSurfaceData(i)%OpenFactor = 0.0d0
if (AirflowNetworkFanActivated .AND. (SimulateAirflowNetwork > AirflowNetworkControlMultizone).AND. &
MultizoneSurfaceData(i)%OpenFactor .GT. 0.0d0 .AND. Surface(j)%ExtBoundCond == ExternalEnvironment .AND. &
.NOT. WarmUpFlag) then
! Exterior Large opening only
MultizoneSurfaceData(i)%ExtLargeOpeningErrCount = MultizoneSurfaceData(i)%ExtLargeOpeningErrCount + 1
if (MultizoneSurfaceData(i)%ExtLargeOpeningErrCount < 2) then
CALL ShowWarningError('AirflowNetwork: The window or door is open during HVAC system operation ' &
//TRIM(MultizoneSurfaceData(i)%SurfName))
CALL ShowContinueError('The window or door opening factor is ' &
//Trim(RoundSigDigits(MultizoneSurfaceData(i)%OpenFactor,2)))
CALL ShowContinueErrorTimeStamp(' ')
else
CALL ShowRecurringWarningErrorAtEnd('AirFlowNetwork: '//TRIM(MultizoneSurfaceData(i)%SurfName)//&
' The window or door is open during HVAC system operation error continues...', &
MultizoneSurfaceData(i)%ExtLargeOpeningErrIndex, MultizoneSurfaceData(i)%OpenFactor, &
MultizoneSurfaceData(i)%OpenFactor)
end if
End If
If (MultizoneSurfaceData(i)%OpenFactor .GT. 1.0d0) then
MultizoneSurfaceData(i)%OpenFactorErrCount = MultizoneSurfaceData(i)%OpenFactorErrCount + 1
if (MultizoneSurfaceData(i)%OpenFactorErrCount < 2) then
CALL ShowWarningError('AirflowNetwork: The window or door opening factor is greater than 1.0 ' &
//TRIM(MultizoneSurfaceData(i)%SurfName))
CALL ShowContinueErrorTimeStamp(' ')
else
CALL ShowRecurringWarningErrorAtEnd('AirFlowNetwork: '//TRIM(MultizoneSurfaceData(i)%SurfName)//&
' The window or door opening factor is greater than 1.0 error continues...' &
, MultizoneSurfaceData(i)%OpenFactorErrIndex, MultizoneSurfaceData(i)%OpenFactor, MultizoneSurfaceData(i)%OpenFactor)
end if
End If
end if
end do
! Check if the global ventilation control is applied or not
GlobalOpenFactor = -1.0d0
Do i=1,AirflowNetworkNumOfSurfaces
If (MultizoneSurfaceData(i)%HybridCtrlMaster) Then
GlobalOpenFactor = MultizoneSurfaceData(i)%OpenFactor
Exit
End If
End Do
If (GlobalOpenFactor .GE. 0.0d0) Then
Do i=1,AirflowNetworkNumOfSurfaces
j = MultizoneSurfaceData(i)%SurfNum
If (SurfaceWindow(j)%OriginalClass == SurfaceClass_Window .OR. SurfaceWindow(j)%OriginalClass == SurfaceClass_Door &
.OR. SurfaceWindow(j)%OriginalClass == SurfaceClass_GlassDoor) then
If (MultizoneSurfaceData(i)%HybridCtrlGlobal) Then
MultizoneSurfaceData(i)%OpenFactor = GlobalOpenFactor
End If
End If
End Do
End IF
CALL InitAirflowNetworkData
CALL AIRMOV
RETURN
END SUBROUTINE CalcAirflowNetworkAirBalance