Heterogeneous reactions at one-dimensional interfaces between multiple adjacent two-dimensional surfaces. More...
#include <EdgeKinetics.h>
Heterogeneous reactions at one-dimensional interfaces between multiple adjacent two-dimensional surfaces.
Definition at line 20 of file EdgeKinetics.h.
Public Member Functions | |
EdgeKinetics () | |
Constructor. | |
string | kineticsType () const override |
Identifies the Kinetics manager type. | |
Public Member Functions inherited from InterfaceKinetics | |
InterfaceKinetics ()=default | |
Constructor. | |
void | resizeReactions () override |
Finalize Kinetics object and associated objects. | |
string | kineticsType () const override |
Identifies the Kinetics manager type. | |
void | setElectricPotential (int n, double V) |
Set the electric potential in the nth phase. | |
void | updateROP () override |
Internal routine that updates the Rates of Progress of the reactions. | |
void | _update_rates_T () |
Update properties that depend on temperature. | |
void | _update_rates_phi () |
Update properties that depend on the electric potential. | |
void | _update_rates_C () |
Update properties that depend on the species mole fractions and/or concentration,. | |
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. | |
void | solvePseudoSteadyStateProblem (int ifuncOverride=-1, double timeScaleOverride=1.0) |
Solve for the pseudo steady-state of the surface problem. | |
void | setIOFlag (int ioFlag) |
virtual void | updateMu0 () |
Update the standard state chemical potentials and species equilibrium constant entries. | |
void | updateKc () |
Update the equilibrium constants and stored electrochemical potentials in molar units for all reversible reactions and for all species. | |
void | setPhaseExistence (const size_t iphase, const int exists) |
Set the existence of a phase in the reaction object. | |
void | setPhaseStability (const size_t iphase, const int isStable) |
Set the stability of a phase in the reaction object. | |
int | phaseExistence (const size_t iphase) const |
Gets the phase existence int for the ith phase. | |
int | phaseStability (const size_t iphase) const |
Gets the phase stability int for the ith phase. | |
double | interfaceCurrent (const size_t iphase) |
Gets the interface current for the ith phase. | |
void | setDerivativeSettings (const AnyMap &settings) override |
Set/modify derivative settings. | |
void | getDerivativeSettings (AnyMap &settings) const override |
Retrieve derivative settings. | |
Eigen::SparseMatrix< double > | fwdRatesOfProgress_ddCi () override |
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations. | |
Eigen::SparseMatrix< double > | revRatesOfProgress_ddCi () override |
Calculate derivatives for forward rates-of-progress with respect to species concentration at constant temperature, pressure and remaining species concentrations. | |
Eigen::SparseMatrix< double > | netRatesOfProgress_ddCi () override |
Calculate derivatives for net rates-of-progress with respect to species concentration at constant temperature, pressure, and remaining species concentrations. | |
void | getEquilibriumConstants (double *kc) override |
Equilibrium constant for all reactions including the voltage term. | |
void | getDeltaGibbs (double *deltaG) override |
Return the vector of values for the reaction Gibbs free energy change. | |
void | getDeltaElectrochemPotentials (double *deltaM) override |
Return the vector of values for the reaction electrochemical free energy change. | |
void | getDeltaEnthalpy (double *deltaH) override |
Return the vector of values for the reactions change in enthalpy. | |
void | getDeltaEntropy (double *deltaS) override |
Return the vector of values for the reactions change in entropy. | |
void | getDeltaSSGibbs (double *deltaG) override |
Return the vector of values for the reaction standard state Gibbs free energy change. | |
void | getDeltaSSEnthalpy (double *deltaH) override |
Return the vector of values for the change in the standard state enthalpies of reaction. | |
void | getDeltaSSEntropy (double *deltaS) override |
Return the vector of values for the change in the standard state entropies for each reaction. | |
void | getActivityConcentrations (double *const conc) override |
Get the vector of activity concentrations used in the kinetics object. | |
bool | isReversible (size_t i) override |
True if reaction i has been declared to be reversible. | |
void | getFwdRateConstants (double *kfwd) override |
Return the forward rate constants. | |
void | getRevRateConstants (double *krev, bool doIrreversible=false) override |
Return the reverse rate constants. | |
void | addThermo (shared_ptr< ThermoPhase > thermo) override |
Add a thermo phase to the kinetics manager object. | |
void | init () override |
Prepare the class for the addition of reactions, after all phases have been added. | |
void | resizeSpecies () override |
Resize arrays with sizes that depend on the total number of species. | |
bool | addReaction (shared_ptr< Reaction > r, bool resize=true) override |
Add a single reaction to the mechanism. | |
void | modifyReaction (size_t i, shared_ptr< Reaction > rNew) override |
Modify the rate expression associated with a reaction. | |
void | setMultiplier (size_t i, double f) override |
Set the multiplier for reaction i to f. | |
Public Member Functions inherited from Kinetics | |
virtual pair< size_t, size_t > | checkDuplicates (bool throw_err=true) const |
Check for unmarked duplicate reactions and unmatched marked duplicates. | |
virtual void | setRoot (shared_ptr< Solution > root) |
Set root Solution holding all phase information. | |
shared_ptr< Solution > | root () const |
Get the Solution object containing this Kinetics object and associated ThermoPhase objects. | |
Kinetics ()=default | |
Default constructor. | |
Kinetics (const Kinetics &)=delete | |
Kinetics objects are not copyable or assignable. | |
Kinetics & | operator= (const Kinetics &)=delete |
size_t | nReactions () const |
Number of reactions in the reaction mechanism. | |
void | checkReactionIndex (size_t m) const |
Check that the specified reaction index is in range Throws an exception if i is greater than nReactions() | |
void | checkReactionArraySize (size_t ii) const |
Check that an array size is at least nReactions() Throws an exception if ii is less than nReactions(). | |
void | checkSpeciesIndex (size_t k) const |
Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1. | |
void | checkSpeciesArraySize (size_t mm) const |
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). | |
size_t | nPhases () const |
The number of phases participating in the reaction mechanism. | |
void | checkPhaseIndex (size_t m) const |
Check that the specified phase index is in range Throws an exception if m is greater than nPhases() | |
void | checkPhaseArraySize (size_t mm) const |
Check that an array size is at least nPhases() Throws an exception if mm is less than nPhases(). | |
size_t | phaseIndex (const string &ph) const |
Return the phase index of a phase in the list of phases defined within the object. | |
size_t | reactionPhaseIndex () const |
Phase where the reactions occur. | |
shared_ptr< ThermoPhase > | reactionPhase () const |
Return pointer to phase where the reactions occur. | |
ThermoPhase & | thermo (size_t n=0) |
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism. | |
const ThermoPhase & | thermo (size_t n=0) const |
size_t | nTotalSpecies () const |
The total number of species in all phases participating in the kinetics mechanism. | |
size_t | kineticsSpeciesIndex (size_t k, size_t n) const |
The location of species k of phase n in species arrays. | |
string | kineticsSpeciesName (size_t k) const |
Return the name of the kth species in the kinetics manager. | |
size_t | kineticsSpeciesIndex (const string &nm) const |
This routine will look up a species number based on the input string nm. | |
ThermoPhase & | speciesPhase (const string &nm) |
This function looks up the name of a species and returns a reference to the ThermoPhase object of the phase where the species resides. | |
const ThermoPhase & | speciesPhase (const string &nm) const |
ThermoPhase & | speciesPhase (size_t k) |
This function takes as an argument the kineticsSpecies index (that is, the list index in the list of species in the kinetics manager) and returns the species' owning ThermoPhase object. | |
size_t | speciesPhaseIndex (size_t k) const |
This function takes as an argument the kineticsSpecies index (that is, the list index in the list of species in the kinetics manager) and returns the index of the phase owning the species. | |
virtual void | getFwdRatesOfProgress (double *fwdROP) |
Return the forward rates of progress of the reactions. | |
virtual void | getRevRatesOfProgress (double *revROP) |
Return the Reverse rates of progress of the reactions. | |
virtual void | getNetRatesOfProgress (double *netROP) |
Net rates of progress. | |
virtual void | getReactionDelta (const double *property, double *deltaProperty) const |
Change in species properties. | |
virtual void | getRevReactionDelta (const double *g, double *dg) const |
Given an array of species properties 'g', return in array 'dg' the change in this quantity in the reversible reactions. | |
virtual void | getThirdBodyConcentrations (double *concm) |
Return a vector of values of effective concentrations of third-body collision partners of any reaction. | |
virtual const vector< double > & | thirdBodyConcentrations () const |
Provide direct access to current third-body concentration values. | |
virtual void | getCreationRates (double *cdot) |
Species creation rates [kmol/m^3/s or kmol/m^2/s]. | |
virtual void | getDestructionRates (double *ddot) |
Species destruction rates [kmol/m^3/s or kmol/m^2/s]. | |
virtual void | getNetProductionRates (double *wdot) |
Species net production rates [kmol/m^3/s or kmol/m^2/s]. | |
virtual void | getFwdRateConstants_ddT (double *dkfwd) |
Calculate derivatives for forward rate constants with respect to temperature at constant pressure, molar concentration and mole fractions. | |
virtual void | getFwdRateConstants_ddP (double *dkfwd) |
Calculate derivatives for forward rate constants with respect to pressure at constant temperature, molar concentration and mole fractions. | |
virtual void | getFwdRateConstants_ddC (double *dkfwd) |
Calculate derivatives for forward rate constants with respect to molar concentration at constant temperature, pressure and mole fractions. | |
virtual void | getFwdRatesOfProgress_ddT (double *drop) |
Calculate derivatives for forward rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions. | |
virtual void | getFwdRatesOfProgress_ddP (double *drop) |
Calculate derivatives for forward rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions. | |
virtual void | getFwdRatesOfProgress_ddC (double *drop) |
Calculate derivatives for forward rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions. | |
virtual Eigen::SparseMatrix< double > | fwdRatesOfProgress_ddX () |
Calculate derivatives for forward rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
virtual void | getRevRatesOfProgress_ddT (double *drop) |
Calculate derivatives for reverse rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions. | |
virtual void | getRevRatesOfProgress_ddP (double *drop) |
Calculate derivatives for reverse rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions. | |
virtual void | getRevRatesOfProgress_ddC (double *drop) |
Calculate derivatives for reverse rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions. | |
virtual Eigen::SparseMatrix< double > | revRatesOfProgress_ddX () |
Calculate derivatives for reverse rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
virtual void | getNetRatesOfProgress_ddT (double *drop) |
Calculate derivatives for net rates-of-progress with respect to temperature at constant pressure, molar concentration and mole fractions. | |
virtual void | getNetRatesOfProgress_ddP (double *drop) |
Calculate derivatives for net rates-of-progress with respect to pressure at constant temperature, molar concentration and mole fractions. | |
virtual void | getNetRatesOfProgress_ddC (double *drop) |
Calculate derivatives for net rates-of-progress with respect to molar concentration at constant temperature, pressure and mole fractions. | |
virtual Eigen::SparseMatrix< double > | netRatesOfProgress_ddX () |
Calculate derivatives for net rates-of-progress with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
void | getCreationRates_ddT (double *dwdot) |
Calculate derivatives for species creation rates with respect to temperature at constant pressure, molar concentration and mole fractions. | |
void | getCreationRates_ddP (double *dwdot) |
Calculate derivatives for species creation rates with respect to pressure at constant temperature, molar concentration and mole fractions. | |
void | getCreationRates_ddC (double *dwdot) |
Calculate derivatives for species creation rates with respect to molar concentration at constant temperature, pressure and mole fractions. | |
Eigen::SparseMatrix< double > | creationRates_ddX () |
Calculate derivatives for species creation rates with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
Eigen::SparseMatrix< double > | creationRates_ddCi () |
Calculate derivatives for species creation rates with respect to species concentration at constant temperature, pressure, and concentration of all other species. | |
void | getDestructionRates_ddT (double *dwdot) |
Calculate derivatives for species destruction rates with respect to temperature at constant pressure, molar concentration and mole fractions. | |
void | getDestructionRates_ddP (double *dwdot) |
Calculate derivatives for species destruction rates with respect to pressure at constant temperature, molar concentration and mole fractions. | |
void | getDestructionRates_ddC (double *dwdot) |
Calculate derivatives for species destruction rates with respect to molar concentration at constant temperature, pressure and mole fractions. | |
Eigen::SparseMatrix< double > | destructionRates_ddX () |
Calculate derivatives for species destruction rates with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
Eigen::SparseMatrix< double > | destructionRates_ddCi () |
Calculate derivatives for species destruction rates with respect to species concentration at constant temperature, pressure, and concentration of all other species. | |
void | getNetProductionRates_ddT (double *dwdot) |
Calculate derivatives for species net production rates with respect to temperature at constant pressure, molar concentration and mole fractions. | |
void | getNetProductionRates_ddP (double *dwdot) |
Calculate derivatives for species net production rates with respect to pressure at constant temperature, molar concentration and mole fractions. | |
void | getNetProductionRates_ddC (double *dwdot) |
Calculate derivatives for species net production rates with respect to molar concentration at constant temperature, pressure and mole fractions. | |
Eigen::SparseMatrix< double > | netProductionRates_ddX () |
Calculate derivatives for species net production rates with respect to species mole fractions at constant temperature, pressure and molar concentration. | |
Eigen::SparseMatrix< double > | netProductionRates_ddCi () |
Calculate derivatives for species net production rates with respect to species concentration at constant temperature, pressure, and concentration of all other species. | |
virtual double | reactantStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a reactant in reaction i. | |
Eigen::SparseMatrix< double > | reactantStoichCoeffs () const |
Stoichiometric coefficient matrix for reactants. | |
virtual double | productStoichCoeff (size_t k, size_t i) const |
Stoichiometric coefficient of species k as a product in reaction i. | |
Eigen::SparseMatrix< double > | productStoichCoeffs () const |
Stoichiometric coefficient matrix for products. | |
Eigen::SparseMatrix< double > | revProductStoichCoeffs () const |
Stoichiometric coefficient matrix for products of reversible reactions. | |
virtual double | reactantOrder (size_t k, size_t i) const |
Reactant order of species k in reaction i. | |
virtual double | productOrder (int k, int i) const |
product Order of species k in reaction i. | |
AnyMap | parameters () |
Return the parameters for a phase definition which are needed to reconstruct an identical object using the newKinetics function. | |
shared_ptr< Reaction > | reaction (size_t i) |
Return the Reaction object for reaction i. | |
shared_ptr< const Reaction > | reaction (size_t i) const |
void | skipUndeclaredSpecies (bool skip) |
Determine behavior when adding a new reaction that contains species not defined in any of the phases associated with this kinetics manager. | |
bool | skipUndeclaredSpecies () const |
void | skipUndeclaredThirdBodies (bool skip) |
Determine behavior when adding a new reaction that contains third-body efficiencies for species not defined in any of the phases associated with this kinetics manager. | |
bool | skipUndeclaredThirdBodies () const |
double | multiplier (size_t i) const |
The current value of the multiplier for reaction i. | |
virtual void | invalidateCache () |
Additional Inherited Members | |
Protected Member Functions inherited from InterfaceKinetics | |
void | applyEquilibriumConstants (double *rop) |
Multiply rate with inverse equilibrium constant. | |
Eigen::SparseMatrix< double > | calculateCompositionDerivatives (StoichManagerN &stoich, const vector< double > &in) |
Process mole fraction derivative. | |
void | assertDerivativesValid (const string &name) |
Helper function ensuring that all rate derivatives can be calculated. | |
Protected Member Functions inherited from Kinetics | |
virtual void | updateROP () |
double | checkDuplicateStoich (map< int, double > &r1, map< int, double > &r2) const |
Check whether r1 and r2 represent duplicate stoichiometries This function returns a ratio if two reactions are duplicates of one another, and 0.0 otherwise. | |
Protected Attributes inherited from InterfaceKinetics | |
vector< double > | m_grt |
Temporary work vector of length m_kk. | |
vector< size_t > | m_revindex |
List of reactions numbers which are reversible reactions. | |
bool | m_redo_rates = false |
vector< unique_ptr< MultiRateBase > > | m_interfaceRates |
Vector of rate handlers for interface reactions. | |
map< string, size_t > | m_interfaceTypes |
Rate handler mapping. | |
vector< size_t > | m_irrev |
Vector of irreversible reaction numbers. | |
vector< double > | m_conc |
Array of concentrations for each species in the kinetics mechanism. | |
vector< double > | m_actConc |
Array of activity concentrations for each species in the kinetics object. | |
vector< double > | m_mu0 |
Vector of standard state chemical potentials for all species. | |
vector< double > | m_mu |
Vector of chemical potentials for all species. | |
vector< double > | m_mu0_Kc |
Vector of standard state electrochemical potentials modified by a standard concentration term. | |
vector< double > | m_phi |
Vector of phase electric potentials. | |
SurfPhase * | m_surf = nullptr |
Pointer to the single surface phase. | |
ImplicitSurfChem * | m_integrator = nullptr |
Pointer to the Implicit surface chemistry object. | |
bool | m_ROP_ok = false |
double | m_temp = 0.0 |
Current temperature of the data. | |
int | m_phaseExistsCheck = false |
Int flag to indicate that some phases in the kinetics mechanism are non-existent. | |
vector< bool > | m_phaseExists |
Vector of booleans indicating whether phases exist or not. | |
vector< int > | m_phaseIsStable |
Vector of int indicating whether phases are stable or not. | |
vector< vector< bool > > | m_rxnPhaseIsReactant |
Vector of vector of booleans indicating whether a phase participates in a reaction as a reactant. | |
vector< vector< bool > > | m_rxnPhaseIsProduct |
Vector of vector of booleans indicating whether a phase participates in a reaction as a product. | |
int | m_ioFlag = 0 |
size_t | m_nDim = 2 |
Number of dimensions of reacting phase (2 for InterfaceKinetics, 1 for EdgeKinetics) | |
vector< double > | m_rbuf0 |
Buffers for partial rop results with length nReactions() | |
vector< double > | m_rbuf1 |
bool | m_jac_skip_coverage_dependence = false |
A flag used to neglect rate coefficient coverage dependence in derivative formation. | |
bool | m_jac_skip_electrochemistry = false |
A flag used to neglect electrochemical contributions in derivative formation. | |
double | m_jac_rtol_delta = 1e-8 |
Relative tolerance used in developing numerical portions of specific derivatives. | |
bool | m_has_electrochemistry = false |
A flag stating if the object uses electrochemistry. | |
bool | m_has_coverage_dependence = false |
A flag stating if the object has coverage dependent rates. | |
Protected Attributes inherited from Kinetics | |
ValueCache | m_cache |
Cache for saved calculations within each Kinetics object. | |
bool | m_ready = false |
Boolean indicating whether Kinetics object is fully configured. | |
size_t | m_kk = 0 |
The number of species in all of the phases that participate in this kinetics mechanism. | |
vector< double > | m_perturb |
Vector of perturbation factors for each reaction's rate of progress vector. | |
vector< shared_ptr< Reaction > > | m_reactions |
Vector of Reaction objects represented by this Kinetics manager. | |
vector< shared_ptr< ThermoPhase > > | m_thermo |
m_thermo is a vector of pointers to ThermoPhase objects that are involved with this kinetics operator | |
vector< size_t > | m_start |
m_start is a vector of integers specifying the beginning position for the species vector for the n'th phase in the kinetics class. | |
map< string, size_t > | m_phaseindex |
Mapping of the phase name to the position of the phase within the kinetics object. | |
size_t | m_mindim = 4 |
number of spatial dimensions of lowest-dimensional phase. | |
vector< double > | m_rfn |
Forward rate constant for each reaction. | |
vector< double > | m_delta_gibbs0 |
Delta G^0 for all reactions. | |
vector< double > | m_rkcn |
Reciprocal of the equilibrium constant in concentration units. | |
vector< double > | m_ropf |
Forward rate-of-progress for each reaction. | |
vector< double > | m_ropr |
Reverse rate-of-progress for each reaction. | |
vector< double > | m_ropnet |
Net rate-of-progress for each reaction. | |
vector< double > | m_dH |
The enthalpy change for each reaction to calculate Blowers-Masel rates. | |
vector< double > | m_rbuf |
Buffer used for storage of intermediate reaction-specific results. | |
bool | m_skipUndeclaredSpecies = false |
See skipUndeclaredSpecies() | |
bool | m_skipUndeclaredThirdBodies = false |
See skipUndeclaredThirdBodies() | |
bool | m_hasUndeclaredThirdBodies = false |
Flag indicating whether reactions include undeclared third bodies. | |
std::weak_ptr< Solution > | m_root |
reference to Solution | |
StoichManagerN | m_reactantStoich |
Stoichiometry manager for the reactants for each reaction. | |
StoichManagerN | m_productStoich |
Stoichiometry manager for the products for each reaction. | |
StoichManagerN | m_revProductStoich |
Stoichiometry manager for the products of reversible reactions. | |
Eigen::SparseMatrix< double > | m_stoichMatrix |
Net stoichiometry (products - reactants) | |
|
inline |
Constructor.
Definition at line 24 of file EdgeKinetics.h.
|
inlineoverridevirtual |
Identifies the Kinetics manager type.
Each class derived from Kinetics should override this method to return a meaningful identifier.
Reimplemented from Kinetics.
Definition at line 28 of file EdgeKinetics.h.