Node(CHWOutletNodeNum)%Temp = CHWOutletTemp Node(HWOutletNodeNum)%Temp = HWOutletTemp Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | WrapperNum | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | FirstIteration | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(in) | :: | LoopNum |
SUBROUTINE CalcWrapperModel(WrapperNum,MyLoad,Runflag,FirstIteration,EquipFlowCtrl,LoopNum)
! SUBROUTINE INFORMATION:
! AUTHOR Daeho Kang, PNNL
! DATE WRITTEN Feb 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate node information connected to plnat & condenser loop
! METHODOLOGY EMPLOYED:
! Use empirical curve fits to model performance at off-reference conditions
! REFERENCES:
! USE STATEMENTS:
USE DataGlobals, ONLY : WarmupFlag, CurrentTime, DayOfSim, HourOfDay, TimeStep, outputfiledebug
USE DataHVACGlobals, ONLY : SmallLoad, TimeStepSys, SmallMassFlow
USE CurveManager, ONLY : CurveValue
USE DataPlant, ONLY : DeltaTemptol, TypeOf_CentralGroundSourceHeatPump
USE DataBranchAirLoopPlant, ONLY: MassFlowTolerance
USE PlantUtilities, ONLY : SetComponentFlowRate
USE ScheduleManager, ONLY: GetCurrentScheduleValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WrapperNum
REAL(r64), INTENT(INOUT) :: MyLoad
LOGICAL, INTENT(IN) :: RunFlag
LOGICAL, INTENT(IN) :: FirstIteration
INTEGER, INTENT(IN) :: EquipFlowCtrl
INTEGER, INTENT(IN) :: LoopNum
! LOCAL VARIABLES
INTEGER :: ChillerHeaterNum ! Chiller heater number
INTEGER :: GSHeatPumpNum ! Heat pump number
INTEGER :: CHWInletNodeNum ! Chiller heater bank chilled water inlet node number
INTEGER :: CHWOutletNodeNum ! Chiller heater bank chilled water Outlet node number
INTEGER :: GLHEInletNodeNum ! Chiller heater bank condenser water inlet node number
INTEGER :: GLHEOutletNodeNum ! Chiller heater bank condenser water outlet node number
INTEGER :: HWInletNodeNum ! Chiller heater bank hot water inlet node number
INTEGER :: HWOutletNodeNum ! Chiller heater bank hot water outlet node number
INTEGER :: EvapInletNode ! Individual chiller heater evaporator inlet node
INTEGER :: EvapOutletNode ! Individual chiller heater evaporator outlet node
INTEGER :: CondInletNode ! Individual chiller heater condenser inlet node
INTEGER :: LoopSideNum ! Loop side number
INTEGER :: LoopSide ! Loop side
INTEGER :: BranchNum ! Branch number
INTEGER :: CompNum ! Component number
INTEGER :: OpMode ! Operation mode
INTEGER :: ChillerHeaterNums ! Total number of chiller heaters
REAL(r64) :: CurCoolingLoad ! Total cooling load chiller heater bank (wrapper) meets
REAL(r64) :: CurHeatingLoad ! Total heating load chiller heater bank (wrapper) meets
REAL(r64) :: CHWInletTemp ! Chiller heater bank chilled water inlet temperature
REAL(r64) :: CHWOutletTemp ! Chiller heater bank chilled water outlet temperature
REAL(r64) :: CHWInletMassFlowRate ! Chiller heater bank chilled water inlet mass flow rate
REAL(r64) :: CHWOutletMassFlowRate ! Chiller heater bank chilled water outlet mass flow rate
REAL(r64) :: CHWBypassMassFlowRate ! Chiller heater bank chilled water bypass mass flow rate
REAL(r64) :: HWInletTemp ! Chiller heater bank hot water inlet temperature
REAL(r64) :: HWOutletTemp ! Chiller heater bank hot water outlet temperature
REAL(r64) :: HWInletMassFlowRate ! Chiller heater bank hot water inlet mass flow rate
REAL(r64) :: HWOutletMassFlowRate ! Chiller heater bank hot water outlet mass flow rate
REAL(r64) :: HWBypassMassFlowRate ! Chiller heater bank hot water bypass mass flow rate
REAL(r64) :: GLHEInletTemp ! Chiller heater bank condenser loop inlet temperature
REAL(r64) :: GLHEOutletTemp ! Chiller heater bank condenser loop outlet temperature
REAL(r64) :: GLHEInletMassFlowRate ! Chiller heater bank condenser loop intlet mass flow rate
REAL(r64) :: GLHEOutletMassFlowRate ! Chiller heater bank condenser loop outlet mass flow rate
REAL(r64) :: GLHEBypassMassFlowRate ! Chiller heater bank condenser loop bypass mass flow rate
REAL(r64) :: CHWMassFlowBypass ! Chilled water bypass flow rate
REAL(r64) :: HWMassFlowBypass ! Hot water bypass flow rate
REAL(r64) :: GLHEMassFlowBypass ! Condenser loop bypass flow rate
REAL(r64) :: WrapperElecPowerCool ! Chiller heater bank total cooling electricity [W]
REAL(r64) :: WrapperElecPowerHeat ! Chiller heater bank total heating electricity [W]
REAL(r64) :: WrapperCoolRate ! Chiller heater bank total cooling rate [W]
REAL(r64) :: WrapperHeatRate ! Chiller heater bank total heating rate [W]
REAL(r64) :: WrapperGLHERate ! Chiller heater bank total condenser heat transfer rate [W]
REAL(r64) :: WrapperElecEnergyCool ! Chiller heater bank total electric cooling energy [J]
REAL(r64) :: WrapperElecEnergyHeat ! Chiller heater bank total electric heating energy [J]
REAL(r64) :: WrapperCoolEnergy ! Chiller heater bank total cooling energy [J]
REAL(r64) :: WrapperHeatEnergy ! Chiller heater bank total heating energy [J]
REAL(r64) :: WrapperGLHEEnergy ! Chiller heater bank total condenser heat transfer energy [J]
INTEGER :: CurrentMode ! Current operation mode indicator
! Read note information
CHWInletNodeNum = Wrapper(WrapperNum)%CHWInletNodeNum
CHWOutletNodeNum = Wrapper(WrapperNum)%CHWOutletNodeNum
HWInletNodeNum = Wrapper(WrapperNum)%HWInletNodeNum
HWOutletNodeNum = Wrapper(WrapperNum)%HWOutletNodeNum
GLHEInletNodeNum = Wrapper(WrapperNum)%GLHEInletNodeNum
GLHEOutletNodeNum = Wrapper(WrapperNum)%GLHEOutletNodeNum
CHWInletMassFlowRate = 0.d0
HWInletMassFlowRate = 0.d0
GLHEInletMassFlowRate = 0.d0
CHWInletTemp = Node(CHWInletNodeNum)%Temp
HWInletTemp = Node(HWInletNodeNum)%Temp
GLHEInletTemp = Node(GLHEInletNodeNum)%Temp
ChillerHeaterNums = Wrapper(WrapperNum)%ChillerheaterNums
! Initiate loads and inlet temperatures each loop
IF (LoopNum == Wrapper(WrapperNum)%CWLoopNum) THEN
CHWInletMassFlowRate = Node(CHWInletNodeNum)%MassFlowRateMaxAvail
HWInletMassFlowRate = Node(HWInletNodeNum)%MassFlowRate
GLHEInletMassFlowRate = Node(GLHEInletNodeNum)%MassFlowRateMaxAvail
LoopSideNum = Wrapper(WrapperNum)%CWLoopSideNum
LoopSide = Wrapper(WrapperNum)%CWLoopSideNum
CurCoolingLoad = 0.d0
Wrapper(WrapperNum)%WrapperCoolingLoad = 0.d0
CurCoolingLoad = ABS(MyLoad)
Wrapper(WrapperNum)%WrapperCoolingLoad = CurCoolingLoad
! Set actual mass flow rate at the nodes when it's locked
IF (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%FlowLock==1) THEN
CHWInletMassFlowRate = Node(CHWInletNodeNum)%MassFlowRate
END IF
IF(CHWInletMassFlowRate == 0.d0) GLHEInletMassFlowRate = 0.d0
ELSEIF (LoopNum == Wrapper(WrapperNum)%HWLoopNum) THEN
CHWInletMassFlowRate = Node(CHWInletNodeNum)%MassFlowRate
HWInletMassFlowRate = Node(HWInletNodeNum)%MassFlowRateMaxAvail
GLHEInletMassFlowRate = Node(GLHEInletNodeNum)%MassFlowRateMaxAvail
LoopSideNum = Wrapper(WrapperNum)%HWLoopSideNum
CurHeatingLoad = 0.d0
Wrapper(WrapperNum)%WrapperHeatingLoad = 0.d0
CurHeatingLoad = MyLoad
Wrapper(WrapperNum)%WrapperHeatingLoad = CurHeatingLoad
! Set actual mass flow rate at the nodes when it's locked
IF (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%FlowLock==1) THEN
HWInletMassFlowRate = Node(HWInletNodeNum)%MassFlowRate
END IF
IF(HWInletMassFlowRate == 0.d0) GLHEInletMassFlowRate = 0.d0
END IF
! Initialize local variables
WrapperElecPowerCool = 0.0d0
WrapperElecPowerHeat = 0.0d0
WrapperCoolRate = 0.0d0
WrapperHeatRate = 0.0d0
WrapperGLHERate = 0.0d0
WrapperElecEnergyCool = 0.0d0
WrapperElecEnergyHeat = 0.0d0
WrapperCoolEnergy = 0.0d0
WrapperHeatEnergy = 0.0d0
WrapperGLHEEnergy = 0.0d0
IF (LoopNum == Wrapper(WrapperNum)%CWLoopNum) THEN
IF (Wrapper(WrapperNum)%ControlMode == SmartMixing) THEN
IF (CurCoolingLoad > 0.d0 .AND. CHWInletMassFlowRate > 0.d0 .AND. GLHEInletMassFlowRate > 0 ) THEN
CALL CalcChillerModel(WrapperNum,OpMode,MyLoad,Runflag,FirstIteration,EquipFlowCtrl,LoopNum)
CALL UpdateChillerRecords(WrapperNum)
! Initialize local variables only for calculating mass-weighed temperatures
CHWOutletTemp = 0.0d0
HWOutletTemp = 0.0d0
GLHEOutletTemp = 0.0d0
CHWOutletMassFlowRate = 0.0d0
HWOutletMassFlowRate = 0.0d0
GLHEOutletMassFlowRate = 0.0d0
DO ChillerHeaterNum=1,ChillerHeaterNums
! Calculated mass flow rate used by individual chiller heater and bypasses
CHWOutletMassFlowRate = CHWOutletMassFlowRate + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot
CHWOutletTemp = CHWOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot/CHWInletMassFlowRate)
WrapperElecPowerCool = WrapperElecPowerCool + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPower
WrapperCoolRate = WrapperCoolRate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap
WrapperElecEnergyCool = WrapperElecEnergyCool + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingEnergy
WrapperCoolEnergy = WrapperCoolEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergy
IF (GLHEInletMassFlowRate > 0.d0) THEN
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot
IF (GLHEOutletMassFlowRate > GLHEInletMassFlowRate) GLHEOutletMassFlowRate = GLHEInletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot/GLHEInletMassFlowRate)
WrapperGLHERate = WrapperGLHERate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond
WrapperGLHEEnergy = WrapperGLHEEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergy
ELSE
GLHEInletMassFlowRate = 0.d0
GLHEOutletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
WrapperGLHERate = 0.d0
WrapperGLHEEnergy = 0.d0
END IF
END DO ! End of summation of mass flow rates and mass weighted temperatrue
! Calculate temperatures for the mixed flows in the chiller bank
CHWBypassMassFlowRate = CHWInletMassFlowRate - CHWOutletMassFlowRate
IF(CHWBypassMassFlowRate > 0.d0) THEN
CHWOutletTemp = CHWOutletTemp + CHWInletTemp * CHWBypassMassFlowRate/CHWInletMassFlowRate
ELSE
CHWOutletTemp = CHWOutletTemp
END IF
IF(GLHEInletMassFlowRate > 0.d0) THEN
GLHEBypassMassFlowRate = GLHEInletMassFlowRate - GLHEOutletMassFlowRate
IF (GLHEBypassMassFlowRate > 0.d0) THEN
GLHEOutletTemp = GLHEOutletTemp + GLHEInletTemp * GLHEBypassMassFlowRate/GLHEInletMassFlowRate
ELSE
GLHEOutletTemp = GLHEOutletTemp
END IF
ELSE
GLHEOutletTemp = GLHEInletTemp
END IF
HWOutletTemp = HWInletTemp
IF (GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr) > 0) THEN
WrapperElecPowerCool = WrapperElecPowerCool + (Wrapper(WrapperNum)%AncilliaryPower * &
GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr))
END IF
Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
Node(HWOutletNodeNum)%Temp = HWOutletTemp
Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
ELSE
! Initialize local variables
CHWOutletTemp = CHWInletTemp
HWOutletTemp = HWInletTemp
GLHEOutletTemp = GLHEInletTemp
DO ChillerHeaterNum=1, ChillerHeaterNums
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%MassFlowRate = 0.d0
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%MassFlowRate = 0.d0
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%Temp = CHWInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp = CHWInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%Temp = GLHEInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondInletNode%Temp = GLHEInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode = 0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerPartLoadRatio = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCyclingRatio = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoadRate = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCapFT = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFT = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFPLR = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPower = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp = CHWOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapInletTemp = CHWInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp = GLHEOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondInletTemp = GLHEInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoad = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ActualCOP = 0.d0
END DO
END IF
IF (SimulHtgDominant .OR. SimulClgDominant) THEN
Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
WrapperReport(WrapperNum)%CHWInletTempSimul = CHWInletTemp
WrapperReport(WrapperNum)%CHWOutletTempSimul = CHWOutletTemp
WrapperReport(WrapperNum)%CHWmdotSimul = CHWInletMassFlowRate
WrapperReport(WrapperNum)%GLHEInletTempSimul = GLHEInletTemp
WrapperReport(WrapperNum)%GLHEOutletTempSimul = GLHEOutletTemp
WrapperReport(WrapperNum)%GLHEmdotSimul = GLHEInletMassFlowRate
WrapperReport(WrapperNum)%TotElecCoolingSimul = WrapperElecEnergyCool
WrapperReport(WrapperNum)%CoolingEnergySimul = WrapperCoolEnergy
WrapperReport(WrapperNum)%TotElecCoolingPwrSimul = WrapperElecPowerCool
WrapperReport(WrapperNum)%CoolingRateSimul = WrapperCoolRate
ELSE
Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
Node(HWOutletNodeNum)%Temp = HWOutletTemp
Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
WrapperReport(WrapperNum)%CHWInletTemp = CHWInletTemp
WrapperReport(WrapperNum)%CHWOutletTemp = CHWOutletTemp
WrapperReport(WrapperNum)%HWInletTemp = HWInletTemp
WrapperReport(WrapperNum)%HWOutletTemp = HWOutletTemp
WrapperReport(WrapperNum)%GLHEInletTemp = GLHEInletTemp
WrapperReport(WrapperNum)%GLHEOutletTemp = GLHEOutletTemp
WrapperReport(WrapperNum)%CHWmdot = CHWInletMassFlowRate
WrapperReport(WrapperNum)%HWmdot = HWInletMassFlowRate
WrapperReport(WrapperNum)%GLHEmdot = GLHEInletMassFlowRate
WrapperReport(WrapperNum)%TotElecCooling = WrapperElecEnergyCool
WrapperReport(WrapperNum)%TotElecHeating = WrapperElecEnergyHeat
WrapperReport(WrapperNum)%CoolingEnergy = WrapperCoolEnergy
WrapperReport(WrapperNum)%HeatingEnergy = WrapperHeatEnergy
WrapperReport(WrapperNum)%GLHEEnergy = WrapperGLHEEnergy
WrapperReport(WrapperNum)%TotElecCoolingPwr = WrapperElecPowerCool
WrapperReport(WrapperNum)%TotElecHeatingPwr = WrapperElecPowerHeat
WrapperReport(WrapperNum)%CoolingRate = WrapperCoolRate
WrapperReport(WrapperNum)%HeatingRate = WrapperHeatRate
WrapperReport(WrapperNum)%GLHERate = WrapperGLHERate
END IF
CALL SetComponentFlowRate(CHWInletMassFlowRate, CHWInletNodeNum, CHWOutletNodeNum, &
Wrapper(WrapperNum)%CWLoopNum, &
Wrapper(WrapperNum)%CWLoopSideNum, &
Wrapper(WrapperNum)%CWBranchNum, &
Wrapper(WrapperNum)%CWCompNum)
CALL SetComponentFlowRate(HWInletMassFlowRate, HWInletNodeNum, HWOutletNodeNum, &
Wrapper(WrapperNum)%HWLoopNum, &
Wrapper(WrapperNum)%HWLoopSideNum, &
Wrapper(WrapperNum)%HWBranchNum, &
Wrapper(WrapperNum)%HWCompNum)
CALL SetComponentFlowRate(GLHEInletMassFlowRate, GLHEInletNodeNum, GLHEOutletNodeNum, &
Wrapper(WrapperNum)%GLHELoopNum, &
Wrapper(WrapperNum)%GLHELoopSideNum, &
Wrapper(WrapperNum)%GLHEBranchNum, &
Wrapper(WrapperNum)%GLHECompNum)
END IF ! End of cooling
ELSE IF (LoopNum == Wrapper(WrapperNum)%HWLoopNum) THEN ! Hot water loop
IF (Wrapper(WrapperNum)%ControlMode == SmartMixing) THEN ! Chiller heater component
IF (CurHeatingLoad > 0.d0 .AND. HWInletMassFlowRate > 0.0d0) THEN
CALL CalcChillerHeaterModel(WrapperNum,OpMode,MyLoad,Runflag,FirstIteration,EquipFlowCtrl,LoopNum)
CALL UpdateChillerHeaterRecords(WrapperNum)
! Calculate individual CH units's temperatures and mass flow rates
CHWOutletTemp = 0.0d0
HWOutletTemp = 0.0d0
GLHEOutletTemp = 0.0d0
CHWOutletMassFlowRate = 0.0d0
HWOutletMassFlowRate = 0.0d0
GLHEOutletMassFlowRate = 0.0d0
IF (SimulHtgDominant .OR. SimulClgDominant) THEN
IF (SimulClgDominant) THEN
DO ChillerHeaterNum=1,ChillerHeaterNums
CurrentMode = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode
CHWInletTemp = WrapperReport(WrapperNum)%CHWInletTempSimul
GLHEInletTemp = WrapperReport(WrapperNum)%GLHEInletTempSimul
CHWInletMassFlowRate = WrapperReport(WrapperNum)%CHWmdotSimul
GLHEInletMassFlowRate = WrapperReport(WrapperNum)%GLHEmdotSimul
IF (CurrentMode /= 0) THEN ! This chiller heater unit is on
IF (CurrentMode == 3) THEN ! Heat recovery mode. Both chilled water and hot water connections
CHWOutletMassFlowRate = CHWOutletMassFlowRate + & ! Wrapper evaporator side to plant chilled water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul
HWOutletMassFlowRate = HWOutletMassFlowRate + & ! Wrapper condenser side to plant hot water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot
IF (HWInletMassFlowRate > 0.d0) THEN
HWOutletTemp = HWOutletTemp + & ! Only calculate in the heat recovery mode
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot/HWInletMassFlowRate)
ELSE
HWOutletTemp = HWInletTemp
END IF
ELSE ! Mode 4. Cooling-only mode with other heat recovery units. Condenser flows.
CHWOutletMassFlowRate = CHWOutletMassFlowRate + & ! Wrapper evaporator side to plant chilled water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul
! Sum condenser node mass flow rates and mass weighed temperatures
IF (GLHEInletMassFlowRate > 0.d0) THEN
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondmdotSimul
IF (GLHEOutletMassFlowRate > GLHEInletMassFlowRate) GLHEOutletMassFlowRate = GLHEInletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTempSimul * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondmdotSimul/GLHEInletMassFlowRate)
WrapperGLHERate = WrapperGLHERate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCondSimul
WrapperGLHEEnergy = WrapperGLHEEnergy + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergySimul
ELSE
GLHEInletMassFlowRate = 0.d0
GLHEOutletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
WrapperGLHERate = 0.d0
WrapperGLHEEnergy = 0.d0
END IF
END IF
ELSE ! This chiller heater is off
! Check if any unit is cooling only mode
IF (ChillerHeaterNum == ChillerHeaterNums) THEN ! All units are heat revocery mode. No condenser flow
GLHEOutletMassFlowRate = 0.d0
GLHEInletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
ELSE ! At leaset, one of chiller heater units is cooling-only mode
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp
END IF
END IF
! Calculate mass weighed chilled water temperatures
IF (CHWInletMassFlowRate > 0.d0) THEN
CHWOutletTemp = CHWOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTempSimul * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul/CHWInletMassFlowRate)
ELSE
CHWOutletTemp = CHWInletTemp
END IF
WrapperElecPowerCool = WrapperElecPowerCool + & ! Cooling electricity
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPowerSimul
WrapperCoolRate = WrapperCoolRate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvapSimul
WrapperElecEnergyCool = WrapperElecEnergyCool + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingEnergySimul
WrapperCoolEnergy = WrapperCoolEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergySimul
! Avoid double counting wrapper energy use
WrapperElecPowerHeat = 0.d0
WrapperHeatRate = 0.d0
WrapperElecEnergyHeat = 0.d0
WrapperHeatEnergy = 0.d0
END DO
! Calculate chilled water temperature
IF (CHWInletMassFlowRate > 0.d0) THEN
CHWBypassMassFlowRate = CHWInletMassFlowRate - CHWOutletMassFlowRate
IF(CHWBypassMassFlowRate > 0.d0) THEN
CHWOutletTemp = CHWOutletTemp + CHWInletTemp * CHWBypassMassFlowRate/CHWInletMassFlowRate
ELSE ! No bypass withnin a wrapper
CHWOutletTemp = CHWOutletTemp
END IF
ELSE
CHWOutletTemp = CHWInletTemp
END IF
! Calculate hot water outlet temperature
IF (HWInletMassFlowRate > 0.d0) THEN
HWBypassMassFlowRate = HWInletMassFlowRate - HWOutletMassFlowRate
IF (HWBypassMassFlowRate > 0.d0) THEN
HWOutletTemp = HWOutletTemp + HWInletTemp * HWBypassMassFlowRate/HWInletMassFlowRate
ELSE
HWOutletTemp = HWOutletTemp
END IF
ELSE
HWOutletTemp = HWInletTemp
END IF
! Calculate condenser outlet temperature
IF(GLHEInletMassFlowRate > 0.d0) THEN
GLHEBypassMassFlowRate = GLHEInletMassFlowRate - GLHEOutletMassFlowRate
IF (GLHEBypassMassFlowRate > 0.d0) THEN
GLHEOutletTemp = GLHEOutletTemp + GLHEInletTemp * GLHEBypassMassFlowRate/GLHEInletMassFlowRate
ELSE
GLHEOutletTemp = GLHEOutletTemp
END IF
ELSE
GLHEOutletTemp = GLHEInletTemp
END IF
! Add ancilliary power if scheduled
IF (GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr) > 0) THEN
WrapperElecPowerCool = WrapperElecPowerCool + (Wrapper(WrapperNum)%AncilliaryPower * &
GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr))
END IF
! Electricity should be counted once for cooling in this mode
WrapperElecEnergyHeat = 0.d0
ELSE IF (SimulHtgDominant) THEN ! Heating dominant simultaneous clg/htg mode
DO ChillerHeaterNum=1,ChillerHeaterNums
! Set temperatures and mass flow rates for the cooling side
CurrentMode = Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode
CHWInletTemp = WrapperReport(WrapperNum)%CHWInletTempSimul
CHWInletMassFlowRate = WrapperReport(WrapperNum)%CHWmdotSimul
IF (CurrentMode /= 0) THEN ! This chiller heater unit is on
IF (CurrentMode == 3) THEN ! Heat recovery mode. Both chilled water and hot water connections
CHWOutletMassFlowRate = CHWOutletMassFlowRate + & ! Wrapper evaporator side to plant chilled water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul
HWOutletMassFlowRate = HWOutletMassFlowRate + & ! Wrapper condenser side to plant hot water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot
IF (CHWInletMassFlowRate > 0.d0) THEN
CHWOutletTemp = CHWOutletTemp + & ! Only need to calculate in the heat recovery mode
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTempSimul * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapmdotSimul/CHWInletMassFlowRate)
ELSE
CHWOutletTemp = CHWInletTemp
END IF
ELSE ! Mode 5. Heating only mode with other heat recovery units
HWOutletMassFlowRate = HWOutletMassFlowRate + & ! Wrapper condenser side to plant hot water loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot
IF (GLHEInletMassFlowRate > 0.d0) THEN
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate + & ! Wrapper evaporator side to plant condenser loop
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot
IF (GLHEOutletMassFlowRate > GLHEInletMassFlowRate) GLHEOutletMassFlowRate = GLHEInletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot/GLHEInletMassFlowRate)
WrapperGLHERate = WrapperGLHERate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap
WrapperGLHEEnergy = WrapperGLHEEnergy + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergy
ELSE
GLHEInletMassFlowRate = 0.d0
GLHEOutletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
WrapperGLHERate = 0.d0
WrapperGLHEEnergy = 0.d0
END IF
END IF ! End of heat recovery mode
ELSE ! This chiller heater is off
! Check if any unit is heating only mode
IF (ChillerHeaterNum == ChillerHeaterNums) THEN ! All are heat revocery mode. No condenser flow
GLHEOutletMassFlowRate = 0.d0
GLHEInletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
ELSE ! At leaset, one of chiller heater units is heating only mode
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp
END IF
END IF
! Calculate mass weighed hot water temperatures
IF (HWInletMassFlowRate > 0.d0) THEN
HWOutletTemp = HWOutletTemp + & ! Always heating as long as heating load remains
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot/HWInletMassFlowRate)
ELSE
HWOutletTemp = HWInletTemp
END IF
WrapperElecPowerHeat = WrapperElecPowerHeat + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower
WrapperHeatRate = WrapperHeatRate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond
WrapperElecEnergyHeat = WrapperElecEnergyHeat + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingEnergy
WrapperHeatEnergy = WrapperHeatEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergy
! Avoid double counting wrapper energy use
WrapperElecPowerCool = 0.d0
WrapperCoolRate = 0.d0
WrapperElecEnergyCool = 0.d0
WrapperElecEnergyCool = 0.d0
END DO
! Calculate chilled water outlet temperature
IF (CHWInletMassFlowRate > 0.d0) THEN
CHWBypassMassFlowRate = CHWInletMassFlowRate - CHWOutletMassFlowRate
IF(CHWBypassMassFlowRate > 0.d0) THEN
CHWOutletTemp = CHWOutletTemp + CHWInletTemp * CHWBypassMassFlowRate/CHWInletMassFlowRate
ELSE ! No bypass withnin a wrapper
CHWOutletTemp = CHWOutletTemp
END IF
ELSE
CHWOutletTemp = CHWInletTemp
END IF
! Calculate hot water outlet temperature
IF (HWInletMassFlowRate > 0.d0) THEN
HWBypassMassFlowRate = HWInletMassFlowRate - HWOutletMassFlowRate
IF (HWBypassMassFlowRate > 0.d0) THEN
HWOutletTemp = HWOutletTemp + HWInletTemp * HWBypassMassFlowRate/HWInletMassFlowRate
ELSE
HWOutletTemp = HWOutletTemp
END IF
ELSE
HWOutletTemp = HWInletTemp
END IF
! Calculate condenser outlet temperature
IF(GLHEInletMassFlowRate > 0.d0) THEN
GLHEBypassMassFlowRate = GLHEInletMassFlowRate - GLHEOutletMassFlowRate
IF (GLHEBypassMassFlowRate > 0.d0) THEN
GLHEOutletTemp = GLHEOutletTemp + GLHEInletTemp * GLHEBypassMassFlowRate/GLHEInletMassFlowRate
ELSE
GLHEOutletTemp = GLHEOutletTemp
END IF
ELSE
GLHEOutletTemp = GLHEInletTemp
END IF
! Check if ancilliary power is used
IF (GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr) > 0) THEN
WrapperElecPowerHeat = WrapperElecPowerHeat + (Wrapper(WrapperNum)%AncilliaryPower * &
GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr))
END IF
! Electricity should be counted once
WrapperElecEnergyCool = 0.d0
END IF ! End of simultaneous clg/htg mode calculations
ELSE ! Heating only mode (mode 2)
DO ChillerHeaterNum=1,ChillerHeaterNums
HWOutletMassFlowRate = HWOutletMassFlowRate + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot
HWOutletTemp = HWOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp * &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot/HWInletMassFlowRate
WrapperElecPowerHeat = WrapperElecPowerHeat + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower
WrapperHeatRate = WrapperHeatRate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond
WrapperElecEnergyHeat = WrapperElecEnergyHeat + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingEnergy
WrapperHeatEnergy = WrapperHeatEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergy
IF (GLHEInletMassFlowRate > 0.d0) THEN
GLHEOutletMassFlowRate = GLHEOutletMassFlowRate + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot
IF (GLHEOutletMassFlowRate > GLHEInletMassFlowRate) GLHEOutletMassFlowRate = GLHEInletMassFlowRate
GLHEOutletTemp = GLHEOutletTemp + &
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp * &
(Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot/GLHEInletMassFlowRate)
WrapperGLHERate = WrapperGLHERate + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap
WrapperGLHEEnergy = WrapperGLHEEnergy + Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergy
ELSE ! No source water flow
GLHEOutletMassFlowRate = 0.d0
GLHEInletMassFlowRate = 0.d0
GLHEOutletTemp = GLHEInletTemp
WrapperGLHERate = 0.d0
WrapperGLHEEnergy = 0.d0
END IF
END DO
! Calculate hot water outlet temperature
IF (HWInletMassFlowRate > 0.d0) THEN
HWBypassMassFlowRate = HWInletMassFlowRate - HWOutletMassFlowRate
IF (HWBypassMassFlowRate > 0.d0) THEN
HWOutletTemp = HWOutletTemp + HWInletTemp * HWBypassMassFlowRate/HWInletMassFlowRate
ELSE
HWOutletTemp = HWOutletTemp
IF (HWOutletTemp > HWInletTemp) HWOutletTemp = HWInletTemp
END IF
ELSE
HWOutletTemp = HWInletTemp
END IF
! Calculate condenser outlet temperature
IF(GLHEInletMassFlowRate > 0.d0) THEN
GLHEBypassMassFlowRate = GLHEInletMassFlowRate - GLHEOutletMassFlowRate
IF (GLHEBypassMassFlowRate > 0.d0) THEN
GLHEOutletTemp = GLHEOutletTemp + GLHEInletTemp * GLHEBypassMassFlowRate/GLHEInletMassFlowRate
ELSE
GLHEOutletTemp = GLHEOutletTemp
END IF
ELSE
GLHEOutletTemp = GLHEInletTemp
END IF
CHWOutletTemp = CHWInletTemp
! Add ancilliary power if necessary
IF (GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr) > 0) THEN
WrapperElecPowerHeat = WrapperElecPowerHeat + (Wrapper(WrapperNum)%AncilliaryPower * &
GetCurrentScheduleValue(Wrapper(WrapperNum)%SchedPtr))
END IF
END IF ! End of calculations
CALL SetComponentFlowRate(CHWInletMassFlowRate, CHWInletNodeNum, CHWOutletNodeNum, &
Wrapper(WrapperNum)%CWLoopNum, &
Wrapper(WrapperNum)%CWLoopSideNum, &
Wrapper(WrapperNum)%CWBranchNum, &
Wrapper(WrapperNum)%CWCompNum)
CALL SetComponentFlowRate(HWInletMassFlowRate, HWInletNodeNum, HWOutletNodeNum, &
Wrapper(WrapperNum)%HWLoopNum, &
Wrapper(WrapperNum)%HWLoopSideNum, &
Wrapper(WrapperNum)%HWBranchNum, &
Wrapper(WrapperNum)%HWCompNum)
CALL SetComponentFlowRate(GLHEInletMassFlowRate, GLHEInletNodeNum, GLHEOutletNodeNum, &
Wrapper(WrapperNum)%GLHELoopNum, &
Wrapper(WrapperNum)%GLHELoopSideNum, &
Wrapper(WrapperNum)%GLHEBranchNum, &
Wrapper(WrapperNum)%GLHECompNum)
! Local variables
WrapperReport(WrapperNum)%CHWInletTemp = CHWInletTemp
WrapperReport(WrapperNum)%CHWOutletTemp = CHWOutletTemp
WrapperReport(WrapperNum)%HWInletTemp = HWInletTemp
WrapperReport(WrapperNum)%HWOutletTemp = HWOutletTemp
WrapperReport(WrapperNum)%GLHEInletTemp = GLHEInletTemp
WrapperReport(WrapperNum)%GLHEOutletTemp = GLHEOutletTemp
WrapperReport(WrapperNum)%CHWmdot = CHWInletMassFlowRate
WrapperReport(WrapperNum)%HWmdot = HWInletMassFlowRate
WrapperReport(WrapperNum)%GLHEmdot = GLHEInletMassFlowRate
WrapperReport(WrapperNum)%TotElecCooling = WrapperElecEnergyCool
WrapperReport(WrapperNum)%TotElecHeating = WrapperElecEnergyHeat
WrapperReport(WrapperNum)%CoolingEnergy = WrapperCoolEnergy
WrapperReport(WrapperNum)%HeatingEnergy = WrapperHeatEnergy
WrapperReport(WrapperNum)%GLHEEnergy = WrapperGLHEEnergy
WrapperReport(WrapperNum)%TotElecCoolingPwr = WrapperElecPowerCool
WrapperReport(WrapperNum)%TotElecHeatingPwr = WrapperElecPowerHeat
WrapperReport(WrapperNum)%CoolingRate = WrapperCoolRate
WrapperReport(WrapperNum)%HeatingRate = WrapperHeatRate
WrapperReport(WrapperNum)%GLHERate = WrapperGLHERate
Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
Node(HWOutletNodeNum)%Temp = HWOutletTemp
Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
ELSE ! Central chiller heater system is off
CHWOutletTemp = CHWInletTemp
HWOutletTemp = HWInletTemp
GLHEOutletTemp = GLHEInletTemp
Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
Node(HWOutletNodeNum)%Temp = HWOutletTemp
Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
IF (Wrapper(WrapperNum)%WrapperCoolingLoad == 0.d0 .AND. .NOT. SimulHtgDominant) THEN
DO ChillerHeaterNum=1, ChillerHeaterNums
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%MassFlowRate = 0.d0
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%MassFlowRate = 0.d0
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapOutletNode%Temp = CHWInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%EvapInletNode%Temp = CHWInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondOutletNode%Temp = GLHEInletTemp
Wrapper(WrapperNum)%Chillerheater(ChillerHeaterNum)%CondInletNode%Temp = GLHEInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CurrentMode = 0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerPartLoadRatio = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCyclingRatio = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoadRate = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerCapFT = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFT = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerEIRFPLR = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingPower = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingPower = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QEvap = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%QCond = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapOutletTemp = CHWOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapInletTemp = CHWInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondOutletTemp = GLHEOutletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondInletTemp = GLHEInletTemp
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Evapmdot = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%Condmdot = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ChillerFalseLoad = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CoolingEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%HeatingEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%EvapEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%CondEnergy = 0.d0
Wrapper(WrapperNum)%ChillerheaterReport(ChillerHeaterNum)%ActualCOP = 0.d0
END DO
WrapperReport(WrapperNum)%CHWInletTemp = CHWInletTemp
WrapperReport(WrapperNum)%CHWOutletTemp = CHWOutletTemp
WrapperReport(WrapperNum)%HWInletTemp = HWInletTemp
WrapperReport(WrapperNum)%HWOutletTemp = HWOutletTemp
WrapperReport(WrapperNum)%GLHEInletTemp = GLHEInletTemp
WrapperReport(WrapperNum)%GLHEOutletTemp = GLHEOutletTemp
WrapperReport(WrapperNum)%CHWmdot = CHWInletMassFlowRate
WrapperReport(WrapperNum)%HWmdot = HWInletMassFlowRate
WrapperReport(WrapperNum)%GLHEmdot = GLHEInletMassFlowRate
WrapperReport(WrapperNum)%TotElecCooling = WrapperElecEnergyCool
WrapperReport(WrapperNum)%TotElecHeating = WrapperElecEnergyHeat
WrapperReport(WrapperNum)%CoolingEnergy = WrapperCoolEnergy
WrapperReport(WrapperNum)%HeatingEnergy = WrapperHeatEnergy
WrapperReport(WrapperNum)%GLHEEnergy = WrapperGLHEEnergy
WrapperReport(WrapperNum)%TotElecCoolingPwr = WrapperElecPowerCool
WrapperReport(WrapperNum)%TotElecHeatingPwr = WrapperElecPowerHeat
WrapperReport(WrapperNum)%CoolingRate = WrapperCoolRate
WrapperReport(WrapperNum)%HeatingRate = WrapperHeatRate
WrapperReport(WrapperNum)%GLHERate = WrapperGLHERate
CALL SetComponentFlowRate(CHWInletMassFlowRate, CHWInletNodeNum, CHWOutletNodeNum, &
Wrapper(WrapperNum)%CWLoopNum, &
Wrapper(WrapperNum)%CWLoopSideNum, &
Wrapper(WrapperNum)%CWBranchNum, &
Wrapper(WrapperNum)%CWCompNum)
CALL SetComponentFlowRate(HWInletMassFlowRate, HWInletNodeNum, HWOutletNodeNum, &
Wrapper(WrapperNum)%HWLoopNum, &
Wrapper(WrapperNum)%HWLoopSideNum, &
Wrapper(WrapperNum)%HWBranchNum, &
Wrapper(WrapperNum)%HWCompNum)
CALL SetComponentFlowRate(GLHEInletMassFlowRate, GLHEInletNodeNum, GLHEOutletNodeNum, &
Wrapper(WrapperNum)%GLHELoopNum, &
Wrapper(WrapperNum)%GLHELoopSideNum, &
Wrapper(WrapperNum)%GLHEBranchNum, &
Wrapper(WrapperNum)%GLHECompNum)
END IF
END IF ! Heating loop calculation
!!Node(CHWOutletNodeNum)%Temp = CHWOutletTemp
!!Node(HWOutletNodeNum)%Temp = HWOutletTemp
!!Node(GLHEOutletNodeNum)%Temp = GLHEOutletTemp
END IF
END IF
RETURN
END SUBROUTINE CalcWrapperModel