18 #ifndef _FUELCELLSHOP__DOUBLETRAP_KINETICS_H
19 #define _FUELCELLSHOP__DOUBLETRAP_KINETICS_H
26 #include <base/parameter_handler.h>
27 #include <base/point.h>
28 #include <base/function.h>
29 #include <lac/vector.h>
30 #include <fe/fe_values.h>
36 using namespace dealii;
38 namespace FuelCellShop
105 virtual void declare_parameters(ParameterHandler ¶m)
const;
111 virtual void initialize(ParameterHandler ¶m);
128 virtual void derivative_current (std::map<
VariableNames, std::vector<double> >& );
154 std::vector<double> t;
156 for(
unsigned int i =0; i < intrinsic_rates[0].size(); i++)
157 t.push_back(C*intrinsic_rates[0][i]);
165 std::vector<double> t;
167 for(
unsigned int i =0; i < intrinsic_rates[1].size(); i++)
168 t.push_back(intrinsic_rates[1][i]*theta_O[i]);
190 std::vector<double> t;
191 for(
unsigned int i =0; i < intrinsic_rates[2].size(); i++)
192 t.push_back(C*Ch*intrinsic_rates[2][i]);
200 std::vector<double> t;
201 for(
unsigned int i =0; i < intrinsic_rates[3].size(); i++)
202 t.push_back(theta_OH[i]*intrinsic_rates[3][i]);
218 std::vector<double> t;
219 for(
unsigned int i =0; i < intrinsic_rates[4].size(); i++)
220 t.push_back(theta_O[i]*Ch*intrinsic_rates[4][i]);
228 std::vector<double> t;
229 for(
unsigned int i =0; i < intrinsic_rates[5].size(); i++)
230 t.push_back(theta_OH[i]*intrinsic_rates[5][i]);
245 std::vector<double> t;
246 for(
unsigned int i =0; i < intrinsic_rates[6].size(); i++)
247 t.push_back(Ch*theta_OH[i]*intrinsic_rates[6][i]);
255 std::vector<double> t;
256 for(
unsigned int i =0; i < intrinsic_rates[5].size(); i++)
257 t.push_back(intrinsic_rates[7][i]*(1.0 -theta_OH[i] -theta_O[i]));
268 void compute_energies();
281 name_reaction_kinetics = name;
285 const std::type_info& info =
typeid(*this);
286 FcstUtilities::log <<
"Only ORR reaction is to be implemented in " << __FUNCTION__ <<
" called in Class " << info.name() << std::endl;
310 virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics >
create_replica ()
330 double correction(1.0);
348 double exponential = 0.5;
379 Assert( !kin_param_initialized, ExcInternalError() );
380 Assert( catalyst != NULL, ExcMessage(
"Catalyst object not initialized in the DoubleTrapKinetics object.") );
381 Assert( catalyst->get_reaction_name() ==
ORR, ExcMessage(
"Catalyst object in the DoubleTrapKinetics not set to ORR reaction name.") );
382 Assert( phi_m.is_initialized() && phi_s.is_initialized() && T.is_initialized(), ExcMessage(
"Either phi_m/phi_s/T is not set in the DoubleTrapKinetics object.") );
383 Assert( reactants_map.find(
oxygen_concentration) != reactants_map.end(), ExcMessage(
"Oxygen concentration is not set in the DoubleTrapKinetics object.") );
387 std::map< VariableNames, double > cref_map;
388 catalyst->reference_concentration(names, cref_map);
392 kin_param_initialized =
true;
396 void d_OH_coverage_du (std::map<
VariableNames, std::vector<double> >& )
const;
399 void d_O_coverage_du (std::map<
VariableNames, std::vector<double> >& )
const;
404 void drate_du(std::vector<std::vector<double> >&,
const VariableNames& )
const;
470 #endif //_FUELCELLSHOP__DOUBLETRAP_KINETICS_H
Definition: system_management.h:85
double proton_concentration_ratio(unsigned int index) const
If needed, compute the proton concentration ratio, i.e., where is the variable exponential.
Definition: double_trap_kinetics.h:365
void G_RA_rate(std::vector< double > &temp) const
Returns the rate of the forward RA step.
Definition: double_trap_kinetics.h:174
void g_da_rate(std::vector< double > &temp) const
Returns the rate of the backward DA step.
Definition: double_trap_kinetics.h:163
virtual void set_reaction_kinetics(const ReactionNames &name)
Member function used to set the reaction name in the DoubleTrap kinetics object.
Definition: double_trap_kinetics.h:277
virtual bool has_coverage(const VariableNames &type)
Definition: double_trap_kinetics.h:293
void g_rt_rate(std::vector< double > &temp) const
Returns the rate of the backward RT step.
Definition: double_trap_kinetics.h:226
double negative_concentration_correction(unsigned int index) const
If any of the oxygen concentrations are negative, make the ORR reaction negative. ...
Definition: double_trap_kinetics.h:328
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:62
double alpha
Stores the transfer coefficient.
Definition: double_trap_kinetics.h:464
std::vector< std::vector< double > > intrinsic_rates
Values of the intrinsic rates for each reaction ( ).
Definition: double_trap_kinetics.h:446
std::vector< std::vector< double > > free_energies
Values of the free activation energies for each reaction ( ).
Definition: double_trap_kinetics.h:417
static DoubleTrapKinetics const * PROTOTYPE
Create prototype for the layer.
Definition: double_trap_kinetics.h:317
double c_ref_oxygen
Stores the reference concentration of oxygen.
Definition: double_trap_kinetics.h:458
Definition: system_management.h:83
Definition: system_management.h:82
std::vector< double > theta_OH
Stores the value of the coverage of the OH and O intermediates.
Definition: double_trap_kinetics.h:449
Definition: system_management.h:151
virtual void init_kin_param()
Method used to initialize reference concentration of oxygen for the reaction, and number of quadratur...
Definition: double_trap_kinetics.h:377
void O_coverage(std::vector< double > &temp) const
Returns the value of the coverage of the O intermediate.
Definition: double_trap_kinetics.h:140
void g_ra_rate(std::vector< double > &temp) const
Returns the rate of the backward RA step.
Definition: double_trap_kinetics.h:198
void G_DA_rate(std::vector< double > &temp) const
Returns the rate of the forward DA step.
Definition: double_trap_kinetics.h:146
double G_OH
Definition: double_trap_kinetics.h:440
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
ReactionNames
Definition: system_management.h:148
Definition: system_management.h:79
Virtual class used to provide the interface for all kinetic/reaction children.
Definition: base_kinetics.h:107
double G_RT_0
Definition: double_trap_kinetics.h:429
void G_RT_rate(std::vector< double > &temp) const
Returns the rate of the forward RT step.
Definition: double_trap_kinetics.h:208
void OH_coverage(std::vector< double > &temp) const
Returns the value of the coverage of the OH intermediate.
Definition: double_trap_kinetics.h:134
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: double_trap_kinetics.h:83
double prefactor
prefactor is the reference prefactor that sets the scale for the current produced.
Definition: double_trap_kinetics.h:455
void G_RD_rate(std::vector< double > &temp) const
Returns the rate of the forward RD step.
Definition: double_trap_kinetics.h:236
void g_rd_rate(std::vector< double > &temp) const
Returns the rate of the backward RD step.
Definition: double_trap_kinetics.h:253
Definition: system_management.h:89
virtual boost::shared_ptr< FuelCellShop::Kinetics::BaseKinetics > create_replica()
This member function is used to create an object of type gas diffusion layer.
Definition: double_trap_kinetics.h:310
double c_ref_protons
Stores the reference concentration of protons.
Definition: double_trap_kinetics.h:461
double oxygen_concentration_ratio(unsigned int index) const
Compute the oxygen concentration ratio, i.e., where is the variable exponential.
Definition: double_trap_kinetics.h:345
This class contains the implementation of the double trap kinetic model as described in the following...
Definition: double_trap_kinetics.h:66