Cantera  2.5.1
Variables
Physical Constants
Collaboration diagram for Physical Constants:

Variables

const double Pi = 3.14159265358979323846
 Pi. More...
 

Thermodynamic Equilibrium Constraints

Integer numbers representing pairs of thermodynamic variables which are held constant during equilibration.

typedef std::map< std::string, double > compositionMap
 Map connecting a string name with a double. More...
 
typedef std::map< std::string, double > Composition
 Map from string names to doubles. More...
 
typedef std::vector< double > vector_fp
 Turn on the use of stl vectors for the basic array type within cantera Vector of doubles. More...
 
typedef std::vector< int > vector_int
 Vector of ints. More...
 
typedef std::vector< std::vector< size_t > > grouplist_t
 A grouplist is a vector of groups of species. More...
 
const int TV = 100
 
const int HP = 101
 
const int SP = 102
 
const int PV = 103
 
const int TP = 104
 
const int UV = 105
 
const int ST = 106
 
const int SV = 107
 
const int UP = 108
 
const int VH = 109
 
const int TH = 110
 
const int SH = 111
 
const int PX = 112
 
const int TX = 113
 
const int VT = -100
 
const int PH = -101
 
const int PS = -102
 
const int VP = -103
 
const int PT = -104
 
const int VU = -105
 
const int TS = -106
 
const int VS = -107
 
const int PU = -108
 
const int HV = -109
 
const int HT = -110
 
const int HS = -111
 
const int XP = -112
 
const int XT = -113
 
const double SmallNumber = 1.e-300
 smallest number to compare to zero. More...
 
const double BigNumber = 1.e300
 largest number to compare to inf. More...
 
const double MaxExp = 690.775527898
 largest x such that exp(x) is valid More...
 
const double Undef = -999.1234
 Fairly random number to be used to initialize variables against to see if they are subsequently defined. More...
 
const double Tiny = 1.e-20
 Small number to compare differences of mole fractions against. More...
 
const size_t npos = static_cast<size_t>(-1)
 index returned by functions to indicate "no position" More...
 

Defined Constants

These constants are defined by CODATA to have a particular value. https://physics.nist.gov/cuu/Constants/index.html

const double Avogadro = 6.02214076e26
 Avogadro's Number \( N_{\mathrm{A}} \) [number/kmol]. More...
 
const double Boltzmann = 1.380649e-23
 Boltzmann constant \( k \) [J/K]. More...
 
const double Planck = 6.62607015e-34
 Planck constant \( h \) [J-s]. More...
 
const double ElectronCharge = 1.602176634e-19
 Elementary charge \( e \) [C]. More...
 
const double lightSpeed = 299792458.0
 Speed of Light in a vacuum \( c \) [m/s]. More...
 
const double OneAtm = 1.01325e5
 One atmosphere [Pa]. More...
 
const double OneBar = 1.0E5
 One bar [Pa]. More...
 

Measured Constants

These constants are measured and reported by CODATA

const double fineStructureConstant = 7.2973525693e-3
 Fine structure constant \( \alpha \) []. More...
 
const double ElectronMass = 9.1093837015e-31
 Electron Mass \( m_e \) [kg]. More...
 

Derived Constants

These constants are found from the defined and measured constants

const double Planck_bar = Planck / (2 * Pi)
 Reduced Planck constant \( \hbar \) [m2-kg/s]. More...
 
const double GasConstant = Avogadro * Boltzmann
 Universal Gas Constant \( R_u \) [J/kmol/K]. More...
 
const double logGasConstant = std::log(GasConstant)
 
const double GasConst_cal_mol_K = GasConstant / 4184.0
 Universal gas constant in cal/mol/K. More...
 
const double logBoltz_Planck = std::log(Boltzmann / Planck)
 log(k_b/h) More...
 
const double StefanBoltz = Pi * Pi * std::pow(Boltzmann, 4.0) / (60.0 * std::pow(Planck_bar, 3.0) * lightSpeed * lightSpeed)
 Stefan-Boltzmann constant \( \sigma \) [W/m2/K4]. More...
 
const double Faraday = ElectronCharge * Avogadro
 Faraday constant \( F \) [C/kmol]. More...
 
const double permeability_0 = 2 * fineStructureConstant * Planck / (ElectronCharge * ElectronCharge * lightSpeed)
 Permeability of free space \( \mu_0 \) [N/A2]. More...
 
