Hamilton’s principle plays a central role in fluid mechanics as a fundamental tool for deriving governing equations, analyzing conservation laws, and designing structure-preserving numerical schemes. However, its classical formulation is restricted to smooth solutions and does not directly accommodate shock discontinuities. Addressing this limitation within a variational framework has long been a challenging issue. In this paper, we develop a variational framework that extends Hamilton’s principle to shock solutions in compressible fluid dynamics. For the barotropic Euler equations, we introduce a modified action principle that incorporates additional contributions localized at discontinuities. This allows the Rankine–Hugoniot conditions for mass and momentum to emerge directly from unrestricted variations, without imposing continuity across shocks. The additional term admits a natural interpretation as a dissipation potential, linking the variational structure to energy loss at shocks. We then extend the approach to the full compressible Euler equations. Using a variational formulation of nonequilibrium thermodynamics together with suitable variational and phenomenological constraints, we recover the Rankine–Hugoniot relations for mass, momentum, and energy. This yields a unified variational description of shock dynamics in compressible fluids and highlights a fundamental distinction between barotropic and full compressible models in the treatment of energy and entropy at discontinuities.

生成讲解博客的中文版本

生成AI智能校验的中文版本