11 #ifndef CT_IMPSURFCHEM_H
12 #define CT_IMPSURFCHEM_H
76 double rtol=1.e-7,
double atol=1.e-14,
77 double maxStepSize=0,
size_t maxSteps=20000,
78 size_t maxErrTestFails=7);
146 double timeScaleOverride = 1.0);
151 size_t neq()
const override {
163 void eval(
double t,
double* y,
double* ydot,
double* p)
override;
215 int checkMatch(vector<ThermoPhase*> m_vec,
ThermoPhase* thPtr);
217 void setIOFlag(
int ioFlag) {
245 vector<size_t> m_specStartIndex;
253 size_t m_numTotalBulkSpecies = 0;
254 size_t m_numTotalSpecies = 0;
256 vector<vector<int>> pLocVec;
259 double m_atol, m_rtol;
263 vector<double> m_work;
271 vector<double> m_concSpeciesSave;
Virtual base class for ODE/DAE right-hand-side function evaluators.
Advances the surface coverages of the associated set of SurfacePhase objects in time.
vector< ThermoPhase * > m_bulkPhases
Vector of pointers to bulk phases.
int m_bulkSpeciesStart
Index into the species vector of the kinetics manager, pointing to the first species from the condens...
int m_mediumSpeciesStart
Index into the species vector of the kinetics manager, pointing to the first species from the surroun...
void eval(double t, double *y, double *ydot, double *p) override
Evaluate the value of ydot[k] at the current conditions.
vector< InterfaceKinetics * > & getObjects()
Returns a reference to the vector of pointers to the InterfaceKinetics objects.
size_t neq() const override
Return the number of equations.
void setConcSpecies(const double *const vecConcSpecies)
Sets the concentrations within phases that are unknowns in the surface problem.
void setCommonState_TP(double TKelvin, double PresPa)
Sets the state variable in all thermodynamic phases (surface and surrounding bulk phases) to the inpu...
size_t m_nv
Total number of surface species in all surface phases.
int m_ioFlag
Controls the amount of printing from this routine and underlying routines.
void initialize(double t0=0.0)
Must be called before calling method 'advance'.
void integrate(double t0, double t1)
Integrate from t0 to t1. The integrator is reinitialized first.
void getConcSpecies(double *const vecConcSpecies) const
Get the specifications for the problem from the values in the ThermoPhase objects for all phases.
vector< SurfPhase * > m_surf
vector of pointers to surface phases.
vector< InterfaceKinetics * > m_vecKinPtrs
vector of pointers to InterfaceKinetics objects
unique_ptr< solveSP > m_surfSolver
Pointer to the helper method, Placid, which solves the surface problem.
double m_maxstep
max step size
bool m_commonTempPressForPhases
If true, a common temperature and pressure for all surface and bulk phases associated with the surfac...
void setTolerances(double rtol=1.e-7, double atol=1.e-14)
Set the relative and absolute integration tolerances.
vector< size_t > m_nsp
Vector of number of species in each Surface Phase.
void setMaxStepSize(double maxstep=0.0)
Set the maximum integration step-size.
vector< double > m_concSpecies
Temporary vector - length num species in the Kinetics object.
void setMaxSteps(size_t maxsteps=20000)
Set the maximum number of CVODES integration steps.
void updateState(double *y)
Set the mixture to a state consistent with solution vector y.
void getState(double *y) override
Get the current state of the solution vector.
size_t m_maxErrTestFails
maximum number of error test failures allowed
unique_ptr< Integrator > m_integ
Pointer to the CVODE integrator.
int m_surfSpeciesStart
Index into the species vector of the kinetics manager, pointing to the first species from the surface...
void integrate0(double t0, double t1)
Integrate from t0 to t1 without reinitializing the integrator.
void solvePseudoSteadyStateProblem(int ifuncOverride=-1, double timeScaleOverride=1.0)
Solve for the pseudo steady-state of the surface problem.
ImplicitSurfChem(vector< InterfaceKinetics * > k, double rtol=1.e-7, double atol=1.e-14, double maxStepSize=0, size_t maxSteps=20000, size_t maxErrTestFails=7)
Constructor for multiple surfaces.
void setMaxErrTestFails(size_t maxErrTestFails=7)
Set the maximum number of CVODES error test failures.
size_t m_nmax
maximum number of steps allowed
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.
Header file for implicit surface problem solver (see Chemical Kinetics and class solveSP).