Towards Large Fluid Animation using Shallow Water and Navier-Stokes Simulation with SPH

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

Hermite Splines in Lie Groups as Products of Geodesics

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

Parallelism for Nested Loops with Non-uniform and Flow Dependences

A Fast Visual Tracking Algorithm Based on Circle Pixels Matching

S1 Note. Basis functions.

2x x l. Module 3: Element Properties Lecture 4: Lagrange and Serendipity Elements

Scan Conversion & Shading

A Binarization Algorithm specialized on Document Images and Photos

SLAM Summer School 2006 Practical 2: SLAM using Monocular Vision

Scan Conversion & Shading

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

Mathematics 256 a course in differential equations for engineering students

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

Dynamic wetting property investigation of AFM tips in micro/nanoscale

Lecture #15 Lecture Notes

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

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

High-Boost Mesh Filtering for 3-D Shape Enhancement

An inverse problem solution for post-processing of PIV data

Some Tutorial about the Project. Computer Graphics

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

Complex Deformable Objects in Virtual Reality

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

Computer Animation and Visualisation. Lecture 4. Rigging / Skinning

Wavefront Reconstructor

REFRACTION. a. To study the refraction of light from plane surfaces. b. To determine the index of refraction for Acrylic and Water.

An Optimal Algorithm for Prufer Codes *

An Accurate Evaluation of Integrals in Convex and Non convex Polygonal Domain by Twelve Node Quadrilateral Finite Element Method

Reading. 14. Subdivision curves. Recommended:

Quality Improvement Algorithm for Tetrahedral Mesh Based on Optimal Delaunay Triangulation

Determining the Optimal Bandwidth Based on Multi-criterion Fusion

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

THE PULL-PUSH ALGORITHM REVISITED

Cloth Simulation. Burak Ertekin i MSc Computer Animation and Visual Effects

Multiblock method for database generation in finite element programs

Support Vector Machines

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

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

Modeling of Airfoil Trailing Edge Flap with Immersed Boundary Method

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

High resolution 3D Tau-p transform by matching pursuit Weiping Cao* and Warren S. Ross, Shearwater GeoServices

Cluster Analysis of Electrical Behavior

Module Management Tool in Software Development Organizations

Simulation and Animation of Fire

User Authentication Based On Behavioral Mouse Dynamics Biometrics

An Application of the Dulmage-Mendelsohn Decomposition to Sparse Null Space Bases of Full Row Rank Matrices

Hybrid particle grid fluid animation with enhanced details

Image Representation & Visualization Basic Imaging Algorithms Shape Representation and Analysis. outline

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

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

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

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

Problem Definitions and Evaluation Criteria for Computational Expensive Optimization

Parallel matrix-vector multiplication

Analysis of 3D Cracks in an Arbitrary Geometry with Weld Residual Stress

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

Proper Choice of Data Used for the Estimation of Datum Transformation Parameters

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

Learning the Kernel Parameters in Kernel Minimum Distance Classifier

Classifier Selection Based on Data Complexity Measures *

An Iterative Solution Approach to Process Plant Layout using Mixed Integer Optimisation

Smoothing Spline ANOVA for variable screening

Lecture 5: Multilayer Perceptrons

VISUAL SELECTION OF SURFACE FEATURES DURING THEIR GEOMETRIC SIMULATION WITH THE HELP OF COMPUTER TECHNOLOGIES

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

A Fast Content-Based Multimedia Retrieval Technique Using Compressed Data

Load Balancing for Hex-Cell Interconnection Network

3D vector computer graphics

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


Automatic selection of reference velocities for recursive depth migration

Kiran Joy, International Journal of Advanced Engineering Technology E-ISSN

APPLICATION OF A COMPUTATIONALLY EFFICIENT GEOSTATISTICAL APPROACH TO CHARACTERIZING VARIABLY SPACED WATER-TABLE DATA

Edge Detection in Noisy Images Using the Support Vector Machines

Line Clipping by Convex and Nonconvex Polyhedra in E 3

Vibration Characteristic Analysis of Axial Fan Shell Based on ANSYS Workbench

SPH Method used for Flow Predictions at a Turgo Impulse Turbine: Comparison with Fluent

An Image Fusion Approach Based on Segmentation Region

A fast algorithm for color image segmentation

Fluid Animation with Dynamic Meshes

Solving two-person zero-sum game by Matlab

Shape Representation Robust to the Sketching Order Using Distance Map and Direction Histogram

Computer models of motion: Iterative calculations

University of Groningen. Point-Based Visualization of Metaballs on a GPU Kooten, Kees van; Bergen, Gino van den; Telea, Alexandru

A Newton-Type Method for Constrained Least-Squares Data-Fitting with Easy-to-Control Rational Curves

VFH*: Local Obstacle Avoidance with Look-Ahead Verification

Detecting Maximum Inscribed Rectangle Based On Election Campaign Algorithm Qing-Hua XIE1,a,*, Xiang-Wei ZHANG1,b, Wen-Ge LV1,c and Si-Yuan CHENG1,d

Fast Computation of Shortest Path for Visiting Segments in the Plane

A MOVING MESH APPROACH FOR SIMULATION BUDGET ALLOCATION ON CONTINUOUS DOMAINS

Simplification of 3D Meshes

Simulation Based Analysis of FAST TCP using OMNET++

Term Weighting Classification System Using the Chi-square Statistic for the Classification Subtask at NTCIR-6 Patent Retrieval Task

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

IP Camera Configuration Software Instruction Manual

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

Feature Reduction and Selection

NUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS

Sequential search. Building Java Programs Chapter 13. Sequential search. Sequential search

Programming in Fortran 90 : 2017/2018

Transcription:

Unverzta Komenského v Bratslave Fakulta matematky, fyzky a nformatky Mgr. Mchal Chládek Autoreferát dzertačnej práce Towards Large Flud Anmaton usng Shallow Water and Naver-Stokes Smulaton wth SPH na získane akademckého ttulu phlosophae doctor v odbore doktorandského štúda: Informatka

Dzertačná práca bola vypracovaná v dennej forme doktorandského štúda na Fakulte Matematky, fyzky a nformatky Unverzty Komenského Predkladatel : Školtel : Mgr. Mchal Chládek Fakulta Matematky, fyzky a nformatky Unverzta Komenského Mlynská dolna 842 48 Bratslava prof. RNDr. Roman Ďurkovč, PhD. Fakulta Matematky, fyzky a nformatky Unverzta Komenského Mlynská dolna 842 48 Bratslava

1 Introducton 3 1 Introducton Flud flow s a very common phenomena n the real world and therefore the applcaton range of flud smulaton s very broad. There are hgh qualty and physcally realstc smulatons on one sde whle there are smplfed and fast solutons on the other sde. Our am s to smulate large masses of water. Therefore, n the thess we mprove the fast and smplfed soluton and we concentrate on large-scale smulatons. We have chosen smoothed partcle hydrodynamcs as the smulaton method, whch s a Lagrangan, partcle-based smulaton method. Usng smoothed partcle hydrodynamcs we solve Naver-Stokes equatons as well as shallow water equatons. Our goal s to mprove the exstng methods and overcome the drawbacks and lmtatons of the exstng methods. In dong so we mprove the shallow water smulaton n several ways. We couple shallow water smulaton wth 3D flud smulaton and propose a novel surface reconstructon algorthm. 2 Solvng Shallow Water Equatons Usng SPH Instead of the Naver-Stokes equatons, a smplfed verson called shallow water equatons (SWE) can be used for descrbng the flud moton. The SWE reduce the threedmensonal problem of flud moton to two dmensons usng a heght-feld descrpton. Assumng an ncompressble and nvscd flow the SWE are derved from Naver-Stokes equatons and n Euleran form can be wrtten as η + v η = η v, t v + v v = g h, t (1) where t s the tme, v s the velocty of the flud n the horzontal plane, g s the vertcal gravty acceleraton, η s the heght of the flud above ground, and h s the heght of the flud above zero-level (see Fgure 1). Transformng the SWE equatons nto Lagrangan form f the ground depth s not consdered we get Dv Dt h = g h, (2) Fgure 1: Depcted flud heght: η s heght above ground and h s heght above zero level. η h h p Fgure 2: Example confguraton of shallow water SPH partcles. A 1-dmensonal case s shown. Partcle move only n horzontal drecton. If partcles get closer the resultng flud heght ncreases. Dh = h v. (3) Dt These equaton can be solved usng SPH as proposed n [6]. Frst, the partcles from standard SPH, whch have a constant mass, are transformed to 2D partcles havng a constant densty ρ c and a constant volume V = m/ρ c. The partcles are movng only n the horzontal drecton. If they get close together the flud heght ncreases and on the contrary f they get apart the flud heght decreases. Example of such partcle confguraton can be found n Fgure 2. Analogously to the densty n the three-dmensonal SPH solvng Naver-Stokes equaton the heght of the flud s determned by the dstrbuton of the partcles. Therefore, the SPH heght approxmaton of the flud s defned as h = N V j W (x x j, h). (4) j=0 Wth ths analogy the approxmaton of functon f at pont x becomes f(x) = N j=0 V j f(x j ) h j W (x x j, h). (5) The dervatves are expressed n a smlar fashon. Havng these approxmatons we can rewrte Equaton 2 nto Dv Dt = g N V j W (x x j, h). (6) j=0 Although the SWE assume an nvscd flow the vscosty s added to damp and thus stablze the smulaton. To add the vscosty nto the smulaton Equaton 2 s altered to Dv Dt = g h + ν 2 v (7) and the vscosty term s approxmated as Dv vsc = ν Dt N j=0 V j v j h j 2 W (x x j, h). (8) x

3 Proposed Modfcaton of Shallow Water SPH 4 3 Proposed Modfcaton of Shallow Water SPH Although a realstc flud moton can be acheved usng Equatons 4, 6, and 8, varous problems arse n the smulaton. In the case of shallow water SPH oscllatons n the heght feld occur. Hgh errors arse from the heght computaton near the boundares because of the partcle defcency. If a part of the partcle neghborhood s not flled wth partcles the summaton s done over less partcles and thus lower flud heghts are ganed usng Equaton 4. Smlar problems mght be observed n the smulaton of Naver-Stokes equatons where the computaton of the densty feld s mproved by Shepard flter (e.g. by Panzzo [11] or Aknc et al. [1]). The kernel Wj 3d used n the computaton of densty s normalzed and changed to W 3D j = j Wj 3D m j ρ j Wj 3D. (9) Such soluton s easy to mplement and greatly mproves the SPH smulaton n terms of accuracy. It s wdely used n 3-dmensonal SPH smulaton and can be exploted n the shallow water smulaton as well. The kernel used n Equaton 4 s changed by applyng Shepard flter to W j = W j V j. (10) j h j W j Fgure 3: Comparson of heght felds at the same tmestep. In the top mage, the heght feld computed wthout usng the Shepard flter s shown. In the bottom mage, the heght feld computed usng the Shepard flter s shown. A decrease of the flud heght near the boundares and oscllatons n the heght feld can be observed n the top mage. M s symmetrc and can be computed n 3 summatons Smlar errors arse n the computaton of the gradent. Unfortunately, the Shepard flter cannot be appled to the computaton of the gradent; nstead, an alternatve approach that nvolves computaton and nverson of a matrx must be used. Ths approach s not usually consdered n computer graphcs because t s computatonally expensve for 3D smulatons. Because of the 2D nature of the shallow water smulaton, we were able to use ths method wth acceptable computatonal overhead. We used a corrected kernel Wj n the computaton of Equaton 6: W j = L W j, (11) W j = M 1 W j, (12) M = V j W j ( ) p h p j, j j (13) where M s defned usng the outer product. The matrx M (1, 1) = j M (2, 2) = j M (1, 2) = M (2, 1) = j V j h j W j (x x j ) 2, (14) V j h j W j (y y j ) 2, (15) V j h j W j (x x j ) (y y j ). (16) Note that matrx L s the dentty matrx except for the locatons where partcle s near a boundary or n areas wth rregular samplng. Thus, the correcton s appled only n such cases. Because M s 2 2 matrx the nverse can be smply computed as: ( ) L =M 1 M (2, 2) M = det(m ) (1, 2) M (2, 1) M (1, 1) 1 L = M (1, 1) M (2, 2) M (1, 2) M (2, 1) ( M (2, 2) ) M (1, 2) M (2, 1) M (1, 1) (17)

4 Proposed Boundary Handlng for Shallow Water SPH 5 4 Proposed Boundary Handlng for Shallow Water SPH Boundary handlng s a crucal part of the flud smulaton. To get a realstc flud moton boundares have to be taken nto account. Boundares n the real world have often f terran very complex and rregular shape. If we consder a 3- pb pj p dmensonal flud smulaton, the problem s well studed n the lterature. In the area of shallow water SPH smulaton, lttle attenton has been pad to solve ths problem. In [13], repulson forces were used to handle sold boundares. Fgure 4: Terran forces actng on the partcle p. The flud partcles Although the repulson forces depend on the dstance from are depcted n black, and the boundary partcle s depcted n red. In case of partcle p the boundary, the fact that the pressure forces n the, only terran forces f terran are appled on the partcle. In case of partcle p j, partcle p b s used to compute the flud depend on the flud heght s not consdered. The boundary force and no terran force s appled. pressure forces lnearly depend on the flud heght. In order to prevent that the partcles cross the boundares we need to counteract the pressure forces n the flud. The boundary partcle p b s used n the force computaton, Another problem of the repulson forces s ts computatonal Equaton 21, nstead. The summaton from Equaton 6 expensveness. Complex boundary shapes are dffcult a s changed by the ntroducton of boundary partcles and expensve to handle usng repulson forces. notng that A b h = V b to f pressure = g V j W j + A b h W b, j F lud (21) where A b s the area of a partcle b. The area can be computed from the dstrbuton of the neghborng partcles. Assumng a constant volume of partcles, we get A method samplng boundares by partcles was proposed n [17]. Vrtual partcles were generated along boundares and used n the SPH summaton. Vrtual partcles were generated every tmestep whch s computatonally expensve. Ths makes t unsutable for our use because we am for fast smulaton. Instead we combne terran forces wth boundary partcles whch are generated before the start of the smulaton or when a resamplng s needed because of the changed shape of the boundary. To compute realstc flud moton, the terran underneath the flud has to be taken nto account. To do ths, we ncorporate the terran heght H nto Equaton 6 and obtan f p = g (h + H ). (18) Usng the formulaton from Equaton 18, we can express the terran forces that act on a sngle partcle as f p = g h g H = f pressure + f terran, (19) f terran = g H. (20) To evaluate f terran, we represent the terran by a heght map and compute the gradent usng forward dfferences. The terran heght and computed gradent are then nterpolated to the partcles. Very large forces may arse from Eq. 20 for a partcle that s close to steep terran slopes. To handle steep or vertcal boundares, we sample the boundares wth partcles and use them n the computaton of the pressure forces. An example confguraton that ncludes the sampled vertcal boundary s llustrated n Fgure 4. To handle the boundary condtons, a force f terran s appled to the partcle p, whle no terran force s appled to partcle p j. A b = V b h = V b j V jw j = 1 j W j. (22) When computng the areas of the boundary partcle, we sum only over the boundary partcles leadng to 1 A b = j boundary W. (23) bj The computaton of the matrx M from Equaton 13 s easly extended to the boundary partcles because only the area of the partcles A s needed n the computaton: M = V j W j ( ) p h p j (24) j j nflud + A b W b (p p b ). (25) b boundary The heght computaton s altered to h = h flud + h boundary s, (26) where h flud s the contrbuton of the flud partcles, and h boundary s the contrbuton of the boundary partcles to the total heght of partcle. The denomnator s, see Equaton 31, represents the kernel alteraton that s performed by applyng the Shepard flter. The value h flud s

4 Proposed Boundary Handlng for Shallow Water SPH 6 Fgure 6: Beach scene wth a hlly terran and several obstacles. 70k partcles were used n the smulaton. Terran forces and boundary partcles are combned to acheve the fnal result. Fgure 5: Beach scene wth cylndrcal obstacles captured at dfferent tmesteps. Complex boundary shapes are handled wthout any artfacts and wth small computatonal overhead. evaluated usng Equaton 4. A smple soluton to compute h boundary would be to extrapolate the heght of the flud partcles to the boundary partcles. Ths cannot be done easly because the total flud heght depends on the heght of the boundary partcles as seen from the equaton h boundary = A b h W b. (27) The value h boundary depends on h and vce versa. To compute h boundary, we frst have to elmnate the unknown h n Equaton 27 by substtutng Equaton 26 for h : h boundary = h boundary = h flud s A b h flud + h boundary s W b, + h boundary s (28) A b W b (29) A b W b, h boundary =h A bw b /s flud 1 A. (30) bw b /s We obtan the expresson for s by applyng the Shepard flter to Equaton 26: s = j F lud V j h W j + V b h boundary b W b. (31) To avod recurson, we evaluate the heght h n Equaton 31 wthout usng the Shepard flter. Usng ths smplfcaton, s s computed as s = j F lud V j h flud + h bound W j + A b W b, (32) where bound dffers from boundary (Equaton 27) n the use of the Shepard flter. Therefore, h bound can be evaluated as h bound = A b (h flud + h bound ) W b, (33) h bound = h A bw b flud 1 A. (34) bw b The flud heght h can be computed effectvely n two sweeps. Frst, the sum A bw b and value h flud (Equaton 4) are computed. Second, the value s (Equaton 32) s evaluated, and the computed values are then combned and used to compute h (Equaton 26). If a flud partcle approaches the boundary partcles, the value h flud gets small compared to the value h boundary. Ths results n large errors of h because the value depends manly on the heght of the flud partcles. To avod these errors, we use two approaches. Frst, we decrease the boundary partcle areas by multplyng them by a constant α: h bound = h αa bw b flud 1 αa. (35) bw b By multplyng the partcle areas the denomnator n Equaton 34 s ncreased and thus we avod stuatons where 1 A bw b approaches 0. Value α = 0.9 worked best n our experments.

5 Surface Reconstructon for Shallow Water SPH 7 Second, we employ the repulson force between the flud and the boundary partcles from [8] ( ) 4 f separaton Wb = V V b k W b, W ( p, r) (36) where W ( p, r) s a precomputed kernel value for p = 0.2h, and k s a user-defned constant. In our experments, k = 10 worked well. Instead of extrapolatng the flud heghts to the boundary partcles, we compute V b from Eq. 36 as V b = A b h. (37) 5 Surface Reconstructon for Shallow Water SPH Surface reconstructon s another mportant part of the flud smulaton. To get a vsually appealng result we need to generate a smooth surface. The surface reconstructon has to be done fast to slow down the smulaton as lttle as possble. We explot the mproved results that are ganed from the applcaton of the Shepard flter and defne the surface heght as equal to the flud heght. Although the flud heght produces a bumpless surface, t causes problems n areas where the flud flows nto empty regons; a flat surface s generated nstead of a gradually slopng surface as seen n Fgure 7. A large gap s created between flud surface and the terran. To solve ths problem, we use the dea from [13] and lnearly nterpolate between the unnormalzed heght h that was computed usng Equaton 4 and the normalzed heght h that was computed usng Equaton 30. The surface heght h surface at the poston x s thus defned as h surface (x) = u (x) h (x) + (1 u (x)) h (x). (38) The nterpolaton coeffcent u depends on the heght of the neghborng partcles and on the heght contrbuton of the boundary partcles and s defned based on h (x) h mn (x) ū (x) = h max (x) h f mn (x) h max (x) > h mn (x), 0 f h max (x) = h mn (x) (39) whch s further clamped and the contrbuton of boundary partcles s added to Equaton 39 to mantan flat flud surface n the vcnty of boundares. Ths results n u (x) = clamp ( clamp + 2 ( h (x) hmn (x) h max (x) h mn (x) ) ) A b W (x x b, r), (40) Fgure 7: The surface mesh generated from the surface heght s depcted n the top mage. The surface mesh generated usng the proposed surface defnton s depcted n the mddle mage. The surface mesh wth the adjusted surface heghts s depcted n the bottom mage. The gap between the bottom and the flud surface s resolved whle the surface near the boundary partcles remans unchanged. where the clampng s done to the 0, 1 nterval. The values h mn (x) and h max (x) represent the maxmum and mnmum flud heghts of the partcles n the neghborhood of poston x, and r s the support radus of the smoothng functon W. To generate a trangular mesh that represents the flud surface, we compute a lattce of flud heghts. We mark a lattce pont as flud f the flud heght at the pont s hgher than the terran heght; otherwse, we mark the pont as non-flud. The trangles of the surface mesh are generated only among lattce ponts that are marked as flud. In ths way, the surface mesh s generated only n areas that contan some flud. Based on the resoluton of the lattce, the proposed approach produces gaps between the surface mesh and the terran as seen n Fgure 7. We solve ths problem by settng the flud heght at the flud lattce ponts that have an adjacent non-flud lattce pont to the terran heght. Havng the fnal surface mesh we export the mesh to obj fle. Afterwards, the fle can be mported n almost all anmaton softwares. For our purposes we used 3ds Max.

6 Couplng of Shallow Water and Naver-Stokes Smulaton Usng SPH Fgure 8: Illustraton of couplng of shallow water smulaton and Nave-Stokes smulaton. Shalow water partcles are n the bottom whle the Naver-Stokes partcles are on the top. 6 8 Fgure 9: Surface of 2D flud sampled by partcles. Frst, the lattce of surface heghts, depcted n red, s computed. Afterwards, the surface partcles, depcted n yellow, are sampled to mantan samplng densty,.e. the maxmal dstance between partcles. Couplng of Shallow Water and 6.1 Vertcal Couplng Naver-Stokes Smulaton Usng To keep the 3D partcle on top of the 2D flud we handle the 2D flud surface as a sold boundary n the 3D flud SPH smulaton. For ths purpose we need a smooth surface Although a lot of work has been done n the area of flud smulatons a full 3D flud smulaton solvng Naver-Stokes equatons s stll computatonally very expensve. Although a few real-tme solutons have been proposed (e.g. [7]), they are stll too expensve for practcal use n nteractve applcatons. Therefore, attenton s pad to smplfed soluton lke shallow water equaton. Such smplfcatons lead to lmtatons. Usng a heghtfeld to smulate flud flow does not allow for splashes or overturnng waves. Wthout such natural phenomena the flud does not look realstc. Therefore, several soluton how to sort ths problem out have been proposed. Flud sheets, n [15], and splash partcles, n [2], were added to the smulaton. A 3D flud smulaton was coupled wth a heghtfeld smulaton n [3] and [4]. wthout gaps along the boundares. The flud heght defnton proposed n Secton 3 satsfes ths condtons and worked n our tests. We preferred t over the surface defnton proposed n Secton 5 because the surface heght s less expensve to compute. Frst, we compute a regular lattce of surface heght wth dstance between lattce ponts equal to half of support radus used n the 3D flud smulaton. Afterwards, we sample surface partcles n every cell by blnearly nterpolatng the lattce heghts. Samplng densty n horzontal drecton s chosen to mantan a maxmal dstance between partcles. Maxmal dstance less than half of the support radus used n the smulaton was suffcent. Thereby the samplng densty s mantaned ndependently of the surface normal. The sampled surface partcles are then ncorporated nto IISPH computaton. Example of such samplng can be In ths chapter we propose a couplng of two SPH smfound n Fgure 9. ulatons. One smulaton solvng Shallow water equatons Because the 2D flud surface s movng we have to take and the second one solvng Naver-Stokes equatons. The nto account the surface partcle veloctes as well. We shallow water smulaton s used to smulate the man volcompute the veloctes from the dfference of the surface ume of the flud whle the Naver-Stokes smulaton s used to capture surface detals, splashes, or waves. Therefore, heghts between two tmesteps. To do ths computaton n the Naver-Stokes smulaton wll be on top of the shallow one tmestep of coupled SPH we nterleave the update of water smulaton, lke n Fgure 8. We wll address the 2D SPH wth the 3D SPH as descrbed n Algorthm 1. We generate the surface partcles n lne 2 based on the shallow water flud and Naver-Stokes n the further text surface heghts computed n lne 1. The surface partcle as 2D flud and 3D flud, respectvely. We dvde the couplng nto two parts. In the frst part, heghts are then update n lne 22, and the veloctes of we handle the vertcal couplng, by whch we keep the 3D surface partcles are computed from the dfference of the partcles on the top of the 2D flud. In the second part, heghts n lne 23. The computed veloctes are fnally used we handle the vertcal couplng, by whch we transfer the n the IISPH computaton of pressure forces n lne 26. The result of vertcal couplng can be seen n Fgure 11, where vertcal forces between the 3D and 2D flud. a layer of 3D partcles s on top of the 2D flud.

6.2 Horzontal Couplng 9 6.2 Horzontal Couplng To algn and couple the movement of the 2D flud wth the movement of the 3D flud we nterpolate veloctes form the 2D flud to the 3D flud and vce versa. To nterpolate the veloctes we explot the SPH approxmaton. To every 2D partcle a 3D poston (x, y, h ) s assgned, where (x, y ) s the poston of partcle, and h s the heght of flud at the poston of partcle. Havng the 3D poston assgned every 2D partcle s taken as a 3D partcle when nterpolatng veloctes. The nterpolated velocty v nterpolate2d from 3D flud to the -th 2D partcle s defned as v nterpolate2d = j λ mj ρ j v horzontal,j W j j m j, (41) ρ j W j where λ s a parameter compensatng dfference of mass between 2D and 3D partcles and wll be descrbed later n more detals. Velocty v horzontal,j s the horzontal part of the velocty of 3D partcle j. The neghborng 3D partcles over whch we sum n Equaton 41 are defned as neghbors n 3D flud,.e. partcles wthn dstance h from partcle. A gap between flud and sold objects appears f the solds are sampled wth partcles. Such gap can be therefore observed between the 3D flud and the 2D flud. Ths gap s approxmately the rest dstance d 0 : The neghbors over whch we sum n Equaton 43 are partcles wthn dstance h from partcle whle we work wth the assgned 3D postons of the 2D flud partcles. Wth the acqured nterpolated veloctes we update the veloctes of the respectve partcles by lnearly nterpolatng between actual velocty v of partcle and nterpolated velocty v nterpolate of partcle : v = (1 t)v + tv nterpolate, (45) where t s the nterpolaton coeffcent whch determnes the strength of the nfluence between the 2D and the 3D flud. The value of t s dependent on the tmestep used n the smulaton. Value t = 70 t worked best n our test scenes. Applyng the nterpolated veloctes works the same way for the 3D and the 2D flud. Therefore, velocty v nterpolate or v nterpolate3d n Equaton 45 can be replaced by v nterpolate2d based on the flud we are workng wth. The change of velocty n Equaton 45 s affectng the knetc energy of the system. The masses of the 2D and 3D flud whch are affected by ths change are dfferent. Therefore, the knetc energy of the system would change after the velocty nterpolaton. To mnmze the change of knetc energy we multply the nterpolated velocty by a computed value λ whch compensates the dfference n mass between the 2D and the 3D flud. The knetc energy E 2D of a partcle havng velocty v 2D n the 2D flud s d 0 = 3 m ρ 0, (42) whch s a dstance between 3D flud partcles n rest state. Because of ths gap the 2D partcles have only a small number of neghbors that s nsuffcent to for accurate nterpolaton. To solve ths problem we lower the heght n the computed lattce by d 0. Ths lowerng brngs the 3D flud lower and removes the gap between the 2D and the 3D flud. If we nterpolate form 2D flud to the 3D flud the nterpolated velocty v nterpolate3d of partcle s defned n smlar fashon to Equaton 41. Instead of summng over 3D partcles we sum over 2D partcles whch leads to defnton: v nterpolate3d = j 1 V j λ h j v extended,j W j j V j, (43) h j W j where v extended,j s the horzontal velocty of partcle j extended by a vertcal velocty to get a 3-dmensonal velocty and v extended,j = (v x,j, v y,j, v z,j ). We computed the vertcal velocty v z,j from the dfference of heghts of partcle j between tmesteps: v vertcal,j = h j(t) h j (t t). (44) t E 2D = V ρ 0 v 2 2D, (46) where V s the volume of a 2D partcle, and ρ 0 s the rest densty of the flud. Knetc energy E 3D of a partcle havng velocty v 3D n 3D flud s E 3D = mv 2 3D, (47) where m s mass of a 3D partcle. To ensure that the 3D partcle has the same knetc energy as the 2D partcle Therefore, E 2D = E 3D, (48) V ρ 0 v 2 2D = mv 2 3D, (49) m v 2D = V ρ v 3D. (50) λ = m V ρ, (51) whch s then used n Equatons 41 and 43. 6.3 Convertng Pressures Untl now we have consdered only a one way vertcal couplng between the 2D and the 3D flud. To acheve a two-way vertcal couplng we have to take nto account the layer of the 3D partcles when smulatng the 2D flud. We

6.4 Surface Reconstructon 10 enforce the couplng by transformng the pressures from 3D flud to heghts and volumes n the 2D flud. Thereby, we alter the evaluaton of pressure acceleratons of the 2D flud from Equaton 6 by addng volume Vj : X Dv = g (Vj + Vj ) W (x xj, h), (52) Dt j where Vj = Aj hj. Therefore, the transformng can be comprehended as transformng of the 3D flud pressure forces to 2D flud pressure forces. Ths transformaton captures the force by whch the 3D flud presses on the 2D flud. To compute h we frst nterpolate pressures from the 3D flud to the 2D flud n smlar fashon to the nterpolaton of horzontal veloctes. For a 2D partcle the nterpolated pressure pnterpolate s computed as P mj j λ ρ pj Wj nterpolate p = P mjj. (53) j ρj Wj Afterwards, we convert the nterpolated pressures to heght dfference h. The converson s defned as! Fgure 10: Three dfferent tmesteps of a drop fallng nto an pnterpolate p rest hlayer, (54) aquarum wth water. Full 3D smulaton s on the left whle a h = 1 + αprest coupled smulaton s on the rght. 65779 partcles were used for a full 3D smulaton whle only 15319 3D and 6400 2D partcles were used for the coupled smulaton. where hlayer s the default thckness of the layer of 3D partcles and α s a user defned parameter determnng the strength of nfluence of the 3D pressures on the 2D flud. horzontal(x) = (x1, x2 ) and heght(x) = x3. The 2D Value α = 5 worked best n our test scenes. The pressure flud s then defned as zero level set of φ2d. value prest s the average of the nterpolated pressures from We defne the combned surface as zero level set of the a layer of 3D partcles wth thckness hlayer n rest state. Therefore, f a layer of 3D partcles of thckness hlayer stays maxmum of φ2d and φ3d : n rest state on top of the 2D flud: h = hlayer. The value φcoupled (x) = max (φ2d (x) + φ3d (x)). (56) prest s precomputed from a test scene and t s suffcent to do ths computaton once durng parameter tunng. 6.5 6.4 Surface Reconstructon To get the surface of the coupled flud we combne the surface of the 2D flud wth the surface of the 3D flud. We use the surface defnton from [10] for the surface reconstructon of the 3D flud whch s defned as zero level set of functon φ3d. The functon φ3d s an mplct dstance based functon. We explot the surface defnton from Equaton 38 to defne the 2D flud surface. Frst, we defne an mplct dstance based functon: h (horzontal(x)) heght(x) φ2d (x) =, r (55) where h s the surface heght defned n Equaton 38, horzontal(x) s the horzontal part of the poston x, heght(x) s the heght of poston x, and r s the support radus used n the smulaton. If x = (x1, x2, x3 ) then Smulaton Overvew The overvew of the whole smulaton step s gven n Algorthm 1. The 3D flud s updated n one tmestep of the coupled flud. Frst, on lnes 3 to 8 the neghbors are searched for and all forces except pressure force are evaluated. Afterwards, on lnes 24 to 28 the pressures are computed usng IISPH usng the generated surface partcles. The pressure forces are evaluated based on the computed pressures and the 3D flud s ntegrated over tme usng Euler-Cromer ntegraton. The update of 2D flud s dvded nto two tmesteps of coupled flud. In the frst tmestep the neghbors are searched and the areas and heghts of the 2D flud partcles are evaluated on lnes 18 to 21. In the next tme step the acceleratons n the flud are computed on lne 15. Fnally, the 2D flud s ntegrated over tme on lne 17. Havng the update of 2D flud dvded nto two tmesteps

7 Colored Marchng Tetrahedra 11 Algorthm 1: Coupled SPH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 generate lattce of surface heghts; generate surface partcles; foreach partcle3d do fnd 3D flud neghbors N3D ; compute 3D flud densty ρ ; compute external 3D flud forces fexternal ; vscosty compute vscous 3D flud forces f ; end nterpolate veloctes between 3D and 2D flud ; // Equatons 41 and 43 apply nterpolated veloctes ; // Equaton 45 nterpolate pressures from 3D flud ; // Equaton 53 foreach partcle2d do compute heghts h ; // Equaton 54 compute volumes V ; compute 2D force f ; // Equaton 6 end ntegrate 2D flud over tme; foreach partcle2d do fnd 2D flud neghbors N2D ; compute 2D flud heghts h ; // Equaton 4 end update lattce of surface heghts; compute surface partcle veloctes; foreach partcle3d do compute 3D flud pressures usng IISPH p ; compute 3D flud pressure forces fpressure ; end ntegrate 3D flud over tme; generate flud surface mesh; Fgure 11: Impact of the use of 3D pressures n the 2D flud smulaton. On the left s the smulaton wthout the 3D pressures and on the rght s the smulaton wth the 3D pressures converted to volumes. 7 Colored Marchng Tetrahedra The most wdely used approach to surface reconstructon s we need an ntalzaton of 2D flud before the smulaton to generate a trangular mesh. Such approach has several starts. Durng the ntalzaton t s suffcent to fnd the advantages. The result can be stored and post-processed neghbors of the partcles n the 2D flud and to compute afterwards. Because trangular mesh s a very common ther heghts. representaton, t can be mported nto most 3D anmaton The couplng s done on several lnes. Frst, a lattce softwares and renderers or vsualzed n real tme usng a of surface heghts s computed on lne 1 and then the GPU. The surface mesh can be used for smulaton purposes surface partcles are generated on lne 2. Before the 2D as well, lke computng surface tenson n [18]. flud s ntegrated over tme we enforce the horzontal The surface of a mesh s usually represented by an couplng on lne 10 by nterpolatng the veloctes usng mplct functon [9, 14, 10]. To generate a mesh from the Equatons 41 and 43. The nterpolated veloctes are mplct functon Marchng Cubes algorthm s generally then appled usng Equaton 44. Afterwards, the 3D flud used. The Marchng Cubes algorthm s easy to mplement pressures are nterpolated to 2D partcles on lne 11. The but the resultng surface has several problems. The fxed nterpolated pressures are then used to compute heght grd used n the algorthm cause large step changes n the and volume dfferences on lnes 13 and 14. After the 2D reconstructed mesh when the flud surface moves through flud s ntegrated over tme we compute the dfference n the grd. The reconstructed surface s blocky f the grd s surface heght and update the lattce of surface heghts under-resolved. There s no clear relaton between the flud and compute the vertcal veloctes of surface partcles on partcles and the surface trangles, therefore the surface lnes 22 and 23, respectvely.

7.1 Ar Partcle Generaton 12 Category 4 Category 3-1 Category 2-2 Category 2-1-1 Category 1-1-1-1 Fgure 12: Fve categores of tetrahedrons created n the process of surface reconstructon and the respectve geometry created n 3D. Fgure 13: Comparson of a surface created usng marchng cubes algorthm on the left and a surface created usng the marchng tetrahedra method on the rght. 15625 flud partcles were used n the smulaton. Mesh smoothng was appled on the surface generated usng marchng tetrahedra n post processng. Both surfaces are vsually smlar. 8 Surface Generaton s usually not advected wth the flow but reconstructed every frame. Ths makes the trackng of surface propertes naccurate. We propose a new method to generate a trangular surface mesh whle explotng Delaunay tetrahedralzaton. Only the surface between fluds s reconstructed. Therefore, a mult-flud scenaro consstng of partcle clouds that are clearly marked and dstngushed, for example by a color ndex, are needed as the nput. In the case of a sngle-flud smulaton, where ar s treated as vacuum the ar partcles have to be generated (Secton 7.1) n order to get at least two partcle clouds for surface reconstructon. Afterwards, a Delaunay Tetrahedralzaton s created whch s then used to generate the flud surface (Secton 8). 7.1 Ar Partcle Generaton To reconstruct the surface resultng from a sngle flud dynamc smulaton usng our Colored Marchng Tetrahedra algorthm the ar partcles have to be generated. We generate only a sngle layer of ar partcles around the flud. Another layer s not needed for the reconstructon and would only enlarge the memory consumpton as well as ncrease the computaton tmes by ncreasng the number of nput partcles for the tetrahedralzaton. Frst, spheres were generated around each flud partcle close to the surface. Second, the ar partcles were evenly sampled on spheres. Partcle was generated only f the resultng densty on the sampled place was lower than a defned threshold. A threshold value 1.5 tmes larger than the rest densty of the flud was used n our experments. In ths way the ar partcles were sampled around the flud n a suffcent way for our purposes. Havng a mult-flud smulaton, a process smlar to Marchng Tetrahedra [16] s used to generate flud surface from the tetrahedralzaton of flud partcles. Vertexes of every tetrahedron are marked by a flud ndex. Based on the flud to whch these partcles belong the geometry nsde every tetrahedron s created. The possble combnatons of dfferent flud partcles can be dvded nto several categores as s shown n Fgure 12. Category 4 (all partcles belong to the same flud): A trval case where no trangles are created and thus ths case can be rejected from the computaton. Category 3-1 (exactly 3 partcles belong to the same flud): A sngle trangle between the fluds s created, formed by the three mddle ponts of the bchromatc edges. Category 2-2 (two pars of partcles belongng to the same flud): Two trangles are created, formed by four mddle ponts of bchromatc edges Category 2-1-1 (exactly two partcles belong to the same flud): 5 mddle ponts of bchromatc edges and two centers of faces have to be computed. These computed ponts form 5 trangles as shown n Fgure 12. Category 1-1-1-1 (each partcle belongs to a dfferent flud): Mddles of every edge as well as centers of every face and the center of the tetrahedron have to be computed. These computed pont from 6 quadrlaterals and thus 12 trangles as shown n Fgure 12. To generate a mesh better representng the flud surface, nstead of mddle ponts we use the ponts on the tetrahedron edges where the level set s equal to zero. Thereby we create a mesh wth vertces on the flud surface. To fnd the pont on the edges where level set s equal to zero we bsect the edges untl the level set s close enough to zero.

9 Results 13 Fgure 14: 3 mmscble flud are mxed together. The fnal surface s reconstructed wthout computng a combned sofuncton. 9 Results The advantage of usng the Shepard flter for the heght computaton can be seen n Fgure 3. The kernel correcton mnmzes the oscllatons n the heght feld. In the top mage n Fgure 3 the surface heght oscllates producng artfacts on the flud surface. In the bottom mage n Fgure 3 the proposed mprovement to the densty computaton reduced the oscllatons and artfacts from the top mage. A smooth surface was generated. The dfference that results from the use of the normalzaton n Equaton 30 near the boundares s also notable. Wthout the use of the Shepard flter, the flud heght near the boundares decreases, generatng a gap between flud surface and boundary. A a flat surface s produced f the Shepard flter s employed. Less dsspaton can be observed n the smulaton that uses the corrected gradent. As shown n Fgure 5, whch shows two tmesteps of the smulaton, our method can handle complex boundary domans. The boundary condtons that are mposed by the cylndrcal obstacles n the scene are correctly handled whle addng only small computatonal overhead compared to a beach scene that does not contan the obstacles. In Table 1, the tmes of the smulaton wth the proposed boundary handlng are gven. The man reason for the dfference n the smulaton tmes s the dfferent samplng denstes. The flud s dscretzed by the same number of partcles whle occupyng a larger area. Because of the constant support radus, the flud partcles have more neghbors and the summaton s done over larger number of partcles. Ths leads to hgher computatonal costs. A larger vew on the hlly scene s n Fgure 6. Partcle boundares are combned wth terran forces produced by a complcated bottom. A plausble result s generated wthout any artfact or nstabltes durng the smulaton. Fgure 15: Coupled smulaton of a wave produced by a movng wall. On the left s the reconstructed surface whle on the rght are the partcles used for the smulaton. 3D flud partcles are depcted n blue whle the 2D flud partcles are depcted n whte. The proposed surface defnton generates flat surfaces n regons that are flled wth partcles and n the vcnty of boundary partcles, whle the surface correctly slopes n areas where the flud flows nto empty regons. Ths s clearly shown n Fgure 5 and 7. Flat surfaces can be observed n the areas near the obstacles, whle smooth transtons between the regons that are flled wth partcles and empty regons are vsble. Tmes of the phases of surface reconstructon are gven n Table 2.The heght computaton n the thrd column s the most computatonally expensve part of the algorthm. It consumed from 76 to 90 percent of the whole surface reconstructon tme. Gap resolvng, n the 4th column has only margnal mpact on the surface reconstructon tme, whle the generaton of the trangular surface mesh, n the 5th column consumed between 10 and 23 percent of surface reconstructon tme. We have tested the proposed couplng on several scenes. Usng the horzontal couplng the layer of 3D partcles stays on top of the 2D flud as can be seen n Fgure 11. We observed that the horzontal couplng helped to prevent penetraton of 2D flud by 3D partcles. We dd not observed any penetraton of 2D flud n our testng even n dynamc scene. We have compared the coupled smulaton wth a full 3D smulaton on a scene wth a flud drop fallng nto an

9 Results 14 scene # flud / boundary common mproved mproved partcles smulaton densty gradent hlly beach 69 888 / 2 477 69 ms 107 ms 126 ms column beach 22 515 / 1 880 41 ms 44 ms 51 ms plan beach 22 515 / 1 016 30 ms 33 ms 42 ms dam break 5 605 / 590 3 ms 3 ms 4 ms Table 1: Comparson of the tme effcency of the mproved smulaton to a common smulaton. In the thrd column are the tmes of a smulaton wthout the proposed mprovements. In the fourth comuln are the tmes of a smulaton wth the mproved densty and n the ffth column are the tmes of the smulaton wth the mproved densty and gradent. Although tmes ncreased the smulaton qualty s mproved. Fgure 16: Four dfferent fluds are poured nto an aquarum wth water, smulated by 40k partcles. The whole scene can be seen n the top mage whle the zoom of ths scene can be seen n the bottom mage. A clean nterface s created between the fluds. aquarum. The reconstructed flud surface from 3 dfferent tmesteps can be seen n Fgure 10. In the begnnng, the results of the full 3D smulaton and the coupled smulaton are smlar. A splash wth a crown s created n both smulatons. In the bottom mages of Fgure 10 the results dffer. In the full 3D smulaton a splash towards the top of the aquarum s vsble whle the 2D flud looks more dumped and no splash s vsble. Ths s manly caused by the dstrbuton of the energy. In the 3D flud the knetc energy of the mpact s dstrbuted only to a small part of the flud. In the coupled flud the veloctes are nterpolated to the 2D flud and thereby to the whole volume of the flud. Also t s not expected that the shallow water smulaton produces the same result as a full 3D smulaton. Because the majorty of the coupled flud s created by a shallow water smulaton the results wll dffer. As can be seen n Fgure 11 after the mpact the couplng ensures that the 2D flud moves approprately and a depresson s cerated. If the pressures from the 3D flud are employed the depresson s larger and vertcal movement of the flud s less dumped. The splash n the mddle of the scene s therefore hgher and more vsble. The fnal tmes of the coupled smulaton are gven n Table 3. The most tme consumng part of the coupled smulaton s the 3D flud smulaton. In average t takes from 80 to 90 percent of the whole tmestep. In comparson wth a full 3D smulaton the coupled smulaton was approxmately 2 tmes faster n the drop scene. Most of the computaton was done durng the mpact. More teraton of IISPH are needed to acheve ncompressblty. In the full 3D smulaton the mpact was resolved faster because of larger layer of partcles. If we compare the coupled smulaton wth the 3D flud smulaton rest state, the coupled smulaton was approxmately 3 tmes faster. We demonstrate the surface reconstructon based on tetrahedralzaton on several examples. Tetgen lbrary ([12]) was used to create the tetrahedralzaton of the smulaton partcles. All examples were exported to 3ds Max, where the surface was smoothed and rendered. The tmes of the phases of the proposed algorthm are gven n Table 4. The most computatonal expensve part of the algorthm s the generaton of the surface and the least expensve s the tetrahedralzaton. In our experments the tme of the surface reconstructon was hghly dependent on the partcle dstrbuton. If the partcles were sparsely dstrbuted throughout the smulaton doman, lke by splashes, hgh number of ar partcles have to be generated whch leads to hgher number of generated trangles and hgher computatonal cost. The resoluton of the surface mesh s drectly dependent on the flud resoluton. Compared to the marchng cubes algorthm usng the marchng tetrahedra the flud surface was reconstructed

10 Concluson 15 faster. The generated mesh has to be smoothed n the postprocessng n order to get comparable results. Wthout the postprocessng the edges on the surface are vsble. A comparson of results from marchng cubes algorthm and marchng tetrahedra algorthm can be found n Fgure 13. Both results are vsually smlar but the marchng tetrahedra generates less trangles and reconstructs the surface faster. Thereby also smaller fles are generated whch leads to lower memory consumpton especally n cases when a large number of tme frames needs to be reconstructed and stored. In Fgure 14, 3 mmscble fluds are mxed. A clear nterface between the fluds and water s created. No ar partcles need to be generated n the areas wthout ar because the smulaton doman s already sampled wth partcles. In our case, when ncompressble flow s consdered, the partcles already have the desred dstrbuton for the surface reconstructon algorthm. Also no combned surface sofuncton, lke n [5], has to be computed to reconstruct the nterfaces between fluds. Because of the mentoned reasons the algorthm s especally sutable for mult-flud scenaros. 10 Concluson The man goal of the thess was to mprove the shallow water smulaton and couple t wth a full 3D smulaton. Ths goal was fulflled and n dong so we contrbuted to several research areas such as flud smulaton, surface reconstructon or boundary handlng. We dvded the contrbuton to several areas. Frst, we mproved the shallow water smulaton by alterng the kernel functons. We mproved the approxmaton of the flud heght as well as the gradent of the flud heght. These alteraton ntroduced acceptable computatonal overhead and mproved the smulaton n several ways. The surface oscllaton as well as the flud heght decay near the boundares was mnmzed. A lower dsspaton was also observed f the modfed kernels were used. We proposed a boundary handlng algorthm for partcle based shallow water smulaton. We sampled the boundares by partcles and ncluded them nto the flud smulaton. The area of the sampled boundary partcles was used to determne ther contrbuton to the SPH summaton. A flat flud surface was acheved near the boundares and even complcated and rregular boundary domans were smulated wth a low computatonal overhead. In order to vsualze the surface we ntroduced a new surface defnton and reconstructon algorthm. The surface defnton was based on the modfed heght computaton. The boundary partcles were ncluded n the defnton to compensate partcle defcency near the boundares. A smooth flud surface was acheved wthn a reasonable tme. The surface correctly decays n the regons where flud flows nto empty regons, and the surface mesh s correctly algned wth the bottom terran. The prevously mentoned mprovements of shallow water smulaton allowed for the couplng wth a full 3D flud smulaton. The man volume of the flud was smulated usng shallow water smulaton whle the surface layer was smulated usng a full 3D smulaton of Naver-Stokes equatons. These two smulatons were coupled by nterpolatng horzontal veloctes between the smulatons. The surface of the 2D flud was sampled by partcles and handled as sold to keep the 3D partcles on top of the 2D flud. The pressures from the 3D flud were used to nfluence the movement of the 2D flud and further enhanced the results. To vsualze the surface a new surface defnton was proposed. Fnally, a new surface reconstructon method was proposed for the surface reconstructon of a 3D partcle-based flud smulaton. Tetrahedralzaton of flud partcles was used to generate the surface. The generated tetrahedra were classfed smlar to marchng cubes algorthm. A surface comparable to marchng cubes was created n a shorter tme. The generated surface s connected wth the flud partcles and the resoluton of the surface mesh s determned by the resoluton of the flud.

10 Concluson 16 scene # f / b heght gap surface total partcles evaluaton resolvng generaton tme hlly beach 69 888 / 2 477 170 ms 0.2 ms 20 ms 190.2 ms column beach 22 515 / 1 880 53 ms 0.2 ms 6 ms 59.2 ms plan beach 22 515 / 1 016 43 ms 0.2 ms 6 ms 49.2 ms dam break 5 605 / 590 10 ms - 3 ms 13 ms Table 2: Tmes of the phases of the proposed surface reconstructon. In the thrd column are the tmes of the surface heght computaton usng Equaton 38. In the fourth column are the tmes of resolvng the produced gap. In the ffth column are the tmes for the computaton of surface normals. In the sxth column are the tmes for the generaton of the trangular surface mesh and n the seventh column are the total tmes of the surface reconstructon. scene # 2D # 3D 2D flud 3D flud partcles partcles smulaton smulaton couplng flud drop 13456 6400 6 ms 151 ms 15 ms flud drop - hgh res 101216 21904 25 ms 1150 ms 61 ms wave scene 13456 6400 6 ms 105 ms 15 ms Table 3: The tmes for the parts of the coupled smulaton of flud drop from Fgure 10. Average tmes of the 2D, 3D, and the overhead of the coupled smulaton are gven n 4th, 5th, and 6th column, respectvely. The tmes for the 2D smulaton and the couplng are relatvely small compared to the 3D smulaton. scene # partcles ar partcle tetrahedralzaton surface total generaton tme generaton tme dam break 16k 15625 0.66 s 0.12 s 1.14 s 1.92 s dam break 128k 127500 5.78 s 0.92 s 10.38 s 17.08 s 3 ppes 8052 0.3 s 0.09 s 3.22 s 3.529 s 4 ppes 28152 1.26 s 0.22 s 5.27 s 6.75 s Table 4: Tmes of the phases of the colored marchng tetrahedra algorthm. Average values are gven n the table. scene # partcles marchng cubes marchng marchng resoluton cubes tetrahedra dam break 16k 15625 200 200 200 5.27 s 1.92 s dam break 128k 127500 300 300 300 17.23 s 17.08 s Table 5: Comparson of the colored marchng tetrahedra wth the marchng cubes. Surface was generated faster usng colored marchng tetrahedra.

Publcatons Journal publcatons Mchal Chládek and Roman Ďurkovč. Partcle-based shallow water smulaton for rregular and sparse smulaton domans. In Computer & Graphcs, Vol. 53, Part B, pages 170-176, 2015. Juraj Onderk, Mchal Chládek and Roman Ďurkovč. Interface reconstructon of multple mmscble fluds. In Araban Journal of Scence Engneerng, Vol. 40, No. 1, pages 269-278, 2015. Juraj Onderk, Mchal Chládek and Roman Ďurkovč. Anmatng multple nteractng mscble and mmscble fluds based on partcle smulaton. In Journal of appled mathematcs, statstcs and nformatcs, Vol. 9, No. 2, pages 73-86, 2013. Domaradzk, J. Martyn, T. Improved partclebased ce meltng smulaton wth SPH ar model. In Journal of WSCG, Vol. 22, No. 2, 2014. Juraj Onderk, Mchal Chládek and Roman Ďurkovč. SPH wth small scale detals and mproved surface reconstructon. In Journal of appled mathematcs, statstcs and nformatcs, Vol. 7, No. 2, pages 21-33, 2011. Roman Ďurkovč, Mchal Chládek and Tomoyuk Nshta. SPH: Towards Flood Smulatons. In IPSJ SIG Notes (Japan), Vol. 2010CG141, No. 12, pages 1-6, Hroshma, Japan, 2010. Conference publcatons Juraj Onderk, Mchal Chládek and Roman Ďurkovč. SPH wth small scale detals and mproved surface reconstructon. In SCCG 11: Proceedngs of the Sprng Conference on Computer graphcs, Vnčné, Slovaka, 2011. 3rd best SCCG 2011 Paper Award 3rd best SCCG 2011 Presentaton Award Aknc, G. Aknc, N. Ihmsen, M. Teschner, M. An effcent surface reconstructon ppelne for partclebased fluds. In VRIPHYS 2012 9th Workshop on Vrtual Realty Interactons and Physcal Smulatons, Geneve: Eurographcs, Swtzerland, 2012. Orthmann, J. Hochstetter, H. Bader, J. Bayraktar, S. Kolb, A. Consstent surface model for SPHbased flud transport. In 12th ACM SIGGRAPH / Eurographcs Symposum on Computer Anmaton, New York: ACM, 2013. Zhang, L. Zhang, C. L, Y. Lv, M. Tang, Y. Realtme smulaton of foam and sprays based on the Weber number. In Journal of Computatonal Informaton Systems, Vol. 10, No. 7, 2014. Huber, M. Eberhardt B. Weskopf, D. Boundary handlng at clothflud contact. In Computer Graphcs Forum,Vol. 34, No. 1, 2015. Jang, T. Noh, J. A geometrc approach to anmatng thn surface features n smoothed partcle hydrodynamcs water. In Computer Anmaton and Vrtual Worlds, Vol. 26, No. 2, 2015. Juraj Onderk, Mchal Chládek and Roman Ďurkovč. SPH wth small scale detals and mproved surface reconstructon. SCCG 11 Proceedngs of the 27th Sprng Conference on Computer Graphcs, New York : ACM, 2013, pages 29-36. Mchal Chládek, Juraj Onderk and Roman Ďurkovč. Colored marchng tetrahedra: a surface reconstructon method for multple nteractng lquds. In Proceedngs of Symposum on Computer Geometry SCG 2012, Bratslava: Slovenská Techncká Unverzta, Slovaka, 2012. Mchal Chládek, Juraj Onderk and Roman Ďurkovč. Mult-flud partcle-based smulaton. In Appled Natural Scences 2013 - Proceedngs, Trnava: Unverzta sv. Cyrla a Metoda, Slovaka, 2013. Roman Ďurkovč, Mchal Chládek and Tomoyuk Nshta. SPH: Towards Flood Smulatons. In 141th Proceedngs of the Informaton Processng Socety of Japan Graphcs and CAD (IPSJ-CGCAD), pages 67-73, Hroshma, Japan, 8-9 November 2010. Abstract and posters Mchal Chládek and Roman Ďurkovč. Smoothed partcle hydrodynamcs n flood smulatons. In Sprng Conference on Computer Graphcs SCCG 2010: Conference Materals and Posters, page 34-37, Budmerce, Slovaka, 2010. Juraj Onderk, Mchal Chládek. SPH wth small scale detals and mproved surface reconstructon(extended abstract). In Študentská vedecká konferenca FMFI UK: Zborník príspevkov, page 61, Fakulta matematky, fyzky a nformatky UK, Bratslava 2011. Juraj Onderk, Mchal Chládek and Roman Ďurkovč. Fyzkálna smuláca kvapalín. In Vrtuálny svet 2012 : Myšlenky, kontext, tvorvé delne a postery pre vedeckú výstavu (DVD), Knžnčné a edčné centrum, page 42, Bratslava, 2011. 17