darkmatter 0.0.1

Dark matter simulation engine — gravitational fields, particle dynamics, halo stability, and cosmological constants
Documentation
pub use sciforge::hub::prelude::constants::{
    C, G, H, HBAR, K_B, LIGHT_YEAR, PARSEC, SIGMA_SB, SOLAR_MASS,
};

pub const KPC: f64 = PARSEC * 1e3;

pub const MPC: f64 = PARSEC * 1e6;

pub const WIMP_MASS_RANGE_GEV: (f64, f64) = (10.0, 1000.0);

pub const WIMP_CROSS_SECTION_UPPER_CM2: f64 = 1e-46;

pub const AXION_MASS_RANGE_EV: (f64, f64) = (1e-6, 1e-3);

pub const THERMAL_RELIC_CROSS_SECTION_CM3_S: f64 = 3e-26;

pub fn schwarzschild_radius(mass: f64) -> f64 {
    2.0 * G * mass / (C * C)
}

pub fn de_broglie_wavelength(mass_kg: f64, velocity: f64) -> f64 {
    H / (mass_kg * velocity)
}

pub fn gev_to_kg(gev: f64) -> f64 {
    gev * 1.782_661_92e-27
}

pub fn kg_to_gev(kg: f64) -> f64 {
    kg / 1.782_661_92e-27
}