Cantera Namespace Reference

Namespace for the Cantera kernel. More...

Classes

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  ElementRangeError
 An element 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  LogPrintCtrl
 This class provides some printing and cropping utilities for writing to the logfile. More...
class  Application
 Class to hold global data. More...
class  PrintCtrl
 This class provides some printing and cropping utilities. 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  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  ConstCpPoly
 A constant-heat capacity species thermodynamic property manager class. More...
class  ConstDensityThermo
 Overloads the virtual methods of class ThermoPhase to implement the incompressible equation of state. More...
class  SpeciesRangeError
 Specific fatal error indicating that the index of a species is out of range. More...
class  Constituents
 Class Constituents manages a set of elements and species. 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...
struct  awData
 Database for atomic molecular weights. More...
class  ElementsFrozen
 Exception class to indicate a fixed set of elements. More...
class  Elements
 Object containing the elements that make up species in a phase. More...
class  GeneralSpeciesThermo
 A species thermodynamic property manager for a phase. More...
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  LatticePhase
 A simple thermoydnamics model for a bulk phase, assuming a lattice of solid atoms. 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  MolalityVPSSTP
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  Nasa9PolyMultiTempRegion
 The NASA 9 polynomial parameterization for a single species encompassing multiple temperature regions. More...
class  NasaPoly1
 The NASA polynomial parameterization for one temperature range. 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  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_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 mater. More...
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  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  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 thermoydnamic manager for an individual species' reference state. More...
class  STITbyPDSS
 Class for the thermoydnamic manager for an individual species' reference state which usess 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...
class  SpeciesThermo1
 This species thermo manager requires that all species have the same parameterization. More...
struct  UnknownThermoParam
 Error for unknown thermo parameterization. More...
struct  ThermoIndexData
 holds parameterization-dependent index information More...
class  State
 Manages the independent variables of temperature, mass density, and species mass/mole fraction that define the thermodynamic state. 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 thermoydnamics model for a surface phase, assuming an ideal solution model. More...
class  UnknownThermoPhaseModel
 Specific error to be thrown if the type of Thermo mananger 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  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  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  MultiPhase
 A class for multiphase mixtures. 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  Falloff
 Base class for falloff function calculators. More...
class  FalloffFactory
 Factory class to construct falloff function calculators. More...
class  Kinetics
 Public interface for kinetics managers. More...

Typedefs

typedef std::map< std::string,
doublereal > 
compositionMap
 Map connecting a string name with a double.
typedef ct::ctvector_fp array_fp
typedef ct::ctvector_fp vector_fp
typedef ct::ctvector_int array_int
typedef ct::ctvector_int vector_int
typedef vector_int group_t
 typedef for a group of species.
typedef std::vector< group_tgrouplist_t
 typedef for a vector of groups of species.
typedef doublereal * workPtr
 Typedef for a pointer to temporary work storage.
typedef const doublereal * const_workPtr
 typedef for a pointer to temporary work storage which is treated as constant
typedef Phase phase_t
 typedef for the base Phase class
typedef ThermoPhase thermophase_t
 typedef for the ThermoPhase class
typedef ThermoPhase thermo_t
 typedef for the ThermoPhase class
typedef Kinetics kinetics_t
 typedef for the kinetics base class

Functions

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.
doublereal fmaxx (doublereal x, doublereal y)
 inline function to return the max value of two doubles.
doublereal fminn (doublereal x, doublereal y)
 inline function to return the min value of two doubles.
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.
int nErrors ()
 Return the number of errors that have been encountered so far.
std::string lastErrorMessage ()
 Returns the last error message.
void setError (std::string r, std::string msg)
 Set an error condition in the application class without throwing an exception.
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 popError ()
 Discard the last error message.
std::string findInputFile (std::string name)
 Find an input file.
void addDirectory (std::string dir)
 Add a directory to the input file search path.
void appdelete ()
 Delete and free all memory associated with the application.
void thread_complete ()
 Delete and free memory allocated per thread in multithreaded applications.
std::string canteraRoot ()
 Returns root directory where Cantera where installed.
void setTmpDir (std::string tmp)
 Sets the temporary file directory.
std::string tmpDir ()
 Retrieves the directory name where temporary files are created.
