22 static const double Tmn = 216.54;
23 static const double Tmx = 1500.0;
24 static const double Tc=304.21;
25 static const double Roc=464.00;
26 static const double To=216.54;
27 static const double R=188.918;
28 static const double Gamma=5.0E-6;
29 static const double u0=3.2174105E5;
30 static const double s0=2.1396056E3;
31 static const double Tp=250;
32 static const double Pc=7.38350E6;
33 static const double M=44.01;
36 static const double Acarbdi[]= {
59 static const double F[]= {
71 static const double D[]= {
81 static const double G[]= {
90 double CarbonDioxide::C(
int j,
double Tinverse,
double T2inverse,
double T3inverse,
double T4inverse)
96 Acarbdi[2] * Tinverse +
97 Acarbdi[3] * T2inverse +
98 Acarbdi[4] * T3inverse;
100 return Acarbdi[5] *T +
102 Acarbdi[7] * Tinverse;
104 return Acarbdi[8]*T + Acarbdi[9];
106 return Acarbdi[10]*T + Acarbdi[11];
110 return Acarbdi[13] *T2inverse +
111 Acarbdi[14] *T3inverse +
112 Acarbdi[15] *T4inverse;
114 return Acarbdi[16] *T2inverse +
115 Acarbdi[17] *T3inverse +
116 Acarbdi[18] *T4inverse;
122 double CarbonDioxide::Cprime(
int j,
double T2inverse,
double T3inverse,
double T4inverse)
127 - Acarbdi[2] * T2inverse +
128 -2 * Acarbdi[3] * T3inverse +
129 -3 * Acarbdi[4] * T4inverse;
132 Acarbdi[7] * T2inverse;
141 -2 *Acarbdi[13] *T3inverse +
142 -3 *Acarbdi[14] *T4inverse +
143 -4 *Acarbdi[15]* pow(T,-5);
146 -2 *Acarbdi[16] *T3inverse +
147 -3 *Acarbdi[17] *T4inverse +
148 -4 *Acarbdi[18] *pow(T,-5);
154 double CarbonDioxide::I(
int j,
double ergho,
double Gamma)
160 return pow(Rho, 2)/2;
162 return pow(Rho, 3)/ 3;
164 return pow(Rho, 4)/ 4;
166 return pow(Rho, 5)/ 5;
168 return (1 - ergho) / double(2 * Gamma);
170 return (1 - ergho *
double(Gamma * pow(Rho,2) +
double(1)))/ double(2 * Gamma * Gamma);
176 double CarbonDioxide::H(
int i,
double egrho)
181 return pow(Rho,3)*egrho;
183 return pow(Rho,5)*egrho;
189 double CarbonDioxide::up()
191 double Tinverse = 1.0/T;
192 double T2inverse = pow(T, -2);
193 double T3inverse = pow(T, -3);
194 double T4inverse = pow(T, -4);
195 double egrho = exp(-Gamma*Rho*Rho);
199 sum += G[0]*log(T/To);
201 for (i=1; i<=5; i++) {
202 sum += G[i]*(pow(T,i) - pow(To,i))/
double(i);
204 for (i=0; i<=6; i++) {
205 sum += I(i,egrho, Gamma) *
206 (C(i, Tinverse, T2inverse, T3inverse, T4inverse) - T*Cprime(i,T2inverse, T3inverse, T4inverse));
209 return sum + m_energy_offset;
212 double CarbonDioxide::sp()
214 double T2inverse = pow(T, -2);
215 double T3inverse = pow(T, -3);
216 double T4inverse = pow(T, -4);
217 double egrho = exp(-Gamma*Rho*Rho);
220 for (
int i=2; i<=5; i++) {
221 sum += G[i]*(pow(T,i-1) - pow(To,i-1))/
double(i-1);
223 sum += G[1]*log(T/To);
224 sum -= G[0]*(1.0/T - 1.0/To);
225 for (
int i=0; i<=6; i++) {
226 sum -= Cprime(i,T2inverse, T3inverse, T4inverse)*I(i,egrho,Gamma);
228 sum += s0 - R*log(Rho);
229 return sum + m_entropy_offset;
232 double CarbonDioxide::Pp()
234 double Tinverse = pow(T,-1);
235 double T2inverse = pow(T, -2);
236 double T3inverse = pow(T, -3);
237 double T4inverse = pow(T, -4);
238 double egrho = exp(-Gamma*Rho*Rho);
242 for (
int i=0; i<=6; i++) {
243 P += C(i,Tinverse, T2inverse, T3inverse, T4inverse)*H(i,egrho);
248 double CarbonDioxide::Psat()
251 if ((T < Tmn) || (T > Tc)) {
253 "Temperature out of range. T = {}", T);
255 for (
int i=1; i<=8; i++) {
256 sum += F[i-1] * pow((T/Tp -1),
double(i-1));
259 log = ((Tc/T)-1)*sum;
264 double CarbonDioxide::ldens()
266 double xx=1-(T/Tc), sum=0;
267 if ((T < Tmn) || (T > Tc)) {
269 "Temperature out of range. T = {}", T);
271 for (
int i=1; i<=6; i++) {
272 sum+=D[i-1]*pow(xx,
double(i-1)/3.0);
280 double CarbonDioxide::Tcrit()
284 double CarbonDioxide::Pcrit()
288 double CarbonDioxide::Vcrit()
292 double CarbonDioxide::Tmin()
296 double CarbonDioxide::Tmax()
300 double CarbonDioxide::MolWt()
Base class for exceptions thrown by Cantera classes.
Namespace for the Cantera kernel.
Contains declarations for string manipulation functions within Cantera.