This repository contains the official implementation of the paper: "Conditional flow matching for generative modelling of near-wall turbulence with quantified uncertainty".
To set up the environment, follow these steps:
-
Create the Conda environment:
conda env create -f environment.yml
-
Activate the environment:
conda activate fm-swag
-
Configure Environment Variables: Create a
.envfile in the root directory of the repository with the following content. Specify the GPU device ID you wish to use (leave empty if not applicable or to use default).CUDA_VISIBLE_DEVICES= PYTHONPATH=$PYTHONPATH:.Then, source the environment file using the following command:
set -o allexport && source .env && set +o allexport
Run scripts using the following syntax:
python scripts/<script_name>.py scripts/<config>.yaml-
Flow Matching Model: For training the flow matching model to learn the prior distribution of velocity fluctuations:
python scripts/training/train_unet_fm.py scripts/training/unet_fm.yaml
-
Baseline (FCN): For the baseline training, you can use either the Wall-Measurement
$\rightarrow$ Velocity-Fluctuations (WMVF) or Velocity-Fluctuations$\rightarrow$ Wall-Measurement (VFWM) configuration.python scripts/training/train_unet_baseline_fwd_op.py scripts/training/unet_bb_wmvf.yaml # OR python scripts/training/train_unet_baseline_fwd_op.py scripts/training/unet_bb_vfwm.yaml -
SWAG Model: For training SWAG forward operator, used for conditional inference:
python scripts/training/train_unet_swag_fwd_op.py scripts/training/unet_swag_fwd_op.yaml
-
Conditional Inference:
python scripts/inference/ours_prod.py scripts/inference/ours.yml
-
Unconditional Inference:
python scripts/inference/ours_uncond_prod.py scripts/inference/ours_uncond.yml
-
Baseline Inference:
python scripts/inference/baseline_prod.py scripts/inference/baseline.yml
Please open an issue if you have any questions.
If you find this code useful in your research, please cite:
@article{Parikh_Fan_Wang_2026,
title={Conditional flow matching for generative modelling of near-wall turbulence with quantified uncertainty},
volume={1029},
DOI={10.1017/jfm.2026.11193},
journal={Journal of Fluid Mechanics},
author={Parikh, Meet Hemant and Fan, Xiantao and Wang, Jian-Xun},
year={2026},
pages={A32}
}