std::string sleep ()
 Delay time in seconds.
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 setLogger (Logger *logwriter)
 Install a logger.
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.
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.
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.
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.
Applicationapp ()
 Return a pointer to the application object.
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 lowercase (const std::string &s)
 Cast a copy of a string to lower case.
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.
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.
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.
template<class T , class S >
max (T i, S j)
 Maximum of two templated quantities, i and j.
template<class T , class S >
min (T i, S j)
 Minimum of two templated quantities, i and j.
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)
 Tempalted Inner product of two vectors of length 5.
template<class V >
doublereal dot6 (const V &x, const V &y)
 Tempalted 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 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.
void fbo_copy_dbl_1 (doublereal *const copyTo, const doublereal *const copyFrom, const int len)
 Copy a vector of doubles in an efficient, fast manner.
void fvo_copy_dbl_1 (std::vector< doublereal > &copyTo, const std::vector< doublereal > &copyFrom, const int len)
 Copy a vector<doubles> in an efficient, fast manner.
void fbo_zero_dbl_1 (doublereal *const v, const int len)
 Zero a double vector in an efficient, fast manner.
void fvo_zero_dbl_1 (std::vector< doublereal > &v, const int len)
 Zero a vector<doubles> in an efficient, fast manner.
XML_NodefindXMLPhase (XML_Node *root, const std::string &phaseName)
 Search an XML_Node tree for a named phase XML_Node.
void installMu0ThermoFromXML (std::string speciesName, SpeciesThermo &sp, int k, const XML_Node *Mu0Node_ptr)
 Install a Mu0 polynomial thermodynamic reference state.
std::string report (const ThermoPhase &th, const bool show_thermo=true)
 Format a summary of the mixture state for output.
void writephase (const ThermoPhase &th, bool show_thermo)
 Write a phase report to the screen device.
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.
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.
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.
bool importPhase (XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory=0)
 Import a phase information into an empty thermophase object.
bool installSpecies (int 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.
ThermoPhasenewThermoPhase (std::string model, ThermoFactory *f=0)
 Create a new thermo manager instance.
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.
int equilibrate (thermo_t &s, const char *XY, int solver=-1, doublereal rtol=1.0e-9, int maxsteps=5000, int maxiter=100, int loglevel=-99)
 Equilibrate a ThermoPhase object.
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.
std::ostream & operator<< (std::ostream &s, Cantera::MultiPhase &x)
 Function to output a MultiPhase description to a stream.
int BasisOptimize (int *usedZeroedSpecies, bool doFormRxn, MultiPhase *mphase, vector_int &orderVectorSpecies, vector_int &orderVectorElements, vector_fp &formRxnMatrix)
 Choose the optimum basis of species for the equilibrium calculations.
int ElemRearrange (int nComponents, const vector_fp &elementAbundances, MultiPhase *mphase, vector_int &orderVectorSpecies, vector_int &orderVectorElements)
 This subroutine handles the potential rearrangement of the constraint equations represented by the Formula Matrix.
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=5000, 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=5000, 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=5000, int maxiter=100, int loglevel=-99)
 Set a multi-phase chemical solution to chemical equilibrium.

Variables

const doublereal Pi = 3.1415926
 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 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 doublereal T_c = 647.096
 Critical Temperature value (kelvin).
const doublereal Rho_c = 322.
 Value of the Density at the critical point (kg m-3).
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.02214179e26
 Avogadro's Number.
const doublereal GasConstant = 8314.47215
 Universal Gas Constant. 2006 CODATA value.
const doublereal logGasConstant = 9.025752908
const doublereal OneAtm = 1.01325e5
 One atmosphere.
const doublereal GasConst_cal_mol_K = 1.987
 Universal gas constant in cal/mol/K.
const doublereal Boltzmann = GasConstant / Avogadro
 Boltzmann's constant.
const doublereal Planck = 6.62606896e-34
 Planck's constant. Units of J-s.
const doublereal Planck_bar = 1.05457162853e-34
const doublereal logBoltz_Planck = 23.7599032
 log(k/h)
const doublereal StefanBoltz = 5.6704004e-8
 Stefan-Boltzmann constant.
Electron Properties

const doublereal ElectronCharge = 1.60217648740e-19
const doublereal ElectronMass = 9.1093821545e-31
const doublereal Faraday = ElectronCharge * Avogadro
Electromagnetism

