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

This class deals with Ficks Transport Equation. More...

#include <new_ficks_transport_equation.h>

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

Public Member Functions

Constructors, destructor, and initalization
 NewFicksTransportEquation (FuelCell::SystemManagement &system_management, FuelCellShop::Material::PureGas *solute, FuelCellShop::Material::PureGas *solvent)
 Constructor.
 
 NewFicksTransportEquation (FuelCell::SystemManagement &system_management)
 Constructor.
 
virtual ~NewFicksTransportEquation ()
 Destructor.
 
virtual void declare_parameters (ParameterHandler &param)
 Declare parameters.
 
virtual void initialize (ParameterHandler &param)
 Initialize parameters.
 
void set_solute_and_solvent (FuelCellShop::Material::PureGas *solute, FuelCellShop::Material::PureGas *solvent1)
 Method to set solute and solve if other constructor (not passing solute and solvent in the constructor) is being used.
 
Local CG FEM based assemblers
virtual void assemble_cell_matrix (AppFrame::MatrixVector &cell_matrices, const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local cell matrix.
 
virtual void assemble_bdry_matrix (AppFrame::MatrixVector &bdry_matrices, const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local boundary matrix.
 
virtual void assemble_cell_residual (AppFrame::FEVector &cell_rhs, const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local cell residual.
 
virtual void assemble_bdry_residual (AppFrame::FEVector &bdry_rhs, const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 Assemble local boundary residual.
 
Accessors and info
virtual void print_equation_info () const
 The function printing out the equations info.
 
void class_test ()
 Member function used to test the functionality of the class.
 
- Public Member Functions inherited from FuelCellShop::Equation::EquationBase< dim >
const couplings_mapget_internal_cell_couplings () const
 This function returns internal_cell_couplings of a derived equation class.
 
const couplings_mapget_internal_flux_couplings () const
 This function returns internal_flux_couplings (DG FEM only) of a derived equation class.
 
const
component_materialID_value_map
get_component_materialID_value () const
 This function returns component_materialID_value of a derived equation class.
 
const
component_boundaryID_value_map
get_component_boundaryID_value () const
 This function returns component_boundaryID_value of a derived equation class.
 
const std::vector< BoundaryType > & get_boundary_types () const
 This function returns boundary_types of a derived equation class.
 
const std::vector< std::vector
< BoundaryType > > & 
get_multi_boundary_types () const
 This function returns multi_boundary_types of a derived equation class.
 
const std::vector< OutputType > & get_output_types () const
 This function returns output_types of a derived equation class.
 
const std::vector< std::vector
< OutputType > > & 
get_multi_output_types () const
 This function returns multi_output_types of a derived equation class.
 
const std::string & get_equation_name () const
 This function returns equation_name of a derived equation class.
 
const std::vector< unsigned int > & get_matrix_block_indices () const
 This function returns matrix_block_indices of a derived equation class.
 
const std::vector< unsigned int > & get_residual_indices () const
 This function returns residual_indices of a derived equation class.
 

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).
 
virtual void make_assemblers_cell_constant_data (const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info)
 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) .
 
virtual void make_assemblers_bdry_constant_data (const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info)
 This function computes Local CG FEM based assemblers - constant data (boundary) and allocates the memory for shape functions, normal_vectors, and JxW_bdry in Local CG FEM based assemblers - variable data (boundary) .
 
virtual void make_assemblers_cell_variable_data (const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 This function computes Local CG FEM based assemblers - variable data (cell) .
 
virtual void make_assemblers_bdry_variable_data (const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 This function computes Local CG FEM based assemblers - variable data (boundary) .
 
Other make_ functions
virtual void make_internal_cell_couplings ()
 This function fills out internal_cell_couplings.
 
virtual void make_boundary_types ()
 This function fills out boundary_types.
 
- Protected Member Functions inherited from FuelCellShop::Equation::EquationBase< dim >
 EquationBase (FuelCell::SystemManagement &system_management)
 Constructor.
 
virtual ~EquationBase ()
 Destructor.
 
virtual void declare_parameters (ParameterHandler &param) const
 Declare parameters.
 
virtual void make_internal_flux_couplings ()
 This function fills out internal_flux_couplings (DG FEM only) of a derived equation class.
 
virtual void make_component_materialID_value ()
 This function fills out component_materialID_value of a derived equation class.
 
virtual void make_component_boundaryID_value ()
 This function fills out component_boundaryID_value of a derived equation class.
 
virtual void make_multi_boundary_types ()
 This function fills out multi_boundary_types of a derived equation class.
 
virtual void make_output_types ()
 This function fills out output_types of a derived equation class.
 
virtual void make_multi_output_types ()
 This function fills out multi_output_types of a derived equation class.
 
virtual void make_matrix_block_indices ()
 This function fills out matrix_block_indices of a derived equation class.
 
virtual void make_residual_indices ()
 This function fills out residual_indices of a derived equation class.
 
void standard_to_block_wise (FullMatrix< double > &target) const
 This function changes the order of dealii::FullMatrix<double> target from standard to block-wise.
 
void standard_to_block_wise (Vector< double > &target) const
 This function changes the order of dealii::Vector<double> target from standard to block-wise.
 
void dealII_to_appframe (AppFrame::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 AppFrame::MatrixVector dst.
 
void dealII_to_appframe (AppFrame::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 AppFrame::FEVector dst.
 
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.
 
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.
 

Protected Attributes

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.
 
Boundary conditions
std::vector< unsigned int > dirichlet_bdry_ids
 Container of boundary_id (s ) for Dirichlet boundaries.
 
Generic Constant Data
std::string name_base_variable
 Name of the variable we are trying to solve for.
 
FuelCellShop::Material::PureGasgas
 Gas for which the equation is setup.
 
FuelCellShop::Material::PureGassolvent
 Solvent gas for which the equation is setup.
 
VariableInfo xi
 VariableInfo structure corresponding to base variable of this equation class, "solute.name()_molar_fraction".
 
VariableInfo t_rev
 VariableInfo structure corresponding to "temperature_of_REV".
 
Local CG FEM based assemblers - variable data (cell)
std::vector< Tensor< 2, dim > > conc_Deff_cell
 Tensor with concentration times effective molecular diffusivity [mol/(cm-s )], at all quadrature points in the cell.
 
std::vector< std::vector
< double > > 
phi_xi_cell
 \( \mathbf{x_{i}} \) shape function.
 
std::vector< std::vector
< Tensor< 1, dim > > > 
grad_phi_xi_cell
 \( \mathbf{x_{i}} \) shape function gradients.
 
std::vector< std::vector
< Tensor< 1, dim > > > 
grad_phi_T_cell
 \( \mathbf{T} \) shape function gradients.
 
- Protected Attributes inherited from FuelCellShop::Equation::EquationBase< dim >
unsigned int dofs_per_cell
 Number of degrees of freedom per cell.
 
unsigned int n_q_points_cell
 Number of quadrature points per cell.
 
unsigned int n_q_points_bdry
 Number of quadrature points per boundary.
 
DoFHandler< dim >
::active_cell_iterator 
cell
 Currently active DoFHandler<dim> active cell iterator.
 
DoFHandler< dim >
::active_face_iterator 
bdry
 Currently active DoFHandler<dim> active boundary iterator.
 
std::vector< double > JxW_cell
 Jacobian of mapping by Weight in the quadrature points of a cell.
 
std::vector< double > JxW_bdry
 Jacobian of mapping by Weight in the quadrature points of a boundary.
 
std::vector< Point< dim > > normal_vectors
 Normal vectors in the quadrature points of a boundary.
 
std::vector< std::vector
< Point< dim > > > 
tangential_vectors
 Tangential vectors in the quadrature points of a boundary.
 
FuelCell::SystemManagementsystem_management
 Pointer to the external YourApplication<dim>::system_management object.
 
couplings_map internal_cell_couplings
 This object contains the info on how the equations and solution variables of a derived equation class are coupled.
 
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).
 
component_materialID_value_map component_materialID_value
 This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs):
 
component_boundaryID_value_map component_boundaryID_value
 This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs):
 
std::vector< BoundaryTypeboundary_types
 The list of boundary types of a derived equation class.
 
std::vector< std::vector
< BoundaryType > > 
multi_boundary_types
 The list of multiple boundary types of a derived equation class.
 
std::vector< OutputTypeoutput_types
 The list of output types of a derived equation class.
 
std::vector< std::vector
< OutputType > > 
multi_output_types
 The list of multiple output types of a derived equation class.
 
std::string equation_name
 The name of a derived equation class.
 
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).
 
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).
 
std::vector< bool > counter
 This vector contains the collection of internal "counters" used by the derived equation classes.
 

Detailed Description

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

This class deals with Ficks Transport Equation.

This equation class solves for Fick's law of diffusion inside the porous layers. The solute gas and solvent gas are normally passed inside the constructor of this equation class.

It is solved with respect to:

This equation can be written as:

\( \qquad \mathbf{\nabla} \cdot \left( C_T \hat{D}_{i,eff} \mathbf{\nabla} x_i \right) = 0 \quad \in \quad \Omega \)

To be well-posed, these equations are equipped with the appropriate boundary conditions. All the boundary conditions can be described by boundary_id (s ) and boundary_type. Besides, this some boundary types require additional information, which can also be provided by the parameter file. We consider following types of boundary conditions:

The boundary_ids are specified in the parameter file under subsection "Dirichlet Boundary Indicators", as a list of comma-separated values.

e.g.

set Dirichlet Boundary Indicators = 3, 4, 8
Remarks
  • There is no provision to specify boundary indicators for No gas flux or Symmetric boundary conditions, as FEM formulation automatically implies a particular boundary is one of these cases, by default.
  • This class currently works with the following layer classes:
    • FuelCellShop::Layer::GasDiffusionLayer<dim>
    • FuelCellShop::Layer::MicroPorousLayer<dim>
    • FuelCellShop::Layer::CatalystLayer<dim>
  • In the case of isothermal applications, it is necessary to use FuelCellShop::Layer::PorousLayer<dim>::set_gases_and_compute method in the initialization of the application. This method sets the gases to be solved inside the layer and also computes the isobaric isothermal bulk molecular diffusion coefficients.

We solve the whole problem by linearizing the governing equation at each Newton iteration with subsequent CG FEM discretization in space. The class contains the necessary class members to add the necessary contributions to cell_matrix and cell_residual to the governing equations used to analyze gas transport via ficks diffusion model,

Usage Details:

// Creating Equation object (in Application Header file)
// Declare parameters in application
oxygen_transport.declare_parameters(param);
// Initialize in application
oxygen_transport.initialize(param);
// Create a temporary vector in the application for storing couplings_map from all the equation used in the application.
std::vector<couplings_map> tmp;
... // other equations
tmp.push_back( oxygen_transport.get_internal_cell_couplings() );
// Look at ReactionSourceTerms class here, if source terms due to current production/consumption are to be considered.
// Making cell couplings using SystemManagement object created in the application
// cell_matrix in application
// Do a check against layer and it should match with the layers currently working for this equation class.
// for eg: CCL is FuelCellShop::Layer::HomogeneousCL<dim> object.
oxygen_transport.assemble_cell_matrix(cell_matrices, cell_info, &CCL);
// cell_residual in application
oxygen_transport.assemble_cell_residual(cell_vector, cell_info, &CCL);
Note
This class doesn't assemble for current production/consumption source terms; that is taken care off by ReactionSourceTerms class. Please read the documentation of ReactionSourceTerms class, for additional methods to be implemented in the application.
Warning
If current production/consumption source terms are being considered, it's very important to use adjust_internal_cell_couplings member function of ReactionSourceTerms class, before using make_cell_couplings of SystemManagement at the application level.
Author
Madhur Bhaiya, 2013
Marc Secanell, 2013

Constructor & Destructor Documentation

Constructor.

Note
This is the recommended construtor. The solute and solvent are passed immediately, so that the class can setup its equation name based on the solute being considered. The name of the equation is necessary before initialize() is called.

Constructor.

Warning
This constructor is not recommened. If using this constructor, use member function set_solute_and_solvent to setup the gases and name of the equation before calling initialize.

Destructor.

Member Function Documentation

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::assemble_bdry_matrix ( AppFrame::MatrixVector bdry_matrices,
const typename AppFrame::DoFApplication< dim >::FaceInfo &  bdry_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
inlinevirtual

Assemble local boundary matrix.

Currently, NOT IMPLEMENTED.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::assemble_bdry_residual ( AppFrame::FEVector bdry_rhs,
const typename AppFrame::DoFApplication< dim >::FaceInfo &  bdry_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
inlinevirtual

Assemble local boundary residual.

Currently, NOT IMPLEMENTED.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::assemble_cell_matrix ( AppFrame::MatrixVector cell_matrices,
const typename AppFrame::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::NewFicksTransportEquation< dim >::assemble_cell_residual ( AppFrame::FEVector cell_rhs,
const typename AppFrame::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>
void FuelCellShop::Equation::NewFicksTransportEquation< dim >::class_test ( )

Member function used to test the functionality of the class.

It create an object of this class and test functionality.

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::declare_parameters ( ParameterHandler &  param)
virtual

Declare parameters.

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

Initialize parameters.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::make_assemblers_bdry_constant_data ( const typename AppFrame::DoFApplication< dim >::FaceInfo &  bdry_info)
inlineprotectedvirtual

This function computes Local CG FEM based assemblers - constant data (boundary) and allocates the memory for shape functions, normal_vectors, and JxW_bdry in Local CG FEM based assemblers - variable data (boundary) .

Currently, NOT IMPLEMENTED.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::make_assemblers_bdry_variable_data ( const typename AppFrame::DoFApplication< dim >::FaceInfo &  bdry_info,
FuelCellShop::Layer::BaseLayer< dim > *const  layer 
)
inlineprotectedvirtual

This function computes Local CG FEM based assemblers - variable data (boundary) .

Currently, NOT IMPLEMENTED.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::make_assemblers_cell_constant_data ( const typename AppFrame::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::NewFicksTransportEquation< dim >::make_assemblers_cell_variable_data ( const typename AppFrame::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::NewFicksTransportEquation< dim >::make_assemblers_generic_constant_data ( )
protectedvirtual

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

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::make_boundary_types ( )
protectedvirtual

This function fills out boundary_types.

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

template<int dim>
virtual void FuelCellShop::Equation::NewFicksTransportEquation< dim >::make_internal_cell_couplings ( )
protectedvirtual

This function fills out internal_cell_couplings.

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

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

The function printing out the equations info.

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

template<int dim>
void FuelCellShop::Equation::NewFicksTransportEquation< dim >::set_solute_and_solvent ( FuelCellShop::Material::PureGas solute,
FuelCellShop::Material::PureGas solvent1 
)
inline

Method to set solute and solve if other constructor (not passing solute and solvent in the constructor) is being used.

It will also setup name_equation and name_solution

References FuelCellShop::Equation::EquationBase< dim >::equation_name, FuelCellShop::Equation::NewFicksTransportEquation< dim >::gas, FuelCellShop::Material::PureGas::get_name(), and FuelCellShop::Equation::NewFicksTransportEquation< dim >::name_base_variable.

Here is the call graph for this function:

Member Data Documentation

template<int dim>
std::vector< Tensor< 2, dim > > FuelCellShop::Equation::NewFicksTransportEquation< dim >::conc_Deff_cell
protected

Tensor with concentration times effective molecular diffusivity [mol/(cm-s )], at all quadrature points in the cell.

template<int dim>
std::vector<unsigned int> FuelCellShop::Equation::NewFicksTransportEquation< dim >::dirichlet_bdry_ids
protected

Container of boundary_id (s ) for Dirichlet boundaries.

template<int dim>
std::vector< std::vector< Tensor<1,dim> > > FuelCellShop::Equation::NewFicksTransportEquation< dim >::grad_phi_T_cell
protected

\( \mathbf{T} \) shape function gradients.

grad_phi_T_cell [ q ] [ k ] denotes \( k \)-th \( \mathbf{T} \) shape function gradient computed in \( q \)-th quadrature point of the cell.

template<int dim>
std::vector< std::vector< Tensor<1,dim> > > FuelCellShop::Equation::NewFicksTransportEquation< dim >::grad_phi_xi_cell
protected

\( \mathbf{x_{i}} \) shape function gradients.

grad_phi_xi_cell [ q ] [ k ] denotes \( k \)-th \( \mathbf{x_{i}} \) shape function gradient computed in \( q \)-th quadrature point of the cell.

template<int dim>
unsigned int FuelCellShop::Equation::NewFicksTransportEquation< 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>
std::string FuelCellShop::Equation::NewFicksTransportEquation< dim >::name_base_variable
protected

Name of the variable we are trying to solve for.

This will be the molar fraction of the variable we are solving for. For example, gas.get_name()<<" molar fraction"

Referenced by FuelCellShop::Equation::NewFicksTransportEquation< dim >::set_solute_and_solvent().

template<int dim>
std::vector< std::vector<double> > FuelCellShop::Equation::NewFicksTransportEquation< dim >::phi_xi_cell
protected

\( \mathbf{x_{i}} \) shape function.

phi_xi_cell [ q ] [ k ] denotes \( k \)-th \( \mathbf{x_{i}} \) shape function computed in \( q \)-th quadrature point of the cell.

Solvent gas for which the equation is setup.

The diffusion coefficient that we would use is given by D_gas,solvent.

VariableInfo structure corresponding to "temperature_of_REV".

VariableInfo structure corresponding to base variable of this equation class, "solute.name()_molar_fraction".


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