The vulcan::aero module provides fundamental aerodynamic calculations for flight mechanics and trajectory optimization. It is designed to work seamlessly with both numeric types (double) and symbolic types (janus::SymbolicScalar) for automatic differentiation.
Overview
The module provides:
- Fundamental Quantities: Dynamic pressure, Mach number, Reynolds number, Airspeed.
- Aerodynamic Angles: Angle of attack (α) and sideslip angle (β).
- Combined State: A struct AeroState containing all key aerodynamic properties.
Basic Usage
Include
Computing Individual Properties
All functions are templated on Scalar type.
double rho = 1.225;
double V = 250.0;
double a = 340.3;
double mu = 1.789e-5;
double L = 2.0;
Scalar mach_number(const Scalar &velocity, const Scalar &speed_of_sound)
Mach number.
Definition Aerodynamics.hpp:43
Scalar dynamic_pressure(const Scalar &density, const Scalar &velocity)
Dynamic pressure.
Definition Aerodynamics.hpp:28
Scalar reynolds_number(const Scalar &density, const Scalar &velocity, const Scalar &length, const Scalar &viscosity)
Reynolds number.
Definition Aerodynamics.hpp:60
Computing Aerodynamic Angles
aero_angles computes angle of attack (α) and sideslip (β) from the body-frame velocity vector.
vulcan::Vec3<double> v_body;
v_body << 200.0, 10.0, 20.0;
double alpha = angles(0);
double beta = angles(1);
Vec2< Scalar > aero_angles(const Vec3< Scalar > &velocity_body)
Compute aerodynamic angles from velocity in body frame.
Definition Aerodynamics.hpp:113
Combined Aerodynamic State
For efficiency, especially in trajectory optimization, use aero_state to compute everything at once. This effectively combines the atmosphere model outputs with flight conditions.
vulcan::Vec3<double> v_body_10km;
v_body_10km << 250.0, 0.0, 0.0;
double char_len = 5.0;
atm.density,
atm.speed_of_sound,
atm.dynamic_viscosity,
v_body_10km,
char_len
);
std::cout << "Mach: " << state.mach << std::endl;
std::cout << "Dyn P: " << state.dynamic_pressure << std::endl;
AeroState< Scalar > aero_state(const Scalar &density, const Scalar &speed_of_sound, const Scalar &viscosity, const Vec3< Scalar > &velocity_body, const Scalar &char_length)
Compute complete aerodynamic state.
Definition Aerodynamics.hpp:172
AtmosphericState< Scalar > state(const Scalar &altitude)
US Standard Atmosphere 1976 - Complete atmospheric state.
Definition USSA1976.hpp:283
Symbolic Optimization
The entire module is Janus-compatible. You can use janus::SymbolicScalar to build computational graphs for optimization problems.
janus::SymbolicScalar alt = janus::sym("h");
janus::SymbolicScalar velocity = janus::sym("v");
Note: aero_angles uses janus::atan2 and janus::asin, which are fully differentiable and safe for symbolic use.