Cantera uses the MKS unit system.

const doublereal epsilon_0 = 8.85417817e-12
 Permittivity of free space $ \epsilon_0 $ in F/m.
const doublereal permeability_0 = 4.0e-7*Pi
 Permeability of free space $ \mu_0 $ in N/A^2.
const doublereal lightSpeed = 1.0/std::sqrt(epsilon_0 * permeability_0)
 Speed of Light (m/s).
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
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 conventention

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 conventention

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 doublereal H [4]
const doublereal Hij [6][7]
 parameter
const doublereal TStar = 647.27
const doublereal rhoStar = 317.763
const doublereal presStar = 22.115E6
const doublereal muStar = 55.071E-6

Detailed Description

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

typedef const doublereal* const_workPtr

typedef for a pointer to temporary work storage which is treated as constant

Definition at line 221 of file ct_defs.h.

typedef vector_int group_t

typedef for a group of species.

A group of species is a subset of the species in a phase.

Definition at line 211 of file ct_defs.h.

typedef std::vector<group_t> grouplist_t

typedef for a vector of groups of species.

A grouplist of species is a vector of groups.

Definition at line 216 of file ct_defs.h.

typedef for the kinetics base class

Definition at line 1004 of file Kinetics.h.

typedef Phase phase_t

typedef for the base Phase class

Definition at line 544 of file Phase.h.

typedef for the ThermoPhase class

Definition at line 2158 of file ThermoPhase.h.

typedef for the ThermoPhase class

Definition at line 2155 of file ThermoPhase.h.

typedef doublereal* workPtr

Typedef for a pointer to temporary work storage.

Definition at line 219 of file ct_defs.h.


Function Documentation

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_begin InputIter type, indicating the address of the first element of x
x_end InputIter type, indicating the address of the last element of x
y_begin InputIter type, indicating the address of the first element of y
start_value S type, indicating the type of the accumulation result.

Definition at line 145 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:
v Vector 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 161 of file vec_functions.h.

doublereal actEnergyToSI ( std::string  unit  ) 

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

Parameters:
unit String containing the activation energy units

Definition at line 1434 of file misc.cpp.

References Unit::actEnergyToSI(), and Unit::units().

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:
x First object of the addition with template type T At the end of the calculation, it contains the result.
y Second object of the addition with template type T

Definition at line 120 of file vec_functions.h.

Application* Cantera::app (  )  [inline]
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 922 of file misc.cpp.

References Application::ApplicationDestroy(), FactoryBase::deleteFactories(), and Unit::deleteUnit().

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:
dptr pointer to the input c string
Returns:
Returns the double

On any error, it will throw a CanteraError signal.

Referenced by Elements::addUniqueElement(), PDSS_HKFT::constructPDSSXML(), HMWSoln::constructPhaseXML(), XML_Node::fp_value(), HMWSoln::readXMLBinarySalt(), HMWSoln::readXMLPsiCommonAnion(), and HMWSoln::readXMLPsiCommonCation().

void close_XML_File ( std::string  file  ) 

Close a Cantera input file.

Parameters:
file String containing the relative or absolute file name

Definition at line 1071 of file misc.cpp.

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

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:
n Number of elements to copy from x to y
x The object x, of templated type const T&
y The object y, of templated type T&

Definition at line 38 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:
x Numerator object of the division operation with template type T At the end of the calculation, it contains the result.
y Denominator object of the division template type T

Definition at line 51 of file vec_functions.h.

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:
x First object of the dot product with template type T At the end of the calculation, it contains the result.
y Second object of the dot product with template type T

Definition at line 94 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:
x First object of the dot product with template type T At the end of the calculation, it contains the result.
y Second object of the dot product with template type T

Definition at line 107 of file vec_functions.h.

References _dot_ratio().

void Cantera::fbo_copy_dbl_1 ( doublereal *const   copyTo,
const doublereal *const   copyFrom,
const int  len 
) [inline]

Copy a vector of doubles in an efficient, fast manner.

No checking is done other that to check that len is greater than 0

Parameters:
copyTo Vector to receive the copy
copyFrom Vector from which the copy is coming
len Length of the copy

Definition at line 181 of file vec_functions.h.

void Cantera::fbo_zero_dbl_1 ( doublereal *const   v,
const int  len 
) [inline]

