26 #include "grins_config.h"
38 #include "libmesh/getpot.h"
40 int main(
int argc,
char* argv[] )
42 #ifdef GRINS_HAVE_ANTIOCH
47 std::cerr <<
"Error: Must specify input file." << std::endl;
51 GetPot input( argv[1] );
57 libMesh::Real T = 1000;
59 Antioch::TempCache<libMesh::Real> T_cache(T);
61 libMesh::Real rho = 1.0e-3;
63 const unsigned int n_species = 5;
65 std::vector<libMesh::Real> Y(n_species,0.2);
67 std::vector<libMesh::Real> omega_dot(n_species,0.0);
69 antioch_kinetics.
omega_dot( T_cache, rho, Y, omega_dot );
71 for(
unsigned int i = 0; i < n_species; i++ )
73 std::cout << std::scientific << std::setprecision(16)
74 <<
"omega_dot(" << i <<
") = " << omega_dot[i] << std::endl;
78 double tol = std::numeric_limits<double>::epsilon()*40;
81 libMesh::Real sum = 0.0;
82 for(
unsigned int s = 0; s < n_species; s++ )
87 if( std::fabs(sum) > tol )
89 std::cout <<
"Error: Sum of mass sources not equal to zero!" << std::endl
90 <<
"sum = " << sum << std::endl;
95 std::vector<libMesh::Real> omega_dot_reg(n_species,0.0);
96 omega_dot_reg[0] = 4.3561014567820650e-01;
97 omega_dot_reg[1] = -3.6797207156306633e+00;
98 omega_dot_reg[2] = 2.9970582875850726e+00;
99 omega_dot_reg[3] = -1.8346634812051223e+00;
100 omega_dot_reg[4] = 2.0817157635725065e+00;
102 for(
unsigned int s = 0; s < n_species; s++ )
104 if( std::fabs( (omega_dot[s] - omega_dot_reg[s])/omega_dot_reg[s] ) > tol )
106 std::cerr <<
"Error: Mismatch in omega_dot." << std::endl
107 << std::setprecision(16) << std::scientific
108 <<
"s = " << s << std::endl
109 <<
"omega_dot = " << omega_dot[s] << std::endl
110 <<
"omega_dot_reg = " << omega_dot_reg[s] << std::endl;
115 #else //GRINS_HAVE_ANTIOCH
117 int return_flag = 77;
Wrapper class for evaluating chemical kinetics using Antioch.
void omega_dot(const Antioch::TempCache< libMesh::Real > &temp_cache, const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &omega_dot)
Wrapper class for storing state for Antioch thermo and kinetics.
int main(int argc, char *argv[])