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