66 class InterfaceKinetics;
198 int solveSurfProb(
int ifunc, doublereal time_scale, doublereal TKelvin,
199 doublereal PGas, doublereal reltol, doublereal abstol);
204 void print_header(
int ioflag,
int ifunc, doublereal time_scale,
205 int damping, doublereal reltol, doublereal abstol,
206 doublereal TKelvin, doublereal PGas, doublereal netProdRate[],
207 doublereal XMolKinSpecies[]);
210 void printIteration(
int ioflag, doublereal damp,
int label_d,
int label_t,
211 doublereal inv_t, doublereal t_real,
size_t iter,
212 doublereal update_norm, doublereal resid_norm,
213 doublereal netProdRate[], doublereal CSolnSP[],
214 doublereal resid[], doublereal XMolSolnSP[],
215 doublereal wtSpecies[],
size_t dim,
bool do_time);
218 void printFinal(
int ioflag, doublereal damp,
int label_d,
int label_t,
219 doublereal inv_t, doublereal t_real,
size_t iter,
220 doublereal update_norm, doublereal resid_norm,
221 doublereal netProdRateKinSpecies[],
const doublereal CSolnSP[],
222 const doublereal resid[], doublereal XMolSolnSP[],
223 const doublereal wtSpecies[],
const doublereal wtRes[],
224 size_t dim,
bool do_time,
225 doublereal TKelvin, doublereal PGas);
255 doublereal
calc_t(doublereal netProdRateSolnSP[], doublereal XMolSolnSP[],
256 int* label,
int* label_old,
257 doublereal* label_factor,
int ioflag);
269 void calcWeights(doublereal wtSpecies[], doublereal wtResid[],
270 const Array2D& Jac,
const doublereal CSolnSP[],
271 const doublereal abstol,
const doublereal reltol);
314 void fun_eval(doublereal* resid,
const doublereal* CSolnSP,
315 const doublereal* CSolnOldSP,
const bool do_time,
const doublereal deltaT);
330 void resjac_eval(std::vector<doublereal*>& JacCol, doublereal* resid,
332 const doublereal* CSolnSPOld,
const bool do_time,
333 const doublereal deltaT);
int m_bulkFunc
This variable determines how the bulk phases are to be handled.
std::vector< InterfaceKinetics * > & m_objects
Vector of interface kinetics objects.
size_t m_neq
Total number of equations to solve in the implicit problem.
std::vector< doublereal * > m_JacCol
Vector of pointers to the top of the columns of the Jacobian.
Method to solve a pseudo steady state surface problem.
solveSP(ImplicitSurfChem *surfChemPtr, int bulkFunc=BULK_ETCH)
Constructor for the object.
vector_fp m_CSolnSPInit
Saved initial solution vector. length MAX(1, m_neq)
size_t m_numBulkPhasesSS
Total number of volumetric condensed phases included in the steady state problem handled by this rout...
void updateMFSolnSP(doublereal *XMolSolnSP)
Update mole fraction vector consisting of unknowns in surface problem.
vector_fp m_CSolnSP
Solution vector. length MAX(1, m_neq)
const int BULK_ETCH
Etching of a bulk phase is to be expected.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Header file for class Cantera::Array2D.
std::vector< int > vector_int
Vector of ints.
void evalSurfLarge(const doublereal *CSolnSP)
Update the vector that keeps track of the largest species in each surface phase.
size_t m_numTotSurfSpecies
Total number of surface species in all surface phases.
int solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, doublereal PGas, doublereal reltol, doublereal abstol)
Main routine that actually calculates the pseudo steady state of the surface problem.
const int SFLUX_INITIALIZE
This assumes that the initial guess supplied to the routine is far from the correct one...
void print_header(int ioflag, int ifunc, doublereal time_scale, int damping, doublereal reltol, doublereal abstol, doublereal TKelvin, doublereal PGas, doublereal netProdRate[], doublereal XMolKinSpecies[])
Printing routine that optionally gets called at the start of every invocation.
std::vector< size_t > m_eqnIndexStartSolnPhase
Index of the start of the unknowns for each solution phase.
vector_fp m_wtResid
Weights for the residual norm calculation. length MAX(1, m_neq)
const int SFLUX_RESIDUAL
Need to solve the surface problem in order to calculate the surface fluxes of gas-phase species...
vector_fp m_XMolKinSpecies
Vector of mole fractions. length m_maxTotSpecies.
doublereal calc_t(doublereal netProdRateSolnSP[], doublereal XMolSolnSP[], int *label, int *label_old, doublereal *label_factor, int ioflag)
Calculate a conservative delta T to use in a pseudo-steady state algorithm.
vector_fp m_numEqn1
Temporary vector with length equal to max m_maxTotSpecies.
const int BULK_DEPOSITION
Deposition of a bulk phase is to be expected.
const int SFLUX_JACOBIAN
Calculation of the surface problem is due to the need for a numerical jacobian for the gas-problem...
std::vector< size_t > m_spSurfLarge
Vector containing the indices of the largest species in each surface phase.
vector_fp m_CSolnSave
Temporary vector with length equal to max m_maxTotSpecies.
std::vector< size_t > m_nSpeciesSurfPhase
Vector of length number of surface phases containing the number of surface species in each phase...
vector_int m_ipiv
pivots. length MAX(1, m_neq)
void updateMFKinSpecies(doublereal *XMolKinSp, int isp)
Update the mole fraction vector for a specific kinetic species vector corresponding to one InterfaceK...
solveSP & operator=(const solveSP &right)
Unimplemented private assignment operator.
vector_fp m_numEqn2
Temporary vector with length equal to max m_maxTotSpecies.
const int SFLUX_TRANSIENT
The transient calculation is performed here for an amount of time specified by "time_scale".
Declarations for the implicit integration of surface site density equations (see Kinetics Managers an...
std::vector< SurfPhase * > m_ptrsSurfPhase
Vector of surface phase pointers.
doublereal m_maxstep
maximum value of the time step. units = seconds
std::vector< size_t > m_kinObjPhaseIDSurfPhase
Phase ID in the InterfaceKinetics object of the surface phase.
vector_fp m_netProductionRatesSave
Temporary vector with length equal to max m_maxTotSpecies.
std::vector< size_t > m_kinObjIndex
Index between the equation index and the index of the InterfaceKinetics object.
Advances the surface coverages of the associated set of SurfacePhase objects in time.
size_t m_numSurfPhases
Number of surface phases in the surface problem.
std::vector< ThermoPhase * > m_bulkPhasePtrs
Vector of bulk phase pointers, length is equal to m_numBulkPhases.
ImplicitSurfChem * m_SurfChemPtr
Pointer to the manager of the implicit surface chemistry problem.
~solveSP()
Destructor. Deletes the integrator.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal m_atol
The absolute tolerance in real units. units are (kmol/m2)
std::vector< size_t > m_numBulkSpecies
Vector of number of species in the m_numBulkPhases phases.
doublereal m_rtol
The relative error tolerance.
vector_fp m_CSolnSPOld
Saved solution vector at the old time step. length MAX(1, m_neq)
vector_fp m_resid
Residual for the surface problem.
std::vector< size_t > m_kinSpecIndex
Index between the equation index and the position in the kinetic species array for the appropriate ki...
size_t m_maxTotSpecies
Maximum number of species in any single kinetics operator -> also maxed wrt the total # of solution s...
std::vector< size_t > m_indexKinObjSurfPhase
Mapping between the surface phases and the InterfaceKinetics objects.
vector_fp m_wtSpecies
Weights for the species concentrations norm calculation.
void printFinal(int ioflag, doublereal damp, int label_d, int label_t, doublereal inv_t, doublereal t_real, size_t iter, doublereal update_norm, doublereal resid_norm, doublereal netProdRateKinSpecies[], const doublereal CSolnSP[], const doublereal resid[], doublereal XMolSolnSP[], const doublereal wtSpecies[], const doublereal wtRes[], size_t dim, bool do_time, doublereal TKelvin, doublereal PGas)
Print a summary of the solution.
void resjac_eval(std::vector< doublereal * > &JacCol, doublereal *resid, doublereal *CSolnSP, const doublereal *CSolnSPOld, const bool do_time, const doublereal deltaT)
Main routine that calculates the current residual and Jacobian.
void fun_eval(doublereal *resid, const doublereal *CSolnSP, const doublereal *CSolnOldSP, const bool do_time, const doublereal deltaT)
Main Function evaluation.
size_t m_numTotBulkSpeciesSS
Total number of species in all bulk phases.
void printIteration(int ioflag, doublereal damp, int label_d, int label_t, doublereal inv_t, doublereal t_real, size_t iter, doublereal update_norm, doublereal resid_norm, doublereal netProdRate[], doublereal CSolnSP[], doublereal resid[], doublereal XMolSolnSP[], doublereal wtSpecies[], size_t dim, bool do_time)
Printing routine that gets called after every iteration.
void updateState(const doublereal *cSurfSpec)
Update the surface states of the surface phases.
void calcWeights(doublereal wtSpecies[], doublereal wtResid[], const Array2D &Jac, const doublereal CSolnSP[], const doublereal abstol, const doublereal reltol)
Calculate the solution and residual weights.