Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

Similar documents
Divergence-Free Smoothed Particle Hydrodynamics

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Shape of Things to Come: Next-Gen Physics Deep Dive

Overview of Traditional Surface Tracking Methods

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

CGT 581 G Fluids. Overview. Some terms. Some terms

A Geometric Approach to Animating Thin Surface Features in SPH Water

Particle-based Fluid Simulation

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

3D Simulation of Dam-break effect on a Solid Wall using Smoothed Particle Hydrodynamic

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION

Particle-Based Fluid Simulation. CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University

Comparison between incompressible SPH solvers

Realistic Animation of Fluids

Realistic Animation of Fluids

Thermal Coupling Method Between SPH Particles and Solid Elements in LS-DYNA

Animation of Fluids. Animating Fluid is Hard

Navier-Stokes & Flow Simulation

PHYSICALLY BASED ANIMATION

Navier-Stokes & Flow Simulation

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

Support for Multi physics in Chrono

Fluids in Games. Jim Van Verth Insomniac Games

The jello cube. Undeformed cube. Deformed cube

NVIDIA. Interacting with Particle Simulation in Maya using CUDA & Maximus. Wil Braithwaite NVIDIA Applied Engineering Digital Film

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

Cloth Hair. and. soft bodies

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Interactive Fluid Simulation using Augmented Reality Interface

Navier-Stokes & Flow Simulation

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Interactive Fluid Simulation Using Augmented Reality Interface

Dynamical Simulation 1: Particle Systems and ODEs

Hardware Accelerated Real-Time Fluid Surface Simulation

Solidification using Smoothed Particle Hydrodynamics

Cloth Simulation. COMP 768 Presentation Zhen Wei

Module 4: Fluid Dynamics Lecture 9: Lagrangian and Eulerian approaches; Euler's acceleration formula. Fluid Dynamics: description of fluid-motion

Robust Simulation of Sparsely Sampled Thin Features in SPH-Based Free Surface Flows

GPU Simulations of Violent Flows with Smooth Particle Hydrodynamics (SPH) Method

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

An added mass partitioned algorithm for rigid bodies and incompressible flows

1.2 Numerical Solutions of Flow Problems

Chapter 1 - Basic Equations

FEMLAB Exercise 1 for ChE366

Thermal Coupling Method Between SPH Particles and Solid Elements in LS-DYNA

A New Self-Collision Detection Method for Cloth Simulation

Technical Report TR

Physically Based Simulation

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

Physically Based Simulation

A Particle Cellular Automata Model for Fluid Simulations

Abstract. Introduction. Kevin Todisco

SPH: Towards the simulation of wave-body interactions in extreme seas

CS-184: Computer Graphics Lecture #21: Fluid Simulation II

Permeable and Absorbent Materials in Fluid Simulations

Numerical Simulation of Coupled Fluid-Solid Systems by Fictitious Boundary and Grid Deformation Methods

Three-dimensional simulation of floating wave power device Xixi Pan 1, a, Shiming Wang 1, b, Yongcheng Liang 1, c

CS 231. Fluid simulation

Divergence-Free Smoothed Particle Hydrodynamics

Coastal impact of a tsunami Review of numerical models

Surface Tension Approximation in Semi-Lagrangian Level Set Based Fluid Simulations for Computer Graphics

Fluid-structure Interaction by the mixed SPH-FE Method with Application to Aircraft Ditching

Acknowledgements. Prof. Dan Negrut Prof. Darryl Thelen Prof. Michael Zinn. SBEL Colleagues: Hammad Mazar, Toby Heyn, Manoj Kumar

Parallel GPU-Based Fluid Animation. Master s thesis in Interaction Design and Technologies JAKOB SVENSSON

Gradient Free Design of Microfluidic Structures on a GPU Cluster

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Simulation in Computer Graphics. Introduction. Matthias Teschner. Computer Science Department University of Freiburg

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of

Solving Partial Differential Equations on Overlapping Grids

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

NUMERICAL ANALYSIS OF WIND EFFECT ON HIGH-DENSITY BUILDING AERAS

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

The Study of Ship Motions in Regular Waves using a Mesh-Free Numerical Method

Rigid Body Dynamics, Collision Response, & Deformation

Lattice Boltzmann with CUDA

Simulation of Fuel Sloshing Comparative Study

Anatomy of a Physics Engine. Erwin Coumans

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi

More Animation Techniques

Solution for Euler Equations Lagrangian and Eulerian Descriptions

