Figure 1 : Navier-Stokes Equations
Figure 2 : Curls & Divergence
Figure 3 : Lagrangian & Eulerian Viewpoints
Figure 4 : Fluid Force Dynamics - Basic structure of the Fluid Force Dynamics where for each timestep it compute the three steps
In this step, you define the initial state of the simulation by initializing key variables for each grid cell. These variables include color, depth, and velocity, as well as any additional variables that can enhance the visualization of fluid flow. This setup ensures a clear depiction of the fluid's starting state and provides a basis for observing how the fluid evolves over time.
Dynamic modification of grid values is facilitated through various tools and interfaces. A common method is using a graphical user interface (GUI) to adjust parameters like velocity, pressure, and external forces. This allows for the simulation of environmental factors such as wind or gravity, interactions with solid objects, and adjustments for turbulence or boundary conditions. Real-time manipulation of these variables enhances the interactivity and customization of the simulation experience.
Diffusion in fluid simulation spreads values like density or temperature to neighboring grid cells over time. Two main methods are used:
Advection describes how quantities like smoke or fluid density move based on velocity. The reverse advection technique traces values backward in time to their original positions, using the inverted velocity field. This method maintains stability and ensures smooth transitions. After computing new positions, values are interpolated across neighboring cells using bilinear interpolation to ensure a smooth distribution.
Figure 5 : Forward Advection & Backtrace Advection : Basic idea behind the advection step. Instead of moving the cell centers forward in
time (b) through the velocity field shown in (a), we look for the particles which end up exactly at
the cell centers by tracing backwards in time from the cell centers (c).
Figure 6 : Domain Behavior; Rebound Domain & Seamless Domain
Rebound domain behavior suggests a domain where the fluid hits the boundaries and is reflected back into the domain, as if the walls act like mirrors to the flow and this is what i used for my project. While Seamless Domain behavior indicates a continuous flow, where the fluid leaving one side of the domain immediately re-enters from the opposite side, creating a seamless loop.
The projection step ensures that the fluid remains mass-conserving and incompressible, which is crucial for accurately simulating fluid dynamics using the Navier-Stokes equations. To achieve this, the velocity field must be corrected, as it typically doesn't conserve mass after earlier steps. Simply solving the underlying partial differential equations can lead to instability, so numerical stability is vital for the simulation to produce reliable results. This is where the Helmholtz-Hodge decomposition comes in, which allows us to split the velocity field into two components: a mass-conserving field with desired vortex-like patterns and a gradient field, which causes unwanted inward or outward flows. By subtracting the gradient field from the velocity field, we correct it to be mass-conserving. This correction involves solving a linear system called the Poisson equation, stabilizing the simulation and ensuring the fluid behaves realistically.
Figure 7 : Helmholtz-Hodge decomposition
The fluid simulation procedure begins by initializing key variables, such as velocity and density fields. While the simulation is active, the previous timesteps for both velocity and density are retained. The velocity field is then computed using fluid forces such as external forces, diffusion, and advection, followed by the computation of the density field using similar dynamics. Finally, a projection step is performed to ensure mass conservation, after which the simulation results are visualized. This process is repeated continuously for each simulation step.
Figure 8 : Simulation steps