Expand description
Neutral-atmosphere density, temperature, pressure, and wind models.
Pure-Rust port of JEOD’s atmosphere models from
models/environment/atmosphere/. All evaluations are framed by the
AtmosphereState return type — density (kg/m^3), temperature (K),
pressure (Pa), and inertial-frame wind velocity (m/s). The crate has zero
Bevy dependency; orchestration lives in astrodyn.
§Models
exponential—rho = rho_0 * exp(-(h - h_0) / H). A simple, single-parameter scale-height model intended as a fallback and as a sanity-check baseline for tests. Not physically accurate above ~100 km where diffusive equilibrium takes over.met— Marshall Engineering Thermosphere model. Faithful port of JEOD’s MET implementation, which is built on the Jacchia 1970/1971 thermosphere papers (SAO Special Reports No. 313 and 332). MET combines temperature-profile integration via Gauss quadrature with seasonal- latitude density corrections and is the production model for LEO drag.
§Co-rotation wind
compute_corotation_wind (and its typed sibling
compute_corotation_wind_typed) implement JEOD’s
WindVelocity::update_wind() for a planet whose angular velocity points
along the inertial Z axis: wind = omega × r. Aerodynamic drag computes
its relative velocity against this co-rotating wind, not against the bare
inertial frame.
§Typed quantities
AtmosphereState<P> is parameterized over the atmosphere planet P
so the wind vector carries Velocity<PlanetInertial<P>> directly.
AtmosphereState<Earth> and AtmosphereState<Mars> are distinct types
and the compiler refuses to feed Mars’s wind to an Earth drag kernel.
Producers that determine the planet at runtime (evaluate_atmosphere,
the runner’s per-body atmospheric_state) return
AtmosphereState<SelfPlanet>; mission code that knows the planet at
compile time uses the typed sibling evaluate_atmosphere_typed::<P>()
and consumes AtmosphereState<P>. The boundary between the two is the
AtmosphereState::<SelfPlanet>::relabel method, restricted to the
planet-erased variant so a planet-pinned AtmosphereState<Earth>
cannot accidentally be retagged as AtmosphereState<Mars>. JEOD source
paths used: models/environment/atmosphere/MET/ and the broader
models/environment/atmosphere/ model directory; the wind-frame
convention is documented in
models/environment/atmosphere/base_atmos/include/wind_velocity.hh
(“the inertial frame of the planet causing the wind velocity”).
§Example
Default exponential atmosphere with Earth sea-level reference values:
use astrodyn_atmosphere::exponential::ExponentialAtmosphere;
let atmos = ExponentialAtmosphere::default();
let sea_level = atmos.density(0.0);
assert!((sea_level.density - 1.225).abs() < 1e-9);
// Density falls off exponentially with altitude.
let one_scale_height = atmos.density(8_500.0);
assert!(one_scale_height.density < sea_level.density);Modules§
- exponential
- Exponential atmosphere model.
- met
- MET (Marshall Engineering Thermosphere) atmosphere model.
Structs§
- Atmosphere
State - Atmospheric state at a given position.
- Body
Attitude - RootInertial → body attitude of vehicle
V, witnessed unit-norm and scalar-first / left-transformation (JEOD canonical). - Body
Frame - Body (CoM-centered) frame of vehicle
V. Rotates with the vehicle. - Earth
- Planet marker for Earth.
- Ecef
- Earth-centered Earth-fixed frame (ITRF-like). Rotates with Earth.
- Frame
Transform - Proper rotation taking vectors expressed in
Fromto the same vectors expressed inTo. - GMST
- Greenwich Mean Sidereal Time (angle, but seconds-ized by convention).
- GPS
- GPS Time (TAI − 19 s).
- Grav
Param - Gravitational parameter μ = GM tagged with the source planet
P. - Harmonic
Degree - Spherical-harmonic degree or order index. Unitless ordinal.
- Inertia
Tensor - Mass moment of inertia tensor (
kg·m²) expressed in frameF. - Integ
Origin - The integration-frame origin: position and velocity of the integration-frame origin expressed in root-inertial coordinates.
- Integration
Frame - A body’s integration frame — a non-rotating quasi-inertial frame whose origin generally differs from the root inertial origin.
- Left
Transform r' = q r q⁻¹— the JEOD convention.- Lvlh
- Local Vertical / Local Horizontal frame relative to chief vehicle
Chief. Z axis points planet-ward; Y opposes orbital angular momentum; X completes the right-handed triad (approximately along-track in near-circular orbits). - Mars
- Planet marker for Mars.
- Mass
Node - Mass-tree wildcard inertial-flavor frame for kinematic-propagation scratch state.
- Moon
- Planet marker for Moon.
- Ned
- North-East-Down topocentric frame relative to chief vehicle
Chief. - Normalized
Quat - A quaternion witnessed to have unit norm at construction time.
- Planet
Fixed - Planet-fixed frame for any planet
P. Rotates with that planet. - Planet
Inertial - A particular planet’s inertial (non-rotating, J2000-aligned) frame, centered at the planet’s CoM.
- Qty3
- Componentwise 3-vector: each of
x,y,zcarries the dimensionD, and the whole vector carries the frame tagF. - Quat
- Quaternion tagged with its storage layout and transformation convention.
- Right
Transform r' = q⁻¹ r q— the opposite of JEOD; common in many textbooks.- Root
Inertial - The simulation’s root inertial frame — the unique inertial node at the top of the frame tree.
- Scalar
First - Storage layout
[q0, q1, q2, q3]whereq0is the scalar part (JEOD). - Scalar
Last - Storage layout
[x, y, z, w]wherewis the scalar part (glam). - Seconds
Since - Seconds elapsed in the named time scale, measured from that scale’s epoch.
- Self
Planet - Phantom marker for “this entity’s own planet” — used by ECS adapters
whose per-entity components carry
PlanetFixed<P>phantoms but whose planet identity is determined at runtime by the entity itself. - SelfRef
- Phantom marker for “this entity’s own vehicle frame” — used by ECS adapters whose per-entity components carry frame phantoms but whose vehicle identity is determined at runtime by the entity itself.
- Structural
Frame - Structural (geometric-origin) frame of vehicle
V. Rotates with vehicle. - Sun
- Planet marker for Sun.
- TAI
- International Atomic Time.
- TDB
- Barycentric Dynamical Time (relativistic correction to TT).
- TT
- Terrestrial Time (TAI + 32.184 s).
- Time
Converter - Explicit converter between two time scales.
- UT1
- Universal Time 1 (Earth-rotation based).
- UTC
- Coordinated Universal Time (leap-second stepped).
Traits§
- Array3
Ext - Extension trait on
[f64; 3](raw component arrays from CSVs or JEOD initial conditions) producing frame-tagged 3-vectors. - F64Ext
- Unit-construction extension on
f64. - Frame
- Compile-time reference frame tag.
- Layout
- Compile-time quaternion storage layout marker.
- Planet
- Compile-time planet tag used to parameterize planet-fixed frames.
- Time
Scale - Compile-time time-scale tag.
- Transform
- Compile-time quaternion transformation convention marker.
- Vec3Ext
- Extension trait on
glam::DVec3producing frame-tagged 3-vectors. - Vehicle
- Compile-time vehicle tag used to parameterize vehicle-relative frames.
Functions§
- compute_
corotation_ wind - Compute atmospheric co-rotation wind velocity in the inertial frame.
- compute_
corotation_ wind_ typed - Typed variant of
compute_corotation_wind.
Type Aliases§
- Acceleration
- Acceleration in frame
F. Base SI unit: m/s². - Angular
Acceleration - Angular acceleration in frame
F. Base SI unit: rad/s². - Angular
Momentum - Angular momentum in frame
F. Base SI unit: kg·m²/s. - Angular
Velocity - Angular velocity in frame
F. Base SI unit: rad/s. - Force
- Force in frame
F. Base SI unit: newtons. - Jeod
Quat - The JEOD canonical quaternion type: scalar-first, left-transformation.
- Jerk
- Jerk (time derivative of acceleration) in frame
F. Base SI unit: m/s³. - Mass
Flow Rate - Scalar mass-flow rate.
- Position
- Position in frame
F(default:RootInertial). Base SI unit: meters. - Specific
AngMom - Scalar specific angular momentum.
- Specific
Energy - Scalar specific energy.
- Torque
- Torque in frame
F. Base SI unit: N·m. - Velocity
- Velocity in frame
F. Base SI unit: m/s.