OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bv_kinetics.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-13 by Energy Systems Design Laboratory, University of Alberta
6 //
7 // This software is distributed under the MIT License.
8 // For more information, see the README file in /doc/LICENSE
9 //
10 // - Class: tafel_kinetics.h
11 // - Description: Header file for Butler-Volmer Kinetics model class.
12 // - Developers: M. Secanell, M. Moore and M. Bhaiya
13 // - $Id: bv_kinetics.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__BV_KINETICS_H
18 #define _FUELCELLSHOP__BV_KINETICS_H
19 
20 // Include openFCST routines:
22 #include <utils/fcst_constants.h>
23 
24 // Include deal.II classes
25 #include <deal.II/base/parameter_handler.h>
26 #include <deal.II/base/point.h>
27 #include <deal.II/base/function.h>
28 #include <deal.II/lac/vector.h>
29 #include <deal.II/fe/fe_values.h>
30 
31 //Include STL
32 #include <cmath>
33 #include <iostream>
34 
35 using namespace dealii;
36 
37 namespace FuelCellShop
38 {
39  namespace Kinetics
40  {
67  :
68  public BaseKinetics
69  {
70  public:
72 
73 
84  static const std::string concrete_name;
86 
91 
96  ButlerVolmerKinetics(const bool);
97 
102 
107  virtual void declare_parameters(ParameterHandler&) const{};
108 
114  virtual void initialize(ParameterHandler&){};
115 
117 
118 
121  virtual void current_density (std::vector<double> &);
122 
129  virtual void derivative_current (std::map< VariableNames, std::vector<double> > &);
131 
132  protected:
134 
135 
140  virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_replica ()
141  {
142  return boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > (new FuelCellShop::Kinetics::ButlerVolmerKinetics ( ));
143  }
149 
151 
152 
156  virtual void init_kin_param()
157  {
158  Assert( !kin_param_initialized, ExcInternalError() );
159  Assert( catalyst != NULL, ExcMessage("Catalyst object not initialized in the ButlerVolmerKinetics object.") );
160  Assert( phi_m.is_initialized() && phi_s.is_initialized() && T.is_initialized(), ExcMessage("Either phi_m/phi_s/T is not set in the ButlerVolmerKinetics object.") );
161  Assert( reactants_map.size()>0, ExcMessage("Atleast one reactant should be set in the ButlerVolmerKinetics object, using set_reactant_concentrations method.") );
162 
163  std::vector<VariableNames> names;
164  for ( std::map< VariableNames, SolutionVariable >::const_iterator iter=reactants_map.begin(); iter!=reactants_map.end(); ++iter )
165  names.push_back(iter->first);
166 
167  catalyst->reference_concentration(names, ref_conc);
168  catalyst->reaction_order(names, gamma);
169  catalyst->alpha_cathodic(alpha_c);
170  catalyst->alpha_anodic(alpha_a);
171 
172  kin_param_initialized = true;
173  }
174 
178  double alpha_c;
179 
183  double alpha_a;
184 
188  std::map< VariableNames, double > ref_conc;
189 
193  std::map< VariableNames, double > gamma;
195  };
196  } //Kinetics
197 } //FuelCellShop
198 
199 #endif //_FUELCELLSHOP__BV_KINETICS_H
virtual void declare_parameters(ParameterHandler &) const
Declare parameters for a parameter file.
Definition: bv_kinetics.h:107
virtual void initialize(ParameterHandler &)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Definition: bv_kinetics.h:114
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: bv_kinetics.h:84
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
std::map< VariableNames, double > ref_conc
Map of reference concentrations.
Definition: bv_kinetics.h:188
static ButlerVolmerKinetics const * PROTOTYPE
Create prototype for the layer.
Definition: bv_kinetics.h:147
virtual boost::shared_ptr< FuelCellShop::Kinetics::BaseKinetics > create_replica()
This member function is used to create an object of type gas diffusion layer.
Definition: bv_kinetics.h:140
Definition: system_management.h:80
Virtual class used to provide the interface for all kinetic/reaction children.
Definition: base_kinetics.h:102
double alpha_a
Anodic transfer coefficient.
Definition: bv_kinetics.h:183
virtual void init_kin_param()
Method used to initialize reference concentrations, reactions orders and cathodic/anodic transfer coe...
Definition: bv_kinetics.h:156
This class implements a Butler-Volmer kinetic model.
Definition: bv_kinetics.h:66
double alpha_c
Cathodic transfer coefficient.
Definition: bv_kinetics.h:178
std::map< VariableNames, double > gamma
Map of reaction orders.
Definition: bv_kinetics.h:193