LCOV - code coverage report
Current view: top level - EnergyPlus - PackagedThermalStorageCoil.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 21.1 % 71 15
Test Date: 2025-05-22 16:09:37 Functions: 75.0 % 4 3

            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 PackagedThermalStorageCoil_hh_INCLUDED
      49              : #define PackagedThermalStorageCoil_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/Data/EnergyPlusData.hh>
      58              : #include <EnergyPlus/DataGlobals.hh>
      59              : #include <EnergyPlus/DataHVACGlobals.hh>
      60              : #include <EnergyPlus/DataHeatBalance.hh>
      61              : #include <EnergyPlus/EnergyPlus.hh>
      62              : #include <EnergyPlus/FluidProperties.hh>
      63              : #include <EnergyPlus/HVACUnitaryBypassVAV.hh>
      64              : 
      65              : namespace EnergyPlus {
      66              : 
      67              : namespace PackagedThermalStorageCoil {
      68              : 
      69              :     // control types
      70              :     enum class PTSCCtrlType
      71              :     {
      72              :         Invalid = -1,
      73              :         ScheduledOpModes,   // control over TES modes is via local schedule
      74              :         EMSActuatedOpModes, // control over TES modes is via EMS
      75              :         Num
      76              :     };
      77              : 
      78              :     // Control Modes
      79              :     enum class PTSCOperatingMode
      80              :     {
      81              :         Invalid = -1,
      82              :         Off,
      83              :         CoolingOnly,
      84              :         CoolingAndCharge,
      85              :         CoolingAndDischarge,
      86              :         ChargeOnly,
      87              :         DischargeOnly,
      88              :         Num
      89              :     };
      90              : 
      91              :     // storage media
      92              :     enum class MediaType
      93              :     {
      94              :         Invalid = -1,
      95              :         Water,
      96              :         UserDefindFluid,
      97              :         Ice,
      98              :         Num
      99              :     };
     100              : 
     101              :     // Water Systems
     102              :     enum class CondensateAction
     103              :     {
     104              :         Invalid = -1,
     105              :         Discard, // default mode where water is "lost"
     106              :         ToTank,  // collect coil condensate from air and store in water storage tank
     107              :         Num
     108              :     };
     109              : 
     110              :     enum class EvapWaterSupply
     111              :     {
     112              :         Invalid = -1,
     113              :         WaterSupplyFromMains,
     114              :         WaterSupplyFromTank,
     115              :         Num
     116              :     };
     117              : 
     118              :     enum class TESCondenserType
     119              :     {
     120              :         Invalid = -1,
     121              :         Air,
     122              :         Evap,
     123              :         Num
     124              :     };
     125              : 
     126              :     // Dehumidification control modes (DehumidControlMode)
     127              :     constexpr int DehumidControl_CoolReheat(2);
     128              : 
     129              :     struct PackagedTESCoolingCoilStruct
     130              :     {
     131              :         // Members
     132              :         std::string Name;                            // Name of TES cooling package
     133              :         Sched::Schedule *availSched = nullptr;       // availability schedule
     134              :         PTSCCtrlType ModeControlType;                // how are operation modes controlled
     135              :         Sched::Schedule *controlModeSched = nullptr; // control schedule if used
     136              :         bool EMSControlModeOn;                       // if true, then EMS actuator has been used
     137              :         Real64 EMSControlModeValue;                  // value to use from EMS actuator for control mode
     138              :         PTSCOperatingMode CurControlMode = PTSCOperatingMode::Off;
     139              :         int curControlModeReport = static_cast<int>(PTSCOperatingMode::Off);
     140              :         int ControlModeErrorIndex;
     141              :         Real64 RatedEvapAirVolFlowRate;  // [m3/s]
     142              :         Real64 RatedEvapAirMassFlowRate; // [kg/s]
     143              :         int EvapAirInletNodeNum;         // evaporator inlet node pointer
     144              :         int EvapAirOutletNodeNum;        // evaporator outlet node pointer
     145              :         // Cooling Only Mode
     146              :         bool CoolingOnlyModeIsAvailable;
     147              :         Real64 CoolingOnlyRatedTotCap; // gross total cooling capacity at rating conditions [W]
     148              :         Real64 CoolingOnlyRatedSHR;    // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
     149              :         Real64 CoolingOnlyRatedCOP;    // Coefficient of performance at rating conditions [W/W]
     150              :         int CoolingOnlyCapFTempCurve;  // curve index for total cooling capacity modifier curve
     151              :         // (function of entering wetbulb, outside drybulb)
     152              :         int CoolingOnlyCapFTempObjectNum; // type of object used for curve input
     153              :         int CoolingOnlyCapFFlowCurve;     // curve index for total cooling capacity modifier curve
     154              :         // (function of actual supply air flow vs rated air flow)
     155              :         int CoolingOnlyCapFFlowObjectNum; // type of object used for curve input
     156              :         int CoolingOnlyEIRFTempCurve;     // curve index for energy input ratio modifier curve
     157              :         // (function of entering wetbulb, outside drybulb)
     158              :         int CoolingOnlyEIRFTempObjectNum; // type of object used for curve input
     159              :         int CoolingOnlyEIRFFlowCurve;     // curve index for energy input ratio modifier curve
     160              :         // (function of actual supply air flow vs rated air flow)
     161              :         int CoolingOnlyEIRFFlowObjectNum; // type of object used for curve input
     162              :         int CoolingOnlyPLFFPLRCurve;      // curve index for part-load fact vs part load ratio,EIR modifier
     163              :         int CoolingOnlyPLFFPLRObjectNum;  // type of object used for curve input
     164              :         int CoolingOnlySHRFTempCurve;     // curve index for sensible heat ratio modifier curve
     165              :         // (function of entering wetbulb and drybulb)
     166              :         int CoolingOnlySHRFTempObjectNum; // type of object used for curve input
     167              :         int CoolingOnlySHRFFlowCurve;     // curve index for sensible heat ratio modifer curve
     168              :         // (function of actual supply air flow vs rated air flow)
     169              :         int CoolingOnlySHRFFlowObjectNum;
     170              :         // cooling and charge mode
     171              :         bool CoolingAndChargeModeAvailable;
     172              :         Real64 CoolingAndChargeRatedTotCap;                // gross total evaporator cooling capacity at rating conditions [W]
     173              :         Real64 CoolingAndChargeRatedTotCapSizingFactor;    // sizing factor for gross total evaporator [ ]
     174              :         Real64 CoolingAndChargeRatedChargeCap;             // net storage charging capacity at rating conditions [W]
     175              :         Real64 CoolingAndChargeRatedChargeCapSizingFactor; // sizing factor for charging capacity [ ]
     176              :         Real64 CoolingAndChargeRatedSHR;                   // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
     177              :         Real64 CoolingAndChargeCoolingRatedCOP;            // Coefficient of performance at rating conditions, for cooling [W/W]
     178              :         Real64 CoolingAndChargeChargingRatedCOP;           // Coefficient of performance at rating conditions, for charging [W/W]
     179              :         int CoolingAndChargeCoolingCapFTempCurve;          // curve index for total cooling capacity modifier curve
     180              :         // (function of entering wetbulb, outside drybulb, state of TES)
     181              :         int CoolingAndChargeCoolingCapFTempObjectNum;
     182              :         int CoolingAndChargeCoolingCapFFlowCurve; // curve index for total cooling capacity modifier curve
     183              :         // (function of actual supply air flow vs rated air flow)
     184              :         int CoolingAndChargeCoolingCapFFlowObjectNum;
     185              :         int CoolingAndChargeCoolingEIRFTempCurve; // curve index for cooling energy input ratio modifier curve
     186              :         // (function of entering wetbulb, outside drybulb, state of TES)
     187              :         int CoolingAndChargeCoolingEIRFTempObjectNum;
     188              :         int CoolingAndChargeCoolingEIRFFlowCurve; // curve index for cooling energy input ratio modifier curve
     189              :         // (function of actual supply air flow vs rated air flow)
     190              :         int CoolingAndChargeCoolingEIRFFlowObjectNum;
     191              :         int CoolingAndChargeCoolingPLFFPLRCurve; // curve index for cooling part-load fact vs part load ratio, EIR modifier
     192              :         // (function of evaporator part load)
     193              :         int CoolingAndChargeCoolingPLFFPLRObjectNum;
     194              :         int CoolingAndChargeChargingCapFTempCurve; // curve index for charging capacity modifier curve
     195              :         // (function of entering wetbulb, outside drybulb, state of TES)
     196              :         int CoolingAndChargeChargingCapFTempObjectNum;
     197              :         int CoolingAndChargeChargingCapFEvapPLRCurve; // curve index for charging capacity modifier curve
     198              :         // function of evaporator part load ratio
     199              :         int CoolingAndChargeChargingCapFEvapPLRObjectNum;
     200              :         int CoolingAndChargeChargingEIRFTempCurve; // curve index for charging energy input ratio modifier curve
     201              :         // (function of entering wetbulb, outside drybulb, state of TES)
     202              :         int CoolingAndChargeChargingEIRFTempObjectNum;
     203              :         int CoolingAndChargeChargingEIRFFLowCurve; // curve index for charging energy input ratio modifier curve
     204              :         // (function of actual supply air flow vs rated air flow)
     205              :         int CoolingAndChargeChargingEIRFFLowObjectNum;
     206              :         int CoolingAndChargeChargingPLFFPLRCurve; // curve index for chargine part-load fact vs part load ratio, EIR modif
     207              :         // (function of evaporator part load)
     208              :         int CoolingAndChargeChargingPLFFPLRObjectNum;
     209              :         int CoolingAndChargeSHRFTempCurve; // curve index for sensible heat ratio modifier curve
     210              :         // (function of entering wetbulb and drybulb)
     211              :         int CoolingAndChargeSHRFFlowCurve; // curve index for sensible heat ratio modifer curve
     212              :         // (function of actual supply air flow vs rated air flow)
     213              :         int CoolingAndChargeSHRFFlowObjectNum;
     214              :         // cooling and discharge mode
     215              :         bool CoolingAndDischargeModeAvailable;
     216              :         Real64 CoolingAndDischargeRatedTotCap;                   // gross total evaporator cooling capacity at rating conditions [W]
     217              :         Real64 CoolingAndDischargeRatedTotCapSizingFactor;       // sizing factor gross total cooling capacity []
     218              :         Real64 CoolingAndDischargeRatedDischargeCap;             // net storage discharging capacity at rating conditions [W]
     219              :         Real64 CoolingAndDischargeRatedDischargeCapSizingFactor; // sizing factor discharging capacity []
     220              :         Real64 CoolingAndDischargeRatedSHR;                      // Sensible heat ratio (sens cap/total cap) at rating conditions [W/W]
     221              :         Real64 CoolingAndDischargeCoolingRatedCOP;               // Coefficient of performance at rating conditions, for cooling [W/W]
     222              :         Real64 CoolingAndDischargeDischargingRatedCOP;           // Coefficient of performance at rating conditions, for charging [W/W]
     223              :         int CoolingAndDischargeCoolingCapFTempCurve;             // curve index for total cooling capacity modifier curve
     224              :         // (function of entering wetbulb, outside drybulb, state of TES)
     225              :         int CoolingAndDischargeCoolingCapFTempObjectNum;
     226              :         int CoolingAndDischargeCoolingCapFFlowCurve; // curve index for total cooling capacity modifier curve
     227              :         // (function of actual supply air flow vs rated air flow)
     228              :         int CoolingAndDischargeCoolingCapFFlowObjectNum;
     229              :         int CoolingAndDischargeCoolingEIRFTempCurve; // curve index for cooling energy input ratio modifier curve
     230              :         // (function of entering wetbulb, outside drybulb, state of TES)
     231              :         int CoolingAndDischargeCoolingEIRFTempObjectNum;
     232              :         int CoolingAndDischargeCoolingEIRFFlowCurve; // curve index for cooling energy input ratio modifier curve
     233              :         // (function of actual supply air flow vs rated air flow)
     234              :         int CoolingAndDischargeCoolingEIRFFlowObjectNum;
     235              :         int CoolingAndDischargeCoolingPLFFPLRCurve; // curve index for cooling part-load fact vs part load ratio,
     236              :         // EIR modifier (function of evaporator part load)
     237              :         int CoolingAndDischargeCoolingPLFFPLRObjectNum;
     238              :         int CoolingAndDischargeDischargingCapFTempCurve; // curve index for discharging capacity modifier curve
     239              :         // (function of entering wetbulb, outside drybulb, state of TES)
     240              :         int CoolingAndDischargeDischargingCapFTempObjectNum;
     241              :         int CoolingAndDischargeDischargingCapFFlowCurve; // curve index for discharging capacity modifier curve
     242              :         // (function of actual supply air flow vs rated air flow)
     243              :         int CoolingAndDischargeDischargingCapFFlowObjectNum;
     244              :         int CoolingAndDischargeDischargingCapFEvapPLRCurve; // curve index for discharging capacity modifier curve
     245              :         // function of evaporator part load ratio
     246              :         int CoolingAndDischargeDischargingCapFEvapPLRObjectNum;
     247              :         int CoolingAndDischargeDischargingEIRFTempCurve; // curve index for discharging energy input ratio modifier curve
     248              :         // (function of entering wetbulb, outside drybulb, state of TES)
     249              :         int CoolingAndDischargeDischargingEIRFTempObjectNum;
     250              :         int CoolingAndDischargeDischargingEIRFFLowCurve; // curve index for discharging energy input ratio modifier curve
     251              :         // (function of actual supply air flow vs rated air flow)
     252              :         int CoolingAndDischargeDischargingEIRFFLowObjectNum;
     253              :         int CoolingAndDischargeDischargingPLFFPLRCurve; // curve index for discharging part-load fact vs part load ratio
     254              :         //  EIR modifier (function of evaporator part load)
     255              :         int CoolingAndDischargeDischargingPLFFPLRObjectNum;
     256              :         int CoolingAndDischargeSHRFTempCurve; // curve index for sensible heat ratio modifier curve
     257              :         // (function of entering wetbulb and drybulb)
     258              :         int CoolingAndDischargeSHRFTempObjectNum;
     259              :         int CoolingAndDischargeSHRFFlowCurve; // curve index for sensible heat ratio modifer curve
     260              :         // (function of actual supply air flow vs rated air flow)
     261              :         int CoolingAndDischargeSHRFFlowObjectNum;
     262              :         // Charge Only Mode
     263              :         bool ChargeOnlyModeAvailable;
     264              :         Real64 ChargeOnlyRatedCapacity;             // net storage charging capacity at rating conditions [W]
     265              :         Real64 ChargeOnlyRatedCapacitySizingFactor; // sizing factor for charging capacity []
     266              :         Real64 ChargeOnlyRatedCOP;                  // coefficient of performance at rating conditions [W/W]
     267              :         int ChargeOnlyChargingCapFTempCurve;        // curve index for charging capacity modifier curve
     268              :         // function of outside drybulb and state of TES
     269              :         int ChargeOnlyChargingCapFTempObjectNum;
     270              :         int ChargeOnlyChargingEIRFTempCurve; // curve index for charging energy input ratio modifier curve
     271              :         // function of outside drybulb and state of TES
     272              :         int ChargeOnlyChargingEIRFTempObjectNum;
     273              :         // Discharge Only mode
     274              :         bool DischargeOnlyModeAvailable;
     275              :         Real64 DischargeOnlyRatedDischargeCap;             // gross total evaporator cooling capacity at rating conditions [W]
     276              :         Real64 DischargeOnlyRatedDischargeCapSizingFactor; // sizing factor for cooling capacity []
     277              :         Real64 DischargeOnlyRatedSHR;                      // sensible heat ratio (sens cap/total cap) at rating conditions
     278              :         Real64 DischargeOnlyRatedCOP;                      // coefficient of performance at rating conditions for discharging [W/W]
     279              :         int DischargeOnlyCapFTempCurve;                    // curve index for total cooling capacity modifier curve
     280              :         // function of entering wetbulb and state of TES
     281              :         int DischargeOnlyCapFTempObjectNum;
     282              :         int DischargeOnlyCapFFlowCurve; // curve index for tot cooling capacity modifier curve
     283              :         // (function of actual supply air flow vs rated air flow)
     284              :         int DischargeOnlyCapFFlowObjectNum;
     285              :         int DischargeOnlyEIRFTempCurve; // curve index for energy input ratio modifier curve
     286              :         // function of entering wetbulb and state of TES
     287              :         int DischargeOnlyEIRFTempObjectNum;
     288              :         int DischargeOnlyEIRFFlowCurve; // curve index for energy input ratio modifier curve
     289              :         // (function of actual supply air flow vs rated air flow)
     290              :         int DischargeOnlyEIRFFlowObjectNum;
     291              :         int DischargeOnlyPLFFPLRCurve; // curve index for part-load fact vs evaporator part load ratio
     292              :         int DischargeOnlyPLFFPLRObjectNum;
     293              :         int DischargeOnlySHRFTempCurve; // curve index for sensible heat ratio modifier curve
     294              :         // (function of entering wetbulb and drybulb)
     295              :         int DischargeOnlySHRFTempObjectNum;
     296              :         int DischargeOnlySHRFFLowCurve; // curve index for
     297              :         int DischargeOnlySHRFFLowObjectNum;
     298              :         // other inputs
     299              :         Real64 AncillaryControlsPower;                          // standby and controls electric power, draws when available [W]
     300              :         Real64 ColdWeatherMinimumTempLimit;                     // temperature limit for cold weather operation mode [C]
     301              :         Real64 ColdWeatherAncillaryPower;                       // electrical power draw during cold weather [W]
     302              :         int CondAirInletNodeNum;                                // Condenser air inlet node num pointer
     303              :         int CondAirOutletNodeNum;                               // condenser air outlet node num pointer
     304              :         TESCondenserType CondenserType = TESCondenserType::Air; // Type of condenser for DX cooling coil: AIR COOLED or EVAP COOLED
     305              :         Real64 CondenserAirVolumeFlow;                          // design air flow rate thru condenser [m3/s]
     306              :         Real64 CondenserAirFlowSizingFactor;                    // scale condenser air flow relative to evap air flow when autosizing
     307              :         Real64 CondenserAirMassFlow;                            // design air flow rate thru condenser [kg/s]
     308              :         Real64 EvapCondEffect;                                  // effectiveness of the evaporatively cooled condenser
     309              :         Real64 CondInletTemp;                                   // air temperature drybulb entering condenser section after evap cooling [C]
     310              :         Real64 EvapCondPumpElecNomPower;                        // Nominal power input to the evap condenser water circulation pump [W]
     311              :         Real64 EvapCondPumpElecEnergy;                          // Electric energy used by condenser water circulation pump [J]
     312              :         Real64 BasinHeaterPowerFTempDiff;                       // Basin heater power for evaporatively cooled condensers [W/K]
     313              :         Sched::Schedule *basinHeaterAvailSched = nullptr;       // basin heater availability schedule pointer num
     314              :         Real64 BasinHeaterSetpointTemp;                         // evap water basin temperature setpoint [C]
     315              :         EvapWaterSupply EvapWaterSupplyMode;                    // where does evap water come from
     316              :         std::string EvapWaterSupplyName;                        // name of water source e.g. water storage tank
     317              :         int EvapWaterSupTankID;                                 // supply tank index, if any
     318              :         int EvapWaterTankDemandARRID;                           // evap water demand array index
     319              :         CondensateAction CondensateCollectMode;                 // where does condensate  water go to
     320              :         std::string CondensateCollectName;                      // name of water source e.g. water storage tank
     321              :         int CondensateTankID;
     322              :         int CondensateTankSupplyARRID;
     323              :         // TES tank
     324              :         MediaType StorageMedia;       // water/fluid or ice based TES
     325              :         std::string StorageFluidName; // if user defined, name of fluid type
     326              :         Fluid::GlycolProps *glycol = nullptr;
     327              : 
     328              :         Real64 FluidStorageVolume;          // volume of water in storage tank for water systems [m3/s]
     329              :         Real64 IceStorageCapacity;          // capacity of storage in J
     330              :         Real64 StorageCapacitySizingFactor; // storage time used to autocalculate capacity [hr]
     331              :         Real64 MinimumFluidTankTempLimit;   // optional inputs [C]
     332              :         Real64 MaximumFluidTankTempLimit;   // optional inputs [C]
     333              :         Real64 RatedFluidTankTemp;          // rating point condition for fluid storage tanks [C]
     334              :         int StorageAmbientNodeNum;          // node "pointer" for ambient conditions exposed to TES
     335              :         Real64 StorageUA;                   // overall heat transfer coefficient for TES to ambient [W/k]
     336              :         bool TESPlantConnectionAvailable;
     337              :         int TESPlantInletNodeNum;                        // plant loop inlet node index
     338              :         int TESPlantOutletNodeNum;                       // plant loop outlet node index
     339              :         int TESPlantLoopNum;                             // plant loop connection index
     340              :         DataPlant::LoopSideLocation TESPlantLoopSideNum; // plant loop side connection index
     341              :         int TESPlantBranchNum;                           // plant loop branch connection index
     342              :         int TESPlantCompNum;                             // plant loop component connection index
     343              :         Real64 TESPlantDesignVolumeFlowRate;             // plant connection design mass flow rate [m3/s]
     344              :         Real64 TESPlantDesignMassFlowRate;               // [kg/s]
     345              :         Real64 TESPlantEffectiveness;
     346              :         Real64 TimeElapsed;
     347              :         Real64 IceFracRemain;             // state of storage for current time step [0..1.0]
     348              :         Real64 IceFracRemainLastTimestep; // state of storage for previous time step [0..1.0]
     349              :         Real64 FluidTankTempFinal;
     350              :         Real64 FluidTankTempFinalLastTimestep;
     351              :         // dynamic calculated data
     352              :         Real64 QdotPlant;            // heat exchange rate for plant connection to TES tank [W]
     353              :         Real64 Q_Plant;              // heat exchange energy for plant connection to TES tank [J]
     354              :         Real64 QdotAmbient;          // heat exchange rate for skin losses/gains for TES tank to surroundings [W]
     355              :         Real64 Q_Ambient;            // heat exchange enegy for skin losses/gains for TES tank to surroundings [J]
     356              :         Real64 QdotTES;              // heat exchange rate by mechanical systems to charge or discharge TES [W]
     357              :         Real64 Q_TES;                // heat exchange energy by mechanical systems to charge or discharge TES [J]
     358              :         Real64 ElecCoolingPower;     // electric power for cooling [W]
     359              :         Real64 ElecCoolingEnergy;    // electric energy for cooling [J], metered
     360              :         Real64 EvapTotCoolingRate;   // evaporator coil total cooling rate [W]
     361              :         Real64 EvapTotCoolingEnergy; // evaporatory coil total cooling energy [J], metered
     362              :         Real64 EvapSensCoolingRate;
     363              :         Real64 EvapSensCoolingEnergy;
     364              :         Real64 EvapLatCoolingRate;
     365              :         Real64 EvapLatCoolingEnergy;
     366              :         Real64 RuntimeFraction;
     367              :         Real64 CondenserRuntimeFraction;
     368              :         Real64 ElectColdWeatherPower;  // electric power for cold weather protection [W]
     369              :         Real64 ElectColdWeatherEnergy; // electric energy for cold weather protection [J], metered
     370              :         Real64 ElectEvapCondBasinHeaterPower;
     371              :         Real64 ElectEvapCondBasinHeaterEnergy;
     372              :         Real64 EvapWaterConsumpRate;    // Evap Water Consumption rate in m3/sec
     373              :         Real64 EvapWaterConsump;        // Evap Water Consumption in m3
     374              :         Real64 EvapWaterStarvMakupRate; // Evap water consumed but not really available from tank m3/s
     375              :         Real64 EvapWaterStarvMakup;     // Evap water consumed but not really available from tank m3
     376              :         Real64 EvapCondPumpElecPower;
     377              :         Real64 EvapCondPumpElecConsumption;
     378              : 
     379              :         // Default Constructor
     380            0 :         PackagedTESCoolingCoilStruct()
     381            0 :             : ModeControlType(PTSCCtrlType::Invalid), EMSControlModeOn(false), EMSControlModeValue(0.0), ControlModeErrorIndex(0),
     382            0 :               RatedEvapAirVolFlowRate(0.0), RatedEvapAirMassFlowRate(0.0), EvapAirInletNodeNum(0), EvapAirOutletNodeNum(0),
     383            0 :               CoolingOnlyModeIsAvailable(false), CoolingOnlyRatedTotCap(0.0), CoolingOnlyRatedSHR(0.0), CoolingOnlyRatedCOP(0.0),
     384            0 :               CoolingOnlyCapFTempCurve(0), CoolingOnlyCapFTempObjectNum(0), CoolingOnlyCapFFlowCurve(0), CoolingOnlyCapFFlowObjectNum(0),
     385            0 :               CoolingOnlyEIRFTempCurve(0), CoolingOnlyEIRFTempObjectNum(0), CoolingOnlyEIRFFlowCurve(0), CoolingOnlyEIRFFlowObjectNum(0),
     386            0 :               CoolingOnlyPLFFPLRCurve(0), CoolingOnlyPLFFPLRObjectNum(0), CoolingOnlySHRFTempCurve(0), CoolingOnlySHRFTempObjectNum(0),
     387            0 :               CoolingOnlySHRFFlowCurve(0), CoolingOnlySHRFFlowObjectNum(0), CoolingAndChargeModeAvailable(false), CoolingAndChargeRatedTotCap(0.0),
     388            0 :               CoolingAndChargeRatedTotCapSizingFactor(0.0), CoolingAndChargeRatedChargeCap(0.0), CoolingAndChargeRatedChargeCapSizingFactor(0.0),
     389            0 :               CoolingAndChargeRatedSHR(0.0), CoolingAndChargeCoolingRatedCOP(0.0), CoolingAndChargeChargingRatedCOP(0.0),
     390            0 :               CoolingAndChargeCoolingCapFTempCurve(0), CoolingAndChargeCoolingCapFTempObjectNum(0), CoolingAndChargeCoolingCapFFlowCurve(0),
     391            0 :               CoolingAndChargeCoolingCapFFlowObjectNum(0), CoolingAndChargeCoolingEIRFTempCurve(0), CoolingAndChargeCoolingEIRFTempObjectNum(0),
     392            0 :               CoolingAndChargeCoolingEIRFFlowCurve(0), CoolingAndChargeCoolingEIRFFlowObjectNum(0), CoolingAndChargeCoolingPLFFPLRCurve(0),
     393            0 :               CoolingAndChargeCoolingPLFFPLRObjectNum(0), CoolingAndChargeChargingCapFTempCurve(0), CoolingAndChargeChargingCapFTempObjectNum(0),
     394            0 :               CoolingAndChargeChargingCapFEvapPLRCurve(0), CoolingAndChargeChargingCapFEvapPLRObjectNum(0), CoolingAndChargeChargingEIRFTempCurve(0),
     395            0 :               CoolingAndChargeChargingEIRFTempObjectNum(0), CoolingAndChargeChargingEIRFFLowCurve(0), CoolingAndChargeChargingEIRFFLowObjectNum(0),
     396            0 :               CoolingAndChargeChargingPLFFPLRCurve(0), CoolingAndChargeChargingPLFFPLRObjectNum(0), CoolingAndChargeSHRFTempCurve(0),
     397            0 :               CoolingAndChargeSHRFFlowCurve(0), CoolingAndChargeSHRFFlowObjectNum(0), CoolingAndDischargeModeAvailable(false),
     398            0 :               CoolingAndDischargeRatedTotCap(0.0), CoolingAndDischargeRatedTotCapSizingFactor(0.0), CoolingAndDischargeRatedDischargeCap(0.0),
     399            0 :               CoolingAndDischargeRatedDischargeCapSizingFactor(0.0), CoolingAndDischargeRatedSHR(0.0), CoolingAndDischargeCoolingRatedCOP(0.0),
     400            0 :               CoolingAndDischargeDischargingRatedCOP(0.0), CoolingAndDischargeCoolingCapFTempCurve(0), CoolingAndDischargeCoolingCapFTempObjectNum(0),
     401            0 :               CoolingAndDischargeCoolingCapFFlowCurve(0), CoolingAndDischargeCoolingCapFFlowObjectNum(0), CoolingAndDischargeCoolingEIRFTempCurve(0),
     402            0 :               CoolingAndDischargeCoolingEIRFTempObjectNum(0), CoolingAndDischargeCoolingEIRFFlowCurve(0),
     403            0 :               CoolingAndDischargeCoolingEIRFFlowObjectNum(0), CoolingAndDischargeCoolingPLFFPLRCurve(0),
     404            0 :               CoolingAndDischargeCoolingPLFFPLRObjectNum(0), CoolingAndDischargeDischargingCapFTempCurve(0),
     405            0 :               CoolingAndDischargeDischargingCapFTempObjectNum(0), CoolingAndDischargeDischargingCapFFlowCurve(0),
     406            0 :               CoolingAndDischargeDischargingCapFFlowObjectNum(0), CoolingAndDischargeDischargingCapFEvapPLRCurve(0),
     407            0 :               CoolingAndDischargeDischargingCapFEvapPLRObjectNum(0), CoolingAndDischargeDischargingEIRFTempCurve(0),
     408            0 :               CoolingAndDischargeDischargingEIRFTempObjectNum(0), CoolingAndDischargeDischargingEIRFFLowCurve(0),
     409            0 :               CoolingAndDischargeDischargingEIRFFLowObjectNum(0), CoolingAndDischargeDischargingPLFFPLRCurve(0),
     410            0 :               CoolingAndDischargeDischargingPLFFPLRObjectNum(0), CoolingAndDischargeSHRFTempCurve(0), CoolingAndDischargeSHRFTempObjectNum(0),
     411            0 :               CoolingAndDischargeSHRFFlowCurve(0), CoolingAndDischargeSHRFFlowObjectNum(0), ChargeOnlyModeAvailable(false),
     412            0 :               ChargeOnlyRatedCapacity(0.0), ChargeOnlyRatedCapacitySizingFactor(0.0), ChargeOnlyRatedCOP(0.0), ChargeOnlyChargingCapFTempCurve(0),
     413            0 :               ChargeOnlyChargingCapFTempObjectNum(0), ChargeOnlyChargingEIRFTempCurve(0), ChargeOnlyChargingEIRFTempObjectNum(0),
     414            0 :               DischargeOnlyModeAvailable(false), DischargeOnlyRatedDischargeCap(0.0), DischargeOnlyRatedDischargeCapSizingFactor(0.0),
     415            0 :               DischargeOnlyRatedSHR(0.0), DischargeOnlyRatedCOP(0.0), DischargeOnlyCapFTempCurve(0), DischargeOnlyCapFTempObjectNum(0),
     416            0 :               DischargeOnlyCapFFlowCurve(0), DischargeOnlyCapFFlowObjectNum(0), DischargeOnlyEIRFTempCurve(0), DischargeOnlyEIRFTempObjectNum(0),
     417            0 :               DischargeOnlyEIRFFlowCurve(0), DischargeOnlyEIRFFlowObjectNum(0), DischargeOnlyPLFFPLRCurve(0), DischargeOnlyPLFFPLRObjectNum(0),
     418            0 :               DischargeOnlySHRFTempCurve(0), DischargeOnlySHRFTempObjectNum(0), DischargeOnlySHRFFLowCurve(0), DischargeOnlySHRFFLowObjectNum(0),
     419            0 :               AncillaryControlsPower(0.0), ColdWeatherMinimumTempLimit(0.0), ColdWeatherAncillaryPower(0.0), CondAirInletNodeNum(0),
     420            0 :               CondAirOutletNodeNum(0), CondenserAirVolumeFlow(0.0), CondenserAirFlowSizingFactor(0.0), CondenserAirMassFlow(0.0), EvapCondEffect(0.0),
     421            0 :               CondInletTemp(0.0), EvapCondPumpElecNomPower(0.0), EvapCondPumpElecEnergy(0.0), BasinHeaterPowerFTempDiff(0.0),
     422            0 :               BasinHeaterSetpointTemp(0.0), EvapWaterSupplyMode(EvapWaterSupply::WaterSupplyFromMains), EvapWaterSupTankID(0),
     423            0 :               EvapWaterTankDemandARRID(0), CondensateCollectMode(CondensateAction::Discard), CondensateTankID(0), CondensateTankSupplyARRID(0),
     424            0 :               StorageMedia(MediaType::Invalid), FluidStorageVolume(0.0), IceStorageCapacity(0.0), StorageCapacitySizingFactor(0.0),
     425            0 :               MinimumFluidTankTempLimit(0.0), MaximumFluidTankTempLimit(100.0), RatedFluidTankTemp(0.0), StorageAmbientNodeNum(0), StorageUA(0.0),
     426            0 :               TESPlantConnectionAvailable(false), TESPlantInletNodeNum(0), TESPlantOutletNodeNum(0), TESPlantLoopNum(0),
     427            0 :               TESPlantLoopSideNum(DataPlant::LoopSideLocation::Invalid), TESPlantBranchNum(0), TESPlantCompNum(0), TESPlantDesignVolumeFlowRate(0.0),
     428            0 :               TESPlantDesignMassFlowRate(0.0), TESPlantEffectiveness(0.0), TimeElapsed(0.0), IceFracRemain(0.0), IceFracRemainLastTimestep(0.0),
     429            0 :               FluidTankTempFinal(0.0), FluidTankTempFinalLastTimestep(0.0), QdotPlant(0.0), Q_Plant(0.0), QdotAmbient(0.0), Q_Ambient(0.0),
     430            0 :               QdotTES(0.0), Q_TES(0.0), ElecCoolingPower(0.0), ElecCoolingEnergy(0.0), EvapTotCoolingRate(0.0), EvapTotCoolingEnergy(0.0),
     431            0 :               EvapSensCoolingRate(0.0), EvapSensCoolingEnergy(0.0), EvapLatCoolingRate(0.0), EvapLatCoolingEnergy(0.0), RuntimeFraction(0.0),
     432            0 :               CondenserRuntimeFraction(0.0), ElectColdWeatherPower(0.0), ElectColdWeatherEnergy(0.0), ElectEvapCondBasinHeaterPower(0.0),
     433            0 :               ElectEvapCondBasinHeaterEnergy(0.0), EvapWaterConsumpRate(0.0), EvapWaterConsump(0.0), EvapWaterStarvMakupRate(0.0),
     434            0 :               EvapWaterStarvMakup(0.0), EvapCondPumpElecPower(0.0), EvapCondPumpElecConsumption(0.0)
     435              :         {
     436            0 :         }
     437              :     };
     438              : 
     439              :     void SimTESCoil(EnergyPlusData &state,
     440              :                     std::string_view CompName, // name of the fan coil unit
     441              :                     int &CompIndex,
     442              :                     HVAC::FanOp const fanOp, // allows parent object to control fan mode
     443              :                     PTSCOperatingMode &TESOpMode,
     444              :                     ObjexxFCL::Optional<Real64 const> PartLoadRatio = _ // part load ratio (for single speed cycling unit)
     445              :     );
     446              : 
     447              :     void GetTESCoilInput(EnergyPlusData &state);
     448              : 
     449              :     void InitTESCoil(EnergyPlusData &state, int &TESCoilNum);
     450              : 
     451              :     void SizeTESCoil(EnergyPlusData &state, int &TESCoilNum);
     452              : 
     453              :     void CalcTESCoilOffMode(EnergyPlusData &state, int const TESCoilNum);
     454              : 
     455              :     void CalcTESCoilCoolingOnlyMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
     456              : 
     457              :     void CalcTESCoilCoolingAndChargeMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
     458              : 
     459              :     void CalcTESCoilCoolingAndDischargeMode(EnergyPlusData &state, int const TESCoilNum, HVAC::FanOp const fanOp, Real64 const PartLoadRatio);
     460              : 
     461              :     void CalcTESCoilChargeOnlyMode(EnergyPlusData &state, int const TESCoilNum);
     462              : 
     463              :     void CalcTESCoilDischargeOnlyMode(EnergyPlusData &state, int const TESCoilNum, Real64 const PartLoadRatio);
     464              : 
     465              :     void UpdateTEStorage(EnergyPlusData &state, int const TESCoilNum);
     466              : 
     467              :     void CalcTESWaterStorageTank(EnergyPlusData &state, int const TESCoilNum);
     468              : 
     469              :     void CalcTESIceStorageTank(EnergyPlusData &state, int const TESCoilNum);
     470              : 
     471              :     void UpdateColdWeatherProtection(EnergyPlusData &state, int const TESCoilNum);
     472              : 
     473              :     void UpdateEvaporativeCondenserBasinHeater(EnergyPlusData &state, int const TESCoilNum);
     474              : 
     475              :     void UpdateEvaporativeCondenserWaterUse(EnergyPlusData &state, int const TESCoilNum, Real64 const HumRatAfterEvap, int const InletNodeNum);
     476              : 
     477              :     void GetTESCoilIndex(
     478              :         EnergyPlusData &state, std::string const &CoilName, int &CoilIndex, bool &ErrorsFound, std::string_view const CurrentModuleObject = {});
     479              : 
     480              :     void GetTESCoilAirInletNode(
     481              :         EnergyPlusData &state, std::string const &CoilName, int &CoilAirInletNode, bool &ErrorsFound, std::string const &CurrentModuleObject);
     482              : 
     483              :     void GetTESCoilAirOutletNode(
     484              :         EnergyPlusData &state, std::string const &CoilName, int &CoilAirOutletNode, bool &ErrorsFound, std::string const &CurrentModuleObject);
     485              : 
     486              :     void GetTESCoilCoolingCapacity(
     487              :         EnergyPlusData &state, std::string const &CoilName, Real64 &CoilCoolCapacity, bool &ErrorsFound, std::string const &CurrentModuleObject);
     488              : 
     489              :     void GetTESCoilCoolingAirFlowRate(
     490              :         EnergyPlusData &state, std::string const &CoilName, Real64 &CoilCoolAirFlow, bool &ErrorsFound, std::string const &CurrentModuleObject);
     491              : 
     492              : } // namespace PackagedThermalStorageCoil
     493              : 
     494              : struct PackagedThermalStorageCoilData : BaseGlobalStruct
     495              : {
     496              : 
     497              :     int NumTESCoils = 0;
     498              :     Array1D_bool CheckEquipName;
     499              :     bool GetTESInputFlag = true;
     500              :     bool MyOneTimeFlag = true;
     501              :     Array1D<PackagedThermalStorageCoil::PackagedTESCoolingCoilStruct> TESCoil;
     502              :     Array1D_bool MyFlag;       // One time environment flag
     503              :     Array1D_bool MySizeFlag;   // One time sizing flag
     504              :     Array1D_bool MyEnvrnFlag;  // flag for init once at start of environment
     505              :     Array1D_bool MyWarmupFlag; // flag for init after warmup complete
     506              : 
     507         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     508              :     {
     509         2126 :     }
     510              : 
     511         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     512              :     {
     513         1152 :     }
     514              : 
     515         2100 :     void clear_state() override
     516              :     {
     517         2100 :         this->NumTESCoils = 0;
     518         2100 :         this->CheckEquipName.deallocate();
     519         2100 :         this->GetTESInputFlag = true;
     520         2100 :         this->MyOneTimeFlag = true;
     521         2100 :         this->TESCoil.deallocate();
     522         2100 :         this->MyFlag.clear();
     523         2100 :         this->MySizeFlag.clear();
     524         2100 :         this->MyEnvrnFlag.clear();
     525         2100 :         this->MyWarmupFlag.clear();
     526         2100 :     }
     527              : };
     528              : 
     529              : } // namespace EnergyPlus
     530              : 
     531              : #endif
        

Generated by: LCOV version 2.0-1