Change Generator to Loop
This commit is contained in:
parent
c93e5b7628
commit
7f8183b804
1 changed files with 21 additions and 3 deletions
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -55,15 +54,27 @@
|
|||
"import cantera as ct\n",
|
||||
"\n",
|
||||
"# Get all of the Species objects defined in the GRI 3.0 mechanism\n",
|
||||
"species = {S.name: S for S in ct.Species.listFromFile('gri30.cti')}\n",
|
||||
"species = {}\n",
|
||||
"for S in ct.Species.listFromFile('gri30.cti'):\n",
|
||||
" species[S.name] = S\n",
|
||||
"\n",
|
||||
"# Create an IdealGas object with selected species\n",
|
||||
"complete_species = [species[S] for S in (str.split(' H2 O2 N2 CO2 CO '))]\n",
|
||||
"complete_species = []\n",
|
||||
"for Sname in (str.split(' H2 O2 N2 CO2 CO ')):\n",
|
||||
" complete_species.append(species[Sname])\n",
|
||||
"\n",
|
||||
"cair = ct.Solution(thermo='IdealGas', species=complete_species)\n",
|
||||
"\n",
|
||||
"cair()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Set Initial Condtion and Calculate Equilibrium"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
|
|
@ -105,6 +116,13 @@
|
|||
"cair.equilibrate('TP')\n",
|
||||
"cair()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue