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) | :: | DamperNum | |||
integer, | intent(in) | :: | ZoneNum | |||
integer, | intent(in) | :: | ZoneNodeNum |
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 SimDualDuctConstVol(DamperNum, ZoneNum, ZoneNodeNum)
! SUBROUTINE INFORMATION:
! AUTHOR Richard J. Liesen
! DATE WRITTEN Jan 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine simulates the simple mixing damper.
! METHODOLOGY EMPLOYED:
! There is method to this madness.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEnergyDemands
!unused0909 USE DataHeatBalFanSys, ONLY: Mat
USE Psychrometrics , ONLY:PsyCpAirFnWTdb, PsyTdbFnHW
USE DataHVACGlobals, ONLY:SmallTempDiff
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
Integer, Intent(IN) :: DamperNum
INTEGER, INTENT(IN) :: ZoneNum
INTEGER, INTENT (IN):: ZoneNodeNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: MassFlow ! [kg/sec] Total Mass Flow Rate from Hot & Cold Inlets
REAL(r64) :: HumRat ! [Kg Moisture / Kg dry air]
REAL(r64) :: Enthalpy ! [Watts]
REAL(r64) :: Temperature ! [C]
REAL(r64) :: QTotLoad ! [W]
REAL(r64) :: QZnReq ! [W]
REAL(r64) :: CpAirZn
REAL(r64) :: CpAirSysHot
REAL(r64) :: CpAirSysCold
! Get the calculated load from the Heat Balance from ZoneSysEnergyDemand
QTotLoad=ZoneSysEnergyDemand(ZoneNum)%RemainingOutputRequired
! Need the design massflowrate for calculations
IF (GetCurrentScheduleValue(Damper(DamperNum)%SchedPtr) .gt. 0.0d0) THEN
MassFlow = DamperHotAirInlet(DamperNum)%AirMassFlowRateMaxAvail/2.0d0 + &
DamperColdAirInlet(DamperNum)%AirMassFlowRateMaxAvail/2.0d0
ELSE
MassFlow = 0.d0
ENDIF
! If there is massflow then need to provide the correct amount of total
! required zone energy
If(MassFlow .GT. SmallMassFlow) Then
CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum)%HumRat,Node(ZoneNodeNum)%Temp)
QZnReq = QTotLoad + Massflow * CpAirZn * Node(ZoneNodeNum)%Temp
! If the enthalpy is the same for the hot and cold duct then there would be a
! divide by zero so for heating or cooling set the damper to one max flow
! or the other.
If(ABS(DamperColdAirInlet(DamperNum)%AirTemp - DamperHotAirInlet(DamperNum)%AirTemp) > SmallTempDiff) Then
! CpAirSysHot = PsyCpAirFnWTdb(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp)
! CpAirSysCold= PsyCpAirFnWTdb(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp)
CpAirSysHot = CpAirZn
CpAirSysCold= CpAirZn
!Determine the Cold Air Mass Flow Rate
DamperColdAirInlet(DamperNum)%AirMassFlowRate = (QZnReq - MassFlow*CpAirSysHot*DamperHotAirInlet(DamperNum)%AirTemp)/ &
(CpAirSysCold*DamperColdAirInlet(DamperNum)%AirTemp - CpAirSysHot*DamperHotAirInlet(DamperNum)%AirTemp)
Else If((QTotLoad > 0.0d0) .And. (DamperHotAirInlet(DamperNum)%AirMassFlowRate > 0.0d0)) Then
DamperColdAirInlet(DamperNum)%AirMassFlowRate = 0.0d0
Else
DamperColdAirInlet(DamperNum)%AirMassFlowRate = MassFlow
End If
! Check to make sure that the calculated flow is not greater than the available flows
IF(DamperColdAirInlet(DamperNum)%AirMassFlowRate .gt. DamperColdAirInlet(DamperNum)%AirMassFlowRateMaxAvail) Then
DamperColdAirInlet(DamperNum)%AirMassFlowRate = DamperColdAirInlet(DamperNum)%AirMassFlowRateMaxAvail
Else If(DamperColdAirInlet(DamperNum)%AirMassFlowRate .lt. DamperColdAirInlet(DamperNum)%AirMassFlowRateMinAvail)Then
DamperColdAirInlet(DamperNum)%AirMassFlowRate = DamperColdAirInlet(DamperNum)%AirMassFlowRateMinAvail
End If
! Using Mass Continuity to determine the other duct flow quantity
DamperHotAirInlet(DamperNum)%AirMassFlowRate = MassFlow - DamperColdAirInlet(DamperNum)%AirMassFlowRate
IF(DamperHotAirInlet(DamperNum)%AirMassFlowRate .gt. DamperHotAirInlet(DamperNum)%AirMassFlowRateMaxAvail) Then
DamperHotAirInlet(DamperNum)%AirMassFlowRate = DamperHotAirInlet(DamperNum)%AirMassFlowRateMaxAvail
Else If(DamperHotAirInlet(DamperNum)%AirMassFlowRate .lt. DamperHotAirInlet(DamperNum)%AirMassFlowRateMinAvail)Then
DamperHotAirInlet(DamperNum)%AirMassFlowRate = DamperHotAirInlet(DamperNum)%AirMassFlowRateMinAvail
End If
MassFlow = DamperColdAirInlet(DamperNum)%AirMassFlowRate + DamperHotAirInlet(DamperNum)%AirMassFlowRate
Else
! System is Off set massflow to 0.0
MassFlow = 0.0d0
End If
If(MassFlow .GT. SmallMassFlow) Then
! After flows are calculated then calculate the mixed air flow properties.
HumRat = (DamperHotAirInlet(DamperNum)%AirHumRat * &
DamperHotAirInlet(DamperNum)%AirMassFlowRate + &
DamperColdAirInlet(DamperNum)%AirHumRat * &
DamperColdAirInlet(DamperNum)%AirMassFlowRate) / MassFlow
Enthalpy = (DamperHotAirInlet(DamperNum)%AirEnthalpy * &
DamperHotAirInlet(DamperNum)%AirMassFlowRate + &
DamperColdAirInlet(DamperNum)%AirEnthalpy * &
DamperColdAirInlet(DamperNum)%AirMassFlowRate) / MassFlow
! If there is no air flow than calculate the No Flow conditions
Else
DamperColdAirInlet(DamperNum)%AirMassFlowRate = 0.0d0
DamperHotAirInlet(DamperNum)%AirMassFlowRate = 0.0d0
HumRat =(DamperHotAirInlet(DamperNum)%AirHumRat + DamperColdAirInlet(DamperNum)%AirHumRat)/2.0d0
Enthalpy = (DamperHotAirInlet(DamperNum)%AirEnthalpy + DamperColdAirInlet(DamperNum)%AirEnthalpy)/2.0d0
End IF
Temperature = PsyTdbFnHW(Enthalpy,HumRat)
! Load all properties in the damper outlet
DamperOutlet(DamperNum)%AirTemp = Temperature
DamperOutlet(DamperNum)%AirHumRat = HumRat
DamperOutlet(DamperNum)%AirMassFlowRate = MassFlow
DamperOutlet(DamperNum)%AirMassFlowRateMaxAvail = MassFlow
DamperOutlet(DamperNum)%AirMassFlowRateMinAvail = MIN(DamperHotAirInlet(DamperNum)%AirMassFlowRateMinAvail, &
DamperColdAirInlet(DamperNum)%AirMassFlowRateMinAvail)
DamperOutlet(DamperNum)%AirEnthalpy = Enthalpy
!Calculate the hot and cold damper position in %
If((DamperHotAirInlet(DamperNum)%AirmassFlowRateMax == 0.0d0) .or. &
(DamperColdAirInlet(DamperNum)%AirmassFlowRateMax == 0.0d0)) Then
Damper(DamperNum)%ColdAirDamperPosition = 0.0d0
Damper(DamperNum)%HotAirDamperPosition = 0.0d0
Else
Damper(DamperNum)%ColdAirDamperPosition = DamperColdAirInlet(DamperNum)%AirMassFlowRate/ &
DamperColdAirInlet(DamperNum)%AirmassFlowRateMax
Damper(DamperNum)%HotAirDamperPosition = DamperHotAirInlet(DamperNum)%AirMassFlowRate/ &
DamperHotAirInlet(DamperNum)%AirmassFlowRateMax
End If
RETURN
END SUBROUTINE SimDualDuctConstVol