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 HVACFan_hh_INCLUDED
49 : #define HVACFan_hh_INCLUDED
50 :
51 : // C++ Headers
52 : #include <memory>
53 : #include <string>
54 : #include <vector>
55 :
56 : #include <ObjexxFCL/Optional.hh>
57 :
58 : // EnergyPlus Headers
59 : #include <EnergyPlus/Data/BaseData.hh>
60 : #include <EnergyPlus/DataGlobals.hh>
61 : #include <EnergyPlus/DataHVACGlobals.hh>
62 : #include <EnergyPlus/EnergyPlus.hh>
63 :
64 : namespace EnergyPlus {
65 :
66 : // Forward declarations
67 : struct EnergyPlusData;
68 :
69 : namespace HVACFan {
70 :
71 : int getFanObjectVectorIndex(EnergyPlusData &state, std::string const &objectName, bool const CheckFlag = true);
72 :
73 : bool checkIfFanNameIsAFanSystem(EnergyPlusData &state, std::string const &objectName);
74 :
75 : class FanSystem
76 : {
77 :
78 : public: // Methods
79 : // Constructor
80 : FanSystem(EnergyPlusData &state, std::string const &objectName);
81 :
82 : // Destructor
83 171 : ~FanSystem()
84 171 : {
85 171 : }
86 :
87 : // Copy Constructor
88 : FanSystem(FanSystem const &) = default;
89 :
90 : void simulate(EnergyPlusData &state,
91 : // bool const firstHVACIteration,
92 : Optional<Real64 const> flowFraction = _, // Flow fraction in operating mode 1
93 : Optional_bool_const zoneCompTurnFansOn = _, // Turn fans ON signal from ZoneHVAC component
94 : Optional_bool_const zoneCompTurnFansOff = _, // Turn Fans OFF signal from ZoneHVAC component
95 : Optional<Real64 const> pressureRise = _, // Pressure difference to use for DeltaPress
96 : Optional<Real64 const> massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s]
97 : Optional<Real64 const> runTimeFraction1 = _, // Run time fraction in operating mode 1
98 : Optional<Real64 const> massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s]
99 : Optional<Real64 const> runTimeFraction2 = _, // Run time fraction in operating mode 2
100 : Optional<Real64 const> pressureRise2 = _ // Pressure difference to use for operating mode 2
101 : );
102 :
103 : Real64 fanPower() const;
104 :
105 : Real64 powerLossToAir() const;
106 :
107 : Real64 maxAirMassFlowRate() const;
108 :
109 : Real64 getFanDesignTemperatureRise(EnergyPlusData &state) const;
110 :
111 : Real64 getFanDesignHeatGain(EnergyPlusData &state, Real64 const FanVolFlow);
112 :
113 : void FanInputsForDesignHeatGain(EnergyPlusData &state, Real64 &deltaP, Real64 &motEff, Real64 &totEff, Real64 &motInAirFrac);
114 :
115 : // void
116 : // fanIsSecondaryDriver();
117 :
118 : // void
119 : // setFaultyFilterOn();
120 :
121 : // void
122 : // setFaultyFilterIndex( int const faultyAirFilterIndex );
123 :
124 : enum class SpeedControlMethod : int
125 : {
126 : // TODO: enum check
127 : Invalid = -1,
128 : NotSet = 0,
129 : Discrete,
130 : Continuous,
131 : Num
132 : };
133 :
134 : // data
135 : std::string name; // user identifier
136 : int availSchedIndex; // Pointer to the availability schedule
137 : int inletNodeNum; // system air node at fan inlet
138 : int outletNodeNum; // system air node at fan outlet
139 : Real64 designAirVolFlowRate; // Max Specified Volume Flow Rate of Fan [m3/sec]
140 : SpeedControlMethod speedControl; // Discrete or Continuous speed control method
141 : Real64 deltaPress; // Delta Pressure Across the Fan [N/m2]
142 : Real64 designElecPower; // design electric power consumption [W]
143 : int powerModFuncFlowFractionCurveIndex; // pointer to performance curve or table
144 : int AirLoopNum; // AirLoop number
145 : bool AirPathFlag; // Yes, this fan is a part of airpath
146 :
147 : // Mass Flow Rate Control Variables
148 : bool fanIsSecondaryDriver; // true if this fan is used to augment flow and may pass air when off.
149 :
150 : // FEI
151 : static Real64 report_fei(
152 : EnergyPlusData &state, Real64 const designFlowRate, Real64 const designElecPower, Real64 const designDeltaPress, Real64 inletRhoAir);
153 :
154 : private: // methods
155 : void init(EnergyPlusData &state);
156 :
157 : void set_size(EnergyPlusData &state);
158 :
159 : void calcSimpleSystemFan(EnergyPlusData &state,
160 : Optional<Real64 const> flowFraction, // Flow fraction for entire timestep (not used if flow ratios are present)
161 : Optional<Real64 const> pressureRise, // Pressure difference to use for DeltaPress
162 : Optional<Real64 const> flowRatio1, // Flow ratio in operating mode 1
163 : Optional<Real64 const> runTimeFrac1, // Run time fraction in operating mode 1
164 : Optional<Real64 const> flowRatio2, // Flow ratio in operating mode 2
165 : Optional<Real64 const> runTimeFrac2, // Run time fraction in operating mode 2
166 : Optional<Real64 const> pressureRise2 // Pressure difference to use for operating mode 2
167 : );
168 :
169 : void update(EnergyPlusData &state) const;
170 :
171 : void report(EnergyPlusData &state);
172 :
173 : // data
174 :
175 : enum class PowerSizingMethod
176 : {
177 : Invalid = -1,
178 : PowerPerFlow,
179 : PowerPerFlowPerPressure,
180 : TotalEfficiencyAndPressure,
181 : Num
182 : };
183 : enum class ThermalLossDestination
184 : {
185 : Invalid = -1,
186 : ZoneGains,
187 : LostToOutside,
188 : Num
189 : };
190 :
191 : std::string m_fanType; // Type of Fan ie. Simple, Vane axial, Centrifugal, etc.
192 : int m_fanType_Num; // DataHVACGlobals fan type
193 : bool m_designAirVolFlowRateWasAutosized; // true if design max volume flow rate was autosize on input
194 : Real64 m_minPowerFlowFrac; // Minimum fan air flow fraction for power calculation
195 : Real64 m_motorEff; // Fan motor efficiency
196 : Real64 m_motorInAirFrac; // Fraction of motor heat entering air stream
197 : bool m_designElecPowerWasAutosized;
198 : PowerSizingMethod m_powerSizingMethod; // sizing method for design electric power, three options
199 : Real64 m_elecPowerPerFlowRate; // scaling factor for PowerPerFlow method
200 : Real64 m_elecPowerPerFlowRatePerPressure; // scaling factor for PowerPerFlowPerPressure
201 : Real64 m_fanTotalEff; // Fan total system efficiency (fan*belt*motor*VFD)
202 : Real64 m_nightVentPressureDelta; // fan pressure rise during night ventilation mode
203 : Real64 m_nightVentFlowFraction; // fan's flow fraction during night ventilation mode, not used
204 : int m_zoneNum; // zone index for motor heat losses as internal gains
205 : Real64 m_zoneRadFract; // thermal radiation split for motor losses
206 : ThermalLossDestination m_heatLossesDestination; // enum for where motor loss go
207 : Real64 m_qdotConvZone; // fan power lost to surrounding zone by convection to air (W)
208 : Real64 m_qdotRadZone; // fan power lost to surrounding zone by radiation to zone surfaces(W)
209 : std::string m_endUseSubcategoryName;
210 : int m_numSpeeds; // input for how many speed levels for discrete fan
211 : std::vector<Real64> m_flowFractionAtSpeed; // array of flow fractions for speed levels
212 : std::vector<Real64> m_powerFractionAtSpeed; // array of power fractions for speed levels
213 : std::vector<bool> m_powerFractionInputAtSpeed;
214 : // calculation variables
215 : std::vector<Real64> m_massFlowAtSpeed;
216 : std::vector<Real64> m_totEfficAtSpeed;
217 : Real64 m_inletAirMassFlowRate; // MassFlow through the Fan being Simulated [kg/Sec]
218 : Real64 m_outletAirMassFlowRate;
219 : // Real64 m_minAirFlowRate; // Min Specified Volume Flow Rate of Fan [m3/sec]
220 : Real64 m_maxAirMassFlowRate; // Max flow rate of fan in kg/sec
221 : // Real64 m_minAirMassFlowRate; // Min flow rate of fan in kg/sec
222 : // int fanMinAirFracMethod; // parameter for what method is used for min flow fraction
223 : // Real64 fanFixedMin; // Absolute minimum fan air flow [m3/s]
224 : Real64 m_inletAirTemp;
225 : Real64 m_outletAirTemp;
226 : Real64 m_inletAirHumRat;
227 : Real64 m_outletAirHumRat;
228 : Real64 m_inletAirEnthalpy;
229 : Real64 m_outletAirEnthalpy;
230 : bool m_objTurnFansOn;
231 : bool m_objTurnFansOff;
232 : bool m_objEnvrnFlag; // initialize to true
233 : bool m_objSizingFlag; // initialize to true, set to false after sizing routine
234 :
235 : // report variables
236 : Real64 m_fanPower; // Power of the Fan being Simulated [W]
237 : Real64 m_fanEnergy; // Fan energy in [J]
238 : // Real64 fanRuntimeFraction; // Fraction of the timestep that the fan operates
239 : Real64 m_deltaTemp; // Temp Rise across the Fan [C]
240 : Real64 m_powerLossToAir; // fan heat gain into process air [W]
241 : std::vector<Real64> m_fanRunTimeFractionAtSpeed;
242 : // EMS related variables
243 : bool m_maxAirFlowRateEMSOverrideOn; // if true, EMS wants to override fan size for Max Volume Flow Rate
244 : Real64 m_maxAirFlowRateEMSOverrideValue; // EMS value to use for override of Max Volume Flow Rate
245 : bool m_eMSFanPressureOverrideOn; // if true, then EMS is calling to override
246 : Real64 m_eMSFanPressureValue; // EMS value for Delta Pressure Across the Fan [Pa]
247 : bool m_eMSFanEffOverrideOn; // if true, then EMS is calling to override
248 : Real64 m_eMSFanEffValue; // EMS value for total efficiency of the Fan, fraction on 0..1
249 : bool m_eMSMaxMassFlowOverrideOn; // if true, then EMS is calling to override mass flow
250 : Real64 m_eMSAirMassFlowValue; // value EMS is directing to use [kg/s]
251 :
252 : bool m_faultyFilterFlag; // Indicate whether there is a fouling air filter corresponding to the fan
253 : int m_faultyFilterIndex; // Index of the fouling air filter corresponding to the fan
254 : // Mass Flow Rate Control Variables
255 : Real64 m_massFlowRateMaxAvail;
256 : Real64 m_massFlowRateMinAvail;
257 : Real64 m_rhoAirStdInit;
258 : // bool oneTimePowerCurveCheck_; // one time flag used for error message
259 : Real64 m_designPointFEI; // Fan Energy Index for the fan at the design operating point
260 :
261 : }; // class FanSystem
262 :
263 : } // namespace HVACFan
264 :
265 1542 : struct HVACFanData : BaseGlobalStruct
266 : {
267 :
268 : std::vector<std::unique_ptr<HVACFan::FanSystem>> fanObjs;
269 :
270 0 : void clear_state() override
271 : {
272 0 : fanObjs.clear();
273 0 : }
274 : };
275 :
276 : } // namespace EnergyPlus
277 :
278 : #endif // HVACFan_hh_INCLUDED_hh_INCLUDED
|