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 2605 2014-08-15 03:36:44Z secanell $
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 #include "PSD_base.h"
26 
27 // Include deal.II classes
28 #include <base/parameter_handler.h>
29 #include <base/point.h>
30 #include <base/function.h>
31 #include <lac/vector.h>
32 #include <fe/fe_values.h>
33 
34 //Include STL
35 #include<cmath>
36 #include<iostream>
37 
38 using namespace dealii;
39 
40 namespace FuelCellShop
41 {
42  namespace Layer
43  {
115  template <int dim>
117  public PorousLayer<dim>
118  {
119  public:
120 
122 
123 
139  static const std::string concrete_name;
140 
142 
144 
145 
170  static void declare_MicroPorousLayer_parameters (const std::string& mpl_section_name,
171  ParameterHandler &param)
172  {
175  iterator++)
176  {
177  iterator->second->declare_parameters(mpl_section_name, param);
178  }
179  }
180 
184  static boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_MicroPorousLayer (const std::string& mpl_section_name,
185  ParameterHandler &param)
186  {
187  boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > pointer;
188 
189  std::string concrete_name;
190  param.enter_subsection("Fuel cell data");
191  {
192  param.enter_subsection(mpl_section_name);
193  {
194  concrete_name = param.get("Micro porous layer type");
195  FcstUtilities::log << "name: "<<concrete_name.c_str()<<std::endl;
196  }
197  param.leave_subsection();
198  }
199  param.leave_subsection();
200 
202 
204  {
205  if (iterator->second)
206  {
207  pointer = iterator->second->create_replica(mpl_section_name);
208  }
209  else
210  {
211  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
212  abort();
213  }
214  }
215  else
216  {
217  FcstUtilities::log<<"Concrete name in FuelCellShop::Layer::MicroPorousLayer<dim>::create_MicroPorousLayer does not exist"<<std::endl;
218  abort();
219  }
220 
221  pointer->initialize(param);
222 
223  return pointer;
224  }
226 
228 
229 
235  //void declare_parameters (ParameterHandler &param) const
236  //{
237  // FuelCellShop::Layer::MicroPorousLayer<dim>::declare_parameters(this->name,param);
238  //}
239 
246  void initialize (ParameterHandler &param);
247 
249 
251 
252 
268  const std::type_info& get_base_type() const
269  {
270  return typeid(MicroPorousLayer<dim>);
271  }
273 
275 
276 
282  virtual void effective_gas_diffusivity(const double&, const double&, double&) const
283  {
284  const std::type_info& info = typeid(*this);
285  FcstUtilities::log << "Pure function " << __FUNCTION__
286  << " called in Class "
287  << info.name() << std::endl;
288  };
294  virtual void effective_gas_diffusivity(const double&, const double&, Tensor<2,dim>&) const
295  {
296  const std::type_info& info = typeid(*this);
297  FcstUtilities::log << "Pure function " << __FUNCTION__
298  << " called in Class "
299  << info.name() << std::endl;
300  };
301 
308  virtual void effective_gas_diffusivity(std::vector< Tensor<2,dim> >& ) const
309  {
310  const std::type_info& info = typeid(*this);
311  FcstUtilities::log << "Pure function " << __FUNCTION__
312  << " called in Class "
313  << info.name() << std::endl;
314  };
322  virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor<2,dim> > >& ) const
323  {
324  const std::type_info& info = typeid(*this);
325  FcstUtilities::log << "Pure function " << __FUNCTION__
326  << " called in Class "
327  << info.name() << std::endl;
328  };
329 
340  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > & ) const
341  {
342  const std::type_info& info = typeid(*this);
343  FcstUtilities::log << "Pure function " << __FUNCTION__
344  << " called in Class "
345  << info.name() << std::endl;
346  };
347 
353  virtual void effective_electron_conductivity(double& ) const
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 
366  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const
367  {
368  const std::type_info& info = typeid(*this);
369  FcstUtilities::log << "Pure function " << __FUNCTION__
370  << " called in Class "
371  << info.name() << std::endl;
372  };
373 
379  virtual void effective_thermal_conductivity(double& ) const
380  {
381  const std::type_info& info = typeid(*this);
382  FcstUtilities::log << "Pure function " << __FUNCTION__
383  << " called in Class "
384  << info.name() << std::endl;
385  };
391  virtual void effective_thermal_conductivity(Tensor<2,dim>& ) const
392  {
393  const std::type_info& info = typeid(*this);
394  FcstUtilities::log << "Pure function " << __FUNCTION__
395  << " called in Class "
396  << info.name() << std::endl;
397  };
403  virtual void effective_thermal_conductivity(std::vector< Tensor<2,dim> >& ) const
404  {
405  const std::type_info& info = typeid(*this);
406  FcstUtilities::log << "Pure function " << __FUNCTION__
407  << " called in Class "
408  << info.name() << std::endl;
409  };
415  virtual void derivative_effective_thermal_conductivity(std::vector< Tensor<2,dim> >& ) const
416  {
417  const std::type_info& info = typeid(*this);
418  FcstUtilities::log << "Pure function " << __FUNCTION__
419  << " called in Class "
420  << info.name() << std::endl;
421  };
422 
426  virtual void liquid_permeablity(std::vector< Tensor<2,dim> >& ) const
427  {
428  const std::type_info& info = typeid(*this);
429  FcstUtilities::log << "Pure function " << __FUNCTION__
430  << " called in Class "
431  << info.name() << std::endl;
432  };
438  virtual void derivative_liquid_permeablity(std::map< VariableNames, std::vector< Tensor<2,dim> > >& ) const
439  {
440  const std::type_info& info = typeid(*this);
441  FcstUtilities::log << "Pure function " << __FUNCTION__
442  << " called in Class "
443  << info.name() << std::endl;
444  };
445 
449  virtual void pcapillary(std::vector<double>&) const
450  {
451  const std::type_info& info = typeid(*this);
452  FcstUtilities::log << "Pure function " << __FUNCTION__
453  << " called in Class "
454  << info.name() << std::endl;
455  };
459  virtual void dpcapillary_dsat(std::vector<double> &) const
460  {
461  const std::type_info& info = typeid(*this);
462  FcstUtilities::log << "Pure function " << __FUNCTION__
463  << " called in Class "
464  << info.name() << std::endl;
465  };
471  virtual void derivative_dpcapillary_dsat(std::map< VariableNames, std::vector<double> > &) const
472  {
473  const std::type_info& info = typeid(*this);
474  FcstUtilities::log << "Pure function " << __FUNCTION__
475  << " called in Class "
476  << info.name() << std::endl;
477  };
478 
483  virtual void interfacial_surface_area(std::vector<double>&) const
484  {
485  const std::type_info& info = typeid(*this);
486  FcstUtilities::log << "Pure function " << __FUNCTION__
487  << " called in Class "
488  << info.name() << std::endl;
489  };
495  virtual void derivative_interfacial_surface_area(std::map< VariableNames, std::vector<double> >&) const
496  {
497  const std::type_info& info = typeid(*this);
498  FcstUtilities::log << "Pure function " << __FUNCTION__
499  << " called in Class "
500  << info.name() << std::endl;
501  };
502 
510  {
511  const std::type_info& info = typeid(*this);
512  FcstUtilities::log << "Pure function " << __FUNCTION__
513  << " called in Class "
514  << info.name() << std::endl;
515 
516  return false;
517  };
524  virtual void effective_transport_property_solid(const double& property,
525  double& effective_property) const
526  {
527  const std::type_info& info = typeid(*this);
528  FcstUtilities::log << "Pure function " << __FUNCTION__
529  << " called in Class "
530  << info.name() << std::endl;
531 
532  };
533 
540  virtual void effective_transport_property_solid(const Tensor<2,dim>& property,
541  Tensor<2,dim>& effective_property) const
542  {
543  const std::type_info& info = typeid(*this);
544  FcstUtilities::log << "Pure function " << __FUNCTION__
545  << " called in Class "
546  << info.name() << std::endl;
547 
548  };
550 
551 
552 
553  protected:
555 
556 
566 
574  MicroPorousLayer(const std::string& name);
575 
579  ~MicroPorousLayer();
580 
587  void declare_parameters (const std::string& name,
588  ParameterHandler &param) const;
589 
590 
592 
594 
595 
601  typedef std::map< std::string, MicroPorousLayer<dim>* > _mapFactory;
602 
651  {
652  static _mapFactory mapFactory;
653  return &mapFactory;
654  }
660  virtual boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_replica (const std::string &name)
661  {
662  const std::type_info& info = typeid(*this);
663  FcstUtilities::log << "Pure function " << __FUNCTION__
664  << " called in Class "
665  << info.name() << std::endl;
666  }
668 
670 
671  std::string PSD_type;
672 
673  /*** Pointer to the PSD object*/
674  boost::shared_ptr< FuelCellShop::MicroScale::BasePSD<dim> > PSD;
676  };
677 
678  }
679 
680 } // FuelCellShop
681 
682 #endif // _FUELCELLSHOP__MICRO_POROUS_LAYER_H
virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &) const
Compute the effective property in the pores.
Definition: micro_porous_layer.h:340
virtual void effective_electron_conductivity(double &) const
Compute the effective conductivity.
Definition: micro_porous_layer.h:353
static boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer< dim > > create_MicroPorousLayer(const std::string &mpl_section_name, ParameterHandler &param)
Function used to select the appropriate MicroPorousLayer.
Definition: micro_porous_layer.h:184
virtual void pcapillary(std::vector< double > &) const
Compute , at all quadrature points in the cell.
Definition: micro_porous_layer.h:449
virtual void effective_transport_property_solid(const double &property, double &effective_property) const
Compute the effective property of a property that is defined by the network of fibres.
Definition: micro_porous_layer.h:524
virtual void effective_electron_conductivity(Tensor< 2, dim > &) const
Compute the effective conductivity.
Definition: micro_porous_layer.h:366
virtual void effective_gas_diffusivity(const double &, const double &, Tensor< 2, dim > &) const
Compute the effective property in the pores of the MPL.
Definition: micro_porous_layer.h:294
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor< 2, dim > > > &) const
Return the derivative of effective diffusivity w.r.t solution variables/design parameters for nonisot...
Definition: micro_porous_layer.h:322
virtual boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer< dim > > create_replica(const std::string &name)
This member function is used to create an object of type micro porous layer.
Definition: micro_porous_layer.h:660
Virtual class used to provide the interface for all MicroPorousLayer children.
Definition: micro_porous_layer.h:116
virtual void dpcapillary_dsat(std::vector< double > &) const
Compute , at all quadrature points in the MPL.
Definition: micro_porous_layer.h:459
virtual void effective_gas_diffusivity(std::vector< Tensor< 2, dim > > &) const
Return the effective diffusivity [m^2/s] for nonisothermal with/without two-phase case in the MPL...
Definition: micro_porous_layer.h:308
std::string PSD_type
PSD class type from input file.
Definition: micro_porous_layer.h:671
virtual void derivative_interfacial_surface_area(std::map< VariableNames, std::vector< double > > &) const
Compute the derivative of the liquid-gas interfacial surface area per unit volume, with respect to either the solution variables or design parameters, at all quadrature points in the MPL.
Definition: micro_porous_layer.h:495
virtual void effective_transport_property_solid(const Tensor< 2, dim > &property, Tensor< 2, dim > &effective_property) const
Compute the effective property of a property that is defined by the network of fibres.
Definition: micro_porous_layer.h:540
virtual void interfacial_surface_area(std::vector< double > &) const
Compute the liquid-gas interfacial surface area per unit volume, , at all quadrature points in the MP...
Definition: micro_porous_layer.h:483
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
static void declare_MicroPorousLayer_parameters(const std::string &mpl_section_name, ParameterHandler &param)
Function used to declare all the data necessary in the parameter files former all MicroPorousLayer ch...
Definition: micro_porous_layer.h:170
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: micro_porous_layer.h:139
const std::type_info & get_base_type() const
This member function returns a type_info object with the name of the base layer type the inherited cl...
Definition: micro_porous_layer.h:268
virtual void derivative_effective_thermal_conductivity(std::vector< Tensor< 2, dim > > &) const
Compute the derivative of effective thermal conductivity with respect to temperature.
Definition: micro_porous_layer.h:415
virtual void effective_gas_diffusivity(const double &, const double &, double &) const
Compute the effective property in the pores of the MPL.
Definition: micro_porous_layer.h:282
Virtual class used to implement properties that are characteristic of a porous layer.
Definition: porous_layer.h:65
static _mapFactory * get_mapFactory()
Return the map library that stores all childrens of this class.
Definition: micro_porous_layer.h:650
virtual void effective_thermal_conductivity(Tensor< 2, dim > &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:391
virtual void effective_thermal_conductivity(double &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:379
virtual void derivative_dpcapillary_dsat(std::map< VariableNames, std::vector< double > > &) const
Compute the derivative of in the MPL, with respect to either the solution or design parameters...
Definition: micro_porous_layer.h:471
virtual bool set_method_effective_transport_property_solid(std::string)
Specify the methodology to be used to compute the effective properties for the porous phase...
Definition: micro_porous_layer.h:509
virtual void derivative_liquid_permeablity(std::map< VariableNames, std::vector< Tensor< 2, dim > > > &) const
Compute the derivative of the anisotropic liquid permeability in the MPL with respect to either the s...
Definition: micro_porous_layer.h:438
boost::shared_ptr< FuelCellShop::MicroScale::BasePSD< dim > > PSD
Definition: micro_porous_layer.h:674
virtual void liquid_permeablity(std::vector< Tensor< 2, dim > > &) const
Compute the anisotropic MPL liquid permeability , at all quadrature points in the cell...
Definition: micro_porous_layer.h:426
virtual void effective_thermal_conductivity(std::vector< Tensor< 2, dim > > &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:403
std::map< std::string, MicroPorousLayer< dim > * > _mapFactory
This object is used to store all objects of type MicroPorousLayer.
Definition: micro_porous_layer.h:601