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
CoolPropDLL.h
Go to the documentation of this file.
1 #ifndef COOLPROPDLL_H
2 #define COOLPROPDLL_H
3 
4  #include "CoolPropTools.h"
5 
6  // Functions with the call type like
7  // EXPORT_CODE void CONVENTION AFunction(double, double);
8  // will be exported to the DLL
9 
10  /*
11  ####################################################################################
12  Overloads for DLL wrapping puposes
13 
14  These functions take strings which are 0-terminated. These functions pass directly to
15  equivalently named functions in CoolProp.h that take std::string
16  ####################################################################################
17  */
18 
23  EXPORT_CODE double CONVENTION Props1SI(const char *FluidName, const char* Output);
28  EXPORT_CODE double CONVENTION PropsSI(const char *Output,const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref);
33  EXPORT_CODE double CONVENTION PropsS(const char *Output,const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref);
38  EXPORT_CODE double CONVENTION Props(const char *Output,const char Name1, double Prop1, const char Name2, double Prop2, const char *Ref);
43  EXPORT_CODE double CONVENTION Props1(const char *FluidName, const char *Output);
48  EXPORT_CODE int CONVENTION IsFluidType(const char *Ref, const char *Type);
49 
50  EXPORT_CODE double CONVENTION DerivTerms(const char *Term, double T, double rho, const char *Ref);
51  EXPORT_CODE long CONVENTION Phase(const char *Fluid, double T, double p, char *Phase_str);
52  EXPORT_CODE long CONVENTION Phase_Trho(const char *Fluid, double T, double p, char *Phase_str);
53  EXPORT_CODE long CONVENTION Phase_Tp(const char *Fluid, double T, double rho, char *Phase_str);
54  EXPORT_CODE void CONVENTION set_phase(const char *Phase_str);
55 
56  EXPORT_CODE double CONVENTION fromSI(const char *input, const double value, const char *new_system);
57  EXPORT_CODE double CONVENTION toSI(const char *input, const double value, const char *old_system);
58 
59  // When using SWIG, it is extremely difficult to deal with char* for output strings, so just use
60  // the std::string version since SWIG can handle std::string just fine
61  #if defined(SWIG)
62  std::string get_global_param_string(std::string ParamName);
63  std::string get_fluid_param_string(std::string FluidName, std::string ParamName);
64  #else
65  EXPORT_CODE long CONVENTION get_global_param_string(const char *param, char *Output);
66  EXPORT_CODE long CONVENTION get_fluid_param_string(const char *fluid, const char *param, char *Output);
67  #endif
68 
73  EXPORT_CODE int CONVENTION set_reference_stateS(const char *Ref, const char *reference_state);
78  EXPORT_CODE int CONVENTION set_reference_stateD(const char *Ref, double T, double rho, double h0, double s0);
79  /*
80  ####################################################################################
81  Implemented functions
82 
83  These functions take inputs that are compatible with DLL passing and are
84  implemented in CoolPropDLL.cpp
85  ####################################################################################
86  */
87 
88  // This version uses the indices in place of the strings for speed. Get the parameter indices
89  // from get_param_index('D') for instance and the Fluid index from get_Fluid_index('Air') for instance
90  EXPORT_CODE double CONVENTION IPropsSI(long iOutput, long iName1, double Prop1, long iName2, double Prop2, long iFluid);
91  EXPORT_CODE double CONVENTION IProps(long iOutput, long iName1, double Prop1, long iName2, double Prop2, long iFluid);
92 
94  EXPORT_CODE double CONVENTION F2K(double T_F);
96  EXPORT_CODE double CONVENTION K2F(double T_K);
97 
106 
107  EXPORT_CODE long CONVENTION get_param_index(const char *param);
108  EXPORT_CODE long CONVENTION get_Fluid_index(const char *param);
109  EXPORT_CODE long CONVENTION redirect_stdout(const char *file);
110 
111  // ---------------------------------
112  // Getter and setter for debug level
113  // ---------------------------------
114 
120  EXPORT_CODE void CONVENTION set_debug_level(int level);
121 
126  EXPORT_CODE bool CONVENTION enable_TTSE_LUT(const char *FluidName);
128  EXPORT_CODE bool CONVENTION isenabled_TTSE_LUT(const char *FluidName);
130  EXPORT_CODE bool CONVENTION disable_TTSE_LUT(const char *FluidName);
132  EXPORT_CODE bool CONVENTION enable_TTSE_LUT_writing(const char *FluidName);
134  EXPORT_CODE bool CONVENTION isenabled_TTSE_LUT_writing(const char *FluidName);
136  EXPORT_CODE bool CONVENTION disable_TTSE_LUT_writing(const char *FluidName);
138  EXPORT_CODE bool CONVENTION set_TTSESat_LUT_size(const char *FluidName, int);
140  EXPORT_CODE bool CONVENTION set_TTSESinglePhase_LUT_size(const char *FluidName, int Np, int Nh);
142  EXPORT_CODE bool CONVENTION set_TTSESinglePhase_LUT_range(const char *FluidName, double hmin, double hmax, double pmin, double pmax);
144  EXPORT_CODE bool CONVENTION get_TTSESinglePhase_LUT_range(const char *FluidName, double *hmin, double *hmax, double *pmin, double *pmax);
146  EXPORT_CODE int CONVENTION set_TTSE_mode(const char *FluidName, const char * Value);
147 
148 
149 #endif
EXPORT_CODE long CONVENTION Phase_Tp(const char *Fluid, double T, double rho, char *Phase_str)
EXPORT_CODE double CONVENTION IProps(long iOutput, long iName1, double Prop1, long iName2, double Prop2, long iFluid)
Definition: CoolProp.cpp:758
EXPORT_CODE double CONVENTION DerivTerms(const char *Term, double T, double rho, const char *Ref)
Definition: CoolPropDLL.cpp:84
EXPORT_CODE bool CONVENTION isenabled_TTSE_LUT(const char *FluidName)
Check if TTSE is enabled.
EXPORT_CODE double CONVENTION PropsSI(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref)
Definition: CoolPropDLL.cpp:73
EXPORT_CODE int CONVENTION set_reference_stateS(const char *Ref, const char *reference_state)
Definition: CoolPropDLL.cpp:18
EXPORT_CODE void CONVENTION set_standard_unit_system(int val)
EXPORT_CODE double CONVENTION F2K(double T_F)
Convert from degrees Fahrenheit to Kelvin (useful primarily for testing)
Definition: CoolPropDLL.cpp:81
EXPORT_CODE double CONVENTION Props1SI(const char *FluidName, const char *Output)
Definition: CoolPropDLL.cpp:31
EXPORT_CODE void CONVENTION set_debug_level(int level)
EXPORT_CODE int CONVENTION get_standard_unit_system()
EXPORT_CODE bool CONVENTION enable_TTSE_LUT_writing(const char *FluidName)
Enable the writing of TTSE tables to file for this fluid.
EXPORT_CODE double CONVENTION fromSI(const char *input, const double value, const char *new_system)
Definition: CoolPropDLL.cpp:91
EXPORT_CODE bool CONVENTION get_TTSESinglePhase_LUT_range(const char *FluidName, double *hmin, double *hmax, double *pmin, double *pmax)
Get the current range of the single-phase LUT.
EXPORT_CODE bool CONVENTION set_TTSESat_LUT_size(const char *FluidName, int)
Over-ride the default size of both of the saturation LUT.
#define EXPORT_CODE
Definition: CoolPropTools.h:31
EXPORT_CODE int CONVENTION set_TTSE_mode(const char *FluidName, const char *Value)
Set the TTSE mode (normal or bicubic)
EXPORT_CODE long CONVENTION redirect_stdout(const char *file)
Definition: CoolPropDLL.cpp:13
Fluid is the abstract base class that is employed by all the other fluids.
Definition: FluidClass.h:147
EXPORT_CODE long CONVENTION get_param_index(const char *param)
EXPORT_CODE bool CONVENTION set_TTSESinglePhase_LUT_range(const char *FluidName, double hmin, double hmax, double pmin, double pmax)
Over-ride the default range of the single-phase LUT.
EXPORT_CODE double CONVENTION Props(const char *Output, const char Name1, double Prop1, const char Name2, double Prop2, const char *Ref)
Definition: CoolPropDLL.cpp:40
Type
Type of JSON value.
Definition: rapidjson.h:513
EXPORT_CODE void CONVENTION set_phase(const char *Phase_str)
EXPORT_CODE double CONVENTION Props1(const char *FluidName, const char *Output)
Definition: CoolPropDLL.cpp:27
EXPORT_CODE double CONVENTION PropsS(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref)
Definition: CoolPropDLL.cpp:35
EXPORT_CODE long CONVENTION get_fluid_param_string(const char *fluid, const char *param, char *Output)
EXPORT_CODE long CONVENTION get_Fluid_index(const char *param)
EXPORT_CODE int CONVENTION get_debug_level()
EXPORT_CODE double CONVENTION K2F(double T_K)
Convert from Kelvin to degrees Fahrenheit (useful primarily for testing)
Definition: CoolPropDLL.cpp:78
EXPORT_CODE double CONVENTION IPropsSI(long iOutput, long iName1, double Prop1, long iName2, double Prop2, long iFluid)
Definition: CoolProp.cpp:861
EXPORT_CODE bool CONVENTION isenabled_TTSE_LUT_writing(const char *FluidName)
Check if the writing of TTSE tables to file is enabled.
EXPORT_CODE bool CONVENTION set_TTSESinglePhase_LUT_size(const char *FluidName, int Np, int Nh)
Over-ride the default size of the single-phase LUT.
EXPORT_CODE long CONVENTION get_global_param_string(const char *param, char *Output)
EXPORT_CODE long CONVENTION Phase_Trho(const char *Fluid, double T, double p, char *Phase_str)
GenericValue< UTF8<> > Value
Value with UTF8 encoding.
Definition: document.h:679
EXPORT_CODE int CONVENTION set_reference_stateD(const char *Ref, double T, double rho, double h0, double s0)
Definition: CoolPropDLL.cpp:22
EXPORT_CODE bool CONVENTION disable_TTSE_LUT_writing(const char *FluidName)
Disable the writing of TTSE tables to file for this fluid.
EXPORT_CODE double CONVENTION toSI(const char *input, const double value, const char *old_system)
Definition: CoolPropDLL.cpp:95
EXPORT_CODE long CONVENTION Phase(const char *Fluid, double T, double p, char *Phase_str)
EXPORT_CODE bool CONVENTION disable_TTSE_LUT(const char *FluidName)
Disable the TTSE.
EXPORT_CODE int CONVENTION IsFluidType(const char *Ref, const char *Type)
Definition: CoolProp.cpp:390
EXPORT_CODE bool CONVENTION enable_TTSE_LUT(const char *FluidName)
Enable the TTSE for this fluid.
#define CONVENTION
Definition: CoolPropTools.h:34