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 | |
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::CatalystBase * | get_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 ¶m) |
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 ¶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. 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 _mapFactory * | get_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< VariableNames > | derivative_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::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. More... | |
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. More... | |
virtual void | init_kin_param ()=0 |
Pure abstract method used to initialize certain kinetics parameters which are normally constant, e.g. More... | |
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.
For a code example see unit_tests/source/DT_test.cc.
|
protected |
This object is used to store all objects of type BaseKinetics.
|
inlinevirtual |
Destructor.
|
inlineprotected |
Constructor.
References Constants::F(), Constants::K(), and Constants::R().
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
References FcstUtilities::log.
|
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 | DoubleTrapKinetics | DualPathKinetics | BVKinetics ]
References get_mapFactory(), and FcstUtilities::log.
|
inlineprotectedvirtual |
This member function is used to create an object of type BaseKinetics.
Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics, FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.
References FcstUtilities::log.
|
inlinevirtual |
Function to return the value of the current [A/cm^2
].
Reimplemented in FuelCellShop::Kinetics::DualPathKinetics, FuelCellShop::Kinetics::TafelKinetics, FuelCellShop::Kinetics::DoubleTrapKinetics, and FuelCellShop::Kinetics::ButlerVolmerKinetics.
References FcstUtilities::log.
|
inlinestatic |
Function used to declare all the data necessary in the parameter files for all BaseKinetics children.
References get_mapFactory().
|
inlineprotectedvirtual |
Declare parameters for a parameter file.
Reimplemented in FuelCellShop::Kinetics::ButlerVolmerKinetics, FuelCellShop::Kinetics::DoubleTrapKinetics, FuelCellShop::Kinetics::DualPathKinetics, and FuelCellShop::Kinetics::TafelKinetics.
References FcstUtilities::log.
|
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.
|
inline |
Function to get pointer to catalyst class.
This function is basically needed by thermal source class.
|
inlinestaticprotected |
Referenced by create_Kinetics(), and declare_Kinetics_parameters().
|
inline |
Returns the name of the reaction that this kinetics class is using.
|
inlinevirtual |
Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics.
|
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.
|
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.
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics.
References FcstUtilities::log.
|
inlinevirtual |
Used to return the coverage of the intermediate species if they are computed.
Reimplemented in FuelCellShop::Kinetics::DoubleTrapKinetics.
References FcstUtilities::log.
|
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.
|
inline |
Set the total gas pressure [Pascals
] in the cell.
|
inline |
Set reactant concentrations at the catalyst/electrolyte interface.
This should be the concentration in Nafion.
The concentrations should be in .
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)
|
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 |
Enumeration 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.