225 std::vector<std::string> species_str_list;
226 const unsigned int n_species = 5;
227 species_str_list.reserve(n_species);
228 species_str_list.push_back(
"N2" );
229 species_str_list.push_back(
"O2" );
230 species_str_list.push_back(
"OH" );
231 species_str_list.push_back(
"O" );
232 species_str_list.push_back(
"H2" );
234 const Scalar Mm_H = 1.008e-3L;
235 const Scalar Mm_N = 14.008e-3L;
236 const Scalar Mm_O = 16.000e-3L;
237 const Scalar Mm_N2 = 2.L * Mm_N;
238 const Scalar Mm_O2 = 2.L * Mm_O;
239 const Scalar Mm_H2 = 2.L * Mm_H;
240 const Scalar Mm_OH = Mm_H + Mm_O;
255 const Scalar T1 = 190.0;
256 const Scalar T2 = 1500.0;
257 const Scalar T3 = 10000.0;
258 const Scalar T4 = 800.0;
260 const Scalar R_N2 = Antioch::Constants::R_universal<Scalar>()/Mm_N2;
261 const Scalar R_O2 = Antioch::Constants::R_universal<Scalar>()/Mm_O2;
262 const Scalar R_H2 = Antioch::Constants::R_universal<Scalar>()/Mm_H2;
263 const Scalar R_O = Antioch::Constants::R_universal<Scalar>()/Mm_O;
264 const Scalar R_OH = Antioch::Constants::R_universal<Scalar>()/Mm_OH;
267 const Scalar cea_N2_a1[10] = { 2.21037122e+04, -3.81846145e+02, 6.08273815e+00, -8.53091381e-03, 1.38464610e-05,
268 -9.62579293e-09, 2.51970560e-12, 0.00000000e+00, 7.10845911e+02, -1.07600320e+01};
269 const Scalar cea_N2_a2[10] = { 5.87709908e+05, -2.23924255e+03, 6.06694267e+00, -6.13965296e-04, 1.49179819e-07,
270 -1.92309442e-11, 1.06194871e-15, 0.00000000e+00, 1.28320618e+04, -1.58663484e+01};
271 const Scalar cea_N2_a3[10] = { 8.30971200e+08, -6.42048187e+05, 2.02020507e+02, -3.06501961e-02, 2.48685558e-06,
272 -9.70579208e-11, 1.43751673e-15, 0.00000000e+00, 4.93850663e+06, -1.67204791e+03};
273 const Scalar cea_O2_a1[10] = {-3.42556269e+04, 4.84699986e+02, 1.11901159e+00, 4.29388743e-03, -6.83627313e-07,
274 -2.02337478e-09, 1.03904064e-12, 0.00000000e+00, -3.39145434e+03, 1.84969912e+01};
275 const Scalar cea_O2_a2[10] = {-1.03793994e+06, 2.34483275e+03, 1.81972949e+00, 1.26784887e-03, -2.18807142e-07,
276 2.05372411e-11, -8.19349062e-16, 0.00000000e+00, -1.68901253e+04, 1.73871835e+01};
277 const Scalar cea_O2_a3[10] = { 4.97515261e+08, -2.86602339e+05, 6.69015464e+01, -6.16971869e-03, 3.01623757e-07,
278 -7.42087888e-12, 7.27744063e-17, 0.00000000e+00, 2.29348755e+06, -5.53044968e+02};
279 const Scalar cea_OH_a1[10] = {-1.99886366e+03, 9.30014295e+01, 3.05085385e+00, 1.52953035e-03, -3.15789256e-06,
280 3.31544734e-09, -1.13876303e-12, 0.00000000e+00, 3.24004397e+03, 4.67411290e+00};
281 const Scalar cea_OH_a2[10] = { 1.01739349e+06, -2.50995748e+03, 5.11654809e+00, 1.30529875e-04, -8.28431902e-08,
282 2.00647550e-11, -1.55699342e-15, 0.00000000e+00, 2.04452334e+04, -1.10128250e+01};
283 const Scalar cea_OH_a3[10] = { 2.84724229e+08, -1.85953704e+05, 5.00825057e+01, -5.14238586e-03, 2.87554326e-07,
284 -8.22883906e-12, 9.56725603e-17, 0.00000000e+00, 1.46864630e+06, -4.02356407e+02};
285 const Scalar cea_O_a1[10] = {-7.95361130e+03, 1.60717779e+02, 1.96622644e+00, 1.01367031e-03, -1.11041542e-06,
286 6.51750750e-10, -1.58477925e-13, 0.00000000e+00, 2.84036244e+04, 8.40424182e+00};
287 const Scalar cea_O_a2[10] = { 2.61902026e+05, -7.29872203e+02, 3.31717727e+00, -4.28133436e-04, 1.03610459e-07,
288 -9.43830433e-12, 2.72503830e-16, 0.00000000e+00, 3.39242806e+04, -6.67958535e-01};
289 const Scalar cea_O_a3[10] = { 1.77900426e+08, -1.08232826e+05, 2.81077837e+01, -2.97523226e-03, 1.85499753e-07,
290 -5.79623154e-12, 7.19172016e-17, 0.00000000e+00, 8.89094263e+05, -2.18172815e+02};
291 const Scalar cea_H2_a1[10] = { 4.07832281e+04, -8.00918545e+02, 8.21470167e+00, -1.26971436e-02, 1.75360493e-05,
292 -1.20286016e-08, 3.36809316e-12, 0.00000000e+00, 2.68248438e+03, -3.04378866e+01};
293 const Scalar cea_H2_a2[10] = { 5.60812338e+05, -8.37149134e+02, 2.97536304e+00, 1.25224993e-03, -3.74071842e-07,
294 5.93662825e-11, -3.60699573e-15, 0.00000000e+00, 5.33981585e+03, -2.20276405e+00};
295 const Scalar cea_H2_a3[10] = { 4.96671613e+08, -3.14744812e+05, 7.98388750e+01, -8.41450419e-03, 4.75306044e-07,
296 -1.37180973e-11, 1.60537460e-16, 0.00000000e+00, 2.48835466e+06, -6.69552419e+02};
298 const Scalar nasa_N2_a2[7] = { 0.02926640E+02, 0.14879768E-02, -0.05684760E-05, 0.10097038E-09, -0.06753351E-13,
299 -0.09227977E+04, 0.05980528E+02};
300 const Scalar nasa_N2_a1[7] = { 0.03298677E+02, 0.14082404E-02, -0.03963222E-04, 0.05641515E-07, -0.02444854E-10,
301 -0.10208999E+04, 0.03950372E+02};
302 const Scalar nasa_O2_a2[7] = { 3.28253784E+00, 1.48308754E-03, -7.57966669E-07, 2.09470555E-10, -2.16717794E-14,
303 -1.08845772E+03, 5.45323129E+00};
304 const Scalar nasa_O2_a1[7] = { 3.78245636E+00, -2.99673416E-03, 9.84730201E-06, -9.68129509E-09, 3.24372837E-12,
305 -1.06394356E+03, 3.65767573E+00};
306 const Scalar nasa_OH_a2[7] = { 3.09288767E+00, 5.48429716E-04, 1.26505228E-07, -8.79461556E-11, 1.17412376E-14,
307 3.85865700E+03, 4.47669610E+00};
308 const Scalar nasa_OH_a1[7] = { 3.99201543E+00, -2.40131752E-03, 4.61793841E-06, -3.88113333E-09, 1.36411470E-12,
309 3.61508056E+03, -1.03925458E-01};
310 const Scalar nasa_O_a2[7] = { 2.56942078E+00, -8.59741137E-05, 4.19484589E-08, -1.00177799E-11, 1.22833691E-15,
311 2.92175791E+04, 4.78433864E+00};
312 const Scalar nasa_O_a1[7] = { 3.16826710E+00, -3.27931884E-03, 6.64306396E-06, -6.12806624E-09, 2.11265971E-12,
313 2.91222592E+04, 2.05193346E+00};
314 const Scalar nasa_H2_a2[7] = { 3.33727920E+00, -4.94024731E-05, 4.99456778E-07, -1.79566394E-10, 2.00255376E-14,
315 -9.50158922E+02, -3.20502331E+00};
316 const Scalar nasa_H2_a1[7] = { 2.34433112E+00, 7.98052075E-03, -1.94781510E-05, 2.01572094E-08, -7.37611761E-12,
317 -9.17935173E+02, 6.83010238E-01};
324 unsigned int index = 0;
327 const Scalar cea_cp_N2_1 = R_N2*
cea_cp( T1, cea_N2_a1[0], cea_N2_a1[1], cea_N2_a1[2], cea_N2_a1[3], cea_N2_a1[4], cea_N2_a1[5], cea_N2_a1[6]);
329 const Scalar cea_cp_N2_2 = R_N2*
cea_cp( T2, cea_N2_a2[0], cea_N2_a2[1], cea_N2_a2[2], cea_N2_a2[3], cea_N2_a2[4], cea_N2_a2[5], cea_N2_a2[6]);
331 const Scalar cea_cp_N2_3 = R_N2*
cea_cp( T3, cea_N2_a3[0], cea_N2_a3[1], cea_N2_a3[2], cea_N2_a3[3], cea_N2_a3[4], cea_N2_a3[5], cea_N2_a3[6]);
334 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
336 int return_flag_temp = 0;
338 return_flag_temp =
test_cp( species_name, index, cea_cp_N2_1, T1, thermo );
339 if( return_flag_temp != 0 ) return_flag = 1;
341 return_flag_temp =
test_cp( species_name, index, cea_cp_N2_2, T2, thermo );
342 if( return_flag_temp != 0 ) return_flag = 1;
344 return_flag_temp =
test_cp( species_name, index, cea_cp_N2_3, T3, thermo );
345 if( return_flag_temp != 0 ) return_flag = 1;
350 const Scalar nasa_cp_N2_1 = R_N2 *
nasa_cp(T4, nasa_N2_a1[0], nasa_N2_a1[1], nasa_N2_a1[2], nasa_N2_a1[3], nasa_N2_a1[4]);
352 const Scalar nasa_cp_N2_2 = R_N2 *
nasa_cp(T2, nasa_N2_a2[0], nasa_N2_a2[1], nasa_N2_a2[2], nasa_N2_a2[3], nasa_N2_a2[4]);
354 return_flag_temp =
test_cp( species_name, index, nasa_cp_N2_1, T4, nasa_thermo );
355 if( return_flag_temp != 0 ) return_flag = 1;
357 return_flag_temp =
test_cp( species_name, index, nasa_cp_N2_2, T2, nasa_thermo );
358 if( return_flag_temp != 0 ) return_flag = 1;
364 unsigned int index = 1;
365 const Scalar cp_1 = R_O2*
cea_cp( T1, cea_O2_a1[0], cea_O2_a1[1], cea_O2_a1[2], cea_O2_a1[3], cea_O2_a1[4], cea_O2_a1[5], cea_O2_a1[6]);
367 const Scalar cp_2 = R_O2*
cea_cp( T2, cea_O2_a2[0], cea_O2_a2[1], cea_O2_a2[2], cea_O2_a2[3], cea_O2_a2[4], cea_O2_a2[5], cea_O2_a2[6]);
369 const Scalar cp_3 = R_O2*
cea_cp( T3, cea_O2_a3[0], cea_O2_a3[1], cea_O2_a3[2], cea_O2_a3[3], cea_O2_a3[4], cea_O2_a3[5], cea_O2_a3[6]);
372 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
374 int return_flag_temp = 0;
375 return_flag_temp =
test_cp( species_name, index, cp_1, T1, thermo );
376 if( return_flag_temp != 0 ) return_flag = 1;
378 return_flag_temp =
test_cp( species_name, index, cp_2, T2, thermo );
379 if( return_flag_temp != 0 ) return_flag = 1;
381 return_flag_temp =
test_cp( species_name, index, cp_3, T3, thermo );
382 if( return_flag_temp != 0 ) return_flag = 1;
385 const Scalar nasa_cp_O2_1 = R_O2 *
nasa_cp(T4, nasa_O2_a1[0], nasa_O2_a1[1], nasa_O2_a1[2], nasa_O2_a1[3], nasa_O2_a1[4]);
387 const Scalar nasa_cp_O2_2 = R_O2 *
nasa_cp(T2, nasa_O2_a2[0], nasa_O2_a2[1], nasa_O2_a2[2], nasa_O2_a2[3], nasa_O2_a2[4]);
389 return_flag_temp =
test_cp( species_name, index, nasa_cp_O2_1, T4, nasa_thermo );
390 if( return_flag_temp != 0 ) return_flag = 1;
392 return_flag_temp =
test_cp( species_name, index, nasa_cp_O2_2, T2, nasa_thermo );
393 if( return_flag_temp != 0 ) return_flag = 1;
398 unsigned int index = 2;
399 const Scalar cp_1 = R_OH*
cea_cp( T1, cea_OH_a1[0], cea_OH_a1[1], cea_OH_a1[2], cea_OH_a1[3], cea_OH_a1[4], cea_OH_a1[5], cea_OH_a1[6]);
401 const Scalar cp_2 = R_OH*
cea_cp( T2, cea_OH_a2[0], cea_OH_a2[1], cea_OH_a2[2], cea_OH_a2[3], cea_OH_a2[4], cea_OH_a2[5], cea_OH_a2[6]);
403 const Scalar cp_3 = R_OH*
cea_cp( T3, cea_OH_a3[0], cea_OH_a3[1], cea_OH_a3[2], cea_OH_a3[3], cea_OH_a3[4], cea_OH_a3[5], cea_OH_a3[6]);
406 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
408 int return_flag_temp = 0;
409 return_flag_temp =
test_cp( species_name, index, cp_1, T1, thermo );
410 if( return_flag_temp != 0 ) return_flag = 1;
412 return_flag_temp =
test_cp( species_name, index, cp_2, T2, thermo );
413 if( return_flag_temp != 0 ) return_flag = 1;
415 return_flag_temp =
test_cp( species_name, index, cp_3, T3, thermo );
416 if( return_flag_temp != 0 ) return_flag = 1;
419 const Scalar nasa_cp_OH_1 = R_OH *
nasa_cp(T4, nasa_OH_a1[0], nasa_OH_a1[1], nasa_OH_a1[2], nasa_OH_a1[3], nasa_OH_a1[4]);
421 const Scalar nasa_cp_OH_2 = R_OH *
nasa_cp(T2, nasa_OH_a2[0], nasa_OH_a2[1], nasa_OH_a2[2], nasa_OH_a2[3], nasa_OH_a2[4]);
423 return_flag_temp =
test_cp( species_name, index, nasa_cp_OH_1, T4, nasa_thermo );
424 if( return_flag_temp != 0 ) return_flag = 1;
426 return_flag_temp =
test_cp( species_name, index, nasa_cp_OH_2, T2, nasa_thermo );
432 unsigned int index = 3;
433 const Scalar cp_1 = R_O*
cea_cp( T1, cea_O_a1[0], cea_O_a1[1], cea_O_a1[2], cea_O_a1[3], cea_O_a1[4], cea_O_a1[5], cea_O_a1[6]);
435 const Scalar cp_2 = R_O*
cea_cp( T2, cea_O_a2[0], cea_O_a2[1], cea_O_a2[2], cea_O_a2[3], cea_O_a2[4], cea_O_a2[5], cea_O_a2[6]);
437 const Scalar cp_3 = R_O*
cea_cp( T3, cea_O_a3[0], cea_O_a3[1], cea_O_a3[2], cea_O_a3[3], cea_O_a3[4], cea_O_a3[5], cea_O_a3[6]);
440 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
442 int return_flag_temp = 0;
443 return_flag_temp =
test_cp( species_name, index, cp_1, T1, thermo );
444 if( return_flag_temp != 0 ) return_flag = 1;
446 return_flag_temp =
test_cp( species_name, index, cp_2, T2, thermo );
447 if( return_flag_temp != 0 ) return_flag = 1;
449 return_flag_temp =
test_cp( species_name, index, cp_3, T3, thermo );
450 if( return_flag_temp != 0 ) return_flag = 1;
453 const Scalar nasa_cp_O_1 = R_O *
nasa_cp(T4, nasa_O_a1[0], nasa_O_a1[1], nasa_O_a1[2], nasa_O_a1[3], nasa_O_a1[4]);
455 const Scalar nasa_cp_O_2 = R_O *
nasa_cp(T2, nasa_O_a2[0], nasa_O_a2[1], nasa_O_a2[2], nasa_O_a2[3], nasa_O_a2[4]);
457 return_flag_temp =
test_cp( species_name, index, nasa_cp_O_1, T4, nasa_thermo );
458 if( return_flag_temp != 0 ) return_flag = 1;
460 return_flag_temp =
test_cp( species_name, index, nasa_cp_O_2, T2, nasa_thermo );
466 unsigned int index = 4;
467 const Scalar cp_1 = R_H2*
cea_cp( T1, cea_H2_a1[0], cea_H2_a1[1], cea_H2_a1[2], cea_H2_a1[3], cea_H2_a1[4], cea_H2_a1[5], cea_H2_a1[6]);
469 const Scalar cp_2 = R_H2*
cea_cp( T2, cea_H2_a2[0], cea_H2_a2[1], cea_H2_a2[2], cea_H2_a2[3], cea_H2_a2[4], cea_H2_a2[5], cea_H2_a2[6]);
471 const Scalar cp_3 = R_H2*
cea_cp( T3, cea_H2_a3[0], cea_H2_a3[1], cea_H2_a3[2], cea_H2_a3[3], cea_H2_a3[4], cea_H2_a3[5], cea_H2_a3[6]);
474 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
476 int return_flag_temp = 0;
477 return_flag_temp =
test_cp( species_name, index, cp_1, T1, thermo );
478 if( return_flag_temp != 0 ) return_flag = 1;
480 return_flag_temp =
test_cp( species_name, index, cp_2, T2, thermo );
481 if( return_flag_temp != 0 ) return_flag = 1;
483 return_flag_temp =
test_cp( species_name, index, cp_3, T3, thermo );
484 if( return_flag_temp != 0 ) return_flag = 1;
488 const Scalar nasa_cp_H2_1 = R_H2 *
nasa_cp(T4, nasa_H2_a1[0], nasa_H2_a1[1], nasa_H2_a1[2], nasa_H2_a1[3], nasa_H2_a1[4]);
490 const Scalar nasa_cp_H2_2 = R_H2 *
nasa_cp(T2, nasa_H2_a2[0], nasa_H2_a2[1], nasa_H2_a2[2], nasa_H2_a2[3], nasa_H2_a2[4]);
492 return_flag_temp =
test_cp( species_name, index, nasa_cp_H2_1, T4, nasa_thermo );
493 if( return_flag_temp != 0 ) return_flag = 1;
495 return_flag_temp =
test_cp( species_name, index, nasa_cp_H2_2, T2, nasa_thermo );
496 if( return_flag_temp != 0 ) return_flag = 1;
504 unsigned int index = 0;
505 const Scalar h_N2_1 = R_N2 * T1 *
cea_h( T1, cea_N2_a1[0], cea_N2_a1[1], cea_N2_a1[2], cea_N2_a1[3], cea_N2_a1[4], cea_N2_a1[5], cea_N2_a1[6],cea_N2_a1[8]);
506 const Scalar s_N2_1 =
cea_s( T1, cea_N2_a1[0], cea_N2_a1[1], cea_N2_a1[2], cea_N2_a1[3], cea_N2_a1[4], cea_N2_a1[5], cea_N2_a1[6],cea_N2_a1[9]);
507 const Scalar g_N2_1 = h_N2_1/(R_N2 * T1) - s_N2_1;
509 const Scalar h_N2_2 = R_N2 * T2 *
cea_h( T2, cea_N2_a2[0], cea_N2_a2[1], cea_N2_a2[2], cea_N2_a2[3], cea_N2_a2[4], cea_N2_a2[5], cea_N2_a2[6],cea_N2_a2[8]);
510 const Scalar s_N2_2 =
cea_s( T2, cea_N2_a2[0], cea_N2_a2[1], cea_N2_a2[2], cea_N2_a2[3], cea_N2_a2[4], cea_N2_a2[5], cea_N2_a2[6],cea_N2_a2[9]);
511 const Scalar g_N2_2 = h_N2_2/(R_N2 * T2) - s_N2_2;
513 const Scalar h_N2_3 = R_N2 * T3 *
cea_h( T3, cea_N2_a3[0], cea_N2_a3[1], cea_N2_a3[2], cea_N2_a3[3], cea_N2_a3[4], cea_N2_a3[5], cea_N2_a3[6],cea_N2_a3[8]);
514 const Scalar s_N2_3 =
cea_s( T3, cea_N2_a3[0], cea_N2_a3[1], cea_N2_a3[2], cea_N2_a3[3], cea_N2_a3[4], cea_N2_a3[5], cea_N2_a3[6],cea_N2_a3[9]);
515 const Scalar g_N2_3 = h_N2_3 /(R_N2 * T3) - s_N2_3;
519 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
521 int return_flag_temp = 0;
522 return_flag_temp =
test_h( species_name, index, h_N2_1, T1, thermo );
523 if( return_flag_temp != 0 ) return_flag = 1;
525 return_flag_temp =
test_h( species_name, index, h_N2_2, T2, thermo );
526 if( return_flag_temp != 0 ) return_flag = 1;
528 return_flag_temp =
test_h( species_name, index, h_N2_3, T3, thermo );
529 if( return_flag_temp != 0 ) return_flag = 1;
531 return_flag_temp =
test_s( species_name, index, s_N2_1, T1, thermo );
532 if( return_flag_temp != 0 ) return_flag = 1;
534 return_flag_temp =
test_s( species_name, index, s_N2_2, T2, thermo );
535 if( return_flag_temp != 0 ) return_flag = 1;
537 return_flag_temp =
test_s( species_name, index, s_N2_3, T3, thermo );
538 if( return_flag_temp != 0 ) return_flag = 1;
540 return_flag_temp =
test_g( species_name, index, g_N2_1, T1, thermo );
541 if( return_flag_temp != 0 ) return_flag = 1;
543 return_flag_temp =
test_g( species_name, index, g_N2_2, T2, thermo );
544 if( return_flag_temp != 0 ) return_flag = 1;
546 return_flag_temp =
test_g( species_name, index, g_N2_3, T3, thermo );
547 if( return_flag_temp != 0 ) return_flag = 1;
550 const Scalar nasa_h_N2_1 = R_N2 * T4 *
nasa_h(T4, nasa_N2_a1[0], nasa_N2_a1[1], nasa_N2_a1[2], nasa_N2_a1[3], nasa_N2_a1[4], nasa_N2_a1[5]);
551 const Scalar nasa_s_N2_1 =
nasa_s(T4, nasa_N2_a1[0], nasa_N2_a1[1], nasa_N2_a1[2], nasa_N2_a1[3], nasa_N2_a1[4], nasa_N2_a1[6]);
552 const Scalar nasa_g_N2_1 = nasa_h_N2_1/(R_N2 * T4) - nasa_s_N2_1;
554 const Scalar nasa_h_N2_2 = R_N2 * T2 *
nasa_h(T2, nasa_N2_a2[0], nasa_N2_a2[1], nasa_N2_a2[2], nasa_N2_a2[3], nasa_N2_a2[4], nasa_N2_a2[5]);
555 const Scalar nasa_s_N2_2 =
nasa_s(T2, nasa_N2_a2[0], nasa_N2_a2[1], nasa_N2_a2[2], nasa_N2_a2[3], nasa_N2_a2[4], nasa_N2_a2[6]);
556 const Scalar nasa_g_N2_2 = nasa_h_N2_2/(R_N2 * T2) - nasa_s_N2_2;
558 return_flag_temp =
test_h( species_name, index, nasa_h_N2_1, T4, nasa_thermo );
559 if( return_flag_temp != 0 ) return_flag = 1;
561 return_flag_temp =
test_h( species_name, index, nasa_h_N2_2, T2, nasa_thermo );
562 if( return_flag_temp != 0 ) return_flag = 1;
564 return_flag_temp =
test_s( species_name, index, nasa_s_N2_1, T4, nasa_thermo );
565 if( return_flag_temp != 0 ) return_flag = 1;
567 return_flag_temp =
test_s( species_name, index, nasa_s_N2_2, T2, nasa_thermo );
568 if( return_flag_temp != 0 ) return_flag = 1;
570 return_flag_temp =
test_g( species_name, index, nasa_g_N2_1, T4, nasa_thermo );
571 if( return_flag_temp != 0 ) return_flag = 1;
573 return_flag_temp =
test_g( species_name, index, nasa_g_N2_2, T2, nasa_thermo );
574 if( return_flag_temp != 0 ) return_flag = 1;
580 unsigned int index = 1;
581 const Scalar h_1 = R_O2*T1*
cea_h( T1, cea_O2_a1[0], cea_O2_a1[1], cea_O2_a1[2], cea_O2_a1[3], cea_O2_a1[4], cea_O2_a1[5], cea_O2_a1[6],cea_O2_a1[8]);
582 const Scalar s_1 =
cea_s( T1, cea_O2_a1[0], cea_O2_a1[1], cea_O2_a1[2], cea_O2_a1[3], cea_O2_a1[4], cea_O2_a1[5], cea_O2_a1[6],cea_O2_a1[9]);
583 const Scalar g_1 = h_1/(R_O2*T1) - s_1;
585 const Scalar h_2 = R_O2*T2*
cea_h( T2, cea_O2_a2[0], cea_O2_a2[1], cea_O2_a2[2], cea_O2_a2[3], cea_O2_a2[4], cea_O2_a2[5], cea_O2_a2[6],cea_O2_a2[8]);
586 const Scalar s_2 =
cea_s( T2, cea_O2_a2[0], cea_O2_a2[1], cea_O2_a2[2], cea_O2_a2[3], cea_O2_a2[4], cea_O2_a2[5], cea_O2_a2[6],cea_O2_a2[9]);
587 const Scalar g_2 = h_2/(R_O2*T2) - s_2;
589 const Scalar h_3 = R_O2*T3*
cea_h( T3, cea_O2_a3[0], cea_O2_a3[1], cea_O2_a3[2], cea_O2_a3[3], cea_O2_a3[4], cea_O2_a3[5], cea_O2_a3[6],cea_O2_a3[8]);
590 const Scalar s_3 =
cea_s( T3, cea_O2_a3[0], cea_O2_a3[1], cea_O2_a3[2], cea_O2_a3[3], cea_O2_a3[4], cea_O2_a3[5], cea_O2_a3[6],cea_O2_a3[9]);
591 const Scalar g_3 = h_3/(R_O2*T3) - s_3;
594 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
596 int return_flag_temp = 0;
597 return_flag_temp =
test_h( species_name, index, h_1, T1, thermo );
598 if( return_flag_temp != 0 ) return_flag = 1;
600 return_flag_temp =
test_h( species_name, index, h_2, T2, thermo );
601 if( return_flag_temp != 0 ) return_flag = 1;
603 return_flag_temp =
test_h( species_name, index, h_3, T3, thermo );
604 if( return_flag_temp != 0 ) return_flag = 1;
606 return_flag_temp =
test_s( species_name, index, s_1, T1, thermo );
607 if( return_flag_temp != 0 ) return_flag = 1;
609 return_flag_temp =
test_s( species_name, index, s_2, T2, thermo );
610 if( return_flag_temp != 0 ) return_flag = 1;
612 return_flag_temp =
test_s( species_name, index, s_3, T3, thermo );
613 if( return_flag_temp != 0 ) return_flag = 1;
615 return_flag_temp =
test_g( species_name, index, g_1, T1, thermo );
616 if( return_flag_temp != 0 ) return_flag = 1;
618 return_flag_temp =
test_g( species_name, index, g_2, T2, thermo );
619 if( return_flag_temp != 0 ) return_flag = 1;
621 return_flag_temp =
test_g( species_name, index, g_3, T3, thermo );
622 if( return_flag_temp != 0 ) return_flag = 1;
625 const Scalar nasa_h_O2_1 = R_O2 * T4 *
nasa_h(T4, nasa_O2_a1[0], nasa_O2_a1[1], nasa_O2_a1[2], nasa_O2_a1[3], nasa_O2_a1[4], nasa_O2_a1[5]);
626 const Scalar nasa_s_O2_1 =
nasa_s(T4, nasa_O2_a1[0], nasa_O2_a1[1], nasa_O2_a1[2], nasa_O2_a1[3], nasa_O2_a1[4], nasa_O2_a1[6]);
627 const Scalar nasa_g_O2_1 = nasa_h_O2_1/(R_O2*T4) - nasa_s_O2_1;
629 const Scalar nasa_h_O2_2 = R_O2 * T2 *
nasa_h(T2, nasa_O2_a2[0], nasa_O2_a2[1], nasa_O2_a2[2], nasa_O2_a2[3], nasa_O2_a2[4], nasa_O2_a2[5]);
630 const Scalar nasa_s_O2_2 =
nasa_s(T2, nasa_O2_a2[0], nasa_O2_a2[1], nasa_O2_a2[2], nasa_O2_a2[3], nasa_O2_a2[4], nasa_O2_a2[6]);
631 const Scalar nasa_g_O2_2 = nasa_h_O2_2/(R_O2*T2) - nasa_s_O2_2;
633 return_flag_temp =
test_h( species_name, index, nasa_h_O2_1, T4, nasa_thermo );
634 if( return_flag_temp != 0 ) return_flag = 1;
636 return_flag_temp =
test_h( species_name, index, nasa_h_O2_2, T2, nasa_thermo );
637 if( return_flag_temp != 0 ) return_flag = 1;
639 return_flag_temp =
test_s( species_name, index, nasa_s_O2_1, T4, nasa_thermo );
640 if( return_flag_temp != 0 ) return_flag = 1;
642 return_flag_temp =
test_s( species_name, index, nasa_s_O2_2, T2, nasa_thermo );
643 if( return_flag_temp != 0 ) return_flag = 1;
645 return_flag_temp =
test_g( species_name, index, nasa_g_O2_1, T4, nasa_thermo );
646 if( return_flag_temp != 0 ) return_flag = 1;
648 return_flag_temp =
test_g( species_name, index, nasa_g_O2_2, T2, nasa_thermo );
649 if( return_flag_temp != 0 ) return_flag = 1;
655 unsigned int index = 2;
656 const Scalar h_1 = R_OH*T1*
cea_h( T1, cea_OH_a1[0], cea_OH_a1[1], cea_OH_a1[2], cea_OH_a1[3], cea_OH_a1[4], cea_OH_a1[5], cea_OH_a1[6],cea_OH_a1[8]);
657 const Scalar s_1 =
cea_s( T1, cea_OH_a1[0], cea_OH_a1[1], cea_OH_a1[2], cea_OH_a1[3], cea_OH_a1[4], cea_OH_a1[5], cea_OH_a1[6],cea_OH_a1[9]);
658 const Scalar g_1 = h_1/(R_OH*T1) - s_1;
660 const Scalar h_2 = R_OH*T2*
cea_h( T2, cea_OH_a2[0], cea_OH_a2[1], cea_OH_a2[2], cea_OH_a2[3], cea_OH_a2[4], cea_OH_a2[5], cea_OH_a2[6],cea_OH_a2[8]);
661 const Scalar s_2 =
cea_s( T2, cea_OH_a2[0], cea_OH_a2[1], cea_OH_a2[2], cea_OH_a2[3], cea_OH_a2[4], cea_OH_a2[5], cea_OH_a2[6],cea_OH_a2[9]);
662 const Scalar g_2 = h_2/(R_OH*T2) - s_2;
664 const Scalar h_3 = R_OH*T3*
cea_h( T3, cea_OH_a3[0], cea_OH_a3[1], cea_OH_a3[2], cea_OH_a3[3], cea_OH_a3[4], cea_OH_a3[5], cea_OH_a3[6],cea_OH_a3[8]);
665 const Scalar s_3 =
cea_s( T3, cea_OH_a3[0], cea_OH_a3[1], cea_OH_a3[2], cea_OH_a3[3], cea_OH_a3[4], cea_OH_a3[5], cea_OH_a3[6],cea_OH_a3[9]);
666 const Scalar g_3 = h_3/(R_OH*T3) - s_3;
669 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
671 int return_flag_temp = 0;
672 return_flag_temp =
test_h( species_name, index, h_1, T1, thermo );
673 if( return_flag_temp != 0 ) return_flag = 1;
675 return_flag_temp =
test_h( species_name, index, h_2, T2, thermo );
676 if( return_flag_temp != 0 ) return_flag = 1;
678 return_flag_temp =
test_h( species_name, index, h_3, T3, thermo );
679 if( return_flag_temp != 0 ) return_flag = 1;
681 return_flag_temp =
test_s( species_name, index, s_1, T1, thermo );
682 if( return_flag_temp != 0 ) return_flag = 1;
684 return_flag_temp =
test_s( species_name, index, s_2, T2, thermo );
685 if( return_flag_temp != 0 ) return_flag = 1;
687 return_flag_temp =
test_s( species_name, index, s_3, T3, thermo );
688 if( return_flag_temp != 0 ) return_flag = 1;
690 return_flag_temp =
test_g( species_name, index, g_1, T1, thermo );
691 if( return_flag_temp != 0 ) return_flag = 1;
693 return_flag_temp =
test_g( species_name, index, g_2, T2, thermo );
694 if( return_flag_temp != 0 ) return_flag = 1;
696 return_flag_temp =
test_g( species_name, index, g_3, T3, thermo );
697 if( return_flag_temp != 0 ) return_flag = 1;
700 const Scalar nasa_h_OH_1 = R_OH * T4 *
nasa_h(T4, nasa_OH_a1[0], nasa_OH_a1[1], nasa_OH_a1[2], nasa_OH_a1[3], nasa_OH_a1[4], nasa_OH_a1[5]);
701 const Scalar nasa_s_OH_1 =
nasa_s(T4, nasa_OH_a1[0], nasa_OH_a1[1], nasa_OH_a1[2], nasa_OH_a1[3], nasa_OH_a1[4], nasa_OH_a1[6]);
702 const Scalar nasa_g_OH_1 = nasa_h_OH_1/(R_OH*T4) - nasa_s_OH_1;
704 const Scalar nasa_h_OH_2 = R_OH * T2 *
nasa_h(T2, nasa_OH_a2[0], nasa_OH_a2[1], nasa_OH_a2[2], nasa_OH_a2[3], nasa_OH_a2[4], nasa_OH_a2[5]);
705 const Scalar nasa_s_OH_2 =
nasa_s(T2, nasa_OH_a2[0], nasa_OH_a2[1], nasa_OH_a2[2], nasa_OH_a2[3], nasa_OH_a2[4], nasa_OH_a2[6]);
706 const Scalar nasa_g_OH_2 = nasa_h_OH_2/(R_OH*T2) - nasa_s_OH_2;
708 return_flag_temp =
test_h( species_name, index, nasa_h_OH_1, T4, nasa_thermo );
709 if( return_flag_temp != 0 ) return_flag = 1;
711 return_flag_temp =
test_h( species_name, index, nasa_h_OH_2, T2, nasa_thermo );
712 if( return_flag_temp != 0 ) return_flag = 1;
714 return_flag_temp =
test_s( species_name, index, nasa_s_OH_1, T4, nasa_thermo );
715 if( return_flag_temp != 0 ) return_flag = 1;
717 return_flag_temp =
test_s( species_name, index, nasa_s_OH_2, T2, nasa_thermo );
718 if( return_flag_temp != 0 ) return_flag = 1;
720 return_flag_temp =
test_g( species_name, index, nasa_g_OH_1, T4, nasa_thermo );
721 if( return_flag_temp != 0 ) return_flag = 1;
723 return_flag_temp =
test_g( species_name, index, nasa_g_OH_2, T2, nasa_thermo );
724 if( return_flag_temp != 0 ) return_flag = 1;
729 unsigned int index = 3;
730 const Scalar h_1 = R_O*T1*
cea_h( T1, cea_O_a1[0], cea_O_a1[1], cea_O_a1[2], cea_O_a1[3], cea_O_a1[4], cea_O_a1[5], cea_O_a1[6],cea_O_a1[8]);
731 const Scalar s_1 =
cea_s( T1, cea_O_a1[0], cea_O_a1[1], cea_O_a1[2], cea_O_a1[3], cea_O_a1[4], cea_O_a1[5], cea_O_a1[6],cea_O_a1[9]);
732 const Scalar g_1 = h_1/(R_O*T1) - s_1;
734 const Scalar h_2 = R_O*T2*
cea_h( T2, cea_O_a2[0], cea_O_a2[1], cea_O_a2[2], cea_O_a2[3], cea_O_a2[4], cea_O_a2[5], cea_O_a2[6],cea_O_a2[8]);
735 const Scalar s_2 =
cea_s( T2, cea_O_a2[0], cea_O_a2[1], cea_O_a2[2], cea_O_a2[3], cea_O_a2[4], cea_O_a2[5], cea_O_a2[6],cea_O_a2[9]);
736 const Scalar g_2 = h_2/(R_O*T2) - s_2;
738 const Scalar h_3 = R_O*T3*
cea_h( T3, cea_O_a3[0], cea_O_a3[1], cea_O_a3[2], cea_O_a3[3], cea_O_a3[4], cea_O_a3[5], cea_O_a3[6],cea_O_a3[8]);
739 const Scalar s_3 =
cea_s( T3, cea_O_a3[0], cea_O_a3[1], cea_O_a3[2], cea_O_a3[3], cea_O_a3[4], cea_O_a3[5], cea_O_a3[6],cea_O_a3[9]);
740 const Scalar g_3 = h_3/(R_O*T3) - s_3;
743 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
745 int return_flag_temp = 0;
746 return_flag_temp =
test_h( species_name, index, h_1, T1, thermo );
747 if( return_flag_temp != 0 ) return_flag = 1;
749 return_flag_temp =
test_h( species_name, index, h_2, T2, thermo );
750 if( return_flag_temp != 0 ) return_flag = 1;
752 return_flag_temp =
test_h( species_name, index, h_3, T3, thermo );
753 if( return_flag_temp != 0 ) return_flag = 1;
755 return_flag_temp =
test_s( species_name, index, s_1, T1, thermo );
756 if( return_flag_temp != 0 ) return_flag = 1;
758 return_flag_temp =
test_s( species_name, index, s_2, T2, thermo );
759 if( return_flag_temp != 0 ) return_flag = 1;
761 return_flag_temp =
test_s( species_name, index, s_3, T3, thermo );
762 if( return_flag_temp != 0 ) return_flag = 1;
764 return_flag_temp =
test_g( species_name, index, g_1, T1, thermo );
765 if( return_flag_temp != 0 ) return_flag = 1;
767 return_flag_temp =
test_g( species_name, index, g_2, T2, thermo );
768 if( return_flag_temp != 0 ) return_flag = 1;
770 return_flag_temp =
test_g( species_name, index, g_3, T3, thermo );
771 if( return_flag_temp != 0 ) return_flag = 1;
774 const Scalar nasa_h_O_1 = R_O * T4 *
nasa_h(T4, nasa_O_a1[0], nasa_O_a1[1], nasa_O_a1[2], nasa_O_a1[3], nasa_O_a1[4], nasa_O_a1[5]);
775 const Scalar nasa_s_O_1 =
nasa_s(T4, nasa_O_a1[0], nasa_O_a1[1], nasa_O_a1[2], nasa_O_a1[3], nasa_O_a1[4], nasa_O_a1[6]);
776 const Scalar nasa_g_O_1 = nasa_h_O_1/(R_O*T4) - nasa_s_O_1;
778 const Scalar nasa_h_O_2 = R_O * T2 *
nasa_h(T2, nasa_O_a2[0], nasa_O_a2[1], nasa_O_a2[2], nasa_O_a2[3], nasa_O_a2[4], nasa_O_a2[5]);
779 const Scalar nasa_s_O_2 =
nasa_s(T2, nasa_O_a2[0], nasa_O_a2[1], nasa_O_a2[2], nasa_O_a2[3], nasa_O_a2[4], nasa_O_a2[6]);
780 const Scalar nasa_g_O_2 = nasa_h_O_2/(R_O*T2) - nasa_s_O_2;
782 return_flag_temp =
test_h( species_name, index, nasa_h_O_1, T4, nasa_thermo );
783 if( return_flag_temp != 0 ) return_flag = 1;
785 return_flag_temp =
test_h( species_name, index, nasa_h_O_2, T2, nasa_thermo );
786 if( return_flag_temp != 0 ) return_flag = 1;
788 return_flag_temp =
test_s( species_name, index, nasa_s_O_1, T4, nasa_thermo );
789 if( return_flag_temp != 0 ) return_flag = 1;
791 return_flag_temp =
test_s( species_name, index, nasa_s_O_2, T2, nasa_thermo );
792 if( return_flag_temp != 0 ) return_flag = 1;
794 return_flag_temp =
test_g( species_name, index, nasa_g_O_1, T4, nasa_thermo );
795 if( return_flag_temp != 0 ) return_flag = 1;
797 return_flag_temp =
test_g( species_name, index, nasa_g_O_2, T2, nasa_thermo );
798 if( return_flag_temp != 0 ) return_flag = 1;
803 unsigned int index = 4;
804 const Scalar h_1 = R_H2*T1*
cea_h( T1, cea_H2_a1[0], cea_H2_a1[1], cea_H2_a1[2], cea_H2_a1[3], cea_H2_a1[4], cea_H2_a1[5], cea_H2_a1[6],cea_H2_a1[8]);
805 const Scalar s_1 =
cea_s( T1, cea_H2_a1[0], cea_H2_a1[1], cea_H2_a1[2], cea_H2_a1[3], cea_H2_a1[4], cea_H2_a1[5], cea_H2_a1[6],cea_H2_a1[9]);
806 const Scalar g_1 = h_1/(R_H2*T1) - s_1;
808 const Scalar h_2 = R_H2*T2*
cea_h( T2, cea_H2_a2[0], cea_H2_a2[1], cea_H2_a2[2], cea_H2_a2[3], cea_H2_a2[4], cea_H2_a2[5], cea_H2_a2[6],cea_H2_a2[8]);
809 const Scalar s_2 =
cea_s( T2, cea_H2_a2[0], cea_H2_a2[1], cea_H2_a2[2], cea_H2_a2[3], cea_H2_a2[4], cea_H2_a2[5], cea_H2_a2[6],cea_H2_a2[9]);
810 const Scalar g_2 = h_2/(R_H2*T2) - s_2;
812 const Scalar h_3 = R_H2*T3*
cea_h( T3, cea_H2_a3[0], cea_H2_a3[1], cea_H2_a3[2], cea_H2_a3[3], cea_H2_a3[4], cea_H2_a3[5], cea_H2_a3[6],cea_H2_a3[8]);
813 const Scalar s_3 =
cea_s( T3, cea_H2_a3[0], cea_H2_a3[1], cea_H2_a3[2], cea_H2_a3[3], cea_H2_a3[4], cea_H2_a3[5], cea_H2_a3[6],cea_H2_a3[9]);
814 const Scalar g_3 = h_3/(R_H2*T3) - s_3;
817 const std::string species_name = chem_mixture.species_inverse_name_map().find(species)->second;
819 int return_flag_temp = 0;
820 return_flag_temp =
test_h( species_name, index, h_1, T1, thermo );
821 if( return_flag_temp != 0 ) return_flag = 1;
823 return_flag_temp =
test_h( species_name, index, h_2, T2, thermo );
824 if( return_flag_temp != 0 ) return_flag = 1;
826 return_flag_temp =
test_h( species_name, index, h_3, T3, thermo );
827 if( return_flag_temp != 0 ) return_flag = 1;
829 return_flag_temp =
test_s( species_name, index, s_1, T1, thermo );
830 if( return_flag_temp != 0 ) return_flag = 1;
832 return_flag_temp =
test_s( species_name, index, s_2, T2, thermo );
833 if( return_flag_temp != 0 ) return_flag = 1;
835 return_flag_temp =
test_s( species_name, index, s_3, T3, thermo );
836 if( return_flag_temp != 0 ) return_flag = 1;
838 return_flag_temp =
test_g( species_name, index, g_1, T1, thermo );
839 if( return_flag_temp != 0 ) return_flag = 1;
841 return_flag_temp =
test_g( species_name, index, g_2, T2, thermo );
842 if( return_flag_temp != 0 ) return_flag = 1;
844 return_flag_temp =
test_g( species_name, index, g_3, T3, thermo );
845 if( return_flag_temp != 0 ) return_flag = 1;
850 const Scalar nasa_h_H2_1 = R_H2 * T4 *
nasa_h(T4, nasa_H2_a1[0], nasa_H2_a1[1], nasa_H2_a1[2], nasa_H2_a1[3], nasa_H2_a1[4], nasa_H2_a1[5]);
851 const Scalar nasa_s_H2_1 =
nasa_s(T4, nasa_H2_a1[0], nasa_H2_a1[1], nasa_H2_a1[2], nasa_H2_a1[3], nasa_H2_a1[4], nasa_H2_a1[6]);
852 const Scalar nasa_g_H2_1 = nasa_h_H2_1/(R_H2 * T4) - nasa_s_H2_1;
854 const Scalar nasa_h_H2_2 = R_H2 * T2 *
nasa_h(T2, nasa_H2_a2[0], nasa_H2_a2[1], nasa_H2_a2[2], nasa_H2_a2[3], nasa_H2_a2[4], nasa_H2_a2[5]);
855 const Scalar nasa_s_H2_2 =
nasa_s(T2, nasa_H2_a2[0], nasa_H2_a2[1], nasa_H2_a2[2], nasa_H2_a2[3], nasa_H2_a2[4], nasa_H2_a2[6]);
856 const Scalar nasa_g_H2_2 = nasa_h_H2_2/(R_H2 * T2) - nasa_s_H2_2;
858 return_flag_temp =
test_h( species_name, index, nasa_h_H2_1, T4, nasa_thermo );
859 if( return_flag_temp != 0 ) return_flag = 1;
861 return_flag_temp =
test_h( species_name, index, nasa_h_H2_2, T2, nasa_thermo );
862 if( return_flag_temp != 0 ) return_flag = 1;
864 return_flag_temp =
test_s( species_name, index, nasa_s_H2_1, T4, nasa_thermo );
865 if( return_flag_temp != 0 ) return_flag = 1;
867 return_flag_temp =
test_s( species_name, index, nasa_s_H2_2, T2, nasa_thermo );
868 if( return_flag_temp != 0 ) return_flag = 1;
870 return_flag_temp =
test_g( species_name, index, nasa_g_H2_1, T4, nasa_thermo );
871 if( return_flag_temp != 0 ) return_flag = 1;
873 return_flag_temp =
test_g( species_name, index, nasa_g_H2_2, T2, nasa_thermo );
874 if( return_flag_temp != 0 ) return_flag = 1;
int test_s(const std::string &species_name, unsigned int species, Scalar s_exact, Scalar T, const Antioch::NASAEvaluator< Scalar, NASAFit > &thermo)
Scalar cea_s(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6, Scalar a9)
Scalar nasa_s(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a6)
void read_nasa_mixture_data(NASAThermoMixture< NumericType, CurveType > &thermo, const std::string &filename=DefaultSourceFilename::thermo_data(), ParsingType=ASCII, bool verbose=true)
Scalar nasa_h(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5)
static const std::string & thermo_data()
Scalar cea_cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6)
int test_cp(const std::string &species_name, unsigned int species, Scalar cp_exact, Scalar T, const Antioch::NASAEvaluator< Scalar, NASAFit > &thermo)
Scalar nasa_cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4)
Class storing chemical mixture properties.
int test_g(const std::string &species_name, unsigned int species, Scalar g_exact, Scalar T, const Antioch::NASAEvaluator< Scalar, NASAFit > &thermo)
Scalar cea_h(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6, Scalar a8)
int test_h(const std::string &species_name, unsigned int species, Scalar h_exact, Scalar T, const Antioch::NASAEvaluator< Scalar, NASAFit > &thermo)