Skip to content

Releases: Neonwave175/TitaniumFoil

Version 0.1.0 Beta

13 May 14:01

Choose a tag to compare

TitaniumFoil v0.1.0 Beta

Released: 2026-05-13


What is TitaniumFoil?

GPU-accelerated NACA airfoil analysis and optimisation for Apple Silicon. A ground-up Rust reimplementation of Mark Drela's XFOIL panel method, with a Metal compute shader for the O(N²) panel influence matrix and a differential evolution optimiser.


Features

Analysis (titaniumfoil)

  • NACA 4-digit, 5-digit, and 6-series airfoil geometry
  • Inviscid panel solver (Dirichlet boundary condition, PSILIN inner loop)
  • Integral boundary layer: Thwaites laminar → Michel transition → Head turbulent → Ludwieg-Tillmann Cf
  • Full polar sweep with braille terminal plots
  • Spanwise lift distribution via Prandtl lifting line theory
  • Chordwise −Cp distribution plot

Optimiser (titaniumfoil-opt)

  • Differential evolution (DE/rand/1/bin) over NACA 4-digit, 6-series, or mixed families
  • Objective: mean L/D across Reynolds numbers with pitching moment penalty
  • GPU-batched panel solves with designation cache — ~21 000 eval/s at N=129
  • Reynolds number, AoA sweep, thickness, camber, and convergence all configurable

Reynolds Calculator (titaniumfoil-re)

  • ISA atmosphere (Sutherland viscosity, hydrostatic density, troposphere + stratosphere)
  • Any altitude, any speed unit (m/s, km/h, mph, kts), any chord unit
  • Outputs ready-to-paste Reynolds list for titaniumfoil-opt

Rust API (titaniumfoil crate)

  • Solver::analyze — single operating point
  • Solver::polar — full polar, panel matrix built once
  • Solver::polar_multi_re — polar across multiple Reynolds numbers
  • Solver::analyze_batch — many airfoils in one GPU dispatch
  • Rayon-parallel friendly — thread-local GPU contexts, no locks

Performance (Apple M-series)

Panel count N Throughput
nside=65 129 ~21 000 eval/s
nside=120 239 ~7 500 eval/s
nside=180 359 ~3 000 eval/s

~21 000× faster than the Python/XFOIL subprocess equivalent.


Requirements

  • macOS (Apple Silicon — M1 or later)
  • Xcode Command Line Tools
  • Rust ≥ 1.70

Known Limitations

  • Inviscid only — boundary layer model gives skin friction but no displacement correction or separation prediction. L/D values are conservative (typically 1.5–2× below fully-coupled viscous results at low Re).
  • No stall modelling — the optimizer will favour thin airfoils that would separate in reality. Set t_min ≥ 10 and use the CM penalty to constrain results.
  • Apple Silicon only — the Metal GPU path requires unified memory. CPU-only fallback is not implemented.
  • NACA families only — arbitrary airfoil coordinates not yet supported.

License

GPL-2.0 — see LICENSE. Derived from Mark Drela's XFOIL (also GPL-2.0).