rizer.hybrid.constant_mass_discharge_in_lte#
Attributes#
Classes#
A fully ionized plasma model for simulating the behavior of a plasma channel. |
Module Contents#
- rizer.hybrid.constant_mass_discharge_in_lte.u#
- class rizer.hybrid.constant_mass_discharge_in_lte.ConstantMassDischargeInLTE(lte_data: rizer.io.thermo_transport_data_reader.ThermoTransportDataReader, radiation_data: rizer.io.radiation_data_reader.RadiationDataReader, pressure: float, l_gap: float, r_0: float, T_0: float, T_amb: float, R_wire: float, U_LV: float, tau_LV: float, L: float, u_flow: float = 0.0, flow_direction: str = 'along_electrodes', factor_radiation: float = 1.0, factor_conduction_gas: float = 1.0, factor_convection_gas: float = 1.0, factor_conduction_electrode: float = 1.0, i_0: float = 0.0)#
A fully ionized plasma model for simulating the behavior of a plasma channel.
This model assumes:
The plasma is in local thermodynamic equilibrium (LTE).
The pressure is constant throughout the simulation.
The plasma channel is a closed system (the mass is constant).
The plasma channel has a cylindrical geometry, with its volume changing based on temperature.
The temperature is uniform within the plasma channel. Same goes for other properties.
Outside the plasma channel, the gas is at ambient temperature.
The plasma channel gains energy from Joule heating and loses energy through radiation and conduction.
An electrical circuit with a voltage source, wire resistance, and inductance drives the injected power.
This model can simulate hybrid discharges, if it is coupled with a model for the NRP phase. For instance, the initial temperature can be set to the last temperature reached during the NRP phase. See rizer.hybrid.engineering_model.RogerModel for an example of such NRP plasma.
- Parameters:
lte_data (
ThermoTransportDataReader) – An instance of ThermoTransportDataReader containing the LTE data for the plasma.radiation_data (
RadiationDataReader) – An instance of RadiationDataReader containing the radiation data for the plasma.pressure (
float) – The constant pressure of the plasma in Pascals.l_gap (
float) – The length of the plasma channel (gap between electrodes) in meters.r_0 (
float) – The initial radius of the plasma channel in meters.T_0 (
float) – The initial temperature of the plasma in Kelvin.T_amb (
float) – The ambient temperature surrounding the plasma in Kelvin.R_wire (
float) – The resistance of the wire in Ohms.U_LV (
float) – The voltage of the source in Volts.tau_LV (
float) – The duration for which the voltage source is active in seconds.L (
float) – The inductance of the circuit in Henrys.u_flow (
float, optional) – The flow velocity of the gas surrounding the plasma in meters per second (default is 0.0 m/s).factor_radiation (
float, optional) – A scaling factor for the radiative power loss (default is 1.0).factor_conduction_gas (
float, optional) – A scaling factor for the conductive power loss to the surrounding gas (default is 1.0).factor_convection_gas (
float, optional) – A scaling factor for the convective power loss to the surrounding gas (default is 1.0).factor_conduction_electrode (
float, optional) – A scaling factor for the conductive power loss to the electrodes (default is 1.0).i_0 (
float, optional) – The initial current in Amperes (default is 0.0 A).minigallery: (..) – rizer.hybrid.constant_mass_discharge_in_lte.ConstantMassDischargeInLTE:
- factor_radiation = 1.0#
- factor_conduction_gas = 1.0#
- factor_convection_gas = 1.0#
- factor_conduction_electrode = 1.0#
- lte_data#
- radiation_data#
- P#
- l_gap#
- r_0#
- S_tr_0#
- V_0#
- T_0#
- m_0#
- T_amb#
- R_wire#
- U_LV#
- tau_LV#
- L#
- i_0 = 0.0#
- u_flow = 0.0#
- flow_direction = 'along_electrodes'#
- times: numpy.ndarray | None = None#
- temperatures: numpy.ndarray | None = None#
- get_volume(T: float) float#
Calculate the volume of the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Volume in cubic meters.
- Return type:
float
Notes
The volume is calculated assuming the mass of the plasma channel remains constant:
\[V(T) = \frac{m_0}{\rho(T)}\]where:
\(m_0\) is the initial mass of the plasma channel.
\(\rho(T)\) is the mass density at temperature T, obtained from LTE data.
- get_transverse_surface(T: float) float#
Calculate the surface area of the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Surface area in square meters.
- Return type:
float
Notes
The transverse surface area of a cylindrical channel is given by:
\[S_{tr} = \pi r^2 = \frac{V}{L_{gap}}\]where:
\(V\) is the volume of the plasma channel at temperature T.
\(L_{gap}\) is the length of the plasma channel (gap between electrodes).
- get_diameter(T: float) float#
Calculate the diameter of the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Diameter in meters.
- Return type:
float
Notes
The diameter is calculated from the transverse surface area:
\[d = 2 \sqrt{\frac{S_{tr}}{\pi}}\]where \(S_{tr}\) is the transverse surface area at temperature T.
- get_radius(T: float) float#
Calculate the radius of the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Radius in meters.
- Return type:
float
Notes
The radius is half the diameter:
\[r = \frac{d}{2}\]
- get_lateral_surface(T: float) float#
Calculate the lateral surface area of the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Lateral surface area in square meters.
- Return type:
float
Notes
The lateral surface area of a cylindrical channel is given by:
\[S_{lat} = \pi d L_{gap}\]where:
\(d\) is the diameter of the plasma channel at temperature T.
\(L_{gap}\) is the length of the plasma channel (gap between electrodes).
- Vg(t: float) float#
Calculate the voltage of the source at time t.
- Parameters:
t (
float) – Time in seconds.- Returns:
Voltage in Volts.
- Return type:
float
Notes
The voltage source is modeled as a square pulse:
\[\begin{split}V_g(t) = \begin{cases} U_{LV}, & 0 \leq t < \tau_{LV} \\ 0, & t \geq \tau_{LV} \end{cases}\end{split}\]where:
\(U_{LV}\) is the voltage of the source.
\(\tau_{LV}\) is the duration for which the voltage source is active.
- get_plasma_resistance(T: float) float#
Calculate the plasma resistance based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Resistance in Ohms.
- Return type:
float
Notes
The plasma resistance is calculated using the formula:
\[R_p(T) = \frac{L_{gap}}{\sigma(T) S_{tr}(T)}\]where:
\(L_{gap}\) is the length of the plasma channel (gap between electrodes).
\(\sigma(T)\) is the electrical conductivity at temperature T, obtained from LTE data.
\(S_{tr}(T)\) is the transverse surface area at temperature T.
- get_plasma_voltage(T: float, i: float) float#
Calculate the plasma voltage based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.i (
float) – Current in Amperes.
- Returns:
Voltage in Volts.
- Return type:
float
Notes
The plasma voltage is calculated using Ohm’s law:
\[U_p(T, I) = R_p(T) I\]where:
\(R_p(T)\) is the plasma resistance at temperature T.
\(I\) is the current through the plasma channel.
- get_plasma_joule_power(T: float, i: float) float#
Calculate the Joule power in the plasma channel based on the temperature.
- Parameters:
T (
float) – Temperature in Kelvin.i (
float) – Current in Amperes.
- Returns:
Power in Watts.
- Return type:
float
Notes
The Joule power is calculated using the formula:
\[P_{joule}(T, I) = R_p(T) I^2\]where:
\(R_p(T)\) is the plasma resistance at temperature T.
\(I\) is the current through the plasma channel.
- get_radiative_power(T: float) float#
Calculate the radiative power in the plasma channel based on the temperature.
The radiative power is calculated using the net emission coefficient (NEC) from the radiation data.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Power in Watts.
- Return type:
float
Notes
The radiative power is calculated using the formula:
\[P_{rad}(T) = factor_{radiation} \cdot 4 \pi \cdot NEC(T) \cdot V(T)\]where:
\(factor_{radiation}\) is a scaling factor for the radiative power loss [-].
\(NEC(T)\) is the net emission coefficient at temperature T [W/(m^3·sr)].
\(V(T)\) is the volume of the plasma channel at temperature T [m^3]
\(4 \pi\) accounts for the integration over all solid angles.
- get_conductive_power_with_gas(T: float) float#
Calculate the conductive power loss to the gas surrounding the plasma channel.
The conductive power loss with gas is calculated using Fourier’s law of heat conduction.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Power in Watts.
- Return type:
float
Notes
The conductive power is calculated using the formula:
\[P_{cond}(T) = A \cdot J_R = A \cdot \kappa(T_f) \cdot \frac{dT}{dr}\]where:
\(A\) is the cross-sectional area of the plasma channel [m^2],
\(J_R\) is the heat flux due to conduction [W/m^2],
\(\kappa(T_f)\) is the thermal conductivity [W/(m·K)], evaluated at the film temperature \(T_f = \frac{T_{gas} + T_{amb}}{2}\),
\(\frac{dT}{dr}\) is the temperature gradient [K/m].
An equivalent expression for the volumetric heat flux is given in section 8.7.1 of [Raizer1991] (page 199), as:
\[P_{cond, vol}(T) = N c_{p, 1} \nu_T (T_{gas} - T_{amb}) = \frac{\kappa(T_f)}{\Lambda_T^2} (T_{gas} - T_{amb})\]where:
\(T_{gas}\) is the temperature of the plasma channel [K],
\(T_{amb}\) is the ambient temperature [K],
\(N\) is the number density of the gas [molec/m^3],
\(c_{p, 1}\) is the specific heat capacity at constant pressure per molecule [J/(molec·K)],
\(\nu_T = \frac{\xi}{\Lambda_T}\) is the heat removal frequency [1/s],
\(\xi = \frac{\kappa(T_f)}{N c_{p, 1}}\) is the thermal diffusivity [m^2/s] (called “thermometric conductivity” in [Raizer1991]),
\(\Lambda_T = \frac{r}{2.8}\) is the characteristic length for heat conduction [m], where \(r\) is the radius of the plasma channel (where \(2.8 \approx \sqrt{8}\)).
This expression can then be multiplied by the volume of the plasma channel to obtain the total conductive power:
\[P_{cond}(T) = P_{cond, vol}(T) \cdot V(T) = \frac{S_{tr} L_{gap}}{\Lambda_T ^2} \kappa(T_f) (T_{gas} - T_{amb})\]Since \(\Lambda_T = \frac{r}{\sqrt{8}}\), this means that \(\frac{S_{tr}}{\Lambda_T^2} = 8 \pi\), leading to:
Combining these approximations, the conductive power loss to the gas is given by:
\[P_{cond}(T) = 8 \pi r L_{gap} \cdot \kappa(T_f) \cdot (T_{gas} - T_{amb})\]which is then scaled by a factor \(factor_{conduction\_gas}\) to account for uncertainties in the model.
- get_convective_power_with_gas(T: float) float#
Calculate the convective power loss to the gas surrounding the plasma channel.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Power in Watts.
- Return type:
float
Notes
The convective power loss to the gas is calculated using Raizer’s approximation (see section 8.7.2 of [Raizer1991], page 200):
\[P_{conv, vol}(T) = N c_{p, 1} \nu_F (T_{gas} - T_{amb})\]where:
\(T_{gas}\) is the temperature of the plasma channel [K],
\(T_{amb}\) is the ambient temperature [K],
\(N\) is the number density of the gas [molec/m^3],
\(c_{p, 1}\) is the specific heat capacity at constant pressure per molecule [J/(molec·K)],
\(\nu_F = \frac{u_{flow}}{\Lambda_F}\) is the convective heat removal frequency [1/s],
\(u_{flow}\) is the flow velocity of the gas surrounding the plasma [m/s],
\(\Lambda_F = \frac{r}{2}\) is the characteristic length for convective heat removal [m], where \(r\) is the radius of the plasma channel. According to [Raizer1991], “the factor 2 takes into account that, on average, the heat is transported half the distance”.
This expression can then be multiplied by the volume of the plasma channel to obtain the total convective power:
\[P_{conv}(T) = P_{conv, vol}(T) \cdot V(T) = N c_{p, 1} \nu_F (T_{gas} - T_{amb}) \cdot V(T)\]where \(V(T)\) is the volume of the plasma channel at temperature T [m^3].
- get_conductive_power_with_electrode(T: float) float#
Calculate the conductive power loss to the electrode surrounding the plasma channel.
Conduction to the electrode is modeled using Newton’s law of heat conduction.
- Parameters:
T (
float) – Temperature in Kelvin.- Returns:
Power in Watts.
- Return type:
float
Notes
The conductive power loss to the electrode is calculated using the formula:
\[P_{cond\_electrode}(T) = h \cdot S \cdot (T_{gas} - T_{electrode}) \cdot 2\]where:
\(h\) is the heat transfer coefficient [W/(m^2·K)], approximated as \(\kappa(T_f) / L_{gap}\).
\(S\) is the surface area in contact with the electrode [m^2].
\(T_{gas}\) is the temperature of the plasma channel.
\(T_{electrode}\) is the temperature of the electrode, assumed to be the ambient temperature.
The factor of 2 accounts for the two electrodes.
Then, the conductive power loss to the electrode is scaled by a factor \(factor_{conduction\_electrode}\) to account for uncertainties in the model.
- solve(tau_max: float, n_points: int = 1000, **solver_options) None#
Solve the system of ordinary differential equations (ODEs) governing the plasma channel.
- Parameters:
tau_max (
float) – The maximum time for the simulation in seconds.n_points (
int, optional) – The number of time points to evaluate (default is 1000).**solver_options –
Additional options to pass to the ODE solver. By default, the following options are used:
method: ‘BDF’ (suitable for stiff problems)
rtol: 1e-3
atol: 1e-4
first_step: 1e-10
max_step: 1e-7
- Returns:
The results are stored in the instance attributes times, temperatures, and currents.
- Return type:
None- Raises:
RuntimeError – If the ODE solver fails to converge.
Notes
The system of ODEs solved is as follows:
Thermal ODE:
\[\frac{dh}{dt} = \frac{P_{joule} - P_{thermal\_loss}}{m_0}\]where:
\(h\) is the enthalpy per unit mass (J/kg).
\(P_{joule}\) is the Joule power (W).
\(P_{thermal\_loss}\) is the total thermal power loss (W), including:
radiation,
conduction with gas,
convection with gas,
conduction with electrode.
\(m_0\) is the initial mass of the plasma channel (kg).
Electrical ODE:
\[\frac{dI}{dt} = \frac{V_g(t) - (R_p(T) + R_{wire}) I}{L}\]where:
\(I\) is the current (A).
\(V_g(t)\) is the voltage of the source at time t (V).
\(R_p(T)\) is the plasma resistance at temperature T (Ohms).
\(R_{wire}\) is the resistance of the wire (Ohms).
\(L\) is the inductance of the circuit (H).
The temperature is obtained from the enthalpy using the LTE data.
The ODEs are solved simultaneously using scipy.integrate.solve_ivp.
- plot(x: str, y: str, yscale: str = 'linear', show: bool = True, x_unit='s') tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]#
Plot the results of the simulation.
- Parameters:
x (
str) –The variable to plot on the x-axis. Options are:
”temperature” or “T”: Temperature in Kelvin.
”time” or “t”: Time in seconds (or microseconds if x_unit is set to “µs”).
y (
str) –The variable to plot on the y-axis. Options are:
”temperature” or “T”: Temperature in Kelvin.
”diameter” or “d”: Diameter in millimeters.
”radius” or “r”: Radius in millimeters.
”current” or “I”: Current in Amperes.
”plasma_voltage” or “U_p”: Plasma voltage in Volts.
”plasma_resistance” or “R_p”: Plasma resistance in Ohms.
yscale (
str, optional) – The scale of the y-axis. Options are “linear” or “log” (default is “linear”).show (
bool, optional) – Whether to display the plot immediately (default is True).x_unit (
str, optional) – The unit for the x-axis if x is “time” or “t”. Options are “s” for seconds or “µs” for microseconds (default is “s”).
- Returns:
The figure and axes objects of the plot.
- Return type:
tuple[matplotlib.figure.Figure,matplotlib.axes.Axes]- Raises:
ValueError – If no data is available for plotting (i.e., solve has not been called). If an invalid variable is specified for the x or y axis.