27 #include "grins_config.h" 
   29 #ifdef GRINS_HAVE_ANTIOCH 
   40 #include "antioch/chemical_mixture.h" 
   41 #include "antioch/cea_evaluator.h" 
   42 #include "antioch/stat_mech_thermo.h" 
   43 #include "antioch/temp_cache.h" 
   44 #include "antioch/cea_mixture_ascii_parsing.h" 
   46 int main(
int argc, 
char* argv[])
 
   50       std::cerr << 
"Error: Must specify at least 1 species name!" << std::endl;
 
   54   unsigned n_species = argc-1;
 
   55   std::vector<std::string> species_list(n_species);
 
   56   for( 
unsigned int s = 0; s < n_species; s++)
 
   58       species_list[s] = std::string(argv[s+1]);
 
   61   Antioch::ChemicalMixture<double> chem_mixture( species_list );
 
   63   Antioch::CEAThermoMixture<double> cea_mixture( chem_mixture );
 
   64   Antioch::read_cea_mixture_data_ascii_default( cea_mixture );
 
   66   Antioch::CEAEvaluator<double> cea_thermo( cea_mixture );
 
   68   Antioch::StatMechThermodynamics<double> stat_mech_thermo( chem_mixture );
 
   71   double delta_T = 100.0;
 
   74   output.open( 
"thermo.dat", std::ios::trunc );
 
   75   output << 
"# Species names" << std::endl;
 
   76   for( 
unsigned int s = 0; s < n_species; s++)
 
   78       output << species_list[s] << 
" ";
 
   81   output << 
"# T [K]       CEA h_s         StatMech h_s" << std::endl;
 
   84   for( 
unsigned int i = 0; i < 56; i++ )
 
   86       double T = T0 + i*delta_T;
 
   88       output.open( 
"thermo.dat", std::ios::app );
 
   89       output << std::scientific << std::setprecision(16);
 
   92       Antioch::TempCache<double> T_cache(T);
 
   94       for( 
unsigned int s = 0; s < n_species; s++)
 
   96           output << cea_thermo.h(T_cache,s) << 
" ";
 
   99       for( 
unsigned int s = 0; s < n_species; s++)
 
  101           output << std::scientific << std::setprecision(16)
 
  102                  << stat_mech_thermo.h_tot( s, T ) - stat_mech_thermo.h_tot( s, 298.15 ) 
 
  103                     + stat_mech_thermo.e_0( s ) << 
" ";
 
  106       for( 
unsigned int s = 0; s < n_species; s++)
 
  108           output << std::scientific << std::setprecision(16)
 
  109                  << stat_mech_thermo.e_tr( s, T ) << 
" ";
 
  112       for( 
unsigned int s = 0; s < n_species; s++)
 
  114           output << std::scientific << std::setprecision(16)
 
  115                  << stat_mech_thermo.e_vib( s, T ) << 
" ";
 
  118       for( 
unsigned int s = 0; s < n_species; s++)
 
  120           output << std::scientific << std::setprecision(16)
 
  121                  << stat_mech_thermo.e_el( s, T ) << 
" ";
 
  124       for( 
unsigned int s = 0; s < n_species; s++)
 
  126           output << std::scientific << std::setprecision(16)
 
  127                  << stat_mech_thermo.e_0( s ) << 
" ";
 
  130       for( 
unsigned int s = 0; s < n_species; s++)
 
  132           output << std::scientific << std::setprecision(16)
 
  133                  << stat_mech_thermo.cv_trans( s ) << 
" ";
 
  136       for( 
unsigned int s = 0; s < n_species; s++)
 
  138           output << std::scientific << std::setprecision(16)
 
  139                  << stat_mech_thermo.cv_rot( s ) << 
" ";
 
  148 #endif // GRINS_HAVE_ANTIOCH 
int main(int argc, char *argv[])