bloc.plot#
Attributes#
Functions#
|
Plot a pie chart of the species composition of a Cantera gas object. |
|
Plot PSR temperature as a function of time. |
|
Plot PSR composition as a function of time. |
|
Plot the temperature and composition as a function of time starting from a Cantera states object. |
|
|
|
Return top-N species names by final mole fraction from a states object. |
|
Return top-N species names by final mass fraction from a states object. |
|
Plot PFR composition with dual x-axes (time and distance), linear scale. |
|
Plot PFR temperature with dual x-axes (time and distance), linear scale. |
|
Plot PFR composition with dual x-axes (time and distance), log scale. |
|
Plot PFR temperature with dual x-axes (time and distance), log scale. |
Module Contents#
- bloc.plot.color_H2 = '#B481FF'#
- bloc.plot.color_Cs = '#000000'#
- bloc.plot.color_CH4 = '#E63946'#
- bloc.plot.color_others = '#607D8B'#
- bloc.plot.color_hhv_others = '#8B0000'#
- bloc.plot.SPECIES_COLORS#
- bloc.plot.plot_speciesPie(gas, quantity='mole', thresh=0.005)#
Plot a pie chart of the species composition of a Cantera gas object.
FIgure is displayed in an Excel sheet
- bloc.plot.plot_psr_temperature_vs_t(states, xscale='log', xmin=0, xmax=None, save=False, save_name=None)#
Plot PSR temperature as a function of time.
- Parameters:
states (
SolutionArray) – PSR reactor states (time-series).xscale (
str) – “log” or “linear” scale for x-axis.xmin (
floatorNone) – X-axis limits.xmax (
floatorNone) – X-axis limits.save (
bool) – If True, save figure to file.save_name (
strorNone) – Base name for saving (without extension).
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.plot_psr_composition_vs_t(states, s_to_plot=None, quantity='mole', xscale='log', yscale='linear', xmin=0, xmax=None, save=False, save_name=None)#
Plot PSR composition as a function of time.
- Parameters:
states (
SolutionArray) – PSR reactor states (time-series).s_to_plot (
listofstrorNone) – Species to plot. If None, top 8 by final mole or mass fraction.quantity (
str) – “mole” or “mass” fraction.xscale (
str) – “log” or “linear” scale for x-axis.yscale (
str) – “log” or “linear” scale for y-axis.xmin (
floatorNone) – X-axis limits.xmax (
floatorNone) – X-axis limits.save (
bool) – If True, save figure to file.save_name (
strorNone) – Base name for saving (without extension).
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.plot_simu_vs_t(states, quantity='mole', s_to_plot=None, xscale='log', yscale='linear', xmin=0, xmax=None, n_sheet=1, save=False, save_name=None)#
Plot the temperature and composition as a function of time starting from a Cantera states object.
The figure is displayed in an Excel sheet.
- bloc.plot.plot_simu_vs_x(states, qm, S, quantity='mole', s_to_plot=None, xscale='log', yscale='linear', xmin=0, xmax=None, n_sheet=1, save=False, save_name=None)#
- bloc.plot.get_top_species_by_mole(states, n=8)#
Return top-N species names by final mole fraction from a states object.
- Parameters:
states (
SolutionArray) – Cantera time-series states object.n (
int) – Maximum number of species to return.
- Returns:
Species names sorted by descending final mole fraction, capped at n.
- Return type:
listofstr
- bloc.plot.get_top_species_by_mass(states, n=8)#
Return top-N species names by final mass fraction from a states object.
- Parameters:
states (
SolutionArray) – Cantera time-series states object.n (
int) – Maximum number of species to return.
- Returns:
Species names sorted by descending final mass fraction, capped at n.
- Return type:
listofstr
- bloc.plot.plot_pfr_composition_dual_axis(states, qm, S, s_to_plot=None, save_path=None, quantity='mole')#
Plot PFR composition with dual x-axes (time and distance), linear scale.
- Parameters:
states (
SolutionArray) – PFR reactor states (time-series).qm (
float) – Total mass flow rate in kg/s.S (
float) – Reactor cross-section area in m2.s_to_plot (
listofstrorNone) – Species to plot. If None, top 8 by final mole or mass fraction.save_path (
strorNone) – If provided, save figure to this path (PNG).quantity (
str) –"mole"or"mass".
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.plot_pfr_temperature_dual_axis(states, qm, S, save_path=None)#
Plot PFR temperature with dual x-axes (time and distance), linear scale.
- Parameters:
states (
SolutionArray) – PFR reactor states (time-series).qm (
float) – Total mass flow rate in kg/s.S (
float) – Reactor cross-section area in m2.save_path (
strorNone) – If provided, save figure to this path (PNG).
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.plot_pfr_composition_dual_axis_log(states, qm, S, s_to_plot=None, save_path=None, quantity='mole')#
Plot PFR composition with dual x-axes (time and distance), log scale.
- Parameters:
states (
SolutionArray) – PFR reactor states (time-series).qm (
float) – Total mass flow rate in kg/s.S (
float) – Reactor cross-section area in m2.s_to_plot (
listofstrorNone) – Species to plot. If None, top 8 by final mole or mass fraction.save_path (
strorNone) – If provided, save figure to this path (PNG).quantity (
str) –"mole"or"mass".
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.plot_pfr_temperature_dual_axis_log(states, qm, S, save_path=None)#
Plot PFR temperature with dual x-axes (time and distance), log scale.
- Parameters:
states (
SolutionArray) – PFR reactor states (time-series).qm (
float) – Total mass flow rate in kg/s.S (
float) – Reactor cross-section area in m2.save_path (
strorNone) – If provided, save figure to this path (PNG).
- Returns:
Path to saved figure, or None if not saved.
- Return type:
strorNone
- bloc.plot.SOLID_LINESTYLES = ['-', '--', '-.']#
- bloc.plot.OTHER_LINESTYLE = ':'#