OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_cathode_KG.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2015 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_KG.h
11 // - Description: This class solves
12 // - steady-state
13 // - compressible
14 // - isothermal
15 // Kerkhof-Geboers fluid transport equations for a
16 // - single-phase
17 // - multi-component
18 // case coupled with
19 // - electron transport equation
20 // - proton transport equation
21 // in a fuel cell cathode
22 // - Developers: Valentin N. Zingan, University of Alberta
23 //
24 // -----------------------------------------------------------------------------------
25 
26 #ifndef _FCST_APPLICATION_APP_CATHODE_KG_H_
27 #define _FCST_APPLICATION_APP_CATHODE_KG_H_
28 //-- dealII
29 #include <deal.II/base/function_parser.h>
30 //-- OpenFCST
38 #include <utils/scaling.h> // For scaling equations and residuals to help with convergence with MUMPS
42 #include <postprocessing/response_mass_flux.h> //For calculating the mass flux at a boundary
43 
44 using namespace dealii;
45 using namespace FuelCell::ApplicationCore;
46 
47 namespace FuelCell
48 {
49  namespace Application
50  {
51 
68  template<int dim>
70  {
71  public:
72 
74 
75 
79  AppCathodeKG( boost::shared_ptr<ApplicationData> data = boost::shared_ptr<ApplicationData>() );
80 
84  ~AppCathodeKG();
85 
89  virtual void declare_parameters(ParameterHandler& param);
90 
94  virtual void initialize(ParameterHandler& param);
95 
101  virtual void initialize_solution(FEVector& initial_guess,
102  std::shared_ptr< Function<dim> > function = std::shared_ptr< Function<dim> >());
103 
105 
107 
108 
112  virtual void cell_matrix(MatrixVector& cell_matrices,
113  const typename DoFApplication<dim>::CellInfo& cell_info);
114 
118  virtual void cell_residual(FEVector& cell_res,
119  const typename DoFApplication<dim>::CellInfo& cell_info);
120 
124  virtual void bdry_matrix(MatrixVector& bdry_matrices,
125  const typename DoFApplication<dim>::FaceInfo& bdry_info);
126 
130  virtual void bdry_residual(FEVector& bdry_res,
131  const typename DoFApplication<dim>::FaceInfo& bdry_info);
132 
134 
136 
137 
141  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
142 
144 
146 
147 
151  virtual void data_out(const std::string& filename,
152  const FEVectors& src);
153 
157  virtual void cell_responses(std::vector<double>& dst,
158  const typename DoFApplication<dim>::CellInfo& cell_info,
159  const FEVector& aux);
160 
164  virtual void bdry_responses(std::vector<double>& dst,
167 
169 
170  protected:
171 
173 
174 
180  void make_variable_boundary_data(FEVector& initial_guess);
181 
186 
190  bool applyScaling = false;
191 
193 
195 
196 
200 
204  std::map<unsigned int, std::string> gasSpeciesMap;
205 
209  std::string oxygen_density_name;
210 
215 
220  void set_gas_species(std::map<unsigned int, std::string> tmp, std::vector< FuelCellShop::Material::PureGas* >& gases);
222 
224 
225 
227 
228 
233 
238 
243 
248 
253 
255 
257 
258 
263 
269  bool withCChannel = false;
270 
274  bool anode = false;
275 
279  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > CGDL;
280 
284  boost::shared_ptr< FuelCellShop::Layer::MicroPorousLayer<dim> > CMPL;
285 
289  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > CCL;
290 
292 
294 
295 
300 
305 
310 
315 
317 
319 
332  };
333 
334  } // Application
335 
336 } // FuelCell
337 
338 #endif
FuelCellShop::Material::Hydrogen hydrogen
Hydrogen as a part of fluid.
Definition: app_cathode_KG.h:247
FuelCellShop::PostProcessing::HORCurrentDensityResponse< dim > HORCurrent
Post-processing routine to compute the HOR current density.
Definition: app_cathode_KG.h:326
std::string hydrogen_density_name
Set hydrogen density name.
Definition: app_cathode_KG.h:214
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:118
FuelCellShop::Material::WaterVapor water
Water vapor as a part of fluid.
Definition: app_cathode_KG.h:237
FuelCellShop::Equation::ProtonTransportEquation< dim > proton_transport_equation
Proton transport equation.
Definition: app_cathode_KG.h:309
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > CGDL
Cathode GDL.
Definition: app_cathode_KG.h:279
FuelCellShop::Material::Nitrogen nitrogen
Nitrogen as a part of fluid.
Definition: app_cathode_KG.h:242
FuelCellShop::Material::GasMixture fluid
Fluid.
Definition: app_cathode_KG.h:252
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::MicroPorousLayer< dim > > CMPL
Cathode MPL.
Definition: app_cathode_KG.h:284
FuelCell::OperatingConditions OC
Operating conditions.
Definition: app_cathode_KG.h:199
std::string oxygen_density_name
Set oxygen density name in terms of species_X.
Definition: app_cathode_KG.h:209
This class solves.
Definition: app_cathode_KG.h:69
This class deals with Electron Transport Equation.
Definition: electron_transport_equation.h:128
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
Class used to calculate the total mass flux at a boundary.
Definition: response_mass_flux.h:118
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
This class describes properties of pure nitrogen.
Definition: PureGas.h:1027
boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > CCL
Cathode CL.
Definition: app_cathode_KG.h:289
FuelCellShop::Layer::Channel< dim > CChannel
Cathode channel.
Definition: app_cathode_KG.h:262
FuelCellShop::Material::Oxygen oxygen
Oxygen as a part of fluid.
Definition: app_cathode_KG.h:232
std::map< unsigned int, std::string > gasSpeciesMap
map relating species number (key) to species material (value)
Definition: app_cathode_KG.h:204
This class describes properties of gas mixtures.
Definition: GasMixture.h:102
FuelCellShop::Equation::ElectronTransportEquation< dim > electron_transport_equation
Electron transport equation.
Definition: app_cathode_KG.h:304
FuelCell::Scaling Scale
Object for performing scaling on equation matrix and residual vector.
Definition: app_cathode_KG.h:185
FuelCellShop::PostProcessing::MassFluxResponse< dim > mass_flux_response
Calculates mass flux.
Definition: app_cathode_KG.h:330
FuelCellShop::PostProcessing::ORRCurrentDensityResponse< dim > ORRCurrent
Post processing routine to compute the ORR current density.
Definition: app_cathode_KG.h:322
This class describes a channel and stores pointers to.
Definition: channel.h:51
Class used to store, read from file and define scaling factors to be applied to equations in equation...
Definition: scaling.h:99
FuelCellShop::Equation::CompressibleMultiComponentKGEquationsCoupled< dim > fluid_transport_equations
Kerkhof-Geboers equations.
Definition: app_cathode_KG.h:299
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
FuelCellShop::Equation::ReactionSourceTermsKG< dim > reaction_source_terms
The reaction source terms for all underlying equations.
Definition: app_cathode_KG.h:314
This class describes properties of pure hydrogen.
Definition: PureGas.h:1081
This class assembles the reaction source terms for all other transport equations, if there&#39;s any...
Definition: reaction_source_terms_KG.h:35
This class implements the multi-component mass transport equations proposed by Kerkhof-Geboers for fl...
Definition: compressible_multi_component_KG_equations_coupled.h:223
Class used to calculate the ORR current density and coverages (if provided in the kinetic model) by t...
Definition: response_current_density.h:59
This class describes properties of pure WaterVapor.
Definition: PureGas.h:1134