OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Virtual class used to provide the interface for all kinetic/reaction children. More...
#include <base_kinetics.h>
Public Member Functions | |
Initalization | |
void | set_electrolyte_potential (const SolutionVariable &phi) |
Set the electrolyte phase potential. | |
void | set_solid_potential (const SolutionVariable &phi) |
Set the solid phase potential. | |
void | set_temperature (const SolutionVariable &temperature) |
Set temperature. | |
void | set_reactant_concentrations (const std::vector< SolutionVariable > &conc_vec) |
Set reactant concentrations. | |
void | set_derivative_flags (const std::vector< VariableNames > &flags) |
Set the variables for which you would like to compute the derivaitives. | |
void | set_catalyst (FuelCellShop::Material::CatalystBase *cat_in) |
Set a pointer to the catalyst that will be used. | |
void | set_electrolyte (FuelCellShop::Material::PolymerElectrolyteBase *electrolyte_in) |
Member function used to set the electrolyte pointer to that used by the application. | |
virtual void | set_reaction_kinetics (const std::string &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) | |
void | set_p_t (const double &P_Tot) |
Set the total gas pressure [Pascals ] in the cell. | |
Information and accessors | |
std::string | get_reaction_name () const |
Returns the name of the reaction that this kinetics class is using. | |
FuelCellShop::Material::CatalystBase * | get_cat () const |
Function to get pointer to catalyst class. | |
virtual void | current_density (std::vector< double > &) |
Function to return the value of the current [A/cm^2 ]. | |
virtual void | derivative_current (std::map< VariableNames, std::vector< double > > &) |
Function to return the derivative of the current density w.r.t solution variables. | |
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. | |
virtual void | OH_coverage (std::vector< double > &) const |
Used to return the coverage of the intermediate species if they are computed. | |
virtual void | O_coverage (std::vector< double > &) const |
Used to return the coverage of the intermediate species if they are computed. | |
Static Public Member Functions | |
Instance Delivery (Public functions) | |
static void | declare_Kinetics_parameters (ParameterHandler ¶m) |
Function used to declare all the data necessary in the parameter files for all BaseKinetics children. | |
static void | set_Kinetics_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
static boost::shared_ptr < FuelCellShop::Kinetics::BaseKinetics > | create_Kinetics (ParameterHandler ¶m, std::string kinetics_name) |
Function called in create_CatalystLayer and used to select the appropriate BaseKinetics type that will be used in the layer. | |
Protected Types | |
Instance Delivery (Types) | |
typedef std::map< std::string, BaseKinetics * > | _mapFactory |
This object is used to store all objects of type BaseKinetics. | |
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. | |
Constructors, destructor, and initalization | |
BaseKinetics () | |
Constructor. | |
virtual | ~BaseKinetics () |
Destructor. | |
virtual void | declare_parameters (ParameterHandler &) const |
Declare parameters for a parameter file. | |
virtual void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) const |
virtual void | initialize (ParameterHandler &) |
Member function used to read in data and initialize the necessary data to compute the coefficients. | |
Static Protected Member Functions | |
Instance Delivery (Private and static) | |
static _mapFactory * | get_mapFactory () |
Protected Attributes | |
Universal constants | |
double | R |
Universal gas constant. | |
double | F |
Universal Farday's constant. | |
double | K |
Boltzmann constant. | |
Solution variables | |
double | p_total |
Total gas pressure [Pascals ] in the cell for isobaric case. | |
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. | |
SolutionVariable | phi_m |
Struct storing a pointer to the solution vector for the electrolyte potential. | |
SolutionVariable | phi_s |
Struct stroing a pointer to the solution vector for the electronic/solid potential. | |
SolutionVariable | T |
Struct stroing a pointer to the solution vector for the temperature. | |
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. | |
std::string | name_reaction_kinetics |
String with the reaction name for which the class returns kinetic parameters. | |
std::vector< VariableNames > | derivative_flags |
Flags for derivatives: These flags are used to request derivatives which are computed using the derivative_current function. | |
unsigned int | n_quad |
Number of quadrature points in the cell. | |
FuelCellShop::Material::CatalystBase * | catalyst |
Pointer to the catalyst object that is created at the application level and passed to the kinetics class using the set_catalyst function. | |
FuelCellShop::Material::PolymerElectrolyteBase * | electrolyte |
Pointer to the electrolyte object created in the application that is used to calculate the properties of the electrolyte in the catalyst layer. | |
virtual void | init_kin_param ()=0 |
Pure abstract method used to initialize certain kinetics parameters which are normally constant, e.g. | |
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.
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.
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.
Here is a code example from ???:
|
protected |
This object is used to store all objects of type BaseKinetics.
|
inlineprotected |
Constructor.
References Constants::F(), Constants::K(), and Constants::R().
|
inlineprotectedvirtual |
Destructor.
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
|
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:
current options are [ TafelKinetics | DualPathKinetics | BVKinetics ]
References get_mapFactory().
|
inlineprotectedvirtual |
This member function is used to create an object of type BaseKinetics.
Reimplemented in FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.
|
inlinevirtual |
Function to return the value of the current [A/cm^2
].
Reimplemented in FuelCellShop::Kinetics::TafelKinetics, FuelCellShop::Kinetics::ButlerVolmerKinetics, and FuelCellShop::Kinetics::DualPathKinetics.
References FuelCellShop::Material::BaseMaterial::name.
|
inlinestatic |
Function used to declare all the data necessary in the parameter files for all BaseKinetics children.
References declare_parameters(), and get_mapFactory().
|
inlineprotectedvirtual |
Declare parameters for a parameter file.
Reimplemented in FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::ButlerVolmerKinetics, and FuelCellShop::Kinetics::TafelKinetics.
Referenced by declare_Kinetics_parameters().
|
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::TafelKinetics, FuelCellShop::Kinetics::ButlerVolmerKinetics, and FuelCellShop::Kinetics::DualPathKinetics.
|
inline |
Function to get pointer to catalyst class.
This function is basically needed by thermal source class.
|
inlinestaticprotected |
Referenced by create_Kinetics(), declare_Kinetics_parameters(), and set_Kinetics_parameters().
|
inline |
Returns the name of the reaction that this kinetics class is using.
|
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::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.
|
inlineprotectedvirtual |
Member function used to read in data and initialize the necessary data to compute the coefficients.
Reimplemented in FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::ButlerVolmerKinetics, and FuelCellShop::Kinetics::TafelKinetics.
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
|
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.
|
inline |
Set the variables for which you would like to compute the derivaitives.
|
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).
|
inline |
Set the electrolyte phase potential.
The potential should be in Volts.
References FuelCellShop::SolutionVariable::get_variablename(), and protonic_electrical_potential.
|
inlinestatic |
|
inline |
Set the total gas pressure [Pascals
] in the cell.
|
inlineprotectedvirtual |
|
inline |
Set reactant concentrations.
The concentrations should be in \( mol/cm^3 \). It should be ensured that no molar fractions are set using this method.
References hydrogen_molar_fraction, oxygen_molar_fraction, and water_molar_fraction.
|
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)
Reimplemented in FuelCellShop::Kinetics::DualPathKinetics.
|
inline |
Set the solid phase potential.
The potential should be in Volts.
References electronic_electrical_potential, and FuelCellShop::SolutionVariable::get_variablename().
|
inline |
Set temperature.
The temperature should be in Kelvin.
References FuelCellShop::SolutionVariable::get_variablename(), and temperature_of_REV.
|
protected |
Pointer to the catalyst object that is created at the application level and passed to the kinetics class using the set_catalyst function.
|
protected |
Flags for derivatives: These flags are used to request derivatives which are computed using the derivative_current function.
|
protected |
Pointer to the electrolyte object created in the application that is used to calculate the properties of the electrolyte in the catalyst layer.
|
protected |
Universal Farday's constant.
|
protected |
Boltzmann constant.
|
protected |
Boolean variable to determine whether init_kin_param has been already called or not.
|
protected |
Number of quadrature points in the cell.
|
protected |
String with the reaction name for which the class returns kinetic parameters.
|
protected |
Total gas pressure [Pascals
] in the cell for isobaric case.
|
protected |
Struct storing a pointer to the solution vector for the electrolyte potential.
|
protected |
Struct stroing a pointer to the solution vector for the electronic/solid potential.
|
protected |
Universal gas constant.
|
protected |
Map of SolutionVariables storing a pointer to the solution vector storing the concentration of each one of the reactants implemented.
|
protected |
Struct stroing a pointer to the solution vector for the temperature.