---
title: HO-FNO-Pipe-Flow
canonical_url: "https://www.modelscope.cn/models/OneScience/HO-FNO-Pipe-Flow"
md_url: "https://www.modelscope.cn/models/OneScience/HO-FNO-Pipe-Flow.md"
repository: OneScience/HO-FNO-Pipe-Flow
last_updated: 2026-10-26
license: apache-2.0
library_name:
  - pytorch
frameworks:
  - PyTorch
language:
  - en
  - zh
downloads: 2
stars: 0
tags:
  - OneScience
  - "流体力学"
  - "管道流动预测"
---

# HO-FNO-Pipe-Flow

> HO-FNO-Pipe-Flow - OneScience 在 ModelScope 开源的模型。HO-FNO-Pipe-Flow 是基于 Higher-Order Fourier Neural Operator 构建的管道流动代理模型，可根据二维管道几何网格预测水平流体速度场。

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

- **Repository**: OneScience/HO-FNO-Pipe-Flow
- **License**: apache-2.0
- **Tags**: OneScience, 流体力学, 管道流动预测
- **Downloads**: 2
- **Stars**: 0
- **Last updated**: 2026-10-26

Source: https://www.modelscope.cn/models/OneScience/HO-FNO-Pipe-Flow

---

<p align="center">
  <strong>
    <span style="font-size: 30px;">HO-FNO-Pipe-Flow</span>
  </strong>
</p>

# 模型介绍

HO-FNO-Pipe-Flow 是基于 Higher-Order Fourier Neural Operator 构建的管道流动代理模型，可根据二维管道几何网格预测水平流体速度场。

论文：[Higher-Order Fourier Neural Operator: Explicit Mode Mixer for Nonlinear PDEs](https://arxiv.org/pdf/2606.28122)

# 模型描述
HO-FNO-Pipe-Flow 复现论文 Table 2 中的 Pipe 实验。模型在 FNO 的基础上显式加入二阶傅里叶模态交互，通过 8 层高阶谱卷积学习不同管道形状到水平速度场的映射。

## 适用场景

| 场景 | 说明 |
| :--- | :--- |
| 管道速度场预测 | 根据二维管道几何网格快速预测水平流体速度分布 |
| PDE 代理建模 | 面向复杂几何上的流体方程开展快速近似求解 |

# 使用说明

## 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/HO-FNO-Pipe-Flow --local_dir ./HO-FNO-Pipe-Flow
cd HO-FNO-Pipe-Flow
```

### 安装运行环境


**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
```

### 训练数据介绍
本案例使用 HO-FNO 官方代码提供下载入口的 Pipe 数据，包括 `Pipe_X.npy`、`Pipe_Y.npy` 和 `Pipe_Q.npy`。三个文件均含 2310 个 `129x129` 样本；前两个文件给出网格坐标，`Pipe_Q.npy` 的第 0 个通道为水平速度场。实验按论文设置使用前 1000 个样本训练、之后 200 个样本测试。

数据来源于[HO-FNO 作者列出的 Pipe 下载入口](https://github.com/AlexColagrande/HO-FNO)。从 OneScience 魔搭数据集下载到模型包的 `data/` 目录：

```bash
modelscope download --dataset OneScience/HO-FNO-Pipe --local_dir ./data
```

下载后应有 `data/Pipe_X.npy`、`data/Pipe_Y.npy` 和 `data/Pipe_Q.npy`；默认配置直接读取这些文件。

### 训练

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

默认完整训练 500 个 epoch，并保存 checkpoint：

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

### 训练权重
本仓库在 `weight/` 文件夹内提供完成 500 个 epoch 训练的模型权重，可用于直接推理。权重大小为 24,981,730 bytes，SHA256 为 `9d71053c64b62a6fc6f867108c29d2cc0d277d667a3504dc073a6b56072981d4`。

本次 200 个测试样本的平均相对 L2 为 `0.00488774`。论文 Table 2 中 HO-FNO Pipe 的平均相对 L2 为 `0.0049`；两者绝对差约为 `1.23e-5`，本次结果约为论文值的 `0.9975` 倍。论文结果只保留四位小数，因此该差异只能视为同一量级内的对齐结果。

### 推理

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

### 评估和可视化

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

# 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 |

# 引用与许可证

- HO-FNO 原始论文：[Higher-Order Fourier Neural Operator: Explicit Mode Mixer for Nonlinear PDEs](https://arxiv.org/pdf/2606.28122)。
- 官方代码仓库：https://github.com/AlexColagrande/HO-FNO 。
- 本仓库保留来源说明，并面向 OneScience ModelScope 自动运行场景进行整理。
