OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
FuelCellShop::Kinetics::BaseKinetics Class Referenceabstract

Virtual class used to provide the interface for all kinetic/reaction children. More...

#include <base_kinetics.h>

Inheritance diagram for FuelCellShop::Kinetics::BaseKinetics:
Inheritance graph
[legend]
Collaboration diagram for FuelCellShop::Kinetics::BaseKinetics:
Collaboration graph
[legend]

Public Member Functions

virtual ~BaseKinetics ()
 Destructor. More...
 
virtual bool has_coverage (const VariableNames &type)
 
Initalization
void set_electrolyte_potential (const SolutionVariable &phi)
 Set the electrolyte phase potential. More...
 
void set_solid_potential (const SolutionVariable &phi)
 Set the solid phase potential. More...
 
void set_temperature (const SolutionVariable &temperature)
 Set temperature. More...
 
void set_reactant_concentrations (const std::vector< SolutionVariable > &conc_vec)
 Set reactant concentrations at the catalyst/electrolyte interface. More...
 
void set_derivative_flags (const std::vector< VariableNames > &flags)
 Set the variables for which you would like to compute the derivaitives. More...
 
void set_catalyst (FuelCellShop::Material::CatalystBase *cat_in)
 Set a pointer to the catalyst that will be used. More...
 
void set_electrolyte (FuelCellShop::Material::PolymerElectrolyteBase *electrolyte_in)
 Member function used to set the electrolyte pointer to that used by the application. More...
 
virtual void set_reaction_kinetics (const ReactionNames name)
 Member function used to specify the reaction for which the kinetic parameters are needed, for example for a Platinum catalyst, we can specify that we need the kinetic parameters for either the oxygen reduction reaction (ORR) or the hydrogen oxidation reaction (HOR) More...
 
void set_p_t (const double &P_Tot)
 Set the total gas pressure [Pascals] in the cell. More...
 
Information and accessors
ReactionNames get_reaction_name () const
 Returns the name of the reaction that this kinetics class is using. More...
 
FuelCellShop::Material::CatalystBaseget_cat () const
 Function to get pointer to catalyst class. More...
 
virtual void current_density (std::vector< double > &)
 Function to return the value of the current [A/cm^2]. More...
 
virtual void derivative_current (std::map< VariableNames, std::vector< double > > &)
 Function to return the derivative of the current density w.r.t solution variables. More...
 
virtual void compute_coverages (const std::string &name_species, std::vector< double > &coverage) const
 Used to return the coverage of the intermediate species if they are computed. More...
 
virtual void OH_coverage (std::vector< double > &) const
 Used to return the coverage of the intermediate species if they are computed. More...
 
virtual void O_coverage (std::vector< double > &) const
 Used to return the coverage of the intermediate species if they are computed. More...
 

Static Public Member Functions

Instance Delivery (Public functions)
static void declare_Kinetics_parameters (ParameterHandler &param)
 Function used to declare all the data necessary in the parameter files for all BaseKinetics children. More...
 
static boost::shared_ptr
< FuelCellShop::Kinetics::BaseKinetics
create_Kinetics (ParameterHandler &param, std::string kinetics_name)
 Function called in create_CatalystLayer and used to select the appropriate BaseKinetics type that will be used in the layer. More...
 

Protected Types

Instance Delivery (Types)
typedef std::map< std::string,
BaseKinetics * > 
_mapFactory
 This object is used to store all objects of type BaseKinetics. More...
 

Protected Member Functions

Instance Delivery (Private functions)
virtual boost::shared_ptr
< FuelCellShop::Kinetics::BaseKinetics
create_replica ()
 This member function is used to create an object of type BaseKinetics. More...
 
Constructors, destructor, and initalization
 BaseKinetics ()
 Constructor. More...
 
virtual void declare_parameters (ParameterHandler &) const
 Declare parameters for a parameter file. More...
 
virtual void initialize (ParameterHandler &)
 Member function used to read in data and initialize the necessary data to compute the coefficients. More...
 

Static Protected Member Functions

Instance Delivery (Private and static)
static _mapFactoryget_mapFactory ()
 

Protected Attributes

Universal constants
double R
 Universal gas constant. More...
 
double F
 Universal Farday's constant. More...
 
