40 template <
typename Scalar>
41 int test_val(
const Scalar val,
const Scalar val_exact,
const Scalar tol,
const std::string& val_name )
47 const Scalar rel_error = abs( (val - val_exact)/val_exact);
51 std::cerr <<
"Error: Mismatch in " << val_name << std::endl
52 << val_name <<
" = " << val << std::endl
53 << val_name+
"_exact = " << val_exact << std::endl
54 <<
"rel_error = " << rel_error << std::endl
55 <<
"tol = " << tol << std::endl;
62 template <
typename Scalar>
65 const Scalar Le = 1.4;
69 const Scalar rho = 3.14;
71 const Scalar
cp = 2.71;
73 const Scalar k = 42.0;
75 const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 2;
77 const Scalar
D = diff.
D( rho, cp, k );
79 const Scalar D_exact = k/(Le*rho*
cp);
81 return test_val( D, D_exact, tol, std::string(
"D") );
86 return ( tester<double>() ||
87 tester<long double>() ||
Compute species diffusivity based on constant Lewis number.
Scalar cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6)
D(const StateType &rho, const StateType &cp, const StateType &k) const ANTIOCH_AUTOFUNC(StateType
Compute species diffusivity.
int test_val(const Scalar val, const Scalar val_exact, const Scalar tol, const std::string &val_name)