#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceRegolith {
pub thickness_m: f64,
pub density_kg_m3: f64,
pub ice_fraction: f64,
}
impl IceRegolith {
pub fn porosity(&self) -> f64 {
(1.0 - self.density_kg_m3 / 917.0).clamp(0.0, 1.0)
}
pub fn thermal_inertia(&self) -> f64 {
self.density_kg_m3 * (150.0 + 400.0 * self.ice_fraction)
}
}
pub fn south_polar_regolith() -> IceRegolith {
IceRegolith {
thickness_m: 5.0,
density_kg_m3: 500.0,
ice_fraction: 0.95,
}
}
pub fn cratered_north_regolith() -> IceRegolith {
IceRegolith {
thickness_m: 12.0,
density_kg_m3: 600.0,
ice_fraction: 0.90,
}
}