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
Deprecated.cpp
Go to the documentation of this file.
1 #if defined(_MSC_VER)
2 #define _CRTDBG_MAP_ALLOC
3 #define _CRT_SECURE_NO_WARNINGS
4 #include <crtdbg.h>
5 #endif
6 
7 #include "CoolProp.h"
8 #include "CPState.h"
9 #include "FluidClass.h"
10 
11 #include "Deprecated.h"
12 
13 EXPORT_CODE double CONVENTION conformal_Trho(const char* FluidName, const char* ReferenceFluidName, double T, double rho, double *Tconform, double *rhoconform)
14 {
15  long iFluid = get_Fluid_index(FluidName);
16  long iRefFluid = get_Fluid_index(ReferenceFluidName);
17  if (iFluid < 0 || iRefFluid < 0)
18  {
19  return _HUGE;
20  }
21  else
22  {
23  try{
24  Fluid *pFluid = get_fluid(iFluid);
25  Fluid *pRefFluid = get_fluid(iRefFluid);
26 
27  double rhobar=rho/pFluid->params.molemass;
28  double rhocbar=pFluid->reduce.rho/pFluid->params.molemass;
29  double Tc=pFluid->reduce.T;
30 
31  double Tc0 = pRefFluid->reduce.T;
32  double rhoc0bar=pRefFluid->reduce.rho/pRefFluid->params.molemass;
33  double T0=T*Tc0/Tc;
34  double rho0bar = rhobar*rhoc0bar/rhocbar; // Must be the ratio of MOLAR densities!!
35  double rho0 = rho0bar*pRefFluid->params.molemass;
36  std::string errstring;
37  std::vector<double> Trho = pFluid->ConformalTemperature(pFluid,pRefFluid,T,rho,T0,rho0,&errstring);
38  if (errstring.size()>0){
39  return _HUGE;
40  }
41  else{
42  *Tconform = Trho[0];
43  *rhoconform = Trho[1];
44  return 0;
45  }
46  }
47  catch (std::exception &){
48  return _HUGE;
49  }
50  }
51 }
52 
53 EXPORT_CODE double CONVENTION viscosity_dilute(const char* FluidName, double T)
54 {
55  long iFluid = get_Fluid_index(FluidName);
56  if (iFluid < 0)
57  {
58  return _HUGE;
59  }
60  else
61  {
62  double e_k, sigma;
63  Fluid *pFluid = get_fluid(iFluid);
64  pFluid->ECSParams(&e_k, &sigma);
65  return pFluid->viscosity_dilute(T,e_k,sigma);
66  }
67 }
68 EXPORT_CODE double CONVENTION viscosity_residual(const char* FluidName, double T, double rho)
69 {
70  long iFluid = get_Fluid_index(FluidName);
71  if (iFluid < 0)
72  {
73  return _HUGE;
74  }
75  else
76  {
77  Fluid *pFluid = get_fluid(iFluid);
78  try{
79  return pFluid->viscosity_residual(T,rho);
80  }
81  catch (NotImplementedError &)
82  {
83  return _HUGE;
84  }
85  }
86 }
87 
88 EXPORT_CODE double CONVENTION conductivity_critical(const char* FluidName, double T, double rho)
89 {
90  long iFluid = get_Fluid_index(FluidName);
91  if (iFluid < 0)
92  {
93  return _HUGE;
94  }
95  else
96  {
97  Fluid *pFluid = get_fluid(iFluid);
98  return pFluid->conductivity_critical(T,rho);
99  }
100 }
101 EXPORT_CODE double CONVENTION conductivity_background(const char* FluidName, double T, double rho)
102 {
103  long iFluid = get_Fluid_index(FluidName);
104  if (iFluid < 0)
105  {
106  return _HUGE;
107  }
108  else
109  {
110  Fluid *pFluid = get_fluid(iFluid);
111  return pFluid->conductivity_background(T,rho);
112  }
113 }
114 
115 EXPORT_CODE double CONVENTION rhosatL_anc(const char* FluidName, double T)
116 {
117  try{
118  // Try to load the CoolProp Fluid
119  Fluid *pFluid = get_fluid(get_Fluid_index(FluidName));
120  return pFluid->rhosatL(T);
121  }
122  catch(NotImplementedError &){
123  return -_HUGE;
124  }
125  return -_HUGE;
126 }
127 EXPORT_CODE double CONVENTION rhosatV_anc(const char* FluidName, double T)
128 {
129  try{
130  // Try to load the CoolProp Fluid
131  Fluid *pFluid = get_fluid(get_Fluid_index(FluidName));
132  return pFluid->rhosatV(T);
133  }
134  catch(NotImplementedError &){
135  return -_HUGE;
136  }
137  return -_HUGE;
138 }
139 EXPORT_CODE double CONVENTION psatL_anc(const char* FluidName, double T)
140 {
141  try{
142  // Try to load the CoolProp Fluid
143  Fluid *pFluid = get_fluid(get_Fluid_index(FluidName));
144  return pFluid->psatL_anc(T);
145  }
146  catch(NotImplementedError &){
147  return -_HUGE;
148  }
149  return -_HUGE;
150 }
151 EXPORT_CODE double CONVENTION psatV_anc(const char* FluidName, double T)
152 {
153  try{
154  // Try to load the CoolProp Fluid
155  Fluid *pFluid = get_fluid(get_Fluid_index(FluidName));
156  return pFluid->psatV_anc(T);
157  }
158  catch(NotImplementedError &){
159  return -_HUGE;
160  }
161  return -_HUGE;
162 }
Fluid * get_fluid(long iFluid)
Definition: CoolProp.cpp:236
long get_Fluid_index(std::string FluidName)
Definition: CoolProp.cpp:239
double psatV_anc(double T)
Definition: FluidClass.h:380
virtual double viscosity_residual(double T, double rho)
Definition: FluidClass.h:468
EXPORT_CODE double CONVENTION conductivity_critical(const char *FluidName, double T, double rho)
Definition: Deprecated.cpp:88
EXPORT_CODE double CONVENTION rhosatV_anc(const char *FluidName, double T)
Definition: Deprecated.cpp:127
double molemass
Definition: FluidClass.h:43
double conductivity_critical(double T, double rho, double qd=2e9, double GAMMA=0.0496, double zeta0=1.94e-10)
EXPORT_CODE double CONVENTION psatL_anc(const char *FluidName, double T)
Definition: Deprecated.cpp:139
double psatL_anc(double T)
Definition: FluidClass.h:374
EXPORT_CODE double CONVENTION psatV_anc(const char *FluidName, double T)
Definition: Deprecated.cpp:151
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
#define EXPORT_CODE
Definition: CoolPropTools.h:31
virtual void ECSParams(double *e_k, double *sigma)
virtual double rhosatV(double T)
Definition: FluidClass.h:371
virtual double viscosity_dilute(double T, double e_k, double sigma)
Fluid is the abstract base class that is employed by all the other fluids.
Definition: FluidClass.h:147
struct OtherParameters params
Definition: FluidClass.h:220
EXPORT_CODE double CONVENTION rhosatL_anc(const char *FluidName, double T)
Definition: Deprecated.cpp:115
std::vector< double > ConformalTemperature(Fluid *InterestFluid, Fluid *ReferenceFluid, double T, double rho, double T0, double rho0, std::string *errstring)
EXPORT_CODE double CONVENTION viscosity_dilute(const char *FluidName, double T)
Definition: Deprecated.cpp:53
EXPORT_CODE double CONVENTION conformal_Trho(const char *FluidName, const char *ReferenceFluidName, double T, double rho, double *Tconform, double *rhoconform)
Definition: Deprecated.cpp:13
virtual double conductivity_background(double T, double rho)
Definition: FluidClass.h:443
virtual double rhosatL(double T)
Definition: FluidClass.h:368
EXPORT_CODE double CONVENTION conductivity_background(const char *FluidName, double T, double rho)
Definition: Deprecated.cpp:101
EXPORT_CODE double CONVENTION viscosity_residual(const char *FluidName, double T, double rho)
Definition: Deprecated.cpp:68
#define CONVENTION
Definition: CoolPropTools.h:34