18 #ifndef _FUELCELLSHOP__DOUBLETRAP_KINETICS_H
19 #define _FUELCELLSHOP__DOUBLETRAP_KINETICS_H
26 #include <deal.II/base/parameter_handler.h>
27 #include <deal.II/base/point.h>
28 #include <deal.II/base/function.h>
29 #include <deal.II/lac/vector.h>
30 #include <deal.II/fe/fe_values.h>
36 using namespace dealii;
38 namespace FuelCellShop
107 virtual void declare_parameters(ParameterHandler ¶m)
const;
113 virtual void initialize(ParameterHandler ¶m);
130 virtual void derivative_current (std::map<
VariableNames, std::vector<double> >& );
156 std::vector<double> t;
158 for(
unsigned int i =0; i < intrinsic_rates[0].size(); i++)
159 t.push_back(C*intrinsic_rates[0][i]);
167 std::vector<double> t;
169 for(
unsigned int i =0; i < intrinsic_rates[1].size(); i++)
170 t.push_back(intrinsic_rates[1][i]*theta_O[i]);
192 std::vector<double> t;
193 for(
unsigned int i =0; i < intrinsic_rates[2].size(); i++)
194 t.push_back(C*Ch*intrinsic_rates[2][i]);
202 std::vector<double> t;
203 for(
unsigned int i =0; i < intrinsic_rates[3].size(); i++)
204 t.push_back(theta_OH[i]*intrinsic_rates[3][i]);
220 std::vector<double> t;
221 for(
unsigned int i =0; i < intrinsic_rates[4].size(); i++)
222 t.push_back(theta_O[i]*Ch*intrinsic_rates[4][i]);
230 std::vector<double> t;
231 for(
unsigned int i =0; i < intrinsic_rates[5].size(); i++)
232 t.push_back(theta_OH[i]*intrinsic_rates[5][i]);
247 std::vector<double> t;
248 for(
unsigned int i =0; i < intrinsic_rates[6].size(); i++)
249 t.push_back(Ch*theta_OH[i]*intrinsic_rates[6][i]);
257 std::vector<double> t;
258 for(
unsigned int i =0; i < intrinsic_rates[5].size(); i++)
259 t.push_back(intrinsic_rates[7][i]*(1.0 -theta_OH[i] -theta_O[i]));
270 void compute_energies();
283 name_reaction_kinetics = name;
287 const std::type_info& info =
typeid(*this);
288 FcstUtilities::log <<
"Only ORR reaction is to be implemented in " << __FUNCTION__ <<
" called in Class " << info.name() << std::endl;
312 virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics >
create_replica ()
332 double correction(1.0);
350 double exponential = 0.5;
381 Assert( !kin_param_initialized, ExcInternalError() );
382 Assert( catalyst != NULL, ExcMessage(
"Catalyst object not initialized in the DoubleTrapKinetics object.") );
383 Assert( catalyst->get_reaction_name() ==
ORR, ExcMessage(
"Catalyst object in the DoubleTrapKinetics not set to ORR reaction name.") );
384 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.") );
385 Assert( reactants_map.find(
oxygen_concentration) != reactants_map.end(), ExcMessage(
"Oxygen concentration is not set in the DoubleTrapKinetics object.") );
389 std::map< VariableNames, double > cref_map;
390 catalyst->reference_concentration(names, cref_map);
394 kin_param_initialized =
true;
398 void d_OH_coverage_du (std::map<
VariableNames, std::vector<double> >& )
const;
401 void d_O_coverage_du (std::map<
VariableNames, std::vector<double> >& )
const;
406 void drate_du(std::vector<std::vector<double> >&,
const VariableNames& )
const;
472 #endif //_FUELCELLSHOP__DOUBLETRAP_KINETICS_H
Definition: system_management.h:86
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:367
void G_RA_rate(std::vector< double > &temp) const
Returns the rate of the forward RA step.
Definition: double_trap_kinetics.h:176
void g_da_rate(std::vector< double > &temp) const
Returns the rate of the backward DA step.
Definition: double_trap_kinetics.h:165
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:279
virtual bool has_coverage(const VariableNames &type)
Definition: double_trap_kinetics.h:295
void g_rt_rate(std::vector< double > &temp) const
Returns the rate of the backward RT step.
Definition: double_trap_kinetics.h:228
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:330
VariableNames
The enumeration containing the names of some of the available FCST solution variables and their deriv...
Definition: system_management.h:63
double alpha
Stores the transfer coefficient.
Definition: double_trap_kinetics.h:466
std::vector< std::vector< double > > intrinsic_rates
Values of the intrinsic rates for each reaction ( ).
Definition: double_trap_kinetics.h:448
std::vector< std::vector< double > > free_energies
Values of the free activation energies for each reaction ( ).
Definition: double_trap_kinetics.h:419
static DoubleTrapKinetics const * PROTOTYPE
Create prototype for the layer.
Definition: double_trap_kinetics.h:319
double c_ref_oxygen
Stores the reference concentration of oxygen.
Definition: double_trap_kinetics.h:460
Definition: system_management.h:84
Definition: system_management.h:83
std::vector< double > theta_OH
Stores the value of the coverage of the OH and O intermediates.
Definition: double_trap_kinetics.h:451
Definition: system_management.h:180
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:379
void O_coverage(std::vector< double > &temp) const
Returns the value of the coverage of the O intermediate.
Definition: double_trap_kinetics.h:142
void g_ra_rate(std::vector< double > &temp) const
Returns the rate of the backward RA step.
Definition: double_trap_kinetics.h:200
void G_DA_rate(std::vector< double > &temp) const
Returns the rate of the forward DA step.
Definition: double_trap_kinetics.h:148
double G_OH
Definition: double_trap_kinetics.h:442
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
ReactionNames
Definition: system_management.h:177
Definition: system_management.h:80
Virtual class used to provide the interface for all kinetic/reaction children.
Definition: base_kinetics.h:102
double G_RT_0
Definition: double_trap_kinetics.h:431
void G_RT_rate(std::vector< double > &temp) const
Returns the rate of the forward RT step.
Definition: double_trap_kinetics.h:210
void OH_coverage(std::vector< double > &temp) const
Returns the value of the coverage of the OH intermediate.
Definition: double_trap_kinetics.h:136
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: double_trap_kinetics.h:85
double prefactor
prefactor is the reference prefactor that sets the scale for the current produced.
Definition: double_trap_kinetics.h:457
void G_RD_rate(std::vector< double > &temp) const
Returns the rate of the forward RD step.
Definition: double_trap_kinetics.h:238
void g_rd_rate(std::vector< double > &temp) const
Returns the rate of the backward RD step.
Definition: double_trap_kinetics.h:255
Definition: system_management.h:90
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:312
double c_ref_protons
Stores the reference concentration of protons.
Definition: double_trap_kinetics.h:463
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:347
This class contains the implementation of the double trap kinetic model as described in the following...
Definition: double_trap_kinetics.h:68