LCOV - code coverage report
Current view: top level - EnergyPlus - RefrigeratedCase.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 42.1 % 183 77
Test Date: 2025-05-22 16:09:37 Functions: 43.8 % 16 7

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, 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 RefrigeratedCase_hh_INCLUDED
      49              : #define RefrigeratedCase_hh_INCLUDED
      50              : 
      51              : // ObjexxFCL Headers
      52              : #include <ObjexxFCL/Array1D.hh>
      53              : 
      54              : // EnergyPlus Headers
      55              : #include <EnergyPlus/Data/BaseData.hh>
      56              : #include <EnergyPlus/DataGlobals.hh>
      57              : #include <EnergyPlus/EnergyPlus.hh>
      58              : #include <EnergyPlus/FluidProperties.hh>
      59              : #include <EnergyPlus/PlantComponent.hh>
      60              : 
      61              : namespace EnergyPlus {
      62              : 
      63              : // Forward declarations
      64              : struct EneryPlusData;
      65              : 
      66              : namespace RefrigeratedCase {
      67              : 
      68              :     // Walk In Cooler Stock Door Protection types
      69              :     enum class WIStockDoor
      70              :     {
      71              :         Invalid = -1,
      72              :         None,
      73              :         AirCurtain,
      74              :         StripCurtain,
      75              :         Num,
      76              :     };
      77              : 
      78              :     // Compressor suction pressure control
      79              :     enum class CompressorSuctionPressureCtrl
      80              :     {
      81              :         Invalid = -1,
      82              :         FloatSuctionTemperature,
      83              :         ConstantSuctionTemperature,
      84              :         Num,
      85              :     };
      86              : 
      87              :     // Subcooler type
      88              :     enum class SubcoolerType
      89              :     {
      90              :         Invalid = -1,
      91              :         LiquidSuction,
      92              :         Mechanical,
      93              :         Num,
      94              :     };
      95              : 
      96              :     // Walk In Cooler Defrost Control type
      97              :     enum class DefrostCtrlType
      98              :     {
      99              :         Invalid = -1,
     100              :         Sched,
     101              :         TempTerm,
     102              :         Num
     103              :     };
     104              : 
     105              :     // Secondary loop parameters
     106              :     enum class SecFluidType
     107              :     {
     108              :         Invalid = -1,
     109              :         AlwaysLiquid,
     110              :         PhaseChange,
     111              :         Num
     112              :     };
     113              : 
     114              :     enum class SecPumpCtrl
     115              :     {
     116              :         Invalid = -1,
     117              :         Constant,
     118              :         Variable,
     119              :         Num
     120              :     };
     121              : 
     122              :     // Refrigerated display case energy equation form
     123              :     enum class EnergyEqnForm
     124              :     {
     125              :         Invalid = -1,
     126              :         None,
     127              :         CaseTemperatureMethod,
     128              :         RHCubic,
     129              :         DPCubic,
     130              :         Num
     131              :     };
     132              : 
     133              :     // Cascade condenser temperature control types
     134              :     enum class CascadeCndsrTempCtrlType
     135              :     {
     136              :         Invalid = -1,
     137              :         TempSet,
     138              :         TempFloat,
     139              :         Num
     140              :     };
     141              : 
     142              :     // Water-cooled condenser loop flow type
     143              :     enum class CndsrFlowType : int
     144              :     {
     145              :         Invalid = -1,
     146              :         Variable,
     147              :         Constant,
     148              :         Num
     149              :     };
     150              : 
     151              :     // Air- and evap-cooled condenser fan speed control types
     152              :     enum class FanSpeedCtrlType
     153              :     {
     154              :         Invalid = -1,
     155              :         VariableSpeed,
     156              :         ConstantSpeedLinear,
     157              :         TwoSpeed,
     158              :         ConstantSpeed,
     159              :         Num
     160              :     };
     161              : 
     162              :     // Refrigerated display case rack heat rejection location
     163              :     enum class HeatRejLocation
     164              :     {
     165              :         Invalid = -1,
     166              :         Outdoors,
     167              :         Zone,
     168              :         Num
     169              :     };
     170              : 
     171              :     // Refrigerated display case defrost type
     172              :     enum class RefCaseDefrostType
     173              :     {
     174              :         Invalid = -1,
     175              :         None,
     176              :         OffCycle,
     177              :         HotFluid,
     178              :         HotFluidTerm,
     179              :         Electric,
     180              :         ElectricOnDemand,
     181              :         ElectricTerm,
     182              :         Num
     183              :     };
     184              : 
     185              :     // Anti-sweat heater control type
     186              :     enum class ASHtrCtrlType
     187              :     {
     188              :         Invalid = -1,
     189              :         None,
     190              :         Constant,
     191              :         Linear,
     192              :         DewPoint,
     193              :         HeatBalance,
     194              :         Num
     195              :     };
     196              : 
     197              :     // Compressor rating types
     198              :     enum class CompRatingType
     199              :     {
     200              :         Invalid = -1,
     201              :         Superheat,
     202              :         ReturnGasTemperature,
     203              :         Subcooling,
     204              :         LiquidTemperature,
     205              :         Num
     206              :     };
     207              : 
     208              :     // Condenser evap cooling water supply
     209              :     enum class WaterSupply
     210              :     {
     211              :         Invalid = -1,
     212              :         FromMains,
     213              :         FromTank,
     214              :         Num
     215              :     };
     216              : 
     217              :     enum class RatingType
     218              :     {
     219              :         Invalid = -1,
     220              :         RatedCapacityTotal,
     221              :         EuropeanSC1Std,
     222              :         EuropeanSC1Nom,
     223              :         EuropeanSC2Std,
     224              :         EuropeanSC2Nom,
     225              :         EuropeanSC3Std,
     226              :         EuropeanSC3Nom,
     227              :         EuropeanSC4Std,
     228              :         EuropeanSC4Nom,
     229              :         EuropeanSC5Std,
     230              :         EuropeanSC5Nom,
     231              :         UnitLoadFactorSens,
     232              :         Num
     233              :     };
     234              : 
     235              :     enum class SHRCorrectionType
     236              :     {
     237              :         Invalid = -1,
     238              :         SHR60,
     239              :         QuadraticSHR,
     240              :         European,
     241              :         TabularRH_DT1_TRoom,
     242              :         Num
     243              :     };
     244              : 
     245              :     enum class VerticalLoc
     246              :     {
     247              :         Invalid = -1,
     248              :         Ceiling,
     249              :         Middle,
     250              :         Floor,
     251              :         Num
     252              :     };
     253              : 
     254              :     enum class SourceType
     255              :     {
     256              :         Invalid = -1,
     257              :         DetailedSystem,
     258              :         SecondarySystem,
     259              :         Num
     260              :     };
     261              : 
     262              :     // Warehouse coil Defrost type
     263              :     enum class DefrostType
     264              :     {
     265              :         Invalid = -1,
     266              :         Fluid,
     267              :         Elec,
     268              :         None,
     269              :         OffCycle,
     270              :         Num
     271              :     };
     272              : 
     273              :     enum class CriticalType
     274              :     {
     275              :         Invalid = -1,
     276              :         Subcritical,
     277              :         Transcritical,
     278              :         Num
     279              :     };
     280              : 
     281              :     enum class IntercoolerType
     282              :     {
     283              :         Invalid = -1,
     284              :         None,
     285              :         Flash,
     286              :         ShellAndCoil,
     287              :         Num
     288              :     };
     289              : 
     290              :     enum class TransSysType
     291              :     {
     292              :         Invalid = -1,
     293              :         SingleStage,
     294              :         TwoStage,
     295              :         Num
     296              :     };
     297              : 
     298              :     struct RefrigCaseData
     299              :     {
     300              :         std::string Name;                                             // Name of refrigerated display case
     301              :         std::string ZoneName;                                         // Zone or Location of Display Case
     302              :         int NumSysAttach = 0;                                         // Number of systems attached to case, error if /=1
     303              :         Sched::Schedule *availSched = nullptr;                        // Availability schedule
     304              :         int ZoneNodeNum = 0;                                          // Index to Zone Node
     305              :         int ActualZoneNum = 0;                                        // Index to Zone
     306              :         int ZoneRANode = 0;                                           // Node number of return node in zone
     307              :         Real64 RatedAmbientTemp = 0.0;                                // Rated ambient (zone) temperature
     308              :         Real64 RatedAmbientRH = 0.0;                                  // Rated ambient (zone) relative humidity
     309              :         Real64 RatedAmbientDewPoint = 0.0;                            // Rated ambient (zone) dew point temperature
     310              :         Real64 RateTotCapPerLength = 0.0;                             // Gross total cooling capacity at rated conditions [W/m]
     311              :         Real64 RatedLHR = 0.0;                                        // Latent heat ratio (lat cap/total cap) at rated conditions
     312              :         Real64 RatedRTF = 0.0;                                        // Run time fraction at rated conditions
     313              :         int LatCapCurvePtr = 0;                                       // Index for latent case credit modifier curve
     314              :         int DefCapCurvePtr = 0;                                       // Index for defrost load modifier curve
     315              :         EnergyEqnForm LatentEnergyCurveType = EnergyEqnForm::Invalid; // Type of latent case credit curve:
     316              :         // 1=Case Temperature Method, 2=RH cubic, 3=DP cubic
     317              :         EnergyEqnForm DefrostEnergyCurveType = EnergyEqnForm::Invalid; // Type of defrost energy curve:
     318              :         // 1=Case Temperature Method, 2=RH cubic, 3=DP cubic
     319              :         Real64 STDFanPower = 0.0;                                    // Standard power of case fan [W/m] for case credit calc
     320              :         Real64 OperatingFanPower = 0.0;                              // Operating power of refrigerated case fan [W/m]
     321              :         Real64 RatedLightingPower = 0.0;                             // Rated (consis w RateTotCapPerLength) power of refrigerated case lights [W/m]
     322              :         Real64 LightingPower = 0.0;                                  // Installed power of refrigerated case lights [W/m]
     323              :         Sched::Schedule *lightingSched = nullptr;                    // case lighting schedule
     324              :         Real64 AntiSweatPower = 0.0;                                 // Rated power of refrigerated case anti-sweat heaters [W/m]
     325              :         Real64 MinimumASPower = 0.0;                                 // Minimum power output of case anti-sweat heaters [W/m]
     326              :         ASHtrCtrlType AntiSweatControlType = ASHtrCtrlType::Invalid; // Type of anti-sweat heater control:
     327              :         // 0=None,1=Constant,2=Linear,3=DewPoint,4=HeatBalance
     328              :         Real64 HumAtZeroAS = 0.0;                                     // Relative humidity for zero AS heater output using linear control
     329              :         Real64 Height = 0.0;                                          // case height for AS heater with heat balance control
     330              :         RefCaseDefrostType defrostType = RefCaseDefrostType::Invalid; // Case defrost control type, Off-cycle,Timed,Hot-gas,Electric
     331              :         Real64 DefrostPower = 0.0;                                    // Rated power of refrigerated case defrost [W/m]
     332              :         Sched::Schedule *defrostSched = nullptr;                      // defrost schedule
     333              :         Sched::Schedule *defrostDripDownSched = nullptr;              // correct fail-safe schedule
     334              :         Real64 Length = 0.0;                                          // Length of refrigerated case [m]
     335              :         Real64 Temperature = 0.0;                                     // Rated case temperature [C]
     336              :         Real64 RAFrac = 0.0;                                          // HVAC under case return air fraction [0-1]
     337              :         Sched::Schedule *stockingSched = nullptr;                     // product stocking schedule
     338              :         Real64 LightingFractionToCase = 0.0;                          // Fraction of lighting energy that directly contributes to the
     339              :         // case cooling load. The remainder contributes to the zone load
     340              :         // (air heat balance).
     341              :         Real64 ASHeaterFractionToCase = 0.0; // Fraction of anti-sweat heater energy that results in a direct
     342              :         // heat load to the case. The remainder is a heating load
     343              :         // to the zone where the refrigerated case is located.
     344              :         Real64 DesignSensCaseCredit = 0.0;              // Design sensible case credit applied to zone load
     345              :         Real64 EvapTempDesign = 0.0;                    // Design evaporator temperature
     346              :         Real64 RefrigInventory = 0.0;                   // Design refrigerant inventory [kg/m]
     347              :         Real64 DesignRefrigInventory = 0.0;             // Design refrigerant inventory [kg total for the case]
     348              :         Real64 DesignRatedCap = 0.0;                    // Design total case capacity=RatedTotCap*Length [W]
     349              :         Real64 DesignLatentCap = 0.0;                   // Design latent case capacity=DesignRAtedCap*LatentHeatRatio*RTF [W]
     350              :         Real64 DesignDefrostCap = 0.0;                  // Design defrost case capacity=DefrostPower*Length [W]
     351              :         Real64 DesignLighting = 0.0;                    // Design case lighting=LightingPower*Length [W]
     352              :         Real64 DesignFanPower = 0.0;                    // Design power of case fan=Operatingpower*Length [W]
     353              :         Real64 StoredEnergy = 0.0;                      // Cumulative Stored Energy not met by evaporator [J]
     354              :         Real64 StoredEnergySaved = 0.0;                 // Cumulative Stored Energy not met by evaporator [J]
     355              :         Sched::Schedule *caseCreditFracSched = nullptr; // case credit reduction schedule
     356              :         // Report Variables
     357              :         Real64 TotalCoolingLoad = 0.0;         // Refrigerated case total cooling rate (W)
     358              :         Real64 TotalCoolingEnergy = 0.0;       // Refrigerated case total cooling energy (J)
     359              :         Real64 SensCoolingEnergyRate = 0.0;    // Refrigerated case sensible cooling rate (W)
     360              :         Real64 SensCoolingEnergy = 0.0;        // Refrigerated case sensible cooling energy (J)
     361              :         Real64 LatCoolingEnergyRate = 0.0;     // Refrigerated case latent cooling rate (W)
     362              :         Real64 LatCoolingEnergy = 0.0;         // Refrigerated case latent cooling energy (J)
     363              :         Real64 SensZoneCreditRate = 0.0;       // Refrigerated case sensible zone credit rate (W)
     364              :         Real64 SensZoneCreditCoolRate = 0.0;   // Refrigerated case sensible cooling zone credit rate (W)
     365              :         Real64 SensZoneCreditCool = 0.0;       // Refrigerated case sensible cooling zone credit energy (J)
     366              :         Real64 SensZoneCreditHeatRate = 0.0;   // Refrigerated case sensible heating zone credit rate (W)
     367              :         Real64 SensZoneCreditHeat = 0.0;       // Refrigerated case sensible heating zone credit energy (J)
     368              :         Real64 LatZoneCreditRate = 0.0;        // Refrigerated case latent zone credit rate (W)
     369              :         Real64 LatZoneCredit = 0.0;            // Refrigerated case latent zone credit energy (J)
     370              :         Real64 SensHVACCreditRate = 0.0;       // Refrigerated case sensible HVAC credit rate (W)
     371              :         Real64 SensHVACCreditCoolRate = 0.0;   // Refrigerated case sensible cooling HVAC credit rate (W)
     372              :         Real64 SensHVACCreditCool = 0.0;       // Refrigerated case sensible cooling HVAC credit energy (J)
     373              :         Real64 SensHVACCreditHeatRate = 0.0;   // Refrigerated case sensible heating HVAC credit rate (W)
     374              :         Real64 SensHVACCreditHeat = 0.0;       // Refrigerated case sensible heating HVAC credit energy (J)
     375              :         Real64 LatHVACCreditRate = 0.0;        // Refrigerated case latent HVAC credit rate (W)
     376              :         Real64 LatHVACCredit = 0.0;            // Refrigerated case latent HVAC credit energy (J)
     377              :         Real64 ElecAntiSweatPower = 0.0;       // Refrigerated case anti-sweat heater rate (W)
     378              :         Real64 ElecAntiSweatConsumption = 0.0; // Refrigerated case anti-sweat heater energy (J)
     379              :         Real64 ElecFanPower = 0.0;             // Refrigerated case fan electric power (W)
     380              :         Real64 ElecFanConsumption = 0.0;       // Refrigerated case fan electric energy (J)
     381              :         Real64 ElecLightingPower = 0.0;        // Refrigerated case lighting electric power (W)
     382              :         Real64 ElecLightingConsumption = 0.0;  // Refrigerated case lighting electric energy (J)
     383              :         Real64 ElecDefrostPower = 0.0;         // Refrigerated case defrost rate (W)
     384              :         Real64 ElecDefrostConsumption = 0.0;   // Refrigerated case defrost energy (J)
     385              :         Real64 DefEnergyCurveValue = 0.0;      // Refrigerated case defrost capacity modifier
     386              :         Real64 LatEnergyCurveValue = 0.0;      // Refrigerated case latent capacity modifier
     387              :         Real64 MaxKgFrost = 0.0;               // Amount of frost formation to initiate defrost for On Demand
     388              :         Real64 Rcase = 0.0;                    // Case wall resistance for AS heater calc (h-sqm-C/W)
     389              :         Real64 DefrostEnergy = 0.0;            // Refrigerated case defrost energy (J)
     390              :         Real64 StockingEnergy = 0.0;           // Refrigerated case product stocking energy (J)
     391              :         Real64 WarmEnvEnergy = 0.0;            // Refrigerated case extra sensible energy due to warm zone ambient (J)
     392              :         Real64 KgFrost = 0.0;                  // Amount of frost on case evaporator (Kg)
     393              :         Real64 DefrostEnergySaved = 0.0;       // Refrigerated case defrost energy (J)
     394              :         Real64 StockingEnergySaved = 0.0;      // Refrigerated case product stocking energy (J)
     395              :         Real64 WarmEnvEnergySaved = 0.0;       // Refrigerated case extra sensible energy due to warm zone ambient (J)
     396              :         Real64 KgFrostSaved = 0.0;             // Amount of frost on case evaporator (Kg)
     397              :         Real64 HotDefrostCondCredit = 0.0;     // Used to credit condenser when heat reclaim used for hot gas/brine defrost (W)
     398              :         Real64 DeltaDefrostEnergy = 0.0;       // Used to reverse accumulation if the zone/load time step is repeated (J)
     399              :         bool ShowStoreEnergyWarning = true;
     400              :         bool ShowFrostWarning = true;
     401              : 
     402              :         // Reset Initialization Values to Zeros
     403            3 :         void reset_init()
     404              :         {
     405            3 :             TotalCoolingLoad = 0.0;
     406            3 :             TotalCoolingEnergy = 0.0;
     407            3 :             SensCoolingEnergyRate = 0.0;
     408            3 :             SensCoolingEnergy = 0.0;
     409            3 :             LatCoolingEnergyRate = 0.0;
     410            3 :             LatCoolingEnergy = 0.0;
     411            3 :             SensZoneCreditRate = 0.0;
     412            3 :             SensZoneCreditCoolRate = 0.0;
     413            3 :             SensZoneCreditCool = 0.0;
     414            3 :             SensZoneCreditHeatRate = 0.0;
     415            3 :             SensZoneCreditHeat = 0.0;
     416            3 :             LatZoneCreditRate = 0.0;
     417            3 :             LatZoneCredit = 0.0;
     418            3 :             SensHVACCreditRate = 0.0;
     419            3 :             SensHVACCreditCoolRate = 0.0;
     420            3 :             SensHVACCreditCool = 0.0;
     421            3 :             SensHVACCreditHeatRate = 0.0;
     422            3 :             SensHVACCreditHeat = 0.0;
     423            3 :             LatHVACCreditRate = 0.0;
     424            3 :             LatHVACCredit = 0.0;
     425            3 :             ElecFanPower = 0.0;
     426            3 :             ElecFanConsumption = 0.0;
     427            3 :             ElecAntiSweatPower = 0.0;
     428            3 :             ElecAntiSweatConsumption = 0.0;
     429            3 :             ElecLightingPower = 0.0;
     430            3 :             ElecLightingConsumption = 0.0;
     431            3 :             ElecDefrostPower = 0.0;
     432            3 :             ElecDefrostConsumption = 0.0;
     433            3 :             DefEnergyCurveValue = 0.0;
     434            3 :             LatEnergyCurveValue = 0.0;
     435            3 :             HotDefrostCondCredit = 0.0;
     436            3 :         }
     437              : 
     438              :         // Reset Accumulation and Carry-Over Values to Zeros
     439            0 :         void reset_init_accum()
     440              :         {
     441            0 :             DefrostEnergy = 0.0;
     442            0 :             StockingEnergy = 0.0;
     443            0 :             WarmEnvEnergy = 0.0;
     444            0 :             KgFrost = 0.0;
     445            0 :             StoredEnergy = 0.0;
     446            0 :         }
     447              : 
     448              :         void CalculateCase(EnergyPlusData &state); // Absolute pointer to refrigerated case
     449              :     };
     450              : 
     451              :     struct RefrigRackData : PlantComponent
     452              :     {
     453              :         int MyIdx = 0;                             // Index number
     454              :         bool CoilFlag = false;                     // Flag to show if coil type load on rack
     455              :         std::string Name;                          // Name of Refrigeration Compressor rack
     456              :         std::string SupplyTankName;                // Evap water supply tank name
     457              :         std::string EndUseSubcategory = "General"; // Rack end-use subcategory
     458              :         // Index of refrigerated case (1 to NumCases) connected to rack #X
     459              :         Array1D_int CaseNum;
     460              :         Array1D_int CoilNum;
     461              :         Array1D_int WalkInNum;
     462              :         HeatRejLocation HeatRejectionLocation = HeatRejLocation::Invalid; // Refrigeration Compressor Rack heat rejection location
     463              :         DataHeatBalance::RefrigCondenserType CondenserType =
     464              :             DataHeatBalance::RefrigCondenserType::Invalid;        // Specifies cooling mode for outdoor condenser
     465              :         Real64 LaggedUsedWaterHeater = 0.0;                       // Heat reclaim used to heat water in previous zone/load time step(W)
     466              :         Real64 LaggedUsedHVACCoil = 0.0;                          // Heat reclaim used to heat HVAC coil in previous zone/load time step(W)
     467              :         Real64 EvapEffect = 0.9;                                  // Effectiveness of evaporative condenser
     468              :         Real64 CondenserAirFlowRate = 0.0;                        // Evaporative condenser air volume flow rate (m3/s)
     469              :         Real64 EvapPumpPower = 0.0;                               // Evaporative cooling water pump power (W)
     470              :         Real64 ActualEvapPumpPower = 0.0;                         // Evaporative cooling water pump power, if adjusted (W)
     471              :         Real64 EvapPumpConsumption = 0.0;                         // Evaporative cooling water pump electric consumption (J)
     472              :         Real64 EvapWaterConsumpRate = 0.0;                        // Evaporative condenser water consumption rate (m3/s)
     473              :         Real64 EvapWaterConsumption = 0.0;                        // Evaporative condenser water consumption (m3)
     474              :         Sched::Schedule *evapAvailSched = nullptr;                // evap condenser availability schedule
     475              :         Real64 BasinHeaterPowerFTempDiff = 0.0;                   // Basin heater capacity per degree K below setpoint (W/K)
     476              :         Real64 BasinHeaterSetPointTemp = 2.0;                     // Setpoint temperature for basin heater operation (C)
     477              :         Real64 BasinHeaterPower = 0.0;                            // Power demand from basin heater (W)
     478              :         Real64 BasinHeaterConsumption = 0.0;                      // Electric consumption from basin heater (J)
     479              :         Real64 RatedCOP = 0.0;                                    // Rated coefficient of performance for compressor rack (W/W)
     480              :         int COPFTempPtr = 0;                                      // Index to the correct COP curve object
     481              :         int NumCases = 0;                                         // Total number of refrigerated cases attached to each rack
     482              :         int NumCoils = 0;                                         // Total number of air chillers attached to each rack
     483              :         int NumWalkIns = 0;                                       // Total number of walk-ins attached to each rack
     484              :         WaterSupply EvapWaterSupplyMode = WaterSupply::FromMains; // Source of water for evap condenser cooling
     485              :         int EvapWaterSupTankID = 0;                               // TankID when evap condenser uses water from storage tank
     486              :         int EvapWaterTankDemandARRID = 0;                         // Demand index when evap condenser uses water from storage tank
     487              :         int OutsideAirNodeNum = 0;                                // Outside air node number
     488              :         int HeatRejectionZoneNum = 0;                             // Heat rejection zone number used when walk-ins present and ht rej to zone
     489              :         int HeatRejectionZoneNodeNum = 0;                         // Heat rejection zone node number used when walk-ins present and ht rej to zone
     490              :         Real64 TotalRackLoad = 0.0;                               // Total capacity of all refrigerated cases on rack
     491              :         Real64 RackCompressorCOP = 0.0;                           // Rack compressor COP at specific operating conditions
     492              :         Real64 RackCompressorPower = 0.0;                         // Total rack compressor power (W)
     493              :         Real64 RackElecConsumption = 0.0;                         // Total rack compressor electric consumption (J)
     494              :         Real64 RackCapacity = 0.0;                                // Total rack delivered capacity (W)
     495              :         Real64 RackCoolingEnergy = 0.0;                           // Total rack delivered energy (J)
     496              :         Real64 CondenserFanPower = 0.0;                           // Condenser fan power (W)
     497              :         int TotCondFTempPtr = 0;                                  // Index for condenser fan power modifier curve
     498              :         // (function of outdoor temperature)
     499              :         Real64 ActualCondenserFanPower = 0.0;             // Rack condenser fan power (W)
     500              :         Real64 CondenserFanConsumption = 0.0;             // Rack condenser fan electric consumption (J)
     501              :         Real64 SensZoneCreditHeatRate = 0.0;              // Rack sensible heating zone credit rate (W)
     502              :         Real64 SensZoneCreditHeat = 0.0;                  // Rack sensible heating zone credit energy (J)
     503              :         Real64 SensHVACCreditHeatRate = 0.0;              // Rack sensible heating HVAC credit rate (W)
     504              :         Real64 SensHVACCreditHeat = 0.0;                  // Rack sensible heating HVAC credit energy (J)
     505              :         int EvapFreezeWarnIndex = 0;                      // Recurring freeze warning index
     506              :         int NoFlowWarnIndex = 0;                          // No cooling water when needed warning index
     507              :         int HighTempWarnIndex = 0;                        // Water outlet high temp warning index
     508              :         int LowTempWarnIndex = 0;                         // Water outlet low temp warning index
     509              :         int HighFlowWarnIndex = 0;                        // Water outlet high flow warning index
     510              :         int HighInletWarnIndex = 0;                       // Water inlet high temp warning index
     511              :         int InletNode = 0;                                // Water-cooled condenser inlet node number
     512              :         Real64 InletTemp = 0.0;                           // Water-cooling condenser inlet temperature (C)
     513              :         int OutletNode = 0;                               // Water-cooled condenser outlet node number
     514              :         int PlantTypeOfNum = 0;                           // Water-cooled condenser plant equipment type
     515              :         PlantLocation plantLoc;                           // Water-cooled condenser plant location
     516              :         Real64 OutletTemp = 0.0;                          // Water-cooling condenser outlet temperature (C)
     517              :         Sched::Schedule *outletTempSched = nullptr;       // Schedule for condenser outlet temp setting
     518              :         Real64 VolFlowRate = 0.0;                         // Water-cooled condenser volumetric flow rate (m3/s)
     519              :         Real64 DesVolFlowRate = 0.0;                      // Water-cooled condenser design volumetric flow rate (m3/s)
     520              :         Real64 MassFlowRate = 0.0;                        // Water-cooled condenser mass flow rate (kg/s)
     521              :         Real64 CondLoad = 0.0;                            // Total condenser load (W)
     522              :         Real64 CondEnergy = 0.0;                          // Condenser energy (J)
     523              :         CndsrFlowType FlowType = CndsrFlowType::Variable; // Water-cooled condenser loop flow type
     524              :         Real64 VolFlowRateMax = 0.0;                      // Maximum condenser volumetric flow rate (m3/s)
     525              :         Real64 MassFlowRateMax = 0.0;                     // Maximum condenser mass flow rate (kg/s)
     526              :         Real64 InletTempMin = 10.0;                       // Minimum condenser water inlet temperature (C)
     527              :         Real64 OutletTempMax = 55.0;                      // Maximum condenser water outlet temperature (C)
     528              :         Real64 TotalCoolingLoad = 0.0;
     529              :         bool ShowCOPWarning = true;
     530              : 
     531              :         // Reset Initialization Values to Zeros
     532            5 :         void reset_init()
     533              :         {
     534            5 :             SensHVACCreditHeatRate = 0.0;
     535            5 :             SensHVACCreditHeat = 0.0;
     536            5 :             SensZoneCreditHeatRate = 0.0;
     537            5 :             SensZoneCreditHeat = 0.0;
     538            5 :             CondLoad = 0.0;
     539            5 :             CondEnergy = 0.0;
     540            5 :             MassFlowRate = 0.0;
     541            5 :             RackElecConsumption = 0.0;
     542            5 :             CondenserFanConsumption = 0.0;
     543            5 :             EvapPumpConsumption = 0.0;
     544            5 :             RackCompressorPower = 0.0;
     545            5 :             ActualCondenserFanPower = 0.0;
     546            5 :             ActualEvapPumpPower = 0.0;
     547            5 :         }
     548              : 
     549              :         void UpdateCondenserOutletNode(EnergyPlusData &state) const;
     550              : 
     551              :         void CalcRackSystem(EnergyPlusData &state);
     552              : 
     553              :         void ReportRackSystem(EnergyPlusData &state, int RackNum);
     554              : 
     555              :         static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName);
     556              : 
     557              :         void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation) override;
     558              : 
     559              :         void simulate([[maybe_unused]] EnergyPlusData &state,
     560              :                       const PlantLocation &calledFromLocation,
     561              :                       bool FirstHVACIteration,
     562              :                       Real64 &CurLoad,
     563              :                       bool RunFlag) override;
     564              : 
     565              :         void oneTimeInit(EnergyPlusData &state) override;
     566              : 
     567              :         void oneTimeInit_new(EnergyPlusData &state) override;
     568              :     };
     569              : 
     570              :     struct RefrigSystemData
     571              :     {
     572              :         std::string Name;            // Name of refrigeration system
     573              :         std::string RefrigerantName; // Name of refrigerant, must match name in FluidName
     574              :         Fluid::RefrigProps *refrig = nullptr;
     575              :         std::string EndUseSubcategory;       // Used for reporting purposes
     576              :         bool SystemRejectHeatToZone = false; // Flag to show air-cooled condenser located inside zone
     577              :         bool CoilFlag = false;               // Flag to show if coil type load on system (even if below in a secondary)
     578              :         Array1D_int CascadeLoadNum;          // absolute index  of condensers placing load (allocated NumCondensers)
     579              :         Array1D_int CaseNum;                 // absolute Index of cases (allocated NumCases)
     580              :         Array1D_int CoilNum;                 // absolute Index of coils (allocated NumCoils)
     581              :         Array1D_int CompressorNum;           // absolute Index of compressors (allocated NumCompressors)
     582              :         Array1D_int CondenserNum;            // absolute Index of condensers removing load (allocated NumCondensers)
     583              :         Array1D_int GasCoolerNum;            // absolute Index of gas cooler
     584              :         Array1D_int HiStageCompressorNum;    // absolute Index of high-stage compressors (allocated NumHiStageCompressors)
     585              :         Array1D_int SecondaryNum;            // absolute Index of seocndary loops (allocated NumSecondarys)
     586              :         Array1D_int SubcoolerNum;            // Absolute Index of subcoolers (allocated NumSubcoolers)
     587              :         Array1D_int WalkInNum;               // absolute Index of walk ins (allocated NumWalkIns)
     588              :         CompressorSuctionPressureCtrl CompSuctControl = CompressorSuctionPressureCtrl::ConstantSuctionTemperature; // Index to suction control
     589              :         int HiStageWarnIndex1 = 0;                                  // Recurring warning index when hi stage compressors unable to meet coil loads
     590              :         int HiStageWarnIndex2 = 0;                                  // Recurring warning index when hi stage compressors unable to meet coil loads
     591              :         int InsuffCapWarn = 0;                                      // Recurring warning index when refrigeration system unable to meet coil loads
     592              :         IntercoolerType intercoolerType = IntercoolerType::Invalid; // Intercooler type (0=none, 1=flash intercooler, 2=shell-and-coil intercooler)
     593              :         int NumCases = 0;                                           // Number of cases on this system
     594              :         int NumCoils = 0;                                           // Number of cases on this system
     595              :         int NumCompressors = 0;                                     // Number of compressors on this system for single-stage systems
     596              :         // or number of low-stage compressors on this system for two-stage systems
     597              :         int NumCondensers = 1;         // Number of condensers on this system
     598              :         int NumGasCoolers = 0;         // Number of gas coolers on this system
     599              :         int NumHiStageCompressors = 0; // Number of high-stage compressors on this system (two-stage systems only)
     600              :         int NumSecondarys = 0;         // Number of secondary loops on this system
     601              :         int NumStages = 1;             // Number of compressor stages
     602              :         int NumSubcoolers = 0;         // Number of subcoolers on this system
     603              :         int NumWalkIns = 0;            // Number of walk in coolers on this system
     604              :         int NumMechSCServed = 0;       // Number of mech subcoolers served/powered by compressor/cond on this system
     605              :         int NumNonCascadeLoads = 0;    // Sum of NumCases, NumWalk-Ins, NumCoils, and NumSecondarys
     606              :         int NumCascadeLoads = 0;       // Number of cascade condensers cooled by this system
     607              :         int NumTransferLoads = 0;      // Sum of NumCascadeLoads and NumSecondarys
     608              :         //   and used thereafter
     609              :         int SuctionPipeActualZoneNum = 0;      // ID number for zone where suction pipes gain heat
     610              :         int SuctionPipeZoneNodeNum = 0;        // ID number for zone node where suction pipes gain heat
     611              :         Array1D<Real64> MechSCLoad;            // Mechanical subcooler load on system from other systems(W)
     612              :         Real64 AverageCompressorCOP = 0.0;     // Average COP for compressors on this system (W)
     613              :         Real64 CpSatLiqCond = 0.0;             // Spec Heat of sat liquid at condensing pressure  (J/kg-C)
     614              :         Real64 CpSatVapEvap = 0.0;             // Spec Heat of saturated vapor exiting evaporator (J/kg-C)
     615              :         Real64 FlowRatioIntercooler = 0.0;     // Refrigerant mass flow ratio through coil-side of shell-and-coil intercooler
     616              :         Real64 HCaseIn = 0.0;                  // Case inlet enthalpy (after subcoolers and pipe P drops) (J/kg)
     617              :         Real64 HCompIn = 0.0;                  // Compressor inlet enthalpy  (J/kg)
     618              :         Real64 HCompOut = 0.0;                 // Compressor outlet enthalpy (J/kg)
     619              :         Real64 HSatLiqCond = 0.0;              // Enthalpy of sat liquid at condensing pressure  (J/kg)
     620              :         Real64 HCaseOut = 0.0;                 // Enthalpy of refrigerant leaving cases, after superheat (J/kg)
     621              :         Real64 IntercoolerEffectiveness = 0.0; // Shell-and-coil intercooler effectiveness
     622              :         Real64 LSHXTrans = 0.0;                // Liquid suction subcooler load transferred within same suction group, W
     623              :         Real64 LSHXTransEnergy = 0.0;          // Liquid suction subcooler load transferred within same suction group, J
     624              :         Real64 NetHeatRejectLoad = 0.0;        // Portion of TotalCondenser load due to this system (after heat recovery) W
     625              :         Real64 NetHeatRejectEnergy = 0.0;      // Portion of TotalCondenser energy due to this system (after heat recovery) J
     626              :         Real64 PIntercooler = 0.0;             // Pressure in the intercooler (two-stage systems only) (Pa)
     627              :         Real64 PipeHeatLoad = 0.0;             // Total suction pipe heat gains, optional (W)
     628              :         Real64 PipeHeatEnergy = 0.0;           // Total suction pipe heat gains, optional (J)
     629              :         Real64 RefMassFlowtoLoads = 0.0;       // Total system refrigerant mass flow through cases(kg/s)
     630              :         Real64 RefMassFlowComps = 0.0;         // Total system refrigerant mass flow through compressors(kg/s)
     631              :         Real64 RefMassFlowHiStageComps = 0.0;  // Total system refrigerant mass flow through high-stage compressors(two-stage systems only) (kg/s)
     632              :         Real64 RefInventory = 0.0;             // Approximate refrigerant inventory entered by user (kg)
     633              :         Real64 SumMechSCLoad = 0.0;            // Total cooling load of all mech subcoolers served by suction group (W)
     634              :         Real64 SumMechSCBenefit = 0.0;         // Total cooling provided by mech subcoolers cooling liquid condensate in this system (W)
     635              :         Real64 SumCascadeCondCredit = 0.0;     // Sum of cond cred for hot brine/gas defrost on cases etc served by
     636              :         //    cascade condenser cooled by this system (W)
     637              :         Real64 SumCascadeLoad = 0.0;               // Total cooling load of all cascade condensers served by suction group (W)
     638              :         Real64 SumSecondaryLoopLoad = 0.0;         // Total cooling loads for all secondary loops served by this suction group (W)
     639              :         Real64 SumUASuctionPiping = 0.0;           // Sum of U*A for system suction piping (W/C)
     640              :         Real64 TCaseOut = 0.0;                     // Case out temperature including case superheat (C)
     641              :         Real64 TCondense = 0.0;                    // Condensing temperature (Tsat for P discharge) (C)
     642              :         Real64 TCompIn = 0.0;                      // Compressor inlet temperature (after case and LSHX superheat and pipe delta P) (C)
     643              :         Real64 TCondenseMin = 0.0;                 // Minimum allowed condensing temperature (C)
     644              :         Real64 TCondenseMinInput = 0.0;            // Minimum allowed condensing temperature, user's original input value (C)
     645              :         bool EMSOverrideOnTCondenseMin = false;    // if true, EMS is calling to override minimum allowed condensing temperature
     646              :         Real64 EMSOverrideValueTCondenseMin = 0.0; // value to use when EMS override is true [C]
     647              :         Real64 TEvapDesign = 0.0;                  // Min (on sys) design case/walkin/secondary evap temp
     648              :         //  (also basis for floating evap T calc) (C)
     649              :         Real64 TEvapNeeded = 0.0;            // Max Case evap temperature to maintain lowest case T on system (C)
     650              :         Real64 TIntercooler = 0.0;           // Temperature in the intercooler (two-stage systems only) (Pa)
     651              :         Real64 TLiqInActual = 0.0;           // Actual liquid temperature entering TXV after subcooling (C)
     652              :         Real64 TotalCondDefrostCredit = 0.0; // sum of heat reclaimed for hot gas and hot brine defrost for
     653              :         //    cases/WI/sec served directly [W]
     654              :         Real64 TotalCoolingEnergy = 0.0; // Total energy of all refrigerated cases and walkins served directly (J)
     655              :         Real64 TotalCoolingLoad = 0.0;   // Total load of all refrigerated cases and walkins served directly (W)
     656              :         Real64 TotalSystemLoad = 0.0;    // Includes cases, walk-ins, and transfer loads (cascade, second, subcooler), W
     657              :         Real64 TotCompPower = 0.0;       // Total power for compressors on this system (for single-stage systems) or
     658              :         // total power for low-stage compressors on this system (for two-stage systems) (W)
     659              :         Real64 TotCompElecConsump = 0.0; // Total Elec consump for compressors on this system (for single-stage systems) or
     660              :         // total elec consump for low-stage compressors on this system (for two-stage systems) (J)
     661              :         Real64 TotCompCapacity = 0.0; // Total design capacity for compressors on this system (for single-stage systems) or
     662              :         // total design capacity for low-stage compressors on this system (for two-stage systems) (W)
     663              :         Real64 TotCompCoolingEnergy = 0.0; // Total cooling energy from compressors on this system (for single-stage systems) or
     664              :         // total cooling energy from low-stage compressors on this system (for two-stage systems) (J)
     665              :         Real64 TotHiStageCompCapacity = 0.0;      // Total design capacity for high-stage compressors on this system (two-stage systems only) (W)
     666              :         Real64 TotHiStageCompCoolingEnergy = 0.0; // Total cooling energy from high-stage compressors on this system (two-stage systems only) (J)
     667              :         Real64 TotHiStageCompElecConsump = 0.0;   // Total Elec consump for high-stage compressors on this system (two-stage systems only) (J)
     668              :         Real64 TotHiStageCompPower = 0.0;         // Total power for high-stage compressors on this system (two-stage systems only) (W)
     669              :         Real64 TotCompElecConsumpTwoStage =
     670              :             0.0;                             // Total Elec consump for the low- and high-stage compressors on this system (two-stage systems only) (J)
     671              :         Real64 TotRejectHeatRecovered = 0.0; // Total reject heat recovered for hot gas or hot brine defrost or
     672              :         //     desuperheater coils (W)
     673              :         Real64 TotTransferLoad = 0.0; // Total load from other systems transferred to this sytem, incl mech subcoolers,
     674              :         // cascade, and secondary loops (W)
     675              :         Real64 TotTransferEnergy = 0.0; // Total energy from other systems transferred to this sytem, incl mech subcoolers,
     676              :         // cascade, and secondary loops (J)
     677              :         Real64 UnmetEnergy = 0.0; // Accumulative loads unmet by total compressors (for single-stage systems) or
     678              :         // by low-stage compressors (for two-stage systems) on this system (J)
     679              :         Real64 UnmetHiStageEnergy = 0.0; // Accumulative loads unmet by total high-stage compressors (two-stage systems only) on this system (J)
     680              :         Real64 UnmetEnergySaved = 0.0;   // Accumulative loads unmet by total compressors (for single-stage systems) on this system (J)
     681              : 
     682              :         // Reset Initialization Values to Zeros
     683            0 :         void reset_init()
     684              :         {
     685            0 :             TotalCoolingLoad = 0.0;
     686            0 :             TotalCondDefrostCredit = 0.0;
     687            0 :             SumSecondaryLoopLoad = 0.0;
     688            0 :             SumMechSCBenefit = 0.0;
     689            0 :             NetHeatRejectLoad = 0.0;
     690            0 :             NetHeatRejectEnergy = 0.0;
     691            0 :             AverageCompressorCOP = 0.0;
     692            0 :             TotCompCapacity = 0.0;
     693            0 :             TotHiStageCompCapacity = 0.0;
     694            0 :             TotCompElecConsump = 0.0;
     695            0 :             TotHiStageCompElecConsump = 0.0;
     696            0 :             TotCompElecConsumpTwoStage = 0.0;
     697            0 :             TotCompPower = 0.0;
     698            0 :             TotHiStageCompPower = 0.0;
     699            0 :             TotCompCoolingEnergy = 0.0;
     700            0 :             TotHiStageCompCoolingEnergy = 0.0;
     701            0 :         }
     702              : 
     703              :         void CalcDetailedSystem(EnergyPlusData &state, int SysNum);
     704              : 
     705              :         void CalculateCondensers(EnergyPlusData &state, int SysNum);
     706              : 
     707              :         void CalculateCompressors(EnergyPlusData &state);
     708              : 
     709              :         void CalculateSubcoolers(EnergyPlusData &state);
     710              :     };
     711              : 
     712              :     struct TransRefrigSystemData
     713              :     {
     714              :         std::string Name;            // Name of transcritical CO2 refrigeration system
     715              :         std::string RefrigerantName; // Name of refrigerant, must match name in FluidName
     716              :         //    (see fluidpropertiesrefdata.idf)
     717              :         Fluid::RefrigProps *refrig = nullptr;
     718              : 
     719              :         std::string EndUseSubcategory;       // Used for reporting purposes
     720              :         bool SystemRejectHeatToZone = false; // Flag to show air-cooled gas cooler located inside zone
     721              :         Array1D_int CaseNumMT;               // absolute Index of medium temperature cases (allocated NumCasesMT)
     722              :         Array1D_int CaseNumLT;               // absolute Index of low temperature cases (allocated NumCasesLT)
     723              :         Array1D_int CompressorNumHP;         // absolute Index of high pressure compressors (allocated NumCompressorsHP)
     724              :         Array1D_int CompressorNumLP;         // absolute Index of low pressure compressors (allocated NumCompressorsLP)
     725              :         Array1D_int GasCoolerNum;            // absolute Index of gas cooler
     726              :         Array1D_int WalkInNumMT;             // absolute Index of medium temperature walk ins (allocated NumWalkInsMT)
     727              :         Array1D_int WalkInNumLT;             // absolute Index of low temperature walk ins (allocated NumWalkInsLT)
     728              :         int NumCasesLT = 0;                  // Number of low temperature cases on this system
     729              :         int NumCasesMT = 0;                  // Number of medium temperature cases on this system
     730              :         int NumCompressorsHP = 0;            // Number of high pressure compressors on this system
     731              :         int NumCompressorsLP = 0;            // Number of low pressure compressors on this system
     732              :         int NumGasCoolers = 1;               // Number of gas coolers on this system
     733              :         int NumWalkInsLT = 0;                // Number of low temperature walk in coolers on this system
     734              :         int NumWalkInsMT = 0;                // Number of medium temperature walk in coolers on this system
     735              :         //   and used thereafter
     736              :         int SuctionPipeActualZoneNumMT = 0;                // ID number for zone where medium temperature suction pipes gain heat
     737              :         int SuctionPipeZoneNodeNumMT = 0;                  // ID number for zone node where medium temperature suction pipes gain heat
     738              :         int SuctionPipeActualZoneNumLT = 0;                // ID number for zone where medium temperature suction pipes gain heat
     739              :         int SuctionPipeZoneNodeNumLT = 0;                  // ID number for zone node where medium temperature suction pipes gain heat
     740              :         TransSysType transSysType = TransSysType::Invalid; // Transcritical refrigeration system type: SingleStage, TwoStage
     741              :         Real64 AverageCompressorCOP = 0.0;                 // Average COP for compressors on this system (W)
     742              :         Real64 CpSatLiqCond = 0.0;                         // Spec Heat of sat liquid at condensing pressure  (J/kg-C)
     743              :         Real64 CpSatVapEvapMT = 0.0;                       // Spec Heat of saturated vapor exiting medium temperature evaporator (J/kg-C)
     744              :         Real64 CpSatVapEvapLT = 0.0;                       // Spec Heat of saturated vapor exiting low temperature evaporator (J/kg-C)
     745              :         Real64 CpSatLiqReceiver = 0.0;                     // Spec Heat of saturated liquid in receiver (J/kg-C)
     746              :         Real64 DelHSubcoolerDis = 0.0;                     // Change in enthalpy across subcooler, hot side (J/kg)
     747              :         Real64 DelHSubcoolerSuc = 0.0;                     // Change in enthalpy across subcooler, cold side (J/kg)
     748              :         Real64 HCaseInMT = 0.0;                            // Medium temperature case inlet enthalpy (after subcoolers and pipe P drops) (J/kg)
     749              :         Real64 HCaseInLT = 0.0;                            // Low temperature case inlet enthalpy (after pipe P drops) (J/kg)
     750              :         Real64 HCompInHP = 0.0;                            // High pressure compressor inlet enthalpy  (J/kg)
     751              :         Real64 HCompInLP = 0.0;                            // Low pressure compressor inlet enthalpy  (J/kg)
     752              :         Real64 HCompOutHP = 0.0;                           // High pressure compressor outlet enthalpy (J/kg)
     753              :         Real64 HCompOutLP = 0.0;                           // Low pressure compressor outlet enthalpy (J/kg)
     754              :         Real64 HSatLiqCond = 0.0;                          // Enthalpy of sat liquid at condensing pressure  (J/kg)
     755              :         Real64 HSatLiqReceiver = 0.0;                      // Enthalpy of sat liquid in receiver (J/kg)
     756              :         Real64 HCaseOutMT = 0.0;                           // Enthalpy of refrigerant leaving medium temperature cases, after superheat (J/kg)
     757              :         Real64 HCaseOutLT = 0.0;                           // Enthalpy of refrigerant leaving low temperature cases, after superheat (J/kg)
     758              :         Real64 NetHeatRejectLoad = 0.0;                    // Portion of TotalCondenser load due to this system (after heat recovery) W
     759              :         Real64 NetHeatRejectEnergy = 0.0;                  // Portion of TotalCondenser energy due to this system (after heat recovery) J
     760              :         Real64 PipeHeatLoadMT = 0.0;                       // Total medium temperature suction pipe heat gains, optional (W)
     761              :         Real64 PipeHeatLoadLT = 0.0;                       // Total low temperature suction pipe heat gains, optional (W)
     762              :         Real64 PipeHeatEnergy = 0.0;                       // Total suction pipe heat gains, optional (J)
     763              :         Real64 PipeHeatEnergyMT = 0.0;                     // Total medium temperature suction pipe heat gains, optional (J)
     764              :         Real64 PipeHeatEnergyLT = 0.0;                     // Total low temperature suction pipe heat gains, optional (J)
     765              :         Real64 RefMassFlowtoMTLoads = 0.0;                 // Refrigerant mass flow through medium temperature cases(kg/s)
     766              :         Real64 RefMassFlowtoLTLoads = 0.0;                 // Refrigerant mass flow through low temperature cases(kg/s)
     767              :         Real64 RefMassFlowCompsHP = 0.0;                   // Total system refrigerant mass flow through high pressue compressors(kg/s)
     768              :         Real64 RefMassFlowCompsLP = 0.0;                   // Total system refrigerant mass flow through low pressue compressors(kg/s)
     769              :         Real64 RefMassFlowComps = 0.0;                     // Total system refrigerant mass flow through all compressors (kg/s)
     770              :         Real64 RefMassFlowReceiverBypass = 0.0;            // Refrigerant mass flow through receiver bypass (kg/s)
     771              :         Real64 RefInventory = 0.0;                         // Approximate refrigerant inventory entered by user (kg)
     772              :         Real64 SCEffectiveness = 0.0;                      // Heat exchanger effectiveness of the subcooler
     773              :         Real64 SumUASuctionPipingMT = 0.0;                 // Sum of U*A for medium temperature suction piping (W/C)
     774              :         Real64 SumUASuctionPipingLT = 0.0;                 // Sum of U*A for low temperature suction piping (W/C)
     775              :         Real64 TCaseOutMT = 0.0;                           // Medium temperature case out temperature including case superheat (C)
     776              :         Real64 TCaseOutLT = 0.0;                           // Low temperature case out temperature including case superheat (C)
     777              :         Real64 TCondense = 0.0;                            // Condensing temperature (Tsat for P discharge) (C)
     778              :         Real64 TReceiver = 0.0;                            // Temperature in receiver (Tsat for P receiver) (C)
     779              :         Real64 PReceiver = 0.0;                            // Pressure in receiver (Psat for T receiver) (C)
     780              :         Real64 TCompInHP = 0.0;              // High pressure compressor inlet temperature (after case and LSHX superheat and pipe delta P) (C)
     781              :         Real64 TCompInLP = 0.0;              // Low pressure compressor inlet temperature (after case and pipe delta P) (C)
     782              :         Real64 TCondenseMin = 0.0;           // Minimum allowed condensing temperature (C)
     783              :         Real64 TEvapDesignMT = 0.0;          // Min (on sys) design medium temperature case/walkin/secondary evap temp
     784              :         Real64 TEvapDesignLT = 0.0;          // Min (on sys) design low temperature case/walkin/secondary evap temp
     785              :         Real64 TEvapNeededMT = 0.0;          // Max MT Case evap temperature to maintain lowest case T on system (C)
     786              :         Real64 TEvapNeededLT = 0.0;          // Max LT Case evap temperature to maintain lowest case T on system (C)
     787              :         Real64 TLiqInActual = 0.0;           // Actual liquid temperature entering TXV after subcooling (C)
     788              :         Real64 TotalCondDefrostCredit = 0.0; // sum of heat reclaimed for hot gas and hot brine defrost for cases/WI served directly [W]
     789              :         Real64 TotalCoolingEnergy = 0.0;     // Total energy of all refrigerated cases and walkins served directly (J)
     790              :         Real64 TotalCoolingEnergyMT = 0.0;   // Total energy of all medium temperature refrigerated cases and walkins served directly (J)
     791              :         Real64 TotalCoolingEnergyLT = 0.0;   // Total energy of all low temperature refrigerated cases and walkins served directly (J)
     792              :         Real64 TotalCoolingLoadMT = 0.0;     // Total medium temperature load of all refrigerated cases and walkins served directly (W)
     793              :         Real64 TotalCoolingLoadLT = 0.0;     // Total low temperature load of all refrigerated cases and walkins served directly (W)
     794              :         Real64 TotalSystemLoad = 0.0;        // Sum of MT and LT loads, W
     795              :         Real64 TotalSystemLoadMT = 0.0;      // Includes medium temperature cases and walk-ins, W
     796              :         Real64 TotalSystemLoadLT = 0.0;      // Includes low temperature cases and walk-ins, W
     797              :         Real64 TotCompPowerHP = 0.0;         // Total power for high pressure compressors on this system (W)
     798              :         Real64 TotCompPowerLP = 0.0;         // Total power for low pressure compressors on this system (W)
     799              :         Real64 TotCompElecConsump = 0.0;     // Total Elec consump for compressors on this system (J)
     800              :         Real64 TotCompElecConsumpHP = 0.0;   // Total Elec consumption for high pressure compressors on this system (J)
     801              :         Real64 TotCompElecConsumpLP = 0.0;   // Total Elec consumption for low pressure compressors on this system (J)
     802              :         Real64 TotCompCapacity = 0.0;        // Sum of HP and LP compressor capacity (W)
     803              :         Real64 TotCompCapacityHP = 0.0;      // Total design capacity for high pressure compressors on this system (W)
     804              :         Real64 TotCompCapacityLP = 0.0;      // Total design capacity for low pressure compressors on this system (W)
     805              :         Real64 TotCompCoolingEnergy = 0.0;   // Total cooling energy from compressors on this system (J)
     806              :         Real64 TotCompCoolingEnergyHP = 0.0; // Total cooling energy from high pressure compressors on this system (J)
     807              :         Real64 TotCompCoolingEnergyLP = 0.0; // Total cooling energy from low pressure compressors on this system (J)
     808              :         Real64 TotRejectHeatRecovered = 0.0; // Total reject heat recovered for hot gas or hot brine defrost (W)
     809              :         Real64 UnmetEnergy = 0.0;            // Accumulative loads unmet by the LP and HP compressors on this system (J)
     810              :         Real64 UnmetEnergyMT = 0.0;          // Accumulative loads unmet by total HP compressors on this system (J)
     811              :         Real64 UnmetEnergyLT = 0.0;          // Accumulative loads unmet by total LP compressors on this system (J)
     812              :         Real64 UnmetEnergySaved = 0.0;       // Accumulative loads unmet by the LP and HP compressors on this system (J)
     813              :         Real64 UnmetEnergySavedMT = 0.0;     // Accumulative loads unmet by total HP compressors on this system (J)
     814              :         Real64 UnmetEnergySavedLT = 0.0;     // Accumulative loads unmet by total LP compressors on this system (J)
     815              : 
     816              :         // Reset Initialization Values to Zeros
     817            0 :         void reset_init()
     818              :         {
     819            0 :             TotalCoolingLoadMT = 0.0;
     820            0 :             TotalCoolingLoadLT = 0.0;
     821            0 :             TotalCondDefrostCredit = 0.0;
     822            0 :             NetHeatRejectLoad = 0.0;
     823            0 :             NetHeatRejectEnergy = 0.0;
     824            0 :             AverageCompressorCOP = 0.0;
     825            0 :             TotCompCapacityHP = 0.0;
     826            0 :             TotCompCapacityLP = 0.0;
     827            0 :             TotCompElecConsump = 0.0;
     828            0 :             TotCompPowerHP = 0.0;
     829            0 :             TotCompPowerLP = 0.0;
     830            0 :             TotCompCoolingEnergy = 0.0;
     831            0 :         }
     832              : 
     833              :         void CalcDetailedTransSystem(EnergyPlusData &state, int SysNum);
     834              : 
     835              :         void CalcGasCooler(EnergyPlusData &state, int SysNum);
     836              : 
     837              :         void CalculateTransCompressors(EnergyPlusData &state);
     838              :     };
     839              : 
     840              :     struct CaseAndWalkInListDef // Derived Type for CaseAndWalkIn Lists
     841              :     {
     842              :         std::string Name;          // Name of this CaseAndWalkIn List
     843              :         int NumCases = 0;          // Number of Cases in this CaseAndWalkIn List
     844              :         int NumCoils = 0;          // Number of Coils in this CaseAndWalkIn List
     845              :         int NumWalkIns = 0;        // Number of WalkIns in this CaseAndWalkIn List
     846              :         Array1D_int CaseItemNum;   // List of Item numbers that correspond to each Case
     847              :         Array1D_int CoilItemNum;   // List of Item numbers that correspond to each Coil
     848              :         Array1D_int WalkInItemNum; // List of Item numbers that correspond to each WalkIn
     849              :     };
     850              : 
     851              :     struct CompressorListDef // Derived Type for Compressor Lists
     852              :     {
     853              :         std::string Name;        // Name of this Compressor List
     854              :         int NumCompressors = 0;  // Number of Compressors in this Node List
     855              :         Array1D_int CompItemNum; // List of Item numbers that correspond to the compressors
     856              :     };
     857              : 
     858              :     struct RefrigCondenserData : PlantComponent
     859              :     {
     860              :         std::string Name;                          // Name of condenser
     861              :         std::string SupplyTankName;                // Evap water supply tank name
     862              :         std::string EndUseSubcategory = "General"; // Rack end-use subcategory
     863              :         bool CondenserRejectHeatToZone = false;    // Flag to show air-cooled condenser located inside zone
     864              :         bool CoilFlag = false;                     // Flag to show if coil type load on system served by condenser
     865              :         Array1D_int SysNum;                        // absolute Index of system placing load (allocated NumRefrigSystems)
     866              :         int NumSysAttach = 0;                      // Number of systems attached to condenser, error if /=1
     867              :         DataHeatBalance::RefrigCondenserType CondenserType = DataHeatBalance::RefrigCondenserType::Invalid; // Specifies cooling mode for condenser
     868              :         int EvapFreezeWarnIndex = 0;                                                                        // Recurring freeze warning index
     869              :         CndsrFlowType FlowType = CndsrFlowType::Variable;                                                   // Water-cooled condenser loop flow type
     870              :         int CondCreditWarnIndex1 = 0;                                                                       // Used to count warnings
     871              :         int CondCreditWarnIndex2 = 0;                                                                       // Used to count warnings
     872              :         int CondCreditWarnIndex3 = 0;                                                                       // Used to count warnings
     873              :         int CondCreditWarnIndex4 = 0;                                                                       // Used to count warnings
     874              :         int CondCreditWarnIndex5 = 0;                                                                       // Used to count warnings
     875              :         int CondCreditWarnIndex6 = 0;                                                                       // Used to count warnings
     876              :         int CondCreditWarnIndex7 = 0;                                                                       // Used to count warnings
     877              :         int NoFlowWarnIndex = 0;                                          // No cooling water when needed warning index
     878              :         int HighTempWarnIndex = 0;                                        // Water outlet high temp warning index
     879              :         int LowTempWarnIndex = 0;                                         // Water outlet low temp warning index
     880              :         int HighFlowWarnIndex = 0;                                        // Water outlet high flow warning index
     881              :         int HighInletWarnIndex = 0;                                       // Water inlet high temp warning index
     882              :         int InletNode = 0;                                                // Water-cooled condenser inlet node number
     883              :         Sched::Schedule *evapAvailSched = nullptr;                        // Evap condenser availability schedule
     884              :         WaterSupply EvapWaterSupplyMode = WaterSupply::FromMains;         // Source of water for evap condenser cooling
     885              :         int EvapWaterSupTankID = 0;                                       // TankID when evap condenser uses water from storage tank
     886              :         int EvapWaterTankDemandARRID = 0;                                 // Demand index when evap condenser uses water from storage tank
     887              :         int OutletNode = 0;                                               // Water-cooled condenser outlet node number
     888              :         int PlantTypeOfNum = 0;                                           // Water-cooled condenser plant equipment type
     889              :         PlantLocation plantLoc;                                           // Water-cooled condenser plant location
     890              :         Sched::Schedule *outletTempSched = nullptr;                       // Schedule for condenser outlet temp setting
     891              :         int InletAirNodeNum = 0;                                          // Inlet air node number, can be outside or in a zone
     892              :         int InletAirZoneNum = 0;                                          // Inlet air zone number, if located in a zone
     893              :         FanSpeedCtrlType FanSpeedControlType = FanSpeedCtrlType::Invalid; // fixed, two-speed, or variable
     894              :         int CapCurvePtr = 0;                                              // capcity curve pointer for air-cooled condensers
     895              :         int CascadeSysID = 0;                                             // System ID number for system rejecting heat to cascade condenser
     896              :         CascadeCndsrTempCtrlType CascadeTempControl =
     897              :             CascadeCndsrTempCtrlType::Invalid; // Determines whether cascade condenser evaporating temperature set by
     898              :         // Tevap for other loads on system (=2) or set at a constant (= 1)
     899              :         int CascadeSinkSystemID = 0; // System ID number for system absorbing condenser heat
     900              :         // INTEGER     :: ServiceType      = 1       ! Index to warehouse or supermarket (only applies to cascade condensers)
     901              :         // 1 = supermarket, 2=warehouse
     902              :         Real64 CascadeRatedEvapTemp = 0.0;      // Rated evaporating temperature in cascade condenser
     903              :         Real64 MinCondLoad = 0.0;               // minimum condenser load for air-cooled cond (W)
     904              :         Real64 TempSlope = 0.0;                 // slope for deltaT as function of heat rej for air-cooled cond (C/W)
     905              :         Real64 EvapEffect = 0.0;                // Effectiveness of evaporative condenser
     906              :         Real64 RatedAirFlowRate = 0.0;          // Evaporative condenser air volume flow rate (m3/s)
     907              :         Real64 EvapPumpPower = 0.0;             // Evaporative cooling water pump power (W)
     908              :         Real64 ActualEvapPumpPower = 0.0;       // Evaporative cooling water pump power, if adjusted (W)
     909              :         Real64 EvapPumpConsumption = 0.0;       // Evaporative cooling water pump electric consumption (J)
     910              :         Real64 EvapWaterConsumpRate = 0.0;      // Evaporative condenser water consumption rate (m3/s)
     911              :         Real64 EvapWaterConsumption = 0.0;      // Evaporative condenser water consumption (m3)
     912              :         Real64 BasinHeaterPowerFTempDiff = 0.0; // Basin heater capacity per degree K below setpoint (W/K)
     913              :         Real64 BasinHeaterSetPointTemp = 0.0;   // Setpoint temperature for basin heater operation (C)
     914              :         Real64 BasinHeaterPower = 0.0;          // Power demand from basin heater (W)
     915              :         Real64 BasinHeaterConsumption = 0.0;    // Electric consumption from basin heater (J)
     916              :         Real64 FanMinAirFlowRatio = 0.0;        // Minimum power fraction for fan (dimensionless between 0 and 1.0)
     917              :         Real64 RatedFanPower = 0.0;             // Rated Condenser fan power (W)
     918              :         Real64 ActualFanPower = 0.0;            // Condenser fan power (W)
     919              :         Real64 FanElecEnergy = 0.0;             // Condenser fan electric consumption (J)
     920              :         Real64 InletTemp = 0.0;                 // Water-cooling condenser inlet temperature (C)
     921              :         Real64 OutletTemp = 0.0;                // Water-cooling condenser outlet temperature (C)
     922              :         Real64 VolFlowRate = 0.0;               // Water-cooled condenser volumetric flow rate (m3/s)
     923              :         Real64 DesVolFlowRate = 0.0;            // Water-cooled condenser design volumetric flow rate (m3/s)
     924              :         Real64 MassFlowRate = 0.0;              // Water-cooled condenser water mass flow rate (kg/s)
     925              :         Real64 RatedTCondense = 0.0;            // Condenser rated saturated condensing Temperature (C)
     926              :         Real64 CondLoad = 0.0;                  // Total condenser load (W)
     927              :         Real64 CondEnergy = 0.0;                // Condenser energy (J)
     928              :         Real64 VolFlowRateMax = 0.0;            // Maximum condenser volumetric flow rate (m3/s)
     929              :         Real64 MassFlowRateMax = 0.0;           // Maximum condenser mass flow rate (kg/s)
     930              :         Real64 InletTempMin = 0.0;              // Minimum condenser water inlet temperature (C)
     931              :         Real64 OutletTempMax = 0.0;             // Maximum condenser water outlet temperature (C)
     932              :         Real64 RatedSubcool = 0.0;              // Subcooling included in capacity rating curves (C)
     933              :         Real64 RatedDelT = 0.0;                 // Rated difference between Tcondense and Tdrybulb for air-cooled (C)
     934              :         // Rated difference between Tcondense and Twetbulb for evap-cooled (C)
     935              :         Real64 RatedCapacity = 0.0;             // Rated heat rejection capacity (W)
     936              :         Real64 RatedWaterInletT = 0.0;          // Rated water inlet temperature (C)
     937              :         Real64 RatedApproachT = 0.0;            // Rated approach temperature difference for water-cooled or cascade condenser(C)
     938              :         Real64 MinCapFacEvap = 0.0;             // HRCF equation limit
     939              :         Real64 MaxCapFacEvap = 0.0;             // HRCF equation limit
     940              :         Real64 EvapCoeff1 = 0.0;                // First coefficient in evap condenser approach T difference equn (C)
     941              :         Real64 EvapCoeff2 = 0.0;                // Second coefficient in evap condenser approach T difference equn (C)
     942              :         Real64 EvapCoeff3 = 0.0;                // Third coefficient in evap condenser approach T difference equn (C)
     943              :         Real64 EvapCoeff4 = 0.0;                // Fourth coefficient in evap condenser approach T difference equn (dimensionless)
     944              :         Real64 EvapElevFact = 0.0;              // Elevation correction factor for evap condensers
     945              :         Real64 RefOpCharge = 0.0;               // Condenser refrigerant operating charge, kg
     946              :         Real64 RefReceiverInventory = 0.0;      // Condensate receiver refrigerant inventory, kg
     947              :         Real64 RefPipingInventory = 0.0;        // Condensate piping refrigerant inventory, kg
     948              :         Real64 TotalHeatRecoveredEnergy = 0.0;  // All recovered heat for external loads and defrost purposes, J
     949              :         Real64 TotalHeatRecoveredLoad = 0.0;    // All recovered heat for external loads and defrost purposes [W]
     950              :         Real64 ExternalEnergyRecovered = 0.0;   // ExternalHeatRecovered, J
     951              :         Real64 InternalEnergyRecovered = 0.0;   // InternalHeatRecovered, J
     952              :         Real64 ExternalHeatRecoveredLoad = 0.0; // Sum of LaggedUsedWaterHeater and LaggedUsedHVACCoil [W]
     953              :         Real64 InternalHeatRecoveredLoad = 0.0; // Sum of all heat recovered for defrost purposes [W]
     954              :         Real64 LaggedUsedWaterHeater = 0.0;     // Heat reclaim used to heat water in previous zone/load time step(W)
     955              :         Real64 LaggedUsedHVACCoil = 0.0;        // Heat reclaim used to heat HVAC coil in previous zone/load time step(W)
     956              : 
     957              :         // Reset Initialization Values to Zeros
     958            0 :         void reset_init()
     959              :         {
     960            0 :             CondLoad = 0.0;
     961            0 :             CondEnergy = 0.0;
     962            0 :             MassFlowRate = 0.0;
     963            0 :             ActualFanPower = 0.0;
     964            0 :             FanElecEnergy = 0.0;
     965            0 :             EvapWaterConsumpRate = 0.0;
     966            0 :             EvapWaterConsumption = 0.0;
     967            0 :             ActualEvapPumpPower = 0.0;
     968            0 :             EvapPumpConsumption = 0.0;
     969            0 :             ExternalHeatRecoveredLoad = 0.0;
     970            0 :             ExternalEnergyRecovered = 0.0;
     971            0 :             InternalHeatRecoveredLoad = 0.0;
     972            0 :             InternalEnergyRecovered = 0.0;
     973            0 :             TotalHeatRecoveredLoad = 0.0;
     974            0 :             TotalHeatRecoveredEnergy = 0.0;
     975            0 :         }
     976              : 
     977              :         void UpdateCondenserOutletNode(EnergyPlusData &state) const;
     978              : 
     979              :         static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName);
     980              : 
     981              :         void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation) override;
     982              : 
     983              :         void simulate([[maybe_unused]] EnergyPlusData &state,
     984              :                       const PlantLocation &calledFromLocation,
     985              :                       bool FirstHVACIteration,
     986              :                       Real64 &CurLoad,
     987              :                       bool RunFlag) override;
     988              : 
     989              :         void oneTimeInit(EnergyPlusData &state) override;
     990              : 
     991              :         void oneTimeInit_new(EnergyPlusData &state) override;
     992              :     };
     993              : 
     994              :     struct RefrigGasCoolerData
     995              :     {
     996              :         std::string Name;                          // Name of gas cooler
     997              :         std::string EndUseSubcategory = "General"; // Gas cooler end-use subcategory
     998              :         bool GasCoolerRejectHeatToZone = false;    // Flag to show gas cooler located inside zone
     999              :         bool TransOpFlag = false;                  // Flag to show transcritical (vs subcritical) operation of the refrigeration system
    1000              :         Array1D_int SysNum;                        // absolute Index of system placing load (allocated NumRefrigSystems)
    1001              :         int CapCurvePtr = 0;                       // capacity curve pointer for gas cooler
    1002              :         FanSpeedCtrlType FanSpeedControlType = FanSpeedCtrlType::Invalid; // fixed, two-speed, or variable
    1003              :         int GasCoolerCreditWarnIndex = 0;                                 // Used to count warnings
    1004              :         int InletAirNodeNum = 0;                                          // Inlet air node number, can be outside or in a zone
    1005              :         int InletAirZoneNum = 0;                                          // Inlet air zone number, if located in a zone
    1006              :         int NumSysAttach = 0;                                             // Number of systems attached to gas cooler
    1007              :         Real64 ActualFanPower = 0.0;                                      // Actual gas cooler fan power (W)
    1008              :         Real64 CpGasCoolerOut = 0.0;                                      // Saturated liquid specific heat at gas cooler outlet (J/kg-C)
    1009              :         Real64 FanElecEnergy = 0.0;                                       // Gas cooler fan electric consumption (J)
    1010              :         Real64 FanMinAirFlowRatio = 0.0;                                  // Minimum power fraction for fan (dimensionless between 0 and 1.0)
    1011              :         Real64 GasCoolerApproachT = 3.0;                                  // Gas cooler approach temperature (C)
    1012              :         Real64 GasCoolerEnergy = 0.0;                                     // Gas cooler energy (J)
    1013              :         Real64 GasCoolerLoad = 0.0;                                       // Total gas cooler load (W)
    1014              :         Real64 HGasCoolerOut = 0.0;                                       // Specific enthalpy at the gas cooler outlet (C)
    1015              :         Real64 InternalEnergyRecovered = 0.0;                             // InternalHeatRecovered, J
    1016              :         Real64 InternalHeatRecoveredLoad = 0.0;                           // Sum of all heat recovered for defrost purposes [W]
    1017              :         Real64 MinCondLoad = 0.0;                                         // minimun gas cooler load for air-cooled gas cooler (W)
    1018              :         Real64 MinCondTemp = 1.0e1;                                       // Minimum condensing temperature during subcritical operation (C)
    1019              :         Real64 PGasCoolerOut = 0.0;                                       // Optimum pressure at the gas cooler outlet (C)
    1020              :         Real64 RatedApproachT = 3.0;                                      // Rated approach temperature difference(C)
    1021              :         Real64 RatedCapacity = 0.0;                                       // Rated heat rejection capacity (W)
    1022              :         Real64 RatedFanPower = 0.0;                                       // Rated gas cooler fan power (W)
    1023              :         Real64 RatedOutletP = 9.0e6;                                      // Rated gas cooler outlet pressure (Pa)
    1024              :         Real64 RatedOutletT = 38.0;                                       // Rated gas cooler outlet temperature (C)
    1025              :         Real64 RefOpCharge = 0.0;                                         // Gas cooler refrigerant operating charge, kg
    1026              :         Real64 RefPipingInventory = 0.0;                                  // Gas cooler outlet piping refrigerant inventory, kg
    1027              :         Real64 RefReceiverInventory = 0.0;                                // Gas cooler receiver refrigerant inventory, kg
    1028              :         Real64 SubcriticalTempDiff = 1.0e1;                               // Temperature difference for subcritical operation (C)
    1029              :         Real64 TempSlope = 0.0;                                           // slope for deltaT as function of heat rej for gas cooler (C/W)
    1030              :         Real64 TGasCoolerOut = 0.0;                                       // Temperature at the gas cooler outlet (C)
    1031              :         Real64 TotalHeatRecoveredEnergy = 0.0;                            // All recovered heat for defrost purposes, J
    1032              :         Real64 TotalHeatRecoveredLoad = 0.0;                              // All recovered heat for defrost purposes [W]
    1033              :         Real64 TransitionTemperature = 0.0; // Transition temperature between subcritical and transcritical operation (C)
    1034              : 
    1035              :         // Reset Initialization Values to Zeros
    1036            0 :         void reset_init()
    1037              :         {
    1038            0 :             GasCoolerLoad = 0.0;
    1039            0 :             GasCoolerEnergy = 0.0;
    1040            0 :             ActualFanPower = 0.0;
    1041            0 :             FanElecEnergy = 0.0;
    1042            0 :             InternalHeatRecoveredLoad = 0.0;
    1043            0 :             InternalEnergyRecovered = 0.0;
    1044            0 :             TotalHeatRecoveredLoad = 0.0;
    1045            0 :             TotalHeatRecoveredEnergy = 0.0;
    1046            0 :         }
    1047              :     };
    1048              : 
    1049              :     struct RefrigCompressorData
    1050              :     {
    1051              :         bool CoilFlag = false;                                        // Flag to show if coil type load on system served by compressor
    1052              :         std::string Name;                                             // Name of compressor
    1053              :         int CapacityCurvePtr = 0;                                     // Index to the capacity curve object
    1054              :         int ElecPowerCurvePtr = 0;                                    // Index to the electrical power curve object
    1055              :         int MassFlowCurvePtr = 0;                                     // Index to the mass flow curve object
    1056              :         int TransElecPowerCurvePtr = 0;                               // Index to the transcritical electrical power curve object
    1057              :         int TransCapacityCurvePtr = 0;                                // Index to the transcritical capacity curve object
    1058              :         int NumSysAttach = 0;                                         // Number of systems attached to compressor, error if /=1
    1059              :         CompRatingType SuperheatRatingType = CompRatingType::Invalid; // Type of manufacturer's rating info re superheat
    1060              :         CompRatingType SubcoolRatingType = CompRatingType::Invalid;   // Type of manufacturer's rating info re subcooling
    1061              :         Real64 Capacity = 0.0;                                        // Comprssor delivered capacity (W)
    1062              :         Real64 CoolingEnergy = 0.0;                                   // Compressor delivered energy (J)
    1063              :         Real64 Efficiency = 0.0;                                      // Compressor efficiency (0 to 1)
    1064              :         Real64 ElecConsumption = 0.0;                                 // Compressor electric consumption (J)
    1065              :         Real64 LoadFactor = 0.0;                                      // Fraction of the time the compressor runs to meet the load (0 to 1)
    1066              :         Real64 MassFlow = 0.0;                                        // Compressor mass flow (kg/s)
    1067              :         Real64 NomCap = 0.0;                                          // Nominal compressor capacity at ARI 540 rating conditions
    1068              :         Real64 Power = 0.0;                                           // Compressor power (W)
    1069              :         Real64 RatedSuperheat = 0.0;                                  // Rated Superheat at compressor suction (C)
    1070              :         Real64 RatedSubcool = 0.0;                                    // Rated Subcooling, note may not match condenser rating (C)
    1071              :         std::string EndUseSubcategory = "General";                    // Compressor end-use subcategory
    1072              :         bool TransFlag = false;                                       // Flag to indicate if compressor can operate in transcritical region
    1073              : 
    1074              :         // Reset Initialization Values to Zeros
    1075            0 :         void reset_init()
    1076              :         {
    1077            0 :             ElecConsumption = 0.0;
    1078            0 :             Power = 0.0;
    1079            0 :         }
    1080              :     };
    1081              : 
    1082              :     struct CaseRAFractionData
    1083              :     {
    1084              :         Real64 TotalCaseRAFraction = 0.0; // Sum case return air fraction for error checking
    1085              :         std::string ZoneName;             // Zone or Location of Refrigerated Case
    1086              :     };
    1087              : 
    1088              :     struct SubcoolerData
    1089              :     {
    1090              :         bool CoilFlag = false;     // Flag to show if coil type load on system served by subcooler
    1091              :         std::string Name;          // Name of Subcooler
    1092              :         std::string MechSourceSys; // Name of refrigeration system providing
    1093              :         // cool liquid to mechanical, needed for character comparison after systems read
    1094              :         SubcoolerType subcoolerType = SubcoolerType::Invalid; // Specifies subcooler type(0=liquid suction heat exchanger,1=mechanical)
    1095              :         int MechSourceSysID = 0;                              // ID number of refrigeration system providing cool liquid to mechanical
    1096              :         Real64 MechSCTransLoad = 0.0;                         // Mechanical subcooler load transferred between suction groups, W
    1097              :         Real64 MechSCTransEnergy = 0.0;                       // Mechanical subcooler energy transferred between suction groups, W
    1098              :         Real64 LiqSuctDesignDelT = 0.0;                       // Liquid suction subcooler design subcooling, C
    1099              :         Real64 LiqSuctDesignTliqIn = 0.0;                     // Liquid suction subcooler design inlet temperature liquid, C
    1100              :         Real64 LiqSuctDesignTvapIn = 0.0;                     // Liquid suction subcooler design inlet temperature vapor, C
    1101              :         Real64 MechControlTliqOut = 0.0;                      // Mechanical subcooler design outlet temperature subcooled liquid, C
    1102              :     };
    1103              : 
    1104              :     struct SecondaryLoopData
    1105              :     {
    1106              :         bool CoilFlag = false; // Flag to show if coil type load on secondary system
    1107              :         std::string Name;      // Name of refrigeration system
    1108              :         std::string FluidName; // Name of circulating fluid
    1109              :         Fluid::GlycolProps *glycol = nullptr;
    1110              :         Fluid::RefrigProps *refrig = nullptr;
    1111              :         std::string EndUseSubcategory;                      // Used for reporting purposes
    1112              :         Array1D_int CaseNum;                                // Absolute Index of cases (dimensioned 1 to NumCases)
    1113              :         Array1D_int CoilNum;                                // Absolute Index of coils (dimensioned 1 to NumCoils)
    1114              :         Array1D_int WalkInNum;                              // Absolute Index of walk-ins (dimensioned 1 to NumWalkIns)
    1115              :         int DistPipeZoneNum = 0;                            // ID number for zone where distribution pipe gain heat
    1116              :         int DistPipeZoneNodeNum = 0;                        // ID number for zone node where distribution pipe gain heat
    1117              :         Real64 DistPipeZoneHeatGain = 0.0;                  // ! sensible heat gain rate to zone with pipe
    1118              :         SecFluidType FluidType = SecFluidType::Invalid;     // Indicates whether fluid always liquid or undergoes phase change
    1119              :         int NumSysAttach = 0;                               // Used to check for non-unique and unused secondary loops
    1120              :         int NumPumps = 0;                                   // Number of pumps (or pump stages) serving this system
    1121              :         int NumCases = 0;                                   // Number of Cases served by this secondary loop
    1122              :         int NumCoils = 0;                                   // Number of Cases served by this secondary loop
    1123              :         int NumWalkIns = 0;                                 // Number of Walk-Ins served by this secondary loop
    1124              :         SecPumpCtrl PumpControlType = SecPumpCtrl::Invalid; // Constant speed or variable speed
    1125              :         int ReceiverZoneNum = 0;                            // ID number for zone where receiver gains heat
    1126              :         int ReceiverZoneNodeNum = 0;                        // ID number for zone node where receiver gains heat
    1127              :         Real64 ReceiverZoneHeatGain = 0.0;                  // sensible heat gain rate to zone with receiver
    1128              :         int VarSpeedCurvePtr = 0;                           // Pointer for variable speed pump power curve
    1129              :         Real64 AvailLoadCoils = 0.0;                        // Used to determine amount of avail heat for warehouse coils
    1130              :         Real64 CpBrineRated = 0.0;                          // Specific heat of secondary loop fluid at rated average
    1131              :         //    brine temperature (J/kg-C)
    1132              :         Real64 ChillerRefInventory = 0.0; // Refrigerant inventory on cold side of loop heat exchanger
    1133              :         Real64 CircRate = 0.0;            // For PhaseChange loop = mass flow at pump/mass gas out load (dimensionless)
    1134              :         Real64 CoolingLoadRated = 0.0;    // Rated capacity of heat exchanger serving secondary loop (W)
    1135              :         Real64 DensityBrineRated = 0.0;   // Density of secondary loop fluid at
    1136              :         //    rated average brine temperature (J/kg-C)
    1137              :         Real64 DistPipeHeatGain = 0.0;       // Secondary fluid distribution piping heat gain (W)
    1138              :         Real64 DistPipeHeatGainEnergy = 0.0; // Secondary fluid distribution piping heat gain (J)
    1139              :         Real64 FlowVolActual = 0.0;          // Actual Mass flow rate of circ fluid(kg/s)
    1140              :         Real64 HotDefrostCondCredit = 0.0;   // Used to credit condenser when heat reclaim used for hot gas/brine defrost (W)
    1141              :         Real64 HeatExchangeEta = 0.0;        // Heat exchanger effectiveness (dimensionless)
    1142              :         Real64 MaxVolFlow = 0.0;             // Defined by minimum of chiller or pump ratings (m3/s)
    1143              :         Real64 MaxLoad = 0.0;                // Defined by minimum of chiller rating or loat at MaxVolFlow (W)
    1144              :         Real64 PumpTotRatedPower = 0.0;      // Total pump rated power on loop (W)
    1145              :         Real64 PumpPowerToHeat = 0.0;        // Fraction of pump power converted to heat in circ fluid (dimensionless)
    1146              :         Real64 PumpIncrementFlowVol = 0.0;   // Circ fluid flow for each pump or pump stage (m3/s)
    1147              :         Real64 PumpIncrementPower = 0.0;     // Pump power for each pump or pump stage (W)
    1148              :         Real64 PumpPowerTotal = 0.0;         // Total Pump Power Secondary Loop (report variable)(W)
    1149              :         Real64 PumpElecEnergyTotal = 0.0;    // Total pump energy secondary loop (report variable)(W)
    1150              :         Real64 ReceiverHeatGain = 0.0;       // Secondary fluid Receiver heat gain (W)
    1151              :         Real64 ReceiverHeatGainEnergy = 0.0; // Secondary fluid Receiver heat gain (J)
    1152              :         Real64 RefInventory = 0.0;           // Approximate refrigerant inventory entered by user (kg)
    1153              :         Real64 SumUADistPiping = 0.0;        // Sum of U*A for secondary fluid dist piping (W/C)
    1154              :         Real64 SumUAReceiver = 0.0;          // Sum of U*A for secondary fluid receiver (W/C)
    1155              :         Real64 TBrineAverage = 0.0;          // (C)
    1156              :         Real64 TBrineInRated = 0.0;          // Entering brine temperature based upon rated range,approach,
    1157              :         //    and evap Temp (C)
    1158              :         Real64 TCondense = 0.0; // Rated condensing temperature for heat exchanger serving
    1159              :         //    secondary loop with phase change(C)
    1160              :         Real64 TEvapDesign = 0.0; // Rated evaporating temperature for heat exchanger serving
    1161              :         //    secondary loop (C)
    1162              :         Real64 TApproachDifRated = 0.0; // Rated approach temperature diff for heat exchanger serving
    1163              :         //    secondary loop (C)
    1164              :         Real64 TRangeDifRated = 0.0; // Rated range temperature diff for heat exchanger serving
    1165              :         //    secondary loop (C)
    1166              :         Real64 TMinNeeded = 0.0;       // Lowest Tbrine to case or walk-in needed on loop (C)
    1167              :         Real64 TotalCoolingLoad = 0.0; // Total load (cases + walk-ins + pump heat + distribution pipe heat gain)
    1168              :         //     on this system (W)
    1169              :         Real64 TotalCoolingEnergy = 0.0; // Total energy (cases + walk-ins + pump heat + distribution pipe heat gain)
    1170              :         //    on this system (J)
    1171              :         Real64 TotalRefrigLoad = 0.0;   // Total load (cases + walk-ins) on this system (W)
    1172              :         Real64 TotalRefrigEnergy = 0.0; // Total energy (cases + walk-ins) on this system (J)
    1173              :         Real64 UnmetEnergy = 0.0;       // Load that is greater than capacity of loop heat exchanger, accumulates (J)
    1174              :         Real64 UnmetEnergySaved = 0.0;  // Load that is greater than capacity of loop heat exchanger, accumulates (J)
    1175              : 
    1176              :         // Reset Initialization Values to Zeros
    1177            0 :         void reset_init()
    1178              :         {
    1179            0 :             TotalCoolingLoad = 0.0;
    1180            0 :             PumpPowerTotal = 0.0;
    1181            0 :             PumpElecEnergyTotal = 0.0;
    1182            0 :             ReceiverZoneHeatGain = 0.0;
    1183            0 :             DistPipeZoneHeatGain = 0.0;
    1184            0 :         }
    1185              : 
    1186              :         void CalculateSecondary(EnergyPlusData &state, int SecondaryNum);
    1187              :     };
    1188              : 
    1189              :     struct TransferLoadListDef // Derived Type for Transfer Load (Secondary and Cascade) Lists
    1190              :     {
    1191              :         std::string Name;               // Name of this TransferLoad List
    1192              :         int NumSecondarys = 0;          // Number of Secondary Loops in this TransferLoad List
    1193              :         int NumCascadeLoads = 0;        // Number of Cascade condenser loads in this TransferLoad List
    1194              :         Array1D_int CascadeLoadItemNum; // List of Item numbers that correspond to the Cascade Condenser
    1195              :         Array1D_int SecondaryItemNum;   // List of Item numbers that correspond to the Secondary
    1196              :     };
    1197              : 
    1198              :     struct WalkInData
    1199              :     {
    1200              :         std::string Name; // Name of walk in cooler
    1201              :         Array1D_string ZoneName;
    1202              :         // Names of zones exchanging energy with cooler
    1203              :         Sched::Schedule *circFanAvailSched = nullptr;                  // Index to the correct availability schedule
    1204              :         Sched::Schedule *defrostDripDownSched = nullptr;               // fail-safe schedule
    1205              :         Sched::Schedule *defrostSched = nullptr;                       // defrost schedule
    1206              :         DefrostCtrlType DefrostControlType = DefrostCtrlType::Invalid; // WalkIn defrost control type, Timed,Frost level
    1207              :         DefrostType defrostType = DefrostType::Invalid;                // WalkIn defrost type, Hot-gas,Electric, Hot-brine
    1208              :         Sched::Schedule *heaterSched = nullptr;                        // heater availability schedule
    1209              :         Sched::Schedule *lightingSched = nullptr;                      // walkIn lighting schedule
    1210              :         int NumSysAttach = 0;                                          // Number of systems attached to WalkIn, error if /=1
    1211              :         int NumZones = 0;                                              // Number of zones exchanging energy with WalkIn
    1212              :         Sched::Schedule *availSched = nullptr;                         // availability schedule
    1213              :         Sched::Schedule *stockingSched = nullptr;                      // product stocking schedule
    1214              :         Array1D<Sched::Schedule *> glassDoorOpenScheds;                // door opening schedule
    1215              :         Array1D<Sched::Schedule *> stockDoorOpenScheds;                // door opening schedule
    1216              :         Array1D<WIStockDoor> StockDoorProtectType;                     // Index to door protection type
    1217              :         Array1D_int ZoneNodeNum;                                       // Index to Zone Node
    1218              :         Array1D_int ZoneNum;                                           // Index to Zone
    1219              :         Real64 CircFanPower = 0.0;                                     // Operating power of  Walk In fan [W]
    1220              :         Real64 CoilFanPower = 0.0;                                     // Operating power of  Walk In evap coil fan [W]
    1221              :         Real64 IceTemp = 0.0;                                          // Temperature of Ice Mass [C]
    1222              :         Real64 IceTempSaved = 0.0;                                     // Temperature of Ice Mass [C]
    1223              :         Real64 DefrostCapacity = 0.0;                                  // Design defrost WalkIn capacity [W]
    1224              :         Real64 DeltaFreezeKgFrost = 0.0;                               // Used to reverse accumulation if the zone/load time step is repeated (kg)
    1225              :         Real64 DefEnergyFraction = 0.0;                                // Portion of defrost energy available to melt ice,
    1226              :         //    used with fluid defrost with temp termination (dimensionless)
    1227              :         Real64 DesignFanPower = 0.0;        // Design power of fans [W]
    1228              :         Real64 DesignLighting = 0.0;        // Design  lighting (includes task and display lights)[W]
    1229              :         Real64 DesignRatedCap = 0.0;        // Design total capacity [W]
    1230              :         Real64 DesignRefrigInventory = 0.0; // Design refrigerant inventory [kg]
    1231              :         Real64 FloorArea = 0.0;             // Floor area of  Walk In [m2]
    1232              :         Real64 FloorUValue = 0.0;           // U-value of Walk In floor [W/m2-C]
    1233              :         Real64 HeaterPower = 0.0;           // Rated power of  Walk In   heaters [W/m]
    1234              :         Real64 HotDefrostCondCredit = 0.0;  // Used to credit condenser when heat reclaim used for hot gas/brine defrost (W)
    1235              :         Real64 KgFrost = 0.0;               // Amount of frost on WalkIn evaporator (Kg)
    1236              :         Real64 StoredEnergy = 0.0;          // Cumulative Stored Energy not met by evaporator [J]
    1237              :         Real64 KgFrostSaved = 0.0;          // Amount of frost on WalkIn evaporator (Kg)
    1238              :         Real64 StoredEnergySaved = 0.0;     // Cumulative Stored Energy not met by evaporator [J]
    1239              :         Real64 Temperature = 0.0;           // Rated temperature [C]
    1240              :         Real64 TEvapDesign = 0.0;           // Design evaporator temperature (or brine inlet T) [C]
    1241              :         Real64 TotalFanPower = 0.0;         // Sum of coil and circ fan power  [W]
    1242              :         Array1D<Real64> AreaGlassDr;
    1243              :         Array1D<Real64> UValueGlassDr;
    1244              :         Array1D<Real64> HeightGlassDr;
    1245              :         Array1D<Real64> AreaStockDr;
    1246              :         Array1D<Real64> UValueStockDr;
    1247              :         Array1D<Real64> HeightStockDr;
    1248              :         Array1D<Real64> SurfaceArea;
    1249              :         Array1D<Real64> UValue;
    1250              :         // Report Variables
    1251              :         Real64 ElecHeaterPower = 0.0;         // Walk In heater rate (W)
    1252              :         Real64 ElecHeaterConsumption = 0.0;   // Walk In heater energy (J)
    1253              :         Real64 ElecFanPower = 0.0;            // Walk In fan electric power (W)
    1254              :         Real64 ElecFanConsumption = 0.0;      // Walk In fan electric energy (J)
    1255              :         Real64 ElecLightingPower = 0.0;       // Walk In lighting electric power (W)
    1256              :         Real64 ElecLightingConsumption = 0.0; // Walk In lighting electric energy (J)
    1257              :         Real64 ElecDefrostPower = 0.0;        // Walk In defrost rate (W)
    1258              :         Real64 ElecDefrostConsumption = 0.0;  // Walk In defrost energy (J)
    1259              :         Real64 TotalCoolingLoad = 0.0;        // Walk In total cooling rate (W)
    1260              :         Real64 TotalCoolingEnergy = 0.0;      // Walk In total cooling energy (J)
    1261              :         Real64 TotalElecPower = 0.0;          // Walk In total electric
    1262              :         //   (fans, heaters, lighting, and elec defrost) rate (W)
    1263              :         Real64 TotalElecConsumption = 0.0;      // Walk In total electric energy (J)
    1264              :         Real64 TotLatCoolingEnergyRate = 0.0;   // Walk In latent cooling rate (W)
    1265              :         Real64 TotLatCoolingEnergy = 0.0;       // Walk In latent cooling energy (J)
    1266              :         Real64 TotSensCoolingEnergyRate = 0.0;  // Walk In sensible cooling rate (W)
    1267              :         Real64 TotSensCoolingEnergy = 0.0;      // Walk In sensible cooling energy (J)
    1268              :         Array1D<Real64> LatZoneCreditRate;      // Amount of latent energy provided to zone(W)
    1269              :         Array1D<Real64> LatZoneCredit;          // Amount of latent energy provided to zone(J)
    1270              :         Array1D<Real64> SensZoneCreditRate;     // Amount of sensible heat gain to zone, pos and neg (W)
    1271              :         Array1D<Real64> SensZoneCreditCoolRate; // Amount of sensible cooling provided to the zone (W)
    1272              :         Array1D<Real64> SensZoneCreditCool;     // Amount of sensible cooling provided to the zone (J)
    1273              :         Array1D<Real64> SensZoneCreditHeatRate; // Amount of sensible heat provided to the zone (W)
    1274              :         Array1D<Real64> SensZoneCreditHeat;     // Amount of sensible heat provided to the zone (J)
    1275              :         bool ShowUnmetWIEnergyWarning = true;
    1276              :         bool ShowWIFrostWarning = true;
    1277              : 
    1278              :         // Reset Initialization Values to Zeros
    1279            3 :         void reset_init()
    1280              :         {
    1281            3 :             HotDefrostCondCredit = 0.0;
    1282            3 :             TotalCoolingLoad = 0.0;
    1283            3 :             TotalCoolingEnergy = 0.0;
    1284            3 :             TotSensCoolingEnergyRate = 0.0;
    1285            3 :             TotSensCoolingEnergy = 0.0;
    1286            3 :             TotLatCoolingEnergyRate = 0.0;
    1287            3 :             TotLatCoolingEnergy = 0.0;
    1288            3 :             ElecFanPower = 0.0;
    1289            3 :             ElecFanConsumption = 0.0;
    1290            3 :             ElecHeaterPower = 0.0;
    1291            3 :             ElecHeaterConsumption = 0.0;
    1292            3 :             ElecLightingPower = 0.0;
    1293            3 :             ElecLightingConsumption = 0.0;
    1294            3 :             TotalElecPower = 0.0;
    1295            3 :             TotalElecConsumption = 0.0;
    1296            3 :             ElecDefrostPower = 0.0;
    1297            3 :             ElecDefrostConsumption = 0.0;
    1298            3 :         }
    1299              : 
    1300              :         void CalculateWalkIn(EnergyPlusData &state);
    1301              :     };
    1302              : 
    1303              :     struct CaseWIZoneReportData
    1304              :     {
    1305              :         // Members
    1306              :         Real64 LatCoolingToZoneRate = 0.0; // Positive for reporting Net latent credit to zone on sys time step from cases/walkins (W)
    1307              :         Real64 LatCoolingToZoneEnergy = 0.0;
    1308              :         Real64 SenCoolingToZoneRate = 0.0; // Positive for reporting Net sensible cooling to zone on sys time step from cases/walkins (W)
    1309              :         Real64 SenCoolingToZoneEnergy = 0.0;
    1310              :         Real64 HeatingToZoneRate = 0.0; // Positive for reporting Net sensible credit to zone on sys time step from cases/walkins (W)
    1311              :         Real64 HeatingToZoneEnergy = 0.0;
    1312              :         Real64 TotCoolingToZoneRate = 0.0; // Positive for reporting Net total cooling credit to zone from cases/walkins (W)
    1313              :         Real64 TotCoolingToZoneEnergy = 0.0;
    1314              :         Real64 TotHtXferToZoneRate = 0.0; // Gives negative for cooling, positive for heating net to zone from cases/walkins (W)
    1315              :         Real64 TotHtXferToZoneEnergy = 0.0;
    1316              :         Real64 SenCaseCreditToZoneEnergy = 0.0; // Negative (heat out zone) positive (heat into zone) (rate found in CaseCreditData) (J)
    1317              : 
    1318              :         // Reset to Zeros
    1319            5 :         void reset()
    1320              :         {
    1321            5 :             new (this) CaseWIZoneReportData();
    1322            5 :         }
    1323              :     };
    1324              : 
    1325              :     struct WarehouseCoilData
    1326              :     {
    1327              :         std::string Name;                                              // Name of Warehouse Coil
    1328              :         std::string ZoneName;                                          // Names of zone cooled by coil
    1329              :         bool SecStatusFirst = false;                                   // Flag to show if this is the first coil on a particular secondary
    1330              :         bool SecStatusLast = false;                                    // Flag to show if this is the last coil on a particular secondary
    1331              :         bool SysStatusFirst = false;                                   // Flag to show if this is the first coil on a particular primary
    1332              :         bool SysStatusLast = false;                                    // Flag to show if this is the last coil on a particular primary
    1333              :         Sched::Schedule *coilFanAvaildSched = nullptr;                 // availability schedule
    1334              :         Sched::Schedule *defrostDripDownSched = nullptr;               // fail-safe schedule
    1335              :         Sched::Schedule *defrostSched = nullptr;                       // defrost schedule
    1336              :         DefrostCtrlType DefrostControlType = DefrostCtrlType::Invalid; // Coil defrost control type, Timed,Frost level
    1337              :         DefrostType defrostType = DefrostType::Invalid;                // Coil defrost type, Hot-gas,Electric, Hot-brine
    1338              :         FanSpeedCtrlType FanType = FanSpeedCtrlType::Invalid;          // Index to coil fan type (fixed, two-speed, etc.)
    1339              :         Sched::Schedule *heaterAvailSched = nullptr;                   // availability schedule
    1340              :         int NumSysAttach = 0;                                          // Number of refrigerating systems cooling this coil (error check purpose)
    1341              :         RatingType ratingType = RatingType::Invalid;                   // Indicates which type of manufacturer's rating is used
    1342              :         Sched::Schedule *availSched = nullptr;                         // availability schedule
    1343              :         int SCIndex = 0;                                               // IDs which of European standard conditions is used for rating
    1344              :         int SecServeID = 0;                                            // Index to the refrigeration system serving this coil
    1345              :         SHRCorrectionType SHRCorrType = SHRCorrectionType::Invalid;    // Index to type of correction for sensible heat ratio
    1346              :         int SHRCorrectionCurvePtr = 0;                                 // Index to Sensible heat ratio correction curve
    1347              :         int SysServeID = 0;                                            // Index to the secondary system serving this coil
    1348              :         VerticalLoc VerticalLocation = VerticalLoc::Invalid;           // Index to coil location, floor, ceiling, or middle
    1349              :         int ZoneNodeNum = 0;                                           // Index to the zone node for the zone served by this coil
    1350              :         int ZoneNum = 0;                                               // Index to the zone served by this coil
    1351              :         Real64 CorrMaterial = 0.0;                                     // Correction factor from manufacturer's rating for coil material, default 1.0
    1352              :         Real64 CorrRefrigerant = 0.0;                                  // Correction factor from manufacturer's rating for refrigerant, default 1.0
    1353              :         Real64 DefrostCapacity = 0.0;                                  // Design defrost Coil capacity [W]
    1354              :         Real64 DefrostPower = 0.0;                                     // Defrost power for electric defrost (W)
    1355              :         Real64 DeltaFreezeKgFrost = 0.0;                               // Used to reverse accumulation if the zone/load time step is repeated (kg)
    1356              :         Real64 DefEnergyFraction = 0.0;                                // Portion of defrost energy available to melt ice,
    1357              :         //    used with fluid defrost with temp termination (dimensionless)
    1358              :         Real64 DesignRefrigInventory = 0.0; // Design refrigerant inventory [kg]
    1359              :         Real64 FanMinAirFlowRatio = 0.0;    // Minimum air flow ratio set to preserve fan motor, dimensionless
    1360              :         Real64 HeaterPower = 0.0;           // Rated power of  coil heaters [W/m]
    1361              :         Real64 HotDefrostCondCredit = 0.0;  // Used to credit condenser when heat reclaim used for hot gas/brine defrost (W)
    1362              :         Real64 IceTemp = 0.0;               // Temperature of Ice Mass [C]
    1363              :         Real64 IceTempSaved = 0.0;          // Temperature of Ice Mass [C]
    1364              :         Real64 KgFrost = 0.0;               // Amount of frost on coil evaporator (Kg)
    1365              :         Real64 KgFrostSaved = 0.0;          // Amount of frost on coil evaporator (Kg)
    1366              :         Real64 MaxTemperatureDif = 0.0;     // Maximum difference between Tevap and Tair inlet, limits capacity during initial pull-down (deltaC)
    1367              :         Real64 RatedAirVolumeFlow = 0.0;    // Rated air flow through coil (m3/s)
    1368              :         Real64 RatedCapTotal = 0.0;         // Rated total heat capacity, both latent and sensible [W]
    1369              :         Real64 RatedFanPower = 0.0;         // Rated power of fans [W]
    1370              :         Real64 RatedRH = 0.0;               // Rated RH corresponding to RatedCapacityTotal [decimal 0 to 1]
    1371              :         Real64 RatedSensibleCap = 0.0;      // Rated total capacity at sensible heat ratio of 1.0 [W]
    1372              :         Real64 RatedTemperatureDif = 0.0;   // Rated temperature difference DT1, T air in minus evaporating temperature [W]
    1373              :         Real64 ReqLoad = 0.0;               // Load requested to meet zone load [W]
    1374              :         Real64 SensHeatRatio = 0.0;         // Sensible heat ratio (sensible/total), dimensionless
    1375              :         Real64 SHRCorrection60 = 0.0;       // Correction factor corresponding to sensible heat ratio of 0.6 [ dimensionless]
    1376              :         Real64 Temperature = 0.0;           // Rated temperature [C]
    1377              :         Real64 TEvapDesign = 0.0;           // Design evaporator temperature (or brine inlet T) [C]
    1378              :         Real64 ThermalDefrostPower = 0.0;   // Thermal defrost load used to communicate with derate routine even if not electric defrost [W]
    1379              :         Real64 UnitLoadFactorSens = 0.0;    // Rated sensible capacity [W/C]
    1380              :         // Report Variables
    1381              :         Real64 ElecHeaterPower = 0.0;             // Coil heater rate (W)
    1382              :         Real64 ElecHeaterConsumption = 0.0;       // Coil heater energy (J)
    1383              :         Real64 ElecFanPower = 0.0;                // Coil fan electric power (W)
    1384              :         Real64 ElecFanConsumption = 0.0;          // Coil fan electric energy (J)
    1385              :         Real64 ElecDefrostPower = 0.0;            // Coil defrost rate (W)
    1386              :         Real64 ElecDefrostConsumption = 0.0;      // Coil defrost energy (J)
    1387              :         Real64 LatCreditRate = 0.0;               // Latent heat removed from the zone [W]
    1388              :         Real64 LatLoadServed = 0.0;               // Latent load met by coil (J)
    1389              :         Real64 LatKgPerS_ToZone = 0.0;            // Latent load met by coil (kg/s)
    1390              :         Real64 LatCreditEnergy = 0.0;             // Latent heat removed from the zone [J]
    1391              :         Real64 ReportSensCoolCreditRate = 0.0;    // Coil cooling credit to zone (net) [W]
    1392              :         Real64 ReportHeatingCreditRate = 0.0;     // Coil heating credit to zone (net) [J]
    1393              :         Real64 ReportSensCoolCreditEnergy = 0.0;  // Coil cooling credit to zone (net) [W]
    1394              :         Real64 ReportHeatingCreditEnergy = 0.0;   // Coil heating credit to zone (net) [J]
    1395              :         Real64 ReportTotalCoolCreditRate = 0.0;   // Coil cooling sens + latent credit to zone[W]
    1396              :         Real64 ReportTotalCoolCreditEnergy = 0.0; // Coil cooling sens + latent credit to zone[J]
    1397              :         Real64 SensCreditRate = 0.0;              // Net Sensible heat removed from the zone [W]
    1398              :         Real64 SensCreditEnergy = 0.0;            // Net Sensible heat removed from the zone [J]
    1399              :         Real64 SensCoolingEnergyRate = 0.0;       // Gross Coil sensible cooling rate (W)
    1400              :         Real64 SensCoolingEnergy = 0.0;           // Gross Coil sensible cooling energy (J)
    1401              :         Real64 TotalCoolingLoad = 0.0;            // Gross total cooling rate (W)
    1402              :         Real64 TotalCoolingEnergy = 0.0;          // Gross total cooling energy (J)
    1403              :         Real64 TotalElecPower = 0.0;              // Coil total electric
    1404              :         Real64 TotalElecConsumption = 0.0;        // Coil total electric energy (J)
    1405              :         bool ShowCoilFrostWarning = true;
    1406              : 
    1407              :         // Reset Initialization Values to Zeros
    1408            0 :         void reset_init()
    1409              :         {
    1410            0 :             HotDefrostCondCredit = 0.0;
    1411            0 :             TotalCoolingLoad = 0.0;
    1412            0 :             TotalCoolingEnergy = 0.0;
    1413            0 :             SensCoolingEnergyRate = 0.0;
    1414            0 :             SensCoolingEnergy = 0.0;
    1415            0 :             SensCreditRate = 0.0;
    1416            0 :             LatKgPerS_ToZone = 0.0;
    1417            0 :             SensHeatRatio = 0.0;
    1418            0 :             LatCreditEnergy = 0.0;
    1419            0 :             LatCreditRate = 0.0;
    1420            0 :             ElecFanPower = 0.0;
    1421            0 :             ElecFanConsumption = 0.0;
    1422            0 :             ElecHeaterPower = 0.0;
    1423            0 :             ElecHeaterConsumption = 0.0;
    1424            0 :             TotalElecPower = 0.0;
    1425            0 :             TotalElecConsumption = 0.0;
    1426            0 :             ElecDefrostPower = 0.0;
    1427            0 :             ElecDefrostConsumption = 0.0;
    1428            0 :             ReportTotalCoolCreditRate = 0.0;
    1429            0 :             ReportTotalCoolCreditEnergy = 0.0;
    1430            0 :             ReportSensCoolCreditRate = 0.0;
    1431            0 :             ReportHeatingCreditRate = 0.0;
    1432            0 :             ReportSensCoolCreditEnergy = 0.0;
    1433            0 :             ReportHeatingCreditEnergy = 0.0;
    1434            0 :         }
    1435              : 
    1436              :         void CalculateCoil(EnergyPlusData &state, Real64 QZnReq);
    1437              :     };
    1438              : 
    1439              :     struct AirChillerSetData
    1440              :     {
    1441              :         std::string Name;     // Name of Chiller Set
    1442              :         std::string ZoneName; // Name of zone where chiller set is located
    1443              :         Array1D_int CoilNum;  // ID number of Individual Chiller in set
    1444              :         int ChillerSetID = 0; // ID number for this set of chillers (all serving one zone,
    1445              :         //                       but can be chilled by multi systems)
    1446              :         Sched::Schedule *availSched = nullptr; // Schedule to take whole set off-line if needed // availability?
    1447              :         int NodeNumInlet = 0;                  // Node ID Number of inlet for chiller set as a whole, not identified for specific coils
    1448              :         int NodeNumOutlet = 0;                 // Node ID Number of outlet for chiller set as a whole, not identified for specific coils
    1449              :         int NumCoils = 0;                      // Number of individual chillers in set
    1450              :         int ZoneNum = 0;                       // ID number of zone where chiller set is located
    1451              :         int ZoneNodeNum = 0;                   // ID number of zone node giving mixed conditions of zone where chiller set is located
    1452              :         Real64 QZnReqSens = 0.0;               // Sensible heat needed by the zone to reach setpoint [W]
    1453              : 
    1454              :         void CalculateAirChillerSets(EnergyPlusData &state);
    1455              :     };
    1456              : 
    1457              :     struct CoilCreditData // used to sum impact of all coils within a zone
    1458              :     {
    1459              :         Real64 LatCreditToZoneRate = 0.0; // Net latent credit to zone on sys time step from coil (W)
    1460              :         Real64 LatCreditToZoneEnergy = 0.0;
    1461              :         Real64 LatKgPerS_ToZoneRate = 0.0; // Latent water to zone on sys time step from coils, neg when water removed (kg/s)
    1462              :         Real64 SenCreditToZoneRate = 0.0;  // Net sensible credit to zone on sys time step from coil (W)
    1463              :         Real64 SenCreditToZoneEnergy = 0.0;
    1464              :         Real64 ReportH2ORemovedKgPerS_FromZoneRate = 0.0; // same but positive for reporting purposes (kg/s)
    1465              :         Real64 ReportLatCreditToZoneRate = 0.0;           // Positive for reporting Net latent credit to zone on sys time step from coil (W)
    1466              :         Real64 ReportLatCreditToZoneEnergy = 0.0;
    1467              :         Real64 ReportHeatingToZoneRate = 0.0; // Positive for reporting Net sensible credit to zone on sys time step from coil (W)
    1468              :         Real64 ReportHeatingToZoneEnergy = 0.0;
    1469              :         Real64 ReportSenCoolingToZoneRate = 0.0; // Positive for reporting Net sensible credit to zone on sys time step from coil (W)
    1470              :         Real64 ReportSenCoolingToZoneEnergy = 0.0;
    1471              :         Real64 ReportTotCoolingToZoneRate = 0.0; // Positive for reporting Net total cooling credit to zone from chillers (W)
    1472              :         Real64 ReportTotCoolingToZoneEnergy = 0.0;
    1473              : 
    1474              :         // Reset to Zeros
    1475            0 :         void reset()
    1476              :         {
    1477            0 :             new (this) CoilCreditData();
    1478            0 :         }
    1479              :     };
    1480              : 
    1481              :     // Functions
    1482              : 
    1483              :     void ManageRefrigeratedCaseRacks(EnergyPlusData &state);
    1484              : 
    1485              :     void GetRefrigerationInput(EnergyPlusData &state);
    1486              : 
    1487              :     void SetupReportInput(EnergyPlusData &state);
    1488              : 
    1489              :     void InitRefrigeration(EnergyPlusData &state);
    1490              : 
    1491              :     void InitRefrigerationPlantConnections(EnergyPlusData &state);
    1492              : 
    1493              :     void SimulateDetailedRefrigerationSystems(EnergyPlusData &state);
    1494              : 
    1495              :     void SimulateDetailedTransRefrigSystems(EnergyPlusData &state);
    1496              : 
    1497              :     void GetRefrigeratedRackIndex(EnergyPlusData &state,
    1498              :                                   std::string const &Name,
    1499              :                                   int &IndexPtr,
    1500              :                                   DataHeatBalance::RefrigSystemType SysType,
    1501              :                                   bool &ErrorsFound,
    1502              :                                   std::string_view const ThisObjectType = {},
    1503              :                                   bool const SuppressWarning = false);
    1504              : 
    1505              :     void ReportRefrigerationComponents(EnergyPlusData &state);
    1506              : 
    1507              :     void SumZoneImpacts(EnergyPlusData &state);
    1508              : 
    1509              :     void CheckRefrigerationInput(EnergyPlusData &state);
    1510              : 
    1511              :     void SimAirChillerSet(EnergyPlusData &state,
    1512              :                           std::string const &AirChillerSetName,
    1513              :                           int ZoneNum,
    1514              :                           bool FirstHVACIteration,
    1515              :                           Real64 &SysOutputProvided,
    1516              :                           Real64 &LatOutputProvided,
    1517              :                           int &AirChillerSetPtr // from ZoneEquipList(CurZoneEqNum)%EquipIndex(EquipPtr)
    1518              :     );
    1519              : 
    1520              :     void FinalRateCoils(EnergyPlusData &state,
    1521              :                         bool DeRate,                 // True if compressor rack or secondary ht exchanger unable to provide capacity
    1522              :                         SourceType SystemSourceType, // SecondarySystem or DetailedSystem
    1523              :                         int SystemID,                // ID for Secondary loop or detailed system calling for derate
    1524              :                         Real64 InitialTotalLoad,     // Load on system or secondary loop as initially calculated [W]
    1525              :                         Real64 AvailableTotalLoad    // Load that system or secondary loop is able to serve [W]
    1526              :     );
    1527              : 
    1528              :     void FigureRefrigerationZoneGains(EnergyPlusData &state);
    1529              : 
    1530              :     void ZeroHVACValues(EnergyPlusData &state);
    1531              : 
    1532              : } // namespace RefrigeratedCase
    1533              : 
    1534              : struct RefrigeratedCaseData : BaseGlobalStruct
    1535              : {
    1536              : 
    1537              :     int NumRefrigeratedRacks = 0;            // Total number of refrigerated case compressor racks in input
    1538              :     int NumRefrigSystems = 0;                // Total number of detailed refrigeration systems in input
    1539              :     int NumRefrigCondensers = 0;             // Total number of detailed refrigeration condensers in input
    1540              :     int NumRefrigChillerSets = 0;            // Total number of refrigerated warehouse coils in input
    1541              :     int NumSimulationCondAir = 0;            // Number of air-cooled condensers in simulation
    1542              :     int NumSimulationCondEvap = 0;           // Number of evaporative condensers in simulation
    1543              :     int NumSimulationCondWater = 0;          // Number of water-cooled condensers in simulation
    1544              :     int NumSimulationCascadeCondensers = 0;  // Total number of Cascade condensers in IDF
    1545              :     int NumSimulationGasCooler = 0;          // Number of gas coolers in simulation
    1546              :     int NumSimulationSharedGasCoolers = 0;   // Total number of gas coolers that serve more than one system
    1547              :     int NumTransRefrigSystems = 0;           // Total number of transcritical CO2 refrigeration systems
    1548              :     int NumSimulationSharedCondensers = 0;   // Total number of condensers that serve more than one system
    1549              :     int NumSimulationCases = 0;              // Number of refrigerated cases in simulation
    1550              :     int NumSimulationCaseAndWalkInLists = 0; // Total number of CaseAndWalkIn Lists in IDF
    1551              :     int NumSimulationWalkIns = 0;            // Number of walk in coolers in simulation
    1552              :     int NumSimulationCompressors = 0;        // Number of refrigeration compressors in simulation
    1553              :     int NumSimulationSubcoolers = 0;         // Number of refrigeration subcoolers in simulation
    1554              :     int NumSimulationMechSubcoolers = 0;     // Number of mechanical subcoolers in simulation
    1555              :     int NumSimulationRefrigAirChillers = 0;  // Number of individual Air Chillers/coils in simulation
    1556              :     int NumSimulationSecondarySystems = 0;   // Number of Secondary loops in simulation
    1557              :     int NumSimulationTransferLoadLists = 0;  // Number of Secondary Lists in simulation
    1558              :     int NumUnusedRefrigCases = 0;            // Number of refrigerated cases not connected to a rack or system
    1559              :     int NumUnusedCoils = 0;                  // Number of refrigeration air coils not connected to a rack or system
    1560              :     int NumUnusedCondensers = 0;             // Number of refrigeration condensers not connected to a system
    1561              :     int NumUnusedGasCoolers = 0;             // Number of refrigeration gas coolers not connected to a system
    1562              :     int NumUnusedCompressors = 0;            // Number of refrigeration compressors not connected to a system
    1563              :     int NumUnusedSecondarys = 0;             // Number of refrigeration secondarys not connected to a system
    1564              :     bool MyReferPlantScanFlag = true;
    1565              : 
    1566              :     // Refrigerated case variables
    1567              :     Real64 CaseRAFactor = 0.0; // Factor determining case credit allocation (e.g. % to zone or HVAC)
    1568              : 
    1569              :     // Refrigeration compressor rack variables
    1570              :     Real64 TotalRackDeliveredCapacity = 0.0; // Total capacity of all refrigerated cases attached to rack (W)
    1571              :     Real64 TotalCompressorPower = 0.0;       // Total compressor electric power (W)
    1572              :     Real64 CompressorCOPactual = 0.0;        // Compressor coefficient of performance at specific operating conditions (W/W)
    1573              :     Real64 RackSenCreditToZone = 0.0;        // Amount of condenser heat applied to zone load (W)
    1574              :     Real64 RackSenCreditToHVAC = 0.0;        // Amount of condenser heat applied to HVAC RA duct (W)
    1575              : 
    1576              :     // Refrigeration condenser variables (used for both racks and detailed systems)
    1577              :     Real64 TotalCondenserFanPower = 0.0;  // Total condenser fan electric power (W)
    1578              :     Real64 TotalCondenserPumpPower = 0.0; // Total condenser pump electric power (W)
    1579              :     Real64 TotalCondenserHeat = 0.0;      // Total condenser heat from compressor rack (W)
    1580              :     Real64 TotalBasinHeatPower = 0.0;     // Total condenser basin water heater power (W)
    1581              :     Real64 TotalEvapWaterUseRate = 0.0;   // Total condenser water use rate (m3/s)
    1582              : 
    1583              :     // Refrigeration system variables
    1584              :     Array1D_bool
    1585              :         ShowUnmetEnergyWarning; // Used for one-time warning message for possible compressor input error regarding total system compressor capacity
    1586              :     Array1D_bool ShowHiStageUnmetEnergyWarning; // Used for one-time warning message for possible high-stage compressor input error regarding
    1587              :                                                 // high-stage compressor capacity
    1588              : 
    1589              :     // Transcritical refrigeration system variables
    1590              :     Array1D_bool ShowUnmetEnergyWarningTrans; // Used for one-time warning message for possible compressor input error regarding total system
    1591              :                                               // compressor capacity
    1592              : 
    1593              :     // Refrigeration Secondary Loop variables
    1594              :     Array1D_bool ShowUnmetSecondEnergyWarning; // Used for one-time warning message for possible compressor input error regarding secondary loop heat
    1595              :                                                // exchanger capacity
    1596              : 
    1597              :     // Refrigeration Plant connections checks
    1598              :     Array1D_bool CheckEquipNameRackWaterCondenser;
    1599              :     Array1D_bool CheckEquipNameWaterCondenser;
    1600              : 
    1601              :     // Control variables
    1602              :     Array1D_bool RefrigPresentInZone; // Used when translating rate to energy for reporting total refrigeration impact on a zone
    1603              :     Array1D_bool CheckChillerSetName; // used when sim chiller set called form zone equip manager
    1604              : 
    1605              :     bool GetRefrigerationInputFlag = true; // Flag to show case input should be read
    1606              :     bool HaveRefrigRacks = true;           // Is initialized as TRUE and remains true when refrigerated racks exist in the input deck
    1607              :     bool HaveDetailedRefrig = true;        // Is initialized as TRUE and remains true when detailed refrigeration systems exist in the input deck
    1608              :     bool HaveDetailedTransRefrig =
    1609              :         true; // Is initialized as TRUE and remains true when detailed transcritical CO2 refrigeration systems exist in the input deck
    1610              :     bool ManageRefrigeration = true; // Is initialized as TRUE and remains true when refrigerated racks or detailed systems exist in the input deck
    1611              :     bool UseSysTimeStep = false;    // Flag is true IF working on a system that includes a coil cooling a controlled zone on the system time step, All
    1612              :                                     // other refrigeration calculations for case and walkin systems done on the load time step
    1613              :     bool HaveCasesOrWalkins = true; // Is initialized as TRUE and remains true when  refrigerated cases or walkins exist in the input deck
    1614              :     bool HaveChillers = true;       // Is initialized as TRUE and remains true when chillers exist in the input deck
    1615              : 
    1616              :     // Object Data
    1617              :     Array1D<RefrigeratedCase::RefrigCaseData> RefrigCase;
    1618              :     Array1D<RefrigeratedCase::RefrigRackData> RefrigRack;
    1619              :     Array1D<RefrigeratedCase::CaseRAFractionData> CaseRAFraction;
    1620              :     Array1D<RefrigeratedCase::RefrigSystemData> System;
    1621              :     Array1D<RefrigeratedCase::TransRefrigSystemData> TransSystem;
    1622              :     Array1D<RefrigeratedCase::RefrigCondenserData> Condenser;
    1623              :     std::unordered_map<std::string, std::string> UniqueCondenserNames;
    1624              :     Array1D<RefrigeratedCase::RefrigCompressorData> Compressor;
    1625              :     Array1D<RefrigeratedCase::RefrigGasCoolerData> GasCooler;
    1626              :     Array1D<RefrigeratedCase::SubcoolerData> Subcooler;
    1627              :     Array1D<RefrigeratedCase::CaseAndWalkInListDef> CaseAndWalkInList;
    1628              :     Array1D<RefrigeratedCase::CompressorListDef> CompressorLists;
    1629              :     Array1D<RefrigeratedCase::SecondaryLoopData> Secondary;
    1630              :     Array1D<RefrigeratedCase::TransferLoadListDef> TransferLoadList;
    1631              :     Array1D<RefrigeratedCase::WalkInData> WalkIn;
    1632              :     Array1D<RefrigeratedCase::WarehouseCoilData> WarehouseCoil;
    1633              :     Array1D<RefrigeratedCase::AirChillerSetData> AirChillerSet;
    1634              :     Array1D<RefrigeratedCase::CoilCreditData> CoilSysCredit;
    1635              :     Array1D<RefrigeratedCase::CaseWIZoneReportData> CaseWIZoneReport;
    1636              : 
    1637              :     bool MyEnvrnFlag = true; // flag to skip first pass on next begin environment flag
    1638              :     bool InitRefrigerationMyBeginEnvrnFlag = true;
    1639              :     bool InitRefrigerationPlantConnectionsMyBeginEnvrnFlag = true;
    1640              :     bool FigureRefrigerationZoneGainsMyEnvrnFlag = true;
    1641              : 
    1642              :     Real64 MyCurrentTimeSaved = 0.0;   // Used to determine whether the zone time step is a repetition
    1643              :     Real64 MyStepStartTimeSaved = 0.0; // Used to determine whether the system time step is a repetition
    1644              :     Real64 TimeStepFraction = 0.0;     // Used to calculate my current time
    1645              : 
    1646         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
    1647              :     {
    1648         2126 :     }
    1649              : 
    1650         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
    1651              :     {
    1652         1152 :     }
    1653              : 
    1654         2100 :     void clear_state() override
    1655              :     {
    1656         2100 :         new (this) RefrigeratedCaseData();
    1657         2100 :     }
    1658              : };
    1659              : 
    1660              : } // namespace EnergyPlus
    1661              : 
    1662              : #endif
        

Generated by: LCOV version 2.0-1