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 1373 2013-08-21 00:34:53Z madhur $
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  }
94  static void set_Catalyst_parameters (const std::vector<std::string>& name_dvar,
95  const std::vector<double>& value_dvar,
96  ParameterHandler &param)
97  {
98  for (typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->begin();
100  iterator++)
101  {
102  iterator->second->set_parameters(name_dvar,value_dvar, param);
103  }
104  }
123  static boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_Catalyst (ParameterHandler &param,
124  std::string catalyst_name)
125  {
126  boost::shared_ptr<FuelCellShop::Material::CatalystBase > pointer;
127 
128  typename FuelCellShop::Material::CatalystBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystBase::get_mapFactory()->find(catalyst_name);
129 
131  {
132  if (iterator->second)
133  {
134  pointer = iterator->second->create_replica();
135  }
136  else
137  {
138  deallog<<"Pointer not initialized"<<std::endl;
139  abort();
140  }
141  }
142  else
143  {
144  deallog<<"Concrete name in FuelCellShop::Material::CatalystBase::create_Catalyst does not exist"<<std::endl;
145  abort();
146  }
147 
148  pointer->initialize(param);
149 
150  return pointer;
151  }
153 
154 
155 
159  virtual void set_reaction_kinetics(const std::string )
160  {
161  const std::type_info& info = typeid(*this);
162  deallog << "Pure function " << __FUNCTION__
163  << " called in Class "
164  << info.name() << std::endl;
165  };
167 
168 
169 
173  virtual void alpha_anodic(double&) const
174  {
175  const std::type_info& info = typeid(*this);
176  deallog << "Pure function " << __FUNCTION__
177  << " called in Class "
178  << info.name() << std::endl;
179  };
180 
186  virtual void derivative_alpha_anodic(std::vector<double>& ) const
187  {
188  const std::type_info& info = typeid(*this);
189  deallog << "Pure function " << __FUNCTION__
190  << " called in Class "
191  << info.name() << std::endl;
192  };
193 
198  virtual void alpha_cathodic(double&) const
199  {
200  const std::type_info& info = typeid(*this);
201  deallog << "Pure function " << __FUNCTION__
202  << " called in Class "
203  << info.name() << std::endl;
204  };
205 
211  virtual void derivative_alpha_cathodic(std::vector<double>& ) const
212  {
213  const std::type_info& info = typeid(*this);
214  deallog << "Pure function " << __FUNCTION__
215  << " called in Class "
216  << info.name() << std::endl;
217  };
218 
224  virtual double exchange_current_density(const double&) const
225  {
226  const std::type_info& info = typeid(*this);
227  deallog << "Pure function " << __FUNCTION__
228  << " called in Class "
229  << info.name() << std::endl;
230  };
236  virtual double derivative_exchange_current_density(const double&) const
237  {
238  const std::type_info& info = typeid(*this);
239  deallog << "Pure function " << __FUNCTION__
240  << " called in Class "
241  << info.name() << std::endl;
242  };
243 
251  virtual void reference_concentration(const std::vector<VariableNames>&,
252  std::map<VariableNames, double>& ) const
253  {
254  const std::type_info& info = typeid(*this);
255  deallog << "Pure function " << __FUNCTION__
256  << " called in Class "
257  << info.name() << std::endl;
258  };
259 
264  virtual double voltage_cell_th(const double&) const
265  {
266  const std::type_info& info = typeid(*this);
267  deallog << "Pure function " << __FUNCTION__
268  << " called in Class "
269  << info.name() << std::endl;
270  };
271 
276  virtual double dvoltage_cell_th_dT(const double&) const
277  {
278  const std::type_info& info = typeid(*this);
279  deallog << "Pure function " << __FUNCTION__
280  << " called in Class "
281  << info.name() << std::endl;
282  };
283 
291  virtual void reaction_order(const std::vector<VariableNames>&,
292  std::map<VariableNames, double>&) const
293  {
294  const std::type_info& info = typeid(*this);
295  deallog << "Pure function " << __FUNCTION__
296  << " called in Class "
297  << info.name() << std::endl;
298  };
299 
303  inline std::string get_reaction_name() const
304  {
305  Assert(name_reaction_kinetics.size() != 0, ExcMessage("Reaction name not yet set in the CatalystBase object."));
306  return name_reaction_kinetics;
307  }
308 
310  inline double get_density() const
311  {
312  return density;
313  };
315 
316  protected:
318 
319 
324  CatalystBase(std::string name)
325  : FuelCellShop::Material::BaseMaterial(name)
326  {};
327 
332  : FuelCellShop::Material::BaseMaterial()
333  {};
334 
338  virtual ~CatalystBase()
339  {};
340 
345  virtual void declare_parameters(ParameterHandler &param) const
346  {
347  const std::type_info& info = typeid(*this);
348  deallog << "Pure function " << __FUNCTION__
349  << " called in Class "
350  << info.name() << std::endl;
351  };
352 
361  virtual void set_parameters (const std::vector<std::string>& name_dvar,
362  const std::vector<double>& value_dvar,
363  ParameterHandler& param)
364  {
365  const std::type_info& info = typeid(*this);
366  deallog << "Pure function " << __FUNCTION__
367  << " called in Class "
368  << info.name() << std::endl;
369  };
370 
374  virtual void initialize (ParameterHandler &param)
375  {
376  const std::type_info& info = typeid(*this);
377  deallog << "Pure function " << __FUNCTION__
378  << " called in Class "
379  << info.name() << std::endl;
380  };
381 
383 
384 
385 
388  typedef std::map< std::string, FuelCellShop::Material::CatalystBase* > _mapFactory;
390 
392 
393 
397  {
398  static _mapFactory mapFactory;
399  return &mapFactory;
400  }
402 
404 
405 
410  virtual boost::shared_ptr<FuelCellShop::Material::CatalystBase > create_replica ()
411  {
412  const std::type_info& info = typeid(*this);
413  deallog << "Pure function " << __FUNCTION__
414  << " called in Class "
415  << info.name() << std::endl;
416  }
418 
419 
420 
427  virtual bool check_reaction_implementation(const std::string) const
428  {
429  const std::type_info& info = typeid(*this);
430  deallog << "Pure function " << __FUNCTION__
431  << " called in Class "
432  << info.name() << std::endl;
433  };
435 
436 
438 
439 
443 
444 
446  double density;
448  };
449 
450  }
451 }
452 
453 
454 #endif