Cantera  2.4.0
Namespaces
vcs_defs.h File Reference

Defines and definitions within the vcs package. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Cantera
 Namespace for the Cantera kernel.
 

Macros

#define VCS_SUCCESS   0
 
#define VCS_NOMEMORY   1
 
#define VCS_FAILED_CONVERGENCE   -1
 
#define VCS_SHOULDNT_BE_HERE   -2
 
#define VCS_PUB_BAD   -3
 
#define VCS_THERMO_OUTOFRANGE   -4
 
#define VCS_FAILED_LOOKUP   -5
 
#define VCS_MP_FAIL   -6
 
Sizes of Phases and Cutoff Mole Numbers

All size parameters are listed here

#define VCS_RELDELETE_SPECIES_CUTOFF   1.0e-64
 Cutoff relative mole fraction value, below which species are deleted from the equilibrium problem. More...
 
#define VCS_DELETE_MINORSPECIES_CUTOFF   1.0e-140
 Cutoff relative mole number value, below which species are deleted from the equilibrium problem. More...
 
#define VCS_SMALL_MULTIPHASE_SPECIES   1.0e-25
 Relative value of multiphase species mole number for a multiphase species which is small. More...
 
#define VCS_DELETE_PHASE_CUTOFF   1.0e-13
 Cutoff relative moles below which a phase is deleted from the equilibrium problem. More...
 
#define VCS_POP_PHASE_MOLENUM   1.0e-11
 Relative mole number of species in a phase that is created We want this to be comfortably larger than the VCS_DELETE_PHASE_CUTOFF value so that the phase can have a chance to survive. More...
 
#define VCS_DELETE_ELEMENTABS_CUTOFF   1.0e-280
 Cutoff moles below which a phase or species which comprises the bulk of an element's total concentration is deleted. More...
 
#define VCS_MAXSTEPS   50000
 Maximum steps in the inner loop. More...
 
Species Categories used during the iteration
#define VCS_SPECIES_COMPONENT_STOICHZERO   3
 Species is a component which can never be nonzero because of a stoichiometric constraint. More...
 
#define VCS_SPECIES_COMPONENT   2
 Species is a component which can be nonzero. More...
 
#define VCS_SPECIES_MAJOR   1
 Species is a major species. More...
 
#define VCS_SPECIES_MINOR   0
 Species is a major species. More...
 
#define VCS_SPECIES_SMALLMS   -1
 Species lies in a multicomponent phase, with a small phase concentration. More...
 
#define VCS_SPECIES_ZEROEDMS   -2
 Species lies in a multicomponent phase with concentration zero. More...
 
#define VCS_SPECIES_ZEROEDSS   -3
 Species is a SS phase, that is currently zeroed out. More...
 
#define VCS_SPECIES_DELETED   -4
 Species has such a small mole fraction it is deleted even though its phase may possibly exist. More...
 
#define VCS_SPECIES_INTERFACIALVOLTAGE   -5
 Species refers to an electron in the metal. More...
 
#define VCS_SPECIES_ZEROEDPHASE   -6
 Species lies in a multicomponent phase that is zeroed atm. More...
 
#define VCS_SPECIES_ACTIVEBUTZERO   -7
 Species lies in a multicomponent phase that is active, but species concentration is zero. More...
 
#define VCS_SPECIES_STOICHZERO   -8
 Species lies in a multicomponent phase that is active, but species concentration is zero due to stoich constraint. More...
 
Phase Categories used during the iteration
#define VCS_PHASE_EXIST_ALWAYS   3
 Always exists because it contains inerts which can't exist in any other phase. More...
 
#define VCS_PHASE_EXIST_YES   2
 Phase is a normal phase that currently exists. More...
 
#define VCS_PHASE_EXIST_MINORCONC   1
 Phase is a normal phase that exists in a small concentration. More...
 
#define VCS_PHASE_EXIST_NO   0
 Phase doesn't currently exist in the mixture. More...
 
