Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : #ifndef PlantChillers_hh_INCLUDED
49 : #define PlantChillers_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 :
54 : // EnergyPlus Headers
55 : #include <EnergyPlus/Data/BaseData.hh>
56 : #include <EnergyPlus/DataBranchAirLoopPlant.hh>
57 : #include <EnergyPlus/DataGlobals.hh>
58 : #include <EnergyPlus/EnergyPlus.hh>
59 : #include <EnergyPlus/Plant/DataPlant.hh>
60 : #include <EnergyPlus/PlantComponent.hh>
61 :
62 : namespace EnergyPlus {
63 :
64 : // Forward declarations
65 : struct EnergyPlusData;
66 :
67 : namespace PlantChillers {
68 :
69 950 : struct BaseChillerSpecs : PlantComponent // NOTE: This base class is abstract, derived classes must override pure virtual methods
70 : {
71 : // Members
72 : std::string Name; // user identifier
73 : Real64 MinPartLoadRat; // (GT MIN) min allowed operating frac full load
74 : Real64 MaxPartLoadRat; // (GT MAX) max allowed operating frac full load
75 : Real64 OptPartLoadRat; // (GT BEST) optimal operating frac full load
76 : Real64 TempDesCondIn; // C - (GT ADJTC(1)The design secondary loop fluid
77 : // temperature at the chiller condenser side inlet
78 : Real64 TempRiseCoef; // (GT ADJTC(2)) correction factor for off ChillDesign oper.
79 : Real64 TempDesEvapOut; // C - (GT ADJTC(3)The design primary loop fluid
80 : DataPlant::CondenserType CondenserType; // Type of Condenser - Air or Water Cooled
81 : Real64 NomCap; // design nominal capacity of chiller
82 : bool NomCapWasAutoSized; // true if NomCap was autosize on input
83 : Real64 COP; // COP
84 : DataPlant::FlowMode FlowMode; // one of 3 modes for component flow during operation
85 : bool ModulatedFlowSetToLoop; // True if the setpoint is missing at the outlet node
86 : bool ModulatedFlowErrDone; // true if setpoint warning issued
87 : bool HRSPErrDone; // TRUE if set point warning issued for heat recovery loop
88 : int EvapInletNodeNum; // Node number on the inlet side of the plant
89 : int EvapOutletNodeNum; // Node number on the outlet side of the plant
90 : int CondInletNodeNum; // Node number on the inlet side of the condenser
91 : int CondOutletNodeNum; // Node number on the outlet side of the condenser
92 : Real64 EvapVolFlowRate; // m**3/s - design nominal water volumetric flow rate through the evaporator
93 : bool EvapVolFlowRateWasAutoSized; // true if autosized design evap flow rate on input
94 : Real64 EvapMassFlowRateMax; // kg/s - design water mass flow rate through evaporator
95 : Real64 CondVolFlowRate; // m**3/s - design nominal water volumetric flow rate through the condenser
96 : bool CondVolFlowRateWasAutoSized; // true if previous was autosized
97 : Real64 CondMassFlowRateMax; // kg/s - design water mass flow rate through condenser
98 : PlantLocation CWPlantLoc; // chilled water plant loop component index
99 : PlantLocation CDPlantLoc; // condenser water plant loop component index
100 : Real64 SizFac; // sizing factor
101 : Real64 BasinHeaterPowerFTempDiff; // Basin heater capacity per degree C below setpoint (W/C)
102 : Real64 BasinHeaterSetPointTemp; // Setpoint temperature for basin heater operation (C)
103 : int BasinHeaterSchedulePtr; // Pointer to basin heater schedule
104 : int ErrCount1; // for recurring error messages
105 : int ErrCount2; // for recurring error messages
106 : std::string MsgBuffer1; // - buffer to print warning messages on following time step
107 : std::string MsgBuffer2; // - buffer to print warning messages on following time step
108 : Real64 MsgDataLast; // value of data when warning occurred (passed to Recurring Warn)
109 : bool PrintMessage; // logical to determine if message is valid
110 : int MsgErrorCount; // number of occurrences of warning
111 : bool CheckEquipName;
112 : bool PossibleSubcooling; // flag to indicate chiller is doing less cooling that requested
113 : int CondMassFlowIndex;
114 : // Operational fault parameters
115 : bool FaultyChillerSWTFlag; // True if the chiller has SWT sensor fault
116 : int FaultyChillerSWTIndex; // Index of the fault object corresponding to the chiller
117 : Real64 FaultyChillerSWTOffset; // Chiller SWT sensor offset
118 : bool FaultyChillerFoulingFlag; // True if the chiller has fouling fault
119 : int FaultyChillerFoulingIndex; // Index of the fault object corresponding to the chiller
120 : Real64 FaultyChillerFoulingFactor; // Chiller fouling factor
121 : bool MyFlag;
122 : bool MyEnvrnFlag;
123 : Real64 TimeStepSysLast;
124 : Real64 CurrentEndTimeLast;
125 : Real64 CondMassFlowRate; // Kg/s - condenser mass flow rate, water side
126 : Real64 EvapMassFlowRate; // Kg/s - evaporator mass flow rate, water side
127 : Real64 CondOutletTemp; // C - condenser outlet temperature, air or water side
128 : Real64 EvapOutletTemp; // C - evaporator outlet temperature, water side
129 : Real64 QEvaporator; // W - rate of heat transfer to the evaporator coil
130 : Real64 QCondenser; // W - rate of heat transfer to the condenser coil
131 : Real64 Energy; // J - chiller energy use
132 : Real64 EvaporatorEnergy; // J - rate of heat transfer to the evaporator coil
133 : Real64 CondenserEnergy; // J - rate of heat transfer to the condenser coil
134 : Real64 QHeatRecovered; // W - rate of heat transfer to the Heat Recovery coil
135 : Real64 HeatRecOutletTemp; // C - Heat Rec outlet temperature, water side
136 : Real64 AvgCondSinkTemp; // condenser temperature value for use in curves [C]
137 : Real64 BasinHeaterPower; // Basin heater power (W)
138 : Real64 Power;
139 : Real64 CondInletTemp;
140 : Real64 EvapInletTemp;
141 : Real64 BasinHeaterConsumption; // Basin heater energy consumption (J)
142 : DataPlant::PlantEquipmentType ChillerType;
143 :
144 : // Default Constructor
145 632 : BaseChillerSpecs()
146 632 : : MinPartLoadRat(0.0), MaxPartLoadRat(1.0), OptPartLoadRat(1.0), TempDesCondIn(0.0), TempRiseCoef(0.0), TempDesEvapOut(0.0),
147 : CondenserType(DataPlant::CondenserType::WaterCooled), NomCap(0.0), NomCapWasAutoSized(false), COP(0.0),
148 : FlowMode(DataPlant::FlowMode::Invalid), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), HRSPErrDone(false),
149 : EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), EvapVolFlowRate(0.0),
150 : EvapVolFlowRateWasAutoSized(false), EvapMassFlowRateMax(0.0), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false),
151 : CondMassFlowRateMax(0.0), CWPlantLoc{}, CDPlantLoc{}, SizFac(0.0), BasinHeaterPowerFTempDiff(0.0), BasinHeaterSetPointTemp(0.0),
152 : BasinHeaterSchedulePtr(0), ErrCount1(0), ErrCount2(0), MsgDataLast(0.0), PrintMessage(false), MsgErrorCount(0), CheckEquipName(true),
153 : PossibleSubcooling(false), CondMassFlowIndex(0), FaultyChillerSWTFlag(false), FaultyChillerSWTIndex(0), FaultyChillerSWTOffset(0.0),
154 : FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyFlag(true), MyEnvrnFlag(true),
155 : TimeStepSysLast(0.0), CurrentEndTimeLast(0.0), CondMassFlowRate(0.0), EvapMassFlowRate(0.0), CondOutletTemp(0.0),
156 : EvapOutletTemp(0.0), // C - evaporator outlet temperature, water side
157 : QEvaporator(0.0), // W - rate of heat transfer to the evaporator coil
158 : QCondenser(0.0), // W - rate of heat transfer to the condenser coil
159 : Energy(0.0), // J - chiller energy use
160 : EvaporatorEnergy(0.0), // J - rate of heat transfer to the evaporator coil
161 : CondenserEnergy(0.0), // J - rate of heat transfer to the condenser coil
162 : QHeatRecovered(0.0), // W - rate of heat transfer to the Heat Recovery coil
163 : HeatRecOutletTemp(0.0), // C - Heat Rec outlet temperature, water side
164 : AvgCondSinkTemp(0.0), // condenser temperature value for use in curves [C]
165 : BasinHeaterPower(0.0), // Basin heater power (W)
166 632 : Power(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), BasinHeaterConsumption(0.0), ChillerType(DataPlant::PlantEquipmentType::Invalid)
167 :
168 : {
169 632 : }
170 :
171 : void getDesignCapacities(EnergyPlusData &state,
172 : [[maybe_unused]] const PlantLocation &calledFromLocation,
173 : [[maybe_unused]] Real64 &MaxLoad,
174 : [[maybe_unused]] Real64 &MinLoad,
175 : [[maybe_unused]] Real64 &OptLoad) override;
176 :
177 : void getSizingFactor([[maybe_unused]] Real64 &SizFac) override;
178 :
179 : void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) override;
180 :
181 : void getDesignTemperatures([[maybe_unused]] Real64 &TempDesCondIn, [[maybe_unused]] Real64 &TempDesEvapOut) override;
182 :
183 : virtual void initialize(EnergyPlusData &state, bool RunFlag, Real64 MyLoad) = 0;
184 :
185 : virtual void size(EnergyPlusData &state) = 0;
186 : };
187 :
188 629 : struct ElectricChillerSpecs : BaseChillerSpecs
189 : {
190 : // Members
191 : // temperature at the chiller evaporator side outlet
192 : Array1D<Real64> CapRatCoef; // (Electric RCAVC() ) coeff of cap ratio poly fit
193 : Array1D<Real64> PowerRatCoef; // (Electric ADJEC() ) coeff of power rat poly fit
194 : Array1D<Real64> FullLoadCoef; // (Electric RPWRC() ) coeff of full load poly. fit
195 : Real64 TempLowLimitEvapOut; // C - low temperature shut off
196 : Real64 DesignHeatRecVolFlowRate; // m3/s, Design Water mass flow rate through heat recovery loop
197 : bool DesignHeatRecVolFlowRateWasAutoSized; // true if previous was input autosize.
198 : Real64 DesignHeatRecMassFlowRate; // kg/s, Design Water mass flow rate through heat recovery loop
199 : bool HeatRecActive; // True entered Heat Rec Vol Flow Rate >0
200 : int HeatRecInletNodeNum; // Node number on the heat recovery inlet side of the condenser
201 : int HeatRecOutletNodeNum; // Node number on the heat recovery outlet side of the condenser
202 : Real64 HeatRecCapacityFraction; // user input for heat recovery capacity fraction []
203 : Real64 HeatRecMaxCapacityLimit; // Capacity limit for Heat recovery, one time calc [W]
204 : int HeatRecSetPointNodeNum; // index for system node with the heat recover leaving setpoint
205 : int HeatRecInletLimitSchedNum; // index for schedule for the inlet high limit for heat recovery operation
206 : PlantLocation HRPlantLoc; // heat recovery water plant loop component index
207 : std::string EndUseSubcategory; // identifier use for the end use subcategory
208 : Real64 CondOutletHumRat; // kg/kg - condenser outlet humditiy ratio, air side
209 : Real64 ActualCOP;
210 : Real64 QHeatRecovery;
211 : Real64 EnergyHeatRecovery;
212 : Real64 HeatRecInletTemp;
213 : Real64 HeatRecOutletTemp;
214 : Real64 HeatRecMdot;
215 : Real64 ChillerCondAvgTemp; // the effective condenser temperature for chiller performance [C]
216 :
217 : // Default Constructor
218 418 : ElectricChillerSpecs()
219 418 : : CapRatCoef(3, 0.0), PowerRatCoef(3, 0.0), FullLoadCoef(3, 0.0), TempLowLimitEvapOut(0.0), DesignHeatRecVolFlowRate(0.0),
220 : DesignHeatRecVolFlowRateWasAutoSized(false), DesignHeatRecMassFlowRate(0.0), HeatRecActive(false), HeatRecInletNodeNum(0),
221 : HeatRecOutletNodeNum(0), HeatRecCapacityFraction(0.0), HeatRecMaxCapacityLimit(0.0), HeatRecSetPointNodeNum(0),
222 : HeatRecInletLimitSchedNum(0), HRPlantLoc{}, CondOutletHumRat(0.0), ActualCOP(0.0), QHeatRecovery(0.0), EnergyHeatRecovery(0.0),
223 418 : HeatRecInletTemp(0.0), HeatRecOutletTemp(0.0), HeatRecMdot(0.0), ChillerCondAvgTemp(0.0)
224 : {
225 418 : }
226 :
227 : static void getInput(EnergyPlusData &state);
228 :
229 : void setupOutputVariables(EnergyPlusData &state);
230 :
231 : static ElectricChillerSpecs *factory(EnergyPlusData &state, std::string const &chillerName);
232 :
233 : void simulate([[maybe_unused]] EnergyPlusData &state,
234 : const PlantLocation &calledFromLocation,
235 : bool FirstHVACIteration,
236 : Real64 &CurLoad,
237 : bool RunFlag) override;
238 :
239 : void initialize(EnergyPlusData &state, bool RunFlag, Real64 MyLoad) override;
240 :
241 : void size(EnergyPlusData &state) override;
242 :
243 : void calculate(EnergyPlusData &state,
244 : Real64 &MyLoad, // operating load
245 : bool RunFlag, // TRUE when chiller operating
246 : DataBranchAirLoopPlant::ControlType EquipFlowCtrl // Flow control mode for the equipment
247 : );
248 :
249 : void update(EnergyPlusData &state,
250 : Real64 MyLoad, // current load
251 : bool RunFlag // TRUE if chiller operating
252 : );
253 :
254 : void calcHeatRecovery(EnergyPlusData &state,
255 : Real64 &QCond, // current condenser load
256 : Real64 CondMassFlow, // current condenser Mass Flow
257 : Real64 condInletTemp, // current condenser Inlet Temp
258 : Real64 &QHeatRec // amount of heat recovered
259 : );
260 :
261 : void oneTimeInit(EnergyPlusData &state) override;
262 : };
263 :
264 36 : struct EngineDrivenChillerSpecs : BaseChillerSpecs
265 : {
266 : // Members
267 : std::string FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
268 : // temperature at the chiller evaporator side outlet
269 : Array1D<Real64> CapRatCoef; // (EngineDriven RCAVC() ) coeff of cap ratio poly fit
270 : Array1D<Real64> PowerRatCoef; // (EngineDriven ADJEC() ) coeff of power rat poly fit
271 : Array1D<Real64> FullLoadCoef; // (EngineDriven RPWRC() ) coeff of full load poly. fit
272 : Real64 TempLowLimitEvapOut; // C - low temperature shut off
273 : int ClngLoadtoFuelCurve; // Coeff of Shaft Power to Fuel Energy Input Coeff Poly Fit
274 : int RecJacHeattoFuelCurve; // Curve Index for Ratio of Recoverable Jacket Heat to
275 : int RecLubeHeattoFuelCurve; // Curve Index for Ratio of Recoverable Lube Oil Heat to
276 : int TotExhausttoFuelCurve; // Curve Index for Total Exhaust heat Input to Fuel Energy Input Coeffs Poly Fit
277 : Real64 ExhaustTemp; // (TEXDC) Exhaust Gas Temp to Fuel Energy Input
278 : int ExhaustTempCurve; // Curve Index for Exhaust Gas Temp to Fuel Energy Input Coeffs Poly Fit
279 : Real64 UA; // (UACDC) exhaust gas Heat Exchanger UA to Capacity
280 : Array1D<Real64> UACoef; // Heat Exchanger UA Coeffs Poly Fit
281 : Real64 MaxExhaustperPowerOutput; // MAX EXHAUST FLOW PER W DSL POWER OUTPUT COEFF
282 : Real64 DesignMinExitGasTemp; // Steam Saturation Temperature
283 : Real64 FuelHeatingValue; // Heating Value of Fuel in kJ/kg
284 : Real64 DesignHeatRecVolFlowRate; // m3/s, Design Water mass flow rate through heat recovery loop
285 : bool DesignHeatRecVolFlowRateWasAutoSized; // true if user input was autosize for heat recover design flow rate
286 : Real64 DesignHeatRecMassFlowRate; // kg/s, Design Water mass flow rate through heat recovery loop
287 : bool HeatRecActive; // True entered Heat Rec Vol Flow Rate >0
288 : int HeatRecInletNodeNum; // Node number on the heat recovery inlet side of the condenser
289 : int HeatRecOutletNodeNum; // Node number on the heat recovery outlet side of the condenser
290 : Real64 HeatRecCapacityFraction; // user input for heat recovery capacity fraction []
291 : Real64 HeatRecMaxTemp; // Max Temp that can be produced in heat recovery
292 : PlantLocation HRPlantLoc; // heat recovery water plant loop component index
293 :
294 : // engine driven:
295 : Real64 HeatRecInletTemp; // Inlet Temperature of the heat recovery fluid
296 : Real64 HeatRecMdotActual; // Heat Recovery Loop Mass flow rate
297 : Real64 QTotalHeatRecovered; // total heat recovered (W)
298 : Real64 QJacketRecovered; // heat recovered from jacket (W)
299 : Real64 QLubeOilRecovered; // heat recovered from lube (W)
300 : Real64 QExhaustRecovered; // exhaust gas heat recovered (W)
301 : Real64 FuelEnergyUseRate; // Fuel Energy used (W)
302 : Real64 TotalHeatEnergyRec; // total heat recovered (J)
303 : Real64 JacketEnergyRec; // heat recovered from jacket (J)
304 : Real64 LubeOilEnergyRec; // heat recovered from lube (J)
305 : Real64 ExhaustEnergyRec; // exhaust gas heat recovered (J)
306 : Real64 FuelEnergy; // Fuel Energy used (J)
307 : Real64 FuelMdot; // Fuel Amount used (Kg/s)
308 : Real64 ExhaustStackTemp; // Exhaust Stack Temperature (C)
309 :
310 : Real64 HeatRecOutletTemp; // Heat Recovery Loop Outlet Temperature (C)
311 : Real64 HeatRecMdot; // Heat Recovery Loop Mass flow rate (kg/s)
312 : Real64 FuelCOP; // Fuel COP [delivered cooling rate/fuel energy input rate] (W/W)
313 :
314 : // Default Constructor
315 24 : EngineDrivenChillerSpecs()
316 24 : : CapRatCoef(3, 0.0), PowerRatCoef(3, 0.0), FullLoadCoef(3, 0.0), TempLowLimitEvapOut(0.0), ClngLoadtoFuelCurve(0),
317 : RecJacHeattoFuelCurve(0), RecLubeHeattoFuelCurve(0), TotExhausttoFuelCurve(0), ExhaustTemp(0.0), ExhaustTempCurve(0), UA(0.0),
318 : UACoef(2, 0.0), MaxExhaustperPowerOutput(0.0), DesignMinExitGasTemp(0.0), FuelHeatingValue(0.0), DesignHeatRecVolFlowRate(0.0),
319 : DesignHeatRecVolFlowRateWasAutoSized(false), DesignHeatRecMassFlowRate(0.0), HeatRecActive(false), HeatRecInletNodeNum(0),
320 : HeatRecOutletNodeNum(0), HeatRecCapacityFraction(0.0), HeatRecMaxTemp(0.0), HRPlantLoc{}, HeatRecInletTemp(0.0), HeatRecMdotActual(0.0),
321 : QTotalHeatRecovered(0.0), QJacketRecovered(0.0),
322 :
323 : // engine driven:
324 : QLubeOilRecovered(0.0), QExhaustRecovered(0.0), FuelEnergyUseRate(0.0), TotalHeatEnergyRec(0.0), JacketEnergyRec(0.0),
325 : LubeOilEnergyRec(0.0), ExhaustEnergyRec(0.0), FuelEnergy(0.0), FuelMdot(0.0), ExhaustStackTemp(0.0), HeatRecOutletTemp(0.0),
326 24 : HeatRecMdot(0.0), FuelCOP(0.0)
327 : {
328 24 : }
329 :
330 : static EngineDrivenChillerSpecs *factory(EnergyPlusData &state, std::string const &chillerName);
331 :
332 : static void getInput(EnergyPlusData &state);
333 :
334 : void simulate([[maybe_unused]] EnergyPlusData &state,
335 : const PlantLocation &calledFromLocation,
336 : bool FirstHVACIteration,
337 : Real64 &CurLoad,
338 : bool RunFlag) override;
339 :
340 : void setupOutputVariables(EnergyPlusData &state);
341 :
342 : void initialize(EnergyPlusData &state, bool RunFlag, Real64 MyLoad) override;
343 :
344 : void size(EnergyPlusData &state) override;
345 :
346 : void calculate(EnergyPlusData &state,
347 : Real64 &MyLoad, // operating load
348 : bool RunFlag, // TRUE when chiller operating
349 : DataBranchAirLoopPlant::ControlType EquipFlowCtrl // Flow control mode for the equipment
350 : );
351 :
352 : void calcHeatRecovery(EnergyPlusData &state,
353 : Real64 EnergyRecovered, // Amount of heat recovered
354 : Real64 &HeatRecRatio // Max Heat recovery ratio
355 : );
356 :
357 : void update(EnergyPlusData &state,
358 : Real64 MyLoad, // current load
359 : bool RunFlag // TRUE if chiller operating
360 : );
361 :
362 : void oneTimeInit(EnergyPlusData &state) override;
363 : };
364 :
365 6 : struct GTChillerSpecs : BaseChillerSpecs
366 : {
367 : // Members
368 : std::string FuelType; // Type of Fuel - DIESEL, GASOLINE, GAS
369 : Array1D<Real64> CapRatCoef; // (GT RCAVC() ) coeff of cap ratio poly fit
370 : Array1D<Real64> PowerRatCoef; // (GT ADJEC() ) coeff of power rat poly fit
371 : Array1D<Real64> FullLoadCoef; // (GT RPWRC() ) coeff of full load poly. fit
372 : Real64 TempLowLimitEvapOut; // C - low temperature shut off
373 : // "special" GT chiller input parameters
374 : Real64 FuelEnergyIn; // (EFUEL) Amount of Fuel Energy Required to run gas turbine
375 : Array1D<Real64> PLBasedFuelInputCoef; // (FUL1GC) Part Load Ratio Based Fuel Input Coefficients Poly Fit
376 : Array1D<Real64> TempBasedFuelInputCoef; // (FUL2GC) Ambient Temperature Based Fuel Input Coeff Poly Fit
377 : Real64 ExhaustFlow; // (FEX) Exhaust Gas Flow Rate cubic meters per second
378 : Array1D<Real64> ExhaustFlowCoef; // (FEXGC) Exhaust Gas Flow Rate Input Coef Poly Fit
379 : Real64 ExhaustTemp; // (TEX) Exhaust Gas Temperature in C
380 : Array1D<Real64> PLBasedExhaustTempCoef; // (TEX1GC) Part Load Ratio Based Exhaust Temperature Input Coeffs Poly Fit
381 : Array1D<Real64> TempBasedExhaustTempCoef; // (TEX2GC) Ambient Temperature Based Exhaust Gas Temp to
382 : // Fuel Energy Input Coeffs Poly Fit
383 : Real64 HeatRecLubeEnergy; // (ELUBE) Recoverable Lube Oil Energy
384 : Real64 HeatRecLubeRate; // (ELUBE) Recoverable Lube Oil Rate of Recovery (W)
385 : Array1D<Real64> HeatRecLubeEnergyCoef; // (ELUBEGC) Recoverable Lube Oil Energy Input Coef Poly Fit
386 : Real64 UAtoCapRat; // (UACGC) Heat Exchanger UA to Capacity
387 : Array1D<Real64> UAtoCapCoef; // Heat Exchanger UA to Capacity Coeffs Poly Fit
388 : Real64 GTEngineCapacity; // Capacity of GT Unit attached to Chiller
389 : bool GTEngineCapacityWasAutoSized; // true if previous field was autosize on inpt
390 : Real64 MaxExhaustperGTPower; // Max Exhaust Flow per KW Power Out
391 : Real64 DesignSteamSatTemp; // Steam Saturation Temperature
392 : Real64 ExhaustStackTemp; // Temperature of Exhaust Gases
393 : int HeatRecInletNodeNum; // Node number on the heat recovery inlet side of the condenser
394 : int HeatRecOutletNodeNum; // Node number on the heat recovery outlet side of the condenser
395 : Real64 HeatRecInletTemp; // Inlet Temperature of the heat recovery fluid
396 : Real64 HeatRecOutletTemp; // Outlet Temperature of the heat recovery fluid
397 : Real64 HeatRecMdot; // Heat Recovery Loop Mass flow rate
398 : Real64 DesignHeatRecVolFlowRate; // m3/s, Design Water mass flow rate through heat recovery loop
399 : bool DesignHeatRecVolFlowRateWasAutoSized; // true if previous field was autosize on input
400 : Real64 DesignHeatRecMassFlowRate; // kg/s, Design Water mass flow rate through heat recovery loop
401 : bool HeatRecActive; // True entered Heat Rec Vol Flow Rate >0
402 : Real64 FuelHeatingValue; // Heating Value of Fuel in kJ/kg
403 : Real64 HeatRecCapacityFraction; // user input for heat recovery capacity fraction []
404 : Real64 engineCapacityScalar; // user input for engine efficiency for sizing GTEngineCapacity []
405 : Real64 HeatRecMaxTemp; // Max Temp that can be produced in heat recovery
406 : PlantLocation HRPlantLoc; // heat recovery water plant loop component index
407 :
408 : Real64 FuelEnergyUsed; // Fuel Energy used
409 : Real64 FuelEnergyUsedRate; // Fuel energy used rate (fuel consumption rate)
410 : Real64 FuelMassUsed; // Fuel Amount used
411 : Real64 FuelMassUsedRate; // Fuel amount used (fuel Mass consumption rate)
412 : Real64 FuelCOP; // Fuel coefficient of performance (Qevap/FuelEnergyUsedRate)
413 :
414 : // Default Constructor
415 4 : GTChillerSpecs()
416 4 : : CapRatCoef(3, 0.0), PowerRatCoef(3, 0.0), FullLoadCoef(3, 0.0), TempLowLimitEvapOut(0.0), FuelEnergyIn(0.0),
417 : PLBasedFuelInputCoef(3, 0.0), TempBasedFuelInputCoef(3, 0.0), ExhaustFlow(0.0), ExhaustFlowCoef(3, 0.0), ExhaustTemp(0.0),
418 : PLBasedExhaustTempCoef(3, 0.0), TempBasedExhaustTempCoef(3, 0.0), HeatRecLubeEnergy(0.0), HeatRecLubeRate(0.0),
419 : HeatRecLubeEnergyCoef(3, 0.0), UAtoCapRat(0.0), UAtoCapCoef(3, 0.0), GTEngineCapacity(0.0), GTEngineCapacityWasAutoSized(false),
420 : MaxExhaustperGTPower(0.0), DesignSteamSatTemp(0.0), ExhaustStackTemp(0.0), HeatRecInletNodeNum(0), HeatRecOutletNodeNum(0),
421 : HeatRecInletTemp(0.0), HeatRecOutletTemp(0.0), HeatRecMdot(0.0), DesignHeatRecVolFlowRate(0.0),
422 : DesignHeatRecVolFlowRateWasAutoSized(false), DesignHeatRecMassFlowRate(0.0), HeatRecActive(false), FuelHeatingValue(0.0),
423 : HeatRecCapacityFraction(0.0), engineCapacityScalar(0.35), HeatRecMaxTemp(0.0), HRPlantLoc{}, FuelEnergyUsed(0.0),
424 4 : FuelEnergyUsedRate(0.0), FuelMassUsed(0.0), FuelMassUsedRate(0.0), FuelCOP(0.0)
425 : {
426 4 : }
427 :
428 : static GTChillerSpecs *factory(EnergyPlusData &state, std::string const &chillerName);
429 :
430 : static void getInput(EnergyPlusData &state);
431 :
432 : void simulate([[maybe_unused]] EnergyPlusData &state,
433 : const PlantLocation &calledFromLocation,
434 : bool FirstHVACIteration,
435 : Real64 &CurLoad,
436 : bool RunFlag) override;
437 :
438 : void setupOutputVariables(EnergyPlusData &state);
439 :
440 : void initialize(EnergyPlusData &state, bool RunFlag, Real64 MyLoad) override;
441 :
442 : void size(EnergyPlusData &state) override;
443 :
444 : void calculate(EnergyPlusData &state,
445 : Real64 &MyLoad, // operating load
446 : bool RunFlag, // TRUE when chiller operating
447 : DataBranchAirLoopPlant::ControlType EquipFlowCtrl // Flow control mode for the equipment
448 : );
449 :
450 : void update(EnergyPlusData &state,
451 : Real64 MyLoad, // current load
452 : bool RunFlag // TRUE if chiller operating
453 : );
454 :
455 : void oneTimeInit(EnergyPlusData &state) override;
456 : };
457 :
458 279 : struct ConstCOPChillerSpecs : BaseChillerSpecs
459 : {
460 : // Members
461 : Real64 ActualCOP;
462 :
463 : // Default Constructor
464 186 : ConstCOPChillerSpecs() : ActualCOP(0.0)
465 : {
466 186 : }
467 :
468 : static ConstCOPChillerSpecs *factory(EnergyPlusData &state, std::string const &chillerName);
469 :
470 : static void getInput(EnergyPlusData &state);
471 :
472 : void simulate([[maybe_unused]] EnergyPlusData &state,
473 : const PlantLocation &calledFromLocation,
474 : bool FirstHVACIteration,
475 : Real64 &CurLoad,
476 : bool RunFlag) override;
477 :
478 : void setupOutputVariables(EnergyPlusData &state);
479 :
480 : void initialize(EnergyPlusData &state, bool RunFlag, Real64 MyLoad) override;
481 :
482 : void size(EnergyPlusData &state) override;
483 :
484 : void calculate(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag, DataBranchAirLoopPlant::ControlType EquipFlowCtrl);
485 :
486 : void update(EnergyPlusData &state, Real64 MyLoad, bool RunFlag);
487 :
488 : void oneTimeInit(EnergyPlusData &state) override;
489 : };
490 : } // namespace PlantChillers
491 :
492 1542 : struct PlantChillersData : BaseGlobalStruct
493 : {
494 :
495 : int NumElectricChillers = 0;
496 : int NumEngineDrivenChillers = 0;
497 : int NumGTChillers = 0;
498 : int NumConstCOPChillers = 0;
499 :
500 : bool GetEngineDrivenInput = true;
501 : bool GetElectricInput = true;
502 : bool GetGasTurbineInput = true;
503 : bool GetConstCOPInput = true;
504 :
505 : EPVector<PlantChillers::ElectricChillerSpecs> ElectricChiller;
506 : EPVector<PlantChillers::EngineDrivenChillerSpecs> EngineDrivenChiller;
507 : EPVector<PlantChillers::GTChillerSpecs> GTChiller;
508 : EPVector<PlantChillers::ConstCOPChillerSpecs> ConstCOPChiller;
509 :
510 0 : void clear_state() override
511 : {
512 0 : NumElectricChillers = 0;
513 0 : NumEngineDrivenChillers = 0;
514 0 : NumGTChillers = 0;
515 0 : NumConstCOPChillers = 0;
516 0 : GetEngineDrivenInput = true;
517 0 : GetElectricInput = true;
518 0 : GetGasTurbineInput = true;
519 0 : GetConstCOPInput = true;
520 0 : ElectricChiller.deallocate();
521 0 : EngineDrivenChiller.deallocate();
522 0 : GTChiller.deallocate();
523 0 : ConstCOPChiller.deallocate();
524 0 : }
525 : };
526 :
527 : } // namespace EnergyPlus
528 :
529 : #endif
|