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 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 : // Using/Aliasing
69 : using DataHVACGlobals::MinFrac;
70 :
71 : enum class AvailabilityManagerCoupling
72 : {
73 : Invalid = -1,
74 : Coupled,
75 : Decoupled,
76 : Num
77 : };
78 :
79 4432 : struct FanEquipConditions
80 : {
81 : // Members
82 : std::string FanName; // Name of the fan
83 : std::string FanType; // Type of Fan ie. Simple, Vane axial, Centrifugal, etc.
84 : std::string AvailSchedName; // Fan Operation Schedule
85 : int FanType_Num; // DataHVACGlobals fan type
86 : int AvailSchedPtrNum; // Pointer to the availability schedule
87 : Real64 InletAirMassFlowRate; // MassFlow through the Fan being Simulated [kg/Sec]
88 : Real64 OutletAirMassFlowRate;
89 : Real64 MaxAirFlowRate; // Max Specified Volume Flow Rate of Fan [m3/sec]
90 : bool MaxAirFlowRateIsAutosizable; // if true, then this type of fan could be autosize
91 : bool MaxAirFlowRateEMSOverrideOn; // if true, EMS wants to override fan size for Max Volume Flow Rate
92 : Real64 MaxAirFlowRateEMSOverrideValue; // EMS value to use for override of Max Volume Flow Rate
93 : Real64 MinAirFlowRate; // Min Specified Volume Flow Rate of Fan [m3/sec]
94 : Real64 MaxAirMassFlowRate; // Max flow rate of fan in kg/sec
95 : Real64 MinAirMassFlowRate; // Min flow rate of fan in kg/sec
96 : int FanMinAirFracMethod; // parameter for what method is used for min flow fraction
97 : Real64 FanMinFrac; // Minimum fan air flow fraction
98 : Real64 FanFixedMin; // Absolute minimum fan air flow [m3/s]
99 : bool EMSMaxMassFlowOverrideOn; // if true, then EMS is calling to override mass flow
100 : Real64 EMSAirMassFlowValue; // value EMS is directing to use [kg/s]
101 : Real64 InletAirTemp;
102 : Real64 OutletAirTemp;
103 : Real64 InletAirHumRat;
104 : Real64 OutletAirHumRat;
105 : Real64 InletAirEnthalpy;
106 : Real64 OutletAirEnthalpy;
107 : Real64 FanPower; // Power of the Fan being Simulated [kW]
108 : Real64 FanEnergy; // Fan energy in [kJ]
109 : Real64 FanRuntimeFraction; // Fraction of the timestep that the fan operates
110 : Real64 DeltaTemp; // Temp Rise across the Fan [C]
111 : Real64 DeltaPress; // Delta Pressure Across the Fan [N/m2]
112 : Real64 PowerLossToAir; // Fan heat gain to air stream [W]
113 : bool EMSFanPressureOverrideOn; // if true, then EMS is calling to override
114 : Real64 EMSFanPressureValue; // EMS value for Delta Pressure Across the Fan [Pa]
115 : Real64 FanEff; // Fan total system efficiency (fan*belt*motor*VFD)
116 : bool EMSFanEffOverrideOn; // if true, then EMS is calling to override
117 : Real64 EMSFanEffValue; // EMS value for total efficiency of the Fan, fraction on 0..1
118 : bool FaultyFilterFlag; // Indicate whether there is a fouling air filter corresponding to the fan
119 : int FaultyFilterIndex; // Index of the fouling air filter corresponding to the fan
120 : Real64 MotEff; // Fan motor efficiency
121 : Real64 MotInAirFrac; // Fraction of motor heat entering air stream
122 : Array1D<Real64> FanCoeff; // Fan Part Load Coefficients to match fan type
123 : // Mass Flow Rate Control Variables
124 : Real64 MassFlowRateMaxAvail;
125 : Real64 MassFlowRateMinAvail;
126 : Real64 RhoAirStdInit;
127 : int InletNodeNum;
128 : int OutletNodeNum;
129 : int NVPerfNum;
130 : int FanPowerRatAtSpeedRatCurveIndex;
131 : int FanEffRatioCurveIndex;
132 : std::string EndUseSubcategoryName;
133 : bool OneTimePowerRatioCheck; // one time flag used for error message
134 : bool OneTimeEffRatioCheck; // one time flag used for error message
135 : Real64 FanWheelDia; // Fan wheel outer diameter [m]
136 : Real64 FanOutletArea; // Fan outlet area [m2]
137 : Real64 FanMaxEff; // Fan maximum static efficiency [-]
138 : Real64 EuMaxEff; // Euler number at fan maximum static efficiency [-]
139 : Real64 FanMaxDimFlow; // Fan maximum dimensionless airflow [-]
140 : Real64 FanShaftPwrMax; // Fan shaft maximum input power [W]
141 : Real64 FanSizingFactor; // Fan sizing factor [-]
142 : Real64 PulleyDiaRatio; // Motor/fan pulley diameter ratio [-]
143 : Real64 BeltMaxTorque; // Belt maximum torque [N-m]
144 : Real64 BeltSizingFactor; // Belt sizing factor [-]
145 : Real64 BeltTorqueTrans; // Belt fractional torque transition Region 1-2 [-]
146 : Real64 MotorMaxSpd; // Motor maximum speed [rpm]
147 : Real64 MotorMaxOutPwr; // Motor maximum output power [W]
148 : Real64 MotorSizingFactor; // Motor sizing factor [-]
149 : std::string VFDEffType; // VFD efficiency type [Speed or Power]
150 : Real64 VFDMaxOutPwr; // VFD maximum output power [W]
151 : Real64 VFDSizingFactor; // VFD sizing factor [-]
152 : int PressRiseCurveIndex; // Fan pressure rise curve index
153 : int PressResetCurveIndex; // Duct static pressure reset curve index
154 : int PLFanEffNormCurveIndex; // Fan part-load efficiency (normal) curve index
155 : int PLFanEffStallCurveIndex; // Fan part-load efficiency (stall) curve index
156 : int DimFlowNormCurveIndex; // Fan dimensionless airflow (normal) curve index
157 : int DimFlowStallCurveIndex; // Fan dimensionless airflow (stall) curve index
158 : int BeltMaxEffCurveIndex; // Belt maximum efficiency curve index
159 : int PLBeltEffReg1CurveIndex; // Belt part-load efficiency (Region 1) curve index
160 : int PLBeltEffReg2CurveIndex; // Belt part-load efficiency (Region 2) curve index
161 : int PLBeltEffReg3CurveIndex; // Belt part-load efficiency (Region 3) curve index
162 : int MotorMaxEffCurveIndex; // Motor maximum efficiency curve index
163 : int PLMotorEffCurveIndex; // Motor part-load efficiency curve index
164 : int VFDEffCurveIndex; // VFD efficiency curve index
165 : Real64 DeltaPressTot; // Total pressure rise across fan [N/m2]
166 : Real64 FanAirPower; // Air power for fan being Simulated [W]
167 : Real64 FanSpd; // Fan shaft rotational speed [rpm]
168 : Real64 FanTrq; // Fan shaft torque [N-m]
169 : Real64 FanWheelEff; // Fan efficiency (mechanical)
170 : Real64 FanShaftPower; // Shaft input power for fan being Simulated [W]
171 : Real64 BeltMaxEff; // Belt maximum efficiency (mechanical)
172 : Real64 BeltEff; // Belt efficiency (mechanical)
173 : Real64 BeltInputPower; // Belt input power for fan being Simulated [W]
174 : Real64 MotorMaxEff; // Motor maximum efficiency (electrical)
175 : Real64 MotorInputPower; // Motor input power for fan being Simulated [W]
176 : Real64 VFDEff; // VFD efficiency (electrical)
177 : Real64 VFDInputPower; // VFD input power for fan being Simulated [W]
178 : [[maybe_unused]] Real64 MaxFanPowerEncountered; // Maximum VFD input power encountered [W]
179 : // zone exhaust fan
180 : int FlowFractSchedNum; // schedule index flow rate modifier schedule
181 : AvailabilityManagerCoupling AvailManagerMode =
182 : AvailabilityManagerCoupling::Invalid; // mode for how exhaust fan should react to availability managers
183 : int MinTempLimitSchedNum; // schedule index minimum temperature limit
184 : int BalancedFractSchedNum; // schedule index portion recirculated
185 : Real64 UnbalancedOutletMassFlowRate;
186 : Real64 BalancedOutletMassFlowRate;
187 : int AirLoopNum; // Airloop number
188 : Real64 DesignPointFEI; // Fan Energy Index for the fan at the design operating point
189 :
190 : // Default Constructor
191 546 : FanEquipConditions()
192 546 : : FanType_Num(0), AvailSchedPtrNum(0), InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), MaxAirFlowRate(0.0),
193 : MaxAirFlowRateIsAutosizable(false), MaxAirFlowRateEMSOverrideOn(false), MaxAirFlowRateEMSOverrideValue(0.0), MinAirFlowRate(0.0),
194 : MaxAirMassFlowRate(0.0), MinAirMassFlowRate(0.0), FanMinAirFracMethod(MinFrac), FanMinFrac(0.0), FanFixedMin(0.0),
195 : EMSMaxMassFlowOverrideOn(false), EMSAirMassFlowValue(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0),
196 : OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), FanPower(0.0), FanEnergy(0.0), FanRuntimeFraction(0.0),
197 : DeltaTemp(0.0), DeltaPress(0.0), PowerLossToAir(0.0), EMSFanPressureOverrideOn(false), EMSFanPressureValue(0.0), FanEff(0.0),
198 : EMSFanEffOverrideOn(false), EMSFanEffValue(0.0), FaultyFilterFlag(false), FaultyFilterIndex(0), MotEff(0.0), MotInAirFrac(0.0),
199 : FanCoeff(5, 0.0), MassFlowRateMaxAvail(0.0), MassFlowRateMinAvail(0.0), RhoAirStdInit(0.0), InletNodeNum(0), OutletNodeNum(0),
200 : NVPerfNum(0), FanPowerRatAtSpeedRatCurveIndex(0), FanEffRatioCurveIndex(0), OneTimePowerRatioCheck(true), OneTimeEffRatioCheck(true),
201 : FanWheelDia(0.0), FanOutletArea(0.0), FanMaxEff(0.0), EuMaxEff(0.0), FanMaxDimFlow(0.0), FanShaftPwrMax(0.0), FanSizingFactor(0.0),
202 : PulleyDiaRatio(0.0), BeltMaxTorque(0.0), BeltSizingFactor(0.0), BeltTorqueTrans(0.0), MotorMaxSpd(0.0), MotorMaxOutPwr(0.0),
203 : MotorSizingFactor(0.0), VFDMaxOutPwr(0.0), VFDSizingFactor(0.0), PressRiseCurveIndex(0), PressResetCurveIndex(0),
204 : PLFanEffNormCurveIndex(0), PLFanEffStallCurveIndex(0), DimFlowNormCurveIndex(0), DimFlowStallCurveIndex(0), BeltMaxEffCurveIndex(0),
205 : PLBeltEffReg1CurveIndex(0), PLBeltEffReg2CurveIndex(0), PLBeltEffReg3CurveIndex(0), MotorMaxEffCurveIndex(0), PLMotorEffCurveIndex(0),
206 : VFDEffCurveIndex(0), DeltaPressTot(0.0), FanAirPower(0.0), FanSpd(0.0), FanTrq(0.0), FanWheelEff(0.0), FanShaftPower(0.0),
207 : BeltMaxEff(0.0), BeltEff(0.0), BeltInputPower(0.0), MotorMaxEff(0.0), MotorInputPower(0.0), VFDEff(0.0), VFDInputPower(0.0),
208 : MaxFanPowerEncountered(0.0), FlowFractSchedNum(0), MinTempLimitSchedNum(0), BalancedFractSchedNum(0), UnbalancedOutletMassFlowRate(0.0),
209 546 : BalancedOutletMassFlowRate(0.0), AirLoopNum(0), DesignPointFEI(0.0)
210 : {
211 546 : }
212 : };
213 :
214 0 : struct NightVentPerfData
215 : {
216 : // Members
217 : std::string FanName; // Name of the fan that will use this data
218 : Real64 FanEff; // Fan total efficiency; motor and mechanical
219 : Real64 DeltaPress; // Delta Pressure Across the Fan [N/m2]
220 : Real64 MaxAirFlowRate; // Max Specified Volume Flow Rate of Fan [m3/s]
221 : Real64 MaxAirMassFlowRate; // Max flow rate of fan in kg/sec
222 : Real64 MotEff; // Fan motor efficiency
223 : Real64 MotInAirFrac; // Fraction of motor heat entering air stream
224 :
225 : // Default Constructor
226 0 : NightVentPerfData() : FanEff(0.0), DeltaPress(0.0), MaxAirFlowRate(0.0), MaxAirMassFlowRate(0.0), MotEff(0.0), MotInAirFrac(0.0)
227 : {
228 0 : }
229 : };
230 :
231 4978 : struct FanNumericFieldData
232 : {
233 : // Members
234 : Array1D_string FieldNames;
235 : };
236 :
237 : void SimulateFanComponents(EnergyPlusData &state,
238 : std::string_view CompName,
239 : bool FirstHVACIteration,
240 : int &CompIndex,
241 : Optional<Real64 const> SpeedRatio = _,
242 : Optional_bool_const ZoneCompTurnFansOn = _, // Turn fans ON signal from ZoneHVAC component
243 : Optional_bool_const ZoneCompTurnFansOff = _, // Turn Fans OFF signal from ZoneHVAC component
244 : Optional<Real64 const> PressureRise = _ // Pressure difference to use for DeltaPress
245 : );
246 :
247 : void GetFanInput(EnergyPlusData &state);
248 :
249 : void InitFan(EnergyPlusData &state,
250 : int FanNum,
251 : bool FirstHVACIteration // unused1208
252 : );
253 :
254 : void SizeFan(EnergyPlusData &state, int FanNum);
255 :
256 : void SimSimpleFan(EnergyPlusData &state, int FanNum);
257 :
258 : void SimVariableVolumeFan(EnergyPlusData &state, int FanNum, Optional<Real64 const> PressureRise = _);
259 :
260 : void SimOnOffFan(EnergyPlusData &state, int FanNum, Optional<Real64 const> SpeedRatio = _);
261 :
262 : void SimZoneExhaustFan(EnergyPlusData &state, int FanNum);
263 :
264 : void SimComponentModelFan(EnergyPlusData &state, int FanNum);
265 :
266 : void UpdateFan(EnergyPlusData &state, int FanNum);
267 :
268 : void ReportFan(EnergyPlusData &state, int FanNum);
269 :
270 : void GetFanIndex(EnergyPlusData &state, std::string const &FanName, int &FanIndex, bool &ErrorsFound, std::string_view ThisObjectType = {});
271 :
272 : void GetFanVolFlow(EnergyPlusData &state, int FanIndex, Real64 &FanVolFlow);
273 :
274 : Real64 GetFanPower(EnergyPlusData &state, int FanIndex);
275 :
276 : void GetFanType(EnergyPlusData &state,
277 : std::string const &FanName, // Fan name
278 : int &FanType, // returned fantype number
279 : bool &ErrorsFound, // error indicator
280 : std::string_view ThisObjectType = {}, // parent object type (for error message)
281 : std::string_view ThisObjectName = {} // parent object name (for error message)
282 : );
283 :
284 : Real64 GetFanDesignVolumeFlowRate(EnergyPlusData &state,
285 : std::string_view FanType, // must match fan types in this module
286 : std::string_view FanName, // must match fan names for the fan type
287 : bool &ErrorsFound, // set to true if problem
288 : Optional_int_const FanIndex = _ // index to fan
289 : );
290 :
291 : int GetFanInletNode(EnergyPlusData &state,
292 : std::string_view FanType, // must match fan types in this module
293 : std::string_view FanName, // must match fan names for the fan type
294 : bool &ErrorsFound // set to true if problem
295 : );
296 :
297 : int getFanInNodeIndex(EnergyPlusData &state,
298 : int FanIndex, // fan index
299 : bool &ErrorsFound // set to true if problem
300 : );
301 :
302 : int GetFanOutletNode(EnergyPlusData &state,
303 : std::string const &FanType, // must match fan types in this module
304 : std::string const &FanName, // must match fan names for the fan type
305 : bool &ErrorsFound // set to true if problem
306 : );
307 :
308 : int GetFanAvailSchPtr(EnergyPlusData &state,
309 : std::string const &FanType, // must match fan types in this module
310 : std::string const &FanName, // must match fan names for the fan type
311 : bool &ErrorsFound // set to true if problem
312 : );
313 :
314 : int GetFanSpeedRatioCurveIndex(EnergyPlusData &state,
315 : std::string &FanType, // must match fan types in this module (set if nonzero index passed)
316 : std::string &FanName, // must match fan names for the fan type (set if nonzero index passed)
317 : Optional_int IndexIn = _ // optional fan index if fan type and name are unknown or index needs setting
318 : );
319 :
320 : void SetFanData(EnergyPlusData &state,
321 : int FanNum, // Index of fan
322 : bool &ErrorsFound, // Set to true if certain errors found
323 : std::string const &FanName, // Name of fan
324 : Optional<Real64 const> MaxAirVolFlow = _, // Fan air volumetric flow rate [m3/s]
325 : Optional<Real64 const> MinAirVolFlow = _ // Fan air volumetric flow rate [m3/s]
326 : );
327 :
328 : [[maybe_unused]] Real64 FanDesDT(EnergyPlusData &state,
329 : int FanNum, // index of fan in Fan array
330 : Real64 FanVolFlow // fan volumetric flow rate [m3/s]
331 : );
332 :
333 : Real64 CalFaultyFanAirFlowReduction(EnergyPlusData &state,
334 : std::string const &FanName, // Name of the Fan
335 : Real64 FanDesignAirFlowRate, // Fan Design Volume Flow Rate [m3/s]
336 : Real64 FanDesignDeltaPress, // Fan Design Delta Pressure [Pa]
337 : Real64 FanFaultyDeltaPressInc, // Increase of Fan Delta Pressure in the Faulty Case [Pa]
338 : int FanCurvePtr // Fan Curve Pointer
339 : );
340 :
341 : Real64 FanDesHeatGain(EnergyPlusData &state,
342 : int FanNum, // index of fan in Fan array
343 : Real64 FanVolFlow // fan volumetric flow rate [m3/s]
344 : );
345 :
346 : void SetFanAirLoopNumber(EnergyPlusData &state, int FanIndex, int AirLoopNum);
347 :
348 : void FanInputsForDesHeatGain(EnergyPlusData &state,
349 : int fanIndex,
350 : Real64 &deltaP,
351 : Real64 &motEff,
352 : Real64 &totEff,
353 : Real64 &motInAirFrac,
354 : Real64 &fanShaftPow,
355 : Real64 &motInPower,
356 : bool &fanCompModel);
357 :
358 : } // namespace Fans
359 :
360 1542 : struct FansData : BaseGlobalStruct
361 : {
362 : int NumFans = 0;
363 : int NumNightVentPerf = 0; // number of FAN:NIGHT VENT PERFORMANCE objects found in the input
364 : bool GetFanInputFlag = true; // Flag set to make sure you get input once
365 : bool LocalTurnFansOn = false; // If True, overrides fan schedule and cycles ZoneHVAC component fans on
366 : bool LocalTurnFansOff = false; // If True, overrides fan schedule and LocalTurnFansOn and cycles ZoneHVAC component fans off
367 : bool MyOneTimeFlag = true;
368 : bool ZoneEquipmentListChecked = false;
369 : Array1D_bool MySizeFlag;
370 : Array1D_bool MyEnvrnFlag;
371 : Array1D_bool CheckEquipName;
372 : Array1D<Fans::FanEquipConditions> Fan;
373 : std::unordered_map<std::string, std::string> UniqueFanNames;
374 : Array1D<Fans::NightVentPerfData> NightVentPerf;
375 : Array1D<Fans::FanNumericFieldData> FanNumericFields;
376 : int ErrCount = 0;
377 :
378 0 : void clear_state() override
379 : {
380 0 : *this = FansData();
381 0 : }
382 : };
383 :
384 : } // namespace EnergyPlus
385 :
386 : #endif
|