Khaos Darcy Flow 2D
A Fourier Neural Operator that maps a scenario (fields, boundary conditions and PDE parameters) to the steady pressure field on a 64 x 64 grid, orders of magnitude faster than a numerical solver.
pde_darcy_flow_2d v1, from Khaos (a local-first library of pre-trained models for domain-specific tasks). This is the first release of the artifact.
Model
- Architecture: FNO2d (4 Fourier layers, width 32, 16 x 16 modes) wrapped with input/output normalization; the Fourier transform uses explicit DFT matrices so it exports to ONNX
- Parameters: 4,203,117
- Format: ONNX (
model.onnx) plus PyTorch weights (model.pt) andmanifest.json - Training data: fletxcher/khaos-pde_darcy_flow_2d
Results
Measured on the held-out test split of the training dataset.
| Metric | Value |
|---|---|
| test_rel_l2 | 0.1658 |
| n_test | 280 |
| test_ood_rel_l2 | 0.4498 |
| test_rel_l2_li2021_darcy | 0.0413 |
| test_rel_l2_pdebench_darcy_beta1.0 | 0.0706 |
| test_rel_l2_synthetic | 0.3606 |
| baseline_zero_prediction_rel_l2 | 1.0000 |
Test error by source
| Source | Relative L2 |
|---|---|
| li2021_darcy | 0.0413 |
| pdebench_darcy_beta1.0 | 0.0706 |
| synthetic | 0.3606 |
Training
{
"architecture": "FNO2d",
"time": false,
"log": [
0
],
"epochs": 100,
"batch": 32,
"lr": 0.001,
"extra": [
"test_ood"
],
"resolution": [
64,
64
]
}
Best epoch 98, trained in 12.4 minutes on a single consumer GPU (RTX 3050 8 GB).
Intended use
Fast approximate solutions for design exploration and sweeps on a 64 x 64 grid. The model takes the raw physical inputs described in the dataset card, so normalization is built in.
Limitations
- The grid is fixed at 64 x 64: other resolutions need a new model.
- Accuracy is reported on the dataset's scenario distribution; boundary conditions or parameters outside it are extrapolation.
- A surrogate has no error guarantee: check against a numerical solver before relying on it for safety-critical decisions.
Usage
pip install khaos
khaos serve ./pde_darcy_flow_2d
License
Trained on data released under CC BY 4.0 or generated by Khaos; released under CC BY 4.0.