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 <deal.II/base/parameter_handler.h>
22 #include <deal.II/base/point.h>
23 #include <deal.II/base/function.h>
24 #include <deal.II/lac/vector.h>
25 #include <deal.II/fe/fe_values.h>
26 
27 // Include FCST classes
29 #include <utils/fcst_constants.h>
30 
31 
32 namespace FuelCellShop
33 {
34  namespace Material
35  {
65  class CatalystBase
66  :
67  public BaseMaterial
68  {
69  public:
71 
72 
77  static void declare_Catalyst_parameters (ParameterHandler &param)
78  {
79 
80  for (typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->begin();
82  iterator++)
83  {
84  iterator->second->declare_parameters(param);
85  }
86  }
87 
106  static boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_Catalyst (ParameterHandler &param,
107  std::string catalyst_name)
108  {
109  boost::shared_ptr<FuelCellShop::Material::CatalystBase > pointer;
110 
111  typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->find(catalyst_name);
112 
114  {
115  if (iterator->second)
116  {
117  pointer = iterator->second->create_replica();
118  }
119  else
120  {
121  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
122  abort();
123  }
124  }
125  else
126  {
127  FcstUtilities::log<<"Concrete name in FuelCellShop::Material::CatalystBase::create_Catalyst does not exist"<<std::endl;
128  abort();
129  }
130 
131  pointer->initialize(param);
132 
133  return pointer;
134  }
136 
138 
143  {
144  const std::type_info& info = typeid(*this);
145  FcstUtilities::log << "Pure function " << __FUNCTION__
146  << " called in Class "
147  << info.name() << std::endl;
148  };
150 
152 
156  virtual void alpha_anodic(double&) const
157  {
158  const std::type_info& info = typeid(*this);
159  FcstUtilities::log << "Pure function " << __FUNCTION__
160  << " called in Class "
161  << info.name() << std::endl;
162  };
163 
169  virtual void derivative_alpha_anodic(std::vector<double>& ) const
170  {
171  const std::type_info& info = typeid(*this);
172  FcstUtilities::log << "Pure function " << __FUNCTION__
173  << " called in Class "
174  << info.name() << std::endl;
175  };
176 
181  virtual void alpha_cathodic(double&) const
182  {
183  const std::type_info& info = typeid(*this);
184  FcstUtilities::log << "Pure function " << __FUNCTION__
185  << " called in Class "
186  << info.name() << std::endl;
187  };
188 
194  virtual void derivative_alpha_cathodic(std::vector<double>& ) const
195  {
196  const std::type_info& info = typeid(*this);
197  FcstUtilities::log << "Pure function " << __FUNCTION__
198  << " called in Class "
199  << info.name() << std::endl;
200  };
201 
207  virtual double exchange_current_density(const double&) const
208  {
209  const std::type_info& info = typeid(*this);
210  FcstUtilities::log << "Pure function " << __FUNCTION__
211  << " called in Class "
212  << info.name() << std::endl;
213  };
219  virtual double derivative_exchange_current_density(const double&) const
220  {
221  const std::type_info& info = typeid(*this);
222  FcstUtilities::log << "Pure function " << __FUNCTION__
223  << " called in Class "
224  << info.name() << std::endl;
225  };
226 
234  virtual void reference_concentration(const std::vector<VariableNames>&,
235  std::map<VariableNames, double>& ) const
236  {
237  const std::type_info& info = typeid(*this);
238  FcstUtilities::log << "Pure function " << __FUNCTION__
239  << " called in Class "
240  << info.name() << std::endl;
241  };
242 
247  virtual double voltage_cell_th(const double&) const
248  {
249  const std::type_info& info = typeid(*this);
250  FcstUtilities::log << "Pure function " << __FUNCTION__
251  << " called in Class "
252  << info.name() << std::endl;
253  };
254 
259  virtual double dvoltage_cell_th_dT(const double&) const
260  {
261  const std::type_info& info = typeid(*this);
262  FcstUtilities::log << "Pure function " << __FUNCTION__
263  << " called in Class "
264  << info.name() << std::endl;
265  };
266 
274  virtual void reaction_order(const std::vector<VariableNames>&,
275  std::map<VariableNames, double>&) const
276  {
277  const std::type_info& info = typeid(*this);
278  FcstUtilities::log << "Pure function " << __FUNCTION__
279  << " called in Class "
280  << info.name() << std::endl;
281  };
282 
287  {
288  Assert(name_reaction_kinetics != noReaction, ExcMessage("Reaction name not yet set in the CatalystBase object."));
289  return name_reaction_kinetics;
290  }
291 
295  inline std::string get_kinetic_parameter_method() const
296  {
297  Assert(method_kinetics_ORR.size() != 0, ExcMessage("Kinetic parameter method not yet set in the CatalystBase object."));
298  return method_kinetics_ORR;
299  }
300 
301 
303  inline double get_density() const
304  {
305  return density;
306  };
308 
309  protected:
311 
312 
317  CatalystBase(std::string name)
318  : FuelCellShop::Material::BaseMaterial(name)
319  {};
320 
325  : FuelCellShop::Material::BaseMaterial()
326  {};
327 
331  virtual ~CatalystBase()
332  {};
333 
338  virtual void declare_parameters(ParameterHandler &param) const
339  {
340  const std::type_info& info = typeid(*this);
341  FcstUtilities::log << "Pure function " << __FUNCTION__
342  << " called in Class "
343  << info.name() << std::endl;
344  };
345 
349  virtual void initialize (ParameterHandler &param)
350  {
351  const std::type_info& info = typeid(*this);
352  FcstUtilities::log << "Pure function " << __FUNCTION__
353  << " called in Class "
354  << info.name() << std::endl;
355  };
356 
358 
360 
363  typedef std::map< std::string, FuelCellShop::Material::CatalystBase* > _mapFactory;
365 
367 
368 
372  {
373  static _mapFactory mapFactory;
374  return &mapFactory;
375  }
377 
379 
380 
385  virtual boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_replica ()
386  {
387  const std::type_info& info = typeid(*this);
388  FcstUtilities::log << "Pure function " << __FUNCTION__
389  << " called in Class "
390  << info.name() << std::endl;
391  }
393 
395 
402  virtual bool check_reaction_implementation(const std::string) const
403  {
404  const std::type_info& info = typeid(*this);
405  FcstUtilities::log << "Pure function " << __FUNCTION__
406  << " called in Class "
407  << info.name() << std::endl;
408  };
410 
411 
413 
414 
418 
420  std::string method_kinetics_ORR;
421 
423  double density;
425  };
426 
427  }
428 }
429 
430 
431 #endif
virtual void alpha_anodic(double &) const
Return anodic transfer coefficient for the reaction specified using set_reaction_kinetics method...
Definition: catalyst_base.h:156
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:207
std::map< std::string, FuelCellShop::Material::CatalystBase * > _mapFactory
This object is used to store all objects of type CatalystBase.
Definition: catalyst_base.h:363
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:181
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:77
virtual ~CatalystBase()
Destructor.
Definition: catalyst_base.h:331
static _mapFactory * get_mapFactory()
Definition: catalyst_base.h:371
std::string method_kinetics_ORR
Method for kinetics parameters (ORR), given in the parameter file.
Definition: catalyst_base.h:420
CatalystBase(std::string name)
Constructor.
Definition: catalyst_base.h:317
Definition: system_management.h:178
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:169
This class implements the interface to compute the properties of a &quot;standard&quot; catalyst.
Definition: catalyst_base.h:65
double get_density() const
Obtain the density [gm/cm^3].
Definition: catalyst_base.h:303
CatalystBase()
Constructor.
Definition: catalyst_base.h:324
ReactionNames name_reaction_kinetics
Reaction name for which the class returns kinetic parameters.
Definition: catalyst_base.h:417
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:274
ReactionNames get_reaction_name() const
Member function to return the name of the reaction set in the catalyst material class.
Definition: catalyst_base.h:286
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:385
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: catalyst_base.h:338
virtual void initialize(ParameterHandler &param)
Initialize parameters.
Definition: catalyst_base.h:349
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
ReactionNames
Definition: system_management.h:177
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:402
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:106
double density
Density of catalyst particles [gm/cm^3].
Definition: catalyst_base.h:423
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:219
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:259
std::string get_kinetic_parameter_method() const
Member function to return method for kinetics parameters (ORR).
Definition: catalyst_base.h:295
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:194
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:142
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:234
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:247
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54