| 163 | return Props(Output, Name1[0], Prop1, Name2[0], Prop2, Ref); |
| 164 | } |
| 165 | EXPORT_CODE double CONVENTION Props(const char* Output, const char Name1, double Prop1, const char Name2, double Prop2, const char* Ref) { |
| 166 | fpu_reset_guard guard; |
| 167 | try { |
| 168 | // Get parameter indices |
| 169 | std::string sName1 = std::string(1, Name1), sName2 = std::string(1, Name2); |
| 170 | CoolProp::parameters iOutput = CoolProp::get_parameter_index(Output); |
| 171 | if (!CoolProp::is_trivial_parameter(iOutput)) { |
| 172 | CoolProp::parameters iName1 = CoolProp::get_parameter_index(sName1); |
| 173 | CoolProp::parameters iName2 = CoolProp::get_parameter_index(sName2); |
| 174 | |
| 175 | // Convert inputs to SI |
| 176 | Prop1 = convert_from_kSI_to_SI(iName1, Prop1); |
| 177 | Prop2 = convert_from_kSI_to_SI(iName2, Prop2); |
| 178 | } |
| 179 | |
| 180 | // Call the SI function |
| 181 | double val = PropsSI(Output, sName1.c_str(), Prop1, sName2.c_str(), Prop2, Ref); |
| 182 | |
| 183 | // Convert back to unit system |
| 184 | return convert_from_SI_to_kSI(iOutput, val); |
| 185 | } catch (std::exception& e) { |
| 186 | CoolProp::set_error_string(e.what()); |
| 187 | } catch (...) { |
| 188 | CoolProp::set_error_string("Undefined error"); |
| 189 | } |
| 190 | return _HUGE; |
| 191 | } |
| 192 | EXPORT_CODE double CONVENTION saturation_ancillary(const char* fluid_name, const char* output, int Q, const char* input, double value) { |
| 193 | fpu_reset_guard guard; |
| 194 | try { |