Summary

J. Emmanuel JohnsonTakaya Uchida

In this tutorial, I go step-by-step through the original 12 Steps to Navier-Stokes that was created by Lorena Barber. However, I use the API from this library which uses many other libraries as the backbone, e.g. FiniteDiffX, Diffrax, jaxdf, and kernex.

1D Problems

Linear Convection

ut+cux=0\frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0

Diffusion

ut=ν2ux2\frac{\partial u}{\partial t} = \nu \frac{\partial^2 u}{\partial x^2}

Advection Diffusion

ut+uux=ν2ux2\begin{aligned} \frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x} &= \nu\frac{\partial^2 u}{\partial x^2} \end{aligned}

2D Problems

Linear Convection

ut+cux+cuy=0\frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} + c\frac{\partial u}{\partial y} = 0

Nonlinear Convection

ut+uux+vuy=0vt+uvx+vvy=0\begin{aligned} \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} &= 0 \\ \frac{\partial v}{\partial t} + u \frac{\partial v}{\partial x} + v\frac{\partial v}{\partial y} &= 0 \end{aligned}

Diffusion

ut=ν2ux2+ν2uy2\begin{aligned} \frac{\partial u}{\partial t} &= \nu\frac{\partial^2 u}{\partial x^2} + \nu\frac{\partial^2 u}{\partial y^2} \end{aligned}

Burgers Equation

ut+uux+vuy=ν(2ux2+2uy2)vt+uvx+vvy=ν(2vx2+2vy2)\begin{aligned} \frac{\partial u}{\partial t} &+ u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} = \nu\left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) \\ \frac{\partial v}{\partial t} &+ u\frac{\partial v}{\partial x} + v\frac{\partial v}{\partial y} = \nu\left(\frac{\partial^2 v}{\partial x^2} + \frac{\partial^2 v}{\partial y^2} \right) \end{aligned}

Elliptical Equations

Laplace's Equation

2px2+2py2=0\begin{aligned} \frac{\partial^2 p}{\partial x^2} + \frac{\partial^2 p}{\partial y^2} = 0 \end{aligned}

Poisson's Equation

2ux2+2uy2=u=b\begin{aligned} \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = \nabla u = b \end{aligned}

Navier-Stokes (TODO)

ut+uux+vuy=1ρpx+ν(2ux2+2uy2)vt+uvx+vvy=1ρpy+ν(2vx2+2vy2)2px2+2py2=ρ(uxux+2uyvx+vyvy)\begin{aligned} \frac{\partial u}{\partial t} &+ u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} = - \frac{1}{\rho}\frac{\partial p}{\partial x} + \nu\left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}\right) \\ \frac{\partial v}{\partial t} &+ u\frac{\partial v}{\partial x} + v\frac{\partial v}{\partial y} = - \frac{1}{\rho}\frac{\partial p}{\partial y} + \nu\left(\frac{\partial^2 v}{\partial x^2} + \frac{\partial^2 v}{\partial y^2} \right) \\ \frac{\partial^2 p}{\partial x^2} &+ \frac{\partial^2 p}{\partial y^2} = -\rho\left( \frac{\partial u}{\partial x}\frac{\partial u}{\partial x} + 2 \frac{\partial u}{\partial y}\frac{\partial v}{\partial x} + \frac{\partial v}{\partial y}\frac{\partial v}{\partial y}\right) \end{aligned}