输入文件

命令行参数

./PhysEngine [options]

# 示例
./PhysEngine -m mesh.inp -n 4 -t 10.0 -o output
参数 说明 默认值
-m <file> 输入网格文件(ABAQUS .inp格式) 必需
-n <num> OpenMP线程数 系统默认值
-g <dim> 空间维度(2或3) 3
-t <time> 模拟总时间 1.0
-o <dir> 输出目录 ./output

JSON配置文件

{
  "mesh_file": "mesh.inp",
  "physics": {
    "sph": {
      "density": 1000.0,
      "viscosity": 0.001,
      "sound_speed": 100.0,
      "smoothing_length": 0.01
    },
    "fem": {
      "youngs_modulus": 2.0e11,
      "poisson_ratio": 0.3,
      "density": 7850.0
    }
  },
  "time_step": {
    "dt_initial": 1e-5,
    "dt_max": 1e-3,
    "cfl_number": 0.1
  },
  "output": {
    "frequency": 100,
    "format": "vtk"
  }
}

ABAQUS .inp 网格文件

PhysEngine支持标准ABAQUS .inp格式的网格输入文件。

节点定义

*NODE
1, 0.0, 0.0, 0.0
2, 1.0, 0.0, 0.0
3, 1.0, 1.0, 0.0
4, 0.0, 1.0, 0.0
5, 0.0, 0.0, 1.0
6, 1.0, 0.0, 1.0
7, 1.0, 1.0, 1.0
8, 0.0, 1.0, 1.0

单元定义

*ELEMENT, TYPE=S4R, ELSET=SHELL
1, 1, 2, 3, 4

支持的单元类型映射:

ABAQUS类型 PhysEngine类型 说明
S4, S4R FEMS4R 4节点壳单元
CPEG4R SPH2D4N 2D平面应力单元
C3D8R SPH3D8N 3D实体单元(缩减积分)

材料定义

*MATERIAL, NAME=STEEL
*ELASTIC
210000.0, 0.3
*DENSITY
7850.0

边界条件

*BOUNDARY
1, 1, 6, 0.0    ! 节点1固定
2, 1, 6, 0.0    ! 节点2固定

输出文件格式

VTK格式

# 输出文件命名
output_00000.vtk
output_00001.vtk
...

HDF5格式(用于大规模计算)

output_00000.h5
output_00001.h5

Tecplot格式

output_00000.dat

完整示例

溃坝模拟

{
  "mesh_file": "tank.inp",
  "physics": {
    "sph": {
      "density": 1000.0,
      "viscosity": 1.0e-6,
      "sound_speed": 50.0
    }
  },
  "time_step": {
    "dt_initial": 1e-5,
    "dt_max": 1e-4
  },
  "output": {
    "frequency": 50,
    "format": "vtk"
  }
}