MPMSolver#
MPMSolver 实现了 Material Point Method (MPM,物质点法),用于仿真各种材料,包括弹性固体、颗粒材料、流体和相变。
概述#
MPM 结合了:
Lagrangian particles (拉格朗日粒子): Track material points (追踪物质点)
Eulerian grid (欧拉网格): Solve momentum equations (求解动量方程)
Particle-grid transfers (粒子-网格传输): MLS-MPM for stability (MLS-MPM 用于稳定性)
支持的材料#
Material |
Description |
|---|---|
|
Neo-Hookean elasticity (Neo-Hookean 弹性) |
|
Plasticity with yield (带屈服的塑性) |
|
Drucker-Prager granular (Drucker-Prager 颗粒材料) |
|
Snow plasticity (雪的塑性) |
|
Weakly compressible fluid (弱可压缩流体) |
|
Active muscle material (主动肌肉材料) |
使用方法#
import genesis as gs
gs.init()
scene = gs.Scene(
mpm_options=gs.options.MPMOptions(
dt=1e-4,
lower_bound=(-1, -1, 0),
upper_bound=(1, 1, 2),
grid_density=64,
),
)
# Add MPM entity
soft_box = scene.add_entity(
gs.morphs.Box(pos=(0, 0, 0.5), size=(0.2, 0.2, 0.2)),
material=gs.materials.MPM.Elastic(
E=1e5, # Young's modulus (杨氏模量)
nu=0.3, # Poisson's ratio (泊松比)
rho=1000, # Density (密度)
),
)
scene.build()
for i in range(1000):
scene.step()
配置#
MPMOptions 中的关键选项:
Option |
Type |
Description |
|---|---|---|
|
float |
Internal timestep (内部时间步长) |
|
tuple |
Grid lower corner (网格下角) |
|
tuple |
Grid upper corner (网格上角) |
|
int |
Grid cells per unit (每单位网格单元数) |
|
float |
Particle spacing (粒子间距) |
网格设置#
MPM 需要一个背景网格进行计算:
mpm_options = gs.options.MPMOptions(
lower_bound=(-2, -2, 0), # Grid min (网格最小值)
upper_bound=(2, 2, 4), # Grid max (网格最大值)
grid_density=128, # Resolution (分辨率)
)
材料参数#
弹性材料#
material = gs.materials.MPM.Elastic(
E=1e5, # Young's modulus (Pa) (杨氏模量)
nu=0.3, # Poisson's ratio (泊松比)
rho=1000, # Density (kg/m^3) (密度)
)
颗粒材料 (Sand)#
material = gs.materials.MPM.Sand(
E=1e6,
nu=0.2,
rho=1500,
friction_angle=30, # degrees (摩擦角,单位:度)
)
另请参阅#
MPMEntity(材料点法实体) - MPMEntity
MPM(材料点法) - MPM 材料
gs.options.MPMOptions - 完整选项