From da23717368c4a7d9e2affead09e1fa68e5ee8d13 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Sat, 25 Oct 2014 09:35:42 -0400 Subject: [PATCH] Fix problem with pmin Closes https://github.com/CoolProp/CoolProp/issues/189 Signed-off-by: Ian Bell --- src/AbstractState.cpp | 6 ++++-- src/DataStructures.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/AbstractState.cpp b/src/AbstractState.cpp index 253624c1..3fb6d72a 100644 --- a/src/AbstractState.cpp +++ b/src/AbstractState.cpp @@ -172,6 +172,9 @@ double AbstractState::trivial_keyed_output(int key) return Tmax(); case iP_max: return pmax(); + case iP_min: + case iP_triple: + return this->p_triple(); case iT_reducing: return get_reducing_state().T; case irhomolar_reducing: @@ -184,8 +187,7 @@ double AbstractState::trivial_keyed_output(int key) return this->rhomolar_critical(); case irhomass_critical: return this->rhomolar_critical()*molar_mass(); - case iP_triple: - return this->p_triple(); + default: throw ValueError(format("This input [%d: \"%s\"] is not valid for trivial_keyed_output",key,get_parameter_information(key,"short").c_str())); } diff --git a/src/DataStructures.cpp b/src/DataStructures.cpp index 850fd60c..40fcbd16 100644 --- a/src/DataStructures.cpp +++ b/src/DataStructures.cpp @@ -126,6 +126,7 @@ public: index_map.insert(std::pair("Tmin", iT_min)); index_map.insert(std::pair("Tmax", iT_max)); index_map.insert(std::pair("pmax", iP_max)); + index_map.insert(std::pair("pmin", iP_min)); index_map.insert(std::pair("molemass", imolar_mass)); index_map.insert(std::pair("A", ispeed_sound));