4.4 Velocity-Vortex Model
4.4.1 Rigid-Body Interaction
Rigid-body interaction is a deceptively broad topic and can be related to many different types
of particle systems, in particular fluid simulations. A rigid-bodyis something which cannot
be deformed - this is in contrast to a deformablebody which is allowed to change shape or
volume. Rigid-bodies have many of the same properties as a normal particle has - position, velocity, acceleration, size and so on - but unlike a particle it is not necessarily treated as a part of a much larger system, rather, it is its own entity. The interaction between rigid bodies and particle systems is a very interesting subject and has seen a great deal of research [25]. For example, Harada et. al. [46] describes methods of simulating rigid bodies coupled with fluid dynamics systems, while [44] shows how a rigid-body can be approximated by a number of joined particles to make the interaction between particle systems and more complex-shaped rigid bodies easier and more efficient, while Macklin et. al [78] describe a unified particle dynamics framework which includes the representation of rigid bodies using particles. Indeed, simulating a rigid-body on its own is very simple - the interaction is the difficult part, because the simulation needs to handle computations of interactions from every particle in the system with every rigid-body in the system. Luckily, the use of the spatial grid can once again help with this problem and since the rigid-body is able to use the same spatial grid indexing functionality that particles use, it can be treated the same way.
Rigid-body interaction has been brought up in this instance because the fire system (at least, a more complex one) technically requires at least one rigid-body interaction to take place. Re- call in Section 6.2 that the non-interacting particle model for fire creates particles at a specific
point or within a specific area - the emitter. In more practical terms, the emitter can be con-
sidered the fuel source, where the fire burns off. Rather than having a simple circle as the
emission area, it makes much more sense realistically for the fire to be burning from some particular object which it actually interacts with. For this reason, rigid-body interaction is one of the more central ideas to this more advanced fire simulation. Additionally, because the fire particles should never push within the fuel at all, rigid-body interactions are preferable in this case to soft-body interactions such as those used in the spring-mass model.
Basic rigid-body motion follows mostly the same physical laws as soft-body particles - for example, the standard kinematic equations as in Equation 2.5 as well as Newton’s Second Law
F = ma all apply if the body isnot static in the simulation. This is a point of note because the rigid-body does not always need to be moveable - indeed, this will not be the case for the fire simulation. However it is important to note that bodies may be influenced by the particle system interactions just as particles can be affected by the rigid-body. In the case of the fire, it is simply not required as the body fuel source does not move regardless of the movement of the particles around it. It would be an interesting idea, however, if the movement of the particles over the body caused some sort of destruction effect on the body itself - literally burning away the fuel - and seeing how this would effect the behaviour of the fire as the simulation progresses. Rigid-body interaction is important in the fire simulation because it induces a vorticity in the particles as they rise off the body.
Interacting with rigid bodies can be problematic when taking into account the discretization process. If a vorton is moved naturally inside the area of a rigid-body, it is pushed out and a vorticity is applied to continue it on. This is a simple approach and not very accurate, so it can cause some instability in the system because the position of the vorton is basically overwritten without any account for conservation of momentum. Consequently, this needs to be treated with care, but in practice the method works at least to obtain good visual results on the macro level.
4.5
Summary
In this chapter, the models for the different particle systems used in this thesis are explored, including the governing equations of the models as well as discussing the potential strengths and weaknesses for using them. For the fire simulation, the models described include the non- interacting particle model and and velocity-vortex model, while for the water simulation the models described include the spring-mass model and Smoothed Particle Hydrodynamics. The computational implementation of these models (using CUDA) will be discussed later in Chap- ter 6 and the visual implementation (using OpenGL) will be discussed in Chapter 7. Before this, however, it is important to discuss the elements of the implementation which persist over all the different models - specifically, the implementation for the spatial grid (not applicable for the non-interacting method) and the integration method. This will be the subject of the next chapter.
CHAPTER
5
SPATIAL GRID AND INTEGRATION METHODS
Processing interactions between pairs of particles, or in fact any simulated object, is a compli- cated task in physically-based simulations due to the complexity and scale of the simulation systems involved. Interaction between objects must not only be highly efficient, but the in- teractions which are produced must maintain a relatively correct physical response [126]. A
spatial gridis designed to do this, whereby the simulation space is divided up into a grid of cells and interactions are processed based on the objects location within the grid. The spatial grid implementation will be covered in Section 5.1.
Numerical integration methods are used to approximate the otherwise continuous differ- ential equations governing the behaviour of each particle. The basic theory of the integration methods was covered in Section 2.5 in Chapter 2, while this particular chapter will focus on the implementation of these methods and discuss the advantages and disadvantages of using each. Five methods will be explored; the Euler, RK2, RK4, Leapfrog and Euler-Cromer algorithms. These methods are covered in Section 5.2.
Both these methods are used extensively in all or most of the particle system implementa- tions, and work independently of the particle physics methods. As a result they are discussed separately from the particle system implementations, which are instead covered in Chapter 6.
5.1
Spatial Grid Algorithm
Collision detection between particles in a large particle system has always been a major prob- lem in computer graphics. In the worst case scenario, every particle collides with every other particle within a single time step, making the computational complexity of the collision de-
tection algorithm O(n2), where n is the number of particles in the system. However, such
a naive collision detection algorithm assumes all particles could potentially collide with any other particle regardless of their positions relative to each other in the simulation space.
Spatial grid-based collision algorithms [126] [127] can solve this problem, reducing the number of interactions to only those performed in the local space of the particle, not the entire
Figure 5.1: Particle-to-particle interactions utilizing a spatial grid. Here the particles which are important are those contained within the red-coloured cells only. Particles are considered within a certain cell based on the center point position. These are the particles which will be tested for collisions with the current particle of interest (coloured green in this instance).
simulation space. In recent years there have been many solutions [45] [31] [46] [41] proposed to this problem through the use of spatial grid approaches to reduce the time needed to compute collisions in large particle systems.