Cantera  2.4.0
InterfaceKinetics.h
Go to the documentation of this file.
1 /**
2  * @file InterfaceKinetics.h
3  * @ingroup chemkinetics
4  */
5 
6 // This file is part of Cantera. See License.txt in the top-level directory or
7 // at http://www.cantera.org/license.txt for license and copyright information.
8 
9 #ifndef CT_IFACEKINETICS_H
10 #define CT_IFACEKINETICS_H
11 
12 #include "Kinetics.h"
13 #include "Reaction.h"
14 #include "cantera/base/utilities.h"
15 #include "RateCoeffMgr.h"
16 
17 namespace Cantera
18 {
19 
20 // forward declarations
21 class SurfPhase;
22 class ImplicitSurfChem;
23 
24 //! A kinetics manager for heterogeneous reaction mechanisms. The reactions are
25 //! assumed to occur at a 2D interface between two 3D phases.
26 /*!
27  * There are some important additions to the behavior of the kinetics class due
28  * to the presence of multiple phases and a heterogeneous interface. If a
29  * reactant phase doesn't exists, i.e., has a mole number of zero, a
30  * heterogeneous reaction can not proceed from reactants to products. Note it
31  * could perhaps proceed from products to reactants if all of the product phases
32  * exist.
33  *
34  * In order to make the determination of whether a phase exists or not actually
35  * involves the specification of additional information to the kinetics object.,
36  * which heretofore has only had access to intrinsic field information about the
37  * phases (i.e., temperature pressure, and mole fraction).
38  *
39  * The extrinsic specification of whether a phase exists or not must be
40  * specified on top of the intrinsic calculation of the reaction rate. This
41  * class carries a set of booleans indicating whether a phase in the
42  * heterogeneous mechanism exists or not.
43  *
44  * Additionally, the class carries a set of booleans around indicating whether a
45  * product phase is stable or not. If a phase is not thermodynamically stable,
46  * it may be the case that a particular reaction in a heterogeneous mechanism
47  * will create a product species in the unstable phase. However, other reactions
48  * in the mechanism will destruct that species. This may cause oscillations in
49  * the formation of the unstable phase from time step to time step within a ODE
50  * solver, in practice. In order to avoid this situation, a set of booleans is
51  * tracked which sets the stability of a phase. If a phase is deemed to be
52  * unstable, then species in that phase will not be allowed to be birthed by the
53  * kinetics operator. Nonexistent phases are deemed to be unstable by default,
54  * but this can be changed.
55  *
56  * @ingroup chemkinetics
57  */
59 {
60 public:
61  //! Constructor
62  /*!
63  * @param thermo The optional parameter may be used to initialize the object
64  * with one ThermoPhase object.
65  * HKM Note -> Since the interface kinetics object will
66  * probably require multiple ThermoPhase objects, this is
67  * probably not a good idea to have this parameter.
68  */
70 
71  virtual ~InterfaceKinetics();
72 
73  virtual std::string kineticsType() const {
74  return "Surf";
75  }
76 
77  //! Set the electric potential in the nth phase
78  /*!
79  * @param n phase Index in this kinetics object.
80  * @param V Electric potential (volts)
81  */
82  void setElectricPotential(int n, doublereal V);
83 
84  //! @name Reaction Rates Of Progress
85  //! @{
86 
87  //! Equilibrium constant for all reactions including the voltage term
88  /*!
89  * Kc = exp(deltaG/RT)
90  *
91  * where deltaG is the electrochemical potential difference between
92  * products minus reactants.
93  */
94  virtual void getEquilibriumConstants(doublereal* kc);
95 
96  //! values needed to convert from exchange current density to surface
97  //! reaction rate.
99 
100  virtual void getDeltaGibbs(doublereal* deltaG);
101 
102  virtual void getDeltaElectrochemPotentials(doublereal* deltaM);
103  virtual void getDeltaEnthalpy(doublereal* deltaH);
104  virtual void getDeltaEntropy(doublereal* deltaS);
105 
106  virtual void getDeltaSSGibbs(doublereal* deltaG);
107  virtual void getDeltaSSEnthalpy(doublereal* deltaH);
108  virtual void getDeltaSSEntropy(doublereal* deltaS);
109 
110  //! @}
111  //! @name Reaction Mechanism Informational Query Routines
112  //! @{
113 
114  virtual void getActivityConcentrations(doublereal* const conc);
115 
116  //! Return the charge transfer rxn Beta parameter for the ith reaction
117  /*!
118  * Returns the beta parameter for a charge transfer reaction. This
119  * parameter is not important for non-charge transfer reactions.
120  * Note, the parameter defaults to zero. However, a value of 0.5
121  * should be supplied for every charge transfer reaction if
122  * no information is known, as a value of 0.5 pertains to a
123  * symmetric transition state. The value can vary between 0 to 1.
124  *
125  * @param irxn Reaction number in the kinetics mechanism
126  *
127  * @return Beta parameter. This defaults to zero, even for charge
128  * transfer reactions.
129  */
130  doublereal electrochem_beta(size_t irxn) const;
131 
132  virtual bool isReversible(size_t i) {
133  if (std::find(m_revindex.begin(), m_revindex.end(), i)
134  < m_revindex.end()) {
135  return true;
136  } else {
137  return false;
138  }
139  }
140 
141  virtual void getFwdRateConstants(doublereal* kfwd);
142  virtual void getRevRateConstants(doublereal* krev,
143  bool doIrreversible = false);
144 
145  //! Return effective preexponent for the specified reaction
146  /*!
147  * Returns effective preexponent, accounting for surface coverage
148  * dependencies.
149  *
150  * @param irxn Reaction number in the kinetics mechanism
151  * @return Effective preexponent
152  */
153  double effectivePreExponentialFactor(size_t irxn) {
154  return m_rates.effectivePreExponentialFactor(irxn);
155  }
156 
157  //! Return effective activation energy for the specified reaction
158  /*!
159  * Returns effective activation energy, accounting for surface coverage
160  * dependencies.
161  *
162  * @param irxn Reaction number in the kinetics mechanism
163  * @return Effective activation energy divided by the gas constant
164  */
165  double effectiveActivationEnergy_R(size_t irxn) {
166  return m_rates.effectiveActivationEnergy_R(irxn);
167  }
168 
169  //! Return effective temperature exponent for the specified reaction
170  /*!
171  * Returns effective temperature exponenty, accounting for surface coverage
172  * dependencies. Current parameterization in SurfaceArrhenius does not
173  * change this parameter with the change in surface coverages.
174  *
175  * @param irxn Reaction number in the kinetics mechanism
176  * @return Effective temperature exponent
177  */
178  double effectiveTemperatureExponent(size_t irxn) {
179  return m_rates.effectiveTemperatureExponent(irxn);
180  }
181 
182  //! @}
183  //! @name Reaction Mechanism Construction
184  //! @{
185 
186  //! Add a phase to the kinetics manager object.
187  /*!
188  * This must be done before the function init() is called or
189  * before any reactions are input.
190  *
191  * This function calls Kinetics::addPhase(). It also sets the following
192  * fields:
193  *
194  * m_phaseExists[]
195  *
196  * @param thermo Reference to the ThermoPhase to be added.
197  */
198  virtual void addPhase(thermo_t& thermo);
199 
200  virtual void init();
201  virtual void resizeSpecies();
202  virtual bool addReaction(shared_ptr<Reaction> r);
203  virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
204  //! @}
205 
206  //! Internal routine that updates the Rates of Progress of the reactions
207  /*!
208  * This is actually the guts of the functionality of the object
209  */
210  virtual void updateROP();
211 
212  //! Update properties that depend on temperature
213  /*!
214  * Current objects that this function updates:
215  * m_kdata->m_logtemp
216  * m_kdata->m_rfn
217  * m_rates.
218  * updateKc();
219  */
220  void _update_rates_T();
221 
222  //! Update properties that depend on the electric potential
223  void _update_rates_phi();
224 
225  //! Update properties that depend on the species mole fractions and/or
226  //! concentration,
227  /*!
228  * This method fills out the array of generalized concentrations by calling
229  * method getActivityConcentrations for each phase, which classes
230  * representing phases should overload to return the appropriate quantities.
231  */
232  void _update_rates_C();
233 
234  //! Advance the surface coverages in time
235  /*!
236  * This method carries out a time-accurate advancement of the
237  * surface coverages for a specified amount of time.
238  *
239  * \f[
240  * \dot {\theta}_k = \dot s_k (\sigma_k / s_0)
241  * \f]
242  *
243  * @param tstep Time value to advance the surface coverages
244  */
245  void advanceCoverages(doublereal tstep);
246 
247  //! Solve for the pseudo steady-state of the surface problem
248  /*!
249  * This is the same thing as the advanceCoverages() function,
250  * but at infinite times.
251  *
252  * Note, a direct solve is carried out under the hood here,
253  * to reduce the computational time.
254  *
255  * @param ifuncOverride One of the values defined in @ref solvesp_methods.
256  * The default is -1, which means that the program will decide.
257  * @param timeScaleOverride When a pseudo transient is selected this value
258  * can be used to override the default time scale for
259  * integration which is one. When SFLUX_TRANSIENT is used, this
260  * is equal to the time over which the equations are integrated.
261  * When SFLUX_INITIALIZE is used, this is equal to the time used
262  * in the initial transient algorithm, before the equation
263  * system is solved directly.
264  */
265  void solvePseudoSteadyStateProblem(int ifuncOverride = -1,
266  doublereal timeScaleOverride = 1.0);
267 
268  void setIOFlag(int ioFlag);
269 
270  //! Update the standard state chemical potentials and species equilibrium
271  //! constant entries
272  /*!
273  * Virtual because it is overridden when dealing with experimental open
274  * circuit voltage overrides
275  */
276  virtual void updateMu0();
277 
278  //! Update the equilibrium constants and stored electrochemical potentials
279  //! in molar units for all reversible reactions and for all species.
280  /*!
281  * Irreversible reactions have their equilibrium constant set
282  * to zero. For reactions involving charged species the equilibrium
283  * constant is adjusted according to the electrostatic potential.
284  */
285  void updateKc();
286 
287  //! Apply modifications for the forward reaction rate for interfacial charge
288  //! transfer reactions
289  /*!
290  * For reactions that transfer charge across a potential difference,
291  * the activation energies are modified by the potential difference.
292  * (see, for example, ...). This method applies this correction.
293  *
294  * @param kfwd Vector of forward reaction rate constants on which to have
295  * the voltage correction applied
296  */
297  void applyVoltageKfwdCorrection(doublereal* const kfwd);
298 
299  //! When an electrode reaction rate is optionally specified in terms of its
300  //! exchange current density, adjust kfwd to the standard reaction rate
301  //! constant form and units. When the BV reaction types are used, keep the
302  //! exchange current density form.
303  /*!
304  * For a reaction rate constant that was given in units of Amps/m2
305  * (exchange current density formulation with iECDFormulation == true),
306  * convert the rate to kmoles/m2/s.
307  *
308  * For a reaction rate constant that was given in units of kmol/m2/sec when
309  * the reaction type is a Butler-Volmer form, convert it to exchange
310  * current density form (amps/m2).
311  *
312  * @param kfwd Vector of forward reaction rate constants, given in either
313  * normal form or in exchange current density form.
314  */
315  void convertExchangeCurrentDensityFormulation(doublereal* const kfwd);
316 
317  //! Set the existence of a phase in the reaction object
318  /*!
319  * Tell the kinetics object whether a phase in the object exists. This is
320  * actually an extrinsic specification that must be carried out on top of
321  * the intrinsic calculation of the reaction rate. The routine will also
322  * flip the IsStable boolean within the kinetics object as well.
323  *
324  * @param iphase Index of the phase. This is the order within the
325  * internal thermo vector object
326  * @param exists Boolean indicating whether the phase exists or not
327  */
328  void setPhaseExistence(const size_t iphase, const int exists);
329 
330  //! Set the stability of a phase in the reaction object
331  /*!
332  * Tell the kinetics object whether a phase in the object is stable.
333  * Species in an unstable phase will not be allowed to have a positive
334  * rate of formation from this kinetics object. This is actually an
335  * extrinsic specification that must be carried out on top of the
336  * intrinsic calculation of the reaction rate.
337  *
338  * While conceptually not needed since kinetics is consistent with thermo
339  * when taken as a whole, in practice it has found to be very useful to
340  * turn off the creation of phases which shouldn't be forming. Typically
341  * this can reduce the oscillations in phase formation and destruction
342  * which are observed.
343  *
344  * @param iphase Index of the phase. This is the order within the
345  * internal thermo vector object
346  * @param isStable Flag indicating whether the phase is stable or not
347  */
348  void setPhaseStability(const size_t iphase, const int isStable);
349 
350  //! Gets the phase existence int for the ith phase
351  /*!
352  * @param iphase Phase Id
353  * @return The int specifying whether the kinetics object thinks the phase
354  * exists or not. If it exists, then species in that phase can be
355  * a reactant in reactions.
356  */
357  int phaseExistence(const size_t iphase) const;
358 
359  //! Gets the phase stability int for the ith phase
360  /*!
361  * @param iphase Phase Id
362  * @return The int specifying whether the kinetics object thinks the phase
363  * is stable with nonzero mole numbers. If it stable, then the
364  * kinetics object will allow for rates of production of of
365  * species in that phase that are positive.
366  */
367  int phaseStability(const size_t iphase) const;
368 
369  virtual void determineFwdOrdersBV(ElectrochemicalReaction& r, vector_fp& fwdFullorders);
370 
371 protected:
372  //! Build a SurfaceArrhenius object from a Reaction, taking into account
373  //! the possible sticking coefficient form and coverage dependencies
374  //! @param i Reaction number
375  //! @param r Reaction object containing rate coefficient parameters
376  //! @param replace True if replacing an existing reaction
378  bool replace);
379 
380  //! Temporary work vector of length m_kk
382 
383  //! List of reactions numbers which are reversible reactions
384  /*!
385  * This is a vector of reaction numbers. Each reaction in the list is
386  * reversible. Length = number of reversible reactions
387  */
388  std::vector<size_t> m_revindex;
389 
390  //! Templated class containing the vector of reactions for this interface
391  /*!
392  * The templated class is described in RateCoeffMgr.h
393  * The class SurfaceArrhenius is described in RxnRates.h
394  */
396 
397  bool m_redo_rates;
398 
399  //! Vector of irreversible reaction numbers
400  /*!
401  * vector containing the reaction numbers of irreversible reactions.
402  */
403  std::vector<size_t> m_irrev;
404 
405  //! Array of concentrations for each species in the kinetics mechanism
406  /*!
407  * An array of generalized concentrations \f$ C_k \f$ that are defined
408  * such that \f$ a_k = C_k / C^0_k, \f$ where \f$ C^0_k \f$ is a standard
409  * concentration/ These generalized concentrations are used by this
410  * kinetics manager class to compute the forward and reverse rates of
411  * elementary reactions. The "units" for the concentrations of each phase
412  * depend upon the implementation of kinetics within that phase. The order
413  * of the species within the vector is based on the order of listed
414  * ThermoPhase objects in the class, and the order of the species within
415  * each ThermoPhase class.
416  */
418 
419  //! Array of activity concentrations for each species in the kinetics object
420  /*!
421  * An array of activity concentrations \f$ Ca_k \f$ that are defined
422  * such that \f$ a_k = Ca_k / C^0_k, \f$ where \f$ C^0_k \f$ is a standard
423  * concentration. These activity concentrations are used by this
424  * kinetics manager class to compute the forward and reverse rates of
425  * elementary reactions. The "units" for the concentrations of each phase
426  * depend upon the implementation of kinetics within that phase. The order
427  * of the species within the vector is based on the order of listed
428  * ThermoPhase objects in the class, and the order of the species within
429  * each ThermoPhase class.
430  */
432 
433  //! Vector of standard state chemical potentials for all species
434  /*!
435  * This vector contains a temporary vector of standard state chemical
436  * potentials for all of the species in the kinetics object
437  *
438  * Length = m_kk. Units = J/kmol.
439  */
441 
442  //! Vector of chemical potentials for all species
443  /*!
444  * This vector contains a vector of chemical potentials for all of the
445  * species in the kinetics object
446  *
447  * Length = m_kk. Units = J/kmol.
448  */
450 
451  //! Vector of standard state electrochemical potentials modified by a
452  //! standard concentration term.
453  /*!
454  * This vector contains a temporary vector of standard state electrochemical
455  * potentials + RTln(Cs) for all of the species in the kinetics object
456  *
457  * In order to get the units correct for the concentration equilibrium
458  * constant, each species needs to have an RT ln(Cs) added to its
459  * contribution to the equilibrium constant Cs is the standard concentration
460  * for the species. Frequently, for solid species, Cs is equal to 1.
461  * However, for gases Cs is P/RT. Length = m_kk. Units = J/kmol.
462  */
464 
465  //! Vector of phase electric potentials
466  /*!
467  * Temporary vector containing the potential of each phase in the kinetics
468  * object. length = number of phases. Units = Volts.
469  */
471 
472  //! Vector of potential energies due to Voltages
473  /*!
474  * Length is the number of species in kinetics mech. It's used to store the
475  * potential energy due to the voltage.
476  */
478 
479  //! Storage for the net electric energy change due to reaction.
480  /*!
481  * Length is number of reactions. It's used to store the net electric
482  * potential energy change due to the reaction.
483  *
484  * deltaElectricEnergy_[jrxn] = sum_i ( F V_i z_i nu_ij)
485  */
487 
488  //! Pointer to the single surface phase
490 
491  //! Pointer to the Implicit surface chemistry object
492  /*!
493  * Note this object is owned by this InterfaceKinetics object. It may only
494  * be used to solve this single InterfaceKinetics object's surface problem
495  * uncoupled from other surface phases.
496  */
498 
499  //! Electrochemical transfer coefficient for the forward direction
500  /*!
501  * Electrochemical transfer coefficient for all reactions that have
502  * transfer reactions the reaction is given by m_ctrxn[i]
503  */
505 
506  //! Vector of reaction indexes specifying the id of the charge transfer
507  //! reactions in the mechanism
508  /*!
509  * Vector of reaction indices which involve charge transfers. This provides
510  * an index into the m_beta and m_ctrxn_BVform array.
511  *
512  * irxn = m_ctrxn[i]
513  */
514  std::vector<size_t> m_ctrxn;
515 
516  //! Vector of Reactions which follow the Butler-Volmer methodology for specifying the
517  //! exchange current density first. Then, the other forms are specified based on this form.
518  /*!
519  * Length is equal to the number of reactions with charge transfer coefficients, m_ctrxn[]
520  *
521  * m_ctrxn_BVform[i] = 0; This means that the irxn reaction is calculated via the standard forward
522  * and reverse reaction rates
523  * m_ctrxn_BVform[i] = 1; This means that the irxn reaction is calculated via the BV format
524  * directly.
525  * m_ctrxn_BVform[i] = 2; this means that the irxn reaction is calculated via the BV format
526  * directly, using concentrations instead of activity concentrations.
527  */
528  std::vector<size_t> m_ctrxn_BVform;
529 
530  //! Vector of booleans indicating whether the charge transfer reaction rate constant
531  //! is described by an exchange current density rate constant expression
532  /*!
533  * Length is equal to the number of reactions with charge transfer coefficients, m_ctrxn[]
534  *
535  * m_ctrxn_ecdf[irxn] = 0 This means that the rate coefficient calculator will calculate
536  * the rate constant as a chemical forward rate constant, a standard format.
537  * m_ctrxn_ecdf[irxn] = 1 this means that the rate coefficient calculator will calculate
538  * the rate constant as an exchange current density rate constant expression.
539  */
541 
542  //! Vector of standard concentrations
543  /*!
544  * Length number of kinetic species
545  * units depend on the definition of the standard concentration within each phase
546  */
548 
549  //! Vector of delta G^0, the standard state Gibbs free energies for each reaction
550  /*!
551  * Length is the number of reactions
552  * units are Joule kmol-1
553  */
555 
556  //! Vector of deltaG[] of reaction, the delta Gibbs free energies for each reaction
557  /*!
558  * Length is the number of reactions
559  * units are Joule kmol-1
560  */
562 
563  //! Vector of the products of the standard concentrations of the reactants
564  /*!
565  * Units vary wrt what the units of the standard concentrations are
566  * Length = number of reactions.
567  */
569 
570  bool m_ROP_ok;
571 
572  //! Current temperature of the data
573  doublereal m_temp;
574 
575  //! Current log of the temperature
576  doublereal m_logtemp;
577 
578  //! Boolean flag indicating whether any reaction in the mechanism
579  //! has a coverage dependent forward reaction rate
580  /*!
581  * If this is true, then the coverage dependence is multiplied into
582  * the forward reaction rates constant
583  */
585 
586  //! Boolean flag indicating whether any reaction in the mechanism
587  //! has a beta electrochemical parameter.
588  /*!
589  * If this is true, the Butler-Volmer correction is applied
590  * to the forward reaction rate for those reactions.
591  *
592  * fac = exp ( - beta * (delta_phi))
593  */
595 
596  //! Boolean flag indicating whether any reaction in the mechanism
597  //! is described by an exchange current density expression
598  /*!
599  * If this is true, the standard state Gibbs free energy of the reaction
600  * and the product of the reactant standard concentrations must be
601  * precalculated in order to calculate the rate constant.
602  */
604 
605  //! Int flag to indicate that some phases in the kinetics mechanism are
606  //! non-existent.
607  /*!
608  * We change the ROP vectors to make sure that non-existent phases are
609  * treated correctly in the kinetics operator. The value of this is equal
610  * to the number of phases which don't exist.
611  */
613 
614  //! Vector of booleans indicating whether phases exist or not
615  /*!
616  * Vector of booleans indicating whether a phase exists or not. We use this
617  * to set the ROP's so that unphysical things don't happen. For example, a
618  * reaction can't go in the forwards direction if a phase in which a
619  * reactant is present doesn't exist. Because InterfaceKinetics deals with
620  * intrinsic quantities only normally, nowhere else is this extrinsic
621  * concept introduced except here.
622  *
623  * length = number of phases in the object. By default all phases exist.
624  */
625  std::vector<bool> m_phaseExists;
626 
627  //! Vector of int indicating whether phases are stable or not
628  /*!
629  * Vector of booleans indicating whether a phase is stable or not under
630  * the current conditions. We use this to set the ROP's so that
631  * unphysical things don't happen.
632  *
633  * length = number of phases in the object. By default all phases are stable.
634  */
636 
637  //! Vector of vector of booleans indicating whether a phase participates in
638  //! a reaction as a reactant
639  /*!
640  * m_rxnPhaseIsReactant[j][p] indicates whether a species in phase p
641  * participates in reaction j as a reactant.
642  */
643  std::vector<std::vector<bool> > m_rxnPhaseIsReactant;
644 
645  //! Vector of vector of booleans indicating whether a phase participates in a
646  //! reaction as a product
647  /*!
648  * m_rxnPhaseIsReactant[j][p] indicates whether a species in phase p
649  * participates in reaction j as a product.
650  */
651  std::vector<std::vector<bool> > m_rxnPhaseIsProduct;
652 
653  //! Values used for converting sticking coefficients into rate constants
654  struct StickData {
655  size_t index; //!< index of the sticking reaction in the full reaction list
656  double order; //!< exponent applied to site density term
657  double multiplier; //!< multiplicative factor in rate expression
658  bool use_motz_wise; //!< 'true' if Motz & Wise correction is being used
659  };
660 
661  //! Data for sticking reactions
662  std::vector<StickData> m_stickingData;
663 
664  void applyStickingCorrection(double T, double* kf);
665 
666  int m_ioFlag;
667 
668  //! Number of dimensions of reacting phase (2 for InterfaceKinetics, 1 for
669  //! EdgeKinetics)
670  size_t m_nDim;
671 };
672 }
673 
674 #endif
void applyVoltageKfwdCorrection(doublereal *const kfwd)
Apply modifications for the forward reaction rate for interfacial charge transfer reactions...
void setElectricPotential(int n, doublereal V)
Set the electric potential in the nth phase.
vector_fp m_deltaG0
Vector of delta G^0, the standard state Gibbs free energies for each reaction.
virtual bool addReaction(shared_ptr< Reaction > r)
Add a single reaction to the mechanism.
doublereal electrochem_beta(size_t irxn) const
Return the charge transfer rxn Beta parameter for the ith reaction.
doublereal m_logtemp
Current log of the temperature.
virtual void getDeltaEnthalpy(doublereal *deltaH)
Return the vector of values for the reactions change in enthalpy.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism...
Definition: Kinetics.h:227
SurfPhase * m_surf
Pointer to the single surface phase.
vector_fp m_phi
Vector of phase electric potentials.
void advanceCoverages(doublereal tstep)
Advance the surface coverages in time.
vector_fp m_deltaG
Vector of deltaG[] of reaction, the delta Gibbs free energies for each reaction.
virtual void getDeltaEntropy(doublereal *deltaS)
Return the vector of values for the reactions change in entropy.
vector_fp m_beta
Electrochemical transfer coefficient for the forward direction.
virtual void updateMu0()
Update the standard state chemical potentials and species equilibrium constant entries.
This rate coefficient manager supports one parameterization of the rate constant of any type...
Definition: RateCoeffMgr.h:21
virtual void getDeltaSSEntropy(doublereal *deltaS)
Return the vector of values for the change in the standard state entropies for each reaction...
virtual void getEquilibriumConstants(doublereal *kc)
Equilibrium constant for all reactions including the voltage term.
double effectiveActivationEnergy_R(size_t irxn)
Return effective activation energy for the specified reaction.
std::vector< std::vector< bool > > m_rxnPhaseIsProduct
Vector of vector of booleans indicating whether a phase participates in a reaction as a product...
vector_fp m_StandardConc
Vector of standard concentrations.
virtual void addPhase(thermo_t &thermo)
Add a phase to the kinetics manager object.
double effectiveTemperatureExponent(size_t irxn)
Return effective temperature exponent for the specified reaction.
void convertExchangeCurrentDensityFormulation(doublereal *const kfwd)
When an electrode reaction rate is optionally specified in terms of its exchange current density...
bool m_has_electrochem_rxns
Boolean flag indicating whether any reaction in the mechanism has a beta electrochemical parameter...
int m_phaseExistsCheck
Int flag to indicate that some phases in the kinetics mechanism are non-existent. ...
vector_fp m_mu0_Kc
Vector of standard state electrochemical potentials modified by a standard concentration term...
vector_fp deltaElectricEnergy_
Storage for the net electric energy change due to reaction.
SurfaceArrhenius buildSurfaceArrhenius(size_t i, InterfaceReaction &r, bool replace)
Build a SurfaceArrhenius object from a Reaction, taking into account the possible sticking coefficien...
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
Values used for converting sticking coefficients into rate constants.
void updateKc()
Update the equilibrium constants and stored electrochemical potentials in molar units for all reversi...
std::vector< int > vector_int
Vector of ints.
Definition: ct_defs.h:159
virtual void resizeSpecies()
Resize arrays with sizes that depend on the total number of species.
doublereal m_temp
Current temperature of the data.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition: SurfPhase.h:142
bool m_has_coverage_dependence
Boolean flag indicating whether any reaction in the mechanism has a coverage dependent forward reacti...
vector_int m_ctrxn_ecdf
Vector of booleans indicating whether the charge transfer reaction rate constant is described by an e...
virtual void getDeltaGibbs(doublereal *deltaG)
Return the vector of values for the reaction Gibbs free energy change.
std::vector< size_t > m_ctrxn_BVform
Vector of Reactions which follow the Butler-Volmer methodology for specifying the exchange current de...
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
vector_int m_phaseIsStable
Vector of int indicating whether phases are stable or not.
A kinetics manager for heterogeneous reaction mechanisms.
vector_fp m_conc
Array of concentrations for each species in the kinetics mechanism.
void solvePseudoSteadyStateProblem(int ifuncOverride=-1, doublereal timeScaleOverride=1.0)
Solve for the pseudo steady-state of the surface problem.
std::vector< bool > m_phaseExists
Vector of booleans indicating whether phases exist or not.
bool use_motz_wise
&#39;true&#39; if Motz & Wise correction is being used
size_t m_nDim
Number of dimensions of reacting phase (2 for InterfaceKinetics, 1 for EdgeKinetics) ...
void _update_rates_T()
Update properties that depend on temperature.
A reaction occurring on an interface (i.e. a SurfPhase or an EdgePhase)
Definition: Reaction.h:206
vector_fp m_actConc
Array of activity concentrations for each species in the kinetics object.
Public interface for kinetics managers.
Definition: Kinetics.h:110
virtual void getActivityConcentrations(doublereal *const conc)
Get the vector of activity concentrations used in the kinetics object.
void _update_rates_C()
Update properties that depend on the species mole fractions and/or concentration,.
vector_fp m_pot
Vector of potential energies due to Voltages.
int phaseExistence(const size_t iphase) const
Gets the phase existence int for the ith phase.
void setPhaseStability(const size_t iphase, const int isStable)
Set the stability of a phase in the reaction object.
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
bool m_has_exchange_current_density_formulation
Boolean flag indicating whether any reaction in the mechanism is described by an exchange current den...
double multiplier
multiplicative factor in rate expression
std::vector< std::vector< bool > > m_rxnPhaseIsReactant
Vector of vector of booleans indicating whether a phase participates in a reaction as a reactant...
virtual void modifyReaction(size_t i, shared_ptr< Reaction > rNew)
Modify the rate expression associated with a reaction.
std::vector< size_t > m_revindex
List of reactions numbers which are reversible reactions.
int phaseStability(const size_t iphase) const
Gets the phase stability int for the ith phase.
virtual void getRevRateConstants(doublereal *krev, bool doIrreversible=false)
Return the reverse rate constants.
std::vector< StickData > m_stickingData
Data for sticking reactions.
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
virtual std::string kineticsType() const
Identifies the Kinetics manager type.
void _update_rates_phi()
Update properties that depend on the electric potential.
virtual void init()
Prepare the class for the addition of reactions, after all phases have been added.
std::vector< size_t > m_irrev
Vector of irreversible reaction numbers.
Advances the surface coverages of the associated set of SurfacePhase objects in time.
InterfaceKinetics(thermo_t *thermo=0)
Constructor.
vector_fp m_mu
Vector of chemical potentials for all species.
void updateExchangeCurrentQuantities()
values needed to convert from exchange current density to surface reaction rate.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
virtual void updateROP()
Internal routine that updates the Rates of Progress of the reactions.
double effectivePreExponentialFactor(size_t irxn)
Return effective preexponent for the specified reaction.
double order
exponent applied to site density term
Rate1< SurfaceArrhenius > m_rates
Templated class containing the vector of reactions for this interface.
std::vector< size_t > m_ctrxn
Vector of reaction indexes specifying the id of the charge transfer reactions in the mechanism...
vector_fp m_ProdStanConcReac
Vector of the products of the standard concentrations of the reactants.
void setPhaseExistence(const size_t iphase, const int exists)
Set the existence of a phase in the reaction object.
size_t index
index of the sticking reaction in the full reaction list
virtual void getDeltaSSGibbs(doublereal *deltaG)
Return the vector of values for the reaction standard state Gibbs free energy change.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
virtual void getDeltaElectrochemPotentials(doublereal *deltaM)
Return the vector of values for the reaction electrochemical free energy change.
vector_fp m_mu0
Vector of standard state chemical potentials for all species.
vector_fp m_grt
Temporary work vector of length m_kk.
virtual void getDeltaSSEnthalpy(doublereal *deltaH)
Return the vector of values for the change in the standard state enthalpies of reaction.
ImplicitSurfChem * m_integrator
Pointer to the Implicit surface chemistry object.
An Arrhenius rate with coverage-dependent terms.
Definition: RxnRates.h:118
An interface reaction which involves charged species.
Definition: Reaction.h:235