LCOV - code coverage report
Current view: top level - EnergyPlus - RefrigeratedCase.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 279 363 76.9 %
Date: 2023-01-17 19:17:23 Functions: 65 82 79.3 %

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

Generated by: LCOV version 1.13