Hamiltonial fluid mechanics is the application of Hamiltonian methods to fluid mechanics. This formalism can only apply to nondissipative fluids. Take the simple example of a barotropic, inviscid vorticity-free fluid. Then, the conjugate fields are the density field ρ and the velocity potential φ. The Poisson bracket is given by
- <math>\{\phi(\vec{x}),\rho(\vec{y})\}=\delta^d(\vec{x}-\vec{y})</math>
and the Hamiltonian by
- <math>H=\int d^dx \left[ \frac{1}{2}\rho(\nabla \phi)^2 +u(\rho) \right]</math>
where u is the internal energy density. This gives rise to the following two equations of motion:
- <math>\frac{\partial \rho}{\partial t}=-\nabla\cdot(\rho\vec{v})</math>
- <math>\frac{\partial \phi}{\partial t}=\frac{1}{2}v^2+u'</math>
where <math>\vec{v}\ \stackrel{\mathrm{def}}{=}\ -\nabla \phi</math> is the velocity and is vorticity-free. The second equation leads to the Euler equations
- <math>\frac{\partial \vec{v}}{\partial t}+(\vec{v}\cdot\nabla)\vec{v}=-u\nabla\rho</math>
after exploiting the fact that the vorticity is zero.


