MEASUR-Tools-Suite v1.0.11
The MEASUR Tools Suite is a collection of industrial efficiency calculations written in C++ and with bindings for compilation to WebAssembly.
Loading...
Searching...
No Matches
CHP.h
Go to the documentation of this file.
1
8#ifndef TOOLS_SUITE_CHP_H
9#define TOOLS_SUITE_CHP_H
10
11#include <array>
12#include <map>
13#include <string>
14#include <unordered_map>
15
16class CHP {
17 public:
19 public:
30 CostInfoOutput(double annualOperationSavings, double totalInstalledCostsPayback, double simplePayback,
31 double fuelCosts, double thermalCredit, double incrementalOandMDollarsKwH,
32 double totalOperatingCostsToGenerate)
33 : annualOperationSavings(annualOperationSavings), totalInstalledCostsPayback(totalInstalledCostsPayback),
34 simplePayback(simplePayback), fuelCosts(fuelCosts), thermalCredit(thermalCredit),
35 incrementalOandMDollarsKwH(incrementalOandMDollarsKwH),
36 totalOperatingCostsToGenerate(totalOperatingCostsToGenerate) {};
37 CostInfoOutput() = default;
38 double annualOperationSavings;
39 double totalInstalledCostsPayback;
40 double simplePayback;
41 double fuelCosts;
42 double thermalCredit;
43 double incrementalOandMDollarsKwH;
44 double totalOperatingCostsToGenerate;
45 };
63 enum class Option { PercentAvgkWhElectricCostAvoided, StandbyRate };
64
65 CHP(double annualOperatingHours, double annualElectricityConsumption, double annualThermalDemand,
66 double boilerThermalFuelCosts, double avgElectricityCosts, Option calculationOption,
67 double boilerThermalFuelCostsCHPcase, double CHPfuelCosts, double percentAvgkWhElectricCostAvoidedOrStandbyRate,
68 double displacedThermalEfficiency, double chpAvailability, double thermalUtilization);
69
70 CostInfoOutput getCostInfo() const { return costInfo; }
76 double getAnnualOperatingHours() const { return annualOperatingHours; }
82 double getAnnualElectricityConsumption() const { return annualElectricityConsumption; }
88 double getAnnualThermalDemand() const { return annualThermalDemand; }
94 double getBoilerThermalFuelCosts() const { return boilerThermalFuelCosts; }
100 double getChpFuelCosts() const { return chpFuelCosts; }
106 double getAvgElectricityCosts() const { return avgElectricityCosts; }
112 Option getCalculationOption() const { return calculationOption; }
118 double getBoilerThermalFuelCostsCHPcase() const { return boilerThermalFuelCostsCHPcase; }
124 double getPercentAvgkWhElectricCostAvoided() const { return percentAvgkWhElectricCostAvoided; }
130 double getStandbyRate() const { return standbyRate; }
136 double getDisplacedThermalEfficiency() const { return displacedThermalEfficiency; }
142 double getChpElectricEfficiency() const { return chpElectricEfficiency; }
148 double getChpThermalOutput() const { return chpThermalOutput; }
154 double getChpAvailability() const { return chpAvailability; }
160 double getThermalUtilization() const { return thermalUtilization; }
166 double getAvgPowerDemand() const { return avgPowerDemand; }
172 double getAvgThermalDemand() const { return avgThermalDemand; }
178 double getNetCHPpower() const { return netCHPpower; }
179
180 void setAnnualOperatingHours(double annualOperatingHours);
181 void setAnnualElectricityConsumption(double annualElectricityConsumption);
182 void setAnnualThermalDemand(double annualThermalDemand);
183 void setBoilerThermalFuelCosts(double boilerThermalFuelCosts);
184 void setChpFuelCosts(double chpFuelCosts);
185 void setAvgElectricityCosts(double avgElectricityCosts);
186 void setCalculationOption(Option calculationOption, double percentAvgkWhElectricCostAvoidedOrStandbyRate);
187 void setBoilerThermalFuelCostsCHPcase(double boilerThermalFuelCostsCHPcase);
188 void setPercentAvgkWhElectricCostAvoided(double percentAvgkWhElectricCostAvoided);
189 void setStandbyRate(double standbyRate);
190 void setDisplacedThermalEfficiency(double displacedThermalEfficiency);
191 void setChpElectricEfficiency(double chpElectricEfficiency);
192 void setChpThermalOutput(double chpThermalOutput);
193 void setChpAvailability(double chpAvailability);
194 void setThermalUtilization(double thermalUtilization);
195 void setAvgPowerDemand(double avgPowerDemand);
196 void setAvgThermalDemand(double avgThermalDemand);
197 void setNetCHPpower(double netCHPpower);
198
199 private:
200 void calculate();
201
202 std::map<double, std::size_t>::const_iterator findNearest(double val, std::size_t index) const;
203
204 double annualOperatingHours, annualElectricityConsumption, annualThermalDemand;
205 double boilerThermalFuelCosts, chpFuelCosts, avgElectricityCosts;
206 Option calculationOption;
207 double boilerThermalFuelCostsCHPcase, percentAvgkWhElectricCostAvoided = 0, standbyRate = 0;
208 double displacedThermalEfficiency, chpElectricEfficiency, chpThermalOutput, chpAvailability, thermalUtilization;
209
210 double avgPowerDemand, avgThermalDemand, netCHPpower;
211
212 CostInfoOutput costInfo;
213
214 const std::array<std::array<double, 8>, 3> chpSystemByIndex = {{
215 {{50, 600, 1000, 3300, 5000, 10000, 20000, 45000}}, // row 2 - index 0
216 // {{27.0, 34.5, 36.8, 40.4, 28.9, 27.3, 33.2, 36.0}}, // row 5 - index .
217 // {{6700, 4392, 3854, 3233, 4893, 5262, 3821, 3141}}, // row 6 - index .
218 // {{0.34, 2.64, 3.85, 10.67, 24.47, 52.62, 76.42, 141.33}}, // row 7 - index .
219 {{0.024, 0.021, 0.019, 0.0126, 0.0123, 0.012, 0.0093, 0.0092}}, // row 11 - index 1
220 {{2900, 2737, 2335, 1917, 2080, 1976, 1518, 1248}} // row 13 - index 2
221 }};
222
223 const std::array<std::map<double, std::size_t>, 6> chpSystemByKey = {{
224 {{50, 0}, {600, 1}, {1000, 2}, {3300, 3}, {5000, 4}, {10000, 5}, {20000, 6}, {45000, 7}}, // row 2 - index 0
225 {{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
226 {{6700, 0}, {4392, 1}, {3854, 2}, {3233, 3}, {4893, 4}, {5262, 5}, {3821, 6}, {3141, 7}}, // row 6 - index 2
227 {{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
228 // 3
229 {{0.024, 0},
230 {0.021, 1},
231 {0.019, 2},
232 {0.0126, 3},
233 {0.0123, 4},
234 {0.012, 5},
235 {0.0093, 6},
236 {0.0092, 7}}, // row 11 - index 4
237 {{2900, 0}, {2737, 1}, {2335, 2}, {1917, 3}, {2080, 4}, {1976, 5}, {1518, 6}, {1248, 7}} // row 13 - index 5
238 }};
239};
240
241#endif // TOOLS_SUITE_CHP_H
CostInfoOutput(double annualOperationSavings, double totalInstalledCostsPayback, double simplePayback, double fuelCosts, double thermalCredit, double incrementalOandMDollarsKwH, double totalOperatingCostsToGenerate)
Definition CHP.h:30
Definition CHP.h:16
double getChpFuelCosts() const
Definition CHP.h:100
double getChpThermalOutput() const
Definition CHP.h:148
double getStandbyRate() const
Definition CHP.h:130
double getChpElectricEfficiency() const
Definition CHP.h:142
double getAvgElectricityCosts() const
Definition CHP.h:106
double getNetCHPpower() const
Definition CHP.h:178
double getAnnualElectricityConsumption() const
Definition CHP.h:82
double getAvgThermalDemand() const
Definition CHP.h:172
double getDisplacedThermalEfficiency() const
Definition CHP.h:136
double getAvgPowerDemand() const
Definition CHP.h:166
double getAnnualThermalDemand() const
Definition CHP.h:88
Option getCalculationOption() const
Definition CHP.h:112
double getBoilerThermalFuelCosts() const
Definition CHP.h:94
double getThermalUtilization() const
Definition CHP.h:160
double getChpAvailability() const
Definition CHP.h:154
Option
Definition CHP.h:63
double getBoilerThermalFuelCostsCHPcase() const
Definition CHP.h:118
double getPercentAvgkWhElectricCostAvoided() const
Definition CHP.h:124
double getAnnualOperatingHours() const
Definition CHP.h:76