ioss 0.0.3

Io celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Volcano {
    pub name: &'static str,
    pub plume_height_km: f64,
    pub lava_temperature_k: f64,
    pub eruption_rate_m3_s: f64,
}

impl Volcano {
    pub fn thermal_output_w(&self) -> f64 {
        self.eruption_rate_m3_s * 2_800.0 * 1_200.0 * self.lava_temperature_k / 1_500.0
    }
}

pub fn loki() -> Volcano {
    Volcano {
        name: "Loki",
        plume_height_km: 200.0,
        lava_temperature_k: 1_900.0,
        eruption_rate_m3_s: 3_000.0,
    }
}

pub fn pele() -> Volcano {
    Volcano {
        name: "Pele",
        plume_height_km: 400.0,
        lava_temperature_k: 1_600.0,
        eruption_rate_m3_s: 500.0,
    }
}

pub fn total_heat_flux_w_m2(volcanoes: &[Volcano], surface_area_m2: f64) -> f64 {
    let total: f64 = volcanoes.iter().map(|v| v.thermal_output_w()).sum();
    total / surface_area_m2.max(1.0)
}