←All news
Blog··6 min read

AI trust and CFD accuracy: a NACA airfoil case study

Jack Guo, Davy Brouzet, David Ching, Krissh Chawla
Spinoza Labs, Palo Alto, CA
NACA 4412 at 13.87 degrees: the agent's flow solution
The NACA 4412 at 13.87° incidence, computed by the Vortex agent, which set up, meshed, and solved this simulation from one prompt.

Motivation

Simulation tools (both commercial and open-source) for computer-aided engineering (CAE) have matured significantly in recent decades in usability and convenience. However, a simulation solver's numerical output, run to answer an engineering question, needs to be checked for accuracy and reliability in order to have any utility in engineering design. Whether this resultant output can be verified is the difficult and time-consuming part, as it involves assessing whether:

  1. the computational mesh is of sufficient quality, such as with a grid refinement study,
  2. the solution is converged, and
  3. the simulation setup is correct (initial conditions and boundary conditions, time step sizes and schemes, etc.),

among many other factors. This verification process, being slow, tedious, and problem-specific, typically requires a significant amount of an engineer's time.

Vortex is an agentic workflow designed to address this challenge. The Vortex agent performs the engineering tasks while also assessing whether each step finishes correctly. In this blog, we give an overview of Vortex on a NACA 4412 airfoil near maximum lift, a well-known NASA validation case. We present what the checks caught, how the solution compares with reference data, and where the overall solution and process still fall short.

The case and prompt

Case details:

  • Geometry: NACA 4412 airfoil, 13.87° incident angle of attack, two-dimensional
  • Chord Reynolds number: 1.52E6
  • Mach number: 0.09

This is a difficult case for standard RANS models, and it is part of NASA's Turbulence Modeling Resource (TMR) as a standard check for turbulence models. The upper surface boundary layer separates near the trailing edge, with the predicted lift being dependent on the separation location.

Prompt details (given to the agent):

Vortex was given the airfoil's shape as equations, the flight condition, and a list of deliverables. It was given access to OpenFOAM, Gmsh, and Python, compute resources (8 cores and 6 hours), and no web access or reference data. The mesh, turbulence model, and solver settings were left to the agent.

How Vortex earns trust in its results

Checks over the run, stage by stage
Every check over the run, stage by stage.

The checks are code, and they were tested before they were trusted. Once the results were in, a separate Vortex session, one that had built none of the simulation, wrote the convergence checks as code that was locked against change. Before judging the real results, the checks were tested on small cases with known answers. An AI reviewer can comment but can never sign off a numerical result; only the tested code can.

The first mesher's grid folding, next to the final mesh, with an overview of where
Left: the entire first mesh to scale, which extends to +/- 100 chord lengths in both x and y. The blue column above the trailing edge of the airfoil (which is not visible at this scale) is the region shown in the two blue-framed panels, stretched by a factor of ~70 times in the x direction. Middle: the first builder's marching mesher, rerun from the script it kept. Its grid lines cross 8 to 63 chords above the trailing edge, folding 135 cells (red). The attempt the mesh check actually rejected, with 4,280 folded cells, was not saved. Right: the final (fixed) mesh over the same region, with no folded cells.

Vortex rejected its own first mesh and rebuilt it. The first mesh failed the mesh checks: near the trailing edge, its grid lines crossed and folded thousands of cells inside out. Vortex didn't patch the result. It threw that mesh away, changed its meshing approach, and built a family of four meshes, from coarse to fine, that pass every check.

Vortex measured its own numerical error. It solved the flow on four successively finer meshes and estimated the mesh error using the grid convergence index (GCI) method, with a larger safety factor where the convergence was irregular. It then added the iterative error: how much lift and drag were still changing when the solver was stopped. Together, these give an error bar on each result, built without any external data. The error bars cover numerical error only and not the turbulence model's error. Every reported value was fixed before any comparison was made. The comparison with results from NASA's codes and the wind tunnel below was made afterwards, by us.

Vortex said what it couldn't verify.

  • The lift value was still drifting slightly on the finest mesh, so Vortex deemed its trend across meshes to be undetermined and gave a wider error bar instead.
  • Vortex tried a second turbulence model five times, none converged, and it reported that the error from the turbulence model itself is not measured.
  • Two broader judgment calls left to AI reviewers never passed: whether every number traces back to the run that produced it, and whether the full results package (all force components, the separation point and the turbulence model comparison) is converged and properly qualified. Thus, the study was not signed off as a whole.

Accurate CFD with Vortex: comparison with reference data

Forces against NASA's CFL3D and FUN3D, the trailing-edge flow, and upper-surface skin friction
(a) The agent's forces on its finest mesh, with their numerical error bars, as the difference from NASA's CFL3D solution with the same turbulence model [NASA TMR]; FUN3D in purple [NASA TMR]; grey, an estimated 95 % (+/- 2 standard deviations) band from NASA's 11 (10 for viscous drag, as K-e-Rt model does not give a drag split) published solutions with seven turbulence models [NASA TMR case page]. The grey bar is widened by a factor of 1.26 as a standard correction for a small sample. (b) The flow near the trailing edge: chordwise velocity, with reversed flow in blue inside the black u = 0 line; the flow separates at 80.5 % of the chord. (c) Skin friction on the upper surface: it crosses zero where the flow separates, at 0.805 for the agent and 0.791 for CFL3D.

On the finest mesh (262k cells, with Spalart–Allmaras turbulence model), the lift, drag, and viscous drag forces agree closely with NASA's own solutions with the same turbulence model, computed using the CFL3D and FUN3D codes. The agent's upper-surface separation location is close to CFL3D's value.

Surface pressure and trailing-edge velocity profiles: the agent, NASA's CFL3D with the same model, and the experiment
The agent's solution (blue), NASA's own solution with the same turbulence model (CFL3D, Spalart–Allmaras, dashed orange) [NASA TMR] and the Coles–Wadcock experimental study's measurements (circles) [Wadcock 1978, NASA CR-3283]. (a) Surface pressure, uncorrected. (b) Streamwise velocity along NASA's six lines near the trailing edge. The experiment scales velocity by the speed at a probe below and behind the airfoil (about 0.93 of free stream), so both computed velocities are divided by 0.93. The two computations lie almost on top of each other.

Separation is where the agent's solution differs most from the experiment, and the cause is the turbulence model and not the agent's CFD setup. NASA's own Spalart–Allmaras solution (CFL3D, on NASA's grid) nearly matches ours, with flow reversal at 79 % of the chord versus the Vortex solution of 80.5 %. Notably, both separate earlier than the experimentally measured 85 % [Wadcock 1978, NASA CR-3283] and miss the flat pressure near the trailing edge because both predict a thinner separated region compared to the one measured. Vortex tried a second turbulence model (SST) five times, but none of the five attempts converged, so the report states that this model error is not quantified.

Conclusion

Vortex set up, meshed and solved the NACA 4412 airfoil case near maximum lift from one prompt. It rejected its own first mesh and rebuilt it, and gave an error bar to every numerical result without using any reference data. The results were then checked by code that was tested before being trusted.

Its lift, drag and viscous drag agree closely with NASA's own CFL3D and FUN3D solutions that used the same turbulence model. Where the results differ from the wind tunnel (which occurs at the separation near the trailing edge), the cause is the turbulence model, not the setup, with this model error being unquantified.

We are working to extend and assess Vortex for other physics domains, including solid mechanics (with FEA), heat transfer and conjugate heat transfer, and electromagnetics.

Please reach out to Jack Guo at jack@spinozalabs.ai for any questions or points of discussion, including about how to try out Vortex for your own engineering workflows and any possible collaboration opportunities.