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 1460 2013-08-30 22:28:49Z madhur $
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 
138 
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 
190  virtual void effective_gas_diffusivity(const double& property,
191  double& effective_property) const;
192 
198  virtual void effective_gas_diffusivity(const double& property,
199  Tensor<2,dim>& effective_property) const;
200 
211  virtual void effective_gas_diffusivity(Table< 2, Tensor< 2, dim > > &D_eff) const;
217  virtual void effective_electron_conductivity(double& ) const;
218 
224  virtual void effective_electron_conductivity(Tensor<2,dim>& ) const;
225 
232  virtual void effective_transport_property_solid(const double& property,
233  double& effective_property) const;
234 
241  virtual void effective_transport_property_solid(const Tensor<2,dim>& property,
242  Tensor<2,dim>& effective_property) const;
243 
245 
246  protected:
248 
249 
255  void declare_parameters (const std::string& mpl_section_name,
256  ParameterHandler &param) const;
257 
258 
263  void set_parameters (const std::vector<std::string>& name_dvar,
264  const std::vector<double>& value_dvar,
265  const std::string& name,
266  ParameterHandler &param) const
267  {
268  const std::type_info& info = typeid(*this);
269  deallog << "Pure function " << __FUNCTION__
270  << " called in Class "
271  << info.name() << std::endl;
272  }
274 
276 
277  virtual boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > create_replica (const std::string &name)
278  {
279  return boost::shared_ptr<FuelCellShop::Layer::MicroPorousLayer<dim> > (new FuelCellShop::Layer::DesignMPL<dim> (name));
280  }
281 
285  static DesignMPL<dim> const* PROTOTYPE;
286 
287 
289 
291 
292 
293  //--------------------------
297  double porosity;
299  double solid_phase;
308  //----------------------
311  std::vector<double> porosity_th;
313  std::vector<double> porosity_mu;
315  std::vector<double> porosity_gamma;
317  std::vector<double> D_O2;
319  std::vector<double> D_wv;
321  std::vector<double> fibre_th;
323  std::vector<double> fibre_mu;
325  };
326  }
327 } // FuelCellShop
328 
329 #endif // _FUELCELLSHOP__DESIGN_MPL_H