Skip to content

Commit c2d693d

Browse files
Ingmar Schoeglischoegl
authored andcommitted
Update docstrings for Solution and Interface objects
* Reflects changes to `phase` and `adjacent` keyword
1 parent 19463bf commit c2d693d

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

interfaces/cython/cantera/composite.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,20 @@ class Solution(ThermoPhase, Kinetics, Transport):
2525
2626
gas = ct.Solution('gri30.cti')
2727
28-
If an input file defines multiple phases, the phase *name* (in CTI) or *id*
29-
(in XML) can be used to specify the desired phase::
28+
If an input file defines multiple phases, the phase *name* (in CTI), *id*
29+
(in XML) or *phases* entry (in YAML) can be used to specify the desired
30+
phase via the ``phase`` keyword argument of the constructor::
3031
31-
gas = ct.Solution('diamond.cti', 'gas')
32-
diamond = ct.Solution('diamond.cti', 'diamond')
32+
gas = ct.Solution('diamond.cti', phase='gas')
33+
diamond = ct.Solution('diamond.cti', phase='diamond')
34+
35+
The name of the `Solution` object needs to be unique and defaults to the
36+
*phase* specified in the input file. If another object using the same
37+
constituting information already exists, the name is automatically appended
38+
by a suffix. A custom name can be set via the ``name`` keyword argument of
39+
the constructor, i.e.::
40+
41+
gas = ct.Solution('gri30.cti', name='my_custom_name')
3342
3443
`Solution` objects can also be constructed using `Species` and `Reaction`
3544
objects which can themselves either be imported from input files or defined
@@ -57,7 +66,8 @@ class Solution(ThermoPhase, Kinetics, Transport):
5766
ideal_gas(name='gas', elements='O H Ar',
5867
species='gri30: all',
5968
reactions='gri30: all',
60-
options=['skip_undeclared_elements', 'skip_undeclared_species', 'skip_undeclared_third_bodies'],
69+
options=['skip_undeclared_elements', 'skip_undeclared_species',
70+
'skip_undeclared_third_bodies'],
6171
initial_state=state(temperature=300, pressure=101325))'''
6272
gas = ct.Solution(source=cti_def)
6373
"""
@@ -77,11 +87,12 @@ class Interface(InterfacePhase, InterfaceKinetics):
7787
7888
To construct an `Interface` object, adjacent bulk phases which participate
7989
in reactions need to be created and then passed in as a list in the
80-
``phases`` argument to the constructor::
90+
``adjacent`` argument to the constructor::
8191
82-
gas = ct.Solution('diamond.cti', 'gas')
83-
diamond = ct.Solution('diamond.cti', 'diamond')
84-
diamond_surf = ct.Interface('diamond.cti', 'diamond_100', [gas, diamond])
92+
gas = ct.Solution('diamond.cti', phase='gas')
93+
diamond = ct.Solution('diamond.cti', phase='diamond')
94+
diamond_surf = ct.Interface('diamond.cti', phase='diamond_100',
95+
adjacent=[gas, diamond])
8596
"""
8697
__slots__ = ('_phase_indices',)
8798

@@ -95,7 +106,6 @@ class DustyGas(ThermoPhase, Kinetics, DustyGasTransport):
95106
96107
The only transport properties computed are the multicomponent diffusion
97108
coefficients. The model does not compute viscosity or thermal conductivity.
98-
99109
"""
100110
__slots__ = ()
101111

0 commit comments

Comments
 (0)