Cantera  2.0
Classes | Typedefs | Enumerations | Functions | Variables
Cantera Namespace Reference

Provides class Nucleus. More...

Classes

class  Application
 Class to hold global data. More...
 
class  LogPrintCtrl
 This class provides some printing and cropping utilities for writing to the logfile. More...
 
class  Unit
 Unit conversion utility. More...
 
class  XML_Error
 Classs representing a generic XML error condition. More...
 
class  XML_TagMismatch
 Class representing a specific type of XML file formatting error. More...
 
class  XML_NoChild
 Class representing a specific type of XML file formatting error. More...
 
class  XML_IllegalUnits
 Class representing a specific type of XML file formatting error. More...
 
class  PropertyCalculator
 Classes used by ChemEquil. More...
 
class  Troe3
 The 3-parameter Troe falloff parameterization. More...
 
class  Troe4
 The 4-parameter Troe falloff parameterization. More...
 
class  SRI3
 The 3-parameter SRI falloff function for F More...
 
class  SRI5
 The 5-parameter SRI falloff function. More...
 
class  WF93
 Wang-Frenklach falloff function. More...
 
class  ImplicitSurfChem
 Advances the surface coverages of the associated set of SurfacePhase objects in time. More...
 
class  rxninfo
 these are all used to check for duplicate reactions More...
 
class  solveSP
 Method to solve a pseudo steady state surface problem. More...
 
class  CVodeErr
 Exception thrown when a CVODE error is encountered. More...
 
class  CVodeInt
 Wrapper class for 'cvode' integrator from LLNL. More...
 
class  Nucleus
 Represents atomic nuclei. More...
 
class  ConstCpPoly
 A constant-heat capacity species thermodynamic property manager class. More...
 
struct  awData
 
class  ElementsFrozen
 Exception class to indicate a fixed set of elements. More...
 
class  Nasa9PolyMultiTempRegion
 The NASA 9 polynomial parameterization for a single species encompassing multiple temperature regions. More...
 
class  NasaPoly2
 The NASA polynomial parameterization for two temperature ranges. More...
 
class  NasaThermo
 A species thermodynamic property manager for the NASA polynomial parameterization with two temperature ranges. More...
 
class  ShomatePoly
 The Shomate polynomial parameterization for one temperature range for one species. More...
 
class  ShomatePoly2
 The Shomate polynomial parameterization for two temperature ranges for one species. More...
 
class  ShomateThermo
 A species thermodynamic property manager for the Shomate polynomial parameterization. More...
 
class  UnknownVPSSMgrModel
 Throw a named error for an unknown or missing vpss species thermo model. More...
 
class  VPSSMgrFactory
 Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More...
 
class  FtnTransport
 A class that calls external Fortran functions to evaluate transport properties. More...
 
class  LTPError
 Exception thrown if an error is encountered while reading the transport database. More...
 
class  LTPmodelError
 Exception thrown if an error is encountered while reading the transport database. More...
 
class  MMCollisionIntError
 Error handler class for collision integrals. More...
 
class  MMCollisionInt
 Calculation of Collision integrals. More...
 
class  TortuosityBase
 Base case to handle tortuosity corrections for diffusive transport in porous media. More...
 
class  TortuosityBruggeman
 Base case to handle tortuosity corrections for diffusive transport in porous media using the Bruggeman exponential approximation. More...
 
class  TortuosityMaxwell
 Maxwell model for tortuosity. More...
 
class  TortuosityPercolation
 This class implements transport coefficient corrections appropriate for porous media where percolation theory applies. More...
 
class  TransportDBError
 Exception thrown if an error is encountered while reading the transport database. More...
 
class  Array2D
 A class for 2D arrays stored in column-major (Fortran-compatible) form. More...
 
class  clockWC
 The class provides the wall clock timer in seconds. More...
 
class  CanteraError
 Base class for exceptions thrown by Cantera classes. More...
 
class  ArraySizeError
 Array size error. More...
 
class  IndexError
 An array index is out of range. More...
 
class  FactoryBase
 Base class for factories. More...
 
class  Logger
 Base class for 'loggers' that write text messages to log files. More...
 
class  PrintCtrl
 This class provides some printing and cropping utilities. More...
 
class  XML_Reader
 Class XML_Reader reads an XML file into an XML_Node object. More...
 
class  XML_Node
 Class XML_Node is a tree-based representation of the contents of an XML file. More...
 
class  EquilOpt
 Chemical equilibrium options. More...
 
class  ChemEquil
 Class ChemEquil implements a chemical equilibrium solver for single-phase solutions. More...
 
class  MultiPhase
 A class for multiphase mixtures. More...
 
class  MultiPhaseEquil
 Multiphase chemical equilibrium solver. More...
 
class  GRI30
 This class is a convenience class for use in C++ programs that hard-wires the GRI 3.0 reaction mechanism. More...
 
class  Interface
 An interface between multiple bulk phases. More...
 
class  AqueousKinetics
 Kinetics manager for elementary aqueous-phase chemistry. More...
 
class  EdgeKinetics
 Heterogeneous reactions at one-dimensional interfaces between multiple adjacent two-dimensional surfaces. More...
 
class  Enhanced3BConc
 Computes enhanced third-body concentrations. More...
 
class  Falloff
 Base class for falloff function calculators. More...
 
class  FalloffFactory
 Factory class to construct falloff function calculators. More...
 
class  FalloffMgr
 A falloff manager that implements any set of falloff functions. More...
 
class  GasKinetics
 Kinetics manager for elementary gas-phase chemistry. More...
 
class  GRI_30_Kinetics
 Kinetics manager implementing reaction mechanism GRI-Mech 3.0. More...
 
class  Group
 Class Group is an internal class used by class ReactionPath. More...
 
struct  ReactionRules
 Rules for parsing and installing reactions. More...
 
class  InterfaceKineticsData
 This class holds mechanism-specific data. More...
 
class  InterfaceKinetics
 A kinetics manager for heterogeneous reaction mechanisms. More...
 
class  Kinetics
 Public interface for kinetics managers. More...
 
class  KineticsFactory
 Factory for kinetics managers. More...
 
class  Rate1
 This rate coefficient manager supports one parameterization of the rate constant of any type. More...
 
class  Rate2
 This rate coefficient manager supports two parameterizations of any type. More...
 
class  SpeciesNode
 Nodes in reaction path graphs. More...
 
class  ReactionPathDiagram
 Reaction path diagrams (graphs). More...
 
class  ReactionStoichMgr
 Reaction mechanism stoichiometry manager. More...
 
class  Arrhenius
 Arrhenius reaction rate type depends only on temperature. More...
 
class  ArrheniusSum
 
class  SurfaceArrhenius
 An Arrhenius rate with coverage-dependent terms. More...
 
class  ExchangeCurrent
 Arrhenius reaction rate type depends only on temperature. More...
 
class  C1
 Handles one species in a reaction. More...
 
class  C2
 Handles two species in a single reaction. More...
 
class  C3
 Handles three species in a reaction. More...
 
class  C_AnyN
 Handles any number of species in a reaction, including fractional stoichiometric coefficients, and arbitrary reaction orders. More...
 
class  BandMatrix
 A class for banded matrices, involving matrix inversion processes. More...
 
class  BEulerErr
 Exception class thrown when a BEuler error is encountered. More...
 
class  BEulerInt
 Wrapper class for 'beuler' integrator We derive the class from the class Integrator. More...
 
class  DAE_Solver
 Wrapper for DAE solvers. More...
 
class  CELapackError
 Exception thrown when an LAPACK error is encountered associated with inverting or solving a matrix. More...
 
class  DenseMatrix
 A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operations to class Array2D. More...
 
class  Func1
 Base class for 'functor' classes that evaluate a function of one variable. More...
 
class  Sin1
 implements the sin() function More...
 
class  Cos1
 cos More...
 
class  Exp1
 exp More...
 
class  Pow1
 pow More...
 
class  Const1
 Constant. More...
 
class  Sum1
 Sum of two functions. More...
 
class  Diff1
 Difference of two functions. More...
 
class  Product1
 Product of two functions. More...
 
class  TimesConstant1
 Product of two functions. More...
 
class  PlusConstant1
 A function plus a constant. More...
 
class  Ratio1
 Ratio of two functions. More...
 
class  Composite1
 Composite function. More...
 
class  Gaussian
 A Gaussian. More...
 
class  Poly1
 Polynomial of degree n. More...
 
class  Fourier1
 Fourier cosine/sine series. More...
 
class  Arrhenius1
 Sum of Arrhenius terms. More...
 
class  Periodic1
 Periodic function. More...
 
class  FuncEval
 Virtual base class for ODE right-hand-side function evaluators. More...
 
class  GeneralMatrix
 Generic matrix. More...
 
class  Integrator
 Abstract base class for ODE system integrators. More...
 
class  NonlinearSolver
 Class that calculates the solution to a nonlinear system. More...
 
class  ResidEval
 Virtual base class for DAE residual function evaluators. More...
 
class  ResidJacEval
 Wrappers for the function evaluators for Nonlinear solvers and Time steppers. More...
 
class  RootFind
 Root finder for 1D problems. More...
 
class  solveProb
 Method to solve a pseudo steady state of a nonlinear problem. More...
 
class  SquareMatrix
 A class for full (non-sparse) matrices with Fortran-compatible data storage. More...
 
class  Domain1D
 Base class for one-dimensional domains. More...
 
class  Bdry1D
 The base class for boundaries between one-dimensional spatial domains. More...
 
class  Inlet1D
 An inlet. More...
 
class  Empty1D
 A terminator that does nothing. More...
 
class  Symm1D
 A symmetry plane. More...
 
class  OutletRes1D
 An outlet with specified composition. More...
 
class  Surf1D
 A non-reacting surface. More...
 
class  ReactingSurf1D
 A reacting surface. More...
 
class  MultiJac
 Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplied by an instance of class 'OneDim. More...
 
class  MultiNewton
 Newton iterator for multi-domain, one-dimensional problems. More...
 
class  OneDim
 Container class for multiple-domain 1D problems. More...
 
class  Sim1D
 One-dimensional simulations. More...
 
class  StFlow
 This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemically-reacting, axisymmetric, flows. More...
 
class  AxiStagnFlow
 A class for axisymmetric stagnation flows. More...
 
class  FreeFlame
 A class for freely-propagating premixed flames. More...
 
class  LineBroadener
 Base class for classes implementing line shapes of various types. More...
 
class  LorentzianProfile
 The line shape for pure collisional broadening. More...
 
class  GaussianProfile
 A Gaussian line profile. More...
 
class  Voigt
 A Voigt profile is the convolution of a Lorentzian and a Gaussian profile. More...
 
class  Rotor
 Class Rotor represents a non-rigid quantum-mechanical rotor. More...
 
class  Adsorbate
 An adsorbed surface species. More...
 
class  ConstDensityThermo
 Overloads the virtual methods of class ThermoPhase to implement the incompressible equation of state. More...
 
class  Crystal
 A class for crystals. More...
 
class  DebyeHuckel
 Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulation for nonideality. More...
 
class  EdgePhase
 A thermodynamic Phase representing a one dimensional edge between two surfaces. More...
 
class  Elements
 Object containing the elements that make up species in a phase. More...
 
class  FixedChemPotSSTP
 Class FixedChemPotSSTP represents a stoichiometric (fixed composition) incompressible substance. More...
 
class  GeneralSpeciesThermo
 A species thermodynamic property manager for a phase. More...
 
class  GibbsExcessVPSSTP
 
class  HMWSoln
 Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer formulation for nonideality. More...
 
class  IdealGasPhase
 Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state. More...
 
class  IdealMolalSoln
 This phase is based upon the mixing-rule assumption that all molality-based activity coefficients are equal to one. More...
 
class  IdealSolidSolnPhase
 Class IdealSolidSolnPhase represents a condensed phase ideal solution compound. More...
 
class  IdealSolnGasVPSS
 This class can handle either an ideal solution or an ideal gas approximation of a phase. More...
 
class  IonsFromNeutralVPSSTP
 
class  LatticePhase
 A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms. More...
 
class  LatticeSolidPhase
 A phase that is comprised of a fixed additive combination of other lattice phases. More...
 
class  MargulesVPSSTP
 MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Margules approximation for the excess gibbs free energy. More...
 
class  MetalPhase
 Class MetalPhase represents electrons in a metal. More...
 
class  MetalSHEelectrons
 Class MetalSHEelectrons represents electrons within a metal, adjacent to an aqueous electrolyte, that are consistent with the SHE reference electrode. More...
 
class  MineralEQ3
 Class MineralEQ3 represents a stoichiometric (fixed composition) incompressible substance based on EQ3's parameterization. More...
 
class  MixedSolventElectrolyte
 MixedSolventElectrolyte is a derived class of GibbsExcessVPSSTP that employs the DH and local Marguless approximations for the excess gibbs free energy. More...
 
class  MixtureFugacityTP
 This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handling mixture of gases that whose standard states are defined as ideal gases, but which describe also non-ideal solutions. More...
 
class  MolalityVPSSTP
 
class  MolarityIonicVPSSTP
 
class  Mu0Poly
 The Mu0Poly class implements an interpolation of the Gibbs free energy based on a piecewise constant heat capacity approximation. More...
 
class  Nasa9Poly1
 The NASA 9 polynomial parameterization for one temperature range. More...
 
class  NasaPoly1
 The NASA polynomial parameterization for one temperature range. More...
 
class  PDSS
 Virtual base class for a species with a pressure dependent standard state. More...
 
class  PDSS_ConstVol
 
class  PDSS_HKFT
 Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water. More...
 
class  PDSS_IdealGas
 Derived class for pressure dependent standard states of an ideal gas species. More...
 
class  PDSS_IonsFromNeutral
 Derived class for pressure dependent standard states of an ideal gas species. More...
 
class  PDSS_SSVol
 Class for pressure dependent standard states that uses a standard state volume model of some sort. More...
 
class  PDSS_Water
 Class for the liquid water pressure dependent standard state. More...
 
class  Phase
 Base class for phases of matter. More...
 
class  PhaseCombo_Interaction
 PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs the Margules approximation for the excess gibbs free energy while eliminating the entropy of mixing term. More...
 
class  PseudoBinaryVPSSTP
 
class  PureFluidPhase
 This phase object consists of a single component that can be a gas, a liquid, a mixed gas-liquid fluid, or a fluid beyond its critical point. More...
 
class  RedlichKisterVPSSTP
 RedlichKisterVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Redlich-Kister approximation for the excess gibbs free energy. More...
 
class  RedlichKwongMFTP
 This class can handle either an ideal solution or an ideal gas approximation of a phase. More...
 
class  SemiconductorPhase
 Class SemiconductorPhase represents electrons and holes in a semiconductor. More...
 
class  SimpleThermo
 
class  SingleSpeciesTP
 The SingleSpeciesTP class is a filter class for ThermoPhase. More...
 
class  SpeciesThermo
 Pure Virtual base class for the species thermo manager classes. More...
 
class  UnknownSpeciesThermoModel
 Throw a named error for an unknown or missing species thermo model. More...
 
class  SpeciesThermoFactory
 Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More...
 
class  SpeciesThermoInterpType
 Pure Virtual Base class for the thermodynamic manager for an individual species' reference state. More...
 
class  STITbyPDSS
 Class for the thermodynamic manager for an individual species' reference state which uses the PDSS base class to satisfy the requests. More...
 
class  RefPressureMismatch
 Exception thrown if species reference pressures don't match. More...
 
class  UnknownSpeciesThermo
 Unknown species thermo manager string error. More...
 
class  SpeciesThermoDuo
 This species thermo manager requires that all species have one of two parameterizations. More...
 
struct  UnknownThermoParam
 Error for unknown thermo parameterization. More...
 
struct  ThermoIndexData
 holds parameterization-dependent index information More...
 
class  StoichSubstance
 Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance. More...
 
class  StoichSubstanceSSTP
 Class StoichSubstanceSSTP represents a stoichiometric (fixed composition) incompressible substance. More...
 
class  electrodeElectron
 Class electrodeElectron represents an electron in a metal using the Standard hydrogen reference electrode. More...
 
class  SurfPhase
 A simple thermodynamic model for a surface phase, assuming an ideal solution model. More...
 
class  UnknownThermoPhaseModel
 Specific error to be thrown if the type of Thermo manager is unrecognized. More...
 
class  ThermoFactory
 Factory class for thermodynamic property managers. More...
 
class  ThermoPhase
 Base class for a phase with thermodynamic properties. More...
 
class  VPSSMgr
 Virtual base class for the classes that manage the calculation of standard state properties for all the species in a phase. More...
 
class  VPSSMgr_ConstVol
 Constant Molar Volume e VPSS species thermo manager class. More...
 
class  VPSSMgr_General
 Class that handles the calculation of standard state thermo properties for a set of species belonging to a single phase in a completely general but slow way. More...
 
class  VPSSMgr_IdealGas
 Virtual base class for the species thermo manager classes. More...
 
class  UnknownVPSSMgr
 Error for unknown thermo parameterization. More...
 
class  VPSSMgr_Water_ConstVol
 Virtual base class for the species thermo manager classes. More...
 
class  VPSSMgr_Water_HKFT
 Virtual base class for the species thermo manager classes. More...
 
class  VPStandardStateTP
 This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling a variable pressure standard state for species. More...
 
class  WaterProps
 The WaterProps class is used to house several approximation routines for properties of water. More...
 
class  WaterPropsIAPWS
 Class for calculating the equation of state of water. More...
 
class  WaterSSTP
 Class for single-component water. More...
 
class  AqueousTransport
 Class AqueousTransport implements mixture-averaged transport properties for brine phases. More...
 
class  DustyGasTransport
 Class DustyGasTransport implements the Dusty Gas model for transport in porous media. More...
 
class  GasTransport
 Class GasTransport implements some functions and properties that are shared by the MixTransport and MultiTransport classes. More...
 
class  LiquidTranInteraction
 Base class to handle transport property evaluation in a mixture. More...
 
class  LTI_MoleFracs
 Simple mole fraction weighting of transport properties. More...
 
class  LTI_MassFracs
 Simple mass fraction weighting of transport properties. More...
 
class  LTI_Log_MoleFracs
 Mixing rule using logarithms of the mole fractions. More...
 
class  LTI_Pairwise_Interaction
 Transport properties that act like pairwise interactions as in binary diffusion coefficients. More...
 
class  LTI_StefanMaxwell_PPN
 Stefan Maxwell Diffusion Coefficients can be solved for given ion conductivity, mobility ratios, and self diffusion coeffs. More...
 
class  LTI_MoleFracs_ExpT
 Simple mole fraction weighting of transport properties. More...
 
class  LiquidTransport
 Class LiquidTransport implements models for transport properties for liquid phases. More...
 
class  LiquidTransportData
 Class LiquidTransportData holds transport parameters for a specific liquid-phase species. More...
 
class  LiquidTransportParams
 Composition dependence type for liquid mixture transport properties. More...
 
class  LTPspecies
 Class LTPspecies holds transport parameters for a specific liquid-phase species. More...
 
class  LTPspecies_Const
 Class LTPspecies_Const holds transport parameters for a specific liquid-phase species (LTPspecies) when the transport property is just a constant value. More...
 
class  LTPspecies_Arrhenius
 Class LTPspecies_Arrhenius holds transport parameters for a specific liquid-phase species (LTPspecies) when the transport property is expressed in Arrhenius form. More...
 
class  LTPspecies_Poly
 Class LTPspecies_Poly holds transport parameters for a specific liquid-phase species (LTPspecies) when the transport property is expressed as a polynomial in temperature. More...
 
class  LTPspecies_ExpT
 Class LTPspecies_ExpT holds transport parameters for a specific liquid-phase species (LTPspecies) when the transport property is expressed as an exponential in temperature. More...
 
class  MixTransport
 Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures. More...
 
class  L_Matrix
 Class L_Matrix is used to represent the "L" matrix. More...
 
class  MultiTransport
 Class MultiTransport implements multicomponent transport properties for ideal gas mixtures. More...
 
class  SimpleTransport
 Class SimpleTransport implements mixture-averaged transport properties for liquid phases. More...
 
class  SolidTransport
 Class SolidTransport implements transport properties for solids. More...
 
class  Transport
 Base class for transport property managers. More...
 
struct  GasTransportData
 Struct to hold data read from a transport property database file for gas-phase species. More...
 
class  TransportFactory
 The purpose of the TransportFactory class is to create new instances of 'transport managers', which are classes that provide transport properties and which are derived from the base class, Transport. More...
 
class  NotImplemented
 Error class to indicate an unimplemented method. More...
 
class  TransportParams
 Base structure to hold transport model parameters. More...
 
class  GasTransportParams
 This structure holds transport model parameters relevant to transport in ideal gases with a kinetic theory of gases derived transport model. More...
 
class  WaterTransport
 Transport Parameters for pure water. More...
 
class  ConstPressureReactor
 Class ConstPressureReactor is a class for constant-pressure reactors. More...
 
class  MassFlowController
 A class for mass flow controllers. More...
 
class  PressureController
 A class for mass flow controllers. More...
 
class  Valve
 Valve objects supply a mass flow rate that is a function of the pressure drop across the valve. More...
 
class  FlowDevice
 Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors. More...
 
class  FlowReactor
 Adiabatic, reversible flow in a constant-area duct. More...
 
class  Reactor
 Class Reactor is a general-purpose class for stirred reactors. More...
 
class  ReactorBase
 Base class for stirred reactors. More...
 

Typedefs

typedef std::map< std::string,
doublereal > 
compositionMap
 Map connecting a string name with a double.
 
typedef std::vector< double > vector_fp
 Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
 
typedef std::vector< int > vector_int
 Vector of ints.
 
typedef std::vector
< std::vector< size_t > > 
grouplist_t
 A grouplist is a vector of groups of species.
 
typedef boost::mutex mutex_t
 
typedef boost::mutex::scoped_lock ScopedLock
 
typedef ThermoPhase thermo_t
 typedef for the ThermoPhase class
 
typedef int VelocityBasis
 The diffusion fluxes must be referenced to a particular reference fluid velocity.
 

Enumerations

enum  flow_t { NetFlow, OneWayFlow }
 
enum  BEulerMethodType { BEulerFixedStep, BEulerVarStep }
 
enum  MethodType { BDF_Method, Adams_Method }
 Specifies the method used to integrate the system of equations. More...
 
enum  IterType { Newton_Iter, Functional_Iter }
 Specifies the method used for iteration. More...
 
enum  ResidEval_Type_Enum {
  Base_ResidEval = 0, JacBase_ResidEval, JacDelta_ResidEval, Base_ShowSolution,
  Base_LaggedSolutionComponents
}
 Differentiates the type of residual evaluations according to functionality. More...
 
enum  IonSolnType_enumType { cIonSolnType_PASSTHROUGH = 2000, cIonSolnType_SINGLEANION, cIonSolnType_SINGLECATION, cIonSolnType_MULTICATIONANION }
 enums for molten salt ion solution types More...
 
enum  SSVolume_Model_enumType { cSSVOLUME_CONSTANT = 0, cSSVOLUME_TPOLY, cSSVOLUME_DENSITY_TPOLY }
 Types of general formulations for the specification of the standard state volume. More...
 
enum  PDSS_enumType {
  cPDSS_UNDEF = 100, cPDSS_IDEALGAS, cPDSS_CONSTVOL, cPDSS_SSVOL,
  cPDSS_MOLAL_CONSTVOL, cPDSS_WATER, cPDSS_MOLAL_HKFT, cPDSS_IONSFROMNEUTRAL
}
 Types of PDSS's. More...
 
