Skip to main content
0.490.92Quickstart section. Ticks: transition at the marked condition, in chord fractions.−505101500.51.01.5Angle of attack, degreesSection lift coefficientslope 0.1019 / deg00.010.020.030.0400.51.01.5Section drag coefficientSection lift coefficient
0.490.92−505101500.51.01.5Angle of attack, degreesSection lift coefficientslope 0.1019 / deg00.010.020.030.0400.51.01.5Section drag coefficientSection lift coefficient

Airfoil characteristics in tens of microseconds, with exact gradients

Bora is a Rust port of Peter Sharpe’s NeuralFoil, a neural-network surrogate of XFoil. One call returns lift, drag, moment and transition for an airfoil, with the derivative of every output with respect to all 23 inputs.

Start with the quickstart, or read what Bora is and is not.

The quickstart airfoil at three Reynolds numbers: profile, lift curve and drag polar, with the rows of the sweep around the marked angle. The ticks on the profile give the transition location at the marked condition, in chord fractions. The heavy line on the lift curve is the analytic slope returned with that one evaluation. One small square is 1° across, 0.1 in lift and 0.002 in drag.

Figure 1. The quickstart section at Reynolds numbers of 0.2 (circles), 1.0 (triangles) and 5.0 million (squares), computed by Bora with NeuralFoil’s xlarge network. The mark is the quickstart condition, 3° at one million; the heavy line through it is the analytic slope returned with that evaluation.

One call

Describe the section with 18 Kulfan parameters, set the angle of attack and Reynolds number, and analyze. Nothing iterates, so the call cannot fail to converge and costs the same every time.

src/main.rs
use bora::{AeroInput, ModelSize, NeuralFoil, input_index};

fn main() -> bora::Result<()> {
let mut input = AeroInput::default();
input.kulfan.upper_weights = [0.24, 0.31, 0.25, 0.35, 0.24, 0.35, 0.28, 0.32];
input.kulfan.lower_weights = [-0.12, -0.05, -0.13, 0.02, -0.08, 0.06, 0.02, 0.06];
input.kulfan.leading_edge_weight = 0.02;
input.kulfan.te_thickness = 0.0025;
input.alpha = 3.0; // degrees
input.re = 1e6;

let model = NeuralFoil::new(ModelSize::XLarge)?;
let result = model.analyze_with_gradients(&input);

println!(
"CL = {:.4}, CD = {:.5}, CM = {:.4}",
result.output.cl, result.output.cd, result.output.cm
);
println!(
"dCL/dalpha = {:.4} per degree",
result.gradient.cl[input_index::ALPHA]
);
Ok(())
}
CL = 0.9516, CD = 0.00729, CM = -0.1301
dCL/dalpha = 0.1019 per degree

These are the values at the mark in Figure 1.

What it covers

  • Lift, drag and quarter-chord moment coefficients.
  • The transition location on each surface.
  • Momentum thickness, shape factor and edge velocity at 32 stations per surface.
  • A confidence that falls as the query leaves the conditions the model was trained on.
  • Exact derivatives of all of the above, by forward or reverse mode.
  • Eight network sizes, from 5 to 356 microseconds per analysis on an Apple M1 Pro.

What it leaves out

  • Compressibility. The model is incompressible and has no Mach number input.
  • Deep stall. Results are meaningful within roughly 20° of zero angle of attack.
  • Anything beyond XFoil. The network learned from XFoil, so XFoil’s assumptions are its ceiling.

Accuracy and limits gives the measured errors and the conditions to avoid.

Whose model this is

The model, its training and its weights are the work of Peter Sharpe, described in P. Sharpe and R. J. Hansman, “NeuralFoil: An Airfoil Aerodynamics Analysis Tool Using Physics-Informed Machine Learning,” arXiv:2503.16323, 2025. Bora reimplements the evaluation in Rust, adds hand-derived derivatives, and is tested against Python NeuralFoil 0.3.3 to a relative tolerance of 10⁻⁶.

Bora was written for Zephyr, a vortex-lattice code that needs sectional data with derivatives inside its viscous coupling. For most users, NeuralFoil itself will be the better fit.

If Bora contributes to published work, cite the NeuralFoil paper. References has the entries.