const double epsilon_0 = 1.0 / (lightSpeed * lightSpeed * permeability_0)
 Permittivity of free space \( \varepsilon_0 \) [F/m]. More...
 

Detailed Description

All physical constants are stored here.

Cantera uses the MKS system of units. The unit for moles is defined to be the kmol. All values of physical constants are consistent with the 2018 CODATA recommendations.

Typedef Documentation

◆ compositionMap

typedef std::map<std::string, double> compositionMap

Map connecting a string name with a double.

This is used mostly to assign concentrations and mole fractions to species.

Definition at line 172 of file ct_defs.h.

◆ Composition

typedef std::map<std::string, double> Composition

Map from string names to doubles.

Used for defining species mole/mass fractions, elemental compositions, and reaction stoichiometries.

Definition at line 176 of file ct_defs.h.

◆ vector_fp

typedef std::vector<double> vector_fp

Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.

Definition at line 180 of file ct_defs.h.

◆ vector_int

typedef std::vector<int> vector_int

Vector of ints.

Definition at line 182 of file ct_defs.h.

◆ grouplist_t

typedef std::vector<std::vector<size_t> > grouplist_t

A grouplist is a vector of groups of species.

Definition at line 185 of file ct_defs.h.

Variable Documentation

◆ Pi

const double Pi = 3.14159265358979323846

◆ Avogadro

const double Avogadro = 6.02214076e26

◆ Boltzmann

const double Boltzmann = 1.380649e-23

◆ Planck

const double Planck = 6.62607015e-34

Planck constant \( h \) [J-s].

Definition at line 69 of file ct_defs.h.

◆ ElectronCharge

const double ElectronCharge = 1.602176634e-19

◆ lightSpeed

const double lightSpeed = 299792458.0

Speed of Light in a vacuum \( c \) [m/s].

Definition at line 75 of file ct_defs.h.

Referenced by GasTransportData::setCustomaryUnits().

◆ OneAtm

const double OneAtm = 1.01325e5

◆ OneBar

const double OneBar = 1.0E5

One bar [Pa].

Definition at line 81 of file ct_defs.h.

◆ fineStructureConstant

const double fineStructureConstant = 7.2973525693e-3

Fine structure constant \( \alpha \) [].

Definition at line 92 of file ct_defs.h.

◆ ElectronMass

const double ElectronMass = 9.1093837015e-31

Electron Mass \( m_e \) [kg].

Definition at line 95 of file ct_defs.h.

◆ Planck_bar

const double Planck_bar = Planck / (2 * Pi)

Reduced Planck constant \( \hbar \) [m2-kg/s].

Definition at line 106 of file ct_defs.h.

◆ GasConstant

const double GasConstant = Avogadro * Boltzmann

Universal Gas Constant \( R_u \) [J/kmol/K].

Definition at line 109 of file ct_defs.h.