enum  VPSSMgr_enumType {
  cVPSSMGR_UNDEF = 1000, cVPSSMGR_IDEALGAS, cVPSSMGR_CONSTVOL, cVPSSMGR_PUREFLUID,
  cVPSSMGR_WATER_CONSTVOL, cVPSSMGR_WATER_HKFT, cVPSSMGR_GENERAL
}
 enum for VPSSMgr types More...
 
enum  LiquidTranMixingModel {
  LTI_MODEL_NOTSET =-1, LTI_MODEL_NONE, LTI_MODEL_SOLVENT, LTI_MODEL_MOLEFRACS,
  LTI_MODEL_MASSFRACS, LTI_MODEL_LOG_MOLEFRACS, LTI_MODEL_PAIRWISE_INTERACTION, LTI_MODEL_STEFANMAXWELL_PPN,
  LTI_MODEL_STOKES_EINSTEIN, LTI_MODEL_MOLEFRACS_EXPT
}
 Composition dependence type for liquid mixture transport properties. More...
 
enum  TransportPropertyType {
  TP_UNKNOWN = -1, TP_VISCOSITY = 0, TP_IONCONDUCTIVITY, TP_MOBILITYRATIO,
  TP_SELFDIFFUSION, TP_THERMALCOND, TP_DIFFUSIVITY, TP_HYDRORADIUS,
  TP_ELECTCOND
}
 Enumeration of the types of transport properties that can be handled by the variables in the various Transport classes. More...
 
enum  LTPTemperatureDependenceType {
  LTP_TD_NOTSET =-1, LTP_TD_CONSTANT, LTP_TD_ARRHENIUS, LTP_TD_POLY,
  LTP_TD_EXPT
}
 Temperature dependence type for pure (liquid) species properties. More...
 
enum  TRANSOLVE_TYPE { TRANSOLVE_GMRES = 1, TRANSOLVE_LU }
 Transport solve options. More...
 

Functions

cthreadId_t getThisThreadId ()
 
void deprecatedMethod (std::string classnm, std::string oldnm, std::string newnm)
 Print a warning when a deprecated method is called.
 
void removeAtVersion (std::string func, std::string version)
 Throw an error condition for a procedure that has been removed.
 
static Applicationapp ()
 Return a pointer to the application object.
 
void setLogger (Logger *logwriter)
 Install a logger.
 
void writelog (const std::string &msg)
 Write a message to the screen.
 
void writelog (const char *msg)
 Write a message to the screen.
 
void writelogf (const char *fmt,...)
 Write a formatted message to the screen.
 
void writelogendl ()
 Write an end of line character to the screen and flush output.
 
void error (const std::string &msg)
 Write an error message and terminate execution.
 
int userInterface ()
 returns 1 for MATLAB, 2 for Python, and 0 for C++ or Fortran.
 
void beginLogGroup (std::string title, int loglevel=-99)
 Create a new group for log messages.
 
void addLogEntry (std::string tag, std::string value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string tag, doublereal value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string tag, int value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string msg)
 Add an entry msg string to an HTML log file.
 
void endLogGroup (std::string title="")
 Close the current group of log messages.
 
void write_logfile (std::string file="log.html")
 Write the HTML log file.
 
void appdelete ()
 Delete and free all memory associated with the application.
 
void thread_complete ()
 Delete and free memory allocated per thread in multithreaded applications.
 
XML_Nodeget_XML_File (std::string file, int debug=0)
 Return a pointer to the XML tree for a Cantera input file.
 
void close_XML_File (std::string file)
 Close a Cantera input file.
 
int nErrors ()
 Return the number of errors that have been encountered so far.
 
void popError ()
 Discard the last error message.
 
string lastErrorMessage ()
 Returns the last error message.
 
void showErrors (std::ostream &f)
 Prints all of the error messages to an ostream.
 
void showErrors ()
 Print all of the error messages using function writelog of class logger.
 
void setError (std::string r, std::string msg)
 Set an error condition in the application class without throwing an exception.
 
void addDirectory (std::string dir)
 Add a directory to the input file search path.
 
std::string findInputFile (std::string name)
 Find an input file.
 
doublereal toSI (std::string unit)
 Return the conversion factor to convert unit std::string 'unit' to SI units.
 
doublereal actEnergyToSI (std::string unit)
 Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin.
 
string canteraRoot ()
 Returns root directory where Cantera where installed.
 
static void split_at_pound (const std::string &src, std::string &file, std::string &id)
 split a string at a '#' sign. Used to separate a file name from an id string.
 
XML_Nodeget_XML_Node (const std::string &file_ID, XML_Node *root)
 This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string.
 
XML_Nodeget_XML_NameID (const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
 This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string.
 
void writePlotFile (const std::string &fname, const std::string &fmt, const std::string &plotTitle, const std::vector< std::string > &names, const Array2D &data)
 Write a Plotting file.
 
void outputTEC (std::ostream &s, const std::string &title, const std::vector< std::string > &names, const Array2D &data)
 Write a Tecplot data file.
 
void outputExcel (std::ostream &s, const std::string &title, const std::vector< std::string > &names, const Array2D &data)
 Write an Excel spreadsheet in 'csv' form.
 
std::string fp2str (const double x, const std::string &fmt)
 Convert a double into a c++ string.
 
std::string fp2str (const double x)
 Convert a double into a c++ string.
 
std::string int2str (const int n, const std::string &fmt)
 Convert an int to a string using a format converter.
 
std::string int2str (const int n)
 Convert an int to a string.
 
std::string int2str (const size_t n)
 Convert an unsigned integer to a string.
 
std::string lowercase (const std::string &s)
 Cast a copy of a string to lower case.
 
static int firstChar (const std::string &s)
 Return the position of the first printable character in the string.
 
static int lastChar (const std::string &s)
 Return the position of the last printable character in the string.
 
std::string stripws (const std::string &s)
 Strip the leading and trailing white space from a string.
 
std::string stripnonprint (const std::string &s)
 Strip non-printing characters wherever they are.
 
void parseCompString (const std::string &ss, Cantera::compositionMap &x)
 Parse a composition string into a map consisting of individual key:composition pairs.
 
void split (const std::string &ss, std::vector< std::string > &w)
 Parse a composition string into individual key:composition pairs.
 
int fillArrayFromString (const std::string &str, doublereal *const a, const char delim= ' ')
 Interpret a string as a list of floats, and convert it to a vector of floats.
 
std::string getBaseName (const std::string &fullPath)
 Get the file name without the path or extension.
 
int intValue (std::string val)
 Translate a string into one integer value.
 
doublereal fpValue (std::string val)
 Translate a string into one doublereal value.
 
doublereal fpValueCheck (std::string val)
 Translate a string into one doublereal value.
 
std::string logfileName (const std::string &infile)
 Generate a logfile name based on an input file name.
 
std::string wrapString (const std::string &s, const int len=70)
 Line wrap a string via a copy operation.
 
std::string parseSpeciesName (const std::string &nameStr, std::string &phaseName)
 Parse a name string, separating out the phase name from the species name.
 
int stripLTWScstring (char str[])
 Routine strips off white space from a c character string.
 
doublereal atofCheck (const char *const dptr)
 Translate a char string into a single double.
 
doublereal strSItoDbl (const std::string &strSI)
 Interpret one or two token string as a single double.
 
static std::string::size_type findFirstWS (const std::string &val)
 Find the first white space in a string.
 
static std::string::size_type findFirstNotOfWS (const std::string &val)
 Find the first non-white space in a string.
 
void tokenizeString (const std::string &oval, std::vector< std::string > &v)
 This function separates a string up into tokens according to the location of white space.
 
static string::size_type findUnbackslashed (std::string s, const char q, std::string::size_type istart=0)
 Find the first position of a character, q, in string, s, which is not immediately preceded by the backslash character.
 
XML_NodefindXMLPhase (XML_Node *root, const std::string &phaseName)
 Search an XML_Node tree for a named phase XML_Node.
 
int _equilflag (const char *xy)
 map property strings to integers
 
doublereal equilibrate (MultiPhase &s, const char *XY, doublereal rtol=1.0e-9, int maxsteps=5000, int maxiter=100, int loglevel=-99)
 Equilibrate a MultiPhase object.
 
int equilibrate (thermo_t &s, const char *XY, int solver=-1, doublereal rtol=1.0e-9, int maxsteps=VCS_MAXSTEPS, int maxiter=100, int loglevel=-99)
 Equilibrate a ThermoPhase object.
 
static string coeffString (bool first, doublereal nu, string sym)
 Used to print reaction equations.
 
int new_equilibrate (thermo_t &s, const char *XY, int solver, doublereal rtol, int maxsteps, int maxiter, int loglevel)
 
int vcs_equilibrate (thermo_t &s, const char *XY, int estimateEquil=0, int printLvl=0, int solver=-1, doublereal rtol=1.0e-9, int maxsteps=VCS_MAXSTEPS, int maxiter=100, int loglevel=-99)
 Set a single-phase chemical solution to chemical equilibrium.
 
int vcs_equilibrate (MultiPhase &s, const char *XY, int estimateEquil=0, int printLvl=0, int solver=2, doublereal rtol=1.0e-9, int maxsteps=VCS_MAXSTEPS, int maxiter=100, int loglevel=-99)
 Set a multi-phase chemical solution to chemical equilibrium.
 
int vcs_equilibrate_1 (MultiPhase &s, int ixy, int estimateEquil=0, int printLvl=0, int solver=2, doublereal rtol=1.0e-9, int maxsteps=VCS_MAXSTEPS, int maxiter=100, int loglevel=-99)
 Set a multi-phase chemical solution to chemical equilibrium.
 
int vcs_determine_PhaseStability (MultiPhase &s, int iphase, double &funcStab, int printLvl, int loglevel)
 Determine the phase stability of a single phase given the current conditions in a MultiPhase object.
 
std::ostream & operator<< (std::ostream &s, const Cantera::Group &g)
 
void checkRxnElementBalance (Kinetics &kin, const ReactionData &rdata, doublereal errorTolerance=1.0e-3)
 This function will check a specific reaction to see if the elements balance.
 
bool getReagents (const XML_Node &rxn, Kinetics &kin, int rp, std::string default_phase, std::vector< size_t > &spnum, vector_fp &stoich, vector_fp &order, const ReactionRules &rules)
 Get the reactants or products of a reaction.
 
static void getArrhenius (const XML_Node &node, int &highlow, doublereal &A, doublereal &b, doublereal &E)
 getArrhenius() parses the xml element called Arrhenius.
 
static void getStick (const XML_Node &node, Kinetics &kin, ReactionData &r, doublereal &A, doublereal &b, doublereal &E)
 getStick() processes the XML element called Stick that specifies the sticking coefficient reaction.
 
static void getCoverageDependence (const XML_Node &node, thermo_t &surfphase, ReactionData &rdata)
 
static void getFalloff (const XML_Node &f, ReactionData &rdata)
 Get falloff parameters for a reaction.
 
static void getEfficiencies (const XML_Node &eff, Kinetics &kin, ReactionData &rdata, const ReactionRules &rules)
 Get the enhanced collision efficiencies.
 
void getRateCoefficient (const XML_Node &kf, Kinetics &kin, ReactionData &rdata, const ReactionRules &rules)
 Read the rate coefficient data from the XML file.
 
doublereal isDuplicateReaction (std::map< int, doublereal > &r1, std::map< int, doublereal > &r2)
 This function returns a ratio if two reactions are duplicates of one another, and 0.0 otherwise.
 
bool installReactionArrays (const XML_Node &p, Kinetics &kin, std::string default_phase, bool check_for_duplicates=false)
 Create a new ThermoPhase object and initializes it according to the XML tree database.
 
bool importKinetics (const XML_Node &phase, std::vector< ThermoPhase * > th, Kinetics *kin)
 Import a reaction mechanism for a phase or an interface.
 
bool buildSolutionFromXML (XML_Node &root, std::string id, std::string nm, ThermoPhase *th, Kinetics *k)
 Build a single-phase ThermoPhase object with associated kinetics mechanism.
 
string reactionLabel (size_t i, size_t kr, size_t nr, const std::vector< size_t > &slist, const Kinetics &s)
 
static doublereal calc_damping (doublereal *x, doublereal *dx, size_t dim, int *)
 
static doublereal calcWeightedNorm (const doublereal[], const doublereal dx[], size_t)
 
static doublereal calc_damping (doublereal x[], doublereal dxneg[], size_t dim, int *label)
 
ostream & operator<< (std::ostream &s, const BandMatrix &m)
 Utility routine to print out the matrix.
 
static void print_line (const char *str, int n)
 
static void print_time_step1 (int order, int n_time_step, double time, double delta_t_n, double delta_t_nm1, bool step_failed, int num_failures)
 
static void print_time_step2 (int time_step_num, int order, double time, double time_error_factor, double delta_t_n, double delta_t_np1)
 
static void print_time_fail (bool convFailure, int time_step_num, double time, double delta_t_n, double delta_t_np1, double time_error_factor)
 
static void print_final (double time, int step_failed, int time_step_num, int num_newt_its, int total_linear_solves, int numConvFails, int numTruncFails, int nfe, int nJacEval)
 
static void print_lvl1_Header (int nTimes)
 
static void print_lvl1_summary (int time_step_num, double time, const char *rslt, double delta_t_n, int newt_its, int aztec_its, int bktr_stps, double time_error_factor, const char *comment)
 
double subtractRD (doublereal a, doublereal b)
 This routine subtracts two numbers for one another.
 
DAE_SolvernewDAE_Solver (std::string itype, ResidJacEval &f)
 Factor method for choosing a DAE solver.
 
int solve (DenseMatrix &A, double *b)
 Solve Ax = b. Array b is overwritten on exit with x.
 
int solve (DenseMatrix &A, DenseMatrix &b)
 Solve Ax = b for multiple right-hand-side vectors.
 
void multiply (const DenseMatrix &A, const double *const b, double *const prod)
 Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.
 
void increment (const DenseMatrix &A, const double *const b, double *const prod)
 Multiply A*b and add it to the result in prod. Uses BLAS routine DGEMV.
 
int invert (DenseMatrix &A, size_t nn=npos)
 invert A. A is overwritten with A^-1.
 
static bool isConstant (Func1 &f)
 
static bool isZero (Func1 &f)
 
static bool isOne (Func1 &f)
 
static bool isTimesConst (Func1 &f)
 
static bool isExp (Func1 &f)
 
static bool isPow (Func1 &f)
 
Func1newSumFunction (Func1 &f1, Func1 &f2)
 
Func1newDiffFunction (Func1 &f1, Func1 &f2)
 
Func1newProdFunction (Func1 &f1, Func1 &f2)
 
Func1newRatioFunction (Func1 &f1, Func1 &f2)
 
Func1newCompositeFunction (Func1 &f1, Func1 &f2)
 
Func1newTimesConstFunction (Func1 &f, doublereal c)
 
Func1newPlusConstFunction (Func1 &f, doublereal c)
 
doublereal linearInterp (doublereal x, const vector_fp &xpts, const vector_fp &fpts)
 Linearly interpolate a function defined on a discrete grid.
 
doublereal polyfit (int n, doublereal *x, doublereal *y, doublereal *w, int maxdeg, int &ndeg, doublereal eps, doublereal *r)
 Fits a polynomial function to a set of data points.
 
static void print_line (const char *str, int n)
 Print a line of a single repeated character string.
 
IntegratornewIntegrator (std::string itype)
 
void deleteIntegrator (Integrator *cv)
 
static void print_funcEval (FILE *fp, doublereal xval, doublereal fval, int its)
 Print out a form for the current function evaluation.
 
static doublereal calcWeightedNorm (const doublereal[], const doublereal dx[], size_t)
 
void drawline ()
 
doublereal bound_step (const doublereal *x, const doublereal *step, Domain1D &r, int loglevel)
 Return a damping coefficient that keeps the solution after taking one Newton step between specified lower and upper bounds.
 
doublereal norm_square (const doublereal *x, const doublereal *step, Domain1D &r)
 This function computes the square of a weighted norm of a step vector for one domain.
 
template<class M >
bool has_key (const M &m, size_t j)
 
static void r_drawline ()
 
static doublereal eps ()
 Return the square root of machine precision.
 
static void sim1D_drawline ()
 
void importSolution (size_t points, doublereal *oldSoln, IdealGasPhase &oldmech, size_t size_new, doublereal *newSoln, IdealGasPhase &newmech)
 Import a previous solution to use as an initial estimate.
 
static void st_drawline ()
 
NucleusHydrogenNucleus ()
 
NucleusDeuteriumNucleus ()
 
NucleusTritiumNucleus ()
 
NucleusHe3Nucleus ()
 
NucleusHe4Nucleus ()
 
NucleusC12nucleus ()
 
NucleusC13nucleus ()
 
NucleusN14nucleus ()
 
NucleusN15nucleus ()
 
NucleusO16nucleus ()
 
NucleusO17nucleus ()
 
NucleusO18nucleus ()
 
NucleusF19nucleus ()
 
static int interp_est (std::string estString)
 Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field.
 
doublereal LookupWtElements (const std::string &ename)
 Function to look up an atomic weight This function looks up the argument string in the database above and returns the associated molecular weight.
 
static double factorOverlap (const std::vector< std::string > &elnamesVN, const std::vector< double > &elemVectorN, const size_t nElementsN, const std::vector< std::string > &elnamesVI, const std::vector< double > &elemVectorI, const size_t nElementsI)
 Return the factor overlap.
 
void installMu0ThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const XML_Node *Mu0Node_ptr)
 Install a Mu0 polynomial thermodynamic reference state.
 
static doublereal JoyceDixon (doublereal r)
 
static void getSpeciesThermoTypes (std::vector< XML_Node * > &spDataNodeList, int &has_nasa, int &has_shomate, int &has_simple, int &has_other)
 Examine the types of species thermo parameterizations, and return a flag indicating the type of reference state thermo manager that will be needed in order to evaluate them all.
 
static void installNasaThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const XML_Node *f0ptr, const XML_Node *f1ptr)
 Install a NASA polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
static doublereal LookupGe (const std::string &elemName, ThermoPhase *th_ptr)
 Look up the elemental reference state entropies.
 
static doublereal convertDGFormation (size_t k, ThermoPhase *th_ptr)
 Convert delta G formulation.
 
static void installMinEQ3asShomateThermoFromXML (std::string speciesName, ThermoPhase *th_ptr, SpeciesThermo &sp, size_t k, const XML_Node *MinEQ3node)
 Install a NASA96 polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
static void installShomateThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const XML_Node *f0ptr, const XML_Node *f1ptr)
 Install a Shomate polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
static void installSimpleThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const XML_Node &f)
 Install a Simple thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
static void installNasa9ThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const std::vector< XML_Node * > &tp)
 Install a NASA9 polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
static void installAdsorbateThermoFromXML (std::string speciesName, SpeciesThermo &sp, size_t k, const XML_Node &f)
 Install a Adsorbate polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.
 
SpeciesThermonewSpeciesThermoMgr (int type, SpeciesThermoFactory *f=0)
 Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.
 
SpeciesThermonewSpeciesThermoMgr (std::string &stype, SpeciesThermoFactory *f=0)
 Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.
 
SpeciesThermonewSpeciesThermoMgr (std::vector< XML_Node * > spDataNodeList, SpeciesThermoFactory *f=0, bool opt=false)
 Function to return SpeciesThermo manager.
 
std::string eosTypeString (int ieos, int length=100)
 Translate the eosType id into a string.
 
ThermoPhasenewPhase (XML_Node &xmlphase)
 
ThermoPhasenewPhase (std::string infile, std::string id)
 Create and Initialize a ThermoPhase object from an XML input file.
 
static void formSpeciesXMLNodeList (std::vector< XML_Node * > &spDataNodeList, std::vector< std::string > &spNamesList, std::vector< int > &spRuleList, const std::vector< XML_Node * > spArray_names, const std::vector< XML_Node * > spArray_dbases, const vector_int sprule)
 Gather a vector of pointers to XML_Nodes for a phase.
 
bool importPhase (XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory=0)
 Import a phase information into an empty thermophase object.
 
bool installSpecies (size_t k, const XML_Node &s, thermo_t &p, SpeciesThermo *spthermo_ptr, int rule, XML_Node *phaseNode_ptr=0, VPSSMgr *vpss_ptr=0, SpeciesThermoFactory *factory=0)
 Install a species into a ThermoPhase object, which defines the phase thermodynamics and speciation.
 
const XML_NodespeciesXML_Node (std::string kname, const XML_Node *phaseSpeciesData)
 Search an XML tree for species data.
 
std::string report (const ThermoPhase &th, const bool show_thermo=true)
 Format a summary of the mixture state for output.
 
static void getVPSSMgrTypes (std::vector< XML_Node * > &spDataNodeList, int &has_nasa_idealGas, int &has_nasa_constVol, int &has_shomate_idealGas, int &has_shomate_constVol, int &has_simple_idealGas, int &has_simple_constVol, int &has_water, int &has_tpx, int &has_hptx, int &has_other)
 Examine the types of species thermo parameterizations, and return a flag indicating the type of parameterization needed by the species.
 
VPSSMgrnewVPSSMgr (VPSSMgr_enumType type, VPStandardStateTP *vp_ptr, VPSSMgrFactory *f=0)
 Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.
 
VPSSMgrnewVPSSMgr (VPStandardStateTP *vp_ptr, XML_Node *phaseNode_ptr, std::vector< XML_Node * > &spDataNodeList, VPSSMgrFactory *f=0)
 Function to return VPSSMgr manager.
 
static void getArrhenius (const XML_Node &node, doublereal &A, doublereal &b, doublereal &E)
 getArrhenius() parses the xml element called Arrhenius.
 
doublereal Frot (doublereal tr, doublereal sqtr)
 
static void err (const std::string r)
 
TransportnewTransportMgr (std::string transportModel="", thermo_t *thermo=0, int loglevel=0, TransportFactory *f=0)
 Create a new transport manager instance.
 
TransportnewDefaultTransportMgr (thermo_t *thermo, int loglevel=0, TransportFactory *f=0)
 Create a new transport manager instance.
 
std::ostream & operator<< (std::ostream &s, const Array2D &m)
 Output the current contents of the Array2D object.
 
void operator*= (Array2D &m, doublereal a)
 Overload the times equals operator for multiplication of a matrix and a scalar.
 
void operator+= (Array2D &x, const Array2D &y)
 Overload the plus equals operator for addition of one matrix with another.
 
template<class V >
doublereal dot4 (const V &x, const V &y)
 Templated Inner product of two vectors of length 4.
 
template<class V >
doublereal dot5 (const V &x, const V &y)
 Templated Inner product of two vectors of length 5.
 
template<class V >
doublereal dot6 (const V &x, const V &y)
 Templated Inner product of two vectors of length 6.
 
template<class InputIter , class InputIter2 >
doublereal dot (InputIter x_begin, InputIter x_end, InputIter2 y_begin)
 Function that calculates a templated inner product.
 
template<class InputIter , class OutputIter , class S >
void scale (InputIter begin, InputIter end, OutputIter out, S scale_factor)
 Multiply elements of an array by a scale factor.
 
template<class InputIter , class OutputIter , class S >
void increment_scale (InputIter begin, InputIter end, OutputIter out, S scale_factor)
 
template<class InputIter , class OutputIter >
void multiply_each (OutputIter x_begin, OutputIter x_end, InputIter y_begin)
 Multiply each entry in x by the corresponding entry in y.
 
