擅长:python、mysql、java
<p>函数<code>import_phases</code>返回一个列表,对于从同一个文件导入多个阶段定义的情况非常有用,例如</p>
<pre><code>mixtures = ct.import_phases(mech, ['gas1', 'gas2'])
</code></pre>
<p>其中<code>mixtures[0]</code>和<code>mixtures[2]</code>将是单相定义。如果只想定义一个阶段,则更容易编写:</p>
<pre><code>gas_mix = ct.Solution(mech,'gas')
</code></pre>
<p>或者,如果机制文件仅包含一个阶段定义,则</p>
<pre><code>gas_mix = ct.Solution(mech)
</code></pre>
<p>从这里,你应该可以访问物种的数量</p>
<pre><code>gas_mix.n_species
</code></pre>
<p>文档页面“<a href="http://cantera.github.io/docs/sphinx/html/cython/migrating.html" rel="nofollow">Migrating from the Old Python Module</a>”中描述了从旧Cantera接口迁移到新Cantera接口的许多细节。你知道吗</p>