1 #ifndef AMO_TOOLS_SUITE_STEAMSYSTEMMODELERTOOL_H 2 #define AMO_TOOLS_SUITE_STEAMSYSTEMMODELERTOOL_H 11 Point(
double x,
double y)
14 double getX()
const {
return x_; }
16 double getY()
const {
return y_; }
36 struct SteamPropertiesOutput {
37 SteamPropertiesOutput(
const double temperature,
const double pressure,
const double quality,
38 const double specificVolume,
const double density,
const double specificEnthalpy,
39 const double specificEntropy,
const double internalEnergy = 0):
40 temperature(temperature), pressure(pressure), quality(quality), specificVolume(specificVolume),
41 density(density), specificEnthalpy(specificEnthalpy), specificEntropy(specificEntropy),
42 internalEnergy(internalEnergy)
45 friend std::ostream &operator<<(std::ostream &stream,
const SteamPropertiesOutput &props);
47 SteamPropertiesOutput() =
default;
49 double temperature = 0, pressure = 0, quality = 0, specificVolume = 0, density = 0;
50 double specificEnthalpy = 0, specificEntropy = 0, internalEnergy = 0;
67 struct SaturatedPropertiesOutput {
68 SaturatedPropertiesOutput(
const double temperature,
const double pressure,
69 const double gasSpecificVolume,
const double gasSpecificEnthalpy,
const double gasSpecificEntropy,
70 const double liquidSpecificVolume,
const double liquidSpecificEnthalpy,
const double liquidSpecificEntropy,
71 const double evaporationSpecificVolume,
const double evaporationSpecificEnthalpy,
const double evaporationSpecificEntropy):
72 temperature(temperature), pressure(pressure),
73 gasSpecificVolume(gasSpecificVolume), gasSpecificEnthalpy(gasSpecificEnthalpy), gasSpecificEntropy(gasSpecificEntropy),
74 liquidSpecificVolume(liquidSpecificVolume), liquidSpecificEnthalpy(liquidSpecificEnthalpy), liquidSpecificEntropy(liquidSpecificEntropy),
75 evaporationSpecificVolume(evaporationSpecificVolume), evaporationSpecificEnthalpy(evaporationSpecificEnthalpy), evaporationSpecificEntropy(evaporationSpecificEntropy)
78 SaturatedPropertiesOutput() =
default;
80 double temperature = 0, pressure = 0;
81 double gasSpecificVolume = 0, gasSpecificEnthalpy = 0, gasSpecificEntropy = 0;
82 double liquidSpecificVolume = 0, liquidSpecificEnthalpy = 0, liquidSpecificEntropy = 0;
83 double evaporationSpecificVolume = 0, evaporationSpecificEnthalpy = 0, evaporationSpecificEntropy = 0;
99 struct FluidProperties:
public SteamPropertiesOutput {
100 FluidProperties(
const double massFlow,
const double energyFlow,
const double temperature,
const double pressure,
101 const double quality,
const double specificVolume,
const double density,
const double specificEnthalpy,
102 const double specificEntropy,
const double internalEnergy = 0):
103 SteamPropertiesOutput(temperature, pressure, quality, specificVolume, density, specificEnthalpy,
104 specificEntropy, internalEnergy),
105 massFlow(massFlow), energyFlow(energyFlow)
108 FluidProperties(
const double massFlow,
const double energyFlow, SteamPropertiesOutput
const & sp):
109 SteamPropertiesOutput(sp.temperature, sp.pressure, sp.quality, sp.specificVolume, sp.density,
110 sp.specificEnthalpy, sp.specificEntropy, sp.internalEnergy),
111 massFlow(massFlow), energyFlow(energyFlow)
114 friend std::ostream &operator<<(std::ostream &stream,
const FluidProperties &props);
115 friend std::ostream &operator<<(std::ostream &stream, const std::shared_ptr<FluidProperties> &props);
117 FluidProperties() =
default;
119 double massFlow = 0, energyFlow = 0;
142 static int regionSelect(
double pressure,
double temperature);
152 static SteamPropertiesOutput region1(
double temperature,
double pressure);
162 static SteamPropertiesOutput region2(
double temperature,
double pressure);
172 static SteamPropertiesOutput region3(
double temperature,
double pressure);
174 static SteamPropertiesOutput region3Density(
double density,
double temperature);
184 static double region4(
double temperature);
194 static double backwardPressureEnthalpyRegion1(
double pressure,
double enthalpy);
204 static double backwardPressureEnthalpyRegion2A(
double pressure,
double enthalpy);
214 static double backwardPressureEnthalpyRegion2B(
double pressure,
double enthalpy);
224 static double backwardPressureEnthalpyRegion2C(
double pressure,
double enthalpy);
234 static double backwardPressureEntropyRegion2A(
double pressure,
double entropy);
244 static double backwardPressureEntropyRegion2B(
double pressure,
double entropy);
254 static double backwardPressureEntropyRegion2C(
double pressure,
double entropy);
264 static double backwardPressureEntropyRegion1(
double pressure,
double entropy);
276 static Point generatePoint(
int region, SteamSystemModelerTool::Key key,
double var1,
double var2);
287 static double linearTestPoint(
double X,
Point point1,
Point point2);
290 static double backwardRegion3Exact(
double pressure,
double X, SteamSystemModelerTool::Key key);
298 static double backwardPressureEnthalpyRegion3(
double pressure,
double enthalpy);
307 static double backwardPressureEntropyRegion3(
double pressure,
double entropy);
309 static double backwardPressureEnthalpyRegion1Exact(
double pressure,
double enthalpy);
311 static double backwardPressureEntropyRegion1Exact(
double pressure,
double entropy);
319 static double backwardPressureEnthalpyRegion2AExact(
double pressure,
double enthalpy);
327 static double backwardPressureEntropyRegion2AExact(
double pressure,
double entropy);
335 static double backwardPressureEnthalpyRegion2BExact(
double pressure,
double enthalpy);
343 static double backwardPressureEntropyRegion2BExact(
double pressure,
double entropy);
351 static double backwardPressureEnthalpyRegion2CExact(
double pressure,
double enthalpy);
359 static double backwardPressureEntropyRegion2CExact(
double pressure,
double entropy);
370 static double backwardExact(
int region, SteamSystemModelerTool::Key key, SteamSystemModelerTool::Region regionFunction ,
double pressure,
double var2);
377 static constexpr
double PRESSURE_MIN = 0.01;
381 static constexpr
double TEMPERATURE_MIN = 273.15;
385 static constexpr
double PRESSURE_Tp = 16.5291643;
390 static constexpr
double TEMPERATURE_Tp = 623.15;
395 static constexpr
double PRESSURE_CRIT = 22.064;
400 static constexpr
double TEMPERATURE_CRIT = 647.096;
405 static constexpr
double PRESSURE_MAX = 100;
410 static constexpr
double TEMPERATURE_MAX = 1073.15;
415 static constexpr
double TEMPERATURE_REGION3_MAX = 863.15;
423 static inline double boundaryByTemperatureRegion3to2(
const double t) {
424 return 0.34805185628969E+03 - 0.11671859879975E+01 * t + 0.10192970039326E-02 * std::pow(t, 2.0);
434 static inline double boundaryByPressureRegion3to2(
const double p) {
435 return 0.57254459862746E+03 + std::pow((p - 0.13918839778870E+02) / 0.10192970039326E-02, 0.5);
443 #endif //AMO_TOOLS_SUITE_STEAMSYSTEMMODELERTOOL_H