LCOV - code coverage report
Current view: top level - EnergyPlus - SystemAvailabilityManager.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 34 77 44.2 %
Date: 2023-01-17 19:17:23 Functions: 35 48 72.9 %

          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 SystemAvailabilityManager_hh_INCLUDED
      49             : #define SystemAvailabilityManager_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : #include <ObjexxFCL/Optional.hh>
      54             : 
      55             : // EnergyPlus Headers
      56             : #include <EnergyPlus/Data/BaseData.hh>
      57             : #include <EnergyPlus/DataGlobals.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : #include <EnergyPlus/Plant/PlantAvailManager.hh>
      60             : 
      61             : namespace EnergyPlus {
      62             : 
      63             : // Forward declarations
      64             : struct EnergyPlusData;
      65             : 
      66             : namespace SystemAvailabilityManager {
      67             : 
      68             :     enum class ControlAlgorithm
      69             :     {
      70             :         Invalid = -1,
      71             :         ConstantTemperatureGradient,
      72             :         AdaptiveTemperatureGradient,
      73             :         AdaptiveASHRAE,
      74             :         ConstantStartTime,
      75             :         Num
      76             :     };
      77             : 
      78             :     // Cycling Run Time Control Type
      79             :     enum class CyclingRunTimeControl
      80             :     {
      81             :         Invalid = -1,
      82             :         FixedRunTime,
      83             :         Thermostat,
      84             :         ThermostatWithMinimumRunTime,
      85             :         Num
      86             :     };
      87             : 
      88             :     enum class NightCycleControlType
      89             :     {
      90             :         Invalid = -1,
      91             :         Off,
      92             :         OnAny,
      93             :         OnControlZone,
      94             :         OnZoneFansOnly,
      95             :         OnAnyCoolingOrHeatingZone,
      96             :         OnAnyCoolingZone,
      97             :         OnAnyHeatingZone,
      98             :         OnAnyHeatingZoneFansOnly,
      99             :         Num
     100             :     };
     101             : 
     102             :     // Optimum start parameter definitions
     103             :     enum class OptimumStartControlType
     104             :     {
     105             :         Invalid = -1,
     106             :         Off,
     107             :         ControlZone,
     108             :         MaximumOfZoneList,
     109             :         Num
     110             :     };
     111             : 
     112        3095 :     struct SysAvailManager
     113             :     {
     114             :         // Members
     115             :         std::string Name;                                                                       // Name of the manager object
     116             :         DataPlant::SystemAvailabilityType MgrType = DataPlant::SystemAvailabilityType::Invalid; // Integer equivalent of availability manager type
     117             :         int SchedPtr;                                                                           // Schedule pointer
     118             :         int AvailStatus;                                                                        // reports status of availability manager
     119             : 
     120             :         // Default Constructor
     121        1847 :         SysAvailManager() : SchedPtr(0), AvailStatus(0)
     122             :         {
     123        1847 :         }
     124             :     };
     125             : 
     126        2311 :     struct SysAvailManagerScheduled : SysAvailManager // Derived type for Scheduled Sys Avail Managers
     127             :     {
     128             :     };
     129             : 
     130          16 :     struct SysAvailManagerScheduledOn : SysAvailManager // Derived type for Scheduled On Sys Avail Managers
     131             :     {
     132             :     };
     133             : 
     134          20 :     struct SysAvailManagerScheduledOff : SysAvailManager // Derived type for Scheduled Off Sys Avail Managers
     135             :     {
     136             :     };
     137             : 
     138        1183 :     struct SysAvailManagerNightCycle : SysAvailManager // Derived type for Night Cycle Sys Avail Managers
     139             :     {
     140             :         // Members
     141             :         std::string FanSched; // Fan schedule name
     142             :         int FanSchedPtr;      // Fan schedule pointer
     143             :         //   Cycle On Control Zone, or Cycle On Any - Zone Fans Only
     144             :         Real64 TempTolRange;                                                          // range in degrees C of thermostat tolerance
     145             :         int CyclingTimeSteps;                                                         // period (in Loads time steps) system will cycle on.
     146             :         int PriorAvailStatus;                                                         // prior status of availability manager
     147             :         std::string CtrlZoneListName;                                                 // controlled zone or zonelist name
     148             :         int NumOfCtrlZones;                                                           // number of controlled zones
     149             :         Array1D_int CtrlZonePtrs;                                                     // pointers to controlled zone(s)
     150             :         std::string CoolingZoneListName;                                              // coolin zone or zonelist name
     151             :         int NumOfCoolingZones;                                                        // number of cooling zones
     152             :         Array1D_int CoolingZonePtrs;                                                  // pointers to cooling zone(s)
     153             :         std::string HeatingZoneListName;                                              // heatig zone or zonelist name
     154             :         int NumOfHeatingZones;                                                        // number of heatig zones
     155             :         Array1D_int HeatingZonePtrs;                                                  // pointers to heating zone(s)
     156             :         std::string HeatZnFanZoneListName;                                            // heating zone fans only zone or zonelist name
     157             :         int NumOfHeatZnFanZones;                                                      // number of heating zone fans only zones
     158             :         Array1D_int HeatZnFanZonePtrs;                                                // pointers to heating zone fans only zone(s)
     159             :         CyclingRunTimeControl cyclingRunTimeControl = CyclingRunTimeControl::Invalid; // Cycling Run Time Control Type
     160             :         NightCycleControlType nightCycleControlType = NightCycleControlType::Invalid; // type of control: Stay Off, Cycle On Any,
     161             : 
     162             :         // Default Constructor
     163         655 :         SysAvailManagerNightCycle()
     164         655 :             : FanSchedPtr(0), TempTolRange(1.0), CyclingTimeSteps(1), PriorAvailStatus(0), NumOfCtrlZones(0), NumOfCoolingZones(0),
     165         655 :               NumOfHeatingZones(0), NumOfHeatZnFanZones(0)
     166             :         {
     167         655 :         }
     168             :     };
     169             : 
     170           3 :     struct SysAvailManagerOptimumStart : SysAvailManager // Derived type for Optimal Start Sys Avail Managers
     171             :     {
     172             :         // Members
     173             :         bool isSimulated;                  // true after availability manager is simulated
     174             :         std::string FanSched;              // Fan schedule name
     175             :         int FanSchedPtr;                   // Fan schedule pointer
     176             :         std::string CtrlZoneName;          // Name of the control zone
     177             :         int ZoneNum;                       // zone number of control zone
     178             :         std::string ZoneListName;          // Zone List name
     179             :         int NumOfZones;                    // Number of zones in the list
     180             :         Array1D_int ZonePtrs;              // Pointers to zones in the list
     181             :         Real64 MaxOptStartTime;            // Maximum value of start time in hours
     182             :         ControlAlgorithm controlAlgorithm; // Control algorithm: ConstantTemperatureGradient,
     183             :         // AdaptiveTemperatureGradient, AdaptiveASHRAE, ConstantStartTime
     184             :         Real64 ConstTGradCool;    // Constant temperature gradient in cooling mode, unit: degC per hour
     185             :         Real64 ConstTGradHeat;    // Constant temperature gradient in heating mode, unit: degC per hour
     186             :         Real64 InitTGradCool;     // Initial value for temperature gradient in cooling mode, unit: degC per hour
     187             :         Real64 InitTGradHeat;     // Initial value for temperature gradient in heating mode, unit: degC per hour
     188             :         Real64 AdaptiveTGradCool; // Calculated adaptive temperature gradient in cooling mode, unit: degC per hour
     189             :         Real64 AdaptiveTGradHeat; // Calculated adaptive temperature gradient in heating mode, unit: degC per hour
     190             :         Real64 ConstStartTime;    // Constant start time in hours
     191             :         int NumPreDays;           // Number of previous days for adaptive control
     192             :         Real64 NumHoursBeforeOccupancy;
     193             :         Real64 TempDiffHi;   // temperature difference for cooling mode
     194             :         Real64 TempDiffLo;   // temperature difference for heating mode
     195             :         int ATGWCZoneNumLo;  // zone index for worst case heating zone
     196             :         int ATGWCZoneNumHi;  // zone index for worst case cooling zone
     197             :         bool CycleOnFlag;    // Tracks when air loop has cycled on
     198             :         bool ATGUpdateFlag1; // updates
     199             :         bool ATGUpdateFlag2;
     200             :         bool FirstTimeATGFlag;
     201             :         bool OverNightStartFlag; // Flag to indicate the optimum start starts before mid night.
     202             :         bool OSReportVarFlag;
     203             :         Array1D<Real64> AdaTempGradTrdHeat; // Heating temp gradient for previous days
     204             :         Array1D<Real64> AdaTempGradTrdCool; // Cooling temp gradient for previous days
     205             :         Real64 AdaTempGradHeat;
     206             :         Real64 AdaTempGradCool;
     207             :         Real64 ATGUpdateTime1;
     208             :         Real64 ATGUpdateTime2;
     209             :         Real64 ATGUpdateTemp1;
     210             :         Real64 ATGUpdateTemp2;
     211             :         OptimumStartControlType optimumStartControlType =
     212             :             OptimumStartControlType::Invalid; // Type of control: Stay Off, ControlZone, MaximumofZoneList
     213             : 
     214             :         // Default Constructor
     215           2 :         SysAvailManagerOptimumStart()
     216           2 :             : isSimulated(false), FanSchedPtr(0), ZoneNum(0), NumOfZones(0), MaxOptStartTime(6.0), controlAlgorithm(ControlAlgorithm::Invalid),
     217             :               ConstTGradCool(1.0), ConstTGradHeat(1.0), InitTGradCool(1.0), InitTGradHeat(1.0), AdaptiveTGradCool(1.0), AdaptiveTGradHeat(1.0),
     218             :               ConstStartTime(2.0), NumPreDays(1), NumHoursBeforeOccupancy(0.0), TempDiffHi(0.0), TempDiffLo(0.0), ATGWCZoneNumLo(0),
     219             :               ATGWCZoneNumHi(0), CycleOnFlag(false), ATGUpdateFlag1(false), ATGUpdateFlag2(false), FirstTimeATGFlag(true), OverNightStartFlag(false),
     220             :               OSReportVarFlag(false), AdaTempGradHeat(0.0), AdaTempGradCool(0.0), ATGUpdateTime1(0.0), ATGUpdateTime2(0.0), ATGUpdateTemp1(0.0),
     221           2 :               ATGUpdateTemp2(0.0)
     222             :         {
     223           2 :         }
     224             : 
     225             :         void SetOptStartFlag(EnergyPlusData &state, int const AirLoopNum);
     226             :     };
     227             : 
     228           0 :     struct DefineASHRAEAdaptiveOptimumStartCoeffs // Derived type for Differential Thermostat Sys Avail Managers
     229             :     {
     230             :         // Members
     231             :         std::string Name; // Name of the object
     232             :         Real64 Coeff1;    // 1st Coefficient of the equation
     233             :         Real64 Coeff2;    // 2nd Coefficient of the equation
     234             :         Real64 Coeff3;    // 3rd Coefficient of the equation
     235             :         Real64 Coeff4;    // 4th Coefficient of the equation
     236             : 
     237             :         // Default Constructor
     238             :         DefineASHRAEAdaptiveOptimumStartCoeffs() : Coeff1(0.0), Coeff2(0.0), Coeff3(0.0), Coeff4(0.0)
     239             :         {
     240             :         }
     241             :     };
     242             : 
     243           6 :     struct SysAvailManagerDiffThermo : SysAvailManager // Derived type for Differential Thermostat Sys Avail Managers
     244             :     {
     245             :         // Members
     246             :         int HotNode;        // "Hot" sensor node
     247             :         int ColdNode;       // "Cold" sensor node
     248             :         Real64 TempDiffOn;  // Temperature difference for turn on (delta C)
     249             :         Real64 TempDiffOff; // Temperature difference for turn off (delta C)
     250             : 
     251             :         // Default Constructor
     252           4 :         SysAvailManagerDiffThermo() : HotNode(0), ColdNode(0), TempDiffOn(0.0), TempDiffOff(0.0)
     253             :         {
     254           4 :         }
     255             :     };
     256             : 
     257         171 :     struct SysAvailManagerHiLoTemp : SysAvailManager // Derived type for High/Low Temperature On/Off Sys Avail Managers
     258             :     {
     259             :         // Members
     260             :         int Node;    // Sensor node
     261             :         Real64 Temp; // Temperature for on/off (C)
     262             : 
     263             :         // Default Constructor
     264         112 :         SysAvailManagerHiLoTemp() : Node(0), Temp(0.0)
     265             :         {
     266         112 :         }
     267             :     };
     268             : 
     269           3 :     struct SysAvailManagerNightVent : SysAvailManager
     270             :     {
     271             :         // Members
     272             :         std::string FanSched;      // Fan schedule name
     273             :         int FanSchedPtr;           // Fan schedule pointer
     274             :         std::string VentTempSched; // Ventilation temperature schedule
     275             :         int VentTempSchedPtr;      // Ventilation temperature schedule pointer
     276             :         Real64 VentDelT;           // Ventilation delta T [deltaC]
     277             :         Real64 VentTempLowLim;     // ventilation temperature low limit
     278             :         std::string CtrlZoneName;  // Name of the control zone
     279             :         int ZoneNum;               // zome number of control zone
     280             :         Real64 VentFlowFrac;       // the night venting flow fraction
     281             : 
     282             :         // Default Constructor
     283           2 :         SysAvailManagerNightVent() : FanSchedPtr(0), VentTempSchedPtr(0), VentDelT(0.0), VentTempLowLim(0.0), ZoneNum(0), VentFlowFrac(0.0)
     284             :         {
     285           2 :         }
     286             :     };
     287             : 
     288          29 :     struct SysAvailManagerHybridVent : SysAvailManager
     289             :     {
     290             :         // Members
     291             :         std::string AirLoopName;     // Name of HVAC Air Loop
     292             :         int AirLoopNum;              // HVAC Air Loop number
     293             :         std::string ControlZoneName; // Controlled zone name
     294             :         int NodeNumOfControlledZone; // Controlled zone node number
     295             :         int ControlledZoneNum;       // Controlled zone number
     296             :         int ControlModeSchedPtr;     // Ventilation control mode schedule pointer
     297             :         int ControlMode;             // hybrid ventilation control mode
     298             :         int VentilationCtrl;         // Ventilation control type: Noaction, Close, Open
     299             :         Real64 MinOutdoorTemp;       // Minimum Outdoor Temperature [C]
     300             :         Real64 MaxOutdoorTemp;       // Maximum Outdoor Temperature [C]
     301             :         Real64 MinOutdoorEnth;       // Minimum Outdoor Enthalpy [J/kg]
     302             :         Real64 MaxOutdoorEnth;       // Maximum Outdoor Enthalpy [J/kg]
     303             :         Real64 MinOutdoorDewPoint;   // Minimum Outdoor Dew point temperature [C]
     304             :         Real64 MaxOutdoorDewPoint;   // Maximum Outdoor Dew Point Temperature [C]
     305             :         Real64 MaxWindSpeed;         // Maximum Wind speed [m/s]
     306             :         bool UseRainIndicator;       // Use WeatherFile Rain Indicators
     307             :         std::string MinOASched;      // Minimum Outdoor Ventilation Air Schedule Name
     308             :         int MinOASchedPtr;           // Minimum Outdoor Ventilation Air Schedule pointer
     309             :         int DewPointNoRHErrCount;    // Dewpoint control mode error count without a humidistat
     310             :         int DewPointNoRHErrIndex;    // Dewpoint control mode error index without a humidistat
     311             :         int DewPointErrCount;        // Dewpoint control mode error count without a valid humidistat
     312             :         int DewPointErrIndex;        // Dewpoint control mode error index without a valid humidistat
     313             :         int SingleHCErrCount;        // Temperature and enthalpy control mode error count
     314             :         // with a singleHeatingCooling setpoint
     315             :         int SingleHCErrIndex; // Temperature and enthalpy control mode error index
     316             :         // with a singleHeatingCooling setpoint
     317             :         int OpeningFactorFWS;                 // Opening factor modifier as a function of wind speed
     318             :         int ANControlTypeSchedPtr;            // AirflowNetwork control type schedule pointer
     319             :         int SimpleControlTypeSchedPtr;        // Simple airflow object control type schedule pointer
     320             :         int VentilationPtr;                   // Ventilation object name pointer
     321             :         std::string VentilationName;          // Ventilation object name
     322             :         bool HybridVentMgrConnectedToAirLoop; // Flag to check whether hybrid ventilation
     323             :         // manager is connected to air loop
     324             :         bool SimHybridVentSysAvailMgr; // Set to false when a zone has two hybrid ventilation
     325             :         // managers, one with air loop and one without
     326             :         Real64 OperativeTemp;    // Zone air operative temperature [C]
     327             :         Real64 CO2;              // Zone air CO2 [ppm]
     328             :         Real64 MinOperTime;      // Minimum HVAC Operation Time [minutes]
     329             :         Real64 MinVentTime;      // Minimum Ventilation Time [minutes]
     330             :         Real64 TimeOperDuration; // Time duration with continuous HVAC operation [minutes]
     331             :         Real64 TimeVentDuration; // Time duration with continuous ventilation [minutes]
     332             :         Real64 minAdaTem;        // minimum adaptive temperature for adaptive temperature control [C]
     333             :         Real64 maxAdaTem;        // maximum adaptive temperature for adaptive temperature control [C]
     334             : 
     335             :         // Default Constructor
     336          19 :         SysAvailManagerHybridVent()
     337          19 :             : AirLoopNum(0), NodeNumOfControlledZone(0), ControlledZoneNum(0), ControlModeSchedPtr(0), ControlMode(0), VentilationCtrl(0),
     338             :               MinOutdoorTemp(-100.0), MaxOutdoorTemp(100.0), MinOutdoorEnth(0.1), MaxOutdoorEnth(300000.0), MinOutdoorDewPoint(-100.0),
     339             :               MaxOutdoorDewPoint(100.0), MaxWindSpeed(0.0), UseRainIndicator(true), MinOASchedPtr(0), DewPointNoRHErrCount(0),
     340             :               DewPointNoRHErrIndex(0), DewPointErrCount(0), DewPointErrIndex(0), SingleHCErrCount(0), SingleHCErrIndex(0), OpeningFactorFWS(0),
     341             :               ANControlTypeSchedPtr(0), SimpleControlTypeSchedPtr(0), VentilationPtr(0), HybridVentMgrConnectedToAirLoop(true),
     342             :               SimHybridVentSysAvailMgr(false), OperativeTemp(0.0), CO2(0.0), MinOperTime(0.0), MinVentTime(0.0), TimeOperDuration(0.0),
     343          19 :               TimeVentDuration(0.0), minAdaTem(0.0), maxAdaTem(0.0)
     344             :         {
     345          19 :         }
     346             :     };
     347             : 
     348        2958 :     struct List
     349             :     {
     350             :         // Members
     351             :         std::string Name; // Availability Manager List Name
     352             :         int NumItems;
     353             :         Array1D_string AvailManagerName;
     354             :         Array1D<DataPlant::SystemAvailabilityType> AvailManagerType;
     355             : 
     356             :         // Default Constructor
     357        1741 :         List() : NumItems(0)
     358             :         {
     359        1741 :         }
     360             :     };
     361             : 
     362             :     void ManageSystemAvailability(EnergyPlusData &state);
     363             : 
     364             :     void GetSysAvailManagerInputs(EnergyPlusData &state);
     365             : 
     366             :     void GetSysAvailManagerListInputs(EnergyPlusData &state);
     367             : 
     368             :     void GetPlantAvailabilityManager(EnergyPlusData &state,
     369             :                                      std::string const &AvailabilityListName, // name that should be an Availability Manager List Name
     370             :                                      int const Loop,                          // which loop this is
     371             :                                      int const NumPlantLoops,                 // Total number of plant loops
     372             :                                      bool &ErrorsFound                        // true if certain errors are detected here
     373             :     );
     374             : 
     375             :     void GetAirLoopAvailabilityManager(EnergyPlusData &state,
     376             :                                        std::string const &AvailabilityListName, // name that should be an Availability Manager List Name
     377             :                                        int const Loop,                          // which loop this is
     378             :                                        int const NumAirLoops,                   // Total number of air loops
     379             :                                        bool &ErrorsFound                        // true if certain errors are detected here
     380             :     );
     381             : 
     382             :     void GetZoneEqAvailabilityManager(EnergyPlusData &state,
     383             :                                       int const ZoneEquipType, // Type of ZoneHVAC:* component
     384             :                                       int const CompNum,       // Index of a particular ZoneHVAC:* component
     385             :                                       bool &ErrorsFound        // true if certain errors are detected here
     386             :     );
     387             : 
     388             :     void InitSysAvailManagers(EnergyPlusData &state);
     389             : 
     390             :     void SimSysAvailManager(EnergyPlusData &state,
     391             :                             const DataPlant::SystemAvailabilityType SysAvailType,
     392             :                             std::string const &SysAvailName,
     393             :                             int &SysAvailNum,
     394             :                             int const PriAirSysNum, // Primary Air System index. If being called for a ZoneHVAC:* component
     395             :                             int const PreviousStatus,
     396             :                             int &AvailStatus,
     397             :                             Optional_int_const ZoneEquipType = _, // Type of ZoneHVAC:* equipment component
     398             :                             Optional_int_const CompNum = _        // Index of ZoneHVAC:* equipment component
     399             :     );
     400             : 
     401             :     void CalcSchedSysAvailMgr(EnergyPlusData &state,
     402             :                               int const SysAvailNum, // number of the current scheduled system availability manager
     403             :                               int &AvailStatus       // System status indicator
     404             :     );
     405             : 
     406             :     void CalcSchedOnSysAvailMgr(EnergyPlusData &state,
     407             :                                 int const SysAvailNum, // number of the current scheduled on system availability manager
     408             :                                 int &AvailStatus       // System status indicator
     409             :     );
     410             : 
     411             :     void CalcSchedOffSysAvailMgr(EnergyPlusData &state,
     412             :                                  int const SysAvailNum, // number of the current scheduled off system availability manager
     413             :                                  int &AvailStatus       // System status indicator
     414             :     );
     415             : 
     416             :     void CalcNCycSysAvailMgr(EnergyPlusData &state,
     417             :                              int const SysAvailNum,                // number of the current scheduled system availability manager
     418             :                              int const PriAirSysNum,               // number of the primary air system affected by this Avail. Manager
     419             :                              int &AvailStatus,                     // System status indicator
     420             :                              Optional_int_const ZoneEquipType = _, // Type of ZoneHVAC equipment component
     421             :                              Optional_int_const CompNum = _        // Index of ZoneHVAC equipment component
     422             :     );
     423             : 
     424             :     bool CoolingZoneOutOfTolerance(EnergyPlusData &state,
     425             :                                    Array1D_int const ZonePtrList, // list of controlled zone pointers
     426             :                                    int const NumZones,            // number of zones in list
     427             :                                    Real64 const TempTolerance     // temperature tolerance
     428             :     );
     429             : 
     430             :     bool HeatingZoneOutOfTolerance(EnergyPlusData &state,
     431             :                                    Array1D_int const ZonePtrList, // list of controlled zone pointers
     432             :                                    int const NumZones,            // number of zones in list
     433             :                                    Real64 const TempTolerance     // temperature tolerance
     434             :     );
     435             : 
     436             :     void CalcOptStartSysAvailMgr(EnergyPlusData &state,
     437             :                                  int const SysAvailNum,                // number of the current scheduled system availability manager
     438             :                                  int const PriAirSysNum,               // number of the primary air system affected by this Avail. Manager
     439             :                                  int &AvailStatus,                     // System status indicator
     440             :                                  Optional_int_const ZoneEquipType = _, // Type of ZoneHVAC equipment component
     441             :                                  Optional_int_const CompNum = _        // Index of ZoneHVAC equipment component
     442             :     );
     443             : 
     444             :     void CalcNVentSysAvailMgr(EnergyPlusData &state,
     445             :                               int const SysAvailNum,               // number of the current scheduled system availability manager
     446             :                               int const PriAirSysNum,              // number of the primary air system affected by this Avail. Manager
     447             :                               int &AvailStatus,                    // System status indicator
     448             :                               Optional_int_const ZoneEquipType = _ // Type of zone equipment component
     449             :     );
     450             : 
     451             :     void CalcDiffTSysAvailMgr(EnergyPlusData &state,
     452             :                               int const SysAvailNum,    // Number of the current scheduled system availability manager
     453             :                               int const PreviousStatus, // System status for the previous timestep
     454             :                               int &AvailStatus          // System status indicator
     455             :     );
     456             : 
     457             :     void CalcHiTurnOffSysAvailMgr(EnergyPlusData &state,
     458             :                                   int const SysAvailNum, // Number of the current scheduled system availability manager
     459             :                                   int &AvailStatus       // System status indicator
     460             :     );
     461             : 
     462             :     void CalcHiTurnOnSysAvailMgr(EnergyPlusData &state,
     463             :                                  int const SysAvailNum, // Number of the current scheduled system availability manager
     464             :                                  int &AvailStatus       // System status indicator
     465             :     );
     466             : 
     467             :     void CalcLoTurnOffSysAvailMgr(EnergyPlusData &state,
     468             :                                   int const SysAvailNum, // Number of the current scheduled system availability manager
     469             :                                   int &AvailStatus       // System status indicator
     470             :     );
     471             : 
     472             :     void CalcLoTurnOnSysAvailMgr(EnergyPlusData &state,
     473             :                                  int const SysAvailNum, // Number of the current scheduled system availability manager
     474             :                                  int &AvailStatus       // System status indicator
     475             :     );
     476             : 
     477             :     void ManageHybridVentilation(EnergyPlusData &state);
     478             : 
     479             :     void GetHybridVentilationInputs(EnergyPlusData &state);
     480             : 
     481             :     void InitHybridVentSysAvailMgr(EnergyPlusData &state);
     482             : 
     483             :     void CalcHybridVentSysAvailMgr(EnergyPlusData &state,
     484             :                                    int const SysAvailNum,              // number of the current scheduled system availability manager
     485             :                                    Optional_int_const PriAirSysNum = _ // number of the primary air system affected by this Avail. Manager
     486             :     );
     487             : 
     488             :     bool GetHybridVentilationControlStatus(EnergyPlusData &state, int const ZoneNum); // Index of zone
     489             : 
     490             : } // namespace SystemAvailabilityManager
     491             : 
     492        1542 : struct SystemAvailabilityManagerData : BaseGlobalStruct
     493             : {
     494             :     int NumSchedSysAvailMgrs = 0;
     495             :     int NumSchedOnSysAvailMgrs = 0;
     496             :     int NumSchedOffSysAvailMgrs = 0;
     497             :     int NumNCycSysAvailMgrs = 0;
     498             :     int NumDiffTSysAvailMgrs = 0;
     499             :     int NumHiTurnOffSysAvailMgrs = 0;
     500             :     int NumHiTurnOnSysAvailMgrs = 0;
     501             :     int NumLoTurnOffSysAvailMgrs = 0;
     502             :     int NumLoTurnOnSysAvailMgrs = 0;
     503             :     int NumNVentSysAvailMgrs = 0;
     504             :     int NumAvailManagerLists = 0;
     505             :     bool GetAvailListsInput = true;
     506             :     bool GetAvailMgrInputFlag = true; // First time, input is "gotten"
     507             :     bool GetHybridInputFlag = true;   // Flag set to make sure you get input once
     508             :     int NumOptStartSysAvailMgrs = 0;
     509             : 
     510             :     bool InitSysAvailManagers_MyOneTimeFlag = true;
     511             :     bool CalcNCycSysAvailMgr_OneTimeFlag = true;
     512             :     Array1D<Real64> OptStart_AdaTempGradTrdHeat; // Heating temp gradient for previous days - used in CalcOptStartSysAvailMgr
     513             :     Array1D<Real64> OptStart_AdaTempGradTrdCool; // Cooling temp gradient for previous days - used in CalcOptStartSysAvailMgr
     514             : 
     515             :     EPVector<SystemAvailabilityManager::SysAvailManagerScheduled> SchedData;
     516             :     EPVector<SystemAvailabilityManager::SysAvailManagerScheduledOn> SchedOnData;
     517             :     EPVector<SystemAvailabilityManager::SysAvailManagerScheduledOff> SchedOffData;
     518             :     EPVector<SystemAvailabilityManager::SysAvailManagerNightCycle> NightCycleData;
     519             :     EPVector<SystemAvailabilityManager::SysAvailManagerDiffThermo> DiffThermoData;
     520             :     EPVector<SystemAvailabilityManager::SysAvailManagerHiLoTemp> HiTurnOffData;
     521             :     EPVector<SystemAvailabilityManager::SysAvailManagerHiLoTemp> HiTurnOnData;
     522             :     EPVector<SystemAvailabilityManager::SysAvailManagerHiLoTemp> LoTurnOffData;
     523             :     EPVector<SystemAvailabilityManager::SysAvailManagerHiLoTemp> LoTurnOnData;
     524             :     EPVector<SystemAvailabilityManager::SysAvailManagerNightVent> NightVentData;
     525             :     EPVector<SystemAvailabilityManager::SysAvailManagerHybridVent> HybridVentData;
     526             :     EPVector<SystemAvailabilityManager::List> ListData;
     527             :     EPVector<SystemAvailabilityManager::SysAvailManagerOptimumStart> OptimumStartData;
     528             :     EPVector<SystemAvailabilityManager::DefineASHRAEAdaptiveOptimumStartCoeffs> ASHRAEOptSCoeffCooling;
     529             :     EPVector<SystemAvailabilityManager::DefineASHRAEAdaptiveOptimumStartCoeffs> ASHRAEOptSCoeffHeating;
     530             : 
     531             :     bool BeginOfDayResetFlag = true;
     532             : 
     533             :     Array1D_bool ZoneCompNCControlType;
     534             :     bool MyOneTimeFlag = true; // One time flag
     535             :     bool MyEnvrnFlag = true;
     536             : 
     537             :     Real64 CurrentEndTime = 0.0;     // Current end time
     538             :     Real64 CurrentEndTimeLast = 0.0; // last end time
     539             :     Real64 TimeStepSysLast = 0.0;    // last system time step
     540             : 
     541           0 :     void clear_state() override
     542             :     {
     543           0 :         NumSchedSysAvailMgrs = 0;
     544           0 :         NumSchedOnSysAvailMgrs = 0;
     545           0 :         NumSchedOffSysAvailMgrs = 0;
     546           0 :         NumNCycSysAvailMgrs = 0;
     547           0 :         NumDiffTSysAvailMgrs = 0;
     548           0 :         NumHiTurnOffSysAvailMgrs = 0;
     549           0 :         NumHiTurnOnSysAvailMgrs = 0;
     550           0 :         NumLoTurnOffSysAvailMgrs = 0;
     551           0 :         NumLoTurnOnSysAvailMgrs = 0;
     552           0 :         NumNVentSysAvailMgrs = 0;
     553           0 :         NumAvailManagerLists = 0;
     554           0 :         GetAvailListsInput = true;
     555           0 :         GetAvailMgrInputFlag = true;
     556           0 :         GetHybridInputFlag = true;
     557           0 :         InitSysAvailManagers_MyOneTimeFlag = true;
     558           0 :         CalcNCycSysAvailMgr_OneTimeFlag = true;
     559           0 :         NumOptStartSysAvailMgrs = 0;
     560           0 :         SchedData.deallocate();
     561           0 :         SchedOnData.deallocate();
     562           0 :         SchedOffData.deallocate();
     563           0 :         NightCycleData.deallocate();
     564           0 :         DiffThermoData.deallocate();
     565           0 :         HiTurnOffData.deallocate();
     566           0 :         HiTurnOnData.deallocate();
     567           0 :         LoTurnOffData.deallocate();
     568           0 :         LoTurnOnData.deallocate();
     569           0 :         NightVentData.deallocate();
     570           0 :         HybridVentData.deallocate();
     571           0 :         ListData.deallocate();
     572           0 :         OptimumStartData.deallocate();
     573           0 :         ASHRAEOptSCoeffCooling.deallocate();
     574           0 :         ASHRAEOptSCoeffHeating.deallocate();
     575           0 :         BeginOfDayResetFlag = true;
     576           0 :         OptStart_AdaTempGradTrdHeat.deallocate();
     577           0 :         OptStart_AdaTempGradTrdCool.deallocate();
     578           0 :         MyOneTimeFlag = true;
     579           0 :         MyEnvrnFlag = true;
     580           0 :         CurrentEndTime = 0.0;
     581           0 :         CurrentEndTimeLast = 0.0;
     582           0 :         TimeStepSysLast = 0.0;
     583           0 :     }
     584             : };
     585             : } // namespace EnergyPlus
     586             : 
     587             : #endif

Generated by: LCOV version 1.13