double K
 Boltzmann constant. More...
 
Solution variables
double p_total
 Total gas pressure [Pascals] in the cell for isobaric case. More...
 
std::map< VariableNames,
SolutionVariable
reactants_map
 Map of SolutionVariables storing a pointer to the solution vector storing the concentration of each one of the reactants implemented. More...
 
SolutionVariable phi_m
 Struct storing a pointer to the solution vector for the electrolyte potential. More...
 
SolutionVariable phi_s
 Struct stroing a pointer to the solution vector for the electronic/solid potential. More...
 
SolutionVariable T
 Struct stroing a pointer to the solution vector for the temperature. More...
 

Material objects and other internal data/methods

bool kin_param_initialized
 Boolean variable to determine whether init_kin_param has been already called or not. More...
 
ReactionNames name_reaction_kinetics
 Enumeration with the reaction name for which the class returns kinetic parameters. More...
 
std::vector< VariableNamesderivative_flags
 Flags for derivatives: These flags are used to request derivatives which are computed using the derivative_current function. More...
 
unsigned int n_quad
 Number of quadrature points in the cell. More...
 
FuelCellShop::Material::CatalystBasecatalyst
 Pointer to the catalyst object that is created at the application level and passed to the kinetics class using the set_catalyst function. More...
 
FuelCellShop::Material::PolymerElectrolyteBaseelectrolyte
 Pointer to the electrolyte object created in the application that is used to calculate the properties of the electrolyte in the catalyst layer. More...
 
virtual void init_kin_param ()=0
 Pure abstract method used to initialize certain kinetics parameters which are normally constant, e.g. More...
 

Detailed Description

Virtual class used to provide the interface for all kinetic/reaction children.

The main purpose of kinetic objects is to calculate the rate of the reaction. In the case of fuel cells, instead of the rate we return the current that is produced per unit area of catalyst in the electrode.

To use this class, first the object needs to be initialized by doing two very important things:

No object of type BaseKinetics should ever be created, instead this class is used to initialize pointers of type BaseKinetics and to provide a common interface for all Kinetics classes.

The class has a database of children such that it will declare all necessary parameters for all children in the input file, read the input file, create the appropriate children and return a pointer to BaseKinetics with the children selected.

Usage Details:

In order to create a kinetics object within an reactive layer, the following steps need to be taken.

First, in the CatalystLayer object .h file that needs a kinetics object, create a pointer to a BaseKinetics object, i.e.

* boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics<dim> >ORR;
*

This pointer object will be available anywhere inside the reactive layer. Because we do not want to worry about deleting the pointer afterwards, we use a Boost pointer which has its own memory management algorithms. See the Boost website for more information

Once the pointer is available, we need to do three things in the reactive layer

The object is ready for use now.

For a code example see unit_tests/source/DT_test.cc.

Author
M. Moore, 2011-12
M. Bhaiya, 2013
M. Secanell, 2013

Member Typedef Documentation

typedef std::map< std::string, BaseKinetics* > FuelCellShop::Kinetics::BaseKinetics::_mapFactory
protected

This object is used to store all objects of type BaseKinetics.

Constructor & Destructor Documentation

virtual FuelCellShop::Kinetics::BaseKinetics::~BaseKinetics ( )
inlinevirtual

Destructor.

FuelCellShop::Kinetics::BaseKinetics::BaseKinetics ( )
inlineprotected

Constructor.

References Constants::F(), Constants::K(), and Constants::R().

Here is the call graph for this function:

Member Function Documentation

virtual void FuelCellShop::Kinetics::BaseKinetics::compute_coverages ( const std::string &  name_species,
std::vector< double > &  coverage 
) const
inlinevirtual

Used to return the coverage of the intermediate species if they are computed.

References FcstUtilities::log.

static boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > FuelCellShop::Kinetics::BaseKinetics::create_Kinetics ( ParameterHandler &  param,
std::string  kinetics_name 
)
inlinestatic

Function called in create_CatalystLayer and used to select the appropriate BaseKinetics type that will be used in the layer.

The name of the kinetics object to be used is provided in kinetics_name.

The name of the kinetics object is provided in the ParameterHandler in the CatalystLayer subsection as follows:

