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 //-- OpenFCST
25 
26 #include <materials/PureGas.h>
27 #include <materials/GasMixture.h>
28 #include <materials/platinum.h>
29 #include <materials/nafion.h>
30 #include <materials/carbon.h>
31 
34 #include <layers/catalyst_layer.h>
35 
42 
43 using namespace dealii;
44 using namespace FuelCell::ApplicationCore;
45 
46 namespace FuelCell
47 {
48  //---------------------------------------------------------------------------
49  //---------------------------------------------------------------------------
50  //---------------------------------------------------------------------------
51  namespace Application
52  {
139  template<int dim>
141  {
142  public:
143 
145 
146 
150  AppCathode( boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
151  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >() );
152 
156  ~AppCathode();
157 
161  virtual void declare_parameters(ParameterHandler& param);
162 
166  virtual void initialize(ParameterHandler& param);
167 
173  virtual void initialize_solution (FEVector& initial_guess,
174  std::shared_ptr<Function<dim> > initial_function = std::shared_ptr<Function<dim> >());
175 
177 
179 
180 
184  virtual void cell_matrix(MatrixVector& cell_matrices,
185  const typename DoFApplication<dim>::CellInfo& cell_info);
186 
190  virtual void cell_residual(FuelCell::ApplicationCore::FEVector& cell_res,
191  const typename DoFApplication<dim>::CellInfo& cell_info);
192 
194 
196 
197 
201  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
202 
206  virtual double evaluate (const FuelCell::ApplicationCore::FEVectors& src);
207 
211  virtual void data_out(const std::string& filename,
212  const FEVectors& src);
213 
215 
217 
218 
222  virtual void cell_responses(std::vector<double>& dst,
223  const typename DoFApplication<dim>::CellInfo& cell_info,
224  const FEVector&);
228  void global_responses(std::vector<double>& resp,
229  const FuelCell::ApplicationCore::FEVector& /*src*/);
230 
232 
233  protected:
235 
236 
239  boost::shared_ptr< FuelCellShop::Geometry::GridBase<dim> > grid;
241 
242 
243 
245 
246 
250 
261 
263 
264 
267  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > CGDL;
268 
272  boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer<dim> > CMPL;
273 
277  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > CCL;
278 
282  bool anode;
284 
286 
287 
295 
302 
309 
316 
318 
322 
323 
324 
325  private:
329  virtual void cell_responses_aux(std::vector<double>& dst,
330  const typename DoFApplication<dim>::CellInfo& cell_info,
331  const FEVector&);
332 
338  void set_default_parameters_for_application(ParameterHandler &param)
339  {
340  param.enter_subsection("System management");
341  {
342  param.set("Number of solution variables","3");
343  param.enter_subsection("Solution variables");
344  {
345  param.set("Solution variable 1","oxygen_molar_fraction");
346  param.set("Solution variable 2","protonic_electrical_potential");
347  param.set("Solution variable 3","electronic_electrical_potential");
348  }
349  param.leave_subsection();
350 
351  param.enter_subsection("Equations");
352  {
353  param.set("Equation 1","Ficks Transport Equation - oxygen");
354  param.set("Equation 2","Proton Transport Equation");
355  param.set("Equation 3","Electron Transport Equation");
356  }
357  param.leave_subsection();
358  }
359  param.leave_subsection();
360  param.enter_subsection("Discretization");
361  {
362  param.set("Element","FESystem[FE_Q(1)^3]");
363  }
364  param.leave_subsection();
365  }
366 
367  };
368 
369  } // Application
370 
371 } // FuelCell
372 
373 #endif
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:118
FuelCellShop::Equation::ReactionSourceTerms< dim > reaction_source_terms
The reaction source terms for all underlying equations.
Definition: app_cathode.h:314
FuelCellShop::Equation::FicksTransportEquation< dim > ficks_transport_equation_cathode
Definition: app_cathode.h:293
This class deals with Proton Transport Equation.
Definition: proton_transport_equation.h:132
Class used to calculate the current density at the anode catalyst layer.
Definition: response_current_density.h:180
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > CGDL
Cathode GDL.
Definition: app_cathode.h:267
This class deals with Electron Transport Equation.
Definition: electron_transport_equation.h:128
FuelCellShop::PostProcessing::ORRCurrentDensityResponse< dim > ORRCurrent
Definition: app_cathode.h:319
FuelCell::OperatingConditions OC
Operating conditions.
Definition: app_cathode.h:249
FuelCellShop::Equation::FicksTransportEquation< dim > * ficks_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:292
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
This class describes properties of pure oxygen.
Definition: PureGas.h:974
FuelCellShop::Equation::ProtonTransportEquation< dim > proton_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:308
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:338
FuelCellShop::Material::Nitrogen solvent
Solvent.
Definition: app_cathode.h:259
This class describes properties of pure nitrogen.
Definition: PureGas.h:1027
boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > CCL
Cathode CL.
Definition: app_cathode.h:277
FuelCellShop::PostProcessing::HORCurrentDensityResponse< dim > HORCurrent
Definition: app_cathode.h:320
bool anode
Run an anode instead of a cathode:
Definition: app_cathode.h:282
This class assembles the reaction source terms for all other transport equations, if there&#39;s any...
Definition: reaction_source_terms.h:37
FuelCellShop::Equation::ElectronTransportEquation< dim > electron_transport_equation
This object describes the equations that we are going to solve here.
Definition: app_cathode.h:301
boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer< dim > > CMPL
Cathode MPL.
Definition: app_cathode.h:272
This class is used to solve a system of equations similar to the one presented in the journal article...
Definition: app_cathode.h:140
FuelCellShop::Material::Oxygen solute
Solute.
Definition: app_cathode.h:254
boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > grid
Grid.
Definition: app_cathode.h:239
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
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:49
This class deals with Fick&#39;s Transport Equation.
Definition: ficks_transport_equation.h:132
FuelCellShop::Equation::FicksTransportEquation< dim > ficks_transport_equation_anode
Definition: app_cathode.h:294
This class describes properties of pure hydrogen.
Definition: PureGas.h:1081
Class used to calculate the ORR current density and coverages (if provided in the kinetic model) by t...
Definition: response_current_density.h:59
FuelCellShop::Material::Hydrogen solute_anode
Definition: app_cathode.h:255