Change Generator to Loop

This commit is contained in:
Yeongdo Park 2019-09-19 16:50:14 +09:00
parent c93e5b7628
commit 7f8183b804

View file

@ -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": {