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
Ethylene.cpp
Go to the documentation of this file.
1 
2 #include "CoolProp.h"
3 #include <vector>
4 #include "CPExceptions.h"
5 #include "FluidClass.h"
6 #include "Ethylene.h"
7 
9 {
10  double _n [] = {0,0.18617429100670e1, -0.30913708460844e1, -0.17384817095516, 0.80370985692840e-1, 0.23682707317354, 0.21922786610247e-1, 0.11827885813193, -0.21736384396776e-1, 0.44007990661139e-1, 0.12554058863881, -0.13167945577241, -0.52116984575897e-2, 0.15236081265419e-3, -0.24505335342756e-4, 0.28970524924022, -0.18075836674288, 0.15057272878461, -0.14093151754458, 0.22755109070253e-1, 0.14026070529061e-1, 0.61697454296214e-2, -0.41286083451333e-3, 0.12885388714785e-1, -0.69128692157093e-1, 0.10936225568483, -0.81818875271794e-2, -0.56418472117170e-1, 0.16517867750633e-2, 0.95904006517001e-2, -0.26236572984886e-2, -0.50242414011355e2, 0.74846420119299e4, -0.68734299232625e4, -0.93577982814338e3, 0.94133024786113e3};
11  double _d [] = {0, 1, 1, 1, 2, 2, 4, 1, 1, 3, 4, 5, 7, 10, 11, 1, 1, 2, 2, 4, 4, 6, 7, 4, 5, 6, 6, 7, 8, 9, 10, 2, 2, 2, 3, 3};
12  double _t [] = {0, 0.5, 1, 2.5, 0, 2, 0.5, 1, 4, 1.25, 2.75, 2.25, 1, 0.75, 0.5, 2.5, 3.5, 4, 6, 1.5, 5, 4.5, 15, 20, 23, 22, 29, 19, 15, 13, 10, 1, 0, 1, 2, 3};
13  double _l [] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
14  double _eta [] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25};
15  double _beta [] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, 300, 300, 300, 300};
16  double _gamma [] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.16, 1.19, 1.19, 1.19, 1.19};
17  double _epsilon [] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1};
18 
19  std::vector<double> n_v(_n,_n+sizeof(_n)/sizeof(double));
20  std::vector<double> d_v(_d,_d+sizeof(_d)/sizeof(double));
21  std::vector<double> t_v(_t,_t+sizeof(_t)/sizeof(double));
22  std::vector<double> l_v(_l,_l+sizeof(_l)/sizeof(double));
23  std::vector<double> eta_v(_eta,_eta+sizeof(_eta)/sizeof(double));
24  std::vector<double> epsilon_v(_epsilon,_epsilon+sizeof(_epsilon)/sizeof(double));
25  std::vector<double> beta_v(_beta,_beta+sizeof(_beta)/sizeof(double));
26  std::vector<double> gamma_v(_gamma,_gamma+sizeof(_gamma)/sizeof(double));
27 
28  //Critical parameters
29  crit.rho = 214.24; //[kg/m^3]
30  crit.p = PressureUnit(5041.8, UNIT_KPA); //[kPa]
31  crit.T = 282.35; //[K]
32  crit.v = 1/crit.rho;
33 
34  // Other fluid parameters
35  params.molemass = 28.05376;
36  params.Ttriple = 103.989;
37  params.ptriple = 0.12265;
38  params.accentricfactor = 0.0866;
39  params.R_u = 8.31451;
40 
41  // Limits of EOS
42  limits.Tmin = params.Ttriple;
43  limits.Tmax = 500.0;
44  limits.pmax = 100000.0;
45  limits.rhomax = 1000000.0*params.molemass;
46 
47  phirlist.push_back(new phir_power( n_v,d_v,t_v,l_v,1,30));
48  phirlist.push_back(new phir_gaussian( n_v,d_v,t_v,eta_v,epsilon_v,beta_v,gamma_v,31,35));
49 
50  double _theta [] ={0, 0, 0, 0, 4.43266896, 5.74840149, 7.8027825, 15.5851154};
51  std::vector<double> theta_v (_theta,_theta+sizeof(_theta)/sizeof(double));
52  double _n0 [] ={0, 8.68815523, -4.47960564, 3.0, 2.49395851, 3.0027152, 2.5126584, 3.99064217};
53  std::vector<double> n0_v (_n0,_n0+sizeof(_n0)/sizeof(double));
54 
55  // lead term: log(delta)+c+m*tau
56  phi0list.push_back(new phi0_lead(n0_v[1], n0_v[2]));
57  phi0list.push_back(new phi0_logtau(n0_v[3]));
58  phi0list.push_back(new phi0_Planck_Einstein(n0_v,theta_v,4,7));
59 
60  EOSReference.assign("Smukala, J., R. Span, and W. Wagner, \"New Equation of State for Ethylene Covering the Fluid Region for Temperatures From the Melting Line to 450 K at Pressures up to 300 MPa,\" J. Phys. Chem. Ref. Data, Vol. 29, No. 5, 2000");
61  TransportReference.assign("Using ECS in fully predictive mode");
62 
63  name.assign("Ethylene");
64  aliases.push_back(std::string("ethylene"));
65  aliases.push_back(std::string("ETHYLENE"));
66  REFPROPname.assign("ETHYLENE");
67 
68  BibTeXKeys.EOS = "Smukala-JPCRD-2000";
69  BibTeXKeys.ECS_LENNARD_JONES = "Poling-BOOK-2001";
70  BibTeXKeys.VISCOSITY = "__Holland-JPCRD-1983";
71  BibTeXKeys.CONDUCTIVITY = "__Holland-JPCRD-1983";
72 }
73 double EthyleneClass::psat(double T)
74 {
75  // Maximum absolute error is 0.009490 % between 103.986001 K and 282.349999 K
76  const double ti[]={0,1.0,1.5,2.3,3.6,5.2,7.3};
77  const double Ni[]={0,-6.3985237646344073, 1.4639547492870413, -1.0557590711139355, -0.033354984340998643, -3.0888771259345189, 1.4052009269648895 };
78  double summer=0,theta;
79  int i;
80  theta=1-T/reduce.T;
81  for (i=1;i<=6;i++)
82  {
83  summer=summer+Ni[i]*pow(theta,ti[i]);
84  }
85  return reduce.p.Pa*exp(reduce.T/T*summer);
86 }
87 double EthyleneClass::rhosatL(double T)
88 {
89  // Maximum absolute error is 0.195803 % between 103.986001 K and 282.349999 K
90  const double ti[]={0,0.32887068042309103, 1.0428684104660895, 1.2689349956735425, 1.1595368235084051, 1.252154945568378};
91  const double Ni[]={0,1.5248594908220618, -14.910147190092355, 181.29389338879201, 64.047306515891108, -230.65598949594369};
92  double summer=0;
93  int i;
94  double theta;
95  theta=1-T/reduce.T;
96  for (i=1;i<=5;i++)
97  {
98  summer+=Ni[i]*pow(theta,ti[i]);
99  }
100  return reduce.rho*exp(summer);
101 }
102 double EthyleneClass::rhosatV(double T)
103 {
104  // Maximum absolute error is 0.225963 % between 103.986001 K and 282.349999 K
105  const double ti[]={0,0.32298080248015554, 2.4807017275343246, 0.72680742932964071, 13.056302112753443, 4.6256425195832778};
106  const double Ni[]={0,-1.522898492573022, -0.48983677815077542, -3.0102481473248313, 2.8753984965993493, -3.3109543516950803};
107  double summer=0,theta;
108  int i;
109  theta=1.0-T/reduce.T;
110  for (i=1;i<=5;i++)
111  {
112  summer=summer+Ni[i]*pow(theta,ti[i]);
113  }
114  return reduce.rho*exp(crit.T/T*summer);
115 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
double psat(double)
Definition: Ethylene.cpp:73
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
std::string VISCOSITY
Definition: FluidClass.h:122
PressureUnit p
Definition: FluidClass.h:50
std::string name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
double rhosatL(double)
Definition: Ethylene.cpp:87
std::string TransportReference
A std::string that contains a reference for thermo properties for the fluid.
Definition: FluidClass.h:158
double Pa
Definition: Units.h:22
std::vector< std::string > aliases
The REFPROP-compliant name if REFPROP-"name" is not a compatible fluid name. If not included...
Definition: FluidClass.h:153
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
double Tmax
Definition: FluidClass.h:54
std::string EOSReference
The critical qd parameter for the Olchowy-Sengers cross-over term.
Definition: FluidClass.h:157
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
std::string ECS_LENNARD_JONES
Definition: FluidClass.h:124
double rhosatV(double)
Definition: Ethylene.cpp:102
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
std::vector< phi_BC * > phi0list
A vector of instances of the phi_BC classes for the residual Helmholtz energy contribution.
Definition: FluidClass.h:179
double Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
std::string CONDUCTIVITY
Definition: FluidClass.h:123