27 #include "grins_config.h"
29 #ifdef GRINS_HAVE_ANTIOCH
37 #include "libmesh/getpot.h"
43 int main(
int argc,
char* argv[])
49 std::cerr <<
"Error: Must specify input file." << std::endl;
53 GetPot input( argv[1] );
59 libMesh::Real T0 = input(
"Conditions/T0", 300.0 );
60 libMesh::Real T1 = input(
"Conditions/T1", 300.0 );
61 libMesh::Real T_inc = input(
"Conditions/T_increment", 100.0 );
64 libMesh::Real p0 = input(
"Conditions/pressure", 1.0e5 );
66 const unsigned int n_species = antioch_mixture.
n_species();
68 std::vector<libMesh::Real> Y(n_species);
69 if( input.vector_variable_size(
"Conditions/mass_fractions" ) != n_species )
71 std::cerr <<
"Error: mass fractions size not consistent with n_species"
76 for(
unsigned int s = 0; s < n_species; s++ )
78 Y[s] = input(
"Conditions/mass_fractions", 0.0, s );
81 libMesh::Real R_mix = antioch_mixture.
R_mix(Y);
84 std::vector<libMesh::Real> omega_dot(n_species,0.0);
89 output.open(
"omega_dot.dat", std::ios::trunc );
91 output <<
"# Species names" << std::endl;
92 for(
unsigned int s = 0; s < n_species; s++ )
97 output <<
"# T [K] omega_dot [kg/m^3-s]" << std::endl;
103 Antioch::TempCache<libMesh::Real> T_cache(T);
105 libMesh::Real rho = p0/(R_mix*T);
107 antioch_kinetics.
omega_dot( T_cache, rho, Y, omega_dot );
109 output.open(
"omega_dot.dat", std::ios::app );
112 for(
unsigned int i = 0; i < n_species; i++ )
114 output << std::scientific << std::setprecision(16)
115 << omega_dot[i] <<
" ";
127 #endif //GRINS_HAVE_ANTIOCH
unsigned int n_species() const
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)
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
Mixture gas constant, [J/kg-K].
std::string species_name(unsigned int species_index) const
Wrapper class for storing state for Antioch thermo and kinetics.
int main(int argc, char *argv[])