NeuralConvection-2D-CompactFNO

Model Introduction

NeuralConvection-2D-CompactFNO is a surrogate for two-dimensional natural convection. It maps velocity, temperature, and pressure fields from a Boussinesq simulation to the corresponding compressible-flow fields.

Paper: A Neural Surrogate Approach for Simulating Natural Convection Problems

Model Description

This package reproduces the compact FNO in Table 5: four Fourier blocks, width 64, and 16 retained spectral modes per direction. Inputs and outputs are four-channel 64x64 fields in [u_x, u_y, T, p] order. The model was trained for 200 epochs on the authors' stochastic-temperature-boundary dataset.

Use Cases

Scenario Description
Natural-convection correction Predict compressible fields from Boussinesq fields
Industrial thermal-flow simulation Accelerate field estimation in two-dimensional coupled flow and heat-transfer studies

Usage

1. OneCode

Open the OneCode AI4S environment

2. Manual Setup

Hardware requirements

  • GPU or DCU is recommended. CPU is suitable for small import and forward checks.
  • For DCU, load the matching DTK environment before running PyTorch.

Download the Model Package

hf download OneScience-Group/NeuralConvection-2D-CompactFNO --local-dir ./NeuralConvection-2D-CompactFNO
cd NeuralConvection-2D-CompactFNO

Install the Runtime

DCU

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
pip install scikit-image PyYAML

GPU

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
pip install scikit-image PyYAML

Training Data

The authors' NeuralConvection 2D dataset provides 4,000 training pairs and three 200-pair test splits. Download the fixed v1.0-legacy revision used for this reproduction:

hf download NurshatMenglik/NeuralConvection_2D_TrainTest --repo-type dataset --revision v1.0-legacy --local-dir ./data

The public package sets data.root_dir in config/config.yaml to ./data, so the commands below use the downloaded data when run from the project directory.

Training

python scripts/train.py

The best checkpoint is saved to weight/best_model.pth.

Model Weights

The package includes the best checkpoint from a complete 200-epoch DCU training run.

Inference

python scripts/inference.py

Evaluation and Visualization

python scripts/result.py

OneScience Repositories

Citation and License


中文说明

模型简介

NeuralConvection-2D-CompactFNO 是二维自然对流的代理模型(surrogate model)。它将 Boussinesq 模拟中的速度场、温度场和压力场映射到对应的可压缩流场。

论文:用于模拟自然对流问题的神经代理模型方法

模型描述

本模型包复现了表 5 中的紧凑 FNO,包含四个傅里叶块,宽度为 64,每个方向保留 16 个频谱模态。输入和输出均为按 [u_x, u_y, T, p] 排列的四通道 64x64 场。模型使用作者的随机温度边界数据集训练了 200 轮。

使用场景

场景 说明
自然对流校正 根据 Boussinesq 场预测可压缩流场
工业热流动模拟 加速二维流动与传热耦合研究中的场估计

使用指南

1. OneCode

打开 OneCode AI4S 环境

2. 手动配置

硬件要求

  • 建议使用 GPU 或 DCU。CPU 适用于小规模导入和前向计算检查。
  • 使用 DCU 时,请先加载匹配的 DTK 环境,再运行 PyTorch。

下载模型包

hf download OneScience-Group/NeuralConvection-2D-CompactFNO --local-dir ./NeuralConvection-2D-CompactFNO
cd NeuralConvection-2D-CompactFNO

安装运行环境

DCU

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
pip install scikit-image PyYAML

GPU

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
pip install scikit-image PyYAML

训练数据

作者的 NeuralConvection 2D 数据集提供 4,000 对训练样本及三个各含 200 对样本的测试划分。下载本次复现所用的固定 v1.0-legacy 版本。

hf download NurshatMenglik/NeuralConvection_2D_TrainTest --repo-type dataset --revision v1.0-legacy --local-dir ./data

公开模型包将 config/config.yaml 中的 data.root_dir 设为 ./data,因此从项目目录运行下列命令时会使用下载的数据。

训练

python scripts/train.py

最佳模型权重(检查点)(checkpoint)保存到 weight/best_model.pth。

模型权重

模型包包含通过在 DCU 上完整训练 200 轮得到的最佳模型权重(检查点)。

推理(inference)

python scripts/inference.py

评估与可视化

python scripts/result.py

OneScience 仓库

引用与许可证

Downloads last month
13
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train OneScience-Group/NeuralConvection-2D-CompactFNO

Paper for OneScience-Group/NeuralConvection-2D-CompactFNO