Referenced by BinarySolutionTabulatedThermo::_updateThermo(), SurfPhase::_updateThermo(), vcs_VolPhase::_updateVolPM(), Reactor::addSensitivitySpeciesEnthalpy(), InterfaceKinetics::buildSurfaceArrhenius(), MixtureFugacityTP::calculatePsat(), MultiPhaseEquil::computeReactionSteps(), UnitSystem::convertActivationEnergy(), ConstDensityThermo::cp_mole(), IdealGasPhase::cp_mole(), IdealSolidSolnPhase::cp_mole(), IdealSolnGasVPSS::cp_mole(), LatticePhase::cp_mole(), PDSS_Nondimensional::cp_mole(), RedlichKwongMFTP::cp_mole(), SingleSpeciesTP::cp_mole(), PDSS_Molar::cp_R(), PDSS::cpDelp_mole(), RedlichKwongMFTP::critCompressibility(), IdealGasPhase::cv_mole(), IdealSolnGasVPSS::cv_mole(), MargulesVPSSTP::cv_mole(), PDSS_IdealGas::cv_mole(), RedlichKisterVPSSTP::cv_mole(), RedlichKwongMFTP::cv_mole(), PDSS_IonsFromNeutral::density(), MixtureFugacityTP::densityCalc(), RedlichKwongMFTP::dpdVCalc(), PDSS_Nondimensional::enthalpy_mole(), PDSS_Molar::enthalpy_RT(), PDSS::enthalpyDelp_mole(), ConstDensityThermo::entropy_mole(), IdealGasPhase::entropy_mole(), IdealSolidSolnPhase::entropy_mole(), IdealSolnGasVPSS::entropy_mole(), LatticePhase::entropy_mole(), PDSS_Nondimensional::entropy_mole(), RedlichKwongMFTP::entropy_mole(), SurfPhase::entropy_mole(), PDSS_Molar::entropy_R(), PDSS::entropyDelp_mole(), ChemEquil::estimateElementPotentials(), StFlow::evalResidual(), GasTransport::fitProperties(), IdealSolidSolnPhase::getChemPotentials_RT(), RedlichKwongMFTP::getCoeff(), SurfPhase::getCp_R(), WaterSSTP::getCp_R(), BulkKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSEntropy(), PureFluidPhase::getEntropy_R(), SurfPhase::getEntropy_R(), WaterSSTP::getEntropy_R(), WaterSSTP::getGibbs_RT(), WaterSSTP::getIntEnergy_RT(), DustyGasTransport::getMolarFluxes(), DebyeHuckel::getPartialMolarCp(), HMWSoln::getPartialMolarCp(), IdealGasPhase::getPartialMolarCp(), IdealMolalSoln::getPartialMolarCp(), IdealSolidSolnPhase::getPartialMolarCp(), IdealSolnGasVPSS::getPartialMolarCp(), LatticePhase::getPartialMolarCp(), RedlichKwongMFTP::getPartialMolarCp(), SingleSpeciesTP::getPartialMolarCp(), SurfPhase::getPartialMolarCp(), DebyeHuckel::getPartialMolarEntropies(), HMWSoln::getPartialMolarEntropies(), IdealGasPhase::getPartialMolarEntropies(), IdealMolalSoln::getPartialMolarEntropies(), IdealSolidSolnPhase::getPartialMolarEntropies(), IdealSolnGasVPSS::getPartialMolarEntropies(), IonsFromNeutralVPSSTP::getPartialMolarEntropies(), LatticePhase::getPartialMolarEntropies(), RedlichKwongMFTP::getPartialMolarEntropies(), SingleSpeciesTP::getPartialMolarEntropies(), SurfPhase::getPartialMolarEntropies(), MultiTransport::getThermalDiffCoeffs(), PDSS_Nondimensional::gibbs_mole(), PDSS_Molar::gibbs_RT(), PDSS::gibbsDelp_mole(), GasKinetics::init(), PDSS_ConstVol::intEnergy_mole(), PDSS_IdealGas::intEnergy_mole(), PDSS_IonsFromNeutral::intEnergy_mole(), PDSS_SSVol::intEnergy_mole(), ConstCpPoly::modifyOneHf298(), NasaPoly1::modifyOneHf298(), ShomatePoly::modifyOneHf298(), RedlichKwongMFTP::NicholsSolve(), IdealGasPhase::pressure(), MixTransport::pressure_ig(), RedlichKwongMFTP::pressureCalc(), RedlichKwongMFTP::pressureDerivatives(), ConstCpPoly::reportHf298(), NasaPoly1::reportHf298(), ShomatePoly::reportHf298(), ThermoPhase::RT(), MargulesVPSSTP::s_update_dlnActCoeff_dT(), UnitSystem::setDefaultActivationEnergy(), ShomatePoly::setParameters(), Mu0Poly::setParameters(), PDSS_ConstVol::setPressure(), PDSS_IdealGas::setPressure(), PDSS_SSVol::setPressure(), IdealGasPhase::setState_RP(), PDSS_IdealGas::setState_TR(), PDSS_ConstVol::setTemperature(), PDSS_IdealGas::setTemperature(), PDSS_SSVol::setTemperature(), ShomatePoly::ShomatePoly(), Unit::Unit(), DustyGasTransport::updateKnudsenDiffCoeffs(), MultiTransport::updateThermal_T(), VCS_SOLVE::vcs_evalSS_TP(), VCS_SOLVE::vcs_prob_specifyFully(), VCS_SOLVE::vcs_report(), and VCS_SOLVE::vcs_TP().

◆ GasConst_cal_mol_K

const double GasConst_cal_mol_K = GasConstant / 4184.0

