10#include "gtest/gtest.h"
34expectCanteraValues(
const Real
T,
const std::array<Reference, 7> & references)
36 for (
const auto & ref : references)
39 EXPECT_NEAR(
NASA7::cpOverR(data,
T), ref.cp_R,
tol * std::abs(ref.cp_R)) << ref.species;
40 EXPECT_NEAR(
NASA7::hOverRT(data,
T), ref.h_RT,
tol * std::abs(ref.h_RT)) << ref.species;
41 EXPECT_NEAR(
NASA7::sOverR(data,
T), ref.s_R,
tol * std::abs(ref.s_R)) << ref.species;
46TEST(NASA7PolynomialsTest, canteraBelowMidpoint)
49 expectCanteraValues(923.15,
50 {{{
"H2", 3.613168165140949, 2.393557882983218, 19.70388492877914},
51 {
"O2", 4.147314656442323, 2.611086604285082, 28.963169712215056},
52 {
"H2O", 4.844876850286245, -28.52667487834571, 27.59941233403597},
53 {
"CH4", 8.411873653444164, -5.402055033541204, 29.171138189568893},
54 {
"CO", 3.9393320432028016, -11.904521875475112, 27.892178607608198},
55 {
"CO2", 6.410478331025108, -47.455763652874914, 31.870172746438772},
56 {
"N2", 3.883883836068483, 2.4714182404274005, 27.11985064871594}}});
59TEST(NASA7PolynomialsTest, canteraAtMidpoint)
62 expectCanteraValues(1000.0,
63 {{{
"H2", 3.6277926600000017, 2.4880181500000003, 19.99356155536211},
64 {
"O2", 4.195457489999999, 2.7310016248333326, 29.296709192476225},
65 {
"H2O", 4.9666161199999985, -25.957432841000003, 27.991587242388515},
66 {
"CH4", 8.854050229999995, -4.323604100000004, 29.861079446444933},
67 {
"CO", 3.9885755050000005, -10.6849246888, 28.209233158602412},
68 {
"CO2", 6.533298272000001, -43.31136104626667, 32.38768755547865},
69 {
"N2", 3.9403564, 2.5822312499999995, 27.43274636040696}}});
72TEST(NASA7PolynomialsTest, canteraAboveMidpoint)
74 expectCanteraValues(1500.0,
75 {{{
"H2", 3.8822959451999997, 2.9101473592241667, 21.51235276622741},
76 {
"O2", 4.3989938846625, 3.2555381173887485, 31.039298778830236},
77 {
"H2O", 5.687841430574999, -15.524086927924582, 30.14793701207187},
78 {
"CH4", 10.874274296875003, 0.43494356952083546, 33.86860929626944},
79 {
"CO", 4.234951016024999, -5.748131851494999, 29.878586100354962},
80 {
"CO2", 7.023470866475001, -26.605086887146665, 35.14116319971301},
81 {
"N2", 4.1861203930625, 3.079423123570834, 29.081165481314585}}});
84TEST(NASA7PolynomialsTest, molarMass)
87 const std::array<std::pair<std::string, Real>, 7> molecular_weights = {{{
"H2", 2.016},
97 for (
const auto & [species, molecular_weight] : molecular_weights)
101TEST(NASA7PolynomialsTest, consistentDerivatives)
109 for (
const std::string species : {
"H2",
"O2",
"H2O",
"CH4",
"CO",
"CO2",
"N2"})
110 for (
const Real T_value : {600.0, 2000.0})
118 EXPECT_NEAR(h_R.derivatives()[0], cp_R,
tol * cp_R) << species <<
" at " << T_value;
119 EXPECT_NEAR(s_R.derivatives()[0], cp_R / T_value,
tol * cp_R / T_value)
120 << species <<
" at " << T_value;
DualNumber< Real, DNDerivativeType, true > ADReal
SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< MOOSE_AD_MAX_DOFS_PER_ELEM > > DNDerivativeType
TEST(NASA7PolynomialsTest, canteraBelowMidpoint)
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
CppType hOverRT(const SpeciesData &data, const CppType &T)
Standard-state molar enthalpy divided by the gas constant and temperature, h/(RT)
const SpeciesData & speciesData(const std::string &name)
Data of a built-in species.
CppType cpOverR(const SpeciesData &data, const CppType &T)
Standard-state molar isobaric heat capacity divided by the gas constant, cp/R.
CppType sOverR(const SpeciesData &data, const CppType &T)
Standard-state molar entropy divided by the gas constant, s/R, at the reference pressure of the data ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real molar_mass
Molar mass [kg/mol].