Cantera  2.1.2
Namespaces | Macros | Typedefs | Variables
ct_defs.h File Reference

This file contains definitions of terms that are used in internal routines and are unlikely to need modifying (text for module physConstants (see Physical Constants) is found here). More...

#include "config.h"
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
Include dependency graph for ct_defs.h:
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 DATA_PTR(vec)   &vec[0]
 Creates a pointer to the start of the raw data for a vector. More...
 

Typedefs

typedef std::map< std::string,
doublereal > 
compositionMap
 Map connecting a string name with a double. 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...
 

Variables

const doublereal Pi = 3.14159265358979323846
 Pi. More...
 
const doublereal SqrtPi = std::sqrt(Pi)
 sqrt(Pi) More...
 
const doublereal OneThird = 1.0/3.0
 1/3 More...
 
const doublereal FiveSixteenths = 5.0/16.0
 5/16 More...
 
const doublereal SqrtTen = std::sqrt(10.0)
 sqrt(10) More...
 
const doublereal SqrtEight = std::sqrt(8.0)
 sqrt(8) More...
 
const doublereal SqrtTwo = std::sqrt(2.0)
 sqrt(2) More...
 
const doublereal SmallNumber = 1.e-300
 smallest number to compare to zero. More...
 
const doublereal BigNumber = 1.e300
 largest number to compare to inf. More...
 
const doublereal MaxExp = 690.775527898
 largest x such that exp(x) is valid More...
 
const doublereal Undef = -999.1234
 Fairly random number to be used to initialize variables against to see if they are subsequently defined. More...
 
const doublereal 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...
 
Variations of the Gas Constant

Cantera uses the MKS system of units. The unit for moles is defined to be the kmol.

const doublereal Avogadro = 6.02214129e26
 Avogadro's Number [number/kmol]. More...
 
const doublereal GasConstant = 8314.4621
 Universal Gas Constant. [J/kmol/K]. More...
 
const doublereal logGasConstant = std::log(GasConstant)
 
const doublereal OneAtm = 1.01325e5
 One atmosphere [Pa]. More...
 
const doublereal OneBar = 1.0E5
 
const doublereal GasConst_cal_mol_K = GasConstant / 4184.0
 Universal gas constant in cal/mol/K. More...
 
const doublereal Boltzmann = GasConstant / Avogadro
 Boltzmann's constant [J/K]. More...
 
const doublereal Planck = 6.62607009e-34
 Planck's constant. [J-s]. More...
 
const doublereal Planck_bar = Planck / (2 * Pi)
 
const doublereal logBoltz_Planck = std::log(Boltzmann / Planck)
 log(k/h) More...
 
const doublereal StefanBoltz = 5.670373e-8
 Stefan-Boltzmann constant. More...
 
Electron Properties
const doublereal ElectronCharge = 1.602176565e-19
 
const doublereal ElectronMass = 9.10938291e-31
 
const doublereal Faraday = ElectronCharge * Avogadro
 
Electromagnetism

Cantera uses the MKS unit system.

const doublereal lightSpeed = 299792458.0
 Speed of Light (m/s). More...
 
const doublereal permeability_0 = 4.0e-7*Pi
 Permeability of free space \( \mu_0 \) in N/A^2. More...
 
const doublereal epsilon_0 = 1.0 / (lightSpeed*lightSpeed*permeability_0)
 Permittivity of free space \( \epsilon_0 \) in F/m. More...
 
Thermodynamic Equilibrium Constraints

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

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
 

Detailed Description

This file contains definitions of terms that are used in internal routines and are unlikely to need modifying (text for module physConstants (see Physical Constants) is found here).

This file is included in every file that is in the Cantera Namespace.

All physical constants are stored here. The module physConstants is defined here.

Definition in file ct_defs.h.

Macro Definition Documentation

#define DATA_PTR (   vec)    &vec[0]

Creates a pointer to the start of the raw data for a vector.

Definition at line 36 of file ct_defs.h.

