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
122 static void declare_Kinetics_parameters (ParameterHandler ¶m)
135 static void set_Kinetics_parameters (
const std::vector<std::string>& name_dvar,
136 const std::vector<double>& value_dvar,
137 ParameterHandler ¶m)
143 iterator->second->set_parameters(name_dvar,value_dvar, param);
164 static boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_Kinetics (ParameterHandler ¶m,
165 std::string kinetics_name)
168 boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > pointer;
174 if (iterator->second)
176 pointer = iterator->second->create_replica();
180 deallog<<
"Pointer not initialized"<<std::endl;
186 deallog<<
"Concrete name does not exist"<<std::endl;
190 pointer->initialize(param);
227 void set_reactant_concentrations(
const std::vector<SolutionVariable>& conc_vec)
229 Assert( conc_vec.size() > 0, ExcMessage(
"Atleast one reactant concentration should be passed inside BaseKinetics::set_reactant_concentrations. !!") );
231 for (
unsigned int i=0; i<conc_vec.size(); ++i )
235 conc_vec[i].get_variablename() !=
water_molar_fraction), ExcMessage(
"Molar fractions can't be setup using BaseKinetics::set_reactant_concentrations.") );
237 reactants_map[ conc_vec[i].get_variablename() ] = conc_vec[i];
244 void set_derivative_flags(
const std::vector<VariableNames>& flags)
246 derivative_flags = flags;
265 electrolyte = electrolyte_in;
273 virtual void set_reaction_kinetics(
const std::string& name)
275 name_reaction_kinetics = name;
279 void set_p_t(
const double& P_Tot)
289 inline std::string get_reaction_name()
const
291 return name_reaction_kinetics;
304 virtual void current_density (std::vector<double>&)
306 const std::type_info& info =
typeid(*this);
307 deallog <<
"Pure function " << __FUNCTION__
308 <<
" called in Class "
309 << info.
name() << std::endl;
319 virtual void derivative_current (std::map<
VariableNames, std::vector<double> >&)
321 const std::type_info& info =
typeid(*this);
322 deallog <<
"Pure function " << __FUNCTION__
323 <<
" called in Class "
324 << info.name() << std::endl;
330 virtual void compute_coverages(
const std::string& name_species,
331 std::vector<double>& coverage)
const
333 const std::type_info& info =
typeid(*this);
334 deallog <<
"Pure function " << __FUNCTION__
335 <<
" called in Class "
336 << info.name() << std::endl;
343 virtual void OH_coverage(std::vector<double>& )
const
345 const std::type_info& info =
typeid(*this);
346 deallog <<
"Pure function " << __FUNCTION__
347 <<
" called in Class "
348 << info.name() << std::endl;
356 virtual void O_coverage(std::vector<double>& )
const
358 const std::type_info& info =
typeid(*this);
359 deallog <<
"Pure function " << __FUNCTION__
360 <<
" called in Class "
361 << info.name() << std::endl;
395 virtual boost::shared_ptr<FuelCellShop::Kinetics::BaseKinetics > create_replica ()
397 const std::type_info& info =
typeid(*this);
398 deallog <<
"Pure function " << __FUNCTION__
399 <<
" called in Class "
400 << info.name() << std::endl;
421 kin_param_initialized =
false;
433 virtual void declare_parameters (ParameterHandler&)
const
435 const std::type_info& info =
typeid(*this);
436 deallog <<
"Pure function " << __FUNCTION__
437 <<
" called in Class "
438 << info.name() << std::endl;
442 virtual void set_parameters(
const std::vector<std::string>& name_dvar,
443 const std::vector<double>& value_dvar,
444 ParameterHandler& param)
const
446 const std::type_info& info =
typeid(*this);
447 deallog <<
"Pure function " << __FUNCTION__
448 <<
" called in Class "
449 << info.name() << std::endl;
458 const std::type_info& info =
typeid(*this);
459 deallog <<
"Pure function " << __FUNCTION__
460 <<
" called in Class "
461 << info.name() << std::endl;
472 virtual void init_kin_param() = 0;