28 DecibelsMethodData(
const double linePressure,
const double decibels,
const double decibelRatingA,
29 const double pressureA,
const double firstFlowA,
const double secondFlowA,
30 const double decibelRatingB,
const double pressureB,
const double firstFlowB,
31 const double secondFlowB)
32 : linePressure(linePressure), decibels(decibels), decibelRatingA(decibelRatingA), pressureA(pressureA),
33 firstFlowA(firstFlowA), secondFlowA(secondFlowA), decibelRatingB(decibelRatingB), pressureB(pressureB),
34 firstFlowB(firstFlowB), secondFlowB(secondFlowB) {}
37 const double denominator = (pressureB - pressureA) * (decibelRatingB - decibelRatingA);
38 const double leakRateEstimate =
39 ((pressureB - linePressure) * (decibelRatingB - decibels)) / denominator * firstFlowA +
40 ((linePressure - pressureA) * (decibelRatingB - decibels)) / denominator * secondFlowA +
41 ((pressureB - linePressure) * (decibels - decibelRatingA)) / denominator * firstFlowB +
42 ((linePressure - pressureA) * (decibels - decibelRatingA)) / denominator * secondFlowB;
44 return leakRateEstimate;
50 double decibelRatingA;
54 double decibelRatingB;
62 OrificeMethodData(
const double airTemp,
const double atmPressure,
const double dischargeCoef,
const double diameter,
63 const double supplyPressure,
const int numOrifices)
64 : airTemp(airTemp), atmPressure(atmPressure), dischargeCoef(dischargeCoef), diameter(diameter),
65 supplyPressure(supplyPressure), numOrifices(numOrifices) {}
68 const double caPressurePSIA = atmPressure + supplyPressure;
71 const double airTempRankine = airTemp + 459.67;
73 const double caDensity = caPressurePSIA * 144 / (53.34 * airTempRankine);
74 const double standardDensity = atmPressure * 144 / (53.34 * airTempRankine);
75 const double sonicDensity = caDensity * std::pow((2 / 2.4), (1 / .4));
77 const double leakVelocity = std::pow(((2 * 1.4) / (1.4 + 1)) * 53.34 * airTempRankine * 32.2, 0.5);
78 const double leakRateLBMmin =
79 sonicDensity * (diameter * diameter) * (M_PI / (4 * 144)) * leakVelocity * 60 * dischargeCoef;
80 const double leakRateScfm = leakRateLBMmin / standardDensity;
81 const double leakRateEstimate = leakRateScfm * numOrifices;
82 return leakRateEstimate;
86 double airTemp, atmPressure, dischargeCoef, diameter, supplyPressure;
97 : hoursPerYear(hoursPerYear), utilityType(utilityType), utilityCost(utilityCost),
98 measurementMethod(measurementMethod), estimateMethodData(estimateMethodData),
99 decibelsMethodData(decibelsMethodData), bagMethod(bagMethod), orificeMethodData(orificeMethodData),
100 compressorElectricityData(compressorElectricityData), units(units) {}
102 int getHoursPerYear()
const {
return hoursPerYear; }
103 int getUtilityType()
const {
return utilityType; }
104 int getMeasurementMethod()
const {
return measurementMethod; }
105 int getUnits()
const {
return units; }
106 double getUtilityCost()
const {
return utilityCost; }
109 BagMethod getBagMethod()
const {
return bagMethod; }
114 int hoursPerYear, utilityType;
116 int measurementMethod;
128 Output(
double annualTotalElectricity,
double annualTotalElectricityCost,
double totalFlowRate,
129 double annualTotalFlowRate)
130 : annualTotalElectricity(annualTotalElectricity), annualTotalElectricityCost(annualTotalElectricityCost),
131 totalFlowRate(totalFlowRate), annualTotalFlowRate(annualTotalFlowRate) {}
134 double annualTotalElectricity = 0, annualTotalElectricityCost = 0, totalFlowRate = 0, annualTotalFlowRate = 0;
138 : compressedAirLeakSurveyInputVec(compressedAirLeakSurveyInputVec) {}
141 double annualTotalElectricity = 0, annualTotalElectricityCost = 0, totalFlowRate = 0, annualTotalFlowRate = 0;
143 for (
auto& compressedAirLeakSurveyInput : compressedAirLeakSurveyInputVec) {
144 double tmpAnnualTotalElectricity = 0, tmpAnnualTotalElectricityCost = 0, tmpTotalFlowRate = 0,
145 tmpAnnualTotalFlowRate = 0;
148 if (compressedAirLeakSurveyInput.getMeasurementMethod() == 0) {
149 EstimateMethodData estimateMethodData = compressedAirLeakSurveyInput.getEstimateMethodData();
150 tmpTotalFlowRate = estimateMethodData.getLeakRateEstimate() * compressedAirLeakSurveyInput.getUnits();
151 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
154 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 1) {
155 DecibelsMethodData decibelsMethodData = compressedAirLeakSurveyInput.getDecibelsMethodData();
156 tmpTotalFlowRate = decibelsMethodData.calculate() * compressedAirLeakSurveyInput.getUnits();
157 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
160 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 2) {
161 BagMethod bagMethod = compressedAirLeakSurveyInput.getBagMethod();
164 tmpTotalFlowRate = bagOutput.flowRate * compressedAirLeakSurveyInput.getUnits();
165 tmpAnnualTotalFlowRate = bagOutput.annualConsumption * compressedAirLeakSurveyInput.getUnits();
168 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 3) {
169 OrificeMethodData orificeMethodData = compressedAirLeakSurveyInput.getOrificeMethodData();
170 tmpTotalFlowRate = orificeMethodData.calculate() * compressedAirLeakSurveyInput.getUnits();
171 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
175 if (compressedAirLeakSurveyInput.getUtilityType() == 0) {
176 tmpAnnualTotalElectricityCost = compressedAirLeakSurveyInput.getUtilityCost() * tmpAnnualTotalFlowRate;
179 else if (compressedAirLeakSurveyInput.getUtilityType() == 1) {
181 compressedAirLeakSurveyInput.getCompressorElectricityData();
182 double electricityCalculation = compressorElectricityData.calculate();
183 tmpAnnualTotalElectricity = electricityCalculation * tmpAnnualTotalFlowRate;
184 tmpAnnualTotalElectricityCost =
185 tmpAnnualTotalElectricity * compressedAirLeakSurveyInput.getUtilityCost();
187 annualTotalElectricity += tmpAnnualTotalElectricity;
188 annualTotalElectricityCost += tmpAnnualTotalElectricityCost;
189 totalFlowRate += tmpTotalFlowRate;
190 annualTotalFlowRate += tmpAnnualTotalFlowRate;
194 annualTotalFlowRate);
196 std::vector<CompressedAirLeakSurveyInput>
const& getCompressedAirLeakSurveyInputVec()
const {
197 return compressedAirLeakSurveyInputVec;
199 void setCompressedAirReductionInputVec(std::vector<CompressedAirReductionInput>& compressedAirReductionInputVec);
202 std::vector<CompressedAirLeakSurveyInput> compressedAirLeakSurveyInputVec;