InterfaceKinetics.h Source File#
InterfaceKinetics.h
Go to the documentation of this file.
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Advances the surface coverages of the associated set of SurfacePhase objects in time.
Definition ImplicitSurfChem.h:59
A kinetics manager for heterogeneous reaction mechanisms.
Definition InterfaceKinetics.h:56
bool addReaction(shared_ptr< Reaction > r, bool resize=true) override
Add a single reaction to the mechanism.
Definition InterfaceKinetics.cpp:380
int phaseExistence(const size_t iphase) const
Gets the phase existence int for the ith phase.
Definition InterfaceKinetics.cpp:567
double interfaceCurrent(const size_t iphase)
Gets the interface current for the ith phase.
Definition InterfaceKinetics.cpp:589
vector< vector< bool > > m_rxnPhaseIsReactant
Vector of vector of booleans indicating whether a phase participates in a reaction as a reactant.
Definition InterfaceKinetics.h:471
string kineticsType() const override
Identifies the Kinetics manager type.
Definition InterfaceKinetics.h:65
vector< int > m_phaseIsStable
Vector of int indicating whether phases are stable or not.
Definition InterfaceKinetics.h:463
Eigen::SparseMatrix< double > revRatesOfProgress_ddCi() override
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant...
Definition InterfaceKinetics.cpp:616
size_t m_nDim
Number of dimensions of reacting phase (2 for InterfaceKinetics, 1 for EdgeKinetics)
Definition InterfaceKinetics.h:485
void getFwdRateConstants(double *kfwd) override
Return the forward rate constants.
Definition InterfaceKinetics.cpp:177
vector< bool > m_phaseExists
Vector of booleans indicating whether phases exist or not.
Definition InterfaceKinetics.h:453
void getDeltaSSGibbs(double *deltaG) override
Return the vector of values for the reaction standard state Gibbs free energy change.
Definition InterfaceKinetics.cpp:333
void setPhaseStability(const size_t iphase, const int isStable)
Set the stability of a phase in the reaction object.
Definition InterfaceKinetics.cpp:579
void getDeltaGibbs(double *deltaG) override
Return the vector of values for the reaction Gibbs free energy change.
Definition InterfaceKinetics.cpp:283
bool m_jac_skip_coverage_dependence
A flag used to neglect rate coefficient coverage dependence in derivative formation.
Definition InterfaceKinetics.h:493
bool isReversible(size_t i) override
True if reaction i has been declared to be reversible.
Definition InterfaceKinetics.h:104
void _update_rates_phi()
Update properties that depend on the electric potential.
Definition InterfaceKinetics.cpp:81
void assertDerivativesValid(const string &name)
Helper function ensuring that all rate derivatives can be calculated.
Definition InterfaceKinetics.cpp:674
double m_jac_rtol_delta
Relative tolerance used in developing numerical portions of specific derivatives.
Definition InterfaceKinetics.h:497
void setMultiplier(size_t i, double f) override
Set the multiplier for reaction i to f.
Definition InterfaceKinetics.cpp:473
void getDeltaSSEntropy(double *deltaS) override
Return the vector of values for the change in the standard state entropies for each reaction.
Definition InterfaceKinetics.cpp:364
void advanceCoverages(double 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:518
void getDeltaSSEnthalpy(double *deltaH) override
Return the vector of values for the change in the standard state enthalpies of reaction.
Definition InterfaceKinetics.cpp:347
void resizeSpecies() override
Resize arrays with sizes that depend on the total number of species.
Definition InterfaceKinetics.cpp:501
void getActivityConcentrations(double *const conc) override
Get the vector of activity concentrations used in the kinetics object.
Definition InterfaceKinetics.cpp:111
void getRevRateConstants(double *krev, bool doIrreversible=false) override
Return the reverse rate constants.
Definition InterfaceKinetics.cpp:186
void getEquilibriumConstants(double *kc) override
Equilibrium constant for all reactions including the voltage term.
Definition InterfaceKinetics.cpp:166
vector< size_t > m_revindex
List of reactions numbers which are reversible reactions.
Definition InterfaceKinetics.h:336
bool m_has_electrochemistry
A flag stating if the object uses electrochemistry.
Definition InterfaceKinetics.h:499
void updateKc()
Update the equilibrium constants and stored electrochemical potentials in molar units for all reversi...
Definition InterfaceKinetics.cpp:117
void setPhaseExistence(const size_t iphase, const int exists)
Set the existence of a phase in the reaction object.
Definition InterfaceKinetics.cpp:548
void updateROP() override
Internal routine that updates the Rates of Progress of the reactions.
Definition InterfaceKinetics.cpp:201
void applyEquilibriumConstants(double *rop)
Multiply rate with inverse equilibrium constant.
Definition InterfaceKinetics.cpp:683
void getDerivativeSettings(AnyMap &settings) const override
Retrieve derivative settings.
Definition InterfaceKinetics.cpp:658
void getDeltaEnthalpy(double *deltaH) override
Return the vector of values for the reactions change in enthalpy.
Definition InterfaceKinetics.cpp:311
Eigen::SparseMatrix< double > fwdRatesOfProgress_ddCi() override
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant...
Definition InterfaceKinetics.cpp:606
void modifyReaction(size_t i, shared_ptr< Reaction > rNew) override
Modify the rate expression associated with a reaction.
Definition InterfaceKinetics.cpp:446
bool m_jac_skip_electrochemistry
A flag used to neglect electrochemical contributions in derivative formation.
Definition InterfaceKinetics.h:495
void _update_rates_C()
Update properties that depend on the species mole fractions and/or concentration,.
Definition InterfaceKinetics.cpp:92
vector< double > m_rbuf0
Buffers for partial rop results with length nReactions()
Definition InterfaceKinetics.h:488
int phaseStability(const size_t iphase) const
Gets the phase stability int for the ith phase.
Definition InterfaceKinetics.cpp:573
vector< unique_ptr< MultiRateBase > > m_interfaceRates
Vector of rate handlers for interface reactions.
Definition InterfaceKinetics.h:341
vector< double > m_mu0_Kc
Vector of standard state electrochemical potentials modified by a standard concentration term.
Definition InterfaceKinetics.h:408
ImplicitSurfChem * m_integrator
Pointer to the Implicit surface chemistry object.
Definition InterfaceKinetics.h:426
void _update_rates_T()
Update properties that depend on temperature.
Definition InterfaceKinetics.cpp:44
void solvePseudoSteadyStateProblem(int ifuncOverride=-1, double timeScaleOverride=1.0)
Solve for the pseudo steady-state of the surface problem.
Definition InterfaceKinetics.cpp:534
bool m_has_coverage_dependence
A flag stating if the object has coverage dependent rates.
Definition InterfaceKinetics.h:501
virtual void updateMu0()
Update the standard state chemical potentials and species equilibrium constant entries.
Definition InterfaceKinetics.cpp:148
void addThermo(shared_ptr< ThermoPhase > thermo) override
Add a thermo phase to the kinetics manager object.
Definition InterfaceKinetics.cpp:487
vector< double > m_mu
Vector of chemical potentials for all species.
Definition InterfaceKinetics.h:394
vector< double > m_actConc
Array of activity concentrations for each species in the kinetics object.
Definition InterfaceKinetics.h:376
vector< double > m_mu0
Vector of standard state chemical potentials for all species.
Definition InterfaceKinetics.h:385
void getDeltaElectrochemPotentials(double *deltaM) override
Return the vector of values for the reaction electrochemical free energy change.
Definition InterfaceKinetics.cpp:300
void setElectricPotential(int n, double V)
Set the electric potential in the nth phase.
Definition InterfaceKinetics.cpp:38
void init() override
Prepare the class for the addition of reactions, after all phases have been added.
Definition InterfaceKinetics.cpp:494
void resizeReactions() override
Finalize Kinetics object and associated objects.
Definition InterfaceKinetics.cpp:22
int m_phaseExistsCheck
Int flag to indicate that some phases in the kinetics mechanism are non-existent.
Definition InterfaceKinetics.h:440
Eigen::SparseMatrix< double > calculateCompositionDerivatives(StoichManagerN &stoich, const vector< double > &in)
Process mole fraction derivative.
Definition InterfaceKinetics.cpp:665
Eigen::SparseMatrix< double > netRatesOfProgress_ddCi() override
Calculate derivatives for net rates-of-progress with respect to species concentration at constant tem...
Definition InterfaceKinetics.cpp:627
void getDeltaEntropy(double *deltaS) override
Return the vector of values for the reactions change in entropy.
Definition InterfaceKinetics.cpp:322
vector< vector< bool > > m_rxnPhaseIsProduct
Vector of vector of booleans indicating whether a phase participates in a reaction as a product.
Definition InterfaceKinetics.h:479
void setDerivativeSettings(const AnyMap &settings) override
Set/modify derivative settings.
Definition InterfaceKinetics.cpp:642
vector< double > m_conc
Array of concentrations for each species in the kinetics mechanism.
Definition InterfaceKinetics.h:362
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
Definition Kinetics.h:242
This class handles operations involving the stoichiometric coefficients on one side of a reaction (re...
Definition StoichManager.h:589
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition SurfPhase.h:98
Generated by 1.9.7