---
title: FlowBench-FNO-LDC2D-Harmonics
canonical_url: "https://www.modelscope.cn/models/OneScience/FlowBench-FNO-LDC2D-Harmonics"
md_url: "https://www.modelscope.cn/models/OneScience/FlowBench-FNO-LDC2D-Harmonics.md"
repository: OneScience/FlowBench-FNO-LDC2D-Harmonics
last_updated: 2026-10-26
license: apache-2.0
library_name:
  - pytorch
frameworks:
  - PyTorch
language:
  - en
  - zh
downloads: 3
stars: 0
tags:
  - OneScience
  - "流体力学"
  - "神经算子"
---

# FlowBench-FNO-LDC2D-Harmonics

> FlowBench-FNO-LDC2D-Harmonics - OneScience 在 ModelScope 开源的模型。FlowBench-FNO-LDC2D-Harmonics

OneScience/FlowBench-FNO-LDC2D-Harmonics 是 ModelScope 魔搭社区上的机器学习模型，采用 apache-2.0 许可。

- **Repository**: OneScience/FlowBench-FNO-LDC2D-Harmonics
- **License**: apache-2.0
- **Tags**: OneScience, 流体力学, 神经算子
- **Downloads**: 3
- **Stars**: 0
- **Last updated**: 2026-10-26

Source: https://www.modelscope.cn/models/OneScience/FlowBench-FNO-LDC2D-Harmonics

---

<p align="center">
  <strong>
    <span style="font-size: 30px;">FlowBench-FNO-LDC2D-Harmonics</span>
  </strong>
</p>

# 模型介绍

FlowBench-FNO-LDC2D-Harmonics 是基于 FlowBench 数据集构建的二维顶盖驱动腔流 FNO 基线模型，用于预测复杂几何下的稳态流场。

论文：[FlowBench: A Large Scale Benchmark for Flow Simulation over Complex Geometries](https://arxiv.org/pdf/2409.18032)

# 模型描述
FlowBench-FNO-LDC2D-Harmonics 使用 Fourier Neural Operator 结构，复现论文中的 LDC_NS_2D 128x128 harmonics lid-driven cavity 基线实验。模型输入为官方数据中的 3 通道场，输出为 4 通道流场结果。

## 适用场景

| 场景 | 说明 |
| :--- | :--- |
| 复杂几何内流预测 | 面向含复杂内部障碍物的二维顶盖驱动腔流场预测 |
| 神经算子基线验证 | 用于 FlowBench 数据上的 FNO 训练、推理和可视化流程验证 |

# 使用说明

## 1. OneCode 使用

可通过 OneCode 在线环境体验智能化一键式 AI4S 编程：

[点击体验智能化一键式 AI4S 编程](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. 手动安装使用

**硬件要求**

- 推荐使用 GPU 或 DCU 运行。
- CPU 可以用于导入和小配置连通性验证，完整训练和推理速度较慢。
- DCU 用户需要预先安装 DTK，建议使用 DTK 25.04.2 以上版本或与当前集群匹配的 OneScience 推荐版本。

### 下载模型包
```bash
modelscope download --model OneScience/FlowBench-FNO-LDC2D-Harmonics --local_dir ./FlowBench-FNO-LDC2D-Harmonics
cd FlowBench-FNO-LDC2D-Harmonics
```

### 安装运行环境


**DCU环境**

```bash
# 请首先激活DTK及CONDA
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# 支持uv安装
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

**GPU环境**
```bash
# 请首先激活CONDA
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
# 支持uv安装
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

### 训练数据介绍
本模型使用 [FlowBench 官方数据集](https://huggingface.co/datasets/BGLab/FlowBench)中的 `LDC_NS_2D/128x128/harmonics` 子集，原数据按 CC BY-NC 4.0 许可提供。从 OneScience 魔搭数据集下载到模型包的 `data/` 目录：

```bash
modelscope download --dataset OneScience/FlowBench-LDC2D-Harmonics --local_dir ./data
```

主要数据文件为：

```text
LDC_NS_2D/128x128/harmonics_lid_driven_cavity_X.npz
LDC_NS_2D/128x128/harmonics_lid_driven_cavity_Y.npz
```

其中 `X` 文件内部 `data` 的 shape 为 `[1000, 3, 128, 128]`，`Y` 文件内部 `data` 的 shape 为 `[1000, 4, 128, 128]`。训练时默认按照 `0.8` 比例划分训练集和验证集；默认配置从 `data/` 读取。

### 训练

```bash
python scripts/train.py
```

默认训练会保存 checkpoint：

```text
./weight/best_model.pth
```

### 训练权重
本仓库在 `weight/` 文件夹内提供本次训练得到的最好模型权重，可用于直接推理。

```text
./weight/best_model.pth
```

权重大小约为 241 MB，SHA256 为：

```text
13caed2d5d34db87cf728b1669601782642d2ab83a9c8b683fe05e2a80ab5905
```

### 推理

```bash
python scripts/inference.py
```

本次验证集推理结果：

```text
mse = 0.0012336337
relative_l2 = 0.0434478655
mae = 0.0087878581
```

### 评估和可视化

```bash
python scripts/result.py
```

评估结果会保存到 `results/result_summary.json`，可视化图片会保存到 `results/figures/`。

# OneScience 官方信息

| 平台 | OneScience 主仓库 | Skills 仓库 |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |

# 引用与许可证

- FlowBench 原始论文：[FlowBench: A Large Scale Benchmark for Flow Simulation over Complex Geometries](https://arxiv.org/pdf/2409.18032)。
- 本仓库保留来源说明，并面向 OneScience ModelScope 自动运行场景进行整理。