Zero a double vector in an efficient, fast manner.

No checking is done other that to check that len is greater than 0

Parameters:
v Vector to be zeroed
len Length of the copy

Definition at line 210 of file vec_functions.h.

Referenced by HMWSoln::s_update_dlnMolalityActCoeff_dP(), and HMWSoln::s_update_dlnMolalityActCoeff_dT().

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:
str String input vector
a Output pointer to a vector of floats
delim character delimiter. Defaults to a space
Returns:
Returns the number of floats found and converted
XML_Node * findXMLPhase ( XML_Node *  root,
const std::string &  phaseName 
)

Search an XML_Node tree for a named phase XML_Node.

Search for a phase Node matching a name.

Parameters:
root Starting XML_Node* pointer for the search
phaseName Name of the phase to search for
Returns:
Returns the XML_Node pointer if the phase is found. If the phase is not found, it returns 0

Referenced by PDSS_Water::constructPDSSFile(), PDSS_SSVol::constructPDSSFile(), PDSS_IdealGas::constructPDSSFile(), PDSS_HKFT::constructPDSSFile(), PDSS_ConstVol::constructPDSSFile(), WaterSSTP::constructPhaseFile(), IdealSolidSolnPhase::constructPhaseFile(), IdealMolalSoln::constructPhaseFile(), HMWSoln::constructPhaseFile(), DebyeHuckel::constructPhaseFile(), and ThermoPhase::initThermoFile().

doublereal Cantera::fmaxx ( doublereal  x,
doublereal  y 
) [inline]
doublereal Cantera::fminn ( doublereal  x,
doublereal  y 
) [inline]

inline function to return the min value of two doubles.

Parameters:
x double value
y second double value

Definition at line 180 of file ct_defs.h.

Referenced by _maxTemp().

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:
x double to be converted
std::string fp2str ( const double  x,
const std::string &  fmt 
)
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:
val String value of the double
Returns:
Returns a doublereal value

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

doublereal fpValueCheck ( std::string  val  ) 

Translate a string into one doublereal value.

Error checking is carried on the conversion.

Parameters:
val String value of the double
Returns:
Returns a doublereal value
void Cantera::fvo_copy_dbl_1 ( std::vector< doublereal > &  copyTo,
const std::vector< doublereal > &  copyFrom,
const int  len 
) [inline]

Copy a vector<doubles> in an efficient, fast manner.

No checking is done other that to check that len is greater than 0

Parameters:
copyTo Vector to receive the copy
copyFrom Vector from which the copy is coming
len Length of the copy

Definition at line 196 of file vec_functions.h.

Referenced by HMWSoln::s_updateScaling_pHScaling(), HMWSoln::s_updateScaling_pHScaling_dT(), and HMWSoln::s_updateScaling_pHScaling_dT2().

void Cantera::fvo_zero_dbl_1 ( std::vector< doublereal > &  v,
const int  len 
) [inline]

Zero a vector<doubles> in an efficient, fast manner.

No checking is done other that to check that len is greater than 0

Parameters:
v Vector to be zeroed
len Length of the copy

Definition at line 223 of file vec_functions.h.

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:
file String containing the relative or absolute file name
debug Debug flag

Definition at line 941 of file misc.cpp.

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

Referenced by Elements::addElementsFromXML(), electrodeElectron::electrodeElectron(), MetalSHEelectrons::MetalSHEelectrons(), MineralEQ3::MineralEQ3(), StoichSubstanceSSTP::StoichSubstanceSSTP(), and SurfPhase::SurfPhase().

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:
nameTarget This is the XML element name to look for.
file_ID This is a concatenation of two strings seperated 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.
root If 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 1914 of file misc.cpp.

References XML_Node::findNameID(), and Application::get_XML_File().

Referenced by PDSS_SSVol::constructPDSSFile(), PDSS_HKFT::constructPDSSFile(), PDSS_ConstVol::constructPDSSFile(), electrodeElectron::electrodeElectron(), VPSSMgr_Water_HKFT::initThermoXML(), VPSSMgr_Water_ConstVol::initThermoXML(), VPSSMgr_ConstVol::initThermoXML(), IdealSolidSolnPhase::initThermoXML(), IdealMolalSoln::initThermoXML(), HMWSoln::initThermoXML(), DebyeHuckel::initThermoXML(), MetalSHEelectrons::MetalSHEelectrons(), MineralEQ3::MineralEQ3(), StoichSubstanceSSTP::StoichSubstanceSSTP(), and SurfPhase::SurfPhase().

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_ID This is a concatenation of two strings seperated 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.
root If 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 1867 of file misc.cpp.

