2 #define _CRTDBG_MAP_ALLOC
3 #define _CRT_SECURE_NO_WARNINGS
11 static int debug_level=0;
15 freopen(file,
"a+", stdout);
29 return Props1(std::string(FluidName), std::string(Output));
33 return Props1SI(std::string(FluidName),std::string(Output));
37 double val =
Props(Output,Name1[0],Prop1,Name2[0],Prop2,Ref);
58 char n1[] =
"\0", n2[] =
"\0";
67 double val =
PropsSI(Output,(
const char*)n1,Prop1,(
const char*)n2,Prop2,Ref);
73 EXPORT_CODE double CONVENTION PropsSI(
const char *Output,
const char *Name1,
double Prop1,
const char *Name2,
double Prop2,
const char * FluidName)
75 double val =
PropsSI(std::string(Output),Name1,Prop1,Name2,Prop2,FluidName);
79 {
return T * 9 / 5 - 459.67; }
82 {
return (T_F + 459.67) * 5 / 9;}
87 double val =
DerivTerms(std::string(Term),T,rho,std::string(Ref));
117 if (!strcmp(value,
"TTSE"))
121 else if (!strcmp(value,
"BICUBIC"))
153 strcpy(Phase_str,(
char*)
Phase(std::string(Fluid),T,p).c_str());
158 strcpy(Phase_str,(
char*)
Phase(std::string(Fluid),T,p).c_str());
163 strcpy(Phase_str,(
char*)
Phase_Trho(std::string(Fluid),T,rho).c_str());
172 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false; };
179 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false; };
185 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false; };
192 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return true;};
199 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false;};
205 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false;};
212 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false; };
219 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false;};
226 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false;};
233 long iFluid =
get_Fluid_index(FluidName);
if (iFluid<0){
return false;};
EXPORT_CODE double CONVENTION F2K(double T_F)
Convert from degrees Fahrenheit to Kelvin (useful primarily for testing)
Fluid * get_fluid(long iFluid)
EXPORT_CODE long CONVENTION Phase(const char *Fluid, double T, double p, char *Phase_str)
EXPORT_CODE bool CONVENTION enable_TTSE_LUT(const char *FluidName)
Enable the TTSE for this fluid.
EXPORT_CODE void CONVENTION set_standard_unit_system(int val)
bool build_TTSE_LUT(bool force=false)
Build of the TTSE LUT.
void enable_TTSE_LUT_writing(void)
Enable the writing of TTSE tables to file.
EXPORT_CODE int CONVENTION set_reference_stateS(const char *Ref, const char *reference_state)
EXPORT_CODE int CONVENTION set_TTSE_mode(const char *fluid, const char *value)
Set the TTSE mode (normal or bicubic)
bool isenabled_TTSE_LUT_writing(void)
Check if the writing of TTSE tables to file is enabled.
EXPORT_CODE bool CONVENTION set_TTSESat_LUT_size(const char *FluidName, int Nsat)
Over-ride the default size of both of the saturation LUT.
EXPORT_CODE double CONVENTION Props1SI(const char *FluidName, const char *Output)
void _set_standard_unit_system(int unit_sys)
EXPORT_CODE int CONVENTION get_debug_level()
void set_TTSESinglePhase_LUT_range(double hmin, double hmax, double pmin, double pmax)
Over-ride the default range of the single-phase LUT.
EXPORT_CODE void CONVENTION set_phase(const char *Phase_str)
int _get_standard_unit_system()
EXPORT_CODE void CONVENTION set_debug_level(int level)
EXPORT_CODE int CONVENTION get_standard_unit_system(void)
void set_TTSESinglePhase_LUT_size(int Np, int Nh)
Over-ride the default size of the single-phase LUT.
EXPORT_CODE long CONVENTION get_Fluid_index(const char *param)
Fluid is the abstract base class that is employed by all the other fluids.
double convert_from_SI_to_unit_system(long iInput, double value, int new_system)
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 disable_TTSE_LUT_writing(const char *FluidName)
Disable the writing of TTSE tables to file for this fluid.
EXPORT_CODE long CONVENTION get_global_param_string(const char *param, char *Output)
void enable_TTSE_LUT(void)
void set_TTSESat_LUT_size(int Nsat)
Over-ride the default size of both of the saturation LUT.
TTSESinglePhaseTableClass TTSESinglePhase
EXPORT_CODE bool CONVENTION enable_TTSE_LUT_writing(const char *FluidName)
Enable the writing of TTSE tables to file for this fluid.
EXPORT_CODE long CONVENTION redirect_stdout(const char *file)
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 PropsS(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *Ref)
EXPORT_CODE long CONVENTION get_param_index(const char *param)
void disable_TTSE_LUT_writing(void)
Disable the writing of TTSE tables to file.
EXPORT_CODE double CONVENTION PropsSI(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *FluidName)
EXPORT_CODE double CONVENTION fromSI(const char *input, double value, const char *new_system)
void get_TTSESinglePhase_LUT_range(double *hmin, double *hmax, double *pmin, double *pmax)
Get the current range of the single-phase LUT.
EXPORT_CODE double CONVENTION Props(const char *Output, char Name1, double Prop1, char Name2, double Prop2, const char *Ref)
EXPORT_CODE double CONVENTION DerivTerms(const char *Term, double T, double rho, const char *Ref)
EXPORT_CODE double CONVENTION Props1(const char *FluidName, const char *Output)
bool isenabled_TTSE_LUT(void)
Check if TTSE is enabled.
EXPORT_CODE long CONVENTION Phase_Trho(const char *Fluid, double T, double rho, char *Phase_str)
double convert_from_unit_system_to_SI(long iInput, double value, int old_system)
void set_err_string(std::string error_string)
EXPORT_CODE long CONVENTION Phase_Tp(const char *Fluid, double T, double p, char *Phase_str)
EXPORT_CODE int CONVENTION set_reference_stateD(const char *Ref, double T, double rho, double h0, double s0)
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 bool CONVENTION disable_TTSE_LUT(const char *FluidName)
Disable the TTSE for this fluid.
void disable_TTSE_LUT(void)
Disable the TTSE.
EXPORT_CODE double CONVENTION K2F(double T)
Convert from Kelvin to degrees Fahrenheit (useful primarily for testing)
EXPORT_CODE double CONVENTION toSI(const char *input, double value, const char *old_system)
EXPORT_CODE bool CONVENTION isenabled_TTSE_LUT(const char *FluidName)
Check if TTSE is enabled.
EXPORT_CODE long CONVENTION get_fluid_param_string(const char *fluid, const char *param, char *Output)
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.