Expand description
§use-plasma
Small scalar plasma physics helpers for RustUse.
§Install
[dependencies]
use-plasma = "0.0.1"§Foundation
use-plasma provides small scalar plasma physics helpers for plasma frequency, Debye length,
Debye number, thermal speed, gyrofrequency, gyroradius, plasma pressure, magnetic pressure,
plasma beta, Alfven speed, charge density, and quasi-neutrality checks.
Inputs are expected to be SI-style numeric values:
- particles per cubic meter for number density
- kelvin for temperature
- teslas for magnetic flux density
- kilograms for mass
- kilograms per cubic meter for mass density
- meters for Debye length and gyroradius
- radians per second for angular frequency
- hertz for frequency
- pascals for pressure
- coulombs per cubic meter for charge density
The crate keeps only a few local convenience constants. Broader physical constants belong in the
top-level use-constants set. Unit abstractions belong in the top-level use-units set.
Electromagnetic field helpers belong in use-electromagnetism, and particle metadata belongs in
use-particle.
§Example
use use_plasma::{ElectronPlasma, alfven_speed};
let plasma = ElectronPlasma::new(1.0e18, 10_000.0).ok_or("expected valid plasma")?;
assert!(plasma.debye_length().is_some_and(|value| value > 0.0));
assert!(plasma.plasma_frequency().is_some_and(|value| value > 0.0));
assert!(alfven_speed(0.01, 1.0e-10).is_some_and(|value| value >= 0.0));§When to use directly
Choose use-plasma when you need reusable scalar plasma formulas without bringing in a larger
simulation stack or a broader plasma modeling framework.
§Scope
- APIs stay dependency-free,
f64-first, and intentionally small. - This crate is not a plasma simulation engine, particle-in-cell framework, magnetohydrodynamics solver, radiation transport tool, or materials database.
- Detailed collisional transport models, plasma chemistry, and reaction networks are out of scope.
§Status
use-plasma is a pre-1.0 crate with a deliberately small scalar API.
Small scalar plasma physics helpers.
Modules§
Structs§
- Electron
Plasma - A simple electron-plasma state.
- Plasma
Species - A simple scalar plasma species description.
Constants§
- BOLTZMANN_
CONSTANT - Boltzmann constant in joules per kelvin.
- ELECTRON_
MASS - Electron mass in kilograms.
- ELEMENTARY_
CHARGE - Elementary charge in coulombs.
- PROTON_
MASS - Proton mass in kilograms.
- VACUUM_
PERMEABILITY - Vacuum permeability in henries per meter.
- VACUUM_
PERMITTIVITY - Vacuum permittivity in farads per meter.
Functions§
- alfven_
speed - Computes the Alfven speed.
- charge_
density - Computes charge density.
- debye_
length - Computes the Debye length.
- debye_
number - Computes the Debye number.
- debye_
sphere_ volume - Computes the Debye sphere volume.
- electron_
gyrofrequency - Computes the electron gyrofrequency using electron mass and charge magnitude.
- electron_
gyroradius - Computes the electron gyroradius using electron mass and charge magnitude.
- electron_
plasma_ angular_ frequency - Computes the electron plasma angular frequency.
- electron_
plasma_ frequency - Computes the electron plasma frequency in hertz.
- electron_
thermal_ speed - Computes the electron thermal speed.
- gyro_
angular_ frequency - Computes the gyro angular frequency.
- gyrofrequency
- Computes the gyrofrequency in hertz.
- gyroradius
- Computes the gyroradius.
- ion_
plasma_ angular_ frequency - Computes the ion plasma angular frequency.
- is_
quasi_ neutral - Checks whether a plasma is quasi-neutral within a relative tolerance.
- is_
valid_ coulomb_ logarithm - Returns whether a Coulomb logarithm value is finite and positive.
- magnetic_
pressure - Computes magnetic pressure.
- particle_
thermal_ speed - Computes a particle thermal speed.
- plasma_
beta - Computes plasma beta.
- plasma_
pressure - Computes scalar plasma pressure.
- total_
plasma_ pressure - Computes total scalar plasma pressure.