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-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: dummy_cl.h
11 // - Description: Class characterizing the conventional catalyst layer and defining constant effective properties
12 // - Developers: Marc Secanell and Madhur Bhaiya
13 // - $Id: dummy_CL.h 1373 2013-08-21 00:34:53Z madhur $
14 //
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;
154  }
155 
160  virtual void current_density(std::vector<double>&);
165  virtual void derivative_current_density(std::map< VariableNames, std::vector<double> >& );
170  virtual void current_density(std::vector<double>& current, std::vector<double>& effectiveness)
171  {
172  current_density(current);
173  effectiveness.assign(current.size(), 1.0);
174  }
175 
177  private:
179 
180 
183  DummyCL(const std::string& name);
184 
189  void declare_parameters (const std::string& name,
190  ParameterHandler &param) const
191  {
192 
194 
195  param.enter_subsection("Fuel cell data");
196  {
197  param.enter_subsection(name);
198  {
199  param.enter_subsection(concrete_name); //-- Transport for the anisotropic case:
200  {
201  param.declare_entry ("Oxygen diffusion coefficient, [cm^2/s]",
202  "0.02514", //1atm, 353K
203  Patterns::Double(),
204  "Oxygen diffusion coefficient given by experiment");
205  param.declare_entry ("Water vapour diffusion coefficient, [cm^2/s]",
206  "0.29646",
207  Patterns::Double(),
208  "Water vapour diffusion coefficient given by experiment");
209  param.declare_entry ("Electrical conductivity, [S/cm]",
210  "40", // [S/cm]
211  Patterns::Double(),
212  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
213  param.declare_entry ("Protonic conductivity, [S/cm]",
214  "40", // [S/cm]
215  Patterns::Double(),
216  "Effective cond. if given is used, otherwise conductivity of the raw material. Units [S/cm]");
217  param.declare_entry ("Active area [cm^2/cm^3]",
218  "2.0e5",
219  Patterns::Double());
220  }
221  param.leave_subsection();
222 
223  }
224  param.leave_subsection();
225  }
226  param.leave_subsection();
227 
228  }
229 
233  void set_parameters (const std::vector<std::string>& name_dvar,
234  const std::vector<double>& value_dvar,
235  const std::string& cl_section_name,
236  ParameterHandler &param) const;
237 
239 
241 
242 
247  virtual boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > create_replica (const std::string &name)
248  {
249  return boost::shared_ptr<FuelCellShop::Layer::CatalystLayer<dim> > (new FuelCellShop::Layer::DummyCL<dim> (name));
250  }
254  static DummyCL<dim> const* PROTOTYPE;
256 
258 
259 
260  double D_O2;
262  double D_wv;
264  double sigma_e;
266  double sigma_m;
268  double Av;
270  };
271  }
272 }
273 
274 #endif