GRINS-0.6.0
constant_catalycity_unit.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 // GRINS
27 
28 int main()
29 {
30  double gamma0 = 0.01;
31 
32  GRINS::ConstantCatalycity gamma( gamma0 );
33 
34  double T1 = 10.0;
35 
36  double tol = std::numeric_limits<double>::epsilon()*10;
37 
38  int return_flag = 0;
39 
40  if( std::fabs( gamma(T1) - gamma0 ) > tol )
41  {
42  std::cerr << "Error: mismatch in gamma" << std::endl
43  << " gamma = " << gamma(T1) << std::endl
44  << " gamma exact = " << gamma0 << std::endl;
45 
46  return_flag = 1;
47  }
48 
49  if( std::fabs( gamma.dT(T1) ) > tol )
50  {
51  std::cerr << "Error: mismatch in dgamma_dT" << std::endl
52  << " dgamma_dT = " << gamma.dT(T1) << std::endl
53  << " dgamma_dT exact = " << 0.0 << std::endl;
54 
55  return_flag = 1;
56  }
57 
58  std::vector<double> gamma1;
59  gamma1.push_back( 1.0e-5 );
60 
61  gamma.set_params( gamma1 );
62 
63  if( std::fabs( gamma(T1) - gamma1[0] ) > tol )
64  {
65  std::cerr << "Error: mismatch in gamma" << std::endl
66  << " gamma = " << gamma(T1) << std::endl
67  << " gamma exact = " << gamma0 << std::endl;
68 
69  return_flag = 1;
70  }
71 
72  if( std::fabs( gamma.dT(T1) ) > tol )
73  {
74  std::cerr << "Error: mismatch in dgamma_dT" << std::endl
75  << " dgamma_dT = " << gamma.dT(T1) << std::endl
76  << " dgamma_dT exact = " << 0.0 << std::endl;
77 
78  return_flag = 1;
79  }
80 
81  return return_flag;
82 }
int main()
virtual libMesh::Real dT(const libMesh::Real T) const
virtual void set_params(const std::vector< libMesh::Real > &params)

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1