OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dummy_CL.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2015 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: dummy_CL.h
11 // - Description: This class characterizes a conventional catalyst layer
12 // and defines constant effective properties
13 // - Developers: Marc Secanell and Madhur Bhaiya
14 // - Id: $Id$
15 //
16 // ----------------------------------------------------------------------------
17 
18 #ifndef _FUELCELLSHOP__DUMMY_CL__H
19 #define _FUELCELLSHOP__DUMMY_CL__H
20 
21 // Include deal.II classes
22 #include<base/parameter_handler.h>
23 #include<base/point.h>
24 #include <base/function.h>
25 #include <lac/vector.h>
26 #include <fe/fe_values.h>
27 
28 // Include FCST classes
29 #include "fcst_units.h"
30 #include "catalyst_layer.h"
31 #include "base_kinetics.h"
32 
33 //Include STL
34 #include<cmath>
35 #include<iostream>
36 
37 
38 namespace FuelCellShop
39 {
40  namespace Layer
41  {
52  template <int dim>
53  class DummyCL :
54  public CatalystLayer<dim>
55  {
56  public:
57 
58 
74  static const std::string concrete_name;
75 
76 
78 
79 
84  DummyCL();
85 
89  ~DummyCL();
90 
96  virtual void declare_parameters (ParameterHandler &param) const
97  {
98  declare_parameters(this->name, param);
99  };
100 
105  virtual void initialize (ParameterHandler &param);
107 
109 
110 
116  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > >&) const;
117 
121  virtual void effective_electron_conductivity(double& ) const;
122 
126  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const;
127 
134  virtual void effective_proton_conductivity(double& ) const;
135 
140  virtual void effective_proton_conductivity(std::vector<double>& ) const;
141 
147  virtual void derivative_effective_proton_conductivity(std::map< VariableNames, std::vector<double> >& ) const;
148 
149 
151  inline double get_active_area_Pt() const
152  {
153  return Av.at(this->local_material_id());
154  }
156  void set_cell_id(const unsigned int& ){}
157 
162  virtual void current_density(std::vector<double>&);
167  virtual void derivative_current_density(std::map< VariableNames, std::vector<double> >& );
172  virtual void current_density(std::vector<double>& current, std::vector<double>& effectiveness)
173  {
174  current_density(current);
175  effectiveness.assign(current.size(), 1.0);
176  }
177 
179  private:
181 
182 
185  DummyCL(const std::string& name);
186 
191  void declare_parameters (const std::string& name,
192  ParameterHandler &param) const
193  {
194 
196 
197  param.enter_subsection("Fuel cell data");
198  {
199  param.enter_subsection(name);
200  {
201  param.enter_subsection(concrete_name); //-- Transport for the anisotropic case:
202  {
203  param.declare_entry ("Oxygen diffusion coefficient, [cm^2/s]",
204  "4:0.02514", //1atm, 353K
205  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
206  "Oxygen diffusion coefficient given by experiment");
207  param.declare_entry ("Water vapour diffusion coefficient, [cm^2/s]",
208  "4:0.29646",
209  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
210  "Water vapour diffusion coefficient given by experiment");
211  param.declare_entry ("Electrical conductivity, [S/cm]",
212  "4:40", // [S/cm]
213  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
214  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
215  param.declare_entry ("Protonic conductivity, [S/cm]",
216  "4:40", // [S/cm]
217  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
218  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
219  param.declare_entry ("Active area [cm^2/cm^3]",
220  "4:2.0e5",
221  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0)));
222  }
223  param.leave_subsection();
224 
225  }
226  param.leave_subsection();
227  }
228  param.leave_subsection();
229 
230  }
231 
232 
234 
236 
237 
242  virtual boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > create_replica (const std::string &name)
243  {
244  return boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > (new FuelCellShop::Layer::DummyCL<dim> (name));
245  }
249  static DummyCL<dim> const* PROTOTYPE;
251 
253 
254 
255  std::map< unsigned int, double > D_O2;
257  std::map< unsigned int, double > D_wv;
259  std::map< unsigned int, double > sigma_e;
261  std::map< unsigned int, double > sigma_m;
263  std::map< unsigned int, double > Av;
265  };
266  }
267 }
268 
269 #endif
virtual void current_density(std::vector< double > &)
This member function will use a FuelCellShop::Kinetics class in order to compute the current density ...
void set_cell_id(const unsigned int &)
This routine is not used for this layer.
Definition: dummy_CL.h:156
DummyCL()
Prototype Constructor.
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: dummy_CL.h:74
virtual void effective_proton_conductivity(double &) const
Compute the effective proton conductivity in the CL.
virtual void current_density(std::vector< double > &current, std::vector< double > &effectiveness)
This member function computes the current density production in the CL.
Definition: dummy_CL.h:172
void declare_parameters(const std::string &name, ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: dummy_CL.h:191
std::map< unsigned int, double > D_O2
Oxygen diffusion coefficient.
Definition: dummy_CL.h:255
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
virtual void declare_parameters(const std::string &name, ParameterHandler &param) const
Default virtual declare parameters for a parameter file.
const std::string name
Name of the layer.
Definition: base_layer.h:336
virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &) const
Compute the effective diffusivty in the CL.
virtual void derivative_current_density(std::map< VariableNames, std::vector< double > > &)
This member function will use a FuelCellShop::Kinetics class in order to compute the derivative of th...
std::map< unsigned int, double > Av
Active area of catalyst per unit volume of catalyst layer.
Definition: dummy_CL.h:263
virtual void derivative_effective_proton_conductivity(std::map< VariableNames, std::vector< double > > &) const
Compute the derivative of the effective proton conductivity in the CL with respect to either the solu...
This class characterizes a macro-homogeneous catalyst layer and should be used in the case of constan...
Definition: dummy_CL.h:53
double get_active_area_Pt() const
Get the active area of platinum per unit volume of CL.
Definition: dummy_CL.h:151
static DummyCL< dim > const * PROTOTYPE
Definition: dummy_CL.h:249
virtual void declare_parameters(ParameterHandler &param) const
Declare all necessary parameters in order to compute the coefficients.
Definition: dummy_CL.h:96
std::map< unsigned int, double > sigma_e
Solid network conductivity.
Definition: dummy_CL.h:259
virtual boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > create_replica(const std::string &name)
This member function is used to create an object of type gas diffusion layer.
Definition: dummy_CL.h:242
std::map< unsigned int, double > sigma_m
Membrane phase conductivity.
Definition: dummy_CL.h:261
unsigned int local_material_id() const
Return the local material id of the layer, performs a check.
Definition: base_layer.h:215
std::map< unsigned int, double > D_wv
Water vapour diffusion coefficient.
Definition: dummy_CL.h:257
virtual void initialize(ParameterHandler &param)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Virtual class used to provide the interface for all CatalystLayer children.
Definition: catalyst_layer.h:130
virtual void effective_electron_conductivity(double &) const
Compute the effective electron conductivity in the CL.