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) | :: | UnitarySysNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=R64), | intent(in) | :: | PartLoadRatio | |||
integer, | intent(in) | :: | CompOn | |||
real(kind=R64), | intent(in) | :: | OnOffAirFlowRatio | |||
real(kind=R64), | intent(in) | :: | CoilCoolHeatRat | |||
logical, | intent(inout), | optional | :: | 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 CalcUnitaryCoolingSystem(UnitarySysNum, FirstHVACIteration, PartLoadRatio, &
CompOn, OnOffAirFlowRatio, CoilCoolHeatRat, HXUnitOn)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages unitary cooling system component simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DXCoils, ONLY: SimDXCoil, SimDXCoilMultiSpeed, SimDXCoilMultiMode
USE HVACHXAssistedCoolingCoil, ONLY: SimHXAssistedCoolingCoil
USE Fans, ONLY: SimulateFanComponents
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE VariableSpeedCoils, ONLY: SimVariableSpeedCoils
USE WatertoAirHeatPumpSimple, ONLY: SimWatertoAirHPSimple
USE WatertoAirHeatPump, ONLY: SimWaterToAirHP
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: UnitarySysNum ! Index of AirloopHVAC:UnitarySystem object
LOGICAL, INTENT(IN) :: FirstHVACIteration ! True when first HVAC iteration
REAL(R64), INTENT(IN) :: PartLoadRatio ! coil operating part-load ratio
INTEGER, INTENT(IN) :: CompOn ! compressor control (0=off, 1=on)
REAL(R64), INTENT(IN) :: OnOffAirFlowRatio !
REAL(R64), INTENT(IN) :: CoilCoolHeatRat ! ratio of cooling to heating PLR for cycling fan RH control
LOGICAL, INTENT(INOUT), OPTIONAL :: HXUnitOn ! Flag to control HX for HXAssisted Cooling Coil
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompName ! Name of Unitary System object
INTEGER :: CompIndex ! index to cooling coil
REAL(R64) :: OutsideDryBulbTemp ! outdoor temperature (C)
REAL(r64) :: mdot ! water side flow rate (kg/s)
REAL(r64) :: QActual ! actual coil output (W)
REAL(r64) :: OutdoorPressure ! Outdoor barometric pressure at condenser (Pa)
LOGICAL :: errflag ! returned flag from called routine
! Simulate the coil component
CompName = UnitarySystem(UnitarySysNum)%CoolingCoilName
CompIndex = UnitarySystem(UnitarySysNum)%CoolingCoilIndex
IF (UnitarySystem(UnitarySysNum)%CondenserNodeNum /= 0) THEN
OutdoorPressure = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%Press
! IF node is not connected to anything, pressure = default, use weather data
IF(OutdoorPressure == DefaultNodeValues%Press)THEN
OutsideDryBulbTemp = OutDryBulbTemp
! OutdoorHumRat = OutHumRat
! OutdoorPressure = OutBaroPress
! OutdoorWetBulb = OutWetBulbTemp
ELSE
OutsideDryBulbTemp = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%Temp
! OutdoorHumRat = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%HumRat
! OutdoorWetBulb = PsyTwbFnTdbWPb(OutdoorDryBulb,OutdoorHumRat,OutdoorPressure,RoutineName)
END IF
ELSE
OutsideDryBulbTemp = OutDryBulbTemp
! OutdoorHumRat = OutHumRat
! OutdoorPressure = OutBaroPress
! OutdoorWetBulb = OutWetBulbTemp
END IF
! PartLoadRatio = UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac
SELECT CASE(UnitarySystem(UnitarySysNum)%CoolingCoilType_Num)
CASE (CoilDX_CoolingSingleSpeed) ! Coil:Cooling:DX:SingleSpeed
CALL SimDXCoil(Blank,CompOn,FirstHVACIteration, PartLoadRatio, &
CompIndex, &
UnitarySystem(UnitarySysNum)%FanOpMode, &
CoilCoolingHeatingPLRRatio = CoilCoolHeatRat)
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE (CoilDX_CoolingHXAssisted,CoilWater_CoolingHXAssisted) ! CoilSystem:Cooling:*:HeatExchangerAssisted
IF(UnitarySystem(UnitarySysNum)%CoolingCoilType_Num==CoilWater_CoolingHXAssisted)THEN
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%CoolCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxCoolCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%CoolCoilFluidInletNode)%MassFlowRate = mdot
END IF
CALL SimHXAssistedCoolingCoil(Blank,FirstHVACIteration,CompOn,PartLoadRatio, &
CompIndex, UnitarySystem(UnitarySysNum)%FanOpMode, &
HXUnitEnable=HXUnitOn,EconomizerFlag=EconomizerFlag)
IF(UnitarySystem(UnitarySysNum)%CoolingCoilType_Num==CoilDX_CoolingHXAssisted) &
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE (CoilDX_CoolingTwoSpeed) ! Coil:Cooling:DX:TwoSpeed
! formerly (v3 and beyond)COIL:DX:MULTISPEED:COOLINGEMPIRICAL
CALL SimDXCoilMultiSpeed(Blank,UnitarySystem(UnitarySysNum)%CoolingSpeedRatio,&
UnitarySystem(UnitarySysNum)%CoolingCycRatio,CompIndex)
IF(UnitarySystem(UnitarySysNum)%CoolingSpeedRatio .GT. 0.0d0)THEN
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = UnitarySystem(UnitarySysNum)%CoolingSpeedRatio*REAL(CompOn,r64)
ELSE
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = UnitarySystem(UnitarySysNum)%CoolingCycRatio*REAL(CompOn,r64)
END IF
CASE (CoilDX_MultiSpeedCooling) ! Coil:Cooling:DX:Multispeed
IF(OutsideDryBulbTemp .GT. UnitarySystem(UnitarySysNum)%MinOATCompressor) THEN
CALL SimDXCoilMultiSpeed(CompName,UnitarySystem(UnitarySysNum)%CoolingSpeedRatio, &
UnitarySystem(UnitarySysNum)%CoolingCycRatio,&
CompIndex, &
UnitarySystem(UnitarySysNum)%CoolingSpeedNum, &
UnitarySystem(UnitarySysNum)%FanOpMode,CompOn)
IF(UnitarySystem(UnitarySysNum)%CoolingSpeedNum .GT. 1)THEN
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = REAL(CompOn,r64)
ELSE
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = UnitarySystem(UnitarySysNum)%CoolingCycRatio*REAL(CompOn,r64)
END IF
ELSE
CALL SimDXCoilMultiSpeed(CompName,0.0d0,0.0d0,&
CompIndex, &
UnitarySystem(UnitarySysNum)%CoolingSpeedNum, &
UnitarySystem(UnitarySysNum)%FanOpMode,CompOn)
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = 0.0d0
END IF
CASE (CoilDX_CoolingTwoStageWHumControl) ! Coil:Cooling:DX:TwoStageWithHumidityControlMode
! formerly (v3 and beyond) COIL:DX:MULTIMODE:COOLINGEMPIRICAL
CALL SimDXCoilMultiMode(CompName,CompOn,FirstHVACIteration,PartLoadRatio, &
UnitarySystem(UnitarySysNum)%dehumidificationMode, &
CompIndex, &
UnitarySystem(UnitarySysNum)%FanOpMode)
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE (Coil_CoolingWater, Coil_CoolingWaterDetailed)
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%CoolCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxCoolCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%CoolCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateWaterCoilComponents(CompName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%CoolingCoilIndex, &
QActual,UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio)
CASE (Coil_CoolingAirToAirVariableSpeed, Coil_CoolingWaterToAirHPVSEquationFit)
CALL SimVariableSpeedCoils(CompName,CompIndex,&
UnitarySystem(UnitarySysNum)%FanOpMode,UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant,UnitarySystem(UnitarySysNum)%FanDelayTime,&
CompOn, PartLoadRatio, OnOffAirFlowRatio, &
UnitarySystem(UnitarySysNum)%CoolingSpeedNum, &
UnitarySystem(UnitarySysNum)%CoolingSpeedRatio,&
UnitarySystem(UnitarySysNum)%CoolingCoilSensDemand, &
UnitarySystem(UnitarySysNum)%CoolingCoilLatentDemand )
CASE(Coil_CoolingWaterToAirHPSimple)
IF(PartLoadRatio > 0.0d0 .AND. UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac > 0.0d0 .AND. &
UnitarySystem(UnitarySysNum)%FanOpMode == CycFanCycCoil)THEN
OnOffFanPartLoadFraction = PartLoadRatio/UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac
END IF
CALL SimWatertoAirHPSimple(Blank, UnitarySystem(UnitarySysNum)%CoolingCoilIndex, &
UnitarySystem(UnitarySysNum)%CoolingCoilSensDemand, &
UnitarySystem(UnitarySysNum)%CoolingCoilLatentDemand, &
UnitarySystem(UnitarySysNum)%FanOpMode,UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac, &
UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
CompOn, PartLoadRatio, FirstHVACIteration)
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE(Coil_CoolingWaterToAirHP)
CALL HeatPumpRunFrac(UnitarySysNum,PartLoadRatio,errflag,UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac)
IF(PartLoadRatio > 0.0d0 .AND. UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac > 0.0d0 .AND. &
UnitarySystem(UnitarySysNum)%FanOpMode == CycFanCycCoil)THEN
OnOffFanPartLoadFraction = PartLoadRatio/UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac
END IF
CALL SimWatertoAirHP(Blank, UnitarySystem(UnitarySysNum)%CoolingCoilIndex, &
UnitarySystem(UnitarySysNum)%MaxCoolAirMassFlow,UnitarySystem(UnitarySysNum)%FanOpMode,&
FirstHVACIteration,UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac,&
UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, &
UnitarySystem(UnitarySysNum)%FanDelayTime, &
UnitarySystem(UnitarySysNum)%InitHeatPump, &
UnitarySystem(UnitarySysNum)%CoolingCoilSensDemand, &
UnitarySystem(UnitarySysNum)%CoolingCoilLatentDemand,CompOn, PartLoadRatio)
UnitarySystem(UnitarySysNum)%CoolCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
END SELECT
UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac = PartLoadRatio
RETURN
END SUBROUTINE CalcUnitaryCoolingSystem