LCOV - code coverage report
Current view: top level - EnergyPlus - Fans.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 8 19 42.1 %
Date: 2024-08-23 23:50:59 Functions: 3 8 37.5 %

          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 Fans_hh_INCLUDED
      49             : #define Fans_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/DataHVACGlobals.hh>
      59             : #include <EnergyPlus/EnergyPlus.hh>
      60             : 
      61             : namespace EnergyPlus {
      62             : 
      63             : // Forward declarations
      64             : struct EnergyPlusData;
      65             : 
      66             : namespace Fans {
      67             : 
      68             :     // Fan Minimum Flow Fraction Input Method
      69             :     enum class MinFlowFracMethod
      70             :     {
      71             :         Invalid = -1,
      72             :         MinFrac,
      73             :         FixedMin,
      74             :         Num
      75             :     };
      76             : 
      77             :     enum class AvailManagerMode
      78             :     {
      79             :         Invalid = -1,
      80             :         Coupled,
      81             :         Decoupled,
      82             :         Num
      83             :     };
      84             : 
      85             :     static constexpr std::array<std::string_view, (int)AvailManagerMode::Num> availManagerModeNamesUC = {"COUPLED", "DECOUPLED"};
      86             : 
      87             :     struct FanBase
      88             :     {
      89        2214 :         FanBase()
      90        2214 :         {
      91        2214 :         }
      92             : 
      93           0 :         virtual ~FanBase() = default;
      94             : 
      95             :         virtual void set_size(EnergyPlusData &state) = 0;
      96             : 
      97             :         virtual void init(EnergyPlusData &state) = 0;
      98             :         virtual void simulate(EnergyPlusData &state,
      99             :                               bool const FirstHVACIteration,
     100             :                               ObjexxFCL::Optional<Real64 const> speedRatio = _,       // Flow fraction in operating mode 1
     101             :                               ObjexxFCL::Optional<Real64 const> pressureRise = _,     // Pressure difference to use for DeltaPress
     102             :                               ObjexxFCL::Optional<Real64 const> flowFraction = _,     // Flow fraction in operating mode 1
     103             :                               ObjexxFCL::Optional<Real64 const> massFlowRate1 = _,    // Mass flow rate in operating mode 1 [kg/s]
     104             :                               ObjexxFCL::Optional<Real64 const> runTimeFraction1 = _, // Run time fraction in operating mode 1
     105             :                               ObjexxFCL::Optional<Real64 const> massFlowRate2 = _,    // Mass flow rate in operating mode 2 [kg/s]
     106             :                               ObjexxFCL::Optional<Real64 const> runTimeFraction2 = _, // Run time fraction in operating mode 2
     107             :                               ObjexxFCL::Optional<Real64 const> pressureRise2 = _     // Pressure difference to use for operating mode 2
     108             :         );
     109             : 
     110             :         virtual void update(EnergyPlusData &state) = 0;
     111             : 
     112             :         virtual void report(EnergyPlusData &state) = 0;
     113             : 
     114             :         virtual Real64 getDesignHeatGain(EnergyPlusData &state, Real64 const FanVolFlow) = 0;
     115             : 
     116             :         virtual void getInputsForDesignHeatGain(EnergyPlusData &state,
     117             :                                                 Real64 &deltaP,
     118             :                                                 Real64 &motEff,
     119             :                                                 Real64 &totEff,
     120             :                                                 Real64 &motInAirFrac,
     121             :                                                 Real64 &fanShaftPow,
     122             :                                                 Real64 &motInPower,
     123             :                                                 bool &fanCompModel) = 0;
     124             :         // Members
     125             :         std::string Name;                            // Name of the fan
     126             :         HVAC::FanType type = HVAC::FanType::Invalid; // DataHVACGlobals fan type
     127             : 
     128             :         bool envrnFlag = true;  // initialize to true
     129             :         bool sizingFlag = true; // initialize to true, set to false after sizing routine
     130             : 
     131             :         std::string endUseSubcategoryName;
     132             : 
     133             :         int availSchedNum = 0; // Pointer to the availability schedule
     134             :         int inletNodeNum = 0;
     135             :         int outletNodeNum = 0;
     136             :         int airLoopNum = 0;
     137             :         bool airPathFlag = false; // Yes, this fan is a part of airpath
     138             :         bool isAFNFan = false;    // Is fan part of and AirFlowNetwork distribution system
     139             : 
     140             :         Real64 maxAirFlowRate = 0.0; // Max Specified Volume Flow Rate of Fan [m3/sec]
     141             :         Real64 minAirFlowRate = 0.0; // Max Specified Volume Flow Rate of Fan [m3/sec]
     142             :         bool maxAirFlowRateIsAutosized = false;
     143             : 
     144             :         Real64 deltaPress = 0.0; // Delta Pressure Across the Fan [N/m2]
     145             :         Real64 deltaTemp = 0.0;  // Temp Rise across the Fan [C]
     146             : 
     147             :         Real64 totalEff = 0.0; // Fan total system efficiency (fan*belt*motor*VFD)
     148             : 
     149             :         Real64 motorEff = 0.0;       // Fan motor efficiency
     150             :         Real64 motorInAirFrac = 0.0; // Fraction of motor heat entering air stream
     151             : 
     152             :         // report variables
     153             :         Real64 totalPower = 0.0;  // Power of the Fan being Simulated [W]
     154             :         Real64 totalEnergy = 0.0; // Fan energy in [J]
     155             :                                   //    Real64 fanRuntimeFraction; // Fraction of the timestep that the fan operates
     156             : 
     157             :         Real64 powerLossToAir = 0.0; // fan heat gain into process air [W]
     158             : 
     159             :         Real64 inletAirMassFlowRate = 0.0; // MassFlow through the Fan being Simulated [kg/Sec]
     160             :         Real64 outletAirMassFlowRate = 0.0;
     161             : 
     162             :         Real64 maxAirMassFlowRate = 0.0; // Max flow rate of fan in kg/sec
     163             :                                          //    Real64 m_minAirMassFlowRate; // Min flow rate of fan in kg/sec
     164             :                                          //    int fanMinAirFracMethod; // parameter for what method is used for min flow fraction
     165             :                                          //    Real64 fanFixedMin; // Absolute minimum fan air flow [m3/s]
     166             :         Real64 minAirMassFlowRate = 0.0; // Min flow rate of fan in kg/sec
     167             : 
     168             :         // Mass Flow Rate Control Variables
     169             :         Real64 massFlowRateMaxAvail = 0.0;
     170             :         Real64 massFlowRateMinAvail = 0.0;
     171             :         Real64 rhoAirStdInit = 0.0;
     172             : 
     173             :         Real64 inletAirTemp = 0.0;
     174             :         Real64 outletAirTemp = 0.0;
     175             :         Real64 inletAirHumRat = 0.0;
     176             :         Real64 outletAirHumRat = 0.0;
     177             :         Real64 inletAirEnthalpy = 0.0;
     178             :         Real64 outletAirEnthalpy = 0.0;
     179             : 
     180             :         // Faults
     181             :         bool faultyFilterFlag = false; // Indicate whether there is a fouling air filter corresponding to the fan
     182             :         int faultyFilterIndex = 0;     // Index of the fouling air filter corresponding to the fan
     183             : 
     184             :         // EMS
     185             :         bool EMSMaxAirFlowRateOverrideOn = false; // if true, EMS wants to override fan size for Max Volume Flow Rate
     186             :         Real64 EMSMaxAirFlowRateValue = 0.0;      // EMS value to use for override of  Max Volume Flow Rate
     187             :         bool EMSMaxMassFlowOverrideOn = false;    // if true, then EMS is calling to override mass flow
     188             :         Real64 EMSAirMassFlowValue = 0.0;         // value EMS is directing to use [kg/s]
     189             :         bool EMSPressureOverrideOn = false;       // if true, then EMS is calling to override
     190             :         Real64 EMSPressureValue = 0.0;            // EMS value for Delta Pressure Across the Fan [Pa]
     191             :         bool EMSTotalEffOverrideOn = false;       // if true, then EMS is calling to override
     192             :         Real64 EMSTotalEffValue = 0.0;            // EMS value for total efficiency of the Fan, fraction on 0..1
     193             : 
     194             :         std::string sizingPrefix;
     195             :     };
     196             : 
     197             :     enum class VFDEffType
     198             :     {
     199             :         Invalid = -1,
     200             :         Speed,
     201             :         Power,
     202             :         Num
     203             :     };
     204             : 
     205             :     static constexpr std::array<std::string_view, (int)VFDEffType::Num> vfdEffTypeNamesUC = {"SPEED", "POWER"};
     206             : 
     207             :     struct FanComponent : public FanBase
     208             :     {
     209             :         void set_size(EnergyPlusData &state);
     210             : 
     211             :         void init(EnergyPlusData &state);
     212             : 
     213             :         Real64 getDesignHeatGain(EnergyPlusData &state, Real64 const FanVolFlow);
     214             : 
     215             :         void getInputsForDesignHeatGain(EnergyPlusData &state,
     216             :                                         Real64 &deltaP,
     217             :                                         Real64 &motEff,
     218             :                                         Real64 &totEff,
     219             :                                         Real64 &motInAirFrac,
     220             :                                         Real64 &fanShaftPow,
     221             :                                         Real64 &motInPower,
     222             :                                         bool &fanCompModel);
     223             : 
     224             :         void update(EnergyPlusData &state);
     225             : 
     226             :         void report(EnergyPlusData &state);
     227             : 
     228             :         void simulateConstant(EnergyPlusData &state);
     229             : 
     230             :         void simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional<Real64 const> PressureRise = _);
     231             : 
     232             :         void simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional<Real64 const> SpeedRatio = _);
     233             : 
     234             :         void simulateZoneExhaust(EnergyPlusData &state);
     235             : 
     236             :         void simulateComponentModel(EnergyPlusData &state);
     237             : 
     238             :         Real64 runtimeFrac = 0.0;
     239             : 
     240             :         MinFlowFracMethod minAirFracMethod = MinFlowFracMethod::MinFrac; // parameter for what method is used for min flow fraction
     241             : 
     242             :         Real64 minFrac = 0.0;                                  // Minimum fan air flow fraction
     243             :         Real64 fixedMin = 0.0;                                 // Absolute minimum fan air flow [m3/s]
     244             :         std::array<Real64, 5> coeffs{0.0, 0.0, 0.0, 0.0, 0.0}; // Fan Part Load Coefficients to match fan type
     245             :         // Mass Flow Rate Control Variables
     246             : 
     247             :         int nightVentPerfNum = 0;
     248             :         int powerRatioAtSpeedRatioCurveNum = 0;
     249             :         int effRatioCurveNum = 0;
     250             :         bool oneTimePowerRatioCheck = true;          // one time flag used for error message
     251             :         bool oneTimeEffRatioCheck = true;            // one time flag used for error message
     252             :         Real64 wheelDia = 0.0;                       // Fan wheel outer diameter [m]
     253             :         Real64 outletArea = 0.0;                     // Fan outlet area [m2]
     254             :         Real64 maxEff = 0.0;                         // Fan maximum static efficiency [-]
     255             :         Real64 eulerMaxEff = 0.0;                    // Euler number at fan maximum static efficiency [-]
     256             :         Real64 maxDimFlow = 0.0;                     // Fan maximum dimensionless airflow [-]
     257             :         Real64 shaftPowerMax = 0.0;                  // Fan shaft maximum input power [W]
     258             :         Real64 sizingFactor = 0.0;                   // Fan sizing factor [-]
     259             :         Real64 pulleyDiaRatio = 0.0;                 // Motor/fan pulley diameter ratio [-]
     260             :         Real64 beltMaxTorque = 0.0;                  // Belt maximum torque [N-m]
     261             :         Real64 beltSizingFactor = 0.0;               // Belt sizing factor [-]
     262             :         Real64 beltTorqueTrans = 0.0;                // Belt fractional torque transition Region 1-2 [-]
     263             :         Real64 motorMaxSpeed = 0.0;                  // Motor maximum speed [rpm]
     264             :         Real64 motorMaxOutPower = 0.0;               // Motor maximum output power [W]
     265             :         Real64 motorSizingFactor = 0.0;              // Motor sizing factor [-]
     266             :         VFDEffType vfdEffType = VFDEffType::Invalid; // VFD efficiency type [Speed or Power]
     267             :         Real64 vfdMaxOutPower = 0.0;                 // VFD maximum output power [W]
     268             :         Real64 vfdSizingFactor = 0.0;                // VFD sizing factor [-]
     269             :         int pressRiseCurveNum = 0;                   // Fan pressure rise curve index
     270             :         int pressResetCurveNum = 0;                  // Duct static pressure reset curve index
     271             :         int plTotalEffNormCurveNum = 0;              // Fan part-load efficiency (normal) curve index
     272             :         int plTotalEffStallCurveNum = 0;             // Fan part-load efficiency (stall) curve index
     273             :         int dimFlowNormCurveNum = 0;                 // Fan dimensionless airflow (normal) curve index
     274             :         int dimFlowStallCurveNum = 0;                // Fan dimensionless airflow (stall) curve index
     275             :         int beltMaxEffCurveNum = 0;                  // Belt maximum efficiency curve index
     276             :         int plBeltEffReg1CurveNum = 0;               // Belt part-load efficiency (Region 1) curve index
     277             :         int plBeltEffReg2CurveNum = 0;               // Belt part-load efficiency (Region 2) curve index
     278             :         int plBeltEffReg3CurveNum = 0;               // Belt part-load efficiency (Region 3) curve index
     279             :         int motorMaxEffCurveNum = 0;                 // Motor maximum efficiency curve index
     280             :         int plMotorEffCurveNum = 0;                  // Motor part-load efficiency curve index
     281             :         int vfdEffCurveNum = 0;                      // VFD efficiency curve index
     282             :         Real64 deltaPressTot = 0.0;                  // Total pressure rise across fan [N/m2]
     283             :         Real64 airPower = 0.0;                       // Air power for fan being Simulated [W]
     284             :         Real64 fanSpeed = 0.0;                       // Fan shaft rotational speed [rpm]
     285             :         Real64 fanTorque = 0.0;                      // Fan shaft torque [N-m]
     286             :         Real64 wheelEff = 0.0;                       // Fan efficiency (mechanical)
     287             :         Real64 shaftPower = 0.0;                     // Shaft input power for fan being Simulated [W]
     288             :         Real64 beltMaxEff = 0.0;                     // Belt maximum efficiency (mechanical)
     289             :         Real64 beltEff = 0.0;                        // Belt efficiency (mechanical)
     290             :         Real64 beltInputPower = 0.0;                 // Belt input power for fan being Simulated [W]
     291             :         Real64 motorMaxEff = 0.0;                    // Motor maximum efficiency (electrical)
     292             :         Real64 motorInputPower = 0.0;                // Motor input power for fan being Simulated [W]
     293             :         Real64 vfdEff = 0.0;                         // VFD efficiency (electrical)
     294             :         Real64 vfdInputPower = 0.0;                  // VFD input power for fan being Simulated [W]
     295             :         // zone exhaust fan
     296             :         int flowFracSchedNum = 0;                                      // schedule index flow rate modifier schedule
     297             :         AvailManagerMode availManagerMode = AvailManagerMode::Invalid; // mode for how exhaust fan should react to availability managers
     298             :         int minTempLimitSchedNum = 0;                                  // schedule index minimum temperature limit
     299             :         int balancedFractSchedNum = 0;                                 // schedule index portion recirculated
     300             :         Real64 unbalancedOutletMassFlowRate = 0.0;
     301             :         Real64 balancedOutletMassFlowRate = 0.0;
     302             :         Real64 designPointFEI = 0.0; // Fan Energy Index for the fan at the design operating point
     303             :     };
     304             : 
     305             :     struct NightVentPerfData
     306             :     {
     307             :         // Members
     308             :         std::string FanName;             // Name of the fan that will use this data
     309             :         Real64 FanEff = 0.0;             // Fan total efficiency; motor and mechanical
     310             :         Real64 DeltaPress = 0.0;         // Delta Pressure Across the Fan [N/m2]
     311             :         Real64 MaxAirFlowRate = 0.0;     // Max Specified Volume Flow Rate of Fan [m3/s]
     312             :         Real64 MaxAirMassFlowRate = 0.0; // Max flow rate of fan in kg/sec
     313             :         Real64 MotEff = 0.0;             // Fan motor efficiency
     314             :         Real64 MotInAirFrac = 0.0;       // Fraction of motor heat entering air stream
     315             :     };
     316             : 
     317             :     void GetFanInput(EnergyPlusData &state);
     318             : 
     319             :     int GetFanIndex(EnergyPlusData &state, std::string const &FanName);
     320             : 
     321             :     Real64 CalFaultyFanAirFlowReduction(EnergyPlusData &state,
     322             :                                         std::string const &FanName,    // Name of the Fan
     323             :                                         Real64 FanDesignAirFlowRate,   // Fan Design Volume Flow Rate [m3/s]
     324             :                                         Real64 FanDesignDeltaPress,    // Fan Design Delta Pressure [Pa]
     325             :                                         Real64 FanFaultyDeltaPressInc, // Increase of Fan Delta Pressure in the Faulty Case [Pa]
     326             :                                         int FanCurvePtr                // Fan Curve Pointer
     327             :     );
     328             : 
     329             :     enum class PowerSizing
     330             :     {
     331             :         Invalid = -1,
     332             :         PerFlow,
     333             :         PerFlowPerPressure,
     334             :         TotalEfficiencyAndPressure,
     335             :         Num
     336             :     };
     337             : 
     338             :     static constexpr std::array<std::string_view, (int)PowerSizing::Num> powerSizingNamesUC = {
     339             :         "POWERPERFLOW", "POWERPERFLOWPERPRESSURE", "TOTALEFFICIENCYANDPRESSURE"};
     340             : 
     341             :     enum class HeatLossDest
     342             :     {
     343             :         Invalid = -1,
     344             :         Zone,
     345             :         Outside,
     346             :         Num
     347             :     };
     348             : 
     349             :     enum class SpeedControl : int
     350             :     {
     351             :         // TODO: enum check
     352             :         Invalid = -1,
     353             :         Discrete,
     354             :         Continuous,
     355             :         Num
     356             :     };
     357             : 
     358             :     static constexpr std::array<std::string_view, (int)SpeedControl::Num> speedControlNamesUC = {"DISCRETE", "CONTINUOUS"};
     359             : 
     360             :     class FanSystem : public FanBase
     361             :     {
     362             :     public: // Methods
     363         229 :         FanSystem()
     364         229 :         {
     365         229 :         }
     366             :         // Destructor
     367           0 :         ~FanSystem()
     368           0 :         {
     369           0 :         }
     370             : 
     371             :         // Copy Constructor
     372             :         FanSystem(FanSystem const &) = default;
     373             : 
     374             :         Real64 getDesignTemperatureRise(EnergyPlusData &state) const;
     375             : 
     376             :         Real64 getDesignHeatGain(EnergyPlusData &state, Real64 const FanVolFlow);
     377             : 
     378             :         void getInputsForDesignHeatGain(EnergyPlusData &state,
     379             :                                         Real64 &deltaP,
     380             :                                         Real64 &motEff,
     381             :                                         Real64 &totEff,
     382             :                                         Real64 &motInAirFrac,
     383             :                                         Real64 &fanShaftPow,
     384             :                                         Real64 &motInPower,
     385             :                                         bool &fanCompModel);
     386             : 
     387             :         SpeedControl speedControl = SpeedControl::Invalid; // Discrete or Continuous speed control method
     388             :         Real64 designElecPower = 0.0;                      // design electric power consumption [W]
     389             :         int powerModFuncFlowFracCurveNum = 0;              // pointer to performance curve or table
     390             :         int numSpeeds = 0;                                 // input for how many speed levels for discrete fan
     391             :         std::vector<Real64> massFlowAtSpeed;
     392             :         std::vector<Real64> flowFracAtSpeed; // array of flow fractions for speed levels
     393             : 
     394             :         // Mass Flow Rate Control Variables
     395             :         bool isSecondaryDriver = false; // true if this fan is used to augment flow and may pass air when off.
     396             : 
     397             :         // FEI
     398             :         static Real64 report_fei(EnergyPlusData &state, Real64 const designFlowRate, Real64 const designElecPower, Real64 const designDeltaPress);
     399             : 
     400             :         void init(EnergyPlusData &state);
     401             : 
     402             :         void set_size(EnergyPlusData &state);
     403             : 
     404             :         void
     405             :         calcSimpleSystemFan(EnergyPlusData &state,
     406             :                             ObjexxFCL::Optional<Real64 const> flowFraction, // Flow fraction for entire timestep (not used if flow ratios are present)
     407             :                             ObjexxFCL::Optional<Real64 const> pressureRise, // Pressure difference to use for DeltaPress
     408             :                             ObjexxFCL::Optional<Real64 const> flowRatio1,   // Flow ratio in operating mode 1
     409             :                             ObjexxFCL::Optional<Real64 const> runTimeFrac1, // Run time fraction in operating mode 1
     410             :                             ObjexxFCL::Optional<Real64 const> flowRatio2,   // Flow ratio in operating mode 2
     411             :                             ObjexxFCL::Optional<Real64 const> runTimeFrac2, // Run time fraction in operating mode 2
     412             :                             ObjexxFCL::Optional<Real64 const> pressureRise2 // Pressure difference to use for operating mode 2
     413             :         );
     414             : 
     415             :         void update(EnergyPlusData &state);
     416             : 
     417             :         void report(EnergyPlusData &state);
     418             : 
     419             :     public:
     420             :         // data
     421             :         Real64 minPowerFlowFrac = 0.0; // Minimum fan air flow fraction for power calculation
     422             :         bool designElecPowerWasAutosized = false;
     423             :         PowerSizing powerSizingMethod = PowerSizing::Invalid; // sizing method for design electric power, three options
     424             :         Real64 elecPowerPerFlowRate = 0.0;                    // scaling factor for PowerPerFlow method
     425             :         Real64 elecPowerPerFlowRatePerPressure = 0.0;         // scaling factor for PowerPerFlowPerPressure
     426             :         Real64 nightVentPressureDelta = 0.0;                  // fan pressure rise during night ventilation mode
     427             :         Real64 nightVentFlowFraction = 0.0;                   // fan's flow fraction during night ventilation mode, not used
     428             :         int zoneNum = 0;                                      // zone index for motor heat losses as internal gains
     429             :         Real64 zoneRadFract = 0.0;                            // thermal radiation split for motor losses
     430             :         HeatLossDest heatLossDest = HeatLossDest::Invalid;    // enum for where motor loss go
     431             :         Real64 qdotConvZone = 0.0;                            // fan power lost to surrounding zone by convection to air (W)
     432             :         Real64 qdotRadZone = 0.0;                             // fan power lost to surrounding zone by radiation to zone surfaces(W)
     433             :         std::vector<Real64> powerFracAtSpeed;                 // array of power fractions for speed levels
     434             :         std::vector<bool> powerFracInputAtSpeed;
     435             :         // calculation variables
     436             :         std::vector<Real64> totalEffAtSpeed;
     437             :         std::vector<Real64> runtimeFracAtSpeed;
     438             : 
     439             :         Real64 designPointFEI = 0.0; // Fan Energy Index for the fan at the design operating point
     440             : 
     441             :     }; // class FanSystem
     442             : 
     443             : } // namespace Fans
     444             : 
     445             : struct FansData : BaseGlobalStruct
     446             : {
     447             :     int NumNightVentPerf = 0;    // number of FAN:NIGHT VENT PERFORMANCE objects found in the input
     448             :     bool GetFanInputFlag = true; // Flag set to make sure you get input once
     449             :     bool MyOneTimeFlag = true;
     450             :     bool ZoneEquipmentListChecked = false;
     451             : 
     452             :     Array1D<Fans::NightVentPerfData> NightVentPerf;
     453             :     int ErrCount = 0;
     454             : 
     455             :     Array1D<Fans::FanBase *> fans;
     456             :     std::map<std::string, int> fanMap;
     457             : 
     458         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     459             :     {
     460         796 :     }
     461             : 
     462           0 :     void clear_state() override
     463             :     {
     464           0 :         for (int i = 1; i <= (int)fans.size(); ++i)
     465           0 :             delete fans(i);
     466             : 
     467           0 :         fans.clear();
     468           0 :         fanMap.clear();
     469             : 
     470           0 :         new (this) FansData();
     471           0 :     }
     472             : };
     473             : 
     474             : } // namespace EnergyPlus
     475             : 
     476             : #endif

Generated by: LCOV version 1.14