template<class InputIter >
void resize_each (int m, InputIter begin, InputIter end)
 Invoke method 'resize' with argument m for a sequence of objects (templated version)
 
template<class InputIter >
doublereal absmax (InputIter begin, InputIter end)
 The maximum absolute value (templated version)
 
template<class InputIter , class OutputIter >
void normalize (InputIter begin, InputIter end, OutputIter out)
 Normalize the values in a sequence, such that they sum to 1.0 (templated version)
 
template<class InputIter , class OutputIter >
void divide_each (OutputIter x_begin, OutputIter x_end, InputIter y_begin)
 Templated divide of each element of x by the corresponding element of y.
 
template<class InputIter , class OutputIter >
void sum_each (OutputIter x_begin, OutputIter x_end, InputIter y_begin)
 Increment each entry in x by the corresponding entry in y.
 
template<class InputIter , class OutputIter , class IndexIter >
void scatter_copy (InputIter begin, InputIter end, OutputIter result, IndexIter index)
 Copies a contiguous range in a sequence to indexed positions in another sequence.
 
template<class InputIter , class RandAccessIter , class IndexIter >
void scatter_mult (InputIter mult_begin, InputIter mult_end, RandAccessIter data, IndexIter index)
 Multiply selected elements in an array by a contiguous sequence of multipliers.
 
template<class InputIter , class OutputIter , class IndexIter >
void scatter_divide (InputIter begin, InputIter end, OutputIter result, IndexIter index)
 Divide selected elements in an array by a contiguous sequence of divisors.
 
template<class InputIter >
doublereal sum_xlogx (InputIter begin, InputIter end)
 Compute

\[ \sum_k x_k \log x_k. \]

.

 
template<class InputIter1 , class InputIter2 >
doublereal sum_xlogQ (InputIter1 begin, InputIter1 end, InputIter2 Q_begin)
 Compute

\[ \sum_k x_k \log Q_k. \]

.

 
template<class OutputIter >
void scale (int N, double alpha, OutputIter x)
 Scale a templated vector by a constant factor.
 
template<class D , class R >
poly6 (D x, R *c)
 Templated evaluation of a polynomial of order 6.
 
template<class D , class R >
poly8 (D x, R *c)
 Templated evaluation of a polynomial of order 8.
 
template<class D , class R >
poly10 (D x, R *c)
 Templated evaluation of a polynomial of order 10.
 
template<class D , class R >
poly5 (D x, R *c)
 Templated evaluation of a polynomial of order 5.
 
template<class D , class R >
poly4 (D x, R *c)
 Evaluates a polynomial of order 4.
 
template<class D , class R >
poly3 (D x, R *c)
 Templated evaluation of a polynomial of order 3.
 
template<class D >
void deepStdVectorPointerCopy (const std::vector< D * > &fromVec, std::vector< D * > &toVec)
 Templated deep copy of a std vector of pointers.
 
template<class T >
void copyn (size_t n, const T &x, T &y)
 Templated function that copies the first n entries from x to y.
 
template<class T >
void divide_each (T &x, const T &y)
 Divide each element of x by the corresponding element of y.
 
template<class T >
void multiply_each (T &x, const T &y)
 Multiply each element of x by the corresponding element of y.
 
template<class T , class S >
void scale (T &x, S scale_factor)
 Multiply each element of x by scale_factor.
 
template<class T >
doublereal dot_product (const T &x, const T &y)
 Return the templated dot product of two objects.
 
template<class T >
doublereal dot_ratio (const T &x, const T &y)
 Returns the templated dot ratio of two objects.
 
template<class T >
void add_each (T &x, const T &y)
 Returns a templated addition operation of two objects.
 
template<class InputIter , class S >
doublereal _dot_ratio (InputIter x_begin, InputIter x_end, InputIter y_begin, S start_value)
 Templated dot ratio class.
 
template<class T >
absmax (const std::vector< T > &v)
 Finds the entry in a vector with maximum absolute value, and return this value.
 
template<class T >
std::ostream & operator<< (std::ostream &os, const std::vector< T > &v)
 Write a vector to a stream.
 
std::ostream & operator<< (std::ostream &s, Cantera::MultiPhase &x)
 Function to output a MultiPhase description to a stream.
 
size_t BasisOptimize (int *usedZeroedSpecies, bool doFormRxn, MultiPhase *mphase, std::vector< size_t > &orderVectorSpecies, std::vector< size_t > &orderVectorElements, vector_fp &formRxnMatrix)
 Choose the optimum basis of species for the equilibrium calculations.
 
size_t ElemRearrange (size_t nComponents, const vector_fp &elementAbundances, MultiPhase *mphase, std::vector< size_t > &orderVectorSpecies, std::vector< size_t > &orderVectorElements)
 This subroutine handles the potential rearrangement of the constraint equations represented by the Formula Matrix.
 
InterfaceimportInterface (std::string infile, std::string id, std::vector< Cantera::ThermoPhase * > phases)
 Import an instance of class Interface from a specification in an input file.
 
KineticsnewKineticsMgr (XML_Node &phase, std::vector< ThermoPhase * > th, KineticsFactory *f=0)
 Create a new kinetics manager.
 
KineticsnewKineticsMgr (std::string model, KineticsFactory *f=0)
 Create a new kinetics manager.
 
Group parseGroupString (std::string str, std::vector< std::string > &esyms)
 
static doublereal ppow (doublereal x, doublereal order)
 
static std::string fmt (std::string r, size_t n)
 
template<class InputIter , class Vec1 , class Vec2 >
static void _multiply (InputIter begin, InputIter end, const Vec1 &input, Vec2 &output)
 
template<class InputIter , class Vec1 , class Vec2 >
static void _incrementSpecies (InputIter begin, InputIter end, const Vec1 &input, Vec2 &output)
 
template<class InputIter , class Vec1 , class Vec2 >
static void _decrementSpecies (InputIter begin, InputIter end, const Vec1 &input, Vec2 &output)
 
template<class InputIter , class Vec1 , class Vec2 >
static void _incrementReactions (InputIter begin, InputIter end, const Vec1 &input, Vec2 &output)
 
template<class InputIter , class Vec1 , class Vec2 >
static void _decrementReactions (InputIter begin, InputIter end, const Vec1 &input, Vec2 &output)
 
template<class InputIter >
static void _writeIncrementSpecies (InputIter begin, InputIter end, std::string r, std::map< size_t, std::string > &out)
 
template<class InputIter >
static void _writeDecrementSpecies (InputIter begin, InputIter end, std::string r, std::map< size_t, std::string > &out)
 
template<class InputIter >
static void _writeIncrementReaction (InputIter begin, InputIter end, std::string r, std::map< size_t, std::string > &out)
 
template<class InputIter >
static void _writeDecrementReaction (InputIter begin, InputIter end, std::string r, std::map< size_t, std::string > &out)
 
template<class InputIter >
static void _writeMultiply (InputIter begin, InputIter end, std::string r, std::map< size_t, std::string > &out)
 
void ct_dgemv (ctlapack::storage_t storage, ctlapack::transpose_t trans, int m, int n, doublereal alpha, const doublereal *a, int lda, const doublereal *x, int incX, doublereal beta, doublereal *y, int incY)
 
void ct_dgbsv (int n, int kl, int ku, int nrhs, doublereal *a, int lda, integer *ipiv, doublereal *b, int ldb, int &info)
 
void ct_dgbtrf (size_t m, size_t n, size_t kl, size_t ku, doublereal *a, size_t lda, integer *ipiv, int &info)
 
void ct_dgbtrs (ctlapack::transpose_t trans, size_t n, size_t kl, size_t ku, size_t nrhs, doublereal *a, size_t lda, integer *ipiv, doublereal *b, size_t ldb, int &info)
 
void ct_dgetrf (size_t m, size_t n, doublereal *a, size_t lda, integer *ipiv, int &info)
 
void ct_dgetrs (ctlapack::transpose_t trans, size_t n, size_t nrhs, doublereal *a, size_t lda, integer *ipiv, doublereal *b, size_t ldb, int &info)
 
void ct_dgetri (int n, doublereal *a, int lda, integer *ipiv, doublereal *work, int lwork, int &info)
 
void ct_dscal (int n, doublereal da, doublereal *dx, int incx)
 
void ct_dgeqrf (size_t m, size_t n, doublereal *a, size_t lda, doublereal *tau, doublereal *work, size_t lwork, int &info)
 
void ct_dormqr (ctlapack::side_t rlside, ctlapack::transpose_t trans, size_t m, size_t n, size_t k, doublereal *a, size_t lda, doublereal *tau, doublereal *c, size_t ldc, doublereal *work, size_t lwork, int &info)
 
void ct_dtrtrs (ctlapack::upperlower_t uplot, ctlapack::transpose_t trans, const char *diag, size_t n, size_t nrhs, doublereal *a, size_t lda, doublereal *b, size_t ldb, int &info)
 
doublereal ct_dtrcon (const char *norm, ctlapack::upperlower_t uplot, const char *diag, size_t n, doublereal *a, size_t lda, doublereal *work, int *iwork, int &info)
 
void ct_dpotrf (ctlapack::upperlower_t uplot, size_t n, doublereal *a, size_t lda, int &info)
 
void ct_dpotrs (ctlapack::upperlower_t uplot, size_t n, size_t nrhs, doublereal *a, size_t lda, doublereal *b, size_t ldb, int &info)
 
doublereal ct_dgecon (const char norm, size_t n, doublereal *a, size_t lda, doublereal anorm, doublereal *work, int *iwork, int &info)
 
doublereal ct_dgbcon (const char norm, size_t n, size_t kl, size_t ku, doublereal *a, size_t ldab, int *ipiv, doublereal anorm, doublereal *work, int *iwork, int &info)
 
doublereal ct_dlange (const char norm, size_t m, size_t n, doublereal *a, size_t lda, doublereal *work)
 
doublereal hz_to_wnum (doublereal freq)
 convert from Hz to wavenmbers
 
doublereal wnum_to_J (doublereal w)
 Convert from wavenumbers to Joules.
 
doublereal J_to_wnum (doublereal e)
 
doublereal wnum_to_eV (doublereal w)
 
doublereal eV_to_wnum (doublereal e)
 
std::ostream & operator<< (std::ostream &s, Cantera::Crystal &x)
 Prints out the current internal state of the Crystal ThermoPhase object.
 
template<class InputIter >
void _updateAll (InputIter begin, InputIter end, doublereal T, vector_fp &cp_R, vector_fp &h_RT, vector_fp &s_R)
 Invokes the 'updateProperties' method of all objects in the list.
 
template<class InputIter >
doublereal _minTemp (InputIter begin, InputIter end)
 Iterates through a list of objects which implement a method 'minTemp()', and returns the largest 'minTemp' value.
 
template<class _InputIter >
doublereal _maxTemp (_InputIter begin, _InputIter end)
 Iterates through a list of objects which implement a method 'maxTemp()', and returns the smallest 'maxTemp' value.
 
ThermoPhasenewThermoPhase (std::string model, ThermoFactory *f=0)
 Create a new thermo manager instance.
 
ReactorBasenewReactor (std::string model, ReactorFactory *f=0)
 

Variables

static mutex_t dir_mutex
 Mutex for input directory access.
 
static mutex_t app_mutex
 Mutex for creating singletons within the application object.
 
static mutex_t xml_mutex
 Mutex for controlling access to XML file storage.
 
static mutex_t msg_mutex
 Mutex for access to string messages.
 
static const char * stars = "***********************************************************************\n"
 
const doublereal TINY = 1.0e-20
 
static int ntypes = 6
 
static string _types [] = {"none", "GasKinetics", "GRI30", "Interface", "Edge", "AqueousKinetics"}
 
static int _itypes [] = {0, cGasKinetics, cGRI30, cInterfaceKinetics, cEdgeKinetics, cAqueousKinetics}
 
const double DampFactor = 4
 Dampfactor is the factor by which the damping factor is reduced by when a reduction in step length is warranted.
 
const int NDAMP = 10
 Number of damping steps that are carried out before the solution is deemed a failure.
 
const string dashedline
 
static struct awData aWTable []
 aWTable is a vector containing the atomic weights database.
 
static double xxSmall = 1.0E-150
 Small value to be used in cutoff expressions with logs.
 
static const double xxSmall = 1.0E-150
 
static const double xxSmall = 1.0E-150
 
static const double xxSmall = 1.0E-150
 
static const double xxSmall = 1.0E-150
 
static const double xxSmall = 1.0E-150
 
static const double xxSmall = 1.0E-150
 
const doublereal JD_const1 = 1.0/sqrt(8.0)
 
const doublereal JD_const2 = 3.0/16.0 - sqrt(3.0)/9.0
 
static int ntypes = 23
 Define the number of ThermoPhase types for use in this factory routine.
 
static string _types []
 Define the string name of the ThermoPhase types that are handled by this factory routine.
 
static int _itypes []
 Define the integer id of the ThermoPhase types that are handled by this factory routine.
 
const doublereal T_c = 647.096
 Critical Temperature value (kelvin)
 
static const doublereal P_c = 22.064E6
 Critical Pressure (Pascals)
 
const doublereal Rho_c = 322.
 Value of the Density at the critical point (kg m-3)
 
static const doublereal M_water = 18.015268
 Molecular Weight of water that is consistent with the paper (kg kmol-1)
 
static const doublereal Rgas = 8.314371E3
 Gas constant that is quoted in the paper.
 
const doublereal Min_C_Internal = 0.001
 Constant to compare dimensionless heat capacities against zero.
 
static int ntypes = 4
 
static string _types []
 
static int _itypes []
 
const doublereal Pi = 3.14159265358979323846
 Pi.
 
const doublereal SqrtPi = std::sqrt(Pi)
 sqrt(Pi)
 
const doublereal OneThird = 1.0/3.0
 1/3
 
const doublereal FiveSixteenths = 5.0/16.0
 5/16
 
const doublereal SqrtTen = std::sqrt(10.0)
 sqrt(10)
 
const doublereal SqrtEight = std::sqrt(8.0)
 sqrt(8)
 
const doublereal SqrtTwo = std::sqrt(2.0)
 sqrt(2)
 
const doublereal SmallNumber = 1.e-300
 smallest number to compare to zero.
 
const doublereal BigNumber = 1.e300
 largest number to compare to inf.
 
const doublereal MaxExp = 690.775527898
 largest x such that exp(x) is valid
 
const doublereal Undef = -999.1234
 Fairly random number to be used to initialize variables against to see if they are subsequently defined.
 
const doublereal Tiny = 1.e-20
 Small number to compare differences of mole fractions against.
 
const size_t npos = static_cast<size_t>(-1)
 index returned by functions to indicate "no position"
 
int ChemEquil_print_lvl = 0
 
const int cGRI_30_Kinetics = cGasKinetics + 1
 
const int NONE = 0
 
const int NO_ERROR = 0
 
const int UNKNOWN_REACTION_TYPE = -100
 
const int UNKNOWN_RATE_COEFF_TYPE = -200
 
const int NOT_YET_IMPLEMENTED = -300
 
const int cDirect = 0
 
const int cKrylov = 1
 
const int FourierFuncType = 1
 
const int PolyFuncType = 2
 
const int ArrheniusFuncType = 3
 
const int GaussianFuncType = 4
 
const int SumFuncType = 20
 
const int DiffFuncType = 25
 
const int ProdFuncType = 30
 
const int RatioFuncType = 40
 
const int PeriodicFuncType = 50
 
const int CompositeFuncType = 60
 
const int TimesConstantFuncType = 70
 
const int PlusConstantFuncType = 80
 
const int SinFuncType = 100
 
const int CosFuncType = 102
 
const int ExpFuncType = 104
 
const int PowFuncType = 106
 
const int ConstFuncType = 110
 
const int DIAG = 1
 
const int DENSE = 2
 
const int NOJAC = 4
 
const int JAC = 8
 
const int GMRES =16
 
const int BAND =32
 
const int c_NONE = 0
 
const int c_GE_ZERO = 1
 
const int c_GT_ZERO = 2
 
const int c_LE_ZERO = -1
 
const int c_LT_ZERO = -2
 
const int cFlowType = 50
 
const int cConnectorType = 100
 
const int cSurfType = 102
 
const int cInletType = 104
 
const int cSymmType = 105
 
const int cOutletType = 106
 
const int cEmptyType = 107
 
const int cOutletResType = 108
 
const int cPorousType = 109
 
const int LeftInlet = 1
 
const int RightInlet = -1
 
const size_t c_offset_U = 0
 
const size_t c_offset_V = 1
 
const size_t c_offset_T = 2
 
const size_t c_offset_L = 3
 
const size_t c_offset_Y = 4
 
const int c_Mixav_Transport = 0
 
const int c_Multi_Transport = 1
 
const int c_Soret = 2
 
const int cEST_solvent = 0
 Electrolyte species type.
 
const int cEST_chargedSpecies = 1
 
const int cEST_weakAcidAssociated = 2
 
const int cEST_strongAcidAssociated = 3
 
const int cEST_polarNeutral = 4
 
const int cEST_nonpolarNeutral = 5
 
const int cHMWSoln0 = 45010
 eosTypes returned for this ThermoPhase Object
 
const int cHMWSoln1 = 45011
 
const int cHMWSoln2 = 45012
 
const int cDebyeHuckel0 = 46010
 eosTypes returned for this ThermoPhase Object
 
const int cDebyeHuckel1 = 46011
 
const int cDebyeHuckel2 = 46012
 
const int cNone = 0
 This generic id is used as the default in virtual base classes that employ id's.
 
const int cNASA = 1
 
const int cShomate = 2
 
const int cNASA96 = 3
 
const int cHarmonicOsc = 4
 
const int cIdealGas = 1
 Equation of state types:
 
const int cIncompressible = 2
 
const int cSurf = 3
 A surface phase. Used by class SurfPhase.
 
const int cMetal = 4
 A metal phase.
 
const int cStoichSubstance = 5
 
const int cSemiconductor = 7
 
const int cMineralEQ3 = 8
 
const int cMetalSHEelectrons = 9
 
const int cLatticeSolid = 20
 
const int cLattice = 21
 
const int cPureFluid = 10
 
const int cEdge = 6
 An edge between two 2D surfaces.
 
const int cFixedChemPot = 70
 Stoichiometric compound with a constant chemical potential.
 
const int cIdealSolidSolnPhase = 5009
 Constant partial molar volume solution IdealSolidSolnPhase.h.
 
const int cHMW = 40
 HMW - Strong electrolyte using the Pitzer formulation.
 
const int cDebyeHuckel = 50
 DebyeHuckel - Weak electrolyte using various Debye-Huckel formulations.
 
const int cIdealMolalSoln = 60
 IdealMolalSoln - molality based solution with molality-based act coeffs of 1.
 
const int cIdealSolnGasVPSS = 500
 
const int cIdealSolnGasVPSS_iscv = 501
 
const int cMixtureFugacityTP = 700
 Fugacity Models.
 
const int cRedlichKwongMFTP = 701
 
const int cMargulesVPSSTP = 301
 
const int cRedlichKisterVPSSTP = 303
 
const int cMolarityIonicVPSSTP = 401
 
const int cMixedSolventElectrolyte = 402
 
const int cPhaseCombo_Interaction = 305
 
const int cIonsFromNeutral = 2000
 
const int cVPSS_IdealGas = 1001
 Variable Pressure Standard State ThermoPhase objects.
 
const int cVPSS_ConstVol = 1002
 
const int cVPSS_PureFluid = 1010
 
const int cVPSS_HMW = 1040
 
const int cVPSS_DebyeHuckel = 1050
 
const int cVPSS_MolalSoln = 1060
 
const int cGasKinetics = 2
 
const int cGRI30 = 3
 
const int cInterfaceKinetics = 4
 
const int cLineKinetics = 5
 
const int cEdgeKinetics = 6
 
const int cSolidKinetics = 7
 
const int cAqueousKinetics = 8
 
const int PHSCALE_PITZER = 0
 Scale to be used for the output of single-ion activity coefficients is that used by Pitzer.
 
const int PHSCALE_NBS = 1
 Scale to be used for evaluation of single-ion activity coefficients is that used by the NBS standard for evaluation of the pH variable.
 
const int cElectron = 0
 
const int cHole = 1
 
const VelocityBasis VB_MASSAVG = -1
 Diffusion velocities are based on the mass averaged velocity.
 
const VelocityBasis VB_MOLEAVG = -2
 Diffusion velocities are based on the mole averaged velocities.
 
const VelocityBasis VB_SPECIES_0 = 0
 Diffusion velocities are based on the relative motion wrt species 0.
 
const VelocityBasis VB_SPECIES_1 = 1
 Diffusion velocities are based on the relative motion wrt species 1.
 
const VelocityBasis VB_SPECIES_2 = 2
 Diffusion velocities are based on the relative motion wrt species 2.
 
const VelocityBasis VB_SPECIES_3 = 3
 Diffusion velocities are based on the relative motion wrt species 3.
 
const int MFC_Type = 1
 
const int PressureController_Type = 2
 
const int Valve_Type = 3
 
const int ReservoirType = 1
 
const int ReactorType = 2
 
const int FlowReactorType = 3
 
const int ConstPressureReactorType = 4
 
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].
 
const doublereal GasConstant = 8314.4621
 Universal Gas Constant. [J/kmol/K].
 
const doublereal logGasConstant = std::log(GasConstant)
 
const doublereal OneAtm = 1.01325e5
 One atmosphere [Pa].
 
const doublereal GasConst_cal_mol_K = GasConstant / 4184.0
 Universal gas constant in cal/mol/K.
 
const doublereal Boltzmann = GasConstant / Avogadro
 Boltzmann's constant [J/K].
 
const doublereal Planck = 6.62607009e-34
 Planck's constant. [J-s].
 
const doublereal Planck_bar = Planck / (2 * Pi)
 
const doublereal logBoltz_Planck = std::log(Boltzmann / Planck)
 log(k/h)
 
const doublereal StefanBoltz = 5.670373e-8
 Stefan-Boltzmann constant.
 
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).
 
const doublereal permeability_0 = 4.0e-7*Pi
 Permeability of free space \( \mu_0 \) in N/A^2.
 
const doublereal epsilon_0 = 1.0 / (lightSpeed*lightSpeed*permeability_0)
 Permittivity of free space \( \epsilon_0 \) in F/m.
 
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
 
Reaction Types
const int ELEMENTARY_RXN = 1
 A reaction with a rate coefficient that depends only on temperature.
 
const int THREE_BODY_RXN = 2
 A reaction that requires a third-body collision partner.
 
const int FALLOFF_RXN = 4
 The general form for an association or dissociation reaction, with a pressure-dependent rate.
 
const int PLOG_RXN = 5
 A pressure-dependent rate expression consisting of several Arrhenius rate expressions evaluated at different pressures.
 
const int CHEBYSHEV_RXN = 6
 A general pressure-dependent reaction where k(T,P) is defined in terms of a bivariate Chebyshev polynomial.
 
const int CHEMACT_RXN = 8
 A chemical activation reaction.
 
const int SURFACE_RXN = 20
 A reaction occurring on a surface.
 
const int EDGE_RXN = 22
 A reaction occurring at a one-dimensional interface between two surface phases.
 
const int GLOBAL_RXN = 30
 A global reaction.
 
Rate Coefficient Types

These types define the supported rate coefficient types for elementary reactions.

Any of these may also be used as the high and low-pressure limits of falloff and chemical activation reactions.

