LCOV - code coverage report
Current view: top level - EnergyPlus - DXCoils.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 95.3 % 64 61
Test Date: 2025-06-02 07:23:51 Functions: 83.3 % 6 5

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

Generated by: LCOV version 2.0-1