OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
conventional_CL.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: conventional_cl.h
11 // - Description: Class characterizing the conventional catalyst layer and methods for computing effective properties. It also provides interface to various material classes used in catalyst layer.
12 // - Developers: Peter Dobson (2011) and Madhur Bhaiya (2013)
13 // - Id: $Id: conventional_CL.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__CONVENTIONAL_CL__H
18 #define _FUELCELLSHOP__CONVENTIONAL_CL__H
19 
20 // Include deal.II classes
21 #include <deal.II/base/types.h>
22 
23 // Include FCST classes
24 #include <layers/catalyst_layer.h>
25 #include <grid/geometries.h>
26 #include <boost/shared_ptr.hpp>
27 
28 //Include STL
29 #include <algorithm>
30 #include <math.h>
31 #include <memory>
32 
33 using namespace dealii;
34 
35 namespace FuelCellShop
36 {
37  namespace Layer
38  {
47  template <int dim>
49  public CatalystLayer<dim>
50  {
51  public:
52 
68  static const std::string concrete_name;
69 
71 
72 
79 
83  virtual ~ConventionalCL();
84 
86 
88 
89 
93  virtual inline void set_local_material_id(const unsigned int& id)
94  {
96  if (!epsilon_V.empty())
97  this->porosity = epsilon_V.at(this->local_material_id());
98  }
102  virtual void print_layer_properties() const;
103 
105  virtual void get_volume_fractions(std::map<std::string, double>& volume_fractions)
106  {
107  //Assert( mat_id != numbers::invalid_material_id, ExcMessage("Graded Catalyst Layers needs its material id.") );
108 
109  compute_volume_fraction();
110  volume_fractions["Solid"] = epsilon_S.at(this->local_material_id());
111  volume_fractions["Void"] = epsilon_V.at(this->local_material_id());
112  volume_fractions["Ionomer"] = epsilon_N.at(this->local_material_id());
113 
114  }
115 
124  virtual inline void get_loadings(std::map<std::string, double> & info)
125  {
126  //Assert( mat_id != numbers::invalid_material_id, ExcMessage("Graded/Homogeneous Catalyst Layers needs its material id.") );
127  info["V_Pt"] = V_Pt.at(this->local_material_id());
128  info["loading_N"] = loading_N.at(this->local_material_id());
129  info["IC_ratio"] = IC_ratio.at(this->local_material_id());
130  info["prc_Pt"] = prc_Pt.at(this->local_material_id());
131  };
132 
134  inline double get_V_Pt(const unsigned int mat_id = numbers::invalid_material_id) const
135  {
136  Assert( mat_id != numbers::invalid_material_id, ExcMessage("Graded/Homogeneous Catalyst Layers needs its material id.") );
137  // this is blah-blah return, change later
138  return V_Pt.at(this->local_material_id());
139  }
140 
146  virtual double get_active_area_Pt() const
147  {
148  //Assert( mat_id != numbers::invalid_material_id, ExcMessage("Graded Catalyst Layers needs its material id.") );
149  // this is blah-blah return, change later
150  return Av.at(this->local_material_id());
151  }
152 
154 
156 
162  virtual void effective_gas_diffusivity(const double&,
163  const double&,
164  double&) const;
165 
174  virtual void effective_gas_diffusivity(std::vector< Tensor<2,dim> >&) const;
184  virtual void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor<2,dim> > >&) const;
185 
195  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > >&) const;
196 
200  virtual void effective_electron_conductivity(double&) const;
201 
206  virtual void effective_electron_conductivity(Tensor<2,dim>&) const;
207 
213  virtual void derivative_effective_electron_conductivity(std::vector<double>&) const;
214 
218  virtual void effective_proton_conductivity(double&) const;
219  virtual void effective_proton_conductivity(std::vector<double>&) const;
225  virtual void derivative_effective_proton_conductivity(std::map< VariableNames, std::vector<double> >&) const;
226 
230  virtual void effective_water_diffusivity(double&) const;
231  virtual void effective_water_diffusivity(std::vector<double>&) const;
237  virtual void derivative_effective_water_diffusivity(std::map< VariableNames, std::vector<double> >&) const;
238 
242  virtual void effective_thermal_conductivity(double&) const;
246  virtual void effective_thermal_conductivity(std::vector< Tensor<2,dim> >&) const;
251  virtual void derivative_effective_thermal_conductivity(std::vector< Tensor<2,dim> >&) const;
252 
257  virtual void effective_thermoosmotic_diffusivity(std::vector<double>&) const;
263  virtual void derivative_effective_thermoosmotic_diffusivity(std::map< VariableNames, std::vector<double> >&) const;
264 
268  virtual void liquid_permeablity(std::vector< Tensor<2,dim> >&) const;
269 
275  virtual void derivative_liquid_permeablity(std::map< VariableNames, std::vector< Tensor<2,dim> > >&) const;
276 
277 
278 
279 
280 
281 
282 
283 
287  virtual void saturated_liquid_permeablity_PSD(double&) const;
288 
289  virtual void relative_liquid_permeability_PSD(std::vector< Tensor<2,dim> >&) const;
290 
291  virtual void derivative_relative_liquid_permeablity_PSD(std::vector< double >&) const;
292 
293  virtual void derivative_relative_liquid_permeablity_PSD(std::map< VariableNames, std::vector< Tensor<2,dim> > >&) const;
294 
295 
296 
297 
298 
299 
300 
301 
302 
306  virtual void pcapillary(std::vector<double>&) const;
307 
308  virtual void saturation_from_capillary_equation(std::vector<double>&) const;
309 
310  virtual void derivative_saturation_from_capillary_equation_PSD(std::vector<double>&) const;
314  virtual void dpcapillary_dsat(std::vector<double> &) const;
320  virtual void derivative_dpcapillary_dsat(std::map< VariableNames, std::vector<double> > &) const;
321 
326  virtual void interfacial_surface_area(std::vector<double>&) const;
332  virtual void derivative_interfacial_surface_area(std::map< VariableNames, std::vector<double> >&) const;
333 
338  virtual void interfacial_surface_area_PSD(std::vector<double>&) const;
344  virtual void derivative_interfacial_surface_area_PSD(std::vector<double>&) const;
345  virtual void derivative_interfacial_surface_area_PSD(std::map< VariableNames, std::vector<double> >&) const;
346 
348 
349  protected:
351 
352 
355  ConventionalCL(std::string name);
356 
399  void declare_parameters (const std::string& cl_section_name,
400  ParameterHandler &param) const;
401 
406  void initialize (ParameterHandler &param);
408 
411  void compute_volume_fraction();
412 
457  void compute_Av();
462  void derivative_effective_proton_conductivity_wrt_electrolyte_loading(double&) const;
463 
469  void derivative_volume_fractions(double &Depsilon_S,
470  double &Depsilon_V,
471  double &Depsilon_N) const;
472 
476  void get_method_transport_property_pores(std::string& method) const
477  {
478  method = method_eff_property_pores;
479  };
480 
484  void get_method_transport_property_electrolyte(std::string& method) const
485  {
486  method = method_eff_property_electrolyte;
487  };
488 
492  void get_method_transport_property_solid(std::string& method) const
493  {
494  method = method_eff_property_solid;
495  };
496 
503  inline double depsilon_S_cat_dprc_Pt(const double& V_Pt,
504  const double& prc_Pt) const
505  {
506  return -(V_Pt*1e-3)/(rho_c*pow(prc_Pt,2.0));
507  }
508 
515  inline double depsilon_S_cat_dVPt(const double& prc_Pt) const
516  {
517  return (1/rho_Pt + (1-prc_Pt)/(prc_Pt*rho_c))*(1e-3);
518  }
519 
526  inline double depsilon_V_cat_depsilon_S_cat() const
527  {
528  return -1;
529  }
530 
537  inline double depsilon_V_cat_depsilon_N_cat() const
538  {
539  return -1;
540  }
541 
542  //-- Composition
544  std::map< unsigned int, double> epsilon_N;
546  std::map< unsigned int, double> epsilon_V;
548  std::map< unsigned int, double> epsilon_S;
550  std::map< unsigned int, double> epsilon_W;
551 
552  //-- Catalyst properties
554  double rho_Pt;
556  double rho_c;
558  std::map< unsigned int, double> prc_Pt;
560  std::map< unsigned int, double> V_Pt;
562  std::map< unsigned int, double> M_Pt;
564  std::map< unsigned int, double> Av;
566  std::string method_Av;
568  std::string method_porosity;
570  std::map< unsigned int, double> L_CL;
571 
572  //-- Electrolyte properties
574  double rho_N;
579  std::map< unsigned int, double> loading_N;
584  std::map< unsigned int, double> IC_ratio;
585 
587  std::map< unsigned int, double> prc_N;
588 
589  // Network characteristics
593  double porosity_th;
595  double porosity_mu;
598 
602  double solid_th;
604  double solid_mu;
611 
612 
614  std::string method_eff_thermal;
616  std::map< unsigned int, double> k_T;
617 
621  std::map< unsigned int, double> s_irr;
623  std::map< unsigned int, double> abs_permeability;
624 
627 
628 
629 
630 
631 
632 
633 
634 
635 
636 
637  };
638  }
639 }
640 
641 #endif
std::string method_eff_property_pores
Method used to compute effective properties – Type of network.
Definition: conventional_CL.h:591
void get_method_transport_property_pores(std::string &method) const
Get the effective transport method in the pores.
Definition: conventional_CL.h:476
std::map< unsigned int, double > k_T
Thermal Conductivity of the layer.
Definition: conventional_CL.h:616
std::string method_eff_property_solid
Method used to compute effective properties – Type of network.
Definition: conventional_CL.h:600
std::map< unsigned int, double > V_Pt
Platinum loading at the catalyst layer per unit volume.
Definition: conventional_CL.h:560
std::map< unsigned int, double > IC_ratio
Ionomer to carbon ratio.
Definition: conventional_CL.h:584
double depsilon_S_cat_dVPt(const double &prc_Pt) const
Inline function to compute .
Definition: conventional_CL.h:515
virtual double get_active_area_Pt() const
Get the active area of platinum per unit volume of CL.
Definition: conventional_CL.h:146
std::map< unsigned int, double > epsilon_N
Volume fraction of Nafion in the cathode catalyst layer.
Definition: conventional_CL.h:544
double porosity_gamma
Definition: conventional_CL.h:597
std::map< unsigned int, double > epsilon_S
Solid volume fraction in the catalyst layer.
Definition: conventional_CL.h:548
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
std::string method_porosity
Method to compute porosity.
Definition: conventional_CL.h:568
double get_V_Pt(const unsigned int mat_id=numbers::invalid_material_id) const
Return the platinum loading per cm3 catalyst layer.
Definition: conventional_CL.h:134
std::map< unsigned int, double > prc_N
Percentage (mass fraction) of electrolyte in the catalyst layer.
Definition: conventional_CL.h:587
std::map< unsigned int, double > prc_Pt
Percentage of platinum per carbon on the catalyst layer.
Definition: conventional_CL.h:558
double rho_c
Density of support material.
Definition: conventional_CL.h:556
std::map< unsigned int, double > epsilon_W
Volume fraction of water in the cathode catalyst layer.
Definition: conventional_CL.h:550
double solid_mu
Solid phase network constant.
Definition: conventional_CL.h:604
virtual void get_volume_fractions(std::map< std::string, double > &volume_fractions)
Get the volume fractions in the catalyst layer.
Definition: conventional_CL.h:105
std::string method_eff_thermal
Method used to compute effective thermal conductivity in the catalyst layer.
Definition: conventional_CL.h:614
double porosity_th
Porous network threshold.
Definition: conventional_CL.h:593
std::map< unsigned int, double > epsilon_V
Void volume fraction (Porosity) of the catalyst layer.
Definition: conventional_CL.h:546
double depsilon_V_cat_depsilon_S_cat() const
Inline function to compute .
Definition: conventional_CL.h:526
This class characterizes a catalyst layer and uses this information to compute effective transport pr...
Definition: conventional_CL.h:48
std::string method_capillary_function
Method used to compute capillary pressure as a function of saturation.
Definition: conventional_CL.h:626
virtual void set_local_material_id(const unsigned int &id)
Re-implementation of the parent set_local_material_id class to initialize the porosity variable to th...
Definition: conventional_CL.h:93
std::map< unsigned int, double > s_irr
Irreducible liquid water saturation value in the MPL.
Definition: conventional_CL.h:621
double depsilon_S_cat_dprc_Pt(const double &V_Pt, const double &prc_Pt) const
Inline function to compute .
Definition: conventional_CL.h:503
std::map< unsigned int, double > Av
Active area of catalyst per unit volume of catalyst layer.
Definition: conventional_CL.h:564
double solid_th
Solid phase network threshold.
Definition: conventional_CL.h:602
double depsilon_V_cat_depsilon_N_cat() const
Inline function to compute .
Definition: conventional_CL.h:537
virtual void set_local_material_id(const unsigned int &id)
Function for setting local material id, for unit testing purposes.
Definition: base_layer.h:85
double rho_Pt
Density of platinum.
Definition: conventional_CL.h:554
virtual void get_loadings(std::map< std::string, double > &info)
Return loadings.
Definition: conventional_CL.h:124
std::map< unsigned int, double > L_CL
Layer thickness or thicknesses.
Definition: conventional_CL.h:570
double porosity_mu
Porous network constant.
Definition: conventional_CL.h:595
std::map< unsigned int, double > loading_N
Electrolyte loading.
Definition: conventional_CL.h:579
static const std::string concrete_name
FcstUtilities Concrete name used for objects of this class.
Definition: conventional_CL.h:68
std::string method_Av
Method to compute active area.
Definition: conventional_CL.h:566
double rho_N
Density of electrolyte.
Definition: conventional_CL.h:574
double electrolyte_mu
Electrolyte network constant.
Definition: conventional_CL.h:610
std::map< unsigned int, double > abs_permeability
Absolute permeability [cm^2] of the layer.
Definition: conventional_CL.h:623
std::string method_eff_property_electrolyte
Method used to compute effective properties – Type of network.
Definition: conventional_CL.h:606
double electrolyte_th
Electrolyte network threshold.
Definition: conventional_CL.h:608
std::string method_rel_liquid_permeability
Method used to compute the relative liquid permeability.
Definition: conventional_CL.h:619
void get_method_transport_property_solid(std::string &method) const
Get the effective transport method in the solid phase.
Definition: conventional_CL.h:492
Virtual class used to provide the interface for all CatalystLayer children.
Definition: catalyst_layer.h:124
void get_method_transport_property_electrolyte(std::string &method) const
Get the effective transport method in the electrolyte.
Definition: conventional_CL.h:484
std::map< unsigned int, double > M_Pt
Platinum loading at the catalyst layer per unit area.
Definition: conventional_CL.h:562