OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tafel_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 Tafel Kinetics model class.
12 // - Developers: M. Moore, M. Bhaiya, M. Secanell and V. Zingan
13 // - $Id: tafel_kinetics.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__TAFEL_KINETICS_H
18 #define _FUELCELLSHOP__TAFEL_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  {
68  :
69  public BaseKinetics
70  {
71  public:
72 
74 
75 
78  TafelKinetics();
79 
84  TafelKinetics(const bool);
85 
89  ~TafelKinetics();
90 
95  virtual void declare_parameters(ParameterHandler& param) const;
96 
102  virtual void initialize(ParameterHandler& param);
103 
105 
107 
108 
119  static const std::string concrete_name;
121 
123 
124 
127  virtual void current_density (std::vector<double> &);
128 
135  virtual void derivative_current (std::map< VariableNames, std::vector<double> > &);
136 
138 
139  protected:
141 
142 
147  virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_replica ()
148  {
149  return boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > (new FuelCellShop::Kinetics::TafelKinetics ( ));
150  }
154  static TafelKinetics const* PROTOTYPE;
156 
158 
159 
163  virtual void init_kin_param()
164  {
165  Assert( !kin_param_initialized, ExcInternalError() );
166  Assert( catalyst != NULL, ExcMessage("Catalyst object not initialized in the TafelKinetics object.") );
167  Assert( phi_m.is_initialized() && phi_s.is_initialized() && T.is_initialized(), ExcMessage("Either phi_m/phi_s/T is not set in the TafelKinetics object.") );
168  Assert( reactants_map.size()>0, ExcMessage("Atleast one reactant should be set in the TafelKinetics object, using set_reactant_concentrations method.") );
169 
170  std::vector<VariableNames> names;
171  for ( std::map< VariableNames, SolutionVariable >::const_iterator iter=reactants_map.begin(); iter!=reactants_map.end(); ++iter )
172  names.push_back(iter->first);
173 
174  catalyst->reference_concentration(names, ref_conc);
175  catalyst->reaction_order(names, gamma);
176  catalyst->alpha_cathodic(alpha_c);
177 
178  kin_param_initialized = true;
179  }
180 
184  double alpha_c;
185 
189  std::map< VariableNames, double > ref_conc;
190 
194  std::map< VariableNames, double > gamma;
196 
197  };
198 
199  } //Kinetics
200 
201 } //FuelCellShop
202 
203 #endif //_FUELCELLSHOP__TAFEL_KINETICS_H
std::map< VariableNames, double > gamma
Map of reaction orders.
Definition: tafel_kinetics.h:194
virtual boost::shared_ptr< FuelCellShop::Kinetics::BaseKinetics > create_replica()
This member function is used to create an object of type gas diffusion layer.
Definition: tafel_kinetics.h:147
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
std::map< VariableNames, double > ref_conc
Map of reference concentrations.
Definition: tafel_kinetics.h:189
This class defines a simple Tafel kinetic model.
Definition: tafel_kinetics.h:67
virtual void init_kin_param()
Method used to initialize reference concentrations, reactions orders and cathodic transfer coefficien...
Definition: tafel_kinetics.h:163
Definition: system_management.h:79
Virtual class used to provide the interface for all kinetic/reaction children.
Definition: base_kinetics.h:107
static TafelKinetics const * PROTOTYPE
Create prototype for the layer.
Definition: tafel_kinetics.h:154
double alpha_c
Cathodic transfer coefficient.
Definition: tafel_kinetics.h:184
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: tafel_kinetics.h:119