OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
FuelCellShop::Equation::ReactionSourceTerms< dim > Class Template Reference

This class assembles the reaction source terms for all other transport equations, if there's any. More...

#include <reaction_source_terms.h>

Inheritance diagram for FuelCellShop::Equation::ReactionSourceTerms< dim >:
Inheritance graph
[legend]
Collaboration diagram for FuelCellShop::Equation::ReactionSourceTerms< dim >:
Collaboration graph
[legend]

Public Member Functions

Constructors, destructor, and initalization
 ReactionSourceTerms (FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
 Constructor. More...
 
virtual ~ReactionSourceTerms ()
 Destructor. More...
 
virtual void declare_parameters (ParameterHandler &param) const
 Declare parameters. More...
 
virtual void initialize (ParameterHandler &param)
 Initialize parameters. More...
 
void set_cathode_kinetics (FuelCellShop::Kinetics::BaseKinetics *kinetics)
 Set the pointer to cathode kinetics in the object. More...
 
void set_anode_kinetics (FuelCellShop::Kinetics::BaseKinetics *kinetics)
 Set the pointer to anode kinetics in the object. More...
 
Local CG FEM based assemblers
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. More...
 
virtual void assemble_cell_residual (FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local cell residual. More...
 
Accessors & Info
virtual void adjust_internal_cell_couplings (std::vector< couplings_map > &dst)
 This function is used to adjust std::vector < internal_cell_couplings >, which is generated after getting internal_cell_couplings from all the equations being used in the application. More...
 
virtual void print_equation_info () const
 This function prints out the info for this class. More...
 
bool get_irrev_heat_ccl () const
 Method to get whether the ir-reversible heating due to ORR, inside the cathode catalyst layer is ON or OFF (irrev_heat_ccl). More...
 
bool get_irrev_heat_acl () const
 Method to get whether the ir-reversible heating due to HOR, inside the anode catalyst layer is ON or OFF (irrev_heat_acl). More...
 
bool get_rev_heat () const
 Method to get whether the reversible (entropic) heating due to net reaction forming liquid water product is ON or OFF (rev_heat). More...
 
double get_factor_rev_heat_ccl () const
 Method to get the fraction of reversible heat released corresponding to half-cell reaction of ORR, inside the cathode catalyst layer (factor_rev_heat_ccl). More...
 
bool get_water_vap_heat_ccl () const
 Method to get whether the heat sink due to evaoration of water produced during the ORR inside the athode catalyst layer is ON or OFF (water_vap_heat_ccl). More...
 
FuelCellShop::Kinetics::BaseKineticsget_cathode_kinetics () const
 Accessor for cathode catalyst layer FuelCellShop::Kinetics::BaseKinetics pointer. More...
 
FuelCellShop::Kinetics::BaseKineticsget_anode_kinetics () const
 Accessor for anode catalyst layer FuelCellShop::Kinetics::BaseKinetics pointer. More...
 
- Public Member Functions inherited from FuelCellShop::Equation::EquationBase< dim >
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. More...
 
virtual void assemble_bdry_residual (FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local boundary residual. More...
 
const couplings_mapget_internal_cell_couplings () const
 This function returns internal_cell_couplings of a derived equation class. More...
 
const couplings_mapget_internal_flux_couplings () const
 This function returns internal_flux_couplings (DG FEM only) of a derived equation class. More...
 
const
component_materialID_value_map
get_component_materialID_value () const
 This function returns component_materialID_value of a derived equation class. More...
 
const
component_boundaryID_value_map
get_component_boundaryID_value () const
 This function returns component_boundaryID_value of a derived equation class. More...
 
const std::vector< BoundaryType > & get_boundary_types () const
 This function returns boundary_types of a derived equation class. More...
 
const std::vector< std::vector
< BoundaryType > > & 
get_multi_boundary_types () const
 This function returns multi_boundary_types of a derived equation class. More...
 
const std::vector< OutputType > & get_output_types () const
 This function returns output_types of a derived equation class. More...
 
const std::vector< std::vector
< OutputType > > & 
get_multi_output_types () const
 This function returns multi_output_types of a derived equation class. More...
 
const std::string & get_equation_name () const
 This function returns equation_name of a derived equation class. More...
 
const std::vector< unsigned int > & get_matrix_block_indices () const
 This function returns matrix_block_indices of a derived equation class. More...
 
const std::vector< unsigned int > & get_residual_indices () const
 This function returns residual_indices of a derived equation class. More...
 

Protected Member Functions

Local CG FEM based assemblers - make_ functions
virtual void make_assemblers_generic_constant_data ()
 This function computes Local CG FEM based assemblers - constant data (generic). More...
 
virtual void make_assemblers_cell_constant_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info)
 This function computes. More...
 
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. More...
 
virtual void assemble_matrix_for_equation (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, const std::string &eq_name, const FEValuesBase< dim > &test_fe, const std::vector< std::vector< double > > &test_shape_functions, const double &sourceterm_factor)
 This function is specifically created for assembly of cell matrices for the following equations, viz. More...
 
- Protected Member Functions inherited from FuelCellShop::Equation::EquationBase< dim >
 EquationBase (FuelCell::SystemManagement &sys_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
 Constructor. More...
 
virtual ~EquationBase ()
 Destructor. More...
 
virtual void set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Set parameters using the parameter file, in order to run parametric/optimization studies. More...
 
virtual void make_assemblers_bdry_constant_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info)
 
virtual void make_assemblers_bdry_variable_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 
void select_cell_assemblers (const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 This routine is used to select the make_assembly routines that need to be called inside assemble_cell_matrix to compute. More...
 
virtual void make_internal_cell_couplings ()
 This function fills out internal_cell_couplings of a derived equation class. More...
 
virtual void make_internal_flux_couplings ()
 This function fills out internal_flux_couplings (DG FEM only) of a derived equation class. More...
 
virtual void make_component_materialID_value ()
 This function fills out component_materialID_value of a derived equation class. More...
 
virtual void make_component_boundaryID_value ()
 This function fills out component_boundaryID_value of a derived equation class. More...
 
virtual void make_boundary_types ()
 This function fills out boundary_types of a derived equation class. More...
 
virtual void make_multi_boundary_types ()
 This function fills out multi_boundary_types of a derived equation class. More...
 
virtual void make_output_types ()
 This function fills out output_types of a derived equation class. More...
 
virtual void make_multi_output_types ()
 This function fills out multi_output_types of a derived equation class. More...
 
virtual void make_matrix_block_indices ()
 This function is only needed to provide the last argument to dealII_to_appframe. More...
 
virtual void make_residual_indices ()
 This function is only needed to provide the last argument to dealII_to_appframe. More...
 
virtual void assemble_cell_Jacobian_matrix (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble the local Jacobian Matrix for Non-Linear problems. More...
 
virtual void assemble_bdry_Jacobian_matrix (FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local Jacobian boundary matrix for Non-Linear problems. More...
 
virtual void assemble_cell_linear_matrix (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble the local cell matrix for Linear problems. More...
 
virtual void assemble_cell_residual_rhs (FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local cell RHS for nonlinear problems. More...
 
virtual void assemble_cell_linear_rhs (FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local cell RHS for Linear problems. More...
 
virtual void assemble_bdry_linear_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 for linear problems. More...
 
virtual void assemble_bdry_linear_rhs (FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local boundary RHS for linear problems. More...
 
void standard_to_block_wise (FullMatrix< double > &target) const
 This function changes the order of dealii::FullMatrix<double> target from standard to block-wise. More...
 
void standard_to_block_wise (Vector< double > &target) const
 This function changes the order of dealii::Vector<double> target from standard to block-wise. More...
 
void dealII_to_appframe (FuelCell::ApplicationCore::MatrixVector &dst, const FullMatrix< double > &src, const std::vector< unsigned int > &matrix_block_indices) const
 This function converts the standard ordered structure dealii::FullMatrix<double> src into the block-wise ordered structure FuelCell::ApplicationCore::MatrixVector dst. More...
 
void dealII_to_appframe (FuelCell::ApplicationCore::FEVector &dst, const Vector< double > &src, const std::vector< unsigned int > &residual_indices) const
 This function converts the standard ordered structure dealii::Vector<double> src into the block-wise ordered structure FuelCell::ApplicationCore::FEVector dst. More...
 
bool belongs_to_boundary (const unsigned int &tria_boundary_id, const unsigned int &param_boundary_id) const
 This function returns true if a boundary indicator of an external face on the triangulation coincides with a boundary indicator defined in the parameters file of a derived equation class. More...
 
void print_caller_name (const std::string &caller_name) const
 This function is used to print out the name of another function that has been declared in the scope of this class, but not yet been implemented. More...
 

Protected Attributes

Boolean flags / Parameters
bool irrev_heat_ccl
 This boolean data member indicates that the ir-reversible heating due to ORR, inside the cathode catalyst layer is ON or OFF. More...
 
bool irrev_heat_acl
 This boolean data member indicates that the ir-reversible heating due to HOR, inside the anode catalyst layer is ON or OFF. More...
 
bool rev_heat
 This boolean data member indicates that the reversible (entropic) heat source due to net reaction forming liquid water product is ON or OFF. More...
 
double factor_rev_heat_ccl
 This represents the fraction of reversible heat released corresponding to half-cell reaction of ORR, inside the cathode catalyst layer. More...
 
bool water_vapour_phase
 This boolean data member indicates that whether the water is produced in vapour phase (i.e. More...
 
bool water_vap_heat_ccl
 This boolean data member indicates that the heat sink due to evaporation of water produced during the ORR inside the cathode catalyst layer is ON or OFF. More...
 
std::string equation_name_liquid_water
 This string data member indicates that the liquid water generated for the whole MEA or only cathode. More...
 
Kinetics Objects
FuelCellShop::Kinetics::BaseKineticscathode_kinetics
 Pointer to Cathode Kinetics object, initialized in the constructor. More...
 
FuelCellShop::Kinetics::BaseKineticsanode_kinetics
 Pointer to Anode Kinetics object, initialized in the constructor. More...
 
ReactionHeat Objects
FuelCellShop::Equation::ReactionHeatcathode_reactionheat
 Pointer to Cathode ReactionHeat object. More...
 
FuelCellShop::Equation::ReactionHeatanode_reactionheat
 Pointer to Anode Reactionheat object. More...
 
Generic Constant Data
VariableInfo x_oxygen
 VariableInfo structure corresponding to "oxygen_molar_fraction". More...
 
VariableInfo x_hydrogen
 VariableInfo structure corresponding to "hydrogen_molar_fraction". More...
 
VariableInfo x_water
 VariableInfo structure corresponding to "water_molar_fraction". More...
 
VariableInfo phi_s
 VariableInfo structure corresponding to "electronic_electrical_potential". More...
 
VariableInfo lambda
 VariableInfo structure corresponding to "membrane_water_content". More...
 
VariableInfo phi_m
 VariableInfo structure corresponding to "protonic_electrical_potential". More...
 
VariableInfo t_rev
 VariableInfo structure corresponding to "temperature_of_REV". More...
 
VariableInfo s_liquid_water
 VariableInfo structure corresponding to "liquid_water_saturation". More...
 
VariableInfo p_liquid_water
 VariableInfo structure corresponding to "capillary_pressure". More...
 
double F
 Universal Faraday's constant. More...
 
double M_water
 Molar weight of water in grams/mole. More...
 
Local CG FEM based assemblers - variable data (cell)
std::vector< std::vector
< double > > 
phi_T_cell
 $ \mathbf{T} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_xOxygen_cell
 $ \mathbf{x_{O_2}} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_xHydrogen_cell
 $ \mathbf{x_{H_2}} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_phiS_cell
 $ \mathbf{\phi_s} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_phiM_cell
 $ \mathbf{\phi_m} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_xWater_cell
 $ \mathbf{x_{H_2O}} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_s_cell
 $ \mathbf{s} $ shape functions. More...
 
std::vector< std::vector
< double > > 
phi_p_cell
 
std::vector< double > current_cell
 Current produced [A/cm^3] at all quadrature points in the cell. More...
 
std::vector< double > heat_cell
 Heat produced due to electrochemical reaction [W/cm^2] at all quadrature points in the cell. More...
 
std::vector< double > dcurrent_dphiS_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dcurrent_dphiM_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dcurrent_dT_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dcurrent_dxOxygen_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dcurrent_dxHydrogen_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dcurrent_dxWater_cell
 Derivative of current w.r.t. More...
 
std::vector< double > dheat_dphiS_cell
 Derivative of heat produced w.r.t. More...
 
std::vector< double > dheat_dphiM_cell
 Derivative of heat produced w.r.t. More...
 
std::vector< double > dheat_dT_cell
 Derivative of heat produced w.r.t. More...
 
std::vector< double > dheat_dxOxygen_cell
 Derivative of heat produced w.r.t. More...
 
std::vector< double > dheat_dxHydrogen_cell
 Derivative of heat produced w.r.t. More...
 
std::vector< double > dheat_dxWater_cell
 Derivative of heat produced w.r.t. More...
 
double active_area_cell
 Active area [cm^2/cm^3] of the cell. More...
 
double factor_protontranseq_cell
 Factor for. More...
 
double factor_electrontranseq_cell
 Factor for. More...
 
double factor_oxygentranseq_cell
 Factor for. More...
 
double factor_hydrogentranseq_cell
 Factor for. More...
 
double factor_watertranseq_cell
 Factor for. More...
 
double factor_saturationtranseq_cell
 Factor for. More...
 
double factor_capillarytranseq_cell
 
Counters
bool cell_matrix_counter
 Counter set to TRUE when cell_matrix is being assembled. More...
 
bool cell_residual_counter
 Counter set to TRUE when cell_residual is being assembled. More...
 
unsigned int last_iter_cell
 Variable used to store the index in cell_info->global_data of the previous Newton solution The solution at the previous iteration is used to compute cell_matrix and cell_residual. More...
 
- Protected Attributes inherited from FuelCellShop::Equation::EquationBase< dim >
unsigned int dofs_per_cell
 Number of degrees of freedom per cell. More...
 
unsigned int n_q_points_cell
 Number of quadrature points per cell. More...
 
unsigned int n_q_points_bdry
 Number of quadrature points per boundary. More...
 
DoFHandler< dim >
::active_cell_iterator 
cell
 Currently active DoFHandler<dim> active cell iterator. More...
 
DoFHandler< dim >
::active_face_iterator 
bdry
 Currently active DoFHandler<dim> active boundary iterator. More...
 
std::vector< double > JxW_cell
 Jacobian of mapping by Weight in the quadrature points of a cell. More...
 
std::vector< double > JxW_bdry
 Jacobian of mapping by Weight in the quadrature points of a boundary. More...
 
std::vector< Point< dim > > normal_vectors
 Normal vectors in the quadrature points of a boundary. More...
 
std::vector< std::vector
< Point< dim > > > 
tangential_vectors
 Tangential vectors in the quadrature points of a boundary. More...
 
FuelCell::SystemManagementsystem_management
 Pointer to the external YourApplication<dim>::system_management object. More...
 
couplings_map internal_cell_couplings
 This object contains the info on how the equations and solution variables of a derived equation class are coupled. More...
 
couplings_map internal_flux_couplings
 This object contains the info on how the "X" and "Y" of a derived equation class are coupled (DG FEM only). More...
 
component_materialID_value_map component_materialID_value
 This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More...
 
component_boundaryID_value_map component_boundaryID_value
 This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More...
 
std::vector< BoundaryTypeboundary_types
 The list of boundary types of a derived equation class. More...
 
std::vector< std::vector
< BoundaryType > > 
multi_boundary_types
 The list of multiple boundary types of a derived equation class. More...
 
std::vector< OutputTypeoutput_types
 The list of output types of a derived equation class. More...
 
std::vector< std::vector
< OutputType > > 
multi_output_types
 The list of multiple output types of a derived equation class. More...
 
std::string equation_name
 The name of a derived equation class. More...
 
std::string name_base_variable
 Const std::string member storing name of the base solution variable corresponding to the equation represented by this class. More...
 
std::vector< unsigned int > matrix_block_indices
 The system matrix block indices (a derived equation class) drawn from the global structure (a derived equation class + other active equation classes included into the computation). More...
 
std::vector< unsigned int > residual_indices
 The residual indices (a derived equation class) drawn from the global structure (a derived equation class + other active equation classes included into the computation). More...
 
std::vector< bool > counter
 This vector contains the collection of internal "counters" used by the derived equation classes. More...
 
EquationFlags assemble_flags
 This vector contains a collection of internal flags to tell derived equation classes what needs to be re-computed. More...
 
boost::shared_ptr
< FuelCell::ApplicationCore::ApplicationData
data
 Data object for the application data to be passed to the equation classes. More...
 
std::string solution_vector_name
 The name of the solution vector in FEVectors. More...
 
std::string residual_vector_name
 The name of the residual vector name in FEVectors. More...
 

Additional Inherited Members

- Public Attributes inherited from FuelCellShop::Equation::EquationBase< dim >
bool variable_initial_data
 true, if variable initial data is prescribed on a part of the domain. More...
 
bool variable_boundary_data
 true, if variable Dirichlet boundary conditions are prescribed on a part of the boundary. More...
 

Detailed Description

template<int dim>
class FuelCellShop::Equation::ReactionSourceTerms< dim >

This class assembles the reaction source terms for all other transport equations, if there's any.

Author
Madhur Bhaiya, 2013
Valentin N. Zingan, 2013 - all couplings with fluid transport equations

Constructor & Destructor Documentation

Constructor.

template<int dim>
virtual FuelCellShop::Equation::ReactionSourceTerms< dim >::~ReactionSourceTerms ( )
virtual

Destructor.

Member Function Documentation

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::adjust_internal_cell_couplings ( std::vector< couplings_map > &  dst)
virtual

This function is used to adjust std::vector < internal_cell_couplings >, which is generated after getting internal_cell_couplings from all the equations being used in the application.

Note
It's very important to use this function, if we are considering source terms due to reaction in the catalyst layers. It's also noteworthy that this function should be used after whole vector of internal_cell_couplings is created, and BEFORE make_cell_couplings of SystemManagement is called.
template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::assemble_cell_matrix ( FuelCell::ApplicationCore::MatrixVector cell_matrices,
const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &  cell_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
virtual

Assemble local cell matrix.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::assemble_cell_residual ( FuelCell::ApplicationCore::FEVector cell_residual,
const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &  cell_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
virtual

Assemble local cell residual.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::assemble_matrix_for_equation ( FuelCell::ApplicationCore::MatrixVector cell_matrices,
const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &  cell_info,
const std::string &  eq_name,
const FEValuesBase< dim > &  test_fe,
const std::vector< std::vector< double > > &  test_shape_functions,
const double &  sourceterm_factor 
)
protectedvirtual

This function is specifically created for assembly of cell matrices for the following equations, viz.

  • "Proton Transport Equation"
  • "Electron Transport Equation"
  • "Ficks Transport Equation - oxygen"
  • "Ficks Transport Equation - water"
  • "Thermal Transport Equation"
  • "Liquid Water Saturation Transport Equation"

Cell matrix terms for the abovementioned equations follow a similar pattern, using different factors; hence this function avoids using repeated lines of code for each of these equations in assemble_cell_matrix method. The argument list is defined as follows:

Parameters
-first corresponds to FuelCell::ApplicationCore::MatrixVector which we need to fill.
-second corresponds to typename FuelCell::ApplicationCore::DoFApplication<dim>::CellInfo object; used to access fe elements for variables other than test function.
-third corresponds to std::string for the name of the equation for which we are doing the assembly. It should match with names mentioned above.
-fourth corresponds to FEValuesBase (fe discretization) used for the test function i.e. equation for which assembly is being done.
-fifth corresponds to shape functions for the test function, filled already by make_assemblers_cell_variable_data.
-fifth corresponds to the factor used to multiply with the current density in source term for a particular equation.
Warning
For the DEVELOPERS: This function should only be used after make_assemblers_cell_variable_data has been called in assemble_cell_matrix, otherwise it is bound to give wrong results.
template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::declare_parameters ( ParameterHandler &  param) const
virtual

Declare parameters.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
FuelCellShop::Kinetics::BaseKinetics* FuelCellShop::Equation::ReactionSourceTerms< dim >::get_anode_kinetics ( ) const
inline
template<int dim>
FuelCellShop::Kinetics::BaseKinetics* FuelCellShop::Equation::ReactionSourceTerms< dim >::get_cathode_kinetics ( ) const
inline
template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::get_factor_rev_heat_ccl ( ) const
inline

Method to get the fraction of reversible heat released corresponding to half-cell reaction of ORR, inside the cathode catalyst layer (factor_rev_heat_ccl).

The typical use of this method is for the post-processing routines in the application.

References FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_rev_heat_ccl.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::get_irrev_heat_acl ( ) const
inline

Method to get whether the ir-reversible heating due to HOR, inside the anode catalyst layer is ON or OFF (irrev_heat_acl).

The typical use of this method is for the post-processing routines in the application.

References FuelCellShop::Equation::ReactionSourceTerms< dim >::irrev_heat_acl.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::get_irrev_heat_ccl ( ) const
inline

Method to get whether the ir-reversible heating due to ORR, inside the cathode catalyst layer is ON or OFF (irrev_heat_ccl).

The typical use of this method is for the post-processing routines in the application.

References FuelCellShop::Equation::ReactionSourceTerms< dim >::irrev_heat_ccl.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::get_rev_heat ( ) const
inline

Method to get whether the reversible (entropic) heating due to net reaction forming liquid water product is ON or OFF (rev_heat).

The typical use of this method is for the post-processing routines in the application.

References FuelCellShop::Equation::ReactionSourceTerms< dim >::rev_heat.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::get_water_vap_heat_ccl ( ) const
inline

Method to get whether the heat sink due to evaoration of water produced during the ORR inside the athode catalyst layer is ON or OFF (water_vap_heat_ccl).

The typical use of this method is for the post-processing routines in the application.

References FuelCellShop::Equation::ReactionSourceTerms< dim >::water_vap_heat_ccl.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::initialize ( ParameterHandler &  param)
virtual

Initialize parameters.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::make_assemblers_cell_constant_data ( const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &  cell_info)
protectedvirtual

This function computes.

Local CG FEM based assemblers - constant data (cell)

and allocates the memory for shape functions, shape function gradients, and JxW_cell in

Local CG FEM based assemblers - variable data (cell)

.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::make_assemblers_cell_variable_data ( const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &  cell_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
protectedvirtual

This function computes.

Local CG FEM based assemblers - variable data (cell)

.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::make_assemblers_generic_constant_data ( )
protectedvirtual

This function computes Local CG FEM based assemblers - constant data (generic).

Warning
For the DEVELOPERS: block_index for VariableInfo are not filled here, but indices_exist flag is set to TRUE (as it is needed at other places before cell_matrix or cell_residual assembly). Developers need to be wary of this fact that the block_index are still not filled yet, and they need to fill them before doing cell_matrix assembly.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
virtual void FuelCellShop::Equation::ReactionSourceTerms< dim >::print_equation_info ( ) const
virtual

This function prints out the info for this class.

Reimplemented from FuelCellShop::Equation::EquationBase< dim >.

template<int dim>
void FuelCellShop::Equation::ReactionSourceTerms< dim >::set_anode_kinetics ( FuelCellShop::Kinetics::BaseKinetics kinetics)
inline

Set the pointer to anode kinetics in the object.

Note
If an application uses anode kinetics model, this method should be called neccessarily before initializing this object (using initialize method).

References FuelCellShop::Equation::ReactionSourceTerms< dim >::anode_kinetics.

template<int dim>
void FuelCellShop::Equation::ReactionSourceTerms< dim >::set_cathode_kinetics ( FuelCellShop::Kinetics::BaseKinetics kinetics)
inline

Set the pointer to cathode kinetics in the object.

Note
If an application uses cathode kinetics model, this method should be called neccessarily before initializing this object (using initialize method).

References FuelCellShop::Equation::ReactionSourceTerms< dim >::cathode_kinetics.

Member Data Documentation

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::active_area_cell
protected

Active area [cm^2/cm^3] of the cell.

This is specifically required for heat source terms, as ReactionHeat return heat terms in [W/cm^2].

template<int dim>
FuelCellShop::Equation::ReactionHeat* FuelCellShop::Equation::ReactionSourceTerms< dim >::anode_reactionheat
protected

Pointer to Anode Reactionheat object.

This is initialized automatically inside this class, depending on whether temperature_of_REV is beig solved for or not, and anode_kinetics exists or not.

template<int dim>
FuelCellShop::Equation::ReactionHeat* FuelCellShop::Equation::ReactionSourceTerms< dim >::cathode_reactionheat
protected

Pointer to Cathode ReactionHeat object.

This is initialized automatically inside this class, depending on whether temperature_of_REV is beig solved for or not, and cathode_kinetics exists or not.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::cell_matrix_counter
protected

Counter set to TRUE when cell_matrix is being assembled.

This ensures that only derivatives of source terms are computed in the cell, in make_assemblers_cell_variable_data.

Note
For developers: Other counter cell_residual_counter should be set to FALSE, when this counter is set to TRUE.
template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::cell_residual_counter
protected

Counter set to TRUE when cell_residual is being assembled.

This ensures that only source terms, e.g. Current or Reaction Heat, are computed in the cell, in make_assemblers_cell_variable_data.

Note
For developers: Other counter cell_matrix_counter should be set to FALSE, when this counter is set to TRUE.
template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::current_cell
protected

Current produced [A/cm^3] at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dphiM_cell
protected

Derivative of current w.r.t.

$ \mathbf{\phi_m} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dphiS_cell
protected

Derivative of current w.r.t.

$ \mathbf{\phi_s} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dT_cell
protected

Derivative of current w.r.t.

$ \mathbf{T} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dxHydrogen_cell
protected

Derivative of current w.r.t.

$ \mathbf{x_{H_2}} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dxOxygen_cell
protected

Derivative of current w.r.t.

$ \mathbf{x_{O_2}} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dcurrent_dxWater_cell
protected

Derivative of current w.r.t.

$ \mathbf{x_{H_2O}} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dphiM_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{\phi_m} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dphiS_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{\phi_s} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dT_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{T} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dxHydrogen_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{x_{O_2}} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dxOxygen_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{x_{O_2}} $ at all quadrature points in the cell.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::dheat_dxWater_cell
protected

Derivative of heat produced w.r.t.

$ \mathbf{x_{H_2O}} $ at all quadrature points in the cell.

template<int dim>
std::string FuelCellShop::Equation::ReactionSourceTerms< dim >::equation_name_liquid_water
protected

This string data member indicates that the liquid water generated for the whole MEA or only cathode.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::F
protected

Universal Faraday's constant.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_capillarytranseq_cell
protected
template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_electrontranseq_cell
protected

Factor for.

Electron Transport Equation

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_hydrogentranseq_cell
protected

Factor for.

Ficks Transport Equation - oxygen

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_oxygentranseq_cell
protected

Factor for.

Ficks Transport Equation - oxygen

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_protontranseq_cell
protected

Factor for.

Proton Transport Equation

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_rev_heat_ccl
protected

This represents the fraction of reversible heat released corresponding to half-cell reaction of ORR, inside the cathode catalyst layer.

Referenced by FuelCellShop::Equation::ReactionSourceTerms< dim >::get_factor_rev_heat_ccl().

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_saturationtranseq_cell
protected

Factor for.

Liquid Water Saturation Transport Equation

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer, and it also depends on whether the water is getting produced in the liquid phase or vapour phase.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::factor_watertranseq_cell
protected

Factor for.

Ficks Transport Equation - water

source term, depending on whether the current cell is in the Anode catalyst layer or Cathode catalyst layer, and it also depends on whether the water is getting produced in the liquid phase or vapour phase.

template<int dim>
std::vector<double> FuelCellShop::Equation::ReactionSourceTerms< dim >::heat_cell
protected

Heat produced due to electrochemical reaction [W/cm^2] at all quadrature points in the cell.

ReactionHeat object returns heat produced in [W/cm^2]. It needs to be multiplied by active_area_cell [cm^2/cm^3] to convert into a source term [W/cm^3].

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::irrev_heat_acl
protected

This boolean data member indicates that the ir-reversible heating due to HOR, inside the anode catalyst layer is ON or OFF.

Referenced by FuelCellShop::Equation::ReactionSourceTerms< dim >::get_irrev_heat_acl().

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::irrev_heat_ccl
protected

This boolean data member indicates that the ir-reversible heating due to ORR, inside the cathode catalyst layer is ON or OFF.

Referenced by FuelCellShop::Equation::ReactionSourceTerms< dim >::get_irrev_heat_ccl().

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::lambda
protected

VariableInfo structure corresponding to "membrane_water_content".

template<int dim>
unsigned int FuelCellShop::Equation::ReactionSourceTerms< dim >::last_iter_cell
protected

Variable used to store the index in cell_info->global_data of the previous Newton solution The solution at the previous iteration is used to compute cell_matrix and cell_residual.

template<int dim>
double FuelCellShop::Equation::ReactionSourceTerms< dim >::M_water
protected

Molar weight of water in grams/mole.

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::p_liquid_water
protected

VariableInfo structure corresponding to "capillary_pressure".

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_m
protected

VariableInfo structure corresponding to "protonic_electrical_potential".

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_p_cell
protected
template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_phiM_cell
protected

$ \mathbf{\phi_m} $ shape functions.

phi_phiM_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{\phi_m} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_phiS_cell
protected

$ \mathbf{\phi_s} $ shape functions.

phi_phiS_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{\phi_s} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_s
protected

VariableInfo structure corresponding to "electronic_electrical_potential".

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_s_cell
protected

$ \mathbf{s} $ shape functions.

phi_s_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{s} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_T_cell
protected

$ \mathbf{T} $ shape functions.

phi_T_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{T} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_xHydrogen_cell
protected

$ \mathbf{x_{H_2}} $ shape functions.

phi_xHydrogen_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{x_{H_2}} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_xOxygen_cell
protected

$ \mathbf{x_{O_2}} $ shape functions.

phi_xOxygen_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{x_{O_2}} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::ReactionSourceTerms< dim >::phi_xWater_cell
protected

$ \mathbf{x_{H_2O}} $ shape functions.

phi_xWater_cell [ q ] [ k ] denotes $ k $-th $ \mathbf{x_{H_2O}} $ shape function computed in $ q $-th quadrature point of the cell.

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::rev_heat
protected

This boolean data member indicates that the reversible (entropic) heat source due to net reaction forming liquid water product is ON or OFF.

Referenced by FuelCellShop::Equation::ReactionSourceTerms< dim >::get_rev_heat().

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::s_liquid_water
protected

VariableInfo structure corresponding to "liquid_water_saturation".

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::t_rev
protected

VariableInfo structure corresponding to "temperature_of_REV".

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::water_vap_heat_ccl
protected

This boolean data member indicates that the heat sink due to evaporation of water produced during the ORR inside the cathode catalyst layer is ON or OFF.

Referenced by FuelCellShop::Equation::ReactionSourceTerms< dim >::get_water_vap_heat_ccl().

template<int dim>
bool FuelCellShop::Equation::ReactionSourceTerms< dim >::water_vapour_phase
protected

This boolean data member indicates that whether the water is produced in vapour phase (i.e.

completely evaporated) during ORR, inside the CCL.

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::x_hydrogen
protected

VariableInfo structure corresponding to "hydrogen_molar_fraction".

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::x_oxygen
protected

VariableInfo structure corresponding to "oxygen_molar_fraction".

template<int dim>
VariableInfo FuelCellShop::Equation::ReactionSourceTerms< dim >::x_water
protected

VariableInfo structure corresponding to "water_molar_fraction".


The documentation for this class was generated from the following file: