8 #ifndef CT_IFACEKINETICS_H
9 #define CT_IFACEKINETICS_H
25 class ImplicitSurfChem;
88 virtual int type()
const;
106 void getExchangeCurrentQuantities();
175 bool doIrreversible =
false);
199 virtual bool ready()
const;
265 doublereal timeScaleOverride = 1.0);
267 void setIOFlag(
int ioFlag);
269 void checkPartialEquil();
271 size_t reactionNumber()
const {
275 void addElementaryReaction(ReactionData& r);
276 void addGlobalReaction(
const ReactionData& r);
277 void installReagents(
const ReactionData& r);
294 m_index[rxnNumber] = std::pair<int, size_t>(
type, loc);
390 mutable std::map<size_t, std::pair<int, size_t> >
m_index;
423 mutable std::vector<std::map<size_t, doublereal> >
m_rrxn;
433 mutable std::vector<std::map<size_t, doublereal> >
m_prxn;
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...
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...
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.
void updateKc()
Update the equilibrium constants in molar units for all reversible reactions.
std::vector< int > vector_int
Vector of ints.
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.
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.
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...
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.
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.
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