OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
proton_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: proton_transport_equation.h
11 // - Description: Equation class for Proton Transport (using Ohm's law)
12 // - Developers: Madhur Bhaiya, M. Secanell, Valentin N. Zingan
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_PROTON_TRANSPORT_EQUATION_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_PROTON_TRANSPORT_EQUATION_H_
18 
20 
21 #include <layers/catalyst_layer.h>
22 #include <layers/membrane_layer.h>
23 
24 // STD
25 #include <sstream>
26 #include <string>
27 
28 namespace FuelCellShop
29 {
30  namespace Equation
31  {
131  template<int dim>
133  {
134  public:
135 
137 
138 
142  ProtonTransportEquation(FuelCell::SystemManagement& system_management,boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
143  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
144 
148  virtual ~ProtonTransportEquation();
149 
153  virtual void declare_parameters(ParameterHandler& param) const;
154 
158  virtual void initialize(ParameterHandler& param);
159 
161 
164 
170 
177 
184 
191 
193 
195 
196 
200  virtual void print_equation_info() const;
201 
206  inline std::map<unsigned int, double> get_dirichlet_bdry_map() const
207  {
208  return dirichlet_bdry_map;
209  }
210 
215  void class_test();
217 
218  protected:
220 
221 
226  std::map<unsigned int, double> dirichlet_bdry_map;
227 
232  std::map<unsigned int, double> proton_current_flux_map;
233 
235 
237 
238 
244 
254 
264 
271 
278 
280 
282 
283 
288  virtual void make_internal_cell_couplings();
289 
294  virtual void make_boundary_types();
295 
300  virtual void make_output_types()
301  {};
302 
304 
306 
307 
311 
316 
321 
323 
325 
326 
331  std::vector<double> sigmaMeff_cell;
332 
338  std::vector<double> dsigmaMeff_dlambda_cell;
339 
345  std::vector<double> dsigmaMeff_dT_cell;
346 
354  std::vector< std::vector< Tensor<1,dim> > > grad_phi_phiM_cell;
355 
363  std::vector< std::vector<double> > phi_lambda_cell;
364 
372  std::vector< std::vector<double> > phi_T_cell;
373 
375 
377 
378 
386  std::vector< std::vector<double> > phi_phiM_bdry;
387 
389 
395 
401 
406  unsigned int last_iter_cell;
407 
412  unsigned int last_iter_bdry;
413 
414  };
415  } // Equation
416 } // FuelCellShop
417 
418 #endif
std::map< unsigned int, double > get_dirichlet_bdry_map() const
Method to provide access to Dirichlet boundary conditions map filled using the parameter file...
Definition: proton_transport_equation.h:206
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data object for the application data to be passed to the equation classes.
Definition: equation_base.h:890
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_phiM_cell
shape function gradients.
Definition: proton_transport_equation.h:354
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
void class_test()
This member function creates an object of its own type and runs test to diagnose if there are any pro...
virtual void print_equation_info() const
The function prints out the equation&#39;s info.
unsigned int last_iter_cell
Variable used to store the index in cell_info-&gt;global_data of the previous Newton solution The soluti...
Definition: proton_transport_equation.h:406
This class deals with Proton Transport Equation.
Definition: proton_transport_equation.h:132
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
virtual void make_output_types()
This function fills out output_types.
Definition: proton_transport_equation.h:300
bool bdry_residual_counter
Counter set to TRUE when bdry_residual is being assembled.
Definition: proton_transport_equation.h:400
virtual void make_assemblers_cell_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info)
This function computes Local CG FEM based assemblers - constant data (cell) and allocates the memor...
std::vector< double > sigmaMeff_cell
Effective proton conductivity, [S/cm], at all quadrature points of the cell.
Definition: proton_transport_equation.h:331
virtual void make_assemblers_bdry_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info)
This function computes Local CG FEM based assemblers - constant data (boundary) and allocates the m...
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
virtual void make_boundary_types()
This function fills out boundary_types.
std::vector< std::vector< double > > phi_T_cell
shape functions.
Definition: proton_transport_equation.h:372
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
virtual void assemble_cell_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell matrix.
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
virtual void assemble_cell_residual(FuelCell::ApplicationCore::FEVector &cell_rhs, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell residual.
std::vector< std::vector< double > > phi_lambda_cell
shape functions.
Definition: proton_transport_equation.h:363
VariableInfo phi_m
VariableInfo structure corresponding to &quot;protonic_electrical_potential&quot;.
Definition: proton_transport_equation.h:310
virtual void initialize(ParameterHandler &param)
Initialize parameters.
std::map< unsigned int, double > proton_current_flux_map
std::map&lt; unsigned int, double &gt; container for details regarding Galvanostatic boundary conditions...
Definition: proton_transport_equation.h:232
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
virtual void make_assemblers_cell_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes Local CG FEM based assemblers - variable data (cell) .
This is the base class used for all Equation classes.
Definition: equation_base.h:160
VariableInfo lambda
VariableInfo structure corresponding to &quot;membrane_water_content&quot;.
Definition: proton_transport_equation.h:315
virtual void assemble_bdry_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary matrix.
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
std::vector< std::vector< double > > phi_phiM_bdry
shape functions.
Definition: proton_transport_equation.h:386
virtual void make_assemblers_bdry_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes Local CG FEM based assemblers - variable data (boundary) .
unsigned int last_iter_bdry
Variable used to store the index in bdry_info-&gt;global_data of the previous Newton solution The soluti...
Definition: proton_transport_equation.h:412
virtual void assemble_bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_rhs, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary residual.
VariableInfo t_rev
VariableInfo structure corresponding to &quot;temperature_of_REV&quot;.
Definition: proton_transport_equation.h:320
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: proton_transport_equation.h:394
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
std::vector< double > dsigmaMeff_dlambda_cell
Derivative of effective protonic conductivity w.r.t.
Definition: proton_transport_equation.h:338
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
std::vector< double > dsigmaMeff_dT_cell
Derivative of effective protonic conductivity w.r.t &quot;temperature_of_REV&quot;, at all quadrature points in...
Definition: proton_transport_equation.h:345
std::map< unsigned int, double > dirichlet_bdry_map
std::map&lt; unsigned int, double &gt; container for Dirichlet boundary conditions.
Definition: proton_transport_equation.h:226
ProtonTransportEquation(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.