LCOV - code coverage report
Current view: top level - EnergyPlus - RefrigeratedCase.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 178 181 98.3 %
Date: 2024-08-23 23:50:59 Functions: 14 15 93.3 %

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

Generated by: LCOV version 1.14