mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
speed of sound added back to high level wrapper
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@ AbstractState * AbstractState::factory(const std::string &backend, const std::st
|
||||
static std::string HEOS_string = "HEOS";
|
||||
if (!backend.compare("HEOS"))
|
||||
{
|
||||
if (fluid_string.find('&') == -1){
|
||||
if (fluid_string.find('&') == std::string::npos){
|
||||
return new HelmholtzEOSBackend(&get_fluid(fluid_string));
|
||||
}
|
||||
else{
|
||||
@@ -31,7 +31,7 @@ AbstractState * AbstractState::factory(const std::string &backend, const std::st
|
||||
}
|
||||
else if (!backend.compare("REFPROP"))
|
||||
{
|
||||
if (fluid_string.find('&') == -1){
|
||||
if (fluid_string.find('&') == std::string::npos){
|
||||
return new REFPROPBackend(fluid_string);
|
||||
}
|
||||
else{
|
||||
@@ -57,7 +57,7 @@ AbstractState * AbstractState::factory(const std::string &backend, const std::st
|
||||
{
|
||||
std::size_t idel = fluid_string.find("::");
|
||||
// Backend has not been specified, and we have to figure out what the backend is by parsing the string
|
||||
if (idel == -1) // No '::' found, no backend specified, try HEOS, otherwise a failure
|
||||
if (idel == std::string::npos) // No '::' found, no backend specified, try HEOS, otherwise a failure
|
||||
{
|
||||
// Figure out what backend to use
|
||||
return factory(HEOS_string, fluid_string);
|
||||
@@ -196,6 +196,8 @@ double AbstractState::keyed_output(int key)
|
||||
return get_reducing().T;
|
||||
case irhomolar_reducing:
|
||||
return get_reducing().rhomolar;
|
||||
case ispeed_sound:
|
||||
return speed_sound();
|
||||
//case iT_critical:
|
||||
// return get_critical().T;
|
||||
//case irhomolar_critical:
|
||||
|
||||
@@ -50,7 +50,8 @@ parameter_info parameter_info_list[] = {
|
||||
parameter_info(irhomolar_critical, "rhomolar_critical","O","mol/m^3","Molar density at critical point"),
|
||||
parameter_info(iT_reducing, "T_reducing","O","K","Temperature at the reducing point"),
|
||||
parameter_info(iT_critical, "T_critical","O","K","Temperature at the critical point"),
|
||||
parameter_info(iisothermal_compressibility, "isothermal_compressibility","O","1/Pa","Isothermal compressibility")
|
||||
parameter_info(iisothermal_compressibility, "isothermal_compressibility","O","1/Pa","Isothermal compressibility"),
|
||||
parameter_info(ispeed_sound, "speed_of_sound","O","m/s","Speed of sound")
|
||||
};
|
||||
|
||||
class ParameterInformation
|
||||
@@ -157,7 +158,7 @@ input_pair_info input_pair_list[] = {
|
||||
input_pair_info(SmolarT_INPUTS, "SmolarT_INPUTS", "Entropy in J/mol/K, Temperature in K"),
|
||||
input_pair_info(TUmass_INPUTS, "TUmass_INPUTS", "Temperature in K, Internal energy in J/kg"),
|
||||
input_pair_info(TUmolar_INPUTS, "TUmolar_INPUTS", "Temperature in K, Internal energy in J/mol"),
|
||||
|
||||
|
||||
input_pair_info(DmassP_INPUTS, "DmassP_INPUTS", "Mass density in kg/m^3, Pressure in Pa"),
|
||||
input_pair_info(DmolarP_INPUTS, "DmolarP_INPUTS", "Molar density in mol/m^3, Pressure in Pa"),
|
||||
input_pair_info(HmassP_INPUTS, "HmassP_INPUTS", "Enthalpy in J/kg, Pressure in Pa"),
|
||||
@@ -206,4 +207,4 @@ std::string get_input_pair_long_desc(int pair)
|
||||
return input_pair_information.long_desc_map[pair];
|
||||
}
|
||||
|
||||
} /* namespace CoolProp */
|
||||
} /* namespace CoolProp */
|
||||
|
||||
Reference in New Issue
Block a user