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 1373 2013-08-21 00:34:53Z madhur $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__BV_KINETICS_H
18 #define _FUELCELLSHOP__BV_KINETICS_H
19 
20 // Include openFCST routines:
21 #include "base_kinetics.h"
22 #include "fcst_constants.h"
23 
24 // Include deal.II classes
25 #include <base/parameter_handler.h>
26 #include <base/point.h>
27 #include <base/function.h>
28 #include <lac/vector.h>
29 #include <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 
113  virtual void set_parameters(const std::vector<std::string>&,
114  const std::vector<double>&,
115  ParameterHandler&) const{};
116 
122  virtual void initialize(ParameterHandler&){};
123 
125 
126 
129  virtual void current_density (std::vector<double> &);
130 
137  virtual void derivative_current (std::map< VariableNames, std::vector<double> > &);
139 
140  protected:
142 
143 
148  virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_replica ()
149  {
150  return boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > (new FuelCellShop::Kinetics::ButlerVolmerKinetics ( ));
151  }
157 
159 
160 
164  virtual void init_kin_param()
165  {
166  Assert( !kin_param_initialized, ExcInternalError() );
167  Assert( catalyst != NULL, ExcMessage("Catalyst object not initialized in the ButlerVolmerKinetics object.") );
168  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.") );
169  Assert( reactants_map.size()>0, ExcMessage("Atleast one reactant should be set in the ButlerVolmerKinetics object, using set_reactant_concentrations method.") );
170 
171  std::vector<VariableNames> names;
172  for ( std::map< VariableNames, SolutionVariable >::const_iterator iter=reactants_map.begin(); iter!=reactants_map.end(); ++iter )
173  names.push_back(iter->first);
174 
175  catalyst->reference_concentration(names, ref_conc);
176  catalyst->reaction_order(names, gamma);
177  catalyst->alpha_cathodic(alpha_c);
178  catalyst->alpha_anodic(alpha_a);
179 
180  kin_param_initialized = true;
181  }
182 
186  double alpha_c;
187 
191  double alpha_a;
192 
196  std::map< VariableNames, double > ref_conc;
197 
201  std::map< VariableNames, double > gamma;
203  };
204  } //Kinetics
205 } //FuelCellShop
206 
207 #endif //_FUELCELLSHOP__BV_KINETICS_H