Overview:
1、two simulations with different resolution scales, a low-resolution L and a high-resolution H.
2、the resolution difference is a user-defined(Here is a multiple of 8 in each scaling step)
3、the coarse level L as the base simulation and compute the physics for the whole fluid
4、From L, determine a subset of the fluid to simulate higher resolution
5、the subset region defines the second simulation
6、an additional particle layer is used to model the boundary condition for H (be advected by the flow field of L) (be dynamially added and deleted)
7、H region=active region, when a boundary particle enters the active region, physical quantities must change smoothly
8、a feedback force from H onto L
9、H and L are merged for the final rendering
Steps:
(一) HIGH RESOLUTION REGION
The High-resolution region H: can be defined by any type of sampling condition and change dynamically during the simulation.( Here is geometry driven criteria, ohter including physicas-driven conditions and combined criteria, the reason is the surface particles are typically used to reconstruct the fluid surface);
Spatial conditions: are straightforward to define, for example where is obstacles, Camera information can be additionally included to change the resolution according to the field of view.
How to define a particle to be at the surface: the distance to the center of mass of its neighborhood is above a threshold as described in [Solenthaler et al. 2007], isolated particles are detected separately, they are defined by having empty neighborhoods.
Flood fill is used to extract several layers of particles that are close to the surface. The interface between multiple fluids can be determined similarly, the only difference is the distance is based on particles of the same fluid type only.
[In order to keep the computation cost low, as many operations as possible are executed in L. Therefore, the high-resolution region is detected in L and then transferred onto H]. 边界粒子是由近邻的低分辨率的粒子转化过来的。
Near the boundary, Each particle in H stores a parent particle, which is the closest particle in L, and is classified according to the region of its parent.
(二) BOUNDARY REGION
PREMISE: The particles that are inside the high-resolution region as active
Detect the boundary region to H: using the flood fill method. Boundary particles are advected by the flow of L, the velocity is interpolated from L onto H[box kernel is used, more accurate kernels as SPH density kernel can be used too]. The computational is small sine no physics or neighborhood have to be computed.
Active particle and hence contribute to the density and exert viscous and pressure force???????????(cannot be understood)
To compute the pair-wise forces, a boundary particle additionally stores the interpolated density and pressure values.[Guarantee that the nirghborhood of an active particle close to the boundary region is completely filled with particles to avoid imbalanced pressure forces]最小的边界区域定义为kernel的大小h。
(三) DYNAMIC BOUNDARY PARTICLE GENERATION
When a particle in L enters the boundary region from outside we dynamically create high-resolution boundary particles in H.
Here use cubical initialization, others including 2-particles[Adams et al. 2007] and spherical initialization using 7 particles[Desbrun and Cani 1999]
Particles created outside the domain should not be deleted because this would lead to volume loss. In such situtation, set the particles onto the boundary and slightly shift positons to avoid excessive clustering.
Since particles undergo a relaxation process to slowly rearrange as soon as they enter the active region[NEXT SECTION 四].父粒子不在active region和boundary region的,生成的边界粒子最后被直接删除掉。
(四)TRANSITION BETWEEN BOUNDARY AND ACTIVE
两种情况:1、如果活动区中的粒子j的父粒子离开活动区或进入边界区,粒子j的状态也跟着改变, it is advected by the velocity field of L in the following.
2、与上述情况相反时,(进入活动区的粒子j和同在活动区的粒子i,其中粒子j是粒子i的近邻粒子)如果两个粒子从时刻t到时刻t+1没有发生位置的变化,那么他们的物理量也是固定不变的。
第二种情况只是简单的填充,j已经在之前的计算中包含进来,所以计算i的密度和压强,不会发生值的跳变。第一种情况则是至关重要的,advection容易引入错误,导致不规则的粒子采用。
Since the quantities computed with SPH are very sensitive to the number of neighboring particles and their locations, the interpolated quantities at time t do not necessarily correspond to the quantities computed by the physics at t+1(t时刻插值的量不会等于从t+1时刻计算来的量)。 The density, for example, can be much larger than the interpolated value when particles are clustered, leading to large pressure forces. To alleviate this problem, apply a particle relaxation process that allows the particles to settle into a stable configuration.
Particle relaxation process: the simplest way to achieve this is by letting the physics slowly pushing the particles into the right location. This is done during the time Trelax that set to 0.05s in all examples. During this time, the quantities j 的密度及压强被计算as follow:
slowly adjust the density to get a smooth transition between 插值密度与t+1时刻密度,公式是:密度=系数*(t+1时刻密度)+(1-系数)*插值密度,在t+1时刻系数为0,在Trelax时间段内,系数逐渐增加到1.
Pressure force should slowly push particles away from each other to get j into a relaxed configuration.(See the paper)
(五)FEEDBACK
The high resolution simulation H encounters less damping than L asnd more small-scale details can be resolved , hence the flows of H and L can diverge. A feedback force is defined to modify the velocity field of L according to the flow of H.