* subsection Catalyst Layer Properties <- This name is the name of the catalyst layer subsection where the kinetics are taking place.
* (...)
* set Kinetics type = TafelKinetics
* (...)
* end
*

current options are [ TafelKinetics | DoubleTrapKinetics | DualPathKinetics | BVKinetics ]

References get_mapFactory(), and FcstUtilities::log.

Here is the call graph for this function:

virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > FuelCellShop::Kinetics::BaseKinetics::create_replica ( )
inlineprotectedvirtual

This member function is used to create an object of type BaseKinetics.

Warning
This class MUST be redeclared in every child.

Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics, FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.

References FcstUtilities::log.

virtual void FuelCellShop::Kinetics::BaseKinetics::current_density ( std::vector< double > &  )
inlinevirtual
static void FuelCellShop::Kinetics::BaseKinetics::declare_Kinetics_parameters ( ParameterHandler &  param)
inlinestatic

Function used to declare all the data necessary in the parameter files for all BaseKinetics children.

References get_mapFactory().

Here is the call graph for this function:

virtual void FuelCellShop::Kinetics::BaseKinetics::declare_parameters ( ParameterHandler &  ) const
inlineprotectedvirtual
virtual void FuelCellShop::Kinetics::BaseKinetics::derivative_current ( std::map< VariableNames, std::vector< double > > &  )
inlinevirtual

Function to return the derivative of the current density w.r.t solution variables.

It returns a map of vectors containing derivative w.r.t solution variables / design variables set using set_derivative_flags method. Each vector can be accessed by using Key of the map, which correpsonds to the VariableNames (solution/design variable). This method takes input map by reference, hence the map is needed to be created at application/equation level with default arguments and passed inside this method.

Reimplemented in FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, FuelCellShop::Kinetics::DoubleTrapKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.

References FcstUtilities::log.

FuelCellShop::Material::CatalystBase* FuelCellShop::Kinetics::BaseKinetics::get_cat ( ) const
inline

Function to get pointer to catalyst class.

This function is basically needed by thermal source class.

static _mapFactory* FuelCellShop::Kinetics::BaseKinetics::get_mapFactory ( )
inlinestaticprotected

Referenced by create_Kinetics(), and declare_Kinetics_parameters().

Here is the caller graph for this function:

ReactionNames FuelCellShop::Kinetics::BaseKinetics::get_reaction_name ( ) const
inline

Returns the name of the reaction that this kinetics class is using.

virtual bool FuelCellShop::Kinetics::BaseKinetics::has_coverage ( const VariableNames type)
inlinevirtual
virtual void FuelCellShop::Kinetics::BaseKinetics::init_kin_param ( )
protectedpure virtual

Pure abstract method used to initialize certain kinetics parameters which are normally constant, e.g.

reference concentrations, reaction order etc. This function is necessarily required to be reimplemented in all of the child kinetics classes.

Implemented in FuelCellShop::Kinetics::DoubleTrapKinetics, FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.

virtual void FuelCellShop::Kinetics::BaseKinetics::initialize ( ParameterHandler &  )
inlineprotectedvirtual

Member function used to read in data and initialize the necessary data to compute the coefficients.

Reimplemented in FuelCellShop::Kinetics::ButlerVolmerKinetics, FuelCellShop::Kinetics::DoubleTrapKinetics, FuelCellShop::Kinetics::DualPathKinetics, and FuelCellShop::Kinetics::TafelKinetics.

References FcstUtilities::log.

virtual void FuelCellShop::Kinetics::BaseKinetics::O_coverage ( std::vector< double > &  ) const
inlinevirtual

Used to return the coverage of the intermediate species if they are computed.

Deprecated:

Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics.

References FcstUtilities::log.

virtual void FuelCellShop::Kinetics::BaseKinetics::OH_coverage ( std::vector< double > &  ) const
inlinevirtual

Used to return the coverage of the intermediate species if they are computed.

Deprecated:

Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics.

References FcstUtilities::log.

void FuelCellShop::Kinetics::BaseKinetics::set_catalyst ( FuelCellShop::Material::CatalystBase cat_in)
inline

Set a pointer to the catalyst that will be used.

The catalyst is specified at the application level and passed to the kinetics class using this function.

void FuelCellShop::Kinetics::BaseKinetics::set_derivative_flags ( const std::vector< VariableNames > &  flags)
inline

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

