LCOV - code coverage report
Current view: top level - EnergyPlus - SingleDuct.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 14 86 16.3 %
Date: 2023-01-17 19:17:23 Functions: 9 12 75.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef SingleDuct_hh_INCLUDED
      49             : #define SingleDuct_hh_INCLUDED
      50             : 
      51             : #include <unordered_map>
      52             : 
      53             : // ObjexxFCL Headers
      54             : #include <ObjexxFCL/Array1D.hh>
      55             : #include <ObjexxFCL/Optional.hh>
      56             : 
      57             : // EnergyPlus Headers
      58             : #include <EnergyPlus/Data/BaseData.hh>
      59             : #include <EnergyPlus/DataGlobals.hh>
      60             : #include <EnergyPlus/DataZoneEquipment.hh>
      61             : #include <EnergyPlus/EnergyPlus.hh>
      62             : #include <EnergyPlus/Plant/Enums.hh>
      63             : #include <EnergyPlus/Plant/PlantLocation.hh>
      64             : 
      65             : namespace EnergyPlus {
      66             : 
      67             : // Forward declarations
      68             : struct EnergyPlusData;
      69             : 
      70             : namespace SingleDuct {
      71             : 
      72             :     enum class Action
      73             :     {
      74             :         Invalid = -1,
      75             :         Normal,
      76             :         Reverse,
      77             :         ReverseWithLimits,
      78             :         HeatingNotUsed,
      79             :         Num
      80             :     };
      81             :     enum class SysType
      82             :     {
      83             :         Invalid = -1,
      84             :         SingleDuctVAVReheat,
      85             :         SingleDuctConstVolReheat,
      86             :         SingleDuctConstVolNoReheat,
      87             :         SingleDuctVAVNoReheat,
      88             :         SingleDuctVAVReheatVSFan,
      89             :         SingleDuctCBVAVReheat,
      90             :         SingleDuctCBVAVNoReheat,
      91             :         Num,
      92             :     };
      93             :     enum class HeatingCoilType : int
      94             :     {
      95             :         Invalid = -1,
      96             :         None,
      97             :         Gas,
      98             :         Electric,
      99             :         SimpleHeating,
     100             :         SteamAirHeating,
     101             :         Num,
     102             :     };
     103             :     enum class MinFlowFraction
     104             :     {
     105             :         Invalid = -1,
     106             :         Constant,
     107             :         Scheduled,
     108             :         Fixed,
     109             :         MinFracNotUsed,
     110             :         Num
     111             :     };
     112             : 
     113             :     struct SingleDuctAirTerminalFlowConditions
     114             :     {
     115             :         // Members
     116             :         Real64 AirMassFlowRate;         // MassFlow through the Sys being Simulated [kg/Sec]
     117             :         Real64 AirMassFlowRateMaxAvail; // MassFlow through the Sys being Simulated [kg/Sec]
     118             :         Real64 AirMassFlowRateMinAvail; // MassFlow through the Sys being Simulated [kg/Sec]
     119             :         Real64 AirTemp;                 // (C)
     120             :         Real64 AirHumRat;               // (Kg/Kg)
     121             :         Real64 AirEnthalpy;             // (J/Kg)
     122             : 
     123             :         // Default Constructor
     124        1008 :         SingleDuctAirTerminalFlowConditions()
     125        1008 :             : AirMassFlowRate(0.0), AirMassFlowRateMaxAvail(0.0), AirMassFlowRateMinAvail(0.0), AirTemp(0.0), AirHumRat(0.0), AirEnthalpy(0.0)
     126             :         {
     127        1008 :         }
     128             :     };
     129             : 
     130        7122 :     struct SingleDuctAirTerminal
     131             :     {
     132             :         // Members
     133             :         int SysNum;                                         // index to single duct air terminal unit
     134             :         std::string SysName;                                // Name of the Sys
     135             :         std::string sysType;                                // Type of Sys ie. VAV, Mixing, Inducing, etc.
     136             :         SysType SysType_Num;                                // Numeric Equivalent for System type
     137             :         std::string Schedule;                               // Sys Operation Schedule
     138             :         int SchedPtr;                                       // Pointer to the correct schedule
     139             :         std::string ReheatComp;                             // Type of the Reheat Coil Object
     140             :         HeatingCoilType ReheatComp_Num;                     // Numeric Equivalent in this module for Coil type
     141             :         int ReheatComp_Index;                               // Returned Index number from other routines
     142             :         std::string ReheatName;                             // name of reheat coil
     143             :         DataPlant::PlantEquipmentType ReheatComp_PlantType; // typeOf_ number for plant type of heating coil
     144             :         std::string FanType;                                // Type of the Fan Object
     145             :         int Fan_Num;                                        // Numeric Equivalent in this module for fan type
     146             :         int Fan_Index;                                      // Returned Index number from other routines
     147             :         int ControlCompTypeNum;
     148             :         int CompErrIndex;
     149             :         std::string FanName;                  // name of fan
     150             :         Real64 MaxAirVolFlowRate;             // Max Specified Volume Flow Rate of Sys (cooling max) [m3/sec]
     151             :         Real64 AirMassFlowRateMax;            // Max Specified Mass Flow Rate of Sys (cooling max) [kg/sec]
     152             :         Real64 MaxHeatAirVolFlowRate;         // Max specified volume flow rate of unit at max heating [m3/s]
     153             :         Real64 HeatAirMassFlowRateMax;        // Max Specified Mass Flow Rate of unit at max heating [kg/sec]
     154             :         MinFlowFraction ZoneMinAirFracMethod; // parameter for what method is used for min flow fraction
     155             :         Real64 ZoneMinAirFracDes;             // Fraction of supply air used as design minimum flow
     156             :         Real64 ZoneMinAirFrac;                // Fraction of supply air used as current minimum flow
     157             :         Real64 ZoneMinAirFracReport;          // Fraction of supply air used as minimum flow for reporting (zero if terminal unit flow is zero)
     158             :         Real64 ZoneFixedMinAir;               // Absolute minimum supply air flow
     159             :         int ZoneMinAirFracSchPtr;             // pointer to the schedule for min flow fraction
     160             :         bool ConstantMinAirFracSetByUser;     // record if user left field blank for constant min fraction.
     161             :         bool FixedMinAirSetByUser;            // record if user left field blank for constant min fraction.
     162             :         Real64 DesignMinAirFrac;              // store user entered constant min flow fract for design
     163             :         Real64 DesignFixedMinAir;             // store user entered constant min flow for design
     164             :         int InletNodeNum;                     // terminal unit inlet node number; damper inlet node number
     165             :         int OutletNodeNum;                    // damper outlet node number for VAV; unused by CV; coil air inlet node for VAV
     166             :         // fan outlet node, coil inlet node for VAV VS Fan
     167             :         int ReheatControlNode;        // hot water inlet node for heating coil
     168             :         int ReheatCoilOutletNode;     // outlet node for heating coil
     169             :         Real64 ReheatCoilMaxCapacity; // heating coil capacity, W
     170             :         int ReheatAirOutletNode;      // terminal unit outlet node; heating coil air outlet node
     171             :         Real64 MaxReheatWaterVolFlow; // m3/s
     172             :         Real64 MaxReheatSteamVolFlow; // m3/s
     173             :         Real64 MaxReheatWaterFlow;    // kg/s
     174             :         Real64 MaxReheatSteamFlow;    // kg/s
     175             :         Real64 MinReheatWaterVolFlow; // m3/s
     176             :         Real64 MinReheatSteamVolFlow; // m3/s
     177             :         Real64 MinReheatWaterFlow;    // kg/s
     178             :         Real64 MinReheatSteamFlow;    // kg/s
     179             :         Real64 ControllerOffset;
     180             :         Real64 MaxReheatTemp; // C
     181             :         bool MaxReheatTempSetByUser;
     182             :         Action DamperHeatingAction;
     183             :         Real64 DamperPosition;
     184             :         int ADUNum;                           // index of corresponding air distribution unit
     185             :         int FluidIndex;                       // Refrigerant index
     186             :         int ErrCount1;                        // iteration limit exceeded in Hot Water Flow Calc
     187             :         int ErrCount1c;                       // iteration limit exceeded in Hot Water Flow Calc - continue
     188             :         int ErrCount2;                        // bad iterations limits in hot water flow calc
     189             :         Real64 ZoneFloorArea;                 // Zone floor area
     190             :         int CtrlZoneNum;                      // Pointer to CtrlZone data structure
     191             :         int CtrlZoneInNodeIndex;              // which controlled zone inlet node number corresponds with this unit
     192             :         Real64 MaxAirVolFlowRateDuringReheat; // Maximum vol flow during reheat
     193             :         Real64 MaxAirVolFractionDuringReheat; // Maximum vol flow fraction during reheat
     194             :         Real64 AirMassFlowDuringReheatMax;    // Maximum mass flow during reheat
     195             :         int ZoneOutdoorAirMethod;             // Outdoor air method
     196             :         Real64 OutdoorAirFlowRate;            // report variable for TU outdoor air flow rate
     197             :         bool NoOAFlowInputFromUser;           // avoids OA calculation if no input specified by user
     198             :         int OARequirementsPtr;                // - Index to DesignSpecification:OutdoorAir object
     199             :         int AirLoopNum;
     200             :         PlantLocation HWplantLoc;     // plant topology, Component location
     201             :         std::string ZoneHVACUnitType; // type of Zone HVAC unit for air terminal mixer units
     202             :         std::string ZoneHVACUnitName; // name of Zone HVAC unit for air terminal mixer units
     203             :         int SecInNode;                // zone or zone unit air node number
     204             :         // warning variables
     205             :         int IterationLimit;                                       // Used for RegulaFalsi error -1
     206             :         int IterationFailed;                                      // Used for RegulaFalsi error -2
     207             :         DataZoneEquipment::PerPersonVentRateMode OAPerPersonMode; // mode for how per person rates are determined, DCV or design.
     208             :         bool EMSOverrideAirFlow;                                  // if true, EMS is calling to override flow rate
     209             :         Real64 EMSMassFlowRateValue;                              // value EMS is directing to use for flow rate [kg/s]
     210             :         int ZoneTurndownMinAirFracSchPtr;                         // pointer to the schedule for turndown minimum airflow fraction
     211             :         Real64 ZoneTurndownMinAirFrac;       // turndown minimum airflow fraction value, multiplier of zone design minimum air flow
     212             :         bool ZoneTurndownMinAirFracSchExist; // if true, if zone turndown min air frac schedule exist
     213             :         bool MyEnvrnFlag;
     214             :         bool MySizeFlag;
     215             :         bool GetGasElecHeatCoilCap; // Gets autosized value of coil capacity
     216             :         bool PlantLoopScanFlag;     // plant loop scan flag, false if scanned
     217             :         Real64 MassFlow1;           // previous value of the terminal unit mass flow rate
     218             :         Real64 MassFlow2;           // previous value of the previous value of the mass flow rate
     219             :         Real64 MassFlow3;
     220             :         Real64 MassFlowDiff;
     221             :         SingleDuctAirTerminalFlowConditions sd_airterminalInlet;
     222             :         SingleDuctAirTerminalFlowConditions sd_airterminalOutlet;
     223             : 
     224             :         // Default Constructor
     225         504 :         SingleDuctAirTerminal()
     226         504 :             : SysNum(-1), SysType_Num(SysType::Invalid), SchedPtr(0), ReheatComp_Num(HeatingCoilType::None), ReheatComp_Index(0),
     227             :               ReheatComp_PlantType(DataPlant::PlantEquipmentType::Invalid), Fan_Num(0), Fan_Index(0), ControlCompTypeNum(0), CompErrIndex(0),
     228             :               MaxAirVolFlowRate(0.0), AirMassFlowRateMax(0.0), MaxHeatAirVolFlowRate(0.0), HeatAirMassFlowRateMax(0.0),
     229             :               ZoneMinAirFracMethod(MinFlowFraction::Constant), ZoneMinAirFracDes(0.0), ZoneMinAirFrac(0.0), ZoneMinAirFracReport(0.0),
     230             :               ZoneFixedMinAir(0.0), ZoneMinAirFracSchPtr(0), ConstantMinAirFracSetByUser(false), FixedMinAirSetByUser(false), DesignMinAirFrac(0.0),
     231             :               DesignFixedMinAir(0.0), InletNodeNum(0), OutletNodeNum(0), ReheatControlNode(0), ReheatCoilOutletNode(0), ReheatCoilMaxCapacity(0.0),
     232             :               ReheatAirOutletNode(0), MaxReheatWaterVolFlow(0.0), MaxReheatSteamVolFlow(0.0), MaxReheatWaterFlow(0.0), MaxReheatSteamFlow(0.0),
     233             :               MinReheatWaterVolFlow(0.0), MinReheatSteamVolFlow(0.0), MinReheatWaterFlow(0.0), MinReheatSteamFlow(0.0), ControllerOffset(0.0),
     234             :               MaxReheatTemp(0.0), MaxReheatTempSetByUser(false), DamperHeatingAction(Action::HeatingNotUsed), DamperPosition(0.0), ADUNum(0),
     235             :               FluidIndex(0), ErrCount1(0), ErrCount1c(0), ErrCount2(0), ZoneFloorArea(0.0), CtrlZoneNum(0), CtrlZoneInNodeIndex(0),
     236             :               MaxAirVolFlowRateDuringReheat(0.0), MaxAirVolFractionDuringReheat(0.0), AirMassFlowDuringReheatMax(0.0), ZoneOutdoorAirMethod(0),
     237             :               OutdoorAirFlowRate(0.0), NoOAFlowInputFromUser(true), OARequirementsPtr(0), AirLoopNum(0), HWplantLoc{}, SecInNode(0),
     238             :               IterationLimit(0), IterationFailed(0), OAPerPersonMode(DataZoneEquipment::PerPersonVentRateMode::Invalid), EMSOverrideAirFlow(false),
     239             :               EMSMassFlowRateValue(0.0), ZoneTurndownMinAirFracSchPtr(0), ZoneTurndownMinAirFrac(1.0), ZoneTurndownMinAirFracSchExist(false),
     240             :               MyEnvrnFlag(true), MySizeFlag(true), GetGasElecHeatCoilCap(true), PlantLoopScanFlag(true), MassFlow1(0.0), MassFlow2(0.0),
     241         504 :               MassFlow3(0.0), MassFlowDiff(0.0)
     242             :         {
     243         504 :         }
     244             : 
     245             :         void InitSys(EnergyPlusData &state, bool FirstHVACIteration);
     246             : 
     247             :         void SizeSys(EnergyPlusData &state);
     248             : 
     249             :         void SimVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);
     250             : 
     251             :         void CalcOAMassFlow(EnergyPlusData &state, Real64 &SAMassFlow, Real64 &AirLoopOAFrac) const;
     252             : 
     253             :         void SimCBVAV(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);
     254             : 
     255             :         void SimVAVVS(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);
     256             : 
     257             :         void SimConstVol(EnergyPlusData &state, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum);
     258             : 
     259             :         void CalcVAVVS(EnergyPlusData &state,
     260             :                        bool FirstHVACIteration,
     261             :                        int ZoneNode,
     262             :                        Real64 HWFlow,
     263             :                        Real64 HCoilReq,
     264             :                        int FanType,
     265             :                        Real64 AirFlow,
     266             :                        int FanOn,
     267             :                        Real64 &LoadMet);
     268             : 
     269             :         void SimConstVolNoReheat(EnergyPlusData &state);
     270             : 
     271             :         void CalcOutdoorAirVolumeFlowRate(EnergyPlusData &state);
     272             : 
     273             :         void UpdateSys(EnergyPlusData &state) const;
     274             : 
     275             :         void ReportSys(EnergyPlusData &state);
     276             :     };
     277             : 
     278         290 :     struct AirTerminalMixerData
     279             :     {
     280             :         // Members
     281             :         // Input data
     282             :         std::string Name;             // name of unit
     283             :         int MixerType;                // type of inlet mixer, 1 = inlet side, 2 = supply side
     284             :         int ZoneHVACUnitType;         // type of Zone HVAC unit. ZoneHVAC:WaterToAirHeatPump =1, ZoneHVAC:FourPipeFanCoil = 2
     285             :         std::string ZoneHVACUnitName; // name of Zone HVAC unit
     286             :         int SecInNode;                // secondary air inlet node number
     287             :         int PriInNode;                // primary air inlet node number
     288             :         int MixedAirOutNode;          // mixed air outlet node number
     289             :         int ZoneInletNode;            // zone inlet node that ultimately receives air from this mixer
     290             :         Real64 ZoneAirTemp;           // zone air in temp
     291             :         Real64 ZoneAirHumRat;         // zone air in hum rat
     292             :         Real64 ZoneAirEnthalpy;       // zone air in enthalpy
     293             :         Real64 ZoneAirPressure;       // zone air in pressure
     294             :         Real64 ZoneAirMassFlowRate;   // zone air in mass flow rate
     295             :         Real64 DOASTemp;              // DOAS air in temp
     296             :         Real64 DOASHumRat;            // DOAS air in hum rat
     297             :         Real64 DOASEnthalpy;          // DOAS air in enthalpy
     298             :         Real64 DOASPressure;          // DOAS air in pressure
     299             :         Real64 DOASMassFlowRate;      // DOAS air in mass flow rate
     300             :         Real64 MixedAirTemp;          // mixed air in temp
     301             :         Real64 MixedAirHumRat;        // mixed air in hum rat
     302             :         Real64 MixedAirEnthalpy;      // mixed air in enthalpy
     303             :         Real64 MixedAirPressure;      // mixed air in pressure
     304             :         Real64 MixedAirMassFlowRate;  // mixed air in mass flow rate
     305             :         Real64 MassFlowRateMaxAvail;  // maximum air mass flow rate allowed through component
     306             :         int ADUNum;                   // index of Air Distribution Unit
     307             :         int TermUnitSizingIndex;      // Pointer to TermUnitSizing and TermUnitFinalZoneSizing data for this terminal unit
     308             :         bool OneTimeInitFlag;         // true if one-time inits should be done
     309             :         bool OneTimeInitFlag2;        // true if more one-time inits should be done
     310             :         int CtrlZoneInNodeIndex;      // which controlled zone inlet node number corresponds with this unit
     311             :         int ZoneNum;
     312             :         bool NoOAFlowInputFromUser;                               // avoids OA calculation if no input specified by user
     313             :         int OARequirementsPtr;                                    // - Index to DesignSpecification:OutdoorAir object
     314             :         int AirLoopNum;                                           // System sizing adjustments
     315             :         Real64 DesignPrimaryAirVolRate;                           // System sizing adjustments, filled from design OA spec using sizing mode flags.
     316             :         DataZoneEquipment::PerPersonVentRateMode OAPerPersonMode; // mode for how per person rates are determined, DCV or design.
     317             :         bool printWarning;                                        // flag to print warnings only once
     318             :         // Default Constructor
     319         192 :         AirTerminalMixerData()
     320         192 :             : MixerType(0), ZoneHVACUnitType(0), SecInNode(0), PriInNode(0), MixedAirOutNode(0), ZoneInletNode(0), ZoneAirTemp(0.0),
     321             :               ZoneAirHumRat(0.0), ZoneAirEnthalpy(0.0), ZoneAirPressure(0.0), ZoneAirMassFlowRate(0.0), DOASTemp(0.0), DOASHumRat(0.0),
     322             :               DOASEnthalpy(0.0), DOASPressure(0.0), DOASMassFlowRate(0.0), MixedAirTemp(0.0), MixedAirHumRat(0.0), MixedAirEnthalpy(0.0),
     323             :               MixedAirPressure(0.0), MixedAirMassFlowRate(0.0), MassFlowRateMaxAvail(0.0), ADUNum(0), TermUnitSizingIndex(0), OneTimeInitFlag(true),
     324             :               OneTimeInitFlag2(true), CtrlZoneInNodeIndex(0), ZoneNum(0), NoOAFlowInputFromUser(true), OARequirementsPtr(0), AirLoopNum(0),
     325         192 :               DesignPrimaryAirVolRate(0.0), OAPerPersonMode(DataZoneEquipment::PerPersonVentRateMode::Invalid), printWarning(true)
     326             :         {
     327         192 :         }
     328             : 
     329             :         void InitATMixer(EnergyPlusData &state, bool FirstHVACIteration);
     330             :     };
     331             : 
     332             :     void SimulateSingleDuct(EnergyPlusData &state, std::string_view CompName, bool FirstHVACIteration, int ZoneNum, int ZoneNodeNum, int &CompIndex);
     333             : 
     334             :     void GetSysInput(EnergyPlusData &state);
     335             : 
     336             :     void GetHVACSingleDuctSysIndex(EnergyPlusData &state,
     337             :                                    std::string const &SDSName,
     338             :                                    int &SDSIndex,
     339             :                                    bool &ErrorsFound,
     340             :                                    std::string_view const ThisObjectType = {},
     341             :                                    Optional_int DamperInletNode = _, // Damper inlet node number
     342             :                                    Optional_int DamperOutletNode = _ // Damper outlet node number
     343             :     );
     344             : 
     345             :     void SimATMixer(EnergyPlusData &state, std::string const &SysName, bool FirstHVACIteration, int &SysIndex);
     346             : 
     347             :     void GetATMixers(EnergyPlusData &state);
     348             : 
     349             :     void CalcATMixer(EnergyPlusData &state, int SysNum);
     350             : 
     351             :     void UpdateATMixer(EnergyPlusData &state, int SysNum);
     352             : 
     353             :     void GetATMixer(EnergyPlusData &state,
     354             :                     std::string const &ZoneEquipName, // zone unit name name
     355             :                     std::string &ATMixerName,         // air terminal mixer name
     356             :                     int &ATMixerNum,                  // air terminal mixer index
     357             :                     int &ATMixerType,                 // air teminal mixer type
     358             :                     int &ATMixerPriNode,              // air terminal mixer primary air node number
     359             :                     int &ATMixerSecNode,              // air terminal mixer secondary air node number
     360             :                     int &ATMixerOutNode,              // air terminal mixer outlet air node number
     361             :                     int ZoneEquipOutletNode           // zone equipment outlet node (used with inlet side mixers)
     362             :     );
     363             : 
     364             :     void SetATMixerPriFlow(EnergyPlusData &state,
     365             :                            int ATMixerNum,                               // Air terminal mixer index
     366             :                            Optional<Real64 const> PriAirMassFlowRate = _ // Air terminal mixer primary air mass flow rate [kg/s]
     367             :     );
     368             : 
     369             :     void setATMixerSizingProperties(EnergyPlusData &state,
     370             :                                     int inletATMixerIndex, // index to ATMixer at inlet of zone equipment
     371             :                                     int controlledZoneNum, // controlled zone number
     372             :                                     int curZoneEqNum       // current zone equipment being simulated
     373             :     );
     374             : 
     375             : } // namespace SingleDuct
     376             : 
     377        1542 : struct SingleDuctData : BaseGlobalStruct
     378             : {
     379             : 
     380             :     Array1D<SingleDuct::AirTerminalMixerData> SysATMixer;
     381             :     Array1D<SingleDuct::SingleDuctAirTerminal> sd_airterminal;
     382             :     std::unordered_map<std::string, std::string> SysUniqueNames;
     383             :     Array1D_bool CheckEquipName;
     384             :     int NumATMixers = 0;
     385             :     int NumConstVolSys = 0;
     386             :     int NumSDAirTerminal = 0;              // The Number of single duct air terminals found in the Input
     387             :     bool GetInputFlag = true;              // Flag set to make sure you get input once
     388             :     bool GetATMixerFlag = true;            // Flag set to make sure you get input once
     389             :     bool InitSysFlag = true;               // Flag set to make sure you do begin simulation initializaztions once
     390             :     bool InitATMixerFlag = true;           // Flag set to make sure you do begin simulation initializaztions once for mixer
     391             :     bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     392             : 
     393             :     int SysNumGSI = 0;   // The Sys that you are currently loading input into
     394             :     int SysIndexGSI = 0; // The Sys that you are currently loading input into
     395             :     int NumVAVSysGSI = 0;
     396             :     int NumNoRHVAVSysGSI = 0;
     397             :     int NumVAVVSGSI = 0;
     398             :     int NumCBVAVSysGSI = 0;
     399             :     int NumNoRHCBVAVSysGSI = 0;
     400             :     int NumAlphasGSI = 0;
     401             :     int NumNumsGSI = 0;
     402             :     int NumCVNoReheatSysGSI = 0;
     403             :     int MaxNumsGSI = 0;   // Maximum number of numeric input fields
     404             :     int MaxAlphasGSI = 0; // Maximum number of alpha input fields
     405             :     int TotalArgsGSI = 0; // Total number of alpha and numeric arguments  = max for a
     406             :     Real64 CoilInTempSS = 0.0;
     407             :     Real64 DesCoilLoadSS = 0.0;
     408             :     Real64 DesZoneHeatLoadSS = 0.0;
     409             :     Real64 ZoneDesTempSS = 0.0;
     410             :     Real64 ZoneDesHumRatSS = 0.0;
     411             :     int CoilWaterInletNodeSS = 0;
     412             :     int CoilWaterOutletNodeSS = 0;
     413             :     int CoilSteamInletNodeSS = 0;
     414             :     int CoilSteamOutletNodeSS = 0;
     415             :     int DummyWaterIndexSS = 1;
     416             :     Real64 UserInputMaxHeatAirVolFlowRateSS = 0.0; // user input for MaxHeatAirVolFlowRate
     417             :     Real64 MinAirMassFlowRevActSVAV = 0.0;         // minimum air mass flow rate used in "reverse action" air mass flow rate calculation
     418             :     Real64 MaxAirMassFlowRevActSVAV = 0.0;         // maximum air mass flow rate used in "reverse action" air mass flow rate calculation
     419             :     Real64 ZoneTempSCBVAV = 0.0;                   // zone air temperature [C]
     420             :     Real64 MaxHeatTempSCBVAV = 0.0;                // maximum supply air temperature [C]
     421             :     Real64 MassFlowReqSCBVAV = 0.0;                // air mass flow rate required to meet the coil heating load [W]
     422             :     Real64 MassFlowActualSCBVAV = 0.0;             // air mass flow rate actually used [W]
     423             :     Real64 QZoneMaxSCBVAV = 0.0;                   // maximum zone heat addition rate given constraints of MaxHeatTemp and max        /
     424             :                                                    // available air mass flow rate [W]
     425             :     Real64 MinMassAirFlowSCBVAV = 0.0;             // the air flow rate during heating for normal acting damper
     426             :     Real64 QZoneMax2SCBVAV = 0.0;                  // temporary variable
     427             :     Real64 QZoneMax3SCBVAV = 0.0;                  // temporary variable
     428             :     Real64 TAirMaxSCV = 0.0;                       // Maximum zone supply air temperature [C]
     429             :     Real64 QMaxSCV = 0.0;                          // Maximum heat addition rate imposed by the max zone supply air temperature [W]
     430             :     Real64 ZoneTempSCV = 0.0;                      // Zone temperature [C]
     431             :     Real64 QMax2SCV = 0.0;
     432             :     int SysNumSATM = 0;
     433             :     Real64 PriMassFlowRateCATM = 0.0;
     434             :     Real64 PriEnthalpyCATM = 0.0;
     435             :     Real64 PriHumRatCATM = 0.0;
     436             :     Real64 PriTempCATM = 0.0;
     437             : 
     438             :     Real64 SecAirMassFlowRateCATM = 0.0;
     439             :     Real64 SecAirEnthalpyCATM = 0.0;
     440             :     Real64 SecAirHumRatCATM = 0.0;
     441             :     Real64 SecAirTempCATM = 0.0;
     442             : 
     443             :     Real64 MixedAirMassFlowRateCATM = 0.0;
     444             :     Real64 MixedAirEnthalpyCATM = 0.0;
     445             :     Real64 MixedAirHumRatCATM = 0.0;
     446             :     Real64 MixedAirTempCATM = 0.0;
     447             : 
     448             :     Real64 ZoneTempSDAT = 0.0;                      // zone air temperature [C]
     449             :     Real64 MaxHeatTempSDAT = 0.0;                   // maximum supply air temperature [C]
     450             :     Real64 MaxDeviceAirMassFlowReheatSDAT = 0.0;    // air mass flow rate required to meet the coil heating load [W]
     451             :     Real64 MassFlowReqToLimitLeavingTempSDAT = 0.0; // air mass flow rate actually used [W]
     452             :     Real64 QZoneMaxRHTempLimitSDAT = 0.0;           // maximum zone heat addition rate given constraints of MaxHeatTemp and max
     453             :                                                     // available air mass flow rate [W]
     454             :     Real64 MinMassAirFlowSDAT = 0.0;                // the air flow rate during heating for normal acting damper
     455             :     Real64 QZoneMax2SDAT = 0.0;                     // temporary variable
     456             : 
     457           0 :     void clear_state() override
     458             :     {
     459           0 :         this->SysATMixer.deallocate();
     460           0 :         this->sd_airterminal.deallocate();
     461           0 :         this->SysUniqueNames.clear();
     462           0 :         this->CheckEquipName.deallocate();
     463           0 :         this->NumATMixers = 0;
     464           0 :         this->NumConstVolSys = 0;
     465           0 :         this->NumSDAirTerminal = 0;
     466           0 :         this->GetInputFlag = true;
     467           0 :         this->GetATMixerFlag = true;
     468           0 :         this->InitSysFlag = true;
     469           0 :         this->InitATMixerFlag = true;
     470           0 :         this->ZoneEquipmentListChecked = false;
     471             : 
     472           0 :         this->SysNumGSI = 0;   // The Sys that you are currently loading input into
     473           0 :         this->SysIndexGSI = 0; // The Sys that you are currently loading input into
     474           0 :         this->NumVAVSysGSI = 0;
     475           0 :         this->NumNoRHVAVSysGSI = 0;
     476           0 :         this->NumVAVVSGSI = 0;
     477           0 :         this->NumCBVAVSysGSI = 0;
     478           0 :         this->NumNoRHCBVAVSysGSI = 0;
     479           0 :         this->NumAlphasGSI = 0;
     480           0 :         this->NumNumsGSI = 0;
     481           0 :         this->NumCVNoReheatSysGSI = 0;
     482           0 :         this->MaxNumsGSI = 0;   // Maximum number of numeric input fields
     483           0 :         this->MaxAlphasGSI = 0; // Maximum number of alpha input fields
     484           0 :         this->TotalArgsGSI = 0; // Total number of alpha and numeric arguments  = max for a
     485           0 :         this->CoilInTempSS = 0.0;
     486           0 :         this->DesCoilLoadSS = 0.0;
     487           0 :         this->DesZoneHeatLoadSS = 0.0;
     488           0 :         this->ZoneDesTempSS = 0.0;
     489           0 :         this->ZoneDesHumRatSS = 0.0;
     490           0 :         this->CoilWaterInletNodeSS = 0;
     491           0 :         this->CoilWaterOutletNodeSS = 0;
     492           0 :         this->CoilSteamInletNodeSS = 0;
     493           0 :         this->CoilSteamOutletNodeSS = 0;
     494           0 :         this->DummyWaterIndexSS = 1;
     495           0 :         this->UserInputMaxHeatAirVolFlowRateSS = 0.0; // user input for MaxHeatAirVolFlowRate
     496           0 :         this->MinAirMassFlowRevActSVAV = 0.0;         // minimum air mass flow rate used in "reverse action" air mass flow rate calculation
     497           0 :         this->MaxAirMassFlowRevActSVAV = 0.0;         // maximum air mass flow rate used in "reverse action" air mass flow rate calculation
     498           0 :         this->ZoneTempSCBVAV = 0.0;                   // zone air temperature [C]
     499           0 :         this->MaxHeatTempSCBVAV = 0.0;                // maximum supply air temperature [C]
     500           0 :         this->MassFlowReqSCBVAV = 0.0;                // air mass flow rate required to meet the coil heating load [W]
     501           0 :         this->MassFlowActualSCBVAV = 0.0;             // air mass flow rate actually used [W]
     502           0 :         this->QZoneMaxSCBVAV = 0.0;                   // maximum zone heat addition rate given constraints of MaxHeatTemp and max        /
     503           0 :         this->MinMassAirFlowSCBVAV = 0.0;             // the air flow rate during heating for normal acting damper
     504           0 :         this->QZoneMax2SCBVAV = 0.0;                  // temporary variable
     505           0 :         this->QZoneMax3SCBVAV = 0.0;                  // temporary variable
     506           0 :         this->TAirMaxSCV = 0.0;                       // Maximum zone supply air temperature [C]
     507           0 :         this->QMaxSCV = 0.0;                          // Maximum heat addition rate imposed by the max zone supply air temperature [W]
     508           0 :         this->ZoneTempSCV = 0.0;                      // Zone temperature [C]
     509           0 :         this->QMax2SCV = 0.0;
     510           0 :         this->SysNumSATM = 0;
     511           0 :         this->PriMassFlowRateCATM = 0.0;
     512           0 :         this->PriEnthalpyCATM = 0.0;
     513           0 :         this->PriHumRatCATM = 0.0;
     514           0 :         this->PriTempCATM = 0.0;
     515           0 :         this->SecAirMassFlowRateCATM = 0.0;
     516           0 :         this->SecAirEnthalpyCATM = 0.0;
     517           0 :         this->SecAirHumRatCATM = 0.0;
     518           0 :         this->SecAirTempCATM = 0.0;
     519           0 :         this->MixedAirMassFlowRateCATM = 0.0;
     520           0 :         this->MixedAirEnthalpyCATM = 0.0;
     521           0 :         this->MixedAirHumRatCATM = 0.0;
     522           0 :         this->MixedAirTempCATM = 0.0;
     523             : 
     524           0 :         this->ZoneTempSDAT = 0.0;                      // zone air temperature [C]
     525           0 :         this->MaxHeatTempSDAT = 0.0;                   // maximum supply air temperature [C]
     526           0 :         this->MaxDeviceAirMassFlowReheatSDAT = 0.0;    // air mass flow rate required to meet the coil heating load [W]
     527           0 :         this->MassFlowReqToLimitLeavingTempSDAT = 0.0; // air mass flow rate actually used [W]
     528           0 :         this->QZoneMaxRHTempLimitSDAT = 0.0;           // maximum zone heat addition rate given constraints of MaxHeatTemp and max
     529           0 :         this->MinMassAirFlowSDAT = 0.0;                // the air flow rate during heating for normal acting damper
     530           0 :         this->QZoneMax2SDAT = 0.0;                     // temporary variable
     531           0 :     }
     532             : };
     533             : 
     534             : } // namespace EnergyPlus
     535             : 
     536             : #endif

Generated by: LCOV version 1.13