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
include
compressedAir
DecibelsMethod.h
Go to the documentation of this file.
1
10
#ifndef TOOLS_SUITE_DECIBELSMETHOD_H
11
#define TOOLS_SUITE_DECIBELSMETHOD_H
12
13
class
DecibelsMethod
{
14
public
:
15
struct
Output
{
16
Output
(
const
double
leakRateEstimate,
const
double
annualConsumption)
17
: leakRateEstimate(leakRateEstimate), annualConsumption(annualConsumption) {}
18
19
const
double
leakRateEstimate, annualConsumption;
20
};
21
37
DecibelsMethod
(
const
double
operatingTime,
const
double
linePressure,
const
double
decibels,
38
const
double
decibelRatingA,
const
double
pressureA,
const
double
firstFlowA,
39
const
double
secondFlowA,
const
double
decibelRatingB,
const
double
pressureB,
40
const
double
firstFlowB,
const
double
secondFlowB)
41
: operatingTime(operatingTime), linePressure(linePressure), decibels(decibels), decibelRatingA(decibelRatingA),
42
pressureA(pressureA), firstFlowA(firstFlowA), secondFlowA(secondFlowA), decibelRatingB(decibelRatingB),
43
pressureB(pressureB), firstFlowB(firstFlowB), secondFlowB(secondFlowB) {}
44
48
Output
calculate
() {
49
/*
50
double operatingTime;
51
double linePressure; // X
52
double decibels; // Y
53
double decibelRatingA; // Y1
54
double pressureA; // X1
55
double firstFlowA; // Q11
56
double secondFlowA; // Q21
57
double decibelRatingB; // Y2
58
double pressureB; // X2
59
double firstFlowB; // Q12
60
double secondFlowB; // Q22
61
*/
62
63
const
double
denominator = (pressureB - pressureA) * (decibelRatingB - decibelRatingA);
64
const
double
leakRateEstimate =
65
((pressureB - linePressure) * (decibelRatingB - decibels)) / denominator * firstFlowA +
66
((linePressure - pressureA) * (decibelRatingB - decibels)) / denominator * secondFlowA +
67
((pressureB - linePressure) * (decibels - decibelRatingA)) / denominator * firstFlowB +
68
((linePressure - pressureA) * (decibels - decibelRatingA)) / denominator * secondFlowB;
69
const
double
annualConsumption = (leakRateEstimate * operatingTime * 60) / 1000;
70
DecibelsMethod::Output
output(leakRateEstimate, annualConsumption);
71
72
return
output;
73
}
74
75
private
:
76
double
operatingTime;
77
double
linePressure;
// X
78
double
decibels;
// Y
79
double
decibelRatingA;
// Y1
80
double
pressureA;
// X1
81
double
firstFlowA;
// Q11
82
double
secondFlowA;
// Q21
83
double
decibelRatingB;
// Y2
84
double
pressureB;
// X2
85
double
firstFlowB;
// Q12
86
double
secondFlowB;
// Q22
87
};
88
89
#endif
DecibelsMethod
Definition
DecibelsMethod.h:13
DecibelsMethod::DecibelsMethod
DecibelsMethod(const double operatingTime, const double linePressure, const double decibels, const double decibelRatingA, const double pressureA, const double firstFlowA, const double secondFlowA, const double decibelRatingB, const double pressureB, const double firstFlowB, const double secondFlowB)
Definition
DecibelsMethod.h:37
DecibelsMethod::calculate
Output calculate()
Definition
DecibelsMethod.h:48
DecibelsMethod::Output
Definition
DecibelsMethod.h:15
Generated by
1.9.8