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::Layer::PorousLayer< dim > Class Template Reference

Virtual class used to implement properties that are characteristic of a void layer or a porous layer. More...

#include <porous_layer.h>

Inheritance diagram for FuelCellShop::Layer::PorousLayer< dim >:
Inheritance graph
[legend]
Collaboration diagram for FuelCellShop::Layer::PorousLayer< dim >:
Collaboration graph
[legend]

Public Member Functions

Initalization
void set_gases_and_compute (std::vector< FuelCellShop::Material::PureGas * > &gases_in, const double &pressure_in, const double &temperature_in)
 Member function used to store all the gases that are in the pore space in the gas diffusion layer as well as their temperature [Kelvin] and total pressure [atm].
 
void compute_gas_diffusion (FuelCellShop::Material::PureGas *solute_gas, FuelCellShop::Material::PureGas *solvent_gas)
 Member function used to compute bulk diffusion coefficients and derivatives w.r.t temperature for non-isothermal case and store inside the layer.
 
void set_gases (std::vector< FuelCellShop::Material::PureGas * > &gases_in, const double &pressure_in)
 Member function used to store all the gases that are in the pore space in the porous layer.
 
void set_temperature (const SolutionVariable &T_in)
 Member function used to set the temperature ]Kelvin] at every quadrature point inside the cell.
 
Accessors and info
FuelCellShop::Material::PureGasget_gas_pointer (int index) const
 Return the FuelCellShop::Material::PureGas pointer that is stored inside the class in the ith position.
 
std::vector
< FuelCellShop::Material::PureGas * > 
get_gases () const
 Returns the vector of FuelCellShop::Material::PureGas pointers stored in the porous layer.
 
void get_gas_index (FuelCellShop::Material::PureGas *gas_type, int &index) const
 Return the gas index in the GDL class.
 
void get_T_and_p (double &T, double &p) const
 Return the constant temperature [Kelvin] and constant pressure [atm] inside the layer.
 
void get_p (double &p) const
 Return the constant pressure [atm] inside the layer.
 
virtual void print_layer_properties () const
 This member function is a virtual class that can be used to output to screen information from the layer.
 
virtual bool test_layer () const
 This virtual class should be used for any derived class to be able to test the functionality of the class.
 
- Public Member Functions inherited from FuelCellShop::Layer::BaseLayer< dim >
virtual void set_derivative_flags (const std::vector< VariableNames > &flags)
 Set the variables for which you would like to compute the derivatives.
 
void set_position (std::vector< Point< dim > > &p)
 Member function used by some applications such as dummyGDL in order to know which value to return.
 
virtual void set_constant_solution (const double &value, const VariableNames &name)
 Set those solution variables which are constant in the particular application.
 
virtual void set_solution (const std::vector< SolutionVariable > &)
 If the effective properties in the layer depend on the solution, the solution for a given cell should be passed to the class using this member function.
 
bool belongs_to_material (const char material_id)
 Check if a given cell belongs to the catalyst layer.
 
const std::string & name_material ()
 Return the name of the layer.
 
virtual const std::type_info & get_base_type () const
 This member function return the name of the type of layer, i.e.
 
virtual bool test_layer ()
 This virtual class should be used for any derived class to be able to test the functionality of the class.
 
unsigned int get_material_id ()
 Return the material id of the layer.
 

Protected Member Functions

Constructors, destructor, and initalization
 PorousLayer (const std::string &name)
 Constructor.
 
 PorousLayer ()
 Constructor.
 
virtual ~PorousLayer ()
 Destructor.
 
virtual void declare_parameters (const std::string &name, ParameterHandler &param) const
 Declare parameters for a parameter file.
 
virtual void declare_parameters (ParameterHandler &param) const
 Declare parameters for a parameter file.
 
virtual void initialize (ParameterHandler &param)
 Member function used to read in data and initialize the necessary data to compute the coefficients.
 
void set_parameters (const std::string &object_name, const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Member function used to change the values in the parameter file for a given list of parameters.
 
virtual void set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param)
 Member function used to change the values in the parameter file for a given list of parameters.
 
Internal accessors and info
virtual void gas_diffusion_coefficients (Table< 2, double > &) const
 Return the molecular diffusivty all the gases assigned to the layer using set_gases_and_compute.
 
virtual void derivative_gas_diffusion_coefficients (std::vector< Table< 2, double > > &) const
 Return the derivative of the molecular diffusion coefficient with respect to the derivative flags for all the gases assigned to the layer using set_gases_and_compute.
 
- Protected Member Functions inherited from FuelCellShop::Layer::BaseLayer< dim >
 BaseLayer ()
 Constructor.
 
 BaseLayer (const std::string &name)
 Constructor.
 
virtual ~BaseLayer ()
 Destructor.
 

Protected Attributes

Internal variables
std::string diffusion_species_name
 If GDL properties are stored inside the class (e.g DummyGDL) then, return the property stored under coefficient_name name.
 
std::vector
< FuelCellShop::Material::PureGas * > 
gases
 Gases inside the layer.
 
double temperature
 Temperature [Kelvin] used to compute gas diffusivity.
 
