Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PotFlow

PotFlow 是基于势流理论(频域 3D 边界元法)的船舶与海工水动力分析软件,支持辐射/绕射/RAO 计算与 HDB HDF5 输出。

功能

  • 频域 3D BEM 面板法求解
  • 无限水深自由面 Green 函数
  • 6 模态辐射(附加质量 + 阻尼)、绕射(波浪激振力)
  • 静水恢复力、6 DOF RAO
  • 多浪向、多频率批量计算
  • 水动力系数 HDF5 数据库(HDB)、CSV/PNG 输出
  • 误差登记与阶段门校验

安装

pip install -e .

可选加速:

pip install -e ".[accelerated]"   # Numba JIT
pip install -e ".[dev]"           # 开发工具(pytest, mypy, ruff)

使用

案例以 TOML 格式配置:

[caseMeta]
caseName = "wigley"

[geometry]
sourceType = "stl"

[[geometry.artifacts]]
name = "hull"
path = "A-geo/wet_surface.stl"
format = "stl"

[geometry.parameters]
draft = 4.0

[materials.fluid]
density = 1025.0
gravity = 9.81

[[materials.bodies]]
mass = 1.2e7
draft = 4.0

[execution]
frequencyRange = [0.2, 2.0, 20]
waveHeadings = [0, 45, 90, 135, 180]
waterDepth = "infinite"

运行:

potflow solve case.toml                  # 端到端求解
potflow validate case.toml               # 校验配置
potflow solve case.toml --verbose        # 详细日志
potflow solve case.toml --output-dir ./results

输出目录:

C-run/<case_name>/
├── hdb.h5           # 水动力系数数据库 (HDF5)
├── rao.csv          # RAO 幅值/相位
├── added_mass.csv   # 附加质量
├── solver.log       # 求解日志
└── rao_*.png        # RAO 曲线图

项目结构

solver_demo/
├── src/potflow/     # 源代码
│   ├── case/        # 案例配置与管道编排
│   ├── core/        # BEM 数值核心(Green 函数、影响系数、求解器)
│   ├── physics/     # 物理模块(辐射、绕射、静水力、RAO)
│   ├── geom/        # 几何读取与湿表面提取
│   ├── mesh/        # 面板生成与质量检查
│   ├── io/          # HDB / CSV / VTK 输入输出
│   ├── waves/       # 入射波与波谱
│   ├── errors/      # 统一错误管理
│   └── cli/         # 命令行接口
├── tests/           # 测试
│   ├── unit/
│   ├── integration/
│   ├── system/
│   └── benchmarks/
├── examples/        # 示例案例
└── docs/            # 设计文档

文档

详见 docs/ 目录:

文档 内容
01_project_proposal.md 立项报告与可行性分析
02_user_requirements.md 用户需求
03_software_req_spec.md 软件需求规格
04_architecture_design.md 软件架构
05_detailed_design.md 详细设计
06_interface_design.md 接口设计
07_test_plan.md 验证与确认计划

许可证

Apache 2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages