jupiters 0.0.1

Jupiter celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use sciforge::hub::domain::geology::tectonics::{airy_root, isostatic_equilibrium};

pub const METALLICHYDROGENDENSITY: f64 = 1000.0;
pub const ROCKYCOREDENSITY: f64 = 25000.0;

pub struct InteriorFeature {
    pub name: &'static str,
    pub peakelevationm: f64,
    pub baseelevationm: f64,
    pub mantlethicknesskm: f64,
}

impl InteriorFeature {
    pub fn height(&self) -> f64 {
        self.peakelevationm - self.baseelevationm
    }

    pub fn rootdepthm(&self) -> f64 {
        airy_root(self.height(), METALLICHYDROGENDENSITY, ROCKYCOREDENSITY)
    }

    pub fn totalthicknessm(&self) -> f64 {
        self.mantlethicknesskm * 1000.0 + self.rootdepthm()
    }

    pub fn isostaticelevation(&self) -> f64 {
        isostatic_equilibrium(
            self.mantlethicknesskm * 1000.0,
            METALLICHYDROGENDENSITY,
            ROCKYCOREDENSITY,
        )
    }
}

pub fn metallichydrogenmantle() -> InteriorFeature {
    InteriorFeature {
        name: "Metallic Hydrogen Mantle",
        peakelevationm: 500.0,
        baseelevationm: 0.0,
        mantlethicknesskm: 40000.0,
    }
}

pub fn rockycorepeak() -> InteriorFeature {
    InteriorFeature {
        name: "Rocky Core Peak",
        peakelevationm: 3000.0,
        baseelevationm: 0.0,
        mantlethicknesskm: 0.0,
    }
}