diff --git a/dev/fluids/R404A.json b/dev/fluids/R404A.json index 1278d073..10fafc17 100644 --- a/dev/fluids/R404A.json +++ b/dev/fluids/R404A.json @@ -228,6 +228,14 @@ "smolar": 153.46743148019652, "smolar_units": "J/mol/K" }, + "pressure_max_sat": { + "T": 345.2707352, + "T_units": "K", + "p": 3734900.064, + "p_units": "Pa", + "rhomolar": 4972.369784, + "rhomolar_units": "mol/m^3" + }, "reducing": { "T": 345.27, "T_units": "K", @@ -263,6 +271,14 @@ "rhomolar_units": "mol/m^3", "smolar": 165.11140069543768, "smolar_units": "J/mol/K" + }, + "temperature_max_sat": { + "T": 345.2714161, + "T_units": "K", + "p": 3734844.658, + "p_units": "Pa", + "rhomolar": 4929.111461, + "rhomolar_units": "mol/m^3" } }, "T_max": 450, @@ -425,22 +441,6 @@ "rhomolar": 4939.999999999999, "rhomolar_units": "mol/m^3" }, - "pressure_max_sat": { - "T": 345.2707352, - "T_units": "K", - "p": 3734900.064, - "p_units": "Pa", - "rhomolar": 4972.369784, - "rhomolar_units": "mol/m^3" - }, - "temperature_max_sat": { - "T": 345.2714161, - "T_units": "K", - "p": 3734844.658, - "p_units": "Pa", - "rhomolar": 4929.111461, - "rhomolar_units": "mol/m^3" - }, "triple_liquid": { "T": 200.0, "T_units": "K", diff --git a/dev/fluids/R407C.json b/dev/fluids/R407C.json index c84f7a67..246983fe 100644 --- a/dev/fluids/R407C.json +++ b/dev/fluids/R407C.json @@ -228,6 +228,14 @@ "smolar": 144.75289659421776, "smolar_units": "J/mol/K" }, + "pressure_max_sat": { + "T": 359.2360941, + "T_units": "K", + "p": 4640147.348, + "p_units": "Pa", + "rhomolar": 5780.415923, + "rhomolar_units": "mol/m^3" + }, "reducing": { "T": 359.345, "T_units": "K", @@ -263,6 +271,14 @@ "rhomolar_units": "mol/m^3", "smolar": 167.25075151048213, "smolar_units": "J/mol/K" + }, + "temperature_max_sat": { + "T": 359.3438976, + "T_units": "K", + "p": 4630980.714, + "p_units": "Pa", + "rhomolar": 5244.554217, + "rhomolar_units": "mol/m^3" } }, "T_max": 450, @@ -421,22 +437,6 @@ "rhomolar": 5260.000046401775, "rhomolar_units": "mol/m^3" }, - "pressure_max_sat": { - "T": 359.2360941, - "T_units": "K", - "p": 4640147.348, - "p_units": "Pa", - "rhomolar": 5780.415923, - "rhomolar_units": "mol/m^3" - }, - "temperature_max_sat": { - "T": 359.3438976, - "T_units": "K", - "p": 4630980.714, - "p_units": "Pa", - "rhomolar": 5244.554217, - "rhomolar_units": "mol/m^3" - }, "triple_liquid": { "T": 200.0, "T_units": "K", diff --git a/dev/fluids/R410A.json b/dev/fluids/R410A.json index 60a6b7a5..544f4c93 100644 --- a/dev/fluids/R410A.json +++ b/dev/fluids/R410A.json @@ -228,6 +228,14 @@ "smolar": 119.87551795269343, "smolar_units": "J/mol/K" }, + "pressure_max_sat": { + "T": 344.4942687, + "T_units": "K", + "p": 4901296.586, + "p_units": "Pa", + "rhomolar": 6365.195238, + "rhomolar_units": "mol/m^3" + }, "reducing": { "T": 344.494, "T_units": "K", @@ -263,6 +271,14 @@ "rhomolar_units": "mol/m^3", "smolar": 146.36703706533677, "smolar_units": "J/mol/K" + }, + "temperature_max_sat": { + "T": 344.4943434, + "T_units": "K", + "p": 4901288.901, + "p_units": "Pa", + "rhomolar": 6350.735221, + "rhomolar_units": "mol/m^3" } }, "T_max": 450, @@ -421,22 +437,6 @@ "rhomolar": 6323.999999999999, "rhomolar_units": "mol/m^3" }, - "pressure_max_sat": { - "T": 344.4942687, - "T_units": "K", - "p": 4901296.586, - "p_units": "Pa", - "rhomolar": 6365.195238, - "rhomolar_units": "mol/m^3" - }, - "temperature_max_sat": { - "T": 344.4943434, - "T_units": "K", - "p": 4901288.901, - "p_units": "Pa", - "rhomolar": 6350.735221, - "rhomolar_units": "mol/m^3" - }, "triple_liquid": { "T": 200.0, "T_units": "K", diff --git a/dev/fluids/R507A.json b/dev/fluids/R507A.json index 996e732b..befe3dea 100644 --- a/dev/fluids/R507A.json +++ b/dev/fluids/R507A.json @@ -228,6 +228,14 @@ "smolar": 154.19725729401733, "smolar_units": "J/mol/K" }, + "pressure_max_sat": { + "T": 343.7658099, + "T_units": "K", + "p": 3704883.269, + "p_units": "Pa", + "rhomolar": 4961.302819, + "rhomolar_units": "mol/m^3" + }, "reducing": { "T": 343.765, "T_units": "K", @@ -263,6 +271,14 @@ "rhomolar_units": "mol/m^3", "smolar": 165.25997489864025, "smolar_units": "J/mol/K" + }, + "temperature_max_sat": { + "T": 343.7658302, + "T_units": "K", + "p": 3704881.627, + "p_units": "Pa", + "rhomolar": 4953.55251, + "rhomolar_units": "mol/m^3" } }, "T_max": 450, @@ -431,22 +447,6 @@ "rhomolar": 4964.029650250053, "rhomolar_units": "mol/m^3" }, - "pressure_max_sat": { - "T": 343.7658099, - "T_units": "K", - "p": 3704883.269, - "p_units": "Pa", - "rhomolar": 4961.302819, - "rhomolar_units": "mol/m^3" - }, - "temperature_max_sat": { - "T": 343.7658302, - "T_units": "K", - "p": 3704881.627, - "p_units": "Pa", - "rhomolar": 4953.55251, - "rhomolar_units": "mol/m^3" - }, "triple_liquid": { "T": 200.0, "T_units": "K", diff --git a/src/Backends/Helmholtz/Fluids/FluidLibrary.h b/src/Backends/Helmholtz/Fluids/FluidLibrary.h index cef386f7..7614dc4e 100644 --- a/src/Backends/Helmholtz/Fluids/FluidLibrary.h +++ b/src/Backends/Helmholtz/Fluids/FluidLibrary.h @@ -346,16 +346,16 @@ protected: if (EOS_json["STATES"].HasMember("pressure_max_sat")){ rapidjson::Value &s = EOS_json["STATES"]["pressure_max_sat"]; - EOS.max_sat_T.T = cpjson::get_double(s, "T"); - EOS.max_sat_T.p = cpjson::get_double(s, "p"); - EOS.max_sat_T.rhomolar = cpjson::get_double(s, "rhomolar"); + EOS.max_sat_p.T = cpjson::get_double(s, "T"); + EOS.max_sat_p.p = cpjson::get_double(s, "p"); + EOS.max_sat_p.rhomolar = cpjson::get_double(s, "rhomolar"); } if (EOS_json["STATES"].HasMember("temperature_max_sat")){ rapidjson::Value &s = EOS_json["STATES"]["temperature_max_sat"]; - EOS.max_sat_p.T = cpjson::get_double(s, "T"); - EOS.max_sat_p.p = cpjson::get_double(s, "p"); - EOS.max_sat_p.rhomolar = cpjson::get_double(s, "rhomolar"); + EOS.max_sat_T.T = cpjson::get_double(s, "T"); + EOS.max_sat_T.p = cpjson::get_double(s, "p"); + EOS.max_sat_T.rhomolar = cpjson::get_double(s, "rhomolar"); } if (EOS_json.HasMember("critical_region_splines")){ diff --git a/src/Backends/Incompressible/IncompressibleBackend.h b/src/Backends/Incompressible/IncompressibleBackend.h index 3b8c0c5f..5f594250 100644 --- a/src/Backends/Incompressible/IncompressibleBackend.h +++ b/src/Backends/Incompressible/IncompressibleBackend.h @@ -124,6 +124,15 @@ public: long double calc_fraction_max(void){return fluid->getxmax();}; long double calc_T_freeze(void){ return fluid->Tfreeze(_p, _fractions[0]);}; + + long double calc_melting_line(int param, int given, long double value){ + if (param == iT && given == iP){ + return fluid->Tfreeze(value, _fractions[0]); + } + else{ + throw ValueError("For incompressibles, the only valid inputs to calc_melting_line are T(p)"); + } + }; std::string calc_name(void){return fluid->getDescription();}; };