CoolFace
Modelpublic

OneScience-Group/CFD_Benchmark

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes13downloads
Model Card

<p align="center"> <strong> <span style="font-size: 30px;">CFD_Benchmark</span> </strong> </p>

Model Overview

CFD_Benchmark is an open-source deep-learning benchmark library for research on neural partial differential equation (PDE) solvers. It extends Tsinghua University's open-source Neural-Solver-Library with Distributed Data Parallel (DDP) training support, additional models, and new datasets, while retaining the original neural-operator and physical-field modeling framework. The library supports neural PDE solver evaluation, deep-learning research for CFD, multi-model performance comparisons, large-scale distributed training experiments, physical simulation dataset development, and algorithm benchmarking.

The library currently supports the following benchmarks:

  • Six standard benchmarks from [[FNO]](https://arxiv.org/abs/2010.08895) and [[geo-FNO]](https://arxiv.org/abs/2207.05209)
  • PDEBench [[NeurIPS 2022 Track dataset and benchmark]](https://arxiv.org/abs/2210.07182) for autoregressive tasks
  • The ShapeNet-Car dataset [[TOG 2018]](https://dl.acm.org/doi/abs/10.1145/3197517.3201325) for industrial design benchmarks
  • The BubbleML [[Multiphase Multiphysics Dataset]](https://arxiv.org/abs/2307.14623) for studying multiphysics phase-transition phenomena

Supported Neural Solvers

The following neural PDE solvers are supported:

  • Transolver - Transolver: A Fast Transformer Solver for PDEs on General Geometries [[ICML 2024]](https://arxiv.org/abs/2402.02366) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Transolver.py)
  • ONO - Improved Operator Learning by Orthogonal Attention [[ICML 2024]](https://arxiv.org/abs/2310.12487v3) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/ONO.py)
  • Factformer - Scalable Transformer for PDE Surrogate Modeling [[NeurIPS 2023]](https://arxiv.org/abs/2305.17560) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Factformer.py)
  • U-NO - U-NO: U-shaped Neural Operators [[TMLR 2023]](https://openreview.net/pdf?id=j3oQF9coJd) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/U_NO.py)
  • LSM - Solving High-Dimensional PDEs with Latent Spectral Models [[ICML 2023]](https://arxiv.org/pdf/2301.12664) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/LSM.py)
  • GNOT - GNOT: A General Neural Operator Transformer for Operator Learning [[ICML 2023]](https://arxiv.org/abs/2302.14376) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/GNOT.py)
  • F-FNO - Factorized Fourier Neural Operators [[ICLR 2023]](https://arxiv.org/abs/2111.13802) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/F_FNO.py)
  • U-FNO - An enhanced Fourier neural operator-based deep-learning model for multiphase flow [[Advances in Water Resources 2022]](https://www.sciencedirect.com/science/article/pii/S0309170822000562) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/U_FNO.py)
  • Galerkin Transformer - Choose a Transformer: Fourier or Galerkin [[NeurIPS 2021]](https://arxiv.org/abs/2105.14995) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Galerkin_Transformer.py)
  • MWT - Multiwavelet-based Operator Learning for Differential Equations [[NeurIPS 2021]](https://openreview.net/forum?id=LZDiWaC9CGL) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/MWT.py)
  • FNO - Fourier Neural Operator for Parametric Partial Differential Equations [[ICLR 2021]](https://arxiv.org/pdf/2010.08895) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/FNO.py)
  • Transformer - Attention Is All You Need [[NeurIPS 2017]](https://arxiv.org/pdf/1706.03762) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Transformer.py)
  • GFNO - Group Equivariant Fourier Neural Operators for Partial Differential Equations[[2023 Poster]](https://arxiv.org/pdf/1706.03762)[[Code]](https://github.com/divelab/AIRS/blob/main/OpenPDE/G-FNO/models/GFNO.py)

Several vision architectures also serve as effective baselines for structured-geometry tasks:

  • Swin Transformer - Swin Transformer: Hierarchical Vision Transformer using Shifted Windows [[ICCV 2021]](https://arxiv.org/abs/2103.14030) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Swin_Transformer.py)
  • U-Net - U-Net: Convolutional Networks for Biomedical Image Segmentation [[MICCAI 2015]](https://arxiv.org/pdf/1505.04597) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/U_Net.py)

Several established geometric deep-learning models are included for design tasks:

  • Graph-UNet - Graph U-Nets [[ICML 2019]](https://arxiv.org/pdf/1905.05178) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/Graph_UNet.py)
  • GraphSAGE - Inductive Representation Learning on Large Graphs [[NeurIPS 2017]](https://arxiv.org/pdf/1706.02216) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/GraphSAGE.py)
  • PointNet - PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation [[CVPR 2017]](https://arxiv.org/pdf/1612.00593) [[Code]](https://github.com/thuml/Neural-Solver-Library/blob/main/models/PointNet.py)

The library also includes the following graph neural network:

  • MeshGraphNet LEARNING MESH-BASED SIMULATION WITH GRAPH NETWORKSICLR 2021 [[Code]](https://github.com/google-deepmind/deepmind-research/tree/master/meshgraphnets)

Use Cases

Use CaseDescription
Neural PDE solver evaluationTrain, run inference with, and compare models such as FNO, Transolver, GNOT, ONO, and U-NO through a unified workflow
Autoregressive physical predictionPredict the temporal evolution of PDE states step by step using datasets such as PDEBench
Multiphysics modelingStudy multiphase flows, multiphysics coupling, and phase-transition phenomena using datasets such as BubbleML
ModelScope/OneCode executionDownload the standalone model package, install its dependencies, and run the provided scripts

Usage

1. OneCode

Use the online OneCode environment for an intelligent, one-click AI for Science (AI4S) programming experience:

Launch OneCode for one-click AI4S programming

2. Manual Setup

Hardware Requirements

  • A GPU or DCU is recommended.
  • A CPU can be used for import checks and small-scale pipeline validation, but full training and inference will be slow.
  • DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version for the target cluster, is recommended.

Download the Model Package

bash
hf download OneScience-Group/CFD_Benchmark --local-dir ./CFD_Benchmark 
cd CFD_Benchmark 

Set Up the Runtime Environment

DCU Environment

bash
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# Installation with uv is also supported
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai

GPU Environment

bash
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
# Installation with uv is also supported
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai

Training Data

Use the dataset links in the benchmark overview above to download the required data.

The six standard benchmark datasets from [[FNO]](https://arxiv.org/abs/2010.08895) and [[geo-FNO]](https://arxiv.org/abs/2207.05209) are available from this link.

The PDEBench [[NeurIPS 2022 Track dataset and benchmark]](https://arxiv.org/abs/2210.07182), used for benchmarking autoregressive tasks, is available from this link.

The ShapeNet-Car [[TOG 2018]](https://dl.acm.org/doi/abs/10.1145/3197517.3201325) benchmark dataset for industrial design tasks is available from [[this link]](http://www.nobuyuki-umetani.com/publication/mlcfd_data.zip).

The BubbleML [[Multiphase Multiphysics Dataset]](https://arxiv.org/abs/2307.14623), designed for research on multiphysics phase-transition phenomena, is available from [[this link]](https://github.com/HPCForge/BubbleML/blob/main/bubbleml_data/README.md).

The OneScience community also provides the cfd_benchmark dataset for training. Download it with the command below and verify that the data path in conf/config.yaml is configured correctly:

hf download --repo-type dataset OneScience-Group/cfd_benchmark  --local-dir ./data

Training

bash
python scripts/train.py

Model Weights

This repository will provide weights trained on the OneScience cfd_benchmark dataset in the weights/ directory. The weights will be uploaded soon.

Inference

bash
python scripts/inference.py

Inference loads the trained weights referenced by paths.weight_path and writes the metrics to:

text
./results/{train.save_name}/metrics.json

Official OneScience Resources

PlatformOneScience RepositorySkills Repository
Giteehttps://gitee.com/onescience-ai/onesciencehttps://gitee.com/onescience-ai/oneskills
GitHubhttps://github.com/onescience-ai/OneSciencehttps://github.com/onescience-ai/oneskills

Citations and License

  • Reference repository: Neural-Solver-Library.
  • This repository retains source attribution and has been adapted for automated execution through OneScience and ModelScope.