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
CompressedAirCentrifugal.h
1 //
2 // Created by 7bo on 10/12/2020.
3 // Calculate estimated power(kW) consumption and air flow(acfm) for a centrifugal compressors based on control type
4 // 1. Control type
5 // a. Load / unload
6 // b. Inlet Butterfly with BlowOff or Inlet Guide Vane with BlowOff
7 // c. Inlet Guide Vane Modulation with Unloading or Butterfly Modulation with unloading
8 // 2. Using Input as
9 // a. Capacity
10 // b. Capacity%
11 // c. Power
12 // d. Power%
13 // OR
14 // Power% and BlowOff%
15 // e. Volts, Amps, Power Factor(PF)
16 // OR
17 // Volts, Amps, Power Factor(PF) and BlowOff%
18 //
19 
20 #ifndef AMO_TOOLS_SUITE_COMPRESSEDAIRCENTRIFUGAL_H
21 #define AMO_TOOLS_SUITE_COMPRESSEDAIRCENTRIFUGAL_H
22 
23 #include "CurveFitVal.h"
24 
26 public:
27  enum ControlType {
28  LoadUnload,
29  ModulationUnload,
30  BlowOff
31  };
32 
33  enum ComputeFrom {
34  PercentagePower,
35  PercentageCapacity,
36  PowerMeasured,
37  CapacityMeasured,
38  PowerFactor
39  };
40 
41  struct Output
42  {
43  Output(double kW_Calc, double C_Calc, double PerkW, double C_Per) : kW_Calc(kW_Calc), C_Calc(C_Calc), PerkW(PerkW), C_Per(C_Per){}
44 
45  Output() = default;
46  double kW_Calc = 0, C_Calc = 0, PerkW = 0, C_Per = 0;
47  };
48 
49  struct OutputBlowOff
50  {
51  OutputBlowOff(double kW_Calc, double C_Calc, double PerkW, double C_Per, double C_blow, double blowPer) : kW_Calc(kW_Calc), C_Calc(C_Calc), PerkW(PerkW), C_Per(C_Per), C_blow(C_blow), blowPer(blowPer){}
52 
53  OutputBlowOff() = default;
54  double kW_Calc = 0, C_Calc = 0, PerkW = 0, C_Per = 0, C_blow = 0, blowPer = 0;
55  };
56 
57  static double Round(double value) { return (float)((int)(value * 100 + .5)) / 100; }
58 
59 protected:
60  CompressedAirCentrifugalBase(const double kW_fl, const double C_fl) : kW_fl(kW_fl), C_fl(C_fl), C_fl_raw(C_fl) {}
61 
62  const double kW_fl, C_fl_raw;
63  double C_fl;
64 
65 private:
66  virtual CompressedAirCentrifugalBase::OutputBlowOff calculateFromPerkW_BlowOff(double, double) {return OutputBlowOff();}
67  virtual CompressedAirCentrifugalBase::OutputBlowOff calculateFromPerC_BlowOff(double) {return OutputBlowOff();}
68  virtual CompressedAirCentrifugalBase::OutputBlowOff calculateFromkWMeasured_BlowOff(double, double) {return OutputBlowOff();}
69  virtual CompressedAirCentrifugalBase::OutputBlowOff calculateFromCMeasured_BlowOff(double) {return OutputBlowOff();}
70  virtual CompressedAirCentrifugalBase::OutputBlowOff calculateFromVIPFMeasured_BlowOff(double, double, double, double) {return OutputBlowOff();}
71 
72  virtual CompressedAirCentrifugalBase::Output calculateFromPerkW(double) {return Output();}
73  virtual CompressedAirCentrifugalBase::Output calculateFromPerC(double) {return Output();}
74  virtual CompressedAirCentrifugalBase::Output calculateFromkWMeasured(double) {return Output();}
75  virtual CompressedAirCentrifugalBase::Output calculateFromCMeasured(double) {return Output();}
76  virtual CompressedAirCentrifugalBase::Output calculateFromVIPFMeasured(double, double, double) {return Output();}
77 
78  virtual void AdjustDischargePressure(std::vector<double>, std::vector<double>, double, double) {}
79 };
80 
82 public:
83  CompressedAirCentrifugal(const double kW_fl, const double C_fl) : CompressedAirCentrifugalBase(kW_fl, C_fl) {}
84 };
85 
87 public:
88  double C_fl_Adjusted = 0;
89 
90  CompressedAirCentrifugal_BlowOff(const double kW_fl, const double C_fl, const double kW_blow, const double C_blow) : CompressedAirCentrifugalBase(kW_fl, C_fl), C_blow(C_blow), C_fl_Adjusted(C_fl)
91  {
92  CPer_blow = C_blow / C_fl;
93  kWPer_blow = kW_blow / kW_fl;
94  }
95 
96  CompressedAirCentrifugalBase::OutputBlowOff calculateFromPerkW_BlowOff(double PerkW, double blowPer) override;
97  CompressedAirCentrifugalBase::OutputBlowOff calculateFromPerC_BlowOff(double C_Per) override;
98  CompressedAirCentrifugalBase::OutputBlowOff calculateFromkWMeasured_BlowOff(double kW, double blowPer) override;
99  CompressedAirCentrifugalBase::OutputBlowOff calculateFromCMeasured_BlowOff(double C) override;
100  CompressedAirCentrifugalBase::OutputBlowOff calculateFromVIPFMeasured_BlowOff(double V, double I, double PF, double blowPer) override;
101 
102  void AdjustDischargePressure(std::vector<double> Capacity, std::vector<double> DischargePressure, double P_fl, double P_max = 0) override {
103  if(P_fl > 0) {
104  CurveFitVal curveFitValCap(DischargePressure, Capacity, 2);
105  C_fl_Adjusted = C_fl = curveFitValCap.calculate(P_fl);
106 
107  CPer_blow = C_blow / C_fl;
108  }
109  }
110 
111 private:
112  double C_blow = 1;
113  double CPer_blow = 1;
114  double kWPer_blow = 0;
115 };
116 
118 public:
119  double C_fl_Adjusted = 0;
120 
121  CompressedAirCentrifugal_LoadUnload(const double kW_fl, const double C_fl, const double kW_nl) : CompressedAirCentrifugalBase(kW_fl, C_fl), C_fl_Adjusted(C_fl)
122  {
123  kWPer_nl = kW_nl / kW_fl;
124  }
125 
126  CompressedAirCentrifugalBase::Output calculateFromPerkW(double PerkW) override;
127  CompressedAirCentrifugalBase::Output calculateFromPerC(double C_Per) override;
128  CompressedAirCentrifugalBase::Output calculateFromkWMeasured(double kW) override;
129  CompressedAirCentrifugalBase::Output calculateFromCMeasured(double C) override;
130  CompressedAirCentrifugalBase::Output calculateFromVIPFMeasured(double V, double I, double PF) override;
131 
132  void AdjustDischargePressure(std::vector<double> Capacity, std::vector<double> DischargePressure, double P_fl, double P_max = 0) override {
133  if(P_fl > 0) {
134  CurveFitVal curveFitValCap(DischargePressure, Capacity, 2);
135  C_fl_Adjusted = C_fl = curveFitValCap.calculate(P_fl);
136  }
137  }
138 
139 private:
140  const double CPer_fl = 1;
141  const double CPer_nl = 0;
142  double kWPer_nl = 0;
143 };
144 
146 public:
147  double C_fl_Adjusted = 0;
148  double C_max_Adjusted = 0;
149 
150  CompressedAirCentrifugal_ModulationUnload(const double kW_fl, const double C_fl, const double kW_nl, const double C_max, const double kW_ul, const double C_ul): CompressedAirCentrifugalBase(kW_fl, C_fl), C_max(C_max), C_max_raw(C_max), C_ul(C_ul), C_fl_Adjusted(C_fl), C_max_Adjusted(C_max)
151  {
152  kWPer_nl = kW_nl / kW_fl;
153  kWPer_ul = kW_ul / kW_fl;
154  CPer_max = C_max / C_fl;
155  CPer_ul = C_ul / C_fl;
156  CPer_ulB = C_ul / C_max;
157  }
158 
159  CompressedAirCentrifugalBase::Output calculateFromPerkW(double PerkW) override;
160  CompressedAirCentrifugalBase::Output calculateFromPerC(double C_Per) override;
161  CompressedAirCentrifugalBase::Output calculateFromkWMeasured(double kW) override;
162  CompressedAirCentrifugalBase::Output calculateFromCMeasured(double C) override;
163  CompressedAirCentrifugalBase::Output calculateFromVIPFMeasured(double V, double I, double PF) override;
164 
165  void AdjustDischargePressure(std::vector<double> Capacity, std::vector<double> DischargePressure, double P_fl, double P_max) override {
166  if(P_fl > 0 || P_max > 0) {
167  CurveFitVal curveFitValCap(DischargePressure, Capacity, 2);
168 
169  if(P_fl > 0) C_fl_Adjusted = C_fl = curveFitValCap.calculate(P_fl);
170  if(P_max > 0) C_max_Adjusted = C_max = curveFitValCap.calculate(P_max);
171 
172  CPer_max = C_max / C_fl;
173  CPer_ul = C_ul / C_fl;
174  CPer_ulB = C_ul / C_max;
175  }
176  }
177 
178 private:
179  const double kWPer_max = 1, C_max_raw = 1, C_ul = 1;
180  double kWPer_nl = 0;
181  double kWPer_ul = 1;
182  double C_max = 1;
183  double CPer_max = 1;
184  double CPer_ul = 1;
185  double CPer_ulB = 1;
186  const double CPer_nl = 0;
187 };
188 #endif //AMO_TOOLS_SUITE_COMPRESSEDAIRCENTRIFUGAL_H
Curve Fit class.
Definition: CurveFitVal.h:19