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) | :: | SysNum |
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 CalcATMixer(SysNum)
! SUBROUTINE INFORMATION:
! AUTHOR
! DATE WRITTEN March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE
! Calculate the mixed air flow and conditions in the air terminal mixer
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
USE Psychrometrics, ONLY:PsyTdbFnHW
Use DataEnvironment, ONLY: StdRhoAir
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS
INTEGER, INTENT(IN) :: SysNum
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: PriMassFlowRate = 0.0d0
REAL(r64) :: PriPressure = 0.0d0
REAL(r64) :: PriEnthalpy = 0.0d0
REAL(r64) :: PriHumRat = 0.0d0
REAL(r64) :: PriTemp = 0.0d0
REAL(r64) :: SecAirMassFlowRate = 0.0d0
REAL(r64) :: SecAirPressure = 0.0d0
REAL(r64) :: SecAirEnthalpy = 0.0d0
REAL(r64) :: SecAirHumRat = 0.0d0
REAL(r64) :: SecAirTemp = 0.0d0
REAL(r64) :: MixedAirMassFlowRate = 0.0d0
REAL(r64) :: MixedAirPressure = 0.0d0
REAL(r64) :: MixedAirEnthalpy = 0.0d0
REAL(r64) :: MixedAirHumRat = 0.0d0
REAL(r64) :: MixedAirTemp = 0.0d0
PriEnthalpy = Node(SysATMixer(SysNum)%PriInNode)%Enthalpy
PriHumRat = Node(SysATMixer(SysNum)%PriInNode)%HumRat
PriTemp = Node(SysATMixer(SysNum)%PriInNode)%Temp
PriMassFlowRate = Node(SysATMixer(SysNum)%PriInNode)%MassFlowRate
SecAirMassFlowRate = Node(SysATMixer(SysNum)%SecInNode)%MassFlowRate
SecAirEnthalpy = Node(SysATMixer(SysNum)%SecInNode)%Enthalpy
SecAirHumRat = Node(SysATMixer(SysNum)%SecInNode)%HumRat
SecAirTemp = Node(SysATMixer(SysNum)%SecInNode)%Temp
IF (SysATMixer(SysNum)%MixerType == ATMixer_SupplySide) THEN
MixedAirMassFlowRate = SecAirMassFlowRate + PriMassFlowRate
ELSE
! for inlet side mixer, the mixed air flow has been set, but we don't know the secondary flow
MixedAirMassFlowRate = Node(SysATMixer(SysNum)%MixedAirOutNode)%MassFlowRate
SecAirMassFlowRate = MAX(MixedAirMassFlowRate - PriMassFlowRate,0.0d0)
Node(SysATMixer(SysNum)%SecInNode)%MassFlowRate = SecAirMassFlowRate
END IF
! now calculate the mixed (outlet) conditions
IF (MixedAirMassFlowRate > 0.0d0) THEN
MixedAirEnthalpy = (SecAirMassFlowRate*SecAirEnthalpy + PriMassFlowRate*PriEnthalpy) / MixedAirMassFlowRate
MixedAirHumRat = (SecAirMassFlowRate*SecAirHumRat + PriMassFlowRate*PriHumRat) / MixedAirMassFlowRate
! Mixed air temperature is calculated from the mixed air enthalpy and humidity ratio.
MixedAirTemp = PsyTdbFnHW(MixedAirEnthalpy,MixedAirHumRat)
END IF
SysATMixer(SysNum)%MixedAirMassFlowRate = MixedAirMassFlowRate
SysATMixer(SysNum)%MixedAirEnthalpy = MixedAirEnthalpy
SysATMixer(SysNum)%MixedAirHumRat = MixedAirHumRat
SysATMixer(SysNum)%MixedAirTemp = MixedAirTemp
RETURN
END SUBROUTINE CalcATMixer