| 1166 | #endif |
| 1167 | |
| 1168 | std::string phase_lookup_string(phases Phase) { |
| 1169 | switch (Phase) { |
| 1170 | case iphase_liquid: ///< Liquid |
| 1171 | return "liquid"; |
| 1172 | case iphase_supercritical: ///< Supercritical (p > pc, T > Tc) |
| 1173 | return "supercritical"; |
| 1174 | case iphase_supercritical_gas: ///< Supercritical gas (p < pc, T > Tc) |
| 1175 | return "supercritical_gas"; |
| 1176 | case iphase_supercritical_liquid: ///< Supercritical liquid (p > pc, T < Tc) |
| 1177 | return "supercritical_liquid"; |
| 1178 | case iphase_critical_point: ///< At the critical point |
| 1179 | return "critical_point"; |
| 1180 | case iphase_gas: ///< Subcritical gas |
| 1181 | return "gas"; |
| 1182 | case iphase_twophase: ///< Twophase (between saturation curves - inclusive) |
| 1183 | return "twophase"; |
| 1184 | case iphase_unknown: ///< Unknown phase |
| 1185 | return "unknown"; |
| 1186 | case iphase_not_imposed: |
| 1187 | return "not_imposed"; |
| 1188 | } |
| 1189 | throw ValueError("I should never be thrown"); |
| 1190 | } |
| 1191 | std::string PhaseSI(const std::string& Name1, double Prop1, const std::string& Name2, double Prop2, const std::string& FluidName) { |
| 1192 | double Phase_double = PropsSI("Phase", Name1, Prop1, Name2, Prop2, FluidName); // Attempt to get "Phase" from PropsSI() |
| 1193 | if (!ValidNumber(Phase_double)) { // if the returned phase is invalid... |