Fluid Simulations on GPU with Complex Boundary Conditions Youquan Liu1,3, Xuehui Liu1, Enhua Wu1, 2 Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing, China 2 Department of Computer and Information Science, Faculty of Science and Technology, University of Macau, Macao, China 3 Graduate School of the Chinese Academy of Sciences, Beijing, China [email protected], [email protected], [email protected] http://lcs.ios.ac.cn/~lyq/demos/gpgpu/gpgpu.htm 1

1 Introduction Fluid simulation is always a hot topic in computer graphics community. There is much work focused on this [1,2,3], trying to simulate water flowing, cloud animation, fire, smoke etc. We have implemented a system to simulate fluid flowing in 2D and 3D domain, which can process complex boundary conditions easily and efficiently on GPU.

2 Fluid Simulations on GPU To depict the flowing effects more exactly the Navier-Stokes Equations (NSEs) which mainly include two parts, the continuous equation (1) to ensure mass conservation, and the momentum equation (2) to ensure the momentum conservation are used. ∇ ⋅u = 0 (1) (2) ∂ u ∂ t = − (u ⋅ ∇ )u + v∇ 2u -∇ p + f Here u is the velocity vector, v is the coefficient for control of the diffusion, f is the external force and p is the pressure. Because of its good stability, we adopt semi-Lagrangian method [4] to solve the advection of NSEs without pressure. We compute the Possion equation of pressure, and then correct the velocity field with the pressure. To illustrate the flowing effects, the two scalar variables, density ρ and temperature T are introduced which are passively convected by the velocity field u, similar to the momentum equation. (3) ∂ ρ ∂ t = − (u ⋅ ∇ ) ρ + k ρ∇ 2 ρ + S ρ (4) ∂ T ∂ t = − ( u ⋅ ∇ )T + k T ∇ 2 T + S T To take full advantage of parallelism of GPU, we pack the density and temperature variables into RGBA channels with velocity variable together for 2D problems in our system. For 3D problems, just the density and temperature are packed together and flat 3D texture [2] is used to reduce the rendering pass number.

according to the obstacle information. Node’s Type(i,j) = Obstacle(i,j,k)*64 + Obstacle(i+1,j,k)*1 + Obstacle(i-1,j,k)*2+ Obstacle(i,j+1,k)*8 + Obstacle(i,j-1,k)*4+ Obstacle(i,j,k+1)*16 + Obstacle(i,j,k-1)*32

In this way, the boundary condition can be rewritten as φboundary = dφoffset + e , where d and e are determined from the

equation (1), which are packed to one texture. This texture is used to modify the velocity and pressure on boundaries.

4 Results After computing the whole field, we render the flowing effects with density distribution. So the whole simulation totally happens on GPU, and the CPU is just used to send commands and several quads, or to control the display of result. The test results prove the efficiency of our method. Figure 1 gives an example to illustrate the Von Karman vortex street effect in a classic example in computational fluid dynamics (CFD) field. Compared with the same algorithm on CPU, this method on GPU will speed up to 14 times on our machine. Figure 2 provides another example flowing in a maze, which can be used to simulate the smoke flowing in buildings. More demos can be visited at http://lcs.ios.ac.cn/~lyq/demos/gpgpu/gpgpu.htm. And the 2D application is also downloadable on the site.

Figure 1: Flowing around an obstacle in 2D domain

3 Boundary Processing It’s important to process the boundary conditions for those real fluid problems. The boundary conditions include Dirichlet (prescribed value), Neumann (prescribed derivative), and mixed (coupled value and derivative), as expressed by the equation (1): (1) aφ + b ∂φ ∂n = c Where φ stands for velocity, density, temperature or pressure etc., a, b and c are the coefficients. In order to process the complex boundary conditions on GPU, we take the obstacle information into an image, with 1 standing for fluid, 0 for obstacle. By doing so, we can take advantage of higher parallelism of GPU. It’s easy to implement in 2D domain, but in 3D domain, we clip the bounding box with stencil buffer to form the correct obstacle information that is different from [2]. We discrete equation (1) in first order, then the value of each voxel on boundaries can be determined by one nearest voxel. So we can generate one texture that consists of the voxel offsets that determine the value of the current voxel according to the node type with one fragment program. But before computing the offsets, we firstly generate one texture standing for the type of each node by the following coding scheme (2D problems have the similar form) with one fragment program

Figure 2: Flowing in maze in 3D domain

Acknowledgements This work is financially supported by the NSFC (60223005, 60033010), the National Grand Fundamental Research Grant of Science and Technology (973 Project: 2002CB312102), and the Research Grant of University of Macau.

References 1. 2.

3.

Ronald Fedkiw, Jos Stam and Henrik Wann Jensen. Visual Simulation of Smoke. In Proceedings of SIGGRAPH, pages15-22, August 2001. Wei Li, Zhe Fan, Xiaoming Wei, and Arie Kaufman, GPU-Based Flow Simulation with Complex Boundaries. Technical Report 031105, Computer Science Department, SUNY at Stony Brook, Nov 2003. Jos Stam. Stable Fluids. In Proceedings of SIGGRAPH, pages121-128, July 1999.

