OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_cathode.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2014 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_cathode.h
11 // - Description: This class describes diffusion in fuel cell cathodes
12 // Ficks, one gas
13 // - Developers: Marc Secanell, University of Alberta
14 // Valentin N. Zingan, University of Alberta
15 //
16 // ----------------------------------------------------------------------------
17 
18 #ifndef _FCST_APPLICATION_APP_CATHODE_H_
19 #define _FCST_APPLICATION_APP_CATHODE_H_
20 
21 #include "boost/shared_ptr.hpp"
22 
23 // Include FuelCell classes
24 #include "grid/geometry.h"
25 
27 #include "system_management.h"
28 
30 
31 #include "materials/PureGas.h"
32 #include "materials/GasMixture.h"
33 #include "materials/platinum.h"
34 #include "materials/nafion.h"
35 #include "materials/carbon.h"
36 
39 #include "layers/catalyst_layer.h"
40 
45 #include "solvers/linear_solvers.h"
47 
49 
50 using namespace dealii;
51 using namespace FuelCell::ApplicationCore;
52 
53 namespace FuelCell
54 {
55  //---------------------------------------------------------------------------
56  //---------------------------------------------------------------------------
57  //---------------------------------------------------------------------------
58  namespace Application
59  {
146  template<int dim>
148  {
149  public:
150 
152 
153 
157  AppCathode( boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
158  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >() );
159 
163  ~AppCathode();
164 
168  virtual void declare_parameters(ParameterHandler& param);
169 
173  virtual void initialize(ParameterHandler& param);
174 
180  virtual void initialize_solution (FEVector& initial_guess,
181  std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
182 
184 
186 
187 
191  virtual void cell_matrix(MatrixVector& cell_matrices,
192  const typename DoFApplication<dim>::CellInfo& cell_info);
193 
197  virtual void cell_residual(FuelCell::ApplicationCore::FEVector& cell_res,
198  const typename DoFApplication<dim>::CellInfo& cell_info);
199 
201 
203 
204 
208  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
209 
213  virtual double evaluate (const FuelCell::ApplicationCore::FEVectors& src);
214 
218  virtual void data_out(const std::string& filename,
219  const FEVectors& src);
220 
222 
224 
225 
229  virtual void cell_responses(std::vector<double>& dst,
230  const typename DoFApplication<dim>::CellInfo& cell_info,
231  const FEVector&);
235  void global_responses(std::vector<double>& resp,
236  const FuelCell::ApplicationCore::FEVector& /*src*/);
237 
239 
240  protected:
242 
243 
246  boost::shared_ptr< FuelCellShop::Geometry::GridBase<dim> > grid;
248 
249 
250 
252 
253 
257 
262 
267 
269 
271 
272 
275  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > CGDL;
276 
280  boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer<dim> > CMPL;
281 
285  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > CCL;
287 
289 
290 
296 
303 
310 
317 
319 
322 
323  private:
327  virtual void cell_responses_aux(std::vector<double>& dst,
328  const typename DoFApplication<dim>::CellInfo& cell_info,
329  const FEVector&);
330 
336  void set_default_parameters_for_application(ParameterHandler &param)
337  {
338  param.enter_subsection("System management");
339  {
340  param.set("Number of solution variables","3");
341  param.enter_subsection("Solution variables");
342  {
343  param.set("Solution variable 1","oxygen_molar_fraction");
344  param.set("Solution variable 2","protonic_electrical_potential");
345  param.set("Solution variable 3","electronic_electrical_potential");
346  }
347  param.leave_subsection();
348 
349  param.enter_subsection("Equations");
350  {
351  param.set("Equation 1","Ficks Transport Equation - oxygen");
352  param.set("Equation 2","Proton Transport Equation");
353  param.set("Equation 3","Electron Transport Equation");
354  }
355  param.leave_subsection();
356  }
357  param.leave_subsection();
358  param.enter_subsection("Discretization");
359  {
360  param.set("Element","FESystem[FE_Q(1)^3]");
361  }
362  param.leave_subsection();
363  }
364 
365  };
366 
367  } // Application
368 
369 } // FuelCell
370 
371 #endif
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:110
FuelCellShop::Equation::ReactionSourceTerms< dim > reaction_source_terms
The reaction source terms for all underlying equations.
Definition: app_cathode.h:315
This class deals with Proton Transport Equation.
Definition: proton_transport_equation.h:138
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > CGDL
Cathode GDL.
Definition: app_cathode.h:275
This class deals with Electron Transport Equation.
Definition: electron_transport_equation.h:130
FuelCellShop::PostProcessing::ORRCurrentDensityResponse< dim > ORRCurrent
Definition: app_cathode.h:320
FuelCell::OperatingConditions OC
Operating conditions.
Definition: app_cathode.h:256
This class deals with Ficks Transport Equation.
Definition: new_ficks_transport_equation.h:132
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
FuelCellShop::Equation::ProtonTransportEquation< dim > proton_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:309
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
void set_default_parameters_for_application(ParameterHandler &param)
Function to modify the default values of the data file in order to make sure that the equations match...
Definition: app_cathode.h:336
FuelCellShop::Material::Nitrogen solvent
Solvent.
Definition: app_cathode.h:266
This class describes properties of pure nitrogen.
Definition: PureGas.h:1039
boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > CCL
Cathode CL.
Definition: app_cathode.h:285
This class assembles the reaction source terms for all other transport equations, if there&#39;s any...
Definition: reaction_source_terms.h:60
FuelCellShop::Equation::NewFicksTransportEquation< dim > ficks_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:295
FuelCellShop::Equation::ElectronTransportEquation< dim > electron_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:302
boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer< dim > > CMPL
Cathode MPL.
Definition: app_cathode.h:280
This class is used to solve a system of equations similar to the one presented in the journal article...
Definition: app_cathode.h:147
FuelCellShop::Material::Oxygen solute
Solute.
Definition: app_cathode.h:261
boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > grid
Grid.
Definition: app_cathode.h:246
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
Class used to calculate the ORR current density and coverages (if provided in the kinetic model) by t...
Definition: response_current_density.h:74