venuss 0.0.2

Venus celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use sciforge::hub::domain::common::constants::SIGMA_SB;

pub struct VenusClimateState {
    pub co2_surface_pressure_pa: f64,
    pub cloud_optical_depth: f64,
    pub global_mean_temp_k: f64,
    pub albedo: f64,
}

impl VenusClimateState {
    pub fn current() -> Self {
        Self {
            co2_surface_pressure_pa: crate::SURFACE_PRESSURE_PA,
            cloud_optical_depth: crate::MEAN_CLOUD_OPTICAL_DEPTH,
            global_mean_temp_k: crate::MEAN_TEMPERATURE_K,
            albedo: crate::BOND_ALBEDO,
        }
    }

    pub fn outgoing_longwave_radiation(&self) -> f64 {
        SIGMA_SB * self.global_mean_temp_k.powi(4)
    }

    pub fn absorbed_solar_radiation(&self) -> f64 {
        let s = sciforge::hub::domain::meteorology::radiation::solar_constant()
            / (crate::SEMI_MAJOR_AXIS_AU * crate::SEMI_MAJOR_AXIS_AU);
        s * (1.0 - self.albedo) / 4.0
    }

    pub fn energy_imbalance(&self) -> f64 {
        self.absorbed_solar_radiation() - self.outgoing_longwave_radiation()
    }

    pub fn greenhouse_effect_k(&self) -> f64 {
        self.global_mean_temp_k - self.effective_emission_temperature()
    }

    pub fn effective_emission_temperature(&self) -> f64 {
        let s = sciforge::hub::domain::meteorology::radiation::solar_constant()
            / (crate::SEMI_MAJOR_AXIS_AU * crate::SEMI_MAJOR_AXIS_AU);
        ((s * (1.0 - self.albedo)) / (4.0 * SIGMA_SB)).powf(0.25)
    }
}