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