OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dual_path_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: dual_path_kinetics.h
11 // - Description: Dual Path Kinetics model for hydrogen oxidation reaction
12 // - Developers: M. Secanell, M. Moore and Madhur Bhaiya
13 // - $Id: dual_path_kinetics.h 1373 2013-08-21 00:34:53Z madhur $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__DUAL_PATH_KINETICS_H
18 #define _FUELCELLSHOP__DUAL_PATH_KINETICS_H
19 
20 // Include OpenFCST routines:
21 #include "base_kinetics.h"
22 
23 // Include deal.II classes
24 #include <base/parameter_handler.h>
25 #include <base/point.h>
26 #include <base/function.h>
27 #include <lac/vector.h>
28 #include <fe/fe_values.h>
29 
30 //Include STL
31 #include<cmath>
32 #include<iostream>
33 
34 using namespace dealii;
35 
36 namespace FuelCellShop
37 {
38  namespace Kinetics
39  {
54  public BaseKinetics
55  {
56  public:
58 
59 
70  static const std::string concrete_name;
72 
74 
75 
79  virtual void set_reaction_kinetics(const std::string& name)
80  {
81  if (name == "HOR")
82  name_reaction_kinetics = name;
83 
84  else
85  {
86  const std::type_info& info = typeid(*this);
87  deallog << "Only HOR reaction is to be implemented in " << __FUNCTION__ << " called in Class " << info.name() << std::endl;
88  exit(1);
89  }
90  }
92 
94 
95 
98  virtual void current_density (std::vector<double>&);
99 
106  virtual void derivative_current (std::map< VariableNames, std::vector<double> >&);
107 
109 
111 
112 
116 
122  DualPathKinetics(const bool);
123 
127  ~DualPathKinetics();
128 
132  virtual void declare_parameters(ParameterHandler &param) const;
133 
138  virtual void set_parameters(const std::vector<std::string>&,
139  const std::vector<double>&,
140  ParameterHandler&) const{};
141 
146  virtual void initialize(ParameterHandler &param);
148 
149  protected:
151 
152 
157  virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_replica ()
158  {
159  return boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > (new FuelCellShop::Kinetics::DualPathKinetics ( ));
160  }
166 
168 
169 
173  virtual void init_kin_param()
174  {
175  Assert( !kin_param_initialized, ExcInternalError() );
176  Assert( catalyst != NULL, ExcMessage("Catalyst object not initialized in the DualPathKinetics object.") );
177  Assert( catalyst->get_reaction_name() == "HOR", ExcMessage("Catalyst object in the DualPathKinetics not set to HOR reaction name.") );
178  Assert( phi_m.is_initialized() && phi_s.is_initialized() && T.is_initialized(), ExcMessage("Either phi_m/phi_s/T is not set in the DualPathKinetics object.") );
179  Assert( reactants_map.find(hydrogen_concentration) != reactants_map.end(), ExcMessage("Hydrogen concentration is not set in the DualPathKinetics object.") );
180 
181  std::vector<VariableNames> names(1, hydrogen_concentration);
182  std::map< VariableNames, double > cref_map;
183  catalyst->reference_concentration(names, cref_map);
184  ref_conc_H2 = cref_map[hydrogen_concentration];
185 
186  kin_param_initialized = true;
187  }
188 
190  double ref_conc_H2;
191 
193  double j_0T;
194 
196  double j_0H;
197 
200 
203 
205 
206 
207  };
208 
209  } //Kinetics
210 
211 } //FuelCellShop
212 
213 #endif //_FUELCELLSHOP__DUAL_PATH_KINETICS_H