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 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__MICRO_POROUS_LAYER_H
18 #define _FUELCELLSHOP__MICRO_POROUS_LAYER_H
19 
20 // FCST classes
22 #include <layers/porous_layer.h>
23 
24 using namespace dealii;
25 
26 namespace FuelCellShop
27 {
28  namespace Layer
29  {
101  template <int dim>
103  public PorousLayer<dim>
104  {
105  public:
106 
108 
109 
125  static const std::string concrete_name;
126 
128 
130 
131 
156  static void declare_MicroPorousLayer_parameters (const std::string& mpl_section_name,
157  ParameterHandler &param)
158  {
161  iterator++)
162  {
163  iterator->second->declare_parameters(mpl_section_name, param);
164  }
165  }
166 
170  static boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_MicroPorousLayer (const std::string& mpl_section_name,
171  ParameterHandler &param)
172  {
173  boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > pointer;
174 
175  std::string concrete_name;
176  param.enter_subsection("Fuel cell data");
177  {
178  param.enter_subsection(mpl_section_name);
179  {
180  concrete_name = param.get("Micro porous layer type");
181  FcstUtilities::log << "name: "<<concrete_name.c_str()<<std::endl;
182  }
183  param.leave_subsection();
184  }
185  param.leave_subsection();
186 
188 
190  {
191  if (iterator->second)
192  {
193  pointer = iterator->second->create_replica(mpl_section_name);
194  }
195  else
196  {
197  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
198  abort();
199  }
200  }
201  else
202  {
203  FcstUtilities::log<<"Concrete name in FuelCellShop::Layer::MicroPorousLayer<dim>::create_MicroPorousLayer does not exist"<<std::endl;
204  abort();
205  }
206 
207  pointer->initialize(param);
208 
209  return pointer;
210  }
212 
214 
215 
221  //void declare_parameters (ParameterHandler &param) const
222  //{
223  // FuelCellShop::Layer::MicroPorousLayer<dim>::declare_parameters(this->name,param);
224  //}
225 
232  void initialize (ParameterHandler &param);
233 
235 
237 
238 
254  const std::type_info& get_base_type() const
255  {
256  return typeid(MicroPorousLayer<dim>);
257  }
259 
261 
262 
268  virtual void effective_gas_diffusivity(const double&, const double&, double&) const
269  {
270  const std::type_info& info = typeid(*this);
271  FcstUtilities::log << "Pure function " << __FUNCTION__
272  << " called in Class "
273  << info.name() << std::endl;
274  };
280  virtual void effective_gas_diffusivity(const double&, const double&, Tensor<2,dim>&) const
281  {
282  const std::type_info& info = typeid(*this);
283  FcstUtilities::log << "Pure function " << __FUNCTION__
284  << " called in Class "
285  << info.name() << std::endl;
286  };
287 
294  virtual void effective_gas_diffusivity(std::vector< 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  };
308  virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, 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  };
315 
326  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > & ) const
327  {
328  const std::type_info& info = typeid(*this);
329  FcstUtilities::log << "Pure function " << __FUNCTION__
330  << " called in Class "
331  << info.name() << std::endl;
332  };
333 
339  virtual void effective_electron_conductivity(double& ) const
340  {
341  const std::type_info& info = typeid(*this);
342  FcstUtilities::log << "Pure function " << __FUNCTION__
343  << " called in Class "
344  << info.name() << std::endl;
345  };
346 
352  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const
353  {
354  const std::type_info& info = typeid(*this);
355  FcstUtilities::log << "Pure function " << __FUNCTION__
356  << " called in Class "
357  << info.name() << std::endl;
358  };
359 
365  virtual void effective_thermal_conductivity(double& ) const
366  {
367  const std::type_info& info = typeid(*this);
368  FcstUtilities::log << "Pure function " << __FUNCTION__
369  << " called in Class "
370  << info.name() << std::endl;
371  };
377  virtual void effective_thermal_conductivity(Tensor<2,dim>& ) const
378  {
379  const std::type_info& info = typeid(*this);
380  FcstUtilities::log << "Pure function " << __FUNCTION__
381  << " called in Class "
382  << info.name() << std::endl;
383  };
389  virtual void effective_thermal_conductivity(std::vector< Tensor<2,dim> >& ) const
390  {
391  const std::type_info& info = typeid(*this);
392  FcstUtilities::log << "Pure function " << __FUNCTION__
393  << " called in Class "
394  << info.name() << std::endl;
395  };
401  virtual void derivative_effective_thermal_conductivity(std::vector< Tensor<2,dim> >& ) const
402  {
403  const std::type_info& info = typeid(*this);
404  FcstUtilities::log << "Pure function " << __FUNCTION__
405  << " called in Class "
406  << info.name() << std::endl;
407  };
408 
412  virtual void liquid_permeablity(std::vector< Tensor<2,dim> >& ) const
413  {
414  const std::type_info& info = typeid(*this);
415  FcstUtilities::log << "Pure function " << __FUNCTION__
416  << " called in Class "
417  << info.name() << std::endl;
418  };
424  virtual void derivative_liquid_permeablity(std::map< VariableNames, std::vector< Tensor<2,dim> > >& ) const
425  {
426  const std::type_info& info = typeid(*this);
427  FcstUtilities::log << "Pure function " << __FUNCTION__
428  << " called in Class "
429  << info.name() << std::endl;
430  };
436  virtual void relative_liquid_permeability_PSD(std::vector< Tensor<2,dim> >& ) const
437  {
438  const std::type_info& info = typeid(*this);
439  FcstUtilities::log << "Pure function " << __FUNCTION__
440  << " called in Class "
441  << info.name() << std::endl;
442  };
443 
444  virtual void derivative_relative_liquid_permeablity_PSD(std::map< VariableNames, std::vector< Tensor<2,dim> > > & ) const
445  {
446  const std::type_info& info = typeid(*this);
447  FcstUtilities::log << "Pure function " << __FUNCTION__
448  << " called in Class "
449  << info.name() << std::endl;
450  };
451 
452  virtual void derivative_relative_liquid_permeablity_PSD(std::vector<double> & ) const
453  {
454  const std::type_info& info = typeid(*this);
455  FcstUtilities::log << "Pure function " << __FUNCTION__
456  << " called in Class "
457  << info.name() << std::endl;
458  };
459 
460  virtual void saturated_liquid_permeablity_PSD(double& ) const
461  {
462  const std::type_info& info = typeid(*this);
463  FcstUtilities::log << "Pure function " << __FUNCTION__
464  << " called in Class "
465  << info.name() << std::endl;
466  };
467 
471  virtual void pcapillary(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 
479  virtual void saturation_from_capillary_equation(std::vector<double>&) const
480  {
481  const std::type_info& info = typeid(*this);
482  FcstUtilities::log << "Pure function " << __FUNCTION__
483  << " called in Class "
484  << info.name() << std::endl;
485  };
486 
487  virtual void derivative_saturation_from_capillary_equation_PSD(std::vector<double>&) const
488  {
489  const std::type_info& info = typeid(*this);
490  FcstUtilities::log << "Pure function " << __FUNCTION__
491  << " called in Class "
492  << info.name() << std::endl;
493  };
497  virtual void dpcapillary_dsat(std::vector<double> &) const
498  {
499  const std::type_info& info = typeid(*this);
500  FcstUtilities::log << "Pure function " << __FUNCTION__
501  << " called in Class "
502  << info.name() << std::endl;
503  };
509  virtual void derivative_dpcapillary_dsat(std::map< VariableNames, std::vector<double> > &) const
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 
521  virtual void interfacial_surface_area(std::vector<double>&) const
522  {
523  const std::type_info& info = typeid(*this);
524  FcstUtilities::log << "Pure function " << __FUNCTION__
525  << " called in Class "
526  << info.name() << std::endl;
527  };
533  virtual void derivative_interfacial_surface_area(std::map< VariableNames, std::vector<double> >&) const
534  {
535  const std::type_info& info = typeid(*this);
536  FcstUtilities::log << "Pure function " << __FUNCTION__
537  << " called in Class "
538  << info.name() << std::endl;
539  };
540 
548  {
549  const std::type_info& info = typeid(*this);
550  FcstUtilities::log << "Pure function " << __FUNCTION__
551  << " called in Class "
552  << info.name() << std::endl;
553 
554  return false;
555  };
562  virtual void effective_transport_property_solid(const double& property,
563  double& effective_property) const
564  {
565  const std::type_info& info = typeid(*this);
566  FcstUtilities::log << "Pure function " << __FUNCTION__
567  << " called in Class "
568  << info.name() << std::endl;
569 
570  };
571 
578  virtual void effective_transport_property_solid(const Tensor<2,dim>& property,
579  Tensor<2,dim>& effective_property) const
580  {
581  const std::type_info& info = typeid(*this);
582  FcstUtilities::log << "Pure function " << __FUNCTION__
583  << " called in Class "
584  << info.name() << std::endl;
585 
586  };
587 
592  virtual void interfacial_surface_area_PSD(std::vector<double>&) const
593  {
594  const std::type_info& info = typeid(*this);
595  FcstUtilities::log << "Pure function " << __FUNCTION__
596  << " called in Class "
597  << info.name() << std::endl;
598  };
604  virtual void derivative_interfacial_surface_area_PSD(std::map< VariableNames, std::vector<double> >&) const
605  {
606  const std::type_info& info = typeid(*this);
607  FcstUtilities::log << "Pure function " << __FUNCTION__
608  << " called in Class "
609  << info.name() << std::endl;
610  };
611 
612  virtual void derivative_interfacial_surface_area_PSD(std::vector<double>&) const
613  {
614  const std::type_info& info = typeid(*this);
615  FcstUtilities::log << "Pure function " << __FUNCTION__
616  << " called in Class "
617  << info.name() << std::endl;
618  };
619 
621 
622 
623 
624  protected:
626 
627 
637 
645  MicroPorousLayer(const std::string& name);
646 
650  ~MicroPorousLayer();
651 
658  void declare_parameters (const std::string& name,
659  ParameterHandler &param) const;
660 
661 
663 
665 
666 
672  typedef std::map< std::string, MicroPorousLayer<dim>* > _mapFactory;
673 
722  {
723  static _mapFactory mapFactory;
724  return &mapFactory;
725  }
731  virtual boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_replica (const std::string &name)
732  {
733  const std::type_info& info = typeid(*this);
734  FcstUtilities::log << "Pure function " << __FUNCTION__
735  << " called in Class "
736  << info.name() << std::endl;
737  }
739 
741 
744  Tensor<2,dim> oxygen_diffusivity;
746  Tensor<2,dim> water_diffusivity;
748  Tensor<2,dim> electrical_conductivity;
750  Tensor<2,dim> thermal_conductivity;
752  };
753 
754  }
755 
756 } // FuelCellShop
757 
758 #endif // _FUELCELLSHOP__MICRO_POROUS_LAYER_H
Tensor< 2, dim > water_diffusivity
Water diffusion coefficient.
Definition: micro_porous_layer.h:746
virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &) const
Compute the effective property in the pores.
Definition: micro_porous_layer.h:326
virtual void derivative_interfacial_surface_area_PSD(std::vector< double > &) const
Definition: micro_porous_layer.h:612
virtual void effective_electron_conductivity(double &) const
Compute the effective conductivity.
Definition: micro_porous_layer.h:339
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:170
virtual void pcapillary(std::vector< double > &) const
Compute , at all quadrature points in the cell.
Definition: micro_porous_layer.h:471
virtual void saturated_liquid_permeablity_PSD(double &) const
Definition: micro_porous_layer.h:460
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:562
virtual void effective_electron_conductivity(Tensor< 2, dim > &) const
Compute the effective conductivity.
Definition: micro_porous_layer.h:352
virtual void derivative_saturation_from_capillary_equation_PSD(std::vector< double > &) const
Definition: micro_porous_layer.h:487
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:280
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
virtual void interfacial_surface_area_PSD(std::vector< double > &) const
Compute the liquid-gas interfacial surface area per unit volume, , at all quadrature points in the CL...
Definition: micro_porous_layer.h:592
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:308
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:731
Virtual class used to provide the interface for all MicroPorousLayer children.
Definition: micro_porous_layer.h:102
virtual void dpcapillary_dsat(std::vector< double > &) const
Compute , at all quadrature points in the MPL.
Definition: micro_porous_layer.h:497
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:294
Tensor< 2, dim > electrical_conductivity
Electrical conductivity from the input file in the anisotripic case.
Definition: micro_porous_layer.h:748
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:533
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:578
virtual void saturation_from_capillary_equation(std::vector< double > &) const
Definition: micro_porous_layer.h:479
virtual void relative_liquid_permeability_PSD(std::vector< Tensor< 2, dim > > &) const
Compute the derivative of the anisotropic liquid permeability in the GDL with respect to either the s...
Definition: micro_porous_layer.h:436
Tensor< 2, dim > thermal_conductivity
Thermal conductivity from the input file in the anisotripic case.
Definition: micro_porous_layer.h:750
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:521
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:156
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: micro_porous_layer.h:125
virtual void derivative_interfacial_surface_area_PSD(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 CL.
Definition: micro_porous_layer.h:604
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:254
virtual void derivative_relative_liquid_permeablity_PSD(std::map< VariableNames, std::vector< Tensor< 2, dim > > > &) const
Definition: micro_porous_layer.h:444
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:401
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:268
Tensor< 2, dim > oxygen_diffusivity
Oxygen diffusion coefficient.
Definition: micro_porous_layer.h:744
Virtual class used to implement properties that are characteristic of a porous layer.
Definition: porous_layer.h:75
virtual void derivative_relative_liquid_permeablity_PSD(std::vector< double > &) const
Definition: micro_porous_layer.h:452
static _mapFactory * get_mapFactory()
Return the map library that stores all childrens of this class.
Definition: micro_porous_layer.h:721
virtual void effective_thermal_conductivity(Tensor< 2, dim > &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:377
virtual void effective_thermal_conductivity(double &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:365
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:509
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:547
bool anisotropy
Anisotropy variable.
Definition: micro_porous_layer.h:742
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:424
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:412
virtual void effective_thermal_conductivity(std::vector< Tensor< 2, dim > > &) const
Compute the effective thermal conductivity.
Definition: micro_porous_layer.h:389
std::map< std::string, MicroPorousLayer< dim > * > _mapFactory
This object is used to store all objects of type MicroPorousLayer.
Definition: micro_porous_layer.h:672