Note that not all of these are currently implemented!

Todo:
Finish implementing reaction rate types.
const int ARRHENIUS_REACTION_RATECOEFF_TYPE = 1
 
const int LANDAUTELLER_REACTION_RATECOEFF_TYPE = 2
 
const int TSTRATE_REACTION_RATECOEFF_TYPE = 3
 
const int SURF_ARRHENIUS_REACTION_RATECOEFF_TYPE = 4
 
const int ARRHENIUS_SUM_REACTION_RATECOEFF_TYPE = 5
 
const int EXCHANGE_CURRENT_REACTION_RATECOEFF_TYPE = 6
 
const int PLOG_REACTION_RATECOEFF_TYPE = 7
 
const int CHEBYSHEV_REACTION_RATECOEFF_TYPE = 8
 
Falloff Function Types
const int SIMPLE_FALLOFF = 100
 
const int TROE3_FALLOFF = 110
 
const int TROE4_FALLOFF = 111
 
const int SRI3_FALLOFF = 112
 
const int SRI5_FALLOFF = 113
 
const int WF_FALLOFF = 114
 
CONSTANTS - Models for the Standard State of IdealSolidSolnPhase's
const int cIdealSolidSolnPhase0 = 5010
 
const int cIdealSolidSolnPhase1 = 5011
 
const int cIdealSolidSolnPhase2 = 5012
 
CONSTANTS - Models for the Standard State of IdealSolnPhase's
const int cIdealSolnGasPhaseG = 6009
 
const int cIdealSolnGasPhase0 = 6010
 
const int cIdealSolnGasPhase1 = 6011
 
const int cIdealSolnGasPhase2 = 6012
 
CONSTANTS - Specification of the Molality convention
const int cAC_CONVENTION_MOLAR = 0
 Standard state uses the molar convention.
 
const int cAC_CONVENTION_MOLALITY = 1
 Standard state uses the molality convention.
 
CONSTANTS - Specification of the SS convention
const int cSS_CONVENTION_TEMPERATURE = 0
 Standard state uses the molar convention.
 
const int cSS_CONVENTION_VPSS = 1
 Standard state uses the molality convention.
 
const int cSS_CONVENTION_SLAVE = 2
 Standard state thermodynamics is obtained from slave ThermoPhase objects.
 
const int LVISC_CONSTANT = 0
 
const int LVISC_WILKES = 1
 
const int LVISC_MIXTUREAVG = 2
 
const int LDIFF_MIXDIFF_UNCORRECTED = 0
 
const int LDIFF_MIXDIFF_FLUXCORRECTED = 1
 
const int LDIFF_MULTICOMP_STEFANMAXWELL = 2
 

Detailed Description

Provides class Nucleus.

Namespace for classes implementing zero-dimensional reactor networks.

Namespace for spectroscopic functions and classes.

Namespace for the Cantera kernel.

Typedef Documentation

typedef std::map<std::string, doublereal> 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.

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 175 of file ct_defs.h.

typedef std::vector<int> vector_int

Vector of ints.

Definition at line 177 of file ct_defs.h.

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

A grouplist is a vector of groups of species.

Definition at line 180 of file ct_defs.h.

typedef for the ThermoPhase class

Definition at line 1670 of file ThermoPhase.h.

Enumeration Type Documentation

enum MethodType

Specifies the method used to integrate the system of equations.

Not all methods are supported by all integrators.

Enumerator:
BDF_Method 

Backward Differentiation.

Adams_Method 

Adams.

Definition at line 32 of file Integrator.h.

enum IterType

Specifies the method used for iteration.

Not all methods are supported by all integrators.

Enumerator:
Newton_Iter 

Newton Iteration.

Functional_Iter 

Functional Iteration.

Definition at line 41 of file Integrator.h.

Differentiates the type of residual evaluations according to functionality.

Enumerator:
Base_ResidEval 

Base residual calculation for the time-stepping function.

JacBase_ResidEval 

Base residual calculation for the Jacobian calculation.

JacDelta_ResidEval 

Delta residual calculation for the Jacbobian calculation.

Base_ShowSolution 

Base residual calculation for the showSolution routine.

We calculate this when we want to display a solution

Base_LaggedSolutionComponents 

Base residual calculation containing any lagged components.

We use this to calculate residuals when doing line searches along directions determined by Jacobians that are missing contributions from lagged entries.

Definition at line 24 of file ResidJacEval.h.

enums for molten salt ion solution types

Types identify how complicated the solution is. If there is just mixing on one of the sublattices but not the other, then the math is considerably simpler.

Definition at line 33 of file IonsFromNeutralVPSSTP.h.

Types of general formulations for the specification of the standard state volume.

Enumerator:
cSSVOLUME_CONSTANT 

This approximation is for a constant volume.

cSSVOLUME_TPOLY 

This approximation is for a species with a quadratic polynomial in temperature.

V^ss_i = ai + bi T + ci T2

cSSVOLUME_DENSITY_TPOLY 

This approximation is for a species where the density is expressed as a quadratic polynomial in temperature.

V^ss_i = M_i / (ai + bi T + ci T2)

Definition at line 101 of file mix_defs.h.

Types of PDSS's.

Definition at line 118 of file mix_defs.h.

enum for VPSSMgr types

Definition at line 131 of file mix_defs.h.

Composition dependence type for liquid mixture transport properties.

Types of temperature dependencies:

  • 0 - Mixture calculations with this property are not allowed
  • 1 - Use solvent (species 0) properties
  • 2 - Properties weighted linearly by mole fractions
  • 3 - Properties weighted linearly by mass fractions
  • 4 - Properties weighted logarithmically by mole fractions (interaction energy weighting)
  • 5 - Interactions given pairwise between each possible species (i.e. D_ij)

    *    <transport model="Liquid">
    *       <viscosity>
    *          <compositionDependence model="logMoleFractions">
    *             <interaction>
    *                <speciesA> LiCl(L) </speciesA>
    *                <speciesB> KCl(L)  </speciesB>
    *                <Eij units="J/kmol"> -1.0 </Eij>
    *                <Sij units="J/kmol/K"> 1.0E-1 </Sij>
    *     -or-       <Sij>
    *                  <floatArray units="J/kmol/K"> 1.0E-1, 0.001 0.01 </floatArray>
    *                </Sij>
    *     -same form for Hij,Aij,Bij-
    *             </interaction>
    *          </compositionDependence>
    *       </viscosity>
    *       <speciesDiffusivity>
    *          <compositionDependence model="pairwiseInteraction">
    *             <interaction>
    *                <speciesA> Li+ </speciesA>
    *                <speciesB> K+  </speciesB>
    *                <Dij units="m2/s"> 1.5 </Dij>
    *             </interaction>
    *             <interaction>
    *                <speciesA> K+  </speciesA>
    *                <speciesB> Cl- </speciesB>
    *                <Dij units="m2/s"> 1.0 </Dij>
    *             </interaction>
    *             <interaction>
    *                <speciesA> Li+  </speciesA>
    *                <speciesB> Cl-  </speciesB>
    *                <Dij units="m2/s"> 1.2 </Dij>
    *             </interaction>
    *          </compositionDependence>
    *       </speciesDiffusivity>
    *       <thermalConductivity>
    *          <compositionDependence model="massFractions"/>
    *       </thermalConductivity>
    *       <hydrodynamicRadius>
    *          <compositionDependence model="none"/>
    *       </hydrodynamicRadius>
    *    </transport>
    *   

Definition at line 75 of file LiquidTranInteraction.h.

Enumeration of the types of transport properties that can be handled by the variables in the various Transport classes.

Not all of these are handled by each class and each class should handle exceptions where the transport property is not handled.

Transport properties currently on the list

0 - viscosity 1 - Ionic conductivity 2 - Mobility Ratio 3 - Self Diffusion coefficient 4 - Thermal conductivity 5 - species diffusivity 6 - hydrodynamic radius 7 - electrical conductivity

Definition at line 39 of file LTPspecies.h.

Temperature dependence type for pure (liquid) species properties.

Types of temperature dependencies: 0 - Independent of temperature 1 - extended arrhenius form 2 - polynomial in temperature form 3 - exponential temperature polynomial

Definition at line 60 of file LTPspecies.h.

Transport solve options.

Deprecated:
GMRES option is unimplemented.
Enumerator:
TRANSOLVE_GMRES 

Solve the dense matrix via a gmres iteration.

TRANSOLVE_LU 

Solve the dense matrix via an LU gauss elimination.

Definition at line 25 of file MultiTransport.h.

Function Documentation

static Application* Cantera::app ( )
static
void writelogendl ( )

Write an end of line character to the screen and flush output.

Some implementations differentiate between
and endl in terms of when the output is flushed.

Definition at line 61 of file global.cpp.

References app(), writelogendl(), and Application::writelogendl().

Referenced by writelogendl().

void appdelete ( )

Delete and free all memory associated with the application.

Delete all global data. It should be called at the end of the application if leak checking is to be done.

Definition at line 122 of file global.cpp.

References appdelete().

Referenced by appdelete().

void thread_complete ( )

Delete and free memory allocated per thread in multithreaded applications.

Delete the memory allocated per thread by Cantera. It should be called from within the thread just before the thread terminates. If your version of Cantera has not been specifically compiled for thread safety this function does nothing.

Definition at line 129 of file global.cpp.

References app(), thread_complete(), and Application::thread_complete().

Referenced by thread_complete().

XML_Node * get_XML_File ( std::string  file,
int  debug = 0 
)

Return a pointer to the XML tree for a Cantera input file.

This routine will find the file and read the XML file into an XML tree structure. Then, a pointer will be returned. If the file has already been processed, then just the pointer will be returned.

Parameters
fileString containing the relative or absolute file name
debugDebug flag

Definition at line 134 of file global.cpp.

References app(), get_XML_File(), and Application::get_XML_File().

Referenced by Elements::addElementsFromXML(), Phase::addElementsFromXML(), electrodeElectron::electrodeElectron(), FixedChemPotSSTP::FixedChemPotSSTP(), get_XML_File(), get_XML_NameID(), get_XML_Node(), Interface::Interface(), MetalSHEelectrons::MetalSHEelectrons(), MineralEQ3::MineralEQ3(), newPhase(), RedlichKwongMFTP::RedlichKwongMFTP(), StoichSubstanceSSTP::StoichSubstanceSSTP(), and SurfPhase::SurfPhase().

void close_XML_File ( std::string  file)

Close a Cantera input file.

Parameters
fileString containing the relative or absolute file name

Definition at line 141 of file global.cpp.

References app(), close_XML_File(), and Application::close_XML_File().

Referenced by close_XML_File().

doublereal toSI ( std::string  unit)

Return the conversion factor to convert unit std::string 'unit' to SI units.

Parameters
unitString containing the units

Definition at line 186 of file global.cpp.

References toSI().

Referenced by ctml::getFloatArray(), ctml::getFloatCurrent(), ctml::getFloatDefaultUnits(), ctml::getFloats(), ctml::getMatrixValues(), MineralEQ3::initThermoXML(), DebyeHuckel::initThermoXML(), HMWSoln::initThermoXML(), strSItoDbl(), and toSI().

doublereal actEnergyToSI ( std::string  unit)

Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin.

Parameters
unitString containing the activation energy units

Definition at line 197 of file global.cpp.

References actEnergyToSI().

Referenced by actEnergyToSI(), ctml::getFloatArray(), ctml::getFloatCurrent(), and ctml::getFloatDefaultUnits().

static void Cantera::split_at_pound ( const std::string &  src,
std::string &  file,
std::string &  id 
)
static

split a string at a '#' sign. Used to separate a file name from an id string.

Parameters
srcOriginal string to be split up. This is unchanged.
fileOutput string representing the first part of the string, which is the filename.
idOutput string representing the last part of the string, which is the id.

Definition at line 227 of file global.cpp.

References npos, and split_at_pound().

Referenced by get_XML_NameID(), get_XML_Node(), and split_at_pound().

XML_Node * get_XML_Node ( const std::string &  file_ID,
XML_Node *  root 
)

This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string.

Searches are based on the ID attribute of the XML element only.

Parameters
file_IDThis is a concatenation of two strings separated by the "#" character. The string before the pound character is the file name of an xml file to carry out the search. The string after the # character is the ID attribute of the xml element to search for. The string is interpreted as a file string if no # character is in the string.
rootIf the file string is empty, searches for the xml element with matching ID attribute are carried out from this XML node.
Returns
Returns the XML_Node, if found. Returns null if not found.

Definition at line 239 of file global.cpp.

References XML_Node::findID(), get_XML_File(), get_XML_Node(), and split_at_pound().

Referenced by IonsFromNeutralVPSSTP::constructPhaseXML(), get_XML_Node(), importPhase(), installReactionArrays(), and Interface::Interface().

XML_Node * get_XML_NameID ( const std::string &  nameTarget,
const std::string &  file_ID,
XML_Node *  root 
)

This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string.

Searches are based on the XML element name and the ID attribute of the XML element. An exact match of both is usually required. However, the ID attribute may be set to "", in which case the first xml element with the correct element name will be returned.

Parameters
nameTargetThis is the XML element name to look for.
file_IDThis is a concatenation of two strings separated by the "#" character. The string before the pound character is the file name of an xml file to carry out the search. The string after the # character is the ID attribute of the xml element to search for. The string is interpreted as a file string if no # character is in the string.
rootIf the file string is empty, searches for the xml element with matching ID attribute are carried out from this XML node.
Returns
Returns the XML_Node, if found. Returns null if not found.

Definition at line 261 of file global.cpp.

References XML_Node::findNameID(), get_XML_File(), get_XML_NameID(), and split_at_pound().

Referenced by buildSolutionFromXML(), PDSS_ConstVol::constructPDSSFile(), PDSS_HKFT::constructPDSSFile(), PDSS_IonsFromNeutral::constructPDSSFile(), PDSS_SSVol::constructPDSSFile(), electrodeElectron::electrodeElectron(), FixedChemPotSSTP::FixedChemPotSSTP(), get_XML_NameID(), VPSSMgr_ConstVol::initThermoXML(), VPSSMgr_Water_ConstVol::initThermoXML(), VPSSMgr_Water_HKFT::initThermoXML(), IdealMolalSoln::initThermoXML(), LatticePhase::initThermoXML(), IdealSolidSolnPhase::initThermoXML(), DebyeHuckel::initThermoXML(), HMWSoln::initThermoXML(), MetalSHEelectrons::MetalSHEelectrons(), MineralEQ3::MineralEQ3(), newPhase(), RedlichKwongMFTP::RedlichKwongMFTP(), StoichSubstanceSSTP::StoichSubstanceSSTP(), and SurfPhase::SurfPhase().

void writePlotFile ( const std::string &  fname,
const std::string &  fmt,
const std::string &  plotTitle,
const std::vector< std::string > &  names,
const Array2D &  data 
)

Write a Plotting file.

Parameters
fnameOutput file name
fmtEither TEC or XL or CSV
plotTitleTitle of the plot
namesvector of variable names
dataN x M data array. data(n,m) is the m^th value of the n^th variable.

Definition at line 22 of file plots.cpp.

References outputExcel(), and outputTEC().

void outputTEC ( std::ostream &  s,
const std::string &  title,
const std::vector< std::string > &  names,
const Array2D &  data 
)

Write a Tecplot data file.

Parameters
soutput stream
titleplot title
namesvector of variable names
dataN x M data array. data(n,m) is the m^th value of the n^th variable.

Definition at line 54 of file plots.cpp.

References Array2D::nColumns(), and Array2D::nRows().

Referenced by writePlotFile().

void outputExcel ( std::ostream &  s,
const std::string &  title,
const std::vector< std::string > &  names,
const Array2D &  data 
)

Write an Excel spreadsheet in 'csv' form.

Parameters
soutput stream
titleplot title
namesvector of variable names
dataN x M data array. data(n,m) is the m^th value of the n^th variable.

Definition at line 91 of file plots.cpp.

References Array2D::nColumns(), and Array2D::nRows().

Referenced by writePlotFile().

std::string fp2str ( const double  x,
const std::string &  fmt 
)

Convert a double into a c++ string.

This routine doesn't assume a formatting. You must supply the formatting

Parameters
xdouble to be converted
fmtFormat to be used (printf style)

Definition at line 42 of file stringUtils.cpp.

Referenced by XML_Node::addAttribute(), ctml::addFloatArray(), Application::Messages::addLogEntry(), XML_Node::addValue(), InterfaceKinetics::applyButlerVolmerCorrection(), IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions(), NasaThermo::checkContinuity(), GibbsExcessVPSSTP::checkMFSum(), checkRxnElementBalance(), coeffString(), WaterProps::coeffThermalExp_IAPWS(), WaterPropsIAPWS::corr(), MixtureFugacityTP::corr0(), WaterPropsIAPWS::corr1(), WaterSSTP::dthermalExpansionCoeffdT(), PDSS_Water::dthermalExpansionCoeffdT(), ChemEquil::equilibrate(), MultiPhase::equilibrate(), vcs_MultiPhaseEquil::equilibrate_HP(), vcs_MultiPhaseEquil::equilibrate_SP(), vcs_MultiPhaseEquil::equilibrate_TV(), ChemEquil::equilResidual(), FixedChemPotSSTP::FixedChemPotSSTP(), getFalloff(), ctml::getFloatArray(), SRI3::init(), SRI5::init(), ChemEquil::initialize(), PDSS_HKFT::initThermo(), SimpleThermo::install(), NasaThermo::install(), ShomateThermo::install(), installMinEQ3asShomateThermoFromXML(), WaterProps::isothermalCompressibility_IAPWS(), Sim1D::refine(), PDSS_Water::setPressure(), SingleSpeciesTP::setState_HP(), ThermoPhase::setState_HPorUV(), SingleSpeciesTP::setState_SP(), ThermoPhase::setState_SPorSV(), SingleSpeciesTP::setState_SV(), SingleSpeciesTP::setState_UV(), RootFind::solve(), MultiPhaseEquil::stepComposition(), ChemEquil::update(), MixTransport::update_T(), AqueousTransport::update_T(), SimpleTransport::update_T(), LiquidTransport::update_T(), and VCS_SOLVE::vcs_nondim_TP().

std::string fp2str ( const double  x)

Convert a double into a c++ string.

The default format to use is equivalent to the default format used by printf's g formatting.

Parameters
xdouble to be converted

Definition at line 52 of file stringUtils.cpp.

std::string int2str ( const int  n,
const std::string &  fmt 
)

Convert an int to a string using a format converter.

Parameters
nint to be converted
fmtformat converter for an int int the printf command

Definition at line 66 of file stringUtils.cpp.

Referenced by ctml::addIntegerArray(), Application::Messages::addLogEntry(), InterfaceKinetics::applyButlerVolmerCorrection(), NonlinearSolver::beuler_jac(), bound_step(), NonlinearSolver::boundStep(), Domain1D::componentName(), MultiNewton::dampStep(), NonlinearSolver::deltaBoundStep(), WaterPropsIAPWS::density(), WaterPropsIAPWS::density_const(), NonlinearSolver::doAffineNewtonSolve(), Elements::elementName(), ChemEquil::equilibrate(), MultiPhase::equilibrate(), vcs_MultiPhaseEquil::equilibrate_HP(), vcs_MultiPhaseEquil::equilibrate_SP(), vcs_MultiPhaseEquil::equilibrate_TV(), PseudoBinaryVPSSTP::err(), MolarityIonicVPSSTP::err(), GibbsExcessVPSSTP::err(), VPStandardStateTP::err(), IonsFromNeutralVPSSTP::err(), SingleSpeciesTP::err(), RedlichKisterVPSSTP::err(), SimpleTransport::err(), PhaseCombo_Interaction::err(), MargulesVPSSTP::err(), MixedSolventElectrolyte::err(), Transport::err(), MolalityVPSSTP::err(), MixtureFugacityTP::err(), LiquidTransport::err(), ThermoPhase::err(), SquareMatrix::factor(), SquareMatrix::factorQR(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), XML_Node::findNameIDIndex(), getEfficiencies(), getFalloff(), MultiTransport::getMassFluxes(), MultiTransport::getMultiDiffCoeffs(), getRateCoefficient(), importPhase(), importSolution(), Phase::init(), Rate1< ChebyshevRate >::install(), GeneralSpeciesThermo::install(), GeneralSpeciesThermo::install_STIT(), rxninfo::installReaction(), LatticeSolidPhase::installSlavePhases(), CVodeInt::integrate(), invert(), Sim1D::newtonSolve(), VPSSMgrFactory::newVPSSMgr(), polyfit(), NonlinearSolver::print_solnDelta_norm_contrib(), HMWSoln::printCoeffs(), solveProb::printFinal(), solveSP::printFinal(), solveProb::printIteration(), solveSP::printIteration(), WaterPropsIAPWS::psat(), SquareMatrix::rcond(), BandMatrix::rcond(), SquareMatrix::rcondQR(), NonlinearSolver::residErrorNorm(), Domain1D::setBounds(), MolalityVPSSTP::setpHScale(), Domain1D::setTolerances(), NonlinearSolver::solnErrorNorm(), MultiNewton::solve(), SquareMatrix::solve(), solve(), SquareMatrix::solveQR(), solveSP::solveSurfProb(), Kinetics::speciesPhaseIndex(), MultiNewton::step(), CVodeInt::step(), UnknownThermoParam::UnknownThermoParam(), UnknownVPSSMgr::UnknownVPSSMgr(), InterfaceKinetics::updateKc(), DustyGasTransport::updateMultiDiffCoeffs(), Sim1D::value(), vcs_determine_PhaseStability(), vcs_equilibrate_1(), VCS_SOLVE::vcs_printSpeciesChemPot(), Application::Messages::write_logfile(), OneDim::writeStats(), and XML_Error::XML_Error().

std::string int2str ( const int  n)

Convert an int to a string.

Parameters
nint to be converted

Definition at line 81 of file stringUtils.cpp.

std::string int2str ( const size_t  n)

Convert an unsigned integer to a string.

Parameters
nint to be converted

Definition at line 96 of file stringUtils.cpp.

std::string lowercase ( const std::string &  s)

Cast a copy of a string to lower case.

Parameters
sInput string
Returns
Returns a copy of the string, with all characters lowercase.

Definition at line 103 of file stringUtils.cpp.

Referenced by PDSS_HKFT::constructPDSSXML(), PDSS_IonsFromNeutral::constructPDSSXML(), MolarityIonicVPSSTP::constructPhaseXML(), RedlichKisterVPSSTP::constructPhaseXML(), MargulesVPSSTP::constructPhaseXML(), MixedSolventElectrolyte::constructPhaseXML(), PhaseCombo_Interaction::constructPhaseXML(), IonsFromNeutralVPSSTP::constructPhaseXML(), IdealSolidSolnPhase::constructPhaseXML(), HMWSoln::constructPhaseXML(), LiquidTranInteraction::init(), SimpleTransport::initLiquid(), VPSSMgr_Water_HKFT::initThermoXML(), IdealSolnGasVPSS::initThermoXML(), MolarityIonicVPSSTP::initThermoXML(), RedlichKwongMFTP::initThermoXML(), PhaseCombo_Interaction::initThermoXML(), RedlichKisterVPSSTP::initThermoXML(), MargulesVPSSTP::initThermoXML(), MixedSolventElectrolyte::initThermoXML(), LatticePhase::initThermoXML(), IdealSolidSolnPhase::initThermoXML(), DebyeHuckel::initThermoXML(), HMWSoln::initThermoXML(), interp_est(), HMWSoln::interp_est(), TransportFactory::newLTP(), SpeciesThermoFactory::newSpeciesThermoManager(), HMWSoln::readXMLBinarySalt(), PhaseCombo_Interaction::readXMLBinarySpecies(), RedlichKisterVPSSTP::readXMLBinarySpecies(), MargulesVPSSTP::readXMLBinarySpecies(), MixedSolventElectrolyte::readXMLBinarySpecies(), RedlichKwongMFTP::readXMLCrossFluid(), HMWSoln::readXMLLambdaNeutral(), HMWSoln::readXMLMunnnNeutral(), HMWSoln::readXMLPsiCommonAnion(), HMWSoln::readXMLPsiCommonCation(), RedlichKwongMFTP::readXMLPureFluid(), HMWSoln::readXMLThetaAnion(), HMWSoln::readXMLThetaCation(), HMWSoln::readXMLZetaCation(), and VPSSMgrFactory::VPSSMgr_StringConversion().

static int Cantera::firstChar ( const std::string &  s)
static

Return the position of the first printable character in the string.

Parameters
sinput string
Returns
Returns an int representing the first printable string. If none returns the size of the string.

Definition at line 121 of file stringUtils.cpp.

Referenced by stripws().

static int Cantera::lastChar ( const std::string &  s)
static

Return the position of the last printable character in the string.

Parameters
sinput string
Returns
Returns an int representing the first printable string. If none returns -1.

Definition at line 141 of file stringUtils.cpp.

Referenced by stripws().

std::string stripws ( const std::string &  s)

Strip the leading and trailing white space from a string.

The command isprint() is used to determine printable characters.

Parameters
sInput string
Returns
Returns a copy of the string, stripped of leading and trailing white space

Definition at line 162 of file stringUtils.cpp.

References firstChar(), and lastChar().

Referenced by Elements::addUniqueElement(), Phase::addUniqueElement(), XML_Node::addValue(), ctml::ct2ctml(), ctml::fpValue(), fpValue(), fpValueCheck(), intValue(), parseCompString(), parseSpeciesName(), XML_Reader::parseTag(), ctml::pypath(), and XML_Reader::readValue().

std::string stripnonprint ( const std::string &  s)

Strip non-printing characters wherever they are.

Parameters
sInput string
Returns
Returns a copy of the string, stripped of all non-printing characters.

Definition at line 175 of file stringUtils.cpp.

Referenced by Application::addDataDirectory().

void parseCompString ( const std::string &  ss,
Cantera::compositionMap x 
)

Parse a composition string into a map consisting of individual key:composition pairs.

The composition is a double. Example

Input is

"fire:0 ice:1 snow:2"

Output is x["fire"] = 0 x["ice"] = 1 x["snow"] = 2

Parameters
ssoriginal string consisting of multiple key:composition pairs on multiple lines
xOutput map consisting of a composition map, which is a string to double map

Definition at line 208 of file stringUtils.cpp.

References npos, and stripws().

Referenced by SurfPhase::setCoveragesByName(), Phase::setMassFractionsByName(), MolalityVPSSTP::setMolalitiesByName(), Phase::setMoleFractionsByName(), MultiPhase::setMolesByName(), ThermoPhase::setState_TPX(), and ThermoPhase::setState_TPY().

void split ( const std::string &  ss,
std::vector< std::string > &  w 
)

Parse a composition string into individual key:composition pairs.

Parameters
ssoriginal string consisting of multiple key:composition pairs on multiple lines
wOutput vector consisting of single key:composition items in each index.

Definition at line 251 of file stringUtils.cpp.

References npos.

int fillArrayFromString ( const std::string &  str,
doublereal *const  a,
const char  delim = ' ' 
)

Interpret a string as a list of floats, and convert it to a vector of floats.

Parameters
strString input vector
aOutput pointer to a vector of floats
delimcharacter delimiter. Defaults to a space
Returns
Returns the number of floats found and converted

Definition at line 272 of file stringUtils.cpp.

References atofCheck().

std::string getBaseName ( const std::string &  fullPath)

Get the file name without the path or extension.

Parameters
fullPathInput file name consisting of the full file name
Returns
Returns the basename

Definition at line 301 of file stringUtils.cpp.

Referenced by ctml::get_CTML_Tree(), and logfileName().

int intValue ( std::string  val)

Translate a string into one integer value.

No error checking is done on the conversion. The c stdlib function atoi() is used.

Parameters
valString value of the integer
Returns
Returns an integer

Definition at line 318 of file stringUtils.cpp.

References stripws().

Referenced by importPhase(), and Sim1D::restore().

doublereal fpValue ( std::string  val)

Translate a string into one doublereal value.

No error checking is done on the conversion. The c stdlib function atof() is used.

Parameters
valString value of the double
Returns
Returns a doublereal value

Definition at line 323 of file stringUtils.cpp.

References stripws().

Referenced by getEfficiencies(), getFalloff(), getRateCoefficient(), getReagents(), DebyeHuckel::initThermoXML(), and installMu0ThermoFromXML().

doublereal fpValueCheck ( std::string  val)

Translate a string into one doublereal value.

Error checking is carried on the conversion.

Parameters
valString value of the double
Returns
Returns a doublereal value

Definition at line 328 of file stringUtils.cpp.

References atofCheck(), and stripws().

Referenced by PDSS_IonsFromNeutral::constructPDSSXML(), and LatticeSolidPhase::setParametersFromXML().

std::string logfileName ( const std::string &  infile)

Generate a logfile name based on an input file name.

It tries to find the basename. Then, it appends a .log to it.

Parameters
infileInput file name
Returns
Returns a logfile name

Definition at line 342 of file stringUtils.cpp.

References getBaseName().

std::string wrapString ( const std::string &  s,
const int  len = 70 
)

Line wrap a string via a copy operation.

Parameters
sInput string to be line wrapped
lenLength at which to wrap. The default is 70.

Definition at line 355 of file stringUtils.cpp.

std::string parseSpeciesName ( const std::string &  nameStr,
std::string &  phaseName 
)

Parse a name string, separating out the phase name from the species name.

Name strings must not contain these internal characters "; \n \t ," Only one colon is allowed, the one separating the phase name from the species name. Therefore, names may not include a colon.

Parameters
nameStr(input) Name string containing the phase name and the species name separated by a colon. The phase name is optional. example: "silane:SiH4"
phaseName(output) Name of the phase, if specified. If not specified, a blank string is returned.
Returns
(output) Species name is returned. If nameStr is blank an empty string is returned.

Definition at line 388 of file stringUtils.cpp.

References npos, and stripws().

Referenced by Phase::speciesIndex().

int stripLTWScstring ( char  str[])

Routine strips off white space from a c character string.

This routine strips off blanks and tabs (only leading and trailing
characters) in 'str'.  On return, it returns the number of
characters still included in the string (excluding the null character).

 Comments are excluded -> All instances of the comment character, '!',
                          are replaced by NULL character thereby terminating
                          the string

Parameter list:
Parameters
strOn output 'str' contains the same characters as on input except the leading and trailing white space and comments have been removed.

Definition at line 430 of file stringUtils.cpp.

Referenced by atofCheck().

doublereal atofCheck ( const char *const  dptr)

Translate a char string into a single double.

atofCheck is a wrapper around the C stdlib routine atof(). It does quite a bit more error checking than atof() or strtod(), and is quite a bit more restrictive.

First it interprets both E, e, d, and D as exponents. atof() only interprets e or E as an exponent character.

It only accepts a string as well formed if it consists as a single token. Multiple words will produce an error message

It will produce an error for NAN and inf entries as well, in contrast to atof() or strtod(). The user needs to know that a serious numerical issue has occurred.

It does not accept hexadecimal numbers.

Parameters
dptrpointer to the input c string
Returns
Returns the double

On any error, it will throw a CanteraError signal.

Definition at line 494 of file stringUtils.cpp.

References stripLTWScstring().

Referenced by Elements::addUniqueElement(), Phase::addUniqueElement(), PDSS_HKFT::constructPDSSXML(), HMWSoln::constructPhaseXML(), fillArrayFromString(), XML_Node::fp_value(), fpValueCheck(), ctml::getFloatArray(), ctml::getMatrixValues(), installSpecies(), HMWSoln::readXMLBinarySalt(), HMWSoln::readXMLPsiCommonAnion(), HMWSoln::readXMLPsiCommonCation(), and strSItoDbl().

doublereal strSItoDbl ( const std::string &  strSI)

Interpret one or two token string as a single double.

This is similar to atof(). However, the second token is interpreted as an MKS units string and a conversion factor to MKS is applied.

Example " 1.0 atm"

results in the number 1.01325e5

Parameters
strSIstring to be converted. One or two tokens
Returns
returns a converted double

Definition at line 562 of file stringUtils.cpp.

References atofCheck(), tokenizeString(), and toSI().

Referenced by PDSS_HKFT::constructPDSSXML(), and installMinEQ3asShomateThermoFromXML().

static std::string::size_type Cantera::findFirstWS ( const std::string &  val)
static

Find the first white space in a string.

Returns the location of the first white space character in a string

Parameters
valInput string to be parsed
Returns
In a size_type variable, return the location of the first white space character. Return npos if none is found

Definition at line 586 of file stringUtils.cpp.

References npos.

Referenced by tokenizeString().

static std::string::size_type Cantera::findFirstNotOfWS ( const std::string &  val)
static

Find the first non-white space in a string.

Returns the location of the first non-white space character in a string

Parameters
valInput string to be parsed
Returns
In a size_type variable, return the location of the first nonwhite space character. Return npos if none is found

Definition at line 611 of file stringUtils.cpp.

References npos.

Referenced by tokenizeString().

void tokenizeString ( const std::string &  oval,
std::vector< std::string > &  v 
)

This function separates a string up into tokens according to the location of white space.

White space includes the new line character. tokens are stripped of leading and trailing white space.

The separate tokens are returned in a string vector, v.

Parameters
ovalString to be broken up
vOutput vector of tokens.

Definition at line 636 of file stringUtils.cpp.

References findFirstNotOfWS(), findFirstWS(), and npos.

Referenced by ctml::getStringArray(), and strSItoDbl().

static string::size_type Cantera::findUnbackslashed ( std::string  s,
const char  q,
std::string::size_type  istart = 0 
)
static

Find the first position of a character, q, in string, s, which is not immediately preceded by the backslash character.

Parameters
sInput string
qSearch for this character
istartDefaults to 0

Definition at line 231 of file xml.cpp.

References npos.

Referenced by XML_Reader::findQuotedString().

XML_Node * findXMLPhase ( XML_Node *  root,
const std::string &  phaseName 
)
int _equilflag ( const char *  xy)

map property strings to integers

Definition at line 37 of file ChemEquil.cpp.

Referenced by equilibrate(), ChemEquil::equilibrate(), and vcs_equilibrate().

static string Cantera::coeffString ( bool  first,
doublereal  nu,
string  sym 
)
static

Used to print reaction equations.

Given a stoichiometric coefficient 'nu' and a chemical symbol 'sym', return a string for this species in the reaction.

Parameters
firstif this is false, then a " + " string will be added to the beginning of the string.
nuStoichiometric coefficient. May be positive or negative. The absolute value will be used in the string.
symSpecies chemical symbol.

Definition at line 31 of file MultiPhaseEquil.cpp.

References fp2str().

Referenced by MultiPhaseEquil::reactionString().

int vcs_determine_PhaseStability ( MultiPhase &  s,
int  iphase,
double &  funcStab,
int  printLvl,
int  loglevel 
)

Determine the phase stability of a single phase given the current conditions in a MultiPhase object.

Parameters
sThe MultiPhase object to be set to an equilibrium state
iphasePhase index within the multiphase object to be tested for stability.
funcStabFunction value that tests equilibrium. > 0 indicates stable < 0 indicates unstable
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing).
loglevelControls amount of diagnostic output. loglevel = 0 suppresses diagnostics, and increasingly-verbose messages are written as loglevel increases. The messages are written to a file in HTML format for viewing in a web browser.
See Also
Writing HTML Logfiles

Definition at line 404 of file vcs_equilibrate.cpp.

References addLogEntry(), beginLogGroup(), vcs_MultiPhaseEquil::determine_PhaseStability(), endLogGroup(), MultiPhase::init(), int2str(), lastErrorMessage(), ckr::max(), and vcs_MultiPhaseEquil::reportCSV().

bool getReagents ( const XML_Node &  rxn,
Kinetics &  kin,
int  rp,
std::string  default_phase,
std::vector< size_t > &  spnum,
vector_fp &  stoich,
vector_fp &  order,
const ReactionRules &  rules 
)

Get the reactants or products of a reaction.

The information is returned in the spnum, stoich, and order vectors. The length of the vectors is the number of different types of reactants or products found for the reaction.

Input

rxn -> xml node pointing to the reaction element in the xml tree. kin -> Reference to the kinetics object to install the information into. rp = 1 -> Go get the reactants for a reaction -1 -> Go get the products for a reaction default_phase = String name for the default phase to loop up species in.

Output

spnum = vector of species numbers found. Length is number of reactants or products. stoich = stoichiometric coefficient of the reactant or product Length is number of reactants or products. order = Order of the reactant and product in the reaction rate expression rules = If we fail to find a species, we will throw an error if rule != 1. If rule = 1, we simply return false, allowing the calling routine to skip this reaction and continue.

The information is returned in the spnum, stoich, and order vectors. The length of the vectors is the number of different types of reactants or products found for the reaction.

Input

rxn -> xml node pointing to the reaction element in the xml tree. kin -> Reference to the kinetics object to install the information into. rp = 1 -> Go get the reactants for a reaction -1 -> Go get the products for a reaction default_phase = String name for the default phase to loop up species in.

Output

spnum = vector of species numbers found. Length is number of reactants or products. stoich = stoichiometric coefficient of the reactant or product Length is number of reactants or products. order = Order of the reactant and product in the reaction rate expression

Parameters
rulesIf rules.skipUndeclaredSpecies is set and we fail to find a species we simply return false, allowing the calling routine to skip this reaction and continue. Otherwise, we will throw an error.

Definition at line 177 of file importKinetics.cpp.

References XML_Node::child(), fpValue(), XML_Node::getChildren(), ctml::getPairs(), XML_Node::hasChild(), Kinetics::kineticsSpeciesIndex(), and npos.

Referenced by rxninfo::installReaction().

static void Cantera::getArrhenius ( const XML_Node &  node,
int &  highlow,
doublereal &  A,
doublereal &  b,
doublereal &  E 
)
static

getArrhenius() parses the xml element called Arrhenius.

The Arrhenius expression is

\[ k = A T^(b) exp (-E_a / RT). \]

Definition at line 286 of file importKinetics.cpp.

References GasConstant, and ctml::getFloat().

Referenced by getRateCoefficient(), and LTPspecies_Arrhenius::LTPspecies_Arrhenius().

static void Cantera::getStick ( const XML_Node &  node,
Kinetics &  kin,
ReactionData &  r,
doublereal &  A,
doublereal &  b,
doublereal &  E 
)
static

getStick() processes the XML element called Stick that specifies the sticking coefficient reaction.

This routine will translate the sticking coefficient value into a "normal" rate constant for the surface reaction.

Output

Output is the normal Arrhenius expressions for a surface reaction rate constant.

A - units such that rate of rxn has kmol/m^2/s when A is multiplied by activity concentrations of reactants in the normal manner. n - unitless E - Units 1/Kelvin

Definition at line 321 of file importKinetics.cpp.

References cEdge, cSurf, ThermoPhase::eosType(), GasConstant, ctml::getFloat(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), Phase::molecularWeights(), Pi, Phase::speciesIndex(), Kinetics::speciesPhase(), Kinetics::speciesPhaseIndex(), ThermoPhase::standardConcentration(), and Kinetics::thermo().

Referenced by getRateCoefficient().

static void Cantera::getFalloff ( const XML_Node &  f,
ReactionData &  rdata 
)
static

Get falloff parameters for a reaction.

This routine reads the falloff XML node and extracts parameters into a vector of doubles

<falloff type="Troe"> 0.5 73.2 5000. 9999. </falloff>

Definition at line 429 of file importKinetics.cpp.

References fp2str(), fpValue(), ctml::getStringArray(), and int2str().

Referenced by getRateCoefficient().

static void Cantera::getEfficiencies ( const XML_Node &  eff,
Kinetics &  kin,
ReactionData &  rdata,
const ReactionRules &  rules 
)
static

Get the enhanced collision efficiencies.

It is assumed that the reaction mechanism is homogeneous, so that all species belong to phase(0) of 'kin'.

Definition at line 475 of file importKinetics.cpp.

References fpValue(), ctml::getPairs(), Phase::id(), int2str(), Kinetics::kineticsSpeciesIndex(), npos, and Kinetics::thermo().

Referenced by getRateCoefficient().

std::ostream & operator<< ( std::ostream &  s,
const BandMatrix &  m 
)

Utility routine to print out the matrix.

Parameters
sostream to print the matrix out to
mMatrix to be printed
Returns
Returns a reference to the ostream

Definition at line 330 of file BandMatrix.cpp.

References BandMatrix::nColumns(), and BandMatrix::nRows().

static doublereal subtractRD ( doublereal  a,
doublereal  b 
)
inline

This routine subtracts two numbers for one another.

This routine subtracts 2 numbers. If the difference is less than 1.0E-14 times the magnitude of the smallest number, then diff returns an exact zero. It also returns an exact zero if the difference is less than 1.0E-300.

returns: a - b

This routine is used in numerical differencing schemes in order to avoid roundoff errors resulting in creating Jacobian terms. Note: This is a slow routine. However, jacobian errors may cause loss of convergence. Therefore, in practice this routine has proved cost-effective.

Parameters
aValue of a
bvalue of b
Returns
returns the difference between a and b

Definition at line 644 of file BEulerInt.cpp.

References ckr::min().

Referenced by NonlinearSolver::beuler_jac().

DAE_Solver * newDAE_Solver ( std::string  itype,
ResidJacEval &  f 
)

Factor method for choosing a DAE solver.

Parameters
itypeString identifying the type (IDA is the only option)
fResidual function to be solved by the DAE algorithm
Returns
Returns a point to the instantiated DAE_Solver object

Definition at line 22 of file DAE_solvers.cpp.

int solve ( DenseMatrix &  A,
double *  b 
)

Solve Ax = b. Array b is overwritten on exit with x.

The solve class uses the LAPACK routine dgetrf to invert the m xy n matrix.

The factorization has the form A = P * L * U where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n), and U is upper triangular (upper trapezoidal if m < n).

The system is then solved using the LAPACK routine dgetrs

Parameters
ADense matrix to be factored
brhs to be solved.

Definition at line 135 of file DenseMatrix.cpp.

References int2str(), DenseMatrix::ipiv(), DenseMatrix::m_printLevel, DenseMatrix::m_useReturnErrorCode, Array2D::nColumns(), Array2D::nRows(), Array2D::ptrColumn(), and writelogf().

Referenced by ChemEquil::equilibrate(), ChemEquil::estimateElementPotentials(), ChemEquil::estimateEP_Brinkley(), MultiTransport::solveLMatrixEquation(), AqueousTransport::stefan_maxwell_solve(), and LiquidTransport::stefan_maxwell_solve().

int solve ( DenseMatrix &  A,
DenseMatrix &  b 
)

Solve Ax = b for multiple right-hand-side vectors.

Parameters
ADense matrix to be factored
bDense matrix of rhs's. Each column is a rhs

Definition at line 181 of file DenseMatrix.cpp.

References int2str(), DenseMatrix::ipiv(), DenseMatrix::m_printLevel, DenseMatrix::m_useReturnErrorCode, Array2D::nColumns(), Array2D::nRows(), Array2D::ptrColumn(), and writelogf().

void multiply ( const DenseMatrix &  A,
const double *const  b,
double *const  prod 
)

Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.

\[ prod_i = sum^N_{j = 1}{A_{ij} b_j} \]

Parameters
Ainput Dense Matrix A with M rows and N columns
binput vector b with length N
prodoutput output vector prod length = M

Definition at line 234 of file DenseMatrix.cpp.

References Array2D::nColumns(), Array2D::nRows(), and Array2D::ptrColumn().

Referenced by DustyGasTransport::getMolarFluxes(), MultiPhaseEquil::MultiPhaseEquil(), MultiPhaseEquil::stepComposition(), GasTransport::viscosity(), and AqueousTransport::viscosity().

void increment ( const DenseMatrix &  A,
const double *const  b,
double *const  prod 
)

Multiply A*b and add it to the result in prod. Uses BLAS routine DGEMV.

\[ prod_i += sum^N_{j = 1}{A_{ij} b_j} \]

Parameters
Ainput Dense Matrix A with M rows and N columns
binput vector b with length N
prodoutput output vector prod length = M

Definition at line 241 of file DenseMatrix.cpp.

References Array2D::nRows(), and Array2D::ptrColumn().

Referenced by DustyGasTransport::getMolarFluxes().

int invert ( DenseMatrix &  A,
size_t  nn = npos 
)

invert A. A is overwritten with A^-1.

Parameters
AInvert the matrix A and store it back in place
nnSize of A. This defaults to -1, which means that the number of rows is used as the default size of n

Definition at line 248 of file DenseMatrix.cpp.

References int2str(), DenseMatrix::ipiv(), DenseMatrix::m_printLevel, DenseMatrix::m_useReturnErrorCode, npos, Array2D::nRows(), Array2D::ptrColumn(), and writelogf().

Referenced by MultiTransport::getMultiDiffCoeffs(), and DustyGasTransport::updateMultiDiffCoeffs().

doublereal Cantera::linearInterp ( doublereal  x,
const vector_fp &  xpts,
const vector_fp &  fpts 
)

Linearly interpolate a function defined on a discrete grid.

Vector xpts contains a monotonic sequence of grid points, and vector fpts contains function values defined at these points. The value returned is the linear interpolate at point x. If x is outside the range of xpts, the value of fpts at the nearest end is returned.

Parameters
xvalue of the x coordinate
xptsvalue of the grid points
fptsvalue of the interpolant at the grid points
Returns
Returned value is the value of of the interpolated function at x.

Definition at line 56 of file funcs.cpp.

Referenced by StFlow::_finalize(), and Sim1D::setProfile().

doublereal polyfit ( int  n,
doublereal *  x,
doublereal *  y,
doublereal *  w,
int  maxdeg,
int &  ndeg,
doublereal  eps,
doublereal *  r 
)

Fits a polynomial function to a set of data points.

Given a collection of points X(I) and a set of values Y(I) which
correspond to some function or measurement at each of the X(I),
subroutine  DPOLFT  computes the weighted least-squares polynomial
fits of all degrees up to some degree either specified by the user
or determined by the routine.  The fits thus obtained are in
orthogonal polynomial form.  Subroutine  DP1VLU  may then be
called to evaluate the fitted polynomials and any of their
derivatives at any point.  The subroutine  DPCOEF  may be used to
express the polynomial fits as powers of (X-C) for any specified
point C.
Parameters
nThe number of data points.
xA set of grid points on which the data is specified. The array of values of the independent variable. These values may appear in any order and need not all be distinct. There are n of them.
yarray of corresponding function values. There are n of them
warray of positive values to be used as weights. If W[0] is negative, DPOLFT will set all the weights to 1.0, which means unweighted least squares error will be minimized. To minimize relative error, the user should set the weights to: W(I) = 1.0/Y(I)**2, I = 1,...,N .
maxdegmaximum degree to be allowed for polynomial fit. MAXDEG may be any non-negative integer less than N. Note – MAXDEG cannot be equal to N-1 when a statistical test is to be used for degree selection, i.e., when input value of EPS is negative.
ndegoutput degree of the fit computed.
epsSpecifies the criterion to be used in determining the degree of fit to be computed. (1) If EPS is input negative, DPOLFT chooses the degree based on a statistical F test of significance. One of three possible significance levels will be used: .01, .05 or .10. If EPS=-1.0 , the routine will automatically select one of these levels based on the number of data points and the maximum degree to be considered. If EPS is input as -.01, -.05, or -.10, a significance level of .01, .05, or .10, respectively, will be used. (2) If EPS is set to 0., DPOLFT computes the polynomials of degrees 0 through MAXDEG . (3) If EPS is input positive, EPS is the RMS error tolerance which must be satisfied by the fitted polynomial. DPOLFT will increase the degree of fit until this criterion is met or until the maximum degree is reached.
rOutput vector containing the first LL+1 Taylor coefficients where LL=ABS(ndeg). P(X) = r[0] + r[1]*(X-C) + ... + r[ndeg] * (X-C)**ndeg ( here C = 0.0)
Returns
returns the RMS error of the polynomial of degree ndeg .

Given a collection of points X(I) and a set of values Y(I) which correspond to some function or measurement at each of the X(I), subroutine DPOLFT computes the weighted least-squares polynomial fits of all degrees up to some degree either specified by the user or determined by the routine. The fits thus obtained are in orthogonal polynomial form. Subroutine DP1VLU may then be called to evaluate the fitted polynomials and any of their derivatives at any point. The subroutine DPCOEF may be used to express the polynomial fits as powers of (X-C) for any specified point C.

Parameters
nThe number of data points.
xA set of grid points on which the data is specified. The array of values of the independent variable. These values may appear in any order and need not all be distinct. There are n of them.
yarray of corresponding function values. There are n of them
warray of positive values to be used as weights. If W[0] is negative, DPOLFT will set all the weights to 1.0, which means unweighted least squares error will be minimized. To minimize relative error, the user should set the weights to: W(I) = 1.0/Y(I)**2, I = 1,...,N .
maxdegmaximum degree to be allowed for polynomial fit. MAXDEG may be any non-negative integer less than N. Note – MAXDEG cannot be equal to N-1 when a statistical test is to be used for degree selection, i.e., when input value of EPS is negative.
ndegoutput degree of the fit computed.
epsSpecifies the criterion to be used in determining the degree of fit to be computed. (1) If EPS is input negative, DPOLFT chooses the degree based on a statistical F test of significance. One of three possible significance levels will be used: .01, .05 or .10. If EPS=-1.0 , the routine will automatically select one of these levels based on the number of data points and the maximum degree to be considered. If EPS is input as -.01, -.05, or -.10, a significance level of .01, .05, or .10, respectively, will be used. (2) If EPS is set to 0., DPOLFT computes the polynomials of degrees 0 through MAXDEG . (3) If EPS is input positive, EPS is the RMS error tolerance which must be satisfied by the fitted polynomial. DPOLFT will increase the degree of fit until this criterion is met or until the maximum degree is reached.
rOutput vector containing the first ndeg+1 Taylor coefficients
              P(X) = r[0] + r[1]*(X-C) + ... + r[ndeg] * (X-C)**ndeg
             ( here C = 0.0)
Returns
Returned value is the value of the rms of the interpolated function at x.

Definition at line 138 of file funcs.cpp.

References int2str().

Referenced by MMCollisionInt::fit(), MMCollisionInt::fit_omega22(), MMCollisionInt::fitDelta(), and TransportFactory::fitProperties().

static void Cantera::print_line ( const char *  str,
int  n 
)
static

Print a line of a single repeated character string.

Parameters
strCharacter string
nIteration length

Definition at line 56 of file NonlinearSolver.cpp.

References print_line().

Referenced by print_line(), NonlinearSolver::print_solnDelta_norm_contrib(), NonlinearSolver::residErrorNorm(), NonlinearSolver::solnErrorNorm(), and NonlinearSolver::solve_nonlinear_problem().

static void Cantera::print_funcEval ( FILE *  fp,
doublereal  xval,
doublereal  fval,
int  its 
)
static

Print out a form for the current function evaluation.

Parameters
fpPointer to the FILE object
xvalCurrent value of x
fvalCurrent value of f
itsCurrent iteration value

Definition at line 56 of file RootFind.cpp.

References print_funcEval().

Referenced by print_funcEval(), and RootFind::solve().

doublereal bound_step ( const doublereal *  x,
const doublereal *  step,
Domain1D &  r,
int  loglevel 
)

Return a damping coefficient that keeps the solution after taking one Newton step between specified lower and upper bounds.

This function only considers one domain.

Definition at line 31 of file newton_utils.cpp.

References Domain1D::componentName(), Domain1D::domainIndex(), int2str(), Domain1D::lowerBound(), ckr::max(), ckr::min(), Domain1D::nComponents(), Domain1D::nPoints(), Domain1D::upperBound(), and writelog().

Referenced by MultiNewton::boundStep().

doublereal norm_square ( const doublereal *  x,
const doublereal *  step,
Domain1D &  r 
)

This function computes the square of a weighted norm of a step vector for one domain.

Parameters
xSolution vector for this domain.
stepNewton step vector for this domain.
rObject representing the domain. Used to get tolerances, number of components, and number of points.

The return value is

\[ \sum_{n,j} \left(\frac{s_{n,j}}{w_n}\right)^2 \]

where the error weight for solution component \(n\) is given by

\[ w_n = \epsilon_{r,n} \frac{\sum_j |x_{n,j}|}{J} + \epsilon_{a,n}. \]

Here \(\epsilon_{r,n} \) is the relative error tolerance for component n, and multiplies the average magnitude of solution component n in the domain. The second term, \(\epsilon_{a,n}\), is the absolute error tolerance for component n.

Definition at line 113 of file newton_utils.cpp.

References Domain1D::atol(), Domain1D::nComponents(), Domain1D::nPoints(), and Domain1D::rtol().

Referenced by MultiNewton::norm2().

static doublereal Cantera::eps ( )
static

Return the square root of machine precision.

Definition at line 31 of file refine.cpp.

References eps().

Referenced by eps(), TransportFactory::fitProperties(), LTI_StefanMaxwell_PPN::getMatrixTransProp(), MultiTransport::setOptions_GMRES(), and StFlow::updateTransport().

void importSolution ( size_t  points,
doublereal *  oldSoln,
IdealGasPhase &  oldmech,
size_t  size_new,
doublereal *  newSoln,
IdealGasPhase &  newmech 
)

Import a previous solution to use as an initial estimate.

The previous solution may have been computed using a different reaction mechanism. Species in the old and new mechanisms are matched by name, and any species in the new mechanism that were not in the old one are set to zero. The new solution is created with the same number of grid points as in the old solution.

Definition at line 32 of file StFlow.cpp.

References Phase::getMassFractions(), int2str(), npos, Phase::nSpecies(), Phase::setMassFractions(), Phase::speciesIndex(), and Phase::speciesName().

static int Cantera::interp_est ( std::string  estString)
static

Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field.

Parameters
estStringinput string that will be interpreted

Definition at line 962 of file DebyeHuckel.cpp.

References cEST_solvent, and lowercase().

Referenced by DebyeHuckel::initThermoXML(), and HMWSoln::initThermoXML().

double LookupWtElements ( const std::string &  ename)

Function to look up an atomic weight This function looks up the argument string in the database above and returns the associated molecular weight.

The data are from the periodic table.

Note: The idea behind this function is to provide a unified source for the element atomic weights. This helps to ensure that mass is conserved.

Parameters
enameString, Only the first 3 characters are significant
Returns
The atomic weight of the element
Exceptions
CanteraErrorIf a match is not found, throws a CanteraError

Definition at line 177 of file Elements.cpp.

References aWTable.

Referenced by Phase::addElement(), and Phase::addUniqueElement().

static double Cantera::factorOverlap ( const std::vector< std::string > &  elnamesVN,
const std::vector< double > &  elemVectorN,
const size_t  nElementsN,
const std::vector< std::string > &  elnamesVI,
const std::vector< double > &  elemVectorI,
const size_t  nElementsI 
)
static

Return the factor overlap.

Parameters
elnamesVN
elemVectorN
nElementsN
elnamesVI
elemVectorI
nElementsI

Definition at line 1158 of file IonsFromNeutralVPSSTP.cpp.

References ckr::min().

Referenced by IonsFromNeutralVPSSTP::initThermoXML().

static void Cantera::getSpeciesThermoTypes ( std::vector< XML_Node * > &  spDataNodeList,
int &  has_nasa,
int &  has_shomate,
int &  has_simple,
int &  has_other 
)
static

Examine the types of species thermo parameterizations, and return a flag indicating the type of reference state thermo manager that will be needed in order to evaluate them all.

Parameters
spDataNodeListThis vector contains a list of species XML nodes that will be in the phase
has_nasaReturn int that indicates whether the phase has a NASA polynomial form for one of its species
has_shomateReturn int that indicates whether the phase has a SHOMATE polynomial form for one of its species
has_simpleReturn int that indicates whether the phase has a SIMPLE polynomial form for one of its species
has_otherReturn int that indicates whether the phase has a form for one of its species that is not one of the ones listed above.
Todo:
Make sure that spDadta_node is species Data XML node by checking its name is speciesData

Definition at line 54 of file SpeciesThermoFactory.cpp.

References XML_Node::attrib(), XML_Node::child(), and XML_Node::hasChild().

Referenced by SpeciesThermoFactory::newSpeciesThermo(), and SpeciesThermoFactory::newSpeciesThermoOpt().

static void Cantera::installNasaThermoFromXML ( std::string  speciesName,
SpeciesThermo &  sp,
size_t  k,
const XML_Node *  f0ptr,
const XML_Node *  f1ptr 
)
static

Install a NASA polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a NASA block is found in the XML input.

Parameters
speciesNameString name of the species
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
f0ptrPtr to the first XML_Node for the first NASA polynomial
f1ptrPtr to the first XML_Node for the first NASA polynomial

Definition at line 300 of file SpeciesThermoFactory.cpp.

References XML_Node::child(), ctml::fpValue(), ctml::getFloatArray(), XML_Node::hasAttrib(), SpeciesThermo::install(), NASA, and OneAtm.

Referenced by SpeciesThermoFactory::installThermoForSpecies().

static doublereal Cantera::LookupGe ( const std::string &  elemName,
ThermoPhase *  th_ptr 
)
static

Look up the elemental reference state entropies.

Parameters
elemNameString name of the element
th_ptrPointer to the thermophase.

Definition at line 381 of file SpeciesThermoFactory.cpp.

References Phase::elementIndex(), ENTROPY298_UNKNOWN, Phase::entropyElement298(), and npos.

Referenced by convertDGFormation().

static doublereal Cantera::convertDGFormation ( size_t  k,
ThermoPhase *  th_ptr 
)
static

Convert delta G formulation.

Calculates the sum of the elemental reference state entropies

Parameters
kspecies index
th_ptrPointer to the ThermoPhase

Definition at line 403 of file SpeciesThermoFactory.cpp.

References Phase::elementName(), LookupGe(), Phase::nAtoms(), and Phase::nElements().

Referenced by installMinEQ3asShomateThermoFromXML().

static void Cantera::installMinEQ3asShomateThermoFromXML ( std::string  speciesName,
ThermoPhase *  th_ptr,
SpeciesThermo &  sp,
size_t  k,
const XML_Node *  MinEQ3node 
)
static

Install a NASA96 polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a MinEQ3node block is found in the XML input.

Parameters
speciesNameString name of the species
th_ptrPointer to the ThermoPhase object
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
MinEQ3nodePtr to the first XML_Node for the first MinEQ3 parameterization

Definition at line 436 of file SpeciesThermoFactory.cpp.

References convertDGFormation(), fp2str(), ctml::getFloatDefaultUnits(), SpeciesThermo::install(), SHOMATE, and strSItoDbl().

Referenced by SpeciesThermoFactory::installThermoForSpecies().

static void Cantera::installShomateThermoFromXML ( std::string  speciesName,
SpeciesThermo &  sp,
size_t  k,
const XML_Node *  f0ptr,
const XML_Node *  f1ptr 
)
static

Install a Shomate polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a Shomate block is found in the XML input.

Parameters
speciesNameString name of the species
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
f0ptrPtr to the first XML_Node for the first NASA polynomial
f1ptrPtr to the first XML_Node for the first NASA polynomial

Definition at line 523 of file SpeciesThermoFactory.cpp.

References XML_Node::child(), ctml::fpValue(), ctml::getFloatArray(), XML_Node::hasAttrib(), SpeciesThermo::install(), OneAtm, and SHOMATE.

Referenced by SpeciesThermoFactory::installThermoForSpecies().

static void Cantera::installSimpleThermoFromXML ( std::string  speciesName,
SpeciesThermo &  sp,
size_t  k,
const XML_Node &  f 
)
static

Install a Simple thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a SimpleThermo block is found

Parameters
speciesNameString name of the species
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
fXML_Node for the SimpleThermo block

Definition at line 589 of file SpeciesThermoFactory.cpp.

References ctml::fpValue(), ctml::getFloat(), SpeciesThermo::install(), OneAtm, and SIMPLE.

Referenced by SpeciesThermoFactory::installThermoForSpecies().

static void Cantera::installNasa9ThermoFromXML ( std::string  speciesName,
SpeciesThermo &  sp,
size_t  k,
const std::vector< XML_Node * > &  tp 
)
static

Install a NASA9 polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a NASA9 block is found in the XML input.

Parameters
speciesNameString name of the species
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
tpVector of XML Nodes that make up the parameterization

Definition at line 619 of file SpeciesThermoFactory.cpp.

References XML_Node::child(), DATA_PTR, ctml::fpValue(), ctml::getFloatArray(), XML_Node::hasChild(), SpeciesThermo::install_STIT(), XML_Node::name(), and OneAtm.

Referenced by SpeciesThermoFactory::installThermoForSpecies().

static void Cantera::installAdsorbateThermoFromXML ( std::string  speciesName,
SpeciesThermo &  sp,
size_t  k,
const XML_Node &  f 
)
static

Install a Adsorbate polynomial thermodynamic property parameterization for species k into a SpeciesThermo instance.

This is called by method installThermoForSpecies if a Adsorbate block is found in the XML input.

Parameters
speciesNameString name of the species
spSpeciesThermo object that will receive the nasa polynomial object
kSpecies index within the phase
fXML Node that contains the parameterization

Definition at line 679 of file SpeciesThermoFactory.cpp.

References ADSORBATE, XML_Node::child(), ctml::fpValue(), ctml::getFloat(), ctml::getFloatArray(), XML_Node::hasAttrib(), XML_Node::hasChild(), and OneAtm.

Referenced by SpeciesThermoFactory::installThermoForSpecies().

SpeciesThermo * newSpeciesThermoMgr ( int  type,
SpeciesThermoFactory *  f = 0 
)

Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.

This utility program will look through species nodes. It will discover what each species needs for its species property managers. Then, it will malloc and return the proper species property manager to use.

These functions allow using a different factory class that derives from SpeciesThermoFactory.

Parameters
typeSpecies thermo type.
fPointer to a SpeciesThermoFactory. optional parameter. Defaults to NULL.

Definition at line 861 of file SpeciesThermoFactory.cpp.

References SpeciesThermoFactory::newSpeciesThermo().

Referenced by importPhase(), and VPSSMgrFactory::newVPSSMgr().

SpeciesThermo * newSpeciesThermoMgr ( std::string &  stype,
SpeciesThermoFactory *  f = 0 
)

Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.

This utility program is a basic factory operation for spawning a new species reference-state thermo manager

These functions allows for using a different factory class that derives from SpeciesThermoFactory. However, no applications of this have been done yet.

Parameters
stypeString specifying the species thermo type
fPointer to a SpeciesThermoFactory. optional parameter. Defaults to NULL.

Definition at line 884 of file SpeciesThermoFactory.cpp.

References SpeciesThermoFactory::newSpeciesThermoManager().

SpeciesThermo * newSpeciesThermoMgr ( std::vector< XML_Node * >  spDataNodeList,
SpeciesThermoFactory *  f = 0,
bool  opt = false 
)

Function to return SpeciesThermo manager.

This utility program will look through species nodes. It will discover what each species needs for its species property managers. Then, it will malloc and return the proper species reference state manager to use.

These functions allow using a different factory class that derives from SpeciesThermoFactory.

Parameters
spDataNodeListThis vector contains a list of species XML nodes that will be in the phase
fPointer to a SpeciesThermoFactory. optional parameter. Defaults to NULL.
optBoolean defaults to false.

Definition at line 910 of file SpeciesThermoFactory.cpp.

References SpeciesThermoFactory::newSpeciesThermo(), and SpeciesThermoFactory::newSpeciesThermoOpt().

static void Cantera::formSpeciesXMLNodeList ( std::vector< XML_Node * > &  spDataNodeList,
std::vector< std::string > &  spNamesList,
std::vector< int > &  spRuleList,
const std::vector< XML_Node * >  spArray_names,
const std::vector< XML_Node * >  spArray_dbases,
const vector_int  sprule 
)
static

Gather a vector of pointers to XML_Nodes for a phase.

Parameters
spDataNodeListOutput vector of pointer to XML_Nodes which contain the species XML_Nodes for the species in the current phase.
spNamesListOutput Vector of strings, which contain the names of the species in the phase
spRuleListOutput Vector of ints, which contain the value of sprule for each species in the phase
spArray_namesVector of pointers to the XML_Nodes which contains the names of the species in the phase
spArray_dbasesInput vector of pointers to species data bases. We search each data base for the required species names
spruleInput vector of sprule values

Definition at line 302 of file ThermoFactory.cpp.

References XML_Node::findByAttr(), XML_Node::getChildren(), and ctml::getStringArray().

Referenced by importPhase().

std::string report ( const ThermoPhase &  th,
const bool  show_thermo = true 
)

Format a summary of the mixture state for output.

Parameters
thThermoPhase object to create a report about
show_thermoBoolean indicating whether the thermo functions of the phase should be written out
Returns
Returns a string containing the report
Deprecated:
use "th.report(show_thermo)" instead

Definition at line 1504 of file ThermoPhase.cpp.

References ThermoPhase::report().

Referenced by operator<<().

static void Cantera::getVPSSMgrTypes ( std::vector< XML_Node * > &  spDataNodeList,
int &  has_nasa_idealGas,
int &  has_nasa_constVol,
int &  has_shomate_idealGas,
int &  has_shomate_constVol,
int &  has_simple_idealGas,
int &  has_simple_constVol,
int &  has_water,
int &  has_tpx,
int &  has_hptx,
int &  has_other 
)
static

Examine the types of species thermo parameterizations, and return a flag indicating the type of parameterization needed by the species.

Parameters
spDataNodeListSpecies Data XML node. This node contains a list of species XML nodes underneath it.
has_nasa_idealGasBoolean indicating that one species has a nasa ideal gas standard state
has_nasa_constVolBoolean indicating that one species has a nasa ideal solution standard state
has_shomate_idealGasBoolean indicating that one species has a shomate ideal gas standard state
has_shomate_constVolBoolean indicating that one species has a shomate ideal solution standard state
has_simple_idealGasBoolean indicating that one species has a simple ideal gas standard state
has_simple_constVolBoolean indicating that one species has a simple ideal solution standard state
has_waterBoolean indicating that one species has a water standard state
has_tpxBoolean indicating that one species has a tpx standard state
has_hptxBoolean indicating that one species has a htpx standard state
has_otherBoolean indicating that one species has different standard state than the ones listed above
Todo:
Make sure that spDadta_node is species Data XML node by checking its name is speciesData

Definition at line 71 of file VPSSMgrFactory.cpp.

References XML_Node::attrib(), XML_Node::child(), and XML_Node::hasChild().

Referenced by VPSSMgrFactory::newVPSSMgr().

VPSSMgr * newVPSSMgr ( VPSSMgr_enumType  type,
VPStandardStateTP *  vp_ptr,
VPSSMgrFactory *  f = 0 
)

Create a new species thermo manager instance, by specifying the type and (optionally) a pointer to the factory to use to create it.

This utility program will look through species nodes. It will discover what each species needs for its species property managers. Then, it will malloc and return the proper species property manager to use.

These functions allow using a different factory class that derives from SpeciesThermoFactory.

Parameters
typeSpecies thermo type.
vp_ptrVariable pressure standard state ThermoPhase object that will be the owner.
fPointer to a SpeciesThermoFactory. optional parameter. Defaults to NULL.

Definition at line 364 of file VPSSMgrFactory.cpp.

References VPSSMgrFactory::newVPSSMgr().

Referenced by importPhase(), and VPSSMgrFactory::newVPSSMgr().

VPSSMgr * newVPSSMgr ( VPStandardStateTP *  vp_ptr,
XML_Node *  phaseNode_ptr,
std::vector< XML_Node * > &  spDataNodeList,
VPSSMgrFactory *  f = 0 
)

Function to return VPSSMgr manager.

This utility program will look through species nodes. It will discover what each species needs for its species property managers. Then, it will alloc and return the proper species property manager to use.

These functions allow using a different factory class that derives from SpeciesThermoFactory.

Parameters
vp_ptrVariable pressure standard state ThermoPhase object that will be the owner.
phaseNode_ptrPointer to the ThermoPhase phase XML Node
spDataNodeListThis vector contains a list of species XML nodes that will be in the phase
fPointer to a SpeciesThermoFactory. optional parameter. Defaults to NULL.

Definition at line 375 of file VPSSMgrFactory.cpp.

References VPSSMgrFactory::newVPSSMgr().

static void Cantera::getArrhenius ( const XML_Node &  node,
doublereal &  A,
doublereal &  b,
doublereal &  E 
)
static

getArrhenius() parses the xml element called Arrhenius.

The Arrhenius expression is

\[ k = A T^(b) exp (-E_a / RT) \]

Parameters
nodeXML_Node to be read
AOutput pre-exponential factor. The units are variable.
boutput temperature power
EOutput activation energy in units of Kelvin

Definition at line 41 of file LTPspecies.cpp.

References GasConstant, and ctml::getFloat().

doublereal Cantera::Frot ( doublereal  tr,
doublereal  sqtr 
)
inline

The Parker temperature correction to the rotational collision number.

Parameters
trReduced temperature \( \epsilon/kT \)
sqtrsquare root of tr.

Definition at line 48 of file MultiTransport.cpp.

References Pi, and SqrtPi.

Referenced by MultiTransport::initGas(), and MultiTransport::updateThermal_T().

Transport * newTransportMgr ( std::string  transportModel = "",
thermo_t *  thermo = 0,
int  loglevel = 0,
TransportFactory *  f = 0 
)

Create a new transport manager instance.

Parameters
transportModelString identifying the transport model to be instantiated, defaults to the empty string
thermoThermoPhase object associated with the phase, defaults to null pointer
loglevelint containing the Loglevel, defaults to zero
fptr to the TransportFactory object if it's been malloced.

Definition at line 1491 of file TransportFactory.cpp.

References TransportFactory::factory(), and TransportFactory::newTransport().

Transport * newDefaultTransportMgr ( thermo_t *  thermo,
int  loglevel = 0,
TransportFactory *  f = 0 
)

Create a new transport manager instance.

