|
185 | 185 | { |
186 | 186 | "cell_type": "code", |
187 | 187 | "execution_count": null, |
188 | | - "metadata": {}, |
| 188 | + "metadata": { |
| 189 | + "scrolled": true |
| 190 | + }, |
189 | 191 | "outputs": [], |
190 | 192 | "source": [ |
191 | 193 | "import time\n", |
|
245 | 247 | "mol_frac_list=[{species_dict[fuel_species]: fuel_stoich,\n", |
246 | 248 | " species_dict[O2_species]: 1,\n", |
247 | 249 | " species_dict[N2_species]: 3.76}]\n", |
248 | | - "T_list = ([temperature],'K')\n", |
249 | | - "P_list = ([pressure],'atm')\n", |
| 250 | + "Tlist = ([temperature],'K')\n", |
| 251 | + "Plist = ([pressure],'atm')\n", |
250 | 252 | "\n", |
251 | 253 | "job = Cantera(species_list=species_list, reaction_list=reaction_list, output_directory=directory)\n", |
252 | 254 | "job.load_chemkin_model(os.path.join(chem_path, 'chem_annotated.inp'), os.path.join(chem_path, 'tran.dat'))\n", |
253 | | - "job.generate_conditions(reactor_type_list, reaction_time_list, mol_frac_list, T_list, P_list)\n", |
| 255 | + "job.generate_conditions(reactor_type_list=reactor_type_list, reaction_time_list=reaction_time_list, \n", |
| 256 | + " mol_frac_list=mol_frac_list, Tlist=Tlist, Plist=Plist)\n", |
254 | 257 | "\n", |
255 | 258 | "alldata = job.simulate()\n", |
256 | 259 | "print(\"Simulation Completed\")" |
|
266 | 269 | { |
267 | 270 | "cell_type": "code", |
268 | 271 | "execution_count": null, |
269 | | - "metadata": { |
270 | | - "scrolled": false |
271 | | - }, |
| 272 | + "metadata": {}, |
272 | 273 | "outputs": [], |
273 | 274 | "source": [ |
274 | 275 | "############### Settings ###############\n", |
|
280 | 281 | "import pandas as pd\n", |
281 | 282 | "from rmgpy.tools import plot as rmg_plot\n", |
282 | 283 | "from operator import itemgetter\n", |
283 | | - "%matplotlib notebook\n", |
284 | 284 | "\n", |
285 | 285 | "times = alldata[0][0].data\n", |
286 | 286 | "temperatures = alldata[0][1][0].data\n", |
|
353 | 353 | "plt.rcParams['ytick.labelsize'] = 12\n", |
354 | 354 | "plt.rcParams['figure.autolayout'] = True\n", |
355 | 355 | "\n", |
356 | | - "plt.style.use('ggplot')\n", |
357 | | - "plt.style.use('seaborn-pastel')\n", |
358 | | - "\n", |
359 | 356 | "fig = plt.figure(figsize=fsize)\n", |
360 | 357 | "\n", |
361 | 358 | "plt.subplot(1,2,1)\n", |
|
418 | 415 | "outputs": [], |
419 | 416 | "source": [ |
420 | 417 | "import cantera as ct\n", |
421 | | - "gas = ct.Solution(os.path.join(directory, 'cantera', 'chem.cti'))\n", |
| 418 | + "gas = ct.Solution(os.path.join(directory, 'cantera', 'chem.yaml'))\n", |
422 | 419 | "comp = str(species_dict[fuel_species])+\":\"+str(fuel_stoich)+\",\"+str(species_dict[O2_species])+\":1,\"+str(species_dict[N2_species])+\":3.76\"\n", |
423 | 420 | "gas.TPX = temperature, pressure, comp\n", |
424 | 421 | "reactor = ct.IdealGasConstPressureReactor(gas)\n", |
425 | 422 | "network = ct.ReactorNet([reactor])\n", |
426 | 423 | "network.advance(ign_delay_time)\n", |
427 | 424 | "ROP_C = ct.ReactionPathDiagram(gas, 'C')\n", |
428 | 425 | "\n", |
429 | | - "from PIL import Image as PILimg\n", |
430 | | - "ROP1 = plt.subplot(1,1,1)\n", |
431 | 426 | "dot_file = os.path.join(directory, 'cantera', 'rxnpathC.dot')\n", |
432 | 427 | "img_file = os.path.join(directory, 'cantera', 'rxnpathC.png')\n", |
433 | 428 | "ROP_C.title = 'Reaction path diagram following C'\n", |
|
439 | 434 | "fullpath = os.getcwd() + '/' + img_file\n", |
440 | 435 | "display(Image(fullpath))" |
441 | 436 | ] |
442 | | - }, |
443 | | - { |
444 | | - "cell_type": "code", |
445 | | - "execution_count": null, |
446 | | - "metadata": {}, |
447 | | - "outputs": [], |
448 | | - "source": [] |
449 | 437 | } |
450 | 438 | ], |
451 | 439 | "metadata": { |
452 | 440 | "anaconda-cloud": {}, |
453 | 441 | "kernelspec": { |
454 | | - "display_name": "Python [conda env:rmg_env]", |
| 442 | + "display_name": "Python 3 (ipykernel)", |
455 | 443 | "language": "python", |
456 | | - "name": "conda-env-rmg_env-py" |
| 444 | + "name": "python3" |
457 | 445 | }, |
458 | 446 | "language_info": { |
459 | 447 | "codemirror_mode": { |
|
465 | 453 | "name": "python", |
466 | 454 | "nbconvert_exporter": "python", |
467 | 455 | "pygments_lexer": "ipython3", |
468 | | - "version": "3.7.4" |
| 456 | + "version": "3.9.23" |
469 | 457 | } |
470 | 458 | }, |
471 | 459 | "nbformat": 4, |
472 | | - "nbformat_minor": 2 |
| 460 | + "nbformat_minor": 4 |
473 | 461 | } |
0 commit comments