Configuration Variables

At runtime, there are a several configuration variables that can be used to change the behavior of CoolProp

Warning

The adjustment of the internal configuration variables might have side effects that you are not expecting, use with caution!!

From C++ and the SWIG wrappers, the values can be directly set/changed by using the type-specified getter/setter functions get_config_bool(), set_config_bool(), get_config_string(), set_config_string(), etc., as in sonething like:

In [1]: import CoolProp.CoolProp as CP

In [2]: current_val = CP.get_config_bool(CP.CRITICAL_WITHIN_1UK)

In [3]: CP.set_config_bool(CP.CRITICAL_WITHIN_1UK, current_val)

From all languages, the configuration state can obtained by retrieving the configuration state in the form of a JSON formatted string. For instance, in python, you can get the default configuration state from

In [4]: import CoolProp.CoolProp as CP, json

In [5]: json.loads(CP.get_config_as_json_string())
Out[5]: 
{u'ALTERNATIVE_REFPROP_HMX_BNC_PATH': u'',
 u'ALTERNATIVE_REFPROP_PATH': u'',
 u'ALTERNATIVE_TABLES_DIRECTORY': u'',
 u'CRITICAL_SPLINES_ENABLED': True,
 u'CRITICAL_WITHIN_1UK': True,
 u'DONT_CHECK_PROPERTY_LIMITS': False,
 u'HENRYS_LAW_TO_GENERATE_VLE_GUESSES': False,
 u'MAXIMUM_TABLE_DIRECTORY_SIZE_IN_GB': 1.0,
 u'NORMALIZE_GAS_CONSTANTS': True,
 u'PHASE_ENVELOPE_STARTING_PRESSURE_PA': 100.0,
 u'REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS': False,
 u'REFPROP_USE_GERG': False,
 u'REFPROP_USE_PENGROBINSON': False,
 u'R_U_CODATA': 8.3144598,
 u'SAVE_RAW_TABLES': False,
 u'VTPR_UNIFAQ_PATH': u''}

Most modern languages have facilities for interfacing with JSON formatted strings and converting them back and forth with language-specific data structures. For instance, in python, there is the built-in json package that converts json-formatted strings to python dictionaries, lists, etc.

Configuration Keys

Here is a list of (alphabetically sorted) configuration keys that can be used, along with a short description of the use of each of the configuration keys:

ALTERNATIVE_REFPROP_HMX_BNC_PATH: An alternative path to the HMX.BNC file. If provided, it will be passed into REFPROP’s SETUP or SETMIX routines

ALTERNATIVE_REFPROP_PATH: An alternative path to be provided to the directory that contains REFPROP’s fluids and mixtures directories. If provided, the SETPATH function will be called with this directory prior to calling any REFPROP functions.

ALTERNATIVE_TABLES_DIRECTORY: If provided, this path will be the root directory for the tabular data. Otherwise, ${HOME}/.CoolProp/Tables is used

CRITICAL_SPLINES_ENABLED: If true, the critical splines will be used in the near-vicinity of the critical point

CRITICAL_WITHIN_1UK: If true, any temperature within 1 uK of the critical temperature will be considered to be AT the critical point

DONT_CHECK_PROPERTY_LIMITS: If true, when possible, CoolProp will skip checking whether values are inside the property limits

HENRYS_LAW_TO_GENERATE_VLE_GUESSES: If true, when doing water-based mixture dewpoint calculations, use Henry’s Law to generate guesses for liquid-phase composition

MAXIMUM_TABLE_DIRECTORY_SIZE_IN_GB: The maximum allowed size of the directory that is used to store tabular data

NORMALIZE_GAS_CONSTANTS: If true, for mixtures, the molar gas constant (R) will be set to the CODATA value

PHASE_ENVELOPE_STARTING_PRESSURE_PA: Starting pressure [Pa] for phase envelope construction

REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS: If true, if the binary interaction parameters in REFPROP are estimated, throw an error rather than silently continuing

REFPROP_USE_GERG: If true, rather than using the highly-accurate pure fluid equations of state, use the pure-fluid EOS from GERG-2008

REFPROP_USE_PENGROBINSON: If true, rather than using the highly-accurate pure fluid equations of state, use the Peng-Robinson EOS

R_U_CODATA: 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.

SAVE_RAW_TABLES: If true, the raw, uncompressed tables will also be written to file

VTPR_UNIFAQ_PATH: The path to the directory containing the UNIFAQ JSON files. Should be slash terminated