6-DoF longitudinal rigid-body dynamics with second-order actuator modeling, SU2-anchored aerodynamic surrogates, and event-driven CFD verification.
Flight dynamics connects CFD to real-world motion. An aerodynamic surrogate built from SU2 RANS data feeds a Newton-Euler 6-DoF integrator, which drives an event-driven verification hook that fires SU2 snapshots at critical flight conditions - closing the loop between fast surrogate prediction and high-fidelity CFD.
Compressible RANS with SA turbulence at 5 AoA points
Linear interpolation over AoA with flap delta effects
Newton-Euler integration at 200 Hz with second-order actuator
Event-driven SU2 snapshot at peak gust and cruise recovery
Watch the aircraft respond to a 5 m/s “1-cos” vertical gust at 50 m/s cruise. The simulation runs at 200 Hz with second-order actuator dynamics. Nose-up pitch indicates positive AoA excursion.
A 5 m/s vertical gust (duration 0.5s, onset at t=1.0s) excites the longitudinal dynamics. The aircraft experiences a transient AoA increase of 0.6° and a peak load factor of 2.48g before recovering to trim.
The verification hook monitors the simulation state stream for key flight conditions. On trigger, it serializes the flight state and requests a high-fidelity SU2 RANS snapshot for comparison against the aerodynamic surrogate prediction.
| Event | Time | AoA | V | Surrogate CL | Surrogate CD | SU2 Status |
|---|---|---|---|---|---|---|
| Peak Gust | 1.26s | 1.73° | 50.6 m/s | 0.194 | 0.083 | Snapshot Requested |
| Cruise Recovery | 1.70s | 0.80° | 51.0 m/s | 0.090 | 0.080 | Snapshot Requested |
The longitudinal dynamics integrate Newton-Euler rigid-body equations in body-axis coordinates. Aerodynamic forces are computed from the surrogate model and rotated from wind axes. Static stability is enforced via a negative static margin ($C_{m_\alpha} = C_L \cdot \overline{x}_{cg}$).
$$ \dot{u} = -q w - g\sin\theta + \frac{F_x}{m} $$
$$ \dot{w} = q u + g\cos\theta + \frac{F_z}{m} $$
$$ \dot{q} = \frac{M}{I_{yy}} $$
$$ \dot{\theta} = q $$
$$ F_x = L\sin\alpha - D\cos\alpha + T $$
$$ F_z = -L\cos\alpha - D\sin\alpha $$
$$ M = \bar{q} S c\,(C_m + C_{L}\overline{x}_{cg} + C_{m_q}\hat{q}) $$
$$ \ddot{\delta} = \omega_n^2(\delta_{cmd} - \delta) - 2\zeta\omega_n\dot{\delta} $$
$\zeta = 0.7$, $\omega_n = 10$ rad/s, $f_s = 200$ Hz
$$ V_g(t) = \frac{A}{2}\left[1 - \cos\frac{2\pi(t-t_0)}{T}\right] $$
$A = 5$ m/s, $t_0 = 1.0$ s, $T = 0.5$ s
The dual-panel dashboard shows the flight trajectory with AoA overlay (top) and the actuator commanded vs actual deflection with load factor (bottom). The gust event at t=1.0s is visible as a transient in both panels.
The flight dynamics pipeline is implemented across six modules in src/ and one in physics/:
| Module | Class / Function | Purpose |
|---|---|---|
physics/aero_surrogate.py | AeroSurrogate | CL/CD/CM interpolation from SU2 data |
src/dynamics.py | LongitudinalDynamics | 6-DoF Newton-Euler integration |
src/actuator.py | Actuator | Second-order control surface model |
src/gust_profile.py | gust_1minuscos() | Smooth vertical wind gust generator |
src/verification_hook.py | VerificationHook | Event-driven SU2 snapshot trigger |
src/plot_telemetry.py | plot_telemetry() | Dracula-themed telemetry dashboard |
run_flight_dynamics.py | main() | Orchestrator and entry point |