OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
micro_porous_layer.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2013 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: micro_porous_layer.h
11 // - Description: Base Micro-Porous Layer Class. It implements the interface for other micro-porous layer classes
12 // and some common methods.
13 // - Developers: M. Secanell
14 // - $Id: micro_porous_layer.h 1460 2013-08-30 22:28:49Z madhur $
15 //
16 //---------------------------------------------------------------------------
17 
18 #ifndef _FUELCELLSHOP__MICRO_POROUS_LAYER_H
19 #define _FUELCELLSHOP__MICRO_POROUS_LAYER_H
20 
21 // FCST classes
22 #include "base_material.h"
23 #include "base_layer.h"
24 #include "porous_layer.h"
25 
26 // Include deal.II classes
27 #include <base/parameter_handler.h>
28 #include <base/point.h>
29 #include <base/function.h>
30 #include <lac/vector.h>
31 #include <fe/fe_values.h>
32 
33 //Include STL
34 #include<cmath>
35 #include<iostream>
36 
37 using namespace dealii;
38 
39 namespace FuelCellShop
40 {
41  namespace Layer
42  {
132  template <int dim>
134  public PorousLayer<dim>
135  {
136  public:
137 
139 
140 
156  static const std::string concrete_name;
157 
159 
161 
162 
187  static void declare_MicroPorousLayer_parameters (const std::string& mpl_section_name,
188  ParameterHandler &param)
189  {
192  iterator++)
193  {
194  iterator->second->declare_parameters(mpl_section_name, param);
195  }
196  }
197 
208  static void set_MicroPorousLayer_parameters (const std::vector<std::string>& name_dvar,
209  const std::vector<double>& value_dvar,
210  const std::string& mpl_section_name,
211  ParameterHandler &param)
212  {
215  iterator++)
216  {
217  iterator->second->set_parameters(name_dvar, value_dvar, mpl_section_name, param);
218  }
219  }
220 
224  static boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_MicroPorousLayer (const std::string& mpl_section_name,
225  ParameterHandler &param)
226  {
227  boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > pointer;
228 
229  std::string concrete_name;
230  param.enter_subsection("Fuel cell data");
231  {
232  param.enter_subsection(mpl_section_name);
233  {
234  concrete_name = param.get("Micro porous layer type");
235  deallog << "name: "<<concrete_name.c_str()<<std::endl;
236  }
237  param.leave_subsection();
238  }
239  param.leave_subsection();
240 
242 
244  {
245  if (iterator->second)
246  {
247  pointer = iterator->second->create_replica(mpl_section_name);
248  }
249  else
250  {
251  deallog<<"Pointer not initialized"<<std::endl;
252  abort();
253  }
254  }
255  else
256  {
257  deallog<<"Concrete name in FuelCellShop::Layer::MicroPorousLayer<dim>::create_MicroPorousLayer does not exist"<<std::endl;
258  abort();
259  }
260 
261  pointer->initialize(param);
262 
263  return pointer;
264  }
266 
268 
269 
275  void declare_parameters (ParameterHandler &param) const
276  {
278  }
279 
286  void initialize (ParameterHandler &param);
287 
289 
291 
292 
308  const std::type_info& get_base_type() const
309  {
310  return typeid(MicroPorousLayer<dim>);
311  }
313 
315 
316 
321  virtual void effective_gas_diffusivity(const double& property,
322  double& effective_property) const
323  {
324  const std::type_info& info = typeid(*this);
325  deallog << "Pure function " << __FUNCTION__
326  << " called in Class "
327  << info.name() << std::endl;
328  };
329 
335  virtual void effective_gas_diffusivity(const double& property,
336  Tensor<2,dim>& effective_property) const
337  {
338  const std::type_info& info = typeid(*this);
339  deallog << "Pure function " << __FUNCTION__
340  << " called in Class "
341  << info.name() << std::endl;
342  };
343 
354  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &D_eff) const
355  {
356  const std::type_info& info = typeid(*this);
357  deallog << "Pure function " << __FUNCTION__
358  << " called in Class "
359  << info.name() << std::endl;
360  };
361 
367  virtual void effective_electron_conductivity(double& ) const
368  {
369  const std::type_info& info = typeid(*this);
370  deallog << "Pure function " << __FUNCTION__
371  << " called in Class "
372  << info.name() << std::endl;
373  };
374 
380  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const
381  {
382  const std::type_info& info = typeid(*this);
383  deallog << "Pure function " << __FUNCTION__
384  << " called in Class "
385  << info.name() << std::endl;
386  };
387 
394  virtual bool set_method_effective_transport_property_solid(std::string)
395  {
396  const std::type_info& info = typeid(*this);
397  deallog << "Pure function " << __FUNCTION__
398  << " called in Class "
399  << info.name() << std::endl;
400 
401  return false;
402  };
409  virtual void effective_transport_property_solid(const double& property,
410  double& effective_property) const
411  {
412  const std::type_info& info = typeid(*this);
413  deallog << "Pure function " << __FUNCTION__
414  << " called in Class "
415  << info.name() << std::endl;
416 
417  };
418 
425  virtual void effective_transport_property_solid(const Tensor<2,dim>& property,
426  Tensor<2,dim>& effective_property) const
427  {
428  const std::type_info& info = typeid(*this);
429  deallog << "Pure function " << __FUNCTION__
430  << " called in Class "
431  << info.name() << std::endl;
432 
433  };
435 
436 
437 
438  protected:
440 
441 
451 
459  MicroPorousLayer(const std::string& name);
460 
464  ~MicroPorousLayer();
465 
472  void declare_parameters (const std::string& name,
473  ParameterHandler &param) const;
474 
475 
480  void set_parameters (const std::vector<std::string>& name_dvar,
481  const std::vector<double>& value_dvar,
482  const std::string& name,
483  ParameterHandler &param) const
484  {}
486 
488 
489 
495  typedef std::map< std::string, MicroPorousLayer<dim>* > _mapFactory;
496 
544  static _mapFactory * get_mapFactory()
545  {
546  static _mapFactory mapFactory;
547  return &mapFactory;
548  }
554  virtual boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_replica (const std::string &name)
555  {
556  const std::type_info& info = typeid(*this);
557  deallog << "Pure function " << __FUNCTION__
558  << " called in Class "
559  << info.name() << std::endl;
560  }
562  };
563 
564  }
565 
566 } // FuelCellShop
567 
568 #endif // _FUELCELLSHOP__MICRO_POROUS_LAYER_H