Downloads · 30 days
0
yaga-07/apexflow-surrogate
apexflow-surrogate is a machine learning model from yaga-07. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Two small PyTorch models that predict steady, incompressible 2D RANS flow around NACA 4-digit airfoils, trained on OpenFOAM (simpleFoam, kOmegaSST) CFD data. Learned surrogates, not CFD -- see Limitations below.
Downloads · 30 days
0
Access
Public
Updated Aug 25, 2026
Repo size
2 MB
Likes
0
Public
Click a slice to open those files.
.pt2 MB · 100%
From the Hugging Face model README
Two small PyTorch models that predict steady, incompressible 2D RANS flow
around NACA 4-digit airfoils, trained on OpenFOAM (simpleFoam, kOmegaSST)
CFD data. Learned surrogates, not CFD -- see Limitations below.
Demo Space: see the linked Space on this model's page (or search "ApexFlow" on Hugging Face Spaces).
best.pt -- Route A, a small U-Net (483,763 params). Input: 5-channel
(signed distance function, fluid/solid mask, x, z, angle of attack) on a
128x128 grid. Output: (u/U∞, v/U∞, Cp) on the same grid.best_surface.pt -- Route B, a coordinate-based MLP (8,897 params).
Input: (fractional arc-length position, x, z, camber m, camber location p,
thickness t, angle of attack) per surface point. Output: Cp at that point.
This is the more accurate force-recovery path (see Metrics) -- reading Cp
off Route A's 128x128 grid and interpolating it onto the exact airfoil
surface has an inherent resolution-limited error that predicting Cp
directly at surface points avoids.Both files are self-contained PyTorch checkpoints: model_state_dict,
config (architecture hyperparameters), and norm_stats (per-channel
normalization statistics computed from the training split only) all bundled
together.
| Metric | Route A (U-Net, field) | Route B (surface MLP) |
|---|---|---|
| Params | 483,763 | 8,897 |
| Field MSE (u*, v*, Cp), physical units | 0.00031 / 0.00005 / 0.00013 | -- |
| Mean |Cl error| vs CFD | 0.076 | 0.023 |
| Mean |Cd (pressure) error| vs CFD | 0.0034 | 0.0043 |
| Cd within 0.01 tolerance | -- | 15/15 |
Route A's Cl recovery is bounded by a known grid-interpolation artifact, isolated during evaluation by also integrating the ground-truth gridded Cp the same way (mean |Cl error| 0.24 from gridding alone) -- confirming the gap is resolution, not model quality. Route B avoids this by predicting Cp directly at surface points instead of reading it off the grid, which is why it's the recommended path for lift/drag, and Route A is the one to use for the full flow field.
Both models degrade specifically near AoA ≈ 8-9°, the separation-onset boundary -- consistent with, not contradicting, the training-data exclusion above.