30 #include "grins_config.h"
38 #include "libmesh/getpot.h"
40 #ifdef GRINS_HAVE_CANTERA
41 int main(
int argc,
char* argv[])
47 std::cerr <<
"Error: Must specify input file." << std::endl;
51 GetPot input( argv[1] );
53 std::vector<std::string> species(5);
54 species[0] = input(
"Materials/TestMaterial/GasMixture/species",
"DIE!", 0 );
55 species[1] = input(
"Materials/TestMaterial/GasMixture/species",
"DIE!", 1 );
56 species[2] = input(
"Materials/TestMaterial/GasMixture/species",
"DIE!", 2 );
57 species[3] = input(
"Materials/TestMaterial/GasMixture/species",
"DIE!", 3 );
58 species[4] = input(
"Materials/TestMaterial/GasMixture/species",
"DIE!", 4 );
68 std::vector<double> Y(5,0.2);
70 double rho = P/T/cantera_mixture.
R_mix(Y);
78 std::vector<double> Tqp(1,T);
79 std::vector<double> Pqp(1,P);
80 std::vector<std::vector<double> > Yqp(1,Y);
87 std::vector<libMesh::Real> D(5,0.0);
95 const double tol = 6.0e-15;
97 const double mu_reg = 4.2134235819759682e-05;
98 const double k_reg = 5.7138665373733508e-02;
99 std::vector<libMesh::Real> D_reg(5,0.0);
100 D_reg[0] = 1.7611544183904180e-04;
101 D_reg[1] = 1.7169898621123060e-04;
102 D_reg[2] = 1.7379080956310527e-04;
103 D_reg[3] = 2.6991049091576078e-04;
104 D_reg[4] = 2.6488528311729070e-04;
106 if( std::fabs( (mu_reg - mu)/mu ) > tol )
108 std::cerr <<
"Error: Mismatch in viscosity." << std::endl
109 << std::setprecision(16) << std::scientific
110 <<
"mu = " << mu << std::endl
111 <<
"mu_reg = " << mu_reg << std::endl;
115 if( std::fabs( (k_reg - k)/k ) > tol )
117 std::cerr <<
"Error: Mismatch in thermal conductivity." << std::endl
118 << std::setprecision(16) << std::scientific
119 <<
"k = " << k << std::endl
120 <<
"k_reg = " << k_reg << std::endl;
124 for(
unsigned int i = 0; i < 5; i++ )
126 if( std::fabs( (D_reg[i] - D[i])/D[i] ) > tol )
128 std::cerr <<
"Error: Mismatch in diffusion coefficient." << std::endl
129 << std::setprecision(16) << std::scientific
130 <<
"i = " << i << std::endl
131 <<
"D = " << D[i] << std::endl
132 <<
"D_reg = " << D_reg[i] << std::endl;
150 #else //GRINS_HAVE_CANTERA
void set_values(unsigned int quantity, std::vector< libMesh::Number > &values)
int main(int argc, char *argv[])
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
Wrapper class for storing state for computing thermochemistry and transport properties using Cantera...
void mu_and_k_and_D(const libMesh::Real T, const libMesh::Real rho, const libMesh::Real cp, const std::vector< libMesh::Real > &Y, libMesh::Real &mu, libMesh::Real &k, std::vector< libMesh::Real > &D)
void add_quantity(unsigned int quantity)
Wrapper class for evaluating transport properties using Cantera.
void set_vector_values(unsigned int quantity, std::vector< std::vector< libMesh::Number > > &values)