SUBROUTINE CalcMultiSpeedDXCoilCooling(DXCoilNum,SpeedRatio, CycRatio, SpeedNum, FanOpMode, CompOp)
! SUBROUTINE INFORMATION:
! AUTHOR Lixing Gu, FSEC
! DATE WRITTEN June 2007
! MODIFIED April 2010, Chandan sharma, FSEC, added basin heater
! RE-ENGINEERED Revised based on CalcMultiSpeedDXCoil
! PURPOSE OF THIS SUBROUTINE:
! Calculates the air-side performance and electrical energy use of a direct-
! expansion, air-cooled cooling unit with a multispeed compressor.
! METHODOLOGY EMPLOYED:
! Uses the same methodology as the single speed DX unit model (SUBROUTINE CalcDoe2DXCoil).
! In addition it assumes that the unit performance is obtained by interpolating between
! the performance at high speed and that at low speed. If the output needed is below
! that produced at low speed, the compressor cycles between off and low speed.
! USE STATEMENTS:
USE CurveManager, ONLY: CurveValue
USE DataWater, ONLY: WaterStorage
USE DataHVACGlobals, ONLY: MSHPMassFlowRateLow, MSHPMassFlowRateHigh, MSHPWasteHeat
USE General, ONLY: TrimSigDigits, RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: DXCoilNum ! the number of the DX heating coil to be simulated
REAL(r64) :: SpeedRatio ! = (CompressorSpeed - CompressorSpeedMin) / (CompressorSpeedMax - CompressorSpeedMin)
! SpeedRatio varies between 1.0 (maximum speed) and 0.0 (minimum speed)
REAL(r64) :: CycRatio ! cycling part load ratio
INTEGER :: SpeedNum ! Speed number
INTEGER :: FanOpMode ! Sets fan control to CycFanCycCoil or ContFanCycCoil
INTEGER :: CompOp ! Compressor on/off; 1=on, 0=off
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='CalcMultiSpeedDXCoilCooling'
! 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) :: InletAirWetBulbC ! wetbulb temperature of inlet air [C]
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]
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
!REAL(r64) :: InletAirPressure ! inlet air pressure [Pa]
REAL(r64) :: OutletAirDryBulbTemp ! outlet air dry bulb temperature [C]
REAL(r64) :: OutletAirEnthalpy ! outlet air enthalpy [J/kg]
REAL(r64) :: OutletAirHumRat ! outlet air humidity ratio [kg/kg]
!REAL(r64) :: OutletAirRH ! outlet air relative humudity [fraction]
REAL(r64) :: OutletAirDryBulbTempSat ! outlet air dry bulb temp at saturation at the outlet enthalpy [C]
REAL(r64) :: LSOutletAirDryBulbTemp ! low speed outlet air dry bulb temperature [C]
REAL(r64) :: LSOutletAirEnthalpy ! low speed outlet air enthalpy [J/kg]
REAL(r64) :: LSOutletAirHumRat ! low speed outlet air humidity ratio [kg/kg]
REAL(r64) :: LSOutletAirRH ! low speed outlet air relative humudity [fraction]
REAL(r64) :: HSOutletAirDryBulbTemp ! hihg speed outlet air dry bulb temperature [C]
REAL(r64) :: HSOutletAirEnthalpy ! high speed outlet air enthalpy [J/kg]
REAL(r64) :: HSOutletAirHumRat ! high speed outlet air humidity ratio [kg/kg]
REAL(r64) :: HSOutletAirRH ! high speed outlet air relative humudity [fraction]
REAL(r64) :: hDelta ! Change in air enthalpy across the cooling coil [J/kg]
REAL(r64) :: hTinwout ! Enthalpy at inlet dry-bulb and outlet humidity ratio [J/kg]
REAL(r64) :: hADP ! Apparatus dew point enthalpy [J/kg]
REAL(r64) :: tADP ! Apparatus dew point temperature [C]
REAL(r64) :: wADP ! Apparatus dew point humidity ratio [kg/kg]
REAL(r64) :: hTinwADP ! Enthalpy at inlet dry-bulb and wADP [J/kg]
REAL(r64) :: RatedCBFHS ! coil bypass factor at rated conditions (high speed)
REAL(r64) :: CBFHS ! coil bypass factor at max flow (high speed)
REAL(r64) :: RatedCBFLS ! coil bypass factor at rated conditions (low speed)
REAL(r64) :: CBFLS ! coil bypass factor at max flow (low speed)
REAL(r64) :: TotCapHS ! total capacity at high speed [W]
REAL(r64) :: SHRHS ! sensible heat ratio at high speed
REAL(r64) :: TotCapLS ! total capacity at low speed [W]
REAL(r64) :: SHRLS ! sensible heat ratio at low speed
REAL(r64) :: EIRTempModFacHS ! EIR modifier (function of entering wetbulb, outside drybulb) (high speed)
REAL(r64) :: EIRFlowModFacHS ! EIR modifier (function of actual supply air flow vs rated flow) (high speed)
REAL(r64) :: EIRHS ! EIR at off rated conditions (high speed)
REAL(r64) :: EIRTempModFacLS ! EIR modifier (function of entering wetbulb, outside drybulb) (low speed)
REAL(r64) :: EIRFlowModFacLS ! EIR modifier (function of actual supply air flow vs rated flow) (low speed)
REAL(r64) :: EIRLS ! EIR at off rated conditions (low speed)
REAL(r64) :: SHR ! sensible heat ratio at current speed
REAL(r64) :: EIR ! EIR at current speed
REAL(r64) :: CBF ! CBFNom adjusted for actual air mass flow rate
REAL(r64) :: PLF ! Part load factor, accounts for thermal lag at compressor startup, used in
! power calculation
REAL(r64) :: CondInletTemp ! Condenser inlet temperature (C). Outdoor dry-bulb temp for air-cooled condenser.
! Outdoor Wetbulb +(1 - effectiveness)*(outdoor drybulb - outdoor wetbulb) for evap condenser.
REAL(r64) :: CondInletHumrat ! Condenser inlet humidity ratio (kg/kg). Zero for air-cooled condenser.
! For evap condenser, its the humidity ratio of the air leaving the evap cooling pads.
REAL(r64) :: RhoAir ! Density of air [kg/m3]
REAL(r64) :: RhoWater ! Density of water [kg/m3]
REAL(r64) :: CondAirMassFlow ! Condenser air mass flow rate [kg/s]
REAL(r64) :: EvapCondPumpElecPower ! Evaporative condenser electric pump power [W]
REAL(r64) :: MinAirHumRat = 0.0d0 ! minimum of the inlet air humidity ratio and the outlet air humidity ratio
INTEGER,SAVE :: DXMode=1 ! Performance mode for MultiMode DX coil; Always 1 for other coil types
REAL(r64) :: OutdoorDryBulb ! Outdoor dry-bulb temperature at condenser (C)
REAL(r64) :: OutdoorWetBulb ! Outdoor wet-bulb temperature at condenser (C)
REAL(r64) :: OutdoorHumRat ! Outdoor humidity ratio at condenser (kg/kg)
REAL(r64) :: OutdoorPressure ! Outdoor barometric pressure at condenser (Pa)
INTEGER :: SpeedNumHS ! High speed number
INTEGER :: SpeedNumLS ! Low speed number
REAL(r64) :: SHRUnadjusted ! Temp SHR
REAL(r64) :: QLatRated ! Qlatent at rated conditions of indoor(TDB,TWB)=(26.7C,19.4C)
REAL(r64) :: QLatActual ! Qlatent at actual operating conditions
REAL(r64) :: AirMassFlowRatioLS ! airflow ratio at low speed
REAL(r64) :: AirMassFlowRatioHS ! airflow ratio at high speed
REAL(r64) :: WasteHeatLS ! Waste heat at low speed
REAL(r64) :: WasteHeatHS ! Waste heat at high speed
REAL(r64) :: LSElecCoolingPower ! low speed power [W]
REAL(r64) :: HSElecCoolingPower ! high speed power [W]
REAL(r64) :: CrankcaseHeatingPower ! Power due to crank case heater
REAL(r64) :: Hfg
REAL(r64) :: AirVolumeFlowRate ! Air volume flow rate across the heating coil
REAL(r64) :: VolFlowperRatedTotCap ! Air volume flow rate divided by rated total heating capacity
IF (DXCoil(DXCoilNum)%CondenserInletNodeNum(DXMode) /= 0) THEN
OutdoorPressure = Node(DXCoil(DXCoilNum)%CondenserInletNodeNum(DXMode))%Press
! If node is not connected to anything, pressure = default, use weather data
IF(OutdoorPressure == DefaultNodeValues%Press)THEN
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ELSE
OutdoorDryBulb = Node(DXCoil(DXCoilNum)%CondenserInletNodeNum(DXMode))%Temp
OutdoorHumRat = Node(DXCoil(DXCoilNum)%CondenserInletNodeNum(DXMode))%HumRat
OutdoorWetBulb = PsyTwbFnTdbWPb(OutdoorDryBulb,OutdoorHumRat,OutdoorPressure,RoutineName)
END IF
ELSE
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ENDIF
If (SpeedNum > 1) Then
SpeedNumLS = SpeedNum-1
SpeedNumHS = SpeedNum
If (SpeedNum .GT. DXCoil(DXCoilNum)%NumOfSpeeds) Then
SpeedNumLS = DXCoil(DXCoilNum)%NumOfSpeeds-1
SpeedNumHS = DXCoil(DXCoilNum)%NumOfSpeeds
End If
Else
SpeedNumLS = 1
SpeedNumHS = 1
End If
MSHPWasteHeat = 0.0d0
AirMassFlow = DXCoil(DXCoilNum)%InletAirMassFlowRate
AirMassFlowRatioLS = MSHPMassFlowRateLow/DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumLS)
AirMassFlowRatioHS = MSHPMassFlowRateHigh/DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumHS)
DXCoil(DXCoilNum)%PartLoadRatio = 0.0d0
HeatReclaimDXCoil(DXCoilNum)%AvailCapacity = 0.0d0
DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction = 0.0d0
InletAirDryBulbTemp = DXCoil(DXCoilNum)%InletAirTemp
InletAirEnthalpy = DXCoil(DXCoilNum)%InletAirEnthalpy
InletAirHumRat = DXCoil(DXCoilNum)%InletAirHumRat
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
!InletAirPressure = DXCoil(DXCoilNum)%InletAirPressure
!InletAirWetbulbC = PsyTwbFnTdbWPb(InletAirDryBulbTemp,InletAirHumRat,InletAirPressure)
InletAirWetbulbC = PsyTwbFnTdbWPb(InletAirDryBulbTemp,InletAirHumRat,OutdoorPressure,RoutineName)
IF (DXCoil(DXCoilNum)%CondenserType(DXMode) == AirCooled) THEN
CondInletTemp = OutdoorDryBulb ! Outdoor dry-bulb temp
ELSEIF (DXCoil(DXCoilNum)%CondenserType(DXMode) == EvapCooled) THEN
! Outdoor wet-bulb temp from DataEnvironment + (1.0-EvapCondEffectiveness) * (drybulb - wetbulb)
CondInletTemp = OutdoorWetBulb + (OutdoorDryBulb-OutdoorWetBulb)*(1.0d0 - DXCoil(DXCoilNum)%MSEvapCondEffect(SpeedNumHS))
CondInletHumrat = PsyWFnTdbTwbPb(CondInletTemp,OutdoorWetBulb,OutdoorPressure,RoutineName)
END IF
IF (OutdoorDryBulb .LT. DXCoil(DXCoilNum)%MaxOATCrankcaseHeater)THEN
CrankcaseHeatingPower = DXCoil(DXCoilNum)%CrankcaseHeaterCapacity
ELSE
CrankcaseHeatingPower = 0.0d0
END IF
IF((AirMassFlow .GT. 0.0d0) .AND. &
(GetCurrentScheduleValue(DXCoil(DXCoilNum)%SchedPtr) .GT. 0.0d0) &
.AND. (SpeedRatio > 0.0d0 .OR. CycRatio > 0.0d0) .AND. (CompOp == On)) THEN
RhoAir = PsyRhoAirFnPbTdbW(OutdoorPressure,OutdoorDryBulb,OutdoorHumRat,RoutineName)
IF (SpeedNum > 1) THEN
! Check for valid air volume flow per rated total cooling capacity (200 - 500 cfm/ton) at low speed
AirVolumeFlowRate = MSHPMassFlowRateLow/PsyRhoAirFnPbTdbW(OutdoorPressure,InletAirDryBulbTemp, InletAirHumRat,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! AirVolumeFlowRate = AirMassFlow/PsyRhoAirFnPbTdbW(InletAirPressure,InletAirDryBulbTemp, InletAirHumRat)
VolFlowperRatedTotCap = AirVolumeFlowRate/DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumLS)
IF ((VolFlowperRatedTotCap.LT.MinOperVolFlowPerRatedTotCap(DXCT)).OR. &
(VolFlowperRatedTotCap.GT.MaxCoolVolFlowPerRatedTotCap(DXCT))) THEN
IF (DXCoil(DXCoilNum)%MSErrIndex(SpeedNumLS) == 0) THEN
CALL ShowWarningMessage(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed ' &
//TRIM(TrimSigDigits(SpeedNumLS))//'.')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('Expected range for VolumeFlowPerRatedTotalCapacity=['// &
TRIM(RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT),3))//'--'// &
TRIM(RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT),3))//']')
CALL ShowContinueError('Possible causes include inconsistent air flow rates in system components or')
CALL ShowContinueError('inconsistent supply air fan operation modes in coil and unitary system objects.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out ' //&
'of range at speed '//TRIM(TrimSigDigits(SpeedNumLS))//'error continues...', &
DXCoil(DXCoilNum)%MSErrIndex(SpeedNumLS),ReportMinOf=VolFlowperRatedTotCap,ReportMaxOf=VolFlowperRatedTotCap)
END IF
! Check for valid air volume flow per rated total cooling capacity (200 - 500 cfm/ton) at high speed
AirVolumeFlowRate = MSHPMassFlowRateHigh/PsyRhoAirFnPbTdbW(OutdoorPressure,InletAirDryBulbTemp, InletAirHumRat,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! AirVolumeFlowRate = AirMassFlow/PsyRhoAirFnPbTdbW(InletAirPressure,InletAirDryBulbTemp, InletAirHumRat)
VolFlowperRatedTotCap = AirVolumeFlowRate/DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumHS)
IF ((VolFlowperRatedTotCap.LT.MinOperVolFlowPerRatedTotCap(DXCT)).OR. &
(VolFlowperRatedTotCap.GT.MaxCoolVolFlowPerRatedTotCap(DXCT))) THEN
IF (DXCoil(DXCoilNum)%MSErrIndex(SpeedNumHS) == 0) THEN
CALL ShowWarningMessage(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed ' &
//Trim(TrimSigDigits(SpeedNumHS))//'.')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('Expected range for VolumeFlowPerRatedTotalCapacity=['// &
TRIM(RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT),3))//'--'// &
TRIM(RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT),3))//']')
CALL ShowContinueError('Possible causes include inconsistent air flow rates in system components or')
CALL ShowContinueError('inconsistent supply air fan operation modes in coil and unitary system objects.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out ' //&
'of range at speed '//TRIM(TrimSigDigits(SpeedNumHS))//'error continues...', &
DXCoil(DXCoilNum)%MSErrIndex(SpeedNumHS),ReportMinOf=VolFlowperRatedTotCap,ReportMaxOf=VolFlowperRatedTotCap)
END IF
! Adjust high speed coil bypass factor for actual maximum air flow rate.
RatedCBFHS = DXCoil(DXCoilNum)%MSRatedCBF(SpeedNumHS)
CBFHS = AdjustCBF(RatedCBFHS,DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumHS),MSHPMassFlowRateHigh)
RatedCBFLS = DXCoil(DXCoilNum)%MSRatedCBF(SpeedNumLS)
CBFLS = AdjustCBF(RatedCBFLS,DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumLS),MSHPMassFlowRateLow)
! get low speed total capacity and SHR at current conditions
CALL CalcTotCapSHR(InletAirDryBulbTemp,InletAirHumRat,InletAirEnthalpy,InletAirWetbulbC,AirMassFlowRatioLS, &
MSHPMassFlowRateLow,DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumLS), &
CBFLS,DXCoil(DXCoilNum)%MSCCapFTemp(SpeedNumLS), &
DXCoil(DXCoilNum)%MSCCapFFlow(SpeedNumLS),TotCapLS,SHRLS,CondInletTemp, &
OutdoorPressure)
! get low speed outlet conditions
hDelta = TotCapLS / MSHPMassFlowRateLow
! Calculate new apparatus dew point conditions
hADP = InletAirEnthalpy - hDelta/(1.d0-CBFLS)
tADP = PsyTsatFnHPb(hADP,OutdoorPressure,'CalcMultiSpeedDXCoilCooling highspeed')
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! tADP = PsyTsatFnHPb(hADP,InletAirPressure)
wADP = PsyWFnTdbH(tADP,hADP,'CalcMultiSpeedDXCoilCooling')
hTinwADP = PsyHFnTdbW(InletAirDryBulbTemp,wADP,'CalcMultiSpeedDXCoilCooling highspeed')
! get corresponding SHR
IF ((InletAirEnthalpy-hADP) > 1.d-10) THEN
SHRLS = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
ELSE
SHRLS=1.0d0
ENDIF
!cr8918 SHRLS = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
! get low speed outlet conditions
LSOutletAirEnthalpy = InletAirEnthalpy - hDelta
hTinwout = InletAirEnthalpy - (1.0d0-SHRLS)*hDelta
LSOutletAirHumRat = PsyWFnTdbH(InletAirDryBulbTemp,hTinwout,RoutineName)
LSOutletAirDryBulbTemp = PsyTdbFnHW(LSOutletAirEnthalpy,LSOutletAirHumRat,RoutineName)
LSOutletAirRH = PsyRhFnTdbWPb(LSOutletAirDryBulbTemp,LSOutletAirHumRat,OutdoorPressure, &
'CalcMultiSpeedDXCoilCooling:highspeed')
OutletAirDryBulbTempSat = PsyTsatFnHPb(LSOutletAirEnthalpy,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! LSOutletAirRH = PsyRhFnTdbWPb(LSOutletAirDryBulbTemp,LSOutletAirHumRat,InletAirPressure)
! OutletAirDryBulbTempSat = PsyTsatFnHPb(LSOutletAirEnthalpy,InletAirPressure)
IF (LSOutletAirDryBulbTemp < OutletAirDryBulbTempSat) THEN ! Limit to saturated conditions at OutletAirEnthalpy
LSOutletAirDryBulbTemp = OutletAirDryBulbTempSat
LSOutletAirHumRat = PsyWFnTdbH(LSOutletAirDryBulbTemp,LSOutletAirEnthalpy,RoutineName)
END IF
! get high speed total capacity and SHR at current conditions
CALL CalcTotCapSHR(InletAirDryBulbTemp,InletAirHumRat,InletAirEnthalpy,InletAirWetbulbC,AirMassFlowRatioHS, &
MSHPMassFlowRateHigh,DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumHS), &
CBFHS,DXCoil(DXCoilNum)%MSCCapFTemp(SpeedNumHS),DXCoil(DXCoilNum)%MSCCapFFlow(SpeedNumHS),TotCapHS,SHRHS, &
CondInletTemp, OutdoorPressure)
hDelta = TotCapHS / MSHPMassFlowRateHigh
! Calculate new apparatus dew point conditions
hADP = InletAirEnthalpy - hDelta/(1.d0-CBFHS)
tADP = PsyTsatFnHPb(hADP,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! tADP = PsyTsatFnHPb(hADP,InletAirPressure)
wADP = PsyWFnTdbH(tADP,hADP,RoutineName)
hTinwADP = PsyHFnTdbW(InletAirDryBulbTemp,wADP,RoutineName)
! get corresponding SHR
IF ((InletAirEnthalpy-hADP) > 1.d-10) THEN
SHRHS = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
ELSE
SHRHS=1.0d0
ENDIF
!cr8918 SHRHS = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
! get the part load factor that will account for cycling losses
PLF = CurveValue(DXCoil(DXCoilNum)%MSPLFFPLR(SpeedNumHS),SpeedRatio)
IF (PLF < 0.7d0) THEN
PLF = 0.7d0
END IF
! calculate the run time fraction
DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction = SpeedRatio / PLF
DXCoil(DXCoilNum)%PartLoadRatio = SpeedRatio
IF ( DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction > 1.0d0 ) THEN
DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction = 1.0d0 ! Reset coil runtime fraction to 1.0
END IF
! get high speed outlet conditions
HSOutletAirEnthalpy = InletAirEnthalpy - hDelta
hTinwout = InletAirEnthalpy - (1.0d0-SHRHS)*hDelta
HSOutletAirHumRat = PsyWFnTdbH(InletAirDryBulbTemp,hTinwout,RoutineName)
HSOutletAirDryBulbTemp = PsyTdbFnHW(HSOutletAirEnthalpy,HSOutletAirHumRat,RoutineName)
HSOutletAirRH = PsyRhFnTdbWPb(HSOutletAirDryBulbTemp,HSOutletAirHumRat,OutdoorPressure, &
RoutineName//':highspeedoutlet')
OutletAirDryBulbTempSat = PsyTsatFnHPb(HSOutletAirEnthalpy,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! LSOutletAirRH = PsyRhFnTdbWPb(LSOutletAirDryBulbTemp,LSOutletAirHumRat,InletAirPressure)
! OutletAirDryBulbTempSat = PsyTsatFnHPb(LSOutletAirEnthalpy,InletAirPressure)
IF (HSOutletAirDryBulbTemp < OutletAirDryBulbTempSat) THEN ! Limit to saturated conditions at OutletAirEnthalpy
HSOutletAirDryBulbTemp = OutletAirDryBulbTempSat
HSOutletAirHumRat = PsyWFnTdbH(HSOutletAirDryBulbTemp,HSOutletAirEnthalpy,RoutineName)
END IF
! If constant fan with cycling compressor, call function to determine "effective SHR"
! which includes the part-load degradation on latent capacity
IF (DXCoil(DXCoilNum)%LatentImpact .AND. FanOpMode .EQ. ContFanCycCoil .AND. SpeedRatio .GT. 0.0d0) THEN
QLatRated = DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumHS) * (1.d0 - DXCoil(DXCoilNum)%MSRatedSHR(SpeedNumHS))
QLatActual = TotCapHS * (1.d0 - SHRHS)
SHRUnadjusted = SHRHS
SHR = CalcEffectiveSHR(DXCoilNum, SHRHS, DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction, &
QLatRated, QLatActual, InletAirDryBulbTemp, InletAirWetbulbC, SpeedNumHS)
! Calculate full load output conditions
If (SHR .GT. 1.0d0) SHR=1.0d0
hTinwout = InletAirEnthalpy - (1.0d0-SHR)*hDelta
If (SHR < 1.0d0) Then
HSOutletAirHumRat = PsyWFnTdbH(InletAirDryBulbTemp,hTinwout,RoutineName)
Else
HSOutletAirHumRat = InletAirHumRat
End If
HSOutletAirDryBulbTemp = PsyTdbFnHW(HSOutletAirEnthalpy,HSOutletAirHumRat,RoutineName)
END IF
! get high speed EIR at current conditions
EIRTempModFacHS = CurveValue(DXCoil(DXCoilNum)%MSEIRFTemp(SpeedNumHS),InletAirWetbulbC,CondInletTemp)
EIRFlowModFacHS = CurveValue(DXCoil(DXCoilNum)%MSEIRFFlow(SpeedNumHS),AirMassFlowRatioHS)
EIRHS = 1.0d0/DXCoil(DXCoilNum)%MSRatedCOP(SpeedNumHS) * EIRFlowModFacHS * EIRTempModFacHS
! get low speed EIR at current conditions
EIRTempModFacLS = CurveValue(DXCoil(DXCoilNum)%MSEIRFTemp(SpeedNumLS),InletAirWetbulbC,CondInletTemp)
EIRFlowModFacLS = CurveValue(DXCoil(DXCoilNum)%MSEIRFFlow(SpeedNumLS),AirMassFlowRatioLS)
EIRLS = 1.0d0/DXCoil(DXCoilNum)%MSRatedCOP(SpeedNumLS) * EIRTempModFacLS * EIRFlowModFacLS
! get current total capacity, SHR, EIR
IF (SpeedRatio >= 1.0d0) THEN
SHR = SHRHS
EIR = EIRHS
CondAirMassFlow = RhoAir * DXCoil(DXCoilNum)%MSEvapCondAirFlow(SpeedNumHS)
EvapCondPumpElecPower = DXCoil(DXCoilNum)%MSEvapCondPumpElecNomPower(SpeedNumHS)
ELSE
EIR = SpeedRatio*EIRHS + (1.0d0-SpeedRatio)*EIRLS
SHR = SpeedRatio*SHRHS + (1.0d0-SpeedRatio)*SHRLS
CondAirMassFlow = RhoAir * (SpeedRatio * DXCoil(DXCoilNum)%MSEvapCondAirFlow(SpeedNumHS) + (1.0d0-SpeedRatio)* &
DXCoil(DXCoilNum)%MSEvapCondAirFlow(SpeedNumLS))
EvapCondPumpElecPower = SpeedRatio * DXCoil(DXCoilNum)%MSEvapCondPumpElecNomPower(SpeedNumHS) + (1.0d0-SpeedRatio)* &
DXCoil(DXCoilNum)%MSEvapCondPumpElecNomPower(SpeedNumLS)
END IF
! Outlet calculation
DXCoil(DXCoilNum)%TotalCoolingEnergyRate = MSHPMassFlowRateHigh*(InletAirEnthalpy - HSOutletAirEnthalpy)*SpeedRatio + &
MSHPMassFlowRateLow*(InletAirEnthalpy - LSOutletAirEnthalpy)*(1.0d0-SpeedRatio)
! Average outlet enthalpy
OutletAirEnthalpy = InletAirEnthalpy - DXCoil(DXCoilNum)%TotalCoolingEnergyRate/DXCoil(DXCoilNum)%InletAirMassFlowRate
MinAirHumRat = MIN(InletAirHumRat,SpeedRatio*HSOutletAirHumRat+(1.0d0-SpeedRatio)*LSOutletAirHumRat)
DXCoil(DXCoilNum)%SensCoolingEnergyRate = MSHPMassFlowRateHigh*(PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - &
PsyHFnTdbW(HSOutletAirDryBulbTemp,MinAirHumRat,RoutineName))*SpeedRatio + &
MSHPMassFlowRateLow*(PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - &
PsyHFnTdbW(LSOutletAirDryBulbTemp,MinAirHumRat,RoutineName))*(1.0d0-SpeedRatio)
IF (DXCoil(DXCoilNum)%SensCoolingEnergyRate > DXCoil(DXCoilNum)%TotalCoolingEnergyRate) THEN
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate
END IF
DXCoil(DXCoilNum)%LatCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate - &
DXCoil(DXCoilNum)%SensCoolingEnergyRate
IF (FanOpMode .EQ. CycFanCycCoil) OnOffFanPartLoadFraction = 1.0d0
! Update outlet conditions
If (SpeedRatio .EQ. 0.0d0 .AND. FanOpMode .EQ. CycFanCycCoil) Then
OutletAirEnthalpy = LSOutletAirEnthalpy
OutletAirHumRat = LSOutletAirHumRat
OutletAirDryBulbTemp = LSOutletAirDryBulbTemp
Else If (SpeedRatio >= 1.0d0 .AND. FanOpMode .EQ. CycFanCycCoil) Then
OutletAirEnthalpy = HSOutletAirEnthalpy
OutletAirHumRat = HSOutletAirHumRat
OutletAirDryBulbTemp = HSOutletAirDryBulbTemp
Else
Hfg = PsyHfgAirFnWTdb(MinAirHumRat,HSOutletAirDryBulbTemp*SpeedRatio+(1.0d0-SpeedRatio)*LSOutletAirDryBulbTemp, &
RoutineName//':highspeed')
! Average outlet HR
OutletAirHumRat = InletAirHumRat-DXCoil(DXCoilNum)%LatCoolingEnergyRate/Hfg/DXCoil(DXCoilNum)%InletAirMassFlowRate
OutletAirDryBulbTemp = PsyTdbFnHW(OutletAirEnthalpy,OutletAirHumRat,RoutineName)
IF (OutletAirDryBulbTemp < OutletAirDryBulbTempSat) THEN ! Limit to saturated conditions at OutletAirEnthalpy
OutletAirDryBulbTemp = OutletAirDryBulbTempSat
OutletAirHumRat = PsyWFnTdbH(OutletAirDryBulbTemp,OutletAirEnthalpy,RoutineName)
MinAirHumRat = MIN(InletAirHumRat,OutletAirHumRat)
DXCoil(DXCoilNum)%SensCoolingEnergyRate = AirMassFlow*(PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - &
PsyHFnTdbW(OutletAirDryBulbTemp,MinAirHumRat,RoutineName))
IF (DXCoil(DXCoilNum)%SensCoolingEnergyRate > DXCoil(DXCoilNum)%TotalCoolingEnergyRate) THEN
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate
END IF
DXCoil(DXCoilNum)%LatCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate - &
DXCoil(DXCoilNum)%SensCoolingEnergyRate
END IF
End If
LSElecCoolingPower = TotCapLS*EIRLS
HSElecCoolingPower = TotCapHS*EIRHS
! Power calculation
If (.NOT. DXCoil(DXCoilNum)%PLRImpact) Then
DXCoil(DXCoilNum)%ElecCoolingPower = SpeedRatio*HSElecCoolingPower+(1.0d0-SpeedRatio)*LSElecCoolingPower
Else
DXCoil(DXCoilNum)%ElecCoolingPower = DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction*HSElecCoolingPower + &
(1.0d0-DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction)*LSElecCoolingPower
End If
! Calculation for heat reclaim needs to be corrected to use compressor power (not including condenser fan power)
HeatReclaimDXCoil(DXCoilNum)%AvailCapacity = DXCoil(DXCoilNum)%TotalCoolingEnergyRate + DXCoil(DXCoilNum)%ElecCoolingPower
! Waste heat calculation
WasteHeatLS = CurveValue(DXCoil(DXCoilNum)%MSWasteHeat(SpeedNumLS),OutdoorDryBulb,InletAirDryBulbTemp) * &
DXCoil(DXCoilNum)%MSWasteHeatFrac(SpeedNumLS)
WasteHeatHS = CurveValue(DXCoil(DXCoilNum)%MSWasteHeat(SpeedNumHS),OutdoorDryBulb,InletAirDryBulbTemp) * &
DXCoil(DXCoilNum)%MSWasteHeatFrac(SpeedNumHS)
MSHPWasteHeat = (SpeedRatio*WasteHeatHS + (1.0d0-SpeedRatio)*WasteHeatLS)*DXCoil(DXCoilNum)%ElecCoolingPower
! Energy use for other fuel types
If (DXCoil(DXCoilNum)%FuelType .NE. FuelTypeElectricity) Then
DXCoil(DXCoilNum)%FuelUsed = DXCoil(DXCoilNum)%ElecCoolingPower
DXCoil(DXCoilNum)%ElecCoolingPower = 0.0d0
End If
DXCoil(DXCoilNum)%OutletAirEnthalpy = OutletAirEnthalpy
DXCoil(DXCoilNum)%OutletAirHumRat = OutletAirHumRat
DXCoil(DXCoilNum)%OutletAirTemp = OutletAirDryBulbTemp
DXCoil(DXCoilNum)%CrankcaseHeaterPower = 0.0d0
ELSE IF (CycRatio > 0.0d0) THEN
IF (FanOpMode .EQ. CycFanCycCoil) AirMassFlow = AirMassFlow/CycRatio
IF (FanOpMode .EQ. ContFanCycCoil) AirMassFlow = MSHPMassFlowRateLow
! Check for valid air volume flow per rated total cooling capacity (200 - 500 cfm/ton) at low speed
AirVolumeFlowRate = MSHPMassFlowRateLow/PsyRhoAirFnPbTdbW(OutdoorPressure,InletAirDryBulbTemp, InletAirHumRat,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! AirVolumeFlowRate = AirMassFlow/PsyRhoAirFnPbTdbW(InletAirPressure,InletAirDryBulbTemp, InletAirHumRat)
VolFlowperRatedTotCap = AirVolumeFlowRate/DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumLS)
IF ((VolFlowperRatedTotCap.LT.MinOperVolFlowPerRatedTotCap(DXCT)).OR. &
(VolFlowperRatedTotCap.GT.MaxCoolVolFlowPerRatedTotCap(DXCT))) THEN
IF (DXCoil(DXCoilNum)%MSErrIndex(SpeedNumLS) == 0) THEN
CALL ShowWarningMessage(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out of range at speed ' &
//TRIM(TrimSigDigits(SpeedNumLS))//'.')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('Expected range for VolumeFlowPerRatedTotalCapacity=['// &
TRIM(RoundSigDigits(MinOperVolFlowPerRatedTotCap(DXCT),3))//'--'// &
TRIM(RoundSigDigits(MaxCoolVolFlowPerRatedTotCap(DXCT),3))//']')
CALL ShowContinueError('Possible causes include inconsistent air flow rates in system components or')
CALL ShowContinueError('inconsistent supply air fan operation modes in coil and unitary system objects.')
END IF
CALL ShowRecurringWarningErrorAtEnd(TRIM(DXCoil(DXCoilNum)%DXCoilType)//' "'//TRIM(DXCoil(DXCoilNum)%Name)//&
'" - Air volume flow rate per watt of rated total cooling capacity is out ' //&
'of range at speed '//TRIM(TrimSigDigits(SpeedNumHS))//'error continues...', &
DXCoil(DXCoilNum)%MSErrIndex(SpeedNumHS),ReportMinOf=VolFlowperRatedTotCap,ReportMaxOf=VolFlowperRatedTotCap)
END IF
IF (DXCoil(DXCoilNum)%CondenserType(SpeedNumLS) == EvapCooled) THEN
! Outdoor wet-bulb temp from DataEnvironment + (1.0-EvapCondEffectiveness) * (drybulb - wetbulb)
CondInletTemp = OutdoorWetBulb + (OutdoorDryBulb-OutdoorWetBulb)*(1.0d0 - DXCoil(DXCoilNum)%MSEvapCondEffect(SpeedNumLS))
CondInletHumrat = PsyWFnTdbTwbPb(CondInletTemp,OutdoorWetBulb,OutdoorPressure,RoutineName)
END IF
RatedCBFLS = DXCoil(DXCoilNum)%MSRatedCBF(SpeedNumLS)
CBFLS = AdjustCBF(RatedCBFLS,DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumLS),MSHPMassFlowRateLow)
! Adjust low speed coil bypass factor for actual flow rate.
! CBF = AdjustCBF(DXCoil(DXCoilNum)%RatedCBF2,DXCoil(DXCoilNum)%RatedAirMassFlowRate2,AirMassFlow)
! get low speed total capacity and SHR at current conditions
CALL CalcTotCapSHR(InletAirDryBulbTemp,InletAirHumRat,InletAirEnthalpy,InletAirWetbulbC,AirMassFlowRatioLS, &
MSHPMassFlowRateLow,DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumLS), &
CBFLS,DXCoil(DXCoilNum)%MSCCapFTemp(SpeedNumLS), &
DXCoil(DXCoilNum)%MSCCapFFlow(SpeedNumLS),TotCapLS,SHRLS,CondInletTemp, &
OutdoorPressure)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! Node(DXCoil(DXCoilNum)%AirInNode)%Press)
hDelta = TotCapLS / AirMassFlow
! Adjust CBF for off-nominal flow
CBF = AdjustCBF(DXCoil(DXCoilNum)%MSRatedCBF(SpeedNumLS),DXCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedNumLS),AirMassFlow)
! Calculate new apparatus dew point conditions
hADP = InletAirEnthalpy - hDelta/(1.d0-CBF)
tADP = PsyTsatFnHPb(hADP,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! tADP = PsyTsatFnHPb(hADP,InletAirPressure)
wADP = PsyWFnTdbH(tADP,hADP,RoutineName)
hTinwADP = PsyHFnTdbW(InletAirDryBulbTemp,wADP,RoutineName)
! get corresponding SHR
IF ((InletAirEnthalpy-hADP) > 1.d-10) THEN
SHR = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
ELSE
SHR=1.0d0
ENDIF
!cr8918 SHR = MIN((hTinwADP-hADP)/(InletAirEnthalpy-hADP),1.d0)
! get the part load factor that will account for cycling losses
PLF = CurveValue(DXCoil(DXCoilNum)%MSPLFFPLR(SpeedNumLS),CycRatio)
IF (FanOpMode .EQ. CycFanCycCoil .AND. CycRatio .EQ. 1.0d0 .AND. PLF .NE. 1.0d0) Then
IF (DXCoil(DXCoilNum)%PLFErrIndex == 0) THEN
CALL ShowWarningMessage('The PLF curve value for DX cooling coil '//TRIM(DXCoil(DXCoilNum)%Name)//&
' ='//TRIM(RoundSigDigits(PLF,2))//' for part-load ratio = 1')
CALL ShowContinueError('PLF curve value must be = 1.0 and has been reset to 1.0. Simulation is continuing.')
CALL ShowContinueErrorTimeStamp(' ')
ENDIF
CALL ShowRecurringWarningErrorAtEnd(TRIM(DXCoil(DXCoilNum)%Name)//'":'//&
' DX cooling coil PLF curve value <> 1.0 warning continues...' &
, DXCoil(DXCoilNum)%PLFErrIndex, PLF, PLF)
PLF = 1.0d0
END IF
IF (PLF < 0.7d0) THEN
PLF = 0.7d0
END IF
! calculate the run time fraction
DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction = CycRatio / PLF
DXCoil(DXCoilNum)%PartLoadRatio = CycRatio
IF ( DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction > 1.0d0 ) THEN
DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction = 1.0d0 ! Reset coil runtime fraction to 1.0
END IF
! get low speed outlet conditions
LSOutletAirEnthalpy = InletAirEnthalpy - hDelta
hTinwout = InletAirEnthalpy - (1.0d0-SHR)*hDelta
LSOutletAirHumRat = PsyWFnTdbH(InletAirDryBulbTemp,hTinwout,RoutineName)
LSOutletAirDryBulbTemp = PsyTdbFnHW(LSOutletAirEnthalpy,LSOutletAirHumRat,RoutineName)
LSOutletAirRH = PsyRhFnTdbWPb(LSOutletAirDryBulbTemp,LSOutletAirHumRat,OutdoorPressure, &
RoutineName//':lowspeedoutlet')
OutletAirDryBulbTempSat = PsyTsatFnHPb(LSOutletAirEnthalpy,OutdoorPressure,RoutineName)
! Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
! LSOutletAirRH = PsyRhFnTdbWPb(LSOutletAirDryBulbTemp,LSOutletAirHumRat,InletAirPressure)
! OutletAirDryBulbTempSat = PsyTsatFnHPb(LSOutletAirEnthalpy,InletAirPressure)
IF (LSOutletAirDryBulbTemp < OutletAirDryBulbTempSat) THEN ! Limit to saturated conditions at OutletAirEnthalpy
LSOutletAirDryBulbTemp = OutletAirDryBulbTempSat
LSOutletAirHumRat = PsyWFnTdbH(LSOutletAirDryBulbTemp,LSOutletAirEnthalpy,RoutineName)
END IF
! If constant fan with cycling compressor, call function to determine "effective SHR"
! which includes the part-load degradation on latent capacity
IF (FanOpMode .EQ. ContFanCycCoil) THEN
QLatRated = DXCoil(DXCoilNum)%MSRatedTotCap(SpeedNumLS) * (1.d0 - DXCoil(DXCoilNum)%MSRatedSHR(SpeedNumLS))
QLatActual = TotCapLS * (1.d0 - SHR)
SHRUnadjusted = SHR
SHR = CalcEffectiveSHR(DXCoilNum, SHR, DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction, &
QLatRated, QLatActual, InletAirDryBulbTemp, InletAirWetbulbC, SpeedNumLS)
! Calculate full load output conditions
If (SHR .GT. 1.0d0) SHR=1.0d0
hTinwout = InletAirEnthalpy - (1.0d0-SHR)*hDelta
If (SHR < 1.0d0) Then
LSOutletAirHumRat = PsyWFnTdbH(InletAirDryBulbTemp,hTinwout,RoutineName)
Else
LSOutletAirHumRat = InletAirHumRat
End If
LSOutletAirDryBulbTemp = PsyTdbFnHW(LSOutletAirEnthalpy,LSOutletAirHumRat,RoutineName)
END IF
IF (FanOpMode .EQ. CycFanCycCoil) OnOffFanPartLoadFraction = PLF
! outlet conditions are average of inlet and low speed weighted by CycRatio
OutletAirEnthalpy = LSOutletAirEnthalpy
OutletAirHumRat = LSOutletAirHumRat
OutletAirDryBulbTemp = LSOutletAirDryBulbTemp
! get low speed EIR at current conditions
EIRTempModFacLS = CurveValue(DXCoil(DXCoilNum)%MSEIRFTemp(SpeedNumLS),InletAirWetbulbC,CondInletTemp)
EIRFlowModFacLS = CurveValue(DXCoil(DXCoilNum)%MSEIRFFlow(SpeedNumLS),AirMassFlowRatioLS)
EIRLS = 1.0d0/DXCoil(DXCoilNum)%MSRatedCOP(SpeedNumLS) * EIRTempModFacLS * EIRFlowModFacLS
! get the eletrical power consumption
DXCoil(DXCoilNum)%ElecCoolingPower = TotCapLS * EIRLS * DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction
! calculate cooling output power
! AirMassFlow = DXCoil(DXCoilNum)%InletAirMassFlowRate
DXCoil(DXCoilNum)%TotalCoolingEnergyRate = AirMassFlow * (InletAirEnthalpy - LSOutletAirEnthalpy)*CycRatio
IF (FanOpMode .EQ. ContFanCycCoil) THEN
OutletAirEnthalpy = InletAirEnthalpy - DXCoil(DXCoilNum)%TotalCoolingEnergyRate/DXCoil(DXCoilNum)%InletAirMassFlowRate
MinAirHumRat = MIN(InletAirHumRat,LSOutletAirHumRat)
DXCoil(DXCoilNum)%SensCoolingEnergyRate = AirMassFlow * (PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - &
PsyHFnTdbW(LSOutletAirDryBulbTemp,MinAirHumRat,RoutineName))*CycRatio
IF (DXCoil(DXCoilNum)%SensCoolingEnergyRate > DXCoil(DXCoilNum)%TotalCoolingEnergyRate) THEN
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate
END IF
DXCoil(DXCoilNum)%LatCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate - &
DXCoil(DXCoilNum)%SensCoolingEnergyRate
! Calculate avarage outlet conditions
Hfg = PsyHfgAirFnWTdb(MinAirHumRat,OutletAirDryBulbTemp*CycRatio+(1.0d0-CycRatio)*InletAirDryBulbTemp,'MultiSpeedCooling ')
OutletAirHumRat = InletAirHumRat-DXCoil(DXCoilNum)%LatCoolingEnergyRate/Hfg/DXCoil(DXCoilNum)%InletAirMassFlowRate
OutletAirDryBulbTemp = PsyTdbFnHW(OutletAirEnthalpy,OutletAirHumRat,RoutineName)
IF (OutletAirDryBulbTemp < OutletAirDryBulbTempSat) THEN ! Limit to saturated conditions at OutletAirEnthalpy
OutletAirDryBulbTemp = OutletAirDryBulbTempSat
OutletAirHumRat = PsyWFnTdbH(OutletAirDryBulbTemp,OutletAirEnthalpy,RoutineName)
MinAirHumRat = MIN(InletAirHumRat,OutletAirHumRat)
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%InletAirMassFlowRate* &
(PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - PsyHFnTdbW(OutletAirDryBulbTemp,MinAirHumRat,RoutineName))
IF (DXCoil(DXCoilNum)%SensCoolingEnergyRate > DXCoil(DXCoilNum)%TotalCoolingEnergyRate) THEN
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate
END IF
DXCoil(DXCoilNum)%LatCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate - &
DXCoil(DXCoilNum)%SensCoolingEnergyRate
END IF
Else
MinAirHumRat = MIN(InletAirHumRat,OutletAirHumRat)
DXCoil(DXCoilNum)%SensCoolingEnergyRate = AirMassFlow * (PsyHFnTdbW(InletAirDryBulbTemp,MinAirHumRat,RoutineName) - &
PsyHFnTdbW(LSOutletAirDryBulbTemp,MinAirHumRat,RoutineName))*CycRatio
! Don't let sensible capacity be greater than total capacity
IF (DXCoil(DXCoilNum)%SensCoolingEnergyRate > DXCoil(DXCoilNum)%TotalCoolingEnergyRate) THEN
DXCoil(DXCoilNum)%SensCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate
END IF
DXCoil(DXCoilNum)%LatCoolingEnergyRate = DXCoil(DXCoilNum)%TotalCoolingEnergyRate - &
DXCoil(DXCoilNum)%SensCoolingEnergyRate
End If
! Calculation for heat reclaim needs to be corrected to use compressor power (not including condenser fan power)
HeatReclaimDXCoil(DXCoilNum)%AvailCapacity = DXCoil(DXCoilNum)%TotalCoolingEnergyRate + DXCoil(DXCoilNum)%ElecCoolingPower
DXCoil(DXCoilNum)%OutletAirEnthalpy = OutletAirEnthalpy
DXCoil(DXCoilNum)%OutletAirHumRat = OutletAirHumRat
DXCoil(DXCoilNum)%OutletAirTemp = OutletAirDryBulbTemp
CondAirMassFlow = RhoAir * DXCoil(DXCoilNum)%MSEvapCondAirFlow(SpeedNumLS) * DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction
EvapCondPumpElecPower = DXCoil(DXCoilNum)%MSEvapCondPumpElecNomPower(SpeedNumLS) * DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction
! Waste heat
MSHPWasteHeat = CurveValue(DXCoil(DXCoilNum)%MSWasteHeat(SpeedNumLS),OutdoorDryBulb,InletAirDryBulbTemp) * &
DXCoil(DXCoilNum)%MSWasteHeatFrac(SpeedNumLS)*DXCoil(DXCoilNum)%ElecCoolingPower
! Energy use for other fuel types
If (DXCoil(DXCoilNum)%FuelType .NE. FuelTypeElectricity) Then
DXCoil(DXCoilNum)%FuelUsed = DXCoil(DXCoilNum)%ElecCoolingPower
DXCoil(DXCoilNum)%ElecCoolingPower = 0.0d0
End If
IF(DXCoil(DXCoilNum)%CompanionUpstreamDXCoil .EQ. 0) THEN
DXCoil(DXCoilNum)%CrankcaseHeaterPower = CrankcaseHeatingPower * &
(1.0d0 - DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction)
ELSE
DXCoil(DXCoilNum)%CrankcaseHeaterPower = CrankcaseHeatingPower * &
(1.0d0 - MAX(DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction, &
DXCoil(DXCoil(DXCoilNum)%CompanionUpstreamDXCoil)%HeatingCoilRuntimeFraction))
END IF
END IF
IF (DXCoil(DXCoilNum)%CondenserType(DXMode) == EvapCooled) THEN
!******************
! WATER CONSUMPTION IN m3 OF WATER FOR DIRECT
! H2O [m3/sec] = Delta W[KgH2O/Kg air]*Mass Flow Air[Kg air]
! /RhoWater [kg H2O/m3 H2O]
!******************
RhoWater = RhoH2O(OutdoorDryBulb)
DXCoil(DXCoilNum)%EvapWaterConsumpRate = (CondInletHumrat - OutdoorHumRat) * CondAirMassFlow/RhoWater
DXCoil(DXCoilNum)%EvapCondPumpElecPower = EvapCondPumpElecPower
!set water system demand request (if needed)
IF ( DXCoil(DxCoilNum)%EvapWaterSupplyMode == WaterSupplyFromTank) THEN
WaterStorage(DXCoil(DXCoilNum)%EvapWaterSupTankID)%VdotRequestDemand(DXCoil(DXCoilNum)%EvapWaterTankDemandARRID) &
= DXCoil(DXCoilNum)%EvapWaterConsumpRate
ENDIF
! Calculate basin heater power
CALL CalcBasinHeaterPower(DXCoil(DXCoilNum)%BasinHeaterPowerFTempDiff,&
DXCoil(DXCoilNum)%BasinHeaterSchedulePtr,&
DXCoil(DXCoilNum)%BasinHeaterSetPointTemp,DXCoil(DXCoilNum)%BasinHeaterPower)
DXCoil(DXCoilNum)%BasinHeaterPower = DXCoil(DXCoilNum)%BasinHeaterPower * &
(1.d0 - DXCoil(DXCoilNum)%CoolingCoilRuntimeFraction)
ENDIF
ELSE
! DX coil is off; just pass through conditions
DXCoil(DXCoilNum)%OutletAirEnthalpy = DXCoil(DXCoilNum)%InletAirEnthalpy
DXCoil(DXCoilNum)%OutletAirHumRat = DXCoil(DXCoilNum)%InletAirHumRat
DXCoil(DXCoilNum)%OutletAirTemp = DXCoil(DXCoilNum)%InletAirTemp
DXCoil(DXCoilNum)%FuelUsed = 0.0d0
DXCoil(DXCoilNum)%ElecCoolingPower = 0.0d0
DXCoil(DXCoilNum)%TotalCoolingEnergyRate = 0.0d0
DXCoil(DXCoilNum)%SensCoolingEnergyRate = 0.0d0
DXCoil(DXCoilNum)%LatCoolingEnergyRate = 0.0d0
DXCoil(DXCoilNum)%EvapCondPumpElecPower = 0.0d0
DXCoil(DXCoilNum)%EvapWaterConsumpRate = 0.0d0
IF(DXCoil(DXCoilNum)%CompanionUpstreamDXCoil .EQ. 0) THEN
DXCoil(DXCoilNum)%CrankcaseHeaterPower = CrankcaseHeatingPower
ELSE
DXCoil(DXCoilNum)%CrankcaseHeaterPower = CrankcaseHeatingPower * &
(1.0d0 - DXCoil(DXCoil(DXCoilNum)%CompanionUpstreamDXCoil)%HeatingCoilRuntimeFraction)
END IF
! Calculate basin heater power
IF (DXCoil(DXCoilNum)%CondenserType(DXMode) == EvapCooled) THEN
CALL CalcBasinHeaterPower(DXCoil(DXCoilNum)%BasinHeaterPowerFTempDiff,&
DXCoil(DXCoilNum)%BasinHeaterSchedulePtr,&
DXCoil(DXCoilNum)%BasinHeaterSetPointTemp,DXCoil(DXCoilNum)%BasinHeaterPower)
ENDIF
END IF
DXCoilOutletTemp(DXCoilNum) = DXCoil(DXCoilNum)%OutletAirTemp
DXCoilOutletHumRat(DXCoilNum) = DXCoil(DXCoilNum)%OutletAirHumRat
DXCoilPartLoadRatio(DXCoilNum) = DXCoil(DXCoilNum)%PartLoadRatio
DXCoilFanOpMode(DXCoilNum) = FanOpMode
DXCoil(DXCoilNum)%CondInletTemp = CondInletTemp ! Save condenser inlet temp in the data structure
RETURN
END SUBROUTINE CalcMultiSpeedDXCoilCooling