27 #include "antioch_config.h"
41 #ifdef ANTIOCH_HAVE_GSL
43 template <
typename Scalar>
44 int test_viscosity(
const Scalar mu,
const Scalar mu_exact,
const Scalar tol )
50 const double rel_error = abs( (mu - mu_exact)/mu_exact);
54 std::cerr << std::setprecision(15) << std::scientific;
55 std::cerr <<
"Error: Mismatch in viscosity" << std::endl
56 <<
"mu(T) = " << mu << std::endl
57 <<
"mu_exact = " << mu_exact << std::endl
58 <<
"rel_error = " << rel_error << std::endl
59 <<
"tol = " << tol << std::endl;
66 template <
typename Scalar>
70 const Scalar LJ_depth(97.530L);
71 const Scalar LJ_diameter(3.621L);
72 const Scalar dipole_moment(0.L);
73 const Scalar mass(28.016e-3L/Antioch::Constants::Avogadro<Scalar>());
75 Antioch::KineticsTheoryViscosity<Scalar,Antioch::GSLSpliner> mu(LJ_depth,LJ_diameter,dipole_moment,mass);
77 const Scalar T = 1500.1;
80 const Scalar mu_exact_times_interp = 0.0000417395098853601937871105407365424874568203066945573066;
84 const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 10.;
86 return_flag =
test_viscosity( mu(T) * mu.Stockmayer(T), mu_exact_times_interp, tol );
90 #endif // ANTIOCH_HAVE_GSL
94 #ifdef ANTIOCH_HAVE_GSL
95 return tester<double>() ||
96 tester<long double>() ||
int tester(const std::string &testname)
int test_viscosity(const Scalar mu, const Scalar mu_exact, const Scalar tol)