LCOV - code coverage report
Current view: top level - EnergyPlus - SetPointManager.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 30 6.7 %
Date: 2024-08-24 18:31:18 Functions: 1 4 25.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2024, 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 SetPointManager_hh_INCLUDED
      49             : #define SetPointManager_hh_INCLUDED
      50             : 
      51             : #include <map>
      52             : 
      53             : // ObjexxFCL Headers
      54             : #include <ObjexxFCL/Array1D.hh>
      55             : 
      56             : // EnergyPlus Headers
      57             : #include <EnergyPlus/DataEnvironment.hh>
      58             : #include <EnergyPlus/DataGlobals.hh>
      59             : #include <EnergyPlus/DataLoopNode.hh>
      60             : #include <EnergyPlus/EnergyPlus.hh>
      61             : #include <EnergyPlus/Plant/Enums.hh>
      62             : #include <EnergyPlus/Plant/PlantLocation.hh>
      63             : 
      64             : namespace EnergyPlus {
      65             : 
      66             : // Forward declarations
      67             : struct EnergyPlusData;
      68             : 
      69             : namespace SetPointManager {
      70             : 
      71             :     enum class SupplyFlowTempStrategy
      72             :     {
      73             :         Invalid = -1,
      74             :         MaxTemp,
      75             :         MinTemp,
      76             :         Num
      77             :     };
      78             : 
      79             :     enum class ControlStrategy
      80             :     {
      81             :         Invalid = -1,
      82             :         TempFirst,
      83             :         FlowFirst,
      84             :         Num
      85             :     };
      86             : 
      87             :     enum class AirTempType
      88             :     {
      89             :         Invalid = -1,
      90             :         WetBulb,
      91             :         DryBulb,
      92             :         Num
      93             :     };
      94             : 
      95             :     enum class ReturnTempType
      96             :     {
      97             :         Invalid = -1,
      98             :         Scheduled,
      99             :         Constant,
     100             :         Setpoint,
     101             :         Num
     102             :     };
     103             : 
     104             :     enum class SPMType
     105             :     {
     106             :         Invalid = -1,
     107             :         Scheduled,
     108             :         ScheduledDual,
     109             :         OutsideAir,
     110             :         SZReheat,
     111             :         SZHeating,
     112             :         SZCooling,
     113             :         SZMinHum,
     114             :         SZMaxHum,
     115             :         MixedAir,
     116             :         OutsideAirPretreat,
     117             :         Warmest,
     118             :         Coldest,
     119             :         WarmestTempFlow,
     120             :         ReturnAirBypass,
     121             :         MZCoolingAverage,
     122             :         MZHeatingAverage,
     123             :         MZMinHumAverage,
     124             :         MZMaxHumAverage,
     125             :         MZMinHum,
     126             :         MZMaxHum,
     127             :         FollowOutsideAirTemp,
     128             :         FollowSystemNodeTemp,
     129             :         FollowGroundTemp,
     130             :         CondenserEnteringTemp,
     131             :         IdealCondenserEnteringTemp,
     132             :         SZOneStageCooling,
     133             :         SZOneStageHeating,
     134             :         ChilledWaterReturnTemp,
     135             :         HotWaterReturnTemp,
     136             :         TESScheduled,
     137             :         SystemNodeTemp,
     138             :         SystemNodeHum,
     139             :         Num
     140             :     };
     141             : 
     142             :     struct SPMBase
     143             :     {
     144             :         std::string Name;
     145             :         SPMType type = SPMType::Invalid;
     146             : 
     147             :         HVAC::CtrlVarType ctrlVar = HVAC::CtrlVarType::Invalid; // set to CtrlVarType::*
     148             : 
     149             :         std::vector<int> ctrlNodeNums; // index to control node
     150             : 
     151             :         std::string airLoopName; // name of air loop
     152             :         int airLoopNum = 0;      // index to air loop
     153             :         int refNodeNum = 0;      // index to reference node
     154             : 
     155             :         Real64 minSetTemp = 0.0; // minimum supply air setpoint temperature
     156             :         Real64 maxSetTemp = 0.0; // maximum supply air setpoint temperature
     157             : 
     158             :         Real64 minSetHum = 0.0; // minimum supply air setpoint humidity ratio [kg/kg]
     159             :         Real64 maxSetHum = 0.0; // maximum supply air setpoint humidity ratio [kg/kg]
     160             :         Real64 setPt = 0.0;     // the setpoint
     161             : 
     162           0 :         virtual ~SPMBase() = default;
     163             : 
     164             :         virtual void calculate(EnergyPlusData &state) = 0;
     165             :     };
     166             : 
     167             :     struct SPMScheduled : SPMBase // Derived type for Scheduled Setpoint Manager data
     168             :     {
     169             :         int schedNum = 0;
     170             : 
     171             :         void calculate(EnergyPlusData &state) override;
     172             :     };
     173             : 
     174             :     struct SPMScheduledDual : SPMBase // Derived type for Scheduled Dual Setpoint Manager
     175             :     {
     176             :         int schedNumHi = 0;
     177             :         int schedNumLo = 0;
     178             :         Real64 setPtHi = 0.0;
     179             :         Real64 setPtLo = 0.0;
     180             : 
     181             :         void calculate(EnergyPlusData &state) override;
     182             :     };
     183             : 
     184             :     struct SPMOutsideAir : SPMBase // Derived type for Outside Air Setpoint Manager Data
     185             :     {
     186             :         // Members
     187             :         Real64 lowSetPt1 = 0.0;            // 1st setpoint at outside low
     188             :         Real64 low1 = 0.0;                 // 1st Outside low
     189             :         Real64 highSetPt1 = 0.0;           // 1st setpoint at outside high
     190             :         Real64 high1 = 0.0;                // 1st Outside high
     191             :         int schedNum = 0;                  // Schedule index
     192             :         int invalidSchedValErrorIndex = 0; // index for recurring error when schedule is not 1 or 2
     193             :         int setPtErrorCount = 0;           // countfor recurring error when schedule is not 1 or 2
     194             :         Real64 lowSetPt2 = 0.0;            // 2nd setpoint at outside low (optional)
     195             :         Real64 low2 = 0.0;                 // 2nd Outside low (optional)
     196             :         Real64 highSetPt2 = 0.0;           // 2nd setpoint at outside high (optional)
     197             :         Real64 high2 = 0.0;                // 2nd Outside high (optional)
     198             : 
     199             :         void calculate(EnergyPlusData &state) override;
     200             :     };
     201             : 
     202             :     struct SPMSingleZoneReheat : SPMBase // Derived type for the Single Zone Reheat Setpoint Manager data
     203             :     {
     204             :         // Members
     205             :         std::string ctrlZoneName; // name of the control zone (zone with main thermostat)
     206             :         int ctrlZoneNum = 0;      // number (index into Zone array) of control zone
     207             :         int zoneNodeNum = 0;      // zone node number
     208             :         int zoneInletNodeNum = 0; // inlet node number for the SZRH air
     209             :         int mixedAirNodeNum = 0;  // mixed air node number
     210             :         int fanInNodeNum = 0;     // fan inlet node number
     211             :         int fanOutNodeNum = 0;    // fan outlet node number
     212             :         int oaInNodeNum = 0;      // outside airstream inlet node to the OA mixer
     213             :         int retNodeNum = 0;       // return node inlet to OA mixer
     214             :         int loopInNodeNum = 0;    // Primary Air System inlet node
     215             : 
     216             :         void calculate(EnergyPlusData &state) override;
     217             :     };
     218             : 
     219             :     // The one can be used for both SZ Heating and SZCooling SPMs
     220             :     struct SPMSingleZoneTemp : SPMBase
     221             :     {
     222             :         // Members
     223             :         std::string ctrlZoneName; // name of the control zone (zone with main thermostat)
     224             :         int ctrlZoneNum = 0;      // number (index into Zone array) of control zone
     225             :         int zoneNodeNum = 0;      // zone node number
     226             :         int zoneInletNodeNum = 0; // inlet node number for the supply air
     227             : 
     228             :         void calculate(EnergyPlusData &state) override;
     229             :     };
     230             : 
     231             :     // Can be used for both SZMinHum and SZMaxHum SPMs
     232             :     struct SPMSingleZoneHum : SPMBase // Derived Type for Single Zone Minimum Humidity Setpoint Manager data
     233             :     {
     234             :         // Members
     235             :         int zoneNodeNum = 0; // zone node numbers of zones being controlled
     236             :         int ctrlZoneNum = 0; // index into ZoneEquipConfig
     237             : 
     238             :         void calculate(EnergyPlusData &state) override;
     239             :     };
     240             : 
     241             :     struct SPMMixedAir : SPMBase
     242             : 
     243             :     {
     244             :         // Members
     245             :         int fanInNodeNum = 0;            // supply fan inlet node number
     246             :         int fanOutNodeNum = 0;           // Supplt fan outlet node number
     247             :         bool mySetPointCheckFlag = true; // used for mixed air SPM test for missing SP
     248             :         bool freezeCheckEnable = true;   // Enable freezing check
     249             :         int coolCoilInNodeNum = 0;       // Cooling coil inlet node number
     250             :         int coolCoilOutNodeNum = 0;      // Cooling coil outlet node number
     251             :         Real64 minCoolCoilOutTemp = 7.2; // The minimum temperature at cooling coil outlet node
     252             : 
     253             :         void calculate(EnergyPlusData &state) override;
     254             :     };
     255             : 
     256             :     struct SPMOutsideAirPretreat : SPMBase
     257             :     {
     258             :         // Members
     259             :         int mixedOutNodeNum = 0;         // mixed air outlet node number
     260             :         int oaInNodeNum = 0;             // outside air inlet node number
     261             :         int returnInNodeNum = 0;         // return air inlet node number
     262             :         bool mySetPointCheckFlag = true; // used for DOAS SPM test for missing SP
     263             : 
     264             :         void calculate(EnergyPlusData &state) override;
     265             :     };
     266             : 
     267             :     // Works for both coldest and warmest SPMs
     268             :     struct SPMTempest : SPMBase
     269             :     {
     270             :         // Members
     271             :         SupplyFlowTempStrategy strategy = SupplyFlowTempStrategy::Invalid; // supply flow and temperature set strategy
     272             : 
     273             :         void calculate(EnergyPlusData &state) override;
     274             :     };
     275             : 
     276             :     struct SPMWarmestTempFlow : SPMBase
     277             :     {
     278             :         // Members
     279             :         ControlStrategy strategy = ControlStrategy::Invalid; // supply flow and temperature set strategy
     280             :         Real64 minTurndown = 0.0;                            // minimum fractional flow rate
     281             :         Real64 turndown = 0.0;                               // fractional flow rate
     282             :         int critZoneNum = 0;
     283             :         bool simReady = false;
     284             : 
     285             :         void calculate(EnergyPlusData &state) override;
     286             :     };
     287             : 
     288             :     struct SPMReturnAirBypassFlow : SPMBase
     289             :     {
     290             :         // Members
     291             :         int schedNum = 0;     // index of the above schedule
     292             :         Real64 FlowSetPt = 0; // mass flow rate setpoint (kg/s)
     293             :         int rabMixInNodeNum = 0;
     294             :         int supMixInNodeNum = 0;
     295             :         int mixOutNodeNum = 0;
     296             :         int rabSplitOutNodeNum = 0;
     297             :         int sysOutNodeNum = 0;
     298             : 
     299             :         void calculate(EnergyPlusData &state) override;
     300             :     };
     301             : 
     302             :     struct SPMMultiZoneTemp : SPMBase // derived type for SetpointManager:Multizone:Cooling:Average data
     303             :     {
     304             :         void calculate(EnergyPlusData &state) override;
     305             :     };
     306             : 
     307             :     struct SPMMultiZoneHum : SPMBase // derived type for SetpointManager:MultiZone:MinimumHumidity:Average data
     308             :     {
     309             :         void calculate(EnergyPlusData &state) override;
     310             :     };
     311             : 
     312             :     struct SPMFollowOutsideAirTemp : SPMBase
     313             :     {
     314             :         // Members
     315             :         AirTempType refTempType = AirTempType::Invalid; // set to iRefTempType_WetBulb or iRefTempType_DryBulb
     316             :         Real64 offset = 0.0;                            // Offset temperature difference
     317             : 
     318             :         void calculate(EnergyPlusData &state) override;
     319             :     };
     320             : 
     321             :     struct SPMFollowSysNodeTemp : SPMBase
     322             :     {
     323             :         // Members
     324             :         AirTempType refTempType = AirTempType::Invalid; // set to iRefTempType_WetBulb or iRefTempType_DryBulb
     325             :         Real64 offset = 0.0;                            // Offset temperature difference
     326             : 
     327             :         void calculate(EnergyPlusData &state) override;
     328             :     };
     329             : 
     330             :     struct SPMFollowGroundTemp : SPMBase
     331             :     {
     332             :         // Members
     333             :         // Site:GroundTemperature:BuildingSurface
     334             :         // Site:GroundTemperature:Shallow
     335             :         // Site:GroundTemperature:Deep
     336             :         // Site:GroundTemperature:FCfactorMethod
     337             :         DataEnvironment::GroundTempType refTempType = DataEnvironment::GroundTempType::Invalid;
     338             :         Real64 offset = 0.0; // Offset temperature difference
     339             : 
     340             :         void calculate(EnergyPlusData &state) override;
     341             :     };
     342             : 
     343             :     struct SPMCondenserEnteringTemp : SPMBase // derived type for SetpointManager:CondenserEnteringReset data
     344             :     {
     345             :         // Members
     346             :         int condenserEnteringTempSchedNum = 0;     // default condenser entering water temperature schedule Index
     347             :         Real64 towerDesignInletAirWetBulbTemp = 0; // cooling tower design inlet air wetbulb temperature
     348             :         int minTowerDesignWetBulbCurveNum = 0;     // minimum design wetbulb temperature curve name
     349             :         int minOAWetBulbCurveNum = 0;              // minimum outside air wetbulb temperature curve name
     350             :         int optCondenserEnteringTempCurveNum = 0;  // optimized condenser entering water temperature curve name
     351             :         Real64 minLift = 0.0;                      // minimum lift
     352             :         Real64 maxCondenserEnteringTemp = 0.0;     // maximum condenser entering water temp
     353             :         PlantLocation plantPloc;                   // plant side chiller index
     354             :         PlantLocation demandPloc;
     355             :         DataPlant::PlantEquipmentType chillerType; // chiller type number
     356             : 
     357             :         void calculate(EnergyPlusData &state) override;
     358             :     };
     359             : 
     360             :     struct SPMVar
     361             :     {
     362             :         OutputProcessor::VariableType Type = OutputProcessor::VariableType::Invalid;
     363             :         int Num = 0;
     364             :     };
     365             : 
     366             :     struct SPMIdealCondenserEnteringTemp : SPMBase // derived type for SetpointManager:CondenserEnteringReset:Ideal data
     367             :     {
     368             :         // Members
     369             :         Real64 minLift = 0.0;                  // minimum lift
     370             :         Real64 maxCondenserEnteringTemp = 0.0; // maximum condenser entering water temp
     371             :         PlantLocation chillerPloc;             // plant side chiller index
     372             :         SPMVar chillerVar;
     373             :         SPMVar chilledWaterPumpVar;
     374             :         Array1D<SPMVar> towerVars;
     375             :         SPMVar condenserPumpVar;
     376             :         DataPlant::PlantEquipmentType chillerType = DataPlant::PlantEquipmentType::Invalid; // chiller type number
     377             :         Array1D<PlantLocation> towerPlocs;
     378             :         int numTowers = 0;                      // number of towers to query
     379             :         PlantLocation condenserPumpPloc;        // condenser pump number
     380             :         PlantLocation chilledWaterPumpPloc;     // chilled water pump number
     381             :         bool setupIdealCondEntSetPtVars = true; // flag for initialization of meters and such
     382             : 
     383             :         void calculate(EnergyPlusData &state) override;
     384             : 
     385             :         void SetupMeteredVarsForSetPt(EnergyPlusData &state);
     386             : 
     387             :         Real64 calculateCurrentEnergyUsage(EnergyPlusData &state);
     388             : 
     389             :         void setupSetPointAndFlags(Real64 &TotEnergy,
     390             :                                    Real64 &TotEnergyPre,
     391             :                                    Real64 &CondWaterSetPoint,
     392             :                                    Real64 &CondTempLimit,
     393             :                                    bool &RunOptCondEntTemp,
     394             :                                    bool &RunSubOptCondEntTemp,
     395             :                                    bool &RunFinalOptCondEntTemp) const;
     396             :     };
     397             : 
     398             :     struct SPMSingleZoneOneStageCooling : SPMBase // Derived type for the Single Zone One Stage Cooling Setpoint Manager data
     399             :     {
     400             :         // Members
     401             :         int ctrlZoneNum = 0;          // number (index into Zone array) of control zone
     402             :         int zoneNodeNum = 0;          // zone node number
     403             :         Real64 coolingOnSetPt = 0.0;  // minimum supply air setpoint temperature
     404             :         Real64 coolingOffSetPt = 0.0; // maximum supply air setpoint temperature
     405             : 
     406             :         void calculate(EnergyPlusData &state) override;
     407             :     };
     408             : 
     409             :     struct SPMSingleZoneOneStageHeating : SPMBase // Derived type for the Single Zone One Stage Cooling Setpoint Manager data
     410             :     {
     411             :         // Members
     412             :         int ctrlZoneNum = 0;          // number (index into Zone array) of control zone
     413             :         int zoneNodeNum = 0;          // zone node number
     414             :         Real64 heatingOnSetPt = 0.0;  // minimum supply air setpoint temperature
     415             :         Real64 heatingOffSetPt = 0.0; // maximum supply air setpoint temperature
     416             : 
     417             :         void calculate(EnergyPlusData &state) override;
     418             :     };
     419             : 
     420             :     struct SPMReturnWaterTemp : SPMBase // derived type for SetpointManager:SupplyResetForReturnTemperature:ChilledWater data
     421             :     {
     422             :         // Members
     423             :         int returnNodeNum = 0;                 // node ID for the plant supply-side return node
     424             :         int supplyNodeNum = 0;                 // node ID for the plant supply-side supply node
     425             :         int returnTempSchedNum = 0;            // the index in Schedules array for the scheduled return temperature; zero if not used
     426             :         Real64 returnTempConstantTarget = 0.0; // the constant value used as the return temperature target; used if schedule index is zero
     427             :         Real64 currentSupplySetPt = 0.0;       // the current supply setpoint temperature
     428             :         int plantLoopNum = 0;                  // the index for the plant loop for this manager, zero if not initialized
     429             :         int plantSetPtNodeNum = 0;             // the index for the node where the plant setpoint is set, need to look up after Plant is established
     430             :         ReturnTempType returnTempType = ReturnTempType::Invalid;
     431             : 
     432             :         // Calculation method
     433             :         void calculate(EnergyPlusData &state) override;
     434             :         // void calculate(EnergyPlusData &state, DataLoopNode::NodeData &returnNode, DataLoopNode::NodeData &supplyNode);
     435             :     };
     436             : 
     437             :     struct SPMTESScheduled : SPMBase // Derived type for Scheduled TES Setpoint Manager data
     438             :     {
     439             :         // Members
     440             :         int schedNum = 0;
     441             :         int schedNumCharge = 0;
     442             :         int ctrlNodeNum = 0;
     443             :         Real64 nonChargeCHWTemp = 0.0;
     444             :         Real64 chargeCHWTemp = 0.0;
     445             :         DataPlant::CtrlType compOpType = DataPlant::CtrlType::Invalid;
     446             : 
     447             :         // Calculation method
     448             :         void calculate(EnergyPlusData &state) override;
     449             :     };
     450             : 
     451             :     struct SPMSystemNode : SPMBase // Derived type for System Node Reset Setpoint Manager Data
     452             :     {
     453             :         // Members
     454             :         Real64 lowRefSetPt = 0.0;  // Setpoint at Low Reference Temperature or Humidity Ratio (i.e., Maximum Temperature/Humidity Ratio Setpoint)
     455             :         Real64 highRefSetPt = 0.0; // Setpoint at High Reference Temperature or Humidity Ratio (i.e., Maximum Temperature/Humidity Ratio Setpoint)
     456             :         Real64 lowRef = 0.0;       // Low Reference Temperature or Humidity Ratio
     457             :         Real64 highRef = 0.0;      // High Reference Temperature or Humidity Ratio
     458             : 
     459             :         void calculate(EnergyPlusData &state) override;
     460             :     };
     461             : 
     462             :     int GetSetPointManagerIndex(EnergyPlusData &state, std::string const &Name);
     463             : 
     464             :     void ManageSetPoints(EnergyPlusData &state);
     465             : 
     466             :     void GetSetPointManagerInputs(EnergyPlusData &state); // wrapper for GetInput to accomodate unit testing
     467             : 
     468             :     void GetSetPointManagerInputData(EnergyPlusData &state, bool &ErrorsFound);
     469             : 
     470             :     void VerifySetPointManagers(EnergyPlusData &state, bool &ErrorsFound); // flag to denote node conflicts in input. !unused1208
     471             : 
     472             :     void InitSetPointManagers(EnergyPlusData &state);
     473             : 
     474             :     void SimSetPointManagers(EnergyPlusData &state);
     475             : 
     476             :     void UpdateSetPointManagers(EnergyPlusData &state);
     477             : 
     478             :     void UpdateMixedAirSetPoints(EnergyPlusData &state);
     479             : 
     480             :     void UpdateOAPretreatSetPoints(EnergyPlusData &state);
     481             : 
     482             :     int GetSetPointManagerIndexByNode(EnergyPlusData &state, int NodeNum, HVAC::CtrlVarType ctrlVar, SPMType spmType, bool isRefNode);
     483             : 
     484             :     bool IsNodeOnSetPtManager(EnergyPlusData &state, int NodeNum, HVAC::CtrlVarType ctrlVar);
     485             : 
     486             :     bool NodeHasSPMCtrlVarType(EnergyPlusData &state, int NodeNum, HVAC::CtrlVarType ctrlVar);
     487             : 
     488             :     void ResetHumidityRatioCtrlVarType(EnergyPlusData &state, int NodeNum);
     489             : 
     490             :     void CheckIfAnyIdealCondEntSetPoint(EnergyPlusData &state);
     491             : 
     492             :     HVAC::CtrlVarType GetHumidityRatioVariableType(EnergyPlusData &state, int CtrlNodeNum);
     493             : 
     494             :     void SetUpNewScheduledTESSetPtMgr(EnergyPlusData &state,
     495             :                                       int SchedPtr,
     496             :                                       int SchedPtrCharge,
     497             :                                       Real64 NonChargeCHWTemp,
     498             :                                       Real64 ChargeCHWTemp,
     499             :                                       DataPlant::CtrlType CompOpType,
     500             :                                       int ControlNodeNum);
     501             : 
     502             :     bool GetCoilFreezingCheckFlag(EnergyPlusData &state, int MixedAirSPMNum);
     503             : 
     504             :     int GetMixedAirNumWithCoilFreezingCheck(EnergyPlusData &state, int MixedAirNode);
     505             : 
     506             :     Real64 interpSetPoint(Real64 LowVal, Real64 HighVal, Real64 RefVal, Real64 SetptAtLowVal, Real64 SetptAtHighVal);
     507             : } // namespace SetPointManager
     508             : 
     509             : struct SetPointManagerData : BaseGlobalStruct
     510             : {
     511             :     bool ManagerOn = false;
     512             :     bool GetInputFlag = true; // First time, input is "gotten"
     513             : 
     514             :     bool InitSetPointManagersOneTimeFlag = true;
     515             :     bool InitSetPointManagersOneTimeFlag2 = true;
     516             :     // This will cause a warning to be issued if no "surface" ground temperature object was input.
     517             : 
     518             :     std::array<bool, (int)DataEnvironment::GroundTempType::Num> NoGroundTempObjWarning = {true, true, true, true};
     519             :     bool InitSetPointManagersMyEnvrnFlag = true; // flag for init once at start of environment
     520             : 
     521             :     // Object Data
     522             :     Array1D<SetPointManager::SPMBase *> spms;
     523             :     std::map<std::string, int> spmMap;
     524             : 
     525             :     // IdealCondenserEnteringTemp::calculate() state variables
     526             :     bool ICET_RunSubOptCondEntTemp = false;
     527             :     bool ICET_RunFinalOptCondEntTemp = false;
     528             :     Real64 ICET_CondenserWaterSetPt = 0; // Condenser entering water temperature setpoint this timestep, C
     529             :     Real64 ICET_TotEnergyPre = 0;        // Total energy consumptions at the previous time step
     530             : 
     531             :     // Condenser Entering Temp::calculate() state variables
     532             :     Real64 CET_ActualLoadSum = 0.0;
     533             :     Real64 CET_DesignLoadSum = 0.0;
     534             :     Real64 CET_WeightedActualLoadSum = 0.0;
     535             :     Real64 CET_WeightedDesignLoadSum = 0.0;
     536             :     Real64 CET_WeightedLoadRatio = 0.0;
     537             :     Real64 CET_DesignMinCondenserSetPt = 0.0;
     538             :     Real64 CET_DesignEnteringCondenserTemp = 0.0;
     539             :     Real64 CET_DesignMinWetBulbTemp = 0.0;
     540             :     Real64 CET_MinActualWetBulbTemp = 0.0;
     541             :     Real64 CET_OptCondenserEnteringTemp = 0.0;
     542             :     Real64 CET_CurMinLift = 0.0;
     543             : 
     544         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     545             :     {
     546         796 :     }
     547             : 
     548           0 :     void clear_state() override
     549             :     {
     550           0 :         ManagerOn = false;
     551           0 :         GetInputFlag = true; // First time, input is "gotten"
     552             :         // Object Data
     553           0 :         InitSetPointManagersOneTimeFlag = true;
     554           0 :         InitSetPointManagersOneTimeFlag2 = true;
     555             : 
     556           0 :         for (int iSPM = 1; iSPM <= (int)spms.size(); ++iSPM) {
     557           0 :             delete spms(iSPM);
     558             :         }
     559           0 :         spms.deallocate();
     560           0 :         spmMap.clear();
     561             : 
     562           0 :         NoGroundTempObjWarning = {true, true, true, true};
     563           0 :         InitSetPointManagersMyEnvrnFlag = true;
     564             : 
     565           0 :         ICET_RunSubOptCondEntTemp = false;
     566           0 :         ICET_RunFinalOptCondEntTemp = false;
     567           0 :         ICET_CondenserWaterSetPt = 0;
     568           0 :         ICET_TotEnergyPre = 0;
     569             : 
     570           0 :         CET_ActualLoadSum = 0.0;
     571           0 :         CET_DesignLoadSum = 0.0;
     572           0 :         CET_WeightedActualLoadSum = 0.0;
     573           0 :         CET_WeightedDesignLoadSum = 0.0;
     574           0 :         CET_WeightedLoadRatio = 0.0;
     575           0 :         CET_DesignMinCondenserSetPt = 0.0;
     576           0 :         CET_DesignEnteringCondenserTemp = 0.0;
     577           0 :         CET_DesignMinWetBulbTemp = 0.0;
     578           0 :         CET_MinActualWetBulbTemp = 0.0;
     579           0 :         CET_OptCondenserEnteringTemp = 0.0;
     580           0 :         CET_CurMinLift = 0.0;
     581           0 :     }
     582             : };
     583             : 
     584             : } // namespace EnergyPlus
     585             : 
     586             : #endif

Generated by: LCOV version 1.14