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 //
15 // ----------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__DUMMY_CL__H
18 #define _FUELCELLSHOP__DUMMY_CL__H
19 
20 // Include FCST classes
21 #include <utils/fcst_units.h>
22 #include <layers/catalyst_layer.h>
23 
24 
25 
26 namespace FuelCellShop
27 {
28  namespace Layer
29  {
40  template <int dim>
41  class DummyCL :
42  public CatalystLayer<dim>
43  {
44  public:
45 
46 
62  static const std::string concrete_name;
63 
64 
66 
67 
72  DummyCL();
73 
77  ~DummyCL();
78 
84  virtual void declare_parameters (ParameterHandler &param) const
85  {
86  declare_parameters(this->name, param);
87  };
88 
93  virtual void initialize (ParameterHandler &param);
95 
97 
98 
104  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > >&) const;
105 
106  void effective_gas_diffusivity(std::vector< Tensor<2,dim> >& prop_eff_vec) const;
107 
108  void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor<2,dim> > >&dprop_eff) const;
109 
113  virtual void effective_electron_conductivity(double& ) const;
114 
118  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const;
119 
126  virtual void effective_proton_conductivity(double& ) const;
127 
132  virtual void effective_proton_conductivity(std::vector<double>& ) const;
133 
139  virtual void derivative_effective_proton_conductivity(std::map< VariableNames, std::vector<double> >& ) const;
140 
141 
143  inline double get_active_area_Pt() const
144  {
145  return Av.at(this->local_material_id());
146  }
148  void set_cell_id(const unsigned int& ){}
149 
154  virtual void current_density(std::vector<double>&);
159  virtual void derivative_current_density(std::map< VariableNames, std::vector<double> >& );
164  virtual void current_density(std::vector<double>& current, std::vector<double>& effectiveness)
165  {
166  current_density(current);
167  effectiveness.assign(current.size(), 1.0);
168  }
169 
171  private:
173 
174 
177  DummyCL(const std::string& name);
178 
183  void declare_parameters (const std::string& name,
184  ParameterHandler &param) const
185  {
186 
188 
189  param.enter_subsection("Fuel cell data");
190  {
191  param.enter_subsection(name);
192  {
193  param.enter_subsection(concrete_name); //-- Transport for the anisotropic case:
194  {
195  param.declare_entry ("Oxygen diffusion coefficient, [cm^2/s]",
196  "4:0.02514", //1atm, 353K
197  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
198  "Oxygen diffusion coefficient given by experiment");
199  param.declare_entry ("Water vapour diffusion coefficient, [cm^2/s]",
200  "4:0.29646",
201  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
202  "Water vapour diffusion coefficient given by experiment");
203  param.declare_entry ("Electrical conductivity, [S/cm]",
204  "4:40", // [S/cm]
205  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
206  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
207  param.declare_entry ("Protonic conductivity, [S/cm]",
208  "4:40", // [S/cm]
209  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0) ),
210  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
211  param.declare_entry ("Active area [cm^2/cm^3]",
212  "4:2.0e5",
213  Patterns::Map( Patterns::Integer(0,255), Patterns::Double(0)));
214  }
215  param.leave_subsection();
216 
217  }
218  param.leave_subsection();
219  }
220  param.leave_subsection();
221 
222  }
223 
224 
226 
228 
229 
234  virtual boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > create_replica (const std::string &name)
235  {
236  return boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > (new FuelCellShop::Layer::DummyCL<dim> (name));
237  }
241  static DummyCL<dim> const* PROTOTYPE;
243 
245 
246 
247  std::map< unsigned int, double > D_O2;
249  std::map< unsigned int, double > D_wv;
251  std::map< unsigned int, double > sigma_e;
253  std::map< unsigned int, double > sigma_m;
255  std::map< unsigned int, double > Av;
257  };
258  }
259 }
260 
261 #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:148
DummyCL()
Prototype Constructor.
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: dummy_CL.h:62
void derivative_effective_gas_diffusivity(std::map< VariableNames, std::vector< Tensor< 2, dim > > > &dprop_eff) const
Return the derivative of effective diffusivity w.r.t solution variables/design parameters for nonisot...
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:164
void declare_parameters(const std::string &name, ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: dummy_CL.h:183
std::map< unsigned int, double > D_O2
Oxygen diffusion coefficient.
Definition: dummy_CL.h:247
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
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:255
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:41
double get_active_area_Pt() const
Get the active area of platinum per unit volume of CL.
Definition: dummy_CL.h:143
static DummyCL< dim > const * PROTOTYPE
Definition: dummy_CL.h:241
virtual void declare_parameters(ParameterHandler &param) const
Declare all necessary parameters in order to compute the coefficients.
Definition: dummy_CL.h:84
std::map< unsigned int, double > sigma_e
Solid network conductivity.
Definition: dummy_CL.h:251
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:234
std::map< unsigned int, double > sigma_m
Membrane phase conductivity.
Definition: dummy_CL.h:253
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:249
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:124
virtual void effective_electron_conductivity(double &) const
Compute the effective electron conductivity in the CL.