Skip to main content

Crate astrodyn_interactions

Crate astrodyn_interactions 

Source
Expand description

Surface interactions: aerodynamics, radiation pressure, contact, lighting, torques.

Pure-Rust port of JEOD’s models/interactions/ plus the surface-model and shadow geometry that those interactions depend on. Each module produces a force, torque, or environmental scalar at a vehicle position; the orchestration that sums these into a body’s astrodyn_dynamics::TotalForce lives in astrodyn.

§Public surface

JEOD source: models/interactions/ and surrounding utilities. Pure Rust, zero Bevy dependency.

§Example

Compute ballistic aerodynamic drag for a 1 m² Cd=2.2 plate moving at 7.5 km/s through a thin LEO atmosphere:

use astrodyn_atmosphere::AtmosphereState;
use astrodyn_interactions::{compute_ballistic_drag, DragConfig};
use astrodyn_quantities::frame::SelfPlanet;
use glam::{DMat3, DVec3};

let cfg = DragConfig { cd: 2.2, area: 1.0, constant_density: None };
// 1e-12 kg/m^3 is roughly 400 km altitude.
let atmos = AtmosphereState::<SelfPlanet>::from_raw(1.0e-12, 0.0, 0.0, DVec3::ZERO);
// Velocity along +X at 7.5 km/s; identity rotation (inertial == body).
let v = DVec3::new(7_500.0, 0.0, 0.0);
let force = compute_ballistic_drag(&cfg, &atmos, v, &DMat3::IDENTITY);

// Drag opposes motion (-X) and is small but non-zero.
assert!(force.force.x < 0.0);
assert!(force.force.length() > 0.0 && force.force.length() < 1.0);

Re-exports§

pub use contact::compute_contact_force;
pub use contact::compute_contact_force_from_geometry;
pub use contact::compute_contact_geometry;
pub use contact::compute_ground_contact_geometry;
pub use contact::ContactFacet;
pub use contact::ContactForce;
pub use contact::ContactGeometry;
pub use contact::ContactMaterial;
pub use contact::ContactShape;
pub use contact::GroundFacet;
pub use contact::Phase;
pub use contact::SphericalTerrain;
pub use contact::Terrain;
pub use earth_lighting::compute_earth_lighting;
pub use earth_lighting::compute_earth_lighting_typed;
pub use earth_lighting::EarthLightingState;
pub use earth_lighting::LightingBody;
pub use earth_lighting::LightingParams;
pub use forces::collect_and_resolve_forces;
pub use forces::collect_and_resolve_forces_typed;
pub use gravity_torque::compute_gravity_torque;
pub use gravity_torque::compute_gravity_torque_typed;
pub use surface_model::ArticulatedFacet;
pub use surface_model::ArticulationState;
pub use surface_model::SurfaceFacet;
pub use surface_model::SurfaceShape;
pub use thermal_rider::compute_thermal_power_balance;
pub use thermal_rider::ThermalEnvironment;
pub use thermal_rider::ThermalFacet;
pub use thermal_rider::ThermalPowerBalance;
pub use aero_drag::*;
pub use flat_plate_aero::*;
pub use radiation_pressure::*;
pub use shadow::*;

Modules§

aero_drag
Aerodynamic drag computation.
contact
Contact dynamics (spring-damper + Coulomb friction).
earth_lighting
Earth lighting model.
flat_plate_aero
Flat-plate aerodynamic surface model.
forces
Force-collection stage: composes per-body external + interaction + gravity contributions into the integrator’s FrameDerivatives (linear and angular accelerations expressed in the integration frame).
gravity_torque
Gravity gradient torque computation.
radiation_pressure
Solar radiation pressure computation.
shadow
Shadow (eclipse) detection.
surface_model
Generic surface geometry model.
thermal_rider
Thermal-rider model: per-facet environmental heating and Stefan-Boltzmann emission.