rizer.pipeline.post_process.quantities#

Physical-quantity compute functions for the post-process registry.

Each function is a pure ct.SolutionArray -> dict[str, numpy.ndarray] transform, run once by rizer.pipeline.post_process.results_io.postprocess_and_save() right after a simulation finishes (see rizer.pipeline.post_process.registry), so both the matplotlib renderer (SimulationPlotter) and the Rizer Spice backend’s web renderer read the same stored value instead of recomputing it independently.

Functions#

compute_mole_fractions(→ dict[str, numpy.ndarray])

Compute the mole fraction of every species in states.

compute_mass_fractions(→ dict[str, numpy.ndarray])

Compute the mass fraction of every species in states.

compute_species_number_density(→ dict[str, numpy.ndarray])

Compute the number density of every species in states.

compute_equilibrium_composition(→ dict[str, numpy.ndarray])

Compute the LTE (Te = Tg) equilibrium composition at every state's (T, P).

compute_voltage_current_energy(→ dict[str, numpy.ndarray])

Compute plasma current and cumulated Joule energy.

compute_power_ratio(→ dict[str, numpy.ndarray])

Compute the inelastic-to-elastic collisional power ratio.

compute_maxwellian_validity(→ dict[str, numpy.ndarray])

Compute the Maxwellian-distribution validity ratios (Mitchner VIII-3.8/3.10/3.12).

compute_reduced_electric_field(→ dict[str, numpy.ndarray])

Compute the reduced electric field E/N.

compute_electron_transport(→ dict[str, numpy.ndarray])

Compute electron transport coefficients from the electron-heavy collision frequency.

Module Contents#

rizer.pipeline.post_process.quantities.compute_mole_fractions(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the mole fraction of every species in states.

Parameters:

states (cantera.SolutionArray) – Simulation state array.

Returns:

{"X_<species>": mole_fraction} for every species in states.species_names, dimensionless (0-1).

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_mass_fractions(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the mass fraction of every species in states.

Parameters:

states (cantera.SolutionArray) – Simulation state array.

Returns:

{"Y_<species>": mass_fraction} for every species in states.species_names, dimensionless (0-1).

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_species_number_density(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the number density of every species in states.

Parameters:

states (cantera.SolutionArray) – Simulation state array.

Returns:

{"n_<species>": number_density} for every species in states.species_names, in m^-3: concentrations * N_a_kmol (states.concentrations is in kmol/m^3). The electron species is named "e-", so this includes an "n_e-" column, numerically identical to the top-level n_e raw column (both reduce to X_e * P / (k_b * mean_temperature)) – kept for uniformity with every other species rather than special-cased out.

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_equilibrium_composition(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the LTE (Te = Tg) equilibrium composition at every state’s (T, P).

Parameters:

states (cantera.SolutionArray) – Simulation state array.

Returns:

{"Xeq_<species>": mole_fraction, "Yeq_<species>": mass_fraction, "neq_<species>": number_density} for every species in states.species_names: the chemical-equilibrium composition reachable from each state’s own elemental composition at its recorded (T, P), with Te = Tg (single-temperature LTE – equivalent to equilibrating a plain ideal-gas phase of the same mechanism, to floating-point precision). Comparing against the actual (non- equilibrium) X_<species>/n_<species> columns is a departure- from-LTE diagnostic.

Return type:

dict of str to numpy.ndarray

Notes

states.concentrations/.X/.T/.P are read into plain arrays before this function ever touches the underlying phase, so the per-row equilibrate loop below (which transiently mutates that shared phase object – ct.SolutionArray.equilibrate has no way to also set Te per row, so the array’s own .equilibrate() cannot be used here) cannot corrupt states’s own stored columns, read by other post-processors before or after this one.

rizer.pipeline.post_process.quantities.compute_voltage_current_energy(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute plasma current and cumulated Joule energy.

Parameters:

states (cantera.SolutionArray) – Simulation state array with V_p [V] and R_p [Ohm] columns.

Returns:

“I_p” : Plasma current [A], via Ohm’s law on the plasma branch: V_p / R_p. “E_p” : Cumulated Joule energy [J]: cumsum(I_p * V_p * dt), where dt is each sample’s own spacing (numpy.diff(states.t, prepend=states.t[0])) rather than a single constant step, so the integral stays correct even where the time array is not uniformly spaced (e.g. the last sample of a radius-change segment).

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_power_ratio(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the inelastic-to-elastic collisional power ratio.

Parameters:

states (cantera.SolutionArray) – Simulation state array with P_inelastic and P_elastic columns [W/m^3].

Returns:

“power_ratio” : P_inelastic / P_elastic, elementwise, dimensionless. NaN at the pre-field initial sample, where both are exactly zero.

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_maxwellian_validity(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the Maxwellian-distribution validity ratios (Mitchner VIII-3.8/3.10/3.12).

Parameters:

states (cantera.SolutionArray) – Simulation state array with nu_ee [1/s], nu_eH_mass_weighted [1/kg/s], T_e [K], P_Joule [W/m^3], n_e [m^-3], and tau [s] columns.

Returns:

“v_th_e” : Electron thermal speed [m/s]: sqrt(8 k_b T_e / (pi m_e)). “maxwellian_condition_VIII_3_8” : Eq VIII-3.8 validity ratio [-]: m_e * nu_eH_mass_weighted / nu_ee. “maxwellian_condition_VIII_3_10” : Eq VIII-3.10 validity ratio [-]: 1 / (nu_ee * tau), with tau the reference pulse duration; NaN if the run was given no pulse_duration (tau is then NaN). “maxwellian_condition_VIII_3_12” : Eq VIII-3.12 validity ratio [-]: P_Joule / (n_e m_e v_th_e^2 nu_ee). All three ratios are NaN/inf at the pre-field initial sample, where nu_ee (and nu_eH_mass_weighted, P_Joule) are exactly zero – a genuine 0/0/x/0, not a bug.

Return type:

dict of str to numpy.ndarray

References

rizer.pipeline.post_process.quantities.compute_reduced_electric_field(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute the reduced electric field E/N.

Parameters:

states (cantera.SolutionArray) – Simulation state array with V_p [V], gap [m], P [Pa], and T [K] columns.

Returns:

“E_over_N” : Reduced electric field [V.m^2]: E / N, with E = V_p / gap [V/m] and N = P / (k_b T) [m^-3]. “E_over_N_Td” : The same quantity in Townsend: E_over_N / u.Td (1 Td = 1e-21 V.m^2).

Return type:

dict of str to numpy.ndarray

rizer.pipeline.post_process.quantities.compute_electron_transport(states: cantera.SolutionArray) → dict[str, numpy.ndarray]#

Compute electron transport coefficients from the electron-heavy collision frequency.

Parameters:

states (cantera.SolutionArray) – Simulation state array with n_e [m^-3], T_e [K], nu_eH [1/s], and density [kg/m^3] columns.

Returns:

“kappa_e” : Electron thermal conductivity [W/(m.K)], via electron_thermal_conductivity(). “D_e” : Electron diffusion coefficient [m^2/s], via electron_diffusion_coefficient(). “mu_e” : Electron mobility [m^2/(V.s)], via electron_mobility(). “alpha_e” : Electron thermal diffusivity [m^2/s]: kappa_e / (density * Y_e * cp_e_mass()) – directly comparable to D_e (same units). kappa_e/D_e/mu_e/alpha_e are inf at the pre-field initial sample, where nu_eH is exactly zero (and alpha_e alone is also inf for any state with no electrons in its composition, Y_e = 0) – a genuine x/0, not a bug.

Return type:

dict of str to numpy.ndarray