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) | :: | CBVAVNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(inout) | :: | QZnReq | |||
real(kind=r64), | intent(out) | :: | QSensUnitOut | |||
real(kind=r64), | intent(inout) | :: | OnOffAirFlowRatio | |||
logical, | intent(inout) | :: | HXUnitOn |
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 SimCBVAV(CBVAVNum,FirstHVACIteration,QZnReq,QSensUnitOut,OnOffAirFlowRatio, HXUnitOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN July 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate a changeover-bypass VAV system.
! METHODOLOGY EMPLOYED:
! Calls ControlCBVAVOutput to obtain the desired unit output
! REFERENCES:
! na
! USE STATEMENTS:
USE Psychrometrics, ONLY: PsyHFnTdbW
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT (IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep
INTEGER, INTENT (IN) :: CBVAVNum ! Index of the current CBVAV system being simulated
REAL(r64), INTENT (INOUT) :: QZnReq ! Zone load for all zones served by this air loop system
REAL(r64), INTENT (OUT) :: QSensUnitOut ! Sensible delivered capacity [W]
REAL(r64), INTENT (INOUT) :: OnOffAirFlowRatio ! Ratio of compressor ON airflow to AVERAGE airflow over timestep
LOGICAL, INTENT (INOUT) :: HXUnitOn ! flag to enable heat exchanger
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: UnitOn ! TRUE if unit is on
INTEGER :: OutletNode ! CBVAV air outlet node
INTEGER :: InletNode ! CBVAV air inlet node
REAL(r64) :: QTotUnitOut ! Total delivered capacity [W]
REAL(r64) :: AirMassFlow ! Air mass flow rate [kg/s]
REAL(r64) :: HeatingPower ! Power consumption of DX heating coil or electric heating coil [W]
REAL(r64) :: MinOutletHumRat ! Minimum of inlet and outlet air humidity ratio [kg/kg]
REAL(r64) :: PartLoadFrac
! zero the fan and DX coils electricity consumption
FanElecPower = 0.0d0
DXElecCoolingPower = 0.0d0
DXElecHeatingPower = 0.0d0
ElecHeatingCoilPower = 0.0d0
SaveCompressorPLR = 0.0d0
! initialize local variables
UnitOn = .TRUE.
QSensUnitOut = 0.0d0
OutletNode = CBVAV(CBVAVNum)%AirOutNode
InletNode = CBVAV(CBVAVNum)%AirInNode
AirMassFlow = Node(InletNode)%MassFlowRate
PartLoadFrac = 0.0d0
! set the on/off flags
IF (CBVAV(CBVAVNum)%OPMode == CycFanCycCoil) THEN
! cycling unit only runs if there is a cooling or heating load.
IF (CBVAV(CBVAVNum)%HeatCoolMode .EQ. 0 .OR. AirMassFlow < SmallMassFlow) THEN
UnitOn = .FALSE.
END IF
ELSE IF (CBVAV(CBVAVNum)%OPMode == ContFanCycCoil) THEN
! continuous unit: fan runs if scheduled on; coil runs only if there is a cooling or heating load
IF (AirMassFlow.LT.SmallMassFlow) THEN
UnitOn = .FALSE.
END IF
END IF
OnOffFanPartLoadFraction = 1.0d0
IF(UnitOn)THEN
CALL ControlCBVAVOutput(CBVAVNum,FirstHVACIteration,QZnReq,PartLoadFrac,OnOffAirFlowRatio, HXUnitOn)
ELSE
CALL CalcCBVAV(CBVAVNum, FirstHVACIteration, PartLoadFrac, QSensUnitOut, QZnReq, OnOffAirFlowRatio, HXUnitOn)
END IF
! calculate delivered capacity
AirMassFlow = Node(OutletNode)%MassFlowRate
QTotUnitOut = AirMassFlow * (Node(OutletNode)%Enthalpy - Node(InletNode)%Enthalpy)
MinOutletHumRat = MIN(Node(InletNode)%HumRat,Node(OutletNode)%HumRat)
QSensUnitOut = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinOutletHumRat) - &
PsyHFnTdbW(Node(InletNode)%Temp,MinOutletHumRat))
! report variables
CBVAV(CBVAVNum)%CompPartLoadRatio = SaveCompressorPLR
IF (UnitOn) THEN
CBVAV(CBVAVNum)%FanPartLoadRatio = 1.0d0
ELSE
CBVAV(CBVAVNum)%FanPartLoadRatio = 0.0d0
END IF
CBVAV(CBVAVNum)%TotCoolEnergyRate = ABS(MIN(0.0d0, QTotUnitOut))
CBVAV(CBVAVNum)%TotHeatEnergyRate = ABS(MAX(0.0d0, QTotUnitOut))
CBVAV(CBVAVNum)%SensCoolEnergyRate = ABS(MIN(0.0d0, QSensUnitOut))
CBVAV(CBVAVNum)%SensHeatEnergyRate = ABS(MAX(0.0d0, QSensUnitOut))
CBVAV(CBVAVNum)%LatCoolEnergyRate = ABS(MIN(0.0d0, (QTotUnitOut - QSensUnitOut)))
CBVAV(CBVAVNum)%LatHeatEnergyRate = ABS(MAX(0.0d0, (QTotUnitOut - QSensUnitOut)))
IF(CBVAV(CBVAVNum)%HeatCoilType_Num .EQ. CoilDX_HeatingEmpirical)THEN
HeatingPower = DXElecHeatingPower
ELSEIF(CBVAV(CBVAVNum)%HeatCoilType_Num .EQ. Coil_HeatingElectric)THEN
HeatingPower = ElecHeatingCoilPower
ELSE
HeatingPower = 0.0d0
END IF
CBVAV(CBVAVNum)%ElecPower = FanElecPower + DXElecCoolingPower + HeatingPower
RETURN
END SUBROUTINE SimCBVAV