Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2024, 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 PackagedThermalStorageCoil_hh_INCLUDED
49 : #define PackagedThermalStorageCoil_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 : #include <ObjexxFCL/Optional.hh>
54 :
55 : // EnergyPlus Headers
56 : #include <EnergyPlus/Data/BaseData.hh>
57 : #include <EnergyPlus/Data/EnergyPlusData.hh>
58 : #include <EnergyPlus/DataGlobals.hh>
59 : #include <EnergyPlus/DataHVACGlobals.hh>
60 : #include <EnergyPlus/DataHeatBalance.hh>
61 : #include <EnergyPlus/EnergyPlus.hh>
62 : #include <EnergyPlus/HVACUnitaryBypassVAV.hh>
63 :
64 : namespace EnergyPlus {
65 :
66 : namespace PackagedThermalStorageCoil {
67 :
68 : // control types
69 : enum class PTSCCtrlType
70 : {
71 : Invalid = -1,
72 : ScheduledOpModes, // control over TES modes is via local schedule
73 : EMSActuatedOpModes, // control over TES modes is via EMS
74 : Num
75 : };
76 :
77 : // Control Modes
78 : enum class PTSCOperatingMode
79 : {
80 : Invalid = -1,
81 : Off,
82 : CoolingOnly,
83 : CoolingAndCharge,
84 : CoolingAndDischarge,
85 : ChargeOnly,
86 : DischargeOnly,
87 : Num
88 : };
89 :
90 : // storage media
91 : enum class MediaType
92 : {
93 : Invalid = -1,
94 : Water,
95 : UserDefindFluid,
96 : Ice,
97 : Num
98 : };
99 :
100 : // Water Systems
101 : enum class CondensateAction
102 : {
103 : Invalid = -1,
104 : Discard, // default mode where water is "lost"
105 : ToTank, // collect coil condensate from air and store in water storage tank
106 : Num
107 : };
108 :
109 : enum class EvapWaterSupply
110 : {
111 : Invalid = -1,
112 : WaterSupplyFromMains,
113 : WaterSupplyFromTank,
114 : Num
115 : };
116 :
117 : enum class TESCondenserType
118 : {
119 : Invalid = -1,
120 : Air,
121 : Evap,
122 : Num
123 : };
124 :
125 : // Dehumidification control modes (DehumidControlMode)
126 : constexpr int DehumidControl_CoolReheat(2);
127 :
128 : struct PackagedTESCoolingCoilStruct
129 : {
130 : // Members
131 : std::string Name; // Name of TES cooling package
132 : int AvailSchedNum; // pointer to availability schedule
133 : PTSCCtrlType ModeControlType; // how are operation modes controlled
134 : int ControlModeSchedNum; // pointer to control schedule if used
135 : bool EMSControlModeOn; // if true, then EMS actuator has been used
136 : Real64 EMSControlModeValue; // value to use from EMS actuator for control mode
137 : PTSCOperatingMode CurControlMode = PTSCOperatingMode::Off;
138 : int curControlModeReport = static_cast<int>(PTSCOperatingMode::Off);
139 : int ControlModeErrorIndex;
140 : Real64 RatedEvapAirVolFlowRate; // [m3/s]
141 : Real64 RatedEvapAirMassFlowRate; // [kg/s]
142 : int EvapAirInletNodeNum; // evaporator inlet node pointer
143 : int EvapAirOutletNodeNum; // evaporator outlet node pointer
144 : // Cooling Only Mode
145 : bool CoolingOnlyModeIsAvailable;
146 : Real64 CoolingOnlyRatedTotCap; // gross total cooling capacity at rating conditions [W]
147 : Real64 CoolingOnlyRatedSHR; // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
148 : Real64 CoolingOnlyRatedCOP; // Coefficient of performance at rating conditions [W/W]
149 : int CoolingOnlyCapFTempCurve; // curve index for total cooling capacity modifier curve
150 : // (function of entering wetbulb, outside drybulb)
151 : int CoolingOnlyCapFTempObjectNum; // type of object used for curve input
152 : int CoolingOnlyCapFFlowCurve; // curve index for total cooling capacity modifier curve
153 : // (function of actual supply air flow vs rated air flow)
154 : int CoolingOnlyCapFFlowObjectNum; // type of object used for curve input
155 : int CoolingOnlyEIRFTempCurve; // curve index for energy input ratio modifier curve
156 : // (function of entering wetbulb, outside drybulb)
157 : int CoolingOnlyEIRFTempObjectNum; // type of object used for curve input
158 : int CoolingOnlyEIRFFlowCurve; // curve index for energy input ratio modifier curve
159 : // (function of actual supply air flow vs rated air flow)
160 : int CoolingOnlyEIRFFlowObjectNum; // type of object used for curve input
161 : int CoolingOnlyPLFFPLRCurve; // curve index for part-load fact vs part load ratio,EIR modifier
162 : int CoolingOnlyPLFFPLRObjectNum; // type of object used for curve input
163 : int CoolingOnlySHRFTempCurve; // curve index for sensible heat ratio modifier curve
164 : // (function of entering wetbulb and drybulb)
165 : int CoolingOnlySHRFTempObjectNum; // type of object used for curve input
166 : int CoolingOnlySHRFFlowCurve; // curve index for sensible heat ratio modifer curve
167 : // (function of actual supply air flow vs rated air flow)
168 : int CoolingOnlySHRFFlowObjectNum;
169 : // cooling and charge mode
170 : bool CoolingAndChargeModeAvailable;
171 : Real64 CoolingAndChargeRatedTotCap; // gross total evaporator cooling capacity at rating conditions [W]
172 : Real64 CoolingAndChargeRatedTotCapSizingFactor; // sizing factor for gross total evaporator [ ]
173 : Real64 CoolingAndChargeRatedChargeCap; // net storage charging capacity at rating conditions [W]
174 : Real64 CoolingAndChargeRatedChargeCapSizingFactor; // sizing factor for charging capacity [ ]
175 : Real64 CoolingAndChargeRatedSHR; // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
176 : Real64 CoolingAndChargeCoolingRatedCOP; // Coefficient of performance at rating conditions, for cooling [W/W]
177 : Real64 CoolingAndChargeChargingRatedCOP; // Coefficient of performance at rating conditions, for charging [W/W]
178 : int CoolingAndChargeCoolingCapFTempCurve; // curve index for total cooling capacity modifier curve
179 : // (function of entering wetbulb, outside drybulb, state of TES)
180 : int CoolingAndChargeCoolingCapFTempObjectNum;
181 : int CoolingAndChargeCoolingCapFFlowCurve; // curve index for total cooling capacity modifier curve
182 : // (function of actual supply air flow vs rated air flow)
183 : int CoolingAndChargeCoolingCapFFlowObjectNum;
184 : int CoolingAndChargeCoolingEIRFTempCurve; // curve index for cooling energy input ratio modifier curve
185 : // (function of entering wetbulb, outside drybulb, state of TES)
186 : int CoolingAndChargeCoolingEIRFTempObjectNum;
187 : int CoolingAndChargeCoolingEIRFFlowCurve; // curve index for cooling energy input ratio modifier curve
188 : // (function of actual supply air flow vs rated air flow)
189 : int CoolingAndChargeCoolingEIRFFlowObjectNum;
190 : int CoolingAndChargeCoolingPLFFPLRCurve; // curve index for cooling part-load fact vs part load ratio, EIR modifier
191 : // (function of evaporator part load)
192 : int CoolingAndChargeCoolingPLFFPLRObjectNum;
193 : int CoolingAndChargeChargingCapFTempCurve; // curve index for charging capacity modifier curve
194 : // (function of entering wetbulb, outside drybulb, state of TES)
195 : int CoolingAndChargeChargingCapFTempObjectNum;
196 : int CoolingAndChargeChargingCapFEvapPLRCurve; // curve index for charging capacity modifier curve
197 : // function of evaporator part load ratio
198 : int CoolingAndChargeChargingCapFEvapPLRObjectNum;
199 : int CoolingAndChargeChargingEIRFTempCurve; // curve index for charging energy input ratio modifier curve
200 : // (function of entering wetbulb, outside drybulb, state of TES)
201 : int CoolingAndChargeChargingEIRFTempObjectNum;
202 : int CoolingAndChargeChargingEIRFFLowCurve; // curve index for charging energy input ratio modifier curve
203 : // (function of actual supply air flow vs rated air flow)
204 : int CoolingAndChargeChargingEIRFFLowObjectNum;
205 : int CoolingAndChargeChargingPLFFPLRCurve; // curve index for chargine part-load fact vs part load ratio, EIR modif
206 : // (function of evaporator part load)
207 : int CoolingAndChargeChargingPLFFPLRObjectNum;
208 : int CoolingAndChargeSHRFTempCurve; // curve index for sensible heat ratio modifier curve
209 : // (function of entering wetbulb and drybulb)
210 : int CoolingAndChargeSHRFFlowCurve; // curve index for sensible heat ratio modifer curve
211 : // (function of actual supply air flow vs rated air flow)
212 : int CoolingAndChargeSHRFFlowObjectNum;
213 : // cooling and discharge mode
214 : bool CoolingAndDischargeModeAvailable;
215 : Real64 CoolingAndDischargeRatedTotCap; // gross total evaporator cooling capacity at rating conditions [W]
216 : Real64 CoolingAndDischargeRatedTotCapSizingFactor; // sizing factor gross total cooling capacity []
217 : Real64 CoolingAndDischargeRatedDischargeCap; // net storage discharging capacity at rating conditions [W]
218 : Real64 CoolingAndDischargeRatedDischargeCapSizingFactor; // sizing factor discharging capacity []
219 : Real64 CoolingAndDischargeRatedSHR; // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
220 : Real64 CoolingAndDischargeCoolingRatedCOP; // Coefficient of performance at rating conditions, for cooling [W/W]
221 : Real64 CoolingAndDischargeDischargingRatedCOP; // Coefficient of performance at rating conditions, for charging [W/W]
222 : int CoolingAndDischargeCoolingCapFTempCurve; // curve index for total cooling capacity modifier curve
223 : // (function of entering wetbulb, outside drybulb, state of TES)
224 : int CoolingAndDischargeCoolingCapFTempObjectNum;
225 : int CoolingAndDischargeCoolingCapFFlowCurve; // curve index for total cooling capacity modifier curve
226 : // (function of actual supply air flow vs rated air flow)
227 : int CoolingAndDischargeCoolingCapFFlowObjectNum;
228 : int CoolingAndDischargeCoolingEIRFTempCurve; // curve index for cooling energy input ratio modifier curve
229 : // (function of entering wetbulb, outside drybulb, state of TES)
230 : int CoolingAndDischargeCoolingEIRFTempObjectNum;
231 : int CoolingAndDischargeCoolingEIRFFlowCurve; // curve index for cooling energy input ratio modifier curve
232 : // (function of actual supply air flow vs rated air flow)
233 : int CoolingAndDischargeCoolingEIRFFlowObjectNum;
234 : int CoolingAndDischargeCoolingPLFFPLRCurve; // curve index for cooling part-load fact vs part load ratio,
235 : // EIR modifier (function of evaporator part load)
236 : int CoolingAndDischargeCoolingPLFFPLRObjectNum;
237 : int CoolingAndDischargeDischargingCapFTempCurve; // curve index for discharging capacity modifier curve
238 : // (function of entering wetbulb, outside drybulb, state of TES)
239 : int CoolingAndDischargeDischargingCapFTempObjectNum;
240 : int CoolingAndDischargeDischargingCapFFlowCurve; // curve index for discharging capacity modifier curve
241 : // (function of actual supply air flow vs rated air flow)
242 : int CoolingAndDischargeDischargingCapFFlowObjectNum;
243 : int CoolingAndDischargeDischargingCapFEvapPLRCurve; // curve index for discharging capacity modifier curve
244 : // function of evaporator part load ratio
245 : int CoolingAndDischargeDischargingCapFEvapPLRObjectNum;
246 : int CoolingAndDischargeDischargingEIRFTempCurve; // curve index for discharging energy input ratio modifier curve
247 : // (function of entering wetbulb, outside drybulb, state of TES)
248 : int CoolingAndDischargeDischargingEIRFTempObjectNum;
249 : int CoolingAndDischargeDischargingEIRFFLowCurve; // curve index for discharging energy input ratio modifier curve
250 : // (function of actual supply air flow vs rated air flow)
251 : int CoolingAndDischargeDischargingEIRFFLowObjectNum;
252 : int CoolingAndDischargeDischargingPLFFPLRCurve; // curve index for discharging part-load fact vs part load ratio
253 : // EIR modifier (function of evaporator part load)
254 : int CoolingAndDischargeDischargingPLFFPLRObjectNum;
255 : int CoolingAndDischargeSHRFTempCurve; // curve index for sensible heat ratio modifier curve
256 : // (function of entering wetbulb and drybulb)
257 : int CoolingAndDischargeSHRFTempObjectNum;
258 : int CoolingAndDischargeSHRFFlowCurve; // curve index for sensible heat ratio modifer curve
259 : // (function of actual supply air flow vs rated air flow)
260 : int CoolingAndDischargeSHRFFlowObjectNum;
261 : // Charge Only Mode
262 : bool ChargeOnlyModeAvailable;
263 : Real64 ChargeOnlyRatedCapacity; // net storage charging capacity at rating conditions [W]
264 : Real64 ChargeOnlyRatedCapacitySizingFactor; // sizing factor for charging capacity []
265 : Real64 ChargeOnlyRatedCOP; // coefficient of performance at rating conditions [W/W]
266 : int ChargeOnlyChargingCapFTempCurve; // curve index for charging capacity modifier curve
267 : // function of outside drybulb and state of TES
268 : int ChargeOnlyChargingCapFTempObjectNum;
269 : int ChargeOnlyChargingEIRFTempCurve; // curve index for charging energy input ratio modifier curve
270 : // function of outside drybulb and state of TES
271 : int ChargeOnlyChargingEIRFTempObjectNum;
272 : // Discharge Only mode
273 : bool DischargeOnlyModeAvailable;
274 : Real64 DischargeOnlyRatedDischargeCap; // gross total evaporator cooling capacity at rating conditions [W]
275 : Real64 DischargeOnlyRatedDischargeCapSizingFactor; // sizing factor for cooling capacity []
276 : Real64 DischargeOnlyRatedSHR; // sensible heat ratio (sens cap/total cap) at rating conditions
277 : Real64 DischargeOnlyRatedCOP; // coefficient of performance at rating conditions for discharging [W/W]
278 : int DischargeOnlyCapFTempCurve; // curve index for total cooling capacity modifier curve
279 : // function of entering wetbulb and state of TES
280 : int DischargeOnlyCapFTempObjectNum;
281 : int DischargeOnlyCapFFlowCurve; // curve index for tot cooling capacity modifier curve
282 : // (function of actual supply air flow vs rated air flow)
283 : int DischargeOnlyCapFFlowObjectNum;
284 : int DischargeOnlyEIRFTempCurve; // curve index for energy input ratio modifier curve
285 : // function of entering wetbulb and state of TES
286 : int DischargeOnlyEIRFTempObjectNum;
287 : int DischargeOnlyEIRFFlowCurve; // curve index for energy input ratio modifier curve
288 : // (function of actual supply air flow vs rated air flow)
289 : int DischargeOnlyEIRFFlowObjectNum;
290 : int DischargeOnlyPLFFPLRCurve; // curve index for part-load fact vs evaporator part load ratio
291 : int DischargeOnlyPLFFPLRObjectNum;
292 : int DischargeOnlySHRFTempCurve; // curve index for sensible heat ratio modifier curve
293 : // (function of entering wetbulb and drybulb)
294 : int DischargeOnlySHRFTempObjectNum;
295 : int DischargeOnlySHRFFLowCurve; // curve index for
296 : int DischargeOnlySHRFFLowObjectNum;
297 : // other inputs
298 : Real64 AncillaryControlsPower; // standby and controls electric power, draws when available [W]
299 : Real64 ColdWeatherMinimumTempLimit; // temperature limit for cold weather operation mode [C]
300 : Real64 ColdWeatherAncillaryPower; // electrical power draw during cold weather [W]
301 : int CondAirInletNodeNum; // Condenser air inlet node num pointer
302 : int CondAirOutletNodeNum; // condenser air outlet node num pointer
303 : TESCondenserType CondenserType = TESCondenserType::Air; // Type of condenser for DX cooling coil: AIR COOLED or EVAP COOLED
304 : Real64 CondenserAirVolumeFlow; // design air flow rate thru condenser [m3/s]
305 : Real64 CondenserAirFlowSizingFactor; // scale condenser air flow relative to evap air flow when autosizing
306 : Real64 CondenserAirMassFlow; // design air flow rate thru condenser [kg/s]
307 : Real64 EvapCondEffect; // effectiveness of the evaporatively cooled condenser
308 : Real64 CondInletTemp; // air temperature drybulb entering condenser section after evap cooling [C]
309 : Real64 EvapCondPumpElecNomPower; // Nominal power input to the evap condenser water circulation pump [W]
310 : Real64 EvapCondPumpElecEnergy; // Electric energy used by condenser water circulation pump [J]
311 : Real64 BasinHeaterPowerFTempDiff; // Basin heater power for evaporatively cooled condensers [W/K]
312 : int BasinHeaterAvailSchedNum; // basin heater availability schedule pointer num
313 : Real64 BasinHeaterSetpointTemp; // evap water basin temperature setpoint [C]
314 : EvapWaterSupply EvapWaterSupplyMode; // where does evap water come from
315 : std::string EvapWaterSupplyName; // name of water source e.g. water storage tank
316 : int EvapWaterSupTankID; // supply tank index, if any
317 : int EvapWaterTankDemandARRID; // evap water demand array index
318 : CondensateAction CondensateCollectMode; // where does condensate water go to
319 : std::string CondensateCollectName; // name of water source e.g. water storage tank
320 : int CondensateTankID;
321 : int CondensateTankSupplyARRID;
322 : // TES tank
323 : MediaType StorageMedia; // water/fluid or ice based TES
324 : std::string StorageFluidName; // if user defined, name of fluid type
325 : int StorageFluidIndex; // if user defined, index of fluid type
326 : Real64 FluidStorageVolume; // volume of water in storage tank for water systems [m3/s]
327 : Real64 IceStorageCapacity; // capacity of storage in J
328 : Real64 StorageCapacitySizingFactor; // storage time used to autocalculate capacity [hr]
329 : Real64 MinimumFluidTankTempLimit; // optional inputs [C]
330 : Real64 MaximumFluidTankTempLimit; // optional inputs [C]
331 : Real64 RatedFluidTankTemp; // rating point condition for fluid storage tanks [C]
332 : int StorageAmbientNodeNum; // node "pointer" for ambient conditions exposed to TES
333 : Real64 StorageUA; // overall heat transfer coefficient for TES to ambient [W/k]
334 : bool TESPlantConnectionAvailable;
335 : int TESPlantInletNodeNum; // plant loop inlet node index
336 : int TESPlantOutletNodeNum; // plant loop outlet node index
337 : int TESPlantLoopNum; // plant loop connection index
338 : DataPlant::LoopSideLocation TESPlantLoopSideNum; // plant loop side connection index
339 : int TESPlantBranchNum; // plant loop branch connection index
340 : int TESPlantCompNum; // plant loop component connection index
341 : Real64 TESPlantDesignVolumeFlowRate; // plant connection design mass flow rate [m3/s]
342 : Real64 TESPlantDesignMassFlowRate; // [kg/s]
343 : Real64 TESPlantEffectiveness;
344 : Real64 TimeElapsed;
345 : Real64 IceFracRemain; // state of storage for current time step [0..1.0]
346 : Real64 IceFracRemainLastTimestep; // state of storage for previous time step [0..1.0]
347 : Real64 FluidTankTempFinal;
348 : Real64 FluidTankTempFinalLastTimestep;
349 : // dynamic calculated data
350 : Real64 QdotPlant; // heat exchange rate for plant connection to TES tank [W]
351 : Real64 Q_Plant; // heat exchange energy for plant connection to TES tank [J]
352 : Real64 QdotAmbient; // heat exchange rate for skin losses/gains for TES tank to surroundings [W]
353 : Real64 Q_Ambient; // heat exchange enegy for skin losses/gains for TES tank to surroundings [J]
354 : Real64 QdotTES; // heat exchange rate by mechanical systems to charge or discharge TES [W]
355 : Real64 Q_TES; // heat exchange energy by mechanical systems to charge or discharge TES [J]
356 : Real64 ElecCoolingPower; // electric power for cooling [W]
357 : Real64 ElecCoolingEnergy; // electric energy for cooling [J], metered
358 : Real64 EvapTotCoolingRate; // evaporator coil total cooling rate [W]
359 : Real64 EvapTotCoolingEnergy; // evaporatory coil total cooling energy [J], metered
360 : Real64 EvapSensCoolingRate;
361 : Real64 EvapSensCoolingEnergy;
362 : Real64 EvapLatCoolingRate;
363 : Real64 EvapLatCoolingEnergy;
364 : Real64 RuntimeFraction;
365 : Real64 CondenserRuntimeFraction;
366 : Real64 ElectColdWeatherPower; // electric power for cold weather protection [W]
367 : Real64 ElectColdWeatherEnergy; // electric energy for cold weather protection [J], metered
368 : Real64 ElectEvapCondBasinHeaterPower;
369 : Real64 ElectEvapCondBasinHeaterEnergy;
370 : Real64 EvapWaterConsumpRate; // Evap Water Consumption rate in m3/sec
371 : Real64 EvapWaterConsump; // Evap Water Consumption in m3
372 : Real64 EvapWaterStarvMakupRate; // Evap water consumed but not really available from tank m3/s
373 : Real64 EvapWaterStarvMakup; // Evap water consumed but not really available from tank m3
374 : Real64 EvapCondPumpElecPower;
375 : Real64 EvapCondPumpElecConsumption;
376 :
377 : // Default Constructor
378 1 : PackagedTESCoolingCoilStruct()
379 2 : : AvailSchedNum(0), ModeControlType(PTSCCtrlType::Invalid), ControlModeSchedNum(0), EMSControlModeOn(false), EMSControlModeValue(0.0),
380 1 : ControlModeErrorIndex(0), RatedEvapAirVolFlowRate(0.0), RatedEvapAirMassFlowRate(0.0), EvapAirInletNodeNum(0), EvapAirOutletNodeNum(0),
381 1 : CoolingOnlyModeIsAvailable(false), CoolingOnlyRatedTotCap(0.0), CoolingOnlyRatedSHR(0.0), CoolingOnlyRatedCOP(0.0),
382 1 : CoolingOnlyCapFTempCurve(0), CoolingOnlyCapFTempObjectNum(0), CoolingOnlyCapFFlowCurve(0), CoolingOnlyCapFFlowObjectNum(0),
383 1 : CoolingOnlyEIRFTempCurve(0), CoolingOnlyEIRFTempObjectNum(0), CoolingOnlyEIRFFlowCurve(0), CoolingOnlyEIRFFlowObjectNum(0),
384 1 : CoolingOnlyPLFFPLRCurve(0), CoolingOnlyPLFFPLRObjectNum(0), CoolingOnlySHRFTempCurve(0), CoolingOnlySHRFTempObjectNum(0),
385 1 : CoolingOnlySHRFFlowCurve(0), CoolingOnlySHRFFlowObjectNum(0), CoolingAndChargeModeAvailable(false), CoolingAndChargeRatedTotCap(0.0),
386 1 : CoolingAndChargeRatedTotCapSizingFactor(0.0), CoolingAndChargeRatedChargeCap(0.0), CoolingAndChargeRatedChargeCapSizingFactor(0.0),
387 1 : CoolingAndChargeRatedSHR(0.0), CoolingAndChargeCoolingRatedCOP(0.0), CoolingAndChargeChargingRatedCOP(0.0),
388 1 : CoolingAndChargeCoolingCapFTempCurve(0), CoolingAndChargeCoolingCapFTempObjectNum(0), CoolingAndChargeCoolingCapFFlowCurve(0),
389 1 : CoolingAndChargeCoolingCapFFlowObjectNum(0), CoolingAndChargeCoolingEIRFTempCurve(0), CoolingAndChargeCoolingEIRFTempObjectNum(0),
390 1 : CoolingAndChargeCoolingEIRFFlowCurve(0), CoolingAndChargeCoolingEIRFFlowObjectNum(0), CoolingAndChargeCoolingPLFFPLRCurve(0),
391 1 : CoolingAndChargeCoolingPLFFPLRObjectNum(0), CoolingAndChargeChargingCapFTempCurve(0), CoolingAndChargeChargingCapFTempObjectNum(0),
392 1 : CoolingAndChargeChargingCapFEvapPLRCurve(0), CoolingAndChargeChargingCapFEvapPLRObjectNum(0), CoolingAndChargeChargingEIRFTempCurve(0),
393 1 : CoolingAndChargeChargingEIRFTempObjectNum(0), CoolingAndChargeChargingEIRFFLowCurve(0), CoolingAndChargeChargingEIRFFLowObjectNum(0),
394 1 : CoolingAndChargeChargingPLFFPLRCurve(0), CoolingAndChargeChargingPLFFPLRObjectNum(0), CoolingAndChargeSHRFTempCurve(0),
395 1 : CoolingAndChargeSHRFFlowCurve(0), CoolingAndChargeSHRFFlowObjectNum(0), CoolingAndDischargeModeAvailable(false),
396 1 : CoolingAndDischargeRatedTotCap(0.0), CoolingAndDischargeRatedTotCapSizingFactor(0.0), CoolingAndDischargeRatedDischargeCap(0.0),
397 1 : CoolingAndDischargeRatedDischargeCapSizingFactor(0.0), CoolingAndDischargeRatedSHR(0.0), CoolingAndDischargeCoolingRatedCOP(0.0),
398 1 : CoolingAndDischargeDischargingRatedCOP(0.0), CoolingAndDischargeCoolingCapFTempCurve(0), CoolingAndDischargeCoolingCapFTempObjectNum(0),
399 1 : CoolingAndDischargeCoolingCapFFlowCurve(0), CoolingAndDischargeCoolingCapFFlowObjectNum(0), CoolingAndDischargeCoolingEIRFTempCurve(0),
400 1 : CoolingAndDischargeCoolingEIRFTempObjectNum(0), CoolingAndDischargeCoolingEIRFFlowCurve(0),
401 1 : CoolingAndDischargeCoolingEIRFFlowObjectNum(0), CoolingAndDischargeCoolingPLFFPLRCurve(0),
402 1 : CoolingAndDischargeCoolingPLFFPLRObjectNum(0), CoolingAndDischargeDischargingCapFTempCurve(0),
403 1 : CoolingAndDischargeDischargingCapFTempObjectNum(0), CoolingAndDischargeDischargingCapFFlowCurve(0),
404 1 : CoolingAndDischargeDischargingCapFFlowObjectNum(0), CoolingAndDischargeDischargingCapFEvapPLRCurve(0),
405 1 : CoolingAndDischargeDischargingCapFEvapPLRObjectNum(0), CoolingAndDischargeDischargingEIRFTempCurve(0),
406 1 : CoolingAndDischargeDischargingEIRFTempObjectNum(0), CoolingAndDischargeDischargingEIRFFLowCurve(0),
407 1 : CoolingAndDischargeDischargingEIRFFLowObjectNum(0), CoolingAndDischargeDischargingPLFFPLRCurve(0),
408 1 : CoolingAndDischargeDischargingPLFFPLRObjectNum(0), CoolingAndDischargeSHRFTempCurve(0), CoolingAndDischargeSHRFTempObjectNum(0),
409 1 : CoolingAndDischargeSHRFFlowCurve(0), CoolingAndDischargeSHRFFlowObjectNum(0), ChargeOnlyModeAvailable(false),
410 1 : ChargeOnlyRatedCapacity(0.0), ChargeOnlyRatedCapacitySizingFactor(0.0), ChargeOnlyRatedCOP(0.0), ChargeOnlyChargingCapFTempCurve(0),
411 1 : ChargeOnlyChargingCapFTempObjectNum(0), ChargeOnlyChargingEIRFTempCurve(0), ChargeOnlyChargingEIRFTempObjectNum(0),
412 1 : DischargeOnlyModeAvailable(false), DischargeOnlyRatedDischargeCap(0.0), DischargeOnlyRatedDischargeCapSizingFactor(0.0),
413 1 : DischargeOnlyRatedSHR(0.0), DischargeOnlyRatedCOP(0.0), DischargeOnlyCapFTempCurve(0), DischargeOnlyCapFTempObjectNum(0),
414 1 : DischargeOnlyCapFFlowCurve(0), DischargeOnlyCapFFlowObjectNum(0), DischargeOnlyEIRFTempCurve(0), DischargeOnlyEIRFTempObjectNum(0),
415 1 : DischargeOnlyEIRFFlowCurve(0), DischargeOnlyEIRFFlowObjectNum(0), DischargeOnlyPLFFPLRCurve(0), DischargeOnlyPLFFPLRObjectNum(0),
416 1 : DischargeOnlySHRFTempCurve(0), DischargeOnlySHRFTempObjectNum(0), DischargeOnlySHRFFLowCurve(0), DischargeOnlySHRFFLowObjectNum(0),
417 1 : AncillaryControlsPower(0.0), ColdWeatherMinimumTempLimit(0.0), ColdWeatherAncillaryPower(0.0), CondAirInletNodeNum(0),
418 1 : CondAirOutletNodeNum(0), CondenserAirVolumeFlow(0.0), CondenserAirFlowSizingFactor(0.0), CondenserAirMassFlow(0.0), EvapCondEffect(0.0),
419 1 : CondInletTemp(0.0), EvapCondPumpElecNomPower(0.0), EvapCondPumpElecEnergy(0.0), BasinHeaterPowerFTempDiff(0.0),
420 1 : BasinHeaterAvailSchedNum(0), BasinHeaterSetpointTemp(0.0), EvapWaterSupplyMode(EvapWaterSupply::WaterSupplyFromMains),
421 2 : EvapWaterSupTankID(0), EvapWaterTankDemandARRID(0), CondensateCollectMode(CondensateAction::Discard), CondensateTankID(0),
422 2 : CondensateTankSupplyARRID(0), StorageMedia(MediaType::Invalid), StorageFluidIndex(0), FluidStorageVolume(0.0), IceStorageCapacity(0.0),
423 1 : StorageCapacitySizingFactor(0.0), MinimumFluidTankTempLimit(0.0), MaximumFluidTankTempLimit(100.0), RatedFluidTankTemp(0.0),
424 1 : StorageAmbientNodeNum(0), StorageUA(0.0), TESPlantConnectionAvailable(false), TESPlantInletNodeNum(0), TESPlantOutletNodeNum(0),
425 1 : TESPlantLoopNum(0), TESPlantLoopSideNum(DataPlant::LoopSideLocation::Invalid), TESPlantBranchNum(0), TESPlantCompNum(0),
426 1 : TESPlantDesignVolumeFlowRate(0.0), TESPlantDesignMassFlowRate(0.0), TESPlantEffectiveness(0.0), TimeElapsed(0.0), IceFracRemain(0.0),
427 1 : IceFracRemainLastTimestep(0.0), FluidTankTempFinal(0.0), FluidTankTempFinalLastTimestep(0.0), QdotPlant(0.0), Q_Plant(0.0),
428 1 : QdotAmbient(0.0), Q_Ambient(0.0), QdotTES(0.0), Q_TES(0.0), ElecCoolingPower(0.0), ElecCoolingEnergy(0.0), EvapTotCoolingRate(0.0),
429 1 : EvapTotCoolingEnergy(0.0), EvapSensCoolingRate(0.0), EvapSensCoolingEnergy(0.0), EvapLatCoolingRate(0.0), EvapLatCoolingEnergy(0.0),
430 1 : RuntimeFraction(0.0), CondenserRuntimeFraction(0.0), ElectColdWeatherPower(0.0), ElectColdWeatherEnergy(0.0),
431 1 : ElectEvapCondBasinHeaterPower(0.0), ElectEvapCondBasinHeaterEnergy(0.0), EvapWaterConsumpRate(0.0), EvapWaterConsump(0.0),
432 1 : EvapWaterStarvMakupRate(0.0), EvapWaterStarvMakup(0.0), EvapCondPumpElecPower(0.0), EvapCondPumpElecConsumption(0.0)
433 : {
434 1 : }
435 : };
436 :
437 : void SimTESCoil(EnergyPlusData &state,
438 : std::string_view CompName, // name of the fan coil unit
439 : int &CompIndex,
440 : HVAC::FanOp const fanOp, // allows parent object to control fan mode
441 : PTSCOperatingMode &TESOpMode,
442 : ObjexxFCL::Optional<Real64 const> PartLoadRatio = _ // part load ratio (for single speed cycling unit)
443 : );
444 :
445 : void GetTESCoilInput(EnergyPlusData &state);
446 :
447 : void InitTESCoil(EnergyPlusData &state, int &TESCoilNum);
448 :
449 : void SizeTESCoil(EnergyPlusData &state, int &TESCoilNum);
450 :
451 : void CalcTESCoilOffMode(EnergyPlusData &state, int const TESCoilNum);
452 :
453 : void CalcTESCoilCoolingOnlyMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
454 :
455 : void CalcTESCoilCoolingAndChargeMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
456 :
457 : void CalcTESCoilCoolingAndDischargeMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
458 :
459 : void CalcTESCoilChargeOnlyMode(EnergyPlusData &state, int const TESCoilNum);
460 :
461 : void CalcTESCoilDischargeOnlyMode(EnergyPlusData &state, int const TESCoilNum, Real64 const PartLoadRatio);
462 :
463 : void UpdateTEStorage(EnergyPlusData &state, int const TESCoilNum);
464 :
465 : void CalcTESWaterStorageTank(EnergyPlusData &state, int const TESCoilNum);
466 :
467 : void CalcTESIceStorageTank(EnergyPlusData &state, int const TESCoilNum);
468 :
469 : void UpdateColdWeatherProtection(EnergyPlusData &state, int const TESCoilNum);
470 :
471 : void UpdateEvaporativeCondenserBasinHeater(EnergyPlusData &state, int const TESCoilNum);
472 :
473 : void UpdateEvaporativeCondenserWaterUse(EnergyPlusData &state, int const TESCoilNum, Real64 const HumRatAfterEvap, int const InletNodeNum);
474 :
475 : void GetTESCoilIndex(
476 : EnergyPlusData &state, std::string const &CoilName, int &CoilIndex, bool &ErrorsFound, std::string_view const CurrentModuleObject = {});
477 :
478 : void GetTESCoilAirInletNode(
479 : EnergyPlusData &state, std::string const &CoilName, int &CoilAirInletNode, bool &ErrorsFound, std::string const &CurrentModuleObject);
480 :
481 : void GetTESCoilAirOutletNode(
482 : EnergyPlusData &state, std::string const &CoilName, int &CoilAirOutletNode, bool &ErrorsFound, std::string const &CurrentModuleObject);
483 :
484 : void GetTESCoilCoolingCapacity(
485 : EnergyPlusData &state, std::string const &CoilName, Real64 &CoilCoolCapacity, bool &ErrorsFound, std::string const &CurrentModuleObject);
486 :
487 : void GetTESCoilCoolingAirFlowRate(
488 : EnergyPlusData &state, std::string const &CoilName, Real64 &CoilCoolAirFlow, bool &ErrorsFound, std::string const &CurrentModuleObject);
489 :
490 : } // namespace PackagedThermalStorageCoil
491 :
492 : struct PackagedThermalStorageCoilData : BaseGlobalStruct
493 : {
494 :
495 : int NumTESCoils = 0;
496 : Array1D_bool CheckEquipName;
497 : bool GetTESInputFlag = true;
498 : bool MyOneTimeFlag = true;
499 : Array1D<PackagedThermalStorageCoil::PackagedTESCoolingCoilStruct> TESCoil;
500 : Array1D_bool MyFlag; // One time environment flag
501 : Array1D_bool MySizeFlag; // One time sizing flag
502 : Array1D_bool MyEnvrnFlag; // flag for init once at start of environment
503 : Array1D_bool MyWarmupFlag; // flag for init after warmup complete
504 :
505 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
506 : {
507 796 : }
508 :
509 0 : void clear_state() override
510 : {
511 0 : this->NumTESCoils = 0;
512 0 : this->CheckEquipName.deallocate();
513 0 : this->GetTESInputFlag = true;
514 0 : this->MyOneTimeFlag = true;
515 0 : this->TESCoil.deallocate();
516 0 : this->MyFlag.clear();
517 0 : this->MySizeFlag.clear();
518 0 : this->MyEnvrnFlag.clear();
519 0 : this->MyWarmupFlag.clear();
520 0 : }
521 : };
522 :
523 : } // namespace EnergyPlus
524 :
525 : #endif
|