References XML_Node::findID(), and Application::get_XML_File().

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

Get the file name without the path or extension.

Parameters:
fullPath Input file name consisting of the full file name
Returns:
Returns the basename
std::string int2str ( const int  n  ) 

Convert an int to a string.

Parameters:
n int to be converted
std::string int2str ( const int  n,
const std::string &  fmt 
)
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:
val String value of the integer
Returns:
Returns an integer
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:
infile Input file name
Returns:
Returns a logfile name
std::string lowercase ( const std::string &  s  ) 
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:
x First object of the multiplication with template type T At the end of the calculation, it contains the result.
y Second object of the multiplication with template type T

Definition at line 67 of file vec_functions.h.

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:
spDataNodeList This vector contains a list of species XML nodes that will be in the phase
f Pointer to a SpeciesThermoFactory. optional parameter. Defautls to NULL.
opt Boolean defaults to false.
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 mananger

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

Parameters:
stype String specifying the species thermo type
f Pointer to a SpeciesThermoFactory. optional parameter. Defautls to NULL.
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:
type Species thermo type.
f Pointer to a SpeciesThermoFactory. optional parameter. Defautls to NULL.

Referenced by 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_ptr Variable pressure standard state ThermoPhase object that will be the owner.
phaseNode_ptr Pointer to the ThermoPhase phase XML Node
spDataNodeList This vector contains a list of species XML nodes that will be in the phase
f Pointer to a SpeciesThermoFactory. optional parameter. Defautls to NULL.
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:
type Species thermo type.
vp_ptr Variable pressure standard state ThermoPhase object that will be the owner.
f Pointer to a SpeciesThermoFactory. optional parameter. Defautls to NULL.
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:
m Matrix
a scalar

Definition at line 353 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:
x First matrix
y Second matrix, which is a const

Definition at line 366 of file Array.h.

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

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:
s ostream
x Reference to a MultiPhase
Returns:
returns a reference to the ostream

Definition at line 707 of file MultiPhase.h.

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

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:
s Reference to the ostream to write to
m Object of type Array2D that you are querying
Returns:
Returns a reference to the ostream.

Definition at line 332 of file Array.h.

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

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:
s output stream
title plot title
names vector of variable names
data N x M data array. data(n,m) is the m^th value of the n^th variable.
void outputTEC ( std::ostream &  s,
const std::string &  title,
const std::vector< std::string > &  names,
const Array2D &  data 
)

Write a Tecplot data file.

Parameters:
s output stream
title plot title
names vector of variable names
data N x M data array. data(n,m) is the m^th value of the n^th variable.
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:
ss original string consisting of multiple key:composition pairs on multiple lines
x Output map consisting of a composition map, which is a string to double map

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

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

Format a summary of the mixture state for output.

Parameters:
th ThermoPhase object to create a report about
show_thermo Boolean indicating whether the thermo functions of the phase should be written out
Returns:
Returns a string containing the report

Referenced by operator<<(), and writephase().

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:
x First object of the multiplication with template type T At the end of the calculation, it contains the result.
scale_factor scale factor with template type S

Definition at line 81 of file vec_functions.h.

References scale().

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

Parse a composition string into individual key:composition pairs.

Parameters:
ss original string consisting of multiple key:composition pairs on multiple lines
w Output vector consisting of single key:composition items in each index.
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:
str On output 'str' contains the same characters as on input except the leading and trailing white space and comments have been removed.
std::string stripnonprint ( const std::string &  s  ) 

Strip non-printing characters wherever they are.

Parameters:
s Input string
Returns:
Returns a copy of the string, stripped of all non-printing characters.

Referenced by Application::addDataDirectory().

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:
s Input string
Returns:
Returns a copy of the string, stripped of leading and trailing white space

Referenced by Elements::addUniqueElement(), and XML_Node::addValue().

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:
strSI string to be converted. One or two tokens
Returns:
returns a converted double

