OneSimulation docs Website Free books Plans on Gumroad

Docs › Build a first case in each physics package › Plasma physics

5.15 Plasma physics

onesim.physics.plasma

Choose the model at the scale of the question. ChargedParticle uses prescribed electric and magnetic inputs and integrates position and velocity. A uniform magnetic field with zero electric field gives a speed and gyrofrequency check. UniformGuidingCenter describes a reduced orbit, ColdPlasmaOscillation a homogeneous velocity and electric field, and the waterbag declarations evolve velocity contours on a line. For a waterbag initialize ordered lower and upper contours, inspect density and enforce an ordered invariant domain where supported. test_plasma_uniform_input_flexibility.py shows dimensioned drive inputs and feedback for the lumped models.

DriftDiffusionPlasma composes gas, chemistry, electron energy, electron collisions, magnetized electron transport and ion mobility. Use explicit initial number densities and energy, with background and transported species distinguished. Supply or couple the electric, magnetic and heating inputs with their required units. Choose the wall physics explicitly, for example AbsorbingPlasmaWall or NoParticleFlux. A line or volume finite-volume assembly can use a compatible Scharfetter–Gummel flux and local source treatment. Use test_public_plasma_balance.py and test_native_multimesh_plasma.py to check the applicable mesh and source contracts. Verify particle, charge and energy balances before interpreting densities or mean energy.

For ECR coupling, NativeEcrPlasma composes the species, energy, Poisson and Maxwell blocks. NativeEcrDiscretization, NativeEcrStateTransfer, EcrExcitation and the potential gauge express separate choices. Keep excitation, phasor, cold-electron response and absorbed-power transfer consistent. Start with the supplied native ECR tests for your intended geometry and execution route. The public constructors accept explicit data and collaborators. Check which collision and transport data your distribution actually contains.

5.15.1 Check a homogeneous plasma oscillation

Set collision frequency and external current to zero for an independent reference. With initial electron velocity zero and electric field \(E_0\), the field evolves as \(E_0\cos(\omega_p t)\), where \(\omega_p^2=n_e e^2/(m_e\epsilon)\). The coefficients here are scaled test values supplied to the model. For an application, use its actual physical parameters and resolve the resulting time scale.

# Use run_lumped and scalar_series from the cooling chapter.
from onesim.physics.plasma import ColdPlasmaOscillation

domain = LumpedDomain()
plasma = ColdPlasmaOscillation(
    domain=domain.system, density=2.0, electron_mass=3.0,
    elementary_charge=1.0, permittivity=4.0, collision_frequency=0.0,
)
_, samples, time = run_lumped(
    domain, plasma,
    ((plasma.velocity, 0.0), (plasma.electric_field, 0.3), (plasma.thermal_energy, 0.0)),
    (plasma.electric_field, plasma.velocity), end=1.0, dt=0.01, interval=0.05,
)
omega = np.sqrt(2/(3*4))
np.testing.assert_allclose(scalar_series(samples, plasma.electric_field),
                           0.3*np.cos(omega*time), atol=1e-9, rtol=0)