26 #include "grins_config.h"
28 #ifdef GRINS_HAVE_ANTIOCH
41 #include "libmesh/getpot.h"
43 int test_generic(
const libMesh::Real value,
const libMesh::Real value_reg,
const std::string& name )
47 const double tol = std::numeric_limits<double>::epsilon()*10;
49 const double rel_error = std::fabs( (value - value_reg)/value_reg );
54 std::cout <<
"Mismatch in "+name << std::endl
55 << name+
" = " << value << std::endl
56 << name+
"_reg = " << value_reg << std::endl
57 <<
"rel_error = " << rel_error << std::endl;
64 template<
typename Viscosity>
65 int test_mu(
const libMesh::Real mu );
67 template<
typename Thermo,
typename Conductivity>
68 int test_k(
const libMesh::Real k );
70 template<
typename Thermo,
typename Viscosity,
typename Conductivity,
typename Diffusivity>
71 int test_D(
const std::vector<libMesh::Real>& D );
74 int test_mu<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> > >(
const libMesh::Real mu )
76 double mu_reg = 4.5123309407810213e-05;
82 int test_k<Antioch::StatMechThermodynamics<libMesh::Real>,
83 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> > >(
const libMesh::Real k )
85 double k_reg = 8.0102737519532258e-02;
91 int test_D<Antioch::StatMechThermodynamics<libMesh::Real>,
92 Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> >,
93 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
94 Antioch::ConstantLewisDiffusivity<libMesh::Real> >(
const std::vector<libMesh::Real>& D )
96 std::vector<libMesh::Real> D_reg(5);
97 D_reg[0] = 9.1105330096162743e-02;
103 int return_flag_tmp = 0;
105 for(
unsigned int s = 0; s < 5; s++ )
108 if( return_flag_tmp != 0 ) return_flag = 1;
114 template<
typename Thermo,
typename Viscosity,
typename Conductivity,
typename Diffusivity>
121 const libMesh::Real T = 1000;
123 const libMesh::Real rho = 1.0e-3;
125 const unsigned int n_species = 5;
127 std::vector<libMesh::Real> Y(n_species,0.2);
132 std::vector<double> Tqp(1,T);
136 std::vector<double> rhoqp(1,rho);
140 std::vector<std::vector<double> > Yqp(1,Y);
143 libMesh::Real mu = evaluator.
mu( cache, 0 );
145 libMesh::Real k = evaluator.
k( cache, 0 );
147 libMesh::Real mu2 = 0.0;
148 libMesh::Real k2 = 0.0;
150 evaluator.
mu_and_k( cache, 0, mu2, k2 );
152 std::vector<libMesh::Real> D(n_species,0.0);
154 evaluator.
D( cache, 0, D );
156 std::cout << std::scientific << std::setprecision(16)
157 <<
"mu = " << mu << std::endl;
159 std::cout << std::scientific << std::setprecision(16)
160 <<
"k = " << k << std::endl;
162 for(
unsigned int i = 0; i < n_species; i++ )
164 std::cout << std::scientific << std::setprecision(16)
165 <<
"D(" << mixture.
species_name(i) <<
") = " << D [i] << std::endl;
170 int return_flag_temp = 0;
172 return_flag_temp = test_mu<Viscosity>( mu );
173 if( return_flag_temp != 0 ) return_flag = 1;
175 return_flag_temp = test_k<Thermo,Conductivity>( k );
176 if( return_flag_temp != 0 ) return_flag = 1;
178 return_flag_temp = test_mu<Viscosity>( mu2 );
179 if( return_flag_temp != 0 ) return_flag = 1;
181 return_flag_temp = test_k<Thermo,Conductivity>( k2 );
182 if( return_flag_temp != 0 ) return_flag = 1;
184 return_flag_temp = test_D<Thermo,Viscosity,Conductivity,Diffusivity>( D );
185 if( return_flag_temp != 0 ) return_flag = 1;
191 int main(
int argc,
char* argv[] )
197 std::cerr <<
"Error: Must specify input file." << std::endl;
201 GetPot input( argv[1] );
205 std::cout << std::endl <<
"Running StatMesh, Blottner, Eucken, Constant Lewis regression test." << std::endl;
206 return_flag = test_evaluator<Antioch::StatMechThermodynamics<libMesh::Real>,
207 Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> >,
208 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
209 Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
214 #else //GRINS_HAVE_ANTIOCH
libMesh::Real mu(const CachedValues &cache, unsigned int qp)
void set_values(unsigned int quantity, std::vector< libMesh::Number > &values)
void D(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &D)
int main(int argc, char *argv[])
int test_mu(const libMesh::Real mu)
int test_k(const libMesh::Real k)
std::string species_name(unsigned int species_index) const
void mu_and_k(const CachedValues &cache, unsigned int qp, libMesh::Real &mu, libMesh::Real &k)
int test_generic(const libMesh::Real value, const libMesh::Real value_reg, const std::string &name)
int test_D(const std::vector< libMesh::Real > &D)
void add_quantity(unsigned int quantity)
void set_vector_values(unsigned int quantity, std::vector< std::vector< libMesh::Number > > &values)
libMesh::Real k(const CachedValues &cache, unsigned int qp)
Wrapper class for storing state for computing Wilke transport properties using Antioch.
Wrapper class for evaluating Wilke transport properties using Antioch.
int test_evaluator(const GetPot &input)