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