—
Plot thermodynamic and transport data vs. temperature for a plasma of H2, O2, N2, Ar, He in LTE.#
This example plots the thermodynamic and transport data of H2, O2, N2, Ar, and He as a function of temperature.
References data#
Import the required libraries.#
import matplotlib.pyplot as plt
from rizer.io.thermo_transport_data_reader import ThermoTransportDataReader
from rizer.misc.plt_utils import get_species_color, get_species_in_latex, set_mpl_style
# Set the style of the plots.
set_mpl_style(nb_columns=1)
Load reference data.#
data_H2_Boulos2023 = ThermoTransportDataReader(
gas_name="H2", pressure_atm=1, source="Boulos2023"
)
data_N2_Boulos2023 = ThermoTransportDataReader(
gas_name="N2", pressure_atm=1, source="Boulos2023"
)
data_O2_Boulos2023 = ThermoTransportDataReader(
gas_name="O2", pressure_atm=1, source="Boulos2023"
)
data_Ar_Boulos2023 = ThermoTransportDataReader(
gas_name="Ar", pressure_atm=1, source="Boulos2023"
)
data_He_Boulos2023 = ThermoTransportDataReader(
gas_name="He", pressure_atm=1, source="Boulos2023"
)
datas = [
data_H2_Boulos2023,
data_N2_Boulos2023,
data_O2_Boulos2023,
data_Ar_Boulos2023,
data_He_Boulos2023,
]
# Plot options for all the plots.
plot_options = [
{
"ls": "-",
"lw": 4,
"color": get_species_color("H2"),
"label": get_species_in_latex("H2"),
},
{
"ls": "-",
"lw": 3,
"color": get_species_color("N2"),
"label": get_species_in_latex("N2"),
},
{
"ls": "-",
"lw": 2,
"color": get_species_color("O2"),
"label": get_species_in_latex("O2"),
},
{
"ls": "-",
"lw": 3,
"color": get_species_color("Ar"),
"label": get_species_in_latex("Ar"),
},
{
"ls": "-",
"lw": 3,
"color": get_species_color("He"),
"label": get_species_in_latex("He"),
},
]
Plot all physical properties vs. temperature.#
physical_properties = ["rho", "cp", "h", "kappa", "sigma", "mu"]
for physical_property in physical_properties:
fig, ax = plt.subplots()
for data, options in zip(datas, plot_options):
data.plot(
x="T",
y=physical_property,
fig_ax=(fig, ax),
show=False,
yscale="log",
ax_title="1 atm, LTE, Boulos2023",
**options, # type: ignore
)
ax.legend()
plt.show()
Total running time of the script: (0 minutes 3.471 seconds)
![Mass density $\mathregular{[kg.m^{-3}]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_001.png)
![Heat capacity at constant pressure $\mathregular{[J.kg^{-1}.K^{-1}]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_002.png)
![Mass enthalpy $\mathregular{[J.kg^{-1}]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_003.png)
![Thermal conductivity $\mathregular{[W.m^{-1}.K^{-1}]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_004.png)
![Electrical conductivity $\mathregular{[S.m^{-1}]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_005.png)
![Dynamic viscosity $\mathregular{[Pa.s]}$ vs. Temperature $\mathregular{[K]}$, 1 atm, LTE, Boulos2023](../../_images/sphx_glr_plot_Boulos2023_LTE_data_006.png)