GRINS-0.8.0
Functions
arrhenius_catalycity.C File Reference
#include "grins/arrhenius_catalycity.h"
Include dependency graph for arrhenius_catalycity.C:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( )

Definition at line 28 of file arrhenius_catalycity.C.

References GRINS::ArrheniusCatalycity::dT(), and GRINS::ArrheniusCatalycity::set_params().

29 {
30  double gamma0 = 0.01;
31 
32  double Ta = 300.0;
33 
34  GRINS::ArrheniusCatalycity gamma( gamma0, Ta );
35 
36  double T1 = 10.0;
37 
38  double tol = std::numeric_limits<double>::epsilon()*10;
39 
40  int return_flag = 0;
41 
42  {
43  double gamma_exact = gamma0*std::exp(-Ta/T1);
44  double dgamma_exact = gamma0*(Ta/(T1*T1))*std::exp(-Ta/T1);
45 
46  if( std::fabs( gamma(T1) - gamma_exact ) > tol )
47  {
48  std::cerr << "Error: mismatch in gamma" << std::endl
49  << " gamma = " << gamma(T1) << std::endl
50  << " gamma exact = " << gamma_exact << std::endl;
51 
52  return_flag = 1;
53  }
54 
55  if( std::fabs( gamma.dT(T1) - dgamma_exact ) > tol )
56  {
57  std::cerr << "Error: mismatch in dgamma_dT" << std::endl
58  << " dgamma_dT = " << gamma.dT(T1) << std::endl
59  << " dgamma_dT exact = " << dgamma_exact << std::endl;
60 
61  return_flag = 1;
62  }
63  }
64 
65  std::vector<double> params;
66  params.push_back( 1.0e-5 );
67  params.push_back( 400.0 );
68 
69  gamma.set_params( params );
70 
71  {
72  double gamma_exact = params[0]*std::exp(-params[1]/T1);
73  double dgamma_exact = params[0]*(params[1]/(T1*T1))*std::exp(-params[1]/T1);
74 
75  if( std::fabs( gamma(T1) - gamma_exact ) > tol )
76  {
77  std::cerr << "Error: mismatch in gamma" << std::endl
78  << " gamma = " << gamma(T1) << std::endl
79  << " gamma exact = " << gamma_exact << std::endl;
80 
81  return_flag = 1;
82  }
83 
84  if( std::fabs( gamma.dT(T1) - dgamma_exact ) > tol )
85  {
86  std::cerr << "Error: mismatch in dgamma_dT" << std::endl
87  << " dgamma_dT = " << gamma.dT(T1) << std::endl
88  << " dgamma_dT exact = " << dgamma_exact << std::endl;
89 
90  return_flag = 1;
91  }
92  }
93 
94  return return_flag;
95 }

Generated on Tue Dec 19 2017 12:47:29 for GRINS-0.8.0 by  doxygen 1.8.9.1