Water Droplet Simulation Avneesh Sud Problem • Realistic Animation of individual water droplets on surfaces – Lot of work on ‘large’ water bodies (Napier-Stokes, Stam) •
Download ReportTranscript Water Droplet Simulation Avneesh Sud Problem • Realistic Animation of individual water droplets on surfaces – Lot of work on ‘large’ water bodies (Napier-Stokes, Stam) •
Water Droplet Simulation Avneesh Sud 1 Problem • Realistic Animation of individual water droplets on surfaces – Lot of work on ‘large’ water bodies (Napier-Stokes, Stam) • Water droplets tougher – – – – Gravity Interfacial , surface tension Air resistance Accurate rendering • Two Problems : Flow and Rendering 2 Work Presented • Kaneda93 : Water Droplets on Glass Plate • Kaneda96 : Droplets on a Curved Surface 3 Flow of Water Droplets • Physics studied by Janosi89 • Droplet runs down glass plate if mass exceeds critical mass • Route of stream determined by impurities and presence of other droplets • Traces of water left behind on surface : “Wetting” 4 Simulation of Flow • Surface divided into a nxn lattice • An affinity for water fi,j assigned to each lattice point – Depends on surface properties, impurities etc. 5 Simulation of Flow • • • • • When does droplet move? Which direction does it move in? What speed does it move with? How much moves/left behind? When does it stop? 6 Critical Mass • Each lattice point associated with a mass mi,j • Droplet moves if mi , j m ( ) s c msc() is the static critical weight when inclination angle is 7 Direction of Motion • From (i,j) to (i-1,j+1), (i,j+1) or (i+1,j+1) • If water exists in one of the 3 directions, then moves to that direction – If exists in more than 1 direction, then to (i,j+1) – If not exist in (i,j+1), then to direction with larger mass • If not exist in any direction, then tendency to move in direction (i+k,j+1) is di k , j 1 w1 (, k ) fi k , j 1 w1(,k) is the inclination weighting function 8 Speed of water • Depends in wetness of new direction and inclination v v0 ai k , j 1 ( )t • Acceleration ai,j() can be dry acceleration ad() or wet acceleration aw(), aw() > ad() t is time from generation/collision 9 Mass of Moving Water • Mass of remaining water m’i,j depends on fi,j, mmin, mmax m (if mi , j f i , j mmin ) i, j m mmin mi, j w2 f i , j (mi , j f i , j mmin ) f i , j mmin (if f i , j mmin mi , j f i , j mmin max ) w2 mmax mmin f m ( if m f m ) i, j i , j min i , j max w 2 • Mass of water at new position mik , j 1 mi k , j 1 mi , j mi, j 10 Merging • Conservation of mass and momentum m1v1 m2v2 v0 m1 m2 11 Stopping • With no water ahead, decelerates and stops when mass is less than dynamic critical mass mdc() • Speed during deceleration given by v v0 ad ( )t 12 Shape of Droplet • Shape of static droplet on glass plate determined by interfacial, surface tensions (de Gennes 85) SL S L cos 0 • Dynamic droplets complicated – different contact angles at head & tail, several contact angles to minimize energy 13 Shape of Droplet • Approximated by a sphere ( x x0 ) 2 ( y y0 ) 2 ( z z0 ) 2 r 2 z r cos z0 • Radius of sphere dependent on mass 3m r 3 (2 cos 3 cos ) 1 3 14 Rendering • Background textures generated for environment mapping – Front face at higher resolution 15 Rendering • Tracing reflected/refracted rays – Most rays either reflected or refracted : follow one principle direction 16 Rendering • Determining pixel color using the background texture at the intersection point 17 Results (Flow) 18 Results (Animation) 19 Curved Surfaces • Modeled as Bezier Patches • Discretized to a quad mesh – approximated by a plane • A more generic method that reduces discretization artifacts 20 Critical Mass • Movement Test : Sum of external (gravity, wind) forces greater than affinity force f i ,extj Fi , j f i ,extj f g ( i , j ) f w( i , j ) Fi , j s ci , j Fi,j is the static critical force s is degree of affinity coefficient 21 Direction of Motion • “Roulette” of 8 adjacent meshes used • Probability assigned to each mesh • Using probabilities allows to simulate random ‘meandering’ of water 22 Direction of Motion 23 Direction of Motion • Weight of each direction determined by – Newton’s Laws of Motion – Degree of affinity for water – Wetness of neighboring meshes 24 In the beginning … 25 Newton’s Laws • Compute principle velocity vector VP from Newton's mechanics. f i ,extj mi , j ai , j (t ) f ext i, j f g (i , j ) f w(i , j ) Solve to find position P where droplet crosses boundary and the velocity VP at crossing point 26 Newton’s Laws • Probabilities distributed between 2 nearest neighboring directions of VP (l, l+1) 1 * d (k l , l 1) k VP Dk Dsum (otherwise) 0 Dsum dl* VP dl*1 VP 27 Affinity • Probability distributed to directions whose angle from VP is less than 90 deg ck Ak u d k* VP Asum 8 Asum cl u dl* VP l 1 ck is degree of affinity in neighboring mesh u(x) is unit step function 28 Wetness • Probability distributed to directions whose angle from principle vector is less than 90 deg – Prevents a droplet from suddenly changing direction back to a wet spot g (d k* ) Wk u d k* VP Wsum 8 Wsum g (d l* ) u d l* VP l 1 g(d*k) is a function to check wetness 29 Determining direction • All 3 probabilities weighted and summed up Rk 1 VP Dk 2 Ak Wk Rsum 1 controls regularity, 2 controls meandering • Direction depends on generated random p 1 p number r R k 1 k r Rk k 1 p is the desired direction of movement 30 Speed of Travel • Project acceleration in direction of principle vector • Internal forces depend on affinity 31 Mass of moving drop • “Wetting” : Mass of remaining water mi, j hci , j mi , j h(c) is a function for remaining water based on affinity • “Merging” : Follow conservation of mass, momentum 32 Algorithm 1. 2. 3. 4. 5. 6. 7. 8. 9. Make a discretized surface model, specify degree of affinity for each mesh element Put new droplets at mesh points, specify weight and initial speed Initialize timekeepers for all droplets to accumulate time taken for a droplet to travel from one mesh to another If droplet moves, goto step (5) else repeat (4) for all droplets Determine mesh droplet will visit next Calculate time required for droplet to move to next mesh Move the droplet to next mesh based on timekeeper value Repeat steps (4)-(7) for all droplets till end of frame Repeat (2)-(8) for duration of animation 33 Rendering • Similar to glass plate –efficient bezier intersection tests used • Higher quality method based on metaballs – Efficient intersection between ray and metaball using bezier clipping 34 Results 35 Results 36 References • • • • • Janosi IM, Horvath VK Dynamics of Water Droplets on a Window Pane. Physical Review 40(9): 5232-5237 (1989) De gennes PG. Wetting: Statucs and Dynamics. Rev. Mod. Phys. 57(3): 827-863 (1985) Kaneda K, Kagawa T, Yamashita H. Animation of Water Droplets on a Glass Plate. Proc. Computer Animation’93: 177-189 (1993) Kaneda K, Zuyama Y, Yamashita H, Nishita T. Animation of Water Droplet Flow on Curved Surfaces. Proc. PACIFIC GRAPHICS '96: 50-65 (1996). Yu YJ, Jung HY, Cho HG. A New Rendering Techniques for Water Droplet using Metaball in the Gravitation Force. WCGS'98 (1998) 37