CondOutletTemp
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | WrapperNum | |||
integer, | intent(in) | :: | OpMode | |||
real(kind=r64) | :: | MyLoad | ||||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | FirstIteration | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(in) | :: | LoopNum | CHARACTER(len=*), PARAMETER :: OutputFormat = '(F6.2)' |
SUBROUTINE CalcChillerHeaterModel(WrapperNum,OpMode,MyLoad,Runflag,FirstIteration,EquipFlowCtrl,LoopNum)
! SUBROUTINE INFORMATION:
! AUTHOR Daeho Kang, PNNL
! DATE WRITTEN Feb 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate a ChillerHeaterPerformance:Electric:EIR using curve fit
! METHODOLOGY EMPLOYED:
! Use empirical curve fits to model performance at off-reference conditions
! REFERENCES:
! 1. DOE-2 Engineers Manual, Version 2.1A, November 1982, LBL-11353
! USE STATEMENTS:
USE DataGlobals, ONLY : WarmupFlag, CurrentTime, outputfiledebug, InitConvTemp
USE DataHVACGlobals, ONLY : SmallLoad, TimeStepSys
USE CurveManager, ONLY : CurveValue,GetCurveMinMaxValues
USE DataPlant, ONLY : DeltaTemptol
USE ScheduleManager, ONLY : GetCurrentScheduleValue
USE InputProcessor, ONLY : MakeUPPERCase
USE General, ONLY : TrimSigDigits, RoundSigDigits
USE DataBranchAirLoopPlant, ONLY : MassFlowTolerance
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WrapperNum ! Wrapper number pointor
INTEGER, INTENT(IN) :: OpMode ! Operation mode
REAL(r64) :: MyLoad ! Heating load plant should meet
LOGICAL, INTENT(IN) :: FirstIteration ! TRUE when first iteration of timestep
LOGICAL, INTENT(IN) :: RunFlag ! TRUE when chiller operating
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER, INTENT(IN) :: LoopNum ! Loop number
! SUBROUTINE PARAMETER DEFINITIONS:
!!CHARACTER(len=*), PARAMETER :: OutputFormat = '(F6.2)'
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: ErrorsFound=.false. ! True when input errors are found
LOGICAL,SAVE :: PossibleSubCooling ! Flag to indicate chiller is doing less cooling that requested
LOGICAL :: IsLoadHeatRemaining = .TRUE. ! Ture if heating load remains for this chiller heater
LOGICAL :: NextCompIndicator = .FALSE. ! Component indicator when identical chiller heaters exist
INTEGER :: EvapInletNode ! Evaporator inlet node number
INTEGER :: EvapOutletNode ! Evaporator outlet node number
INTEGER :: CondInletNode ! Condenser inlet node number
INTEGER :: CondOutletNode ! Condenser outlet node number
INTEGER :: PlantLoopNum ! Plant loop which contains the current chiller
INTEGER :: LoopSideNum ! Plant loop side which contains the current chiller (usually supply side)
INTEGER :: BranchNum ! Branch number
INTEGER :: CompNum ! Component number
INTEGER :: ChillerHeaterNum ! Chiller heater number
INTEGER :: CurrentMode ! Current operational mode, heating or simultaneous cooling and heating mode
INTEGER :: IdenticalUnitCounter ! Pointer to count number of identical unit passed
INTEGER :: IdenticalUnitRemaining ! Pointer to count number of identical unit available for a component
REAL(r64) :: Cp ! Local fluid specific heat
REAL(r64) :: CondTempforCurve ! Reference condenser temperature for the performance curve reading
REAL(r64) :: FRAC ! Chiller cycling ratio
REAL(r64) :: MinPartLoadRat ! Min allowed operating fraction of full load
REAL(r64) :: MaxPartLoadRat ! Max allowed operating fraction of full load
REAL(r64) :: EvapInletTemp ! Evaporator inlet temperature [C]
REAL(r64) :: CondInletTemp ! Condenser inlet temperature [C]
REAL(r64) :: EvapOutletTempSetpoint ! Condenser outlet temperature setpoint [C]
REAL(r64) :: CondOutletTempSetpoint ! Condenser outlet temperature setpoint [C]
REAL(r64) :: AvailChillerCap ! Chiller available capacity at current operating conditions [W]
REAL(r64) :: ChillerRefCap ! Chiller reference capacity
REAL(r64) :: EvapDeltaTemp ! Evaporator temperature difference [C]
REAL(r64) :: CondDeltaTemp ! Condenser temperature difference [C]
REAL(r64) :: ReferenceCOP ! Reference coefficient of performance, from user input
REAL(r64) :: PartLoadRat ! Operating part load ratio
REAL(r64) :: TempLowLimitEout ! Evaporator low temp. limit cut off [C]
REAL(r64) :: EvapMassFlowRateMax ! Maximum reference evaporator mass flow rate [kg/s]
REAL(r64) :: CondenserLoad ! Remaining heating load that this wrapper should meet
REAL(r64) :: HeatingLoadToMeet ! Heating load that this chiller heater should meet
REAL(r64) :: GLHEDensityRatio ! The density ratio of source water to the initialized source water
REAL(r64) :: HWDensityRatio ! The density ratio of hot water to the initialized hot water
REAL(r64) :: PartLoadRatHeat ! Condenser part load ratio
REAL(r64) :: CondenserCapMin ! Minimum condenser capacity
REAL(r64) :: CoolingPower ! Evaporator cooling power to produce heat for heating
REAL(r64) :: HWInletMassFlowRate ! Hot water inlet mass flow rate
REAL(r64) :: CurAvailHWMassFlowRate ! Maximum available hot water mass within the wrapper bank
REAL(r64) :: CondDeltaTempCalc ! Temperature differnece between condenser inlet and outlet calculated
REAL(r64) :: CondOutletTempCalc ! Condenser outlet temperature calculated
REAL(r64) :: CondMassFlowRateCalc ! Condenser mass flow rate calculated
REAL(r64) :: EvapMassFlowRate ! Evaporator mass flow rate through this chiller heater
REAL(r64) :: CondMassFlowRate ! Condenser mass flow rate through this chiller heater
REAL(r64) :: EvapOutletTemp ! Evaporator outlet temperature
REAL(r64) :: CondOutletTemp ! Condenser outlet temperature
REAL(r64) :: QCondenser ! Condenser heat transfer rate
REAL(r64) :: QEvaporator ! Evaporator heat transfer rate
REAL(r64) :: CHPower ! Evaporator compressor power added to heating power
REAL(r64) :: InitDensity ! Water density at the initial temperature
REAL(r64) :: EvapDensity ! Evaporator water density
REAL(r64) :: CondDensity ! Condenser water density
REAL(r64) :: ActualCOP ! Actual performance of individual chiller heater
CondenserLoad = 0.d0
CondenserLoad = Wrapper(WrapperNum)%WrapperHeatingLoad
LoopSideNum = Wrapper(WrapperNum)%HWLoopSideNum
HWInletMassFlowRate = Node(Wrapper(WrapperNum)%HWInletNodeNum)%MassFlowRate
CurAvailHWMassFlowRate = 0.d0
CompNum = 0
! Flow
DO ChillerHeaterNum=1, Wrapper(WrapperNum)%ChillerHeaterNums
! Set module level inlet and outlet nodes and initialize other local variables
CurrentMode = 0
HeatingLoadToMeet = 0.d0
ChillerPartLoadRatio = 0.d0
ChillerCyclingRatio = 0.d0
ChillerFalseLoadRate = 0.d0
EvapMassFlowRate = 0.d0
CondMassFlowRate = 0.d0
CHPower = 0.d0
QCondenser = 0.d0
QEvaporator = 0.d0
CondenserFanPower = 0.d0
FRAC = 1.d0
CondDeltaTemp = 0.d0
EvapDeltaTemp = 0.d0
CoolingPower = 0.d0
ActualCOP = 0.d0
EvapInletTemp = Node(Wrapper(WrapperNum)%GLHEInletNodeNum)%Temp
CondInletTemp = Node(Wrapper(WrapperNum)%HWInletNodeNum)%Temp
EvapOutletTemp = EvapInletTemp
CondOutletTemp = CondInletTemp
! Find proper schedule values
IF (Wrapper(WrapperNum)%NumOfComp /= Wrapper(WrapperNum)%ChillerHeaterNums) THEN ! Identical units exist
IF (ChillerHeaterNum == 1) THEN
IdenticalUnitCounter = 0
IdenticalUnitRemaining = 0
NextCompIndicator = .FALSE.
CompNum = ChillerHeaterNum
END IF
IF (NextCompIndicator) THEN
CompNum = CompNum + 1
END IF
IF (CompNum == 1) THEN
IF (ChillerHeaterNum /= Wrapper(WrapperNum)%WrapperComp(CompNum)%WrapperIdenticalObjectNum) THEN
NextCompIndicator = .FALSE.
ELSE iF (ChillerHeaterNum == Wrapper(WrapperNum)%WrapperComp(CompNum)%WrapperIdenticalObjectNum) THEN
NextCompIndicator = .TRUE.
END IF
ELSE IF (CompNum > 1) THEN
IF ((ChillerHeaterNum - ((ChillerHeaterNum-1) - IdenticalUnitCounter)) /= &
wrapper(WrapperNum)%WrapperComp(CompNum)%WrapperIdenticalObjectNum) THEN
NextCompIndicator = .FALSE.
ELSE IF ((ChillerHeaterNum - ((ChillerHeaterNum-1) - IdenticalUnitCounter)) == &
wrapper(WrapperNum)%WrapperComp(CompNum)%WrapperIdenticalObjectNum) THEN
NextCompIndicator = .TRUE.
END IF
END IF
IdenticalUnitCounter = IdenticalUnitCounter + 1
IdenticalUnitRemaining = Wrapper(WrapperNum)%WrapperComp(CompNum)%WrapperIdenticalObjectNum - IdenticalUnitCounter
IF (IdenticalUnitRemaining == 0) IdenticalUnitCounter = 0
ELSE IF (Wrapper(WrapperNum)%NumOfComp == Wrapper(WrapperNum)%ChillerHeaterNums) THEN
CompNum = CompNum + 1
END IF
! Check to see if this chiiller heater needs to run
IF (CondenserLoad > 0.d0 .AND. (GetCurrentScheduleValue(Wrapper(WrapperNum)%WrapperComp(CompNum)%CHSchedPtr) > 0)) THEN
IsLoadHeatRemaining = .TRUE.
! Calculate density ratios to adjust mass flow rates from initialized ones
! Hot water temperature is known, but condenser mass flow rates will be adjusted in the following "Do" loop
InitDensity = GetDensityGlycol(PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidIndex, &
'CalcChillerHeaterModel')
EvapDensity = GetDensityGlycol(PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidName, &
EvapInletTemp, &
PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidIndex, &
'CalcChillerHeaterModel')
CondDensity = GetDensityGlycol(PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidName, &
CondInletTemp, &
PlantLoop(Wrapper(WrapperNum)%CWLoopNum)%FluidIndex, &
'CalcChillerHeaterModel')
! Calculate density ratios to adjust mass flow rates from initialized ones
HWDensityRatio = CondDensity / InitDensity
GLHEDensityRatio = EvapDensity / InitDensity
EvapMassFlowRate = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%MassFlowRateMaxAvail
CondMassFlowRate = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondInletNode%MassFlowRateMaxAvail
EvapMassFlowRate = EvapMassFlowRate * GLHEDensityRatio
CondMassFlowRate = CondMassFlowRate * HWDensityRatio
! Check flows from plant to adjust as necessary
IF (CurAvailHWMassFlowRate == 0) THEN ! First chiller heater which is on
CurAvailHWMassFlowRate = HWInletMassFlowRate
ELSE IF (ChillerHeaterNum > 1) THEN
CurAvailHWMassFlowRate = CurAvailHWMassFlowRate - &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum-1)%CondOutletNode%MassFlowRate
END IF
CondMassFlowRate = MIN(CurAvailHWMassFlowRate,CondMassFlowRate)
! It is not enforced to be the smaller of CH max temperature and plant temp setpoint.
! Hot water temperatures at the individual CHs' outlet may be greater than plant setpoint temp,
! but should be lower than the CHs max temp
CondOutletTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefCondOutClgHtg
CondDeltaTemp = CondOutletTemp - CondInletTemp
IF(CondDeltaTemp < 0.d0) THEN ! Hot water temperature is greater than the maximum
IF (Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRRefTempErrorIndex == 0) THEN
CALL ShowSevereMessage('CalcChillerHeaterModel: ChillerHeaterPerformance:Electric:EIR="'// &
TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%Name)//'", DeltaTemp < 0')
CALL ShowContinueError(' Reference Simultaneous Cooling-Heating Mode Leaving Condenser Water Temperature ['// &
trim(RoundSigDigits(CondOutletTemp,1))//']')
CALL ShowContinueError('is below condenser inlet temperature of [' // TRIM(RoundSigDigits(CondInletTemp,1))//'].')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError(' Reset reference temperature to one greater than the inlet temperature ')
ENDIF
CALL ShowRecurringSevereErrorAtEnd('ChillerHeaterPerformance:Electric:EIR="'// &
TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%Name)//'": Reference temperature problems continue.', &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRRefTempErrorIndex, &
ReportMaxOf=CondDeltaTemp,ReportMinOf=CondDeltaTemp, &
ReportMaxUnits='deltaC',ReportMinUnits='deltaC')
QCondenser = 0.d0
IsLoadHeatRemaining = .FALSE.
END IF
IF (ChillerHeaterNum > 1 ) THEN
! Operation mode needs to be set in a simultaneous clg/htg mode
! Always off even heating load remains if this CH is assumed to be off in the loop 1
IF (SimulClgDominant) THEN
IF (Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvapSimul == 0.d0) THEN
CurrentMode = 0
ISLoadHeatRemaining = .FALSE.
ELSE ! Heat recovery
CurrentMode = 3
END IF
END IF
END IF ! End of simulataneous clg/htg mode detemination
ELSE ! chiller heater is off
IsLoadHeatRemaining = .FALSE.
CondMassFlowRate = 0.d0
EvapMassFlowRate = 0.d0
CurrentMode = 0
IF (SimulClgDominant) THEN
IF (Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvapSimul > 0.d0) THEN
CurrentMode = 4 ! Simultaneous cooling dominant mode: 4
END IF
END IF ! End of mode determination
END IF ! End of system operation determinatoin
IF (IsLoadHeatRemaining .AND. CondMassFlowRate > 0.d0 .AND. &
(GetCurrentScheduleValue(Wrapper(WrapperNum)%WrapperComp(CompNum)%CHSchedPtr) > 0)) THEN ! System is on
! Operation mode
IF (SimulHtgDominant) THEN
IF (Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvapSimul == 0.d0) THEN
CurrentMode = 5 ! No cooling necessary
ELSE ! Heat recovery mode. Both chilled water and hot water loops are connected. No condenser flow.
CurrentMode = 3
END IF
END IF
! Mode 3 and 5 use cooling side data stored from the chilled water loop
! Mode 4 uses all data from the chilled water loop due to no heating demand
IF(SimulClgDominant .OR. CurrentMode == 3) THEN
CurrentMode = 3
Cp = GetSpecificHeatGlycol(PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidName, &
CondInletTemp, &
PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidIndex, &
'CalcChillerHeaterModel')
QCondenser = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCondSimul
IF (Wrapper(WrapperNum)%VariableFlowCH) THEN ! Variable flow
CondMassFlowRateCalc = QCondenser/CondDeltaTemp/Cp
IF (CondMassFlowRateCalc > CondMassFlowRate) THEN
CondMassFlowRateCalc = CondMassFlowRate
CondDeltaTempCalc = QCondenser/CondMassFlowRate/Cp
IF(CondDeltaTempCalc > CondDeltaTemp) THEN ! Load to meet should be adjusted
CondDeltaTempCalc = CondDeltaTemp
QCondenser = CondMassFlowRate * Cp * CondDeltaTemp
END IF
END IF
CondMassFlowRate = CondMassFlowRateCalc
ELSE ! Constant flow control
CondDeltaTempCalc = QCondenser/CondMassFlowRate/Cp
CondOutletTempCalc = CondDeltaTempCalc + CondInletTemp
IF (CondOutletTempCalc > CondOutletTemp) THEN
CondOutletTempCalc = CondOutletTemp
QCondenser = CondMassFlowRate * Cp * CondDeltaTemp
END IF
CondOutletTemp = CondOutletTempCalc
END IF
ELSE ! Either Mode 2 or 3 or 5
IF(SimulHtgDominant) THEN
CurrentMode = 5
ELSE
CurrentMode = 2
END IF
ChillerCapFT = 0.0d0
ChillerEIRFT = 0.0d0
ChillerEIRFPLR = 0.0d0
! Assign curve values to local data array
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCap = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCapClgHtg
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCOP = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCOPClgHtg
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefEvapOut = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefEvapOutClgHtg
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefCondOut = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefCondOutClgHtg
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%OptPartLoadRat = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%OptPartLoadRatClgHtg
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondMode = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondModeHeating
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFT = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTHeating
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFT = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFTHeating
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFPLR = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFPLRHeating
IF (TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondMode) == MakeUPPERCase('EnteringCondenser')) THEN
CondTempforCurve = CondInletTemp
ELSEIF (TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondMode) == MakeUPPERCase('LeavingCondenser')) THEN
CondTempforCurve = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefCondOutClgHtg !!CondOutletTemp
ELSE
CALL ShowWarningError('ChillerHeaterPerformance:Electric:EIR "'// &
TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%Name)//'":')
CALL ShowContinueError('Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving ('// &
TRIM(RoundSigDigits(ChillerCapFT,3))//').')
CondTempforCurve = Node(PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%TempSetPointNodeNum)%TempSetPoint
ENDIF
CALL GetCurveMinMaxValues (Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFPLR, &
MinPartLoadRat,MaxPartLoadRat)
ChillerRefCap = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCap
ReferenceCOP = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%RefCOP
EvapOutletTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefEvapOutClgHtg
TempLowLimitEout = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempLowLimitEvapOut
EvapOutletTempSetpoint = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%TempRefEvapOutClgHtg
ChillerCapFT = CurveValue(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFT, &
EvapOutletTempSetpoint,CondTempforCurve)
IF(ChillerCapFT .LT. 0)THEN
IF(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTError .LT. 1 .AND. .NOT. WarmupFlag)THEN
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTError = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTError + 1
CALL ShowWarningError('ChillerHeaterPerformance:Electric:EIR "'//&
TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%Name)//'":')
CALL ShowContinueError(' ChillerHeater Capacity as a Function of Temperature curve output is negative ('// &
TRIM(RoundSigDigits(ChillerCapFT,3))//').')
CALL ShowContinueError(' Negative value occurs using an Evaporator Outlet Temp of ' // &
TRIM(RoundSigDigits(EvapOutletTempSetpoint,1))// &
' and a Condenser Inlet Temp of '//TRIM(RoundSigDigits(CondInletTemp,1))//'.')
CALL ShowContinueErrorTimeStamp(' Resetting curve output to zero and continuing simulation.')
ELSE IF(.NOT. WarmupFlag)THEN
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTError = &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTError + 1
CALL ShowRecurringWarningErrorAtEnd('ChillerHeaterPerformance:Electric:EIR "' &
//TRIM(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%Name)//'":'//&
' ChillerHeater Capacity as a Function of Temperature curve output is negative warning continues...' &
, Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerCapFTErrorIndex, ChillerCapFT, ChillerCapFT)
END IF
ChillerCapFT = 0.0d0
END IF
! Available chiller capacity as a function of temperature
AvailChillerCap = ChillerRefCap*ChillerCapFT
! Part load ratio based on reference capacity and available chiller capacity
IF(AvailChillerCap > 0)THEN
PartLoadRat = MAX(0.0d0, MIN((ChillerRefCap/AvailChillerCap),MaxPartLoadRat))
ELSE
PartLoadRat = 0.0d0
END IF
Cp = GetSpecificHeatGlycol(PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidName, &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp, &
PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidIndex, &
'CalcChillerHeaterModel')
! Calculate evaporator heat transfer
IF(EvapMassFlowRate > MassFlowTolerance) THEN
QEvaporator = AvailChillerCap * PartLoadRat
EvapDeltaTemp = QEvaporator/EvapMassFlowRate/CP
EvapOutletTemp = EvapInletTemp - EvapDeltaTemp
END IF
! Check that the evaporator outlet temp honors both plant loop temp low limit and also the chiller low limit
IF(EvapOutletTemp .LT. TempLowLimitEout) THEN
IF((Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp - TempLowLimitEout) > DeltaTemptol) THEN
EvapOutletTemp = TempLowLimitEout
EvapDeltaTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp - EvapOutletTemp
QEvaporator = EvapMassFlowRate*Cp*EvapDeltaTemp
ELSE
EvapOutletTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp
EvapDeltaTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp - EvapOutletTemp
QEvaporator = EvapMassFlowRate*Cp*EvapDeltaTemp
END IF
END IF
IF(EvapOutletTemp .LT. Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin) THEN
IF((Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp - &
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin) .GT. DeltaTemptol) THEN
EvapOutletTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin
EvapDeltaTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin - EvapOutletTemp
QEvaporator = EvapMassFlowRate*Cp*EvapDeltaTemp
ELSE
EvapOutletTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin
EvapDeltaTemp = Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%TempMin - EvapOutletTemp
QEvaporator = EvapMassFlowRate*Cp*EvapDeltaTemp
END IF
END IF
! Evaporator operates at full load
IF(AvailChillerCap .GT. 0.0d0)THEN
PartLoadRat = MAX(0.0d0,MIN((QEvaporator/AvailChillerCap),MaxPartLoadRat))
ELSE
PartLoadRat = 0.0d0
END IF
! Chiller cycles below minimum part load ratio, FRAC = amount of time chiller is ON during this time step
IF (PartLoadRat .LT. MinPartLoadRat) FRAC = MIN(1.0d0,(PartLoadRat/MinPartLoadRat))
IF (FRAC <= 0.0d0) FRAC = 1.0 ! CR 9303 COP reporting issue, it should be greater than zero in this routine
ChillerCyclingRatio = FRAC
! Chiller is false loading below PLR = minimum unloading ratio, find PLR used for energy calculation
IF(AvailChillerCap .GT. 0.0d0)THEN
PartLoadRat = Max(PartLoadRat,MinPartLoadRat)
ELSE
PartLoadRat = 0.0d0
END IF
! Evaporator part load ratio
ChillerPartLoadRatio = PartLoadRat
! calculate the load due to false loading on chiller over and above water side load
ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator
IF(ChillerFalseLoadRate .LT. SmallLoad) THEN
ChillerFalseLoadRate = 0.0d0
END IF
ChillerEIRFT = MAX(0.d0,CurveValue(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFT, &
EvapOutletTemp,CondTempforCurve))
ChillerEIRFPLR = MAX(0.d0,CurveValue(Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%ChillerEIRFPLR,PartLoadRat))
CHPower = (AvailChillerCap/ReferenceCOP) * ChillerEIRFPLR * ChillerEIRFT * FRAC
ActualCOP = (QEvaporator + ChillerFalseLoadRate)/CHPower
QCondenser = CHPower*Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%OpenMotorEff + &
QEvaporator + ChillerFalseLoadRate
! Determine heating load for this heater and pass the remaining load to the next chiller heater
CondenserCapMin = QCondenser * MinPartLoadRat
HeatingLoadToMeet = MIN(QCondenser,MAX(ABS(CondenserLoad),CondenserCapMin))
! Set load this chiller heater should meet and temperatures given
QCondenser = Min(HeatingLoadToMeet,QCondenser)
Cp = GetSpecificHeatGlycol(PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidName, &
CondInletTemp, &
PlantLoop(Wrapper(WrapperNum)%HWLoopNum)%FluidIndex, &
'CalcElectricEIRChillerModel')
! Calculate temperatures for constant flow and mass flow rate for variable flow
! Limit mass for this chiller heater to the available mass at given temperature conditions
! when mass calculated to meet the load is greater than the maximum available
! then recalculate heating load this chiller heater can meet
IF (CurrentMode == 2 .OR. SimulHtgDominant) THEN
IF(CondMassFlowRate > MassFlowTolerance .AND. CondDeltaTemp > 0.0d0) THEN
IF (Wrapper(WrapperNum)%VariableFlowCH) THEN ! Variable flow
CondMassFlowRateCalc = QCondenser/CondDeltaTemp/Cp
IF (CondMassFlowRateCalc > CondMassFlowRate) THEN
CondMassFlowRateCalc = CondMassFlowRate
CondDeltaTempCalc = QCondenser/CondMassFlowRate/Cp
IF(CondDeltaTempCalc > CondDeltaTemp) THEN ! Load to meet should be adjusted
CondDeltaTempCalc = CondDeltaTemp
QCondenser = CondMassFlowRate * Cp * CondDeltaTemp
END IF
END IF
CondMassFlowRate = CondMassFlowRateCalc
ELSE ! Constant Flow at a fixed flow rate and capacity
CondDeltaTempCalc = QCondenser/CondMassFlowRate/Cp
CondOutletTempCalc = CondDeltaTempCalc + CondInletTemp
IF(CondOutletTempCalc > CondOutletTemp) THEN ! Load to meet should be adjusted
CondOutletTempCalc = CondOutletTemp
QCondenser = CondMassFlowRate * Cp * CondDeltaTemp
END IF
CondOutletTemp = CondOutletTempCalc
END IF
ELSE
QCondenser = 0.0d0
CondOutletTemp = CondInletTemp
END IF
END IF
END IF ! End of calculaton dependiong on the modes
! Determine load next chiller heater meets
IF (CondenserLoad < QCondenser) THEN ! Heating load is met by this chiller heater
CondenserLoad = 0.d0
ELSE
CondenserLoad = CondenserLoad - QCondenser
END IF
IF (QCondenser == 0.d0) THEN
CurrentMode = 0
ChillerPartLoadRatio = 0.d0
ChillerCyclingRatio = 0.d0
ChillerFalseLoadRate = 0.d0
EvapMassFlowRate = 0.d0
CondMassFlowRate = 0.d0
CHPower = 0.d0
QEvaporator = 0.d0
CondenserFanPower = 0.d0
EvapOutletTemp = EvapInletTemp
CondOutletTemp = CondInletTemp
CondenserLoad = 0.d0
END IF
! Heat recovery or cooling dominant modes need to use the evaporator side information
IF (CurrentMode == 3 .OR. CurrentMode == 4) THEN
ChillerPartLoadRatio = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerPartLoadRatioSimul
ChillerCyclingRatio = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCyclingRatioSimul
ChillerFalseLoadRate = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoadRateSimul
ChillerCapFT = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCapFTSimul
ChillerEIRFT = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFTSimul
ChillerEIRFPLR = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFPLRSimul
QEvaporator = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvapSimul
EvapOutletTemp = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTempSimul
EvapInletTemp = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapInletTempSimul
EvapMassFlowRate = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul
IF (SimulClgDominant) THEN
CHPower = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPowerSimul
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower = 0.d0
END IF
END IF
END IF
! Check if it is mode 4, then skip binding local variables
IF (CurrentMode == 4) THEN
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode = CurrentMode
ELSE
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%MassFlowRate = EvapMassFlowRate
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%MassFlowRate = CondMassFlowRate
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%Temp = EvapOutletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp = EvapInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%Temp = CondOutletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondInletNode%Temp = CondInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode = CurrentMode
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerPartLoadRatio = ChillerPartLoadRatio
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCyclingRatio = ChillerCyclingRatio
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoadRate = ChillerFalseLoadRate
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCapFT = ChillerCapFT
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFT = ChillerEIRFT
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFPLR = ChillerEIRFPLR
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPower = CoolingPower
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower = CHPower
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap = QEvaporator
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond = QCondenser
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp = EvapOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapInletTemp = EvapInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp = CondOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondInletTemp = CondInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot = EvapMassFlowRate
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot = CondMassFlowRate
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ActualCOP = ActualCOP
END IF
ENDDO
RETURN
END SUBROUTINE CalcChillerheaterModel