Warning
This documentation is for an old version of Cantera. You can find docs for newer versions here.
These classes are used to describe the thermodynamic state of a system.
Phases of matter.
Class Phase manages basic state and constituent property information for a homogeneous phase of matter. It handles only those properties that do not require the equation of state, namely the temperature, density, chemical composition, and attributes of the elements and species.
It does not know about the pressure, or any other thermodynamic property requiring the equation of state – class ThermoPhase derives from Phase and adds those properties.
Class Phase is not usually instantiated directly. It is used as a base class for class ThermoPhase.
Array of element molar masses [kg/kmol].
If a sequence of element symbols is supplied, only the values for those elements are returned, ordered as in the list. Otherwise, the values are for all elements in the phase, ordered as in the input file.
Mass density [kg/m^3].
The index of element element, which may be specified as a string or an integer index. In the latter case, the index is checked for validity and returned. If no such element is present, an exception is thrown.
Name of the element with index number m.
Return a tuple of all element names.
Mass fraction of one species, referenced by name or index number.
>>> ph.massFraction(4)
>>> ph.massFraction('CH4')
Species mass fraction array. If optional argument species is supplied, then only the values for the selected species are returned.
>>> y1 = ph.massFractions() # all species
>>> y2 = ph.massFractions(['OH', 'CH3'. 'O2'])
Mean molar mass [kg/kmol].
Mean molar mass [kg/kmol].
Molar density [kmol/m^3].
Array of species molar masses [kg/kmol].
Mole fraction of a species, referenced by name or index number.
>>> ph.moleFraction(4)
>>> ph.moleFraction('CH4')
Species mole fraction array. If optional argument species is supplied, then only the values for the selected species are returned.
>>> x1 = ph.moleFractions() # all species
>>> x2 = ph.moleFractions(['OH', 'CH3'. 'O2'])
Array of species molar masses [kg/kmol].
Number of atoms of element element in species species. The element and species may be specified by name or by number.
>>> ph.nAtoms('CH4','H')
4
Number of elements.
Number of species.
The integer index used to access the kernel-level object. Internal.
Given an array f of floating-point element properties, return a those values corresponding to elements listed in elements. Returns an array if elements is a sequence, or a scalar if elements is a scalar.
>>> f = ph.elementPotentials()
>>> lam_o, lam_h = ph.selectElements(f, ['O', 'H'])
>>> lam_h = ph.selectElements(f, 'H')
Given an array f of floating-point species properties, return those values corresponding to species listed in species. Returns an array if species is a sequence, or a scalar if species is a scalar. This method is used internally to implement species selection in methods like moleFractions, massFractions, etc.
>>> f = ph.chemPotentials()
>>> muo2, muh2 = ph.selectSpecies(f, ['O2', 'H2'])
>>> muh2 = ph.selectSpecies(f, 'H2')
Set the density [kg/m3].
Set the mass fractions. See setMoleFractions()
Set the density [kmol/m3].
Set the mole fractions.
Parameters: |
|
---|
>>> ph.setMoleFractions('CO:1, H2:7, H2O:7.8')
>>> x = [1.0]*ph.nSpecies()
>>> ph.setMoleFractions(x)
>>> ph.setMoleFractions(x, norm = 0) # don't normalize values
Set the temperature, molardensity, and mole fractions. The mole fractions may be entered as a string or array,
>>> ph.setState_TNX(600.0, 2.0e-3, 'CH4:0.4, O2:0.6')
Set the temperature and density, leaving the composition unchanged.
Set the temperature, density, and mole fractions. The mole fractions may be entered as a string or array, >>> ph.setState_TRX(600.0, 2.0e-3, ‘CH4:0.4, O2:0.6’)
Set the temperature, density, and mass fractions.
Set the temperature [K].
The index of species species, which may be specified as a string or an integer index. In the latter case, the index is checked for validity and returned. If no such species is present, an exception is thrown.
Name of the species with index k.
Return a tuple of all species names.
Temperature [K].
Specific volume [m^3/kg].
Bases: Cantera.Phase.Phase
A phase with an equation of state.
Class ThermoPhase may be used to represent the intensive thermodynamic state of a phase of matter, which might be a gas, liquid, or solid. Class ThermoPhase extends class Phase by providing methods that require knowledge of the equation of state.
Class ThermoPhase is not usually instantiated directly. It is used as base class for classes Solution and Interface.
Parameters: |
|
---|
Species chemical potentials.
This method returns an array containing the species chemical potentials [J/kmol]. The expressions used to compute these depend on the model implemented by the underlying kernel thermo manager.
Pure species non-dimensional heat capacities at constant pressure.
This method returns an array containing the pure-species standard-state heat capacities divided by R. For gaseous species, these values are ideal gas heat capacities.
Specific heat at constant pressure [J/kg/K].
The molar heat capacity at constant pressure [J/kmol/K].
Specific heat at constant volume [J/kg/K].
The molar heat capacity at constant volume [J/kmol/K].
Electric potential [V].
Element potentials of the elements.
This method returns an array containing the element potentials [J/kmol]. The element potentials are only defined for equilibrium states. This method first sets the composition to a state of equilibrium holding T and P constant, then computes the element potentials for this equilibrium state.
Pure species non-dimensional reference state enthalpies.
This method returns an array containing the pure-species standard-state enthalpies divided by RT. For gaseous species, these values are ideal gas enthalpies.
Specific enthalpy [J/kg].
The molar enthalpy [J/kmol].
Pure species non-dimensional entropies.
This method returns an array containing the pure-species standard-state entropies divided by R. For gaseous species, these values are ideal gas entropies.
Specific entropy [J/kg/K].
The molar entropy [J/kmol/K].
Set to a state of chemical equilibrium holding property pair XY constant.
Parameters: |
|
---|
Pure species non-dimensional Gibbs free energies.
This method returns an array containing the pure-species standard-state Gibbs free energies divided by R. For gaseous species, these are ideal gas values.
Specific Gibbs free energy [J/kg].
The molar Gibbs function [J/kmol].
Specific internal energy [J/kg].
The molar internal energy [J/kmol].
Maximum temperature for which thermodynamic property fits are valid. If a species is specified (by name or number), then the maximum temperature is for only this species. Otherwise it is the highest temperature for which the properties are valid for all species.
Minimum temperature for which thermodynamic property fits are valid. If a species is specified (by name or number), then the minimum temperature is for only this species. Otherwise it is the lowest temperature for which the properties are valid for all species.
The name assigned to the phase. The default value is the name attribute from the CTI file. But method setName can be used to set the name to anything desired, e.g. ‘gas at inlet’ or ‘exhaust’
The pressure [Pa].
Reference pressure [Pa]. All standard-state thermodynamic properties are for this pressure.
Restore the state to that stored in array s.
Return an array with state information that can later be used to restore the state.
Set the electric potential.
Set the name attribute. This can be any string
Set the pressure [Pa].
Set the state by specifying the specific enthalpy and the pressure.
Set the pressure [Pa], and mole fractions.
Set the pressure [Pa], and mass fractions.
Set the state by specifying the specific entropy energy and the pressure.
Set the state by specifying the specific entropy and the specific volume.
Set the temperature [K] and pressure [Pa].
Set the temperature [K], pressure [Pa], and mole fractions.
Set the temperature [K], pressure [Pa], and mass fractions.
Set the state by specifying the specific internal energy and the specific volume.
Return the integer index that is used to reference the kernel object. For internal use.
Return the integer index that is used to reference the kernel object. For internal use.
Bases: Cantera.SurfacePhase.SurfacePhase
A one-dimensonal edge.
Bases: Cantera.ThermoPhase.ThermoPhase
A class for surface phases.
Return the array of surface concentrations [kmol/m2].
Return the array of surface coverages.
Set the surface concentrations to the values in array conc.
Set the surface coverages to the values in array theta.
Set the site density.
Site density [kmol/m2]