OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
catalyst_base.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2011-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: catalyst_base.h
11 // - Description: Base catalyst material class
12 // - Developers: M. Secanell and Madhur Bhaiya
13 // - $Id: catalyst_base.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP_CATALYST_BASE__H
18 #define _FUELCELLSHOP_CATALYST_BASE__H
19 
20 // Include deal.II classes
21 #include <base/parameter_handler.h>
22 #include <base/point.h>
23 #include <base/function.h>
24 #include <lac/vector.h>
25 #include <fe/fe_values.h>
26 
27 // Include FCST classes
28 #include "base_material.h"
29 #include "fcst_constants.h"
30 
31 //Include STL
32 #include<cmath>
33 #include<iostream>
34 
35 
36 namespace FuelCellShop
37 {
38  namespace Material
39  {
69  class CatalystBase
70  :
71  public BaseMaterial
72  {
73  public:
75 
76 
81  static void declare_Catalyst_parameters (ParameterHandler &param)
82  {
83 
84  for (typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->begin();
86  iterator++)
87  {
88  iterator->second->declare_parameters(param);
89  }
90  }
91 
110  static boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_Catalyst (ParameterHandler &param,
111  std::string catalyst_name)
112  {
113  boost::shared_ptr<FuelCellShop::Material::CatalystBase > pointer;
114 
115  typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->find(catalyst_name);
116 
118  {
119  if (iterator->second)
120  {
121  pointer = iterator->second->create_replica();
122  }
123  else
124  {
125  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
126  abort();
127  }
128  }
129  else
130  {
131  FcstUtilities::log<<"Concrete name in FuelCellShop::Material::CatalystBase::create_Catalyst does not exist"<<std::endl;
132  abort();
133  }
134 
135  pointer->initialize(param);
136 
137  return pointer;
138  }
140 
142 
147  {
148  const std::type_info& info = typeid(*this);
149  FcstUtilities::log << "Pure function " << __FUNCTION__
150  << " called in Class "
151  << info.name() << std::endl;
152  };
154 
156 
160  virtual void alpha_anodic(double&) const
161  {
162  const std::type_info& info = typeid(*this);
163  FcstUtilities::log << "Pure function " << __FUNCTION__
164  << " called in Class "
165  << info.name() << std::endl;
166  };
167 
173  virtual void derivative_alpha_anodic(std::vector<double>& ) const
174  {
175  const std::type_info& info = typeid(*this);
176  FcstUtilities::log << "Pure function " << __FUNCTION__
177  << " called in Class "
178  << info.name() << std::endl;
179  };
180 
185  virtual void alpha_cathodic(double&) const
186  {
187  const std::type_info& info = typeid(*this);
188  FcstUtilities::log << "Pure function " << __FUNCTION__
189  << " called in Class "
190  << info.name() << std::endl;
191  };
192 
198  virtual void derivative_alpha_cathodic(std::vector<double>& ) const
199  {
200  const std::type_info& info = typeid(*this);
201  FcstUtilities::log << "Pure function " << __FUNCTION__
202  << " called in Class "
203  << info.name() << std::endl;
204  };
205 
211  virtual double exchange_current_density(const double&) const
212  {
213  const std::type_info& info = typeid(*this);
214  FcstUtilities::log << "Pure function " << __FUNCTION__
215  << " called in Class "
216  << info.name() << std::endl;
217  };
223  virtual double derivative_exchange_current_density(const double&) const
224  {
225  const std::type_info& info = typeid(*this);
226  FcstUtilities::log << "Pure function " << __FUNCTION__
227  << " called in Class "
228  << info.name() << std::endl;
229  };
230 
238  virtual void reference_concentration(const std::vector<VariableNames>&,
239  std::map<VariableNames, double>& ) const
240  {
241  const std::type_info& info = typeid(*this);
242  FcstUtilities::log << "Pure function " << __FUNCTION__
243  << " called in Class "
244  << info.name() << std::endl;
245  };
246 
251  virtual double voltage_cell_th(const double&) const
252  {
253  const std::type_info& info = typeid(*this);
254  FcstUtilities::log << "Pure function " << __FUNCTION__
255  << " called in Class "
256  << info.name() << std::endl;
257  };
258 
263  virtual double dvoltage_cell_th_dT(const double&) const
264  {
265  const std::type_info& info = typeid(*this);
266  FcstUtilities::log << "Pure function " << __FUNCTION__
267  << " called in Class "
268  << info.name() << std::endl;
269  };
270 
278  virtual void reaction_order(const std::vector<VariableNames>&,
279  std::map<VariableNames, double>&) const
280  {
281  const std::type_info& info = typeid(*this);
282  FcstUtilities::log << "Pure function " << __FUNCTION__
283  << " called in Class "
284  << info.name() << std::endl;
285  };
286 
291  {
292  Assert(name_reaction_kinetics != noReaction, ExcMessage("Reaction name not yet set in the CatalystBase object."));
293  return name_reaction_kinetics;
294  }
295 
299  inline std::string get_kinetic_parameter_method() const
300  {
301  Assert(method_kinetics_ORR.size() != 0, ExcMessage("Kinetic parameter method not yet set in the CatalystBase object."));
302  return method_kinetics_ORR;
303  }
304 
305 
307  inline double get_density() const
308  {
309  return density;
310  };
312 
313  protected:
315 
316 
321  CatalystBase(std::string name)
322  : FuelCellShop::Material::BaseMaterial(name)
323  {};
324 
329  : FuelCellShop::Material::BaseMaterial()
330  {};
331 
335  virtual ~CatalystBase()
336  {};
337 
342  virtual void declare_parameters(ParameterHandler &param) const
343  {
344  const std::type_info& info = typeid(*this);
345  FcstUtilities::log << "Pure function " << __FUNCTION__
346  << " called in Class "
347  << info.name() << std::endl;
348  };
349 
353  virtual void initialize (ParameterHandler &param)
354  {
355  const std::type_info& info = typeid(*this);
356  FcstUtilities::log << "Pure function " << __FUNCTION__
357  << " called in Class "
358  << info.name() << std::endl;
359  };
360 
362 
364 
367  typedef std::map< std::string, FuelCellShop::Material::CatalystBase* > _mapFactory;
369 
371 
372 
376  {
377  static _mapFactory mapFactory;
378  return &mapFactory;
379  }
381 
383 
384 
389  virtual boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_replica ()
390  {
391  const std::type_info& info = typeid(*this);
392  FcstUtilities::log << "Pure function " << __FUNCTION__
393  << " called in Class "
394  << info.name() << std::endl;
395  }
397 
399 
406  virtual bool check_reaction_implementation(const std::string) const
407  {
408  const std::type_info& info = typeid(*this);
409  FcstUtilities::log << "Pure function " << __FUNCTION__
410  << " called in Class "
411  << info.name() << std::endl;
412  };
414 
415 
417 
418 
422 
424  std::string method_kinetics_ORR;
425 
427  double density;
429  };
430 
431  }
432 }
433 
434 
435 #endif
virtual void alpha_anodic(double &) const
Return anodic transfer coefficient for the reaction specified using set_reaction_kinetics method...
Definition: catalyst_base.h:160
virtual double exchange_current_density(const double &) const
Compute the exchange current density [A/cm^2] for the reaction specified using set_reaction_kinetics ...
Definition: catalyst_base.h:211
std::map< std::string, FuelCellShop::Material::CatalystBase * > _mapFactory
This object is used to store all objects of type CatalystBase.
Definition: catalyst_base.h:367
const std::string name
Name of the layer.
Definition: base_material.h:155
virtual void alpha_cathodic(double &) const
Return cathodic transfer coefficient for the reaction specified using set_reaction_kinetics method...
Definition: catalyst_base.h:185
static void declare_Catalyst_parameters(ParameterHandler &param)
Function used to declare all the data necessary in the parameter files for all BaseKinetics children...
Definition: catalyst_base.h:81
virtual ~CatalystBase()
Destructor.
Definition: catalyst_base.h:335
static _mapFactory * get_mapFactory()
Definition: catalyst_base.h:375
std::string method_kinetics_ORR
Method for kinetics parameters (ORR), given in the parameter file.
Definition: catalyst_base.h:424
CatalystBase(std::string name)
Constructor.
Definition: catalyst_base.h:321
Definition: system_management.h:149
virtual void derivative_alpha_anodic(std::vector< double > &) const
Return derivative of anodic transfer coefficient for the reaction specified using set_reaction_kineti...
Definition: catalyst_base.h:173
This class implements the interface to compute the properties of a &quot;standard&quot; catalyst.
Definition: catalyst_base.h:69
double get_density() const
Obtain the density [gm/cm^3].
Definition: catalyst_base.h:307
CatalystBase()
Constructor.
Definition: catalyst_base.h:328
ReactionNames name_reaction_kinetics
Reaction name for which the class returns kinetic parameters.
Definition: catalyst_base.h:421
virtual void reaction_order(const std::vector< VariableNames > &, std::map< VariableNames, double > &) const
Compute the reaction order of the electrochemical reaction with respect to each species involved in t...
Definition: catalyst_base.h:278
ReactionNames get_reaction_name() const
Member function to return the name of the reaction set in the catalyst material class.
Definition: catalyst_base.h:290
virtual boost::shared_ptr< FuelCellShop::Material::CatalystBase > create_replica()
This member function is used to create an object of type CatalystBase.
Definition: catalyst_base.h:389
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: catalyst_base.h:342
virtual void initialize(ParameterHandler &param)
Initialize parameters.
Definition: catalyst_base.h:353
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
ReactionNames
Definition: system_management.h:148
virtual bool check_reaction_implementation(const std::string) const
Check that whether a particular reaction is implemented in the class or not.
Definition: catalyst_base.h:406
static boost::shared_ptr< FuelCellShop::Material::CatalystBase > create_Catalyst(ParameterHandler &param, std::string catalyst_name)
Function called in create_CatalystLayer and used to select the appropriate CatalystBase children that...
Definition: catalyst_base.h:110
double density
Density of catalyst particles [gm/cm^3].
Definition: catalyst_base.h:427
virtual double derivative_exchange_current_density(const double &) const
Compute the derivative of exchange current density [A/cm^2] w.r.t temperature [Kelvin] for the reacti...
Definition: catalyst_base.h:223
virtual double dvoltage_cell_th_dT(const double &) const
Compute the derivative of theoretical cell voltage [Volts] w.r.t temperature [Kelvin], for the reaction specified using set_reaction_kinetics method.
Definition: catalyst_base.h:263
std::string get_kinetic_parameter_method() const
Member function to return method for kinetics parameters (ORR).
Definition: catalyst_base.h:299
virtual void derivative_alpha_cathodic(std::vector< double > &) const
Return derivative of cathodic transfer coefficient for the reaction specified using set_reaction_kine...
Definition: catalyst_base.h:198
virtual void set_reaction_kinetics(const ReactionNames)
Member function used to specify the reaction for which the kinetic parameters are needed...
Definition: catalyst_base.h:146
virtual void reference_concentration(const std::vector< VariableNames > &, std::map< VariableNames, double > &) const
Compute the reference concentration for the reaction specified using set_reaction_kinetics method...
Definition: catalyst_base.h:238
virtual double voltage_cell_th(const double &) const
Compute the theroretical cell voltage [Volts] as a function of temperature, for the reaction specifie...
Definition: catalyst_base.h:251
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54