double pressure
 Total pressure [atm] used to compute gas diffusivity.
 
SolutionVariable T_vector
 Temperature at every quadrature point inside the cell.
 
Table< 2, double > D_ECtheory
 Tensor of diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.
 
std::vector< Table< 2, double > > dD_ECtheory_dx
 Vector of tensors for the derivative of the diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.
 
std::vector< double > D_bulk
 Vector of bulk diffusion coefficients at every quadrature point inside the cell.
 
std::vector< double > dD_bulk_dT
 Vector of derivative of bulk diffusion coefficients w.r.t temperature, at every quadrature point inside the cell.
 
- Protected Attributes inherited from FuelCellShop::Layer::BaseLayer< dim >
const std::string name
 Name of the layer.
 
unsigned int material_id
 Identification number.
 
std::vector< Point< dim > > point
 Coordinates of the point where we would like to compute the effective properties.
 
std::vector< VariableNamesderivative_flags
 Flags for derivatives: These flags are used to request derivatives.
 
std::map< VariableNames, double > constant_solutions
 Map storing values of solution variables constant in a particular application.
 

Detailed Description

template<int dim>
class FuelCellShop::Layer::PorousLayer< dim >

Virtual class used to implement properties that are characteristic of a void layer or a porous layer.

This layer is used to setup information needed to compute molecular diffusivities and Knudsen diffusivities (pending implementation) for any gases. Therefore, it provides member functions to specify the gases that exist within the layer as well as their temperature and pressure.

It also inherits all properties of BaseLayer.

Note you cannot make an object of this class since it still lacks many member functions that are necessary for a full layer implementation.

Author
M. Secanell, 2013

Constructor & Destructor Documentation

template<int dim>
FuelCellShop::Layer::PorousLayer< dim >::PorousLayer ( const std::string &  name)
inlineprotected

Constructor.

References temperature_of_REV, and total_pressure.

template<int dim>
FuelCellShop::Layer::PorousLayer< dim >::PorousLayer ( )
inlineprotected

Constructor.

Warning
For internal use only
template<int dim>
virtual FuelCellShop::Layer::PorousLayer< dim >::~PorousLayer ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::compute_gas_diffusion ( FuelCellShop::Material::PureGas solute_gas,
FuelCellShop::Material::PureGas solvent_gas 
)

Member function used to compute bulk diffusion coefficients and derivatives w.r.t temperature for non-isothermal case and store inside the layer.

