23#include "steamModeler/SteamProperties.h"
27 enum class UtilityType { steam, electric, natural_gas };
30 SteamLeakSurveyResults(
const double leakRate,
const double steamLoss,
const double energyLoss,
const double leakCost)
31 : leakRate(leakRate), steamLoss(steamLoss), energyLoss(energyLoss), leakCost(leakCost) {}
33 const double leakRate, steamLoss, energyLoss, leakCost;
47 SteamLeakSurvey(
const double operatingTime,
const double steamTemp,
const double steamPressure,
const double costOfElectricity,
48 const double leakPressure,
const double leakTemp,
const double feedwaterTemp,
49 const double steamCost) :
50 SteamLeakSurvey(operatingTime, steamTemp, steamPressure, costOfElectricity,
51 leakPressure, leakTemp, feedwaterTemp,
52 0, 0, UtilityType::steam, 0, 1, steamCost) {}
66 SteamLeakSurvey(
const double operatingTime,
const double steamTemp,
const double steamPressure,
const double costOfElectricity,
67 const double leakPressure,
const double leakTemp,
const double feedwaterTemp,
68 const double boilerEfficiency,
const double systemEfficiency) :
69 SteamLeakSurvey(operatingTime, steamTemp, steamPressure, costOfElectricity,
70 leakPressure, leakTemp, feedwaterTemp,
71 boilerEfficiency, systemEfficiency, UtilityType::electric){}
87 SteamLeakSurvey(
const double operatingTime,
const double steamTemp,
const double steamPressure,
const double costOfElectricity,
88 const double leakPressure,
const double leakTemp,
const double feedwaterTemp,
89 const double boilerEfficiency,
const double systemEfficiency,
90 const double fuelCost,
const double fuelEnergyFactor = 1) :
91 SteamLeakSurvey(operatingTime, steamTemp, steamPressure, costOfElectricity,
92 leakPressure, leakTemp, feedwaterTemp,
93 boilerEfficiency, systemEfficiency, UtilityType::natural_gas, fuelCost, fuelEnergyFactor){}
111 SteamLeakSurvey(
const double operatingTime,
const double steamTemp,
const double steamPressure,
const double costOfElectricity,
112 const double leakPressure,
const double leakTemp,
const double feedwaterTemp,
113 const double boilerEfficiency,
const double systemEfficiency,
const UtilityType utilityType,
114 const double fuelCost = 0,
const double fuelEnergyFactor = 1,
const double steamCost = 0) :
115 operatingTime(operatingTime), steamPressure(steamPressure), leakPressure(leakPressure), costOfElectricity(costOfElectricity) {
123 const auto steamProperties =
SteamProperties(steamPressureMPa, SteamProperties::ThermodynamicQuantity::TEMPERATURE, steamTempK).
calculate();
124 specificHeatRatio = steamProperties.isentropicExponent;
125 steamSpecificEnthalpy = steamProperties.specificEnthalpy;
126 isentropicEnthalpy =
SteamProperties(leakPressureMPa, SteamProperties::ThermodynamicQuantity::ENTROPY,steamProperties.specificEntropy).
calculate().specificEnthalpy;
127 leakEnthalpy =
SteamProperties(leakPressureMPa, SteamProperties::ThermodynamicQuantity::TEMPERATURE,leakTempK).
calculate().specificEnthalpy;
128 feedwaterEnthalpy =
SteamProperties(feedWaterPressureMPa, SteamProperties::ThermodynamicQuantity::TEMPERATURE, feedwaterTempK).
calculate().specificEnthalpy;
130 double leakSpecificVolume =
SteamProperties(leakPressureMPa, SteamProperties::ThermodynamicQuantity::TEMPERATURE, leakTempK).
calculate().specificVolume;
138 leakDensity = 1 / leakSpecificVolume;
140 switch (utilityType) {
141 case UtilityType::natural_gas:
142 this->steamCost = fuelCost * fuelEnergyFactor * (steamSpecificEnthalpy - feedwaterEnthalpy) / 1000000 / (boilerEfficiency/100) / (systemEfficiency/100);
144 case UtilityType::electric:
145 this->steamCost = costOfElectricity * 293.071 * (steamSpecificEnthalpy - feedwaterEnthalpy) / 1000000 / (boilerEfficiency/100) / (systemEfficiency/100);
147 case UtilityType::steam :
148 this->steamCost = steamCost;
159 return calculate(leakRate);
169 return calculate(leakRate, turbineEfficiency);
181 const double criticalPressureRatio = std::pow(2 / (specificHeatRatio+1), (specificHeatRatio+1) / (specificHeatRatio-1));
182 const double pressureRatio = atmPressure / (leakPressure + atmPressure);
183 const double minPressure = atmPressure / (criticalPressureRatio - atmPressure);
185 if (criticalPressureRatio <= pressureRatio) {
186 throw std::runtime_error(
"Steam Leak with Orifice method, Leak pressure (" + std::to_string(leakPressure) +
187 ") must be at least minimum pressure (" + std::to_string(minPressure) +
")");
190 const double leakRate = dischargeCoef * M_PI / 4 * holeSize * holeSize *
191 std::sqrt(specificHeatRatio * leakDensity * (leakPressure + atmPressure) * 32.2 * 12 * criticalPressureRatio) * 3600;
193 return calculate(leakRate, turbineEfficiency);
207 return calculate(leakRate, turbineEfficiency);
214 if (turbineEfficiency != 0) {
215 return steamCost - costOfElectricity * 293.071 * (steamSpecificEnthalpy - isentropicEnthalpy) / 1000000 * (turbineEfficiency/100);
229 SteamLeakSurveyResults calculate(
const double leakRate,
const double turbineEfficiency = 0)
const {
230 const double steamLoss = operatingTime * leakRate / 1000;
231 const double energyLoss = leakEnthalpy * steamLoss / 1000;
233 const double leakCost = steamLoss *
costOfSteam(turbineEfficiency) * 1000 *
234 (leakEnthalpy - feedwaterEnthalpy) / (steamSpecificEnthalpy - feedwaterEnthalpy);
236 return {leakRate, steamLoss, energyLoss, leakCost};
239 double operatingTime = 0, steamPressure = 0, leakPressure = 0, costOfElectricity = 0, steamCost = 0;
240 double steamSpecificEnthalpy = 1256.12;
241 double isentropicEnthalpy = 1220.35;
242 double feedwaterEnthalpy = 38.16;
243 double leakEnthalpy = 1208.07;
244 double leakDensity = 0;
245 double specificHeatRatio = 1.3;
static double estimate(const double pressure, const double plumeLength, const double ambTemp)
SteamLeakSurveyResults estimateMethodTurbineCalc(const double turbineEfficiency, const double leakRate) const
double costOfSteam() const
SteamLeakSurveyResults orificeMethodCalc(const double turbineEfficiency, const double holeSize, const double dischargeCoef, const double atmPressure) const
SteamLeakSurvey(const double operatingTime, const double steamTemp, const double steamPressure, const double costOfElectricity, const double leakPressure, const double leakTemp, const double feedwaterTemp, const double boilerEfficiency, const double systemEfficiency, const double fuelCost, const double fuelEnergyFactor=1)
double costOfSteam(const double turbineEfficiency) const
SteamLeakSurveyResults estimateMethodPRVCalc(const double leakRate) const
SteamLeakSurveyResults plumeMethodCalc(const double turbineEfficiency, const double plumeLength, const double ambTemp) const
SteamLeakSurvey(const double operatingTime, const double steamTemp, const double steamPressure, const double costOfElectricity, const double leakPressure, const double leakTemp, const double feedwaterTemp, const double boilerEfficiency, const double systemEfficiency, const UtilityType utilityType, const double fuelCost=0, const double fuelEnergyFactor=1, const double steamCost=0)
SteamLeakSurvey(const double operatingTime, const double steamTemp, const double steamPressure, const double costOfElectricity, const double leakPressure, const double leakTemp, const double feedwaterTemp, const double steamCost)
SteamLeakSurvey(const double operatingTime, const double steamTemp, const double steamPressure, const double costOfElectricity, const double leakPressure, const double leakTemp, const double feedwaterTemp, const double boilerEfficiency, const double systemEfficiency)
SteamSystemModelerTool::SteamPropertiesOutput calculate()
Defines physical constants and unit conversions.
constexpr double kFt3ToIn3
convert ft3 -> in3.
constexpr double kWaterSurfacePressure
Surface pressure exerted by water @ sea level lb/in2.
constexpr double kKJPerKgToBtuPerLb
convert kJ/kg -> btu/lb.
constexpr double psigToMPa(const double psig)
convert psig to MPa.
constexpr double fahrenheitToKelvin(double fahrenheit)
Convert Fahrenheit to Kelvin.
constexpr double kM3PerKgToFt3PerLb
convert m3/kg -> ft3/lb.
Implementations of DOE's Quantify and Eliminate Steam Leaks.