Fluid Simulation
Koray BalcıIşık Barış Fidaner
Level set
• Implicit signed distance function• Negative inside, positive outside• Isocontour at zero is the surface.
• Evolves in time by eqn:
Particles
• Level set methods tend to lose volume
• Particles are added to prevent this loss.
• Each particle adds tolevel set equation by:(r: radius, s: sign of particle (inside / outside))
• Then surface is smoothed by a function S.
Only levelsets
Level setswith particles
3D grid of cells• Pressures at the
center of cells
• Velocities at the faces of cells
• High resolution Euler grid
• Low resolution Navier-Stokes subgrid
The Navier-Stokes Equations
1) Incompressibility. No fluid flows out of the cell, mass is conserved.
(: viscosity, : density, p: pressure, g: gravity)
2) Velocity and pressure fields are related through conservation of momentum.
(u: velocity field)
Solving Navier-Stokes
i) Initial velocity field at a time step
ii) Firstly, forces are added to the velocity field.
Velocity field u is updated after each time step through 4 operations:
u(t) add force advect diffuse project u(t+1)
Solving Navier-Stokes
iii) Semi-Lagrangian method for stability of fluid movement. Velocity is traced back in one time step. Thus, momentum is carried forward in time.
iv) Diffusion (viscousity) of the fluid is realized in this step.
Solving Navier-Stokes
v) Finally, incompressibility is enforced.
By using Helmholtz-Hodge Decomposition, a vector field can be divided into a divergence free vector field and the gradient of a scalar field.
In this step, we find the divergence-free part of the velocity field.
Time step limitations
• Timestep must be short enough that no significant change occurs.
• Width of a cell, divided by maximum velocity
• CFL (Courant-Friedrichs-Levy) condition: