1.球体模型的创建与属性赋值
model new;清除之前的数据
model domain extent -10 10 ;确定区域,必要操作
ball create position -0.5 0 radius 0.5;球体创建,规定球心坐标,半径,按照先后顺序默认编号
ball create position 1 0 radius 1
ball attribute velocity -1 0 range id 1;给指定编号球体速度属性赋值
ball attribute velocity 1 0 range id 2
ball attribute density 2e3;球体密度属性赋值
model mech timestep fix 1e-4;规定时间步长
;model cycle 10000;执行确定的步数
model solve time 2;执行确定的时间,两种方式选一
model save "likai";保存最终的状态,方便后续使用
2.球体碰撞
model restore "likai";读取上面所保存的状态
contact cmat default model linear property kn 1e7;指定线性模型接触,并确定刚度值
ball attribute velocity 1 0 range id 1
ball attribute velocity -1 0 range id 2
model solve time 2.01
3.墙体建立
model new
model domain extent -10 10
wall generate box -5 5 -8 8;创建二维矩形墙体
ball create position 0 7 radius 1
ball attribute density 2e3 damp 0.1;阻尼系数给定,通过阻尼耗散掉系统的能量
model gravity 9.8;给系统设置重力
contact cmat default model linear property kn 1e7
model mech timestep fix 5e-4
model solve time 10