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

Virtual class used to characterize a generic layer interface. More...

#include <base_layer.h>

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

Public Member Functions

Initialization
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.
 
Accessors and info
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 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 ()
 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
 BaseLayer ()
 Constructor.
 
 BaseLayer (const std::string &name)
 Constructor.
 
virtual ~BaseLayer ()
 Destructor.
 
virtual void declare_parameters (const std::string &object_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 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)
 Set parameters in parameter file.
 
virtual void initialize (ParameterHandler &param)
 Member function used to read in data and initialize the necessary data to compute the coefficients.
 

Protected Attributes

Basic layer information
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::BaseLayer< dim >

Virtual class used to characterize a generic layer interface.

Note that his class does not contain enough information to characterize any useful layer yet. Please see children.

The base layer is used to store an identification number for the layer and the geometry of the layer.

Author
M. Secanell
M. Bhaiya
V. Zingan

Constructor & Destructor Documentation

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

Constructor.

Warning
For internal use only
template<int dim>
FuelCellShop::Layer::BaseLayer< dim >::BaseLayer ( const std::string &  name)
protected

Constructor.

template<int dim>
virtual FuelCellShop::Layer::BaseLayer< dim >::~BaseLayer ( )
protectedvirtual

Destructor.

Member Function Documentation

template<int dim>
bool FuelCellShop::Layer::BaseLayer< dim >::belongs_to_material ( const char  material_id)

Check if a given cell belongs to the catalyst layer.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::declare_parameters ( const std::string &  object_name,
ParameterHandler &  param 
) const
inlineprotectedvirtual
template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::declare_parameters ( ParameterHandler &  param) const
inlineprotectedvirtual
template<int dim>
virtual const std::type_info& FuelCellShop::Layer::BaseLayer< dim >::get_base_type ( ) const
inlinevirtual

This member function return the name of the type of layer, i.e.

Note that this is necessary if we want to find out not the name of the actual class which can be obtain using

const std::type_info& name = typeid(*this)

but the name of the parent class.

Note
Do not implement this class anywhere other than the following "base" classes:

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, FuelCellShop::Layer::GasDiffusionLayer< dim >, FuelCellShop::Layer::MicroPorousLayer< dim >, FuelCellShop::Layer::MembraneLayer< dim >, and FuelCellShop::Layer::SolidLayer< dim >.

template<int dim>
unsigned int FuelCellShop::Layer::BaseLayer< dim >::get_material_id ( )
inline

Return the material id of the layer.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::initialize ( ParameterHandler &  param)
protectedvirtual
template<int dim>
const std::string& FuelCellShop::Layer::BaseLayer< dim >::name_material ( )
inline

Return the name of the layer.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::print_layer_properties ( ) const
virtual

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 in FuelCellShop::Layer::AgglomerateCL< dim >, FuelCellShop::Layer::PorousLayer< dim >, and FuelCellShop::Layer::ConventionalCL< dim >.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_constant_solution ( const double &  value,
const VariableNames name 
)
inlinevirtual

Set those solution variables which are constant in the particular application.

If the effective properties in the layer depend on other variables that are usually part of the solution vector but are assumed to be constant in this simulation, the const solution value should be passed to the class using this member function. This method should be called in the initialization section of the application. This function takes value to be set as the first argument and the VariableNames as second argument. For instance, it's required to store constant temperature value for an isothermal application, in that case this method can be used. e.g., in order to set temperature as 353.0 [Kelvin] in the layer, you can use the following code:

// In the initialization section of the application.
layer.set_constant_solution(353.0, VariableNames::temperature_of_REV);

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, and FuelCellShop::Layer::MembraneLayer< dim >.

Referenced by FuelCellShop::Layer::MembraneLayer< dim >::set_constant_solution(), and FuelCellShop::Layer::CatalystLayer< dim >::set_constant_solution().

Here is the caller graph for this function:

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_derivative_flags ( const std::vector< VariableNames > &  flags)
inlinevirtual

Set the variables for which you would like to compute the derivatives.

It takes a vector of VariableNames as an input argument.

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >, and FuelCellShop::Layer::MembraneLayer< dim >.

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

  • 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 in FuelCellShop::Layer::PorousLayer< dim >.

Referenced by FuelCellShop::Layer::PorousLayer< dim >::set_parameters().

Here is the caller graph for this function:

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

Member function used by some applications such as dummyGDL in order to know which value to return.

For other classes this class is not used.

template<int dim>
virtual void FuelCellShop::Layer::BaseLayer< dim >::set_solution ( const std::vector< SolutionVariable > &  )
inlinevirtual

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.

It is used to set SolutionVariable structure inside the layer. This structure stores the solution variable values at all quadrature points in the cell. For sample usage details, please see documentation of FuelCellShop::SolutionVariable structure.

Note, this function in the base layer sets the interface. It has to be reimplemented in respective child layer classes for respective uses.

Note
Use only for solution variables.

Reimplemented in FuelCellShop::Layer::CatalystLayer< dim >.

References FuelCellShop::Layer::BaseLayer< dim >::name.

template<int dim>
virtual bool FuelCellShop::Layer::BaseLayer< dim >::test_layer ( )
inlinevirtual

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::map< VariableNames, double > FuelCellShop::Layer::BaseLayer< dim >::constant_solutions
protected

Map storing values of solution variables constant in a particular application.

template<int dim>
std::vector<VariableNames> FuelCellShop::Layer::BaseLayer< dim >::derivative_flags
protected

Flags for derivatives: These flags are used to request derivatives.

Referenced by FuelCellShop::Layer::MembraneLayer< dim >::set_derivative_flags(), and FuelCellShop::Layer::CatalystLayer< dim >::set_derivative_flags().

template<int dim>
unsigned int FuelCellShop::Layer::BaseLayer< dim >::material_id
protected

Identification number.

template<int dim>
const std::string FuelCellShop::Layer::BaseLayer< dim >::name
protected
template<int dim>
std::vector<Point<dim> > FuelCellShop::Layer::BaseLayer< dim >::point
protected

Coordinates of the point where we would like to compute the effective properties.


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