Real-Time Volumetric Smoke using D3D10. Sarah Tariq and Ignacio Llamas NVIDIA Developer Technology

An Efficient Adaptive Vortex Particle Method for Real-Time Smoke Simulation

The 3D DSC in Fluid Simulation

Fluid Simulation using Smoothed Particle Hydrodynamics

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Lecture 1.1 Introduction to Fluid Dynamics

ENERGY-224 Reservoir Simulation Project Report. Ala Alzayer

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015

Fluid-Structure-Interaction Using SPH and GPGPU Technology

MESHLESS SOLUTION OF INCOMPRESSIBLE FLOW OVER BACKWARD-FACING STEP

PARALLEL SIMULATION OF A FLUID FLOW BY MEANS OF THE SPH METHOD: OPENMP VS. MPI COMPARISON. Pawe l Wróblewski, Krzysztof Boryczko

Fast Particle Neighbor Searching for Unlimited Scene with Fluid Refraction Improvement


Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Example 13 - Shock Tube

SPH: Why and what for?

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

Terminal Falling Velocity of a Sand Grain

Transcription:

4th International Conference on Sensors, Measurement and Intelligent Materials (ICSMIM 2015) Interaction of Fluid Simulation Based on PhysX Physics Engine Huibai Wang, Jianfei Wan, Fengquan Zhang College of Computer, North China University of Technology, Beijing, China wanghb@ncut.edu.cn, wjf0924@sina.com, fqzhang@ncut.edu.cn Keywords: fluid simulation, PhysX physics engine, SPH, interaction of fluid and solid Abstract. To enhance the real-time and interactivity of fluid simulation, a method was proposed based on smooth particle hydrodynamics(sph) technique in PhysX physics engine. According to SPH method, the fluid was treated as a particle system, analyzing composite force of each particle, and simulating real motion and interaction with static solid and dynamic solid of the fluid on physical environment. Experimental results show that this method satisfy the requirement of real-time simulation and the problem of interaction between fluid and solid was also solved. Introduction With the study of fluid simulation in recent years, fluid-solid interaction has become a hot research topic, which is also a difficult problem in computer graphics and virtual reality. It is a complex technology to simulate the interaction between fluid and solid, because the fluid has no fixed shape, and the partial differential equation of time and space where the force of motion and interaction is converted into is extremely difficult to realize in program. Therefore, the sense of reality and computational efficiency are important criterion in the whole simulation process, however, it is highly difficult to have these two properties in simulation. Related Work The fluid simulation method mainly consists of Euler and Lagrange method. The Euler method is a fluid simulation method based on grid, but it would consume excessive resources, and easily lead to large error because of the complex calculation process dealing with large deformation object. Lagrange method is a method based on particle system, the fluid is treated as lots of particles, and each particle has its own unique properties, such as position, speed, etc. The Smooth Particle Hydrodynamics(SPH) is a typical Lagrange method, which is simple and efficient in the simulation process, and is widely used in various fluid simulation and interaction. Sun [1] presented a new simulation method for interactions of fluids and deformable solids was. In this way, both fluids and solids are described by SPH so that avoids complex interface for coupling fluids and solids. Based on SPH method, a search method by list was proposed, which accelerates searching the nearest neighbor particles and improves computational efficiency [2]. In order to simulate the water and water droplets, Kim [3] proposed a regional level sets with a mix of grid and particle, but this method is difficult to naturally complete the transition of grid and particle. Lenaerts [4] added number of absorbent particles to each solid particles, simulating the interaction between permeable materials and water using Darcy's law. Akinci [5] presented a general coupling method based on solid particle size, which has the characteristics of good reality and high efficiency. In this paper, we mainly study the simulation method based on smooth particle hydrodynamics technique in PhysX physics engine, which can maintain the high fluency in the case of large particles. Introduction of SPH Method Principle of SPH. Smooth Particle Hydrodynamics is a interpolation method based on fluid dynamics, which can calculate the physical properties of fluid by interpolation. Navier-Stokes equation, an important equation describing the motion of incompressible fluid in fluid dynamics, has become the 2016. The authors - Published by Atlantis Press 480

