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 | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | ZoneNode | |||
integer, | intent(in) | :: | HCoilType | |||
real(kind=r64), | intent(in) | :: | HWFlow | |||
real(kind=r64), | intent(in) | :: | HCoilReq | |||
integer, | intent(in) | :: | FanType | |||
real(kind=r64), | intent(in) | :: | AirFlow | |||
integer, | intent(in) | :: | FanOn | |||
real(kind=r64), | intent(out) | :: | LoadMet |
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 CalcVAVVS(SysNum,FirstHVACIteration,ZoneNode,HCoilType,HWFlow,HCoilReq,FanType,AirFlow,FanOn,LoadMet)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN July 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate the components making up the VAV terminal unit with variable speed fan.
! METHODOLOGY EMPLOYED:
! Simulates the unit components sequentially in the air flow direction.
! REFERENCES:
! na
! USE STATEMENTS:
Use WaterCoils, Only: SimulateWaterCoilComponents
Use HeatingCoils, Only: SimulateHeatingCoilComponents
Use Fans, Only: SimulateFanComponents
Use DataHVACGlobals, Only: TurnFansOff
Use SteamCoils, Only: SimulateSteamCoilComponents
USE PlantUtilities, ONLY: SetComponentFlowRate
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: SysNum ! Unit index
LOGICAL, INTENT (IN) :: FirstHVACIteration ! flag for 1st HVAV iteration in the time step
INTEGER, INTENT (IN) :: ZoneNode ! zone node number
INTEGER, INTENT (IN) :: HCoilType ! type of hot water coil !unused1208
REAL(r64), INTENT (IN) :: HWFlow ! hot water flow (kg/s)
REAL(r64), INTENT (IN) :: HCoilReq ! gas or elec coil demand requested
INTEGER, INTENT (IN) :: FanType ! type of fan
REAL(r64), INTENT (IN) :: AirFlow ! air flow rate (kg/s)
INTEGER, INTENT (IN) :: FanOn ! 1 means fan is on
REAL(r64), INTENT (OUT) :: LoadMet ! load met by unit (watts)
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: FanInNode ! unit air inlet node (fan inlet)
INTEGER :: FanOutNode ! fan outlet node (heating coil inlet node)
INTEGER :: HCOutNode ! unit air outlet node (heating coil air outlet node)
INTEGER :: HotControlNode ! the hot water inlet node
REAL(r64) :: AirMassFlow ! total air mass flow rate [kg/s]
REAL(r64) :: CpAirZn ! zone air specific heat [J/kg-C]
Logical :: TurnFansOffSav ! save the fan off flag
REAL(r64) :: mdot
TurnFansOffSav = TurnFansOff
FanInNode = Sys(SysNum)%InletNodeNum
FanOutNode = Sys(SysNum)%OutletNodeNum
HCOutNode = Sys(SysNum)%ReheatAirOutletNode
HotControlNode = Sys(SysNum)%ReheatControlNode
AirMassFlow = AirFlow
Node(FanInNode)%MassFlowRate = AirMassFlow
CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode)%HumRat,Node(ZoneNode)%Temp)
IF (FanType == FanType_VS .AND. FanOn == 1) THEN
CALL SimulateFanComponents(Sys(SysNum)%FanName,FirstHVACIteration,Sys(SysNum)%Fan_Index)
ELSE ! pass through conditions
TurnFansOff = .TRUE.
CALL SimulateFanComponents(Sys(SysNum)%FanName,FirstHVACIteration,Sys(SysNum)%Fan_Index)
TurnFansOff = TurnFansOffSav
Node(FanOutNode)%MassFlowRate = Node(FanInNode)%MassFlowRate
Node(FanOutNode)%MassFlowRateMaxAvail = Node(FanInNode)%MassFlowRateMaxAvail
Node(FanOutNode)%MassFlowRateMinAvail = Node(FanInNode)%MassFlowRateMinAvail
END IF
SELECT CASE(Sys(SysNum)%ReheatComp_Num)
CASE(HCoilType_SimpleHeating) ! COIL:WATER:SIMPLEHEATING
mdot = HWFlow
IF (Sys(SysNum)%HWLoopNum > 0 ) THEN
CALL SetComponentFlowRate(mdot, &
Sys(SysNum)%ReheatControlNode, &
Sys(SysNum)%ReheatCoilOutletNode, &
Sys(SysNum)%HWLoopNum, &
Sys(SysNum)%HWLoopSide, &
Sys(SysNum)%HWBranchIndex, &
Sys(SysNum)%HWCompIndex)
ENDIF
CALL SimulateWaterCoilComponents(Sys(SysNum)%ReheatName,FirstHVACIteration,Sys(SysNum)%ReheatComp_Index)
CASE(HCoilType_SteamAirHeating) ! HW Flow is steam mass flow here
mdot = HWFlow
IF (Sys(SysNum)%HWLoopNum > 0 ) THEN
CALL SetComponentFlowRate(mdot, &
Sys(SysNum)%ReheatControlNode, &
Sys(SysNum)%ReheatCoilOutletNode, &
Sys(SysNum)%HWLoopNum, &
Sys(SysNum)%HWLoopSide, &
Sys(SysNum)%HWBranchIndex, &
Sys(SysNum)%HWCompIndex)
ENDIF
CALL SimulateSteamCoilComponents(Sys(SysNum)%ReheatName,FirstHVACIteration,HCoilReq,Sys(SysNum)%ReheatComp_Index)
CASE(HCoilType_Electric) ! COIL:ELECTRIC:HEATING
CALL SimulateHeatingCoilComponents(Sys(SysNum)%ReheatName,FirstHVACIteration,HCoilReq,Sys(SysNum)%ReheatComp_Index)
CASE(HCoilType_Gas) ! COIL:GAS:HEATING
CALL SimulateHeatingCoilComponents(Sys(SysNum)%ReheatName,FirstHVACIteration,HCoilReq,Sys(SysNum)%ReheatComp_Index)
CASE DEFAULT
CALL ShowFatalError('Invalid Reheat Component='//TRIM(Sys(SysNum)%ReheatComp))
END SELECT
LoadMet = AirMassFlow*CpAirZn*(Node(HCOutNode)%Temp-Node(ZoneNode)%Temp)
RETURN
END SUBROUTINE CalcVAVVS