CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
CoolProp.h File Reference
#include "FluidClass.h"
#include "CoolPropDLL.h"
#include "Units.h"
#include "GlobalConstants.h"

Go to the source code of this file.

Functions

double Props1 (std::string FluidName, std::string Output)
 
double Props (std::string Output, std::string Name1, double Prop1, std::string Name2, double Prop2, std::string FluidName)
 
double Props (char Output, char Name1, double Prop1, char Name2, double Prop2, char *FluidName)
 
double Props (std::string Output, char Name1, double Prop1, char Name2, double Prop2, std::string FluidName)
 
double Props1SI (std::string FluidName, std::string Output)
 
double PropsSI (std::string Output, std::string Name1, double Prop1, std::string Name2, double Prop2, std::string FluidName)
 
double DerivTerms (std::string Term, double T, double rho, std::string FluidName)
 
double DerivTerms (long iTerm, double T, double rho, Fluid *pFluid)
 
long getFluidType (std::string FluidName)
 
std::string get_global_param_string (std::string ParamName)
 
std::string get_fluid_param_string (std::string FluidName, std::string ParamName)
 
std::string Phase (std::string FluidName, double T, double p)
 
std::string Phase_Trho (std::string FluidName, double T, double rho)
 
std::string Phase_Tp (std::string FluidName, double T, double p)
 
std::string get_BibTeXKey (std::string FluidName, std::string item)
 
bool add_REFPROP_fluid (std::string FluidName)
 Add a REFPROP fluid to the fluid listing in CoolProp. More...
 
long get_param_index (std::string param)
 
long get_Fluid_index (std::string FluidName)
 
Fluidget_fluid (long iFluid)
 
void set_err_string (std::string err_string)
 
int set_reference_stateP (Fluid *pFluid, std::string reference_state)
 
int set_reference_stateS (std::string FluidName, std::string reference_state)
 
int set_reference_stateD (std::string FluidName, double T, double rho, double h0, double s0)
 
int _get_standard_unit_system ()
 
void _set_standard_unit_system (int)
 
void set_warning (std::string warning)
 
void set_phase (std::string Phase_str)
 Nearly deprecated function. More...
 

Function Documentation

int _get_standard_unit_system ( )

Returns the value for the integer flag corresponding to the current set of units

Returns
val The integer value for the current set of units, one of enumerated values UNIT_SYSTEM_SI, UNIT_SYSTEM_KSI (see GlobalConstants.h)

Definition at line 61 of file CoolProp.cpp.

void _set_standard_unit_system ( int  )

Sets the flag for the integer flag corresponding to the current set of units

Parameters
valThe integer value for the current set of units, one of enumerated values UNIT_SYSTEM_SI, UNIT_SYSTEM_KSI (see GlobalConstants.h)

Definition at line 62 of file CoolProp.cpp.

bool add_REFPROP_fluid ( std::string  FluidName)

Add a REFPROP fluid to the fluid listing in CoolProp.

Definition at line 253 of file CoolProp.cpp.

double DerivTerms ( std::string  Term,
double  T,
double  rho,
std::string  FluidName 
)

Return some low level derivative terms, see source for a complete list

Parameters
TermString, some options are "phir" (residual Helmholtz energy),"dphir_dDelta", "dphir_dTau", etc.
TTemperature [K]
rhoDensity [kg/m^3]
FluidNameString

Definition at line 1004 of file CoolProp.cpp.

double DerivTerms ( long  iTerm,
double  T,
double  rho,
Fluid pFluid 
)

Return some low level derivative terms, see source for a complete list

Parameters
iTermlong desired output
TTemperature [K]
rhoDensity [kg/m^3]
pFluidPointer to Fluid instance

Definition at line 1001 of file CoolProp.cpp.

std::string get_BibTeXKey ( std::string  FluidName,
std::string  item 
)

Returns the BibTeX key from the bibtex library of CoolProp corresponding to the item requested

Parameters
FluidNameThe name of the fluid
itemString, one of "EOS","CP0", "VISCOSITY", "CONDUCTIVITY", "ECS_LENNARD_JONES", "ECS_FITS", "SURFACE_TENSION"
Returns
key the BibTeX key

Definition at line 1122 of file CoolProp.cpp.

Fluid* get_fluid ( long  iFluid)

Get a pointer to a fluid that has been loaded

Parameters
iFluidThe integer index for the fluid (get from get_Fluid_index)
Returns
pFluid A pointer to a Fluid instance

Definition at line 236 of file CoolProp.cpp.

long get_Fluid_index ( std::string  FluidName)

Get the fluid index for a given fluid name

Parameters
FluidNameThe name for a fluid
Returns
index The fluid index (for use in IProps or elsewhere); -1 if not found

Definition at line 239 of file CoolProp.cpp.

std::string get_fluid_param_string ( std::string  FluidName,
std::string  ParamName 
)

Get a string for a value from a fluid (numerical values can be obtained from Props1 function)

Parameters
FluidNameThe name of the fluid
ParamNameA string, one of "aliases", "CAS", "CAS_number", "ASHRAE34", "REFPROPName","REFPROP_name", "TTSE_mode"
Returns
str The string, or an error message if not valid input

Definition at line 1173 of file CoolProp.cpp.

std::string get_global_param_string ( std::string  ParamName)

Get a globally-defined string

Parameters
ParamNameA string, one of "version", "errstring", "warnstring", "gitrevision", "FluidsList", "fluids_list"
Returns
str The string, or an error message if not valid input

Definition at line 1142 of file CoolProp.cpp.

long get_param_index ( std::string  param)

Get the parameter index for a given parameter

Parameters
paramThe string for an input or output parameter
Returns
index The parameter index (for use in IProps or elsewhere); -1 if not found

