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::domain::common::constants::{DEGREE_TO_RAD, R_GAS};
pub struct ErosionParams {
    pub rainfallmmyr: f64,
    pub slopedeg: f64,
    pub rockerodibility: f64,
    pub vegetationcover: f64,
}
impl ErosionParams {
    pub fn fluvialerosionratemmyr(&self) -> f64 {
        let sloperad = self.slopedeg * DEGREE_TO_RAD;
        self.rockerodibility
            * self.rainfallmmyr.powf(1.5)
            * sloperad.tan()
            * (1.0 - self.vegetationcover)
    }
    pub fn sedimentyieldtkm2yr(&self) -> f64 {
        let quartzsg = *crate::QUARTZDENSITY / crate::FRESHWATERDENSITY;
        self.fluvialerosionratemmyr() * quartzsg
    }
}
pub fn chemicalweatheringrate(temperaturec: f64, precipitationmmyr: f64) -> f64 {
    let tempk = temperaturec + crate::CELSIUSTOKELVIN;
    let ea = crate::EAWEATHERING;
    let a = 1e6;
    a * (-ea / (R_GAS * tempk)).exp() * precipitationmmyr.powf(0.65)
}
pub fn frostweatheringrate(freezethawcycles: f64, porosity: f64) -> f64 {
    0.001 * freezethawcycles * porosity
}
pub fn glacialerosionrate(icevelocitymyr: f64, effectivepressurepa: f64) -> f64 {
    let abrasioncoeff = 1e-4;
    abrasioncoeff * icevelocitymyr * effectivepressurepa / 1e6
}
pub fn winderosionthresholdvelocity(particlediameterm: f64, particledensity: f64) -> f64 {
    let airdensity = *crate::SEALEVELAIRDENSITY;
    let g = *crate::SURFACEGRAVITY;
    0.1 * ((particledensity - airdensity) * g * particlediameterm / airdensity).sqrt()
}