Hybrid particle grid fluid animation with enhanced details

Similar documents
Cluster Analysis of Electrical Behavior

Modeling, Manipulating, and Visualizing Continuous Volumetric Data: A Novel Spline-based Approach

An Optimal Algorithm for Prufer Codes *

Simulation of a Ship with Partially Filled Tanks Rolling in Waves by Applying Moving Particle Semi-Implicit Method

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

A Binarization Algorithm specialized on Document Images and Photos

Parallelism for Nested Loops with Non-uniform and Flow Dependences

Mathematics 256 a course in differential equations for engineering students

SLAM Summer School 2006 Practical 2: SLAM using Monocular Vision

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

Dynamic wetting property investigation of AFM tips in micro/nanoscale

A Fast Visual Tracking Algorithm Based on Circle Pixels Matching

Problem Definitions and Evaluation Criteria for Computational Expensive Optimization

Support Vector Machines

Classifier Selection Based on Data Complexity Measures *

S1 Note. Basis functions.

3D vector computer graphics

Improvement of Spatial Resolution Using BlockMatching Based Motion Estimation and Frame. Integration

Content Based Image Retrieval Using 2-D Discrete Wavelet with Texture Feature with Different Classifiers

Related-Mode Attacks on CTR Encryption Mode

S.P.H. : A SOLUTION TO AVOID USING EROSION CRITERION?

A MOVING MESH APPROACH FOR SIMULATION BUDGET ALLOCATION ON CONTINUOUS DOMAINS

Learning the Kernel Parameters in Kernel Minimum Distance Classifier

Module Management Tool in Software Development Organizations

Quality Improvement Algorithm for Tetrahedral Mesh Based on Optimal Delaunay Triangulation

User Authentication Based On Behavioral Mouse Dynamics Biometrics

FEATURE EXTRACTION. Dr. K.Vijayarekha. Associate Dean School of Electrical and Electronics Engineering SASTRA University, Thanjavur

Suppression for Luminance Difference of Stereo Image-Pair Based on Improved Histogram Equalization

Lecture 5: Multilayer Perceptrons

Fast Computation of Shortest Path for Visiting Segments in the Plane

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields

Some Tutorial about the Project. Computer Graphics

Overview. Basic Setup [9] Motivation and Tasks. Modularization 2008/2/20 IMPROVED COVERAGE CONTROL USING ONLY LOCAL INFORMATION

Feature Reduction and Selection

An Entropy-Based Approach to Integrated Information Needs Assessment

Interaction Methods for the SPH Parts (Multiphase Flows, Solid Bodies) in LS-DYNA

A new segmentation algorithm for medical volume image based on K-means clustering

Virtual Noctiluca: Interaction between Light and Water using Real-time Fluid Simulation and 3D Motion Measurement

MULTISPECTRAL IMAGES CLASSIFICATION BASED ON KLT AND ATR AUTOMATIC TARGET RECOGNITION

Reproducing Works of Calder

The Codesign Challenge

High-Boost Mesh Filtering for 3-D Shape Enhancement

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following.

An inverse problem solution for post-processing of PIV data

Surface Tension Model Based on Implicit Incompressible Smoothed Particle Hydrodynamics for Fluid Simulation

Topology Design using LS-TaSC Version 2 and LS-DYNA

Tsinghua University at TAC 2009: Summarizing Multi-documents by Information Distance

Analysis on the Workspace of Six-degrees-of-freedom Industrial Robot Based on AutoCAD

A Background Subtraction for a Vision-based User Interface *

Virtual Machine Migration based on Trust Measurement of Computer Node

Boundary Condition Simulation for Structural Local Refined Modeling Using Genetic Algorithm

Determining the Optimal Bandwidth Based on Multi-criterion Fusion

Design of Structure Optimization with APDL

Real-Time Two-way Coupling of Ship Simulator with Virtual Reality Application

Electrical analysis of light-weight, triangular weave reflector antennas

The Shortest Path of Touring Lines given in the Plane

Type-2 Fuzzy Non-uniform Rational B-spline Model with Type-2 Fuzzy Data

Real-time Motion Capture System Using One Video Camera Based on Color and Edge Distribution

Steps for Computing the Dissimilarity, Entropy, Herfindahl-Hirschman and. Accessibility (Gravity with Competition) Indices

Problem Set 3 Solutions

Accounting for the Use of Different Length Scale Factors in x, y and z Directions

The Research of Ellipse Parameter Fitting Algorithm of Ultrasonic Imaging Logging in the Casing Hole

COMPARISON OF TWO MODELS FOR HUMAN EVACUATING SIMULATION IN LARGE BUILDING SPACES. University, Beijing , China

Enhanced Advancing Front Technique with Extension Cases for Initial Triangular Mesh Generation

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

A New Approach For the Ranking of Fuzzy Sets With Different Heights

Array transposition in CUDA shared memory

A Fast Content-Based Multimedia Retrieval Technique Using Compressed Data

Explicit Formulas and Efficient Algorithm for Moment Computation of Coupled RC Trees with Lumped and Distributed Elements

Active Contours/Snakes

Range images. Range image registration. Examples of sampling patterns. Range images and range surfaces

UrbaWind, a Computational Fluid Dynamics tool to predict wind resource in urban area

The Theory and Application of an Adaptive Moving Least. Squares for Non-uniform Samples

Finite Element Analysis of Rubber Sealing Ring Resilience Behavior Qu Jia 1,a, Chen Geng 1,b and Yang Yuwei 2,c

Helsinki University Of Technology, Systems Analysis Laboratory Mat Independent research projects in applied mathematics (3 cr)

Smoothing Spline ANOVA for variable screening

Lecture #15 Lecture Notes

Analysis of Continuous Beams in General

Module 6: FEM for Plates and Shells Lecture 6: Finite Element Analysis of Shell

Scheduling Remote Access to Scientific Instruments in Cyberinfrastructure for Education and Research

Positive Semi-definite Programming Localization in Wireless Sensor Networks

Querying by sketch geographical databases. Yu Han 1, a *

Skew Angle Estimation and Correction of Hand Written, Textual and Large areas of Non-Textual Document Images: A Novel Approach

THE PULL-PUSH ALGORITHM REVISITED

Simulation Based Analysis of FAST TCP using OMNET++

CAD and CAE Analysis for Siphon Jet Toilet

Efficient Distributed File System (EDFS)

AMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain

Constructing Minimum Connected Dominating Set: Algorithmic approach

Complex Deformable Objects in Virtual Reality

Computer models of motion: Iterative calculations

Classifier Swarms for Human Detection in Infrared Imagery

Computer Animation and Visualisation. Lecture 4. Rigging / Skinning

The Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique

Learning-Based Top-N Selection Query Evaluation over Relational Databases

Numerical Simulations of 3D Liquid Sloshing Flows by MPS Method

SAO: A Stream Index for Answering Linear Optimization Queries

APPLICATION OF PREDICTION-BASED PARTICLE FILTERS FOR TELEOPERATIONS OVER THE INTERNET

Wishing you all a Total Quality New Year!

Solving two-person zero-sum game by Matlab

Transcription:

Vs Comput (2013) 29:937 947 DOI 10.1007/s00371-013-0849-6 ORIGINAL ARTICLE Hybrd partcle grd flud anmaton wth enhanced detals Chang-bo Wang Qang Zhang Fan-long Kong Hong Qn Publshed onlne: 1 June 2013 Sprnger-Verlag Berln Hedelberg 2013 Abstract Smulatng large-scale flud whle retanng and renderng detals stll remans to be a dffcult task n spte of rapd advancements of computer graphcs durng the last two decades. Grd-based methods can be easly extended to handle large-scale flud, yet they are unable to preserve sub-grd surface detals lke spray and foam wthout multlevel grd refnement. On the other hand, the partcle-based methods model detals naturally, but at the expense of ncreasng partcle denstes. Ths paper proposes a hybrd partcle grd couplng method to smulate flud wth fner detals. The nteracton between partcles and flud grds occurs n the vcnty of couplng band where multple partcle level sets are ntroduced smultaneously. Frst, fluds free of nteracton could be modeled by grds and SPH partcles ndependently after ntalzaton. A couplng band nsde and near the nterface s then dentfed where the grds nteract wth the partcles. Second, the grds nsde and far away from the nterface are adaptvely sampled for largescale smulaton. Thrd, the SPH partcles outsde the couplng band are enhanced by dffuse partcles whch render lttle computatonal cost to smulate spray, foam, and bubbles. A dstance functon s contnuously updated to adaptvely coarsen or refne the grds near the couplng band and Electronc supplementary materal The onlne verson of ths artcle (do:10.1007/s00371-013-0849-6) contans supplementary materal, whch s avalable to authorzed users. C.-b. Wang ( ) Q. Zhang F.-l. Kong Software Engneerng Insttute, East Chna Normal Unversty, Shangha 200062, Chna e-mal: cbwangcg@gmal.com H. Qn Department of Computer Scence, Stony Brook Unversty, Stony Brook, NY, USA e-mal: qn@cs.sunysb.edu provdes the couplng weghts for the two-way couplng between grds and partcles. One characterstc of our hybrd approach s that the two-way couplng between these partcles of spray and foam and the grds of flud volume can retan detals wth lttle extra computatonal cost. Our renderng results realstcally exhbt fluds wth enhanced detals lke spray, foam, and bubbles. We make comprehensve comparsons wth exstng works to demonstrate the effectveness of our new method. Keywords Hybrd partcle grd smulaton Flud anmaton Two-way nteracton Enhanced detals 1 Introducton Physcally based flud smulaton has been one of actve research topcs n computer graphcs n recent years. However, due to ts physcs nature and the tme and space complexty of smulatng physcal prncples n realty, many of the flud smulatons can only handle flud n a small and confned regon such as a smple cube-shaped boundng box, but for large-scale free-boundary flud wth fne detals, such smulaton s subject to the lmt governed by the grd sze, hence the overall resoluton of smulaton regon. In such grd-based smulaton, t s unavodable to optmze the grd refnement and conduct extra smulaton n regons of nterest n order to expect sub-grd features lke foam and spray to occur. There have been some works on large-scale flud smulaton n recent years, such as grd optmzaton [7], multscale partcles [8], 2D and 3D couplng [5, 6], etc. As a result, t s possble to smulate large scenes such as boat floatng on the lake, and large shp crusng n ocean. Stll,

