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

This class implements Fick's law of diffusion. More...

#include <ficks_transport_equation.h>

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

Public Member Functions

 FicksTransportEquation (FuelCell::SystemManagement &system_management)
 Constructor.
 
 FicksTransportEquation (FuelCell::SystemManagement &system_management, FuelCellShop::Material::PureGas *solute, FuelCellShop::Material::PureGas *solvent)
 Constructor.
 
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.
 
virtual ~FicksTransportEquation ()
 Destructor.
 
virtual void declare_parameters (ParameterHandler &param)
 Declare parameters.
 
virtual void initialize (ParameterHandler &param)
 Initialize parameters.
 
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.
 
virtual const couplings_mapget_internal_cell_couplings () const
 The function returns internal_cell_couplings of this class,.
 
virtual void print_equation_info () const
 The function printing out the equations info.
 
 DeclException1 (GasDoesNotExistInGDL, std::string,<< "Gas "<< arg1<< " does not exist in the Gas diffusion layer")
 
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

virtual void make_internal_cell_couplings ()
 This function fills out internal_cell_couplings of this class based on the structure of the equations at hand.
 
- 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_assemblers_generic_constant_data ()
 This function is overridden in the derived equation classes.
 
virtual void make_assemblers_cell_constant_data (const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info)
 This function is overridden in the derived equation classes.
 
virtual void make_assemblers_bdry_constant_data (const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info)
 This function is overridden in the derived equation classes.
 
virtual void make_assemblers_cell_variable_data (const typename AppFrame::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 This function is overridden in the derived equation classes.
 
virtual void make_assemblers_bdry_variable_data (const typename AppFrame::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
 This function is overridden in the derived equation classes.
 
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_boundary_types ()
 This function fills out boundary_types 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

FuelCellShop::Material::PureGasgas
 Gas for which the equation is setup.
 
FuelCellShop::Material::PureGassolvent
 Solvent gas for which the equation is setup.
 
std::string name_equation
 Name of the equation that we are solving for.
 
std::string name_solution
 Name of the variable we are trying to solve for.
 
couplings_map internal_cell_couplings
 internal_cell_couplings object.
 
std::vector< unsigned int > matrix_block_indices
 The system matrix block indices related to the equations implemented in this class and to the entire problem at hand.
 
std::vector< unsigned int > component_indices
 The component indices related to the equations implemented in this class and to the entire problem at hand.
 
- 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::FicksTransportEquation< dim >

This class implements Fick's law of diffusion.

Please note that this equation works for any gas. The gas type is not selected in the class. Instead, an object of type BaseLayer is used to pass the information regarding the type of gas and effective properties.

*TODO Dynamic type casting has to be modified so that the base class type_id is used in the comparision in assemble_cell_matrix

Author
Marc Secanell, 2012

Constructor & Destructor Documentation

Constructor.

If using this constructor, use member function set_solute_and_solvent to setup the gases and name of the equation

Constructor.

Destructor.

Member Function Documentation

template<int dim>
virtual void FuelCellShop::Equation::FicksTransportEquation< 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.

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

template<int dim>
virtual void FuelCellShop::Equation::FicksTransportEquation< 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.

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

template<int dim>
virtual void FuelCellShop::Equation::FicksTransportEquation< 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::FicksTransportEquation< 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::FicksTransportEquation< 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::FicksTransportEquation< dim >::declare_parameters ( ParameterHandler &  param)
virtual

Declare parameters.

template<int dim>
FuelCellShop::Equation::FicksTransportEquation< dim >::DeclException1 ( GasDoesNotExistInGDL  ,
std::string  ,
<< "Gas "<< arg1<< " does not exist in the Gas diffusion layer"   
)
template<int dim>
virtual const couplings_map& FuelCellShop::Equation::FicksTransportEquation< dim >::get_internal_cell_couplings ( ) const
inlinevirtual

The function returns internal_cell_couplings of this class,.

References FuelCellShop::Equation::FicksTransportEquation< dim >::internal_cell_couplings.

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

Initialize parameters.

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

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

This function fills out internal_cell_couplings of this class based on the structure of the equations at hand.

The names of variables and equations must match those defined in SystemManagement class

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

template<int dim>
virtual void FuelCellShop::Equation::FicksTransportEquation< 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::FicksTransportEquation< 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::FicksTransportEquation< dim >::gas, FuelCellShop::Material::PureGas::get_name(), FuelCellShop::Equation::FicksTransportEquation< dim >::name_equation, and FuelCellShop::Equation::FicksTransportEquation< dim >::name_solution.

Here is the call graph for this function:

Member Data Documentation

template<int dim>
std::vector<unsigned int> FuelCellShop::Equation::FicksTransportEquation< dim >::component_indices
protected

The component indices related to the equations implemented in this class and to the entire problem at hand.

Gas for which the equation is setup.

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

template<int dim>
couplings_map FuelCellShop::Equation::FicksTransportEquation< dim >::internal_cell_couplings
protected
template<int dim>
std::vector<unsigned int> FuelCellShop::Equation::FicksTransportEquation< dim >::matrix_block_indices
protected

The system matrix block indices related to the equations implemented in this class and to the entire problem at hand.

template<int dim>
std::string FuelCellShop::Equation::FicksTransportEquation< dim >::name_equation
protected

Name of the equation that we are solving for.

The name depends on the type of gas we use. It is set to "Ficks Transport Equation - "<<gas.get_name();

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

template<int dim>
std::string FuelCellShop::Equation::FicksTransportEquation< dim >::name_solution
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::FicksTransportEquation< dim >::set_solute_and_solvent().

Solvent gas for which the equation is setup.

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


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