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) | :: | SplitterNum | |||
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 InitAirLoopSplitter(SplitterNum, FirstHVACIteration, FirstCall)
! SUBROUTINE INFORMATION:
! AUTHOR Richard J. Liesen
! DATE WRITTEN March 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initialisations of the Splitter Components.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger events.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataEnvironment, ONLY : OutBaroPress, OutHumRat
USE Psychrometrics, ONly : PsyHFnTdbW
USE DataContaminantBalance, ONLY: Contaminant, OutdoorCO2, OutdoorGC
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: SplitterNum
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 :: NodeNum
REAL(r64) :: AirEnthalpy ! [J/kg]
LOGICAL,SAVE :: MyEnvrnFlag=.true.
! FLOW:
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag) THEN
! Calculate the air density and enthalpy for standard conditions...
AirEnthalpy = PsyHFnTdbW(20.0d0,OutHumRat)
! Initialize the inlet node to s standard set of conditions so that the
! flows match around the loop & do not cause convergence problems.
InletNode = SplitterCond(SplitterNum)%InletNode
Node(InletNode)%Temp = 20.0d0
Node(InletNode)%HumRat = OutHumRat
Node(InletNode)%Enthalpy = AirEnthalpy
Node(InletNode)%Press = OutBaroPress
IF (Contaminant%CO2Simulation) Then
Node(InletNode)%CO2 = OutdoorCO2
End If
IF (Contaminant%GenericContamSimulation) Then
Node(InletNode)%GenContam = OutdoorGC
End If
MyEnvrnFlag = .FALSE.
END IF
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag=.true.
ENDIF
! Set the inlet node for the Splitter
InletNode = SplitterCond(SplitterNum)%InletNode
! Do the following initializations (every time step): This should be the info from
! the previous components outlets or the node data in this section.
! Load the node data in this section for the component simulation
! This section is very important to understand. The system off condition is important
! transfer around the loop even if the splitter does not have enough information to
! calculate the correct flow rates since the dampers are downstream and there is no pressure
! simulation. What happens in this section is the flow from upstream is not zero is
! arbitrarily split by the number of inlet nodes. This is by no way meant to determine the
! correct split flow! Just to give each outlet a non-zero flow so that the Air Distribution
! Unit(ADU) downstream knows that the system is operating or has flow. This is only done the first
! iteration through and the splitter first pass. After the first iteration the ADU sets the
! correct flow and that is used and passed back upstream.
IF (FirstHVACIteration .AND. FirstCall) THEN
IF(Node(InletNode)%MassFlowRate > 0.0d0) Then
DO NodeNum = 1, SplitterCond(SplitterNum)%NumOutletNodes
OutletNode = SplitterCond(SplitterNum)%OutletNode(NodeNum)
Node(OutletNode)%MassFlowRate = Node(InletNode)%MassFlowRate/ &
SplitterCond(SplitterNum)%NumOutletNodes
END DO
END IF
IF(Node(InletNode)%MassFlowRateMaxAvail > 0.0d0) Then
DO NodeNum = 1, SplitterCond(SplitterNum)%NumOutletNodes
OutletNode = SplitterCond(SplitterNum)%OutletNode(NodeNum)
Node(OutletNode)%MassFlowRateMaxAvail = Node(InletNode)%MassFlowRateMaxAvail/ &
SplitterCond(SplitterNum)%NumOutletNodes
END DO
END IF
END IF !For FirstHVACIteration and FirstCall
IF (FirstCall) THEN
!There is one exception to the rule stated above and that is if the system shuts OFF
! for some operational or algorithm dependency. This IF block should catch that condition
! and then pass the NO flow condition downstream to the waiting ADU's. Most of the time
! this IF is jumped over.
IF(Node(InletNode)%MassFlowRateMaxAvail == 0.0d0) Then
DO NodeNum = 1, SplitterCond(SplitterNum)%NumOutletNodes
OutletNode = SplitterCond(SplitterNum)%OutletNode(NodeNum)
Node(OutletNode)%MassFlowRate = 0.0d0
Node(OutletNode)%MassFlowRateMaxAvail = 0.0d0
Node(OutletNode)%MassFlowRateMinAvail = 0.0d0
END DO
End IF !For Node inlet Max Avail = 0.0
!Pass the State Properties through every time. This is what mainly happens each time
! through the splitter,
InletNode = SplitterCond(SplitterNum)%InletNode
SplitterCond(SplitterNum)%InletTemp = Node(InletNode)%Temp
SplitterCond(SplitterNum)%InletHumRat = Node(InletNode)%HumRat
SplitterCond(SplitterNum)%InletEnthalpy = Node(InletNode)%Enthalpy
SplitterCond(SplitterNum)%InletPressure = Node(InletNode)%Press
Else !On the second call from the ZoneEquipManager this is where the flows are passed back to
! the splitter inlet.
DO NodeNum = 1, SplitterCond(SplitterNum)%NumOutletNodes
OutletNode = SplitterCond(SplitterNum)%OutletNode(NodeNum)
SplitterCond(SplitterNum)%OutletMassFlowRate(NodeNum) = Node(OutletNode)%MassFlowRate
SplitterCond(SplitterNum)%OutletMassFlowRateMaxAvail(NodeNum) = Node(OutletNode)%MassFlowRateMaxAvail
SplitterCond(SplitterNum)%OutletMassFlowRateMinAvail(NodeNum) = Node(OutletNode)%MassFlowRateMinAvail
End Do
END IF !For FirstCall
RETURN
END SUBROUTINE InitAirLoopSplitter