GRINS-0.8.0
power_law_catalycity.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 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 // This class
27 
28 // C++
29 #include <cmath>
30 
31 namespace GRINS
32 {
33  PowerLawCatalycity::PowerLawCatalycity( const libMesh::Real gamma0,
34  const libMesh::Real Tref,
35  const libMesh::Real alpha )
36  : _gamma0(gamma0),
37  _Tref(Tref),
38  _alpha(alpha)
39  {
40  return;
41  }
42 
44  {
45  return;
46  }
47 
48  libMesh::Real PowerLawCatalycity::operator()( const libMesh::Real T ) const
49  {
50  return _gamma0*std::pow( T/_Tref, _alpha);
51  }
52 
53  libMesh::Real PowerLawCatalycity::dT( const libMesh::Real T ) const
54  {
55  return (*this)(T)*_alpha/T;
56  }
57 
58  void PowerLawCatalycity::set_params( const std::vector<libMesh::Real>& params )
59  {
60  libmesh_assert_equal_to( params.size(), 3 );
61 
62  _gamma0 = params[0];
63 
64  _Tref = params[1];
65 
66  _alpha = params[2];
67 
68  return;
69  }
70 
72  {
73  return new PowerLawCatalycity( *this );
74  }
75 
76  void PowerLawCatalycity::set_parameters(const GetPot & input, const std::string & param_base)
77  {
78  std::string gamma0_str = param_base+"gamma0";
79  this->set_parameter(_gamma0,input,gamma0_str,_gamma0);
80 
81  std::string Tref_str = param_base+"Tref";
82  this->set_parameter(_Tref,input,Tref_str,_Tref);
83 
84  std::string alpha_str = param_base+"alpha";
85  this->set_parameter(_alpha,input,alpha_str,_alpha);
86  }
87 
88 } // end namespace GRINS
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
virtual libMesh::Real dT(const libMesh::Real T) const
virtual libMesh::Real operator()(const libMesh::Real T) const
GRINS namespace.
virtual void set_parameters(const GetPot &input, const std::string &param_base)
Sets parameters for use in sensitivity analysis.
virtual CatalycityBase * clone() const
Creates a new copy of the current class.
virtual void set_params(const std::vector< libMesh::Real > &params)

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