Referenced by PDSS_HKFT::constructPDSSXML().

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 931 of file misc.cpp.

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

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:
oval String to be broken up
v Output vector of tokens.
doublereal toSI ( std::string  unit  ) 

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

Parameters:
unit String containing the units

Definition at line 1424 of file misc.cpp.

References Unit::toSI(), and Unit::units().

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

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

Line wrap a string via a copy operation.

Parameters:
s Input string to be line wrapped
len Length at which to wrap. The default is 70.
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 1570 of file misc.cpp.

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

void Cantera::writephase ( const ThermoPhase &  th,
bool  show_thermo 
)

Write a phase report to the screen device.

This routine is a wrapper around the report() function. It writes to the screen device.

Parameters:
th ThermoPhase object to create a report about
show_thermo Boolean indicating whether the thermo functions of the phase should be written out

Definition at line 51 of file phasereport.cpp.

References report(), and writelog().

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:
fname Output file name
fmt Either TEC or XL or CSV
plotTitle Title of the plot
names vector of variable names
data N x M data array. data(n,m) is the m^th value of the n^th variable.

Variable Documentation

const doublereal BigNumber = 1.e300

largest number to compare to inf.

Definition at line 157 of file ct_defs.h.

const int cAC_CONVENTION_MOLALITY = 1

Standard state uses the molality convention.

Definition at line 32 of file ThermoPhase.h.

Referenced by MolalityVPSSTP::activityConvention().

const int cAC_CONVENTION_MOLAR = 0

Standard state uses the molar convention.

Definition at line 30 of file ThermoPhase.h.

Referenced by ThermoPhase::activityConvention().

Standard state uses the molar convention.

Definition at line 40 of file ThermoPhase.h.

const int cSS_CONVENTION_VPSS = 1

Standard state uses the molality convention.

Definition at line 42 of file ThermoPhase.h.

Referenced by VPStandardStateTP::standardStateConvention().

const doublereal FiveSixteenths = 5.0/16.0

5/16

Definition at line 146 of file ct_defs.h.

const doublereal H[4]
Initial value:
 {1.,
                       0.978197,
                       0.579829,
                       -0.202354}

Definition at line 500 of file WaterProps.cpp.

const doublereal Hij[6][7]
Initial value:
    {
      { 0.5132047, 0.2151778, -0.2818107,  0.1778064, -0.04176610,          0.,           0.},
      { 0.3205656, 0.7317883, -1.070786 ,  0.4605040,          0., -0.01578386,           0.},
      { 0.,        1.241044 , -1.263184 ,  0.2340379,          0.,          0.,           0.},
      { 0.,        1.476783 ,         0., -0.4924179,   0.1600435,          0., -0.003629481},
      {-0.7782567,      0.0 ,         0.,  0.       ,          0.,          0.,           0.},
      { 0.1885447,      0.0 ,         0.,  0.       ,          0.,          0.,           0.},
    }

parameter

Definition at line 505 of file WaterProps.cpp.

Referenced by WaterProps::thermalConductivityWater(), and WaterProps::viscosityWater().

const doublereal MaxExp = 690.775527898

largest x such that exp(x) is valid

Definition at line 159 of file ct_defs.h.

const doublereal OneThird = 1.0/3.0
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 quations.

Definition at line 960 of file MolalityVPSSTP.h.

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

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 934 of file MolalityVPSSTP.h.

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

const doublereal Rho_c = 322.
const doublereal SmallNumber = 1.e-300
const doublereal SqrtEight = std::sqrt(8.0)

sqrt(8)

Definition at line 150 of file ct_defs.h.

const doublereal SqrtTen = std::sqrt(10.0)

sqrt(10)

Definition at line 148 of file ct_defs.h.

const doublereal SqrtTwo = std::sqrt(2.0)

sqrt(2)

Definition at line 152 of file ct_defs.h.

const doublereal T_c = 647.096
const doublereal Tiny = 1.e-20

Small number to compare differences of mole fractions against.

Definition at line 165 of file ct_defs.h.

Referenced by State::init(), sum_xlogQ(), and sum_xlogx().

const doublereal Undef = -999.1234

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

Definition at line 163 of file ct_defs.h.

Referenced by MultiPhase::equilibrate(), vcs_MultiPhaseEquil::equilibrate_HP(), and vcs_MultiPhaseEquil::equilibrate_SP().

Generated by  doxygen 1.6.3