938 C.-b. Wang et al. a common dffculty s the modelng and renderng of surface detals. Although navely ncreasng the grd resoluton and/or the number of partcles could get the job done towards ncreased detals such as foam and spray, extra computatonal expenses are becomng prohbtvely hgh whch has prevented ts practcal utlty at any consumer-level computng platform. For enhanced surface detals, some methods have also been developed. Nonetheless, they are commonly lmted n small-scale scene desgn such as a glass of water, because such scenaro could be easly accommodated by reasonable resolutons n a desktop envronment. In prncple, the water drops are larger than the computng cells so that they can be accurately retaned. In fact, for the two classc flud smulaton methods, Euler method and Lagrangan method have ther respectve advantages and lmtatons. Grd-based dscretzaton can easly be utlzed to model the large-scale flud volume, and the partcle-based method offers a good strategy to model detals of flud surface. It s our belef that the two-way couplng shall offer a good tradeoff, whle takng advantages of both approaches. Yet, how to model the nteracton between partcles and grds remans elusve n general n spte of recent research progresses n ths regard. In ths paper, we focus on large-scale flud wth enhanced surface detals and develop a novel hybrd partcle grd method. Our hybrd partcle grd nteractons occur at three dfferent levels dependng on ther whereabout n the smulaton space, and three levels comprse: the grd for nner flud volume, hybrd couplng band (whch exhbts a layered-structure n the vcnty of free surface), and partcles on the flud surface. Ther nteracton and movement are dynamcally synchronzed wth the evoluton of flud surfaces, and could naturally depct more detals for flud anmaton wthout the need of global grd refnement and/or ncreasng partcle denstes va splttng. To acheve the threelevel model, we proposed a concept of Couplng Band, and accomplsh mprovement on the prevous method n the followng aspects. Partcle grd hybrd modelng wth two-way couplng A hybrd model s proposed to couple the grd-based method for the flud volume wth the partcle-based method for the surface detals. To model sub-grd detals, extra partclebased smulaton s performed near the flud surface. Adaptve grd samplng optmzaton s adopted for the flud volume whch makes the large flud scene wth local detals possble to acheve. Bdrectonal partcle grd nteracton wth couplng band The nteracton between partcles and grds s bdrectonal and strong-couplng. A couplng band s based on the dstance functon whch takes the nterface between grd and partcle as the zero-sosurface. It s a layered-structure whch provdes couplng weght for both partcpatng partcles and the enclosed cells n order to acheve a true two-way couplng. Enhanced surface detals usng SPH and dffuse partcles Local detals near the couplng band are enhanced by addng dynamc partcles wth dfferent moton rules. Three types of partcles are ntroduced wth dfferent dynamc nteractons. Accordng to the crtera f they are nsde, outsde or on the couplng band, they are respectvely classfed as spray, foam, or bubbles. The rest of ths paper s organzed as follows. After brefly revewng the prevous works n Sect. 2, the grdbased method and the PLS for free surface trackng are ntroduced n Sect. 3. In Sect. 4, the couplng band for hybrd partcle grd flud s elaborated. Then we descrbe the adaptve grd optmzaton n Sect. 5 and explan the added dffuse partcles for enhanced surface detals n Sect. 6, and we then brefly explan our results n Sect. 7. Fnally, the concluson and future work are outlned n Sect. 8. 2 Related work In recent years some works have already been focused on the smulaton of free surface flud. Based on the level set method, Enrght et al. [1] proposed the partcle level set (PLS) method whch adds more detals nto the free surface flud, and greatly mproves the vsual realsm. They combned the level set method wth the Lattce Boltzmann method (LBM) [3] and proposed a new free surface model based on the Volume of Flud (VOF) method [2]. Kwak et al. [18] then presented a hybrd method whch couples LBM wth PLS. They ntroduced a complex surface trackng method (lke quad-tree) to obtan more accurate surface wth features. But the results are only lmted to grd-level features, sub-grd features lke spray are hardly smulated. On the other hand, the partcle-based smooth partcle hydrodynamcs (SPH) s becomng more popular [4], as ts formulaton s easy to mplement, and detals lke spray and foam can be modeled n a straghtforward fashon. However, t s dffcult to extract the surface, and how to select an approprate smooth kernel functon also remans ad hoc. The common shortcomng of the aforementoned flud smulaton methods s that they cannot be drectly used to smulate the large-scale flud wth fne surface detals. To smulate the flud n a regon that s as large as possble, grd optmzaton and herarchcal modelng methods are necessary. Hybrd grds are proposed n [5, 6] whch mx the 2D heght map wth the 3D computng grd, and n [7], the new strategy s to coarsen or refne cells based on ts dstance to the surface. For the SPH optmzaton, Solenthaler and Gross [8] presented a two-scale partcle method

Hybrd partcle grd flud anmaton wth enhanced detals 939 to enhance the detal at some regons where complex flow behavor emerges by splttng partcles nto smaller ones. But the referred methods nevtably enlarge the grd resoluton n order to model surface detals n localzed regon, and at the same tme coarsen the grd to adapt to large-scale regon wthout the need of modelng surface detals. Such conflctng requrements make the underlyng computatonal scheme dffcult to deploy and manage. New solutons based on addtonal smulaton are proposed to solve these problems. Chentanez and Muller [9] presented a hybrd method combnng grd-based shallow water solver and partcle-based non-nteractng pont masses. The smplfed computaton makes the real-tme smulaton possble but lmts vsual effects of the scene. Losasso et al. [10] coupled the SPH wth the partcle level set, and smulated the flud volume wth PLS and the surface detals wth SPH wth convncng smulaton results. But no optmzaton s made to the smulaton of flud volume. Ihmsen et al. [11] added dffuse partcles whch only take smple computatons wth three types: foam, bubble, and spray to the SPH flud and obtaned attractve vsual effects. However, ths s only a one-way couplng method whch does not offer suffcent functonaltes. Ths paper s nspred by pror works and advances the current state-ofthe-art wth the new hybrd partcle grd method supportng the two-way couplng. 3 Modelng free surface flud wth PLS 3.1 Grd-based flud solver wth partcle level set Our flud solver s the grd-based Lattce Boltzmann method (LBM), whch uses smple rules of quantfyng mcropartcle movement to reflect macro-flud changes. The Bhatnager Gross Krook model wth sngle-relaxaton can be formulated as f (x + e,t+ Δt) = f (x,t) 1 ( ( ) eq f x,t f (ρ, u) ), (1) τ where e s the dscrete partcle velocty n the drecton, f (x,t) and f eq (ρ, u) are the densty dstrbuton functon and the equlbrum densty dstrbuton functon n the cell at x at tme t, τ s relaxaton tme. In each dscrete spatal cell, the densty ρ and velocty u can be formulated as ρ(x,t)= f (x,t),u(x,t)= 1 ρ e f (x,t). (2) Ths dstrbuton functon f accounts for the number of partcles along the drecton, each dscrete partcle has several drectons of possble movement. Accordng to the conservaton of energy, dfferent ntal condtons and boundary condtons of the recursve evoluton for the dstrbuton functons can be derved. For surface trackng, accordng to the partcle level set method, the evoluton equaton of the dstance functon n level set can be wrtten as φ t + u φ = 0, (3) whch can be spatally dscretzed usng the 5th-order accurate Hamlton Jacob Weghted Essentally Non-Oscllatory (HJ-WENO) scheme [12] and temporally dscretzed usng the 3rd-order Total Varaton Dmnshng Runge Kutta (TVD-RK) scheme [13]. To update the dstance functon, an external velocty feld by the numercal soluton s needed. To keep the level set as a sgned dstance functon (.e., that t must meet the equaton φ =1 n the smulaton process), the fast marchng method (FMM) s used whch advects the nterface n an upwnd fashon [14]. FMM s also used for the velocty extrapolaton whch we wll address n the followng secton [15]. The cells to be updated can be reduced by usng a narrow band level set method, as descrbed n [16]. In ths case, the level set s only propagated n a regon wthn a certan range around the flud surface, hence the veloctes only have to be extrapolated wthn ths regon. As a classc method for surface trackng, the level set method extracts smooth surface of grd-based flud smulaton, however, one weakness s that t smoothes the corner of the smulaton result and fals to capture the thn features and the volume of lqud tends to decrease durng smulaton. To overcome ths problem of volume loss, the partcle level set method (PLSM) [13] uses massless marker partcles n front trackng n sub-grd regons around the nterface. The added partcles have the correspondng value of dstance functon n level set, so the partcles wth postve dstance value are outsde the nterface. Those partcles work to correct the numercal errors generated n the process of the re-ntalzaton of the level set by comparng the dstance value from escaped partcles and cells [13]. Error correcton s used both after the level set has been updated and agan after t has been re-ntalzed. 3.2 Hybrd method for free surface flud To combne the grd of flud wth PLSM, we need to obtan the velocty feld to advect the level set functon and the partcles. The velocty of each cell can be calculated usng Eq. (2). However, the evoluton equaton requres the veloctes on both sdes of the nterface to mantan the valdty and smoothness of the sgned dstance functon. Here the fast marchng method s used to extrapolate the flud veloctes n the neghborng empty cells n each step. Thus, the dstance functons can be advected by the velocty feld. In ths paper, we use the sem-lagrangan advecton scheme [17] for the advecton method. The basc dea

940 C.-b. Wang et al. of the sem Lagrangan method s as follows. Gven the level set functon and the velocty feld u, the updated value at a pont x after Δt s φ(x) = φ ( x u(x)δt ). (4) Free surface flud smulaton has to classfy the cells nto three types: Gas for cells full of gas, Lqud for cells full of flud, Interface for the cells contan both gas and flud. The Lqud cells can be dealt wth usng normal LBM cell, and the Gas cells do not partcpate the computaton. So we only focus on the update of the Interface cells. In [3], the mass exchange s ntroduced whch can record the lqud fracton (rangng from 0 to 1) of a cell so that the cells are classfed (1 for Lqud,0forGas, and other values for Interface). Ths method can guarantee the conservaton of mass, but needs computng tme for the updatng of the mass n the LBM stream step and the swtchng of the types of cells, especally the redstrbuton of the extra mass when an Interface cell swtches to a Gas or a Lqud cell. In [18], the lqud fracton s obtaned by teratvely dvdng a Interface cell nto four cells and calculatng the sgned dstance functons of the new cells untl the predefned accuracy s satsfed. Ths reduces the error n conservaton of mass, but also ncreases the computaton cost. We classfy the cells based on ther dstance values: negatve value for Gas, cells wth postve value and gas neghbors are classfed as Interface, and the others are Lqud. Ths makes the updatng of types of cells much faster. We shall classfy and update the types of the cells n each tme step. As mentoned above, Interface cells must have Gas neghbors. So n the stream step of standard LBM solver, the exchange of densty dstrbuton functons between Interface and Gas cells need to be reconstructed (the orgnal equaton s Eq. (1)). We take the same reconstructon step as n [3]: f eq (x,t + Δt) = f (ρ A, u) + f eq (ρ A, u) fĩ(x,t), (5) where x s the Interface cell, s the drecton from x to the Gas neghbor, ĩ s the opposte drecton of, ρ A s the densty of ar whch s treated as constant 1, u s the velocty of x. To balance the forces on each sde of the nterface, the dstrbuton functons comng from the drecton of the nterface normal are also reconstructed [3]. So we have n eĩ > 0 wth n = φ φ, (6) where n s the surface normal. In our method, the normal s easly computed from the dstance functon. The man computatonal steps n the PLS-LBM framework are llustrated n Fg. 1, where grd-based flud solver provdes velocty feld for PLS to be advected, and PLS offers dfferent types of all cells accordng to the dstance functon. ĩ Fg. 1 The computatonal ppelne n our PLS-LBM model 4 Two-way couplng of grds and partcles For the hybrd method for free surface flud dscussed above, snce the PLS and LBM are both based on the grd, n order to smulate the flud wth surface detals, excessve subgrd refnement must be done but at the expense of ncreasng the global resoluton of computaton grd. Now, t sets a stage for us to ntroduce a novel hybrd partcle grd dea. In the PLS-LBM framework, there s a zero-sosurface,.e., the flud surface whch s called Border below to avod confuson. It may be noted that the Border s not the flud surface n the partcle grd flud but the nterface between grdbased flud and partcle-based flud. 4.1 Partcle-based flud solver Our partcle-based flud solver s SPH. SPH smoothes quanttes over a neghborhood wth the radus h by usng a kernel W(x j,h) to wegh the contrbutons accordng to the dstance between two partcles and j. A smoothed, physcal quantty q for a partcle can thus be computed by summng up the contrbutons of the neghborng partcles j: q = j m j ρ j q j W(x j,h), (7) where m j s the mass of partcle j and ρ j s ts densty. The moton of the partcles s governed by the pressure, vscosty and external force [21]: ρ u t = f pressure + f vscosty + f external, (8) f pressure f vscosty = ρ = μ j j ( p ρ 2 + p ) j ρj 2 m j W(r r j,h), (9) (u j u ) m j ρ j 2 W(r r j,h), (10) where μ s the coeffcent of vscosty, and ρ, ρ j, p, p j are the densty and the pressure of the partcles and j, whch

Hybrd partcle grd flud anmaton wth enhanced detals 941 the resultant velocty. And the closer the dstance between partcle and Border, the greater the drag force t s exerted. When the partcle reaches the Border, ts movement s completely determned by the velocty of the cell where the partcle s resdng, so that the couplng band makes the couplng from grd to partcles more smoothly. Partcle Grd: For an LBM cell x c n the couplng band, the densty and velocty of neghborng partcles are resampled n the neghborng cell x c + e accordng to Fg. 2 The couplng band n the hybrd partcle grd method can be calculated accordng to Becker s method [19], (( ) ρ k p = a 1), k= 7, (11) ρ 0 where ρ 0 s the statc densty, a s a constant. And the weakly compressble SPH solver s used to keep densty varatons lower. The only dfference s the sze of the stffness value k n the gas equaton. Here, k s chosen to be very hgh so that the densty fluctuatons are below 1 %. 4.2 Couplng band for partcle grd couplng To couple the grd wth SPH partcles for two-way nteracton, a couplng band whch s based on the dstance functon n the level set method s proposed. Each cell x n flud grd keeps a value of dstance from the surface φ(x). The couplng band means the area whch s made up of all the cells whose φ s n a gven range [ d,d]. So these cells are dstrbuted on both sdes of the zero-sosurface where φ(x) = 0 (.e., the Border) as can be seen n Fg. 2. Only n ths band, we perform the nteracton between the flud cells and partcles. When a partcle moves out of the couplng band, ts moton wll be defned n the next secton. Grd Partcle: For partcles that are n the couplng band, neghborng cells are treated as boundary condton. For a partcle x p, we can fnd the cell x c that contans ths partcle. Snce the partcles are near the surface, they are lkely to be drven by the underlyng flud cells, so the velocty of the partcle u p s partally determned by x c.we ntroduce a couplng weght here for ths partcle whch can be represented as { φ(xp ) /d φ(x p ) [ d,d] w(x p ) = (12) 0 otherwse. Then we can get ts velocty and update ts poston by u (x p ) = w(x p ) u sph (x p) + ( 1 w(x p ) ) u lbm (x p) x p = x p + u, (13) (x p )Δt where u sph (x p) and u lbm (x p) are the veloctes obtaned from SPH solver and the LBM solver, respectvely, and u (x p ) s ρ lbm (x c + e ) = ρ lbm (x c + e ) + ρ sph (x c + e ), (14) u lbm (x c + e ) = ρ lbm(x c + e ) ρ lbm (x c + e ) u lbm(x c + e ) + ρ sph(x c + e ) ρ lbm (x c + e ) u sph(x c + e ), (15) where u lbm (x c + e ) and ρ lbm (x c + e ) are the velocty and densty obtaned from the cell x c + e, and the u sph (x c + e ), ρ sph (x c + e ) are nterpolated from the SPH usng Eq. (7). In ths way, the dstrbuton densty functons are updated accordng to the resultant densty and velocty, so the cell s affected by the neghborng partcles. A 2D hybrd partcle grd flud s presented n the followng fgures. In Fg. 3, frst, a rectangle represented by SPH partcles and a crcle represented by LBM grd are shown n the left fgure. Then, they fall down due to the gravty and nteract wth each other. To make t vsually clear, the flud cells n LBM solver are represented n square whle gnorng the lqud fracton. 5 Adaptvely-refned grds wth dstance functon The local-grd refnement scheme s frst descrbed n [20]. Adaptve coarsenng algorthm beng appled to fne grds at the area close to nterface [7] can buld a transton zone between fne cells and coarse ones more effectvely. However, they classfes the cells near the nterface nto 5 types and takes 3 passes to update the cells for refnement and 2 passes for coarsenng. Each pass contans neghborhood checkng. In our method, each cell keeps a value of dstance from the nterface, so t can respectvely refne or coarsen tself f φ(x) > φ f or not, where x s the poston of the center of the cell, φ f s a user-defned parameter whch controls how deep the deepest fne cell s from the water surface. To make the computaton n the area of couplng band precse, the φ f shall satsfy φ f >d, where d s the half of the wdth of couplng band n Eq. (12). So, a larger φ f results n more fne cells n the same stuaton. And that s to say, fne cells are for the area near the nterface, and coarse cells are the ones that are far away from the nterface. Fgure 4 shows the types of cells.

942 C.-b. Wang et al. Fg. 3 A 2D hybrd partcle grd flud smulaton starts from a partcle-based rectangle flud and a grd-based crcle flud n the frst fgure and contnues ther nteractons n the mddle and rght fgures coarse and fne cells. For the border of fne cells, f f = f eq f + 2(τ c 1) ( ff f eq ) τ f 1 f, (17) and for the border of coarse cells, f c = f eq c + τ f 1 ( fc f eq ) 2(τ c 1) c, (18) Fg. 4 All types of cells n adaptvely-refned grd There are two knds accordng to the ndces of the cells: even and odd. Even cells mean the cells wth even coordnates on all the axes whle odd cells mean the cells wth at least one odd coordnate on all the axes. The exchange rules of states are as follows. Fne and coarse occurs only on the even cells, whle the state of an odd cell s ether sub-cell (work as a fne cell) or nvald cell accordng to the states of ts neghbors: t s sub-cell when t has a fne cell neghbor, otherwse the nvald cell. In Fg. 4, the border of coarse cells and the border of fne cells are both treated as not only fne cell but also coarse cell, so these two types of cells are the key for the couplng of fne and coarse cells. The grd spacng Δx c and Δt c on the coarse grds are twce as much as those of the fne grds. So the relaxaton tme needs to be recalculated by τ c = 1 ( τ f 1 ) + 1 2 2 2, (16) where τ c and τ f are the relaxaton tme for coarse and fne grds, respectvely. To ensure the velocty and densty consstent and contnuous n dfferent cells, the non-equlbrum parts of the dstrbuton functons have to be rescaled. The stream and collson steps on the fne and sub-cells perform twce as much as the coarse ones do at each tme step. The dstrbuton functons are rescaled drectly on the borders of where the subscrpts c and f are for coarse and fne cells, respectvely. When some neghborng cells of a fne cell are absent (due to the fact that they are coarse cells), sub-cells (n the neghborhood) should be made up by spatal nterpolatng dstrbuton functons of coarse cells. Here, the external forces, such as drop gravty, can change the velocty for unform cells lke: u = u + τg, where u s the orgnal velocty, and u s the resultant velocty, τ s the relaxaton tme, and g s the acceleraton of gravty. However, for mult-scale cells, the affecton s dfferent for dfferent postons: u f = u f + τ f g, u c = u c + τ c Δx c Δx f g, (19) where u f, u c, Δx f, Δx c are the velocty and grd nternal of the fne and coarse cells, respectvely. As the smulaton contnues, the state (fne or coarse) of grd should be updated dynamcally accordng to the dstance functon. For cells updated from coarse to fne, ther neghbors whch are all odd cells should become sub-cells as shownnfg.4. And the ntalzaton of the cell s obtaned from lnear nterpolaton. Whle for cells updated from fne to coarse, ther neghbors whch have no fne neghborng cells should become nvald cells, and ther propertes lke the densty, velocty and dstrbuton functons are smply dscarded.

Hybrd partcle grd flud anmaton wth enhanced detals 943 Fg. 5 Classfcaton of Spray, Foam, andbubble partcles 6 Enhanced surface detals wth spray, foam, and bubbles In addton to the couplng between partcles and grd n the couplng band, more detals occurrng on the flud surface are spray, foam and bubbles. Here we treat partcles as addtonal smulaton near the flud surface to model these nterestng features. Intally, there s only flud expressed by grd, partcles are adaptvely added, classfed and deleted also by the couplng band accordng to the flud evoluton. 6.1 Formaton and classfcaton of partcles In partcle level set, the massless partcles are seeded on both sdes of the flud nterface and some are removed when they come across the nterface beyond a long dstance. These massless partcles are only advected by the velocty feld of flud grd and used to correct the dstance functon of level set as usual. As n [10], we add SPH partcles as Foam at the postons of the removed negatve partcles that were orgnally n the nteror of the flud volume. Here the added SPH partcles are dfferent from the partcles n level set trackng method. These partcles tend to leave the surface of the flud and move nto the ar, they wll be marked as Spray when they leave the couplng band. Addtonally, we also add partcles as Foam at the postons of the removed postve partcles for modelng more features, but the partcles of ths part tend to enter the flud volume. They wll be marked as Bubble when they leave the couplng band. For a level set s partcle p, ts orgnal poston s x o p and x t p denotes ts poston at tme t. Ifφ(xo p ) φ(xt p )<0, we frst delete partcle p, then compute the densty at x t p ;f ρ x t p <ρ 0, we add an SPH partcle at x t p, otherwse do nothng. We compare the denstes ρ x t p and ρ 0 to avod too many SPH partcles beng added n a narrow regon. A partcle s s classfed as Spray, Foam or Bubble accordng to ts dstance from the surface φ(x s ). Here, f φ(x s )>d, partcle s s consdered Spray; fφ(x s )< d, partcle s s consdered Bubble; n all other cases, the partcle s s consdered to be Foam. The postons of Spray, Foam, and Bubble are llustrated n Fg. 5. 6.2 Moton of adaptve partcles We can get the moton of foam partcles usng Eq. (13). And the moton of spray partcle s computed as normal SPH par- Algorthm 1 The process of the hybrd partcle grd flud smulaton procedure GRIDPARTICLEFLUID(PLS,LBM,SPH) Update the LBM and handle the partcle grd couplng by usng Eq. (14) and Eq. (15) Velocty extrapolaton for LBM; Update the φ of PLS by the u of LBM; Update the partcles of PLS by the u of LBM; for all partcle PLS do Fx the correspondng φ of PLS f partcle Removed P artcles then f ρ sph (partcle) < ρ 0 then Insert an SPH partcle end f end f end for Re-ntalze the φ of PLS; Fx the φ by the partcles of PLS Update the states (Spray, F oam, Bubble) of the partcles of SPH by the φ of PLS for all partcle SPH do f partcle Spray then Take normal SPH steps end f f partcle Foamthen //handle the partcle grd couplng Update partcle by Eq. (13) Delete the tme-up partcle end f f partcle Bubble then Update partcle by Eq. (20) and Eq. (21) end f end for end procedure tcle. Due to the hgh densty contrast of water and ar, the force exerted on the bubbles ncludes buoyancy whch counteracts the gravty, and drag force whch makes the partcles flow wth the flud volume. Therefore, the velocty of an ar bubble can be computed as u bub t u lbm (x bub,t + Δt) u bub (t) = w g g + w d, (20) Δt where u bub s the velocty of the Bubble partcle, w g and w d are the weght of buoyancy and drag force, respectvely. Then we update ther postons as x bub (t + Δt) = x bub (t) + Δtu bub (t + Δt). (21) It may be noted that the spray and bubbles could mgrate nto the couplng band and become foams, so n practce we keep a tmer for each foam partcle. when the tmer expres, the correspondng partcle shall be removed.

944 C.-b. Wang et al. Fg. 6 Close-up vew of the comparson of the results wth and wthout surface detals Fg. 7 Comparson between smulated results of our normal PLS-LBM wth and wthout enhanced surface detals. The grd sze s 150 150 150 7 Expermental results and analyss Based on our novel method detaled above, we desgn dfferent scenes of flud smulaton wth and wthout partcles. The attrbutes such as ρ, u, f, φ of the grd are stored n arrays, whle the propertes of the partcles are stored n a pont buffer as a lst for the frequent nsertng and deletng operatons. The computatonal process of the entre algorthm s detaled n Algorthm 1. Our system s mplemented usng C++. Our hardware platform s PC wth Intel (R) Pentum (R) 3.4 GHz CPU, 3 GB memory, and NVIDIA GeForce GTX260 Graphcs card. The smulaton results are rendered by usng V-Ray (www.chaosgroup.com). The coeffcent d of couplng band here s 5Δx f where Δx f s sze of a fne cell and to keep the computaton n couplng band accurate, the φ f often meets φ f >d, here we set t as 8Δx f. To get better vsual results, we choose the lfetme of the foams as 700 steps and add a probablty for generatng an SPH partcle at the poston referred to n Sect. 6.2. The probablty we used n these scenes s 0.01. Fgure 6 s a close-up vew of the comparson of the smulaton wth and wthout detals. In the left of Fg. 6, subgrd features are captured by partcles whch make the scene more realstc. Fgure 7 shows the smulaton result by the PLS-LBM framework wth and wthout enhanced surface detals. The grd sze s 150 150 150. In Fg. 7(a), only PLS-LBM s used, the surface s well tracked, but due to the nherent weakness of PLS, the surface s obvously over-smoothed and s lackng detals on the surface. In ths case, t takes about 11 second per frame at most durng the smulaton.

Hybrd partcle grd flud anmaton wth enhanced detals 945 Fg. 8 An ocean scene wth our novel PLS-LBM method wth enhanced surface detals. The grd sze s 400 100 200 Fg. 9 A ppe scene wth our novel PLS-LBM method wth enhanced surface detals. The grd sze s 100 100 100 Table 1 Tmng, grd szes, and partcle counts n our experments Scenes Grd sze Partcles Second/frame LBM SPH Fg. 7(a) 150 150 150 0 9.3 0.0 Fg. 7(b) 150 150 150 300 K 9.3 0.6 Fg. 8 400 100 200 1 M 60.3 1.9 Fg. 9 100 100 100 160 K 6.4 0.4 Whle n Fg. 7(b), addtonal partcle-based smulaton s added onto the surface and the detals are showng wth at most 300 K partcles for each step of the smulaton, and the partcle-based smulaton costs less than 1 second n total tme. Fgures 8 and 9 show the smulaton results of an ocean scene and a scene n whch a ppe of water stream goes down by usng the PLS-LBM method wth enhanced surface detals. The szes of the grd are 400 100 200 and 100 100 100, respectvely. The spray, foam, and bubbles of the ocean are modeled by the SPH partcles, and the number of partcles s about 1 M and 160 K, respectvely. The detaled comparson s documented n Table 1. 8 Concluson and future work In ths paper, a novel partcle grd hybrd framework for free surface flud s presented. In a nutshell, our method generalzes PLS to support the layered structure n the vcnty of free surface. We have appled our novel method to flud smulaton wth enhanced vsual detals n regons that enclose free surface. Addtonally, we developed a hybrd partcle grd method that tghtly couples partcle-based smulaton wth grd-based flud volume smulaton, wth a goal to facltate the large-scale flud wth fne surface detals. To add suffcent amount of surface detals nto flud smulaton, the adaptve refnement method has been deployed to the cells near the surface n order to dynamcally update dffuse partcles and tghtly couple them wth surroundng flud n a bdrectonal manner. The anmaton effects and the tme statstcs of our method, as well as ts comparsons wth other related works, are documented n Table 2. We notce that the vsual effects we have obtaned mght not be the most deal, nonetheless, the smulaton tme s shorter compared wth the methods wth better detals. The SPH partcles allow us to use coarser grd, and the flud volume comprsng cells allow us to reduce the number of the partcles. They both reduce the computatonal cost of the smulaton wth lttle effect of detals. There are stll lmtatons to overcome. Our method has not yet consdered the local rules for the geometry of flud surface and the physcal movement of partcles, and the flud regon whch we can smulate s stll not large enough. Future research efforts are: to nvestgate better grd optmzaton strateges, and enlarge the smulaton regon fur-

946 C.-b. Wang et al. Table 2 The comparson between our novel method and other recent work Related work Key methods Detals Speed Largest smulaton regon Enrght [1] PLS + +++ 140 110 90 Thuerey [7] LBM +++ + 480 480 480 Losasso [10] SPH, PLS + + + + NA (SPH) + 560 120 320 (grd) Ihmsen [11] SPH, Dffuse partcles +++ ++ 3.5M (SPH) + 7M (Dffuse) Our Method SPH, PLS-LBM ++ +++ 300 K (SPH) + 150 150 150 (grd) ther. Flud sold couplng methods shall also be evaluated wthn our hybrd partcle grd framework, as there are both partcles and cells n the smulaton whch would make flud sold couplng much more challengng. Extendng ths method to smulate the large-scale dsaster scenes also deserves mmedate nvestgaton. Acknowledgements Ths paper was partally supported by Natural Scence Foundaton of Chna (Grant Nos. 61070128, 61272199), Natonal Natural Scence Foundaton of Chna (Grant Nos. 61190120, 61190121, and 61190125) and Natonal Scence Foundaton of USA (Grant Nos. IIS0949467, IIS1047715, and IIS1049448), Innovaton Program of the Shangha Muncpal Educaton Commsson (Grant No. 12ZZ042), Fundamental Research Funds for the Central Unverstes, and Shangha Knowledge Servce Platform for Trustworthy Internet of Thngs (Grant No. ZF1213). References 1. Enrght, D., Marschner, S., Fedkw, R.: Anmaton and renderng of complex water surfaces. ACM Trans. Graph. 21(3), 736 744 (2002) 2. Thuerey, N.: A sngle-phase free-surface Lattce Boltzmann Method. Master thess, Dept. of Computer Scence, Unversty of Erlangen-Nuremberg (2003) 3. Thuerey, N., Rude, U.: Free surface lattce-boltzmann flud smulatons wth and wthout level sets. In: Proceedngs of Workshop on Vson, Modelng and Vsualzaton, Calforna, USA, 2004, pp. 199 207. IOS Press, Amsterdam (2004) 4. Bcknell, G.: The equatons of moton of partcles n smoothed partcle hydrodynamcs. SIAM J. Sc. Stat. Comput. 12(5), 1198 1206 (1991) 5. Irvng, G., Guendelman, E., Losasso, F.: Effcent smulaton of large bodes of water by couplng two and three dmensonal technques. ACM Trans. Graph. 25(3), 805 811 (2006) 6. Thuerey, N., Rude, U., Stammnger, M.: Anmaton of open water phenomena wth coupled shallow water and free surface smulatons. In: Proceedngs of ACM SIGGRAPH/Eurographcs Symposum on Computer Anmaton, pp. 157 164 (2006) 7. Thuerey, N., Rude, U.: Stable free surface flows wth the lattce Boltzmann method on adaptvely coarsened grds. Comput. Vs. Sc. 12(5), 247 263 (2009) 8. Solenthaler, B., Gross, M.: Two-scale partcle smulaton. ACM Trans. Graph. 30(4), 81:1 81:8 (2011) 9. Chentanez, N., Muller, M.: Real-tme smulaton of large bodes of water wth small scale detals. In: Proceedngs of ACM SIGGRAPH/EUROGRAPHICS Symposum on Computer Anmaton, pp. 197 206 (2010) 10. Losasso, F., Talton, J., Kwatra, N.: Two-way coupled SPH and partcle level set flud smulaton. IEEE Trans. Vs. Comput. Graph. 14(4), 797 804 (2008) 11. Ihmsen, M., Aknc, N., Aknc, G., Teschner, M.: Unfed spray, foam and bubbles for partcle-based fluds. Vs. Comput. 28(6 8), 669 677 (2012) 12. Jang, G., Peng, D.: Weghted Eno schemes for Hamlton Jacob equatons. SIAM J. Sc. Comput. 21(6), 2126 2143 (1997) 13. Enrght, D., Fedkw, R., Ferzger, J., Mtchell, I.: A hybrd partcle level set method for mproved nterface capturng. J. Comput. Phys. 183(1), 83 116 (2002) 14. Sethan, J.: Fast marchng methods. SIAM Rev. 41(2), 199 235 (1999) 15. Adalstensson, D., Sethan, J.A.: The fast constructon of extenson veloctes n level set methods. J. Comput. Phys. 148(1), 2 22 (1998) 16. Adalstensson, D., Sethan, J.A.: A fast level set method for propagatng nterfaces. J. Comput. Phys. 118(2), 269 277 (1995) 17. Enrght, D., Losasso, F., Fedkw, R.: A fast and accurate sem- Lagrangan partcle level set method. Comput. Struct. 83(6 7), 479 490 (2005) 18. Kwak, Y., Kuo, C.C.J., Nakano, A.: Hybrd lattce-boltzmann/ level-set method for lqud smulaton and vsualzaton. Int. J. Comput. Sc. 3(6), 579 592 (2009) 19. Becker, M., Teschner, M.: Weakly compressble SPH for free surface flows. In: Proceedngs of ACM SIGGRAPH/Eurographcs Symposum on Computer Anmaton, pp. 209 217 (2007) 20. Flppova, O., Hanel, D.: Grd refnement for lattce-bgk models. J. Comput. Phys. 147(11), 219 228 (1998) 21. Muller, M., Charypar, D., Gross, M.: Partcle-based flud smulaton for nteractve applcatons. In: Proceedngs of ACM SIG- GRAPH/Eurographcs Symposum on Computer Anmaton, pp. 154 159 (2003) Chang-bo Wang s a Professor of Software Engneerng Insttute, East Chna Normal Unversty, P.R. Chna. He receved hs Ph.D. degree at the State Key Lab of CAD&CG, Zhejang Unversty n 2006, and receved B.E. degree n 1998 and M.E. degree n Cvl Engneerng n 2002, respectvely, both from Wuhan Unversty of Technology. Hs research nterests nclude physcally based modelng and renderng, computer anmaton and realstc mage synthess and nformaton vsualzaton.

Hybrd partcle grd flud anmaton wth enhanced detals 947 Qang Zhang s a graduate student of Software Engneerng Insttute, East Chna Normal Unversty, P.R. Chna. He receved hs B.E. degree n Mathematcs & Appled Mathematcs from Zhejang Unversty of Technology. Hs research nterests are physcally based smulaton and dgtal entertanment. Fan-long Kong s a graduate student of Software Engneerng Insttute, East Chna Normal Unversty, P.R. Chna. He receved hs B.E. degree n computer scence from Central Chna Normal Unversty. Hs research nterest s flud smulaton based on physcs. Hong Qn s a Full Professor of Computer Scence n Department of Computer Scence at State Unversty of New York at Stony Brook (Stony Brook Unversty). He receved hs B.Sc. (1986) degree and hs M.Sc. degree (1989) n Computer Scence from Pekng Unversty n Bejng, Chna. He receved hs Ph.D. (1995) degree n Computer Scence from the Unversty of Toronto. Hs research nterests nclude computer graphcs, geometrc- and physcs-based modelng, computer-aded desgn, computer-aded geometrc desgn, computer anmaton and smulaton, vrtual envronments and vrtual engneerng.