#define VCS_PHASE_EXIST_ZEROEDPHASE   -6
 Phase currently is zeroed due to a programmatic issue. More...
 
Types of Element Constraint Equations

There may be several different types of element constraints handled by the equilibrium program and by Cantera in other contexts. These defines are used to assign each constraint to one category.

#define VCS_ELEM_TYPE_TURNEDOFF   -1
 An element constraint that is current turned off. More...
 
#define VCS_ELEM_TYPE_ABSPOS   0
 Normal element constraint consisting of positive coefficients for the formula matrix. More...
 
#define VCS_ELEM_TYPE_ELECTRONCHARGE   1
 This refers to conservation of electrons. More...
 
#define VCS_ELEM_TYPE_CHARGENEUTRALITY   2
 This refers to a charge neutrality of a single phase. More...
 
#define VCS_ELEM_TYPE_LATTICERATIO   3
 Constraint associated with maintaining a fixed lattice stoichiometry in the solids. More...
 
#define VCS_ELEM_TYPE_KINETICFROZEN   4
 Constraint associated with maintaining frozen kinetic equilibria in some functional groups within molecules. More...
 
#define VCS_ELEM_TYPE_SURFACECONSTRAINT   5
 Constraint associated with the maintenance of a surface phase. More...
 
#define VCS_ELEM_TYPE_OTHERCONSTRAINT   6
 Other constraint equations. More...
 
Types of Species Unknowns in the problem
#define VCS_SPECIES_TYPE_MOLNUM   0
 Unknown refers to mole number of a single species. More...
 
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE   -5
 Unknown refers to the voltage level of a phase. More...
 
Types of State Calculations within VCS. These values determine where

the results are stored within the VCS_SOLVE object.

#define VCS_STATECALC_UNKNOWN   -1
 State Calculation is currently in an unknown state. More...
 
#define VCS_STATECALC_OLD   0
 State Calculation based on the old or base mole numbers. More...
 
#define VCS_STATECALC_NEW   1
 State Calculation based on the new or tentative mole numbers. More...
 
#define VCS_STATECALC_PHASESTABILITY   2
 State Calculation based on tentative mole numbers for a phase which is currently zeroed, but is being evaluated for whether it should pop back into existence. More...
 
#define VCS_STATECALC_TMP   3
 State Calculation based on a temporary set of mole numbers. More...
 

Detailed Description

Defines and definitions within the vcs package.

Definition in file vcs_defs.h.

Macro Definition Documentation

◆ VCS_SUCCESS

#define VCS_SUCCESS   0

◆ VCS_RELDELETE_SPECIES_CUTOFF

#define VCS_RELDELETE_SPECIES_CUTOFF   1.0e-64

Cutoff relative mole fraction value, below which species are deleted from the equilibrium problem.

Definition at line 38 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_recheck_deleted(), and VCS_SOLVE::vcs_reinsert_deleted().

◆ VCS_DELETE_MINORSPECIES_CUTOFF

#define VCS_DELETE_MINORSPECIES_CUTOFF   1.0e-140

Cutoff relative mole number value, below which species are deleted from the equilibrium problem.

Definition at line 44 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_add_all_deleted(), VCS_SOLVE::vcs_basopt(), VCS_SOLVE::vcs_deltag(), VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_elabcheck(), VCS_SOLVE::vcs_elcorr(), VCS_SOLVE::vcs_minor_alt_calc(), VCS_SOLVE::vcs_report(), and VCS_SOLVE::vcs_species_type().

◆ VCS_SMALL_MULTIPHASE_SPECIES

#define VCS_SMALL_MULTIPHASE_SPECIES   1.0e-25

Relative value of multiphase species mole number for a multiphase species which is small.

Definition at line 50 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_RxnStepSizes().

◆ VCS_DELETE_PHASE_CUTOFF

#define VCS_DELETE_PHASE_CUTOFF   1.0e-13

