TSA-PINN-CylinderWake

2 downloads 0 likes on ModelScope updated

Model card

TSA-PINN-CylinderWake

模型介绍

TSA-PINN-CylinderWake 复现二维 Re=100 圆柱尾流实验,用可训练正弦激活的物理信息神经网络预测速度和压力。

论文:Physics-informed neural networks with trainable sinusoidal activation functions for approximating the solutions of the Navier-Stokes equations

模型描述

模型包含 4 个宽度为 50 的隐藏层,初始频率为 1.0。训练使用 Navier-Stokes 方程残差和边界条件,完成论文中的 4000 次参数更新,并与作者公开的 DNS 场比较。

适用场景

场景 说明
圆柱绕流 预测非定常尾流的速度和压力
工业仿真加速 对二维不可压缩流动进行物理约束近似求解

使用说明

1. OneCode 使用

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

点击体验智能化一键式 AI4S 编程

2. 手动安装使用

硬件要求

  • 推荐使用 GPU 或 DCU 训练;CPU 可用于导入和数据检查。
  • 本次正式训练使用 1 张 DCU,4000 次参数更新。

下载模型包

modelscope download --model OneScience/TSA-PINN-CylinderWake --local_dir ./TSA-PINN-CylinderWake
cd TSA-PINN-CylinderWake

安装运行环境

DCU环境

# 请首先激活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
pip install -r requirements.txt

GPU环境

# 请首先激活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
pip install -r requirements.txt

训练数据介绍

使用作者仓库公开的 cylinder_nektar_wake.mat。文件包含 5000 个空间点和 200 个时间点,字段为 X_star、t、U_star、p_star。从 OneScience 魔搭数据集下载到默认的 data/ 目录:

modelscope download --dataset OneScience/TSA-PINN-CylinderWake --local_dir ./data

训练

python scripts/train.py

默认完成 4000 次更新,按训练目标值保存最佳 checkpoint 至 weight/best_model.pt。

训练权重

weight/best_model.pt 来自第 3956 次更新,大小 219,298 bytes,SHA256 为 5fadc91405b4741288750c775c09d043c205a625e630d1ee2a9e8b5022712e0f。

推理

python scripts/inference.py

评估和可视化

python scripts/result.py

本次在原始 DNS 的 t=10 时刻,速度 u/v 相对 L2 分别为 0.02198/0.08349;论文 Table 3 为 0.01960/0.06630。本次分别高约 0.00238/0.01719,但论文表格未明确给出完全相同的时空汇总口径,所以这里只作参考比较。完整时空指标和图表见 results/。

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

引用与许可证