mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Make the gas constant an adjustable parameter and update to CODATA 2014 value
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
X(DONT_CHECK_PROPERTY_LIMITS, "DONT_CHECK_PROPERTY_LIMITS", false, "If true, when possible, CoolProp will skip checking whether values are inside the property limits") \
|
||||
X(HENRYS_LAW_TO_GENERATE_VLE_GUESSES, "HENRYS_LAW_TO_GENERATE_VLE_GUESSES", false, "If true, when doing water-based mixture dewpoint calculations, use Henry's Law to generate guesses for liquid-phase composition") \
|
||||
X(PHASE_ENVELOPE_STARTING_PRESSURE_PA, "PHASE_ENVELOPE_STARTING_PRESSURE_PA", 100.0, "Starting pressure [Pa] for phase envelope construction") \
|
||||
X(R_U_CODATA, "R_U_CODATA", 8.3144598, "The value for the ideal gas constant in J/mol/K according to CODATA 2014. This value is used to harmonize all the ideal gas constants. This is especially important in the critical region.") \
|
||||
|
||||
// Use preprocessor to create the Enum
|
||||
enum configuration_keys{
|
||||
|
||||
@@ -197,8 +197,6 @@ std::string get_csv_parameter_list();
|
||||
/// These are constants for the compositions
|
||||
enum composition_types{IFRAC_MASS, IFRAC_MOLE, IFRAC_VOLUME, IFRAC_UNDEFINED, IFRAC_PURE};
|
||||
|
||||
const CoolPropDbl R_u_CODATA = 8.3144621; ///< The value for the ideal gas constant in J/mol/K according to CODATA 2010. This value is used to harmonize all the ideal gas constants. This is especially important in the critical region.
|
||||
|
||||
/// These are unit types for the fluid
|
||||
enum fluid_types{FLUID_TYPE_PURE, FLUID_TYPE_PSEUDOPURE, FLUID_TYPE_REFPROP, FLUID_TYPE_INCOMPRESSIBLE_LIQUID, FLUID_TYPE_INCOMPRESSIBLE_SOLUTION, FLUID_TYPE_UNDEFINED};
|
||||
|
||||
|
||||
@@ -76,10 +76,10 @@ AbstractState * AbstractState::factory(const std::string &backend, const std::ve
|
||||
throw ValueError("TREND backend not yet implemented");
|
||||
}
|
||||
else if (backend == "SRK"){
|
||||
return new SRKBackend(fluid_names, R_u_CODATA);
|
||||
return new SRKBackend(fluid_names, get_config_double(R_U_CODATA));
|
||||
}
|
||||
else if (backend == "PR" || backend == "Peng-Robinson"){
|
||||
return new PengRobinsonBackend(fluid_names, R_u_CODATA);
|
||||
return new PengRobinsonBackend(fluid_names, get_config_double(R_u_CODATA));
|
||||
}
|
||||
else if (!backend.compare("?") || backend.empty())
|
||||
{
|
||||
|
||||
@@ -348,7 +348,7 @@ CoolPropDbl HelmholtzEOSMixtureBackend::calc_gas_constant(void)
|
||||
}
|
||||
else{
|
||||
if (get_config_bool(NORMALIZE_GAS_CONSTANTS)){
|
||||
return R_u_CODATA;
|
||||
return get_config_double(R_U_CODATA);
|
||||
}
|
||||
else{
|
||||
// mass fraction weighted average of the components
|
||||
|
||||
Reference in New Issue
Block a user