37 #include "antioch_config.h"
51 template <
typename Scalar>
52 int test_values( Scalar test_value, Scalar exact_value, Scalar tol )
55 Scalar error = std::abs(test_value - exact_value);
59 std::cout << std::setprecision(16) << std::scientific;
61 std::cout <<
"ERROR: Value exceeds tolerance!" << std::endl
62 <<
"test_value = " << test_value << std::endl
63 <<
"exact_value = " << exact_value << std::endl
64 <<
"error = " << error << std::endl
65 <<
"tol = " << tol << std::endl;
73 template <
typename Scalar>
76 std::vector<std::string> species_str_list;
77 const unsigned int n_species = 2;
78 species_str_list.reserve(n_species);
79 species_str_list.push_back(
"N2" );
80 species_str_list.push_back(
"O2" );
92 #ifdef ANTIOCH_HAVE_GSL
93 Antioch::KineticsTheoryViscosity<Scalar, Antioch::GSLSpliner> k_N2(97.530, 3.621, 0.0, chem_mixture.
M(0)/Antioch::Constants::Avogadro<Scalar>());
94 Antioch::KineticsTheoryViscosity<Scalar, Antioch::GSLSpliner> k_O2(107.400, 3.458, 0.0, chem_mixture.
M(1)/Antioch::Constants::Avogadro<Scalar>() );
95 #endif // ANTIOCH_HAVE_GSL
98 s_mu_mixture(tran_mixture);
101 b_mu_mixture(tran_mixture);
103 #ifdef ANTIOCH_HAVE_GSL
105 k_mu_mixture(tran_mixture);
106 #endif // ANTIOCH_HAVE_GSL
111 #ifdef ANTIOCH_HAVE_GSL
112 Antioch::build_kinetics_theory_viscosity<Scalar>(k_mu_mixture);
113 #endif // ANTIOCH_HAVE_GSL
115 std::cout << s_mu_mixture << std::endl;
116 std::cout << b_mu_mixture << std::endl;
118 #ifdef ANTIOCH_HAVE_GSL
119 std::cout << k_mu_mixture << std::endl;
120 #endif // ANTIOCH_HAVE_GSL
122 const Scalar T = 1500.1;
124 std::cout <<
"Sutherland:" << std::endl;
125 for(
unsigned int s = 0; s < n_species; s++ )
127 std::cout <<
"mu(" << species_str_list[s] <<
") = " << s_mu_mixture(s, T) << std::endl;
130 std::cout <<
"Blottner:" << std::endl;
131 for(
unsigned int s = 0; s < n_species; s++ )
133 std::cout <<
"mu(" << species_str_list[s] <<
") = " << b_mu_mixture(s, T) << std::endl;
136 #ifdef ANTIOCH_HAVE_GSL
137 std::cout <<
"Kinetic Theory:" << std::endl;
138 for(
unsigned int s = 0; s < n_species; s++ )
140 std::cout <<
"mu(" << species_str_list[s] <<
") = " << k_mu_mixture(s, T) << std::endl;
142 #endif // ANTIOCH_HAVE_GSL
146 Scalar tol = 2.0*std::numeric_limits<Scalar>::epsilon();
147 return_flag =
test_values( s_mu_mixture(0, T), s_N2(T), tol ) ||
152 #ifdef ANTIOCH_HAVE_GSL
153 return_flag =
test_values( k_mu_mixture(0, T), k_N2(T), tol ) ||
155 #endif // ANTIOCH_HAVE_GSL
162 return (tester<double>() ||
163 tester<long double>() ||
Container class for species viscosities.
CoeffType M(const unsigned int s) const
Molecular weight (molar mass) for species s in kg/mol.
int test_values(Scalar test_value, Scalar exact_value, Scalar tol)
Class storing chemical mixture properties.
static const std::string & sutherland_data()
static const std::string & blottner_data()
Class storing chemical mixture properties.