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#pragma once
2
10#include <array>
11#include <map>
12#include <string>
13#include <unordered_map>
14
15class CHP {
16 public:
18 public:
29 CostInfoOutput(double annualOperationSavings, double totalInstalledCostsPayback, double simplePayback,
30 double fuelCosts, double thermalCredit, double incrementalOandMDollarsKwH,
31 double totalOperatingCostsToGenerate)
32 : annualOperationSavings(annualOperationSavings), totalInstalledCostsPayback(totalInstalledCostsPayback),
33 simplePayback(simplePayback), fuelCosts(fuelCosts), thermalCredit(thermalCredit),
34 incrementalOandMDollarsKwH(incrementalOandMDollarsKwH),
35 totalOperatingCostsToGenerate(totalOperatingCostsToGenerate) {};
36 CostInfoOutput() = default;
37 double annualOperationSavings;
38 double totalInstalledCostsPayback;
39 double simplePayback;
40 double fuelCosts;
41 double thermalCredit;
42 double incrementalOandMDollarsKwH;
43 double totalOperatingCostsToGenerate;
44 };
62 enum class Option { PercentAvgkWhElectricCostAvoided, StandbyRate };
63
64 CHP(double annualOperatingHours, double annualElectricityConsumption, double annualThermalDemand,
65 double boilerThermalFuelCosts, double avgElectricityCosts, Option calculationOption,
66 double boilerThermalFuelCostsCHPcase, double CHPfuelCosts, double percentAvgkWhElectricCostAvoidedOrStandbyRate,
67 double displacedThermalEfficiency, double chpAvailability, double thermalUtilization);
68
69 CostInfoOutput getCostInfo() const { return costInfo; }
75 double getAnnualOperatingHours() const { return annualOperatingHours; }
81 double getAnnualElectricityConsumption() const { return annualElectricityConsumption; }
87 double getAnnualThermalDemand() const { return annualThermalDemand; }
93 double getBoilerThermalFuelCosts() const { return boilerThermalFuelCosts; }
99 double getChpFuelCosts() const { return chpFuelCosts; }
105 double getAvgElectricityCosts() const { return avgElectricityCosts; }
111 Option getCalculationOption() const { return calculationOption; }
117 double getBoilerThermalFuelCostsCHPcase() const { return boilerThermalFuelCostsCHPcase; }
123 double getPercentAvgkWhElectricCostAvoided() const { return percentAvgkWhElectricCostAvoided; }
129 double getStandbyRate() const { return standbyRate; }
135 double getDisplacedThermalEfficiency() const { return displacedThermalEfficiency; }
141 double getChpElectricEfficiency() const { return chpElectricEfficiency; }
147 double getChpThermalOutput() const { return chpThermalOutput; }
153 double getChpAvailability() const { return chpAvailability; }
159 double getThermalUtilization() const { return thermalUtilization; }
165 double getAvgPowerDemand() const { return avgPowerDemand; }
171 double getAvgThermalDemand() const { return avgThermalDemand; }
177 double getNetCHPpower() const { return netCHPpower; }
178
179 void setAnnualOperatingHours(double annualOperatingHours);
180 void setAnnualElectricityConsumption(double annualElectricityConsumption);
181 void setAnnualThermalDemand(double annualThermalDemand);
182 void setBoilerThermalFuelCosts(double boilerThermalFuelCosts);
183 void setChpFuelCosts(double chpFuelCosts);
184 void setAvgElectricityCosts(double avgElectricityCosts);
185 void setCalculationOption(Option calculationOption, double percentAvgkWhElectricCostAvoidedOrStandbyRate);
186 void setBoilerThermalFuelCostsCHPcase(double boilerThermalFuelCostsCHPcase);
187 void setPercentAvgkWhElectricCostAvoided(double percentAvgkWhElectricCostAvoided);
188 void setStandbyRate(double standbyRate);
189 void setDisplacedThermalEfficiency(double displacedThermalEfficiency);
190 void setChpElectricEfficiency(double chpElectricEfficiency);
191 void setChpThermalOutput(double chpThermalOutput);
192 void setChpAvailability(double chpAvailability);
193 void setThermalUtilization(double thermalUtilization);
194 void setAvgPowerDemand(double avgPowerDemand);
195 void setAvgThermalDemand(double avgThermalDemand);
196 void setNetCHPpower(double netCHPpower);
197
198 private:
199 void calculate();
200
201 std::map<double, std::size_t>::const_iterator findNearest(double val, std::size_t index) const;
202
203 double annualOperatingHours, annualElectricityConsumption, annualThermalDemand;
204 double boilerThermalFuelCosts, chpFuelCosts, avgElectricityCosts;
205 Option calculationOption;
206 double boilerThermalFuelCostsCHPcase, percentAvgkWhElectricCostAvoided = 0, standbyRate = 0;
207 double displacedThermalEfficiency, chpElectricEfficiency, chpThermalOutput, chpAvailability, thermalUtilization;
208
209 double avgPowerDemand, avgThermalDemand, netCHPpower;
210
211 CostInfoOutput costInfo;
212
213 const std::array<std::array<double, 8>, 3> chpSystemByIndex = {{
214 {{50, 600, 1000, 3300, 5000, 10000, 20000, 45000}}, // row 2 - index 0
215 // {{27.0, 34.5, 36.8, 40.4, 28.9, 27.3, 33.2, 36.0}}, // row 5 - index .
216 // {{6700, 4392, 3854, 3233, 4893, 5262, 3821, 3141}}, // row 6 - index .
217 // {{0.34, 2.64, 3.85, 10.67, 24.47, 52.62, 76.42, 141.33}}, // row 7 - index .
218 {{0.024, 0.021, 0.019, 0.0126, 0.0123, 0.012, 0.0093, 0.0092}}, // row 11 - index 1
219 {{2900, 2737, 2335, 1917, 2080, 1976, 1518, 1248}} // row 13 - index 2
220 }};
221
222 const std::array<std::map<double, std::size_t>, 6> chpSystemByKey = {{
223 {{50, 0}, {600, 1}, {1000, 2}, {3300, 3}, {5000, 4}, {10000, 5}, {20000, 6}, {45000, 7}}, // row 2 - index 0
224 {{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
225 {{6700, 0}, {4392, 1}, {3854, 2}, {3233, 3}, {4893, 4}, {5262, 5}, {3821, 6}, {3141, 7}}, // row 6 - index 2
226 {{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
227 // 3
228 {{0.024, 0},
229 {0.021, 1},
230 {0.019, 2},
231 {0.0126, 3},
232 {0.0123, 4},
233 {0.012, 5},
234 {0.0093, 6},
235 {0.0092, 7}}, // row 11 - index 4
236 {{2900, 0}, {2737, 1}, {2335, 2}, {1917, 3}, {2080, 4}, {1976, 5}, {1518, 6}, {1248, 7}} // row 13 - index 5
237 }};
238};
239
CostInfoOutput(double annualOperationSavings, double totalInstalledCostsPayback, double simplePayback, double fuelCosts, double thermalCredit, double incrementalOandMDollarsKwH, double totalOperatingCostsToGenerate)
Definition CHP.h:29
Definition CHP.h:15
double getChpFuelCosts() const
Definition CHP.h:99
double getChpThermalOutput() const
Definition CHP.h:147
double getStandbyRate() const
Definition CHP.h:129
double getChpElectricEfficiency() const
Definition CHP.h:141
double getAvgElectricityCosts() const
Definition CHP.h:105
double getNetCHPpower() const
Definition CHP.h:177
double getAnnualElectricityConsumption() const
Definition CHP.h:81
double getAvgThermalDemand() const
Definition CHP.h:171
double getDisplacedThermalEfficiency() const
Definition CHP.h:135
double getAvgPowerDemand() const
Definition CHP.h:165
double getAnnualThermalDemand() const
Definition CHP.h:87
Option getCalculationOption() const
Definition CHP.h:111
double getBoilerThermalFuelCosts() const
Definition CHP.h:93
double getThermalUtilization() const
Definition CHP.h:159
double getChpAvailability() const
Definition CHP.h:153
Option
Definition CHP.h:62
double getBoilerThermalFuelCostsCHPcase() const
Definition CHP.h:117
double getPercentAvgkWhElectricCostAvoided() const
Definition CHP.h:123
double getAnnualOperatingHours() const
Definition CHP.h:75