Cantera  2.1.2
InterfaceKinetics.h
Go to the documentation of this file.
1 /**
2  * @file InterfaceKinetics.h
3  *
4  * @ingroup chemkinetics
5  */
6 // Copyright 2001 California Institute of Technology
7 
8 #ifndef CT_IFACEKINETICS_H
9 #define CT_IFACEKINETICS_H
10 
12 #include "Kinetics.h"
13 
14 #include "cantera/base/utilities.h"
15 #include "RateCoeffMgr.h"
16 #include "ReactionStoichMgr.h"
17 
18 namespace Cantera
19 {
20 
21 // forward references
22 class ReactionData;
23 class ThermoPhase;
24 class SurfPhase;
25 class ImplicitSurfChem;
26 
27 //! A kinetics manager for heterogeneous reaction mechanisms. The
28 //! reactions are assumed to occur at a 2D interface between two 3D phases.
29 /*!
30  * There are some important additions to the behavior of the kinetics class
31  * due to the presence of multiple phases and a heterogeneous interface. If
32  * a reactant phase doesn't exists, i.e., has a mole number of zero, a
33  * heterogeneous reaction can not proceed from reactants to products. Note it
34  * could perhaps proceed from products to reactants if all of the product
35  * phases exist.
36  *
37  * In order to make the determination of whether a phase exists or not
38  * actually involves the specification of additional information to the
39  * kinetics object., which heretofore has only had access to intrinsic field
40  * information about the phases (i.e., temperature pressure, and mole
41  * fraction).
42  *
43  * The extrinsic specification of whether a phase exists or not must be
44  * specified on top of the intrinsic calculation of the reaction rate. This
45  * class carries a set of booleans indicating whether a phase in the
46  * heterogeneous mechanism exists or not.
47  *
48  * Additionally, the class carries a set of booleans around indicating
49  * whether a product phase is stable or not. If a phase is not
50  * thermodynamically stable, it may be the case that a particular reaction in
51  * a heterogeneous mechanism will create a product species in the unstable
52  * phase. However, other reactions in the mechanism will destruct that
53  * species. This may cause oscillations in the formation of the unstable
54  * phase from time step to time step within a ODE solver, in practice. In
55  * order to avoid this situation, a set of booleans is tracked which sets the
56  * stability of a phase. If a phase is deemed to be unstable, then species in
57  * that phase will not be allowed to be birthed by the kinetics operator.
58  * Nonexistent phases are deemed to be unstable by default, but this can be
59  * changed.
60  *
61  * @ingroup chemkinetics
62  */
64 {
65 public:
66  //! Constructor
67  /*!
68  * @param thermo The optional parameter may be used to initialize
69  * the object with one ThermoPhase object.
70  * HKM Note -> Since the interface kinetics
71  * object will probably require multiple thermophase
72  * objects, this is probably not a good idea
73  * to have this parameter.
74  */
76 
77  /// Destructor.
78  virtual ~InterfaceKinetics();
79 
80  //! Copy Constructor for the %Kinetics object.
82 
83  //! Assignment operator
85 
86  virtual Kinetics* duplMyselfAsKinetics(const std::vector<thermo_t*> & tpVector) const;
87 
88  virtual int type() const;
89 
90  //! Set the electric potential in the nth phase
91  /*!
92  * @param n phase Index in this kinetics object.
93  * @param V Electric potential (volts)
94  */
95  void setElectricPotential(int n, doublereal V);
96 
97  //! @name Reaction Rates Of Progress
98  //! @{
99 
100  virtual void getFwdRatesOfProgress(doublereal* fwdROP);
101  virtual void getRevRatesOfProgress(doublereal* revROP);
102  virtual void getNetRatesOfProgress(doublereal* netROP);
103 
104  virtual void getEquilibriumConstants(doublereal* kc);
105 
106  void getExchangeCurrentQuantities();
107 
108  virtual void getDeltaGibbs(doublereal* deltaG);
109 
110  virtual void getDeltaElectrochemPotentials(doublereal* deltaM);
111  virtual void getDeltaEnthalpy(doublereal* deltaH);
112  virtual void getDeltaEntropy(doublereal* deltaS);
113 
114  virtual void getDeltaSSGibbs(doublereal* deltaG);
115  virtual void getDeltaSSEnthalpy(doublereal* deltaH);
116  virtual void getDeltaSSEntropy(doublereal* deltaS);
117 
118  //! @}
119  //! @name Species Production Rates
120  //! @{
121 
122  virtual void getCreationRates(doublereal* cdot);
123  virtual void getDestructionRates(doublereal* ddot);
124  virtual void getNetProductionRates(doublereal* net);
125 
126  //! @}
127  //! @name Reaction Mechanism Informational Query Routines
128  //! @{
129 
130  virtual doublereal reactantStoichCoeff(size_t k, size_t i) const {
131  return m_rrxn[k][i];
132  }
133 
134  virtual doublereal productStoichCoeff(size_t k, size_t i) const {
135  return m_prxn[k][i];
136  }
137 
138  virtual int reactionType(size_t i) const {
139  return m_index[i].first;
140  }
141 
142  virtual void getActivityConcentrations(doublereal* const conc);
143 
144  //! Return the charge transfer rxn Beta parameter for the ith reaction
145  /*!
146  * Returns the beta parameter for a charge transfer reaction. This
147  * parameter is not important for non-charge transfer reactions.
148  * Note, the parameter defaults to zero. However, a value of 0.5
149  * should be supplied for every charge transfer reaction if
150  * no information is known, as a value of 0.5 pertains to a
151  * symmetric transition state. The value can vary between 0 to 1.
152  *
153  * @param irxn Reaction number in the kinetics mechanism
154  *
155  * @return Beta parameter. This defaults to zero, even for charge
156  * transfer reactions.
157  */
158  doublereal electrochem_beta(size_t irxn) const;
159 
160  virtual bool isReversible(size_t i) {
161  if (std::find(m_revindex.begin(), m_revindex.end(), i)
162  < m_revindex.end()) {
163  return true;
164  } else {
165  return false;
166  }
167  }
168 
169  virtual std::string reactionString(size_t i) const {
170  return m_rxneqn[i];
171  }
172 
173  virtual void getFwdRateConstants(doublereal* kfwd);
174  virtual void getRevRateConstants(doublereal* krev,
175  bool doIrreversible = false);
176  virtual void getActivationEnergies(doublereal* E);
177 
178  //! @}
179  //! @name Reaction Mechanism Construction
180  //! @{
181 
182  //! Add a phase to the kinetics manager object.
183  /*!
184  * This must be done before the function init() is called or
185  * before any reactions are input.
186  *
187  * This function calls Kinetics::addPhase(). It also sets the following
188  * fields:
189  *
190  * m_phaseExists[]
191  *
192  * @param thermo Reference to the ThermoPhase to be added.
193  */
194  virtual void addPhase(thermo_t& thermo);
195 
196  virtual void init();
197  virtual void addReaction(ReactionData& r);
198  virtual void finalize();
199  virtual bool ready() const;
200  //! @}
201 
202  //! Internal routine that updates the Rates of Progress of the reactions
203  /*!
204  * This is actually the guts of the functionality of the object
205  */
206  void updateROP();
207 
208  //! Update properties that depend on temperature
209  /*!
210  * Current objects that this function updates:
211  * m_kdata->m_logtemp
212  * m_kdata->m_rfn
213  * m_rates.
214  * updateKc();
215  */
216  void _update_rates_T();
217 
218  //! Update properties that depend on the electric potential
219  void _update_rates_phi();
220 
221  //! Update properties that depend on the species mole fractions and/or
222  //! concentration,
223  /*!
224  * This method fills out the array of generalized concentrations by
225  * calling method getActivityConcentrations for each phase, which classes
226  * representing phases should overload to return the appropriate
227  * quantities.
228  */
229  void _update_rates_C();
230 
231  //! Advance the surface coverages in time
232  /*!
233  * This method carries out a time-accurate advancement of the
234  * surface coverages for a specified amount of time.
235  *
236  * \f[
237  * \dot {\theta}_k = \dot s_k (\sigma_k / s_0)
238  * \f]
239  *
240  * @param tstep Time value to advance the surface coverages
241  */
242  void advanceCoverages(doublereal tstep);
243 
244  //! Solve for the pseudo steady-state of the surface problem
245  /*!
246  * This is the same thing as the advanceCoverages() function,
247  * but at infinite times.
248  *
249  * Note, a direct solve is carried out under the hood here,
250  * to reduce the computational time.
251  *
252  * @param ifuncOverride One of the values defined in @ref solvesp_methods.
253  * The default is -1, which means that the program will decide.
254  * @param timeScaleOverride When a pseudo transient is
255  * selected this value can be used to override
256  * the default time scale for integration which
257  * is one.
258  * When SFLUX_TRANSIENT is used, this is equal to the
259  * time over which the equations are integrated.
260  * When SFLUX_INITIALIZE is used, this is equal to the
261  * time used in the initial transient algorithm,
262  * before the equation system is solved directly.
263  */
264  void solvePseudoSteadyStateProblem(int ifuncOverride = -1,
265  doublereal timeScaleOverride = 1.0);
266 
267  void setIOFlag(int ioFlag);
268 
269  void checkPartialEquil();
270 
271  size_t reactionNumber() const {
272  return m_ii;
273  }
274 
275  void addElementaryReaction(ReactionData& r);
276  void addGlobalReaction(const ReactionData& r);
277  void installReagents(const ReactionData& r);
278 
279  /**
280  * Update the equilibrium constants in molar units for all reversible
281  * reactions. 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  //! Write values into m_index
288  /*!
289  * @param rxnNumber reaction number
290  * @param type reaction type
291  * @param loc location ??
292  */
293  void registerReaction(size_t rxnNumber, int type, size_t loc) {
294  m_index[rxnNumber] = std::pair<int, size_t>(type, loc);
295  }
296 
297  //! Apply corrections for interfacial charge 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 kf Vector of forward reaction rate constants on which to have
304  * the correction applied
305  */
306  void applyButlerVolmerCorrection(doublereal* const kf);
307 
308  //! When an electrode reaction rate is optionally specified in terms of its
309  //! exchange current density, extra vectors need to be precalculated
310  void applyExchangeCurrentDensityFormulation(doublereal* const kfwd);
311 
312  //! Set the existence of a phase in the reaction object
313  /*!
314  * Tell the kinetics object whether a phase in the object exists. This is
315  * actually an extrinsic specification that must be carried out on top of
316  * the intrinsic calculation of the reaction rate. The routine will also
317  * flip the IsStable boolean within the kinetics object as well.
318  *
319  * @param iphase Index of the phase. This is the order within the
320  * internal thermo vector object
321  * @param exists Boolean indicating whether the phase exists or not
322  */
323  void setPhaseExistence(const size_t iphase, const int exists);
324 
325  //! Set the stability of a phase in the reaction object
326  /*!
327  * Tell the kinetics object whether a phase in the object is stable.
328  * Species in an unstable phase will not be allowed to have a positive
329  * rate of formation from this kinetics object. This is actually an
330  * extrinsic specification that must be carried out on top of the
331  * intrinsic calculation of the reaction rate.
332  *
333  * While conceptually not needed since kinetics is consistent with thermo
334  * when taken as a whole, in practice it has found to be very useful to
335  * turn off the creation of phases which shouldn't be forming. Typically
336  * this can reduce the oscillations in phase formation and destruction
337  * which are observed.
338  *
339  * @param iphase Index of the phase. This is the order within the
340  * internal thermo vector object
341  * @param isStable Flag indicating whether the phase is stable or not
342  */
343  void setPhaseStability(const size_t iphase, const int isStable);
344 
345  //! Gets the phase existence int for the ith phase
346  /*!
347  * @param iphase Phase Id
348  * @return The int specifying whether the kinetics object thinks the phase
349  * exists or not. If it exists, then species in that phase can be
350  * a reactant in reactions.
351  */
352  int phaseExistence(const size_t iphase) const;
353 
354  //! Gets the phase stability int for the ith phase
355  /*!
356  * @param iphase Phase Id
357  * @return The int specifying whether the kinetics object thinks the phase
358  * is stable with nonzero mole numbers. If it stable, then the
359  * kinetics object will allow for rates of production of of
360  * species in that phase that are positive.
361  */
362  int phaseStability(const size_t iphase) const;
363 
364 protected:
365  //! Temporary work vector of length m_kk
367 
368  //! List of reactions numbers which are reversible reactions
369  /*!
370  * This is a vector of reaction numbers. Each reaction in the list is
371  * reversible. Length = number of reversible reactions
372  */
373  std::vector<size_t> m_revindex;
374 
375  //! Templated class containing the vector of reactions for this interface
376  /*!
377  * The templated class is described in RateCoeffMgr.h
378  * The class SurfaceArrhenius is described in RxnRates.h
379  */
381 
382  bool m_redo_rates;
383 
384  /**
385  * Vector of information about reactions in the mechanism.
386  * The key is the reaction index (0 < i < m_ii).
387  * The first pair is the reactionType of the reaction.
388  * The second pair is ...
389  */
390  mutable std::map<size_t, std::pair<int, size_t> > m_index;
391 
392  //! Vector of irreversible reaction numbers
393  /*!
394  * vector containing the reaction numbers of irreversible reactions.
395  */
396  std::vector<size_t> m_irrev;
397 
398  //! Stoichiometric manager for the reaction mechanism
399  /*!
400  * This is the manager for the kinetics mechanism that handles turning
401  * reaction extents into species production rates and also handles
402  * turning thermo properties into reaction thermo properties.
403  */
405 
406  //! Number of irreversible reactions in the mechanism
407  size_t m_nirrev;
408 
409  //! Number of reversible reactions in the mechanism
410  size_t m_nrev;
411 
412  //! m_rrxn is a vector of maps, containing the reactant
413  //! stoichiometric coefficient information
414  /*!
415  * m_rrxn has a length equal to the total number of species in the
416  * kinetics object. For each species, there exists a map, with the
417  * reaction number being the key, and the reactant stoichiometric
418  * coefficient for the species being the value.
419  *
420  * HKM -> mutable because search sometimes creates extra
421  * entries. To be fixed in future...
422  */
423  mutable std::vector<std::map<size_t, doublereal> > m_rrxn;
424 
425  //! m_prxn is a vector of maps, containing the reactant
426  //! stoichiometric coefficient information
427  /**
428  * m_prxn is a vector of maps. m_prxn has a length equal to the total
429  * number of species in the kinetics object. For each species, there
430  * exists a map, with the reaction number being the key, and the product
431  * stoichiometric coefficient for the species being the value.
432  */
433  mutable std::vector<std::map<size_t, doublereal> > m_prxn;
434 
435  //! String expression for each rxn
436  /*!
437  * Vector of strings of length m_ii, the number of
438  * reactions, containing the string expressions for each reaction
439  * (e.g., reactants <=> product1 + product2)
440  */
441  std::vector<std::string> m_rxneqn;
442 
443  //! an array of generalized concentrations for each species
444  /*!
445  * An array of generalized concentrations \f$ C_k \f$ that are defined
446  * such that \f$ a_k = C_k / C^0_k, \f$ where \f$ C^0_k \f$ is a standard
447  * concentration/ These generalized concentrations are used by this
448  * kinetics manager class to compute the forward and reverse rates of
449  * elementary reactions. The "units" for the concentrations of each phase
450  * depend upon the implementation of kinetics within that phase. The order
451  * of the species within the vector is based on the order of listed
452  * ThermoPhase objects in the class, and the order of the species within
453  * each ThermoPhase class.
454  */
456 
457  //! Vector of standard state chemical potentials
458  /*!
459  * This vector contains a temporary vector of standard state chemical
460  * potentials for all of the species in the kinetics object
461  *
462  * Length = m_k. Units = J/kmol.
463  */
465 
466  //! Vector of phase electric potentials
467  /*!
468  * Temporary vector containing the potential of each phase in the kinetics
469  * object.
470  *
471  * length = number of phases. Units = Volts.
472  */
474 
475  //! Vector of potential energies due to Voltages
476  /*!
477  * Length is the number of species in kinetics mech. It's
478  * used to store the potential energy due to the voltage.
479  */
481 
482  //! Vector temporary
483  /*!
484  * Length is number of reactions. It's used to store the
485  * voltage contribution to the activation energy.
486  */
488 
489  //! Vector of raw activation energies for the reactions
490  /*!
491  * units are in Kelvin
492  * Length is number of reactions.
493  */
495 
496  //! Pointer to the single surface phase
498 
499  //! Pointer to the Implicit surface chemistry object
500  /*!
501  * Note this object is owned by this InterfaceKinetics object. It may only
502  * be used to solve this single InterfaceKinetics objects's surface
503  * problem uncoupled from other surface phases.
504  */
506 
507  vector_fp m_beta;
508 
509  //! Vector of reaction indexes specifying the id of the current transfer
510  //! reactions in the mechanism
511  /*!
512  * Vector of reaction indices which involve current transfers. This provides
513  * an index into the m_beta array.
514  *
515  * irxn = m_ctrxn[i]
516  */
517  std::vector<size_t> m_ctrxn;
518 
519  //! Vector of booleans indicating whether the charge transfer reaction may
520  //! be described by an exchange current density expression
522 
523  vector_fp m_StandardConc;
524  vector_fp m_deltaG0;
525  vector_fp m_ProdStanConcReac;
526 
527  doublereal m_logp0;
528  doublereal m_logc0;
529  vector_fp m_ropf;
530  vector_fp m_ropr;
531  vector_fp m_ropnet;
532 
533  bool m_ROP_ok;
534 
535  //! Current temperature of the data
536  doublereal m_temp;
537  //! Current log of the temperature
538  doublereal m_logtemp;
539  vector_fp m_rfn;
540  vector_fp m_rkcn;
541 
542  //! boolean indicating whether mechanism has been finalized
544 
545  //! Boolean flag indicating whether any reaction in the mechanism
546  //! has a coverage dependent forward reaction rate
547  /*!
548  * If this is true, then the coverage dependence is multiplied into
549  * the forward reaction rates constant
550  */
552 
553  //! Boolean flag indicating whether any reaction in the mechanism
554  //! has a beta electrochemical parameter.
555  /*!
556  * If this is true, the Butler-Volmer correction is applied
557  * to the forward reaction rate for those reactions.
558  *
559  * fac = exp ( - beta * (delta_phi))
560  */
562 
563  //! Boolean flag indicating whether any reaction in the mechanism
564  //! is described by an exchange current density expression
565  /*!
566  * If this is true, the standard state gibbs free energy of the reaction
567  * and the product of the reactant standard concentrations must be
568  * precalculated in order to calculate the rate constant.
569  */
571 
572  //! Int flag to indicate that some phases in the kinetics mechanism are
573  //! non-existent.
574  /*!
575  * We change the ROP vectors to make sure that non-existent phases are
576  * treated correctly in the kinetics operator. The value of this is equal
577  * to the number of phases which don't exist.
578  */
580 
581  //! Vector of booleans indicating whether phases exist or not
582  /*!
583  * Vector of booleans indicating whether a phase exists or not. We use
584  * this to set the ROP's so that unphysical things don't happen
585  *
586  * length = number of phases in the object. By default all phases exist.
587  */
588  std::vector<bool> m_phaseExists;
589 
590  //! Vector of int indicating whether phases are stable or not
591  /*!
592  * Vector of booleans indicating whether a phase is stable or not under
593  * the current conditions. We use this to set the ROP's so that
594  * unphysical things don't happen
595  *
596  * length = number of phases in the object. By default all phases are stable.
597  */
598  std::vector<int> m_phaseIsStable;
599 
600  //! Vector of vector of booleans indicating whether a phase participates in a
601  //! reaction as a reactant
602  /*!
603  * m_rxnPhaseIsReactant[j][p] indicates whether a species in phase p
604  * participates in reaction j as a reactant.
605  */
606  std::vector<std::vector<bool> > m_rxnPhaseIsReactant;
607 
608  //! Vector of vector of booleans indicating whether a phase participates in a
609  //! reaction as a product
610  /*!
611  * m_rxnPhaseIsReactant[j][p] indicates whether a species in phase p
612  * participates in reaction j as a product.
613  */
614  std::vector<std::vector<bool> > m_rxnPhaseIsProduct;
615 
616  int m_ioFlag;
617 };
618 }
619 
620 #endif
virtual void getActivationEnergies(doublereal *E)
Return the activation energies in Kelvin.
void setElectricPotential(int n, doublereal V)
Set the electric potential in the nth phase.
int phaseStability(const size_t iphase) const
Gets the phase stability int for the ith phase.
virtual void getCreationRates(doublereal *cdot)
Species creation rates [kmol/m^3/s or kmol/m^2/s].
virtual bool ready() const
Returns true if the kinetics manager has been properly initialized and finalized. ...
doublereal m_logtemp
Current log of the temperature.
virtual void getDeltaEnthalpy(doublereal *deltaH)
Return the vector of values for the reactions change in enthalpy.
virtual void getNetProductionRates(doublereal *net)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
doublereal electrochem_beta(size_t irxn) const
Return the charge transfer rxn Beta parameter for the ith reaction.
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:288
Header file declaring class ReactionStoichMgr.
SurfPhase * m_surf
Pointer to the single surface phase.
int phaseExistence(const size_t iphase) const
Gets the phase existence int for the ith phase.
vector_fp m_phi
Vector of phase electric potentials.
void advanceCoverages(doublereal tstep)
Advance the surface coverages in time.
void applyButlerVolmerCorrection(doublereal *const kf)
Apply corrections for interfacial charge transfer reactions.
virtual void getDeltaEntropy(doublereal *deltaS)
Return the vector of values for the reactions change in entropy.
virtual ~InterfaceKinetics()
Destructor.
This rate coefficient manager supports one parameterization of the rate constant of any type...
Definition: RateCoeffMgr.h:25
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)
Return a vector of Equilibrium constants.
std::vector< std::vector< bool > > m_rxnPhaseIsProduct
Vector of vector of booleans indicating whether a phase participates in a reaction as a product...
void registerReaction(size_t rxnNumber, int type, size_t loc)
Write values into m_index.
virtual std::string reactionString(size_t i) const
Return a string representing the reaction.
virtual void addPhase(thermo_t &thermo)
Add a phase to the kinetics manager object.
virtual void addReaction(ReactionData &r)
Add a single reaction to the mechanism.
virtual void getFwdRatesOfProgress(doublereal *fwdROP)
Return the forward rates of progress of the reactions.
size_t m_nrev
Number of reversible reactions in the mechanism.
std::vector< std::map< size_t, doublereal > > m_prxn
m_prxn is a vector of maps, containing the reactant stoichiometric coefficient information ...
bool m_has_electrochem_rxns
Boolean flag indicating whether any reaction in the mechanism has a beta electrochemical parameter...
std::vector< std::string > m_rxneqn
String expression for each rxn.
int m_phaseExistsCheck
Int flag to indicate that some phases in the kinetics mechanism are non-existent. ...
virtual void finalize()
Finish adding reactions and prepare for use.
virtual void getDestructionRates(doublereal *ddot)
Species destruction rates [kmol/m^3/s or kmol/m^2/s].
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:101
void updateKc()
Update the equilibrium constants in molar units for all reversible reactions.
std::vector< int > vector_int
Vector of ints.
Definition: ct_defs.h:167
doublereal m_temp
Current temperature of the data.
virtual doublereal productStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a product in reaction i.
std::vector< std::map< size_t, doublereal > > m_rrxn
m_rrxn is a vector of maps, containing the reactant stoichiometric coefficient information ...
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 may be described by an exchange cu...
virtual void getDeltaGibbs(doublereal *deltaG)
Return the vector of values for the reaction gibbs free energy change.
virtual void getFwdRateConstants(doublereal *kfwd)
Return the forward rate constants.
vector_fp m_E
Vector of raw activation energies for the reactions.
A kinetics manager for heterogeneous reaction mechanisms.
virtual void getNetRatesOfProgress(doublereal *netROP)
Net rates of progress.
vector_fp m_conc
an array of generalized concentrations for each species
void solvePseudoSteadyStateProblem(int ifuncOverride=-1, doublereal timeScaleOverride=1.0)
Solve for the pseudo steady-state of the surface problem.
virtual int type() const
Identifies the kinetics manager type.
std::vector< bool > m_phaseExists
Vector of booleans indicating whether phases exist or not.
void _update_rates_T()
Update properties that depend on temperature.
Public interface for kinetics managers.
Definition: Kinetics.h:131
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.
Intermediate class which stores data about a reaction and its rate parameterization before adding the...
Definition: ReactionData.h:16
size_t m_nirrev
Number of irreversible reactions in the mechanism.
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...
std::vector< std::vector< bool > > m_rxnPhaseIsReactant
Vector of vector of booleans indicating whether a phase participates in a reaction as a reactant...
Reaction mechanism stoichiometry manager.
std::vector< size_t > m_revindex
List of reactions numbers which are reversible reactions.
virtual void getRevRatesOfProgress(doublereal *revROP)
Return the Reverse rates of progress of the reactions.
virtual void getRevRateConstants(doublereal *krev, bool doIrreversible=false)
Return the reverse rate constants.
virtual bool isReversible(size_t i)
True if reaction i has been declared to be reversible.
void _update_rates_phi()
Update properties that depend on the electric potential.
virtual void init()
Prepare the class for the addition of reactions.
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.
virtual Kinetics * duplMyselfAsKinetics(const std::vector< thermo_t * > &tpVector) const
Duplication routine for objects which inherit from Kinetics.
void applyExchangeCurrentDensityFormulation(doublereal *const kfwd)
When an electrode reaction rate is optionally specified in terms of its exchange current density...
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:165
void updateROP()
Internal routine that updates the Rates of Progress of the reactions.
std::vector< int > m_phaseIsStable
Vector of int indicating whether phases are stable or not.
Rate1< SurfaceArrhenius > m_rates
Templated class containing the vector of reactions for this interface.
vector_fp m_rwork
Vector temporary.
size_t m_ii
Number of reactions in the mechanism.
Definition: Kinetics.h:887
std::vector< size_t > m_ctrxn
Vector of reaction indexes specifying the id of the current transfer reactions in the mechanism...
void setPhaseExistence(const size_t iphase, const int exists)
Set the existence of a phase in the reaction object.
virtual doublereal reactantStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a reactant in reaction i.
virtual int reactionType(size_t i) const
Flag specifying the type of reaction.
std::map< size_t, std::pair< int, size_t > > m_index
Vector of information about reactions in the mechanism.
virtual void getDeltaSSGibbs(doublereal *deltaG)
Return the vector of values for the reaction standard state gibbs free energy change.
virtual void getDeltaElectrochemPotentials(doublereal *deltaM)
Return the vector of values for the reaction electrochemical free energy change.
ReactionStoichMgr m_rxnstoich
Stoichiometric manager for the reaction mechanism.
vector_fp m_mu0
Vector of standard state chemical potentials.
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.
InterfaceKinetics & operator=(const InterfaceKinetics &right)
Assignment operator.
bool m_finalized
boolean indicating whether mechanism has been finalized