22static const double Tmn = 216.54;
23static const double Tmx = 1500.0;
24static const double Tc=304.21;
25static const double Roc=464.00;
26static const double To=216.54;
27static const double R=188.918;
28static const double Gamma=5.0E-6;
29static const double u0=3.2174105E5;
30static const double s0=2.1396056E3;
31static const double Tp=250;
32static const double Pc=7.38350E6;
33static const double M=44.01;
36static const double Acarbdi[]= {
59static const double F[]= {
71static const double D[]= {
81static const double G[]= {
90double 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;
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);
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);
181 return pow(Rho,3)*egrho;
183 return pow(Rho,5)*egrho;
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;
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;
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);
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;
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);
Base class for exceptions thrown by Cantera classes.
double Tmax() override
Maximum temperature for which the equation of state is valid.
double up() override
internal energy.
double ldens() override
Liquid density. Equation D2 in Reynolds.
double I(int i, double, double)
I = integral from o-rho { 1/(rho^2) * H(i, rho) d rho } ( see section 2 of Reynolds TPSI )
double Tmin() override
Minimum temperature for which the equation of state is valid.
double Tcrit() override
Critical temperature [K].
double sp() override
entropy. See Reynolds eqn (16) section 2
double Pp() override
Pressure. Equation P-3 in Reynolds. P(rho, T).
double MolWt() override
Molecular weight [kg/kmol].
double H(int i, double egrho)
H returns a multiplier in each term of the sum in P-3.
double C(int jm, double, double, double, double)
C returns a multiplier in each term of the sum in P-3, used in conjunction with C in the function Pp.
double Vcrit() override
Critical specific volume [m^3/kg].
double Pcrit() override
Critical pressure [Pa].
double Psat() override
Pressure at Saturation. Equation S-2 in Reynolds.
double Cprime(int i, double, double, double)
Derivative of C(i)
Namespace for the Cantera kernel.
Contains declarations for string manipulation functions within Cantera.