AMO-Tools-Suite  v.0.9.0
Set of tools for calculating energy efficiency in industrial equipment
All Classes Namespaces Files Functions Variables Enumerations Friends Macros Pages
OptimalFanEfficiency.h
1 
8 #ifndef AMO_TOOLS_SUITE_OPTIMALFANEFFICIENCY_H
9 #define AMO_TOOLS_SUITE_OPTIMALFANEFFICIENCY_H
10 
11 #include <functional>
12 #include <cfloat>
18 {
19 public:
20  enum class FanType
21  {
22  AirfoilSISW,
23  BackwardCurvedSISW,
24  RadialSISW,
25  RadialTipSISW,
26  BackwardInclinedSISW,
27  AirfoilDIDW,
28  BackwardCurvedDIDW,
29  BackwardInclinedDIDW,
30  VaneAxial,
31  AirHandling,
32  MaterialHandling,
33  LongShavings
34  };
35 
36  OptimalFanEfficiency(FanType const fanType, const double fanSpeed, const double flowRate, const double inletPressure,
37  const double outletPressure, const double compressibility)
38  : fanType(fanType), fanSpeed(fanSpeed), flowRate(flowRate), outletPressure(outletPressure),
39  inletPressure(inletPressure), compressibility(compressibility){};
40 
45  double calculate()
46  {
47  FanTypeProperties const &currentFan = fanTypeProperties[static_cast<std::size_t>(fanType)];
48  double specificSpeed = (fanSpeed * std::sqrt(flowRate)) / (std::pow(outletPressure - inletPressure, 0.75) * std::pow(compressibility, 0.25));
49 
50  if (specificSpeed < currentFan.minSpecificSpeed)
51  {
52  specificSpeed = currentFan.minSpecificSpeed;
53  }
54  else if (specificSpeed > currentFan.maxSpecificSpeed)
55  {
56  specificSpeed = currentFan.maxSpecificSpeed;
57  }
58 
59  bool isPolynomial = specificSpeed < currentFan.transition;
60  if (isPolynomial)
61  {
62  return currentFan.polynomialFunction(specificSpeed);
63  }
64  return currentFan.exponentialFunction(specificSpeed);
65  }
66 
67 private:
68  FanType const fanType;
69  const double fanSpeed, flowRate, outletPressure, inletPressure, compressibility;
70 
71  struct FanTypeProperties
72  {
73  private:
81  FanTypeProperties(const FanType fanType, const double transition, const double minSpecificSpeed, const double maxSpecificSpeed,
82  std::function<double(double n)> polynomialFunction,
83  std::function<double(double n)> exponentialFunction = [](double) { return 0; })
84  : fanType(fanType), transition(transition), minSpecificSpeed(minSpecificSpeed), maxSpecificSpeed(maxSpecificSpeed),
85  polynomialFunction(std::move(polynomialFunction)), exponentialFunction(std::move(exponentialFunction))
86  {
87  }
88 
89  const FanType fanType;
90  const double transition, minSpecificSpeed, maxSpecificSpeed;
91  const std::function<double(double n)> polynomialFunction;
92  const std::function<double(double n)> exponentialFunction;
93  friend class OptimalFanEfficiency;
94  };
95 
96  // TODO consider making this static. I think C++17 should allow this to be done inline, in this header file
97  const FanTypeProperties fanTypeProperties[12] = {
98  {FanType::AirfoilSISW, 40500, 25000, 1200100,
99  [](double n) { return -8.0126838E+01 + 1.4126667E-02 * n + -1.0177155E-06 * std::pow(n, 2) + 3.8587782E-11 * std::pow(n, 3) + -8.1056442E-16 * std::pow(n, 4) + 8.9381481E-21 * std::pow(n, 5) + -4.0433292E-26 * std::pow(n, 6); },
100  [](double n) { return 0.0028841 + 0.27192 * std::exp(-2.2547E-06 * n) + 0.86849 * std::exp(-0.00001064 * n); }},
101  {
102  FanType::BackwardCurvedSISW,
103  DBL_MAX,
104  27900,
105  102000,
106  [](double n) { return -3.3858306E+00 + 4.1209144E-04 * n + -1.6548201E-08 * std::pow(n, 2) + 3.5761249E-13 * std::pow(n, 3) + -4.5693281E-18 * std::pow(n, 4) + 3.4555013E-23 * std::pow(n, 5) + -1.4316102E-28 * std::pow(n, 6) + 2.5065191E-34 * std::pow(n, 7); },
107  },
108  {
109  FanType::RadialSISW,
110  37900,
111  14000,
112  135800,
113  [](double n) { return -1.9069988E+00 + 7.3713948E-04 * n + -1.0257832E-07 * std::pow(n, 2) + 8.3624959E-12 * std::pow(n, 3) + -4.1052861E-16 * std::pow(n, 4) + 1.1767564E-20 * std::pow(n, 5) + -1.8050575E-25 * std::pow(n, 6) + 1.1417504E-30 * std::pow(n, 7); },
114  [](double n) { return 0.056999916 + 0.67916774 * std::exp(-2.18789E-05 * n) + 5.1126555 * std::exp(-0.000132336 * n); },
115  },
116  {
117  FanType::RadialTipSISW,
118  64000,
119  19400,
120  213400,
121  [](double n) { return 5.2461E-01 + 1.1922E-05 * n + 3.1851E-11 * std::pow(n, 2) + -7.0532E-15 * std::pow(n, 3) + 4.8891E-20 * std::pow(n, 4) + 1.5505E-25 * std::pow(n, 5); },
122  [](double n) { return 0.053287 + 0.47705 * std::exp(-7.7713E-06 * n) + 0.93414 * std::exp(-0.000023195 * n); },
123  },
124  {
125  FanType::BackwardInclinedSISW,
126  DBL_MAX,
127  32100,
128  150100,
129  [](double n) { return -3.8748275E+00 + 5.7599797E-04 * n + -3.4547599E-08 * std::pow(n, 2) + 1.3031136E-12 * std::pow(n, 3) + -3.2700894E-17 * std::pow(n, 4) + 5.4984885E-22 * std::pow(n, 5) + -6.1792981E-27 * std::pow(n, 6) + 4.5680803E-32 * std::pow(n, 7) + -2.1294090E-37 * std::pow(n, 8) + 5.6703436E-43 * std::pow(n, 9) + -6.5731157E-49 * std::pow(n, 10); },
130  },
131  {
132  FanType::AirfoilDIDW,
133  78000,
134  39000,
135  1800000,
136  [](double n) { return -7.7454E+00 + 5.3186E-04 * n + -1.1335E-08 * std::pow(n, 2) + 7.1361E-14 * std::pow(n, 3) + 6.9345E-19 * std::pow(n, 4) + -1.1607E-23 * std::pow(n, 5) + 4.3954E-29 * std::pow(n, 6); },
137  [](double n) { return 0.019737 + 0.37398 * std::exp(-0.000002682 * n) + 0.8666 * std::exp(-0.000010656 * n); },
138  },
139  {
140  FanType::BackwardCurvedDIDW,
141  148900,
142  38000,
143  270800,
144  [](double n) { return -8.6410E+00 + 8.1273E-04 * n + -2.9882E-08 * std::pow(n, 2) + 6.1531E-13 * std::pow(n, 3) + -7.7968E-18 * std::pow(n, 4) + 6.2161E-23 * std::pow(n, 5) + -3.0415E-28 * std::pow(n, 6) + 8.3466E-34 * std::pow(n, 7) + -9.8355E-40 * std::pow(n, 8); },
145  [](double n) { return 0.11242 + 1.5789 * std::exp(-9.2707E-06 * n) + -0.55707 * std::exp(-9.9734E-06 * n); },
146  },
147  {
148  FanType::BackwardInclinedDIDW,
149  132600,
150  46000,
151  622500,
152  [](double n) { return -2.5449389E+02 + 2.7852726E-02 * n + -1.3284246E-06 * std::pow(n, 2) + 3.6371269E-11 * std::pow(n, 3) + -6.3036202E-16 * std::pow(n, 4) + 7.1757531E-21 * std::pow(n, 5) + -5.3686875E-26 * std::pow(n, 6) + 2.5473585E-31 * std::pow(n, 7) + -6.9602675E-37 * std::pow(n, 8) + 8.3493931E-43 * std::pow(n, 9); },
153  [](double n) { return 0.036754527 + 0.50694842 * std::exp(-4.70913E-06 * n) + 1.0416177 * std::exp(-1.79781E-05 * n); },
154  },
155  {
156  FanType::VaneAxial,
157  179670,
158  60375,
159  348620,
160  [](double n) { return -5.4813500E+00 + 5.0387520E-04 * n + -1.8304300E-08 * std::pow(n, 2) + 3.7439830E-13 * std::pow(n, 3) + -4.6531220E-18 * std::pow(n, 4) + 3.5829160E-23 * std::pow(n, 5) + -1.6699090E-28 * std::pow(n, 6) + 4.3158650E-34 * std::pow(n, 7) + -4.7471640E-40 * std::pow(n, 8); },
161  [](double n) { return 0.1704079 + 1.968828 * std::exp(-7.24616E-06 * n) + -1.782739 * std::exp(-1.32444E-05 * n); },
162  },
163  {
164  FanType::AirHandling,
165  DBL_MAX,
166  15100,
167  67600,
168  [](double n) { return 1.9237E-01 + 8.0744E-05 * n + -4.3274E-09 * std::pow(n, 2) + 9.5885E-14 * std::pow(n, 3) + -1.0050E-18 * std::pow(n, 4) + 4.0941E-24 * std::pow(n, 5); },
169  },
170  {
171  FanType::MaterialHandling,
172  28600,
173  10100,
174  65600,
175  [](double n) { return -1.4085021E+02 + 6.9753242E-02 * n + -1.4963605E-05 * std::pow(n, 2) + 1.8305766E-09 * std::pow(n, 3) + -1.4075805E-13 * std::pow(n, 4) + 7.0623637E-18 * std::pow(n, 5) + -2.3154680E-22 * std::pow(n, 6) + 4.7905555E-27 * std::pow(n, 7) + -5.6833385E-32 * std::pow(n, 8) + 2.9495463E-37 * std::pow(n, 9); },
176  [](double n) { return 0.046254578 + 0.44481692 * std::exp(-2.74877E-05 * n) + 0.61800978 * std::exp(-2.56071E-05 * n); },
177  },
178  {
179  FanType::LongShavings,
180  38500,
181  12400,
182  180500,
183  [](double n) { return -4.9068901E+00 + 1.1742587E-03 * n + -9.8831999E-08 * std::pow(n, 2) + 4.2747034E-12 * std::pow(n, 3) + -1.0139920E-16 * std::pow(n, 4) + 1.2507408E-21 * std::pow(n, 5) + -6.2553192E-27 * std::pow(n, 6); },
184  [](double n) { return 0.026213128 + 0.31783591 * std::exp(-1.22334E-05 * n) + 0.90262955 * std::exp(-4.33422E-05 * n); },
185  }};
186 };
187 
188 #endif //AMO_TOOLS_SUITE_OPTIMALFANEFFICIENCY_H