Incompressible Navier-Stokes equations
The incompressible Navier-Stokes equations describe conservation of mass and conservation of momentum, which can be written as a divergence-free constraint and an evolution equation:
where
The equations are stated here in dimensionless form with a reference length and velocity of unity, in which case the viscosity is the inverse of the Reynolds number: params = (; viscosity = 1e-3).
Integral form
The integral form of the Navier-Stokes equations is used as starting point to develop a spatial discretization:
where
Boundary conditions
The boundary conditions on a part of the boundary
Dirichlet:
on for some ; Neumann:
on ; Periodic:
and for , where is another part of the boundary and is a translation vector; Stress free:
on , where .
See Problem setup for how to prescribe boundary conditions in the code.
Pressure equation
Taking the divergence of the momentum equations yields a Poisson equation for the pressure:
Note the absence of time derivatives in the pressure equation. While the velocity field evolves in time, the pressure only changes such that the velocity stays divergence free.
If there are no pressure boundary conditions, the pressure is only unique up to a constant. Since only the gradient of the pressure appears in the equations, this constant can be set to zero without affecting the velocity field.
Other quantities of interest
Kinetic energy
The local and total kinetic energy are defined by
Vorticity
The vorticity is defined as
In 2D, it is a scalar field given by
In 3D, it is a vector field given by
Note that the 2D vorticity is equal to the