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.
Modify total heating capacity based on defrost heating capacity multiplier MaxHeatCap passed from parent object VRF Condenser and is used to limit capacity of TU's to that available from condenser
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | DXCoilNum | |||
integer, | intent(in) | :: | CyclingScheme | |||
real(kind=r64), | intent(inout) | :: | RuntimeFrac | |||
real(kind=r64), | intent(in) | :: | SensDemand | |||
integer, | intent(in) | :: | CompOp | |||
real(kind=r64), | intent(in) | :: | PartLoadRatio | |||
real(kind=r64), | intent(in) | :: | OnOffAirFlowRatio | |||
real(kind=r64), | intent(in) | :: | SpeedRatio | |||
integer, | intent(in) | :: | SpeedNum |
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 CalcVarSpeedCoilHeating(DXCoilNum,CyclingScheme,RuntimeFrac, &
SensDemand,CompOp,PartLoadRatio,OnOffAirFlowRatio, SpeedRatio, SpeedNum)
! AUTHOR Bo Shen, based on WatertoAirHeatPumpSimple:CalcHPHeatingSimple
! DATE WRITTEN March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for simulating the heating mode of the Variable Speed Water to Air HP Simple
! METHODOLOGY EMPLOYED:
! Simulate the heat pump performance using the coefficients and rated conditions
!
! Finally, adjust the heat pump outlet conditions based on the PartLoadRatio
! and RuntimeFrac.
! REFERENCES:
! na
! USE STATEMENTS:
USE CurveManager, ONLY: CurveValue
USE DataHVACGlobals, ONLY:TimeStepSys, DXElecHeatingPower
USE Psychrometrics, ONLY:PsyWFnTdbTwbPb,PsyRhoAirFnPbTdbW,PsyCpAirFnWTdb,PsyTwbFnTdbWPb, &
PsyTdbFnHW,PsyWFnTdbH,PsyHFnTdbW
USE FluidProperties, ONLY:GetSpecificHeatGlycol
USE DataPlant, ONLY: PlantLoop
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: DXCoilNum ! Heat Pump Number
INTEGER, INTENT(IN) :: CyclingScheme ! Fan/Compressor cycling scheme indicator
REAL(r64), INTENT(IN) :: SensDemand ! Cooling Sensible Demand [W] !unused1208
INTEGER, INTENT(IN) :: CompOp ! compressor operation flag
REAL(r64), INTENT(IN) :: PartLoadRatio ! compressor part load ratio
REAL(r64), INTENT(INOUT) :: RuntimeFrac ! Runtime Fraction of compressor or percent on time (on-time/cycle time)
REAL(r64), INTENT(IN) :: OnOffAirFlowRatio ! ratio of compressor on flow to average flow over time step
REAL(r64), INTENT(IN) :: SpeedRatio ! SpeedRatio varies between 1.0 (higher speed) and 0.0 (lower speed)
INTEGER, INTENT(IN) :: SpeedNum ! Speed number, high bound, i.e. SpeedNum - 1 is the other side
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: Tref=283.15d0 ! Reference Temperature for performance curves,10C [K]
CHARACTER(len=*), PARAMETER :: RoutineName='CalcVarSpeedCoilHeating'
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: CpSource ! Specific heat of water [J/kg_C]
REAL(r64) :: CpAir ! Specific heat of air [J/kg_C]
REAL(r64) :: AirMassFlowRatio ! airflow ratio at low speed
REAL(r64) :: WaterMassFlowRatio ! airflow ratio at high speed
REAL(r64) :: TotCapAirFFModFac !air flow fraction modification
REAL(r64) :: TotCapWaterFFModFac !water flow fraction modification
REAL(r64) :: TotCapTempModFac !total capacity temperature correctio fraction
REAL(r64) :: EIRAirFFModFac !air flow fraction modification
REAL(r64) :: EIRWaterFFModFac !water flow fraction modification
REAL(r64) :: EIRTempModFac !total capacity temperature correctio fraction
REAL(r64) :: EIR !total capacity temperature correctio fraction
INTEGER :: MaxSpeed ! maximum speed level
INTEGER :: SpeedCal ! calculated speed level
REAL(r64) :: QLoadTotal1 ! heating capacit at low speed
REAL(r64) :: QLoadTotal2 ! heating capacity at high speed
REAL(r64) :: Winput1 ! power consumption at low speed
REAL(r64) :: Winput2 ! power consumption at high speed
REAL(r64) :: QWasteHeat !recoverable waste heat
REAL(r64) :: QWasteHeat1 !recoverable waste heat at low speed
REAL(r64) :: QWasteHeat2 !recoverable waste heat at high speed
REAL(r64) :: PLF !part-load function
REAL(r64) :: ReportingConstant
! ADDED VARIABLES FOR air source coil
REAL(r64) :: OutdoorCoilT = 0.0d0 ! Outdoor coil temperature (C)
REAL(r64) :: OutdoorCoildw = 0.0d0 ! Outdoor coil delta w assuming coil temp of OutdoorCoilT (kg/kg)
REAL(r64) :: OutdoorDryBulb = 0.0d0 ! Outdoor dry-bulb temperature at condenser (C)
REAL(r64) :: OutdoorWetBulb = 0.0d0 ! Outdoor wet-bulb temperature at condenser (C)
REAL(r64) :: OutdoorHumRat = 0.0d0 ! Outdoor humidity ratio at condenser (kg/kg)
REAL(r64) :: OutdoorPressure = 0.0d0 ! Outdoor barometric pressure at condenser (Pa)
REAL(r64) :: FractionalDefrostTime = 0.0d0 ! Fraction of time step system is in defrost
REAL(r64) :: HeatingCapacityMultiplier = 0.0d0 ! Multiplier for heating capacity when system is in defrost
REAL(r64) :: InputPowerMultiplier = 0.0d0 ! Multiplier for power when system is in defrost
REAL(r64) :: LoadDueToDefrost = 0.0d0 ! Additional load due to defrost
REAL(r64) :: CrankcaseHeatingPower = 0.0d0 ! power due to crankcase heater
REAL(r64) :: DefrostEIRTempModFac = 0.0d0 ! EIR modifier for defrost (function of entering wetbulb, outside drybulb)
REAL(r64) :: TotRatedCapacity = 0.0d0 ! total rated capacity at the given speed and speed ratio for defrosting
MaxSpeed = VarSpeedCoil(DXCoilNum)%NumofSpeeds
! LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability)
IF (.NOT. (CyclingScheme .EQ. ContFanCycCoil) .AND. PartLoadRatio > 0.0d0) THEN
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = Node(VarSpeedCoil(DXCoilNum)%AirInletNodeNum)%MassFlowRate/PartLoadRatio
END IF
LoadSideMassFlowRate = VarSpeedCoil(DXCoilNum)%AirMassFlowRate
LoadSideInletDBTemp = VarSpeedCoil(DXCoilNum)%InletAirDBTemp
LoadSideInletHumRat = VarSpeedCoil(DXCoilNum)%InletAirHumRat
LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp,LoadSideInletHumRat,OutBaroPress,RoutineName)
LoadSideInletEnth = VarSpeedCoil(DXCoilNum)%InletAirEnthalpy
CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat,LoadSideInletDBTemp,RoutineName)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
! Get condenser outdoor node info from DX Heating Coil
IF (VarSpeedCoil(DXCoilNum)%CondenserInletNodeNum /= 0) THEN
OutdoorDryBulb = Node(VarSpeedCoil(DXCoilNum)%CondenserInletNodeNum)%Temp
OutdoorHumRat = Node(VarSpeedCoil(DXCoilNum)%CondenserInletNodeNum)%HumRat
OutdoorPressure = Node(VarSpeedCoil(DXCoilNum)%CondenserInletNodeNum)%Press
OutdoorWetBulb = Node(VarSpeedCoil(DXCoilNum)%CondenserInletNodeNum)%OutAirWetBulb
ELSE
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ENDIF
SourceSideMassFlowRate = 1.0d0 ! not used and avoid divided by zero
SourceSideInletTemp = OutdoorDryBulb
SourceSideInletEnth = PsyHFnTdbW(OutdoorDryBulb,OutdoorHumRat,RoutineName)
CpSource = PsyCpAirFnWTdb(OutHumRat, OutdoorDryBulb,RoutineName)
! Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil
IF (OutdoorDryBulb .LT. VarSpeedCoil(DXCoilNum)%MaxOATCrankcaseHeater)THEN
CrankcaseHeatingPower = VarSpeedCoil(DXCoilNum)%CrankcaseHeaterCapacity
ELSE
CrankcaseHeatingPower = 0.0d0
END IF
ELSE
SourceSideMassFlowRate = VarSpeedCoil(DXCoilNum)%WaterMassFlowRate
SourceSideInletTemp = VarSpeedCoil(DXCoilNum)%InletWaterTemp
SourceSideInletEnth = VarSpeedCoil(DXCoilNum)%InletWaterEnthalpy
CpSource = GetSpecificHeatGlycol(PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidName, &
SourceSideInletTemp, &
PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidIndex, &
RoutineName//':SourceSideInletTemp')
END IF
!Check for flows, do not perform simulation if no flow in load side or source side.
IF ((SourceSideMassFlowRate <= 0.0d0) .OR. (LoadSideMassFlowRate <= 0.0d0) )THEN
VarSpeedCoil(DXCoilNum)%SimFlag = .FALSE.
RETURN
ELSE
VarSpeedCoil(DXCoilNum)%SimFlag = .TRUE.
ENDIF
IF((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) &
.AND. (OutdoorDryBulb < VarSpeedCoil(DXCoilNum)%MinOATCompressor)) THEN
VarSpeedCoil(DXCoilNum)%SimFlag = .FALSE.
RETURN
END IF
IF (CompOp .EQ. 0) THEN
VarSpeedCoil(DXCoilNum)%SimFlag = .FALSE.
RETURN
ENDIF
IF(SpeedNum > MaxSpeed) THEN
SpeedCal = MaxSpeed
ELSE
SpeedCal = SpeedNum
END IF
RuntimeFrac = 1.0d0
VarSpeedCoil(DXCoilNum)%RunFrac = 1.0d0
IF((SpeedNum == 1) .AND. (PartLoadRatio < 1.0d0)) THEN
PLF = CurveValue(VarSpeedCoil(DXCoilNum)%PLFFPLR,PartLoadRatio)
IF (PLF < 0.7d0) THEN
PLF = 0.7d0
END IF
! calculate the run time fraction
VarSpeedCoil(DXCoilNum)%RunFrac = PartLoadRatio / PLF
VarSpeedCoil(DXCoilNum)%PartLoadRatio = PartLoadRatio
IF ( VarSpeedCoil(DXCoilNum)%RunFrac > 1.0d0 ) THEN
VarSpeedCoil(DXCoilNum)%RunFrac = 1.0d0 ! Reset coil runtime fraction to 1.0
ELSE IF( VarSpeedCoil(DXCoilNum)%RunFrac < 0.0d0 ) THEN
VarSpeedCoil(DXCoilNum)%RunFrac = 0.0d0
END IF
RuntimeFrac = VarSpeedCoil(DXCoilNum)%RunFrac
END IF
IF((SpeedNum == 1) .OR.(SpeedNum > MaxSpeed) .OR. (SpeedRatio == 1.0d0)) THEN
AirMassFlowRatio = LoadSideMassFlowRate/ VarSpeedCoil(DXCoilNum)%DesignAirMassFlowRate
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
WaterMassFlowRatio = 1.0d0
ELSE
WaterMassFlowRatio = SourceSideMassFlowRate/VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate
END IF
TotCapTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
TotCapAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
TotCapWaterFFModFac = 1.0d0
ELSE
TotCapWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
QLoadTotal = VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac
TotRatedCapacity = VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal) ! for defrosting power cal
EIRTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
EIRAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
EIRWaterFFModFac = 1.0D0
ELSE
EIRWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
EIR = (1.0/VarSpeedCoil(DXCoilNum)%MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac
Winput = QLoadTotal * EIR
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
QWasteHeat = 0.0d0
ELSE
QWasteHeat = Winput * VarSpeedCoil(DXCoilNum)%MSWasteHeatFrac(SpeedCal)
QWasteHeat = QWasteHeat * CurveValue(VarSpeedCoil(DXCoilNum)%MSWasteHeat(SpeedCal), &
LoadSideInletDBTemp,SourceSideInletTemp)
END IF
ELSE
AirMassFlowRatio = LoadSideMassFlowRate/ VarSpeedCoil(DXCoilNum)%DesignAirMassFlowRate
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
WaterMassFlowRatio = 1.0d0
ELSE
WaterMassFlowRatio = SourceSideMassFlowRate/VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate
END IF
SpeedCal = SpeedNum - 1
TotCapTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
TotCapAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
TotCapWaterFFModFac = 1.0d0
ELSE
TotCapWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
QLoadTotal1 = VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac
EIRTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
EIRAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
EIRWaterFFModFac = 1.0d0
ELSE
EIRWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
EIR = (1.0/VarSpeedCoil(DXCoilNum)%MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac
Winput1 = QLoadTotal1 * EIR
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
QWasteHeat1 = 0.0d0
ELSE
QWasteHeat1 = Winput1 * VarSpeedCoil(DXCoilNum)%MSWasteHeatFrac(SpeedCal)
QWasteHeat1 = QWasteHeat1 * CurveValue(VarSpeedCoil(DXCoilNum)%MSWasteHeat(SpeedCal), &
LoadSideInletDBTemp,SourceSideInletTemp)
END IF
SpeedCal = SpeedNum
TotCapTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
TotCapAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
TotCapWaterFFModFac = 1.0d0
ELSE
TotCapWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSCCapWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
QLoadTotal2 = VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal) * TotCapTempModFac * TotCapAirFFModFac * TotCapWaterFFModFac
EIRTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRFTemp(SpeedCal),LoadSideInletDBTemp,SourceSideInletTemp)
EIRAirFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRAirFFlow(SpeedCal),AirMassFlowRatio)
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
EIRWaterFFModFac = 1.0d0
ELSE
EIRWaterFFModFac = CurveValue(VarSpeedCoil(DXCoilNum)%MSEIRWaterFFlow(SpeedCal),WaterMassFlowRatio)
END IF
EIR = (1.0/VarSpeedCoil(DXCoilNum)%MSRatedCOP(SpeedCal)) * EIRTempModFac * EIRAirFFModFac * EIRWaterFFModFac
Winput2 = QLoadTotal2 * EIR
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
QWasteHeat2 = 0.0d0
ELSE
QWasteHeat2 = Winput2 * VarSpeedCoil(DXCoilNum)%MSWasteHeatFrac(SpeedCal)
QWasteHeat2 = QWasteHeat2 * CurveValue(VarSpeedCoil(DXCoilNum)%MSWasteHeat(SpeedCal), &
LoadSideInletDBTemp,SourceSideInletTemp)
END IF
QLoadTotal = QLoadTotal2*SpeedRatio + (1.0d0 - SpeedRatio ) * QLoadTotal1
Winput = Winput2*SpeedRatio + (1.0d0 - SpeedRatio ) * Winput1
QWasteHeat = QWasteHeat2*SpeedRatio + (1.0d0 - SpeedRatio ) * QWasteHeat1
TotRatedCapacity =VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal)*SpeedRatio + (1.0d0 - SpeedRatio ) * &
VarSpeedCoil(DXCoilNum)%MSRatedTotCap(SpeedCal - 1)
END IF
VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower = 0.0d0 !necessary to clear zero for water source coils
VarSpeedCoil(DXCoilNum)%DefrostPower = 0.0d0 !clear the defrost power
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
! Calculating adjustment factors for defrost
! Calculate delta w through outdoor coil by assuming a coil temp of 0.82*DBT-9.7(F) per DOE2.1E
OutdoorCoilT = 0.82d0 * OutdoorDryBulb - 8.589d0
OutdoorCoildw = MAX(1.0d-6,(OutdoorHumRat - PsyWFnTdpPb(OutdoorCoilT,OutdoorPressure)))
! Initializing defrost adjustment factors
LoadDueToDefrost = 0.0d0
HeatingCapacityMultiplier = 1.0d0
FractionalDefrostTime = 0.0d0
InputPowerMultiplier = 1.0d0
!
! Check outdoor temperature to determine of defrost is active
IF (OutdoorDryBulb .LE. VarSpeedCoil(DXCoilNum)%MaxOATDefrost) THEN
! Calculate defrost adjustment factors depending on defrost control type
IF (VarSpeedCoil(DXCoilNum)%DefrostControl .EQ. Timed) THEN
FractionalDefrostTime = VarSpeedCoil(DXCoilNum)%DefrostTime
HeatingCapacityMultiplier = 0.909d0 - 107.33d0 * OutdoorCoildw
InputPowerMultiplier = 0.90d0 - 36.45d0*OutdoorCoildw
ELSE !else defrost control is on-demand
FractionalDefrostTime = 1.0d0 / (1.0d0 + 0.01446d0 / OutdoorCoildw)
HeatingCapacityMultiplier = 0.875d0 * ( 1.0d0 - FractionalDefrostTime)
InputPowerMultiplier = 0.954d0 * ( 1.0d0 - FractionalDefrostTime)
END IF
! correction fractional defrost time shorten by runtime fraction
FractionalDefrostTime = RuntimeFrac * FractionalDefrostTime
IF (FractionalDefrostTime .GT. 0.0d0) THEN
! Calculate defrost adjustment factors depending on defrost control strategy
IF (VarSpeedCoil(DXCoilNum)%DefrostStrategy .EQ. ReverseCycle) THEN
LoadDueToDefrost = (0.01d0 * FractionalDefrostTime) * &
(7.222d0 - OutdoorDryBulb) * &
(TotRatedCapacity/1.01667d0)
DefrostEIRTempModFac = CurveValue(VarSpeedCoil(DXCoilNum)%DefrostEIRFT,&
MAX(15.555d0,LoadSideInletWBTemp),MAX(15.555d0,OutdoorDryBulb))
VarSpeedCoil(DXCoilNum)%DefrostPower = DefrostEIRTempModFac * &
(TotRatedCapacity &
/1.01667d0)* FractionalDefrostTime
ELSE ! Defrost strategy is resistive
VarSpeedCoil(DXCoilNum)%DefrostPower = VarSpeedCoil(DXCoilNum)%DefrostCapacity &
* FractionalDefrostTime
END IF
ELSE ! Defrost is not active because (OutDryBulbTemp .GT. DXCoil(DXCoilNum)%MaxOATDefrost)
VarSpeedCoil(DXCoilNum)%DefrostPower = 0.0d0
END IF
END IF
VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower = CrankcaseHeatingPower *(1.0d0 - RuntimeFrac)
!! Modify total heating capacity based on defrost heating capacity multiplier
!! MaxHeatCap passed from parent object VRF Condenser and is used to limit capacity of TU's to that available from condenser
! IF(PRESENT(MaxHeatCap))THEN
! TotCap = MIN(MaxHeatCap,TotCap * HeatingCapacityMultiplier)
! ELSE
! TotCap = TotCap * HeatingCapacityMultiplier
! END IF
QLoadTotal = QLoadTotal * HeatingCapacityMultiplier - LoadDueToDefrost
! count the powr separately
Winput = Winput * InputPowerMultiplier !+ VarSpeedCoil(DXCoilNum)%DefrostPower
END IF
Qsource = QLoadTotal+ QWasteHeat -Winput
QSensible = QLoadTotal
IF(Qsource < 0) THEN
Qsource = 0.0d0
QWasteHeat = Winput - QLoadTotal
END IF
! calculate coil outlet state variables
LoadSideOutletEnth = LoadSideInletEnth + QLoadTotal/LoadSideMassFlowRate
LoadSideOutletDBTemp = LoadSideInletDBTemp + QSensible/(LoadSideMassFlowRate * CpAir)
LoadsideOutletHumRat = PsyWFnTdbH(LoadSideOutletDBTemp,LoadSideOutletEnth,RoutineName)
! Actual outlet conditions are "average" for time step
IF (CyclingScheme .EQ. ContFanCycCoil) THEN
! continuous fan, cycling compressor
VarSpeedCoil(DXCoilNum)%OutletAirEnthalpy = PartLoadRatio*LoadSideOutletEnth + &
(1.d0-PartLoadRatio)*LoadSideInletEnth
VarSpeedCoil(DXCoilNum)%OutletAirHumRat = PartLoadRatio*LoadsideOutletHumRat + &
(1.d0-PartLoadRatio)*LoadSideInletHumRat
VarSpeedCoil(DXCoilNum)%OutletAirDBTemp = PsyTdbFnHW(VarSpeedCoil(DXCoilNum)%OutletAirEnthalpy, &
VarSpeedCoil(DXCoilNum)%OutletAirHumRat,RoutineName)
PLRCorrLoadSideMdot = LoadSideMassFlowRate
ELSE
! default to cycling fan, cycling compressor
VarSpeedCoil(DXCoilNum)%OutletAirEnthalpy = LoadSideOutletEnth
VarSpeedCoil(DXCoilNum)%OutletAirHumRat = LoadsideOutletHumRat
VarSpeedCoil(DXCoilNum)%OutletAirDBTemp = LoadSideOutletDBTemp
PLRCorrLoadSideMdot = LoadSideMassFlowRate*PartLoadRatio
END IF
! scale heat transfer rates to PLR and power to RTF
QLoadTotal = QLoadTotal*PartLoadRatio
QSensible = QSensible*PartLoadRatio
! count the powr separately
Winput = Winput*RuntimeFrac !+ VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower
QSource = QSource*PartLoadRatio
QWasteHeat = QWasteHeat*PartLoadRatio
! Add power to global variable so power can be summed by parent object
DXElecHeatingPower = Winput
ReportingConstant=TimeStepSys*SecInHour
!Update heat pump data structure
VarSpeedCoil(DXCoilNum)%Power = Winput
VarSpeedCoil(DXCoilNum)%QLoadTotal = QLoadTotal
VarSpeedCoil(DXCoilNum)%QSensible = QSensible
VarSpeedCoil(DXCoilNum)%QSource = QSource
VarSpeedCoil(DXCoilNum)%Energy=Winput*ReportingConstant
VarSpeedCoil(DXCoilNum)%EnergyLoadTotal=QLoadTotal*ReportingConstant
VarSpeedCoil(DXCoilNum)%EnergySensible=QSensible*ReportingConstant
VarSpeedCoil(DXCoilNum)%EnergyLatent=0.0d0
VarSpeedCoil(DXCoilNum)%EnergySource=QSource*ReportingConstant
VarSpeedCoil(DXCoilNum)%CrankcaseHeaterConsumption = VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower*ReportingConstant
VarSpeedCoil(DXCoilNum)%DefrostConsumption = VarSpeedCoil(DXCoilNum)%DefrostPower*ReportingConstant
IF(RunTimeFrac == 0.0d0) THEN
VarSpeedCoil(DXCoilNum)%COP = 0.0d0
ELSE
VarSpeedCoil(DXCoilNum)%COP = QLoadTotal/Winput
END IF
VarSpeedCoil(DXCoilNum)%RunFrac = RuntimeFrac
VarSpeedCoil(DXCoilNum)%PartLoadRatio = PartLoadRatio
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = PLRCorrLoadSideMdot
IF(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum .EQ. Coil_HeatingAirToAirVariableSpeed) THEN
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate = 0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterTemp = 0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterEnthalpy = 0.0d0
ELSE
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate = SourceSideMassFlowRate
VarSpeedCoil(DXCoilNum)%OutletWaterTemp = SourceSideInletTemp - QSource/(SourceSideMassFlowRate * CpSource)
VarSpeedCoil(DXCoilNum)%OutletWaterEnthalpy = SourceSideInletEnth - QSource/SourceSideMassFlowRate
END IF
VarSpeedCoil(DXCoilNum)%QWasteHeat = QWasteHeat
RETURN
END SUBROUTINE CalcVarSpeedCoilHeating