Parameters
thermoThermoPhase object associated with the phase, defaults to null pointer
loglevelint containing the Loglevel, defaults to zero
fptr to the TransportFactory object if it's been malloced.
Returns
Returns a transport manager for the phase

Definition at line 1514 of file TransportFactory.cpp.

References TransportFactory::factory(), and TransportFactory::newTransport().

std::ostream& Cantera::operator<< ( std::ostream &  s,
const Array2D &  m 
)
inline

Output the current contents of the Array2D object.

Example of usage: s << m << endl;

Parameters
sReference to the ostream to write to
mObject of type Array2D that you are querying
Returns
Returns a reference to the ostream.

Definition at line 400 of file Array.h.

References Array2D::nColumns(), and Array2D::nRows().

void Cantera::operator*= ( Array2D &  m,
doublereal  a 
)
inline

Overload the times equals operator for multiplication of a matrix and a scalar.

Scaled every element of the matrix by the scalar input

Parameters
mMatrix
ascalar

Definition at line 422 of file Array.h.

References Array2D::begin(), Array2D::end(), and scale().

void Cantera::operator+= ( Array2D &  x,
const Array2D &  y 
)
inline

Overload the plus equals operator for addition of one matrix with another.

Adds each element of the second matrix into the first matrix

Parameters
xFirst matrix
ySecond matrix, which is a const

Definition at line 436 of file Array.h.

References Array2D::begin(), Array2D::end(), and sum_each().

doublereal Cantera::dot4 ( const V &  x,
const V &  y 
)
inline

Templated Inner product of two vectors of length 4.

If either x or y has length greater than 4, only the first 4 elements will be used.

Parameters
xfirst reference to the templated class V
ysecond reference to the templated class V
Returns
This class returns a hard-coded type, doublereal.

Definition at line 68 of file utilities.h.

Referenced by MixTransport::updateCond_T(), AqueousTransport::updateCond_T(), GasTransport::updateDiff_T(), AqueousTransport::updateDiff_T(), GasTransport::updateSpeciesViscosities(), and AqueousTransport::updateSpeciesViscosities().

doublereal Cantera::dot5 ( const V &  x,
const V &  y 
)
inline

Templated Inner product of two vectors of length 5.

If either x or y has length greater than 4, only the first 4 elements will be used.

Parameters
xfirst reference to the templated class V
ysecond reference to the templated class V
Returns
This class returns a hard-coded type, doublereal.

Definition at line 86 of file utilities.h.

Referenced by MixTransport::updateCond_T(), AqueousTransport::updateCond_T(), GasTransport::updateDiff_T(), AqueousTransport::updateDiff_T(), GasTransport::updateSpeciesViscosities(), and AqueousTransport::updateSpeciesViscosities().

doublereal Cantera::dot6 ( const V &  x,
const V &  y 
)
inline

Templated Inner product of two vectors of length 6.

If either x or y has length greater than 4, only the first 4 elements will be used.

Parameters
xfirst reference to the templated class V
ysecond reference to the templated class V
Returns
This class returns a hard-coded type, doublereal.

Definition at line 104 of file utilities.h.

doublereal Cantera::dot ( InputIter  x_begin,
InputIter  x_end,
InputIter2  y_begin 
)
inline

Function that calculates a templated inner product.

This inner product is templated twice. The output variable is hard coded to return a doublereal.

template<class InputIter, class InputIter2>

double x[8], y[8];
doublereal dsum = dot<double *,double *>(x, &x+7, y);
Parameters
x_beginIterator pointing to the beginning, belonging to the iterator class InputIter.
x_endIterator pointing to the end, belonging to the iterator class InputIter.
y_beginIterator pointing to the beginning of y, belonging to the iterator class InputIter2.
Returns
The return is hard-coded to return a double.

Definition at line 132 of file utilities.h.

Referenced by IdealSolnGasVPSS::calcDensity(), RedlichKwongMFTP::calcDensity(), IdealSolidSolnPhase::calcDensity(), ChemEquil::equilibrate(), Phase::mean_Y(), and Phase::setMoleFractions_NoNorm().

void Cantera::scale ( InputIter  begin,
InputIter  end,
OutputIter  out,
scale_factor 
)
inline

Multiply elements of an array by a scale factor.

vector_fp in(8, 1.0), out(8);
scale(in.begin(), in.end(), out.begin(), factor);
Parameters
beginIterator pointing to the beginning, belonging to the iterator class InputIter.
endIterator pointing to the end, belonging to the iterator class InputIter.
outIterator pointing to the beginning of out, belonging to the iterator class OutputIter. This is the output variable for this routine.
scale_factorinput scale factor belonging to the class S.

Definition at line 155 of file utilities.h.

Referenced by ChemEquil::equilibrate(), ChemEquil::estimateElementPotentials(), Phase::getConcentrations(), SurfPhase::getCp_R(), SurfPhase::getEnthalpy_RT(), SurfPhase::getEntropy_R(), VPSSMgr_General::getGibbs_ref(), VPSSMgr::getGibbs_ref(), MixtureFugacityTP::getGibbs_ref(), IdealGasPhase::getGibbs_ref(), SurfPhase::getGibbs_RT(), DustyGasTransport::getMolarFluxes(), Phase::getMoleFractions(), IdealSolnGasVPSS::getPartialMolarCp(), RedlichKwongMFTP::getPartialMolarCp(), IdealGasPhase::getPartialMolarCp(), IdealSolnGasVPSS::getPartialMolarEnthalpies(), RedlichKwongMFTP::getPartialMolarEnthalpies(), IdealGasPhase::getPartialMolarEnthalpies(), IdealSolidSolnPhase::getPartialMolarEnthalpies(), LatticePhase::getPartialMolarEnthalpies(), IdealSolnGasVPSS::getPartialMolarEntropies(), RedlichKwongMFTP::getPartialMolarEntropies(), IdealGasPhase::getPartialMolarEntropies(), IdealSolnGasVPSS::getPartialMolarIntEnergies(), RedlichKwongMFTP::getPartialMolarIntEnergies(), ConstDensityThermo::getPureGibbs(), MixtureFugacityTP::getPureGibbs(), IdealGasPhase::getPureGibbs(), VPSSMgr::getStandardChemPotentials(), IdealGasPhase::getStandardChemPotentials(), LatticePhase::getStandardChemPotentials(), operator*=(), scale(), and Phase::setMassFractions().

void Cantera::increment_scale ( InputIter  begin,
InputIter  end,
OutputIter  out,
scale_factor 
)
inline

Multiply elements of an array, y, by a scale factor, f and add the result to an existing array, x. This is essentially a templated daxpy_ operation.

The template arguments are: template<class InputIter, class OutputIter, class S>

Simple Code Example of the functionality;

double x[10], y[10], f;
for (i = 0; i < n; i++) {
y[i] += f * x[i]
}

Example of the function call to implement the simple code example

double x[10], y[10], f;
increment_scale(x, x+10, y, f);

It is templated with three parameters. The first template is the iterator, InputIter, which controls access to y[]. The second template is the iterator OutputIter, which controls access to y[]. The third iterator is S, which is f.

Parameters
beginInputIter Iterator for beginning of y[]
endinputIter Iterator for end of y[]
outOutputIter Iterator for beginning of x[]
scale_factorScale Factor to multiply y[i] by

Definition at line 193 of file utilities.h.

void Cantera::multiply_each ( OutputIter  x_begin,
OutputIter  x_end,
InputIter  y_begin 
)
inline

Multiply each entry in x by the corresponding entry in y.

The template arguments are: template<class InputIter, class OutputIter>

Simple code Equivalent:

double x[10], y[10]
for (n = 0; n < 10; n++) {
x[n] *= y[n];
}

Example of function call usage to implement the simple code example:

double x[10], y[10]
multiply_each(x, x+10, y);
Parameters
x_beginIterator pointing to the beginning of the vector x, belonging to the iterator class InputIter.
x_endIterator pointing to the end of the vector x, belonging to the iterator class InputIter. The difference between end and begin determines the loop length
y_beginIterator pointing to the beginning of the vector y, belonging to the iterator class outputIter.

Definition at line 228 of file utilities.h.

Referenced by AqueousKinetics::getFwdRateConstants(), GasKinetics::getFwdRateConstants(), InterfaceKinetics::getFwdRateConstants(), InterfaceKinetics::getRevRateConstants(), and InterfaceKinetics::updateROP().

void Cantera::resize_each ( int  m,
InputIter  begin,
InputIter  end 
)
inline

Invoke method 'resize' with argument m for a sequence of objects (templated version)

The template arguments are: template<class InputIter>

Simple code Equivalent:

vector<vector<double> *> VV;
for (n = 0; n < 20; n++) {
vector<double> *vp = VV[n];
vp->resize(m);
}

Example of function call usage to implement the simple code example:

vector<vector<double> *> VV;
resize_each(m, &VV[0], &VV[20]);
Parameters
mInteger specifying the size that each object should be resized to.
beginIterator pointing to the beginning of the sequence of object, belonging to the iterator class InputIter.
endIterator pointing to the end of the sequence of objects, belonging to the iterator class InputIter. The difference between end and begin determines the loop length
Note
This is currently unused.

Definition at line 264 of file utilities.h.

doublereal Cantera::absmax ( InputIter  begin,
InputIter  end 
)
inline

The maximum absolute value (templated version)

The template arguments are: template<class InputIter>

Simple code Equivalent:

double x[10] amax = 0.0;
for (int n = 0; n < 10; n++) {
if (fabs(x[n]) > amax) amax = fabs(x[10]);
}
return amax;

Example of function call usage to implement the simple code example:

double x[10]
double amax = absmax(x, x+10);
Parameters
beginIterator pointing to the beginning of the x vector, belonging to the iterator class InputIter.
endIterator pointing to the end of the x vector, belonging to the iterator class InputIter. The difference between end and begin determines the loop length

Definition at line 296 of file utilities.h.

References amax().

void Cantera::normalize ( InputIter  begin,
InputIter  end,
OutputIter  out 
)
inline

Normalize the values in a sequence, such that they sum to 1.0 (templated version)

The template arguments are: template<class InputIter, class OutputIter>

Simple Equivalent:

double x[10], y[10], sum = 0.0;
for (int n = 0; n < 10; n++) {
sum += x[10];
}
for (int n = 0; n < 10; n++) {
y[n] = x[n]/sum;
}

Example of function call usage:

double x[10], y[10];
normalize(x, x+10, y);
Parameters
beginIterator pointing to the beginning of the x vector, belonging to the iterator class InputIter.
endIterator pointing to the end of the x vector, belonging to the iterator class InputIter. The difference between end and begin determines the loop length
outIterator pointing to the beginning of the output vector, belonging to the iterator class OutputIter.

Definition at line 335 of file utilities.h.

void Cantera::divide_each ( OutputIter  x_begin,
OutputIter  x_end,
InputIter  y_begin 
)
inline

Templated divide of each element of x by the corresponding element of y.

The template arguments are: template<class InputIter, class OutputIter>

Simple Equivalent:

double x[10], y[10];
for (n = 0; n < 10; n++) {
x[n] /= y[n];
}

Example of code usage:

double x[10], y[10];
divide_each(x, x+10, y);
Parameters
x_beginIterator pointing to the beginning of the x vector, belonging to the iterator class OutputIter.
x_endIterator pointing to the end of the x vector, belonging to the iterator class OutputIter. The difference between end and begin determines the number of inner iterations.
y_beginIterator pointing to the beginning of the yvector, belonging to the iterator class InputIter.

Definition at line 370 of file utilities.h.

Referenced by DustyGasTransport::getMolarFluxes().

void Cantera::sum_each ( OutputIter  x_begin,
OutputIter  x_end,
InputIter  y_begin 
)
inline

Increment each entry in x by the corresponding entry in y.

The template arguments are: template<class InputIter, class OutputIter>

Parameters
x_beginIterator pointing to the beginning of the x vector, belonging to the iterator class OutputIter.
x_endIterator pointing to the end of the x vector, belonging to the iterator class OutputIter. The difference between end and begin determines the number of inner iterations.
y_beginIterator pointing to the beginning of the yvector, belonging to the iterator class InputIter.

Definition at line 391 of file utilities.h.

Referenced by operator+=().

void Cantera::scatter_copy ( InputIter  begin,
InputIter  end,
OutputIter  result,
IndexIter  index 
)
inline

Copies a contiguous range in a sequence to indexed positions in another sequence.

The template arguments are: template<class InputIter, class OutputIter, class IndexIter>

Example:

vector<double> x(3), y(20), ;
vector<int> index(3);
index[0] = 9;
index[1] = 2;
index[3] = 16;
scatter_copy(x.begin(), x.end(), y.begin(), index.begin());

This routine is templated 3 times. InputIter is an iterator for the source vector OutputIter is an iterator for the destination vector IndexIter is an iterator for the index into the destination vector.

Parameters
beginIterator pointing to the beginning of the source vector, belonging to the iterator class InputIter.
endIterator pointing to the end of the source vector, belonging to the iterator class InputIter. The difference between end and begin determines the number of inner iterations.
resultIterator pointing to the beginning of the output vector, belonging to the iterator class outputIter.
indexIterator pointing to the beginning of the index vector, belonging to the iterator class IndexIter.

Definition at line 431 of file utilities.h.

void Cantera::scatter_mult ( InputIter  mult_begin,
InputIter  mult_end,
RandAccessIter  data,
IndexIter  index 
)
inline

Multiply selected elements in an array by a contiguous sequence of multipliers.

The template arguments are: template<class InputIter, class RandAccessIter, class IndexIter>

Example:

double multipliers[] = {8.9, -2.0, 5.6};
int index[] = {7, 4, 13};
vector_fp data(20);
...
// Multiply elements 7, 4, and 13 in data by multipliers[0], multipliers[1],and multipliers[2],
// respectively
scatter_mult(multipliers, multipliers + 3, data.begin(), index);
Parameters
mult_beginIterator pointing to the beginning of the multiplier vector, belonging to the iterator class InputIter.
mult_endIterator pointing to the end of the multiplier vector, belonging to the iterator class InputIter. The difference between end and begin determines the number of inner iterations.
dataIterator pointing to the beginning of the output vector, belonging to the iterator class RandAccessIter, that will be selectively multiplied.
indexIterator pointing to the beginning of the index vector, belonging to the iterator class IndexIter.

Definition at line 467 of file utilities.h.

void Cantera::scatter_divide ( InputIter  begin,
InputIter  end,
OutputIter  result,
IndexIter  index 
)
inline

Divide selected elements in an array by a contiguous sequence of divisors.

The template arguments are: template<class InputIter, class OutputIter, class IndexIter>

Example:

double divisors[] = {8.9, -2.0, 5.6};
int index[] = {7, 4, 13};
vector_fp data(20);
...
// divide elements 7, 4, and 13 in data by divisors[7] divisors[4], and divisors[13]
// respectively
scatter_divide(divisors, divisors + 3, data.begin(), index);
Parameters
beginIterator pointing to the beginning of the source vector, belonging to the iterator class InputIter.
endIterator pointing to the end of the source vector, belonging to the iterator class InputIter. The difference between end and begin determines the number of inner iterations.
resultIterator pointing to the beginning of the output vector, belonging to the iterator class outputIter.
indexIterator pointing to the beginning of the index vector, belonging to the iterator class IndexIter.

Definition at line 502 of file utilities.h.

doublereal Cantera::sum_xlogx ( InputIter  begin,
InputIter  end 
)
inline

Compute

\[ \sum_k x_k \log x_k. \]

.

The template arguments are: template<class InputIter>

A small number (1.0E-20) is added before taking the log. This templated class does the indicated sun. The template must be an iterator.

Parameters
beginIterator pointing to the beginning, belonging to the iterator class InputIter.
endIterator pointing to the end, belonging to the iterator class InputIter.
Returns
The return from this class is a double.

Definition at line 525 of file utilities.h.

References Tiny.

Referenced by Phase::sum_xlogx().

doublereal Cantera::sum_xlogQ ( InputIter1  begin,
InputIter1  end,
InputIter2  Q_begin 
)
inline

Compute

\[ \sum_k x_k \log Q_k. \]

.

The template arguments are: template<class InputIter1, class InputIter2>

This class is templated twice. The first template, InputIter1 is the iterator that points to $x_k$. The second iterator InputIter2, point to $Q_k$. A small number (1.0E-20) is added before taking the log.

Parameters
beginIterator pointing to the beginning, belonging to the iterator class InputIter1.
endIterator pointing to the end, belonging to the iterator class InputIter1.
Q_beginIterator pointing to the beginning of Q_k, belonging to the iterator class InputIter2.
Returns
The return from this class is hard coded to a doublereal.

Definition at line 553 of file utilities.h.

References Tiny.

Referenced by Phase::sum_xlogQ().

void Cantera::scale ( int  N,
double  alpha,
OutputIter  x 
)
inline

Scale a templated vector by a constant factor.

The template arguments are: template<class OutputIter>

This function is essentially a wrapper around the stl function scale(). The function is has one template parameter, OutputIter. OutputIter is a templated iterator that points to the vector to be scaled.

Parameters
NLength of the vector
alphascale factor - double
xTemplated Iterator to the start of the vector to be scaled.

Definition at line 578 of file utilities.h.

References scale().

R Cantera::poly6 ( x,
R *  c 
)

Templated evaluation of a polynomial of order 6.

Parameters
xValue of the independent variable - First template parameter
cPointer to the polynomial - Second template parameter

Definition at line 590 of file utilities.h.

Referenced by MultiTransport::updateThermal_T().

R Cantera::poly8 ( x,
R *  c 
)

Templated evaluation of a polynomial of order 8.

Parameters
xValue of the independent variable - First template parameter
cPointer to the polynomial - Second template parameter

Definition at line 602 of file utilities.h.

Referenced by MultiTransport::updateThermal_T().

R Cantera::poly10 ( x,
R *  c 
)

Templated evaluation of a polynomial of order 10.

Parameters
xValue of the independent variable - First template parameter
cPointer to the polynomial - Second template parameter

Definition at line 614 of file utilities.h.

R Cantera::poly5 ( x,
R *  c 
)

Templated evaluation of a polynomial of order 5.

Parameters
xValue of the independent variable - First template parameter
cPointer to the polynomial - Second template parameter

Definition at line 627 of file utilities.h.

Referenced by MMCollisionInt::astar(), MMCollisionInt::bstar(), MMCollisionInt::cstar(), MMCollisionInt::fit(), MMCollisionInt::fit_omega22(), and MMCollisionInt::omega22().

R Cantera::poly4 ( x,
R *  c 
)

Evaluates a polynomial of order 4.

Parameters
xValue of the independent variable.
cPointer to the polynomial coefficient array.

Definition at line 639 of file utilities.h.

Referenced by NasaThermo::checkContinuity(), and TransportFactory::fitProperties().

R Cantera::poly3 ( x,
R *  c 
)

Templated evaluation of a polynomial of order 3.

Parameters
xValue of the independent variable - First template parameter
cPointer to the polynomial - Second template parameter

Definition at line 651 of file utilities.h.

Referenced by TransportFactory::fitProperties().

void Cantera::deepStdVectorPointerCopy ( const std::vector< D * > &  fromVec,
std::vector< D * > &  toVec 
)

Templated deep copy of a std vector of pointers.

Performs a deep copy of a std vectors of pointers to an object. This template assumes that that the templated object has a functioning copy constructor. It also assumes that pointers are zero when they are not malloced.

Parameters
fromVecVector of pointers to a templated class. This will be deep-copied to the other vector
toVecVector of pointers to a templated class. This will be overwritten and on return will be a copy of the fromVec

Definition at line 668 of file utilities.h.

void Cantera::copyn ( size_t  n,
const T &  x,
T &  y 
)
inline

Templated function that copies the first n entries from x to y.

The templated type is the type of x and y

Parameters
nNumber of elements to copy from x to y
xThe object x, of templated type const T&
yThe object y, of templated type T&

Definition at line 35 of file vec_functions.h.

void Cantera::divide_each ( T &  x,
const T &  y 
)
inline

Divide each element of x by the corresponding element of y.

This function replaces x[n] by x[n]/y[n], for 0 <= n < x.size()

Parameters
xNumerator object of the division operation with template type T At the end of the calculation, it contains the result.
yDenominator object of the division template type T

Definition at line 49 of file vec_functions.h.

void Cantera::multiply_each ( T &  x,
const T &  y 
)
inline

Multiply each element of x by the corresponding element of y.

This function replaces x[n] by x[n]*y[n], for 0 <= n < x.size() This is a templated function with just one template type.

Parameters
xFirst object of the multiplication with template type T At the end of the calculation, it contains the result.
ySecond object of the multiplication with template type T

Definition at line 66 of file vec_functions.h.

void Cantera::scale ( T &  x,
scale_factor 
)
inline

Multiply each element of x by scale_factor.

This function replaces x[n] by x[n]*scale_factor, for 0 <= n < x.size()

Parameters
xFirst object of the multiplication with template type T At the end of the calculation, it contains the result.
scale_factorscale factor with template type S

Definition at line 81 of file vec_functions.h.

References scale().

doublereal Cantera::dot_product ( const T &  x,
const T &  y 
)
inline

Return the templated dot product of two objects.

Returns the sum of x[n]*y[n], for 0 <= n < x.size().

Parameters
xFirst object of the dot product with template type T At the end of the calculation, it contains the result.
ySecond object of the dot product with template type T

Definition at line 95 of file vec_functions.h.

doublereal Cantera::dot_ratio ( const T &  x,
const T &  y 
)
inline

Returns the templated dot ratio of two objects.

Returns the sum of x[n]/y[n], for 0 <= n < x.size().

Parameters
xFirst object of the dot product with template type T At the end of the calculation, it contains the result.
ySecond object of the dot product with template type T

Definition at line 109 of file vec_functions.h.

References _dot_ratio().

void Cantera::add_each ( T &  x,
const T &  y 
)
inline

Returns a templated addition operation of two objects.

Replaces x[n] by x[n] + y[n] for 0 <= n < x.size()

Parameters
xFirst object of the addition with template type T At the end of the calculation, it contains the result.
ySecond object of the addition with template type T

Definition at line 123 of file vec_functions.h.

doublereal Cantera::_dot_ratio ( InputIter  x_begin,
InputIter  x_end,
InputIter  y_begin,
start_value 
)
inline

Templated dot ratio class.

Calculates the quantity:

S += x[n]/y[n]

The first templated type is the iterator type for x[] and y[]. The second templated type is the type of S.

Parameters
x_beginInputIter type, indicating the address of the first element of x
x_endInputIter type, indicating the address of the last element of x
y_beginInputIter type, indicating the address of the first element of y
start_valueS type, indicating the type of the accumulation result.

Definition at line 149 of file vec_functions.h.

Referenced by dot_ratio().

T Cantera::absmax ( const std::vector< T > &  v)
inline

Finds the entry in a vector with maximum absolute value, and return this value.

Parameters
vVector to be queried for maximum value, with template type T
Returns
Returns an object of type T that is the maximum value,

Definition at line 167 of file vec_functions.h.

std::ostream& Cantera::operator<< ( std::ostream &  os,
const std::vector< T > &  v 
)
inline

Write a vector to a stream.

Definition at line 186 of file vec_functions.h.

std::ostream& Cantera::operator<< ( std::ostream &  s,
Cantera::MultiPhase x 
)
inline

Function to output a MultiPhase description to a stream.

Writes out a description of the contents of each phase of the MultiPhase using the report function.

Parameters
sostream
xReference to a MultiPhase
Returns
returns a reference to the ostream

