20R = 2.59820853437877e2,
21Gamma = 5.46895508389297e-6,
27static const double Aoxy[] = {
28 -4.26396872798684e-1, 3.48334938784107e1, -5.77516910418738e2,
29 2.40961751553325e4, -1.23332307855543e6, 3.73585286319658e-4,
30 -1.70178244046465e-1 ,-3.33226903068473e-4, 8.61334799901291e3,
31 -6.80394661057309e-7, 7.09583347162704e-4, -5.73905688255053e-2,
32 -1.92123080811409e-7, 3.11764722329504e-8, -8.09463854745591e-6,
33 -2.22562296356501e-11, 9.18401045361994e-15, 5.75758417511114e-12,
34 -2.10752269644774e-15, 3.62884761272184e3, -1.23317754317110e6,
35 -5.03800414800672e-2, 3.30686173177055e2, -5.26259633964252e-8 ,
36 5.53075442383100e-6, -2.71042853363688e-13, -1.65732450675251e-9 ,
37 -5.82711196409204e-20, 4.42953322148281e-17 ,-2.95529679136244e-25,
38 -1.92361786708846e-23, 9.43758410350413e-23
41static const double Foxy[] = {
42 -5.581932039e2, -1.0966262185e2, -8.3456211630e-2,
43 2.6603644330e-3, 1.6875023830e-5, -2.1262477120e-7,
44 9.5741096780e-10, -1.6617640450e-12, 2.7545605710e1
47static const double Doxy[] =
48{ 4.3615175e2, 7.5897189e2, -4.2576866e2, 2.3487106e3, -3.0474660e3, 1.4850169e3 };
50static const double Goxy[] = {
51 -1.29442711174062e6, 5.98231747005341e4, -8.97850772730944e2,
52 6.55236176900400e2, -1.13131252131570e-2,
53 3.4981070244228e-6, 4.21065222886885e-9, 2.67997030050139e2
60 return Aoxy[0] * T + Aoxy[1] * sqrt(T) + Aoxy[2] + (Aoxy[3] + Aoxy[4] * rt) * rt;
62 return Aoxy[5] * T + Aoxy[6] + rt * (Aoxy[7] + Aoxy[8] * rt);
64 return Aoxy[9] * T + Aoxy[10] + Aoxy[11] * rt;
68 return rt*(Aoxy[13] + Aoxy[14]*rt);
72 return rt*(Aoxy[16] + Aoxy[17]*rt);
76 return rt2*(Aoxy[19] + Aoxy[20]*rt);
78 return rt2*(Aoxy[21] + Aoxy[22]*rt2);
80 return rt2*(Aoxy[23] + Aoxy[24]*rt);
82 return rt2*(Aoxy[25] + Aoxy[26]*rt2);
84 return rt2*(Aoxy[27] + Aoxy[28]*rt);
86 return rt2*(Aoxy[29] + Aoxy[30]*rt + Aoxy[31]*rt2);
92double oxygen::Cprime(
int i,
double rt,
double rt2,
double rt3)
96 return Aoxy[0] + 0.5*Aoxy[1]/sqrt(T) - (Aoxy[3] + 2.0*Aoxy[4]*rt)*rt2;
98 return Aoxy[5] - rt2*(Aoxy[7] + 2.0*Aoxy[8]*rt);
100 return Aoxy[9] - Aoxy[11]*rt2;
104 return -rt2*(Aoxy[13] + 2.0*Aoxy[14]*rt);
106 return -Aoxy[15]*rt2;
108 return -rt2*(Aoxy[16] + 2.0*Aoxy[17]*rt);
110 return -2.0*Aoxy[18]*rt3;
112 return -rt3*(2.0*Aoxy[19] + 3.0*Aoxy[20]*rt);
114 return -rt3*(2.0*Aoxy[21] + 4.0*Aoxy[22]*rt2);
116 return -rt3*(2.0*Aoxy[23] + 3.0*Aoxy[24]*rt);
118 return -rt3*(2.0*Aoxy[25] + 4.0*Aoxy[26]*rt2);
120 return -rt3*(2.0*Aoxy[27] + 3.0*Aoxy[28]*rt);
122 return -rt3*(2.0*Aoxy[29] + 3.0*Aoxy[30]*rt + 4.0*Aoxy[31]*rt2);
128double oxygen::W(
int n,
double egrho)
130 return (n == 0 ? (1.0 - egrho)/(2.0*Gamma) :
131 (n*W(n-1, egrho) - 0.5*pow(Rho,2*n)*egrho)/Gamma);
134double oxygen::H(
int i,
double egrho)
136 return (i < 8 ? pow(Rho,i+2) : pow(Rho,2*i-13)*egrho);
139double oxygen::I(
int i,
double egrho)
141 return (i < 8 ? pow(Rho,i+1)/
double(i+1) : W(i-8, egrho));
149 double egrho = exp(-Gamma*Rho*Rho);
152 for (
int i=0; i<14; i++) {
153 sum += (
C(i,rt,rt2) - T*Cprime(i,rt,rt2,rt3))*I(i,egrho);
155 sum += (((0.25*Goxy[6]*T + Goxy[5]/3.0)*T + 0.5*Goxy[4])*T + Goxy[3])*T + Goxy[2]*log(T)
156 - (Goxy[1] + 0.5*Goxy[0]*rt)*rt + Goxy[7]*beta/(exp(beta*rt) - 1.0) + u0;
157 return sum + m_energy_offset;
165 double egrho = exp(-Gamma*Rho*Rho);
168 sum = s0 - R*log(Rho);
169 for (
int i=0; i<14; i++) {
170 sum -= Cprime(i,rt,rt2,rt3)*I(i,egrho);
172 sum += (((Goxy[6]/3.0)*T + 0.5*Goxy[5])*T + Goxy[4])*T + Goxy[3]*log(T)
173 -((Goxy[0]*rt/3.0 + 0.5*Goxy[1])*rt + Goxy[2])*rt
174 + Goxy[7]*(beta*rt + beta*rt/(exp(beta*rt) - 1.0)
175 - log(exp(beta*rt) - 1.0));
176 return sum + m_entropy_offset;
183 double egrho = exp(-Gamma*Rho*Rho);
186 for (
int i=0; i<14; i++) {
187 P +=
C(i,rt,rt2)*H(i,egrho);
196 if ((T < Tmn) || (T > Tc)) {
198 "Temperature out of range. T = {}", T);
200 for (i=0, lnp=0; i<=7; i++) {
202 lnp+=Foxy[i]*pow(Tc-T, alpha);
204 lnp+=Foxy[i]*pow(T,i-1);
213 double xx=1-T/Tc, sum=0;
214 if ((T < Tmn) || (T > Tc)) {
216 "Temperature out of range. T = {}", T);
218 for (
int i=0; i<=5; i++) {
219 sum+=Doxy[i]*pow(xx,
double(i)/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 of a single-phase state.
double ldens() override
Liquid density. Equation D2 from Reynolds TPSI.
double C(int i, double rt, double rt2)
Equation P4 from 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 of a single-phase state.
double MolWt() override
Molecular weight [kg/kmol].
double Vcrit() override
Critical specific volume [m^3/kg].
double Pcrit() override
Critical pressure [Pa].
double Psat() override
Saturation pressure. Equation S4 from Reynolds TPSI.
Namespace for the Cantera kernel.
Contains declarations for string manipulation functions within Cantera.