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), | optional | :: | HeatCoilLoad |
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 CalcUnitaryHeatingSystem(UnitarySysNum, FirstHVACIteration, PartLoadRatio, CompOn, OnOffAirFlowRatio, HeatCoilLoad)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages unitary heating system component simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DXCoils, ONLY: SimDXCoil, SimDXCoilMultiSpeed
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE SteamCoils, ONLY: SimulateSteamCoilComponents
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 ! comrpressor control (0=off, 1=on)
REAL(R64), INTENT(IN) :: OnOffAirFlowRatio ! ratio of on to off flow rate
REAL(r64), OPTIONAL, INTENT(IN) :: HeatCoilLoad ! adjusted heating coil load if outlet temp exceeds max (W)
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompName ! Name of Unitary System object
REAL(R64) :: OutsideDryBulbTemp ! outdoor temperature (C)
REAL(r64) :: mdot ! water side flow rate (kg/s)
REAL(r64) :: QActual ! actual output of coil (W)
REAL(r64) :: dummy ! used when sub argument is not needed
REAL(r64) :: OutdoorPressure ! Outdoor barometric pressure at condenser (Pa)
LOGICAL :: errflag ! returned flag from called routine
CompName = UnitarySystem(UnitarySysNum)%HeatingCoilName
dummy = 0.0d0
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
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE (CoilDX_HeatingEmpirical) ! COIL:HEATING:DX:SINGLESPEED
CALL SimDXCoil(CompName,CompOn,FirstHVACIteration, PartLoadRatio, &
UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%FanOpMode)
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE (Coil_HeatingGas,Coil_HeatingElectric )
IF(PRESENT(HeatCoilLoad))THEN
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
SuppHeat=.FALSE., &
QCoilReq=HeatCoilLoad, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
ELSE
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
SuppHeat=.FALSE., &
QCoilReq=UnitarySystem(UnitarySysNum)%DesignHeatingCapacity*PartLoadRatio, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
END IF
CASE (Coil_HeatingDesuperheater )
IF(PRESENT(HeatCoilLoad))THEN
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
SuppHeat=.FALSE., &
QCoilReq=HeatCoilLoad, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
ELSE
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
SuppHeat=.FALSE., &
QCoilReq=UnitarySystem(UnitarySysNum)%DesignHeatingCapacity*PartLoadRatio, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
END IF
CASE(CoilDX_MultiSpeedHeating)
IF(OutsideDryBulbTemp .GT. UnitarySystem(UnitarySysNum)%MinOATCompressor)THEN
CALL SimDXCoilMultiSpeed(CompName,UnitarySystem(UnitarySysNum)%HeatingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingCycRatio,&
UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%HeatingSpeedNum, &
UnitarySystem(UnitarySysNum)%FanOpMode,CompOn)
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
ELSE
CALL SimDXCoilMultiSpeed(CompName,0.0d0,0.0d0,&
UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%HeatingSpeedNum, &
UnitarySystem(UnitarySysNum)%FanOpMode,CompOn)
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = 0.0d0
END IF
CASE(Coil_HeatingElectric_MultiStage, Coil_HeatingGas_MultiStage)
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex = 0, &
FanOpMode = UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio = UnitarySystem(UnitarySysNum)%HeatingCycRatio, &
StageNum = UnitarySystem(UnitarySysNum)%HeatingSpeedNum, &
SpeedRatio = UnitarySystem(UnitarySysNum)%HeatingSpeedRatio)
CASE (Coil_HeatingWater)
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateWaterCoilComponents(CompName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
QActual,UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio)
CASE (Coil_HeatingSteam)
! this same CALL is made in the steam coil calc routine
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateSteamCoilComponents(CompName, FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%DesignHeatingCapacity*PartLoadRatio, &
UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
FanOpMode = UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio = PartLoadRatio)
CASE(Coil_HeatingAirToAirVariableSpeed, Coil_HeatingWaterToAirHPVSEquationFit)
CALL SimVariableSpeedCoils(CompName,UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%FanOpMode,UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant,UnitarySystem(UnitarySysNum)%FanDelayTime, &
CompOn, PartLoadRatio, OnOffAirFlowRatio, &
UnitarySystem(UnitarySysNum)%HeatingSpeedNum, UnitarySystem(UnitarySysNum)%HeatingSpeedRatio, &
UnitarySystem(UnitarySysNum)%HeatingCoilSensDemand, dummy)
IF(UnitarySystem(UnitarySysNum)%HeatingSpeedNum .GT. 1.0d0)THEN
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = 1.0d0
ELSE
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
END IF
CASE(Coil_HeatingWaterToAirHPSimple)
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)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%HeatingCoilSensDemand, dummy, &
UnitarySystem(UnitarySysNum)%FanOpMode,UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac, &
UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
CompOn, PartLoadRatio, FirstHVACIteration)
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE(Coil_HeatingWaterToAirHP)
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)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%MaxHeatAirMassFlow,UnitarySystem(UnitarySysNum)%FanOpMode,&
FirstHVACIteration,UnitarySystem(UnitarySysNum)%WSHPRuntimeFrac,&
UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, &
UnitarySystem(UnitarySysNum)%FanDelayTime, &
UnitarySystem(UnitarySysNum)%InitHeatPump, &
UnitarySystem(UnitarySysNum)%HeatingCoilSensDemand, &
dummy,CompOn, PartLoadRatio)
UnitarySystem(UnitarySysNum)%HeatCompPartLoadRatio = PartLoadRatio*REAL(CompOn,r64)
CASE DEFAULT
CALL ShowFatalError('CalcUnitaryHeatingSystem: Invalid Unitary System coil type = '// &
TRIM(cAllCoilTypes(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)))
END SELECT
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac = PartLoadRatio
RETURN
END SUBROUTINE CalcUnitaryHeatingSystem