给 DeepSeek Harness 装上 CFD 引擎:通过 PyFluent 直接驱动 ANSYS Fluent, 后台任务形态运行,不经任何 MCP 桥(MCP 桥有时长限制会杀进程——硬性设计约束)。
- 插件提供 4 个模型工具:
fluent_launch/fluent_status/fluent_command/fluent_stop - 输入框右上角(输入框外)「Fluent」按钮:可视化选择 核数 / 精度 / 维度 / 图形界面,可选导入 case(默认不导入)
- Fluent 以分离式后台进程运行,插件停止 / DSH 重启都不会杀掉正在求解的会话;重挂后自动接管
- Windows + 本机 ANSYS Fluent 安装(环境变量
AWP_ROOT*,PyFluent 自动选最新版本;也可用version参数指定如 251) - Python 3.10+ 与
pip install ansys-fluent-core(用户级安装即可) python、pwsh、taskkill在 PATH 上(Windows 默认满足)
从 GitHub 安装到 web profile。dsh plugin 会把参数转发给 profile 目录里的
pnpm,并在安装后自动把它加入 dsh.profile.bundles(声明了 dsh.bundle 的
包才会成为 profile 层)。
# 安装最新发布标签(推荐,版本可复现)
dsh plugin --profile web add github:qing9835/pyfluent-deepseek-harness#v0.1.5
# 或安装默认分支(跟随最新提交)
dsh plugin --profile web add github:qing9835/pyfluent-deepseek-harness
# 或从本地目录安装(开发调试用)
dsh plugin --profile web add D:\path\to\fluent-cfd装完重启 DSH 生效。之后:
- 对 Agent 说「用 16 核双精度 3D 启动 Fluent」→ Agent 调
fluent_launch(立即返回,后台启动) - 「读入 D:\WXT\xxx.cas.h5 然后算 200 步」→ Agent 调
fluent_command(file/read-case、solve/iterate) - 点输入框右上角「Fluent」按钮可在界面里启动/停止/查看状态与 transcript
# 指定新版本标签重新安装(等价于更新依赖并刷新 lockfile)
dsh plugin --profile web add github:qing9835/pyfluent-deepseek-harness#v<新版本>更新后同样需要重启 DSH。
dsh plugin --profile web remove dsh-fluent-cfdremove 会执行 pnpm remove 并自动把该包从 dsh.profile.bundles 移除。卸载后
重启 DSH,fluent 的模型工具与客户端按钮会从运行实例中消失。
可选清理:
- 会话目录
<DSH 进程目录>/.fluent-cfd/(已停止会话的日志/状态,卸载后保留) - Agent 预设
$DSH_HOME/.agent-presets/fluent-cfd/(如安装过预设)
会话目录 <DSH 进程目录>/.fluent-cfd/<session-id>/:
| 文件 | 写方 | 用途 |
|---|---|---|
session.json |
驱动 | 状态机 launching → ready ⇄ busy → stopped/error |
jobs/<id>.json |
插件 | 任务队列(TUI / scheme / stop),驱动领取即删 |
results/<id>.json |
驱动 | 任务结果 `{id, ok, value |
logs/out.log |
启动器 | 驱动 stdout(含 Fluent transcript) |
驱动为分离进程(pwsh Start-Process -WindowStyle Hidden),优雅退出时经
cleanup_on_exit 带走 Fluent;停止超时由插件 taskkill /T /F 兜底。
- 同一时间只允许一个会话(许可证与资源考量);
fluent_stop后才能启动新会话 - 大步数求解务必
wait: false提交,再用fluent_status轮询 - 默认无 GUI(
no_gui),需要界面时勾选「开启图形界面」或传uiMode: "gui"