CoolProp  6.6.0
An open-source fluid property and humid air property database
Macros | Functions
CoolPropLib.h File Reference

Go to the source code of this file.

Macros

#define EXPORT_CODE
 This file defines an interface for shared library (DLL) wrapping. More...
 
#define CONVENTION
 

Functions

EXPORT_CODE double CONVENTION Props1SI (const char *FluidName, const char *Output)
 
EXPORT_CODE void CONVENTION Props1SImulti (const char *Outputs, char *backend, const char *FluidNames, const double *fractions, const long length_fractions, double *result, long *resdim1)
 
EXPORT_CODE double CONVENTION PropsSI (const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref)
 
EXPORT_CODE void CONVENTION PropsSImulti (const char *Outputs, const char *Name1, double *Prop1, const long size_Prop1, const char *Name2, double *Prop2, const long size_Prop2, char *backend, const char *FluidNames, const double *fractions, const long length_fractions, double *result, long *resdim1, long *resdim2)
 
EXPORT_CODE long CONVENTION PhaseSI (const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref, char *phase, int n)
 
EXPORT_CODE long CONVENTION get_global_param_string (const char *param, char *Output, int n)
 
EXPORT_CODE long CONVENTION get_parameter_information_string (const char *key, char *Output, int n)
 
EXPORT_CODE long CONVENTION get_fluid_param_string (const char *fluid, const char *param, char *Output, int n)
 
EXPORT_CODE void CONVENTION set_config_string (const char *key, const char *val)
 Set configuration string. More...
 
EXPORT_CODE void CONVENTION set_config_double (const char *key, const double val)
 Set configuration numerical value as double. More...
 
EXPORT_CODE void CONVENTION set_config_bool (const char *key, const bool val)
 Set configuration value as a boolean. More...
 
EXPORT_CODE void CONVENTION set_departure_functions (const char *string_data, long *errcode, char *message_buffer, const long buffer_length)
 Set the departure functions in the departure function library from a string format. More...
 
EXPORT_CODE int CONVENTION set_reference_stateS (const char *Ref, const char *reference_state)
 
EXPORT_CODE int CONVENTION set_reference_stateD (const char *Ref, double T, double rhomolar, double hmolar0, double smolar0)
 
EXPORT_CODE void CONVENTION propssi_ (const char *Output, const char *Name1, const double *Prop1, const char *Name2, const double *Prop2, const char *Ref, double *output)
 FORTRAN 77 style wrapper of the PropsSI function This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
EXPORT_CODE double CONVENTION F2K (double T_F)
 Convert from degrees Fahrenheit to Kelvin (useful primarily for testing) More...
 
EXPORT_CODE double CONVENTION K2F (double T_K)
 Convert from Kelvin to degrees Fahrenheit (useful primarily for testing) More...
 
EXPORT_CODE long CONVENTION get_param_index (const char *param)
 Get the index for a parameter "T", "P", etc. More...
 
EXPORT_CODE long CONVENTION get_input_pair_index (const char *param)
 Get the index for an input pair for AbstractState.update function. More...
 
EXPORT_CODE long CONVENTION redirect_stdout (const char *file)
 Redirect all output that would go to console (stdout) to a file. More...
 
EXPORT_CODE int CONVENTION get_debug_level ()
 
EXPORT_CODE void CONVENTION set_debug_level (int level)
 
EXPORT_CODE double CONVENTION saturation_ancillary (const char *fluid_name, const char *output, int Q, const char *input, double value)
 
EXPORT_CODE double CONVENTION HAPropsSI (const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Name3, double Prop3)
 DLL wrapper of the HAPropsSI function. More...
 
EXPORT_CODE double CONVENTION cair_sat (double T)
 Humid air saturation specific heat at 1 atmosphere, based on a correlation from EES. More...
 
EXPORT_CODE void CONVENTION hapropssi_ (const char *Output, const char *Name1, const double *Prop1, const char *Name2, const double *Prop2, const char *Name3, const double *Prop3, double *output)
 FORTRAN 77 style wrapper of the HAPropsSI function. More...
 
EXPORT_CODE double CONVENTION HAProps (const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Name3, double Prop3)
 DLL wrapper of the HAProps function. More...
 
EXPORT_CODE void CONVENTION haprops_ (const char *Output, const char *Name1, const double *Prop1, const char *Name2, const double *Prop2, const char *Name3, const double *Prop3, double *output)
 FORTRAN 77 style wrapper of the HAProps function. More...
 
EXPORT_CODE long CONVENTION AbstractState_factory (const char *backend, const char *fluids, long *errcode, char *message_buffer, const long buffer_length)
 Generate an AbstractState instance, return an integer handle to the state class generated to be used in the other low-level accessor functions. More...
 
EXPORT_CODE void CONVENTION AbstractState_fluid_names (const long handle, char *fluids, long *errcode, char *message_buffer, const long buffer_length)
 Get the fluid names for the AbstractState. More...
 
EXPORT_CODE void CONVENTION AbstractState_free (const long handle, long *errcode, char *message_buffer, const long buffer_length)
 Release a state class generated by the low-level interface wrapper. More...
 
EXPORT_CODE void CONVENTION AbstractState_set_fractions (const long handle, const double *fractions, const long N, long *errcode, char *message_buffer, const long buffer_length)
 Set the fractions (mole, mass, volume) for the AbstractState. More...
 
EXPORT_CODE void CONVENTION AbstractState_get_mole_fractions (const long handle, double *fractions, const long maxN, long *N, long *errcode, char *message_buffer, const long buffer_length)
 Get the molar fractions for the AbstractState. More...
 
EXPORT_CODE void CONVENTION AbstractState_get_mole_fractions_satState (const long handle, const char *saturated_state, double *fractions, const long maxN, long *N, long *errcode, char *message_buffer, const long buffer_length)
 Get the molar fractions for the AbstractState and the desired saturated State. More...
 
EXPORT_CODE double CONVENTION AbstractState_get_fugacity (const long handle, const long i, long *errcode, char *message_buffer, const long buffer_length)
 Return the fugacity of the i-th component of the mixture. More...
 
EXPORT_CODE double CONVENTION AbstractState_get_fugacity_coefficient (const long handle, const long i, long *errcode, char *message_buffer, const long buffer_length)
 Return the fugacity coefficient of the i-th component of the mixture. More...
 
EXPORT_CODE void CONVENTION AbstractState_update (const long handle, const long input_pair, const double value1, const double value2, long *errcode, char *message_buffer, const long buffer_length)
 Update the state of the AbstractState. More...
 
EXPORT_CODE void CONVENTION AbstractState_specify_phase (const long handle, const char *phase, long *errcode, char *message_buffer, const long buffer_length)
 Specify the phase to be used for all further calculations. More...
 
EXPORT_CODE void CONVENTION AbstractState_unspecify_phase (const long handle, long *errcode, char *message_buffer, const long buffer_length)
 Unspecify the phase to be used for all further calculations. More...
 
EXPORT_CODE double CONVENTION AbstractState_keyed_output (const long handle, const long param, long *errcode, char *message_buffer, const long buffer_length)
 Get an output value from the AbstractState using an integer value for the desired output value. More...
 
EXPORT_CODE double CONVENTION AbstractState_first_saturation_deriv (const long handle, const long Of, const long Wrt, long *errcode, char *message_buffer, const long buffer_length)
 Calculate a saturation derivative from the AbstractState using integer values for the desired parameters. More...
 
EXPORT_CODE double CONVENTION AbstractState_first_partial_deriv (const long handle, const long Of, const long Wrt, const long Constant, long *errcode, char *message_buffer, const long buffer_length)
 Calculate the first partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters. More...
 
EXPORT_CODE double CONVENTION AbstractState_second_two_phase_deriv (const long handle, const long Of1, const long Wrt1, const long Constant1, const long Wrt2, const long Constant2, long *errcode, char *message_buffer, const long buffer_length)
 Calculate the second partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters. More...
 
EXPORT_CODE double CONVENTION AbstractState_second_partial_deriv (const long handle, const long Of1, const long Wrt1, const long Constant1, const long Wrt2, const long Constant2, long *errcode, char *message_buffer, const long buffer_length)
 Calculate the second partial derivative int two-phase region from the AbstractState using integer values for the desired parameters. More...
 
EXPORT_CODE double CONVENTION AbstractState_first_two_phase_deriv_splined (const long handle, const long Of, const long Wrt, const long Constant, const double x_end, long *errcode, char *message_buffer, const long buffer_length)
 Calculate the first partial derivative in two-phase region with Spline - Approach from the AbstractState using integer values for the desired parameters Spline Approach "Methods to Increase the Robustness of Finite-Volume FlowModels in Thermodynamic Systems: Sylvain Quoilin, Ian Bell, Adriano Desideri, Pierre Dewallef and Vincent Lemort". More...
 
EXPORT_CODE double CONVENTION AbstractState_first_two_phase_deriv (const long handle, const long Of, const long Wrt, const long Constant, long *errcode, char *message_buffer, const long buffer_length)
 Calculate the first partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters. More...
 
EXPORT_CODE void CONVENTION AbstractState_update_and_common_out (const long handle, const long input_pair, const double *value1, const double *value2, const long length, double *T, double *p, double *rhomolar, double *hmolar, double *smolar, long *errcode, char *message_buffer, const long buffer_length)
 Update the state of the AbstractState and get an output value five common outputs (temperature, pressure, molar density, molar enthalpy and molar entropy) More...
 
EXPORT_CODE void CONVENTION AbstractState_update_and_1_out (const long handle, const long input_pair, const double *value1, const double *value2, const long length, const long output, double *out, long *errcode, char *message_buffer, const long buffer_length)
 Update the state of the AbstractState and get one output value (temperature, pressure, molar density, molar enthalpy and molar entropy) More...
 
EXPORT_CODE void CONVENTION AbstractState_update_and_5_out (const long handle, const long input_pair, const double *value1, const double *value2, const long length, long *outputs, double *out1, double *out2, double *out3, double *out4, double *out5, long *errcode, char *message_buffer, const long buffer_length)
 Update the state of the AbstractState and get an output value five common outputs (temperature, pressure, molar density, molar enthalpy and molar entropy) More...
 
EXPORT_CODE void CONVENTION AbstractState_set_binary_interaction_double (const long handle, const long i, const long j, const char *parameter, const double value, long *errcode, char *message_buffer, const long buffer_length)
 Set binary interraction parrameter for mixtures. More...
 
EXPORT_CODE void CONVENTION AbstractState_set_cubic_alpha_C (const long handle, const long i, const char *parameter, const double c1, const double c2, const double c3, long *errcode, char *message_buffer, const long buffer_length)
 Set cubic's alpha function parameters. More...
 
EXPORT_CODE void CONVENTION AbstractState_set_fluid_parameter_double (const long handle, const long i, const char *parameter, const double value, long *errcode, char *message_buffer, const long buffer_length)
 Set some fluid parameter (ie volume translation for cubic) More...
 
EXPORT_CODE void CONVENTION AbstractState_build_phase_envelope (const long handle, const char *level, long *errcode, char *message_buffer, const long buffer_length)
 Build the phase envelope. More...
 
EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data (const long handle, const long length, double *T, double *p, double *rhomolar_vap, double *rhomolar_liq, double *x, double *y, long *errcode, char *message_buffer, const long buffer_length)
 Get data from the phase envelope for the given mixture composition. More...
 
EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data_checkedMemory (const long handle, const long length, const long maxComponents, double *T, double *p, double *rhomolar_vap, double *rhomolar_liq, double *x, double *y, long *actual_length, long *actual_components, long *errcode, char *message_buffer, const long buffer_length)
 Get data from the phase envelope for the given mixture composition. More...
 
EXPORT_CODE void CONVENTION AbstractState_build_spinodal (const long handle, long *errcode, char *message_buffer, const long buffer_length)
 Build the spinodal. More...
 
EXPORT_CODE void CONVENTION AbstractState_get_spinodal_data (const long handle, const long length, double *tau, double *delta, double *M1, long *errcode, char *message_buffer, const long buffer_length)
 Get data for the spinodal curve. More...
 
EXPORT_CODE void CONVENTION AbstractState_all_critical_points (const long handle, const long length, double *T, double *p, double *rhomolar, long *stable, long *errcode, char *message_buffer, const long buffer_length)
 Calculate all the critical points for a given composition. More...
 
EXPORT_CODE double CONVENTION AbstractState_keyed_output_satState (const long handle, const char *saturated_state, const long param, long *errcode, char *message_buffer, const long buffer_length)
 Get an output value from the AbstractState using an integer value for the desired output value and desired saturated State. More...
 
EXPORT_CODE void CONVENTION AbstractState_backend_name (const long handle, char *backend, long *errcode, char *message_buffer, const long buffer_length)
 Return the name of the backend used in the AbstractState. More...
 
EXPORT_CODE void CONVENTION AbstractState_fluid_param_string (const long handle, const char *param, char *return_buffer, const long return_buffer_length, long *errcode, char *message_buffer, const long buffer_length)
 
EXPORT_CODE int CONVENTION AbstractState_phase (const long handle, long *errcode, char *message_buffer, const long buffer_length)
 
EXPORT_CODE double CONVENTION AbstractState_saturated_liquid_keyed_output (const long handle, const long param, long *errcode, char *message_buffer, const long buffer_length)
 
EXPORT_CODE double CONVENTION AbstractState_saturated_vapor_keyed_output (const long handle, const long param, long *errcode, char *message_buffer, const long buffer_length)
 
EXPORT_CODE void CONVENTION add_fluids_as_JSON (const char *backend, const char *fluidstring, long *errcode, char *message_buffer, const long buffer_length)
 Add fluids as a JSON-formatted string. More...
 
EXPORT_CODE int CONVENTION C_is_valid_fluid_string (const char *fluidName)
 
EXPORT_CODE int CONVENTION C_extract_backend (const char *fluid_string, char *backend, const long backend_length, char *fluid, const long fluid_length)
 
EXPORT_CODE double CONVENTION PropsS (const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref)
 
EXPORT_CODE double CONVENTION Props (const char *Output, const char Name1, double Prop1, const char Name2, double Prop2, const char *Ref)
 
EXPORT_CODE double CONVENTION Props1 (const char *FluidName, const char *Output)
 

Macro Definition Documentation

◆ CONVENTION

#define CONVENTION

Definition at line 58 of file CoolPropLib.h.

◆ EXPORT_CODE

#define EXPORT_CODE

This file defines an interface for shared library (DLL) wrapping.

In general the functions defined here take strings which are 0-terminated (C-style), vectors of doubles are passed as double* and length These functions pass directly to equivalently named functions in CoolProp.h in the CoolProp namespace that take std::string, vector<double> etc.

Functions with the call type like EXPORT_CODE void CONVENTION AFunction(double, double); will be exported to the DLL

The exact symbol that will be exported depends on the values of the preprocessor macros COOLPROP_LIB, EXPORT_CODE, CONVENTION, etc.

In order to have 100% control over the export macros, you can specify EXPORT_CODE and CONVENTION directly. Check out CMakeLists.txt in the repo root to see some examples.

Definition at line 55 of file CoolPropLib.h.

Function Documentation

◆ AbstractState_all_critical_points()