Definition at line 288 of file CoolProp.cpp.

long getFluidType ( std::string  FluidName)

Get a long that represents the fluid type

Parameters
FluidNameThe fluid name as a string
Returns
long element from global type enumeration

Definition at line 369 of file CoolProp.cpp.

std::string Phase ( std::string  FluidName,
double  T,
double  p 
)

Return the phase of the given state point with temperature, pressure as inputs

Parameters
FluidNameThe name of the fluid
TTemperature [K]
pPressure [kPa]
Returns
Phase as string, one of ""Two-Phase","Supercritical","Gas","Liquid"

Definition at line 490 of file CoolProp.cpp.

std::string Phase_Tp ( std::string  FluidName,
double  T,
double  p 
)

Return the phase of the given state point with temperature, pressure as inputs

Parameters
FluidNameThe name of the fluid
TTemperature [K]
pPressure [kPa]
Returns
Phase as string, one of ""Two-Phase","Supercritical","Gas","Liquid"

Definition at line 504 of file CoolProp.cpp.

std::string Phase_Trho ( std::string  FluidName,
double  T,
double  rho 
)

Return the phase of the given state point with temperature, density as inputs

Parameters
FluidNameThe name of the fluid
TTemperature [K]
rhoDensity [kg/m^3]
Returns
Phase as string, one of ""Two-Phase","Supercritical","Gas","Liquid"

Definition at line 476 of file CoolProp.cpp.

double Props ( std::string  Output,
std::string  Name1,
double  Prop1,
std::string  Name2,
double  Prop2,
std::string  FluidName 
)

Return a value that depends on the thermodynamic state

Parameters
OutputThe output parameter, one of "T","D","H",etc.
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name

Definition at line 902 of file CoolProp.cpp.

double Props ( char  Output,
char  Name1,
double  Prop1,
char  Name2,
double  Prop2,
char *  FluidName 
)

Return a value that depends on the thermodynamic state

Parameters
OutputThe output parameter, one of "T","D","H",etc.
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name
double Props ( std::string  Output,
char  Name1,
double  Prop1,
char  Name2,
double  Prop2,
std::string  FluidName 
)

Return a value that depends on the thermodynamic state

Parameters
OutputThe output parameter, one of "T","D","H",etc.
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name

Definition at line 907 of file CoolProp.cpp.

double Props1 ( std::string  FluidName,
std::string  Output 
)

Return a fluid value that does not depend on the thermodynamic state

Parameters
FluidNameThe name of the fluid
OutputThe name of the output parameter, some options are "Ttriple", "Tcrit", "pcrit", "Tmin", "molemass", "rhocrit", "accentric" (not all parameters are valid for all fluids)
Returns
val The value, or _HUGE if not valid

Definition at line 586 of file CoolProp.cpp.

double Props1SI ( std::string  FluidName,
std::string  Output 
)

Return a fluid value that does not depend on the thermodynamic state

Parameters
FluidNameThe name of the fluid
OutputThe name of the output parameter, some options are "Ttriple", "Tcrit", "pcrit", "Tmin", "molemass", "rhocrit", "accentric" (not all parameters are valid for all fluids)
Returns
val The value, or _HUGE if not valid

Definition at line 570 of file CoolProp.cpp.

double PropsSI ( std::string  Output,
std::string  Name1,
double  Prop1,
std::string  Name2,
double  Prop2,
std::string  FluidName 
)

Return a value that depends on the thermodynamic state

Parameters
OutputThe output parameter, one of "T","D","H",etc.
Name1The first state variable name, one of "T","D","H",etc.
Prop1The first state variable value
Name2The second state variable name, one of "T","D","H",etc.
Prop2The second state variable value
FluidNameThe fluid name

Definition at line 886 of file CoolProp.cpp.

void set_err_string ( std::string  err_string)

Set the global error string

Parameters
err_stringThe error string to use

Definition at line 191 of file CoolProp.cpp.

void set_phase ( std::string  Phase_str)

Nearly deprecated function.

Definition at line 196 of file CoolProp.cpp.

int set_reference_stateD ( std::string  FluidName,
double  T,
double  rho,
double  h0,
double  s0 
)

Set the reference state based on a state point

Parameters
FluidNameThe name of the fluid
TTemperature at reference state [K]
rhoDensity at reference state [kg/m^3]
h0Enthalpy at reference state [kJ/kg]
s0Entropy at references state [kJ/kg/K]

Definition at line 1100 of file CoolProp.cpp.

int set_reference_stateP ( Fluid pFluid,
std::string  reference_state 
)

Set the reference state for a pointer to a fluid (not exposed)

Parameters
pFluidA pointer to a Fluid instance
reference_stateThe reference state to use, one of "IIR" (h=200 kJ/kg, s=1 kJ/kg/K at 0C sat. liq.) "ASHRAE" (h=0,s=0 @ -40C sat liq), "NBP" (h=0,s=0 @ 1.0 bar sat liq.)

Definition at line 1049 of file CoolProp.cpp.

int set_reference_stateS ( std::string  FluidName,
std::string  reference_state 
)

Set the reference state based on a string representation (consistent naming with RFPROP)

Parameters
FluidNameThe name of the fluid
reference_stateThe reference state to use, one of "IIR" (h=200 kJ/kg, s=1 kJ/kg/K at 0C sat. liq.) "ASHRAE" (h=0,s=0 @ -40C sat liq), "NBP" (h=0,s=0 @ 1.0 bar sat liq.)

Definition at line 1037 of file CoolProp.cpp.

void set_warning ( std::string  warning)

An internal function to set the global warning string (API for warnings is not formalized)

Parameters
warningThe string to set as the warning string

Definition at line 59 of file CoolProp.cpp.