#include "grins_config.h"
#include <fstream>
#include <iomanip>
#include "grins/cantera_mixture.h"
#include "grins/cantera_kinetics.h"
#include "libmesh/getpot.h"
#include "libmesh/libmesh_common.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 43 of file cantera_kinetic_rates.C.
References GRINS::CanteraMixture::n_species(), GRINS::CanteraKinetics::omega_dot_TPY(), GRINS::CanteraMixture::R_mix(), and GRINS::CanteraMixture::species_name().
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 );
63 libMesh::Real rho = input(
"Conditions/density", 1.0e-3 );
65 const unsigned int n_species = mixture.n_species();
67 std::vector<double> Y(n_species,0.0);
68 for(
unsigned int s = 0; s < n_species; s++ )
70 Y[s] = input(
"Conditions/mass_fractions", 0.0, s );
73 libMesh::Real R_mix = mixture.R_mix(Y);
75 std::vector<double> omega_dot(n_species,0.0);
80 output.open(
"omega_dot.dat", std::ios::trunc );
82 output <<
"# Species names" << std::endl;
83 for(
unsigned int s = 0; s < n_species; s++ )
85 output << mixture.species_name( s ) <<
" ";
88 output <<
"# T [K] omega_dot [kg/m^3-s]" << std::endl;
94 libMesh::Real p = rho*R_mix*T;
96 kinetics.omega_dot_TPY( T, p, Y, omega_dot );
98 output.open(
"omega_dot.dat", std::ios::app );
101 for(
unsigned int i = 0; i < n_species; i++ )
103 output << std::scientific << std::setprecision(16)
104 << omega_dot[i] <<
" ";
Wrapper class for storing state for computing thermochemistry and transport properties using Cantera...