OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_ohmic.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: app_ohmic.cc
11 // - Description:
12 // - Developers: M. Sabharwal, M. Secanell
13 // - $Id: app_diffusion.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELL__APP_OHMIC__H
18 #define _FUELCELL__APP_OHMIC__H
19 
20 // Include deal.II classes
21 #include "base/parameter_handler.h"
22 #include "base/function_lib.h"
23 #include "base/function.h"
24 #include "base/quadrature_lib.h"
25 
26 #include "lac/block_vector.h"
27 #include "lac/full_matrix.h"
28 #include "lac/solver_cg.h"
29 #include "lac/solver_gmres.h"
30 #include "lac/precondition.h"
31 #include "lac/precondition_block.h"
32 #include "lac/block_matrix_array.h"
33 #include "lac/sparse_ilu.h"
34 #include "lac/sparse_direct.h"
35 
36 #include "grid/grid_generator.h"
37 #include "grid/tria_accessor.h"
38 #include "grid/tria_iterator.h"
39 #include "grid/tria_boundary_lib.h"
40 
41 #include "fe/fe_values.h"
42 
43 #include "numerics/vector_tools.h"
44 #include "numerics/matrix_tools.h"
45 
46 #include "boost/shared_ptr.hpp"
47 
48 // Include appframe classes
50 
51 // Include FuelCell classes
52 #include "fcst_constants.h"
54 #include "solver_utils.h"
55 
56 #include "operating_conditions.h"
57 #include "geometries.h"
58 
59 #include "PureGas.h"
60 #include "GasMixture.h"
61 #include "platinum.h"
62 #include "nafion.h"
63 #include "carbon.h"
64 
65 #include "gas_diffusion_layer.h"
66 
67 
69 
70 
71 #include "linear_solvers.h"
72 
73 #include "data_out.h"
74 
75 
76 //Include STL
77 #include "fstream"
78 #include "iostream"
79 #include "sstream"
80 #include <algorithm>
81 
82 // Use namespace of deal.II
83 using namespace dealii;
84 
85 namespace FuelCell
86 {
87 
88  namespace Application
89  {
90  //---------------------------------------------------------------------------
91  //---------------------------------------------------------------------------
92  //---------------------------------------------------------------------------
135  template<int dim>
137  {
138  public:
139 
141 
142 
146  AppOhmic( boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
147  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >() );
148 
152  ~AppOhmic();
153 
157  virtual void declare_parameters(ParameterHandler& param);
158 
162  virtual void initialize(ParameterHandler& param);
163 
167  virtual void initialize_solution (FEVector& initial_guess,
168  std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
169 
171 
173 
174 
178  virtual void cell_matrix(MatrixVector& cell_matrices,
179  const typename DoFApplication<dim>::CellInfo& cell_info);
180 
184  virtual void cell_residual(FuelCell::ApplicationCore::FEVector& cell_res,
185  const typename DoFApplication<dim>::CellInfo& cell_info);
186 
188 
190 
191 
195  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
196 
200  virtual double evaluate (const FuelCell::ApplicationCore::FEVectors& src);
201 
205  virtual void data_out(const std::string& filename,
206  const FEVectors& src);
207 
209 
211 
212 
216  virtual void bdry_responses(std::vector<double>& dst,
220 
221  protected:
223 
224 
239 
241 
242 
246 
248 
250 
252 
254 
255 
258  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > CGDL;
259 
261 
263 
264 
270 
278  private:
284  };
285 
286  } // Application
287 
288 } // FuelCell
289 
290 #endif
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:110
This class deals with Electron Transport Equation.
Definition: electron_transport_equation.h:130
FuelCell::OperatingConditions OC
Operating conditions.
Definition: app_ohmic.h:245
FuelCellShop::Material::Nitrogen nitrogen
Definition: app_ohmic.h:249
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:625
This class describes properties of pure oxygen.
Definition: PureGas.h:980
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
The application can be used to simulate a electron transport through a porous media.
Definition: app_ohmic.h:136
This class describes properties of pure nitrogen.
Definition: PureGas.h:1039
FuelCellShop::Equation::ElectronTransportEquation< dim > electron_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_ohmic.h:269
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:39
The data type used in function calls of Application.
Definition: fe_vectors.h:59
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:62
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > CGDL
Cathode GDL.
Definition: app_ohmic.h:258
FuelCellShop::Material::Oxygen oxygen
Definition: app_ohmic.h:247