26 #include "grins_config.h"
28 #ifdef GRINS_HAVE_ANTIOCH
44 #include "libmesh/getpot.h"
46 int test_generic(
const libMesh::Real value,
const libMesh::Real value_reg,
const std::string& name )
50 const double tol = std::numeric_limits<double>::epsilon()*10;
52 const double rel_error = std::fabs( (value - value_reg)/value_reg );
57 std::cout <<
"Mismatch in "+name << std::endl
58 << name+
" = " << value << std::endl
59 << name+
"_reg = " << value_reg << std::endl
60 <<
"rel_error = " << rel_error << std::endl;
67 template<
typename Viscosity>
68 int test_mu(
const libMesh::Real mu );
70 template<
typename Thermo,
typename Conductivity>
71 int test_k(
const libMesh::Real k );
73 template<
typename Thermo,
typename Viscosity,
typename Conductivity,
typename Diffusivity>
74 int test_D(
const std::vector<libMesh::Real>& D );
77 int test_mu<Antioch::BlottnerViscosity<libMesh::Real> >(
const libMesh::Real mu )
79 double mu_reg = 4.5123309407810213e-05;
85 int test_k<Antioch::StatMechThermodynamics<libMesh::Real>,
86 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> > >(
const libMesh::Real k )
88 double k_reg = 8.0102737519532258e-02;
94 int test_D<Antioch::StatMechThermodynamics<libMesh::Real>,
95 Antioch::BlottnerViscosity<libMesh::Real>,
96 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
97 Antioch::ConstantLewisDiffusivity<libMesh::Real> >(
const std::vector<libMesh::Real>& D )
99 std::vector<libMesh::Real> D_reg(5);
100 D_reg[0] = 4.6482311273552429e-02;
106 int return_flag_tmp = 0;
108 for(
unsigned int s = 0; s < 5; s++ )
111 if( return_flag_tmp != 0 ) return_flag = 1;
117 template<
typename KineticsThermo,
typename Thermo,
typename Viscosity,
typename Conductivity,
typename Diffusivity>
122 libMesh::UniquePtr<GRINS::AntiochMixtureAveragedTransportMixture<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity> >
123 mixture_ptr = builder.
build_mixture<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity>
124 (input,
"TestMaterial");
128 mixture = *mixture_ptr;
132 const libMesh::Real T = 1000;
134 const libMesh::Real rho = 1.0e-3;
136 const unsigned int n_species = 5;
138 std::vector<libMesh::Real> Y(n_species,0.2);
140 libMesh::Real p0 = rho*T*evaluator.
R_mix(Y);
141 libMesh::Real mu = 0.0;
142 libMesh::Real k = 0.0;
143 std::vector<libMesh::Real> D(n_species,0.0);
147 std::cout << std::scientific << std::setprecision(16)
148 <<
"mu = " << mu << std::endl;
150 std::cout << std::scientific << std::setprecision(16)
151 <<
"k = " << k << std::endl;
153 for(
unsigned int i = 0; i < n_species; i++ )
155 std::cout << std::scientific << std::setprecision(16)
156 <<
"D(" << mixture.species_name(i) <<
") = " << D [i] << std::endl;
161 int return_flag_temp = 0;
163 return_flag_temp = test_mu<Viscosity>( mu );
164 if( return_flag_temp != 0 ) return_flag = 1;
166 return_flag_temp = test_k<Thermo,Conductivity>( k );
167 if( return_flag_temp != 0 ) return_flag = 1;
169 return_flag_temp = test_D<Thermo,Viscosity,Conductivity,Diffusivity>( D );
170 if( return_flag_temp != 0 ) return_flag = 1;
176 int main(
int argc,
char* argv[] )
182 std::cerr <<
"Error: Must specify input file." << std::endl;
186 GetPot input( argv[1] );
190 std::cout << std::endl <<
"Running StatMesh, Blottner, Eucken, Constant Lewis regression test." << std::endl;
191 return_flag = test_evaluator<Antioch::CEACurveFit<libMesh::Real>,
192 Antioch::StatMechThermodynamics<libMesh::Real>,
193 Antioch::BlottnerViscosity<libMesh::Real>,
194 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
195 Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
200 #else //GRINS_HAVE_ANTIOCH
int test_mu(const libMesh::Real mu)
int main(int argc, char *argv[])
Wrapper class for storing state for computing Wilke transport properties using Antioch.
Wrapper class for evaluating Wilke transport properties using Antioch.
int test_k(const libMesh::Real k)
int test_D(const std::vector< libMesh::Real > &D)
int test_generic(const libMesh::Real value, const libMesh::Real value_reg, const std::string &name)
libMesh::Real cp(const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
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)
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
int test_evaluator(const GetPot &input)
libMesh::UniquePtr< AntiochMixtureAveragedTransportMixture< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity > > build_mixture(const GetPot &input, const std::string &material)