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.
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.