4. Plasma Physics Module
Specific implementations for plasma physics simulations.
4.1. Properties
Utility module for plasma property interpolation and processing.
This module provides efficient methods for handling temperature-dependent thermodynamic, transport, and radiation properties of thermal plasmas. It combines NumPy-based interpolation functions with PyTorch-compatible spline interpolators for use in neural network training and inference.
4.1.1. Plasma Propreties Classes
BaseModel abstract base class components:
ArcPropSpline: PyTorch-based cubic spline class for arc plasma properties
CoronaPropSpline: PyTorch-based spline class for corona discharge
- class ai4plasma.plasma.prop.ArcPropSpline(thermo_file, nec_file, R, T_min=300.0, T_max=30000.0)[source]
Bases:
objectSpline interpolator for arc plasma properties with temperature range enforcement.
This class provides cubic spline interpolation for thermodynamic properties, transport coefficients, and net emission coefficient (NEC) of arc plasma. All input temperatures are automatically clamped to the valid range of 300-30,000 K to ensure physical validity and prevent extrapolation errors.
4. Properties Available
sigma(T): Electrical conductivity (S/m)
kappa(T): Thermal conductivity (W/(m·K))
rho(T): Mass density (kg/m³)
Cp(T): Specific heat capacity at constant pressure (J/(K·kg))
nec(T): Net emission coefficient (W/m³)
4. Temperature Range
All methods automatically clamp input temperatures to [300, 30000] K using torch.clamp. This ensures that property calculations remain within the physically valid and data-supported temperature range.
- param thermo_file:
Path to thermodynamic and transport property data file
- type thermo_file:
str
- param nec_file:
Path to net emission coefficient (NEC) data file
- type nec_file:
str
- param R:
Arc radius in meters (for NEC interpolation)
- type R:
float
- param T_min:
Minimum temperature limit in Kelvin (default: 300 K)
- type T_min:
float, optional
- param T_max:
Maximum temperature limit in Kelvin (default: 30000 K)
- type T_max:
float, optional
- Cp(T)[source]
Compute specific heat capacity at constant pressure at given temperatures.
- Parameters:
T (torch.Tensor) – Temperature values in Kelvin (automatically clamped to [300, 30000] K)
- Returns:
Specific heat capacity in J/(K·kg)
- Return type:
torch.Tensor
- kappa(T)[source]
Compute thermal conductivity at given temperatures.
- Parameters:
T (torch.Tensor) – Temperature values in Kelvin (automatically clamped to [300, 30000] K)
- Returns:
Thermal conductivity in W/(m·K)
- Return type:
torch.Tensor
- nec(T)[source]
Compute net emission coefficient (NEC) at given temperatures.
- Parameters:
T (torch.Tensor) – Temperature values in Kelvin (automatically clamped to [300, 30000] K)
- Returns:
Net emission coefficient in W/m³
- Return type:
torch.Tensor
- class ai4plasma.plasma.prop.CoronaPropSpline(file_path_dict, N_neutral=None, EN_min=None, EN_max=None, alpha_log_scale=True, alpha_multiply_N=True, normalize_mobility=True)[source]
Bases:
objectSpline interpolator for corona discharge transport coefficients with E/N range enforcement.
This class provides cubic spline interpolation for transport coefficients in corona discharge modeling, including ionization coefficient, electron/ion mobilities, and diffusion coefficients. It supports arbitrary gas species (not limited to argon). All input E/N values are automatically clamped to the valid data range to ensure physical validity and prevent extrapolation errors.
4. Properties Available
alpha(E/N): Ionization coefficient (1/m or m²/V depending on normalization)
mu_e(E/N): Electron mobility (m²/(V·s))
mu_p(E/N): Positive ion mobility (m²/(V·s))
D_e(E/N): Electron diffusion coefficient (m²/s)
D_p(E/N): Positive ion diffusion coefficient (m²/s)
4. E/N Units
E/N is the reduced electric field in Townsend units (Td), where: 1 Td = 10⁻²¹ V·m²
Typical range: 10-1000 Td depending on gas species and pressure
4. Normalization Options
The class supports flexible normalization of transport coefficients: - alpha: Can be stored in log-space for numerical stability - mu_e, D_e: Can be normalized by neutral gas density (N_neutral) - mu_p, D_p: Direct interpolation or custom normalization
- param base_path:
Directory path containing transport coefficient data files. Expected files: alpha.dat, mu_e.dat, mu_p.dat, D_e.dat, D_p.dat
- type base_path:
str
- param N_neutral:
Neutral gas number density [1/m³] for normalizing transport coefficients. If None, no normalization is applied (default: None).
- type N_neutral:
float, optional
- param EN_min:
Minimum E/N limit in Td (default: None, uses data range).
- type EN_min:
float, optional
- param EN_max:
Maximum E/N limit in Td (default: None, uses data range).
- type EN_max:
float, optional
- param alpha_log_scale:
Whether to store alpha in log-space for better numerical stability (default: True).
- type alpha_log_scale:
bool, optional
- param alpha_multiply_N:
Whether to multiply alpha by N_neutral when evaluating (default: True). Set to False if alpha data is already in absolute units.
- type alpha_multiply_N:
bool, optional
- param normalize_mobility:
Whether to normalize mobilities and diffusion coefficients by N_neutral (default: True). Set to False if data is already in absolute units.
- type normalize_mobility:
bool, optional
- param File Format:
- param ———–:
- param Each data file should contain two columns:
- param - Column 1:
- type - Column 1:
E/N values in Td (monotonically increasing)
- param - Column 2:
- type - Column 2:
Transport coefficient values
- param Example file (alpha.dat):::
# E/N(Td) alpha(1/m) 10.0 1.5e5 50.0 8.2e6 100.0 2.1e7 …
- D_e(EN)[source]
Compute electron diffusion coefficient at given E/N values.
- Parameters:
EN (torch.Tensor) – Reduced electric field E/N in Td (automatically clamped to valid range)
- Returns:
Electron diffusion coefficient in m²/s
- Return type:
torch.Tensor
- D_p(EN)[source]
Compute positive ion diffusion coefficient at given E/N values.
- Parameters:
EN (torch.Tensor) – Reduced electric field E/N in Td (automatically clamped to valid range)
- Returns:
Positive ion diffusion coefficient in m²/s
- Return type:
torch.Tensor
- alpha(EN)[source]
Compute ionization coefficient at given E/N values.
- Parameters:
EN (torch.Tensor) – Reduced electric field E/N in Td (automatically clamped to valid range)
- Returns:
Ionization coefficient in 1/m (or m²/V depending on normalization)
- Return type:
torch.Tensor
Notes
If alpha_log_scale=True, exp() is applied to convert from log-space
If alpha_multiply_N=True and N_neutral is provided, result is multiplied by N_neutral
- ai4plasma.plasma.prop.interp_nec(temp_list, R_list, nec_array, R, T)[source]
Interpolate Net Emission Coefficient (NEC) at given arc radius and temperatures.
This function performs 2D cubic spline interpolation of radiation emission coefficients that depend on both temperature and arc radius. This is crucial for accurate modeling of radiation losses in arc plasma simulations.
- Parameters:
temp_list (ndarray) – Array of temperature values (in Kelvin) from the NEC table. Must be monotonically increasing.
R_list (ndarray) – Array of arc radius values (in meters) from the NEC table. Must be monotonically increasing.
nec_array (ndarray (2D)) – Array of NEC values with shape (len(temp_list), len(R_list)). Units: W/m³ (power per unit volume).
R (float) – Query arc radius value (in meters). Automatically clamped to [R_list[0], R_list[-1]] if outside valid range.
T (ndarray) – Array of query temperature values (in Kelvin). Values outside [temp_list[0], temp_list[-1]] are clamped. Note: T is modified in-place.
- Returns:
Interpolated NEC values at the given radius R and temperatures T. Shape matches T.shape.
- Return type:
ndarray
- ai4plasma.plasma.prop.interp_nec_log(temp_list, R_list, nec_array, R, T)[source]
Interpolate Net Emission Coefficient (NEC) using logarithmic transformation for improved accuracy across multiple orders of magnitude.
This is the recommended method for NEC interpolation since radiation coefficients typically vary exponentially with temperature and can span many orders of magnitude. Logarithmic interpolation preserves relative accuracy better than linear interpolation.
- Parameters:
temp_list (ndarray) – Array of temperature values (in Kelvin) from the NEC table. Must be monotonically increasing.
R_list (ndarray) – Array of arc radius values (in meters) from the NEC table. Must be monotonically increasing.
nec_array (ndarray (2D)) – Array of NEC values with shape (len(temp_list), len(R_list)). Units: W/m³. All values must be positive for log transformation.
R (float) – Query arc radius value (in meters). Automatically clamped to [R_list[0], R_list[-1]] if outside valid range.
T (ndarray) – Array of query temperature values (in Kelvin). Values outside [temp_list[0], temp_list[-1]] are clamped. Note: T is modified in-place.
- Returns:
Interpolated NEC values at the given radius R and temperatures T, transformed back to linear space. Shape matches T.shape.
- Return type:
ndarray
- ai4plasma.plasma.prop.interp_prop(temp_list, prop_list, T)[source]
Interpolate plasma properties at given temperature values using cubic splines.
This function performs 1D cubic spline interpolation of plasma properties (e.g., conductivity, thermal conductivity) as a function of temperature. Input temperatures are automatically clamped to the valid data range to prevent extrapolation errors.
- Parameters:
temp_list (ndarray) – Array of temperature values (in Kelvin) from the property table. Must be monotonically increasing.
prop_list (ndarray) – Array of property values corresponding to temp_list. Can represent any plasma property (conductivity, density, etc.).
T (ndarray) – Array of query temperature values (in Kelvin) where interpolation is desired. Values outside [temp_list[0], temp_list[-1]] are automatically clamped to boundary values. Note: T is modified in-place.
- Returns:
Interpolated property values at the query temperatures T.
- Return type:
ndarray
- ai4plasma.plasma.prop.interp_prop_log(temp_list, prop_list, T)[source]
Interpolate plasma properties using logarithmic transformation for better accuracy with exponentially varying quantities.
This function is particularly useful for properties that vary over many orders of magnitude (e.g., electrical conductivity, radiation coefficients). Interpolation is performed in log-space to maintain relative accuracy across the entire range, then transformed back to linear space.
- Parameters:
temp_list (ndarray) – Array of temperature values (in Kelvin) from the property table. Must be monotonically increasing.
prop_list (ndarray) – Array of property values corresponding to temp_list. All values must be positive (required for logarithmic transformation).
T (ndarray) – Array of query temperature values (in Kelvin) where interpolation is desired. Values outside [temp_list[0], temp_list[-1]] are automatically clamped. Note: T is modified in-place.
- Returns:
Interpolated property values at the query temperatures T, transformed back to linear space.
- Return type:
ndarray
- ai4plasma.plasma.prop.interp_x(x0, f0, x, kind='linear')[source]
General-purpose 1D interpolation function with automatic boundary clamping.
This utility function provides flexible interpolation for arbitrary 1D functions using either linear or cubic spline methods. Query points outside the data range are automatically clamped to boundary values to prevent extrapolation errors.
- Parameters:
x0 (ndarray) – Array of x-coordinates of the data points. Must be monotonically increasing. Can represent any physical quantity (position, time, etc.).
f0 (ndarray) – Array of y-coordinates (function values) corresponding to x0. Shape must match x0.shape.
x (ndarray) – Array of query x-coordinates where interpolation is desired. Values outside [x0[0], x0[-1]] are clamped to boundary values.
kind (str, optional) – Interpolation method. Options: - ‘linear’: Linear interpolation (default, faster) - ‘cubic’: Cubic spline interpolation (smoother, more accurate)
- Returns:
Interpolated function values at query points x. Shape matches x.shape.
- Return type:
ndarray
- ai4plasma.plasma.prop.read_nec_data(infile)[source]
Read Net Emission Coefficient (NEC) data from a file.
NEC represents the radiation emission power per unit volume of plasma as a function of both temperature and arc radius. This data is essential for modeling radiation losses in arc plasma simulations.
- Parameters:
infile (str) – Path to the NEC data file. Expected format: first column is T(K), subsequent columns are NEC values at different arc radii (column headers represent radius values).
- Returns:
tuple –
- nec_temp_listndarray
Temperature values in Kelvin
- nec_R_listndarray
Arc radius values in meters
- nec_arrayndarray (2D)
NEC values with shape (n_temp, n_radius) in W/m³. Zero or negative values are replaced with 1e-50 to avoid numerical issues in logarithmic calculations.
- Return type:
(nec_temp_list, nec_R_list, nec_array)
- Raises:
FileNotFoundError – If the specified file does not exist.
ValueError – If the data format is invalid.
- ai4plasma.plasma.prop.read_thermo_data(infile)[source]
Read thermodynamic and transport properties data from a file.
This function loads plasma property data including density, enthalpy, specific heat capacity, electrical conductivity, and thermal conductivity as functions of temperature.
- Parameters:
infile (str) – Path to the input data file. Expected format: whitespace-separated columns with headers: T(K), rho(kg/m3), h(J/kg), Cp(J/K/kg), sigma(S/m), kappa(W/m/K).
- Returns:
tuple –
- temp_listndarray
Temperature values in Kelvin
- rho_listndarray
Mass density in kg/m³
- h_listndarray
Specific enthalpy in J/kg
- Cp_listndarray
Specific heat capacity at constant pressure in J/(K·kg)
- sigma_listndarray
Electrical conductivity in S/m
- kappa_listndarray
Thermal conductivity in W/(m·K)
- Return type:
(temp_list, rho_list, h_list, Cp_list, sigma_list, kappa_list)
- Raises:
FileNotFoundError – If the specified file does not exist.
KeyError – If required columns are missing from the data file.
4.2. Arc Discharge
Arc plasma models.
This module provides a comprehensive framework for simulating thermal plasma arcs in cylindrical geometry using the Elenbaas-Heller energy balance equation. It implements steady-state and transient arc models with optional radial velocity effects for high-pressure systems.
4.2.1. Arc Model Classes
StaArc1D: One-dimensional stationary arc model.
TraArc1DNoV: Transient arc model without radial velocity.
TraArc1D: Transient arc model with radial velocity (full convection).
4.2.2. Arc Model References
- [1] L. Zhong, Y. Cressault, and P. Teulet, “Evaluation of Arc Quenching Ability
for a Gas by Combining 1-D Hydrokinetic Modeling and Boltzmann Equation Analysis,” IEEE Trans. Plasma Sci., vol. 47, no. 4, pp. 1835-1840, 2019.
- [2] L. Zhong, Q. Gu, and S. Zheng, “An improved method for fast evaluating arc
quenching performance of a gas based on 1D arc decaying model,” Phys. Plasmas, vol. 26, no. 10, p. 103507, 2019.
- class ai4plasma.plasma.arc.StaArc1D(I, R, prop)[source]
Bases:
objectOne-dimensional stationary arc plasma model (Elenbaas-Heller equation).
This class implements a cylindrically symmetric (1D radial) model for steady-state thermal plasma arcs. It solves the energy balance equation including Joule heating, thermal conduction, and radiation losses.
- I
Arc current in Amperes
- Type:
float
- R
Arc radius in meters
- Type:
float
- temp_list
Temperature values for property tables (K)
- Type:
ndarray
- sigma_list
Electrical conductivity values (S/m)
- Type:
ndarray
- kappa_list
Thermal conductivity values (W/(m·K))
- Type:
ndarray
- nec_list
Net emission coefficient values (W/m³)
- Type:
ndarray
- mesh
Finite volume mesh for spatial discretization
- Type:
fipy.Grid1D
- T
Temperature field variable
- Type:
fipy.CellVariable
- solver
Linear solver for the equation system
- Type:
fipy.Solver
- calc_arc_cond(temp_list, sigma_list, x, T, R)[source]
Calculate total arc electrical conductance from temperature distribution.
The arc conductance G is computed by integrating the conductivity distribution over the arc cross-section:
G = 2π ∫[0 to R] r * sigma(r) dr
This is used to determine the electric field: E = I / G
- Parameters:
temp_list (ndarray) – Temperature values for conductivity table (K)
sigma_list (ndarray) – Electrical conductivity values (S/m)
x (ndarray) – Radial positions where temperature is known (m)
T (ndarray) – Temperature distribution at positions x (K)
R (float) – Integration upper limit (arc radius) in meters
- Returns:
Total arc conductance in Siemens (S). Typical range: 0.01-100 S
- Return type:
float
- generate_mesh(mesh_num)[source]
Generate uniform 1D mesh in radial direction.
Creates a uniform finite volume mesh from r=0 (axis) to r=R (arc boundary). Cell centers are used for temperature values, and face centers are used for evaluating gradients and fluxes.
- Parameters:
mesh_num (int) – Number of mesh cells. Higher values give better spatial resolution but increase computational cost. Typical range: 100-1000.
- init_temp(Tfunc_init)[source]
Initialize temperature field with a given distribution function.
- Parameters:
Tfunc_init (callable) – Function that takes radial position r (array) and returns initial temperature values. Example: lambda r: T_max * (1 - r/R) + T_min
- set_boundary_temp(Tb)[source]
Set boundary conditions for temperature field.
Applies: - Dirichlet BC at outer boundary (r=R): T = Tb - Neumann BC at axis (r=0): dT/dr = 0 (symmetry condition)
- Parameters:
Tb (float) – Boundary temperature at r=R in Kelvin. Should be close to ambient temperature or wall temperature. Typical: 300-3000 K.
- set_solver(ite_num=200, tol=1e-06)[source]
Configure the linear solver for the equation system.
- Parameters:
ite_num (int, optional) – Maximum number of linear solver iterations per nonlinear step. Default: 200. Increase if solver fails to converge.
tol (float, optional) – Convergence tolerance for linear solver. Default: 1e-6. Smaller values give more accurate linear solves but take longer.
- solve(relax, tol, max_ite=6000, is_print=True, flag='')[source]
Iteratively solve the 1D stationary arc energy balance equation.
This method implements a relaxation iteration scheme to solve the nonlinear energy balance equation. The equation couples Joule heating, thermal conduction, and radiation through temperature-dependent properties.
- Parameters:
relax (float) – Relaxation factor for under-relaxation (0 < relax <= 1). Smaller values improve stability but slow convergence. Typical values: 0.05-0.3 for difficult cases, 0.5-1.0 for easier ones.
tol (float) – Convergence tolerance for RMS temperature change between iterations. Typical values: 1e-6 to 1e-4 K.
max_ite (int, optional) – Maximum number of iterations. Default: 6000. Increase for difficult convergence cases.
is_print (bool, optional) – If True, print iteration progress. Default: True.
flag (str, optional) – Identifier string for output messages. Default: ‘’.
- Returns:
(x, T, xface, Tface) where: - x : ndarray, cell center positions (m) - T : ndarray, temperature at cell centers (K) - xface : ndarray, face center positions (m) - Tface : ndarray, temperature at face centers (K)
- Return type:
tuple
- solve_onestep(mesh_num, Tfunc_init, Tb, relax, tol, max_ite=6000, is_print=True, flag='')[source]
Complete solution procedure: mesh generation, initialization, and solving.
This convenience method combines all steps needed to solve the arc model: 1. Generate computational mesh 2. Initialize temperature field 3. Set boundary conditions 4. Configure solver 5. Iteratively solve the equation
- Parameters:
mesh_num (int) – Number of mesh cells. Typical: 100-1000
Tfunc_init (callable) – Initial temperature distribution function: T = f(r) Example: lambda r: (1 - r/R) * (T_max - T_min) + T_min
Tb (float) – Boundary temperature at r=R (K). Typical: 300-3000 K
relax (float) – Relaxation factor (0 < relax <= 1). Typical: 0.1-0.3
tol (float) – Convergence tolerance (K). Typical: 1e-6 to 1e-4
max_ite (int, optional) – Maximum iterations. Default: 6000
is_print (bool, optional) – Print iteration progress. Default: True
flag (str, optional) – Identifier for output messages. Default: ‘’
- Returns:
(x, T, xface, Tface) - Position and temperature arrays
- Return type:
tuple
- class ai4plasma.plasma.arc.TraArc1D(I, R, prop)[source]
Bases:
StaArc1DOne-dimensional transient arc plasma model with radial velocity (full convection model).
This class extends StaArc1D to solve time-dependent arc plasma problems including radial gas flow. The model accounts for both thermal diffusion and convective heat transport, providing a more complete description of arc dynamics compared to TraArc1DNoV. This is essential for modeling arc decay when pressure gradients drive significant radial flow, such as during current interruption in high-pressure circuit breakers.
- I
Arc current in Amperes (can be zero for decay studies)
- Type:
float
- R
Arc radius in meters
- Type:
float
- temp_list
Temperature values for property tables (K)
- Type:
ndarray
- rho_list
Mass density values (kg/m³)
- Type:
ndarray
- Cp_list
Specific heat capacity values (J/(kg·K))
- Type:
ndarray
- sigma_list
Electrical conductivity values (S/m)
- Type:
ndarray
- kappa_list
Thermal conductivity values (W/(m·K))
- Type:
ndarray
- nec_list
Net emission coefficient values (W/m³)
- Type:
ndarray
- mesh
Finite volume mesh for spatial discretization
- Type:
fipy.Grid1D
- T
Temperature field variable with time history
- Type:
fipy.CellVariable
- V
Radial velocity field variable with time history
- Type:
fipy.CellVariable
- init_field(Tfunc_init)[source]
Initialize both temperature and velocity field variables.
Creates FiPy cell variables for temperature and velocity with initial conditions. Both fields are configured to store old values for time integration schemes.
- Parameters:
Tfunc_init (callable) – Initial temperature distribution function: T = f(r) Should return temperature in Kelvin for given radial position. Example: lambda r: T_center * (1 - (r/R)**2) + T_boundary
- set_boundary_field(Tb)[source]
Set boundary conditions for temperature and velocity fields.
Temperature boundary conditions: - At r=R (right boundary): Dirichlet BC, T = Tb (fixed wall temperature) - At r=0 (axis): Neumann BC, dT/dr = 0 (symmetry condition)
Velocity boundary conditions: - At r=0 (axis): V = 0 (symmetry, no flow through axis) - At r=R (right boundary): Free (determined by temperature gradient)
- Parameters:
Tb (float) – Boundary temperature at r=R in Kelvin. Typically represents wall temperature or ambient gas temperature. Typical range: 300 - 3000 K
- set_solver()[source]
Configure the solver for coupled transient equations.
For the coupled temperature-velocity problem, solver configuration is handled within the solve() method. This placeholder is maintained for interface consistency with parent classes.
- solve(dt, step_num, sweep_T_max_num=100, sweep_T_res_tol=1e-06, is_print_sweep=False, enable_joule=False, save_freq=10, is_print=True, flag='')[source]
Solve the coupled transient temperature-velocity equations using implicit method.
This method performs time integration of the coupled energy and momentum equations using a semi-implicit approach with decoupled iterations. At each time step, velocity is first computed from the current temperature field, then temperature is updated with sweep iterations accounting for convection.
IMPORTANT: This implicit method may have convergence issues for some conditions. The explicit method (solve_explicit) is generally more stable and is recommended for most applications.
- Parameters:
dt (float) – Time step size in seconds. Should be small enough for numerical stability of the convection term. Typical: 1e-10 to 1e-7 s
step_num (int) – Total number of time steps to simulate. Total simulation time = dt * step_num
sweep_T_max_num (int, optional) – Maximum number of sweep iterations for temperature equation per time step. Default: 100. May need larger values for strong coupling.
sweep_T_res_tol (float, optional) – Convergence tolerance for temperature sweep iterations (RMS change). Default: 1e-6 K. Controls accuracy vs computational cost.
is_print_sweep (bool, optional) – If True, print detailed information for each sweep iteration. Default: False. Useful for debugging convergence issues.
enable_joule (bool, optional) – If True, include Joule heating in the energy balance. If False, model pure cooling/decay without energy input. Default: False.
save_freq (int, optional) – Frequency of saving solution snapshots (every N time steps). Default: 10. Balance between time resolution and memory usage.
is_print (bool, optional) – If True, print progress at each saved time step. Default: True.
flag (str, optional) – Identifier string for output messages. Default: ‘’.
- Returns:
tuple – t_list : ndarray, time points where solution is saved (s) g_list : ndarray, arc conductance at saved times (S) x_list : ndarray, radial positions (face centers) (m) T_array : ndarray (2D), temperature profiles at saved times (K), Shape: (num_saved_steps, num_cells) V_array : ndarray (2D), velocity profiles at saved times (m/s), Shape: (num_saved_steps, num_cells)
- Return type:
(t_list, g_list, x_list, T_array, V_array) where:
Warning
This method has known convergence challenges and is retained mainly for compatibility. For production use, prefer solve_explicit() which is more robust and often faster.
- solve_explicit(mesh_num, Tfunc_init, Tb, dt, step_num, enable_joule=False, save_freq=10, is_print=True, flag='')[source]
Explicitly solve the coupled temperature-velocity equations (RECOMMENDED METHOD).
This method implements a fully explicit time integration scheme that is generally more stable, faster, and easier to use than the implicit method. The velocity and temperature fields are updated sequentially at each time step using direct finite difference formulas without iterative sweeps.
RECOMMENDED: This is the preferred method for solving the coupled arc equations with velocity. It avoids convergence issues of the implicit solver while maintaining good accuracy.
- Parameters:
mesh_num (int) – Number of mesh points. Typical: 200-1000. Finer mesh improves accuracy but reduces stable time step.
Tfunc_init (callable) – Initial temperature distribution function: T = f(r) Should return temperature in Kelvin for given radial position. Example: lambda r: T_center * (1 - (r/R)**2) + T_boundary
Tb (float) – Boundary temperature at r=R (K). Fixed during simulation. Typical: 300-3000 K (wall or ambient temperature)
dt (float) – Time step size (s). Must satisfy CFL condition for stability. Typical: 1e-10 to 1e-7 s. Adjust based on max(V/dx, kappa/(rho*Cp*dx²))
step_num (int) – Total number of time steps. Total time = dt * step_num
enable_joule (bool, optional) – If True, include Joule heating (current-carrying arc). If False, pure cooling/decay without energy input. Default: False (decay studies)
save_freq (int, optional) – Save solution every N time steps. Default: 10 Balance between time resolution and memory/disk usage
is_print (bool, optional) – Print progress information at saved steps. Default: True
flag (str, optional) – Identifier string for output messages. Default: ‘’
- Returns:
tuple – t_list : ndarray, time points where solution is saved (s) g_list : ndarray, arc conductance at saved times (S) x : ndarray, radial grid points (m) T_array : ndarray (2D), temperature profiles at saved times (K), Shape: (num_saved_steps, mesh_num) V_array : ndarray (2D), velocity profiles at saved times (m/s), Shape: (num_saved_steps, mesh_num)
- Return type:
(t_list, g_list, x, T_array, V_array) where:
- solve_onestep(mesh_num, Tfunc_init, Tb, dt, step_num, sweep_T_max_num=100, sweep_T_res_tol=1e-06, is_print_sweep=False, enable_joule=False, save_freq=10, is_print=True, flag='')[source]
Complete solution procedure with velocity: setup and time integration.
This convenience method combines all steps needed to solve the coupled transient arc problem including radial velocity effects: 1. Generate computational mesh 2. Initialize temperature and velocity fields 3. Set boundary conditions 4. Perform coupled time integration
- Parameters:
mesh_num (int) – Number of mesh cells. Typical: 200-1000. More cells needed for capturing steep velocity gradients.
Tfunc_init (callable) – Initial temperature distribution function: T = f(r) Should return temperature in Kelvin for given radial position. Example: lambda r: T0 * np.exp(-(r/r0)**2) + Tb
Tb (float) – Boundary temperature at r=R (K). Typically ambient or wall temperature. Typical: 300-3000 K
dt (float) – Time step size (s). Must be small for convection stability. Typical: 1e-10 to 1e-7 s (smaller than TraArc1DNoV due to convection)
step_num (int) – Total number of time steps. Total time = dt * step_num
sweep_T_max_num (int, optional) – Maximum sweep iterations for temperature per time step. Default: 100
sweep_T_res_tol (float, optional) – Temperature sweep convergence tolerance (K). Default: 1e-6
is_print_sweep (bool, optional) – Print detailed sweep information. Default: False
enable_joule (bool, optional) – Include Joule heating. Default: False (decay only)
save_freq (int, optional) – Save solution every N time steps. Default: 10
is_print (bool, optional) – Print time step progress. Default: True
flag (str, optional) – Identifier for output messages. Default: ‘’
- Returns:
(t_list, g_list, x_list, T_array, V_array) - Complete time history including both temperature and velocity fields
- Return type:
tuple
- class ai4plasma.plasma.arc.TraArc1DNoV(I, R, prop)[source]
Bases:
StaArc1DOne-dimensional transient arc plasma model without radial velocity (no convection).
This class extends StaArc1D to solve time-dependent arc plasma problems where the arc evolves over time but without significant radial gas flow (velocity = 0). This is applicable during the early stages of arc decay or in cases where convective heat transport is negligible compared to conduction.
- I
Arc current in Amperes (can be zero for decay studies)
- Type:
float
- R
Arc radius in meters
- Type:
float
- temp_list
Temperature values for property tables (K)
- Type:
ndarray
- rho_list
Mass density values (kg/m³)
- Type:
ndarray
- Cp_list
Specific heat capacity values (J/(kg·K))
- Type:
ndarray
- sigma_list
Electrical conductivity values (S/m)
- Type:
ndarray
- kappa_list
Thermal conductivity values (W/(m·K))
- Type:
ndarray
- nec_list
Net emission coefficient values (W/m³)
- Type:
ndarray
- mesh
Finite volume mesh for spatial discretization
- Type:
fipy.Grid1D
- T
Temperature field variable with time history
- Type:
fipy.CellVariable
- set_solver()[source]
Configure the solver for transient equations.
For transient problems with sweep iterations, the solver is configured differently than in steady-state problems. This method is a placeholder and can be extended if specific solver settings are needed.
- solve(dt, step_num, sweep_max_num=10, sweep_res_tol=1e-06, is_print_sweep=False, enable_joule=False, save_freq=10, is_print=True, flag='')[source]
Solve the transient 1D arc equation over specified time steps.
This method performs time integration of the energy balance equation using implicit time discretization. At each time step, inner sweep iterations are performed to handle the nonlinear coupling of temperature-dependent properties.
- Parameters:
dt (float) – Time step size in seconds. Should be small enough for numerical stability. Typical: 1e-9 to 1e-6 s depending on the time scales of interest.
step_num (int) – Total number of time steps to simulate. Total simulation time = dt * step_num
sweep_max_num (int, optional) – Maximum number of sweep iterations per time step for handling nonlinearity. Default: 10. Increase if convergence issues occur.
sweep_res_tol (float, optional) – Convergence tolerance for sweep iterations (RMS temperature change). Default: 1e-6 K. Smaller values give more accurate solutions.
is_print_sweep (bool, optional) – If True, print detailed information for each sweep iteration. Default: False. Useful for debugging convergence issues.
enable_joule (bool, optional) – If True, include Joule heating in the energy balance. If False, model pure cooling/decay without energy input. Default: False. Set to True for current-carrying arcs, False for decay studies.
save_freq (int, optional) – Frequency of saving solution snapshots (every N time steps). Default: 10. Higher values save memory but lose time resolution.
is_print (bool, optional) – If True, print progress at each saved time step. Default: True.
flag (str, optional) – Identifier string for output messages. Default: ‘’.
- Returns:
tuple – t_list : ndarray, time points where solution is saved (s) g_list : ndarray, arc conductance at saved times (S) x_list : ndarray, radial positions (face centers) (m) T_array : ndarray (2D), temperature profiles at saved times (K), Shape: (num_saved_steps, num_cells)
- Return type:
(t_list, g_list, x_list, T_array) where:
- solve_onestep(mesh_num, Tfunc_init, Tb, dt, step_num, sweep_max_num=10, sweep_res_tol=1e-06, is_print_sweep=False, enable_joule=False, save_freq=10, is_print=True, flag='')[source]
Complete solution procedure for transient arc: setup and time integration.
This convenience method combines all steps needed to solve the transient arc problem: 1. Generate computational mesh 2. Initialize temperature field 3. Set boundary conditions 4. Perform time integration
- Parameters:
mesh_num (int) – Number of mesh cells. Typical: 100-1000
Tfunc_init (callable) – Initial temperature distribution function: T = f(r) Should return temperature in Kelvin for given radial position. Example: lambda r: T_center * (1 - r/R) + T_boundary
Tb (float) – Boundary temperature at r=R (K). Typically ambient or wall temperature. Typical: 300-3000 K
dt (float) – Time step size (s). Choose based on required time resolution and numerical stability. Typical: 1e-9 to 1e-6 s
step_num (int) – Total number of time steps. Total time = dt * step_num
sweep_max_num (int, optional) – Maximum sweep iterations per time step. Default: 10
sweep_res_tol (float, optional) – Sweep convergence tolerance (K). Default: 1e-6
is_print_sweep (bool, optional) – Print sweep details. Default: False
enable_joule (bool, optional) – Include Joule heating. Default: False (decay only)
save_freq (int, optional) – Save solution every N time steps. Default: 10
is_print (bool, optional) – Print time step progress. Default: True
flag (str, optional) – Identifier for output messages. Default: ‘’
- Returns:
tuple
- Return type:
(t_list, g_list, x_list, T_array) - Time history of solution