basic equation in SPH method. This equation describes the conservation of momentum of incompressible fluid and is equivalent to the Newton's second law. The equation is given as Du 1 2 = p + µ u + f Dt ρ (1) where ρ denotes the density, u the velocity, μ the viscosity coefficient, f the external force (such as gravity or force of collision). In SPH method, every particle carries individual properties. The scalar A(r) at any position r is a field variable calculated in the Eq. 2: Aj A ( r) = m j W ( r rj, h) ρ i j (2) where scalar A(r), which is estimated by a weighted sum of neighboring particles j, can be an arbitrary property of continuous fluid, such as density, pressure, etc., m j is the mass. The function W(r-r j,h), called kernel function, is a smoothed kernel with the smoothed radius h which indicates the effective range of the function. This function is normalized that has the following properties: W ( r rj, h) dr = 1 (3) The left value Du/Dt in Navier-Stokes equation is the acceleration for a given particle. Therefore, for a given particle, calculating its density and the right values in Navier-Stokes equation firstly, then calculating resultant force putting on the particle so that the position of the given particle can be updated according to the kinematic mechanics, this is the principle of SPH. Basic Idea of SPH. SPH method can be used to solve the partial differential equations of various energy fields in the fluid dynamics problem. The core idea of SPH algorithm is as follows: 1) The problem domain is represented by a series of arbitrarily distributed particles that do not need any connection between them. 2) The field function is approximatively indicated by integral method, which is called kernel approximation. 3) The kernel equation need to be further approximated using kernel approximation method. 4) The given particles depend on particles in current local distribution within each time step. 5) The kernel approximation method is applied to the filed function of all the partial differential equations in order to obtain a series of discretization of ordinary differential equations which only relate to time. 6) Explicit integration method is applied to solve the ordinary differential equations in order to obtain the fastest time integration, and get values of the field variables of all the particles with time. These six points are combined, which makes SPH algorithm to be a dynamic problem solver with no grid, adaptive, stable and Lagrange properties. Fluid Simulation in PhysX Engine Introduction of PhysX Engine. PhysX engine is one of three major physical computing engine in the world. It has excellent parallelism and can be carried out quickly on GPU in order to deal with the integer and floating-point calculation in physical computing. Therefore, PhysX engine can be used to handle large computational simulation of physical effects, such as fluid dynamics. In PhysX, all physical motion simulation are completed in a scene, each of which is involved in the physical computation is actor, and physics is a controller computing and finishing the part of interactions. 481

Fluid Interaction With Static Solid. In the fluid space, particle of fluid enters into the static solid space, and the reactive force is exerted by the solid which will cause the particle to return to fluid space needs to be calculated after interaction. The calculation of the force is defined as F = [ ks d + kd ( v n)] n (4) where d denotes the distance of interaction between particle and static solid, Ks and Kd are respectively the elastic constant and damping constant, v the relative velocity, n the normal vector in the point of collision, F is the reactive force in the direction of normal vector acting on the fluid particle. Added the result of dividing the force by mass of particle to the external force term f in Navier-Stokes equation and the acceleration under this reactive force can be calculated according to the Newton's law of motion. Fluid Interaction With Dynamic Solid. The two-way coupling calculation of fluid to solid and solid to fluid is required when fluid particle reaches the collision distance. The fluid particle produces a force that causes the solid to move or rotate, simultaneously the solid exerts a reactive force on fluid particle forcing it to leave the solid. The process of updating state of solid is described as follows: 1) Obtain the speed in initial state. 2) Solve the forces exerting by each particles. 3) Calculate the external force. 4) Calculate the acceleration of the solid after collision. 5) Update the velocity and position of solid. Motion Simulation of Fluid. The motion of fluid is followed by Newton's second law which determines the relationship of mass, acceleration and resultant force of each particles. The force analysis of fluid particles, including the gravity, the force exerted by external object and the constraining force between adjacent particles, can be easily divided into the internal force and the external force. Therefore, the resultant force of the fluid particles is equal to the sum of all force at the moment t, and we can get 2 S m 2 t = F ( S, t) in + F ( S, t) ex (5) where m denotes the mass of particle, S the displacement vector, Fin is the internal force and Fex is the external force and both of these two forces are functions of displacement and time changing with t and S. In the process of motion, fluid have to be detected collision in each frame so that it can interact with other objects. Updating motion trajectory of each particles after collision can form the motion effect of fluid. In PhysX, these collision detection is carried out in each time slice, and the specific detection process is as follows: 1) Collision filtering. In the scene, all objects involved in physical computing can collide, so it will cost a lot of time to detect all objects in the case of vast objects. Collision filtering is based on the space division, only to detect other objects near the current object can save plenty of time and improve the computing efficiency. 2) Rough collision detection. The fast detection to the collision pairs filtered in step of collision filtering based on axis-aligned bounding box method is carried out to filter the collision pairs again. 3) Precise collision detection. The precise detection based on triangle is applied to the rest of collision pairs and the calculation of interaction will be handled if the collision is occurred. 4) End of collision detection. In the calculation of interaction after collision, the displacement value can be calculated according to Eq. 5. 482