This function takes solute and solvent gas as an input argument (Fick's diffusion model). Before calling this function, pressure [atm] must be set inside the layer, and temperature [Kelvin] must be set using set_temperature method.

template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::declare_parameters ( const std::string &  name,
ParameterHandler &  param 
) const
inlineprotectedvirtual
template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::declare_parameters ( ParameterHandler &  param) const
inlineprotectedvirtual
template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::derivative_gas_diffusion_coefficients ( std::vector< Table< 2, double > > &  ) const
protectedvirtual

Return the derivative of the molecular diffusion coefficient with respect to the derivative flags for all the gases assigned to the layer using set_gases_and_compute.

This routine uses FuelCellShop::Mixture::ChapmanEnskog to compute the binary diffusivity for each gas with respect to each other. If the layer contains three gases the vector returns D12, D13, D23. For 4 gases, it returns D12, D13, D14, D23, D24, D34 . Derivatives are provided in the vector w.r.t following parameters in the same order as below:

template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::gas_diffusion_coefficients ( Table< 2, double > &  ) const
protectedvirtual

Return the molecular diffusivty all the gases assigned to the layer using set_gases_and_compute.

This routine uses FuelCellShop::Mixture::ChapmanEnskog to compute the binary diffusivity for each gas with respect to each other. If the layer contains three gases the vector returns D12, D13, D23. For 4 gases, it returns D12, D13, D14, D23, D24, D34.

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::get_gas_index ( FuelCellShop::Material::PureGas gas_type,
int &  index 
) const

Return the gas index in the GDL class.

If the gas does not exist in the GDL it will return -1 as the index.

template<int dim>
FuelCellShop::Material::PureGas* FuelCellShop::Layer::PorousLayer< dim >::get_gas_pointer ( int  index) const
inline

Return the FuelCellShop::Material::PureGas pointer that is stored inside the class in the ith position.

The diffusion coefficient D[i][j] would be the diffusion coefficient of gas type i with j.

template<int dim>
std::vector<FuelCellShop::Material::PureGas*> FuelCellShop::Layer::PorousLayer< dim >::get_gases ( ) const
inline

Returns the vector of FuelCellShop::Material::PureGas pointers stored in the porous layer.

This method is useful to access all gases which are being transported inside a particular porous layer object.

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::get_p ( double &  p) const
inline

Return the constant pressure [atm] inside the layer.

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::get_T_and_p ( double &  T,
double &  p 
) const
inline

Return the constant temperature [Kelvin] and constant pressure [atm] inside the layer.

template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::initialize ( ParameterHandler &  param)
protectedvirtual
template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::print_layer_properties ( ) const
inlinevirtual

This member function is a virtual class that can be used to output to screen information from the layer.

This function should be re-implemented in each layer with data that is relevant in each case.

Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.

Reimplemented in FuelCellShop::Layer::AgglomerateCL< dim >, and FuelCellShop::Layer::ConventionalCL< dim >.

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::set_gases ( std::vector< FuelCellShop::Material::PureGas * > &  gases_in,
const double &  pressure_in 
)
inline

Member function used to store all the gases that are in the pore space in the porous layer.

Besides this, it takes total pressure [atm] as input. This method can be particulary used for non-isothermal applications when temperature changes in every cell, hence this method doesn't compute the diffusion coefficients but store the relevant constant data.

Note
Please ensure that in the case of Fick's diffusion model, solvent gas should be the last object inside the input vector. On not ensuring this may not give any errors, as this function may also be used for multi-component gas transport but for fickian diffusion, it may give wrong results.
template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::set_gases_and_compute ( std::vector< FuelCellShop::Material::PureGas * > &  gases_in,
const double &  pressure_in,
const double &  temperature_in 
)

Member function used to store all the gases that are in the pore space in the gas diffusion layer as well as their temperature [Kelvin] and total pressure [atm].

Then, when computing diffusion, the class will return each one of the diffusion coefficients for the gases. For example, if we pass a vector with for gases, say oxygen and nitrogen, effective_gas_diffusivity will return \( D_{N_2,O_2} \)

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::set_parameters ( const std::string &  object_name,
const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
)
inlineprotectedvirtual

Member function used to change the values in the parameter file for a given list of parameters.

  • object_name is the name of the subsection that will be used to declare all the parameters for an object of this type.
  • name_param should ideally contain the string as it would appear in the input file, i.e. "Thickness of the agglomerate radius"
  • value_param contains the value that the variable should be set at
  • param is the ParameterHandler that contains all the information that has been read from file

Note that this is a static function, therefore it requires as the first argument the string with the name of the section you would like to create for the object of this class.

Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.

References FuelCellShop::Layer::BaseLayer< dim >::set_parameters().

Here is the call graph for this function:

template<int dim>
virtual void FuelCellShop::Layer::PorousLayer< dim >::set_parameters ( const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
)
inlineprotectedvirtual

Member function used to change the values in the parameter file for a given list of parameters.

  • name_param should ideally contain the string as it would appear in the input file, i.e. "Thickness of the agglomerate radius"
  • value_param contains the value that the variable should be set at
  • param is the ParameterHandler that contains all the information that has been read from file

Reimplemented from FuelCellShop::Layer::BaseLayer< dim >.

Reimplemented in FuelCellShop::Layer::DesignMPL< dim >, and FuelCellShop::Layer::DummyGDL< dim >.

template<int dim>
void FuelCellShop::Layer::PorousLayer< dim >::set_temperature ( const SolutionVariable T_in)
inline

Member function used to set the temperature ]Kelvin] at every quadrature point inside the cell.

This function should particulary be used in the case of non-isothermal application.

References FuelCellShop::SolutionVariable::get_variablename(), and temperature_of_REV.

Here is the call graph for this function:

template<int dim>
virtual bool FuelCellShop::Layer::PorousLayer< dim >::test_layer ( ) const
virtual

This virtual class should be used for any derived class to be able to test the functionality of the class.

Member Data Documentation

template<int dim>
std::vector<double> FuelCellShop::Layer::PorousLayer< dim >::D_bulk
protected

Vector of bulk diffusion coefficients at every quadrature point inside the cell.

This particulary stores non-isothermal diffusion coefficients computed using compute_gas_diffusion method.

template<int dim>
Table< 2, double > FuelCellShop::Layer::PorousLayer< dim >::D_ECtheory
protected

Tensor of diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.

template<int dim>
std::vector<double> FuelCellShop::Layer::PorousLayer< dim >::dD_bulk_dT
protected

Vector of derivative of bulk diffusion coefficients w.r.t temperature, at every quadrature point inside the cell.

These are computed using compute_gas_diffusion method.

template<int dim>
std::vector< Table< 2, double > > FuelCellShop::Layer::PorousLayer< dim >::dD_ECtheory_dx
protected

Vector of tensors for the derivative of the diffusion coefficients – This are computed with setting up the gas so that they do not need to be recomputed all the time.

template<int dim>
std::string FuelCellShop::Layer::PorousLayer< dim >::diffusion_species_name
protected

If GDL properties are stored inside the class (e.g DummyGDL) then, return the property stored under coefficient_name name.

template<int dim>
std::vector<FuelCellShop::Material::PureGas*> FuelCellShop::Layer::PorousLayer< dim >::gases
protected

Gases inside the layer.

template<int dim>
double FuelCellShop::Layer::PorousLayer< dim >::pressure
protected

Total pressure [atm] used to compute gas diffusivity.

template<int dim>
SolutionVariable FuelCellShop::Layer::PorousLayer< dim >::T_vector
protected

Temperature at every quadrature point inside the cell.

template<int dim>
double FuelCellShop::Layer::PorousLayer< dim >::temperature
protected

Temperature [Kelvin] used to compute gas diffusivity.


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