Definition at line 741 of file MultiPhase.h.

References Phase::name(), MultiPhase::nPhases(), MultiPhase::phase(), MultiPhase::phaseMoles(), and ThermoPhase::report().

Interface* Cantera::importInterface ( std::string  infile,
std::string  id,
std::vector< Cantera::ThermoPhase * >  phases 
)

Import an instance of class Interface from a specification in an input file.

This is the preferred method to create an Interface instance.

Definition at line 125 of file Interface.h.

Kinetics* Cantera::newKineticsMgr ( XML_Node &  phase,
std::vector< ThermoPhase * >  th,
KineticsFactory *  f = 0 
)
inline

Create a new kinetics manager.

Definition at line 78 of file KineticsFactory.h.

Kinetics* Cantera::newKineticsMgr ( std::string  model,
KineticsFactory *  f = 0 
)
inline

Create a new kinetics manager.

Definition at line 91 of file KineticsFactory.h.

doublereal Cantera::ct_dtrcon ( const char *  norm,
ctlapack::upperlower_t  uplot,
const char *  diag,
size_t  n,
doublereal *  a,
size_t  lda,
doublereal *  work,
int *  iwork,
int &  info 
)
inline
Parameters
workMust be dimensioned equal to greater than 3N
iworkMust be dimensioned equal to or greater than N

Definition at line 414 of file ctlapack.h.

Referenced by SquareMatrix::rcondQR().

doublereal Cantera::hz_to_wnum ( doublereal  freq)
inline

convert from Hz to wavenmbers

Definition at line 66 of file rotor.h.

References lightSpeed.

doublereal Cantera::wnum_to_J ( doublereal  w)
inline

Convert from wavenumbers to Joules.

Definition at line 72 of file rotor.h.

References lightSpeed, and Planck.

Referenced by Rotor::partitionFunction(), and Rotor::relPopulation().

std::ostream& Cantera::operator<< ( std::ostream &  s,
Cantera::Crystal x 
)
inline

Prints out the current internal state of the Crystal ThermoPhase object.

Example of usage: s << x << endl;

Parameters
sReference to the ostream to write to
xObject of type Crystal that you are querying
Returns
Returns a reference to the ostream.

Definition at line 60 of file Crystal.h.

References MultiPhase::nPhases(), MultiPhase::phase(), MultiPhase::phaseMoles(), and report().

Variable Documentation

mutex_t dir_mutex
static

Mutex for input directory access.

Definition at line 42 of file application.cpp.

Referenced by Application::addDataDirectory(), and Application::findInputFile().

mutex_t app_mutex
static

Mutex for creating singletons within the application object.

Definition at line 45 of file application.cpp.

Referenced by Application::ApplicationDestroy(), and Application::Instance().

mutex_t xml_mutex
static

Mutex for controlling access to XML file storage.

Definition at line 48 of file application.cpp.

Referenced by Application::close_XML_File(), and Application::get_XML_File().

mutex_t msg_mutex
static

Mutex for access to string messages.

Definition at line 307 of file application.cpp.

Referenced by Application::ThreadMessages::operator->(), and Application::ThreadMessages::removeThreadMessages().

const doublereal DampFactor = 4

Dampfactor is the factor by which the damping factor is reduced by when a reduction in step length is warranted.

Definition at line 1634 of file BEulerInt.cpp.

Referenced by MultiNewton::dampStep(), and NonlinearSolver::dampStep().

const size_t NDAMP = 10

Number of damping steps that are carried out before the solution is deemed a failure.

Definition at line 1635 of file BEulerInt.cpp.

Referenced by NonlinearSolver::dampDogLeg(), MultiNewton::dampStep(), and NonlinearSolver::dampStep().

const string dashedline
Initial value:
=
"-----------------------------------------------------------------"

Definition at line 45 of file MultiNewton.cpp.

static struct awData aWTable[]
static

aWTable is a vector containing the atomic weights database.

The size of the table is given by the initial instantiation.

Definition at line 44 of file Elements.cpp.

Referenced by Elements::LookupWtElements(), and LookupWtElements().

double xxSmall = 1.0E-150
static
int ntypes = 23
static

Define the number of ThermoPhase types for use in this factory routine.

Deprecated:
This entire structure could be replaced with a std::map

Definition at line 70 of file ThermoFactory.cpp.

Referenced by eosTypeString(), and ThermoFactory::newThermoPhase().

string _types[]
static
Initial value:
= {"IdealGas", "Incompressible",
"Surface", "Edge", "Metal", "StoichSubstance",
"PureFluid", "LatticeSolid", "Lattice",
"HMW", "IdealSolidSolution", "DebyeHuckel",
"IdealMolalSolution", "IdealGasVPSS",
"MineralEQ3", "MetalSHEelectrons", "Margules", "PhaseCombo_Interaction",
"IonsFromNeutralMolecule", "FixedChemPot", "MolarityIonicVPSSTP",
"MixedSolventElectrolyte", "Redlich-Kister"
}

Define the string name of the ThermoPhase types that are handled by this factory routine.

Definition at line 73 of file ThermoFactory.cpp.

Referenced by eosTypeString(), and ThermoFactory::newThermoPhase().

int _itypes[]
static
Initial value:
= {cIdealGas, cIncompressible,
cSurf, cEdge, cMetal, cStoichSubstance,
cPureFluid, cLatticeSolid, cLattice,
cMineralEQ3, cMetalSHEelectrons,
cMargulesVPSSTP, cPhaseCombo_Interaction, cIonsFromNeutral, cFixedChemPot,
cMolarityIonicVPSSTP, cMixedSolventElectrolyte, cRedlichKisterVPSSTP
}

Define the integer id of the ThermoPhase types that are handled by this factory routine.

Definition at line 84 of file ThermoFactory.cpp.

Referenced by eosTypeString(), and ThermoFactory::newThermoPhase().

const doublereal T_c = 647.096
const doublereal P_c = 22.064E6
static

Critical Pressure (Pascals)

Definition at line 27 of file WaterPropsIAPWS.cpp.

Referenced by WaterPropsIAPWS::psat().

const doublereal Rho_c = 322.
const doublereal M_water = 18.015268
static
const doublereal Rgas = 8.314371E3
static
const doublereal Min_C_Internal = 0.001

Constant to compare dimensionless heat capacities against zero.

Definition at line 23 of file L_matrix.h.

string _types[]
static
Initial value:
= {"Reservoir", "Reactor", "ConstPressureReactor",
"FlowReactor"
}

Definition at line 21 of file ReactorFactory.cpp.

int _itypes[]
static
Initial value:
= {ReservoirType, ReactorType, ConstPressureReactorType,
FlowReactorType
}

Definition at line 26 of file ReactorFactory.cpp.

const doublereal OneThird = 1.0/3.0
const doublereal FiveSixteenths = 5.0/16.0

5/16

Definition at line 140 of file ct_defs.h.

Referenced by TransportFactory::fitProperties().

const doublereal SqrtTen = std::sqrt(10.0)
const doublereal SqrtEight = std::sqrt(8.0)

sqrt(8)

Definition at line 144 of file ct_defs.h.

Referenced by GasTransport::updateViscosity_T(), and AqueousTransport::updateViscosity_T().

const doublereal SqrtTwo = std::sqrt(2.0)

sqrt(2)

Definition at line 146 of file ct_defs.h.

Referenced by GaussianProfile::cumulative(), Voigt::F(), GaussianProfile::profile(), and Voigt::Voigt().

const doublereal SmallNumber = 1.e-300
const doublereal BigNumber = 1.e300

largest number to compare to inf.

Definition at line 151 of file ct_defs.h.

Referenced by GasKinetics::updateKc().

const doublereal MaxExp = 690.775527898

largest x such that exp(x) is valid

Definition at line 153 of file ct_defs.h.

const doublereal Undef = -999.1234
const doublereal 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 165 of file ct_defs.h.

Referenced by ctml::getFloatArray(), ctml::getFloatCurrent(), ctml::getFloats(), Phase::init(), OneDim::initTimeInteg(), MultiPhaseEquil::stepComposition(), sum_xlogQ(), and sum_xlogx().

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

index returned by functions to indicate "no position"

Definition at line 183 of file ct_defs.h.

Referenced by VCS_PROB::addOnePhaseSpecies(), VCS_PROB::addPhaseElements(), Phase::addUniqueElementAfterFreeze(), NonlinearSolver::boundStep(), solveProb::calc_damping(), HMWSoln::calcMolalitiesCropped(), IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions(), MolarityIonicVPSSTP::calcPseudoBinaryMoleFractions(), SquareMatrix::checkColumns(), BandMatrix::checkColumns(), SquareMatrix::checkRows(), BandMatrix::checkRows(), XML_Node::child(), vcs_MultiPhaseEquil::component(), MultiPhase::elementIndex(), Phase::elementIndex(), ChemEquil::equilibrate(), ChemEquil::estimateEP_Brinkley(), MultiJac::eval(), Inlet1D::eval(), Empty1D::eval(), Symm1D::eval(), OutletRes1D::eval(), Domain1D::eval(), Surf1D::eval(), ReactingSurf1D::eval(), AxiStagnFlow::eval(), FreeFlame::eval(), Domain1D::evalss(), ReactionPathDiagram::exportToDot(), ckr::extractSlashData(), EdgeKinetics::finalize(), InterfaceKinetics::finalize(), MolalityVPSSTP::findCLMIndex(), findFirstNotOfWS(), findFirstWS(), Application::findInputFile(), XML_Reader::findQuotedString(), findUnbackslashed(), ctml::get_CTML_Tree(), Application::get_XML_File(), CKParser::getCKLine(), MultiPhaseEquil::getComponents(), getEfficiencies(), ctml::getFloatArray(), ctml::getMap(), ctml::getMatrixValues(), IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(), ctml::getPairs(), getReagents(), ImplicitSurfChem::ImplicitSurfChem(), importKinetics(), importSolution(), LiquidTranInteraction::init(), MultiPhase::init(), ChemEquil::initialize(), WaterSSTP::initThermoXML(), IonsFromNeutralVPSSTP::initThermoXML(), IdealMolalSoln::initThermoXML(), DebyeHuckel::initThermoXML(), HMWSoln::initThermoXML(), installReactionArrays(), LatticeSolidPhase::installSlavePhases(), installSpecies(), invert(), Kinetics::kineticsSpeciesIndex(), Kinetics::kineticsSpeciesName(), LookupGe(), PDSS_HKFT::LookupGe(), MargulesVPSSTP::MargulesVPSSTP(), Phase::massFraction(), GeneralSpeciesThermo::maxTemp(), LatticeSolidPhase::maxTemp(), SimpleThermo::maxTemp(), ShomateThermo::maxTemp(), NasaThermo::maxTemp(), VPSSMgr::maxTemp(), GeneralSpeciesThermo::minTemp(), LatticeSolidPhase::minTemp(), SimpleThermo::minTemp(), ShomateThermo::minTemp(), NasaThermo::minTemp(), VPSSMgr::minTemp(), MixedSolventElectrolyte::MixedSolventElectrolyte(), SimpleThermo::modifyParams(), Phase::moleFraction(), vcs_MultiPhaseEquil::numComponents(), vcs_MultiPhaseEquil::numElemConstraints(), FlowDevice::outletSpeciesMassFlowRate(), parseCompString(), parseSpeciesName(), XML_Reader::parseTag(), PhaseCombo_Interaction::PhaseCombo_Interaction(), Kinetics::phaseIndex(), NonlinearSolver::print_solnDelta_norm_contrib(), solveProb::printFinal(), solveProb::printIteration(), Mu0Poly::processCoeffs(), ReactionPathDiagram::ReactionPathDiagram(), CKParser::readReactionSection(), HMWSoln::readXMLBinarySalt(), PhaseCombo_Interaction::readXMLBinarySpecies(), RedlichKisterVPSSTP::readXMLBinarySpecies(), MargulesVPSSTP::readXMLBinarySpecies(), MixedSolventElectrolyte::readXMLBinarySpecies(), RedlichKwongMFTP::readXMLCrossFluid(), HMWSoln::readXMLLambdaNeutral(), HMWSoln::readXMLMunnnNeutral(), HMWSoln::readXMLPsiCommonAnion(), HMWSoln::readXMLPsiCommonCation(), RedlichKwongMFTP::readXMLPureFluid(), HMWSoln::readXMLThetaAnion(), HMWSoln::readXMLThetaCation(), HMWSoln::readXMLZetaCation(), RedlichKisterVPSSTP::RedlichKisterVPSSTP(), GeneralSpeciesThermo::refPressure(), VPSSMgr::refPressure(), HMWSoln::relative_molal_enthalpy(), MolalityVPSSTP::report(), MolalityVPSSTP::reportCSV(), NonlinearSolver::residErrorNorm(), vcs_VolPhase::resize(), OneDim::resize(), PhaseCombo_Interaction::resizeNumInteractions(), RedlichKisterVPSSTP::resizeNumInteractions(), MargulesVPSSTP::resizeNumInteractions(), MixedSolventElectrolyte::resizeNumInteractions(), MolalityVPSSTP::setMolalitiesByName(), vcs_VolPhase::setMolesFromVCS(), NonlinearSolver::solnErrorNorm(), OneDim::solve(), MultiNewton::solve(), solveProb::solve(), solveSP::solveSP(), Phase::speciesIndex(), MultiPhase::speciesIndex(), Kinetics::speciesPhase(), Kinetics::speciesPhaseIndex(), split(), split_at_pound(), OneDim::ssnorm(), MultiNewton::step(), tokenizeString(), Unit::toSI(), vcs_VolPhase::transferElementsFM(), InterfaceKinetics::updateKc(), STITbyPDSS::updatePropertiesTemp(), VCS_SOLVE::vcs_basopt(), VCS_SOLVE::vcs_elem_rearrange(), VCS_SOLVE::vcs_phaseStabilityTest(), VCS_SOLVE::vcs_popPhaseID(), VCS_PROB::VCS_PROB(), VCS_SOLVE::vcs_RxnStepSizes(), VCS_SOLVE::vcs_solve_TP(), XML_Node::write_int(), and Application::Messages::write_logfile().

const int ELEMENTARY_RXN = 1

A reaction with a rate coefficient that depends only on temperature.

Example: O + OH <-> O2 + H

Definition at line 26 of file reaction_defs.h.

Referenced by AqueousKinetics::addReaction(), GasKinetics::addReaction(), getRateCoefficient(), and rxninfo::installReaction().

const int THREE_BODY_RXN = 2

A reaction that requires a third-body collision partner.

Example: O2 + M <-> O + O + M

Definition at line 32 of file reaction_defs.h.

Referenced by GasKinetics::addReaction(), getRateCoefficient(), and rxninfo::installReaction().

const int FALLOFF_RXN = 4

The general form for an association or dissociation reaction, with a pressure-dependent rate.

Example: CH3 + H (+M) <-> CH4 (+M)

Definition at line 38 of file reaction_defs.h.

Referenced by GasKinetics::addReaction(), getRateCoefficient(), and rxninfo::installReaction().

const int PLOG_RXN = 5

A pressure-dependent rate expression consisting of several Arrhenius rate expressions evaluated at different pressures.

The final rate is calculated by logarithmically interpolating between the two rates that bracket the current pressure.

Definition at line 46 of file reaction_defs.h.

Referenced by GasKinetics::addReaction(), getRateCoefficient(), and rxninfo::installReaction().

const int CHEBYSHEV_RXN = 6

A general pressure-dependent reaction where k(T,P) is defined in terms of a bivariate Chebyshev polynomial.

Definition at line 52 of file reaction_defs.h.

Referenced by GasKinetics::addReaction(), getRateCoefficient(), and rxninfo::installReaction().

const int CHEMACT_RXN = 8

A chemical activation reaction.

For these reactions, the rate falls off as the pressure increases, due to collisional stabilization of a reaction intermediate. Example: Si + SiH4 (+M) <-> Si2H2 + H2 (+M), which competes with Si + SiH4 (+M) <-> Si2H4 (+M).

Todo:
Implement chemical activation reactions.

Definition at line 61 of file reaction_defs.h.

Referenced by getRateCoefficient(), and rxninfo::installReaction().

const int SURFACE_RXN = 20

A reaction occurring on a surface.

Definition at line 66 of file reaction_defs.h.

Referenced by getRateCoefficient(), and rxninfo::installReaction().

const int EDGE_RXN = 22

A reaction occurring at a one-dimensional interface between two surface phases.

Definition at line 72 of file reaction_defs.h.

Referenced by rxninfo::installReaction().

const int GLOBAL_RXN = 30

A global reaction.

These may have non-integral reaction orders, and are not allowed to be reversible.

Definition at line 78 of file reaction_defs.h.

const int cEST_solvent = 0

Electrolyte species type.

Definition at line 19 of file electrolytes.h.

Referenced by DebyeHuckel::initThermoXML(), HMWSoln::initThermoXML(), interp_est(), and HMWSoln::interp_est().

const int cHMWSoln0 = 45010

eosTypes returned for this ThermoPhase Object

Definition at line 41 of file electrolytes.h.

Referenced by HMWSoln::eosType().

const int cDebyeHuckel0 = 46010

eosTypes returned for this ThermoPhase Object

Definition at line 48 of file electrolytes.h.

Referenced by DebyeHuckel::eosType().

const int cNone = 0

This generic id is used as the default in virtual base classes that employ id's.

It is used to indicate the lack of an inherited class that would define the id.

Definition at line 12 of file mix_defs.h.

const int cIdealGas = 1

Equation of state types:

These types are used in the member function eosType() of the virtual base class ThermoPhase. They are used to distinguish different types of equation of states. Also, they may be used for upcasting from the ThermoPhase class. Their id's should be distinct.

Users who wish to define their own equation of states which derive from ThermoPhase should define a unique id which doesn't conflict with those listed below. The Cantera Kernel however, will not be know about the class and will therefore not be able to initialize the class within its "factory" routines.

Definition at line 36 of file mix_defs.h.

Referenced by IdealGasPhase::eosType(), ThermoFactory::newThermoPhase(), and vcs_VolPhase::setPtrThermoPhase().

const int cSurf = 3

A surface phase. Used by class SurfPhase.

Definition at line 39 of file mix_defs.h.

Referenced by Kinetics::addPhase(), SurfPhase::eosType(), getStick(), ThermoFactory::newThermoPhase(), and vcs_VolPhase::setPtrThermoPhase().

const int cMetal = 4

A metal phase.

Definition at line 42 of file mix_defs.h.

Referenced by MetalPhase::eosType(), ThermoFactory::newThermoPhase(), and vcs_VolPhase::setPtrThermoPhase().

const int cEdge = 6

An edge between two 2D surfaces.

Definition at line 57 of file mix_defs.h.

Referenced by Kinetics::addPhase(), EdgePhase::eosType(), getStick(), ThermoFactory::newThermoPhase(), and vcs_VolPhase::setPtrThermoPhase().

const int cFixedChemPot = 70

Stoichiometric compound with a constant chemical potential.

Definition at line 60 of file mix_defs.h.

Referenced by FixedChemPotSSTP::eosType(), and ThermoFactory::newThermoPhase().

const int cIdealSolidSolnPhase = 5009

Constant partial molar volume solution IdealSolidSolnPhase.h.

Definition at line 63 of file mix_defs.h.

Referenced by ThermoFactory::newThermoPhase(), and vcs_VolPhase::setPtrThermoPhase().

const int cHMW = 40

HMW - Strong electrolyte using the Pitzer formulation.

Definition at line 66 of file mix_defs.h.

Referenced by ThermoFactory::newThermoPhase().

const int cDebyeHuckel = 50

DebyeHuckel - Weak electrolyte using various Debye-Huckel formulations.

Definition at line 69 of file mix_defs.h.

Referenced by ThermoFactory::newThermoPhase().

const int cIdealMolalSoln = 60

IdealMolalSoln - molality based solution with molality-based act coeffs of 1.

Definition at line 72 of file mix_defs.h.

Referenced by ThermoFactory::newThermoPhase().

const int cMixtureFugacityTP = 700

Fugacity Models.

Definition at line 78 of file mix_defs.h.

const int cVPSS_IdealGas = 1001

Variable Pressure Standard State ThermoPhase objects.

Definition at line 93 of file mix_defs.h.

Referenced by ThermoFactory::newThermoPhase(), and VPSSMgrFactory::newVPSSMgr().

const int PHSCALE_PITZER = 0

Scale to be used for the output of single-ion activity coefficients is that used by Pitzer.

This is the internal scale used within the code. One property is that the activity coefficients for the cation and anion of a single salt will be equal. This scale is the one presumed by the formulation of the single-ion activity coefficients described in this report.

Activity coefficients for species k may be altered between scales s1 to s2 using the following formula

\[ ln(\gamma_k^{s2}) = ln(\gamma_k^{s1}) + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right) \]

where j is any one species.

Definition at line 963 of file MolalityVPSSTP.h.

Referenced by HMWSoln::applyphScale(), HMWSoln::s_updateScaling_pHScaling(), HMWSoln::s_updateScaling_pHScaling_dP(), HMWSoln::s_updateScaling_pHScaling_dT(), HMWSoln::s_updateScaling_pHScaling_dT2(), and MolalityVPSSTP::setpHScale().

const int PHSCALE_NBS = 1

Scale to be used for evaluation of single-ion activity coefficients is that used by the NBS standard for evaluation of the pH variable.

This is not the internal scale used within the code.

Activity coefficients for species k may be altered between scales s1 to s2 using the following formula

\[ ln(\gamma_k^{s2}) = ln(\gamma_k^{s1}) + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right) \]

where j is any one species. For the NBS scale, j is equal to the Cl- species and

\[ ln(\gamma_{Cl-}^{s2}) = \frac{-A_{\phi} \sqrt{I}}{1.0 + 1.5 \sqrt{I}} \]

This is the NBS pH scale, which is used in all conventional pH measurements. and is based on the Bates-Guggenheim equations.

Definition at line 989 of file MolalityVPSSTP.h.

Referenced by HMWSoln::applyphScale(), HMWSoln::s_updateScaling_pHScaling(), HMWSoln::s_updateScaling_pHScaling_dP(), HMWSoln::s_updateScaling_pHScaling_dT(), HMWSoln::s_updateScaling_pHScaling_dT2(), and MolalityVPSSTP::setpHScale().

const int cAC_CONVENTION_MOLAR = 0

Standard state uses the molar convention.

Definition at line 25 of file ThermoPhase.h.

Referenced by ThermoPhase::activityConvention().

const int cAC_CONVENTION_MOLALITY = 1

Standard state uses the molality convention.

Definition at line 27 of file ThermoPhase.h.

Referenced by MolalityVPSSTP::activityConvention(), and LiquidTransport::stefan_maxwell_solve().

const int cSS_CONVENTION_TEMPERATURE = 0

Standard state uses the molar convention.

Definition at line 35 of file ThermoPhase.h.

Referenced by importPhase(), MixtureFugacityTP::standardStateConvention(), and PureFluidPhase::standardStateConvention().

const int cSS_CONVENTION_VPSS = 1

Standard state uses the molality convention.

Definition at line 37 of file ThermoPhase.h.

Referenced by importPhase(), and VPStandardStateTP::standardStateConvention().

const int cSS_CONVENTION_SLAVE = 2

Standard state thermodynamics is obtained from slave ThermoPhase objects.

Definition at line 39 of file ThermoPhase.h.

Referenced by importPhase(), and LatticeSolidPhase::standardStateConvention().