37 const long double pi(3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825);
39 template <
typename Scalar>
40 Scalar
F(
const Scalar & x)
42 return 1.L +
std::pow(
pi,1.5)/2.L * std::sqrt(x)
43 + (
pi*
pi/4.L + 2.L) * x
47 template <
typename Scalar>
48 Scalar
Z(
const Scalar & T,
const Scalar & eps_kb,
const Scalar & z_298)
50 return z_298 *
F(eps_kb / 298.L) /
F(eps_kb / T);
54 template <
typename Scalar>
60 const Scalar tol = (std::numeric_limits<Scalar>::epsilon() * 10 < 5e-17)?5e-17:
61 std::numeric_limits<Scalar>::epsilon() * 10;
63 const Scalar eps_kb = 97.53L;
64 const Scalar z_298 = 4.0L;
68 for(Scalar T = 300.1; T <= 2500.1; T += 10.)
71 Scalar z_exact =
Z(T,eps_kb,z_298);
73 if( abs( (z - z_exact)/z_exact) > tol )
75 std::cout << std::scientific << std::setprecision(16)
76 <<
"Error: Mismatch in rotational relaxation values." << std::endl
77 <<
" T = " << T << std::endl
78 <<
" z = " << z << std::endl
79 <<
" z_exact = " << z_exact << std::endl
80 <<
" relative error = " << std::abs(z - z_exact)/z_exact << std::endl
81 <<
" tolerance = " << tol << std::endl;
92 return (tester<double>() ||
93 tester<long double>() ||
Scalar Z(const Scalar &T, const Scalar &eps_kb, const Scalar &z_298)
Scalar F(const Scalar &x)
Antioch::enable_if_c< Antioch::is_valarray< T >::value, typename Antioch::state_type< T >::type >::type pow(const T &in, const T2 &n)
const long double pi(3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825)
Scalar z(const Scalar &T, const Scalar &eps_kb, const Scalar &z_298)