This repository contains the code accompanying our paper, "Integrating Neural Operators with Diffusion Models Improves Spectral Representation in Turbulence Modeling". Our work demonstrates how diffusion models can help mitigate the spectral bias suffered by neural operators. Check out our project page. Below, you will find the structure, usage instructions, and dependencies for this repository.
case_1_kolmogorov/: Contains code and data access instructions for the Kolmogorov flow case.case_2_buoyancy/: Contains code and data access instructions for the buoyancy-driven flow case.case_3_airfoil/: Contains code and data access instructions for the LES airfoil case.case_4_LES_jet/: Contains code and data access instructions for the LES jet case.case_5_schlieren_jet/: Contains code and data access instructions for the schlieren jet case.requirements.txt: Minimal dependencies required to run the code.requirements_full.txt: Full dependencies for all features and cases.
We found that DCAR rollouts help stabilize longer forecasts. Checkout our implementation case_3_airfoil/no_dm/tc_unet/dm/dcar_rollout.ipynb
-
Clone this repository:
git clone https://github.com/vivekoommen/NeuralOperator_DiffusionModel.git cd NeuralOperator_DiffusionModel -
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt
-
For full features, install:
pip install -r requirements_full.txt
Each case folder contains a data/ subdirectory with scripts for dataset preparation. The datasets can be accessed or generated as follows:
| Case | Dataset Details |
|---|---|
| Kolmogorov Flow | Generated by ns_data_generator.ipynb link |
| Buoyancy-Driven Flow | From PDEArena link |
| LES Airfoil | airfoilLES_snapshots_midspan.zip from link |
| LES Jet | jet_3D_01000.zip from link |
| Schlieren Jet | 20210125-Run1.zip from link |
-
Train the Neural Operator: Navigate to the desired case folder and run:
python3 -u train_no.py
-
Prepare Data for Diffusion Model: Run the Jupyter Notebook
no_postprocess.ipynb. -
Train the Diffusion Model: Navigate to the
dm/folder inside the case directory and run:python3 -u train_dm.py
-
Post-process Results: Run the Jupyter Notebook
dm_postprocess.ipynbto generate figures.
If you use this code, please cite our paper:
@article{oommen2024integrating,
author = {Oommen, Vivek and Bora, Aniruddha and Zhang, Zhen and Karniadakis, George Em },
title = {Integrating neural operators with diffusion models improves spectral representation in turbulence modelling},
journal = {Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences},
volume = {481},
number = {2309},
pages = {20240819},
year = {2025},
doi = {10.1098/rspa.2024.0819}
}This project is licensed under the MIT License. See the LICENSE file for details.
- The Kolmogorov flow was simulated using the pseudo-spectral solver provided in FNO's Repository.
- This repository builds upon the diffusion model implementation by Phil Wang.