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 | :: | CoilNum | ||||
real(kind=r64) | :: | SpeedRatio | ||||
real(kind=r64) | :: | CycRatio | ||||
integer | :: | StageNum | ||||
integer | :: | FanOpMode |
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 CalcMultiStageElectricHeatingCoil(CoilNum,SpeedRatio, CycRatio, StageNum, FanOpMode)
! SUBROUTINE INFORMATION:
! AUTHOR Chandan Sharma, FSEC
! DATE WRITTEN January 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates the air-side performance and electrical energy use of multistage electric heating coil.
! METHODOLOGY EMPLOYED:
! Uses the same methodology as the single stage electric heating unit model (SUBROUTINE CalcelectricHeatingCoil).
! In addition it assumes that the unit performance is obtained by interpolating between
! the performance at high stage and that at low stage. If the output needed is below
! that produced at low stage, the coil cycles between off and low stage.
! USE STATEMENTS:
USE CurveManager, ONLY: CurveValue
USE General, ONLY: TrimSigDigits, RoundSigDigits
USE DataHVACGlobals, ONLY: MSHPMassFlowRateLow, MSHPMassFlowRateHigh, ElecHeatingCoilPower
USE Psychrometrics, ONLY: PsyTdbFnHW, PsyRhFnTdbWPb, PsyTsatFnHPb, PsyWFnTdbH
USE DataEnvironment, ONLY: OutBaroPress
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: CoilNum ! the number of the electric heating coil to be simulated
REAL(r64) :: SpeedRatio ! SpeedRatio varies between 1.0 (maximum speed) and 0.0 (minimum speed)
REAL(r64) :: CycRatio ! cycling part load ratio
INTEGER :: StageNum ! Stage number
INTEGER :: FanOpMode ! Fan operation mode
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='CalcMultiStageElectricHeatingCoil'
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: AirMassFlow ! dry air mass flow rate through coil [kg/s]
REAL(r64) :: InletAirDryBulbTemp ! inlet air dry bulb temperature [C]
REAL(r64) :: InletAirEnthalpy ! inlet air enthalpy [J/kg]
REAL(r64) :: InletAirHumRat ! inlet air humidity ratio [kg/kg]
REAL(r64) :: OutletAirEnthalpy ! outlet air enthalpy [J/kg]
REAL(r64) :: OutletAirHumRat ! outlet air humidity ratio [kg/kg]
REAL(r64) :: TotCapHS ! total capacity at high stage [W]
REAL(r64) :: TotCapLS ! total capacity at low stage [W]
REAL(r64) :: TotCap ! total capacity at current stage [W]
REAL(r64) :: EffHS ! total capacity at high stage [W]
REAL(r64) :: EffLS ! total capacity at low stage [W]
REAL(r64) :: OutdoorPressure ! Outdoor barometric pressure at condenser (Pa)
INTEGER :: StageNumHS ! High stage number
INTEGER :: StageNumLS ! Low stage number
REAL(r64) :: FullLoadOutAirEnth ! Outlet full load enthalpy
REAL(r64) :: FullLoadOutAirHumRat ! Outlet humidity ratio at full load
REAL(r64) :: FullLoadOutAirTemp ! Outlet temperature at full load
REAL(r64) :: FullLoadOutAirRH ! Outler relative humidity at full load
REAL(r64) :: OutletAirTemp ! Supply ari temperature
REAL(r64) :: LSFullLoadOutAirEnth ! Outlet full load enthalpy at low stage
REAL(r64) :: HSFullLoadOutAirEnth ! Outlet full load enthalpy at high stage
REAL(r64) :: LSElecHeatingPower ! Full load power at low stage
REAL(r64) :: HSElecHeatingPower ! Full load power at high stage
REAL(r64) :: PartLoadRat ! part load ratio
! FLOW
If (StageNum > 1) Then
StageNumLS = StageNum-1
StageNumHS = StageNum
If (StageNum .GT. HeatingCoil(CoilNum)%NumOfStages) Then
StageNumLS = HeatingCoil(CoilNum)%NumOfStages-1
StageNumHS = HeatingCoil(CoilNum)%NumOfStages
End If
Else
StageNumLS = 1
StageNumHS = 1
End If
AirMassFlow = HeatingCoil(CoilNum)%InletAirMassFlowRate
InletAirDryBulbTemp = HeatingCoil(CoilNum)%InletAirTemp
InletAirEnthalpy = HeatingCoil(CoilNum)%InletAirEnthalpy
InletAirHumRat = HeatingCoil(CoilNum)%InletAirHumRat
OutdoorPressure = OutBaroPress
IF((AirMassFlow .GT. 0.0d0) .AND. &
(GetCurrentScheduleValue(HeatingCoil(CoilNum)%SchedPtr) .GT. 0.0d0) .AND. &
((CycRatio .GT. 0.0d0) .OR. (SpeedRatio .GT. 0.0d0))) THEN
If (StageNum > 1) Then
TotCapLS = HeatingCoil(CoilNum)%MSNominalCapacity(StageNumLS)
TotCapHS = HeatingCoil(CoilNum)%MSNominalCapacity(StageNumHS)
EffLS = HeatingCoil(CoilNum)%MSEfficiency(StageNumLS)
EffHS = HeatingCoil(CoilNum)%MSEfficiency(StageNumHS)
! Get full load output and power
LSFullLoadOutAirEnth = InletAirEnthalpy + TotCapLS/MSHPMassFlowRateLow
HSFullLoadOutAirEnth = InletAirEnthalpy + TotCapHS/MSHPMassFlowRateHigh
LSElecHeatingPower = TotCapLS/ EffLS
HSElecHeatingPower = TotCapHS/EffHS
OutletAirHumRat = InletAirHumRat
! if cycling fan, send coil part-load fraction to on/off fan via HVACDataGlobals
! IF (FanOpMode .EQ. CycFanCycCoil) OnOffFanPartLoadFraction = 1.0d0
! Power calculation
HeatingCoil(CoilNum)%ElecUseLoad = SpeedRatio*HSElecHeatingPower+(1.0d0-SpeedRatio)*LSElecHeatingPower
ElecHeatingCoilPower = HeatingCoil(CoilNum)%ElecUseLoad
HeatingCoil(CoilNum)%HeatingCoilLoad = MSHPMassFlowRateHigh*(HSFullLoadOutAirEnth-InletAirEnthalpy)*SpeedRatio + &
MSHPMassFlowRateLow*(LSFullLoadOutAirEnth-InletAirEnthalpy)*(1.0d0-SpeedRatio)
OutletAirEnthalpy = InletAirEnthalpy + HeatingCoil(CoilNum)%HeatingCoilLoad/HeatingCoil(CoilNum)%InletAirMassFlowRate
OutletAirTemp = PsyTdbFnHW(OutletAirEnthalpy,OutletAirHumRat,RoutineName)
FullLoadOutAirRH = PsyRhFnTdbWPb(OutletAirTemp,OutletAirHumRat,OutdoorPressure,RoutineName//':Averageload')
IF (FullLoadOutAirRH .gt. 1.d0) THEN ! Limit to saturated conditions at FullLoadOutAirEnth
OutletAirTemp = PsyTsatFnHPb(OutletAirEnthalpy,OutdoorPressure,RoutineName)
OutletAirHumRat = PsyWFnTdbH(OutletAirTemp,OutletAirEnthalpy,RoutineName)
END IF
HeatingCoil(CoilNum)%OutletAirTemp = OutletAirTemp
HeatingCoil(CoilNum)%OutletAirHumRat = OutletAirHumRat
HeatingCoil(CoilNum)%OutletAirEnthalpy = OutletAirEnthalpy
HeatingCoil(CoilNum)%OutletAirMassFlowRate = HeatingCoil(CoilNum)%InletAirMassFlowRate
! Stage 1
Else If (CycRatio > 0.0d0) Then
PartLoadRat = MIN(1.0d0,CycRatio)
! for cycling fan, reset mass flow to full on rate
IF (FanOpMode .EQ. CycFanCycCoil) AirMassFlow = AirMassFlow / PartLoadRat
IF (FanOpMode .EQ. ContFanCycCoil) AirMassFlow = MSHPMassFlowRateLow
TotCap = HeatingCoil(CoilNum)%MSNominalCapacity(StageNumLS)
! Calculate full load outlet conditions
FullLoadOutAirEnth = InletAirEnthalpy + TotCap/AirMassFlow
FullLoadOutAirHumRat = InletAirHumRat
FullLoadOutAirTemp = PsyTdbFnHW(FullLoadOutAirEnth,FullLoadOutAirHumRat,RoutineName)
FullLoadOutAirRH = PsyRhFnTdbWPb(FullLoadOutAirTemp,FullLoadOutAirHumRat,OutdoorPressure,RoutineName//':fullload')
IF (FullLoadOutAirRH .gt. 1.d0) THEN ! Limit to saturated conditions at FullLoadOutAirEnth
FullLoadOutAirTemp = PsyTsatFnHPb(FullLoadOutAirEnth,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in electric Coil, these lines are commented out and marked with this comment line
! FullLoadOutAirTemp = PsyTsatFnHPb(FullLoadOutAirEnth,InletAirPressure)
FullLoadOutAirHumRat = PsyWFnTdbH(FullLoadOutAirTemp,FullLoadOutAirEnth,RoutineName)
END IF
! Set outlet conditions from the full load calculation
IF (FanOpMode .EQ. CycFanCycCoil) THEN
OutletAirEnthalpy = FullLoadOutAirEnth
OutletAirHumRat = FullLoadOutAirHumRat
OutletAirTemp = FullLoadOutAirTemp
ELSE
OutletAirEnthalpy = PartLoadRat * FullLoadOutAirEnth + (1.0d0-PartLoadRat) * InletAirEnthalpy
OutletAirHumRat = PartLoadRat * FullLoadOutAirHumRat + (1.0d0-PartLoadRat) * InletAirHumRat
OutletAirTemp = PartLoadRat * FullLoadOutAirTemp + (1.0d0-PartLoadRat) * InletAirDryBulbTemp
END IF
EffLS = HeatingCoil(CoilNum)%MSEfficiency(StageNumLS)
! HeatingCoil(CoilNum)%HeatingCoilLoad = TotCap
! This would require a CR to change
HeatingCoil(CoilNum)%HeatingCoilLoad = TotCap * PartLoadRat
HeatingCoil(CoilNum)%ElecUseLoad = HeatingCoil(CoilNum)%HeatingCoilLoad/ EffLS
ElecHeatingCoilPower = HeatingCoil(CoilNum)%ElecUseLoad
HeatingCoil(CoilNum)%OutletAirTemp = OutletAirTemp
HeatingCoil(CoilNum)%OutletAirHumRat = OutletAirHumRat
HeatingCoil(CoilNum)%OutletAirEnthalpy = OutletAirEnthalpy
HeatingCoil(CoilNum)%OutletAirMassFlowRate = HeatingCoil(CoilNum)%InletAirMassFlowRate
! this would require a CR to correct (i.e., calculate outputs when coil is off)
! ELSE
! ! electric coil is off; just pass through conditions
! HeatingCoil(CoilNum)%OutletAirEnthalpy = HeatingCoil(CoilNum)%InletAirEnthalpy
! HeatingCoil(CoilNum)%OutletAirHumRat = HeatingCoil(CoilNum)%InletAirHumRat
! HeatingCoil(CoilNum)%OutletAirTemp = HeatingCoil(CoilNum)%InletAirTemp
! HeatingCoil(CoilNum)%OutletAirMassFlowRate = HeatingCoil(CoilNum)%InletAirMassFlowRate
!
! HeatingCoil(CoilNum)%ElecUseLoad = 0.0
! HeatingCoil(CoilNum)%HeatingCoilLoad = 0.0
! ElecHeatingCoilPower = 0.0
End If
ELSE
! electric coil is off; just pass through conditions
HeatingCoil(CoilNum)%OutletAirEnthalpy = HeatingCoil(CoilNum)%InletAirEnthalpy
HeatingCoil(CoilNum)%OutletAirHumRat = HeatingCoil(CoilNum)%InletAirHumRat
HeatingCoil(CoilNum)%OutletAirTemp = HeatingCoil(CoilNum)%InletAirTemp
HeatingCoil(CoilNum)%OutletAirMassFlowRate = HeatingCoil(CoilNum)%InletAirMassFlowRate
! some of these are reset in Init, can be removed to speed up code
HeatingCoil(CoilNum)%ElecUseLoad = 0.0d0
HeatingCoil(CoilNum)%HeatingCoilLoad = 0.0d0
ElecHeatingCoilPower = 0.0d0
END IF ! end of on/off if - else
RETURN
END SUBROUTINE CalcMultiStageElectricHeatingCoil