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

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( )

Definition at line 28 of file power_law_catalycity.C.

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

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

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