How ttuan-atz1/2d-lattice-boltzmann-d2q9-solvermodern-c-with-les-smagorinsky-naca-0012-aerodynamic-analysis. works
This is a two-dimensional lattice-Boltzmann CFD application for simulating flow around a NACA 0012 airfoil. The main workflow validates run settings, sweeps angles of attack, builds airfoil geometry, advances each flow simulation, samples momentum-exchange forces, summarizes aerodynamic performance, and writes CSV and optional VTK results. The graph separates geometry and force analysis from the solver’s grid, collision, and LES layers. The README is empty, and sampled source excerpts omit some wiring, so uncertain links are excluded.
Main entry points: main.cpp Run driver · solver.cpp LBM solver · vtk_exporter.cpp VTK exporter · momentum_exchange.cpp Momentum exchange
Components 15
Run orchestration
- Run driver
src/main.cpp - Run configuration
include/run_config.hpp - Physical units
include/physical_units.hpp
Airfoil geometry
- NACA geometry
src/geometry_naca.cpp
Flow solver
- Distribution grid
include/Grid.hpp - LBM solver
src/solver.cpp - MRT collision
include/collision.hpp - Smagorinsky LES
src/les_smagorinsky.cpp
Analysis and output
- Momentum exchange
src/momentum_exchange.cpp - Aerodynamic forces
include/aerodynamics.hpp - Force statistics
include/force_statistics.hpp - VTK exporter
src/vtk_exporter.cpp - CSV results
- VTK fields
Other components
- Simulation user
Connections 21
- Simulation user → Run driver: runs
- Run driver → Run configuration: validates
- Run driver → Physical units: constructs
- Run driver → NACA geometry: builds geometry
- Run driver → LBM solver: configures and steps
- Run driver → Momentum exchange: samples forces
- NACA geometry → LBM solver: sets geometry
- LBM solver → Distribution grid: updates
- LBM solver → Smagorinsky LES: computes relaxation
- LBM solver → MRT collision: collides distributions
- LBM solver → Momentum exchange: requests force
- Momentum exchange → Distribution grid: reads distributions
- Momentum exchange → Aerodynamic forces: normalizes force
- Run driver → Force statistics: summarizes samples
- Force statistics → Aerodynamic forces: uses force values
- Run driver → CSV results: writes summaries
- Run driver → VTK exporter: exports fields
- VTK exporter → Physical units: converts units
- VTK exporter → Distribution grid: reads fields
- VTK exporter → VTK fields: writes fields
- Run driver → VTK fields: writes failure snapshots