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
FlowCalculationsEnergyUse.h
Go to the documentation of this file.
1
12#ifndef TOOLS_SUITE_FLOWCALCULATIONSENERGYUSE_H
13#define TOOLS_SUITE_FLOWCALCULATIONSENERGYUSE_H
19 public:
21 enum class Gas {
22 AIR,
23 AMMONIA_DISSOCIATED,
24 ARGON,
25 BUTANE,
26 ENDOTHERMIC_AMMONIA,
27 EXOTHERMIC_CRACKED_LEAN,
28 EXOTHERMIC_CRACKED_RICH,
29 HELIUM,
30 HYDROGEN,
31 NATURAL_GAS,
32 NITROGEN,
33 OXYGEN,
34 PROPANE,
35 OTHER
36 };
37
39 enum class Section { SQUARE_EDGE, SHARP_EDGE, VENTURI };
40
59 FlowCalculationsEnergyUse(Gas gasType, double specificGravity, double orificeDiameter, double insidePipeDiameter,
60 Section sectionType, double dischargeCoefficient, double gasHeatingValue,
61 double gasTemperature, double gasPressure, double orificePressureDrop,
62 double operatingTime)
63 : gasType_(gasType), specificGravity_(specificGravity), orificeDiameter_(orificeDiameter),
64 insidePipeDiameter_(insidePipeDiameter), sectionType_(sectionType),
65 dischargeCoefficient_(dischargeCoefficient), gasHeatingValue_(gasHeatingValue),
66 gasTemperature_(gasTemperature), gasPressure_(gasPressure), orificePressureDrop_(orificePressureDrop),
67 operatingTime_(operatingTime)
68
69 {
70 area_ = 0.0;
71 adjustedDischargeCoefficient_ = 0.0;
72 pressureDrop_ = 0.0;
73 adjustedGasTemperature_ = 0.0;
74 adjustedGasPressure_ = 0.0;
75 flow_ = 0.0;
76 heatInput_ = 0.0;
77 }
78
79 FlowCalculationsEnergyUse() = default;
80
86 Gas getGasType() const { return gasType_; }
87
94 void setGasType(Gas gasType) {
95 gasType_ = gasType;
96
97 switch (gasType) {
98 case Gas::AIR:
99 specificGravity_ = 1;
100 case Gas::AMMONIA_DISSOCIATED:
101 specificGravity_ = 0.3;
102 case Gas::ARGON:
103 specificGravity_ = 1.38;
104 case Gas::BUTANE:
105 specificGravity_ = 2.02;
106 case Gas::ENDOTHERMIC_AMMONIA:
107 specificGravity_ = 0.59;
108 case Gas::EXOTHERMIC_CRACKED_LEAN:
109 specificGravity_ = 1;
110 case Gas::EXOTHERMIC_CRACKED_RICH:
111 specificGravity_ = 0.85;
112 case Gas::HELIUM:
113 specificGravity_ = 0.14;
114 case Gas::HYDROGEN:
115 specificGravity_ = 0.07;
116 case Gas::NATURAL_GAS:
117 specificGravity_ = 0.65;
118 case Gas::NITROGEN:
119 specificGravity_ = 0.96;
120 case Gas::OXYGEN:
121 specificGravity_ = 1.11;
122 case Gas::PROPANE:
123 specificGravity_ = 1.52;
124 case Gas::OTHER:
125 specificGravity_ = 0.0;
126 }
127 }
128
134 double getSpecificGravity() const { return specificGravity_; }
135
142 void setSpecificGravity(double specificGravity) { specificGravity_ = specificGravity; }
143
149 double getOrificeDiameter() const { return orificeDiameter_; }
150
157 void setOrificeDiameter(double orificeDiameter) { orificeDiameter_ = orificeDiameter; }
158
164 double getInsidePipeDiameter() const { return insidePipeDiameter_; }
165
172 void setInsidePipeDiameter(double insidePipeDiameter) { insidePipeDiameter_ = insidePipeDiameter; }
173
179 Section getSectionType() const { return sectionType_; }
180
187 void setSectionType(Section sectionType) {
188 sectionType_ = sectionType;
189
190 switch (sectionType) {
191 case Section::SHARP_EDGE:
192 dischargeCoefficient_ = 0.6;
193 case Section::SQUARE_EDGE:
194 dischargeCoefficient_ = 0.5;
195 case Section::VENTURI:
196 dischargeCoefficient_ = 0.8;
197 }
198 }
199
205 double getDischargeCoefficient() const { return dischargeCoefficient_; }
206
213 void setDischargeCoefficient(double dischargeCoefficient) { dischargeCoefficient_ = dischargeCoefficient; }
214
220 double getGasHeatingValue() const { return gasHeatingValue_; }
221
228 void setGasHeatingValue(double gasHeatingValue) { gasHeatingValue_ = gasHeatingValue; }
229
235 double getGasTemperature() const { return gasTemperature_; }
236
243 void setGasTemperature(double gasTemperature) { gasTemperature_ = gasTemperature; }
244
250 double getGasPressure() const { return gasPressure_; }
251
258 void setGasPressure(double gasPressure) { gasPressure_ = gasPressure; }
259
265 double getOrificePressureDrop() const { return orificePressureDrop_; }
266
273 void setOrificePressureDrop(double orificePressureDrop) { orificePressureDrop_ = orificePressureDrop; }
274
280 double getOperatingTime() const { return operatingTime_; }
281
288 void setOperatingTime(double operatingTime) { operatingTime_ = operatingTime; }
289
295 double getArea();
296
303
310
317
324
330 double getFlow();
331
337 double getHeatInput();
338
345 double getTotalFlow();
346
347 private:
348 // In values
350 double specificGravity_ = 0.0;
351 double orificeDiameter_ = 0.0;
352 double insidePipeDiameter_ = 0.0;
354 double dischargeCoefficient_ = 0.0;
355 double gasHeatingValue_ = 0.0;
356 double gasTemperature_ = 0.0;
357 double gasPressure_ = 0.0;
358 double orificePressureDrop_ = 0.0;
359 double operatingTime_ = 0.0;
360
361 // Out values
362 double area_;
363 double adjustedDischargeCoefficient_;
364 double pressureDrop_;
365 double adjustedGasTemperature_;
366 double adjustedGasPressure_;
367 double flow_;
368 double heatInput_;
369 double totalflow_;
370};
371
372#endif // TOOLS_SUITE_FLOWCALCULATIONSENERGYUSE_H
double getAdjustedDischargeCoefficient()
void setOrificeDiameter(double orificeDiameter)
FlowCalculationsEnergyUse(Gas gasType, double specificGravity, double orificeDiameter, double insidePipeDiameter, Section sectionType, double dischargeCoefficient, double gasHeatingValue, double gasTemperature, double gasPressure, double orificePressureDrop, double operatingTime)
void setGasPressure(double gasPressure)
void setInsidePipeDiameter(double insidePipeDiameter)
void setGasTemperature(double gasTemperature)
void setDischargeCoefficient(double dischargeCoefficient)
void setSpecificGravity(double specificGravity)
void setOperatingTime(double operatingTime)
void setOrificePressureDrop(double orificePressureDrop)
void setSectionType(Section sectionType)
void setGasHeatingValue(double gasHeatingValue)
Section
enum class for section type