# Hydrodynamics

## Euler equations

Euler equations describe a smooth flow. The equations represent conservation of mass (continuity equation), momentum and energy in the fluid. The set of equations are given by:

${\partial\rho\over\partial t}+\nabla\cdot(\rho\vec{v})=0$
${\partial(\rho\vec{v})\over\partial t}+\nabla\cdot(\rho \vec{v}\cdot\vec{v})+\nabla p=0$
${\partial \rho e\over\partial t}+\nabla\cdot(\vec{v}(\rho e+p))=0$

where $e=u+\vec{v}^2/2$ is the total energy density. So far we have three equations and four variables, so we need a forth equation. In the case of a compressible fluid we add an equation of state (EOS) of the type $p=(\gamma -1)\rho u$. For inccompressible fluids we need to assume that the divergence of the fluid velocity is zero $\nabla u =0$ (which is equivalent to consider constant density).

Euler equations can be rewritten in a vectorial form, which is useful to use when solving them numerically:

${\partial \over \partial t} \begin{pmatrix} \rho \\ \rho\vec{v} \\ \rho e \end{pmatrix} =\nabla \begin{pmatrix} \rho\vec{v} \\ \rho \vec{v}\cdot\vec{v} + p \\ (\rho e+p)\vec{v} \end{pmatrix}$

A final equation is usually included in numerical codes to fully characterized a fluid. Although this is not a fluid equation strictly speaking, it is very useful when computing forces and acceleration in a system. Both quantities can be calculated from the potential field, which thanks to this equation is related to the density of the fluid. It is known as the Poisson equation:

$\nabla^2\phi=-4\pi G\rho$