P26
Two-Way Coupling
✅ 水和水中的物体相互作用,物体可以是刚体、弹性体能各种类型的物体。
The coupling between a solid and a liquid should be two-way, i.e., liquid->solid and solid->liquid.
✅ 水 → 物体:浮力。物体 → 水,会把这个水柱的水排出去,此处只讲 “物体 → 水” 部分
P27
关键问题
The coupling between solid and water should be two-way, i.e., water>solid and solid- >water.
The key question is how to expel water out of the gray cell regions???
P28
Virtual Height
✅ 在要排的水柱上面增加一个虚拟的高度,然后正常模拟,关键是求出要加多少虚拟高度,能正好达到排出那么多水的效果。
The idea is to set up a virtual height vi, so that ℎreal_newi=ℎi−ei.
ℎi−ei=ℎi+β(ℎi−ℎoldi)+α(vi+1+ℎi+1+ℎi−1−2vi−2ℎi)=ℎnewi+α(vi+1−2vi)
✅ ℎreal_newi=ℎi−ei:下图左边格子的理想高度。
ℎi+1−ei+1=ℎi+1+β(ℎi+1−ℎoldi+1)+α(ℎi+2+vi+ℎi−2vi+1−2ℎi+1)=ℎnewi+1+α(vi−2vi+1)
✅ 公式2对应右边格子。
P29
Poisson’s Equation
The outcome is Poisson’s equation, with vi and vi+1 being unknowns.
2vi−vi+1=1α(ℎnewi−ℎi+ei)=bi
−vi+2vi+1=1α(ℎnewi+1−ℎi+1+ei+1)=bi+1
✅ 通过公式化简提取出其中的线性关系。
P30
The outcome is Poisson’s equation, with vi and vi+1 being unknowns.
✅ 由于木块位置会变,需要解的vi也要改变。 为了让公式统一方便计算,把图左矩阵乘法写成右边形式。公式结果不变,只是工程实现上的简化。
P31
Algorithm with Coupling
✅ γ 的作用:本算法显式积分,不稳定、γ 会让水波小很多。
P32
Rigid Body Update
We estimate the floating force by the actual water expelled in every column.
fi=ρg∆x(ℎi−ℎnewi)
Or in 3D,
fi,j=ρg∆A(ℎi,j−ℎnewi,j)
✅ 阿基米得定律:物体受到的浮力 = 排出去的水的重力
✅ 同时要考虑旋转和力矩。但目前旋转的效果不太好,可以考虑改进为隐式积分。
✅ 流体对方块的效果。
本文出自CaterpillarStudyGroup,转载请注明出处。
https://caterpillarstudygroup.github.io/GAMES103_mdbook/