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 DXCoils_hh_INCLUDED
49 : #define DXCoils_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/DataEnvironment.hh>
58 : #include <EnergyPlus/DataGlobals.hh>
59 : #include <EnergyPlus/DataHVACGlobals.hh>
60 : #include <EnergyPlus/DataHeatBalance.hh>
61 : #include <EnergyPlus/EnergyPlus.hh>
62 : #include <EnergyPlus/StandardRatings.hh>
63 :
64 : namespace EnergyPlus {
65 :
66 : // Forward declarations
67 : struct EnergyPlusData;
68 :
69 : namespace DXCoils {
70 :
71 : // Using/Aliasing
72 : using DataHVACGlobals::DryBulbIndicator;
73 :
74 : constexpr Real64 RatedInletAirTemp(26.6667); // 26.6667C or 80F
75 : constexpr Real64 RatedInletWetBulbTemp(19.4444); // 19.44 or 67F
76 : constexpr Real64 RatedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
77 : constexpr Real64 RatedOutdoorAirTemp(35.0); // 35 C or 95F
78 : constexpr Real64 RatedInletAirTempHeat(21.1111); // 21.11C or 70F
79 : constexpr Real64 RatedOutdoorAirTempHeat(8.3333); // 8.33 C or 47F
80 : constexpr Real64 RatedOutdoorWetBulbTempHeat(6.1111); // 6.11 C or 43F
81 : constexpr Real64 RatedInletWetBulbTempHeat(15.5556); // 15.55 or 60F
82 : constexpr Real64 DryCoilOutletHumRatioMin(0.00001); // dry coil outlet minimum hum ratio kgWater/kgDryAir
83 :
84 : // Multimode DX Coil
85 : constexpr int MaxCapacityStages(2); // Maximum number of capacity stages supported
86 : constexpr int MaxDehumidModes(1); // Maximum number of enhanced dehumidification modes supported
87 : constexpr int MaxModes(MaxCapacityStages *(MaxDehumidModes + 1)); // Maximum number of performance modes
88 :
89 : // Water Systems
90 : enum class CondensateCollectAction
91 : {
92 : Invalid = -1,
93 : Discard, // default mode where water is "lost"
94 : ToTank, // collect coil condensate from air and store in water storage tank
95 : Num
96 : };
97 :
98 : enum class EvapWaterSupply
99 : {
100 : Invalid = -1,
101 : FromMains,
102 : FromTank,
103 : Num
104 : };
105 :
106 : // Types
107 :
108 2145 : struct DXCoilData
109 : {
110 : // Members
111 : // Some variables in this type are arrays (dimension=MaxModes) to support coil type
112 : // COIL:DX:MultiMode:CoolingEmpirical. Other coil types only use the first element.
113 : std::string Name; // Name of the DX Coil
114 : std::string DXCoilType; // type of coil
115 : int DXCoilType_Num; // Integer equivalent to DXCoilType
116 : std::string Schedule; // WaterCoil Operation Schedule
117 : int SchedPtr; // Pointer to the correct schedule
118 : // RatedCoolCap, RatedSHR and RatedCOP do not include the thermal or electrical
119 : // effects due to the supply air fan
120 : Array1D<Real64> RatedTotCap; // Gross total cooling capacity at rated conditions [watts]
121 : Real64 HeatSizeRatio; // heat pump heating to cooling sizing ratio when autosized
122 : Array1D_bool RatedTotCapEMSOverrideOn; // if true, then EMS is calling to override rated total capacity
123 : Array1D<Real64> RatedTotCapEMSOverrideValue; // value to use for EMS override
124 : Array1D<Real64> RatedSHR; // Sensible heat ratio (sens cap/total cap) at rated conditions
125 : Array1D_bool RatedSHREMSOverrideOn; // if true, then EMS is calling to override Sensible heat ratio
126 : Array1D<Real64> RatedSHREMSOverrideValue; // value to use for EMS override forSensible heat ratio
127 : Array1D<Real64> RatedCOP; // Coefficient of performance at rated conditions
128 : Array1D<Real64> RatedAirVolFlowRate; // Air volume flow rate through coil at rated conditions [m3/s]
129 : // This is adjusted for bypassed air if any (see BypassedFlowFrac)
130 : Array1D_bool RatedAirVolFlowRateEMSOverrideON; // if true, then EMS is calling to override Air volume flow rate
131 : Array1D<Real64> RatedAirVolFlowRateEMSOverrideValue; // value to use for EMS override Air volume flow rate
132 : Array1D<Real64> FanPowerPerEvapAirFlowRate; // Fan Power Per Air volume flow rate through the
133 : // Evaporator coil at rated conditions [W/(m3/s)]
134 : Array1D<Real64> FanPowerPerEvapAirFlowRate_2023;
135 : Array1D<Real64> RatedAirMassFlowRate; // Air mass flow rate through coil at rated conditions [kg/s]
136 : // This is adjusted for bypassed air if any (see BypassedFlowFrac)
137 : Array1D<Real64> BypassedFlowFrac; // Fraction of air flow bypassed around coil
138 : Array1D<Real64> RatedCBF; // rated coil bypass factor, determined using RatedTotCap and RatedSHR
139 : int AirInNode; // Air inlet node number
140 : int AirOutNode; // Air outlet node number
141 : Array1D_int CCapFTemp; // index of total cooling capacity modifier curve
142 : // (function of entering wetbulb, outside drybulb)
143 : int CCapFTempErrorIndex; // Used for warning messages when output of CCapFTemp is negative
144 : Array1D_int CCapFFlow; // index of total cooling capacity modifier curve
145 : // (function of actual supply air flow vs rated air flow)
146 : int CCapFFlowErrorIndex; // Used for warning messages when output of CCapFFlow is negative
147 : Array1D_int EIRFTemp; // index of energy input ratio modifier curve
148 : // (function of entering wetbulb, outside drybulb)
149 : int EIRFTempErrorIndex; // Used for warning messages when output of EIRFTemp is negative
150 : Array1D_int EIRFFlow; // index of energy input ratio modifier curve
151 : // (function of actual supply air flow vs rated air flow)
152 : int EIRFFlowErrorIndex; // Used for warning messages when output of EIRFFlow is negative
153 : Array1D_int PLFFPLR; // index of part-load factor vs part-load ratio curve
154 : bool ReportCoolingCoilCrankcasePower; // logical determines if the cooling coil crankcase heater power is reported
155 : Real64 CrankcaseHeaterCapacity; // total crankcase heater capacity [W]
156 : Real64 CrankcaseHeaterPower; // report variable for average crankcase heater power [W]
157 : Real64 MaxOATCrankcaseHeater; // maximum OAT for crankcase heater operation [C]
158 : Real64 CrankcaseHeaterConsumption; // report variable for total crankcase heater energy consumption [J]
159 : Real64 BasinHeaterPowerFTempDiff; // Basin heater capacity per degree C below setpoint (W/C)
160 : Real64 BasinHeaterSetPointTemp; // setpoint temperature for basin heater operation (C)
161 : int CompanionUpstreamDXCoil; // index number of the DX coil that is "upstream" of this DX coil. Currently used for
162 : // UnitarySystem:HeatPump:AirToAir for proper calculation of crankcase heater energy
163 : // consumption
164 : bool FindCompanionUpStreamCoil; // Flag to get the companion coil in Init.
165 : Array1D_int CondenserInletNodeNum; // Node number of outdoor condenser(s) (actually an evaporator for heating coils)
166 : int LowOutletTempIndex; // used for low outlet temperature warnings
167 : Real64 FullLoadOutAirTempLast; // used for low outlet temperature warnings
168 : Real64 FullLoadInletAirTempLast; // used for low outlet temperature warnings
169 : bool PrintLowOutTempMessage; // used to print warning message for low outlet air dry-bulb conditions
170 : std::string LowOutTempBuffer1; // holds warning message until next iteration (only prints 1 message/iteration)
171 : std::string LowOutTempBuffer2; // holds warning message until next iteration (only prints 1 message/iteration)
172 : int HeatingCoilPLFCurvePTR; // PLF curve index to gas or electric heating coil (used in latent degradation model)
173 : int BasinHeaterSchedulePtr; // Pointer to basin heater schedule
174 : // start of multi-speed compressor variables
175 : Real64 RatedTotCap2; // Gross total cooling capacity at rated conditions, low speed [watts]
176 : // Note: For HPWHs, RatedTotCap2 = Water Heating Capacity for Coil:DX:HPWH and
177 : // RatedTotCap(1) = Air Cooling Coil Capacity for Coil:DX:HPWH
178 : Real64 RatedSHR2; // Sensible heat ratio (sens cap/total cap) at rated conditions, low speed
179 : Real64 RatedCOP2; // Coefficient of performance at rated conditions, low speed
180 : Real64 RatedAirVolFlowRate2; // Air volume flow rate through unit at rated conditions, low speed [m3/s]
181 : Real64 RatedAirMassFlowRate2; // Air mass flow rate through unit at rated conditions, low speed [kg/s]
182 : Real64 RatedCBF2; // rated coil bypass factor (low speed), determined using RatedTotCap2 and RatedSHR2
183 : int CCapFTemp2; // index of total cooling capacity modifier curve (low speed)
184 : int EIRFTemp2; // index of energy input ratio modifier curve (low speed)
185 : // (function of entering wetbulb, outside drybulb)
186 : Real64 RatedEIR2; // rated energy input ratio (low speed, inverse of COP2)
187 : Real64 InternalStaticPressureDrop; // for rating VAV system
188 : bool RateWithInternalStaticAndFanObject;
189 : int SupplyFanIndex; // index of this fan in fan array or vector
190 : int SupplyFan_TypeNum; // type of fan, in DataHVACGlobals
191 : std::string SupplyFanName; // name of fan associated with this dx coil
192 : std::string CoilSystemName;
193 : // end of multi-speed compressor variables
194 : Array1D<Real64> RatedEIR; // rated energy input ratio (inverse of COP)
195 : Real64 InletAirMassFlowRate;
196 : Real64 InletAirMassFlowRateMax;
197 : Real64 InletAirTemp;
198 : Real64 InletAirHumRat;
199 : Real64 InletAirEnthalpy;
200 : // Eventually inlet air conditions will be used in DX Coil, these lines are commented out and marked with this comment line
201 : // REAL(r64) :: InletAirPressure =0.0d0
202 : Real64 OutletAirTemp;
203 : Real64 OutletAirHumRat;
204 : Real64 OutletAirEnthalpy;
205 : Real64 PartLoadRatio; // Ratio of actual sensible cooling load to steady-state sensible cooling capacity
206 : Real64 TotalCoolingEnergy;
207 : Real64 SensCoolingEnergy;
208 : Real64 LatCoolingEnergy;
209 : Real64 TotalCoolingEnergyRate;
210 : Real64 SensCoolingEnergyRate;
211 : Real64 LatCoolingEnergyRate;
212 : Real64 ElecCoolingConsumption;
213 : Real64 ElecCoolingPower;
214 : Real64 CoolingCoilRuntimeFraction; // Run time fraction of the DX cooling unit
215 : // start of variables used in heat pump heating coils only
216 : Real64 TotalHeatingEnergy;
217 : Real64 TotalHeatingEnergyRate;
218 : Real64 ElecHeatingConsumption;
219 : Real64 ElecHeatingPower;
220 : Real64 HeatingCoilRuntimeFraction; // Run time fraction of the DX heating unit
221 : StandardRatings::DefrostStrat DefrostStrategy; // defrost strategy; 1=reverse-cycle, 2=resistive
222 : StandardRatings::HPdefrostControl DefrostControl; // defrost control; 1=timed, 2=on-demand
223 : int EIRFPLR; // index of energy input ratio vs part-load ratio curve
224 : int DefrostEIRFT; // index of defrost mode total cooling capacity for reverse cycle heat pump
225 : int RegionNum; // Region number for calculating HSPF of single speed DX heating coil
226 : Real64 MinOATCompressor; // Minimum OAT for heat pump compressor operation
227 : Real64 OATempCompressorOn; // The outdoor tempearture when the compressor is automatically turned back on,
228 : // if applicable, following automatic shut off. This field is used only for
229 : // HSPF calculation.
230 : Real64 MaxOATCompressor; // Maximum OAT for VRF heat pump compressor operation
231 : Real64 MaxOATDefrost; // Maximum OAT for defrost operation
232 : Real64 DefrostTime; // Defrost time period in hours
233 : Real64 DefrostCapacity; // Resistive defrost to nominal capacity (at 21.11C/8.33C) ratio
234 : Real64 HPCompressorRuntime; // keep track of compressor runtime
235 : Real64 HPCompressorRuntimeLast; // keep track of last time step compressor runtime (if simulation downshifts)
236 : Real64 TimeLeftToDefrost; // keep track of time left to defrost heat pump
237 : Real64 DefrostPower; // power used during defrost
238 : Real64 DefrostConsumption; // energy used during defrost
239 : int HeatingPerformanceOATType; // Heating performance curve OAT type (1-wetbulb, 2-drybulb)
240 : bool HPCoilIsInCoilSystemHeatingDX;
241 : bool OATempCompressorOnOffBlank;
242 : // end of variables used in heat pump heating coils only
243 : // start of variables for DX cooling coil latent degradation model
244 : Array1D<Real64> Twet_Rated; // Nominal time for condensate to begin leaving the coil's
245 : // condensate drain line (sec)
246 : Array1D<Real64> Gamma_Rated; // Initial moisture evaporation rate divided by steady-state
247 : // AC latent capacity (dimensionless)
248 : Array1D<Real64> MaxONOFFCyclesperHour; // Maximum ON/OFF cycles per hour for the compressor (cycles/hour)
249 : Array1D<Real64> LatentCapacityTimeConstant; // Time constant for latent capacity to reach steady state
250 : // after startup (sec)
251 : // end of variables for DX cooling coil latent degradation model
252 : Array1D<DataHeatBalance::RefrigCondenserType> CondenserType; // Type of condenser for DX cooling coil: AIR COOLED or EVAP COOLED
253 : // start of variables for DX cooling coil evaporative condenser option
254 : bool ReportEvapCondVars; // true if any performance mode includes an evap condenser
255 : Array1D<Real64> EvapCondEffect; // effectiveness of the evaporatively cooled condenser
256 : // [high speed for multi-speed unit] (-)
257 : Real64 CondInletTemp; // Evap condenser inlet temperature [C], report variable
258 : Array1D<Real64> EvapCondAirFlow; // Air flow rate through the evap condenser at high speed,
259 : // for water use calcs [m3/s]
260 : Array1D<Real64> EvapCondPumpElecNomPower; // Nominal power input to the evap condenser water circulation pump
261 : // at high speed [W]
262 : Real64 EvapCondPumpElecPower; // Average power consumed by the evap condenser water circulation pump over
263 : // the time step [W]
264 : Real64 EvapCondPumpElecConsumption; // Electric energy consumed by the evap condenser water circulation pump [J]
265 : Real64 EvapWaterConsumpRate; // Evap condenser water consumption rate [m3/s]
266 : Real64 EvapWaterConsump; // Evap condenser water consumption [m3]
267 : Real64 EvapCondAirFlow2; // Air flow rate through the evap condenser at low speed, for water use calcs [m3/s]
268 : Real64 EvapCondEffect2; // effectiveness of the evaporatively cooled condenser at low speed (-)
269 : Real64 EvapCondPumpElecNomPower2; // Nominal power input to the evap condenser water circulation pump at low speed [W]
270 : Real64 BasinHeaterPower; // Basin heater power (W)
271 : Real64 BasinHeaterConsumption; // Basin heater energy consumption (J)
272 : // end of variables for DX cooling coil evaporative condenser option
273 : // start of variables for Multimode DX cooling coil
274 : int NumCapacityStages; // number of capacity stages, up to MaxCapacityStages for Multimode DX coil,
275 : // always 1 for other coils
276 : int NumDehumidModes; // number of enhanced dehumidification modes, up to MaxDehumidModes for Multimode DX coil,
277 : // always 0 for other coils)
278 : Array1D_string CoilPerformanceType; // Coil Performance object type
279 : Array1D_int CoilPerformanceType_Num; // Coil Performance object type number
280 : Array1D_string CoilPerformanceName; // Coil Performance object names
281 : Real64 CoolingCoilStg2RuntimeFrac; // Run time fraction of stage 2
282 : int DehumidificationMode; // Dehumidification mode for multimode coil,
283 : // 0=normal, 1+=enhanced dehumidification mode
284 : // end of variables for Multimode DX cooling coil
285 : // start of variables for heat pump water heater DX coil
286 : int WaterInNode; // Condenser water inlet node number for HPWH DX coil
287 : int WaterOutNode; // Condenser water outlet node number for HPWH DX coil
288 : int HCOPFTemp; // COP as a function of temperature curve index
289 : int HCOPFTempErrorIndex; // Used for warning messages when output of HCOPFTemp is negative
290 : int HCOPFAirFlow; // COP as a function of air flow rate ratio curve index
291 : int HCOPFAirFlowErrorIndex; // Used for warning messages when output of HCOPFAirFlow is negative
292 : int HCOPFWaterFlow; // COP as a function of water flow rate ratio curve index
293 : int HCOPFWaterFlowErrorIndex; // Used for warning messages when output of HCOPFWaterFlow is negative
294 : int HCapFTemp; // Heating capacity as a function of temperature curve index
295 : int HCapFTempErrorIndex; // Used for warning messages when output of HCapFTemp is negative
296 : int HCapFAirFlow; // Heating capacity as a function of air flow rate ratio curve index
297 : int HCapFAirFlowErrorIndex; // Used for warning messages when output of HCapFAirFlow is negative
298 : int HCapFWaterFlow; // Heating capacity as a function of water flow rate ratio curve index
299 : int HCapFWaterFlowErrorIndex; // Used for warning messages when output of HCapFWaterFlow is negative
300 : int InletAirTemperatureType; // Specifies to use either air wet-bulb or dry-bulb temp for curve objects
301 : Real64 RatedInletDBTemp; // Rated inlet air dry-bulb temperature [C]
302 : Real64 RatedInletWBTemp; // Rated inlet air wet-bulb temperature [C]
303 : Real64 RatedInletWaterTemp; // Rated condenser water inlet temperature [C]
304 : // REAL(r64) :: CondenserInletWaterTemp = 0.0d0 ! Actual inlet water temperature to condenser of the HPWH DX coil [C]
305 : Real64 HPWHCondPumpElecNomPower; // Nominal power input to the condenser water circulation pump [W]
306 : Real64 HPWHCondPumpFracToWater; // Nominal power fraction to water for the condenser water circulation pump
307 : Real64 RatedHPWHCondWaterFlow; // Rated water flow rate through the condenser of the HPWH DX coil [m3/s]
308 : Real64 ElecWaterHeatingPower; // Total electric power consumed by compressor and condenser pump [W]
309 : Real64 ElecWaterHeatingConsumption; // Total electric consumption by compressor and condenser pump [J]
310 : bool FanPowerIncludedInCOP; // Indicates that fan heat is included in heating capacity and COP
311 : bool CondPumpHeatInCapacity; // Indicates that condenser pump heat is included in heating capacity
312 : bool CondPumpPowerInCOP; // Indicates that condenser pump power is included in heating COP
313 : // end of variables for heat pump water heater DX coil
314 : // Error tracking
315 : Real64 LowTempLast; // low ambient temp entering condenser when warning message occurred
316 : Real64 HighTempLast; // high ambient temp entering condenser when warning message occurred
317 : int ErrIndex1; // index/pointer to recurring error structure for Air volume flow rate per watt of
318 : // rated total cooling capacity error
319 : int ErrIndex2; // index/pointer to recurring error structure for PLF curve values must be >= 0.7. error
320 : int ErrIndex3; // index/pointer to recurring error structure for DX cooling coil runtime fraction > 1.0 warning
321 : int ErrIndex4; // index/pointer to recurring error structure for DX heating coil runtime fraction > 1.0 warning
322 : int LowAmbErrIndex; // index/pointer to recurring error structure for low ambient temp entering condenser
323 : int HighAmbErrIndex; // index/pointer to recurring error structure for high ambient temp entering condenser
324 : int PLFErrIndex; // index/pointer to recurring error structure for PLF <> 1 at speed 1 for a multiple speed coil
325 : int PLRErrIndex; // index/pointer to recurring error structure for PLR < .7
326 : bool PrintLowAmbMessage; // used to print warning message for low ambient conditions
327 : std::string LowAmbBuffer1; // holds warning message until next iteration (only prints 1 message/iteration)
328 : std::string LowAmbBuffer2; // holds warning message until next iteration (only prints 1 message/iteration)
329 : bool PrintHighAmbMessage; // used to print warning message for high ambient conditions
330 : std::string HighAmbBuffer1; // holds warning message until next iteration (only prints 1 message/iteration)
331 : std::string HighAmbBuffer2; // holds warning message until next iteration (only prints 1 message/iteration)
332 : // begin variables for Water System interactions
333 : EvapWaterSupply EvapWaterSupplyMode; // where does water come from
334 : std::string EvapWaterSupplyName; // name of water source e.g. water storage tank
335 : int EvapWaterSupTankID;
336 : int EvapWaterTankDemandARRID;
337 : CondensateCollectAction CondensateCollectMode; // where does water come from
338 : std::string CondensateCollectName; // name of water source e.g. water storage tank
339 : int CondensateTankID;
340 : int CondensateTankSupplyARRID;
341 : Real64 CondensateVdot; // rate of water condensation from air stream [m3/s]
342 : Real64 CondensateVol; // amount of water condensed from air stream [m3]
343 : // end variables for water system interactions
344 : // used to print low ambient warning message for DOE2 coil only after time step has incremented
345 : Real64 CurrentEndTimeLast; // end time of time step for last simulation time step
346 : Real64 TimeStepSysLast; // last system time step (used to check for downshifting)
347 : // for multispeed DX coil type
348 : std::string FuelType; // Fuel type string
349 : DataGlobalConstants::ResourceType FuelTypeNum; // Fuel type number
350 : int NumOfSpeeds; // Number of speeds
351 : bool PLRImpact; // Part load fraction applied to Speed Number > 1
352 : bool LatentImpact; // Latent degradation applied to Speed Number > 1
353 : Array1D_int MSErrIndex; // index flag for num speeds/recurring messages
354 : Array1D<Real64> MSRatedTotCap; // Rated cooling capacity for MS heat pump [W]
355 : Array1D<Real64> MSRatedTotCapDes; // Autosized Gross total cooling capacity at rated conditions [watts]
356 : Array1D<Real64> MSRatedSHR; // Rated SHR for MS heat pump [dimensionless]
357 : Array1D<Real64> MSRatedCOP; // Rated COP for MS heat pump [dimensionless]
358 : Array1D<Real64> MSRatedAirVolFlowRate; // Air volume flow rate through unit at rated conditions [m3/s]
359 : Array1D<Real64> MSRatedAirMassFlowRate; // Air mass flow rate through unit at rated conditions [m3/s]
360 : Array1D<Real64> MSRatedCBF; // rated coil bypass factor
361 : Array1D_int MSCCapFTemp; // index of total cooling capacity modifier curve
362 : Array1D_int MSCCapFFlow; // index of total cooling capacity modifier curve
363 : Array1D_int MSEIRFTemp; // index of energy input ratio modifier curve as a function of temperature
364 : Array1D_int MSEIRFFlow; // index of energy input ratio modifier curve as a function of flow fraction
365 : Array1D_int MSPLFFPLR; // index of part load factor as a function of part load ratio
366 : Array1D_int MSWasteHeat; // index of waste heat as a function of temperature
367 : Array1D<Real64> MSWasteHeatFrac; // Waste heat fraction
368 : Array1D<Real64> MSEvapCondEffect; // effectiveness of the evaporatively cooled condenser
369 : Array1D<Real64> MSEvapCondAirFlow; // Air flow rate through the evap condenser for water use calcs [m3/s]
370 : Array1D<Real64> MSEvapCondPumpElecNomPower; // Nominal power input to the evap condenser
371 : // water circulation pump
372 : Array1D<Real64> MSTwet_Rated; // Nominal time for condensate to begin leaving the coil's
373 : // condensate drain line (sec)
374 : Array1D<Real64> MSGamma_Rated; // Initial moisture evaporation rate divided by steady-state
375 : // AC latent capacity (dimensionless)
376 : Array1D<Real64> MSMaxONOFFCyclesperHour; // Maximum ON/OFF cycles per hour for the compressor (cycles/hour)
377 : Array1D<Real64> MSLatentCapacityTimeConstant; // Time constant for latent capacity to reach steady state
378 : Array1D<Real64> MSFanPowerPerEvapAirFlowRate;
379 : Array1D<Real64> MSFanPowerPerEvapAirFlowRate_2023;
380 : Real64 FuelUsed; // Energy used, in addition to electricity [W]
381 : Real64 FuelConsumed; // Energy consumed, in addition to electricity [J]
382 : Real64 MSFuelWasteHeat; // Total waste heat [J]
383 : bool MSHPHeatRecActive; // True when entered Heat Rec Vol Flow Rate > 0
384 : int MSHPDesignSpecIndex; // index to MSHPDesignSpecification object used for variable speed coils
385 : // End of multispeed DX coil input
386 : // VRF system variables used for sizing
387 : bool CoolingCoilPresent; // FALSE if coil not present
388 : bool HeatingCoilPresent; // FALSE if coil not present
389 : bool ISHundredPercentDOASDXCoil; // FALSE if coil is regular dx coil
390 : Array1D_int SHRFTemp; // index of sensible heat ratio modifier curve
391 : // (function of entering wetbulb and drybulb)
392 : int SHRFTempErrorIndex; // Used for warning messages when output of SHRFTemp is negative
393 : Array1D_int SHRFFlow; // index of sensible heat ratio modifier curve
394 : // (function of actual supply air flow vs rated air flow)
395 : int SHRFFlowErrorIndex; // Used for warning messages when output of SHRFFlow is negative
396 : int SHRFTemp2; // index of sensible heat ratio modifier curve
397 : // (function of entering wetbulb and drybulb)
398 : int SHRFFlow2; // index of sensible heat ratio modifier curve
399 : // (function of actual supply air flow vs rated air flow)
400 : bool UserSHRCurveExists; // TRUE if user specified SHR modifier curve exists
401 : bool ASHRAE127StdRprt; // TRUE if user wishes to report ASHRAE 127 standard ratings
402 :
403 : int SecZonePtr; // index to the zone where the secondary coil is placed
404 : int SecCoilSHRFT; // index to the secondary coil sensible heat ratio temperature modifier curve
405 : int SecCoilSHRFF; // index to the secondary coil sensible heat ratio flor fraction modifier curve
406 : Real64 SecCoilAirFlow; // secondary coil air flow rate
407 : Real64 SecCoilAirFlowScalingFactor; // secondary coil air flow rate autosize scaling factor
408 : Real64 SecCoilRatedSHR; // secondary coil nominal or rated sensible heat ratio
409 : Real64 SecCoilSHR; // secondary coil current sensible heat ratio
410 : Real64 EvapInletWetBulb; // secondary DX coil inlet wet bulb temperature (zone air node wet bulb temp.)
411 : Real64 SecCoilSensibleHeatGainRate; // secondary zone sensible heat gain rate [W]
412 : Real64 SecCoilTotalHeatRemovalRate; // secondary zone total heat removal rate [W]
413 : Real64 SecCoilSensibleHeatRemovalRate; // secondary zone sensible heat removal rate [W]
414 : Real64 SecCoilLatentHeatRemovalRate; // secondary zone latent heat removal rate [W]
415 : bool IsSecondaryDXCoilInZone; // true means secondary dx coil is zone instead of outside
416 : bool IsDXCoilInZone; // true means dx coil is in zone instead of outside
417 : Real64 CompressorPartLoadRatio; // compressor part load ratio of the primary DX coil
418 : Array1D_int MSSecCoilSHRFT; // index to the multi speed secondary coil sensible heat ratio temperature modifier curve
419 : Array1D_int MSSecCoilSHRFF; // index to the multi speed secondary coil sensible heat ratio flow fraction modifier curve
420 : Array1D<Real64> MSSecCoilAirFlow; // multispeed secondary coil air flow rate
421 : Array1D<Real64> MSSecCoilAirFlowScalingFactor; // multispeed secondary coil air flow rate autosize scaling factor
422 : Array1D<Real64> MSSecCoilRatedSHR; // multispeed secondary coil nominal or rated sensible heat ratio
423 : int MSSpeedNumLS; // current low speed number of multspeed HP
424 : int MSSpeedNumHS; // current high speed number of multspeed HP
425 : Real64 MSSpeedRatio; // current speed ratio of multspeed HP
426 : Real64 MSCycRatio; // current cycling ratio of multspeed HP
427 :
428 : // The following members are for VRF Coils (FluidTCtrl Model)
429 : int VRFIUPtr; // index to the VRF Indoor Unit where the coil is placed
430 : int VRFOUPtr; // index to the VRF Outdoor Unit that the coil serves
431 : Real64 EvaporatingTemp; // indoor unit evaporating temperature [C]
432 : Real64 CondensingTemp; // indoor unit condensing temperature [C]
433 : Real64 C1Te; // VRF Indoor Unit Coefficient 1 to calculate Te,req [--]
434 : Real64 C2Te; // VRF Indoor Unit Coefficient 2 to calculate Te,req [--]
435 : Real64 C3Te; // VRF Indoor Unit Coefficient 3 to calculate Te,req [--]
436 : Real64 C1Tc; // VRF Indoor Unit Coefficient 1 to calculate Tc,req [--]
437 : Real64 C2Tc; // VRF Indoor Unit Coefficient 2 to calculate Tc,req [--]
438 : Real64 C3Tc; // VRF Indoor Unit Coefficient 3 to calculate Tc,req [--]
439 : Real64 SH; // Superheating degrees [C]
440 : Real64 SC; // Subcooling degrees [C]
441 : Real64 ActualSH; // Actual superheating degrees [C]
442 : Real64 ActualSC; // Actual subcooling degrees [C]
443 : Real64 RateBFVRFIUEvap; // VRF Iutdoor Unit Evaporator Rated Bypass Factor
444 : Real64 RateBFVRFIUCond; // VRF Iutdoor Unit Condenser Rated Bypass Factor
445 : int CAPFTErrIndex; // index/pointer to recurring error structure for CAPFT curve value <= 0.0
446 : int EIRFTErrIndex; // index/pointer to recurring error structure for EIRFT curve value <= 0.0
447 : bool reportCoilFinalSizes; // one time report of sizes to coil selection report
448 : Real64 capModFacTotal; // current coil capacity modification factor
449 : int AirLoopNum; // Airloop number
450 :
451 : // Default Constructor
452 241 : DXCoilData()
453 241 : : DXCoilType_Num(0), SchedPtr(0), RatedTotCap(MaxModes, 0.0), HeatSizeRatio(1.0), RatedTotCapEMSOverrideOn(MaxModes, false),
454 : RatedTotCapEMSOverrideValue(MaxModes, 0.0), RatedSHR(MaxModes, 0.0), RatedSHREMSOverrideOn(MaxModes, false),
455 : RatedSHREMSOverrideValue(MaxModes, 0.0), RatedCOP(MaxModes, 0.0), RatedAirVolFlowRate(MaxModes, 0.0),
456 : RatedAirVolFlowRateEMSOverrideON(MaxModes, false), RatedAirVolFlowRateEMSOverrideValue(MaxModes, 0.0),
457 : FanPowerPerEvapAirFlowRate(MaxModes, 0.0), FanPowerPerEvapAirFlowRate_2023(MaxModes, 0.0), RatedAirMassFlowRate(MaxModes, 0.0),
458 : BypassedFlowFrac(MaxModes, 0.0), RatedCBF(MaxModes, 0.0), AirInNode(0), AirOutNode(0), CCapFTemp(MaxModes, 0), CCapFTempErrorIndex(0),
459 : CCapFFlow(MaxModes, 0), CCapFFlowErrorIndex(0), EIRFTemp(MaxModes, 0), EIRFTempErrorIndex(0), EIRFFlow(MaxModes, 0),
460 : EIRFFlowErrorIndex(0), PLFFPLR(MaxModes, 0), ReportCoolingCoilCrankcasePower(true), CrankcaseHeaterCapacity(0.0),
461 : CrankcaseHeaterPower(0.0), MaxOATCrankcaseHeater(0.0), CrankcaseHeaterConsumption(0.0), BasinHeaterPowerFTempDiff(0.0),
462 : BasinHeaterSetPointTemp(0.0), CompanionUpstreamDXCoil(0), FindCompanionUpStreamCoil(true), CondenserInletNodeNum(MaxModes, 0),
463 : LowOutletTempIndex(0), FullLoadOutAirTempLast(0.0), FullLoadInletAirTempLast(0.0), PrintLowOutTempMessage(false),
464 : HeatingCoilPLFCurvePTR(0), BasinHeaterSchedulePtr(0), RatedTotCap2(0.0), RatedSHR2(0.0), RatedCOP2(0.0), RatedAirVolFlowRate2(0.0),
465 : RatedAirMassFlowRate2(0.0), RatedCBF2(0.0), CCapFTemp2(0), EIRFTemp2(0), RatedEIR2(0.0), InternalStaticPressureDrop(0.0),
466 : RateWithInternalStaticAndFanObject(false), SupplyFanIndex(-1), SupplyFan_TypeNum(0), RatedEIR(MaxModes, 0.0), InletAirMassFlowRate(0.0),
467 : InletAirMassFlowRateMax(0.0), InletAirTemp(0.0), InletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirTemp(0.0), OutletAirHumRat(0.0),
468 : OutletAirEnthalpy(0.0), PartLoadRatio(0.0), TotalCoolingEnergy(0.0), SensCoolingEnergy(0.0), LatCoolingEnergy(0.0),
469 : TotalCoolingEnergyRate(0.0), SensCoolingEnergyRate(0.0), LatCoolingEnergyRate(0.0), ElecCoolingConsumption(0.0), ElecCoolingPower(0.0),
470 : CoolingCoilRuntimeFraction(0.0), TotalHeatingEnergy(0.0), TotalHeatingEnergyRate(0.0), ElecHeatingConsumption(0.0),
471 : ElecHeatingPower(0.0), HeatingCoilRuntimeFraction(0.0), DefrostStrategy(StandardRatings::DefrostStrat::Invalid),
472 : DefrostControl(StandardRatings::HPdefrostControl::Invalid), EIRFPLR(0), DefrostEIRFT(0), RegionNum(0), MinOATCompressor(0.0),
473 : OATempCompressorOn(0.0), MaxOATCompressor(0.0), MaxOATDefrost(0.0), DefrostTime(0.0), DefrostCapacity(0.0), HPCompressorRuntime(0.0),
474 : HPCompressorRuntimeLast(0.0), TimeLeftToDefrost(0.0), DefrostPower(0.0), DefrostConsumption(0.0),
475 : HeatingPerformanceOATType(DryBulbIndicator), HPCoilIsInCoilSystemHeatingDX(false), OATempCompressorOnOffBlank(false),
476 : Twet_Rated(MaxModes, 0.0), Gamma_Rated(MaxModes, 0.0), MaxONOFFCyclesperHour(MaxModes, 0.0), LatentCapacityTimeConstant(MaxModes, 0.0),
477 : CondenserType(MaxModes, DataHeatBalance::RefrigCondenserType::Air), ReportEvapCondVars(false), EvapCondEffect(MaxModes, 0.0),
478 : CondInletTemp(0.0), EvapCondAirFlow(MaxModes, 0.0), EvapCondPumpElecNomPower(MaxModes, 0.0), EvapCondPumpElecPower(0.0),
479 : EvapCondPumpElecConsumption(0.0), EvapWaterConsumpRate(0.0), EvapWaterConsump(0.0), EvapCondAirFlow2(0.0), EvapCondEffect2(0.0),
480 : EvapCondPumpElecNomPower2(0.0), BasinHeaterPower(0.0), BasinHeaterConsumption(0.0), NumCapacityStages(1), NumDehumidModes(0),
481 : CoilPerformanceType(MaxModes), CoilPerformanceType_Num(MaxModes, 0), CoilPerformanceName(MaxModes), CoolingCoilStg2RuntimeFrac(0.0),
482 : DehumidificationMode(0), WaterInNode(0), WaterOutNode(0), HCOPFTemp(0), HCOPFTempErrorIndex(0), HCOPFAirFlow(0),
483 : HCOPFAirFlowErrorIndex(0), HCOPFWaterFlow(0), HCOPFWaterFlowErrorIndex(0), HCapFTemp(0), HCapFTempErrorIndex(0), HCapFAirFlow(0),
484 : HCapFAirFlowErrorIndex(0), HCapFWaterFlow(0), HCapFWaterFlowErrorIndex(0), InletAirTemperatureType(0), RatedInletDBTemp(0.0),
485 : RatedInletWBTemp(0.0), RatedInletWaterTemp(0.0), HPWHCondPumpElecNomPower(0.0), HPWHCondPumpFracToWater(0.0),
486 : RatedHPWHCondWaterFlow(0.0), ElecWaterHeatingPower(0.0), ElecWaterHeatingConsumption(0.0), FanPowerIncludedInCOP(true),
487 : CondPumpHeatInCapacity(false), CondPumpPowerInCOP(false), LowTempLast(0.0), HighTempLast(0.0), ErrIndex1(0), ErrIndex2(0), ErrIndex3(0),
488 : ErrIndex4(0), LowAmbErrIndex(0), HighAmbErrIndex(0), PLFErrIndex(0), PLRErrIndex(0), PrintLowAmbMessage(false),
489 : PrintHighAmbMessage(false), EvapWaterSupplyMode(EvapWaterSupply::FromMains), EvapWaterSupTankID(0), EvapWaterTankDemandARRID(0),
490 : CondensateCollectMode(CondensateCollectAction::Discard), CondensateTankID(0), CondensateTankSupplyARRID(0), CondensateVdot(0.0),
491 : CondensateVol(0.0), CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::None), NumOfSpeeds(0),
492 : PLRImpact(false), LatentImpact(false), MSFuelWasteHeat(0.0), MSHPHeatRecActive(false), MSHPDesignSpecIndex(0), CoolingCoilPresent(true),
493 : HeatingCoilPresent(true), ISHundredPercentDOASDXCoil(false), SHRFTemp(MaxModes, 0), SHRFTempErrorIndex(0), SHRFFlow(MaxModes, 0),
494 : SHRFFlowErrorIndex(0), SHRFTemp2(0), SHRFFlow2(0), UserSHRCurveExists(false), ASHRAE127StdRprt(false), SecZonePtr(0), SecCoilSHRFT(0),
495 : SecCoilSHRFF(0), SecCoilAirFlow(0.0), SecCoilAirFlowScalingFactor(1.0), SecCoilRatedSHR(1.0), SecCoilSHR(1.0), EvapInletWetBulb(0.0),
496 : SecCoilSensibleHeatGainRate(0.0), SecCoilTotalHeatRemovalRate(0.0), SecCoilSensibleHeatRemovalRate(0.0),
497 : SecCoilLatentHeatRemovalRate(0.0), IsSecondaryDXCoilInZone(false), IsDXCoilInZone(false), CompressorPartLoadRatio(0.0), MSSpeedNumLS(1),
498 : MSSpeedNumHS(2), MSSpeedRatio(0.0), MSCycRatio(0.0), VRFIUPtr(0), VRFOUPtr(0), EvaporatingTemp(4.0), CondensingTemp(40.0), C1Te(0.0),
499 : C2Te(0.0), C3Te(0.0), C1Tc(0.0), C2Tc(0.0), C3Tc(0.0), SH(0.0), SC(0.0), ActualSH(0.0), ActualSC(0.0), RateBFVRFIUEvap(0.0592),
500 241 : RateBFVRFIUCond(0.1360), CAPFTErrIndex(0), EIRFTErrIndex(0), reportCoilFinalSizes(true), capModFacTotal(0.0), AirLoopNum(0)
501 : {
502 241 : }
503 : };
504 :
505 3187 : struct PerfModeData
506 : {
507 : // Members
508 : Array1D<std::string> FieldNames;
509 :
510 : // Default Constructor
511 1193 : PerfModeData() : FieldNames()
512 : {
513 1193 : }
514 : };
515 :
516 2145 : struct DXCoilNumericFieldData
517 : {
518 : // Members
519 : Array1D<PerfModeData> PerfMode; // Coil Performance object type
520 :
521 : // Default Constructor
522 241 : DXCoilNumericFieldData() : PerfMode(0)
523 : {
524 241 : }
525 : };
526 :
527 : // Functions
528 :
529 : void SimDXCoil(EnergyPlusData &state,
530 : std::string_view CompName, // name of the fan coil unit
531 : DataHVACGlobals::CompressorOperation const CompressorOp, // compressor operation; 1=on, 0=off
532 : bool const FirstHVACIteration, // True when first HVAC iteration
533 : int &CompIndex,
534 : int const FanOpMode, // allows parent object to control fan mode
535 : Optional<Real64 const> PartLoadRatio = _, // part load ratio (for single speed cycling unit)
536 : Optional<Real64 const> OnOffAFR = _, // ratio of compressor on airflow to compressor off airflow
537 : Optional<Real64 const> CoilCoolingHeatingPLRRatio = _, // used for cycling fan RH control
538 : Optional<Real64 const> MaxCap = _, // maximum cooling capacity of VRF terminal units
539 : Optional<Real64 const> CompCyclingRatio = _ // cycling ratio of VRF condenser connected to this TU
540 : );
541 :
542 : void SimDXCoilMultiSpeed(
543 : EnergyPlusData &state,
544 : std::string_view CompName, // name of the fan coil unit
545 : Real64 const SpeedRatio, // = (CompressorSpeed - CompressorSpeedMin) /
546 : Real64 const CycRatio, // cycling part load ratio for variable speed
547 : int &CompIndex,
548 : Optional_int_const SpeedNum = _, // Speed number for multispeed cooling coil onlyn
549 : Optional_int_const FanOpMode = _, // Fan operation mode
550 : DataHVACGlobals::CompressorOperation CompressorOp = DataHVACGlobals::CompressorOperation::Off, // Compressor on/off; 1=on, 0=off
551 : Optional_int_const SingleMode = _ // Single mode operation Yes/No; 1=Yes, 0=No
552 : );
553 :
554 : void SimDXCoilMultiMode(EnergyPlusData &state,
555 : std::string_view CompName, // name of the fan coil unit
556 : DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off !unused1208
557 : bool const FirstHVACIteration, // true if first hvac iteration
558 : Real64 const PartLoadRatio, // part load ratio
559 : int const DehumidMode, // dehumidification mode (0=normal, 1=enhanced)
560 : int &CompIndex,
561 : int const FanOpMode // allows parent object to control fan mode
562 : );
563 :
564 : // TODO: Add New Property for AHRI 2023 Standard & Modify Numeric Fields (increment)
565 : void GetDXCoils(EnergyPlusData &state);
566 :
567 : void InitDXCoil(EnergyPlusData &state, int const DXCoilNum); // number of the current DX coil unit being simulated
568 :
569 : void SizeDXCoil(EnergyPlusData &state, int const DXCoilNum);
570 :
571 : void CalcHPWHDXCoil(EnergyPlusData &state,
572 : int const DXCoilNum, // the number of the DX coil to be simulated
573 : Real64 const PartLoadRatio // sensible water heating load / full load sensible water heating capacity
574 : );
575 :
576 : void CalcDoe2DXCoil(EnergyPlusData &state,
577 : int const DXCoilNum, // the number of the DX coil to be simulated
578 : DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
579 : bool const FirstHVACIteration, // true if this is the first iteration of HVAC
580 : Real64 const PartLoadRatio, // sensible cooling load / full load sensible cooling capacity
581 : int const FanOpMode, // Allows parent object to control fan operation
582 : Optional_int_const PerfMode = _, // Performance mode for MultiMode DX coil; Always 1 for other coil types
583 : Optional<Real64 const> OnOffAirFlowRatio = _, // ratio of compressor on airflow to compressor off airflow
584 : Optional<Real64 const> CoolingHeatingPLR = _ // used for cycling fan RH control
585 : );
586 :
587 : void CalcVRFCoolingCoil(EnergyPlusData &state,
588 : int const DXCoilNum, // the number of the DX coil to be simulated
589 : DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
590 : bool const FirstHVACIteration, // true if this is the first iteration of HVAC
591 : Real64 const PartLoadRatio, // sensible cooling load / full load sensible cooling capacity
592 : int const FanOpMode, // Allows parent object to control fan operation
593 : Real64 const CompCycRatio, // cycling ratio of VRF condenser
594 : Optional_int_const PerfMode = _, // Performance mode for MultiMode DX coil; Always 1 for other coil types
595 : Optional<Real64 const> OnOffAirFlowRatio = _, // ratio of compressor on airflow to compressor off airflow
596 : Optional<Real64 const> MaxCoolCap = _ // maximum capacity of DX coil
597 : );
598 :
599 : void CalcDXHeatingCoil(EnergyPlusData &state,
600 : int const DXCoilNum, // the number of the DX heating coil to be simulated
601 : Real64 const PartLoadRatio, // sensible cooling load / full load sensible cooling capacity
602 : int const FanOpMode, // Allows parent object to control fan mode
603 : Optional<Real64 const> OnOffAirFlowRatio = _, // ratio of compressor on airflow to compressor off airflow
604 : Optional<Real64 const> MaxHeatCap = _ // maximum allowed heating capacity
605 : );
606 :
607 : void CalcMultiSpeedDXCoil(EnergyPlusData &state,
608 : int const DXCoilNum, // the number of the DX heating coil to be simulated
609 : Real64 const SpeedRatio, // = (CompressorSpeed - CompressorSpeedMin) / (CompressorSpeedMax - CompressorSpeedMin)
610 : Real64 const CycRatio, // cycling part load ratio
611 : Optional_bool_const ForceOn = _);
612 :
613 : void CalcBasinHeaterPowerForMultiModeDXCoil(EnergyPlusData &state,
614 : int const DXCoilNum, // Index of coil being simulated
615 : int const DehumidMode // Dehumidification mode (0=normal, 1=enhanced)
616 : );
617 :
618 : Real64 AdjustCBF(Real64 const CBFNom, // nominal coil bypass factor
619 : Real64 const AirMassFlowRateNom, // nominal air mass flow rate [kg/s]
620 : Real64 const AirMassFlowRate // actual air mass flow rate [kg/s]
621 : );
622 :
623 : Real64 CalcCBF(EnergyPlusData &state,
624 : std::string const &UnitType,
625 : std::string const &UnitName,
626 : Real64 const InletAirTemp, // inlet air temperature [C]
627 : Real64 const InletAirHumRat, // inlet air humidity ratio [kg water / kg dry air]
628 : Real64 const TotCap, // total cooling capacity [Watts]
629 : Real64 const AirVolFlowRate, // the air volume flow rate at the given capacity [m3/s]
630 : Real64 const SHR, // sensible heat ratio at the given capacity and flow rate
631 : bool const PrintFlag = true // flag used to print warnings if desired
632 : );
633 :
634 : Real64 ValidateADP(EnergyPlusData &state,
635 : std::string const &UnitType, // component name
636 : std::string const &UnitName, // component type
637 : Real64 const RatedInletAirTemp, // coil inlet air temperature [C]
638 : Real64 const RatedInletAirHumRat, // coil inlet air humidity ratio [kg/kg]
639 : Real64 const TotCap, // coil total capacity [W]
640 : Real64 const AirMassFlow, // coil air mass flow rate [kg/s]
641 : Real64 const InitialSHR, // coil sensible heat ratio []
642 : std::string const &CallingRoutine // function name calling this routine
643 : );
644 :
645 : Real64 CalcEffectiveSHR(EnergyPlusData &state,
646 : int const DXCoilNum, // Index number for cooling coil
647 : Real64 const SHRss, // Steady-state sensible heat ratio
648 : Real64 const RTF, // Compressor run-time fraction
649 : Real64 const QLatRated, // Rated latent capacity
650 : Real64 const QLatActual, // Actual latent capacity
651 : Real64 const EnteringDB, // Entering air dry-bulb temperature
652 : Real64 const EnteringWB, // Entering air wet-bulb temperature
653 : Optional_int_const Mode = _, // Performance mode for MultiMode DX coil; Always 1 for other coil types
654 : Optional<Real64 const> HeatingRTF = _ // Used to recalculate Toff for cycling fan systems
655 : );
656 :
657 : void CalcTotCapSHR(EnergyPlusData &state,
658 : Real64 const InletDryBulb, // inlet air dry bulb temperature [C]
659 : Real64 const InletHumRat, // inlet air humidity ratio [kg water / kg dry air]
660 : Real64 const InletEnthalpy, // inlet air specific enthalpy [J/kg]
661 : Real64 const InletWetBulb, // inlet air wet bulb temperature [C]
662 : Real64 const AirMassFlowRatio, // Ratio of actual air mass flow to nominal air mass flow
663 : Real64 const AirMassFlow, // actual mass flow for capacity and SHR calculation
664 : Real64 const TotCapNom, // nominal total capacity [W]
665 : Real64 const CBF, // coil bypass factor
666 : int const CCapFTemp, // capacity modifier curve index, function of entering wetbulb
667 : int const CCapFFlow, // capacity modifier curve, function of actual flow vs rated flow
668 : Real64 &TotCap, // total capacity at the given conditions [W]
669 : Real64 &SHR, // sensible heat ratio at the given conditions
670 : Real64 const CondInletTemp, // Condenser inlet temperature [C]
671 : Real64 const Pressure, // air pressure [Pa]
672 : Real64 &TotCapModFac // capacity modification factor, func of temp and func of flow
673 : );
674 :
675 : void CalcMultiSpeedDXCoilCooling(EnergyPlusData &state,
676 : int const DXCoilNum, // the number of the DX heating coil to be simulated
677 : Real64 const SpeedRatio, // = (CompressorSpeed - CompressorSpeedMin) / (CompressorSpeedMax - CompressorSpeedMin)
678 : Real64 const CycRatio, // cycling part load ratio
679 : int const SpeedNum, // Speed number
680 : int const FanOpMode, // Sets fan control to CycFanCycCoil or ContFanCycCoil
681 : DataHVACGlobals::CompressorOperation CompressorOp, // Compressor on/off; 1=on, 0=off
682 : int const SingleMode // Single mode operation Yes/No; 1=Yes, 0=No
683 : );
684 :
685 : void CalcMultiSpeedDXCoilHeating(EnergyPlusData &state,
686 : int const DXCoilNum, // the number of the DX heating coil to be simulated
687 : Real64 const SpeedRatio, // = (CompressorSpeed - CompressorSpeedMin) / (CompressorSpeedMax - CompressorSpeedMin)
688 : Real64 const CycRatio, // cycling part load ratio
689 : int const SpeedNum, // Speed number
690 : int const FanOpMode, // Fan operation mode
691 : int const SingleMode // Single mode operation Yes/No; 1=Yes, 0=No
692 : );
693 :
694 : void UpdateDXCoil(EnergyPlusData &state, int const DXCoilNum); // number of the current fan coil unit being simulated
695 :
696 : void ReportDXCoil(EnergyPlusData &state, int const DXCoilNum); // number of the current fan coil unit being simulated
697 :
698 : void CalcTwoSpeedDXCoilStandardRating(EnergyPlusData &state, int const DXCoilNum);
699 :
700 : void GetFanIndexForTwoSpeedCoil(
701 : EnergyPlusData &state, int const CoolingCoilIndex, int &SupplyFanIndex, std::string &SupplyFanName, int &SupplyFan_TypeNum);
702 :
703 : void GetDXCoilIndex(EnergyPlusData &state,
704 : std::string const &DXCoilName,
705 : int &DXCoilIndex,
706 : bool &ErrorsFound,
707 : std::string_view const ThisObjectType = {},
708 : bool const SuppressWarning = false);
709 :
710 : std::string GetDXCoilName(
711 : EnergyPlusData &state, int &DXCoilIndex, bool &ErrorsFound, std::string_view const ThisObjectType = {}, bool const SuppressWarning = false);
712 :
713 : Real64 GetCoilCapacity(EnergyPlusData &state,
714 : std::string const &CoilType, // must match coil types in this module
715 : std::string const &CoilName, // must match coil names for the coil type
716 : bool &ErrorsFound // set to true if problem
717 : );
718 :
719 : Real64 GetCoilCapacityByIndexType(EnergyPlusData &state,
720 : int const CoilIndex, // must match coil index for the coil type
721 : int const CoilType_Num, // must match coil types in this module
722 : bool &ErrorsFound // set to true if problem
723 : );
724 :
725 : int GetCoilTypeNum(EnergyPlusData &state,
726 : std::string const &CoilType, // must match coil types in this module
727 : std::string const &CoilName, // must match coil names for the coil type
728 : bool &ErrorsFound, // set to true if problem
729 : Optional_bool_const PrintWarning = _ // prints warning when true
730 : );
731 :
732 : Real64 GetMinOATCompressor(EnergyPlusData &state,
733 : int const CoilIndex, // index to coil
734 : bool &ErrorsFound // set to true if problem
735 : );
736 :
737 : int GetCoilInletNode(EnergyPlusData &state,
738 : std::string const &CoilType, // must match coil types in this module
739 : std::string const &CoilName, // must match coil names for the coil type
740 : bool &ErrorsFound // set to true if problem
741 : );
742 :
743 : int GetCoilOutletNode(EnergyPlusData &state,
744 : std::string const &CoilType, // must match coil types in this module
745 : std::string const &CoilName, // must match coil names for the coil type
746 : bool &ErrorsFound // set to true if problem
747 : );
748 :
749 : int getCoilInNodeIndex(EnergyPlusData &state,
750 : int CoilIndex, // coil index
751 : bool &ErrorsFound // set to true if problem
752 : );
753 :
754 : int getCoilOutNodeIndex(EnergyPlusData &state,
755 : int CoilIndex, // coil index
756 : bool &ErrorsFound // set to true if problem
757 : );
758 :
759 : int GetCoilCondenserInletNode(EnergyPlusData &state,
760 : std::string const &CoilType, // must match coil types in this module
761 : std::string const &CoilName, // must match coil names for the coil type
762 : bool &ErrorsFound // set to true if problem
763 : );
764 :
765 : Real64 GetDXCoilBypassedFlowFrac(EnergyPlusData &state,
766 : std::string const &CoilType, // must match coil types in this module
767 : std::string const &CoilName, // must match coil names for the coil type
768 : bool &ErrorsFound // set to true if problem
769 : );
770 :
771 : int GetHPCoolingCoilIndex(EnergyPlusData &state,
772 : std::string const &HeatingCoilType, // Type of DX heating coil used in HP
773 : std::string const &HeatingCoilName, // Name of DX heating coil used in HP
774 : int const HeatingCoilIndex // Index of DX heating coil used in HP
775 : );
776 :
777 : int GetDXCoilNumberOfSpeeds(EnergyPlusData &state,
778 : std::string const &CoilType, // must match coil types in this module
779 : std::string const &CoilName, // must match coil names for the coil type
780 : bool &ErrorsFound // set to true if problem
781 : );
782 :
783 : int GetDXCoilAvailSchPtr(EnergyPlusData &state,
784 : std::string const &CoilType, // must match coil types in this module
785 : std::string const &CoilName, // must match coil names for the coil type
786 : bool &ErrorsFound, // set to true if problem
787 : Optional_int_const CoilIndex = _ // Coil index number
788 : );
789 :
790 : Real64 GetDXCoilAirFlow(EnergyPlusData &state,
791 : std::string const &CoilType, // must match coil types in this module
792 : std::string const &CoilName, // must match coil names for the coil type
793 : bool &ErrorsFound // set to true if problem
794 : );
795 :
796 : int GetDXCoilCapFTCurveIndex(EnergyPlusData &state,
797 : int const CoilIndex, // coil index pointer
798 : bool &ErrorsFound // set to true if problem
799 : );
800 :
801 : void SetDXCoolingCoilData(EnergyPlusData &state,
802 : int const DXCoilNum, // Number of DX Cooling Coil
803 : bool &ErrorsFound, // Set to true if certain errors found
804 : Optional_int HeatingCoilPLFCurvePTR = _, // Parameter equivalent of heating coil PLR curve index
805 : Optional<DataHeatBalance::RefrigCondenserType> CondenserType = _, // Parameter equivalent of condenser type parameter
806 : Optional_int CondenserInletNodeNum = _, // Parameter equivalent of condenser inlet node number
807 : Optional<Real64> MaxOATCrankcaseHeater = _, // Parameter equivalent of condenser Max OAT for Crank Case Heater temp
808 : Optional<Real64> MinOATCooling = _, // Parameter equivalent of condenser Min OAT for compressor cooling operation
809 : Optional<Real64> MaxOATCooling = _, // Parameter equivalent of condenser Max OAT for compressor cooling operation
810 : Optional<Real64> MinOATHeating = _, // Parameter equivalent of condenser Min OAT for compressor heating operation
811 : Optional<Real64> MaxOATHeating = _, // Parameter equivalent of condenser Max OAT for compressor heating operation
812 : Optional_int HeatingPerformanceOATType = _, // Parameter equivalent to condenser entering air temp type (1-db, 2=wb)
813 : Optional<StandardRatings::DefrostStrat> DefrostStrategy = _,
814 : Optional<StandardRatings::HPdefrostControl> DefrostControl = _,
815 : Optional_int DefrostEIRPtr = _,
816 : Optional<Real64> DefrostFraction = _,
817 : Optional<Real64> DefrostCapacity = _,
818 : Optional<Real64> MaxOATDefrost = _,
819 : Optional_bool CoolingCoilPresent = _,
820 : Optional_bool HeatingCoilPresent = _,
821 : Optional<Real64> HeatSizeRatio = _,
822 : Optional<Real64> TotCap = _,
823 : Optional_int SupplyFanIndex = _,
824 : Optional_string SupplyFanName = _,
825 : Optional_int SupplyFan_TypeNum = _);
826 :
827 : void SetCoilSystemHeatingDXFlag(EnergyPlusData &state,
828 : std::string const &CoilType, // must match coil types in this module
829 : std::string const &CoilName // must match coil names for the coil type
830 : );
831 :
832 : void SetCoilSystemCoolingData(EnergyPlusData &state,
833 : std::string const &CoilName, // must match coil names for the coil type
834 : std::string const &CoilSystemName);
835 :
836 : Real64 CalcSHRUserDefinedCurves(EnergyPlusData &state,
837 : Real64 const InletDryBulb, // inlet air dry bulb temperature [C]
838 : Real64 const InletWetBulb, // inlet air wet bulb temperature [C]
839 : Real64 const AirMassFlowRatio, // ratio of actual air mass flow to rated air mass flow
840 : int const SHRFTempCurveIndex, // SHR modifier curve index
841 : int const SHRFFlowCurveIndex, // SHR modifier curve index
842 : Real64 const SHRRated // rated sensible heat ratio, user input
843 : );
844 :
845 : void SetDXCoilTypeData(EnergyPlusData &state, std::string const &CoilName); // must match coil names for the coil type
846 :
847 : void CalcSecondaryDXCoils(EnergyPlusData &state, int const DXCoilNum);
848 :
849 : Real64 CalcSecondaryDXCoilsSHR(EnergyPlusData &state,
850 : int const DXCoilNum,
851 : Real64 const EvapAirMassFlow,
852 : Real64 const TotalHeatRemovalRate,
853 : Real64 const PartLoadRatio,
854 : Real64 const SecCoilRatedSHR,
855 : Real64 const EvapInletDryBulb,
856 : Real64 const EvapInletHumRat,
857 : Real64 const EvapInletWetBulb,
858 : Real64 const EvapInletEnthalpy,
859 : Real64 const CondInletDryBulb,
860 : Real64 const SecCoilFlowFraction,
861 : int const SecCoilSHRFT,
862 : int const SecCoilSHRFF);
863 :
864 : // Begin of Methods for New VRF Model: Fluid Temperature Control
865 : //******************************************************************************
866 : void CalcVRFCoolingCoil_FluidTCtrl(EnergyPlusData &state,
867 : int const DXCoilNum, // the number of the DX coil to be simulated
868 : DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
869 : bool const FirstHVACIteration, // true if this is the first iteration of HVAC
870 : Real64 const PartLoadRatio, // sensible cooling load / full load sensible cooling capacity
871 : int const FanOpMode, // Allows parent object to control fan operation
872 : Real64 const CompCycRatio, // cycling ratio of VRF condenser
873 : Optional_int_const PerfMode, // Performance mode for MultiMode DX coil; Always 1 for other coil types
874 : Optional<Real64 const> OnOffAirFlowRatio // ratio of compressor on airflow to compressor off airflow
875 : );
876 :
877 : void CalcVRFHeatingCoil_FluidTCtrl(EnergyPlusData &state,
878 : DataHVACGlobals::CompressorOperation CompressorOp, // compressor operation; 1=on, 0=off
879 : int const DXCoilNum, // the number of the DX heating coil to be simulated
880 : Real64 const PartLoadRatio, // sensible cooling load / full load sensible cooling capacity
881 : int const FanOpMode, // Allows parent object to control fan mode
882 : Optional<Real64 const> OnOffAirFlowRatio, // ratio of compressor on airflow to compressor off airflow
883 : Optional<Real64 const> MaxHeatCap // maximum allowed heating capacity
884 : );
885 :
886 : void ControlVRFIUCoil(EnergyPlusData &state,
887 : int const CoilIndex, // index to VRFTU coil
888 : Real64 const QCoil, // coil load
889 : Real64 const Tin, // inlet air temperature
890 : Real64 const Win, // inlet air humidity ratio
891 : Real64 const TeTc, // evaporating or condensing temperature
892 : Real64 const OAMassFlow, // mass flow rate of outdoor air
893 : Real64 &FanSpdRatio, // fan speed ratio: actual flow rate / rated flow rate
894 : Real64 &Wout, // outlet air humidity ratio
895 : Real64 &Tout, // outlet air temperature
896 : Real64 &Hout, // outlet air enthalpy
897 : Real64 &SHact, // actual SH
898 : Real64 &SCact // actual SC
899 : );
900 :
901 : void CalcVRFCoilSenCap(EnergyPlusData &state,
902 : int const OperationMode, // mode 0 for cooling, 1 for heating
903 : int const CoilNum, // index to VRFTU cooling or heating coil
904 : Real64 const Tinlet, // dry bulb temperature of air entering the coil
905 : Real64 const TeTc, // evaporating or condensing temperature
906 : Real64 const SHSC, // SH at cooling /SC at heating
907 : Real64 const BF, // Bypass factor
908 : Real64 &Q_sen, // VRF coil sensible capacity per air mass flow rate
909 : Real64 &T_coil_surf // Air temperature at coil surface
910 : );
911 :
912 : void CalcVRFCoilCapModFac(EnergyPlusData &state,
913 : int const OperationMode, // mode 0 for cooling, 1 for heating
914 : Optional<int const> CoilIndex, // index to VRFTU cooling or heating coil
915 : Optional<std::string> CoilName, // name of VRFTU cooling or heating coil
916 : Real64 const Tinlet, // dry bulb temperature of air entering the coil
917 : Optional<Real64 const> TeTc, // evaporating or condensing temperature
918 : Optional<Real64 const> SHSC, // SH at cooling /SC at heating
919 : Optional<Real64 const> BF, // Bypass factor
920 : Real64 &CapModFac // Coil capacity modification factor
921 : );
922 :
923 : Real64 FanSpdResidualCool(Real64 FanSpdRto, Real64 QCoilSenCoolingLoad, Real64 Ts_1, Real64 Tin, Real64 Garate, Real64 BF);
924 :
925 : Real64 FanSpdResidualHeat(Real64 FanSpdRto, Real64 QCoilSenHeatingLoad, Real64 Ts_1, Real64 Tin, Real64 Garate, Real64 BF);
926 :
927 : void SetMSHPDXCoilHeatRecoveryFlag(EnergyPlusData &state, int const DXCoilNum); // must match coil names for the coil type
928 :
929 : void SetDXCoilAirLoopNumber(EnergyPlusData &state, std::string const &CoilName, int const AirLoopNum); // must match coil names for the coil type
930 :
931 : void DisableLatentDegradation(EnergyPlusData &state, int const DXCoilNum);
932 :
933 : } // namespace DXCoils
934 :
935 1542 : struct DXCoilsData : BaseGlobalStruct
936 : {
937 :
938 : bool GetCoilsInputFlag = true; // First time, input is "gotten"
939 : bool MyOneTimeFlag = true; // One time flag used to allocate MyEnvrnFlag and MySizeFlag
940 : bool CalcTwoSpeedDXCoilStandardRatingOneTimeEIOHeaderWrite = true;
941 : bool CrankcaseHeaterReportVarFlag = true;
942 : int NumVRFHeatingCoils = 0; // number of VRF heat pump heating coils
943 : int NumVRFCoolingCoils = 0; // number of VRF heat pump cooling coils
944 : int NumDXCoils = 0; // Total number of DX coils
945 : int NumVRFHeatingFluidTCtrlCoils = 0; // number of VRF heat pump heating coils for FluidTCtrl Model
946 : int NumVRFCoolingFluidTCtrlCoils = 0; // number of VRF heat pump cooling coils for FluidTCtrl Model
947 : int NumDXHeatingCoils = 0; // number of DX heat pump heating coils
948 : int NumDoe2DXCoils = 0; // number of doe2 DX coils
949 : int NumDXHeatPumpWaterHeaterPumpedCoils = 0; // number of DX water heater coils, pumped
950 : int NumDXHeatPumpWaterHeaterWrappedCoils = 0; // number of DX water heater coils, pumped
951 : int NumDXMulSpeedCoils = 0; // number of DX coils with multi-speed compressor
952 : int NumDXMulModeCoils = 0; // number of DX coils with multi-mode performance
953 : int NumDXMulSpeedCoolCoils = 0; // number of multispeed DX cooling coils
954 : int NumDXMulSpeedHeatCoils = 0; // number of multispeed DX heating coils
955 : Real64 HPWHHeatingCapacity = 0.0; // Used by Heat Pump:Water Heater object as total water heating capacity [W]
956 : Real64 HPWHHeatingCOP = 0.0; // Used by Heat Pump:Water Heater object as water heating COP [W/W]
957 : Array1D_bool CheckEquipName;
958 : Array1D<Real64> DXCoilOutletTemp; // DX coil outlet dry bulb temperature [C]
959 : Array1D<Real64> DXCoilOutletHumRat; // DX coil outlet humidity ratio [kgWater/kgDryAir]
960 : Array1D<Real64> DXCoilPartLoadRatio; // DX coil part-load ratio
961 : Array1D_int DXCoilFanOpMode; // supply air fan operating mode
962 : Array1D<Real64> DXCoilFullLoadOutAirTemp; // DX coil full load outlet dry bulb temperature [C]
963 : Array1D<Real64> DXCoilFullLoadOutAirHumRat; // DX coil full load outlet humidity ratio [kgWater/kgDryAir]
964 : Array1D<Real64> DXCoilTotalCooling; // DX cooling coil total cooling output [W]
965 : Array1D<Real64> DXCoilTotalHeating; // DX heating coil total heating output [W]
966 : Array1D<Real64> DXCoilCoolInletAirWBTemp; // DX cooling coil inlet air wet-bulb temp [C]
967 : Array1D<Real64> DXCoilHeatInletAirDBTemp; // DX heating coil inlet air dry-bulb temp [C]
968 : Array1D<Real64> DXCoilHeatInletAirWBTemp; // DX heating coil inlet air wet-bulb temp [C]
969 : Array1D<DXCoils::DXCoilData> DXCoil;
970 : Array1D<DXCoils::DXCoilNumericFieldData> DXCoilNumericFields;
971 :
972 : Array1D_bool MyEnvrnFlag; // One time environment flag
973 : Array1D_bool MySizeFlag; // One time sizing flag
974 : Real64 CurrentEndTime = 0.0;
975 : Real64 CalcVRFCoolingCoil_FluidTCtrlCurrentEndTime = 0.0;
976 : Real64 CalcVRFCoolingCoilCurrentEndTime = 0.0;
977 : Real64 NetCoolingCapRated = 0.0; // Net Cooling Coil capacity at Rated conditions, accounting for supply fan heat [W]
978 : Real64 EER = 0.0; // Energy Efficiency Ratio in SI [W/W]
979 : Real64 IEER = 0.0; // Integerated Energy Efficiency Ratio in SI [W/W]
980 : Real64 TotCapTempModFac = 0.0; // Total capacity modifier (function of entering wetbulb, outside drybulb) [-]
981 : Real64 TotCapFlowModFac = 0.0; // Total capacity modifier (function of actual supply air flow vs rated flow) [-]
982 : Real64 EIRTempModFac = 0.0; // EIR modifier (function of entering wetbulb, outside drybulb) [-]
983 : Real64 EIRFlowModFac = 0.0; // EIR modifier (function of actual supply air flow vs rated flow) [-]
984 : Real64 TempDryBulb_Leaving_Apoint = 0.0;
985 :
986 0 : void clear_state() override
987 : {
988 0 : new (this) DXCoilsData();
989 0 : }
990 : };
991 :
992 : } // namespace EnergyPlus
993 :
994 : #endif
|