29 DecibelsMethodData(
const double linePressure,
const double decibels,
const double decibelRatingA,
30 const double pressureA,
const double firstFlowA,
const double secondFlowA,
31 const double decibelRatingB,
const double pressureB,
const double firstFlowB,
32 const double secondFlowB)
33 : linePressure(linePressure), decibels(decibels), decibelRatingA(decibelRatingA), pressureA(pressureA),
34 firstFlowA(firstFlowA), secondFlowA(secondFlowA), decibelRatingB(decibelRatingB), pressureB(pressureB),
35 firstFlowB(firstFlowB), secondFlowB(secondFlowB) {}
38 const double denominator = (pressureB - pressureA) * (decibelRatingB - decibelRatingA);
39 const double leakRateEstimate =
40 ((pressureB - linePressure) * (decibelRatingB - decibels)) / denominator * firstFlowA +
41 ((linePressure - pressureA) * (decibelRatingB - decibels)) / denominator * secondFlowA +
42 ((pressureB - linePressure) * (decibels - decibelRatingA)) / denominator * firstFlowB +
43 ((linePressure - pressureA) * (decibels - decibelRatingA)) / denominator * secondFlowB;
45 return leakRateEstimate;
51 double decibelRatingA;
55 double decibelRatingB;
63 OrificeMethodData(
const double airTemp,
const double atmPressure,
const double dischargeCoef,
const double diameter,
64 const double supplyPressure,
const int numOrifices)
65 : airTemp(airTemp), atmPressure(atmPressure), dischargeCoef(dischargeCoef), diameter(diameter),
66 supplyPressure(supplyPressure), numOrifices(numOrifices) {}
69 const double caPressurePSIA = atmPressure + supplyPressure;
72 const double airTempRankine = airTemp + 459.67;
74 const double caDensity = caPressurePSIA * 144 / (53.34 * airTempRankine);
75 const double standardDensity = atmPressure * 144 / (53.34 * airTempRankine);
76 const double sonicDensity = caDensity * std::pow((2 / 2.4), (1 / .4));
78 const double leakVelocity = std::pow(((2 * 1.4) / (1.4 + 1)) * 53.34 * airTempRankine * 32.2, 0.5);
79 const double leakRateLBMmin =
80 sonicDensity * (diameter * diameter) * (M_PI / (4 * 144)) * leakVelocity * 60 * dischargeCoef;
81 const double leakRateScfm = leakRateLBMmin / standardDensity;
82 const double leakRateEstimate = leakRateScfm * numOrifices;
83 return leakRateEstimate;
87 double airTemp, atmPressure, dischargeCoef, diameter, supplyPressure;
98 : hoursPerYear(hoursPerYear), utilityType(utilityType), utilityCost(utilityCost),
99 measurementMethod(measurementMethod), estimateMethodData(estimateMethodData),
100 decibelsMethodData(decibelsMethodData), bagMethod(bagMethod), orificeMethodData(orificeMethodData),
101 compressorElectricityData(compressorElectricityData), units(units) {}
103 int getHoursPerYear()
const {
return hoursPerYear; }
104 int getUtilityType()
const {
return utilityType; }
105 int getMeasurementMethod()
const {
return measurementMethod; }
106 int getUnits()
const {
return units; }
107 double getUtilityCost()
const {
return utilityCost; }
110 BagMethod getBagMethod()
const {
return bagMethod; }
115 int hoursPerYear, utilityType;
117 int measurementMethod;
129 Output(
double annualTotalElectricity,
double annualTotalElectricityCost,
double totalFlowRate,
130 double annualTotalFlowRate)
131 : annualTotalElectricity(annualTotalElectricity), annualTotalElectricityCost(annualTotalElectricityCost),
132 totalFlowRate(totalFlowRate), annualTotalFlowRate(annualTotalFlowRate) {}
135 double annualTotalElectricity = 0, annualTotalElectricityCost = 0, totalFlowRate = 0, annualTotalFlowRate = 0;
139 : compressedAirLeakSurveyInputVec(compressedAirLeakSurveyInputVec) {}
142 double annualTotalElectricity = 0, annualTotalElectricityCost = 0, totalFlowRate = 0, annualTotalFlowRate = 0;
144 for (
auto& compressedAirLeakSurveyInput : compressedAirLeakSurveyInputVec) {
145 double tmpAnnualTotalElectricity = 0, tmpAnnualTotalElectricityCost = 0, tmpTotalFlowRate = 0,
146 tmpAnnualTotalFlowRate = 0;
149 if (compressedAirLeakSurveyInput.getMeasurementMethod() == 0) {
150 EstimateMethodData estimateMethodData = compressedAirLeakSurveyInput.getEstimateMethodData();
151 tmpTotalFlowRate = estimateMethodData.getLeakRateEstimate() * compressedAirLeakSurveyInput.getUnits();
152 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
155 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 1) {
156 DecibelsMethodData decibelsMethodData = compressedAirLeakSurveyInput.getDecibelsMethodData();
157 tmpTotalFlowRate = decibelsMethodData.calculate() * compressedAirLeakSurveyInput.getUnits();
158 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
161 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 2) {
162 BagMethod bagMethod = compressedAirLeakSurveyInput.getBagMethod();
165 tmpTotalFlowRate = bagOutput.flowRate * compressedAirLeakSurveyInput.getUnits();
166 tmpAnnualTotalFlowRate = bagOutput.annualConsumption * compressedAirLeakSurveyInput.getUnits();
169 else if (compressedAirLeakSurveyInput.getMeasurementMethod() == 3) {
170 OrificeMethodData orificeMethodData = compressedAirLeakSurveyInput.getOrificeMethodData();
171 tmpTotalFlowRate = orificeMethodData.calculate() * compressedAirLeakSurveyInput.getUnits();
172 tmpAnnualTotalFlowRate = (compressedAirLeakSurveyInput.getHoursPerYear() * tmpTotalFlowRate * 60);
176 if (compressedAirLeakSurveyInput.getUtilityType() == 0) {
177 tmpAnnualTotalElectricityCost = compressedAirLeakSurveyInput.getUtilityCost() * tmpAnnualTotalFlowRate;
180 else if (compressedAirLeakSurveyInput.getUtilityType() == 1) {
182 compressedAirLeakSurveyInput.getCompressorElectricityData();
183 double electricityCalculation = compressorElectricityData.calculate();
184 tmpAnnualTotalElectricity = electricityCalculation * tmpAnnualTotalFlowRate;
185 tmpAnnualTotalElectricityCost =
186 tmpAnnualTotalElectricity * compressedAirLeakSurveyInput.getUtilityCost();
188 annualTotalElectricity += tmpAnnualTotalElectricity;
189 annualTotalElectricityCost += tmpAnnualTotalElectricityCost;
190 totalFlowRate += tmpTotalFlowRate;
191 annualTotalFlowRate += tmpAnnualTotalFlowRate;
195 annualTotalFlowRate);
197 std::vector<CompressedAirLeakSurveyInput>
const& getCompressedAirLeakSurveyInputVec()
const {
198 return compressedAirLeakSurveyInputVec;
200 void setCompressedAirReductionInputVec(std::vector<CompressedAirReductionInput>& compressedAirReductionInputVec);
203 std::vector<CompressedAirLeakSurveyInput> compressedAirLeakSurveyInputVec;