bloc.plotting.reaction_path_diagram#

Reaction path diagrams for homogeneous gas-phase pyrolysis.

A constant-pressure adiabatic reactor is integrated from the current state of a cantera.Solution. Reaction path diagrams (Cantera cantera.ReactionPathDiagram) are then drawn for a given element at selected residence times.

Inspired by https://cantera.org/3.1/examples/python/kinetics/interactive_path_diagram.html.

Requires the Graphviz dot executable to render diagrams.

Functions#

run_constant_pressure_reactor(gas, t_start, t_end, n_steps)

Integrate an adiabatic constant-pressure reactor from the current gas state.

plot_reactor_evolution(states, species[, title])

Plot temperature and species mole fractions versus residence time (log axes).

reaction_path_dot(gas, states, time, element[, ...])

Return the Graphviz dot source of the reaction path diagram at time [s].

save_reaction_path_diagram(dot, output_path)

Render dot source to output_path; the format is taken from its suffix.

Module Contents#

bloc.plotting.reaction_path_diagram.run_constant_pressure_reactor(gas, t_start, t_end, n_steps)#

Integrate an adiabatic constant-pressure reactor from the current gas state.

States are stored at n_steps log-spaced times between t_start and t_end [s], preceded by the initial state at t = 0.

Returns a cantera.SolutionArray with an extra t column [s]. gas is left at the final reactor state.

bloc.plotting.reaction_path_diagram.plot_reactor_evolution(states, species, title='')#

Plot temperature and species mole fractions versus residence time (log axes).

Returns the matplotlib figure.

bloc.plotting.reaction_path_diagram.reaction_path_dot(gas, states, time, element, threshold=0.1, details=False, title='')#

Return the Graphviz dot source of the reaction path diagram at time [s].

The stored state closest to time (in log space) is used. gas is set to that state. threshold is the relative flux below which paths are hidden.

bloc.plotting.reaction_path_diagram.save_reaction_path_diagram(dot, output_path)#

Render dot source to output_path; the format is taken from its suffix.

Returns the path of the rendered file.