The main steps of fluid motion simulation in PhysX are given by Fig. 1. Firstly, we should initialize properties of fluid and start the simulation loop. Then the collision detection will be carried out and calculating resultant force and updating velocity and position of fluid particles and dynamic solid are executed. Finally render fluid particles and solids and continue the simulation loop. Fig. 1. The main steps of fluid motion simulation Results and Discussions All experiments in this paper were conducted on a PC with an Intel Xenon E5560 2.13GHz processor, 12GB RAM, and an NVIDIA GeForce GTX 480 graphics card. The version of PhysX 3.3.2 is used. Table 1: Parameters for experiments Parameters Values Smoothed Radius 0.1 Viscosity 60.0 Dynamic Friction 0.002 Restitution 0.1 Mass of Particles 0.00017269 In the experiments, fluid simulation is carried out under the PhysX physics engine, which can make the fluid interact with the static solid and the dynamic solid. Some parameters used in the experiments are shown in Table 1. The results of interaction between fluid and static solid are shown in Fig.2. When the fluid particles collide with static solid, the reactive force exerted by solid forces particles to leave, while the solid still remain in the original state. Fig. 2. Interaction between fluid and static solid 483

The results of interaction between fluid and dynamic solid are shown in Fig.3. When the fluid particles collide with the dynamic solids, solids are also affected by the fluid particles, which can be seen from the figures that the stacked blocks are pushed down and the original state is changed. Fig. 3. Interaction between fluid and dynamic solid Table 2 shows the relationship between the number of particles and the average frame rate, which represents the efficiency of the program. As can be seen from Table 2, when the number of particles in 15000, the calculating efficiency is high enough which can satisfy the requirements of real-time simulation. Table 2 Numbers of particles and average frame rates Conclusions Numbers of Particles Average Frame Rates 1000 84.35 5000 62.26 10000 38.19 15000 22.81 20000 12.01 We presented a new method for fluid simulation and a experiment based on SPH method is carried out in PhysX physics engine which simulated a process of interaction between fluid and solids. The result of experiment showed that the method proposed in this paper can still maintain high frame rate in the case of a large number of particles which satisfy the requirement of real-time simulation and prove the feasibility of the method. However, we just performed the simulation using point-based rendering instead of fluid surface rendering, therefore, we will render the fluid surface using Marching Cubes method and adding the part of human-computer interaction based on Kinect in order to enhance the interactivity is taken into account. Acknowledgements This research was supported by Project of National Science and Technology Support Plan (2012BAF84F02). References [1] Hongquan Sun: submitted to Journal of Natural Science of Heilongjiang University (2012), in Chinese. 484

[2] Yong Tang, Wenjing Zhao, Mengya Lv: submitted to Journal of Chinese Computer Systems (2012), in Chinese. [3] Kim B: ACM Transactions on Graphics Vol. 29 (2010), Article No. 175. [4] Lenaerts T, Adams B, Dutré P: ACM Transactions on Graphics Vol 49 (2008). [5] Akinci N, Ihmsen M, Akinci G, et al: ACM Transactions on Graphics (TOG) Vol 31 (2012). [6] Wojtan C, Thürey N, Gross M, et al: ACM Transactions on Graphics Vol 29 (2010). [7] Tongde Tan, Zhiguo Gao, Hongling Zhao, et al. submitted to Journal of Zhengzhou University (Engineering Science), in Chinese. [8] Akinci N, Akinci G, Teschner M: ACM Transactions on Graphics (TOG) Vol 32 (2013). [9] Bender J, Müller M, Otaduy M A, et al, in: Position-based Methods for the Simulation of Solid Objects in Computer Graphics, volume 1-22 of Eurographics 2013-State of the Art Reports[C] (2012). [10] Solenthaler B, Pajarola R: ACM Transactions on Graphics (TOG) Vol 40 (2009). [11] Becker M, Tessendorf H, Teschner M: Visualization and Computer Graphics Vol 15 (2009). [12] Kelager M: University of Copenhagen: Department of Computer Science (2006). 485