Universal gas constant in cal/mol/K.

Definition at line 114 of file ct_defs.h.

◆ logBoltz_Planck

const double logBoltz_Planck = std::log(Boltzmann / Planck)

log(k_b/h)

Definition at line 117 of file ct_defs.h.

◆ StefanBoltz

const double StefanBoltz = Pi * Pi * std::pow(Boltzmann, 4.0) / (60.0 * std::pow(Planck_bar, 3.0) * lightSpeed * lightSpeed)

Stefan-Boltzmann constant \( \sigma \) [W/m2/K4].

Definition at line 120 of file ct_defs.h.

Referenced by StFlow::evalResidual(), and Wall::Q().

◆ Faraday

const double Faraday = ElectronCharge * Avogadro

◆ permeability_0

const double permeability_0 = 2 * fineStructureConstant * Planck / (ElectronCharge * ElectronCharge * lightSpeed)

Permeability of free space \( \mu_0 \) [N/A2].

Definition at line 126 of file ct_defs.h.

◆ epsilon_0

const double epsilon_0 = 1.0 / (lightSpeed * lightSpeed * permeability_0)

Permittivity of free space \( \varepsilon_0 \) [F/m].

Definition at line 129 of file ct_defs.h.

Referenced by GasTransport::makePolarCorrections(), GasTransport::setupCollisionParameters(), and IonGasTransport::setupN64().

◆ SmallNumber

const double SmallNumber = 1.e-300

◆ BigNumber

const double BigNumber = 1.e300

largest number to compare to inf.

Definition at line 151 of file ct_defs.h.

Referenced by BinarySolutionTabulatedThermo::_updateThermo(), HighPressureGasTransport::thermalConductivity(), and GasKinetics::updateKc().

◆ MaxExp

const double MaxExp = 690.775527898

largest x such that exp(x) is valid

Definition at line 153 of file ct_defs.h.

◆ Undef

const double Undef = -999.1234

Fairly random number to be used to initialize variables against to see if they are subsequently defined.

Definition at line 157 of file ct_defs.h.

Referenced by StFlow::_finalize(), vcs_MultiPhaseEquil::equilibrate_HP(), MultiPhase::equilibrate_MultiPhaseEquil(), vcs_MultiPhaseEquil::equilibrate_SP(), Cantera::getFloatArray(), FlowDevice::massFlowRate(), and StFlow::save().

◆ Tiny

const double Tiny = 1.e-20

Small number to compare differences of mole fractions against.

This number is used for the interconversion of mole fraction and mass fraction quantities when the molecular weight of a species is zero. It's also used for the matrix inversion of transport properties when mole fractions must be positive.

Definition at line 166 of file ct_defs.h.

Referenced by Phase::addSpecies(), MultiPhaseEquil::computeReactionSteps(), HighPressureGasTransport::getBinaryDiffCoeffs(), MultiPhaseEquil::getComponents(), Cantera::getFloatArray(), HighPressureGasTransport::getMultiDiffCoeffs(), OneDim::initTimeInteg(), MultiPhaseEquil::stepComposition(), Cantera::sum_xlogQ(), Cantera::sum_xlogx(), MixTransport::update_C(), MultiTransport::update_C(), and DustyGasTransport::updateTransport_C().

◆ npos

const size_t npos = static_cast<size_t>(-1)

index returned by functions to indicate "no position"

Definition at line 188 of file ct_defs.h.

