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
CHP.h
1 
8 #ifndef AMO_TOOLS_SUITE_CHP_H
9 #define AMO_TOOLS_SUITE_CHP_H
10 
11 #include <array>
12 #include <string>
13 #include <map>
14 #include <unordered_map>
15 
16 class CHP {
17 public:
35  enum class Option {
36  PercentAvgkWhElectricCostAvoided,
37  StandbyRate
38  };
39 
40  CHP(double annualOperatingHours, double annualElectricityConsumption, double annualThermalDemand,
41  double boilerThermalFuelCosts, double avgElectricityCosts, Option calculationOption,
42  double boilerThermalFuelCostsCHPcase, double CHPfuelCosts,
43  double percentAvgkWhElectricCostAvoidedOrStandbyRate, double displacedThermalEfficiency, double chpAvailability,
44  double thermalUtilization);
45 
46  std::unordered_map<std::string, double> const & getCostInfo() const { return costInfo; }
52  double getAnnualOperatingHours() const { return annualOperatingHours; }
58  double getAnnualElectricityConsumption() const { return annualElectricityConsumption; }
64  double getAnnualThermalDemand() const { return annualThermalDemand; }
70  double getBoilerThermalFuelCosts() const { return boilerThermalFuelCosts; }
76  double getChpFuelCosts() const { return chpFuelCosts; }
82  double getAvgElectricityCosts() const { return avgElectricityCosts; }
88  Option getCalculationOption() const { return calculationOption; }
94  double getBoilerThermalFuelCostsCHPcase() const { return boilerThermalFuelCostsCHPcase; }
100  double getPercentAvgkWhElectricCostAvoided() const { return percentAvgkWhElectricCostAvoided; }
106  double getStandbyRate() const { return standbyRate; }
112  double getDisplacedThermalEfficiency() const { return displacedThermalEfficiency; }
118  double getChpElectricEfficiency() const { return chpElectricEfficiency; }
124  double getChpThermalOutput() const { return chpThermalOutput; }
130  double getChpAvailability() const { return chpAvailability; }
136  double getThermalUtilization() const { return thermalUtilization; }
142  double getAvgPowerDemand() const { return avgPowerDemand; }
148  double getAvgThermalDemand() const { return avgThermalDemand; }
154  double getNetCHPpower() const { return netCHPpower; }
155 
156  void setAnnualOperatingHours(double annualOperatingHours);
157  void setAnnualElectricityConsumption(double annualElectricityConsumption);
158  void setAnnualThermalDemand(double annualThermalDemand);
159  void setBoilerThermalFuelCosts(double boilerThermalFuelCosts);
160  void setChpFuelCosts(double chpFuelCosts);
161  void setAvgElectricityCosts(double avgElectricityCosts);
162  void setCalculationOption(Option calculationOption, double percentAvgkWhElectricCostAvoidedOrStandbyRate);
163  void setBoilerThermalFuelCostsCHPcase(double boilerThermalFuelCostsCHPcase);
164  void setPercentAvgkWhElectricCostAvoided(double percentAvgkWhElectricCostAvoided);
165  void setStandbyRate(double standbyRate);
166  void setDisplacedThermalEfficiency(double displacedThermalEfficiency);
167  void setChpElectricEfficiency(double chpElectricEfficiency);
168  void setChpThermalOutput(double chpThermalOutput);
169  void setChpAvailability(double chpAvailability);
170  void setThermalUtilization(double thermalUtilization);
171  void setAvgPowerDemand(double avgPowerDemand);
172  void setAvgThermalDemand(double avgThermalDemand);
173  void setNetCHPpower(double netCHPpower);
174 
175 private:
176  void calculate();
177 
178  std::map<double, std::size_t>::const_iterator findNearest(double val, std::size_t index) const;
179 
180  double annualOperatingHours, annualElectricityConsumption, annualThermalDemand;
181  double boilerThermalFuelCosts, chpFuelCosts, avgElectricityCosts;
182  Option calculationOption;
183  double boilerThermalFuelCostsCHPcase, percentAvgkWhElectricCostAvoided = 0, standbyRate = 0;
184  double displacedThermalEfficiency, chpElectricEfficiency, chpThermalOutput, chpAvailability, thermalUtilization;
185 
186  double avgPowerDemand, avgThermalDemand, netCHPpower;
187 
188  std::unordered_map<std::string, double> costInfo;
189 
190  const std::array<std::array<double, 8>, 3> chpSystemByIndex = {
191  {
192  {{50, 600, 1000, 3300, 5000, 10000, 20000, 45000}}, // row 2 - index 0
193 // {{27.0, 34.5, 36.8, 40.4, 28.9, 27.3, 33.2, 36.0}}, // row 5 - index .
194 // {{6700, 4392, 3854, 3233, 4893, 5262, 3821, 3141}}, // row 6 - index .
195 // {{0.34, 2.64, 3.85, 10.67, 24.47, 52.62, 76.42, 141.33}}, // row 7 - index .
196  {{0.024, 0.021, 0.019, 0.0126, 0.0123, 0.012, 0.0093, 0.0092}}, // row 11 - index 1
197  {{2900, 2737, 2335, 1917, 2080, 1976, 1518, 1248}} // row 13 - index 2
198  }
199  };
200 
201  const std::array<std::map<double, std::size_t>, 6> chpSystemByKey = {
202  {
203  {{50, 0}, {600, 1}, {1000, 2}, {3300, 3}, {5000, 4}, {10000, 5}, {20000, 6}, {45000, 7}}, // row 2 - index 0
204  {{27.0, 0}, {34.5, 1}, {36.8, 2}, {40.4, 3}, {28.9, 4}, {27.3, 5}, {33.2, 6}, {36.0, 7}}, // row 5 - index 1
205  {{6700, 0}, {4392, 1}, {3854, 2}, {3233, 3}, {4893, 4}, {5262, 5}, {3821, 6}, {3141, 7}}, // row 6 - index 2
206  {{0.34, 0}, {2.64, 1}, {3.85, 2}, {10.67, 3}, {24.47, 4}, {52.62, 5}, {76.42, 6}, {141.33, 7}}, // row 7 - index 3
207  {{0.024, 0}, {0.021, 1}, {0.019, 2}, {0.0126, 3}, {0.0123, 4}, {0.012, 5}, {0.0093, 6}, {0.0092, 7}}, // row 11 - index 4
208  {{2900, 0}, {2737, 1}, {2335, 2}, {1917, 3}, {2080, 4}, {1976, 5}, {1518, 6}, {1248, 7}} // row 13 - index 5
209  }
210  };
211 
212 };
213 
214 #endif //AMO_TOOLS_SUITE_CHP_H
double getBoilerThermalFuelCostsCHPcase() const
Definition: CHP.h:94
double getStandbyRate() const
Definition: CHP.h:106
double getAnnualElectricityConsumption() const
Definition: CHP.h:58
double getAvgElectricityCosts() const
Definition: CHP.h:82
double getAvgPowerDemand() const
Definition: CHP.h:142
double getDisplacedThermalEfficiency() const
Definition: CHP.h:112
Definition: CHP.h:16
double getPercentAvgkWhElectricCostAvoided() const
Definition: CHP.h:100
double getAnnualOperatingHours() const
Definition: CHP.h:52
double getBoilerThermalFuelCosts() const
Definition: CHP.h:70
double getThermalUtilization() const
Definition: CHP.h:136
Option
Definition: CHP.h:35
double getAvgThermalDemand() const
Definition: CHP.h:148
double getChpElectricEfficiency() const
Definition: CHP.h:118
double getAnnualThermalDemand() const
Definition: CHP.h:64
double getChpFuelCosts() const
Definition: CHP.h:76
double getChpThermalOutput() const
Definition: CHP.h:124
double getChpAvailability() const
Definition: CHP.h:130
double getNetCHPpower() const
Definition: CHP.h:154
Option getCalculationOption() const
Definition: CHP.h:88