Cutoff relative moles below which a phase is deleted from the equilibrium problem.

Definition at line 56 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_popPhaseRxnStepSizes(), and VCS_SOLVE::vcs_RxnStepSizes().

◆ VCS_POP_PHASE_MOLENUM

#define VCS_POP_PHASE_MOLENUM   1.0e-11

Relative mole number of species in a phase that is created We want this to be comfortably larger than the VCS_DELETE_PHASE_CUTOFF value so that the phase can have a chance to survive.

Definition at line 63 of file vcs_defs.h.

◆ VCS_DELETE_ELEMENTABS_CUTOFF

#define VCS_DELETE_ELEMENTABS_CUTOFF   1.0e-280

Cutoff moles below which a phase or species which comprises the bulk of an element's total concentration is deleted.

Definition at line 70 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_popPhasePossible().

◆ VCS_MAXSTEPS

#define VCS_MAXSTEPS   50000

Maximum steps in the inner loop.

Definition at line 75 of file vcs_defs.h.

◆ VCS_SPECIES_COMPONENT_STOICHZERO

#define VCS_SPECIES_COMPONENT_STOICHZERO   3

Species is a component which can never be nonzero because of a stoichiometric constraint.

These defines are valid values for spStatus()

An example of this would be a species that contains Ni. But, the amount of Ni elements is exactly zero.

Definition at line 92 of file vcs_defs.h.

◆ VCS_SPECIES_COMPONENT

#define VCS_SPECIES_COMPONENT   2

Species is a component which can be nonzero.