Referenced by RedlichKisterVPSSTP::addBinaryInteraction(), Application::addDataDirectory(), VCS_SOLVE::addOnePhaseSpecies(), VCS_SOLVE::addPhaseElements(), InterfaceKinetics::addReaction(), Kinetics::addReaction(), IonsFromNeutralVPSSTP::addSpecies(), Phase::addSpecies(), Phase::addSpeciesAlias(), InterfaceKinetics::buildSurfaceArrhenius(), HMWSoln::calcMolalitiesCropped(), IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions(), BandMatrix::checkColumns(), Cantera::checkElectrochemReaction(), BandMatrix::checkRows(), XML_Node::child(), OneDim::component(), ConstPressureReactor::componentIndex(), FlowReactor::componentIndex(), IdealGasConstPressureReactor::componentIndex(), IdealGasReactor::componentIndex(), Reactor::componentIndex(), Cantera::ct2ctml(), IonGasTransport::electricalConductivity(), MultiPhase::elementIndex(), Phase::elementIndex(), ChemEquil::equilibrate(), ThermoPhase::equivalenceRatio(), MultiJac::eval(), OneDim::eval(), StFlow::eval(), Inlet1D::eval(), Symm1D::eval(), Outlet1D::eval(), OutletRes1D::eval(), Surf1D::eval(), ReactingSurf1D::eval(), StFlow::evalResidual(), ReactionPathDiagram::exportToDot(), MolalityVPSSTP::findCLMIndex(), Application::findInputFile(), XML_Reader::findQuotedString(), Phase::findSpeciesLower(), Cantera::findUnbackslashed(), IonFlow::fixElectricField(), AnyMap::fromYamlFile(), MultiPhaseEquil::getComponents(), Phase::getCompositionFromMap(), Cantera::getFloatArray(), Cantera::getMap(), Cantera::getMatrixValues(), IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(), Cantera::getPairs(), Cantera::importKinetics(), MultiPhase::init(), InterfaceKinetics::init(), IonGasTransport::init(), ChemEquil::initialize(), BinarySolutionTabulatedThermo::initThermo(), IonsFromNeutralVPSSTP::initThermo(), WaterSSTP::initThermo(), ThermoPhase::initThermoFile(), BinarySolutionTabulatedThermo::initThermoXML(), Cantera::installReactionArrays(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), PDSS_HKFT::LookupGe(), Phase::massFraction(), LatticeSolidPhase::maxTemp(), MultiSpeciesThermo::maxTemp(), VPStandardStateTP::maxTemp(), LatticeSolidPhase::minTemp(), MultiSpeciesThermo::minTemp(), VPStandardStateTP::minTemp(), ThermoPhase::mixtureFraction(), Phase::moleFraction(), Cantera::newKinetics(), Cantera::newPhase(), ThermoPhase::o2Required(), FlowDevice::outletSpeciesMassFlowRate(), Cantera::parseCompString(), Cantera::parseSpeciesName(), XML_Reader::parseTag(), Kinetics::phaseIndex(), HMWSoln::readXMLBinarySalt(), RedlichKisterVPSSTP::readXMLBinarySpecies(), HMWSoln::readXMLLambdaNeutral(), HMWSoln::readXMLMunnnNeutral(), HMWSoln::readXMLPsi(), HMWSoln::readXMLTheta(), HMWSoln::readXMLZetaCation(), MultiSpeciesThermo::refPressure(), HMWSoln::relative_molal_enthalpy(), LatticeSolidPhase::resetHf298(), ThermoPhase::resetHf298(), OneDim::resize(), vcs_VolPhase::resize(), Inlet1D::restore(), OutletRes1D::restore(), ReactingSurf1D::restore(), StFlow::restore(), DebyeHuckel::setBeta(), RedlichKwongMFTP::setBinaryCoeffs(), ThermoPhase::setEquivalenceRatio(), Sim1D::setFixedTemperature(), ThermoPhase::setMixtureFraction(), MolalityVPSSTP::setMolalitiesByName(), vcs_VolPhase::setMolesFromVCS(), Mu0Poly::setParameters(), RedlichKwongMFTP::setSpeciesCoeffs(), Domain1D::setSteadyTolerances(), Domain1D::setTransientTolerances(), OneDim::solve(), MultiNewton::solve(), IonFlow::solveElectricField(), solveSP::solveSP(), Phase::species(), Phase::speciesIndex(), Reactor::speciesIndex(), MultiPhase::speciesIndex(), Kinetics::speciesPhase(), Kinetics::speciesPhaseIndex(), Cantera::split_at_pound(), OneDim::ssnorm(), MultiNewton::step(), ThermoPhase::stoichAirFuelRatio(), Unit::toSI(), vcs_VolPhase::transferElementsFM(), Units::Units(), InterfaceKinetics::updateKc(), StFlow::updateProperties(), VCS_SOLVE::vcs_basopt(), VCS_SOLVE::vcs_elcorr(), VCS_SOLVE::vcs_phaseStabilityTest(), VCS_SOLVE::vcs_popPhaseID(), VCS_SOLVE::vcs_RxnStepSizes(), and XML_Node::write_int().