186 int solveSurfProb(
int ifunc,
double time_scale,
double TKelvin,
187 double PGas,
double reltol,
double abstol);
192 void print_header(
int ioflag,
int ifunc,
double time_scale,
193 int damping,
double reltol,
double abstol);
196 void printIteration(
int ioflag,
double damp,
int label_d,
int label_t,
197 double inv_t,
double t_real,
size_t iter,
198 double update_norm,
double resid_norm,
199 bool do_time,
bool final=
false);
228 double calc_t(
double netProdRateSolnSP[],
double XMolSolnSP[],
229 int* label,
int* label_old,
230 double* label_factor,
int ioflag);
242 void calcWeights(
double wtSpecies[],
double wtResid[],
243 const Array2D& Jac,
const double CSolnSP[],
244 const double abstol,
const double reltol);
287 void fun_eval(
double* resid,
const double* CSolnSP,
288 const double* CSolnOldSP,
const bool do_time,
const double deltaT);
304 const double* CSolnSPOld,
const bool do_time,
305 const double deltaT);
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Advances the surface coverages of the associated set of SurfacePhase objects in time.
Method to solve a pseudo steady state surface problem.
vector< size_t > m_numBulkSpecies
Vector of number of species in the m_numBulkPhases phases.
vector< double > m_wtSpecies
Weights for the species concentrations norm calculation.
size_t m_numTotSurfSpecies
Total number of surface species in all surface phases.
void evalSurfLarge(const double *CSolnSP)
Update the vector that keeps track of the largest species in each surface phase.
void updateState(const double *cSurfSpec)
Update the surface states of the surface phases.
vector< size_t > m_indexKinObjSurfPhase
Mapping between the surface phases and the InterfaceKinetics objects.
vector< size_t > m_kinObjIndex
Index between the equation index and the index of the InterfaceKinetics object.
vector< double > m_resid
Residual for the surface problem.
vector< ThermoPhase * > m_bulkPhasePtrs
Vector of bulk phase pointers, length is equal to m_numBulkPhases.
vector< size_t > m_spSurfLarge
Vector containing the indices of the largest species in each surface phase.
vector< double > m_netProductionRatesSave
Temporary vector with length equal to max m_maxTotSpecies.
double calc_t(double netProdRateSolnSP[], double XMolSolnSP[], int *label, int *label_old, double *label_factor, int ioflag)
Calculate a conservative delta T to use in a pseudo-steady state algorithm.
~solveSP()=default
Destructor.
int m_bulkFunc
This variable determines how the bulk phases are to be handled.
vector< double > m_wtResid
Weights for the residual norm calculation. length MAX(1, m_neq)
vector< InterfaceKinetics * > & m_objects
Vector of interface kinetics objects.
void fun_eval(double *resid, const double *CSolnSP, const double *CSolnOldSP, const bool do_time, const double deltaT)
Main Function evaluation.
vector< double > m_CSolnSave
Temporary vector with length equal to max m_maxTotSpecies.
void updateMFSolnSP(double *XMolSolnSP)
Update mole fraction vector consisting of unknowns in surface problem.
vector< double > m_CSolnSPOld
Saved solution vector at the old time step. length MAX(1, m_neq)
void printIteration(int ioflag, double damp, int label_d, int label_t, double inv_t, double t_real, size_t iter, double update_norm, double resid_norm, bool do_time, bool final=false)
Printing routine that gets called after every iteration.
vector< double > m_CSolnSP
Solution vector. length MAX(1, m_neq)
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_numTotBulkSpeciesSS
Total number of species in all bulk phases.
vector< double > m_numEqn1
Temporary vector with length equal to max m_maxTotSpecies.
vector< double > m_CSolnSPInit
Saved initial solution vector. length MAX(1, m_neq)
vector< double > m_XMolKinSpecies
Vector of mole fractions. length m_maxTotSpecies.
vector< double > m_numEqn2
Temporary vector with length equal to max m_maxTotSpecies.
vector< size_t > m_eqnIndexStartSolnPhase
Index of the start of the unknowns for each solution phase.
vector< size_t > m_nSpeciesSurfPhase
Vector of length number of surface phases containing the number of surface species in each phase.
size_t m_numSurfPhases
Number of surface phases in the surface problem.
void print_header(int ioflag, int ifunc, double time_scale, int damping, double reltol, double abstol)
Printing routine that optionally gets called at the start of every invocation.
void updateMFKinSpecies(double *XMolKinSp, int isp)
Update the mole fraction vector for a specific kinetic species vector corresponding to one InterfaceK...
DenseMatrix m_Jac
Jacobian.
size_t m_numBulkPhasesSS
Total number of volumetric condensed phases included in the steady state problem handled by this rout...
size_t m_neq
Total number of equations to solve in the implicit problem.
vector< SurfPhase * > m_ptrsSurfPhase
Vector of surface phase pointers.
vector< size_t > m_kinObjPhaseIDSurfPhase
Phase ID in the InterfaceKinetics object of the surface phase.
size_t m_maxTotSpecies
Maximum number of species in any single kinetics operator -> also maxed wrt the total # of solution s...
int solveSurfProb(int ifunc, double time_scale, double TKelvin, double PGas, double reltol, double abstol)
Main routine that actually calculates the pseudo steady state of the surface problem.
void calcWeights(double wtSpecies[], double wtResid[], const Array2D &Jac, const double CSolnSP[], const double abstol, const double reltol)
Calculate the solution and residual weights.
void resjac_eval(DenseMatrix &jac, double *resid, double *CSolnSP, const double *CSolnSPOld, const bool do_time, const double deltaT)
Main routine that calculates the current residual and Jacobian.
const int BULK_ETCH
Etching of a bulk phase is to be expected.
const int BULK_DEPOSITION
Deposition of a bulk phase is to be expected.
const int SFLUX_TRANSIENT
The transient calculation is performed here for an amount of time specified by "time_scale".
const int SFLUX_RESIDUAL
Need to solve the surface problem in order to calculate the surface fluxes of gas-phase species.
const int SFLUX_JACOBIAN
Calculation of the surface problem is due to the need for a numerical Jacobian for the gas-problem.
const int SFLUX_INITIALIZE
This assumes that the initial guess supplied to the routine is far from the correct one.
Namespace for the Cantera kernel.