void FuelCellShop::Kinetics::BaseKinetics::set_electrolyte ( FuelCellShop::Material::PolymerElectrolyteBase electrolyte_in)
inline

Member function used to set the electrolyte pointer to that used by the application.

Needed so that conversion from molar fraction to concentration can be done. (Henry's constant in particular is needed).

void FuelCellShop::Kinetics::BaseKinetics::set_electrolyte_potential ( const SolutionVariable phi)
inline

Set the electrolyte phase potential.

The potential should be in Volts.

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

Here is the call graph for this function:

void FuelCellShop::Kinetics::BaseKinetics::set_p_t ( const double &  P_Tot)
inline

Set the total gas pressure [Pascals] in the cell.

void FuelCellShop::Kinetics::BaseKinetics::set_reactant_concentrations ( const std::vector< SolutionVariable > &  conc_vec)
inline

Set reactant concentrations at the catalyst/electrolyte interface.

This should be the concentration in Nafion.

The concentrations should be in $ mol/cm^3 $.

Warning
It should be ensured that no molar fractions are set using this method.

References hydrogen_molar_fraction, oxygen_molar_fraction, and water_molar_fraction.

virtual void FuelCellShop::Kinetics::BaseKinetics::set_reaction_kinetics ( const ReactionNames  name)
inlinevirtual

Member function used to specify the reaction for which the kinetic parameters are needed, for example for a Platinum catalyst, we can specify that we need the kinetic parameters for either the oxygen reduction reaction (ORR) or the hydrogen oxidation reaction (HOR)

void FuelCellShop::Kinetics::BaseKinetics::set_solid_potential ( const SolutionVariable phi)
inline

Set the solid phase potential.

The potential should be in Volts.

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

Here is the call graph for this function:

void FuelCellShop::Kinetics::BaseKinetics::set_temperature ( const SolutionVariable temperature)
inline

Set temperature.

The temperature should be in Kelvin.

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

Here is the call graph for this function:

Member Data Documentation

FuelCellShop::Material::CatalystBase* FuelCellShop::Kinetics::BaseKinetics::catalyst
protected

Pointer to the catalyst object that is created at the application level and passed to the kinetics class using the set_catalyst function.

std::vector<VariableNames> FuelCellShop::Kinetics::BaseKinetics::derivative_flags
protected

Flags for derivatives: These flags are used to request derivatives which are computed using the derivative_current function.

FuelCellShop::Material::PolymerElectrolyteBase* FuelCellShop::Kinetics::BaseKinetics::electrolyte
protected

Pointer to the electrolyte object created in the application that is used to calculate the properties of the electrolyte in the catalyst layer.

double FuelCellShop::Kinetics::BaseKinetics::F
protected

Universal Farday's constant.

double FuelCellShop::Kinetics::BaseKinetics::K
protected

Boltzmann constant.

bool FuelCellShop::Kinetics::BaseKinetics::kin_param_initialized
protected

Boolean variable to determine whether init_kin_param has been already called or not.

unsigned int FuelCellShop::Kinetics::BaseKinetics::n_quad
protected

Number of quadrature points in the cell.

ReactionNames FuelCellShop::Kinetics::BaseKinetics::name_reaction_kinetics
protected

Enumeration with the reaction name for which the class returns kinetic parameters.

double FuelCellShop::Kinetics::BaseKinetics::p_total
protected

Total gas pressure [Pascals] in the cell for isobaric case.

SolutionVariable FuelCellShop::Kinetics::BaseKinetics::phi_m
protected

Struct storing a pointer to the solution vector for the electrolyte potential.

SolutionVariable FuelCellShop::Kinetics::BaseKinetics::phi_s
protected

Struct stroing a pointer to the solution vector for the electronic/solid potential.

double FuelCellShop::Kinetics::BaseKinetics::R
protected

Universal gas constant.

std::map< VariableNames, SolutionVariable > FuelCellShop::Kinetics::BaseKinetics::reactants_map
protected

Map of SolutionVariables storing a pointer to the solution vector storing the concentration of each one of the reactants implemented.

SolutionVariable FuelCellShop::Kinetics::BaseKinetics::T
protected

Struct stroing a pointer to the solution vector for the temperature.


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