18 #ifndef _FUELCELLSHOP__BASE__KINETICS_H
19 #define _FUELCELLSHOP__BASE__KINETICS_H
22 #include <base/parameter_handler.h>
23 #include <base/point.h>
24 #include <base/function.h>
25 #include <lac/vector.h>
26 #include <fe/fe_values.h>
41 using namespace dealii;
43 namespace FuelCellShop
124 iterator->second->declare_parameters(param);
146 static boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics >
create_Kinetics (ParameterHandler ¶m,
147 std::string kinetics_name)
150 boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > pointer;
156 if (iterator->second)
158 pointer = iterator->second->create_replica();
172 pointer->initialize(param);
211 Assert( conc_vec.size() > 0, ExcMessage(
"Atleast one reactant concentration should be passed inside BaseKinetics::set_reactant_concentrations. !!") );
213 for (
unsigned int i=0; i<conc_vec.size(); ++i )
217 conc_vec[i].get_variablename() !=
water_molar_fraction), ExcMessage(
"Molar fractions can't be setup using BaseKinetics::set_reactant_concentrations.") );
219 reactants_map[ conc_vec[i].get_variablename() ] = conc_vec[i];
228 derivative_flags = flags;
247 electrolyte = electrolyte_in;
257 name_reaction_kinetics = name;
273 return name_reaction_kinetics;
288 const std::type_info& info =
typeid(*this);
290 <<
" called in Class "
291 << info.name() << std::endl;
303 const std::type_info& info =
typeid(*this);
305 <<
" called in Class "
306 << info.name() << std::endl;
313 std::vector<double>& coverage)
const
315 const std::type_info& info =
typeid(*this);
317 <<
" called in Class "
318 << info.name() << std::endl;
327 const std::type_info& info =
typeid(*this);
329 <<
" called in Class "
330 << info.name() << std::endl;
340 const std::type_info& info =
typeid(*this);
342 <<
" called in Class "
343 << info.name() << std::endl;
382 virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics >
create_replica ()
384 const std::type_info& info =
typeid(*this);
386 <<
" called in Class "
387 << info.name() << std::endl;
408 kin_param_initialized =
false;
422 const std::type_info& info =
typeid(*this);
424 <<
" called in Class "
425 << info.name() << std::endl;
435 const std::type_info& info =
typeid(*this);
437 <<
" called in Class "
438 << info.name() << std::endl;
449 virtual void init_kin_param() = 0;
std::map< VariableNames, SolutionVariable > reactants_map
Map of SolutionVariables storing a pointer to the solution vector storing the concentration of each o...
Definition: base_kinetics.h:504
BaseKinetics()
Constructor.
Definition: base_kinetics.h:396
unsigned int n_quad
Number of quadrature points in the cell.
Definition: base_kinetics.h:470
ReactionNames name_reaction_kinetics
Enumeration with the reaction name for which the class returns kinetic parameters.
Definition: base_kinetics.h:459
virtual ~BaseKinetics()
Destructor.
Definition: base_kinetics.h:414
virtual void initialize(ParameterHandler &)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Definition: base_kinetics.h:433
void set_catalyst(FuelCellShop::Material::CatalystBase *cat_in)
Set a pointer to the catalyst that will be used.
Definition: base_kinetics.h:235
double F()
Faraday constant, .
Definition: fcst_constants.h:38
void set_p_t(const double &P_Tot)
Set the total gas pressure [Pascals] in the cell.
Definition: base_kinetics.h:261
VariableNames get_variablename() const
Function to get the VariableNames enumeration corresponding to this struct.
Definition: fcst_variables.h:163
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 wil...
Definition: base_kinetics.h:146
double K
Boltzmann constant.
Definition: base_kinetics.h:492
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
double p_total
Total gas pressure [Pascals] in the cell for isobaric case.
Definition: base_kinetics.h:498
Definition: system_management.h:70
SolutionVariable phi_m
Struct storing a pointer to the solution vector for the electrolyte potential.
Definition: base_kinetics.h:507
double th
A thresholding value of the GAS-LIQUID concentration of (cathode) or (anode) by passing which the ...
Definition: base_kinetics.h:527
This class implements the interface to compute the properties of a "standard" catalyst.
Definition: catalyst_base.h:69
void set_derivative_flags(const std::vector< VariableNames > &flags)
Set the variables for which you would like to compute the derivaitives.
Definition: base_kinetics.h:226
void set_temperature(const SolutionVariable &temperature)
Set temperature.
Definition: base_kinetics.h:201
virtual void derivative_current(std::map< VariableNames, std::vector< double > > &)
Function to return the derivative of the current density w.r.t solution variables.
Definition: base_kinetics.h:301
double R
Universal gas constant.
Definition: base_kinetics.h:487
SolutionVariable T
Struct stroing a pointer to the solution vector for the temperature.
Definition: base_kinetics.h:513
static void declare_Kinetics_parameters(ParameterHandler ¶m)
Function used to declare all the data necessary in the parameter files for all BaseKinetics children...
Definition: base_kinetics.h:117
virtual void declare_parameters(ParameterHandler &) const
Declare parameters for a parameter file.
Definition: base_kinetics.h:420
Definition: system_management.h:68
Definition: system_management.h:75
void set_electrolyte(FuelCellShop::Material::PolymerElectrolyteBase *electrolyte_in)
Member function used to set the electrolyte pointer to that used by the application.
Definition: base_kinetics.h:245
double R()
Universal gas constant, .
Definition: fcst_constants.h:33
virtual void OH_coverage(std::vector< double > &) const
Used to return the coverage of the intermediate species if they are computed.
Definition: base_kinetics.h:325
virtual void O_coverage(std::vector< double > &) const
Used to return the coverage of the intermediate species if they are computed.
Definition: base_kinetics.h:338
void set_electrolyte_potential(const SolutionVariable &phi)
Set the electrolyte phase potential.
Definition: base_kinetics.h:185
void set_reactant_concentrations(const std::vector< SolutionVariable > &conc_vec)
Set reactant concentrations.
Definition: base_kinetics.h:209
std::map< std::string, BaseKinetics * > _mapFactory
This object is used to store all objects of type BaseKinetics.
Definition: base_kinetics.h:360
FuelCellShop::Material::PolymerElectrolyteBase * electrolyte
Pointer to the electrolyte object created in the application that is used to calculate the properties...
Definition: base_kinetics.h:481
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
void set_solid_potential(const SolutionVariable &phi)
Set the solid phase potential.
Definition: base_kinetics.h:193
virtual boost::shared_ptr< FuelCellShop::Kinetics::BaseKinetics > create_replica()
This member function is used to create an object of type BaseKinetics.
Definition: base_kinetics.h:382
ReactionNames
Definition: system_management.h:148
This class implements the interface to compute the properties of a "standard" polymer electrolyte mem...
Definition: polymer_electrolyte_material_base.h:62
Definition: system_management.h:67
static _mapFactory * get_mapFactory()
Definition: base_kinetics.h:368
Virtual class used to provide the interface for all kinetic/reaction children.
Definition: base_kinetics.h:107
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.
Definition: base_kinetics.h:312
double F
Universal Farday's constant.
Definition: base_kinetics.h:489
virtual void set_reaction_kinetics(const ReactionNames name)
Member function used to specify the reaction for which the kinetic parameters are needed...
Definition: base_kinetics.h:255
Definition: system_management.h:66
ReactionNames get_reaction_name() const
Returns the name of the reaction that this kinetics class is using.
Definition: base_kinetics.h:271
double K()
Boltzmann constant, .
Definition: fcst_constants.h:53
bool kin_param_initialized
Boolean variable to determine whether init_kin_param has been already called or not.
Definition: base_kinetics.h:454
Definition: system_management.h:71
virtual bool has_coverage(const VariableNames &type)
Definition: base_kinetics.h:348
FuelCellShop::Material::CatalystBase * get_cat() const
Function to get pointer to catalyst class.
Definition: base_kinetics.h:277
virtual void current_density(std::vector< double > &)
Function to return the value of the current [A/cm^2].
Definition: base_kinetics.h:286
FuelCellShop::Material::CatalystBase * catalyst
Pointer to the catalyst object that is created at the application level and passed to the kinetics cl...
Definition: base_kinetics.h:476
std::vector< VariableNames > derivative_flags
Flags for derivatives: These flags are used to request derivatives which are computed using the deriv...
Definition: base_kinetics.h:465