antioch-0.4.0
Functions
kinetics_theory_thermal_conductivity_unit.C File Reference
#include <iostream>
#include <cmath>
#include "antioch/stat_mech_thermo.h"
#include "antioch/kinetics_theory_thermal_conductivity.h"
#include "antioch/chemical_mixture.h"
#include "antioch/metaprogramming.h"

Go to the source code of this file.

Functions

template<typename Scalar >
int test_k (const Scalar k, const Scalar k_exact, const Scalar tol)
 
template<typename Scalar >
int tester ()
 
int main ()
 

Function Documentation

int main ( )

Definition at line 97 of file kinetics_theory_thermal_conductivity_unit.C.

98 {
99  return (tester<double>() ||
100  tester<long double>() ||
101  tester<float>());
102 }
template<typename Scalar >
int test_k ( const Scalar  k,
const Scalar  k_exact,
const Scalar  tol 
)

Definition at line 38 of file kinetics_theory_thermal_conductivity_unit.C.

Referenced by tester().

39 {
40  using std::abs;
41 
42  int return_flag = 0;
43 
44  const Scalar rel_error = abs( (k - k_exact)/k_exact);
45 
46  if( rel_error > tol )
47  {
48  std::cerr << std::setprecision(15)
49  << "Error: Mismatch in thermal conductivity" << std::endl
50  << "k = " << k << std::endl
51  << "k_exact = " << k_exact << std::endl
52  << "rel_error = " << rel_error << std::endl
53  << "tol = " << tol << std::endl;
54  return_flag = 1;
55  }
56 
57  return return_flag;
58 }
template<typename Scalar >
int tester ( )

Definition at line 61 of file kinetics_theory_thermal_conductivity_unit.C.

References test_k().

62 {
63  std::vector<std::string> species_str_list;
64  const unsigned int n_species = 1;
65  species_str_list.reserve(n_species);
66  species_str_list.push_back( "N2" );
67 
68  const Scalar LJ_depth_N2 = 97.53L;
69  const Scalar Z_298 = 4.0L;
70 
71  Antioch::ChemicalMixture<Scalar> chem_mixture( species_str_list );
72 
73  Antioch::StatMechThermodynamics<Scalar> thermo( chem_mixture );
74 
76 
77  const Scalar mu = 3.14e-3;
78  const Scalar dss = 5.23e-5;
79  const Scalar rho = 1.4;
80  const Scalar T = 1500.1L;
81 
82  // from bc
83  const Scalar k_N2_exact = 3.194342919259960202334421163642706718735099613817392359646;
84  int return_flag = 0;
85 
86  const Scalar tol = (std::numeric_limits<Scalar>::epsilon() * 2 < 7e-17)?7e-17:
87  std::numeric_limits<Scalar>::epsilon() * 2;
88 
89 
90  int return_flag_temp = 0;
91  return_flag_temp = test_k( k(0,mu,T,rho,dss), k_N2_exact, tol );
92  if( return_flag_temp != 0 ) return_flag = 1;
93 
94  return return_flag;
95 }
Conductivity based on kinetic theory of mixtures approximations.
int test_k(const Scalar k, const Scalar k_exact, const Scalar tol)
Class storing chemical mixture properties.

Generated on Thu Jul 7 2016 11:09:47 for antioch-0.4.0 by  doxygen 1.8.8