earths 0.0.4

High-fidelity Earth simulation engine — orbit, atmosphere, geology, hydrology, biosphere, terrain, lighting, rendering, satellites, and temporal systems with full scientific coupling
Documentation
use sciforge::hub::prelude::constants::elements::atomic_mass;
use sciforge::hub::prelude::constants::{ATM_TO_PASCAL, EARTH_MASS, EARTH_RADIUS, G, N_A, R_GAS};
use std::sync::LazyLock;
pub fn mn2() -> f64 {
    2.0 * atomic_mass(7) * 1e-3
}
pub fn mo2() -> f64 {
    2.0 * atomic_mass(8) * 1e-3
}
pub fn mar() -> f64 {
    atomic_mass(18) * 1e-3
}
pub fn mh2o() -> f64 {
    (2.0 * atomic_mass(1) + atomic_mass(8)) * 1e-3
}
pub fn mco2() -> f64 {
    (atomic_mass(6) + 2.0 * atomic_mass(8)) * 1e-3
}
pub fn mdryair() -> f64 {
    0.78084 * mn2() + 0.20946 * mo2() + 0.00934 * mar() + 0.00036 * mco2()
}
pub fn mnacl() -> f64 {
    (atomic_mass(11) + atomic_mass(17)) * 1e-3
}
pub fn msio2() -> f64 {
    (atomic_mass(14) + 2.0 * atomic_mass(8)) * 1e-3
}
pub fn mna2o() -> f64 {
    (2.0 * atomic_mass(11) + atomic_mass(8)) * 1e-3
}
pub fn mk2o() -> f64 {
    (2.0 * atomic_mass(19) + atomic_mass(8)) * 1e-3
}
pub fn mmgo() -> f64 {
    (atomic_mass(12) + atomic_mass(8)) * 1e-3
}
pub fn mfeo() -> f64 {
    (atomic_mass(26) + atomic_mass(8)) * 1e-3
}
pub fn mcaco3() -> f64 {
    (atomic_mass(20) + atomic_mass(6) + 3.0 * atomic_mass(8)) * 1e-3
}
pub fn mfe() -> f64 {
    atomic_mass(26) * 1e-3
}
pub static SURFACEGRAVITY: LazyLock<f64> =
    LazyLock::new(|| G * EARTH_MASS / (EARTH_RADIUS * EARTH_RADIUS));
pub static RVAPOR: LazyLock<f64> = LazyLock::new(|| R_GAS / mh2o());
pub static SEALEVELAIRDENSITY: LazyLock<f64> = LazyLock::new(|| {
    let rspecific = R_GAS / mdryair();
    ATM_TO_PASCAL / (rspecific * 288.15)
});
pub static LVAPORIZATION: LazyLock<f64> = LazyLock::new(|| 45054.0 / mh2o());
pub static CPFRESHWATER: LazyLock<f64> = LazyLock::new(|| 75.375 / mh2o());
pub static QUARTZDENSITY: LazyLock<f64> = LazyLock::new(|| {
    let a = 4.9133e-10f64;
    let c = 5.4053e-10;
    let vcell = a * a * c * (60.0f64.to_radians().sin());
    3.0 * msio2() / (N_A * vcell)
});
pub static IRONDENSITY: LazyLock<f64> = LazyLock::new(|| {
    let a = 2.8665e-10f64;
    2.0 * mfe() / (N_A * a.powi(3))
});
pub static ICEDENSITY: LazyLock<f64> = LazyLock::new(|| {
    let a = 4.5181e-10f64;
    let c = 7.3560e-10;
    let vcell = a * a * c * (60.0f64.to_radians().sin());
    4.0 * mh2o() / (N_A * vcell)
});
pub const VAPORPRESSURE0C: f64 = 611.657;
pub const CPSEAWATER: f64 = 3994.0;
pub const CELSIUSTOKELVIN: f64 = 273.15;
pub const SECONDSPERYEAR: f64 = 3.15576e7;
pub const OMEGAEARTH: f64 = 7.2921159e-5;
pub const KTTNTTOJOULE: f64 = 4.184e12;
pub const MTTNTTOJOULE: f64 = 4.184e15;
pub const FRESHWATERDENSITY: f64 = 1000.0;
pub const STONYASTEROIDDENSITY: f64 = 3000.0;
pub fn ironasteroiddensity() -> f64 {
    *IRONDENSITY
}
pub fn iceasteroiddensity() -> f64 {
    *ICEDENSITY
}
pub const ARMA: f64 = 6.112;
pub const ARMB: f64 = 17.67;
pub const ARMC: f64 = 243.5;
pub const EAWEATHERING: f64 = 60000.0;
pub const QICECREEP: f64 = 60000.0;
pub const VISCOSITYSHAWA: f64 = 2.8183829312644557e-5;
pub const EAVISCOSITYMAGMA: f64 = 2.5e5;
pub const LITHOSPHERETHICKNESSALPS: f64 = 30000.0;
pub const HIMALAYACONVERGENCEMYR: f64 = 0.045;
pub const CONTINENTALGEOTHERMAL: f64 = 0.045;
pub const KLEIBERA: f64 = 3.5;
pub const MCNABA: f64 = 0.024;
pub const GENTIMEA: f64 = 4.88;
pub const LIFESPANA: f64 = 11.8;
pub const OCEANSURFACEAREA: f64 = 3.61e14;
pub const PARFRACTION: f64 = 0.45;
pub const PARWTOUMOL: f64 = 4.57;
pub const CLOUDEXTINCTIONCOEFF: f64 = 0.13;
pub const CLOUDLWCSCALE: f64 = 0.3;
pub const MANNINGNSAND: f64 = 0.025;
pub const MANNINGNGRAVEL: f64 = 0.035;
pub const MANNINGNROCK: f64 = 0.045;
pub const MANNINGNVEGETATED: f64 = 0.060;
pub const ALBEDOEMAALPHA: f64 = 0.001;
pub const TROPOPAUSEEQUATORM: f64 = 17000.0;
pub const TROPOPAUSEPOLEM: f64 = 9000.0;
pub const SMITHDRAGCOEFF: f64 = 1.2e-3;
pub const STONEMERIDIONALD: f64 = 3.8;
pub const J2EARTH: f64 = 1.08263e-3;
pub const H2LOVE: f64 = 0.6078;
pub const K2LOVE: f64 = 0.2980;
pub const L2LOVE: f64 = 0.0847;
pub const LUNARECCENTRICITY: f64 = 0.0549;
pub const LUNARINCLINATIONDEG: f64 = 5.145;
pub mod atmosphere;
pub mod biosphere;
pub mod geodata;
pub mod geology;
pub mod hydrology;
pub mod lighting;
pub mod physics;
pub mod rendering;
pub mod satellites;
pub mod temporal;
pub mod terrain;