Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 19 additions & 229 deletions ipython/cantera_sensitivity_comparison.ipynb

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions ipython/cantera_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"#job.load_chemkin_model('data/ethane_model/chem_annotated.inp',transport_file='data/ethane_model/tran.dat')\n",
"\n",
"# Generate the conditions based on the settings we declared earlier\n",
"job.generate_conditions(reactor_type_list, reaction_time_list, mol_frac_list, Tlist, Plist)"
"job.generate_conditions(reactor_type_list=reactor_type_list, reaction_time_list=reaction_time_list, \n",
" mol_frac_list=mol_frac_list, Tlist=Tlist, Plist=Plist)"
]
},
{
Expand Down Expand Up @@ -170,20 +171,13 @@
" print('Condition {0}'.format(i+1))\n",
" display(Image(filename=\"temp/{0}_mole_fractions.png\".format(i+1)))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:rmg_env]",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "conda-env-rmg_env-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -195,9 +189,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.23"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
36 changes: 13 additions & 23 deletions ipython/combustion_model_and_ignition_delay_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import time\n",
Expand Down Expand Up @@ -245,12 +247,13 @@
"mol_frac_list=[{species_dict[fuel_species]: fuel_stoich,\n",
" species_dict[O2_species]: 1,\n",
" species_dict[N2_species]: 3.76}]\n",
"T_list = ([temperature],'K')\n",
"P_list = ([pressure],'atm')\n",
"Tlist = ([temperature],'K')\n",
"Plist = ([pressure],'atm')\n",
"\n",
"job = Cantera(species_list=species_list, reaction_list=reaction_list, output_directory=directory)\n",
"job.load_chemkin_model(os.path.join(chem_path, 'chem_annotated.inp'), os.path.join(chem_path, 'tran.dat'))\n",
"job.generate_conditions(reactor_type_list, reaction_time_list, mol_frac_list, T_list, P_list)\n",
"job.generate_conditions(reactor_type_list=reactor_type_list, reaction_time_list=reaction_time_list, \n",
" mol_frac_list=mol_frac_list, Tlist=Tlist, Plist=Plist)\n",
"\n",
"alldata = job.simulate()\n",
"print(\"Simulation Completed\")"
Expand All @@ -266,9 +269,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"############### Settings ###############\n",
Expand All @@ -280,7 +281,6 @@
"import pandas as pd\n",
"from rmgpy.tools import plot as rmg_plot\n",
"from operator import itemgetter\n",
"%matplotlib notebook\n",
"\n",
"times = alldata[0][0].data\n",
"temperatures = alldata[0][1][0].data\n",
Expand Down Expand Up @@ -353,9 +353,6 @@
"plt.rcParams['ytick.labelsize'] = 12\n",
"plt.rcParams['figure.autolayout'] = True\n",
"\n",
"plt.style.use('ggplot')\n",
"plt.style.use('seaborn-pastel')\n",
"\n",
"fig = plt.figure(figsize=fsize)\n",
"\n",
"plt.subplot(1,2,1)\n",
Expand Down Expand Up @@ -418,7 +415,7 @@
"outputs": [],
"source": [
"import cantera as ct\n",
"gas = ct.Solution(os.path.join(directory, 'cantera', 'chem.cti'))\n",
"gas = ct.Solution(os.path.join(directory, 'cantera', 'chem.yaml'))\n",
"comp = str(species_dict[fuel_species])+\":\"+str(fuel_stoich)+\",\"+str(species_dict[O2_species])+\":1,\"+str(species_dict[N2_species])+\":3.76\"\n",
"gas.TPX = temperature, pressure, comp\n",
"reactor = ct.IdealGasConstPressureReactor(gas)\n",
Expand All @@ -439,21 +436,14 @@
"fullpath = os.getcwd() + '/' + img_file\n",
"display(Image(fullpath))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [conda env:rmg_env]",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "conda-env-rmg_env-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -465,9 +455,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.23"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading
Loading