• 沒有找到結果。

CHAPTER 1 INTRODUCTION

1.2 System Overview

This thesis presents a way to combine various kinds of objects using adaptive sampling for particle-based fluid simulation. Our method bases on the Smoothed Particle Hydrodynamics (SPH) framework for the simulation of particles, such as water and sand. We

2

implement the granular materials (e.g. sand) and fluids (e.g. water) separately, then mixing them together. The sand is based on the Zhu and Bridson's sand model, we will show that how to transfer this grid-based model to a particle-based model. The sand then extend by the porous flow simulation which can model the behavior of the mixed materials. Since the system is based on the adaptive sampling for particle-based fluid simulation, it can handle huge particles with higher speed than before.

Chapter 2

Related Works

2.1 Fluid Simulation

Up to now, fluid simulation is still a challenging topic in computer animation. The simulation of complex fluid is often based on Navier-Stokes equation. Foster and Metaxas [12, 13] were the first solving the full 3D Navier-Stokes equations by using a Marker-and-Cell (MAC) method on Eulerian grids. Stam [24] provided a stable model on grid for fluid simulation and allowed much larger time-step. Foster and Fedkiw [11] improved the MAC method by using level set methods to track the free surface of fluids. Génevaux et al. [14]

combined the force between solids and fluids. Carlson et al. [5] provided a technique for two-way coupling between rigid bodies and fluids. Since they treat rigid objects as fluids, the method is called rigid fluid method.

The basic Smoothed Particle Hydrodynamics (SPH) model we used is based on the work of Müller et al. [19], which proposed an interactive system for water simulation.

2.2 Porous Flow Simulation

Lenaerts et al. [16] presented the simulation of a fluid flowing through rigid and elastic materials. They used physical principles of Darcy's Law and combined with SPH framework to simulate fluids. Their algorithm modeled the changing behavior of wet materials which is

4

similar to our simulation.

2.3 Granular Simulation

Miller and Pearce [18] introduced sand animations based on particles. Carlson et al.[6]

provided simulations of wet sand dripping by increased viscosity in fluids. Bell et al.[4]

simulated granular materials using particles. They regarded granular material as a large collection of non-spherical particles. By using a particle-particle collision model, they can handle particles efficiently. Zhu and Bridson [26] provided a physically-based simulation method called Particle-In-Cell for animating sand. Our model of sand sculptures is based on the works of Bell et al. [4] and Zhu and Bridson [26].

In this thesis, we construct a system for simulating the interaction between sand sculptures and water. Our system is similar to Lenaerts and Dutré [17]. However, we use an adaptive particle sampling algorithm. So our system can handle huge amount of particles effectively.

Chapter 3

The Interaction Model

Our simulation framework is based on Smoothed Particle Hydrodynamics (SPH). In the following sections, we will describe how to simulate the interaction between water and sand sculptures. In Section 3.1, we will show the basic smoothed particle hydrodynamics (SPH) model. Then we demonstrate the fluid simulation in Section 3.2. In Section 3.3, we discuss how to compute the forces acting on the sand particles and how the grid-based particle sand simulation framework in Zhu and Bridson [26] can be transferred to a particle framework.

Sections 3.4 and 3.5 explain how to combine the porous flow with the sand materials. We will describe the adaptive sampling algorithm in Section 3.6. Finally, Section 3.7 is the summary of our algorithm.

3.1 Smoothed Particle Hydrodynamics (SPH) Model

In order to simulate fluids, we represent fluids as a set of particles. Smoothed particle hydrodynamics (SPH) is a method to compute approximate numerical solution of the fluid dynamics equations.

The classical SPH equation from [21], [22] is:

∑ , , (1)

where is the density of particle i and , is a smoothing kernel function, with

6

support radius h. A particle is at position , with mass and additional attributes .

3.2 Fluid Simulation

We use Smoothed Particle Hydrodynamics (SPH) based on previous works of Müller et al. [19] and Müller et al. [20] to simulation fluids. Since we use adaptive sampling to simulate particles, the definitions of the force we use are different.

To simulate fluids, we need to use particles to solve the Navier-Stokes equations. The Navier-Stokes momentum equation is:

(2)

where v is velocity, P is pressure is viscosity and g is the gravity. Then, particle forces can be obtained by using the work as Müller et al. [19]. Equation (2) modeling three forces:

pressure force ( ), external forces ( ) and viscosity force ( ). Thus, equation (2) can be rewritten as:

. (3) We define that the is external body forces as gravity force or surface tension force.

Since our system is based on adaptive sampling algorithm [1]. By the definition of [1], a particle has a neighbor if , . In Figure 3.1, particle and are neighbors of each other. We use k-d tree to compute particles' neighborhood.

Figure 3.1: Particle and particle are neighbors of each other

In our system, particles may have difference radius. So we use the shooting-gathering approach from the work of Desbrun and Cani [10] and Adams et al. [1]. Combing the force defined in [19], we obtain the forces: constant. The kernel functions of , we use is as defined in [19]. Since the kernel function is radially symmetric, our system obeys Newton's Third Law.

The surface tension model we use is similar to the work of Becker and Teschner [3].

3.3 Sand Simulation

To simulate sand materials, we use the method based on Zhu and Bridson [26]. Zhu and Bridson [26] provided a physically-based simulation method to animate sand as fluids. At first, we use the SPH model to solve the pressure gradients, and then we use Tait's pressure

8

equation in the work of Becker and Teschner [3] to make the intermediate velocity field nearly incompressible. Tait's equation is

1 (7) with the pressure constant B and a user define constant γ.

In Zhu and Bridson [26], they decompose the sand materials into two parts: one is the region moving rigidly and the other is the region of flow. When the particle of sand is flowing, the frictional stress is given as:

σ / | | (8)

where is the friction coefficient. The strain rate T /2 can be evaluated by using the SPH method. In the Solenthaler et al. [25], is defined as the displacement gradient:

∑ , ∆ (9) Note that the result of is a 3 3 matrix, since , is a 3 1 matrix and

∆ is a 1 3 matrix. To find out which particle is moving rigidly, we need to use the Mohr-Coulomb condition as the work in Zhu and Bridson [26]. The Mohr-Coulomb condition determines the martial will not yield as long as:

√3 (10) where is the shear stress, /3 is the mean stress and 0 is the cohesion coefficient. can be compute as:

| | /√2 (11)

where |·| is the Frobenus norm. The definition of Frobenus norm is

| | ∑ ∑ , A is an m n matrix. We use the rigid stress to check if the particles satisfy the Mohr-Coulomb condition. The rigid stress is:

(12)

Equation (10) can help us to recognize which particle is rigid or not. Then, we search for clusters of particles which are moving rigidly. If two particles are neighboring particles and within a support range, we mark these particles as in the same clusters. Using the breadth-first search, we can easily find the clusters of particles.

Figure 3.2: Sand particles interactive with water particles.

In Figure 3.2, there are two kinds of particles. The blue particles are water particles, and the brown and orange particles are sand particles. The orange particles are moving rigidly. h is the support range of a particle and h' is the distance between the neighboring particles. If , the neighboring particles are in the same cluster. After we define the clusters, we need to compute the force acting on the clusters. Since the particle clusters are moving rigidly, we consider the rigid body motion. The basic rigid body simulation described in Baraff [2].

According to Solenthaler et al. [25] and Baraff [2], the torque vector τ can be computed as:

10

(12)

where is the center of mass of a cluster and is the total force on the ith particle. The total force acting on a cluster is the sum of the :

(13)

and the total torque can be computed similar to (13):

∑ (14)

After the total force and torque of a cluster are computed, we can use this information to compute the angular accelerations and then update the angular velocity and position of particles. By the definition of the Newton's second law, the relation between torque and angular acceleration is:

(15)

where is the total torque acting on a cluster (a rigid body) and I is the inertia tensor. To compute the angular acceleration action on the ith cluster, equation (15) can be rewritten as:

α (16)

In Baraff [2], the inertia tensor in the ith cluster:

∑ (17)

with , for all the particles th cluster. Then the velocity of the particles can be updated:

1 ∆ α ∆ (18)

The brown particles in Figure 3.2 are in a state of shearing flow. Since in equation (8) we

have compute the frictional stress, the force acting on these particles can be computed by using the work in the Solenthaler et al. [25]. The force is similar to the elastic force:

2 (19)

where I is the identity matrix, is the body volume of particle i, and is defined as:

, (20)

Finally, Figure 3.3 summarizes the algorithm for simulating the sand material.

      Figure 3.3: Algorithm for a step in SandSimulator

3.4 Porous Flow Simulation

To simulate the water absorption of sand, we use porous flow simulation as the work of Lenaerts et al. [16]. A porous particle is defined by its porosity and permeability. We can think that a porous particle has a lot of hole inside its body. Thus, a porous particle is capable

12

of holding a amount of water. Figure 3.4 shows the microscopic view and macroscopic view of the porous material model.

Figure 3.4 Porous materials. Top right region is microscopic view of a porous particle. A

porous particle can hold water inside; the water inside a porous particle is in blue color.

Bottom right region is macroscopic view of a porous particle. A porous particle p with porosity , saturation and permeability .

By the definition of porous particles in Lenaerts et al. [16], the porosity represents the unit volume of void space among particles. For example, is the void volume in a particle . Therefore, a particle with porosity can hold the absorbed masses

. The particle's saturation can be computed as:

, 0 1 (21) The permeability is a constant. For different materials, the is different.

In microscopic view, the capillary pressure is the reason why the water can enter into a porous particle and diffuse to neighboring porous particles. The capillary pressure force also keeps the water inside the porous materials. Since our model does not have real pores, we use

the method of Lenaerts et al. [16] to model the capillary forces.

∑ , , (22)

where is the capillary potential, it can be defined as:

1 , (23)

where is a constant and 0 1. When a porous particle's saturation increases, the capillary force decreases.

During the simulation, particles in our system will split and merge due to adaptive sampling algorithm. The volume of the pore space will be different. The porosity is depending on the local density of the material:

(24)

is the porosity in the beginning. To compute the pore pressure , we use the equation similar to the Tait's equation [3]:

1 (25)

Darcy's law [9] is an equation to describe incompressible fluid flow inside the porous materials. The pore velocity is , where q is the Darcy flux. In three dimensions, we need to consider the gravity, so the Darcy's law can be:

(26)

By using equation (26), the pore velocity can be computed as:

(27)

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous particles. The free volume of a porous particle is 1 , and occupied volumes of a porous particle are .

14

The pore velocity inside the materials can't be easily predicted because it's an anisotropic diffusion. Figure 3.5 shows the pore velocity of water through the sand materials in macroscopic view.

Figure 3.5: Actual fluid velocity through the pore space of sand materials.

In our thesis, we just consider the fluid flow inside the materials, like the diffusion process in Müller et al. [20]. During the simulation, fluid mass is diffusing from one porous particle to its neighbors. This way is easy than tracking the fluid particle inside the materials. The diffusion equation for compute absorbed fluid mass is:

∑ , (28)

with the diffusion coefficients :

· , 0 (29)

Using an explicit Euler integration step, the fluid mass can be updated:

∆ (30)

Before updating the fluid mass, we need to check the free and occupied volumes of the porous

Before updating the fluid mass, we need to check the free and occupied volumes of the porous

相關文件