6 using namespace Cantera;
20 const double a134[] = {
44 const double t134[] = {
45 -0.5, 0.0, 0.0, 0.0, 1.5, 1.5, 2.0, 2.0, 1.0, 3.0, 5.0,
46 1.0, 5.0, 5.0, 6.0, 10.0, 10.0, 10.0, 18.0, 22.0, 50.0
50 2, 1, 3, 6, 6, 1, 1, 2, 5, 2, 2,
51 4, 1, 4, 1, 2, 4, 1, 5, 3, 10
54 const double b134[] = {
64 double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0,
65 sum4 = 0.0, sum5 = 0.0;
67 double delta = Rho/Roc;
69 double phi0 = b134[0] + b134[1]*tau + b134[2]*log(tau)
70 + log(delta) + b134[3]/sqrt(tau) + b134[4]*pow(tau,-0.75);
72 for (i = 0; i<8; i++) {
73 sum1 += a134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
75 for (i = 8; i<11; i++) {
76 sum2 += a134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
78 for (i = 11; i<17; i++) {
79 sum3 += a134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
81 for (i = 17; i<20; i++) {
82 sum4 += a134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
84 sum5 = a134[20]*pow(tau,t134[20])*pow(delta,d134[20]);
85 double phir = sum1 + exp(-delta)*sum2 + exp(-delta*delta)*sum3
86 + exp(-delta*delta*delta)*sum4
87 + exp(-delta*delta*delta*delta)*sum5;
88 return R*T*(phir + phi0);
93 double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0,
94 sum4 = 0.0, sum5 = 0.0;
96 double delta = Rho/Roc;
98 double phi0t = b134[1]*tau + b134[2]
99 - 0.5*b134[3]*pow(tau,-0.5) - 0.75*b134[4]*pow(tau,-0.75);
101 for (i = 0; i<8; i++) {
102 sum1 += a134[i]*t134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
104 for (i = 8; i<11; i++) {
105 sum2 += a134[i]*t134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
107 for (i = 11; i<17; i++) {
108 sum3 += a134[i]*t134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
110 for (i = 17; i<20; i++) {
111 sum4 += a134[i]*t134[i]*pow(tau,t134[i])*pow(delta,d134[i]);
113 sum5 = a134[20]*t134[20]*pow(tau,t134[20])*pow(delta,d134[20]);
114 double phirt = sum1 + exp(-delta)*sum2 + exp(-delta*delta)*sum3
115 + exp(-delta*delta*delta)*sum4
116 + exp(-delta*delta*delta*delta)*sum5;
117 return R*T*(phirt + phi0t) + m_energy_offset;
122 double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0,
123 sum4 = 0.0, sum5 = 0.0;
125 double delta = Rho/Roc;
127 double phi0d = 1.0/delta;
130 for (i = 0; i<8; i++) {
131 sum1 += a134[i]*pow(tau,t134[i])*d134[i]*pow(delta,d134[i]-1);
133 for (i = 8; i<11; i++) {
134 sum2 += a134[i]*pow(tau,t134[i])*(d134[i] - delta)*pow(delta,d134[i]-1);
137 double dk = delta*delta;
138 for (i = 11; i<17; i++) {
139 sum3 += a134[i]*pow(tau,t134[i])*(d134[i] - 2.0*dk)*pow(delta,d134[i]-1);
143 for (i = 17; i<20; i++) {
144 sum4 += a134[i]*pow(tau,t134[i])*(d134[i] - 3.0*dk)*pow(delta,d134[i]-1);
148 sum5 = a134[20]*pow(tau,t134[20])*(d134[20] - 4.0*dk)*pow(delta,d134[20]-1);
150 double phird = sum1 + sum2 + sum3 + sum4 + sum5;
151 return R*T*delta*delta*Roc*(phird + phi0d);
155 double HFC134a::Psat()
157 if ((T < Tmn) || (T > Tc)) {
158 throw TPX_Error(
"HFC134a::Psat",
159 "Temperature out of range. T = " +
fp2str(T));
162 double x2 = 1.0 - x1;
163 double f = -7.686556*x2 + 2.311791*pow(x2,1.5)
164 - 2.039554*x2*x2 - 3.583758*pow(x2,4);
181 double HFC134a::ldens()
183 if ((T < Tmn) || (T > Tc)) {
184 throw TPX_Error(
"HFC134a::ldens",
185 "Temperature out of range. T = " +
fp2str(T));
188 double x2 = 1.0 - x1;
189 return 518.2 + 884.13*pow(x2,1.0/3.0) + 485.84*pow(x2,2.0/3.0)
190 + 193.29*pow(x2,10.0/3.0);
193 double HFC134a::Tcrit()
197 double HFC134a::Pcrit()
201 double HFC134a::Vcrit()
205 double HFC134a::Tmin()
209 double HFC134a::Tmax()
213 char* HFC134a::name()
215 return (
char*) m_name.c_str();
217 char* HFC134a::formula()
219 return (
char*) m_formula.c_str();
221 double HFC134a::MolWt()
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Contains declarations for string manipulation functions within Cantera.