LCOV - code coverage report
Current view: top level - EnergyPlus - PurchasedAirManager.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 45 45
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 6 6

            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 PurchasedAirManager_hh_INCLUDED
      49              : #define PurchasedAirManager_hh_INCLUDED
      50              : 
      51              : // ObjexxFCL Headers
      52              : #include <ObjexxFCL/Array1D.hh>
      53              : 
      54              : // EnergyPlus Headers
      55              : #include <EnergyPlus/Data/BaseData.hh>
      56              : #include <EnergyPlus/DataGlobals.hh>
      57              : #include <EnergyPlus/EnergyPlus.hh>
      58              : 
      59              : namespace EnergyPlus {
      60              : 
      61              : // Forward declarations
      62              : struct EnergyPlusData;
      63              : 
      64              : namespace PurchasedAirManager {
      65              : 
      66              :     // Heating and Cooling Limit type parameters
      67              :     enum class LimitType
      68              :     {
      69              :         Invalid = -1,
      70              :         None,
      71              :         FlowRate,
      72              :         Capacity,
      73              :         FlowRateAndCapacity,
      74              :         Num
      75              :     };
      76              : 
      77              :     // Dehumidification and Humidification control type parameters
      78              :     enum class HumControl
      79              :     {
      80              :         Invalid = -1,
      81              :         None,
      82              :         ConstantSensibleHeatRatio,
      83              :         Humidistat,
      84              :         ConstantSupplyHumidityRatio,
      85              :         Num
      86              :     };
      87              : 
      88              :     // Demand controlled ventilation type parameters
      89              :     enum class DCV
      90              :     {
      91              :         Invalid = -1,
      92              :         None,
      93              :         OccupancySchedule,
      94              :         CO2SetPoint,
      95              :         Num
      96              :     };
      97              : 
      98              :     // Outdoor air economizer type parameters
      99              :     enum class Econ
     100              :     {
     101              :         Invalid = -1,
     102              :         NoEconomizer,
     103              :         DifferentialDryBulb,
     104              :         DifferentialEnthalpy,
     105              :         Num
     106              :     };
     107              : 
     108              :     // Heat recovery type parameters
     109              :     enum class HeatRecovery
     110              :     {
     111              :         Invalid = -1,
     112              :         None,
     113              :         Sensible,
     114              :         Enthalpy,
     115              :         Num
     116              :     };
     117              : 
     118              :     // Operating mode parameters
     119              :     enum class OpMode
     120              :     {
     121              :         Invalid = -1,
     122              :         Off,
     123              :         Heat,
     124              :         Cool,
     125              :         DeadBand,
     126              :         Num
     127              :     };
     128              : 
     129              :     struct ZonePurchasedAir
     130              :     {
     131              :         // Members
     132              :         std::string cObjectName;               // Name of the object from IDD
     133              :         std::string Name;                      // Name or identifier of this piece of equipment
     134              :         Sched::Schedule *availSched = nullptr; // System availability schedule
     135              :         int ZoneSupplyAirNodeNum;              // Node number of zone supply air node for purchased air
     136              :         int ZoneExhaustAirNodeNum;             // Node number of zone exhaust air node for purchased air
     137              :         int PlenumExhaustAirNodeNum;           // Node number of plenum exhaust air node
     138              :         int ReturnPlenumIndex;                 // Index of return plenum
     139              :         int PurchAirArrayIndex;                // Index to sub-array that links ideal loads air system to index of sub-array
     140              :         std::string ReturnPlenumName;
     141              :         int ZoneRecircAirNodeNum; // Node number of recirculation air node for purchased air
     142              :         //   same as exhaust node if specified, otherwise zone return node
     143              :         Real64 MaxHeatSuppAirTemp;   // Maximum supply air temperature for heating [C]
     144              :         Real64 MinCoolSuppAirTemp;   // Minimum supply air temperature for cooling [C]
     145              :         Real64 MaxHeatSuppAirHumRat; // Maximum supply heating air humidity ratio [kg water/kg dry air]
     146              :         Real64 MinCoolSuppAirHumRat; // Minimum supply cooling air humidity ratio [kg water/kg dry air]
     147              :         LimitType HeatingLimit;      // Heating capacity limit type - NoLimit, LimitFlowRate, LimitCapacity,
     148              :         //       or LimitFlowRateAndCapacity
     149              :         Real64 MaxHeatVolFlowRate; // Maximum heating supply air flow[m3/s]
     150              :         Real64 MaxHeatSensCap;     // Maximum heating sensible capacity [W]
     151              :         LimitType CoolingLimit;    // Cooling capacity limit type - NoLimit, LimitFlowRate, LimitCapacity,
     152              :         //       or LimitFlowRateAndCapacity
     153              :         Real64 MaxCoolVolFlowRate;                 // Maximum cooling supply air flow [m3/s]
     154              :         Real64 MaxCoolTotCap;                      // Maximum cooling total capacity [W]
     155              :         Sched::Schedule *heatAvailSched = nullptr; // Heating availability schedule
     156              :         Sched::Schedule *coolAvailSched = nullptr; // Index to the cooling availability schedule
     157              :         HumControl DehumidCtrlType;                // Dehumidification control type - ConstantSensibleHeatRatio,
     158              :         //      Humidistat, or ConstantSupplyHumidityRatio
     159              :         Real64 CoolSHR;           // Cooling sensible heat ratio
     160              :         HumControl HumidCtrlType; // Humidification control type - None,
     161              :         //      Humidistat, or ConstantSupplyHumidityRatio
     162              :         int OARequirementsPtr; // Index to DesignSpecification:OutdoorAir object
     163              :         DCV DCVType;           // Demand controlled ventilation type - None,
     164              :         //      OccupancySchedule, or CO2SetPoint
     165              :         Econ EconomizerType; // Outdoor air economizer type - NoEconomizer,
     166              :         //      DifferentialDryBulb, or DifferentialEnthalpy
     167              :         bool OutdoorAir;                            // Is there outdoor air?
     168              :         int OutdoorAirNodeNum;                      // Node number of the outdoor air inlet node
     169              :         HeatRecovery HtRecType;                     // Outdoor air heat recovery type - None, Sensible, Enthalpy
     170              :         Real64 HtRecSenEff;                         // Sensible heat recovery effectiveness
     171              :         Real64 HtRecLatEff;                         // Latent heat recovery effectiveness
     172              :         Sched::Schedule *oaFlowFracSched = nullptr; // Fraction schedule applied to total OA requirement
     173              :         Real64 MaxHeatMassFlowRate;                 // The maximum heating air mass flow rate [kg/s]
     174              :         Real64 MaxCoolMassFlowRate;                 // The maximum cooling air mass flow rate [kg/s]
     175              :         bool EMSOverrideMdotOn;                     // if true, then EMS is calling to override supply mass flow rate
     176              :         Real64 EMSValueMassFlowRate;                // Value EMS is directing to use for supply mass flow rate [kg/s]
     177              :         bool EMSOverrideOAMdotOn;                   // if true, then EMS is calling to override OA mass flow rate
     178              :         Real64 EMSValueOAMassFlowRate;              // Value EMS is directing to use for OA mass flow rate [kg/s]
     179              :         bool EMSOverrideSupplyTempOn;               // if true, then EMS is calling to override supply temperature
     180              :         Real64 EMSValueSupplyTemp;                  // Value EMS is directing to use for supply temperature [C]
     181              :         bool EMSOverrideSupplyHumRatOn;             // if true, then EMS is calling to override supply humidity ratio
     182              :         Real64 EMSValueSupplyHumRat;                // Value EMS is directing to use for supply humidity ratio [kgWater/kgDryAir]
     183              :         Real64 MinOAMassFlowRate;                   // The minimum required outdoor air mass flow rate [kg/s]
     184              :         Real64 OutdoorAirMassFlowRate;              // The outdoor air mass flow rate [kg/s]
     185              :         Real64 OutdoorAirVolFlowRateStdRho;         //  The outdoor air volume flow rate using standard density  [m3/s]
     186              :         Real64 SupplyAirMassFlowRate;               // Supply air mass flow rate [kg/s]
     187              :         Real64 SupplyAirVolFlowRateStdRho;          // supply air volume flow using standard density [m3/s]
     188              :         // Intermediate results
     189              :         Real64 HtRecSenOutput;        // Sensible heating/cooling rate from heat recovery (<0 means cooling) [W]
     190              :         Real64 HtRecLatOutput;        // Latent heating/cooling rate from heat recovery (<0 means cooling or dehumidfying) [W]
     191              :         Real64 OASenOutput;           // Outdoor air sensible output relative to zone conditions [W], <0 means OA is cooler than zone air
     192              :         Real64 OALatOutput;           // Outdoor air latent output relative to zone conditions [W], <0 means OA is drier than zone air
     193              :         Real64 SenOutputToZone;       // Ideal Loads System sensible output to zone [W], <0 means supply is cooler than zone air
     194              :         Real64 LatOutputToZone;       // Ideal Loads System latent heat output to zone [W], <0 means supply is drier than zone air
     195              :         Real64 SenCoilLoad;           // Ideal Loads System sensible load on "coils" (<0 means cooling) [W]
     196              :         Real64 LatCoilLoad;           // Ideal Loads System latent load on "coils" (<0 means cooling or dehumidfying) [W]
     197              :         int OAFlowMaxCoolOutputError; // Counter for OAFlow > Max Cooling Flow error
     198              :         int OAFlowMaxHeatOutputError; // Counter for OAFlow > Max Heating Flow error
     199              :         int SaturationOutputError;    // Counter for OAFlow > Max Heating Flow error
     200              :         int OAFlowMaxCoolOutputIndex; // Recurring warning index for OAFlow > Max Cooling Flow error
     201              :         int OAFlowMaxHeatOutputIndex; // Recurring warning index for OAFlow > Max Heating Flow error
     202              :         int SaturationOutputIndex;    // Recurring warning index for OAFlow > Max Heating Flow error
     203              :         Avail::Status availStatus = Avail::Status::NoAction;
     204              :         int CoolErrIndex; // Cooling setpoint error index (recurring errors)
     205              :         int HeatErrIndex; // Heating setpoint error index (recurring errors)
     206              :         // Output variables
     207              :         Real64 SenHeatEnergy;      // Sensible heating energy consumed [J]
     208              :         Real64 LatHeatEnergy;      // Latent   heating energy consumed [J]
     209              :         Real64 TotHeatEnergy;      // Total    heating energy consumed [J]
     210              :         Real64 SenCoolEnergy;      // Sensible cooling energy consumed [J]
     211              :         Real64 LatCoolEnergy;      // Latent   cooling energy consumed [J]
     212              :         Real64 TotCoolEnergy;      // Total    cooling energy consumed [J]
     213              :         Real64 ZoneSenHeatEnergy;  // Sensible heating energy supplied to the zone [J]
     214              :         Real64 ZoneLatHeatEnergy;  // Latent   heating energy supplied to the zone [J]
     215              :         Real64 ZoneTotHeatEnergy;  // Total    heating energy supplied to the zone [J]
     216              :         Real64 ZoneSenCoolEnergy;  // Sensible cooling energy supplied to the zone [J]
     217              :         Real64 ZoneLatCoolEnergy;  // Latent   cooling energy supplied to the zone [J]
     218              :         Real64 ZoneTotCoolEnergy;  // Total    cooling energy supplied to the zone [J]
     219              :         Real64 OASenHeatEnergy;    // Sensible heating energy required for OA to equal zone air [J]
     220              :         Real64 OALatHeatEnergy;    // Latent   heating energy required for OA to equal zone air [J]
     221              :         Real64 OATotHeatEnergy;    // Total    heating energy required for OA to equal zone air [J]
     222              :         Real64 OASenCoolEnergy;    // Sensible cooling energy required for OA to equal zone air [J]
     223              :         Real64 OALatCoolEnergy;    // Latent   cooling energy required for OA to equal zone air [J]
     224              :         Real64 OATotCoolEnergy;    // Total    cooling energy required for OA to equal zone air [J]
     225              :         Real64 HtRecSenHeatEnergy; // Sensible heating energy from heat reocovery [J]
     226              :         Real64 HtRecLatHeatEnergy; // Latent   heating energy from heat reocovery [J]
     227              :         Real64 HtRecTotHeatEnergy; // Total    heating energy from heat reocovery [J]
     228              :         Real64 HtRecSenCoolEnergy; // Sensible cooling energy from heat reocovery [J]
     229              :         Real64 HtRecLatCoolEnergy; // Latent   cooling energy from heat reocovery [J]
     230              :         Real64 HtRecTotCoolEnergy; // Total    cooling energy from heat reocovery [J]
     231              :         Real64 SenHeatRate;        // Sensible heating rate consumed [W]
     232              :         Real64 LatHeatRate;        // Latent   heating rate consumed [W]
     233              :         Real64 TotHeatRate;        // Total    heating rate consumed [W]
     234              :         Real64 SenCoolRate;        // Sensible cooling rate consumed [W]
     235              :         Real64 LatCoolRate;        // Latent   cooling rate consumed [W]
     236              :         Real64 TotCoolRate;        // Total    cooling rate consumed [W]
     237              :         Real64 ZoneSenHeatRate;    // Sensible heating rate supplied to the zone [W]
     238              :         Real64 ZoneLatHeatRate;    // Latent   heating rate supplied to the zone [W]
     239              :         Real64 ZoneTotHeatRate;    // Total    heating rate supplied to the zone [W]
     240              :         Real64 ZoneSenCoolRate;    // Sensible cooling rate supplied to the zone [W]
     241              :         Real64 ZoneLatCoolRate;    // Latent   cooling rate supplied to the zone [W]
     242              :         Real64 ZoneTotCoolRate;    // Total    cooling rate supplied to the zone [W]
     243              :         Real64 OASenHeatRate;      // Sensible heating rate required for OA to equal zone air [W]
     244              :         Real64 OALatHeatRate;      // Latent   heating rate required for OA to equal zone air [W]
     245              :         Real64 OATotHeatRate;      // Total    heating rate required for OA to equal zone air [W]
     246              :         Real64 OASenCoolRate;      // Sensible cooling rate required for OA to equal zone air [W]
     247              :         Real64 OALatCoolRate;      // Latent   cooling rate required for OA to equal zone air [W]
     248              :         Real64 OATotCoolRate;      // Total    cooling rate required for OA to equal zone air [W]
     249              :         Real64 HtRecSenHeatRate;   // Sensible heating rate from heat reocovery [W]
     250              :         Real64 HtRecLatHeatRate;   // Latent   heating rate from heat reocovery [W]
     251              :         Real64 HtRecTotHeatRate;   // Total    heating rate from heat reocovery [W]
     252              :         Real64 HtRecSenCoolRate;   // Sensible cooling rate from heat reocovery [W]
     253              :         Real64 HtRecLatCoolRate;   // Latent   cooling rate from heat reocovery [W]
     254              :         Real64 HtRecTotCoolRate;   // Total    cooling rate from heat reocovery [W]
     255              :         Real64 TimeEconoActive;    // Time economizer is active [hrs]
     256              :         Real64 TimeHtRecActive;    // Time heat reocovery is active [hrs]
     257              :         int ZonePtr;               // pointer to a zone served by an Ideal load air system
     258              :         int HVACSizingIndex;       // index of a HVAC Sizing object for an Ideal load air system
     259              :         Real64 SupplyTemp;         // Supply inlet to zone dry bulb temperature [C]
     260              :         Real64 SupplyHumRat;       // Supply inlet to zone humidity ratio [kgWater/kgDryAir]
     261              :         Real64 MixedAirTemp;       // Mixed air dry bulb temperature [C]
     262              :         Real64 MixedAirHumRat;     // Mixed air humidity ratio [kgWater/kgDryAir]
     263              : 
     264              :         // Default Constructor
     265           36 :         ZonePurchasedAir()
     266           72 :             : ZoneSupplyAirNodeNum(0), ZoneExhaustAirNodeNum(0), PlenumExhaustAirNodeNum(0), ReturnPlenumIndex(0), PurchAirArrayIndex(0),
     267           36 :               ZoneRecircAirNodeNum(0), MaxHeatSuppAirTemp(0.0), MinCoolSuppAirTemp(0.0), MaxHeatSuppAirHumRat(0.0), MinCoolSuppAirHumRat(0.0),
     268           36 :               HeatingLimit(LimitType::Invalid), MaxHeatVolFlowRate(0.0), MaxHeatSensCap(0.0), CoolingLimit(LimitType::Invalid),
     269           36 :               MaxCoolVolFlowRate(0.0), MaxCoolTotCap(0.0), DehumidCtrlType(HumControl::Invalid), CoolSHR(0.0), HumidCtrlType(HumControl::Invalid),
     270           36 :               OARequirementsPtr(0), DCVType(DCV::Invalid), EconomizerType(Econ::Invalid), OutdoorAir(false), OutdoorAirNodeNum(0),
     271           36 :               HtRecType(HeatRecovery::Invalid), HtRecSenEff(0.0), HtRecLatEff(0.0), MaxHeatMassFlowRate(0.0), MaxCoolMassFlowRate(0.0),
     272           36 :               EMSOverrideMdotOn(false), EMSValueMassFlowRate(0.0), EMSOverrideOAMdotOn(false), EMSValueOAMassFlowRate(0.0),
     273           36 :               EMSOverrideSupplyTempOn(false), EMSValueSupplyTemp(0.0), EMSOverrideSupplyHumRatOn(false), EMSValueSupplyHumRat(0.0),
     274           36 :               MinOAMassFlowRate(0.0), OutdoorAirMassFlowRate(0.0), OutdoorAirVolFlowRateStdRho(0.0), SupplyAirMassFlowRate(0.0),
     275           36 :               SupplyAirVolFlowRateStdRho(0.0), HtRecSenOutput(0.0), HtRecLatOutput(0.0), OASenOutput(0.0), OALatOutput(0.0), SenOutputToZone(0.0),
     276           36 :               LatOutputToZone(0.0), SenCoilLoad(0.0), LatCoilLoad(0.0), OAFlowMaxCoolOutputError(0), OAFlowMaxHeatOutputError(0),
     277           36 :               SaturationOutputError(0), OAFlowMaxCoolOutputIndex(0), OAFlowMaxHeatOutputIndex(0), SaturationOutputIndex(0), CoolErrIndex(0),
     278           36 :               HeatErrIndex(0), SenHeatEnergy(0.0), LatHeatEnergy(0.0), TotHeatEnergy(0.0), SenCoolEnergy(0.0), LatCoolEnergy(0.0), TotCoolEnergy(0.0),
     279           36 :               ZoneSenHeatEnergy(0.0), ZoneLatHeatEnergy(0.0), ZoneTotHeatEnergy(0.0), ZoneSenCoolEnergy(0.0), ZoneLatCoolEnergy(0.0),
     280           36 :               ZoneTotCoolEnergy(0.0), OASenHeatEnergy(0.0), OALatHeatEnergy(0.0), OATotHeatEnergy(0.0), OASenCoolEnergy(0.0), OALatCoolEnergy(0.0),
     281           36 :               OATotCoolEnergy(0.0), HtRecSenHeatEnergy(0.0), HtRecLatHeatEnergy(0.0), HtRecTotHeatEnergy(0.0), HtRecSenCoolEnergy(0.0),
     282           36 :               HtRecLatCoolEnergy(0.0), HtRecTotCoolEnergy(0.0), SenHeatRate(0.0), LatHeatRate(0.0), TotHeatRate(0.0), SenCoolRate(0.0),
     283           36 :               LatCoolRate(0.0), TotCoolRate(0.0), ZoneSenHeatRate(0.0), ZoneLatHeatRate(0.0), ZoneTotHeatRate(0.0), ZoneSenCoolRate(0.0),
     284           36 :               ZoneLatCoolRate(0.0), ZoneTotCoolRate(0.0), OASenHeatRate(0.0), OALatHeatRate(0.0), OATotHeatRate(0.0), OASenCoolRate(0.0),
     285           36 :               OALatCoolRate(0.0), OATotCoolRate(0.0), HtRecSenHeatRate(0.0), HtRecLatHeatRate(0.0), HtRecTotHeatRate(0.0), HtRecSenCoolRate(0.0),
     286           36 :               HtRecLatCoolRate(0.0), HtRecTotCoolRate(0.0), TimeEconoActive(0.0), TimeHtRecActive(0.0), ZonePtr(0), HVACSizingIndex(0),
     287           36 :               SupplyTemp(0.0), SupplyHumRat(0.0), MixedAirTemp(0.0), MixedAirHumRat(0.0)
     288              :         {
     289           36 :         }
     290              :     };
     291              : 
     292              :     struct PurchAirNumericFieldData
     293              :     {
     294              :         // Members
     295              :         Array1D_string FieldNames;
     296              : 
     297              :         // Default Constructor
     298           34 :         PurchAirNumericFieldData() = default;
     299              :     };
     300              : 
     301              :     struct PurchAirPlenumArrayData
     302              :     {
     303              :         // Members
     304              :         int NumPurchAir;
     305              :         int ReturnPlenumIndex;
     306              :         Array1D_int PurchAirArray;
     307              :         Array1D_bool IsSimulated;
     308              : 
     309              :         // Default Constructor
     310            1 :         PurchAirPlenumArrayData() : NumPurchAir(0), ReturnPlenumIndex(0)
     311              :         {
     312            1 :         }
     313              :     };
     314              : 
     315              :     // Object Data
     316              : 
     317              :     void SimPurchasedAir(EnergyPlusData &state,
     318              :                          std::string const &PurchAirName,
     319              :                          Real64 &SysOutputProvided,
     320              :                          Real64 &MoistOutputProvided, // Moisture output provided (kg/s), dehumidification = negative
     321              :                          bool FirstHVACIteration,
     322              :                          int ControlledZoneNum,
     323              :                          int &CompIndex);
     324              : 
     325              :     void GetPurchasedAir(EnergyPlusData &state);
     326              : 
     327              :     void InitPurchasedAir(EnergyPlusData &state, int const PurchAirNum, int const ControlledZoneNum);
     328              : 
     329              :     void SizePurchasedAir(EnergyPlusData &state, int PurchAirNum);
     330              : 
     331              :     void CalcPurchAirLoads(EnergyPlusData &state,
     332              :                            int PurchAirNum,
     333              :                            Real64 &SysOutputProvided,   // Sensible output provided [W] cooling = negative
     334              :                            Real64 &MoistOutputProvided, // Moisture output provided [kg/s] dehumidification = negative
     335              :                            int ControlledZoneNum);
     336              : 
     337              :     void CalcPurchAirMinOAMassFlow(EnergyPlusData &state,
     338              :                                    int PurchAirNum,       // index to ideal loads unit
     339              :                                    int ZoneNum,           // index to zone
     340              :                                    Real64 &OAMassFlowRate // outside air mass flow rate [kg/s] from volume flow using std density
     341              :     );
     342              : 
     343              :     void CalcPurchAirMixedAir(EnergyPlusData &state,
     344              :                               int PurchAirNum,           // index to ideal loads unit
     345              :                               Real64 OAMassFlowRate,     // outside air mass flow rate [kg/s]
     346              :                               Real64 SupplyMassFlowRate, // supply air mass flow rate [kg/s]
     347              :                               Real64 &MixedAirTemp,      // Mixed air dry bulb temperature [C]
     348              :                               Real64 &MixedAirHumRat,    // Mixed air humidity ratio [kgWater/kgDryAir]
     349              :                               Real64 &MixedAirEnthalpy,  // Mixed air enthalpy [J/kg]
     350              :                               OpMode OperatingMode       // current operating mode, Off, Heating, Cooling, or DeadBand
     351              :     );
     352              : 
     353              :     void UpdatePurchasedAir(EnergyPlusData &state, int PurchAirNum, bool FirstHVACIteration);
     354              : 
     355              :     void ReportPurchasedAir(EnergyPlusData &state, int PurchAirNum);
     356              : 
     357              :     Real64 GetPurchasedAirOutAirMassFlow(EnergyPlusData &state, int PurchAirNum);
     358              : 
     359              :     int GetPurchasedAirZoneInletAirNode(EnergyPlusData &state, int PurchAirNum);
     360              : 
     361              :     int GetPurchasedAirReturnAirNode(EnergyPlusData &state, int PurchAirNum);
     362              : 
     363              :     int getPurchasedAirIndex(EnergyPlusData &state, std::string_view PurchAirName);
     364              : 
     365              :     Real64 GetPurchasedAirMixedAirTemp(EnergyPlusData &state, int PurchAirNum);
     366              : 
     367              :     Real64 GetPurchasedAirMixedAirHumRat(EnergyPlusData &state, int PurchAirNum);
     368              : 
     369              :     bool CheckPurchasedAirForReturnPlenum(EnergyPlusData &state, int ReturnPlenumIndex);
     370              : 
     371              :     void InitializePlenumArrays(EnergyPlusData &state, int PurchAirNum);
     372              : 
     373              : } // namespace PurchasedAirManager
     374              : 
     375              : struct PurchasedAirManagerData : BaseGlobalStruct
     376              : {
     377              :     int NumPurchAir = 0;
     378              :     int NumPlenumArrays = 0; // total number of plenum arrays
     379              :     bool GetPurchAirInputFlag = true;
     380              :     Array1D_bool CheckEquipName;
     381              :     Array1D<PurchasedAirManager::ZonePurchasedAir> PurchAir;                      // Used to specify purchased air parameters
     382              :     Array1D<PurchasedAirManager::PurchAirNumericFieldData> PurchAirNumericFields; // Used to save the indices of scalable sizing object for zone HVAC
     383              :     Array1D<PurchasedAirManager::PurchAirPlenumArrayData> PurchAirPlenumArrays;   // Used to save the indices of scalable sizing object for zone HVAC
     384              :     bool InitPurchasedAirMyOneTimeFlag = true;
     385              :     bool InitPurchasedAirZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     386              :     Array1D_bool InitPurchasedAirMyEnvrnFlag;
     387              :     Array1D_bool InitPurchasedAirMySizeFlag;
     388              :     Array1D_bool InitPurchasedAirOneTimeUnitInitsDone; // True if one-time inits for PurchAirNum are completed
     389              :     Array1D<PurchasedAirManager::PurchAirPlenumArrayData>
     390              :         TempPurchAirPlenumArrays; // Used to save the indices of scalable sizing object for zone HVAC
     391              : 
     392         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     393              :     {
     394         2126 :     }
     395              : 
     396         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     397              :     {
     398         1152 :     }
     399              : 
     400         2100 :     void clear_state() override
     401              :     {
     402         2100 :         NumPurchAir = 0;
     403         2100 :         NumPlenumArrays = 0;
     404         2100 :         GetPurchAirInputFlag = true;
     405         2100 :         CheckEquipName.deallocate();
     406         2100 :         PurchAir.deallocate();
     407         2100 :         PurchAirNumericFields.deallocate();
     408         2100 :         InitPurchasedAirMyOneTimeFlag = true;
     409         2100 :         InitPurchasedAirZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     410         2100 :         InitPurchasedAirMyEnvrnFlag.deallocate();
     411         2100 :         InitPurchasedAirMySizeFlag.deallocate();
     412         2100 :         InitPurchasedAirOneTimeUnitInitsDone.deallocate(); // True if one-time inits for PurchAirNum are completed
     413         2100 :         TempPurchAirPlenumArrays.deallocate();
     414         2100 :     }
     415              : };
     416              : 
     417              : } // namespace EnergyPlus
     418              : 
     419              : #endif
        

Generated by: LCOV version 2.0-1