#include <iostream>
#include <cmath>
#include <limits>
#include "antioch/constant_lewis_diffusivity.h"
Go to the source code of this file.
|
template<typename Scalar > |
int | test_val (const Scalar val, const Scalar val_exact, const Scalar tol, const std::string &val_name) |
|
template<typename Scalar > |
int | tester () |
|
int | main () |
|
template<typename Scalar >
int test_val |
( |
const Scalar |
val, |
|
|
const Scalar |
val_exact, |
|
|
const Scalar |
tol, |
|
|
const std::string & |
val_name |
|
) |
| |
Definition at line 41 of file constant_lewis_unit.C.
Referenced by tester().
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;
template<typename Scalar >
Definition at line 63 of file constant_lewis_unit.C.
References cp(), Antioch::SpeciesDiffusionBase< ConstantLewisDiffusivity< CoeffType >, CoeffType >::D(), Antioch::KineticsModel::D, and test_val().
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") );
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)
int test_val(const Scalar val, const Scalar val_exact, const Scalar tol, const std::string &val_name)