#[derive(Debug, Clone, Copy, PartialEq)]
pub struct RegolithLayer {
pub thickness_m: f64,
pub density_kg_m3: f64,
pub ice_fraction: f64,
}
impl RegolithLayer {
pub fn porosity(&self) -> f64 {
(1.0 - self.density_kg_m3 / 2_200.0).clamp(0.0, 1.0)
}
pub fn thermal_inertia(&self) -> f64 {
self.density_kg_m3 * (200.0 + 300.0 * self.ice_fraction)
}
}
pub fn dark_terrain_regolith() -> RegolithLayer {
RegolithLayer {
thickness_m: 15.0,
density_kg_m3: 1_200.0,
ice_fraction: 0.3,
}
}
pub fn bright_patch_regolith() -> RegolithLayer {
RegolithLayer {
thickness_m: 8.0,
density_kg_m3: 1_000.0,
ice_fraction: 0.6,
}
}