Referenced by InterfaceKinetics::_update_rates_C(), InterfaceKinetics::_update_rates_T(), SurfPhase::_updateThermo(), SingleSpeciesTP::_updateThermo(), LatticeSolidPhase::_updateThermo(), IdealSolidSolnPhase::_updateThermo(), MultiPhase::addSpeciesMoles(), InterfaceKinetics::applyButlerVolmerCorrection(), Cantera::BasisOptimize(), NonlinearSolver::beuler_jac(), solveSP::calc_t(), NonlinearSolver::calcColumnScales(), RedlichKwongMFTP::calcDensity(), ChemEquil::calcEmoles(), IonsFromNeutralVPSSTP::calcIonMoleFractions(), MolalityVPSSTP::calcMolalities(), HMWSoln::calcMolalitiesCropped(), MultiPhaseEquil::computeReactionSteps(), Array2D::copyData(), BandMatrix::copyData(), IdealSolnGasVPSS::cp_mole(), RedlichKwongMFTP::cp_mole(), IdealSolidSolnPhase::cp_mole(), IdealMolalSoln::cp_mole(), IonsFromNeutralVPSSTP::cp_mole(), DebyeHuckel::cp_mole(), HMWSoln::cp_mole(), PDSS_IonsFromNeutral::cp_R(), PDSS_IonsFromNeutral::cp_R_ref(), IonsFromNeutralVPSSTP::cv_mole(), cvodes_rhs(), NonlinearSolver::dampDogLeg(), NonlinearSolver::dampStep(), NonlinearSolver::decideStep(), NonlinearSolver::descentComparison(), vcs_MultiPhaseEquil::determine_PhaseStability(), NonlinearSolver::doAffineNewtonSolve(), NonlinearSolver::doCauchyPointSolve(), NonlinearSolver::doNewtonSolve(), NonlinearSolver::doResidualCalc(), IdealSolnGasVPSS::enthalpy_mole(), RedlichKwongMFTP::enthalpy_mole(), IdealMolalSoln::enthalpy_mole(), IonsFromNeutralVPSSTP::enthalpy_mole(), SurfPhase::enthalpy_mole(), DebyeHuckel::enthalpy_mole(), HMWSoln::enthalpy_mole(), PDSS_IonsFromNeutral::enthalpy_RT(), PDSS_IonsFromNeutral::enthalpy_RT_ref(), IdealSolnGasVPSS::entropy_mole(), RedlichKwongMFTP::entropy_mole(), IdealSolidSolnPhase::entropy_mole(), IdealMolalSoln::entropy_mole(), IonsFromNeutralVPSSTP::entropy_mole(), DebyeHuckel::entropy_mole(), HMWSoln::entropy_mole(), PDSS_IonsFromNeutral::entropy_R(), PDSS_IonsFromNeutral::entropy_R_ref(), ChemEquil::equilibrate(), ChemEquil::estimateElementPotentials(), ChemEquil::estimateEP_Brinkley(), MultiJac::eval(), ImplicitSurfChem::eval(), OneDim::eval(), ReactingSurf1D::eval(), FlowReactor::evalEqs(), ConstPressureReactor::evalEqs(), IdealGasReactor::evalEqs(), IdealGasConstPressureReactor::evalEqs(), Reactor::evalEqs(), ReactorNet::evalJacobian(), SquareMatrix::factor(), BandMatrix::factor(), SquareMatrix::factorQR(), Sim1D::finalize(), MultiPhaseEquil::finish(), TransportFactory::fitCollisionIntegrals(), TransportFactory::fitProperties(), solveSP::fun_eval(), GibbsExcessVPSSTP::getActivities(), RedlichKwongMFTP::getActivityConcentrations(), SemiconductorPhase::getChemPotentials(), SurfPhase::getChemPotentials(), IonsFromNeutralVPSSTP::getChemPotentials(), InterfaceKinetics::getDeltaElectrochemPotentials(), InterfaceKinetics::getDeltaEnthalpy(), InterfaceKinetics::getDeltaEntropy(), InterfaceKinetics::getDeltaGibbs(), InterfaceKinetics::getDeltaSSEnthalpy(), InterfaceKinetics::getDeltaSSEntropy(), InterfaceKinetics::getDeltaSSGibbs(), IonsFromNeutralVPSSTP::getdlnActCoeffds(), InterfaceKinetics::getEquilibriumConstants(), AqueousTransport::getFluidMobilities(), SimpleTransport::getFluidMobilities(), LiquidTransport::getFluidMobilities(), IdealSolidSolnPhase::getGibbs_RT(), MultiTransport::getMassFluxes(), MixTransport::getMobilities(), PecosTransport::getMobilities(), AqueousTransport::getMobilities(), SimpleTransport::getMobilities(), LiquidTransport::getMobilities(), DustyGasTransport::getMolarFluxes(), MultiTransport::getMultiDiffCoeffs(), RedlichKwongMFTP::getPartialMolarEntropies(), IdealSolidSolnPhase::getPureGibbs(), MultiTransport::getSpeciesFluxes(), PecosTransport::getSpeciesFluxes(), MixTransport::getSpeciesFluxes(), AqueousTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesVdiff(), SimpleTransport::getSpeciesVdiffES(), IdealSolidSolnPhase::gibbs_mole(), IdealMolalSoln::gibbs_mole(), IonsFromNeutralVPSSTP::gibbs_mole(), DebyeHuckel::gibbs_mole(), HMWSoln::gibbs_mole(), PDSS_IonsFromNeutral::gibbs_RT(), PDSS_IonsFromNeutral::gibbs_RT_ref(), MMCollisionInt::init(), CVodeInt::initialize(), CVodesIntegrator::initialize(), DustyGasTransport::initialize(), ReactorNet::initialize(), SurfPhase::initThermo(), GibbsExcessVPSSTP::initThermo(), LatticeSolidPhase::initThermo(), HMWSoln::initThermoXML(), OneDim::initTimeInteg(), Cantera::installNasa9ThermoFromXML(), LatticeSolidPhase::installSlavePhases(), IdealSolidSolnPhase::intEnergy_mole(), IdealMolalSoln::intEnergy_mole(), ReactorBase::massFractions(), PDSS_IonsFromNeutral::molarVolume(), PDSS_IonsFromNeutral::molarVolume_ref(), MultiPhaseEquil::MultiPhaseEquil(), Sim1D::newtonSolve(), MolalityVPSSTP::osmoticCoefficient(), MultiPhase::phase(), HMWSoln::printCoeffs(), solveProb::printIteration(), SquareMatrix::rcond(), BandMatrix::rcond(), SquareMatrix::rcondQR(), NonlinearSolver::readjustTrustVector(), Sim1D::refine(), HMWSoln::relative_enthalpy(), HMWSoln::relative_molal_enthalpy(), NonlinearSolver::residualComparisonLeg(), solveProb::resjac_eval(), solveSP::resjac_eval(), Sim1D::restore(), StFlow::restore(), IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnN_diag(), IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnX_diag(), IonsFromNeutralVPSSTP::s_update_dlnActCoeffdT(), IonsFromNeutralVPSSTP::s_update_lnActCoeff(), HMWSoln::s_updatePitzer_d2lnMolalityActCoeff_dT2(), HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dP(), HMWSoln::s_updatePitzer_dlnMolalityActCoeff_dT(), HMWSoln::s_updatePitzer_lnMolalityActCoeff(), StFlow::save(), MixtureFugacityTP::setConcentrations(), GibbsExcessVPSSTP::setConcentrations(), IonsFromNeutralVPSSTP::setConcentrations(), SurfPhase::setCoverages(), SurfPhase::setCoveragesByName(), SurfPhase::setCoveragesNoNorm(), Sim1D::setFixedTemperature(), StFlow::setGasAtMidpoint(), MultiPhaseEquil::setInitialMoles(), Wall::setKinetics(), LatticeSolidPhase::setLatticeMoleFractionsByName(), MixtureFugacityTP::setMassFractions(), GibbsExcessVPSSTP::setMassFractions(), IonsFromNeutralVPSSTP::setMassFractions(), MixtureFugacityTP::setMassFractions_NoNorm(), GibbsExcessVPSSTP::setMassFractions_NoNorm(), IonsFromNeutralVPSSTP::setMassFractions_NoNorm(), MolalityVPSSTP::setMolalities(), MolalityVPSSTP::setMolalitiesByName(), Inlet1D::setMoleFractions(), OutletRes1D::setMoleFractions(), LatticeSolidPhase::setMoleFractions(), MixtureFugacityTP::setMoleFractions(), GibbsExcessVPSSTP::setMoleFractions(), IonsFromNeutralVPSSTP::setMoleFractions(), MixtureFugacityTP::setMoleFractions_NoNorm(), GibbsExcessVPSSTP::setMoleFractions_NoNorm(), IonsFromNeutralVPSSTP::setMoleFractions_NoNorm(), MultiPhase::setMoles(), MultiPhase::setMolesByName(), ThermoPhase::setReferenceComposition(), MixtureFugacityTP::setState_TP(), MixtureFugacityTP::setState_TR(), OneDim::setSteadyMode(), ChemEquil::setToEquilState(), RedlichKwongMFTP::setToEquilState(), IdealSolidSolnPhase::setToEquilState(), NonlinearSolver::setupDoubleDogleg(), Sim1D::showSolution(), Sim1D::Sim1D(), OneDim::solve(), SquareMatrix::solve(), MultiNewton::solve(), solveProb::solve(), BandMatrix::solve(), NonlinearSolver::solve_nonlinear_problem(), ImplicitSurfChem::solvePseudoSteadyStateProblem(), SquareMatrix::solveQR(), solveSP::solveSurfProb(), RedlichKwongMFTP::standardConcentration(), HMWSoln::standardConcentration(), AqueousTransport::stefan_maxwell_solve(), LiquidTransport::stefan_maxwell_solve(), MultiPhaseEquil::stepComposition(), StFlow::StFlow(), Wall::syncCoverages(), PecosTransport::thermalConductivity(), NonlinearSolver::trustRegionLength(), ChemEquil::update(), PecosTransport::update_C(), MultiTransport::update_C(), MixTransport::update_C(), AqueousTransport::update_C(), SimpleTransport::update_C(), LiquidTransport::update_C(), InterfaceKinetics::updateKc(), MultiPhase::updatePhases(), InterfaceKinetics::updateROP(), MultiTransport::updateThermal_T(), StFlow::updateTransport(), DustyGasTransport::updateTransport_C(), MultiPhase::uploadMoleFractionsFromPhases(), VCS_SOLVE::vcs_popPhaseRxnStepSizes(), GasTransport::viscosity(), PecosTransport::viscosity(), and AqueousTransport::viscosity().