2D mls-mpm fluid learning&implementation (math)
Quadratic B-spline weight
used to scatter particle to grid or back from grid.
in actual code(discretely & calculated without judging input range). for each cell in 9 surrounding cells
(!notice:
(对于一个粒子来说其只能落在一个网格中,现在需要其距离其所属的网格的中心的距离(x,y 2个方向分开)计算差值的系数,该距离的范围是
gradient of weight
(!notice:mls-mpm use
particle to grid (first phase)
scatter particle mass to grid
for each particle, just loop through 9 surrounding cells and calculate each cell’s weight and sum together.(Eq.172)
momentum (1)
(Eq.173).
particle to grid(second phase)
estimate particle volume
summing up neighborhood's weighted mass contribution. (Eq.150-152)
constitutive equation for isotropic fluid
stress
- viscosity part velocity gradient (Eq.17) the velocity derivatives(linear) is
. So the gradient should be so the viscosity part of stress is
Fused force/momentum(2) on grid node
(Eq.16)
In implementation, for each grid node surrounding current particle
Update grid
current we have calculate the mass and momentum of each grid node. we need to convert momentum to velocity and apply gravity.
Grid To Particles
Use APIC or PolyPIC to transfer velocities and affine/polynomial coefficients from the grid to the particles. (Eq.175,176)
Deformation Update(Plasticity only)
No need for fluid simulation as we never use it in constitutive equation.
(Eq.181 & E1)