(vc_airfoil_naca0012)= # NACA 0012 Airfoil ## Why this case matters Every external-flow case in the suite so far - the sphere {ref}`vc_flow_over_stat_sphere` and the cylinder {ref}`vc_flow_over_cylinder` - is a bluff body with zero net lift, dominated by massive separation. A lifting airfoil is a different and stiffer test: the flow stays attached over most of the surface, the boundary layer develops under a strong streamwise pressure gradient, and the small imbalance between the suction and pressure sides integrates into lift. This is the core regime of external aerodynamics, and it is the most demanding check of the near-wall treatment (the immersed boundary method and its wall model) on a thin, curved body at incidence. The NACA 0012 section is the canonical choice: it is the most extensively documented validation airfoil, with experimental {footcite:t}`Ladson1988,McCroskey1987,Gregory1970` and computational {footcite:t}`NASATMR_NACA0012` reference data spanning the full lift curve and into stall. This case validates the **lift coefficient** $C_L(\alpha)$ and the **surface-pressure distribution** $C_p(x/c)$ first (phase 1); both fall out of the same surface integration of the IBM spread forces. The **skin-friction distribution** $C_f(x/c)$ is a follow-up (phase 2) once the lift baseline is trusted. ### Setup A NACA 0012 section of chord $c$ sits in a uniform free stream $U_\infty$ along $x$. Following the Nassu axis convention (shared with the cylinder case), the span is periodic along $y$ and lift acts along $z$ (the vertical), so the section behaves as an infinite (effectively two-dimensional) wing. The geometry is immersed through the IBM (one Lagrangian node per STL triangle); the angle of attack is applied as a rigid rotation of the body about the spanwise $y$ axis through its quarter chord, so a single STL serves the whole angle sweep. The flow is wall-modelled LES (Smagorinsky subgrid model with a non-equilibrium turbulent-boundary-layer wall model on the body). The boundary layer is thin relative to the chord, so the level-0 grid cannot resolve it and the refinement does the near-wall work. The case keeps level 0 deliberately coarse (`chord_lu` cells per chord, default 42, to keep the large far field cheap), brackets the wake with two nested boxes (levels 1 and 2), and wraps the airfoil itself in a **surface-conforming body refinement** at level 3 - a thin shell that follows the section at incidence (5 lattice nodes into the body, 30 into the fluid) rather than a bounding box. The first near-wall fine cell lands at $y^+ \approx 60$, inside the log layer the wall model expects. Because the finest level is a conforming shell (not a box), it is cheap: level 3 is only a few thousand blocks, and a full angle costs $\approx$100M nodes / $\approx$10 GB / $\approx$12 h at 500 MLUPS. The streamwise domain is biased downstream: the leading edge sits $\approx$5 chords from the inlet, the quarter chord at $5.25c$, and the trailing edge $\approx$15 chords from the outlet, so the refinement extends a long wake downstream before the outlet. This concentrates the refined grid where the lifting wake and shed vorticity develop, rather than on the quiescent upstream flow, and keeps the outlet boundary far enough from the body that it does not feed back onto the loads. :::\{important} This case runs at a **cost-constrained** $\mathrm{Re}_c = 5\times10^5$ (the issue allows $\mathrm{Re}_c \sim 10^5$ to $5\times10^5$ when cost-constrained). Reaching a useful near-wall $y^+$ at the reference $\mathrm{Re}_c = 6\times10^6$ would need of order $10^{10}$ nodes with box refinement. The vendored TMR / SA reference data is at $\mathrm{Re}_c = 6\times10^6$. The **attached-flow lift-curve slope** is nearly Reynolds-independent and compares directly, but the **maximum lift and stall angle both drop at the lower Reynolds number** (roughly $C_{L,\max}\approx 1.0$ near $\alpha \approx 11^\circ$ at $\mathrm{Re}_c = 5\times10^5$, against $\approx 1.5$ near $16^\circ$ at $6\times10^6$ {footcite:t}`Ladson1988`), and the zero-lift drag $C_{D,0}$ and suction-peak $C_p$ are likewise offset. Since all vendored reference data is at $6\times10^6$, the stall metrics are reported only qualitatively here; validating them quantitatively would need matched-Reynolds ($5\times10^5$) reference data. ::: The Reynolds number is chord-based: ```{math} --- label: vc_reynolds_naca0012 --- \mathrm{Re}_c = \frac{U_\infty\, c}{\nu} ``` The simulation runs at $\mathrm{Re}_c = 5\times10^5$, $\mathrm{Ma}_\text{LBM} \approx 0.17$, fully turbulent. The reference data is the NASA Turbulence Modeling Resource (TMR) set at $\mathrm{Re}_c = 6\times10^6$, $\mathrm{Ma} \approx 0.15$ (see the note above on the Reynolds-number offset). :::\{note} The lattice free stream is $U_\infty = 0.1$, i.e. $\mathrm{Ma}_\text{LBM} = U_\infty\sqrt{3} \approx 0.17$, above the usual weakly-compressible $\mathrm{Ma} < 0.1$ guideline. This is a deliberate trade: it halves the number of time steps needed to reach the averaging window, at the cost of some compressibility error in the suction-peak $C_p$. Halve $U_\infty$ to 0.05 ($\mathrm{Ma}_\text{LBM} \approx 0.087$) to stay strictly weakly compressible, at double the step count. ::: Statistics (mean and rms of $\rho$ and velocity) are accumulated by combined spanwise and time averaging over a window of $\approx$100 convective time units ($1\,\text{CTU} = c/U_\infty$, 420 steps at the default resolution), after discarding a $\approx$50-CTU initial transient - the converged-statistics practice for airfoil wall-modelled LES {footcite:t}`NASATMR_NACA0012`. The mean lift, drag and surface pressure are recovered from the time-averaged IBM forces and body probe in the notebook; the per-node IBM spread forces are sampled every 100 steps so the mean and rms of the unsteady lift converge. For inspection the run also exports debug plane series: a full-domain $x$-$z$ plane at mid-span (the streamwise side view), a $x$-$y$ plane at the airfoil mid-height (to check spanwise homogeneity), and a high-resolution $x$-$z$ plane restricted to the airfoil and near-wake (sampled at $0.25$ lattice units for a good view of separation and shed vorticity). ### Domain and sampling vs. published practice The domain extents and averaging window follow published NACA 0012 large-eddy simulation practice. The inlet sits $\approx$5 chords upstream of the leading edge, matching the wall-modelled LES of {footcite:t}`kawai2013wall` near stall, and the far-field boundaries are placed $\pm$5 chords above and below the section. The span is periodic over $0.5c$: this sits between the $0.2c$ spanwise extent used in the full-stall direct numerical simulation of {footcite:t}`rodriguez2013dns` and the $\approx$0.3c common in body-fitted wall-modelled LES, wide enough to decorrelate the spanwise turbulence for an effectively two-dimensional section. Following the same references, a $\approx$50-CTU transient is discarded before statistics accumulate over a $\approx$100-CTU window. ### Lift, drag and pressure coefficients The lift and drag coefficients normalise the force on the section by the dynamic pressure and the planform reference area $A = c\,b$ (chord times span): ```{math} --- label: vc_lift_coefficient_naca0012 --- C_L = \frac{F_z}{\tfrac{1}{2}\rho_\infty U_\infty^2\, c\, b}, \qquad C_D = \frac{F_x}{\tfrac{1}{2}\rho_\infty U_\infty^2\, c\, b} ``` In an IBM simulation the streamwise force $F_x$ (drag) and the vertical force $F_z$ (lift) are recovered from the sum of the spread forces over the Lagrangian surface nodes, time-averaged over the statistics window. In the linear regime thin-airfoil theory predicts a lift-curve slope ```{math} --- label: vc_thin_airfoil_slope --- \frac{\mathrm{d}C_L}{\mathrm{d}\alpha} = 2\pi \;\text{per radian} \;\approx\; 0.11 \;\text{per degree}, ``` independent of Reynolds number in the attached regime. At the reference $\mathrm{Re}_c = 6\times10^6$ the section stalls near $\alpha \approx 16^\circ$ with $C_{L,\max}\approx 1.5$ to $1.6$ {footcite:t}`McCroskey1987`; at the run's lower $\mathrm{Re}_c = 5\times10^5$ both the maximum lift ($C_{L,\max}\approx 1.0$) and the stall angle ($\approx 11^\circ$) are reduced {footcite:t}`Ladson1988`. The pressure coefficient on the surface is ```{math} --- label: vc_pressure_coefficient_naca0012 --- C_p = \frac{p - p_\infty}{\tfrac{1}{2}\rho_\infty U_\infty^2}, \qquad p = c_s^2\,\rho, ``` read from the body-surface probe (the local density just off the wall) and plotted against the chordwise coordinate $x/c$, separated into the suction (upper) and pressure (lower) sides. The suction peak near the leading edge and the stagnation point are the sharpest diagnostics of accuracy. ### Reference data The quantitative target is the TMR finite-volume SA solution on the finest ($897\times257$) C-grid; CFL3D and FUN3D agree to about 1% in $C_L$ and 4% in $C_D$. The experimental anchor is Ladson (NASA TM 4074). Representative values: | $\alpha$ [deg] | $C_L$ (CFL3D) | $C_L$ (FUN3D) | $C_D$ (CFL3D) | $C_D$ (FUN3D) | | -------------: | ------------: | ------------: | ------------: | ------------: | | 0 | 0.0 | 0.0 | 0.00819 | 0.00812 | | 10 | 1.0909 | 1.0983 | 0.01231 | 0.01242 | | 15 | 1.5461 | 1.5547 | 0.02124 | 0.02159 | The zero-lift drag $C_{D,0}\approx 0.0082$ is skin-friction-dominated and is a sharp cross-check of the wall model before the phase-2 $C_f$ distribution is trusted. All reference files (experimental $C_L/C_D$ scatter, CFD $C_p$ and $C_f$ distributions) are vendored under `reference/`; their provenance is recorded in `reference/REFERENCES.md`. ### Simulation parameters | Parameter | Value | | ------------------------------- | ---------------------------------------------------------------------------------------------------- | | Chord $c$ (level 0) | 42 lattice units (`chord_lu`, the resolution knob; default 42) | | Span $b$ (periodic, $y$) | 24 lattice units ($0.5c$) | | Domain ($x\times y\times z$) | $896\times24\times424$ (wake-biased; leading edge at $x=210$, ~5c from inlet) | | Free stream $U_\infty$ | 0.1 (lattice), $\mathrm{Ma}_\text{LBM}\approx0.17$ | | Reynolds number $\mathrm{Re}_c$ | $5\times10^5$ (cost-constrained; reference is $6\times10^6$) | | Relaxation time $\tau$ | 0.5000252 (derived from `chord_lu` and `Re_c`) | | Near-wall refinement | two wake boxes (lvl 1-2) + a body-conforming lvl-3 shell (5 in / 30 out), $y^+\approx 60$ | | Time steps | 63,000 = 21,000 spin-up (~50 CTU) + 42,000 averaging (~100 CTU) | | Cost @ 500 MLUPS (per angle) | $\approx$100M nodes, $\approx$10 GB GPU, $\approx$12 h, $\approx$3.6 GB output | | Velocity set / operator | D3Q27 / RRBGK | | Subgrid model | Smagorinsky, $C_S = 0.17$ | | Wall model | NonEqTBL on the IBM body | | Angle-of-attack sweep | $\alpha = 0, 4, 8, 10, 12, 15^\circ$ (`04_airfoil_naca0012.nassu.yaml`) | | Grid-convergence pair | $\alpha = 10^\circ$, lvl-3 vs lvl-4 body shell (`04.1_airfoil_naca0012_grid_convergence.nassu.yaml`) | ### Tuning the resolution The case is parametric: a single knob, `chord_lu` (level-0 lattice cells per chord, the $H/\Delta x$ analogue), in the `variables` block of both YAML files sets the whole-grid resolution. Every domain extent, refinement box, IBM placement, probe region, the viscosity/$\tau$ and the time window are derived from it in *chord units*, so changing it (for example 40, 44, 48, 52, 56) rescales the mesh while holding the physical layout ($5c$ upstream, $\pm5c$ far-field, refinement extents, the near-wall $y^+$ target) and the Reynolds number fixed. The airfoil STL (native chord 48) is rescaled by `chord_lu / 48` so the IBM node density tracks the lattice. The refinement and statistics boxes are expressed in a `chord` coordinate system (`domain.systems.chord`, `scale = chord_lu`) so their coordinates are plain chord fractions; the solver bakes and block-snaps them, so small sub-block differences between resolutions are expected and harmless. `Re_c` is a second, independent knob ($\tau$ is derived from `chord_lu` and `Re_c`, so resolution and Reynolds number vary independently). Cost scales steeply: node count grows roughly as `chord_lu`$^3$ and the run length (fixed convective-time window) as `chord_lu`, so total work grows about as `chord_lu`$^4$. ### Validation metrics Phase 1 (this case): - $C_L(\alpha)$ matches the reference in the linear regime, with slope close to {eq}`vc_thin_airfoil_slope` - the Reynolds-robust metric and the primary check given the $\mathrm{Re}$ offset. The stall onset ($C_{L,\max}$ and its angle) is reported only qualitatively: both fall at the run's lower Reynolds number and are not directly comparable to the $6\times10^6$ reference. - $C_p(x/c)$ at $\alpha = 10^\circ$ reproduces the chordwise shape of the CFD reference (stagnation, suction peak, recovery); the suction-peak magnitude is expected to sit below the $\mathrm{Re}_c = 6\times10^6$ reference at the run's lower Reynolds number. - Drag is reported as a self-consistency / convergence check (the $\mathrm{Re}_c = 6\times10^6$ value $C_{D,0}\approx 0.0082$ is not the target at $\mathrm{Re}_c = 5\times10^5$, where skin friction is higher). - A spatial-convergence trend reported between the two near-wall resolutions. Phase 2 (follow-up): $C_f(x/c)$ on suction and pressure sides at a documented angle. :::\{note} With an IBM simulation the lift and drag are the sums of the spread forces in the $z$ (vertical) and $x$ (streamwise) directions over the surface nodes (see {eq}`vc_lift_coefficient_naca0012`). ::: :::\{important} The subgrid and wall models carry the near-wall physics. The near-wall refinement depth and the wall-model matching distances (`dist_ref`, `dist_shell`, `z0`) are the primary tunables and are intended to be refined by the maintainer during the GPU validation runs. GPU runs are required to populate the notebook outputs; `uv run pytest tests/mod/` and linting are the CI-level gates. ::: ```{toctree} --- hidden: --- 04_airfoil_naca0012.ipynb ``` ```{footbibliography} ```