OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
design_MPL.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-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: design_MPL.h
11 // - Description: Class used to represent a design MPL where effective properties are computed based on the porosity etc.
12 // - Developers: Madhur Bhaiya
13 // - $Id: design_MPL.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__DESIGN_MPL_H
18 #define _FUELCELLSHOP__DESIGN_MPL_H
19 
20 // FCST classes
21 #include "base_material.h"
22 #include "micro_porous_layer.h"
23 
24 // Include deal.II classes
25 #include <base/parameter_handler.h>
26 #include <base/point.h>
27 #include <base/function.h>
28 #include <lac/vector.h>
29 #include <fe/fe_values.h>
30 
31 //Include STL
32 #include<cmath>
33 #include<iostream>
34 
35 using namespace dealii;
36 
37 namespace FuelCellShop
38 {
39  namespace Layer
40  {
112  template <int dim>
113  class DesignMPL :
114  public MicroPorousLayer<dim>
115  {
116  public:
118 
119 
134  static const std::string concrete_name;
135 
137 
139 
142  DesignMPL(std::string name);
143 
147  DesignMPL();
148 
153  {}
154 
160  void declare_parameters (ParameterHandler &param) const
161  {
163  }
167  void set_parameters (const std::vector<std::string>& name_dvar,const std::vector<double>& value_dvar,ParameterHandler &param);
168 
169 
174  void initialize (ParameterHandler &param);
176 
178 
179 
180 
182 
184 
185 
191  virtual void effective_gas_diffusivity(const double& property,
192  const double& saturation,
193  double& effective_property) const;
199  virtual void effective_gas_diffusivity(const double& property,
200  const double& saturation,
201  Tensor<2,dim>& effective_property) const;
202 
211  virtual void effective_gas_diffusivity(std::vector< Tensor<2,dim> >& ) const;
221  virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor<2,dim> > >& ) const;
222 
223 
234  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &D_eff) const;
235 
236 
242  virtual void effective_electron_conductivity(double& ) const;
243 
249  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const;
255  virtual void effective_thermal_conductivity(double& ) const;
256 
262  virtual void effective_thermal_conductivity(Tensor<2,dim>& ) const;
263 
269  virtual void effective_thermal_conductivity(std::vector< Tensor<2,dim> >& ) const;
270 
271 
275  virtual void liquid_permeablity(std::vector< Tensor<2,dim> >& ) const;
281  virtual void derivative_liquid_permeablity(std::map< VariableNames, std::vector< Tensor<2,dim> > >& ) const;
282 
286  virtual void pcapillary(std::vector<double>&) const;
290  virtual void dpcapillary_dsat(std::vector<double> &) const;
296  virtual void derivative_dpcapillary_dsat(std::map< VariableNames, std::vector<double> > &) const;
297 
302  virtual void interfacial_surface_area(std::vector<double>&) const;
308  virtual void derivative_interfacial_surface_area(std::map< VariableNames, std::vector<double> >&) const;
309 
310 
317  virtual void effective_transport_property_solid(const double& property,
318  double& effective_property) const;
319 
326  virtual void effective_transport_property_solid(const Tensor<2,dim>& property,
327  Tensor<2,dim>& effective_property) const;
328 
330 
331  protected:
333 
334 
340  void declare_parameters (const std::string& mpl_section_name,
341  ParameterHandler &param) const;
342 
343 
348  void set_parameters (const std::vector<std::string>& name_dvar,
349  const std::vector<double>& value_dvar,
350  const std::string& name,
351  ParameterHandler &param) const
352  {
353  const std::type_info& info = typeid(*this);
354  FcstUtilities::log << "Pure function " << __FUNCTION__
355  << " called in Class "
356  << info.name() << std::endl;
357  }
359 
361 
362  virtual boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_replica (const std::string &name)
363  {
364  return boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > (new FuelCellShop::Layer::DesignMPL<dim> (name));
365  }
366 
370  static DesignMPL<dim> const* PROTOTYPE;
371 
372 
374 
376 
377 
378  //--------------------------
382  double porosity;
384  double solid_phase;
399 
403  double s_irr;
404 
405  //----------------------
408  std::vector<double> porosity_th;
410  std::vector<double> porosity_mu;
412  std::vector<double> porosity_gamma;
414  std::vector<double> D_O2;
416  std::vector<double> D_wv;
418  std::vector<double> fibre_th;
420  std::vector<double> fibre_mu;
421 
423  std::vector<double> abs_permeability;
424 
430  double PTFE_loading;
436 
438  };
439  }
440 } // FuelCellShop
441 
442 #endif // _FUELCELLSHOP__DESIGN_MPL_H
std::string method_eff_property_pores
Method used to compute the effective properties in the pores.
Definition: design_MPL.h:386
std::vector< double > D_O2
Oxygen Diffusion coefficient.
Definition: design_MPL.h:414
double s_irr
Irreducible liquid water saturation value in the MPL.
Definition: design_MPL.h:403
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: design_MPL.h:362
std::vector< double > fibre_th
Solid (electron conductive) network of the MPL threshold.
Definition: design_MPL.h:418
std::vector< double > abs_permeability
Absolute permeability [cm^2] of the layer.
Definition: design_MPL.h:423
std::vector< double > D_wv
Water vapour diffusion coefficient.
Definition: design_MPL.h:416
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
std::string method_rel_liquid_permeability
Method used to compute the relative liquid permeability.
Definition: design_MPL.h:401
Virtual class used to provide the interface for all MicroPorousLayer children.
Definition: micro_porous_layer.h:116
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: design_MPL.h:134
std::vector< double > porosity_gamma
Network constant gamma.
Definition: design_MPL.h:412
double thermal_conductivity
Thermal conductivity from the input file.
Definition: design_MPL.h:394
bool anisotropy
General properties.
Definition: design_MPL.h:380
void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: design_MPL.h:160
double porosity
Porosity of the GDL.
Definition: design_MPL.h:382
std::string method_eff_property_fibres
Method used to compute the effective properties in the solid phase.
Definition: design_MPL.h:388
double compaction_pressure
MPL Compaction pressure, .
Definition: design_MPL.h:428
std::vector< double > porosity_th
Anisotropic properties.
Definition: design_MPL.h:408
This class defines an MPL where effective transport properties are computed using macro-homogeneous c...
Definition: design_MPL.h:113
double electrical_conductivity
Electrical conductivity from the input file.
Definition: design_MPL.h:392
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
Tensor< 2, dim > matrix_thermal_conductivity
Thermal conductivity from the input file in the anisotripic case.
Definition: design_MPL.h:398
std::vector< double > porosity_mu
Network constant.
Definition: design_MPL.h:410
std::string method_eff_thermal_conductivity
Method used to compute effective thermal conductivity.
Definition: design_MPL.h:390
double solid_phase
Volume fraction of solid phase, i.e.
Definition: design_MPL.h:384
static DesignMPL< dim > const * PROTOTYPE
Prototype declaration.
Definition: design_MPL.h:370
double kumbur_factor
Factor calculated based on Kumbur et al (2007), to be used in capillary pressure computation, given as: .
Definition: design_MPL.h:435
Tensor< 2, dim > matrix_electrical_conductivity
Electrical conductivity from the input file in the anisotripic case.
Definition: design_MPL.h:396
double PTFE_loading
PTFE loading (% wt) in the MPL.
Definition: design_MPL.h:430
void set_parameters(const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, const std::string &name, ParameterHandler &param) const
Member function used to set new parameters values in the optimization loop.
Definition: design_MPL.h:348
~DesignMPL()
Destructor.
Definition: design_MPL.h:152
std::string method_capillary_function
Method used to compute capillary pressure as a function of saturation.
Definition: design_MPL.h:426
std::vector< double > fibre_mu
Solid (electron conductive) network constant.
Definition: design_MPL.h:420