Navier-Stokes Solver (2D/3D)
Navier-Stokes Equations Overview
The Navier-Stokes equations describe incompressible fluid flow in 2D or 3D:
Momentum Equation:
\\[ \frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u} \cdot \nabla) \mathbf{u} = -\frac{1}{\rho} \nabla p + \nu \nabla^2 \mathbf{u} \\]Continuity Equation:
\\[ \nabla \cdot \mathbf{u} = 0 \\]Where:
- \\(\mathbf{u} = (u, v)\\) (2D) or \\((u, v, w)\\) (3D): Velocity field (m/s)
- \\(p\\): Pressure (Pa)
- \\(\rho\\): Density (kg/m³)
- \\(\nu\\): Kinematic viscosity (m²/s)
Example Setup
2D Lid-driven cavity: \\(N = 64\\), \\(\nu = 0.01 \, \text{m}^2/\text{s}\\), \\(\rho = 1.0 \, \text{kg/m}^3\\), \\(u_{\text{lid}} = 1.0 \, \text{m/s}\\)
Solves for steady-state velocity and pressure in a 1×1 m square domain with top boundary moving at \\(u_{\text{lid}}\\).
3D Driven cube: Similar setup in a 1×1×1 m cube with top face moving.