An Improved Study of Real-Time

1Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing, China ... to simulate water flowing, cloud animation, fire, smoke etc. We have implemented a system to simulate fluid flowing in 2D and. 3D domain ...

188KB Sizes 2 Downloads 129 Views

Recommend Documents

Improved Battery Models of an Aggregation of Thermostatically ...
Improved Battery Models of an Aggregation of Thermostatically Controlled Loads for Frequency Regulation.pdf. Improved Battery Models of an Aggregation of ...

Development of an Improved Dose Reconstruction ...
The most important was an explosion in the radioactive waste-storage facility in 1957 (the .... The System Administrator also makes a backup on streaming tape of the ... In addition, hydrological data pertaining to the Techa River are included.

An Improved Particle Swarm Optimization for Prediction Model of ...
An Improved Particle Swarm Optimization for Prediction Model of. Macromolecular Structure. Fuli RONG, Yang YI,Yang HU. Information Science School ...

An Improved Crowdsourcing Based Evaluation ...
for each query term. Using a context sentence for resolving word sense ambiguity is not a new concept, and it has been used by numerous re- searchers, such as (Melamud et al., 2015; Huang et al., 2012 ... texts presented, where p ≥ 1, will depend o

An improved Incremental Delaunay Triangulation Algorithm
Abstract: The incremental insertion algorithm of. Delaunay triangulation in 2D is very popular due to its simplicity and stability. We briefly discuss.

An improved method for the determination of saturation ...
2) use of cost effective excitation source with improved voltage regulation and ..... power electronic applications, renewable energy systems, energy efficiency.

An improved synthesis approach of the HIV-1 inhibitor ... - Arkivoc
General Papers. ARKIVOC 2016 (vi) 45-51 ... Education), School of Pharmaceutical Sciences, Shandong University, 44 West Culture Road,. 250012 Ji'nan ...

An Improved Version of Cuckoo Hashing: Average ... - Semantic Scholar
a consequence, new implementations have been suggested [5–10]. One of ... such a case, the whole data structure is rebuild by using two new hash functions. ... by s7,s6,...,s0 and assume that f denotes an array of 32-bit random integers.

An Improved Version of Cuckoo Hashing - Semantic Scholar
Proof (Sketch). We model asymmetric cuckoo hashing with help of a labelled bipartite multigraph, the cuckoo graph (see [11]). The two sets of labelled nodes ...

An Improved Algorithm for the Solution of the ...
tine that deals with duplicate data points, a routine that guards against ... numerical algorithm has been tested on several data sets with duplicate points and ...

The Development of an Improved Method for ...
between scraping to allow more time for the froth to build up and mature. This method of ... opinion thereof. It has been proposed that machine vision technologies could be used to extract useful data ... For the modified method of batch flotation th

User Study Insights for Improved Meta-index Searching
For this work, we created a test collection of seven corpora of at least 100 books, ... The domain meta-indexes are compiled from digital books in the public domain. .... were then free to follow threads of discussion, and build upon each other's ...

An Improved Control Law Using HVDC Systems for ...
Aug 28, 2013 - Systems for Frequency Control. Jing Dai1. Gilney Damm2 ... information. ... This lead to a smaller degree of primary reserve sharing, than the ...

An Improved Degree Based Condition for Hamiltonian ...
Lenin Mehedy1, Md. Kamrul Hasan1 and Mohammad Kaykobad2. 1Department of Computer Engineering, Kyung Hee University, South Korea. 2Department of Computer Science and Engineering, North South University, Dhaka, Bangladesh. Email: 1{lenin, kamrul}@oslab

An Improved Divide-and-Conquer Algorithm for Finding ...
Zhao et al. [24] proved that the approximation ratio is. 2 − 3/k for an odd k and 2 − (3k − 4)/(k2 − k) for an even k, if we compute a k-way cut of the graph by iteratively finding and deleting minimum 3-way cuts in the graph. Xiao et al. [23

An Improved Likelihood Model for Eye Tracking
Dec 6, 2005 - This property makes eye tracking systems a unique and effective tool for disabled people ...... In SPIE Defense and Security Symposium,. Automatic ... Real-time eye, gaze, and face pose tracking for monitoring driver vigilance.

SIMULATION OF IMPROVED GAUSSIAN TIME ...
A conventional technique for simulating a Gaussian time history generates the Gaussian signal by summing up a number of sine waves with random phase angles and either deterministic or random amplitudes. After this sim- ulated process has been used as

Realtime HTML5 Multiplayer Games with Node.js - GitHub
○When writing your game no mental model shift ... Switching between different mental models be it java or python or a C++ .... Senior Applications Developer.

An improved memetic algorithm using ring neighborhood ... - GitHub
4, 5, 6, 7 that the con- vergence to the known optimal result of test functions is very fast and most test functions have been converged after around. 1 × 105 FEs.