Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactionPath diagram ignores 'scale' option when using 'OneWayFlow' option #378

Closed
speth opened this issue Nov 4, 2016 · 0 comments · Fixed by #424
Closed

ReactionPath diagram ignores 'scale' option when using 'OneWayFlow' option #378

speth opened this issue Nov 4, 2016 · 0 comments · Fixed by #424

Comments

@speth
Copy link
Member

speth commented Nov 4, 2016

If scale is set to 1.0, then the fluxes in the graphviz diagram should match the actual molar fluxes (e.g. those shown by ReactionPathDiagram.get_data(). This happens when flow_type is set to NetFlow, but not when it is set to OneWayFlow.

import os
import sys

import cantera as ct

gas = ct.Solution('gri30.xml')
gas.TPX = 1400, ct.one_atm, 'N2:1, NO:1e-3, NO2:1e-3, OH:1e-6, HO2:1e-5, HNO:1e-4, H:1e-7'

diagram = ct.ReactionPathDiagram(gas, 'N')

diagram.scale = 1.0
diagram.threshold = 1e-10
diagram.flow_type = 'OneWayFlow'

dot_file = 'rxnpath.dot'
img_file = 'rxnpath.png'
img_path = os.path.join(os.getcwd(), img_file)
print(diagram.get_data())

diagram.write_dot(dot_file)
print("Wrote graphviz input file to '{0}'.".format(os.path.join(os.getcwd(), dot_file)))
os.system('dot {0} -Tpng -o{1} -Gdpi=200'.format(dot_file, img_file))
print("Wrote graphviz output file to '{0}'.".format(img_path))

Produces the diagram:
rxnpath
which shows (for starters):

  • scale should be 1.0, not 0.0042
  • the flux from HNO to NO should be 0.0042, not 1.0

Originally reported in the Users' Group: https://groups.google.com/forum/#!topic/cantera-users/Gy1QjyuMzA8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant