Reactionpathdiagram: 1 Cantera Day 5
Reactionpathdiagram: 1 Cantera Day 5
November 4, 2021
1 Cantera Day 5
Author: Nikhil Verma
Research Scholar
Bangalore
2 Content:
2.1 Reaction Path Diagram
2.1.1 Reference: https://www.tilmanbremer.de/2017/06/tutorial-generating-
reaction-path-diagrams-with-cantera-and-python/
[30]: import os
import cantera as ct
from matplotlib import pyplot as plt
1
gas.TPX = 1500, 100000, 'CH4:0.05,O2:0.21,N2:0.79'
# Write the dot-file first, then create the image from the dot-file with␣
,→customizable
# parameters:
diagram.write_dot(dot_file)
# The last command requires dot to be in your system path variables, or your␣
,→system
2
[29]: import os
import cantera as ct
from matplotlib import pyplot as plt
3
net.step()
T = r.T
# parameters:
diagram.write_dot(dot_file)
# The last command requires dot to be in your system path variables, or your␣
,→system
# Let's open the just created dot file and make so adjustments before␣
,→generating the image
# The dot_file is opened and read, the adjustements are saved in the␣
,→modified_dot_file:
4
os.system('dot {0} -Gdpi=300 -Tpng -o{1}'.format(modified_dot_file, img_file))
fig=plt.figure(figsize=(10, 10))
img = plt.imread(img_file)
plt.imshow(img)
plt.show()
5
[ ]: