Objects Representing Phases#
Caution
The MATLAB toolbox is an experimental part of the Cantera API and may be changed without notice. It includes breaking changes from the legacy MATLAB API. While almost all features of the legacy MATLAB API are implemented, the toolbox does not include all functionality available for the C++ and Python interfaces.
Composite Phase Objects#
These classes are composite representations of a substance which has thermodynamic, chemical kinetic, and (optionally) transport properties.
Solution#
- class ct.Solution(src[, name][, transport_model])#
Bases:
handle,ct.ThermoPhase,ct.Kinetics,ct.TransportSolution Class
>> s = ct.Solution(src, name, transport_model)
Class
ct.Solutionrepresents solutions of multiple species. A solution is defined as a mixture of two or more constituents (species) that are completely mixed on molecular length scales. The macroscopic intensive thermodynamic state of a solution is specified by two thermodynamic properties (for example, the temperature and pressure), and the relative amounts of each species, which may be given as mole fractions or mass fractions.>> s = ct.Solution('input.yaml')
constructs a
ct.Solutionobject from specifications contained in fileinput.yaml. The phase defaults to the first phase listed in the YAML input file and noct.Transportmodel is included unless explicitly specified.Class
ct.Solutionderives from three more basic classes, and most of its methods are inherited from these classes. These are:class
ct.ThermoPhase: composition information and thermodynamic properties.class
ct.Kinetics: homogeneous kinetics.class
ct.Transport: transport properties.
- Parameters:
src – Input string of YAML file name.
name – name of the phase to import as specified in the YAML file.
transport_model – String specifying transport model. Possible values are
'default','none','mixture-averaged','mixture-averaged-CK','ionized-gas', or'multicomponent'. If not specified,'default'is used.
- Property Summary
- solnID#
ID of the
ct.Solutionobject.
- solnName#
Name of the
ct.Solutionobject.
- transportModel#
Transport model of the
ct.Solutionobject.
- Method Summary
- delete()#
Delete
ct.Solutionobject.
Interface#
- class ct.Interface(src, name[, adj...])#
Bases:
ct.SolutionInterface Class
>> s = ct.Interface(src, name, p1, p2)
See ideal-surface and Declaring Adjacent Phases.
- Parameters:
src – YAML file containing the interface or edge phase.
name – Name of the interface or edge phase in the YAML file.
varargin – Optional list of phases pi adjacent to the interface; if omitted, adjacent phases are added automatically.
- Property Summary
- adjacentNames#
Names of adjacent phases.
- coverages#
Surface coverages of the species on an interface.
- nAdjacent#
Number of adjacent phases.
- siteDensity#
Density of sites for interface species [kmol/m² for surface phases or kmol/m for edge phases].
- Method Summary
- adjacent(name)#
Get adjacent phase of an interface by name.
- setUnnormalizedCoverages(cov)#
Set surface coverages without normalizing to force
sum(cov) == 1.0. This should be used only when calculating partial derivatives with respect to cov[k] by finite difference.s.setUnnormalizedCoverages(cov)
- Parameters:
cov – Vector coverage of the species.
Pure Fluid Phases#
The following convenience functions can be used to create PureFluid objects with the
indicated equation of state:
- ct.CarbonDioxide()#
Return an object representing carbon dioxide.
>> c = CarbonDioxide
The object returned by this method implements an accurate equation of state for carbon dioxide that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances. Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and CarbonDioxide in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Heptane()#
Return an object representing n-heptane.
>> h = ct.Heptane()
The object returned by this method implements an accurate equation of state for n-heptane that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances. Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and Heptane in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.HFC134a()#
Return an object representing refrigerant HFC134a.
>> h = ct.HFC134a()
The object returned by this method implements an accurate equation of state for refrigerant HFC134a (R134a) that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. Implements the equation of state given in:
R. Tillner-Roth and H. D. Baehr. “An International Standard Formulation for The Thermodynamic Properties of 1,1,1,2-Tetrafluoroethane (HFC-134a) for Temperatures From 170 K to 455 K and Pressures up to 70 MPa”. J. Phys. Chem. Ref. Data, Vol. 23, No. 5, 1994. pp. 657–729. http://dx.doi.org/10.1063/1.555958
For more details, see classes PureFluidPhase and HFC134a in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Hydrogen()#
Return an object representing hydrogen.
>> h = ct.Hydrogen()
The object returned by this method implements an accurate equation of state for hydrogen that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and hydrogen in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Methane()#
Return an object representing methane.
>> m = ct.Methane()
The object returned by this method implements an accurate equation of state for methane that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and methane in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Nitrogen()#
Return an object representing nitrogen.
>> n = ct.Nitrogen()
The object returned by this method implements an accurate equation of state for nitrogen that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and nitrogen in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Oxygen()#
Return an object representing oxygen.
>> o = ct.Oxygen()
The object returned by this method implements an accurate equation of state for oxygen that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and oxygen in the Cantera C++ source code documentation.
- Returns:
Instance of class
ct.Solution.
- ct.Water()#
Return an object representing water.
>> w = ct.Water(backend)
The object returned by this method implements an accurate equation of state for water that can be used in the liquid, vapor, saturated liquid/vapor, and supercritical regions of the phase diagram. The equation of state is taken from
Reynolds, W. C. Thermodynamic Properties in SI: graphs, tables, and computational equations for forty substances. Stanford: Stanford University, 1979. Print.
For more details, see classes PureFluidPhase and water in the Cantera C++ source code documentation.
- Parameters:
backend – Can be either ‘Reynolds’ or ‘IAPWS95’.
- Returns:
Instance of class
ct.Solution.