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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | DXCoolingSystemName | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | AirLoopNum | |||
integer, | intent(inout) | :: | CompIndex | |||
integer, | intent(in), | optional | :: | OAUnitNum | ||
real(kind=r64), | intent(in), | optional | :: | OAUCoilOutTemp | ||
real(kind=r64), | intent(inout), | optional | :: | QTotOut |
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 SimDXCoolingSystem(DXCoolingSystemName, FirstHVACIteration, AirLoopNum,CompIndex,OAUnitNum,OAUCoilOutTemp,QTotOut)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN Mar 2001
! MODIFIED Richard Raustad, Sept 2003 (added HVACHXAssistedCoolingCoil)
! Feb 2005 M. J. Witte, GARD Analytics, Inc.
! Add support for multimode DX coil
! Feb 2013 Bo Shen, Oak Ridge National Lab
! Add Coil:Cooling:DX:VariableSpeed, capable of both sensible and latent cooling
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages DXCoolingSystem component simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DXCoils, ONLY: SimDXCoil, SimDXCoilMultiSpeed, SimDXCoilMultiMode
USE General, ONLY: TrimSigDigits
USE DataAirLoop, ONLY: AirLoopControlInfo
USE InputProcessor, ONLY: FindItemInList
USE HVACHXAssistedCoolingCoil, ONLY: SimHXAssistedCoolingCoil
USE VariableSpeedCoils, ONLY: SimVariableSpeedCoils
USE PackagedThermalStorageCoil, ONLY: SimTESCoil
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: DXCoolingSystemName ! Name of DXSystem:Airloop object
LOGICAL, INTENT(IN) :: FirstHVACIteration ! True when first HVAC iteration
INTEGER, INTENT(IN) :: AirLoopNum ! Primary air loop number
INTEGER, INTENT(INOUT) :: CompIndex ! Index to DXSystem:Airloop object
INTEGER, INTENT(IN), OPTIONAL:: OAUnitNum ! If the system is an equipment of OutdoorAirUnit
REAL(r64), INTENT(IN), OPTIONAL :: OAUCoilOutTemp ! the coil inlet temperature of OutdoorAirUnit
REAL(r64), INTENT(INOUT), OPTIONAL :: QTotOut ! the total cooling output of unit
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DEFINITIONS:
! na
! FLOW:
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompName ! Name of DXSystem:Airloop object
INTEGER :: DXSystemNum ! Index to DXSystem:Airloop object
LOGICAL :: HXUnitOn ! Flag to control HX for HXAssisted Cooling Coil
REAL(r64) :: AirMassFlow ! DX System air mass flow rate
INTEGER :: InletNodeNum ! DX System inlet node number
INTEGER :: OutletNodeNum ! DX System outlet node number
!local variables for calling variable speed coil
REAL(r64) :: QZnReq = 0.001d0 ! Zone load (W), input to variable-speed DX coil
REAL(r64) :: QLatReq = 0.0d0 ! Zone latent load, input to variable-speed DX coil
REAL(r64) :: MaxONOFFCyclesperHour = 4.0d0 ! Maximum cycling rate of heat pump [cycles/hr]
REAL(r64) :: HPTimeConstant = 0.0d0 ! Heat pump time constant [s]
REAL(r64) :: FanDelayTime = 0.0d0 ! Fan delay time, time delay for the HP's fan to
REAL(r64) :: OnOffAirFlowRatio = 1.0d0 ! ratio of compressor on flow to average flow over time step
! Obtains and Allocates DX Cooling System related parameters from input file
IF (GetInputFlag) THEN !First time subroutine has been entered
!Get the DXCoolingSystem input
CALL GetDXCoolingSystemInput
GetInputFlag=.false.
End If
! Find the correct DXSystemNumber
IF (CompIndex == 0) THEN
DXSystemNum = FindItemInList(DXCoolingSystemName,DXCoolingSystem%Name,NumDXSystem)
IF (DXSystemNum == 0) THEN
CALL ShowFatalError('SimDXCoolingSystem: DXUnit not found='//TRIM(DXCoolingSystemName))
ENDIF
CompIndex=DXSystemNum
ELSE
DXSystemNum=CompIndex
IF (DXSystemNum > NumDXSystem .or. DXSystemNum < 1) THEN
CALL ShowFatalError('SimulateDXCoolingSystem: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXSystemNum))// &
', Number of DX Units='//TRIM(TrimSigDigits(NumDXSystem))// &
', DX Unit name='//TRIM(DXCoolingSystemName))
ENDIF
IF (CheckEquipName(DXSystemNum)) THEN
IF (DXCoolingSystemName /= DXCoolingSystem(DXSystemNum)%Name) THEN
CALL ShowFatalError('SimulateDXCoolingSystem: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXSystemNum))// &
', DX Unit name='//TRIM(DXCoolingSystemName)//', stored DX Unit Name for that index='// &
TRIM(DXCoolingSystem(DXSystemNum)%Name))
ENDIF
CheckEquipName(DXSystemNum)=.false.
ENDIF
ENDIF
Call InitDXCoolingSystem(DXSystemNum,AirLoopNum,OAUnitNUm,OAUCoilOutTemp)
!Call the series of components that simulate a DX Cooling System
! Control the DX Cooling System
HXUnitOn = .FALSE.
Call ControlDXSystem(DXSystemNum, FirstHVACIteration, HXUnitOn)
! simulate DX Cooling System
CompName = DXCoolingSystem(DXSystemNum)%CoolingCoilName
!Need a cooling System call here I think
SELECT CASE(DXCoolingSystem(DXSystemNum)%CoolingCoilType_Num)
CASE (CoilDX_CoolingSingleSpeed) ! COIL:DX:COOLINGBYPASSFACTOREMPIRICAL
CALL SimDXCoil(CompName,On,FirstHVACIteration, DXCoolingSystem(DXSystemNum)%PartLoadFrac, &
DXCoolingSystem(DXSystemNum)%CoolingCoilIndex, &
DXCoolingSystem(DXSystemNum)%FanOpMode)
CASE (CoilDX_CoolingHXAssisted) ! CoilSystem:Cooling:DX:HeatExchangerAssisted
CALL SimHXAssistedCoolingCoil(CompName,FirstHVACIteration,On,DXCoolingSystem(DXSystemNum)%PartLoadFrac, &
DXCoolingSystem(DXSystemNum)%CoolingCoilIndex, DXCoolingSystem(DXSystemNum)%FanOpMode, &
HXUnitEnable=HXUnitOn,EconomizerFlag=EconomizerFlag)
CASE (CoilDX_CoolingTwoSpeed) ! Coil:Cooling:DX:TwoSpeed
! formerly (v3 and beyond)COIL:DX:MULTISPEED:COOLINGEMPIRICAL
CALL SimDXCoilMultiSpeed(CompName,DXCoolingSystem(DXSystemNum)%SpeedRatio,&
DXCoolingSystem(DXSystemNum)%CycRatio,DXCoolingSystem(DXSystemNum)%CoolingCoilIndex)
CASE (CoilDX_CoolingTwoStageWHumControl) ! Coil:Cooling:DX:TwoStageWithHumidityControlMode
! formerly (v3 and beyond) COIL:DX:MULTIMODE:COOLINGEMPIRICAL
CALL SimDXCoilMultiMode(CompName,On,FirstHVACIteration,DXCoolingSystem(DXSystemNum)%PartLoadFrac, &
DXCoolingSystem(DXSystemNum)%DehumidificationMode,DXCoolingSystem(DXSystemNum)%CoolingCoilIndex, &
DXCoolingSystem(DXSystemNum)%FanOpMode)
CASE (Coil_CoolingAirToAirVariableSpeed) ! Coil:Cooling:DX:VariableSpeed
Call SimVariableSpeedCoils(CompName,DXCoolingSystem(DXSystemNum)%CoolingCoilIndex,&
DXCoolingSystem(DXSystemNum)%FanOpMode, MaxONOFFCyclesperHour, &
HPTimeConstant,FanDelayTime,&
On, DXCoolingSystem(DXSystemNum)%PartLoadFrac, OnOffAirFlowRatio, &
DXCoolingSystem(DXSystemNum)%SpeedNum, DXCoolingSystem(DXSystemNum)%SpeedRatio, QZnReq, QLatReq)
CASE ( CoilDX_PackagedThermalStorageCooling )
CALL SimTESCoil( CompName,DXCoolingSystem(DXSystemNum)%CoolingCoilIndex,&
DXCoolingSystem(DXSystemNum)%FanOpMode, DXCoolingSystem(DXSystemNum)%TESOpMode, &
DXCoolingSystem(DXSystemNum)%PartLoadFrac)
CASE DEFAULT
CALL ShowFatalError('SimDXCoolingSystem: Invalid DX Cooling System/Coil='// &
TRIM(DXCoolingSystem(DXSystemNum)%CoolingCoilType))
END SELECT
! set econo lockout flag
! set econo lockout flag
IF (AirLoopNum /=-1) THEN ! IF the sysem is not an equipment of outdoor air unit
IF ( (DXCoolingSystem(DXSystemNum)%PartLoadFrac > 0.0d0 .OR. &
DXCoolingSystem(DXSystemNum)%SpeedRatio > 0.0d0 .OR. &
DXCoolingSystem(DXSystemNum)%CycRatio > 0.0d0) .AND. &
AirLoopControlInfo(AirLoopNum)%CanLockoutEconoWithCompressor) THEN
AirLoopControlInfo(AirLoopNum)%ReqstEconoLockoutWithCompressor = .TRUE.
ELSE
AirLoopControlInfo(AirLoopNum)%ReqstEconoLockoutWithCompressor = .FALSE.
END IF
END IF
IF(PRESENT(QTotOut))THEN
InletNodeNum = DXCoolingSystem(DXSystemNum)%DXCoolingCoilInletNodeNum
OutletNodeNum = DXCoolingSystem(DXSystemNum)%DXCoolingCoilOutletNodeNum
AirMassFlow = Node(OutletNodeNum)%MassFlowRate
QTotOut = AirMassFlow * (Node(InletNodeNum)%Enthalpy - Node(OutletNodeNum)%Enthalpy)
END IF
RETURN
END SUBROUTINE SimDXCoolingSystem