OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
catalyst_support_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: base_kinetics.h
11 // - Description: Implements the properties of a "standard" carbon black support
12 // - Developers: M. Secanell and Madhur Bhaiya
13 // - $Id: catalyst_support_base.h 1366 2013-08-20 02:15:03Z madhur $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__CATALYST_SUPPORT_BASE_H
18 #define _FUELCELLSHOP__CATALYST_SUPPORT_BASE_H
19 
20 //Include STL
21 #include<cmath>
22 #include<iostream>
23 #include "base_material.h"
24 
25 
26 namespace FuelCellShop
27 {
28  namespace Material
29  {
50  :
51  public BaseMaterial
52  {
53  public:
55 
60  static void declare_CatalystSupport_parameters (ParameterHandler &param)
61  {
62 
63  for (typename FuelCellShop::Material::CatalystSupportBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystSupportBase::get_mapFactory()->begin();
65  iterator++)
66  {
67  iterator->second->declare_parameters(param);
68  }
69  }
73  static void set_CatalystSupport_parameters (const std::vector<std::string>& name_dvar,
74  const std::vector<double>& value_dvar,
75  ParameterHandler &param)
76  {
77  for (typename FuelCellShop::Material::CatalystSupportBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystSupportBase::get_mapFactory()->begin();
79  iterator++)
80  {
81  iterator->second->set_parameters(name_dvar,value_dvar, param);
82  }
83  }
102  static boost::shared_ptr<FuelCellShop::Material::CatalystSupportBase > create_CatalystSupport (ParameterHandler &param,
103  std::string support_name)
104  {
105 
106  boost::shared_ptr<FuelCellShop::Material::CatalystSupportBase > pointer;
107 
108  typename FuelCellShop::Material::CatalystSupportBase::_mapFactory::iterator iterator = FuelCellShop::Material::CatalystSupportBase::get_mapFactory()->find(support_name);
109 
111  {
112  if (iterator->second)
113  {
114  pointer = iterator->second->create_replica();
115  }
116  else
117  {
118  deallog<<"Pointer not initialized"<<std::endl;
119  abort();
120  }
121  }
122  else
123  {
124  deallog<<"Concrete name in FuelCellShop::Material::CatalystSupportBase::create_CatalystSupport does not exist"<<std::endl;
125  abort();
126  }
127 
128  pointer->initialize(param);
129 
130  return pointer;
131  }
133 
134 
136 
137 
141  virtual double get_electrical_conductivity() const
142  {
143  const std::type_info& info = typeid(*this);
144  deallog << "Pure function " << __FUNCTION__
145  << " called in Class "
146  << info.name() << std::endl;
147  return 0;
148  };
149 
153  virtual double get_thermal_conductivity() const
154  {
155  const std::type_info& info = typeid(*this);
156  deallog << "Pure function " << __FUNCTION__
157  << " called in Class "
158  << info.name() << std::endl;
159  return 0;
160  };
161 
165  virtual double get_density() const
166  {
167  const std::type_info& info = typeid(*this);
168  deallog << "Pure function " << __FUNCTION__
169  << " called in Class "
170  << info.name() << std::endl;
171  return 0;
172  };
174 
175  protected:
177 
178 
181  :
182  BaseMaterial()
183  {};
184 
193  :
194  BaseMaterial(name)
195  {};
196 
199  {};
200 
207  virtual void declare_parameters(ParameterHandler &param) const
208  {
209  const std::type_info& info = typeid(*this);
210  deallog << "Pure function " << __FUNCTION__
211  << " called in Class "
212  << info.name() << std::endl;
213  };
214 
225  virtual void set_parameters (const std::vector<std::string>& name_dvar,
226  const std::vector<double>& value_dvar,
227  ParameterHandler& param)
228  {
229  const std::type_info& info = typeid(*this);
230  deallog << "Pure function " << __FUNCTION__
231  << " called in Class "
232  << info.name() << std::endl;
233  };
234 
238  virtual void initialize (ParameterHandler &param)
239  {
240  const std::type_info& info = typeid(*this);
241  deallog << "Pure function " << __FUNCTION__
242  << " called in Class "
243  << info.name() << std::endl;
244  };
246 
247 
248 
251  typedef std::map< std::string, FuelCellShop::Material::CatalystSupportBase* > _mapFactory;
253 
255 
256 
260  {
261  static _mapFactory mapFactory;
262  return &mapFactory;
263  }
265 
267 
268 
273  virtual boost::shared_ptr<FuelCellShop::Material::CatalystSupportBase > create_replica ()
274  {
275  const std::type_info& info = typeid(*this);
276  deallog << "Pure function " << __FUNCTION__
277  << " called in Class "
278  << info.name() << std::endl;
279  }
281 
282 
283 
286 
289 
291  double density;
292 
294  };
295  }
296 }
297 
298 #endif