140 std::vector<std::string> species_str_list;
141 const unsigned int n_species = 5;
142 species_str_list.reserve(n_species);
143 species_str_list.push_back(
"N2" );
144 species_str_list.push_back(
"O2" );
145 species_str_list.push_back(
"N" );
146 species_str_list.push_back(
"O" );
147 species_str_list.push_back(
"NO" );
149 const Scalar Mm_N = 14.008e-3L;
150 const Scalar Mm_O = 16.000e-3L;
151 const Scalar Mm_N2 = 2.L * Mm_N;
152 const Scalar Mm_O2 = 2.L * Mm_O;
153 const Scalar Mm_NO = Mm_N + Mm_O;
162 TrioScalars T = example;
163 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
166 T[3*tuple+1] = 1500.0;
167 T[3*tuple+2] = 10000.0;
170 const Scalar R_N2 = Antioch::Constants::R_universal<Scalar>()/Mm_N2;
171 const Scalar R_O2 = Antioch::Constants::R_universal<Scalar>()/Mm_O2;
172 const Scalar R_N = Antioch::Constants::R_universal<Scalar>()/Mm_N;
173 const Scalar R_O = Antioch::Constants::R_universal<Scalar>()/Mm_O;
174 const Scalar R_NO = Antioch::Constants::R_universal<Scalar>()/Mm_NO;
180 unsigned int index = 0;
181 TrioScalars cp_N2 = example;
182 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
184 cp_N2[3*tuple ] = R_N2*
cp( Scalar(T[0]), Scalar(2.21037122e+04), Scalar(-3.81846145e+02), Scalar(6.08273815e+00),
185 Scalar(-8.53091381e-03), Scalar(1.38464610e-05), Scalar(-9.62579293e-09), Scalar(2.51970560e-12));
187 cp_N2[3*tuple+1] = R_N2*
cp( Scalar(T[1]), Scalar(5.87709908e+05), Scalar(-2.23924255e+03), Scalar(6.06694267e+00),
188 Scalar(-6.13965296e-04), Scalar(1.49179819e-07), Scalar(-1.92309442e-11), Scalar(1.06194871e-15) );
190 cp_N2[3*tuple+2] = R_N2*
cp( Scalar(T[2]), Scalar(8.30971200e+08), Scalar(-6.42048187e+05), Scalar(2.02020507e+02), Scalar(-3.06501961e-02),
191 Scalar(2.48685558e-06), Scalar(-9.70579208e-11), Scalar(1.43751673e-15));
195 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
197 int return_flag_temp = 0;
198 return_flag_temp =
test_cp( species_name, index, cp_N2, T, thermo, testname );
199 if( return_flag_temp != 0 ) return_flag = 1;
204 unsigned int index = 1;
205 TrioScalars cp_O2 = example;
206 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
208 cp_O2[3*tuple ] = R_O2*
cp( Scalar(T[0]), Scalar(-3.42556269e+04), Scalar(4.84699986e+02), Scalar(1.11901159e+00),
209 Scalar(4.29388743e-03), Scalar(-6.83627313e-07), Scalar(-2.02337478e-09) , Scalar(1.03904064e-12) );
211 cp_O2[3*tuple+1] = R_O2*
cp( Scalar(T[1]), Scalar(-1.03793994e+06), Scalar(2.34483275e+03), Scalar(1.81972949e+00), Scalar(1.26784887e-03),
212 Scalar(-2.18807142e-07), Scalar(2.05372411e-11), Scalar(-8.19349062e-16) );
214 cp_O2[3*tuple+2] = R_O2*
cp( Scalar(T[2]), Scalar(4.97515261e+08), Scalar(-2.86602339e+05), Scalar(6.69015464e+01), Scalar(-6.16971869e-03),
215 Scalar(3.01623757e-07), Scalar(-7.42087888e-12), Scalar(7.27744063e-17));
219 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
221 int return_flag_temp = 0;
222 return_flag_temp =
test_cp( species_name, index, cp_O2, T, thermo, testname );
223 if( return_flag_temp != 0 ) return_flag = 1;
228 unsigned int index = 2;
229 TrioScalars cp_N = example;
230 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
232 cp_N[3*tuple ] = R_N*
cp( Scalar(T[0]), Scalar(0.00000000e+00), Scalar(0.00000000e+00), Scalar(2.50000000e+00), Scalar(0.00000000e+00),
233 Scalar(0.00000000e+00), Scalar(0.00000000e+00), Scalar(0.00000000e+00));
235 cp_N[3*tuple+1] = R_N*
cp( Scalar(T[1]), Scalar(8.87650138e+04), Scalar(-1.07123150e+02), Scalar(2.36218829e+00), Scalar(2.91672008e-04),
236 Scalar(-1.72951510e-07), Scalar(4.01265788e-11), Scalar(-2.67722757e-15) );
238 cp_N[3*tuple+2] = R_N*
cp( Scalar(T[2]), Scalar(5.47518105e+08), Scalar(-3.10757498e+05), Scalar(6.91678274e+01), Scalar(-6.84798813e-03),
239 Scalar(3.82757240e-07), Scalar(-1.09836771e-11), Scalar(1.27798602e-16));
243 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
245 int return_flag_temp = 0;
246 return_flag_temp =
test_cp( species_name, index, cp_N, T, thermo, testname );
247 if( return_flag_temp != 0 ) return_flag = 1;
253 unsigned int index = 3;
254 TrioScalars cp_O = example;
255 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
257 cp_O[3*tuple ] = R_O*
cp( Scalar(T[0]), Scalar(-7.95361130e+03) , Scalar(1.60717779e+02), Scalar(1.96622644e+00), Scalar(1.01367031e-03),
258 Scalar(-1.11041542e-06), Scalar(6.51750750e-10), Scalar(-1.58477925e-13) );
260 cp_O[3*tuple+1] = R_O*
cp( Scalar(T[1]), Scalar(2.61902026e+05), Scalar(-7.29872203e+02), Scalar(3.31717727e+00), Scalar(-4.28133436e-04),
261 Scalar(1.03610459e-07), Scalar(-9.43830433e-12), Scalar(2.72503830e-16) );
263 cp_O[3*tuple+2] = R_O*
cp( Scalar(T[2]), Scalar(1.77900426e+08), Scalar(-1.08232826e+05), Scalar(2.81077837e+01), Scalar(-2.97523226e-03),
264 Scalar(1.85499753e-07), Scalar(-5.79623154e-12), Scalar(7.19172016e-17) );
268 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
270 int return_flag_temp = 0;
271 return_flag_temp =
test_cp( species_name, index, cp_O, T, thermo, testname );
272 if( return_flag_temp != 0 ) return_flag = 1;
278 unsigned int index = 4;
279 TrioScalars cp_NO = example;
280 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
282 cp_NO[3*tuple ] = R_NO*
cp( Scalar(T[0]), Scalar(-1.14391658e+04), Scalar(1.53646774e+02), Scalar(3.43146865e+00), Scalar(-2.66859213e-03),
283 Scalar(8.48139877e-06), Scalar(-7.68511079e-09), Scalar(2.38679758e-12) );
285 cp_NO[3*tuple+1] = R_NO*
cp( Scalar(T[1]), Scalar(2.23903708e+05), Scalar(-1.28965624e+03), Scalar(5.43394039e+00), Scalar(-3.65605546e-04),
286 Scalar(9.88101763e-08), Scalar(-1.41608327e-11), Scalar(9.38021642e-16) );
288 cp_NO[3*tuple+2] = R_NO*
cp( Scalar(T[2]), Scalar(-9.57530764e+08), Scalar(5.91243671e+05), Scalar(-1.38456733e+02), Scalar(1.69433998e-02),
289 Scalar(-1.00735146e-06), Scalar(2.91258526e-11), Scalar(-3.29511091e-16) );
293 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
295 int return_flag_temp = 0;
296 return_flag_temp =
test_cp( species_name, index, cp_NO, T, thermo, testname );
297 if( return_flag_temp != 0 ) return_flag = 1;
Scalar cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6)
static const std::string & thermo_data()
Class storing chemical mixture properties.
void read_cea_mixture_data_ascii(CEAThermoMixture< NumericType > &thermo, const std::string &filename)
int test_cp(const std::string &species_name, unsigned int species, TrioScalars cp_exact, TrioScalars T, const Antioch::CEAEvaluator< Scalar > &thermo, const std::string &testname)