Definition at line 95 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_evaluate_speciesType(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_MAJOR

#define VCS_SPECIES_MAJOR   1

Species is a major species.

A major species is either a species in a multicomponent phase with significant concentration or it's a Stoich Phase

Definition at line 102 of file vcs_defs.h.

Referenced by VCS_SOLVE::l2normdg(), VCS_SOLVE::vcs_delete_species(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_reinsert_deleted(), VCS_SOLVE::vcs_RxnStepSizes(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_MINOR

#define VCS_SPECIES_MINOR   0

Species is a major species.

A major species is either a species in a multicomponent phase with significant concentration or it's a Stoich Phase

Definition at line 109 of file vcs_defs.h.

Referenced by VCS_SOLVE::l2normdg(), VCS_SOLVE::vcs_deltag(), VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_reinsert_deleted(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_SMALLMS

#define VCS_SPECIES_SMALLMS   -1

Species lies in a multicomponent phase, with a small phase concentration.

The species lies in a multicomponent phase that exists. It concentration is currently very low, necessitating a different method of calculation.

Definition at line 116 of file vcs_defs.h.

◆ VCS_SPECIES_ZEROEDMS

#define VCS_SPECIES_ZEROEDMS   -2

Species lies in a multicomponent phase with concentration zero.

The species lies in a multicomponent phase which currently doesn't exist. It concentration is currently zero.

Definition at line 123 of file vcs_defs.h.

Referenced by VCS_SOLVE::l2normdg(), VCS_SOLVE::vcs_delete_multiphase(), VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_species_type(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_ZEROEDSS

#define VCS_SPECIES_ZEROEDSS   -3

Species is a SS phase, that is currently zeroed out.

The species lies in a single-species phase which is currently zeroed out.

Definition at line 129 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_elcorr(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_species_type(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_DELETED

#define VCS_SPECIES_DELETED   -4

Species has such a small mole fraction it is deleted even though its phase may possibly exist.

The species is believed to have such a small mole fraction that it best to throw the calculation of it out. It will be added back in at the end of the calculation.

Definition at line 138 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_delete_species(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_reinsert_deleted(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_INTERFACIALVOLTAGE

#define VCS_SPECIES_INTERFACIALVOLTAGE   -5

Species refers to an electron in the metal.

The unknown is equal to the electric potential of the phase in which it exists.

Definition at line 145 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_setMolesLinProg(), VCS_SOLVE::vcs_species_type(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_ZEROEDPHASE

#define VCS_SPECIES_ZEROEDPHASE   -6

Species lies in a multicomponent phase that is zeroed atm.

The species lies in a multicomponent phase that is currently deleted and will stay deleted due to a choice from a higher level. These species will formally always have zero mole numbers in the solution vector.

Definition at line 153 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_RxnStepSizes(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_ACTIVEBUTZERO

#define VCS_SPECIES_ACTIVEBUTZERO   -7

Species lies in a multicomponent phase that is active, but species concentration is zero.

The species lies in a multicomponent phase which currently does exist. It concentration is currently identically zero, though the phase exists. Note, this is a temporary condition that exists at the start of an equilibrium problem. The species is soon "birthed" or "deleted".

Definition at line 163 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_elcorr(), VCS_SOLVE::vcs_evaluate_speciesType(), and Cantera::vcs_speciesType_string().

◆ VCS_SPECIES_STOICHZERO

#define VCS_SPECIES_STOICHZERO   -8

Species lies in a multicomponent phase that is active, but species concentration is zero due to stoich constraint.

The species lies in a multicomponent phase which currently does exist. Its concentration is currently identically zero, though the phase exists. This is a permanent condition due to stoich constraints.

An example of this would be a species that contains Ni. But, the amount of Ni elements in the current problem statement is exactly zero.

Definition at line 175 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_evaluate_speciesType(), VCS_SOLVE::vcs_RxnStepSizes(), VCS_SOLVE::vcs_species_type(), and Cantera::vcs_speciesType_string().

◆ VCS_PHASE_EXIST_ALWAYS

#define VCS_PHASE_EXIST_ALWAYS   3

Always exists because it contains inerts which can't exist in any other phase.

These defines are valid values for the phase existence flag

Definition at line 185 of file vcs_defs.h.

Referenced by vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::setTotalMoles(), vcs_VolPhase::setTotalMolesInert(), VCS_SOLVE::vcs_delete_species(), and VCS_SOLVE::vcs_prob_specifyFully().

◆ VCS_PHASE_EXIST_YES

#define VCS_PHASE_EXIST_YES   2

◆ VCS_PHASE_EXIST_MINORCONC

#define VCS_PHASE_EXIST_MINORCONC   1

Phase is a normal phase that exists in a small concentration.

Concentration is so small that it must be calculated using an alternate method

Definition at line 195 of file vcs_defs.h.

◆ VCS_PHASE_EXIST_NO

#define VCS_PHASE_EXIST_NO   0

◆ VCS_PHASE_EXIST_ZEROEDPHASE

#define VCS_PHASE_EXIST_ZEROEDPHASE   -6

Phase currently is zeroed due to a programmatic issue.

We zero phases because we want to follow phase stability boundaries.

Definition at line 204 of file vcs_defs.h.

Referenced by vcs_VolPhase::setExistence(), and vcs_VolPhase::setMoleFractionsState().

◆ VCS_ELEM_TYPE_TURNEDOFF

#define VCS_ELEM_TYPE_TURNEDOFF   -1

An element constraint that is current turned off.

Definition at line 219 of file vcs_defs.h.

◆ VCS_ELEM_TYPE_ABSPOS

#define VCS_ELEM_TYPE_ABSPOS   0

Normal element constraint consisting of positive coefficients for the formula matrix.

All species have positive coefficients within the formula matrix. With this constraint, we may employ various strategies to handle small values of the element number successfully.

Definition at line 228 of file vcs_defs.h.

Referenced by VCS_SOLVE::vcs_basopt(), VCS_SOLVE::vcs_elabcheck(), VCS_SOLVE::vcs_elcorr(), VCS_SOLVE::vcs_popPhasePossible(), VCS_SOLVE::vcs_popPhaseRxnStepSizes(), and VCS_SOLVE::vcs_species_type().

◆ VCS_ELEM_TYPE_ELECTRONCHARGE

#define VCS_ELEM_TYPE_ELECTRONCHARGE   1

This refers to conservation of electrons.

Electrons may have positive or negative values in the Formula matrix.

Definition at line 234 of file vcs_defs.h.

Referenced by vcs_VolPhase::transferElementsFM(), and VCS_SOLVE::vcs_elabcheck().

◆ VCS_ELEM_TYPE_CHARGENEUTRALITY

#define VCS_ELEM_TYPE_CHARGENEUTRALITY   2

This refers to a charge neutrality of a single phase.

Charge neutrality may have positive or negative values in the Formula matrix.

Definition at line 240 of file vcs_defs.h.

Referenced by vcs_VolPhase::transferElementsFM(), and VCS_SOLVE::vcs_elabcheck().

◆ VCS_ELEM_TYPE_LATTICERATIO

#define VCS_ELEM_TYPE_LATTICERATIO   3

Constraint associated with maintaining a fixed lattice stoichiometry in the solids.

The constraint may have positive or negative values. The lattice 0 species will have negative values while higher lattices will have positive values

Definition at line 248 of file vcs_defs.h.

◆ VCS_ELEM_TYPE_KINETICFROZEN

#define VCS_ELEM_TYPE_KINETICFROZEN   4

Constraint associated with maintaining frozen kinetic equilibria in some functional groups within molecules.

We seek here to say that some functional groups or ionic states should be treated as if they are separate elements given the time scale of the problem. This will be abs positive constraint. We have not implemented any examples yet. A requirement will be that we must be able to add and subtract these constraints.

Definition at line 259 of file vcs_defs.h.

◆ VCS_ELEM_TYPE_SURFACECONSTRAINT

#define VCS_ELEM_TYPE_SURFACECONSTRAINT   5

Constraint associated with the maintenance of a surface phase.

We don't have any examples of this yet either. However, surfaces only exist because they are interfaces between bulk layers. If we want to treat surfaces within thermodynamic systems we must come up with a way to constrain their total number.

Definition at line 268 of file vcs_defs.h.

◆ VCS_ELEM_TYPE_OTHERCONSTRAINT

#define VCS_ELEM_TYPE_OTHERCONSTRAINT   6

Other constraint equations.

currently there are none

Definition at line 273 of file vcs_defs.h.

◆ VCS_SPECIES_TYPE_MOLNUM

#define VCS_SPECIES_TYPE_MOLNUM   0

Unknown refers to mole number of a single species.

Definition at line 281 of file vcs_defs.h.

Referenced by vcs_VolPhase::resize(), vcs_VolPhase::transferElementsFM(), VCS_SOLVE::vcs_inest(), VCS_SOLVE::vcs_prep(), VCS_SOLVE::vcs_report(), and VCS_SOLVE::vcs_tmoles().

◆ VCS_SPECIES_TYPE_INTERFACIALVOLTAGE

#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE   -5

◆ VCS_STATECALC_UNKNOWN

#define VCS_STATECALC_UNKNOWN   -1

State Calculation is currently in an unknown state.

Definition at line 298 of file vcs_defs.h.

◆ VCS_STATECALC_OLD

#define VCS_STATECALC_OLD   0

◆ VCS_STATECALC_NEW

#define VCS_STATECALC_NEW   1

◆ VCS_STATECALC_PHASESTABILITY

#define VCS_STATECALC_PHASESTABILITY   2

State Calculation based on tentative mole numbers for a phase which is currently zeroed, but is being evaluated for whether it should pop back into existence.

Definition at line 308 of file vcs_defs.h.

◆ VCS_STATECALC_TMP

#define VCS_STATECALC_TMP   3

State Calculation based on a temporary set of mole numbers.

Definition at line 311 of file vcs_defs.h.

Referenced by vcs_VolPhase::setMoleFractionsState().