45 std::cerr <<
"Error: Must specify input file." << std::endl;
49 GetPot input( argv[1] );
51 std::vector<std::string> species(5);
52 species[0] = input(
"Physics/Chemistry/species",
"DIE!", 0 );
53 species[1] = input(
"Physics/Chemistry/species",
"DIE!", 1 );
54 species[2] = input(
"Physics/Chemistry/species",
"DIE!", 2 );
55 species[3] = input(
"Physics/Chemistry/species",
"DIE!", 3 );
56 species[4] = input(
"Physics/Chemistry/species",
"DIE!", 4 );
60 Cantera::IdealGasMix& cantera = cantera_mixture.get_chemistry();
70 std::vector<double> Y(5,0.2);
78 std::vector<double> Tqp(1,T);
79 std::vector<double> Pqp(1,P);
80 std::vector<std::vector<double> > Yqp(1,Y);
86 std::vector<double> omega_dot(5,0.0);
88 cantera_kinetics.omega_dot(cache,0,omega_dot);
90 const double cv = cantera_thermo.cv( cache, 0 );
91 const double cp = cantera_thermo.cp( cache, 0 );
93 std::vector<double> h(5,0.0);
95 cantera_thermo.h(cache,0,h);
97 cantera.setState_TPY(T,P,&Y[0]);
98 const double e = cantera.intEnergy_mass();
102 const double tol = 1.0e-15;
104 const double e_reg = 1.1354093541825727e+07;
105 if( std::fabs( (e - e_reg)/e_reg ) > tol )
107 std::cerr <<
"Error: Mismatch in internal energy." << std::endl
108 << std::setprecision(16) << std::scientific
109 <<
"e = " << e << std::endl
110 <<
"e_reg = " << e_reg << std::endl;
114 const double cv_reg = 8.8382964243437857e+02;
115 if( std::fabs( (cv - cv_reg)/cv_reg ) > tol )
117 std::cerr <<
"Error: Mismatch in cv." << std::endl
118 << std::setprecision(16) << std::scientific
119 <<
"cv = " << cv << std::endl
120 <<
"cv_reg = " << cv_reg << std::endl;
124 const double cp_reg = 1.2732313697364564e+03;
125 if( std::fabs( (cp - cp_reg)/cp_reg ) > tol )
127 std::cerr <<
"Error: Mismatch in cp." << std::endl
128 << std::setprecision(16) << std::scientific
129 <<
"cp = " << cp << std::endl
130 <<
"cp_reg = " << cp_reg << std::endl;
134 std::vector<double> od_reg(5,0.0);
142 od_reg[0] = 9.3626353539094969e+04;
143 od_reg[1] = -3.3748303628338216e+05;
144 od_reg[2] = 2.5813337444763799e+05;
145 od_reg[3] = -2.1412192748531760e+05;
146 od_reg[4] = 1.9984523578196683e+05;
148 for(
unsigned int i = 0; i < 5; i++ )
150 if( std::fabs( (omega_dot[i] - od_reg[i])/od_reg[i] ) > tol )
152 std::cerr <<
"Error: Mismatch in omega_dot." << std::endl
153 << std::setprecision(16) << std::scientific
154 <<
"i = " << i << std::endl
155 <<
"omega_dot = " << omega_dot[i] << std::endl
156 <<
"od_reg = " << od_reg[i] << std::endl;
161 std::vector<double> h_reg(5,0.0);
162 h_reg[0] = 1.3709248272267890e+06;
163 h_reg[1] = 1.2692054328083945e+06;
164 h_reg[2] = 4.3659730250572553e+06;
165 h_reg[3] = 3.5529883128718123e+07;
166 h_reg[4] = 1.7154994250083648e+07;
168 for(
unsigned int i = 0; i < 5; i++ )
170 if( std::fabs( (h[i] - h_reg[i])/h_reg[i] ) > tol )
172 std::cerr <<
"Error: Mismatch in internal energy." << std::endl
173 << std::setprecision(16) << std::scientific
174 <<
"i = " << i << std::endl
175 <<
"h = " << h[i] << std::endl
176 <<
"h_reg = " << h_reg[i] << std::endl;
void set_values(unsigned int quantity, std::vector< libMesh::Number > &values)
Wrapper class for evaluating thermo properties using Cantera.
Wrapper class for storing state for computing thermochemistry and transport properties using Cantera...
void add_quantity(unsigned int quantity)
void set_vector_values(unsigned int quantity, std::vector< std::vector< libMesh::Number > > &values)