EXPORT_CODE void CONVENTION AbstractState_all_critical_points ( const long  handle,
const long  length,
double *  T,
double *  p,
double *  rhomolar,
long *  stable,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate all the critical points for a given composition.

Parameters
handleThe integer handle for the state class stored in memory
lengthThe length of the buffers passed to this function
TThe pointer to the array of temperature (K)
pThe pointer to the array of pressure (Pa)
rhomolarThe pointer to the array of molar density (m^3/mol)
stableThe pointer to the array of boolean flags for whether the critical point is stable (1) or unstable (0)
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 953 of file CoolPropLib.cpp.

◆ AbstractState_backend_name()

EXPORT_CODE void CONVENTION AbstractState_backend_name ( const long  handle,
char *  backend,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Return the name of the backend used in the AbstractState.

Parameters
handleThe integer handle for the state class stored in memory
backendThe char pointer the name is written to
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 1002 of file CoolPropLib.cpp.

◆ AbstractState_build_phase_envelope()

EXPORT_CODE void CONVENTION AbstractState_build_phase_envelope ( const long  handle,
const char *  level,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Build the phase envelope.

Parameters
handleThe integer handle for the state class stored in memory
levelHow much refining of the phase envelope ("none" to skip refining (recommended))
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 852 of file CoolPropLib.cpp.

◆ AbstractState_build_spinodal()

EXPORT_CODE void CONVENTION AbstractState_build_spinodal ( const long  handle,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Build the spinodal.

Parameters
handleThe integer handle for the state class stored in memory
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 923 of file CoolPropLib.cpp.

◆ AbstractState_factory()

EXPORT_CODE long CONVENTION AbstractState_factory ( const char *  backend,
const char *  fluids,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Generate an AbstractState instance, return an integer handle to the state class generated to be used in the other low-level accessor functions.

Parameters
backendThe backend you will use, "HEOS", "REFPROP", etc.
fluids'&' delimited list of fluids
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
A handle to the state class generated

Definition at line 498 of file CoolPropLib.cpp.

◆ AbstractState_first_partial_deriv()

EXPORT_CODE double CONVENTION AbstractState_first_partial_deriv ( const long  handle,
const long  Of,
const long  Wrt,
const long  Constant,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate the first partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters.

Parameters
handleThe integer handle for the state class stored in memory
OfThe parameter of which the derivative is being taken
WrtThe derivative with with respect to this parameter
ConstantThe parameter that is not affected by the derivative
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 682 of file CoolPropLib.cpp.

◆ AbstractState_first_saturation_deriv()

EXPORT_CODE double CONVENTION AbstractState_first_saturation_deriv ( const long  handle,
const long  Of,
const long  Wrt,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate a saturation derivative from the AbstractState using integer values for the desired parameters.

Parameters
handleThe integer handle for the state class stored in memory
OfThe parameter of which the derivative is being taken
WrtThe derivative with with respect to this parameter
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 670 of file CoolPropLib.cpp.

◆ AbstractState_first_two_phase_deriv()

EXPORT_CODE double CONVENTION AbstractState_first_two_phase_deriv ( const long  handle,
const long  Of,
const long  Wrt,
const long  Constant,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate the first partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters.

Parameters
handleThe integer handle for the state class stored in memory
OfThe parameter of which the derivative is being taken
WrtThe derivative with with respect to this parameter
ConstantThe parameter that is not affected by the derivative
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 725 of file CoolPropLib.cpp.

◆ AbstractState_first_two_phase_deriv_splined()

EXPORT_CODE double CONVENTION AbstractState_first_two_phase_deriv_splined ( const long  handle,
const long  Of,
const long  Wrt,
const long  Constant,
const double  x_end,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate the first partial derivative in two-phase region with Spline - Approach from the AbstractState using integer values for the desired parameters Spline Approach "Methods to Increase the Robustness of Finite-Volume FlowModels in Thermodynamic Systems: Sylvain Quoilin, Ian Bell, Adriano Desideri, Pierre Dewallef and Vincent Lemort".

Parameters
handleThe integer handle for the state class stored in memory @x_end constant parameter for defining range of the spline, (usually 0.1 is used, 0..1 is possible)
OfThe parameter of which the derivative is being taken
WrtThe derivative with with respect to this parameter
ConstantThe parameter that is not affected by the derivative
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 738 of file CoolPropLib.cpp.

◆ AbstractState_fluid_names()

EXPORT_CODE void CONVENTION AbstractState_fluid_names ( const long  handle,
char *  fluids,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get the fluid names for the AbstractState.

Parameters
handleThe integer handle for the state class stored in memory
fluidsLIST_STRING_DELIMETER (',') delimited list of fluids
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 509 of file CoolPropLib.cpp.

◆ AbstractState_fluid_param_string()

EXPORT_CODE void CONVENTION AbstractState_fluid_param_string ( const long  handle,
const char *  param,
char *  return_buffer,
const long  return_buffer_length,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Definition at line 1031 of file CoolPropLib.cpp.

◆ AbstractState_free()

EXPORT_CODE void CONVENTION AbstractState_free ( const long  handle,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Release a state class generated by the low-level interface wrapper.

Parameters
handleThe integer handle for the state class stored in memory
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 528 of file CoolPropLib.cpp.

◆ AbstractState_get_fugacity()

EXPORT_CODE double CONVENTION AbstractState_get_fugacity ( const long  handle,
const long  i,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Return the fugacity of the i-th component of the mixture.

Parameters
handleThe integer handle for the state class stored in memory
ii-th component of the mixture
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 607 of file CoolPropLib.cpp.

◆ AbstractState_get_fugacity_coefficient()

EXPORT_CODE double CONVENTION AbstractState_get_fugacity_coefficient ( const long  handle,
const long  i,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Return the fugacity coefficient of the i-th component of the mixture.

Parameters
handleThe integer handle for the state class stored in memory
ii-th component of the mixture
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 618 of file CoolPropLib.cpp.

◆ AbstractState_get_mole_fractions()

EXPORT_CODE void CONVENTION AbstractState_get_mole_fractions ( const long  handle,
double *  fractions,
const long  maxN,
long *  N,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get the molar fractions for the AbstractState.

Parameters
handleThe integer handle for the state class stored in memory
fractionsThe array of fractions
maxNThe length of the buffer for the fractions
Nnumber of fluids
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 553 of file CoolPropLib.cpp.

◆ AbstractState_get_mole_fractions_satState()

EXPORT_CODE void CONVENTION AbstractState_get_mole_fractions_satState ( const long  handle,
const char *  saturated_state,
double *  fractions,
const long  maxN,
long *  N,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get the molar fractions for the AbstractState and the desired saturated State.

Parameters
handleThe integer handle for the state class stored in memory
saturated_stateThe string specifying the state (liquid or gas)
fractionsThe array of fractions
maxNThe length of the buffer for the fractions
Nnumber of fluids
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 571 of file CoolPropLib.cpp.

◆ AbstractState_get_phase_envelope_data()

EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data ( const long  handle,
const long  length,
double *  T,
double *  p,
double *  rhomolar_vap,
double *  rhomolar_liq,
double *  x,
double *  y,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get data from the phase envelope for the given mixture composition.

Parameters
handleThe integer handle for the state class stored in memory
lengthThe number of elements stored in the arrays (both inputs and outputs MUST be the same length)
TThe pointer to the array of temperature (K)
pThe pointer to the array of pressure (Pa)
rhomolar_vapThe pointer to the array of molar density for vapor phase (m^3/mol)
rhomolar_liqThe pointer to the array of molar density for liquid phase (m^3/mol)
xThe compositions of the "liquid" phase (WARNING: buffer should be Ncomp*Npoints in length, at a minimum, but there is no way to check buffer length at runtime)
yThe compositions of the "vapor" phase (WARNING: buffer should be Ncomp*Npoints in length, at a minimum, but there is no way to check buffer length at runtime)
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 863 of file CoolPropLib.cpp.

◆ AbstractState_get_phase_envelope_data_checkedMemory()

EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data_checkedMemory ( const long  handle,
const long  length,
const long  maxComponents,
double *  T,
double *  p,
double *  rhomolar_vap,
double *  rhomolar_liq,
double *  x,
double *  y,
long *  actual_length,
long *  actual_components,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get data from the phase envelope for the given mixture composition.

Parameters
handleThe integer handle for the state class stored in memory
lengthThe number of elements stored in the arrays (both inputs and outputs MUST be the same length)
maxComponentsThe number of fluid components for which memory is allocated
TThe pointer to the array of temperature (K)
pThe pointer to the array of pressure (Pa)
rhomolar_vapThe pointer to the array of molar density for vapor phase (m^3/mol)
rhomolar_liqThe pointer to the array of molar density for liquid phase (m^3/mol)
xThe compositions of the "liquid" phase (WARNING: buffer should be Ncomp*Npoints in length, at a minimum, but there is no way to check buffer length at runtime)
yThe compositions of the "vapor" phase (WARNING: buffer should be Ncomp*Npoints in length, at a minimum, but there is no way to check buffer length at runtime)
actual_lengthThe number of elements actually stored in the arrays
actual_componentsThe number of fluid components actually stored in the arrays
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 890 of file CoolPropLib.cpp.

◆ AbstractState_get_spinodal_data()

EXPORT_CODE void CONVENTION AbstractState_get_spinodal_data ( const long  handle,
const long  length,
double *  tau,
double *  delta,
double *  M1,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get data for the spinodal curve.

Parameters
handleThe integer handle for the state class stored in memory
lengthThe number of elements stored in the arrays (all outputs MUST be the same length)
tauThe pointer to the array of reciprocal reduced temperature
deltaThe pointer to the array of reduced density
M1The pointer to the array of M1 values (when L1=M1=0, critical point)
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error, no change in the output arrays will be made

Definition at line 933 of file CoolPropLib.cpp.

◆ AbstractState_keyed_output()

EXPORT_CODE double CONVENTION AbstractState_keyed_output ( const long  handle,
const long  param,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get an output value from the AbstractState using an integer value for the desired output value.

Parameters
handleThe integer handle for the state class stored in memory
paramThe integer value for the parameter you want
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 658 of file CoolPropLib.cpp.

◆ AbstractState_keyed_output_satState()

EXPORT_CODE double CONVENTION AbstractState_keyed_output_satState ( const long  handle,
const char *  saturated_state,
const long  param,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Get an output value from the AbstractState using an integer value for the desired output value and desired saturated State.

Parameters
handleThe integer handle for the state class stored in memory
saturated_stateThe string specifying the state (liquid or gas)
paramThe integer value for the parameter you want
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 974 of file CoolPropLib.cpp.

◆ AbstractState_phase()

EXPORT_CODE int CONVENTION AbstractState_phase ( const long  handle,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Definition at line 1020 of file CoolPropLib.cpp.

◆ AbstractState_saturated_liquid_keyed_output()

EXPORT_CODE double CONVENTION AbstractState_saturated_liquid_keyed_output ( const long  handle,
const long  param,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Definition at line 1048 of file CoolPropLib.cpp.

◆ AbstractState_saturated_vapor_keyed_output()

EXPORT_CODE double CONVENTION AbstractState_saturated_vapor_keyed_output ( const long  handle,
const long  param,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Definition at line 1060 of file CoolPropLib.cpp.

◆ AbstractState_second_partial_deriv()

EXPORT_CODE double CONVENTION AbstractState_second_partial_deriv ( const long  handle,
const long  Of1,
const long  Wrt1,
const long  Constant1,
const long  Wrt2,
const long  Constant2,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate the second partial derivative int two-phase region from the AbstractState using integer values for the desired parameters.

Parameters
handleThe integer handle for the state class stored in memory
Of1The parameter of which the derivative is being taken
Wrt1The parameter that the derivative is taken with respect to in the first derivative
Constant1The parameter that is held constant in the first derivative
Wrt2The parameter that the derivative is taken with respect to in the second derivative
Constant2The parameter that is held constant in the second derivative
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 695 of file CoolPropLib.cpp.

◆ AbstractState_second_two_phase_deriv()

EXPORT_CODE double CONVENTION AbstractState_second_two_phase_deriv ( const long  handle,
const long  Of1,
const long  Wrt1,
const long  Constant1,
const long  Wrt2,
const long  Constant2,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Calculate the second partial derivative in homogeneous phases from the AbstractState using integer values for the desired parameters.

Parameters
handleThe integer handle for the state class stored in memory
Of1The parameter of which the derivative is being taken
Wrt1The parameter that the derivative is taken with respect to in the first derivative
Constant1The parameter that is held constant in the first derivative
Wrt2The parameter that the derivative is taken with respect to in the second derivative
Constant2The parameter that is held constant in the second derivative
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 710 of file CoolPropLib.cpp.

◆ AbstractState_set_binary_interaction_double()

EXPORT_CODE void CONVENTION AbstractState_set_binary_interaction_double ( const long  handle,
const long  i,
const long  j,
const char *  parameter,
const double  value,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Set binary interraction parrameter for mixtures.

Parameters
handleThe integer handle for the state class stored in memory
iindice of the first fluid of the binary pair
jindice of the second fluid of the binary pair
parameterstring wit the name of the parameter
valuethe value of the binary interaction parameter
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 818 of file CoolPropLib.cpp.

◆ AbstractState_set_cubic_alpha_C()

EXPORT_CODE void CONVENTION AbstractState_set_cubic_alpha_C ( const long  handle,
const long  i,
const char *  parameter,
const double  c1,
const double  c2,
const double  c3,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Set cubic's alpha function parameters.

Parameters
handleThe integer handle for the state class stored in memory
iindice of the fluid the parramter should be applied too (for mixtures)
parameterthe string specifying the alpha function to use, ex "TWU" for the TWU alpha function
c1the first parameter for the alpha function
c2the second parameter for the alpha function
c3the third parameter for the alpha function
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 830 of file CoolPropLib.cpp.

◆ AbstractState_set_fluid_parameter_double()

EXPORT_CODE void CONVENTION AbstractState_set_fluid_parameter_double ( const long  handle,
const long  i,
const char *  parameter,
const double  value,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Set some fluid parameter (ie volume translation for cubic)

Parameters
handleThe integer handle for the state class stored in memory
iindice of the fluid the parramter should be applied too (for mixtures)
parameterthe string specifying the parameter to use, ex "cm" for volume translation
valuethe value of the parameter
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 841 of file CoolPropLib.cpp.

◆ AbstractState_set_fractions()

EXPORT_CODE void CONVENTION AbstractState_set_fractions ( const long  handle,
const double *  fractions,
const long  N,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Set the fractions (mole, mass, volume) for the AbstractState.

Parameters
handleThe integer handle for the state class stored in memory
fractionsThe array of fractions
NThe length of the fractions array
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 536 of file CoolPropLib.cpp.

◆ AbstractState_specify_phase()

EXPORT_CODE void CONVENTION AbstractState_specify_phase ( const long  handle,
const char *  phase,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Specify the phase to be used for all further calculations.

Parameters
handleThe integer handle for the state class stored in memory
phaseThe string with the phase to use
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 639 of file CoolPropLib.cpp.

◆ AbstractState_unspecify_phase()

EXPORT_CODE void CONVENTION AbstractState_unspecify_phase ( const long  handle,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Unspecify the phase to be used for all further calculations.

Parameters
handleThe integer handle for the state class stored in memory
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 649 of file CoolPropLib.cpp.

◆ AbstractState_update()

EXPORT_CODE void CONVENTION AbstractState_update ( const long  handle,
const long  input_pair,
const double  value1,
const double  value2,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Update the state of the AbstractState.

Parameters
handleThe integer handle for the state class stored in memory
input_pairThe integer value for the input pair obtained from XXXXXXXXXXXXXXXX
value1The first input value
value2The second input value
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns

Definition at line 629 of file CoolPropLib.cpp.

◆ AbstractState_update_and_1_out()

EXPORT_CODE void CONVENTION AbstractState_update_and_1_out ( const long  handle,
const long  input_pair,
const double *  value1,
const double *  value2,
const long  length,
const long  output,
double *  out,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Update the state of the AbstractState and get one output value (temperature, pressure, molar density, molar enthalpy and molar entropy)

from the AbstractState using pointers as inputs and output to allow array computation.

Parameters
handleThe integer handle for the state class stored in memory
input_pairThe integer value for the input pair obtained from get_input_pair_index
value1The pointer to the array of the first input parameters
value2The pointer to the array of the second input parameters
lengthThe number of elements stored in the arrays (both inputs and outputs MUST be the same length)
outputThe indice for the output desired
outThe pointer to the array for output
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 776 of file CoolPropLib.cpp.

◆ AbstractState_update_and_5_out()

EXPORT_CODE void CONVENTION AbstractState_update_and_5_out ( const long  handle,
const long  input_pair,
const double *  value1,
const double *  value2,
const long  length,
long *  outputs,
double *  out1,
double *  out2,
double *  out3,
double *  out4,
double *  out5,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Update the state of the AbstractState and get an output value five common outputs (temperature, pressure, molar density, molar enthalpy and molar entropy)

from the AbstractState using pointers as inputs and output to allow array computation.

Parameters
handleThe integer handle for the state class stored in memory
input_pairThe integer value for the input pair obtained from get_input_pair_index
value1The pointer to the array of the first input parameters
value2The pointer to the array of the second input parameters
lengthThe number of elements stored in the arrays (both inputs and outputs MUST be the same length)
outputsThe 5-element vector of indices for the outputs desired
out1The pointer to the array for the first output
out2The pointer to the array for the second output
out3The pointer to the array for the third output
out4The pointer to the array for the fourth output
out5The pointer to the array for the fifth output
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 795 of file CoolPropLib.cpp.

◆ AbstractState_update_and_common_out()

EXPORT_CODE void CONVENTION AbstractState_update_and_common_out ( const long  handle,
const long  input_pair,
const double *  value1,
const double *  value2,
const long  length,
double *  T,
double *  p,
double *  rhomolar,
double *  hmolar,
double *  smolar,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Update the state of the AbstractState and get an output value five common outputs (temperature, pressure, molar density, molar enthalpy and molar entropy)

from the AbstractState using pointers as inputs and output to allow array computation.

Parameters
handleThe integer handle for the state class stored in memory
input_pairThe integer value for the input pair obtained from get_input_pair_index
value1The pointer to the array of the first input parameters
value2The pointer to the array of the second input parameters
lengthThe number of elements stored in the arrays (both inputs and outputs MUST be the same length)
TThe pointer to the array of temperature
pThe pointer to the array of pressure
rhomolarThe pointer to the array of molar density
hmolarThe pointer to the array of molar enthalpy
smolarThe pointer to the array of molar entropy
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Returns
Note
If there is an error in an update call for one of the inputs, no change in the output array will be made

Definition at line 753 of file CoolPropLib.cpp.

◆ add_fluids_as_JSON()

EXPORT_CODE void CONVENTION add_fluids_as_JSON ( const char *  backend,
const char *  fluidstring,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Add fluids as a JSON-formatted string.

Parameters
backendThe backend to which these should be added; e.g. "HEOS", "SRK", "PR"
fluidstringThe JSON-formatted string
Returns

Definition at line 1072 of file CoolPropLib.cpp.

◆ C_extract_backend()

EXPORT_CODE int CONVENTION C_extract_backend ( const char *  fluid_string,
char *  backend,
const long  backend_length,
char *  fluid,
const long  fluid_length 
)

Definition at line 1087 of file CoolPropLib.cpp.

◆ C_is_valid_fluid_string()

EXPORT_CODE int CONVENTION C_is_valid_fluid_string ( const char *  fluidName)

Definition at line 1083 of file CoolPropLib.cpp.

◆ cair_sat()

EXPORT_CODE double CONVENTION cair_sat ( double  T)

Humid air saturation specific heat at 1 atmosphere, based on a correlation from EES.

See also
HumidAir::cair_sat(double);
Parameters
T[K] good from 250K to 300K, no error bound checking is carried out.
Note
Equals partial derivative of enthalpy with respect to temperature at constant relative humidity of 100 percent and pressure of 1 atmosphere.

Definition at line 444 of file CoolPropLib.cpp.

◆ F2K()

EXPORT_CODE double CONVENTION F2K ( double  T_F)

Convert from degrees Fahrenheit to Kelvin (useful primarily for testing)

Definition at line 330 of file CoolPropLib.cpp.

◆ get_debug_level()

EXPORT_CODE int CONVENTION get_debug_level ( )

Get the debug level

Returns
level The level of the verbosity for the debugging output (0-10) 0: no debgging output

Definition at line 333 of file CoolPropLib.cpp.

◆ get_fluid_param_string()

EXPORT_CODE long CONVENTION get_fluid_param_string ( const char *  fluid,
const char *  param,
char *  Output,
int  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::get_fluid_param_string
Returns
error_code 1 = Ok 0 = error

Definition at line 392 of file CoolPropLib.cpp.

◆ get_global_param_string()

EXPORT_CODE long CONVENTION get_global_param_string ( const char *  param,
char *  Output,
int  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::get_global_param_string
Returns
error_code 1 = Ok 0 = error
Note
This function returns the output string in pre-allocated char buffer. If buffer is not large enough, no copy is made

Definition at line 359 of file CoolPropLib.cpp.

◆ get_input_pair_index()

EXPORT_CODE long CONVENTION get_input_pair_index ( const char *  param)

Get the index for an input pair for AbstractState.update function.

Returns
index The index as a long. If input is invalid, returns -1

Definition at line 349 of file CoolPropLib.cpp.

◆ get_param_index()

EXPORT_CODE long CONVENTION get_param_index ( const char *  param)

Get the index for a parameter "T", "P", etc.

Returns
index The index as a long. If input is invalid, returns -1

Definition at line 339 of file CoolPropLib.cpp.

◆ get_parameter_information_string()

EXPORT_CODE long CONVENTION get_parameter_information_string ( const char *  key,
char *  Output,
int  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::get_parameter_information_string
Note
This function returns the output string in pre-allocated char buffer. If buffer is not large enough, no copy is made
Returns
error_code 1 = Ok 0 = error

Definition at line 371 of file CoolPropLib.cpp.

◆ HAProps()

EXPORT_CODE double CONVENTION HAProps ( const char *  Output,
const char *  Name1,
double  Prop1,
const char *  Name2,
double  Prop2,
const char *  Name3,
double  Prop3 
)

DLL wrapper of the HAProps function.

Warning
DEPRECATED!!
See also
HumidAir::HAProps(const char *OutputName, const char *Input1Name, double Input1, const char *Input2Name, double Input2, const char *Input3Name, double Input3);
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 452 of file CoolPropLib.cpp.

◆ haprops_()

EXPORT_CODE void CONVENTION haprops_ ( const char *  Output,
const char *  Name1,
const double *  Prop1,
const char *  Name2,
const double *  Prop2,
const char *  Name3,
const double *  Prop3,
double *  output 
)

FORTRAN 77 style wrapper of the HAProps function.

Warning
DEPRECATED!!
See also
HumidAir::HAProps(const char *OutputName, const char *Input1Name, double Input1, const char *Input2Name, double Input2, const char *Input3Name, double Input3);
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 464 of file CoolPropLib.cpp.

◆ HAPropsSI()

EXPORT_CODE double CONVENTION HAPropsSI ( const char *  Output,
const char *  Name1,
double  Prop1,
const char *  Name2,
double  Prop2,
const char *  Name3,
double  Prop3 
)

DLL wrapper of the HAPropsSI function.

See also
HumidAir::HAPropsSI(const char *OutputName, const char *Input1Name, double Input1, const char *Input2Name, double Input2, const char *Input3Name, double Input3);
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 439 of file CoolPropLib.cpp.

◆ hapropssi_()

EXPORT_CODE void CONVENTION hapropssi_ ( const char *  Output,
const char *  Name1,
const double *  Prop1,
const char *  Name2,
const double *  Prop2,
const char *  Name3,
const double *  Prop3,
double *  output 
)

FORTRAN 77 style wrapper of the HAPropsSI function.

See also
HumidAir::HAPropsSI(const char *OutputName, const char *Input1Name, double Input1, const char *Input2Name, double Input2, const char *Input3Name, double Input3);
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 448 of file CoolPropLib.cpp.

◆ K2F()

EXPORT_CODE double CONVENTION K2F ( double  T_K)

Convert from Kelvin to degrees Fahrenheit (useful primarily for testing)

Definition at line 327 of file CoolPropLib.cpp.

◆ PhaseSI()

EXPORT_CODE long CONVENTION PhaseSI ( const char *  Name1,
double  Prop1,
const char *  Name2,
double  Prop2,
const char *  Ref,
char *  phase,
int  n 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::PhaseSI(const std::string &, double, const std::string &, double, const std::string&)
Note
This function returns the phase string in pre-allocated phase variable. If buffer is not large enough, no copy is made

Definition at line 300 of file CoolPropLib.cpp.

◆ Props()

EXPORT_CODE double CONVENTION Props ( const char *  Output,
const char  Name1,
double  Prop1,
const char  Name2,
double  Prop2,
const char *  Ref 
)

Works just like CoolProp::PropsSI, but units are in KSI system. This function is deprecated, no longer supported, and users should transition to using the PropsSI function

Definition at line 167 of file CoolPropLib.cpp.

◆ Props1()

EXPORT_CODE double CONVENTION Props1 ( const char *  FluidName,
const char *  Output 
)

Works just like CoolProp::Props1SI, but units are in KSI system. This function is deprecated, no longer supported, and users should transition to using the Props1SI function

Definition at line 154 of file CoolPropLib.cpp.

◆ Props1SI()

EXPORT_CODE double CONVENTION Props1SI ( const char *  FluidName,
const char *  Output 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::Props1SI(std::string, std::string)
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 205 of file CoolPropLib.cpp.

◆ Props1SImulti()

EXPORT_CODE void CONVENTION Props1SImulti ( const char *  Outputs,
char *  backend,
const char *  FluidNames,
const double *  fractions,
const long  length_fractions,
double *  result,
long *  resdim1 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::Props1SImulti(const std::vector<std::string>& Outputs, const std::string& backend, const std::vector<std::string>& fluids, const std::vector<double>& fractions)
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 209 of file CoolPropLib.cpp.

◆ PropsS()

EXPORT_CODE double CONVENTION PropsS ( const char *  Output,
const char *  Name1,
double  Prop1,
const char *  Name2,
double  Prop2,
const char *  Ref 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
Props(const char *Output, const char Name1, double Prop1, const char Name2, double Prop2, const char *Ref)

Definition at line 164 of file CoolPropLib.cpp.

◆ PropsSI()

EXPORT_CODE double CONVENTION PropsSI ( const char *  Output,
const char *  Name1,
double  Prop1,
const char *  Name2,
double  Prop2,
const char *  Ref 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::PropsSI(const std::string &, const std::string &, double, const std::string &, double, const std::string&)
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 243 of file CoolPropLib.cpp.

◆ propssi_()

EXPORT_CODE void CONVENTION propssi_ ( const char *  Output,
const char *  Name1,
const double *  Prop1,
const char *  Name2,
const double *  Prop2,
const char *  Ref,
double *  output 
)

FORTRAN 77 style wrapper of the PropsSI function This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::PropsSI(const std::string &, const std::string &, double, const std::string &, double, const std::string&)
Note
If there is an error, a huge value will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 322 of file CoolPropLib.cpp.

◆ PropsSImulti()

EXPORT_CODE void CONVENTION PropsSImulti ( const char *  Outputs,
const char *  Name1,
double *  Prop1,
const long  size_Prop1,
const char *  Name2,
double *  Prop2,
const long  size_Prop2,
char *  backend,
const char *  FluidNames,
const double *  fractions,
const long  length_fractions,
double *  result,
long *  resdim1,
long *  resdim2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::PropsSImulti(const std::vector<std::string>& Outputs, const std::string& Name1, const std::vector<double>& Prop1, const std::string& Name2, const std::vector<double>& Prop2, const std::string& backend, const std::vector<std::string>& fluids, const std::vector<double>& fractions)
Parameters
OutputsDelimited string separated by LIST_STRING_DELIMITER for the output parameters
Name1The name of the first input variable
Prop1A vector of the first input values
size_Prop1Size of Prop1 double*
Name2The name of the second input variable
Prop2A vector of the second input values
size_Prop2Size of Prop2 double*
backendThe string representation of the backend (HEOS, REFPROP, INCOMP, etc.)
FluidNamesDelimited string separated by LIST_STRING_DELIMITER for the fluid name(s)
fractionsThe fractions (molar, mass, volume, etc.) of the components
length_fractionsSize of fractions double*
resultAllocated memory for result vector
resdim1result vector dimension 1 pointer, to check allocated space and return actual result size
resdim2result vector dimension 2 pointer, to check allocated space and return actual result size
Note
If there is an error, an empty vector will be returned, you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 247 of file CoolPropLib.cpp.

◆ redirect_stdout()

EXPORT_CODE long CONVENTION redirect_stdout ( const char *  file)

Redirect all output that would go to console (stdout) to a file.

Definition at line 124 of file CoolPropLib.cpp.

◆ saturation_ancillary()

EXPORT_CODE double CONVENTION saturation_ancillary ( const char *  fluid_name,
const char *  output,
int  Q,
const char *  input,
double  value 
)

Definition at line 194 of file CoolPropLib.cpp.

◆ set_config_bool()

EXPORT_CODE void CONVENTION set_config_bool ( const char *  key,
const bool  val 
)

Set configuration value as a boolean.

Parameters
keyThe key to configure
valThe value to set to the key
Note
you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 422 of file CoolPropLib.cpp.

◆ set_config_double()

EXPORT_CODE void CONVENTION set_config_double ( const char *  key,
const double  val 
)

Set configuration numerical value as double.

Parameters
keyThe key to configure
valThe value to set to the key
Note
you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 413 of file CoolPropLib.cpp.

◆ set_config_string()

EXPORT_CODE void CONVENTION set_config_string ( const char *  key,
const char *  val 
)

Set configuration string.

Parameters
keyThe key to configure
valThe value to set to the key
Note
you can get the error message by doing something like get_global_param_string("errstring",output)

Definition at line 404 of file CoolPropLib.cpp.

◆ set_debug_level()

EXPORT_CODE void CONVENTION set_debug_level ( int  level)

Set the debug level

Parameters
levelThe level of the verbosity for the debugging output (0-10) 0: no debgging output

Definition at line 336 of file CoolPropLib.cpp.

◆ set_departure_functions()

EXPORT_CODE void CONVENTION set_departure_functions ( const char *  string_data,
long *  errcode,
char *  message_buffer,
const long  buffer_length 
)

Set the departure functions in the departure function library from a string format.

Parameters
string_dataThe departure functions to be set, either provided as a JSON-formatted string or as a string of the contents of a HMX.BNC file from REFPROP
errcodeThe errorcode that is returned (0 = no error, !0 = error)
message_bufferA buffer for the error code
buffer_lengthThe length of the buffer for the error code
Note
By default, if a departure function already exists in the library, this is an error, unless the configuration variable OVERWRITE_DEPARTURE_FUNCTIONS is set to true

Definition at line 431 of file CoolPropLib.cpp.

◆ set_reference_stateD()

EXPORT_CODE int CONVENTION set_reference_stateD ( const char *  Ref,
double  T,
double  rhomolar,
double  hmolar0,
double  smolar0 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::set_reference_stateD
Returns
error_code 1 = Ok 0 = error

Definition at line 140 of file CoolPropLib.cpp.

◆ set_reference_stateS()

EXPORT_CODE int CONVENTION set_reference_stateS ( const char *  Ref,
const char *  reference_state 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
CoolProp::set_reference_stateS
Returns
error_code 1 = Ok 0 = error

Definition at line 128 of file CoolPropLib.cpp.