OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ficks_transport_equation.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2013 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: ficks_transport_equation.h
11 // - Description: Base Catalyst Layer Class. It implements the interface for other catalyst layer class
12 // and some common methods.
13 // - Developers: M. Secanell
14 // - $Id: ficks_transport_equation.h 1354 2013-08-17 00:01:22Z secanell $
15 //
16 //---------------------------------------------------------------------------
17 
18 #ifndef dimension
19 #if deal_II_dimension == 1
20 #define _1D_
21 #elif deal_II_dimension == 2
22 #define _2D_
23 #elif deal_II_dimension == 3
24 #define _3D_
25 #endif
26 #endif
27 
28 #ifndef _FCST_FUELCELLSHOP_EQUATION_FICKS_EQUATION_H_
29 #define _FCST_FUELCELLSHOP_EQUATION_FICKS_EQUATION_H_
30 
31 // FCST includes
32 #include "equation_base.h"
33 #include "fcst_constants.h"
34 #include "gas_diffusion_layer.h"
35 #include "SGL_24_BA.h"
36 #include "micro_porous_layer.h"
37 #include "SGL_24_BC.h"
38 #include "catalyst_layer.h"
39 
40 // Appframe includes
42 
43 // STD
44 #include <sstream>
45 #include <string>
46 
47 namespace FuelCellShop
48 {
49  namespace Equation
50  {
51 
63  template<int dim>
65  {
66  public:
67 
73 
80 
88  {
89  this->gas = solute;
90  this->solvent = solvent1;
91 
92  std::stringstream s;
93  s <<"Ficks Transport Equation - "<<gas->get_name();
94  this->name_equation = s.str();
95 
96  std::stringstream ss;
97  ss <<gas->get_name()<<"_molar_fraction";
98  this->name_solution = ss.str();
99  }
100 
104  virtual ~FicksTransportEquation();
105 
109  virtual void declare_parameters(ParameterHandler& param);
110 
114  virtual void initialize(ParameterHandler& param);
115 
119  virtual void assemble_cell_matrix(AppFrame::MatrixVector& cell_matrices,
120  const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info,
122 
126  virtual void assemble_bdry_matrix(AppFrame::MatrixVector& bdry_matrices,
127  const typename AppFrame::DoFApplication<dim>::FaceInfo& bdry_info,
128  FuelCellShop::Layer::BaseLayer<dim>* const layer){};
129 
133  virtual void assemble_cell_residual(AppFrame::FEVector& cell_rhs,
134  const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info,
136 
141  const typename AppFrame::DoFApplication<dim>::FaceInfo& bdry_info,
142  FuelCellShop::Layer::BaseLayer<dim>* const layer){};
143 
150  {
152  }
153 
158  virtual void print_equation_info() const;
159 
162  DeclException1(GasDoesNotExistInGDL,
163  std::string,
164  << "Gas " << arg1 << " does not exist in the Gas diffusion layer");
165 
171  void class_test();
172 
173  protected:
187  std::string name_equation;
192  std::string name_solution;
199  virtual void make_internal_cell_couplings();
200 
206 
214  std::vector<unsigned int> matrix_block_indices;
215 
223  std::vector<unsigned int> component_indices;
224  };
225 
226  } // Equation
227 
228 } // FuelCellShop
229 
230 #endif