<figure><img src="image_1.png" /></figure>

HAL
open science

# A Lagrangian variational formulation for nonequilibrium thermodynamics. Part II: Continuum systems

François Gay-Balmaz, Hiroaki Yoshimura

► To cite this version:

François Gay-Balmaz, Hiroaki Yoshimura. A Lagrangian variational formulation for nonequilibrium thermodynamics. Part II: Continuum systems. Journal of Geometry and Physics, 2017, 111, pp.194-212. 10.1016/j geomphys.2016.08.019 . insu-03727086

HAL Id: insu-03727086

https://insu.hal.science/insu-03727086v1

Submitted on 28 Jun 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Lagrangian variational formulation for nonequilibrium thermodynamics. Part II: continuum systems

François Gay-Balmaz

CNRS - LMD - IPSL

Ecole Normale Supérieure de Paris

24 Rue Lhomond 75005 Paris, France

francois.gay-balmaz@lmd.ens.fr

Hiroaki Yoshimura

School of Science and Engineering

Waseda University

Okubo, Shinjuku, Tokyo 169-8555, Japan

yoshimura@waseda.jp

7 November 2020

## Abstract

Part I of this paper introduced a Lagrangian variational formulation for the nonequilibrium thermodynamics of discrete systems. This variational formulation extends the Hamilton principle to allow the inclusion of irreversible processes in the dynamics. The irreversibility is encoded into a nonlinear nonholonomic constraint given by the expression of entropy production associated to all the irreversible processes involved.

In Part II, we develop this formulation for the case of continuum systems by extending the setting of Part I to infinite dimensional nonholonomic Lagrangian systems. The variational formulation is naturally expressed in material representation, while its spatial version is obtained via a nonholonomic Lagrangian reduction by symmetry. The theory is illustrated with the examples of a viscous heat conducting fluid and its multicomponent extension including chemical reactions and mass transfer.

## Contents

<table><tr><td>1</td><td>Introduction</td><td>2</td></tr><tr><td>2</td><td>Preliminaries on variational principles in continuum mechanics</td><td>5</td></tr><tr><td>2.1</td><td>Geometric preliminaries</td><td>5</td></tr><tr><td>2.2</td><td>Equations of motion</td><td>6</td></tr><tr><td>2.3</td><td>Reversible continuum mechanics - material representation</td><td>7</td></tr><tr><td>2.4</td><td>Reversible continuum mechanics - spatial representation</td><td>9</td></tr><tr><td>3</td><td>Variational formulation for viscous and heat conducting fluids</td><td>12</td></tr><tr><td>3.1</td><td>Material representation</td><td>12</td></tr><tr><td>3.2</td><td>Spatial representation</td><td>15</td></tr><tr><td>4</td><td>Variational formulation for multicomponent reacting viscous fluids</td><td>18</td></tr><tr><td>4.1</td><td>Material representation</td><td>18</td></tr><tr><td>4.2</td><td>Spatial representation</td><td>22</td></tr><tr><td>5</td><td>Conclusions</td><td>25</td></tr></table>
# 1 Introduction

In Part II of this paper, we continue the development of the variational formulation of nonequilibrium thermodynamics which was begun in Part I for discrete systems. This part focuses on the case of continuum systems, including fluid dynamics and nonlinear elasticity.

The variational formulation for nonequilibrium thermodynamics developed in Part I extends the classical Hamilton principle of Lagrangian mechanics to include irreversible processes. It was illustrated with various examples of discrete systems such as mechanical systems with friction, matter transfer, electric circuits, chemical reactions, and diffusion across membranes. Our variational formulation is obtained by constructing a generalization of the Lagrange-d'Alembert principle of nonholonomic mechanics, where the entropy production of the system, written as the sum of the contribution of each of the irreversible processes, is incorporated into nonlinear nonholonomic constraints. In this context, the constraint is called a phenomenological constraint since it encodes the phenomenological laws associated to each of the irreversible processes. To this constraint, we naturally associate a variational constraint on the admissible variations of the action functional. The definition of the variational constraint from the phenomenological constraint is possible thanks to the introduction of the concept of thermodynamic displacement that generalizes the concept of thermal displacement associated to heat transfer. When irreversible processes are not taken into account, our variational formulation consistently recovers Hamilton's principle in Lagrangian mechanics. More concretely, consider the entropy production written in the generic form

$$I = \frac{1}{T} \sum_{\alpha} J_{\alpha} X^{\alpha},$$

where $X^\alpha$ denotes the thermodynamic affinity associated to an irreversible process and $J_\alpha$ is the corresponding irreversible flux. Our approach consists in associating to each irreversible process the rate $\dot{\Lambda}^\alpha$ of a “new” quantity $\Lambda^\alpha$, called a thermodynamic displacement, such that $\dot{\Lambda}^\alpha = X^\alpha$. This allows us to define a variation $\delta\Lambda^\alpha$ for each of the irreversible process and to write the corresponding admissible constraint to be imposed on the variations of the action functional associated to the Lagrangian of the irreversible system.

**Variational formulation for discrete systems.** We illustrate the developments of Part I by briefly mentioning how the variational formulation applies to two examples of discrete systems, namely, the case of a mechanical system with thermodynamics and the case of a system involving matter transfer and chemical reactions. The detailed treatment of these examples is given in Part I of the paper.

**Example 1: a mechanical system with thermodynamics.** Consider a mechanical system with a Lagrangian $L = L(q, \dot{q}, S)$, where $q$ is the configuration variable, $\dot{q}$ is the velocity, and $S$ is the entropy. Assume that the system is subject to an external force $F^{\text{ext}}(q, \dot{q}, S)$, a friction force $F^{\text{fr}}(q, \dot{q}, S)$, and an external heat power supply $P_H^{\text{ext}}(t)$. The variational formulation for this system reads:

$$\delta \int_{t_1}^{t_2} L(q, \dot{q}, S) dt + \int_{t_1}^{t_2} \langle F^{\text{ext}}(q, \dot{q}, S), \delta q \rangle dt = 0,$$

with respect to admissible variations $\delta q$ and $\delta S$ subject to the variational constraint

$$\frac{\partial L}{\partial S}(q, \dot{q}, S)\delta S = \langle F^{\text{fr}}(q, \dot{q}, S), \delta q \rangle, \quad (1.1)$$
and where one imposes the nonlinear nonholonomic constraints:

$$ \frac{\partial L}{\partial S}(q, \dot{q}, S) \dot{S} = \langle F^{\text{fr}}(q, \dot{q}, S), \dot{q} \rangle - P_H^{\text{ext}}. \qquad (1.2) $$

The constraint (1.2) is the phenomenological constraint that encodes the entropy production of the system. One formally defines (1.1) from (1.2) by replacing the time derivatives by $\delta$-variations and removing the effect from the exterior of the system. This is a systematic and general way to obtain the variational constraint associated to a given phenomenological constraint.

This principle yields the coupled equations of evolution for the mechanical and thermodynamical variables

$$ \frac{d}{dt} \frac{\partial L}{\partial \dot{q}} - \frac{\partial L}{\partial q} = F^{\text{ext}} + F^{\text{fr}}, \quad \frac{\partial L}{\partial S} \dot{S} = \langle F^{\text{fr}}, \dot{q} \rangle - P_H^{\text{ext}}. $$

**Example 2: a discrete system with matter transfer and chemical reaction.** Consider a system with several chemical components $A = 1, \dots, R$ that can diffuse through a homogeneous membrane separating two reservoirs, and undergo $r$ chemical reactions.

We denote by $N_A^{(1)}, N_A^{(2)}, N_A^{(m)}$, the numbers of moles of the component $A$ in the reservoir 1, the reservoir 2, and the membrane $m$, respectively. The Lagrangian is defined as $L(S, \{N_A^{(1)}, N_A^{(2)}, N_A^{(m)}\}) := -U(S, \{N_A^{(1)}, N_A^{(2)}, N_A^{(m)}\})$, where $U$ is the total internal energy of the multicomponent substance. The chemical potentials are denoted $\mu_A^A = \frac{\partial U}{\partial N_A^{(k)}}$, for $k = 1, 2, m$.

We denote by $J_A^{(1)}$ the flux from the reservoir 1 into the membrane and $J_A^{(2)}$ the flux from the membrane into the reservoir 2, for the component $A$. We denote by $J_A^{\text{fr}(k)}$ the friction rate of the chemical reactions $a = 1, \dots, r$, for $k = 1, 2, m$.

Let us assume that the components $A = 1, \dots, R$ can undergo $a = 1, \dots, r$ chemical reactions represented by

$$ \sum_A \nu_A^a A \underset{a=(2)}{\overset{a=(1)}{\rightleftharpoons}} \sum_A \nu''_A^a A, \quad a = 1, \dots, r, \qquad (1.3) $$

where $a_{(1)}$ and $a_{(2)}$ are forward and backward reactions associated to the reaction $a$, and $\nu''_A^a, \nu'_A^a$ are forward and backward stoichiometric coefficients for the component $A$ in the reaction $a$. The affinity of the reaction $a$ is the state function defined by

$$ \mathcal{A}^a = -\nu_A^a \mu^A, \quad a = 1, \dots, r, \qquad (1.4) $$

where $\nu_A^a := \nu''_A^a - \nu'_A^a$. In this formula and in the rest of the paper, Einstein's summation convention is used. Mass conservation during each reaction arises from the condition $M^A \nu_A^a = 0$ for $a = 1, \dots, r$ (Lavoisier law), where $M^A$ is the molecular weight of component $A$.

The thermodynamic displacement associated to the irreversible process of diffusion for the component $N_A^{(k)}$ is denoted by $W_A^A$ and the thermodynamic displacement associated to the irreversible process of chemical reaction $a$ happening for $k = 1, 2, m$ is denoted by $\nu_{(k)}^a$. Indeed, from the variational formulation, we will get the relations

$$ \dot{W}_A^A = \mu_A^{(k)}, \quad \dot{\nu}_{(k)}^a = -A_{(k)}^a. $$
<figure><img src="image_3.png" /><figcaption>Figure 1.1: Chemical reactions and diffusion through membranes</figcaption></figure>

The variational formulation for chemical reactions and diffusion is

$$ \delta \int_{t_1}^{t_2} \left( L(S, \{N_A^{(1)}, N_A^{(2)}, N_A^{(m)}\}) + \dot{W}_{(k)}^A N_A^{(k)} \right) dt = 0, \quad (1.5) $$

with respect to the variational constraints

$$ \frac{\partial L}{\partial S} \delta S = J_A^{(1)}(\delta W_{(1)}^A - \delta W_{(m)}^A) + J_A^{(2)}(\delta W_{(m)}^A - \delta W_{(2)}^A) + \sum_{k,a} J_a^{\text{fr}(k)} \delta \nu_{(k)}^a, \quad (1.6) $$

$$ \delta \nu_{(k)}^a = \sum_A \nu_A^a \delta W_{(k)}^A, \quad k = 1, 2, m, \quad a = 1, \dots, r, $$

where $\delta W_{(k)}(t_i) = 0$, for $k = 1, 2, m$, $i = 1, 2$, and with the phenomenological constraints

$$ \frac{\partial L}{\partial S} \dot{S} = J_A^{(1)}(\dot{W}_{(1)}^A - \dot{W}_{(m)}^A) + J_A^{(2)}(\dot{W}_{(m)}^A - \dot{W}_{(2)}^A) + J_a^{\text{fr}(k)} \dot{\nu}_{(k)}^a, \quad (1.7) $$

$$ \dot{\nu}_{(k)}^a = \nu_A^a \dot{W}_{(k)}^A, \quad k = 1, 2, m, \quad a = 1, \dots, r. $$

The variations $\delta W_{(k)}^A$ yield the equations

$$ \dot{N}_A^{(1)} = J_A^{(1)} + J_a^{\text{fr}(1)} \nu_a^A, \quad \dot{N}_A^{(m)} = -J_A^{(1)} + J_A^{(2)} + J_a^{\text{fr}(m)} \nu_A^a, \quad \dot{N}_A^{(2)} = -J_A^{(2)} + J_a^{\text{fr}(2)} \nu_a^A, $$

for $A = 1, \dots, R$. Using the variations $\delta N_A^{(k)}$, we obtain $\dot{W}_{(k)}^A = \mu_A^{(k)}$, from which get $\dot{\nu}_{(k)}^a = -A_{(k)}^a$ by (1.4). Therefore, the phenomenological constraint (1.7) becomes

$$ -T \dot{S} = J_A^{(1)}(\mu_{(1)}^A - \mu_{(m)}^A) + J_A^{(2)}(\mu_{(m)}^A - \mu_{(2)}^A) - J_a^{\text{fr}(k)} A_{(k)}^a. $$

These equations recover those derived in Oster, Perelson, Katchalsky [1973, §VI]. Mass conservation $\frac{d}{dt} \sum_{A,k} M^A N_A^{(k)} = 0$ follows from the Lavoisier law.

One can easily present a generalization of this variational formulation in order to include mechanical variables as in example 1. This yields the dynamical equations for simple systems involving the coupling of mechanical variables with chemical reactions and diffusion processes. A continuum version of such a variational formulation will be developed in §4 for a multicomponent fluid subject to the irreversible processes associated to viscosity, heat transport, (internal) matter transport, and chemical reactions.
# 2 Preliminaries on variational principles in continuum mechanics

In this section we recall some required ingredients concerning the geometry and kinematics of continuum systems such as fluids and elastic materials. We follow the notations and conventions of Marsden and Hughes [1983], to which we refer for a detailed treatment.

## 2.1 Geometric preliminaries

Let $\mathcal{B} \subset \mathbb{R}^3$ be the reference configuration of the system, assumed to be the closure of an open subset of $\mathbb{R}^3$ with piecewise smooth boundary. A configuration is a smooth embedding $\varphi : \mathcal{B} \to \mathcal{S}$ of $\mathcal{B}$ into a three dimensional manifold $\mathcal{S}$. We will write $x = \varphi(X)$, where $x = (x^1, x^2, x^3)$ and are called spatial points and $X = (X^1, X^2, X^3)$ are material points. The manifold of all smooth embeddings is denoted by $\text{Emb}(\mathcal{B}, \mathcal{S})$.

For problems with fixed boundaries, we can choose $\mathcal{S} = \mathcal{B}$, so that the configuration is a smooth diffeomorphism of $\mathcal{B}$, whereas for free boundary problems, we have $\mathcal{S} = \mathbb{R}^3$ and in this case the configuration $\varphi$ is a diffeomorphism onto the current configuration $\varphi(\mathcal{B}) \subset \mathbb{R}^3$. We will denote by $\text{Diff}(\mathcal{B}) = \text{Emb}(\mathcal{B}, \mathcal{B})$ the group of all smooth diffeomorphisms of $\mathcal{B}$.

Even if in this paper, we will restrict to fixed boundary problems, we still consider the general situation $\varphi : \mathcal{B} \to \mathcal{S}$ in this preliminary section, as a notational way to make a clear distinction between material and spatial quantities. This is a crucial point for the rest of the paper.

Let us denote by $A, B, ...$ local coordinates on $\mathcal{B}$ and by $a, b, ...$ local coordinates on $\mathcal{S}$. The deformation gradient $F$ is the tangent map (derivative) of the configuration $\varphi$, that is $F(X) := T_X\varphi : T_X\mathcal{B} \to T_X\mathcal{S}$. In coordinates, we denote it by $F_A^a$. The deformation gradient can be interpreted as a (1, 1) two-point tensor over $\varphi$, since we can write $F(X) : T_X\mathcal{B} \times T_X^*\mathcal{S} \to \mathbb{R}$, where $x = \varphi(X)$. By a $(p, q)$ tensor field we mean a $p$ times contravariant and $q$ times covariant tensor field.

We endow $\mathcal{B}$ with a Riemannian metric $G$ and $\mathcal{S}$ with a Riemannian metric $g$. We will denote by $\mu_G$ and $\mu_g$ the associated Riemannian volume forms. Recall that the Jacobian of $\varphi$ relative to $\mu_G$ and $\mu_g$ is the function $J_\varphi$ on $\mathcal{B}$ defined by $\varphi^*\mu_g = J_\varphi\mu_G$.

The Levi-Civita covariant derivative relative to $G$ and $g$ will both be denoted by $\nabla$. If $\mathbf{T}$ and $\mathbf{t}$ are tensor fields on $\mathcal{B}$ and $\mathcal{S}$, respectively, with local coordinates $T_{E...G}^{A...C}$ and $t_{e...g}^{a...c}$, then the covariant derivatives $\nabla\mathbf{T}$ and $\nabla\mathbf{t}$ will be denoted locally by $T_{E...G|K}^{A...D}$ and $t_{e...g|k}^{a...c}$. The divergence operator on $\mathcal{B}$ and $\mathcal{S}$, will be denoted by $\text{DIV}$ and $\text{div}$, respectively. They are obtained by contraction of the last covariant and contravariant indices of the covariant derivative. For example, if $\mathbf{T}$ and $\mathbf{t}$ are $(p, q)$ tensor fields, then $\text{DIV}\mathbf{T}$ and $\text{div}\mathbf{t}$ are the $(p-1, q)$ tensor fields given, in local coordinates, by $(\text{DIV}\mathbf{T})_{E...G}^{A...C} = T_{E...G|C}^{A...C}$ and $(\text{div}\mathbf{t})_{e...g}^{a...c} = t_{e...g|c}^{a...c}$. We will occasionally use the following instance of Stokes' theorem. Let $\mathcal{S}$ be a (2, 0) tensor field and $\alpha$ a one-form on $\mathcal{B}$. Then we have the following integration by parts formula:

$$ \int_{\mathcal{B}} (\alpha \cdot \text{DIV} \mathbf{S}) \mu_G = - \int_{\mathcal{B}} (\nabla \alpha : \mathbf{S}) \mu_G + \int_{\partial \mathcal{B}} \mathbf{S}(\alpha, \mathbf{N}^{\flat G}) \mu_G^{\partial G}, \quad (2.1) $$

where $\mu_G^{\partial G}$ is the Riemannian volume form induced on the boundary and $\mathbf{N}$ is the outward pointing unit vector field on $\partial\mathcal{B}$ relative to $G$. Note that, in coordinates, we have $\alpha \cdot \text{DIV} \mathbf{S} = \alpha_A S^{AB}|_B$, $\nabla\alpha : \mathbf{S} = \alpha_{A|B} S^{AB}$, and $\mathbf{S}(\alpha, \mathbf{N}^{\flat g}) = S^{AB}\alpha_A N^C G_{BC}$. See, Problem 7.6, Chap. 1 in Marsden and Hughes [1983].

Given a vector field $\mathbf{u}$ on $\mathcal{S}$, the Piola transformation of $\mathbf{u}$ is the vector field $\mathbf{U}$ on $\mathcal{B}$ defined by $\mathbf{U} := J_\varphi \varphi^*\mathbf{u}$. In local coordinates, we have $U^a = J_\varphi (F^{-1})_a^A u^a$. The Piola
identity relates the divergences $\text{DIV } \mathbf{U}$ and $\text{div } \mathbf{u}$ as follows

$$ \text{DIV } \mathbf{U} = J_{\varphi}(\text{div } \mathbf{u}) \circ \varphi. $$

We can also make a Piola transformation on any index of a tensor field. For example, let $\boldsymbol{\sigma}$ be a given (2,0) tensor field on $\mathcal{S}$. If we make a Piola transformation on the last index, we obtain the two-point tensor field $\mathbf{P}(X) : T_X^*\mathcal{B} \times T_X^*\mathcal{S} \to \mathbb{R}$ over $\varphi$ defined by $\mathbf{P}(X)(\alpha_x, \beta_X) := J_{\varphi}(\boldsymbol{\sigma}(x)(\alpha_x, T_X^*\varphi^{-1}(\beta_X)))$. In local coordinates, we have $P^{aA} = J_{\varphi}\sigma^{ab}(F^{-1})_b^A$ and the Piola identity is

$$ \text{DIV } \mathbf{P} = J_{\varphi}(\text{div } \boldsymbol{\sigma}) \circ \varphi, $$

or, in local coordinates $P^{aA}|_A = J_{\varphi}\sigma^{ab}|_b$. The Piola identity will be crucial later, when passing from the material to the spatial representation.

A motion of $\mathcal{B}$ is a time-dependent family of configurations, written $x = \varphi_t(X) = \varphi(X, t)$. It can therefore be thought of as a curve $\varphi_t \in \text{Emb}(\mathcal{B}, \mathcal{S})$ in the infinite dimensional configuration manifold. The material velocity is defined by $\mathbf{V}_t(X) := \mathbf{V}(X, t) := \frac{d}{dt}\varphi_X(t) \in T_{\varphi(X)}\mathcal{S}$ and the spatial or Eulerian velocity is $\mathbf{v}_t(x) := \mathbf{v}(x, t) = \mathbf{V}_t(\varphi_t^{-1}(x))$. We have

$$ \mathbf{V}_t \in T_{\varphi_t} \text{Emb}(\mathcal{B}, \mathcal{S}) \quad \text{and} \quad \mathbf{v}_t = \mathbf{V}_t \circ \varphi_t^{-1} \in \mathcal{X}(\varphi_t(\mathcal{B})), $$

where $T_{\varphi} \text{Emb}(\mathcal{B}, \mathcal{S})$ is the tangent space to $\text{Emb}(\mathcal{B}, \mathcal{S})$ at $\varphi$ and $\mathcal{X}(\varphi_t(\mathcal{B}))$ is the space of vector fields on $\varphi_t(\mathcal{B}) \subset \mathcal{S}$.

## 2.2 Equations of motion

Let $\varphi_t : \mathcal{B} \to \mathcal{S}$ be a motion of $\mathcal{B}$, let $\mathbf{v}(x, t)$ and $\mathbf{V}(X, t)$ be its spatial and material velocities, and let $\rho(x, t)$ be the mass density function. The body undergoing the motion $x = \varphi(X, t)$ is acted on by several kind of forces such as *body forces* $\mathbf{b}(x, t)$ per unit mass, *surface forces* $\boldsymbol{\tau}(x, t)$ per unit area, and *stress forces* $\mathbf{t}(x, t, \mathbf{n})$ per unit area across any surface element with unit normal $\mathbf{n}$. For simplicity, from now on we shall assume $\boldsymbol{\tau} = 0$.

As a consequence of the mass conservation one obtains the continuity equation $\partial_t \rho + \text{div}(\rho\mathbf{v}) = 0$. This implies the relation $(\rho \circ \varphi)J_{\varphi} = \rho_{\text{ref}}$, where $\rho_{\text{ref}}$ is the mass density in the reference configuration, i.e., written in terms of material coordinates. As a consequence of the integral form of momentum balance we obtain the existence of a (2,0) tensor field $\boldsymbol{\sigma}$, called the Cauchy stress tensor, such that $\mathbf{t}(x, t, \mathbf{n}) = \boldsymbol{\sigma}(x, t)(\mathbf{-}, \mathbf{n}^{b_g})$ or, in coordinates, $t^a = \sigma^{ab}g_{bc}n^c$. Then using again momentum balance and mass conservation we obtain the following motion equation in spatial coordinates

$$ \rho(\partial_t \mathbf{u} + \mathbf{u} \cdot \nabla \mathbf{u}) = \text{div} \boldsymbol{\sigma} + \rho \mathbf{b}, $$

where we recall that $\nabla$ and $\text{div}$ are, respectively, the covariant derivative and the divergence associated to the Riemannian metric $g$ on $\mathcal{S}$. Using balance of moment of momentum, one obtains that the Cauchy stress tensor $\boldsymbol{\sigma}$ is symmetric, i.e. $\sigma^{ab} = \sigma^{ba}$.

In order to write the equations of motion in material coordinates, one has to consider the *Piola transformation* of the Cauchy stress tensor $\boldsymbol{\sigma}(x, t)$, called the *first Piola-Kirchhoff tensor* $\mathbf{P}(X, t)$. We also define the material body force $\mathbf{B}(X, t) := \mathbf{b}(\varphi(X, t), t)$. By using the Piola identity together with the relation $(\rho \circ \varphi)J_{\varphi} = \rho_{\text{ref}}$, one arrives at the equations

$$ \rho_{\text{ref}} \frac{\mathrm{D}\mathbf{V}}{\mathrm{D}t} = \text{DIV } \mathbf{P} + \rho_{\text{ref}} \mathbf{B}, \qquad (2.2) $$

where $\mathrm{D}/\mathrm{D}t$ denotes the covariant derivative relative to the Riemannian metric $g$. As stressed in §2.2 of Marsden and Hughes [1983], when $\mathcal{S}$ is not the Euclidean space, one cannot derive the equations of motion from the integral form of momentum balance. One can however derive the equations from an energy principle that does not require $\mathcal{S}$ to be linear.
### 2.3 Reversible continuum mechanics - material representation

In material representation, the variational formulation follows from the standard Hamilton principle. Hamilton's principle for fluid mechanics in the Lagrangian description has been discussed at least since the works of Herivel [1955], for an incompressible fluid and Serrin [1959] and Eckart [1960] for compressible flows, see also Truesdell and Toupin [1960] for further references.

From the point of view of infinite dimensional Lagrangian mechanics, one considers the Lagrangian defined on the tangent bundle $TEmb(\mathcal{B}, \mathcal{S})$ and given by the kinetic minus potential energy, whose most general form is

$$ 
\begin{aligned}
L_{g,G_{\text{ref}},R_{\text{ref}},Z_{\text{ref}}}(\varphi, \dot{\varphi}) &= \int_{\mathcal{B}} \mathcal{L}(X, \varphi(X), \dot{\varphi}(X), T_X \varphi) \mu_{G_{\text{ref}}}(X) \\
&= \int_{\mathcal{B}} \frac{1}{2} \rho_{\text{ref}}(X) |\dot{\varphi}(X)|_g^2 \mu_{G_{\text{ref}}}(X) \\
&\quad - \int_{\mathcal{B}} \mathfrak{E}(g(\varphi(X)), G_{\text{ref}}^{\sharp}(X), T_X \varphi, R_{\text{ref}}(X), Z_{\text{ref}}(X)) \mu_{G_{\text{ref}}}(X) \\
&\quad - \int_{\mathcal{B}} \rho_{\text{ref}} \mathcal{V}(\varphi(X)) \mu_{G_{\text{ref}}}(X),
\end{aligned} 
\quad (2.3) $$

where $\mathcal{L}$ denotes the Lagrangian density, $R_{\text{ref}} := \rho_{\text{ref}}\mu_{G_{\text{ref}}}$ is the mass form, and $Z_{\text{ref}}$ represents other tensor fields on the reference configuration, on which the internal energy density $\mathfrak{E}$ depends, such as the entropy density $S_{\text{ref}}$ or the magnetic field $B_{\text{ref}}$. The 2-contravariant symmetric tensor field $G_{\text{ref}}^{\sharp}$ denotes the inverse of the Riemannian metric $G_{\text{ref}}$. The notation $L_{g,G_{\text{ref}},R_{\text{ref}},Z_{\text{ref}}}$ for the Lagrangian is used to recall that it depends parametrically on the tensor fields $g, G_{\text{ref}}, R_{\text{ref}}, Z_{\text{ref}}$. These fields are time independent. The function $\mathcal{V}$ is a potential energy density such as the gravitation.

It is essential to explicitly write the dependence of the internal energy density $\mathfrak{E}$ on the Riemannian metric $g$ in order to introduce the notion of covariance. Covariance is the statement on left invariance of $\mathfrak{E}$ relative to the group $Diff(\mathcal{S})$ of spatial diffeomorphisms and is a fundamental physical requirement. We refer to Marsden and Hughes [1983] for a detailed account and to Simo, Marsden, and Krishnaprasad [1988] and Gay-Balmaz, Marsden, and Ratiu [2012] for the corresponding consequences in the reduced Hamiltonian and Lagrangian formulations.

Hamilton's principle reads

$$ \delta \int_{t_1}^{t_2} L_{g,G_{\text{ref}},R_{\text{ref}},Z_{\text{ref}}}(\varphi(t), \dot{\varphi}(t))dt = 0, \quad (2.4) $$

for arbitrary variations $\delta\varphi$ of the configuration $\varphi$ such that $\delta\varphi(t_1) = \delta\varphi(t_2) = 0$. It yields the Euler-Lagrange equations. In order to derive the equations of motion, one has to impose appropriate boundary conditions.

Let us first assume prescribed boundary values, that is, $\varphi(t, X) = \varphi_0(X)$, for all $X \in \partial\mathcal{B}$. In this case, Hamilton variational principle (2.4) for the Lagrangian (2.3) yields the equations (2.2), with

$$ \mathbf{P} = \mathbf{P}^{\text{cons}} = - \left( \frac{\partial \mathcal{L}}{\partial T_X \varphi} \right)^{\sharp_g} = \left( \frac{\partial \mathfrak{E}}{\partial T_X \varphi} \right)^{\sharp_g} \quad \text{and} \quad \mathbf{B} = \mathbf{B}^{\text{cons}} = -(\mathbf{d}\mathcal{V} \circ \varphi)^{\sharp_g} = -\operatorname{grad} \mathcal{V} \circ \varphi, $$

where $\sharp_g$ denotes the sharp operator associated to the Riemannian metric $g$. We use the notations $\mathbf{P}^{\text{cons}}$ and $\mathbf{B}^{\text{cons}}$ to emphasize the fact that the stress forces and body forces arising from the Euler-Lagrange equations are conservative. Note that the case of prescribed
boundary values includes for example no-slip boundary conditions when $\mathcal{S} = \mathcal{B}$ and $\phi_0 = id$, so that the configuration space is the group $\text{Diff}_0(\mathcal{B})$ of diffeomorphisms of $\mathcal{B}$ that fix each point of the boundary.

In the case of a free boundary, Hamilton variational principle (2.4) for the Lagrangian (2.3) yields, in addition to the equations (2.2), the zero-traction boundary condition

$$ \mathbf{P}^{\text{cons}}(\mathbf{N}^{\flat G}, -) = 0 \quad \text{on} \quad \partial\mathcal{B}. $$

In the case with a fixed boundary and tangential boundary condition, that is $\mathcal{S} = \mathcal{B}$, so that $\phi \in \text{Diff}(\mathcal{B})$, then the zero-traction boundary condition reads

$$ \mathbf{P}^{\text{cons}}(\mathbf{N}^{\flat G}, -)|_{T\partial\mathcal{B}} = 0 \quad \text{on} \quad \partial\mathcal{B}, \qquad (2.5) $$

since the variation $\delta\phi$ is parallel to the boundary $\partial\mathcal{B}$.

**Including external forces.** Nonconservative stress forces and body forces can be easily included in the variational principle by considering the Lagrange-d'Alembert principle obtained by adding the virtual work done by the forces along a displacement $\delta\phi$. It reads

$$ \delta \int_{t_1}^{t_2} L_{g, G_{\text{ref}}, R_{\text{ref}}, Z_{\text{ref}}} (\phi, \dot{\phi}) dt \\ + \int_{t_1}^{t_2} \left[ \iint_{\mathcal{B}} \left( \rho_{\text{ref}} \mathbf{B}^{\text{ext}} \cdot \delta\phi - (\mathbf{P}^{\text{ext}})^{\flat g} : \nabla\delta\phi \right) \mu_{G_{\text{ref}}} \right] dt = 0, \qquad (2.6) $$

for arbitrary variations $\delta\phi$ of the configuration $\phi$ such that $\delta\phi(t_1) = \delta\phi(t_2) = 0$. In the above, the flat operator is computed relative to the metric $g$ and we dropped the argument $X$ for simplicity. The notation $\nabla^g \delta\phi$ stands for the Levi-Civita covariant derivative (with respect to $g$) of the two-point tensor $\delta\phi$ (see, e.g, Marsden and Hughes [1983] for a complete treatment). The principle (2.6) yields the equations (2.2) with $\mathbf{P} = \mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{ext}}$ and $\mathbf{B} = \mathbf{B}^{\text{cons}} + \mathbf{B}^{\text{ext}}$. In the case of free, respectively, fixed boundary, we obtain the zero-traction boundary condition $\mathbf{P}(\mathbf{N}^{\flat G}, -) = 0$, respectively, $\mathbf{P}(\mathbf{N}^{\flat G}, -)|_{T\partial\mathcal{B}} = 0$ on $\partial\mathcal{B}$. However, in presence of external forces, one usually imposes no-slip boundary conditions in which case no additional boundary conditions arise from the variational formulation.

**Example 1: ideal compressible fluids.** For this particular case, the tensor field $Z_{\text{ref}}$ is taken as the entropy density $S_{\text{ref}}$, and hence the internal energy density is of the form

$$ \begin{aligned} \mathcal{E} (g(\phi(X)), G_{\text{ref}}^{\sharp}(X), T_X \phi, R_{\text{ref}}(X), S_{\text{ref}}(X)) \mu_{G_{\text{ref}}}(X) &= \varepsilon \left( \frac{\rho_{\text{ref}}(X)}{J_{\phi}(X)}, \frac{S_{\text{ref}}(X)}{J_{\phi}(X)} \right) J_{\phi}(X) \mu_{G_{\text{ref}}}(X) \quad (2.7) \\ &= \varepsilon(\rho(\phi(X)), s(\phi(X)))\phi^* \mu_g(X) = \phi^* (\varepsilon(\rho, s)\mu_g)(X), \end{aligned} $$

where $\varepsilon(\rho, s)\mu_g$ is the energy density in spatial representation, taken here to be an arbitrary function of $\rho(x)$ and $s(x)$. In (2.7) we used the relations between the spatial and material quantities as $(\rho \circ \phi)J_{\phi} = \rho_{\text{ref}}$, $(s \circ \phi)J_{\phi} = S_{\text{ref}}$, and $J_{\phi}\mu_g = \phi^*\mu_{G_{\text{ref}}}$. Note that for ideal compressible fluids the energy $\mathcal{E}$ depends on the deformation gradient $T_X\phi$ only through its Jacobian $J_{\phi}$. It is important to note from (2.7) that whereas both $\mathcal{E}$ and $\mu_{G_{\text{ref}}}$ depend on $G_{\text{ref}}$, the whole expression $\mathcal{E}(\dots)\mu_{G_{\text{ref}}}$ does not depend on $G_{\text{ref}}$ for ideal compressible fluid. For this reason, there is no spatial variable associated to $G_{\text{ref}}$ and we can write $L_{g, G_{\text{ref}}, R_{\text{ref}}, S_{\text{ref}}} = L_{g, R_{\text{ref}}, S_{\text{ref}}}$. In this case, the introduction of a Riemannian metric $G_{\text{ref}}$ on $\mathcal{B}$ is only needed to facilitate the computations.

The Cauchy stress tensor is computed to be

$$ \sigma^{\text{cons}} = -pg^{\sharp} = - \left( \frac{\partial \varepsilon}{\partial \rho} \rho + \frac{\partial \varepsilon}{\partial s} s - \varepsilon \right) g^{\sharp}, \qquad (2.8) $$
where p is the pressure. Using the Piola identity (see Theorem 7.20 of Chapter 1 in Marsden and Hughes [1983]), we obtain DIV **P**<sup>cons</sup> = -(grad p) ◦ ϕJ<sub>ϕ</sub> and hence the equation of motion reads

$$
\rho_{\text{ref}} \frac{DV}{Dt} = -(\text{grad } p) \circ \varphi J_{\varphi} + \rho_{\text{ref}} \mathbf{B}^{\text{cons}}
$$

for ideal compressible fluids in material representation.

For fluids with fixed boundary, i.e., $\mathcal{B} = S$, the boundary condition (2.5) vanishes because of the expression (2.8). Indeed, by definition of the Piola transformation, it follows

$$
\begin{align*}
\mathbf{P}^{\text{cons}} (\delta\varphi(X)^{b_g}, \mathbf{N}^{b_G}(X)) &= J_{\varphi}(X)\boldsymbol{\sigma}^{\text{cons}}(x) (\delta\varphi(X)^{b_g}, T_x^*\varphi^{-1}(\mathbf{N}^{b_G}(X))) \\
&= -p(x)J_{\varphi}(X)g(x) (\delta\varphi(X)^{b_g}, T_x^*\varphi^{-1}(\mathbf{N}^{b_G}(X))) \\
&= -p(x)J_{\varphi}(X) \langle T_x\varphi^{-1}\delta\varphi(X), \mathbf{N}^{b_G}(X) \rangle \\
&= -p(x)J_{\varphi}(X)G_{\text{ref}}(X) (T_x\varphi^{-1}\delta\varphi(X), \mathbf{N}(X)) = 0,
\end{align*}
$$

since $T_x\varphi^{-1}\delta\varphi(X)$ is parallel to the boundary.

In absence of thermodynamic effects, viscosity and other nonconservative stresses can be included in the variational formulation by using the Lagrange-d'Alembert principle (2.6). In this case one usually imposes no-slip boundary conditions.

**Example 2: multicomponent fluids.** In the ideal case, to describe a multicomponent fluid with *K* chemical components *A* = 1, ..., *K*, one has to introduce the molar density *n*<sub>*A*</sub>(*t*, *x*) of the substance *A* in spatial representation. The material Lagrangian is now indexed as *L*<sub>*g*,{N*<sub>*A*</sub>},S<sub>ref</sub></sub>, where *N*<sub>*A*</sub><sub>ref</sub>(*X*), *A* = 1, ..., 2 is the molar density of the substance *A* evaluated at *X* ∈ <B> in material representation, hence *N*<sub>*A*</sub><sub>ref</sub> is constant in time. The Lagrangian is of the form (2.3), where ρ<sub>ref</sub>(*X*) := Σ<sup>*K*</sup><sub>*A*=1*</sub> *M*<sup>*A*</sup>*N*<sub>*A*</sub><sub>ref</sub>(*X*) in the first term denotes the total mass density, with *M*<sup>*A*</sup> the molecular weight of the substance *A*, and the internal energy density has the form

$$
\mathfrak{E} \left( g(\varphi(X)), G_{\text{ref}}^{\sharp}(X), T_X \varphi, \{N_{A \text{ref}}(X)\}, S_{\text{ref}}(X) \right) \mu_{G_{\text{ref}}}(X) = \varphi^* \left( \varepsilon(\{n_A\}, s) \mu_g \right) (X). \quad (2.9)
$$

The Cauchy stress tensor is computed to be

$$
\boldsymbol{\sigma}^{\text{cons}} = -pg^{\sharp} = - \left( \frac{\partial \varepsilon}{\partial n_A} n_A + \frac{\partial \varepsilon}{\partial s} s - \varepsilon \right) g^{\sharp}
$$

and, as before, the boundary condition (2.5) is automatically satisfied.

It is interesting to note that second order fluids require the use of nonholonomic versions of Hamilton's principle. This is shown in Gay-Balmaz and Yoshimura [2015], in conjunction with the Hamilton-Pontryagin principle and Dirac structures.

2.4 Reversible continuum mechanics - spatial representation

While in the Lagrangian description the variational principle is a straightforward extension of the Hamilton principle of classical mechanics, in the Eulerian description the variational principle is much more involved and several approaches have been developed, see Lin [1963], Seliger and Whitham [1968], Bretherton [1970].

In this paper, we shall always derive the variational principles in Eulerian description by a systematic use of the process of Lagrangian reduction by symmetry. For simplicity, we shall restrict to the case S = B so that the configuration manifold is a Lie group,
the group Diff($\mathcal{B}$) of all smooth diffeomorphisms. In this case, the variational principle in Eulerian description has been developed in Holm, Marsden and Ratiu [1998] by using the theory of Euler-Poincaré reduction on Lie groups with advected quantities. The general case $\mathcal{B} \neq \mathcal{S}$ needed for free boundary continuum mechanics, has been developed in Gay-Balmaz, Marsden, and Ratiu [2012].

In order to obtain the spatial form of the equations from a reduced Lagrangian point of view, one has to assume that the Lagrangian (2.3) is right-invariant under the action of the group Diff($\mathcal{B}$). This happens if the material internal energy density $\mathcal{E}$ is Diff($\mathcal{B}$) equivariant, that is,

$$ \mathcal{E} (g \circ \varphi \circ \psi, \psi^* G_{\text{ref}}^{\sharp}, T(\varphi \circ \psi), \psi^* R_{\text{ref}}, \psi^* Z_{\text{ref}}) = \mathcal{E} (g \circ \varphi, G_{\text{ref}}^{\sharp}, T\varphi, R_{\text{ref}}, Z_{\text{ref}}) \circ \psi, $$

for all $\psi \in \text{Diff}(\mathcal{B})$. This is an hypothesis on the material energy density $\mathcal{E}$; see Marsden and Hughes [1983], Gay-Balmaz, Marsden, and Ratiu [2012]. It is clear that (2.7) satisfies this hypothesis.

**Example 1: ideal compressible fluids.** Using the change of variables $x = \varphi(X)$, one obtains, from the material Lagrangian (2.3) and the internal energy (2.7), the (reduced) Lagrangian in spatial representation as

$$ \ell(\mathbf{v}, \rho, s) = \int_S \frac{1}{2} \rho |\mathbf{v}|_g^2 \mu_g - \int_S \varepsilon(\rho, s) \mu_g - \int_S \rho \mathcal{V} \mu_g, $$

where $\mathbf{v} = \dot{\varphi} \circ \varphi^{-1} \in \mathcal{X}_{\parallel}(\mathcal{S})$ is the spatial or Eulerian velocity. Here, $\mathcal{X}_{\parallel}(\mathcal{S})$ denotes the space of vector fields on $\mathcal{S} = \mathcal{B}$ parallel to the boundary, i.e., $\mathcal{X}_{\parallel}(\mathcal{S}) = \{\mathbf{v} \in \mathcal{X}(\mathcal{S}) | \mathbf{v} \cdot \mathbf{n} = 0 \text{ on } \partial\mathcal{B}\}$, where $\mathbf{n}$ is the unit normal vector field to $\partial\mathcal{S}$, relative to the metric $g$. Hamilton's principle (2.4) yields the variational principle

$$ \delta \int_{t_1}^{t_2} \ell(\mathbf{v}, \rho, s) dt = 0, \qquad (2.10) $$

for constrained variations of the form

$$ \delta \mathbf{v} = \partial_t \zeta + [\mathbf{v}, \zeta], \quad \delta \rho = -\operatorname{div}(\rho \zeta), \quad \delta s = -\operatorname{div}(s \zeta), $$

where $\zeta = \delta\varphi \circ \varphi^{-1}$ is an arbitrary curve in $\mathcal{X}_{\parallel}(\mathcal{S})$ vanishing at the endpoints. These variations can be obtained by direct computations of the variations of $\mathbf{v} = \dot{\varphi} \circ \varphi^{-1}$, $\rho = (\rho_{\text{ref}} \circ \varphi^{-1}) J_{\varphi^{-1}}$, and $s = (S_{\text{ref}} \circ \varphi^{-1}) J_{\varphi^{-1}}$, induced from the variations $\delta\varphi$ of the Lagrangian trajectory $\varphi$. From the reduced variational principle (2.10), the equations in spatial variables are obtained as

$$ \left\{ \begin{array}{l} \rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) = -\operatorname{grad} p + \rho \mathbf{b}^{\text{cons}}, \\ \partial_t \rho + \operatorname{div}(\rho \mathbf{v}) = 0, \quad \partial_t s + \operatorname{div}(s \mathbf{v}) = 0, \end{array} \right. \qquad (2.11) $$

where $p = \frac{\partial \varepsilon}{\partial \rho} \rho + \frac{\partial \varepsilon}{\partial s} s - \varepsilon$ and $\mathbf{b}^{\text{cons}} = -\operatorname{grad} \mathcal{V}$. We refer to Holm, Marsden and Ratiu [1998] for the complete description of the Lagrangian reduction theory underlying this example, and its abstract description in terms of the *Euler-Poincaré reduction with advected parameters*.

**Example 2: multicomponent fluids.** For the multicomponent fluid, using the change of variables $x = \varphi(X)$, one obtains, from (2.3) with internal energy (2.9), the Lagrangian in spatial representation as

$$ \ell(\mathbf{v}, \{n_A\}, s) = \int_S \frac{1}{2} \rho |\mathbf{v}|_g^2 \mu_g - \int_S \varepsilon(\{n_A\}, s) \mu_g - \int_S \rho \mathcal{V} \mu_g. $$
The variational principle has the same form as (2.10) in which $\rho$ replaced by the collection of number densities {$n_A$}, $A = 1, ..., K$, with constrained variations $\delta n_A = -\operatorname{div}(n_A \zeta)$. This results in the equations

$$ egin{cases} \rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) = -\operatorname{grad} p + \rho \mathbf{b}^{\text{cons}}, \\ \partial_t n_A + \operatorname{div}(n_A \mathbf{v}) = 0, \quad A = 1, ..., K, \quad \partial_t s + \operatorname{div}(s \mathbf{v}) = 0, \end{cases} \qquad (2.12) $$

where $\rho = M^A n_A$ and $p = \frac{\partial \epsilon}{\partial n_A} n_A + \frac{\partial \epsilon}{\partial s} s - \epsilon$.

Both systems (2.11) and (2.12) will be extended to include irreversible thermodynamics effects in the next sections.

**Including external forces.** Nonconservative stress and body forces can be included in the Lagrange-d'Alembert principle by writing (2.6) in spatial representation. For example, for ideal compressible fluids we have

$$ \delta \int_{t_1}^{t_2} \ell(\mathbf{v}, \rho, s) dt + \int_{t_1}^{t_2} \left[ \int_S \left( \rho \mathbf{b}^{\text{ext}} \cdot \boldsymbol{\zeta} - (\boldsymbol{\sigma}^{\text{ext}})^{b_g} : \nabla \boldsymbol{\zeta} \right) \mu_g \right] dt = 0, $$

where $(\boldsymbol{\sigma}^{\text{ext}})^{b_g} : \nabla \boldsymbol{\zeta} = (\boldsymbol{\sigma}^{\text{ext}})^{b_g} : \text{Def} \boldsymbol{\zeta}$ with Def $\mathbf{v} := \frac{1}{2}(\nabla \mathbf{v} + \nabla \mathbf{v}^T)$ the rate of deformation tensor and $\nabla \mathbf{v}^T$ the transpose of $\nabla \mathbf{v}$ with respect to the metric $g$, i.e., $g(\nabla \mathbf{v}^T \mathbf{u}, \mathbf{w}) = g(\mathbf{u}, \mathbf{w} \cdot \nabla \mathbf{v})$, for all vector fields $\mathbf{u}, \mathbf{w}, \mathbf{w}$. In this case, one usually imposes no-slip boundary conditions, i.e., $\mathbf{v} \in \mathcal{X}_0(S) = \{\mathbf{v} \in \mathcal{X}(S) | \mathbf{v}|_{\partial S} = 0\}$, and hence it follows

$$ \rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) = \operatorname{div} \boldsymbol{\sigma} + \rho \mathbf{b}, \quad \boldsymbol{\sigma} = \boldsymbol{\sigma}^{\text{cons}} + \boldsymbol{\sigma}^{\text{ext}}, \quad \mathbf{b} = \mathbf{b}^{\text{cons}} + \mathbf{b}^{\text{ext}}, \qquad (2.13) $$

together with the advection equations for $\rho$ and $s$. The energy balance is given by

$$ \partial_t e + \operatorname{div}(e\mathbf{v}) = \operatorname{div}(\boldsymbol{\sigma}^{b_g} \cdot \mathbf{v}) - \boldsymbol{\sigma}^{\text{ext}} : \nabla \mathbf{v} + \rho(\mathbf{b}^{\text{ext}})^{b_g} \cdot \mathbf{v}, \qquad (2.14) $$

where $e := \frac{1}{2}\rho|\mathbf{v}|_g^2 + \epsilon(\rho, s) + \rho V$ is the total energy density.

**Navier-Stokes equations.** For the case of the Navier-Stokes equations, the external stress tensor $\boldsymbol{\sigma}^{\text{ext}}$ is given by the viscosity, i.e.,

$$ \boldsymbol{\sigma}^{\text{ext}} = 2\mu(\text{Def } \mathbf{v})^{\sharp_g} + \lambda(\text{div } \mathbf{v})g^{\sharp} = 2\mu \left[ (\text{Def } \mathbf{v})^{\sharp_g} - \frac{1}{3}(\text{div } \mathbf{v})g^{\sharp} \right] + \zeta(\text{div } \mathbf{v})g^{\sharp}, $$

where $\mu$ is the first coefficient of viscosity (shear viscosity) and $\zeta = \lambda + \frac{2}{3}\mu$ is the second coefficient of viscosity (bulk viscosity), while the Cauchy stress tensor $\boldsymbol{\sigma}^{\text{cons}}$ is given by

$$ \boldsymbol{\sigma}^{\text{cons}} = -pg^{\sharp} = - \left( \frac{\partial \epsilon}{\partial \rho} \rho + \frac{\partial \epsilon}{\partial s} s - \epsilon \right) g^{\sharp}. $$

Equations (2.13) become the compressible Navier-Stokes equations

$$ \rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) = -\operatorname{grad} p + \mu \Delta \mathbf{v} + (\mu + \lambda) \nabla \operatorname{div} \mathbf{v} + \rho(\mathbf{b}^{\text{cons}} + \mathbf{b}^{\text{ext}}), $$

which are accompanied by the advection equations $\partial_t \rho + \operatorname{div}(\rho \mathbf{v}) = 0$ and $\partial_t s + \operatorname{div}(s \mathbf{v}) = 0$. The balance of energy (2.14) is computed by using

$$ (\boldsymbol{\sigma}^{\text{ext}})^{b_g} : \text{Def } \mathbf{v} = 2\mu \text{Def } \mathbf{v} : \text{Def } \mathbf{v} + \lambda(\text{div } \mathbf{v})\delta : \text{Def } \mathbf{v} = 2\mu|\text{Def } \mathbf{v}|_g^2 + \lambda(\text{div } \mathbf{v})^2, $$

in (2.14), where $\delta$ denotes the (1, 1) Kronecker tensor.
In this approach, the viscosity is interpreted as an external force, hence the notation $\boldsymbol{\sigma}^{\text{ext}}$, leading to a dissipation of energy. This case is an approximation of the Navier-Stokes-Fourier system treated below, where the same stress tensor $\boldsymbol{\sigma}^{\text{ext}}$ will be considered as a friction $\boldsymbol{\sigma}^{\text{fr}}$ associated to an irreversible transfer of mechanical energy into heat, for which $\partial_t s + \text{div}(s\boldsymbol{v}) = 0$ will no longer be true (see (3.21)). In this case, $\boldsymbol{\sigma}^{\text{fr}}$ will no longer be treated a dissipative force in the energy balance.

This ends our preliminaries concerning the variational formulations in material and spatial representation.

# 3 Variational formulation for viscous and heat conducting fluids

In this section, we present an extension of the variational formulation for nonequilibrium thermodynamics developed for discrete systems in Part I to the case of continuum mechanics. We will first consider a compressible fluid with a single (chemical) component subject to the irreversible processes associated to heat transport and viscosity.

## 3.1 Material representation

Since the internal heat transfer is now taken into account, the appropriate variational formulation in material representation is a continuum version of the variational formulation that we introduced in Theorem 4.1 in Part I. By analogy with the variables $\Gamma^A, \Sigma_A$ developed in §4 of Part I, we introduce the variables $\Gamma(t, X)$ and $\Sigma(t, X)$ in material coordinates, where the rate $\dot{\Gamma}(t, X)$ will ultimately be identified with the temperature in material representation, denoted $\mathcal{T}(t, X)$, while the rate $\dot{\Sigma}(t, X)$ will be clarified as the total (internal and external) entropy production. The introduction of these variables allows us to write the nonholonomic constraint as a sum of thermodynamic affinity densities multiplied by thermodynamic fluxes (written as time derivatives).

The Lagrangian has the same expression as the one for the ideal compressible fluid (i.e. it is given by (2.3), where $\mathfrak{E}$ is given by the internal energy density (2.7)), with a change in the interpretation of the material entropy. Namely, the entropy was understood, before, as a fixed material quantity $S_{\text{ref}}(X)$ on which the Lagrangian depends parametrically. Now we will interpret it as a *dynamic variable* $S(t, X)$ involved in the variational formulation. This crucial difference is illustrated by the change of notation

$$L_{g,R_{\text{ref}},S_{\text{ref}}}(\varphi, \dot{\varphi}) \rightsquigarrow L_{g,R_{\text{ref}}}(\varphi, \dot{\varphi}, S), \quad S_{\text{ref}}(X) \rightsquigarrow S(t, X)$$

in the material Lagrangian (2.3) with material internal energy density given by (2.7).

**Variational formulation for nonequilibrium thermodynamics of viscous heat conducting fluids.** The continuum version of the variational formulation of Theorem 4.1 in Part I is given by

$$\delta \int_{t_1}^{t_2} \left( L_{g,R_{\text{ref}}}(\varphi, \dot{\varphi}, S) + \int_{\mathcal{B}} (S - \Sigma) \dot{\Gamma} \mu_{G_{\text{ref}}} \right) dt = 0, \qquad \text{VARIATIONAL CONDITION (3.1)}$$

with phenomenological and variational constraints

$$\frac{\partial \mathcal{L}}{\partial S} \dot{\Sigma} = -(\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} + \mathbf{J}_S \cdot \mathbf{d}\dot{\Gamma} - \rho_{\text{ref}} R, \qquad \text{PHENOMENOLOGICAL CONSTRAINT (3.2)}$$

$$\frac{\partial \mathcal{L}}{\partial S} \delta\Sigma = -(\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \delta\varphi + \mathbf{J}_S \cdot \mathbf{d}\delta\Gamma, \qquad \text{VARIATIONAL CONSTRAINT (3.3)}$$
where $\mathbf{P}^{\mathrm{fr}}(t, X)$ is a friction Piola-Kirchhoff tensor, $\mathbf{J}_S(t, X)$ is an entropy flux density in material representation, and $\rho_{\mathrm{ref}}(X)R(t, X)$ is a heat power supply density in material representation.

Let us recall that this variational formulation means that when we compute the variation of the action functional in (3.1), we take any variations $\delta\varphi, \delta S, \delta\Gamma, \delta\Sigma$ that satisfy the variational constraint (3.3) and such that $\delta\varphi$ and $\delta\Gamma$ vanish at the endpoints $(t = t_1, t_2)$. The curve $\varphi(t), S(t), \Gamma(t), \Sigma(t)$ around which the variations are taken has to satisfy the nonholonomic phenomenological constraint (3.2).

In the same way as the discrete case, making use of the variables $\Gamma$ and $\Sigma$ in the variational formulation provides a very clear and physically meaningful structure of nonequilibrium thermodynamics of continuum systems:

* The variational condition (3.1) is an extension of Hamilton's principle (2.4) for fluid dynamics in material representation. It is essentially of geometric nature and only involves the knowledge of the configuration space and of the Lagrangian of the system.

* The nonholonomic constraint (3.2) is the expression of the thermodynamic power density associated to all the irreversible processes (heat transport and viscosity in our case) involved in the entropy production. This constraint is of phenomenological nature, in which each of the "thermodynamic affinities" is related to the thermodynamic fluxes characterizing an irreversible process via phenomenological laws; see Remark 4.7 and Remark 4.8 below. The introduction of the variable $\Gamma$ allows us to write this constraint as if a sum of force densities were acting on velocity fields, by analogy with classical mechanics; namely, $\mathbf{P}^{\mathrm{fr}}$ "acting" on $\frac{d}{dt}\varphi$ and $\mathbf{J}_S$ "acting" on $\frac{d}{dt}\Gamma$, resulting in a power or rate of work density.

* Concerning the variational constraint (3.3), the occurrence of the time derivatives in (3.2), also allows us to systematically replace all velocities by "$\delta$-derivatives", i.e., variational displacements and to formulate the variational constraint as a sum of virtual thermodynamic work densities associated to each of the irreversible processes. It is important to note that this interpretation is possible thanks to the introduction of the variable $\Gamma(t, X)$ whose time derivative will be identified with the temperature $\mathfrak{T}(t, X)$:

$$ \frac{d}{dt}\Gamma = -\frac{\partial \mathcal{L}}{\partial S} =: \mathfrak{T}, \qquad (3.4) $$

from the stationarity condition associated with the variation $\delta S$ in the variational formulation, as we will see in (3.7) below. Here we recall that $\mathcal{L}$ denotes the Lagrangian density as in (2.3).

**The equations of motion in material coordinates.** Since we assumed no-slip boundary conditions, we have $\delta\varphi|_{\partial B} = 0$ and by computing the variations in (3.1), and using the instance of Stokes' theorem recalled in (2.1), we obtain

$$ \int_{t_1}^{t_2} \int_{\mathcal{B}} \left[ \left( \frac{\partial \mathcal{L}}{\partial \varphi} - \mathrm{DIV} \frac{\partial \mathcal{L}}{\partial T_X \varphi} - \frac{D}{Dt} \frac{\partial \mathcal{L}}{\partial \dot{\varphi}} \right) \delta\varphi + \frac{\partial \mathcal{L}}{\partial S} \delta S - (\dot{S} - \dot{\Sigma})\delta\Gamma + (\delta S - \delta\Sigma)\dot{\Gamma} \right] \mu_{G_{\mathrm{ref}}} dt = 0. $$
Using the variational constraint (3.3) and the fact that $\frac{\partial \mathcal{L}}{\partial S} \neq 0$, and collecting the terms associated to the variations $\delta\varphi$ and $\delta\Gamma$, $\delta S$, one obtains

$$ \delta\varphi : \rho_{\text{ref}} \frac{DV}{Dt} = \text{DIV} \left( \mathbf{P}^{\text{cons}} - \Gamma \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} \mathbf{P}^{\text{fr}} \right) + \rho_{\text{ref}} \mathbf{B}^{\text{cons}}, \quad (3.5) $$

$$ \delta\Gamma : \dot{S} = \text{DIV} \left( \Gamma \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} \mathbf{J}_S \right) + \dot{\Sigma}, \quad (3.6) $$

$$ \delta S : \dot{\Gamma} = - \frac{\partial \mathcal{L}}{\partial S}, \quad (3.7) $$

where we recall that $\mathbf{V} = \dot{\varphi}$,

$$ \mathbf{P}^{\text{cons}} := - \left( \frac{\partial \mathcal{L}}{\partial(T_X \varphi)} \right)^{\sharp_g} = \left( \frac{\partial \mathcal{E}}{\partial(T_X \varphi)} \right)^{\sharp_g} \quad \text{and} \quad \rho_{\text{ref}} \mathbf{B}^{\text{cons}} = \frac{\partial \mathcal{L}}{\partial \varphi} = - \rho_{\text{ref}} (\mathbf{d}\mathbf{V} \circ \varphi)^{\sharp_g}. $$

Using the relations (3.7) and (3.6) in the phenomenological constraint (3.2) yields

$$ \mathcal{T}(\dot{S} + \text{DIV} \mathbf{J}_S) = (\mathbf{P}^{\text{fr}})^{\flat_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot \mathbf{d}\mathcal{T} + \rho_{\text{ref}} R, $$

where we recall that $\mathcal{T} := -\frac{\partial \mathcal{L}}{\partial S}$ is the temperature in material representation as in (3.4). It is instructive to compare (3.6)-(3.7), with the corresponding relations (4.9)-(4.10) for discrete systems in Part I.

If we impose the variation of $\Gamma$ to vanish at the boundary, i.e., $\delta\Gamma|_{\partial\mathcal{B}} = 0$, then there are no supplementary boundary conditions arising from the variational formulation. If, however, $\delta\Gamma$ has no constraints on the boundary, then it implies the condition

$$ \mathbf{J}_S \cdot \mathbf{N}^{\flat G} = 0 \quad \text{on} \quad \partial\mathcal{B}, $$

where $\mathbf{N}$ is the outward pointing unit normal vector field on $\partial\mathcal{B}$ relative to $G_{\text{ref}}$; namely, it implies that there is no transfer of heat to the exterior. In this case, it is also consistent with the assumption that no heat sources coming from the exterior, that is, $\rho_{\text{ref}} R = 0$ and therefore the fluid is adiabatically closed.

Our results are summarized as follows.

**Theorem 3.1** (Variational formulation for the Navier-Stokes-Fourier system – material representation). In material representation, the Navier-Stokes-Fourier equations are given by

$$ \left\{ \begin{array}{l} \rho_{\text{ref}} \frac{DV}{Dt} = \text{DIV}(\mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{fr}}) + \rho_{\text{ref}} \mathbf{B}^{\text{cons}}, \\ \mathcal{T}(\dot{S} + \text{DIV} \mathbf{J}_S) = (\mathbf{P}^{\text{fr}})^{\flat_g} : \nabla^g \mathbf{V} - \mathbf{J}_S \cdot \mathbf{d}\mathcal{T} + \rho_{\text{ref}} R, \end{array} \right. \quad (3.8) $$

with no-slip boundary conditions $\mathbf{V}|_{\partial\mathcal{B}} = 0$. They follow from the variational condition (3.1) with phenomenological and variational constraints (3.2), (3.3), where we impose $\delta\Gamma|_{\partial\mathcal{B}} = 0$. If the constraint $\delta\Gamma|_{\partial\mathcal{B}} = 0$ is not imposed, then the variational formulation yields the condition $\mathbf{J}_S \cdot \mathbf{N}^{\flat G} = 0$ and if in addition $\rho_{\text{ref}} R = 0$, then the fluid is adiabatically closed.

These equations are not easy to handle because, being in material variables, they are written along the configuration $\varphi_t : \mathcal{B} \to \mathcal{S}$. We shall below write them in the usual spatial representation. However, we choose to consider the material representation first, since the variational formulation is simpler in material coordinates, which is natural in parallel with the one of the discrete systems. Of course, the variational formulation in spatial variables follows from reduction by symmetry of the variational formulation in material variables.

Exterior stress and body forces can be easily included in the variational picture, by augmenting (3.1) with the appropriate virtual force term (see the second term in (2.6)).
**Remark 3.2** (Interpretation of Σ). Notice that (3.6) is the entropy balance equation, namely,

$$ \dot{S} = -\mathrm{DIV} \mathbf{J}_S + \dot{\Sigma}, $$

where $\dot{\Sigma}$ corresponds to the total (internal and external) entropy production of the system as

$$ \dot{\Sigma} = \frac{1}{\xi} \left[ (\mathbf{P}^{\mathrm{fr}})^{b_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot \mathbf{d}\xi + \rho_{\mathrm{ref}} R \right]. $$

In order to complete the system (3.8) it is necessary to specify the phenomenological expressions for $\mathbf{P}^{\mathrm{fr}}$ and $\mathbf{J}_S$ in accordance with the second law of thermodynamics. Recall that the heat power supply density $\rho_{\mathrm{ref}} R$ is external, and then the second law, applied locally, requires the inequality that the internal entropy production density $I$ is positive:

$$ I = \frac{1}{\xi} \left[ (\mathbf{P}^{\mathrm{fr}})^{b_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot \mathbf{d}\xi \right] \geq 0. \quad (3.9) $$

Using the expression $\frac{d}{dt}\mathfrak{E} = (\mathbf{P}^{\mathrm{cons}}+\mathbf{P}^{\mathrm{fr}})^{b_g} : \nabla^g \dot{\varphi}-\mathrm{DIV} \mathbf{J}_Q+\rho_{\mathrm{ref}} R$ for the internal energy balance in material representation and replacing the heat power supply by using the entropy inequality $\dot{S}+\mathrm{DIV} \mathbf{J}_S \geq \frac{1}{\xi}\rho_{\mathrm{ref}} R$, (or, in Clausius form $\dot{S} \geq -\mathrm{DIV} (\frac{1}{\xi}\mathbf{J}_Q) + \frac{1}{\xi}\rho_{\mathrm{ref}} R$, where $\mathbf{J}_Q = \xi\mathbf{J}_S$), we obtain a reformulation of (3.9) known as the *Clausius-Duhem inequality* (see, Lavenda [1978]), namely

$$ \dot{S} - \frac{1}{\xi} \dot{\mathfrak{E}} + \frac{1}{\xi} (\mathbf{P}^{\mathrm{cons}} + \mathbf{P}^{\mathrm{fr}})^{b_g} : \nabla^g \dot{\varphi} - \frac{1}{\xi^2} \mathbf{J}_Q \cdot \mathbf{d}\xi \geq 0, \quad (3.10) $$

written here in material representation, which is a useful rewriting only if $R \neq 0$.

## 3.2 Spatial representation

From a mathematical point of view, the passage from the material to the spatial description follows from the material relabelling symmetry through a Lagrangian reduction process. In this section, we shall implement such a Lagrangian reduction in the constrained variational formulation developed above in §3.1.

One first observes that both the phenomenological and variational constraints (3.2) and (3.3) possesses the needed $\mathrm{Diff}(\mathcal{B})$-invariance to implement this reduction. The material Lagrangian is given by (2.3) with internal energy (2.7), which is also $\mathrm{Diff}(\mathcal{B})$-invariant. The corresponding spatial (or reduced) Lagrangian is provided by

$$ \ell(\mathbf{v}, \rho, s) = \int_S \frac{1}{2} \rho |\mathbf{v}|_g^2 \mu_g - \int_S \varepsilon(\rho, s) \mu_g. \quad (3.11) $$

Therefore, by using the relabelling symmetry, the reduced variables

$$ \mathbf{v} = \dot{\varphi} \circ \varphi^{-1}, \quad \rho = \rho_{\mathrm{ref}} \circ \varphi^{-1} J_{\varphi}^{-1}, \quad s = S \circ \varphi^{-1} J_{\varphi}^{-1}, \quad \sigma = \Sigma \circ \varphi^{-1} J_{\varphi}^{-1}, \quad \gamma = \Gamma \circ \varphi^{-1}, \quad (3.12) $$

and the properties of the Piola transformation, the reduction of the variational formulation (3.1) yields

$$ \delta \int_{t_1}^{t_2} \left( \ell(\mathbf{v}, \rho, s) + \int_S (s - \sigma)(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \mu_g \right) dt = 0, \quad (3.13) $$

together with the reduced phenomenological and variational constraints (3.2) and (3.3), respectively, given by

$$ \frac{\delta \ell}{\delta s} (\partial_t \sigma + \mathrm{div}(\sigma \mathbf{v})) = -(\boldsymbol{\sigma}^{\mathrm{fr}})^{b_g} : \nabla \mathbf{v} + \mathbf{j}_S \cdot \mathbf{d}(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) - \rho r, \quad (3.14) $$
$$ \frac{\delta \ell}{\delta s} (\delta \sigma + \operatorname{div}(\sigma \zeta)) = -(\sigma^{\mathrm{fr}})^{b_g} : \nabla \zeta + \mathbf{j}_S \cdot \mathbf{d}(\delta \gamma + \mathbf{d}\gamma \cdot \zeta), \quad (3.15) $$

where $\zeta = \delta\varphi \circ \varphi^{-1}$ and $\delta\gamma$ are arbitrary curves vanishing at the endpoints, the entropy flux $\mathbf{j}_S$ and the friction stress $\boldsymbol{\sigma}^{\mathrm{fr}}$ in spatial representation are defined as the inverse Piola transformation of $\mathbf{J}_S$ and $\mathbf{P}^{\mathrm{fr}}$, that is,

$$ \mathbf{j}_S := (\varphi_* \mathbf{J}_S) J_{\varphi}^{-1} \quad \text{and} \quad \boldsymbol{\sigma}^{\mathrm{fr}}(x)(\alpha_x, \beta_x) := J_{\varphi}^{-1} \mathbf{P}^{\mathrm{fr}}(X)(\alpha_x, T_X^* \varphi(\beta_x)), \quad (3.16) $$

and $r(x) := R(\varphi^{-1}(x))$. From the definition of the spatial variables $\mathbf{v}$ and $\rho$, the variations $\delta\mathbf{v}$ and $\delta\rho$ are subjects to the constraints

$$ \delta \mathbf{v} = \partial_t \zeta + [\mathbf{v}, \zeta], \quad \delta \rho = - \operatorname{div}(\rho \zeta). $$

Taking the variations of the action integral (3.13) and using the divergence theorem with the boundary condition $\mathbf{v}|_{\partial S} = 0$, we have

$$ \int_{t_0}^{t_1} \int_S \left( \frac{\delta \ell}{\delta \mathbf{v}} \cdot (\partial_t \zeta + [\mathbf{v}, \zeta]) - \frac{\delta \ell}{\delta \rho} \operatorname{div}(\rho \zeta) + \frac{\delta \ell}{\delta s} \delta s - [\partial_t (s - \sigma) + \operatorname{div}((s - \sigma)\mathbf{v})] \delta \gamma \right. \\ \left. + (\delta s - \delta \sigma)(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) + (s - \sigma) \mathbf{d}\gamma \cdot (\partial_t \zeta + [\mathbf{v}, \zeta]) \right) \mu_g dt = 0. $$

Using the divergence theorem with the boundary condition $\zeta|_{\partial S} = 0$, the variational constraint (3.15), the fact that $\frac{\delta \ell}{\delta s} \neq 0$, and collecting the terms associated to the variations $\zeta$, $\delta\gamma$, $\delta s$, we obtain

$$ \zeta : (\partial_t + \operatorname{ad}_{\mathbf{v}}^*) \left( \frac{\delta \ell}{\delta \mathbf{v}} + (s-\sigma)\mathbf{d}\gamma \right) - \rho \frac{\delta \ell}{\delta \rho} + \sigma \mathbf{d}(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \\ + \operatorname{div} \left( (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} \boldsymbol{\sigma}^{\mathrm{fr}} \right) - \operatorname{div} \left( (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} \mathbf{j}_S \right) \cdot \mathbf{d}\gamma = 0, \quad (3.17) $$

$$ \delta\gamma : \partial_t(s - \sigma) + \operatorname{div}((s - \sigma)\mathbf{v}) = \operatorname{div} \left( (\partial_t\gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left(\frac{\delta\ell}{\delta s}\right)^{-1} \mathbf{j}_S \right), \quad (3.18) $$

$$ \delta s : \partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v} = - \frac{\delta \ell}{\delta s}. \quad (3.19) $$

where we assumed $\delta\gamma|_{\partial S} = 0$ and where $\operatorname{ad}_{\mathbf{v}}^* \mathbf{m}$ (the coadjoint operator) denotes the dual operation to the Lie bracket with respect to the pairing $\langle \mathbf{m}, \mathbf{v} \rangle = \int_S g(\mathbf{m}, \mathbf{v})\mu_g$. This operator reads $\operatorname{ad}_{\mathbf{v}}^* \mathbf{m} = \mathbf{v} \cdot \nabla \mathbf{m} + \nabla \mathbf{v}^\mathrm{T} \mathbf{m} + \mathbf{m} \operatorname{div} \mathbf{v}$. Using (3.19) and (3.18) in the phenomenological constraint (3.14) leads to

$$ T(\partial_t s + \operatorname{div}(s\mathbf{v}) + \operatorname{div}\mathbf{j}_S) = (\boldsymbol{\sigma}^{\mathrm{fr}})^{b_g} : \nabla\mathbf{v} - \mathbf{j}_S \cdot \mathbf{d}T + \rho r, $$

where $T := -\frac{\delta \ell}{\delta s}$ is the temperature in spatial representation. If $\delta\gamma|_{\partial S}$ is free, then we obtain the condition

$$ \mathbf{j}_S \cdot \mathbf{n}^{b_g} = 0 \quad \text{on} \quad \partial S, \quad (3.20) $$

where $\mathbf{n}$ is the outward pointing unit normal vector field on $\partial S$ relative to $g$, that is, there is no transport of heat to the exterior. In this case, it is also consistent with the assumption that there exist no heat sources coming from the exterior, namely, $\rho r = 0$, in which case the fluid is adiabatically closed.

Our results are summarized as follows.
**Theorem 3.3** (Variational formulation for the Navier-Stokes-Fourier system – spatial representation). In spatial representation, the Navier-Stokes-Fourier equations are given by

$$
\left\{
\begin{aligned}
\rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) &= -\operatorname{grad} p + \operatorname{div} \boldsymbol{\sigma}^{\mathrm{fr}}, && p = \frac{\partial \varepsilon}{\partial \rho} \rho + \frac{\partial \varepsilon}{\partial s} s - \varepsilon, \\
\partial_t \rho + \operatorname{div}(\rho \mathbf{v}) &= 0, && \\
T(\partial_t s + \operatorname{div}(s \mathbf{v}) + \operatorname{div} \mathbf{j}_S) &= (\boldsymbol{\sigma}^{\mathrm{fr}})^{\mathrm{b}g} : \nabla \mathbf{v} - \mathbf{j}_S \cdot \mathrm{d}T + \rho r, && T = \frac{\partial \varepsilon}{\partial s}.
\end{aligned}
\right.
\quad (3.21)
$$

These equations arise from the variational condition (3.13), where $\mathbf{v}, \rho, s, \gamma, \sigma$ satisfy the nonholonomic constraint (3.14) and for variations $\delta\mathbf{v} = \partial_t\zeta + [\mathbf{v}, \zeta]$, $\delta\rho = -\operatorname{div}(\rho\zeta)$, $\delta s$, $\delta\gamma$, $\delta\sigma$, such that $\zeta$, $\delta\sigma$ and $\delta\gamma$ verify the variational constraint (3.15) and where we impose $\delta\gamma|_{\partial S} = 0$. Direct computations using (3.19) and (3.18) in (3.17) and in the nonholonomic constraint (3.14) leads to (3.21). If the constraint $\delta\gamma|_{\partial S} = 0$ is not imposed, then the variational formulation yields the condition $\mathbf{j}_S \cdot \mathbf{n}^{\mathrm{b}g} = 0$ and if in addition $\rho r = 0$, then the fluid is adiabatically closed.

**Remark 3.4** (Interpretation of $\sigma$). The Lagrangian time derivative of the variables $\sigma$ corresponds to the total entropy production density of the system. The entropy balance equation (3.18) is consistent with equation (10) of §3.1 in de Groot and Mazur [1969] (note that their notation of the entropy production “$\sigma$” corresponds to our notation “$i$”). Indeed, from (3.18) we have

$$ \partial_t \sigma + \operatorname{div}(\sigma \mathbf{v}) = \frac{1}{T} \left( (\boldsymbol{\sigma}^{\mathrm{fr}})^{\mathrm{b}g} : \nabla \mathbf{v} - \mathbf{j}_S \cdot \mathrm{d}T + \rho r \right) = i + \frac{r\rho}{T}, $$

where $i$ is the internal entropy production. As in Remark 3.2, in order to complete the system (3.21), it is necessary to specify the phenomenological expressions for $\boldsymbol{\sigma}^{\mathrm{fr}}$ and $\mathbf{j}_S$ in accordance with the second law of thermodynamics. The second law, applied locally, requires that these expressions are such that the internal entropy production density is positive, i.e., $i \ge 0$. See also Remark 4.7 for the phenomenological expressions. Concerning the total entropy $S(t) = \int_S s(t, x)\mu_g(x)$, we have

$$ \frac{d}{dt} S(t) = - \int_{\partial S} \mathbf{j}_S \cdot \mathbf{n}^{\mathrm{b}g} \mu_g^{\partial} + \int_S i \mu_g + \int_S \frac{1}{T} r \rho \mu_g \ge - \int_{\partial S} \frac{\mathbf{j}_Q \cdot \mathbf{n}^{\mathrm{b}g}}{T} \mu_g^{\partial} + \int_S \frac{r \rho}{T} \mu_g. \quad (3.22) $$

**Remark 3.5** (Energy balance). For completeness, we write here the energy balance in an intrinsic expression. The total energy density $e := \frac{1}{2}\rho|\mathbf{v}|_g^2 + \varepsilon(\rho, s)$ satisfies the equation

$$ \partial_t e + \operatorname{div}(e\mathbf{v}) = \operatorname{div}(\boldsymbol{\sigma}^{\mathrm{b}g} \cdot \mathbf{v}) - \operatorname{div} \mathbf{j}_Q + \rho r, $$

(compare with (2.14)), where $\boldsymbol{\sigma} := -\rho g^\sharp + \boldsymbol{\sigma}^{\mathrm{fr}}$, and $\mathbf{j}_Q = T\mathbf{j}_S$ is the heat flux, so that the total energy $E(t) = \int_S e(t, x)\mu_g(x)$ verifies the balance law

$$ \frac{d}{dt} E(t) = - \int_{\partial S} \mathbf{j}_Q \cdot \mathbf{n}^{\mathrm{b}g} \mu_g^{\partial} + \int_S \rho r \mu_g = P_H^{\mathrm{ext}}(t), $$

where we recall that $\mu_g$ denotes the volume form associated to the Riemannian metric $g$ and $\mu_g^{\partial}$ denotes the volume form induced by $\mu_g$ on the boundary $\partial S$. We consistently have $\frac{d}{dt}E = 0$ in the adiabatically closed case $\mathbf{j}_Q \cdot \mathbf{n}^{\mathrm{b}g} = 0$ (see (3.20)) and $\rho r = 0$.

**Remark 3.6** (General Lagrangian). To obtain (3.21), we have used the explicit expression (3.11) of the Lagrangian of an ideal compressible fluid. For a general Lagrangian $\ell(\mathbf{v}, \rho, s)$, we obtain the system

$$
\left\{
\begin{array}{l}
(\partial_t + \mathrm{ad}_{\mathbf{v}}^*) \frac{\delta \ell}{\delta \mathbf{v}} = \rho \mathrm{d} \frac{\delta \ell}{\delta \rho} + s \mathrm{d} \frac{\delta \ell}{\delta s} + \mathrm{div} \, \boldsymbol{\sigma}^{\mathrm{fr}}, \quad \partial_t \rho + \mathrm{div}(\rho \mathbf{v}) = 0, \\
\\
\frac{\delta \ell}{\delta s} (\partial_t s + \mathrm{div}(s \mathbf{v}) + \mathrm{div} \, \mathbf{j}_S) = -(\boldsymbol{\sigma}^{\mathrm{fr}})^{\mathrm{b}g} : \nabla \mathbf{v} - \mathbf{j}_S \cdot \mathrm{d} \frac{\delta \ell}{\delta s} - r \rho.
\end{array}
\right.
$$
**Remark 3.7** (Thermodynamic phenomenology). As mentioned earlier, in order to determine from (3.21) the time evolution of all the fields, it is necessary to provide phenomenological expressions for $\boldsymbol{\sigma}^{\text{fr}}$ and $\mathbf{j}_S$ (which are examples of the so-called fluxes) in terms of Def $\mathbf{v}$ and $\mathbf{d}T$ (which are examples of the so-called affinities) that are compatible with the second law $i \ge 0$. In the present example, we have the well-known relations

$$ \boldsymbol{\sigma}^{\text{fr}} = 2\mu(\text{Def} \mathbf{v})^{\sharp g} + \left(\zeta - \frac{2}{3}\mu\right) (\text{div} \mathbf{v})g^{\sharp} \quad \text{and} \quad T \mathbf{j}_S^{\flat g} = -\kappa \mathbf{d}T \quad (\text{Fourier law}), $$

where $\mu \ge 0$ is the first coefficient of viscosity (shear viscosity), $\zeta \ge 0$ is the second coefficient of viscosity (bulk viscosity), and $\kappa \ge 0$ is the thermal conductivity.

**Remark 3.8.** Another variational approach to the Navier-Stokes-Fourier system has been developed by Fukagawa and Fujitani [2012], in which the internal conversion due to frictional forces from the mechanical to the heat power in dissipated systems is written as nonholonomic constraints in the integral form over the fluid domain. However, this variational approach does not involve the variables $\Gamma$ nor $\Sigma$. Therefore, in their setting there is no systematic way to pass from a phenomenological constraint to a variational constraint, although it is quite essential when one consider several irreversible processes such as matter transfer and chemical reactions in addition to viscosity (see §4).

In our approach, we have established a variational formulation that enables to incorporate nonlinear nonholonomic constraints associated with nonequilibrium thermodynamics into the Lagrangian setting by using a generalized Lagrange-d'Alembert principle, and we have shown a systematic way to pass from the phenomenological constraint to the variational constraint by simply replacing the rate of each of the irreversible processes (e.g., $\dot{\Gamma}$ here) by the associated variations (e.g., $\delta\Gamma$ here). Furthermore, we have also shown a systematic procedure to pass from the material representation to the spatial representation through a Lagrangian reduction procedure based on relabelling symmetry.

# 4 Variational formulation for multicomponent reacting viscous fluids

In this section, we will extend the variational formulation for nonequilibrium thermodynamics to the case of a multicomponent fluid, which is subject to the irreversible processes associated to viscosity, heat transport, internal matter transport as well as chemical reactions. We will consider a fluid of $K$ chemical components $A = 1, \dots, K$ amongst which $r$ chemical reactions $a = 1, \dots, r$ are possible.

## 4.1 Material representation

We shall show that, despite the complexity of the system of equations for the nonequilibrium thermodynamics of a multicomponent reacting fluid, the Lagrangian variational formulation in material representation has still the same structure described in the previous examples. Again, the variational formulation in spatial representation is much more involved, however, it will be clearly explained by a reduction process associated to the relabelling symmetry applied to the material variational formulation.

Recall from example 2 in §2.3, that in absence of all the irreversible processes, the equations for a fluid with $K$ chemical components $A = 1, \dots, K$, follow from Hamilton's principle applied to a Lagrangian of the form $L_{g,\{N_A \text{ref}\}}, S_{\text{ref}}(\varphi, \dot{\varphi})$, where $N_A \text{ref}(X)$ denotes the number density of the substance $A = 1, \dots, K$ in the reference configuration and $S_{\text{ref}}(X)$
is the entropy density in the reference configuration. To these fixed fields are associated the continuity equations $\partial_t n_A + \text{div}(n_A \mathbf{v}) = 0$ and $\partial_t s + \text{div}(s \mathbf{v}) = 0$ in the spatial representation.

When irreversible processes are included, not only the entropy continuity equation is modified but also the continuity equations $\partial_t n_A + \text{div}(n_A \mathbf{v}) = 0$ for the substances A = 1, ..., K are modified, in which an additional current density and source density occur due to r chemical reactions a = 1, ..., r amongst the K substances. As a consequence, the number densities $N_A$ are no more fixed even in the material representation, but they become dynamic variables $N_A(t, X)$.

Accordingly, for the present case, we will make the following change in the notation of the Lagrangian:

$$L_{g, \{N_A\}_{\text{ref}}}, S_{\text{ref}}(\varphi, \dot{\varphi}) \rightsquigarrow L_g(\varphi, \dot{\varphi}, \{N_A\}, S).$$

The occurrence of the variables $N_A$ must be accompanied with their corresponding conjugate variables $W^A$ whose variation $\delta W^A$ would ensure $\frac{d}{dt}N_A = 0$ in the reversible case. This would amount to add the term $\int_B N_A \dot{W}^A \mu_{G_{\text{ref}}}$ in the action functional. In the irreversible case, however, the equation $\frac{d}{dt}N_A = 0$ has to be broken because of the additional current density and source density occurring due to r chemical reactions a = 1, ..., r amongst the K substances. This can be done by regarding $\dot{W}^A$ as a rate of $W^A$ associated to the irreversible processes of internal matter transfer, similarly to the velocity $\dot{\Gamma}$ associated to heat transfer in the preceding section. We assume that there is no matter transfer with the exterior. Based on these comments, we can now establish an appropriate variational formulation.

**Variational formulation for the nonequilibrium thermodynamics of a reacting multicomponent fluid.** The continuum version of the variational formulation in Theorem 4.1 in Part I adapted to the continuum case and to the setting of chemical reactions recalled in the introduction is given by

$$\delta \int_{t_1}^{t_2} \left( L_g(\varphi, \dot{\varphi}, \{N_A\}, S) + \int_B N_A \dot{W}^A \mu_{G_{\text{ref}}} + \int_B (S - \Sigma) \dot{\Gamma} \mu_{G_{\text{ref}}} \right) dt = 0 \qquad \text{VARIATIONAL CONDITION} \quad (4.1)$$

with phenomenological and chemical constraints

$$\frac{\partial \mathcal{L}}{\partial S} \dot{\Sigma} = -(\mathbf{P}^{\text{fr}})^{b_g} : \nabla \dot{\varphi} + \mathbf{J}_S \cdot d\dot{\Gamma} + \mathbf{J}_A \cdot d\dot{W}^A + J_a \dot{\nu}^a - \rho_{\text{ref}} R, \qquad \text{PHEN. CONSTR.} \quad (4.2)$$

$$\dot{\nu}^a = \nu_A^a \dot{W}^A, \quad a = 1, \dots, r, \qquad \text{CHEM. CONSTR.} \quad (4.3)$$

and their associated variational constraints

$$\frac{\partial \mathcal{L}}{\partial S} \delta \Sigma = -(\mathbf{P}^{\text{fr}})^{b_g} : \nabla \delta \varphi + \mathbf{J}_S \cdot d\delta \Gamma + \mathbf{J}_A \cdot d\delta W^A + J_a \delta \nu^a, \qquad \text{VAR. CONSTR.} \quad (4.4)$$

$$\delta \nu^a = \nu_A^a \delta W^A, \quad a = 1, \dots, r, \qquad \text{VAR. CONSTR.} \quad (4.5)$$

where $\nu_A^a := \nu_A''^a - \nu_A'^a$ and verify $\nu_A^a M^A = 0$ (Lavoisier law) meaning that mass is conserved in each separate chemical reaction a = 1, ..., r. In (4.2) and (4.4), $\mathbf{P}^{\text{fr}}(t, X)$ is the Piola-Kirchhoff friction stress tensor, $\mathbf{J}_S(t, X)$ is the entropy flux density, $\mathbf{J}_A(t, X)$ is the diffusive flux density of substance A, $J_a(t, X)$ is the chemical reaction rate of reaction a, and $\rho_{\text{ref}}(X)R(t, X)$ is the heat power supply density, all of which are expressed in material representation. In all these formulas, Einstein's summation convention is used. The variations $\delta \varphi$, $\delta W^A$, and $\delta \Gamma$ are assumed to vanish at the endpoint $(t = t_1, t_2)$. Total mass is conserved by assuming that the fluxes $\mathbf{J}_A$ verify

$$M^A \mathbf{J}_A(t, X) = 0, \quad \text{for all } A = 1, \dots, N. \qquad (4.6)$$
In a similar way to the simpler case of §3, the introduction of the variables $\Gamma, \Sigma$, and $W^A$ allows us to propose a variational formulation with the same clear and physically meaningful structure:

* The variational condition (4.1) is an extension of Hamilton's principle (2.4) for fluid dynamics in material representation. We note that the whole expression under the temporal integral can be interpreted as a Lagrangian $\bar{L}$ defined on the tangent bundle of the configuration space $Q = \text{Emb}(\mathcal{B}, S) \times [\mathcal{F}(\mathcal{B}) \times \mathcal{F}(\mathcal{B})^*]^K \times \mathcal{F}(\mathcal{B}) \times \mathcal{F}(\mathcal{B})^* \times \mathcal{F}(\mathcal{B})^*$, i.e.,

$$ \bar{L} = \bar{L}(\Psi, \dot{\Psi}) : TQ \to \mathbb{R}, $$

where $\Psi = (\varphi, \{W^A\}, \{N_A\}, \Gamma, \Sigma, S) \in Q$, $\mathcal{F}(\mathcal{B})$ is the space of real valued functions on $\mathcal{B}$, $\mathcal{F}(\mathcal{B})^*$ is its dual space of densities on $\mathcal{B}$, and $[\cdots]^K$ denotes the direct product of $k$ copies of $[\cdots]$.

* The phenomenological constraint (4.2) is the expression of the thermodynamic power density associated to all the irreversible processes involved: viscosity, heat transport, matter transport, chemical reactions, all of which are characterized by the thermodynamic fluxes $J_\alpha$ (as if it were forces in mechanics) acting on the thermodynamic affinities $X^\alpha$ regarded as the rates $\dot{\gamma}^\alpha$ (as if they were velocities in mechanics); namely $\mathbf{P}^{\text{fr}}$ "acting" on $\frac{d}{dt}\varphi$ and $\mathbf{J}_S$ "acting" on $\frac{d}{dt}\Gamma$, $\mathbf{J}_A$ "acting" on $\frac{d}{dt}W^A$ and $J_a$ "acting" on $\frac{d}{dt}\nu^a$, resulting in a power or rate of work density.

* The variational constraint (4.4) can be obtained by replacing velocities by virtual displacements associated to each of the irreversible processes, thereby expressing the variational constraint as a sum of virtual thermodynamic work densities. This interpretation is possible thanks to the introduction of the variables $\Gamma(t, X)$, $W^A(t, X)$, and $\nu_a(t, X)$ whose time derivative will be identified with the temperature $\mathcal{T}(t, X)$, the chemical potential $\Upsilon^A(t, X)$, and the affinity $\Lambda_a(t, X)$, respectively, all written in material representation.

**The equations of motion in material coordinates.** Since we assumed no-slip boundary conditions, we have $\delta\varphi|_{\partial\mathcal{B}} = 0$ and by computing the variations in (4.1), we obtain

$$ \int_{t_1}^{t_2} \int_{\mathcal{B}} \left[ \left( \frac{\partial \mathcal{L}}{\partial \varphi} - \text{DIV} \frac{\partial \mathcal{L}}{\partial T_X \varphi} - \frac{D}{Dt} \frac{\partial \mathcal{L}}{\partial \dot{\varphi}} \right) \delta\varphi + \frac{\partial \mathcal{L}}{\partial N_A} \delta N_A + \frac{\partial \mathcal{L}}{\partial S} \delta S \right. \\ \left. + \delta N_A \dot{W}^A - \dot{N}_A \delta W^A - (\dot{S} - \dot{\Sigma}) \delta\Gamma + (\delta S - \delta\Sigma) \dot{\Gamma} \right] \mu_{G_{\text{ref}}} dt = 0, $$

where we recall that $\mathcal{L}$ denotes the Lagrangian density as in (2.3).

Using the variational constraints (4.4), (4.5) and the fact that $\frac{\partial \mathcal{L}}{\partial S} \neq 0$, and collecting
the terms associated to the variations $\delta\varphi$, $\delta W^A$, $\delta N_A$, $\delta\Gamma$, and $\delta S$, one obtains

$$ \begin{aligned} \delta\varphi: \rho_{\text{ref}} \frac{DV}{Dt} &= \text{DIV} \left( \mathbf{P}^{\text{cons}} - \dot{\Gamma} \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} \mathbf{P}^{\text{fr}} \right) + \rho_{\text{ref}} \mathbf{B}^{\text{cons}}, \\ \delta N_A: \dot{W}^A &= - \frac{\partial \mathcal{L}}{\partial N_A}, \end{aligned} \quad (4.7) $$

$$ \begin{aligned} \delta W^A: \dot{N}_A &= \text{DIV} \left( \dot{\Gamma} \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} \mathbf{J}_A \right) - \dot{\Gamma} \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} J_a \nu_A^a, \\ \delta \Gamma: \dot{S} &= \text{DIV} \left( \dot{\Gamma} \left( \frac{\partial \mathcal{L}}{\partial S} \right)^{-1} \mathbf{J}_S \right) + \dot{\Sigma}, \end{aligned} \quad (4.8) $$

$$ \delta S: \dot{\Gamma} = - \frac{\partial \mathcal{L}}{\partial S}, \quad (4.9) $$

where $\mathbf{V}$, $\mathbf{P}^{\text{cons}}$ and $\mathbf{B}^{\text{cons}}$ are defined as before. Using the relations (4.7), (4.8), (4.9), and the chemical constraint (4.3) in the phenomenological constraint (4.2) yields

$$ \mathcal{T}(\dot{S} + \text{DIV} \mathbf{J}_S) = (\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot d\mathcal{T} - \mathbf{J}_A \cdot d\mathcal{Y}^A + J_a \Lambda^a + \rho_{\text{ref}} R, $$

where we recall that $\mathcal{T} := -\frac{\partial \mathcal{L}}{\partial S}$ is the temperature, $\mathcal{Y}^A := -\frac{\partial \mathcal{L}}{\partial N_A}$ is the chemical potential, and $\Lambda^a := -\nu_A^a \mathcal{Y}^A$ is the affinity, all in material representation.

If we impose the variation of $\Gamma$ and $W^A$ to vanish at the boundary, i.e., $\delta\Gamma|_{\partial\mathcal{B}} = \delta W^A|_{\partial\mathcal{B}} = 0$, then there are no supplementary boundary conditions arising from the variational formulation. If, however, $\delta\Gamma$, respectively, $\delta W^A$ has no constraints on the boundary, then it implies the condition

$$ \mathbf{J}_S \cdot \mathbf{N}^{b_G} = 0, \quad \text{respectively,} \quad \mathbf{J}_A \cdot \mathbf{N}^{b_G} = 0 \quad \text{on } \partial\mathcal{B}, $$

where $\mathbf{N}$ is the outward pointing unit normal vector field on $\partial\mathcal{B}$ relative to $G_{\text{ref}}$, that is, there is no transfer of heat or matter to the exterior. In this case, if $\rho_{\text{ref}} R = 0$, the fluid is adiabatically closed.

Our results are summarized as follows.

**Theorem 4.1** (Variational formulation for multicomponent reacting fluids – material representation). In material representation, the evolution equations are given by

$$ \left\{ \begin{array}{l} \rho_{\text{ref}} \frac{DV}{Dt} = \text{DIV}(\mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{fr}}) + \rho_{\text{ref}} \mathbf{B}^{\text{cons}}, \\ \\ \dot{N}_A + \text{DIV} \mathbf{J}_A = J_a \nu_A^a, \\ \\ \mathcal{T}(\dot{S} + \text{DIV} \mathbf{J}_S) = (\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \mathbf{V} - \mathbf{J}_S \cdot d\mathcal{T} - \mathbf{J}_A \cdot d\mathcal{Y}^A + J_a \Lambda^a + \rho_{\text{ref}} R, \end{array} \right. \quad (4.10) $$

with no-slip boundary conditions $\mathbf{V}|_{\partial\mathcal{B}} = 0$. These equations are obtained from the variational condition for nonequilibrium thermodynamics (4.1) with the phenomenological and chemical constraints (4.2) and (4.3), together with their associated variational constraints (4.4) and (4.5), where $\delta\Gamma|_{\partial\mathcal{B}} = \delta W^A|_{\partial\mathcal{B}} = 0$. If the constraint $\delta W^A|_{\partial\mathcal{B}} = 0$ and $\delta\Gamma|_{\partial\mathcal{B}} = 0$ are not imposed, then the variational formulation yields $\mathbf{J}_S \cdot \mathbf{N}^{b_G} = 0$ and $\mathbf{J}_A \cdot \mathbf{N}^{b_G} = 0$ and if, in addition, $\rho_{\text{ref}} R = 0$, then the fluid is adiabatically closed.
From the second equation in (4.10) and the mass conservation conditions $M^A \mathbf{J}_A = 0$ and $M^A \nu_A^a = 0$, it follows that the total mass density $\mathfrak{R} := M^A N_A$ is conserved as $\mathfrak{R} = 0$, where $M^A$ is the molar mass of the chemical component A.

External stress and body forces can be easily included in the variational picture, by augmenting (4.1) with the appropriate virtual work term (second term in (2.6)). In this case, the first equation above reads

$$ \rho_{\text{ref}} \frac{DV}{Dt} = \text{DIV}(\mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{fr}} + \mathbf{P}^{\text{ext}}) + \rho_{\text{ref}}(\mathbf{B}^{\text{cons}} + \mathbf{B}^{\text{ext}}). $$

**Remark 4.2** (Interpretation of $\Sigma$). Recall from (4.8) that the entropy balance equation is written as

$$ \dot{S} = - \text{DIV} \mathbf{J}_S + \dot{\Sigma}, $$

where the total (internal and external) entropy production of the system is given by

$$ \dot{\Sigma} = \frac{1}{\bar{\mathfrak{F}}} \left[ (\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot d\bar{\mathfrak{F}} - \mathbf{J}_A \cdot d\Upsilon^A + J_a \Lambda^a + \rho_{\text{ref}} R \right]. $$

In order to complete the system (4.10) it is necessary to specify the phenomenological expressions for $\mathbf{P}^{\text{fr}}$, $\mathbf{J}_S$, $\mathbf{J}_A$, and $J^a$ in accordance with the second law of thermodynamics. The second law, applied locally, imposes that these expressions are such that the internal entropy production density $I$ be positive

$$ I = \frac{1}{\bar{\mathfrak{F}}} \left[ (\mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} - \mathbf{J}_S \cdot d\bar{\mathfrak{F}} - \mathbf{J}_A \cdot d\Upsilon^A + J_a \Lambda^a \right] \geq 0. \quad (4.11) $$

Using the expression $\frac{d}{dt} \mathfrak{E} = (\mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} - \text{DIV}(\mathbf{J}_Q + \mathbf{J}_A \Upsilon^A) + \rho_{\text{ref}} R$ for the internal energy balance in material representation and replacing the heat power supply by using the entropy inequality $\dot{S} + \text{DIV} J_S \geq \frac{1}{\bar{\mathfrak{F}}} \rho_{\text{ref}} R$, (or, in Clausius form $\dot{S} \geq - \text{DIV} (\frac{1}{\bar{\mathfrak{F}}} \mathbf{J}_Q) + \frac{1}{\bar{\mathfrak{F}}} \rho_{\text{ref}} R$), we obtain a reformulation of (4.11) that generalizes the Clausius-Duhem inequality (3.10) to the case of the multicomponent reacting fluid, namely,

$$ \dot{S} - \frac{1}{\bar{\mathfrak{F}}} \dot{\mathfrak{E}} + \frac{1}{\bar{\mathfrak{F}}} (\mathbf{P}^{\text{cons}} + \mathbf{P}^{\text{fr}})^{b_g} : \nabla^g \dot{\varphi} - \frac{1}{\bar{\mathfrak{F}}^2} \mathbf{J}_Q \cdot d\bar{\mathfrak{F}} - \frac{1}{\bar{\mathfrak{F}}} \text{DIV}(\mathbf{J}_A \Upsilon^A) \geq 0. $$

## 4.2 Spatial representation

In a similar way to §3.2, the passage from the material to the spatial description follows from the material relabelling symmetry through a Lagrangian reduction procedure in material variables described in §4.1. In spatial coordinates, the Lagrangian of the multicomponent fluid reads

$$ \ell(\mathbf{v}, \{n_A\}, s) = \int_S \frac{1}{2} \rho |\mathbf{v}|_g^2 \mu_g - \int_S \varepsilon(\{n_A\}, s) \mu_g, $$

where we recall that $\rho := \sum_{A=1}^N M^A n_A$, is the total mass density. In addition to the reduced variables in (3.12), we need to define

$$ n_A = N_A \circ \varphi^{-1} J_{\varphi}^{-1}, \quad w^A = W^A \circ \varphi^{-1}, \quad \nu^a = \nu^a \circ \varphi^{-1}. $$

Under these changes of variables, the variational formulation in material representation (4.1) reads

$$ \delta \int_{t_1}^{t_2} \left( \ell(\mathbf{v}, \rho, s) + \int_S (\partial_t w^A + \mathbf{d} w^A \cdot \mathbf{v}) n_A \mu_g + \int_S (s - \sigma)(\partial_t \gamma + \mathbf{d} \gamma \cdot \mathbf{v}) \mu_g \right) dt = 0 \quad (4.12) $$
in spatial representation. Similarly, the material phenomenological and chemical constraints
together with their associated variational constraints (4.2), (4.3), (4.4), (4.5) read

$$
\begin{equation}
\begin{split}
\frac{\delta \ell}{\delta s} (\partial_t \sigma + \operatorname{div}(\sigma \mathbf{v})) = & - (\boldsymbol{\sigma}^{\mathrm{fr}})^{\beta_g} : \nabla^g \mathbf{v} + \mathbf{j}_S \cdot \mathbf{d}(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \\
& + \mathbf{j}_A \cdot \mathbf{d}(\partial_t w^A + \mathbf{d}w^A \cdot \mathbf{v}) + j_a(\partial_t v^a + \mathbf{d}v^a \cdot \mathbf{v}) - \rho r,
\end{split}
\tag{4.13}
\end{equation}
$$

$$
\partial_t v^a + \mathbf{d}v^a \cdot \mathbf{v} = \nu_A^a (\partial_t w^A + \mathbf{d}w^A \cdot \mathbf{v}), \quad (4.14)
$$

$$
\begin{equation}
\begin{split}
\frac{\delta \ell}{\delta s} (\delta \sigma + \operatorname{div}(\sigma \zeta)) = & - (\boldsymbol{\sigma}^{\mathrm{fr}})^{\beta_g} : \nabla^g \zeta + \mathbf{j}_S \cdot \mathbf{d}(\delta\gamma + \mathbf{d}\gamma \cdot \zeta), \\
& + \mathbf{j}_A \cdot \mathbf{d}(\delta w^A + \mathbf{d}w^A \cdot \zeta) + j_a(\delta v^a + \mathbf{d}v^a \cdot \zeta) - \rho r,
\end{split}
\tag{4.15}
\end{equation}
$$

$$
\delta v^a + \mathbf{d}v^a \cdot \zeta = \nu_A^a (\delta w^A + \mathbf{d}w^A \cdot \zeta) \quad (4.16)
$$

in spatial representation. Here, **j**<sub>S</sub> and **σ**<sup>fr</sup> in spatial representation are defined as in (3.16),
while **j**<sub>A</sub>, j<sub>a</sub> and *r* are respectively defined by

$$
\mathbf{j}_A := (\varphi_* \mathbf{J}_A) J_{\varphi}^{-1}, \quad j_a := J_a \circ \varphi^{-1} J_{\varphi}^{-1} \quad \text{and} \quad r := R \circ \varphi^{-1}.
$$

As in §3.2 above, we choose variations of the form $\delta\mathbf{v} = \partial_t\zeta + [\mathbf{v}, \zeta]$, where $\zeta = \delta\varphi \circ \varphi^{-1}$ is
an arbitrary curve vanishing at the endpoints, and the variations of the variables $n_A$, $w^A$,
$s$, $\sigma$, and $\gamma$ verify the variational constraints, and $\delta w^A$ and $\delta\gamma$ vanish at endpoints.

Taking the variations of the action integral (4.12) and using the divergence theorem with
the boundary condition $\mathbf{v}|_{\partial S} = 0$, we have

$$
\int_{t_1}^{t_2} \int_S \left( \frac{\delta \ell}{\delta \mathbf{v}} \cdot (\partial_t \zeta + [\zeta, \mathbf{v}]) + \frac{\delta \ell}{\delta n_A} \delta n_A + \frac{\delta \ell}{\delta s} \delta s - (\partial_t n_A + \operatorname{div}(n_A \mathbf{v})) \delta w^A \right. \\
+ \delta n_A (\partial_t w^A + \mathbf{d}w^A \cdot \mathbf{v}) + n_A \mathbf{d}w^A \cdot (\partial_t \zeta + [\zeta, \mathbf{v}]) - [\partial_t (s-\sigma) + \operatorname{div}((s-\sigma)\mathbf{v})] \delta \gamma \\
\left. + (\delta s - \delta \sigma)(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) + (s-\sigma)\mathbf{d}\gamma \cdot (\partial_t \zeta + [\zeta, \mathbf{v}]) \right) \mu_g dt = 0.
$$

Using the divergence theorem with the boundary condition $\zeta|_{\partial S} = 0$, the variational con-
straints (4.15) and (4.16), the fact that $\frac{\delta \ell}{\delta s} \neq 0$, and collecting the terms associated to the
variations $\zeta$, $\delta n_A$, $\delta w^A$, $\delta \gamma$, $\delta s$, we obtain

$$
\begin{equation}
\begin{split}
\zeta : (\partial_t + \mathrm{ad}_{\mathbf{v}}^*) \left( \frac{\delta \ell}{\delta \mathbf{v}} + (s-\sigma)\mathbf{d}\gamma \right) - \rho \frac{\delta \ell}{\delta \rho} + \sigma \mathbf{d}(\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) & \quad (4.17) \\
& + \mathrm{div} \left( (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} \boldsymbol{\sigma}^{\mathrm{fr}} \right) - \mathrm{div} \left( (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} \mathbf{j}_S \right) \cdot \mathbf{d}\gamma = 0,
\end{split}
\end{equation}
$$

$$
\delta n_A : \partial_t w^A + \mathbf{d}w^A \cdot \mathbf{v} = - \frac{\delta \ell}{\delta n_A}, \quad (4.18)
$$

$$
\delta w_A : \partial_t n_A + \operatorname{div}(n_A \mathbf{v}) = \operatorname{div} \left( (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} \mathbf{j}_A \right) - (\partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left( \frac{\delta \ell}{\delta s} \right)^{-1} j_a \nu_A^a, \quad (4.19)
$$

$$
\delta\gamma : \partial_t(s - \sigma) + \operatorname{div}((s - \sigma)\mathbf{v}) = \operatorname{div} \left( (\partial_t\gamma + \mathbf{d}\gamma \cdot \mathbf{v}) \left(\frac{\delta\ell}{\delta s}\right)^{-1} \mathbf{j}_S \right), \quad (4.20)
$$

$$
\delta s : \partial_t \gamma + \mathbf{d}\gamma \cdot \mathbf{v} = - \frac{\delta \ell}{\delta s}, \qquad (4.21)
$$
where we assumed $\delta\gamma|_{\partial S} = 0$ and $\delta w^A|_{\partial S} = 0$. Using (4.19), (4.20), and (4.21) in the phenomenological constraint (4.13) leads to

$$T(\partial_t s + \mathrm{div}(s\mathbf{v}) + \mathrm{div}\mathbf{j}_S) = (\boldsymbol{\sigma}^{\mathrm{fr}})^{b_g} : \mathrm{Def}\mathbf{v} - \mathbf{j}_S \cdot \mathrm{d}T - \mathbf{j}_A \cdot \mathrm{d}\mu^A + j_a A^a + \rho r,$$

where $T := -\frac{\delta l}{\delta s} = \frac{\partial \varepsilon}{\partial s}$ is the temperature, $\mu^A := \frac{\partial \varepsilon}{\partial n_A}$ is the chemical potential, and $A^a := -\nu_A^a \mu^A$ is the affinity, all in spatial representation. Note that $\frac{\delta l}{\delta n_A} = \frac{1}{2}M^A|\mathbf{v}|_g^2 - \mu_A$, but the contribution of the first term vanishes in (4.13) because of (4.6).

If $\delta\gamma|_{\partial S}$ and $\delta w^A|_{\partial S}$ are free, then we obtain the conditions:

$$\mathbf{j}_S \cdot \mathbf{n}^{b_g} = 0 \quad \text{and} \quad \mathbf{j}_A \cdot \mathbf{n}^{b_g} = 0 \quad \text{on} \quad \partial S, \qquad (4.22)$$

where $\mathbf{n}$ is the outward pointing unit normal vector field on $\partial S$ relative to $g$. In this case, if $r\rho = 0$, the fluid is adiabatically closed.

Our results are summarized as follows.

**Theorem 4.3** (Variational formulation for multicomponent reacting fluids – spatial representation). In spatial representation, the evolution equation are given by

$$\left\{
\begin{array}{l}
\rho(\partial_t \mathbf{v} + \mathbf{v} \cdot \nabla \mathbf{v}) = -\mathrm{grad} p + \mathrm{div} \boldsymbol{\sigma}^{\mathrm{fr}}, \quad p = \frac{\partial \varepsilon}{\partial n_A} n_A + \frac{\partial \varepsilon}{\partial s} s - \varepsilon, \\
\partial_t n_A + \mathrm{div}(n_A \mathbf{v}) + \mathrm{div} \mathbf{j}_A = j_a \nu_A^a, \\
T(\partial_t s + \mathrm{div}(s \mathbf{v}) + \mathrm{div} \mathbf{j}_S) = (\boldsymbol{\sigma}^{\mathrm{fr}})^{b_g} : \mathrm{Def} \mathbf{v} - \mathbf{j}_S \cdot \mathrm{d}T - \mathbf{j}_A \cdot \mathrm{d}\mu^A + j_a A^a + \rho r,
\end{array}
\right.
\qquad (4.23)$$

where $T = -\frac{\delta l}{\delta s} = \frac{\partial \varepsilon}{\partial s}$, $\mu^A = -\frac{\partial \varepsilon}{\partial n_A} = \frac{\partial \varepsilon}{\partial n_A}$, and $A^a = -\nu_A^a \mu^A$. These equations arise from the variational condition (4.12), where $\mathbf{v}, n_A, w^A, s, \gamma, \sigma, v^a$ satisfy the phenomenological and chemical constraints (4.13)-(4.14) and for variations of the form $\delta\mathbf{v} = \partial_t \zeta + [\zeta, \mathbf{v}]$, $\delta n_A$, $\delta w^A$, $\delta s$, $\delta\gamma$, $\delta\sigma$, $\delta v^a$ such that $\zeta$, $\delta\sigma$, $\delta w^A$, $\delta v^a$, $\delta\gamma$ verify the variational constraints (4.15)-(4.16) and with $\delta\gamma|_{\partial S} = \delta w^A|_{\partial S} = 0$. Direct computations using (4.21) and (4.18)-(4.20) in (4.17) and in the phenomenological constraint (4.13) leads to (4.23). If the constraint $\delta\gamma|_{\partial S} = 0$ and $\delta w^A|_{\partial S} = 0$ are not imposed, then the variational formulation yields $\mathbf{j}_S \cdot \mathbf{n}^{b_g} = 0$ and $\mathbf{j}_A \cdot \mathbf{n}^{b_g} = 0$ and if, in addition, $r\rho = 0$, then the fluid is adiabatically closed.

**Remark 4.4** (Interpretation of $\boldsymbol{\sigma}$). As before, the Lagrangian time derivative of the variable $\boldsymbol{\sigma}$ corresponds to the total (internal and external) entropy production density of the system and it follows from (4.20) that

$$\partial_t \boldsymbol{\sigma} + \mathrm{div}(\boldsymbol{\sigma} \mathbf{v}) = \frac{1}{T} \left( (\boldsymbol{\sigma}^{\mathrm{fr}})^{b_g} : \nabla \mathbf{v} - \mathbf{j}_S \cdot \mathrm{d}T - \mathbf{j}_A \cdot \mathrm{d}\mu^A + j_a A^a + \rho r \right) = i + \frac{r\rho}{T},$$

where $i$ is the internal entropy production density and hence, of course, $r\rho/T$, is the external entropy production density. Since the second law of thermodynamics implies $i \ge 0$, for the total entropy, the relation (3.22) is kept unchanged, except the fact that the expression of $i$ is different.

**Remark 4.5** (Energy balance). The total energy density $e := \frac{1}{2}\rho|\mathbf{v}|_g^2 + \varepsilon(\{n_A\}, s)$ satisfies the equation

$$\partial_t e + \mathrm{div}(e\mathbf{v}) = \mathrm{div}(\boldsymbol{\sigma}^{b_g} \cdot \mathbf{v}) - \mathrm{div}\mathbf{j}_Q - \mathrm{div}(\mathbf{j}_A \mu^A) + \rho r,$$

so that the total energy $E(t) = \int_S e(t, x)\mu_g(x)$ verifies the balance law

$$\frac{d}{dt} E(t) = - \int_{\partial S} \mathbf{j}_Q \cdot \mathbf{n}^{b_g} \mu_g^{\partial} - \int_{\partial S} \mu^A \mathbf{j}_A \cdot \mathbf{n}^{b_g} \mu_g^{\partial} + \int_S r \rho \mu_g = P_H^{\mathrm{ext}}(t) + P_M^{\mathrm{ext}}(t).$$

We consistently have $\frac{d}{dt} E = 0$ in the adiabatically closed case, i.e., $\mathbf{j}_Q \cdot \mathbf{n}^{b_g} = \mathbf{J}_A \cdot \mathbf{n}^{b_g} = 0$ (see (4.22)) and $r\rho = 0$.
**Remark 4.6** (General Lagrangian). For a general Lagrangian $\ell(\mathbf{v}, \{n_A\}, s)$, the variational formulation yields the system

$$ \left\{ \begin{array}{l} (\partial_t + \mathrm{ad}_{\mathbf{v}}^*) \frac{\delta \ell}{\delta \mathbf{v}} = \rho \mathbf{d} \frac{\delta \ell}{\delta \rho} + s \mathbf{d} \frac{\delta \ell}{\delta s} + \mathrm{div} \, \boldsymbol{\sigma}^{\mathrm{fr}}, \quad \partial_t n_A + \mathrm{div}(n_A \mathbf{v}) + \mathrm{div} \, \mathbf{j}_A = j_a \nu_A^a, \\ \\ \frac{\delta \ell}{\delta s} (\partial_t s + \mathrm{div}(s \mathbf{v}) + \mathrm{div} \, \mathbf{j}_S) = -(\boldsymbol{\sigma}^{\mathrm{fr}})^{b,g} : \nabla \mathbf{v} - \mathbf{j}_S \cdot \mathbf{d} \frac{\delta \ell}{\delta s} - \mathbf{j}_A \cdot \mathbf{d} \frac{\delta \ell}{\delta n_A} - j_a \nu_A^a \frac{\delta \ell}{\delta n_A} + r \rho. \end{array} \right. $$

**Remark 4.7** (Thermodynamic phenomenology and Onsager's relations). The system of equations (4.23) needs to be supplemented with phenomenological expressions for the thermodynamic fluxes $J_\alpha$ (i.e., $\boldsymbol{\sigma}^{\mathrm{fr}}$, $\mathbf{j}_S$, $\mathbf{j}_A$, and $j_a$) in terms of the thermodynamic affinities $X^\alpha$ (i.e., Def $\mathbf{v}$, $d\mathbf{T}$, $d\mu^A$, $A^a = -\nu_A^a\mu^A$) compatible with the second law $I = J_\alpha X^\alpha \ge 0$, where $I$ is the internal entropy production density. It is empirically accepted that for a large class of irreversible processes and under a wide range of experimental conditions, the thermodynamic fluxes $J_\alpha$ are linear functions of the thermodynamic affinities $X^\alpha$, i.e., $J_\alpha = \mathcal{L}_{\alpha\beta}X^\beta$, where the transport coefficients $\mathcal{L}_{\alpha\beta}(\dots)$ are state functions that must be determined by experiments or if possible by kinetic theory. Besides defining a positive quadratic form, the coefficients $\mathcal{L}_{\alpha\beta}(\dots)$ must also satisfy Onsager's reciprocal relations (Onsager [1931]) due to the microscopic time reversibility and the Curie principle associated to material invariance (see, for instance, de Groot and Mazur [1969], Kondepudi and Prigogine [1998], Woods [1975]). In the case of the multicomponent fluid, writing $(\boldsymbol{\sigma}^{\mathrm{fr}})^{(0)} = \boldsymbol{\sigma}^{\mathrm{fr}} - \frac{1}{3}(\mathrm{Tr} \, \boldsymbol{\sigma}^{\mathrm{fr}})g^\sharp$ and, similarly, $(\mathrm{Def} \, \mathbf{v})^{(0)} = \mathrm{Def} \, \mathbf{v} - \frac{1}{3}(\mathrm{div} \, \mathbf{v})\delta$, we have the following phenomenological linear relations

$$ - \begin{bmatrix} \mathbf{j}_S \\ \mathbf{j}_A \end{bmatrix} = \begin{bmatrix} \mathcal{L}_{SS} & \mathcal{L}_{SB} \\ \mathcal{L}_{AS} & \mathcal{L}_{AB} \end{bmatrix} \begin{bmatrix} \mathbf{d}T \\ \mathbf{d}\mu^B \end{bmatrix}, \quad \begin{bmatrix} \mathrm{Tr} \, \boldsymbol{\sigma}^{\mathrm{fr}} \\ j_a \end{bmatrix} = \begin{bmatrix} \mathcal{L}_{00} & \mathcal{L}_{0b} \\ \mathcal{L}_{a0} & \mathcal{L}_{ab} \end{bmatrix} \begin{bmatrix} \frac{1}{3} \mathrm{div} \, \mathbf{v} \\ A^b \end{bmatrix}, \quad (\boldsymbol{\sigma}^{\mathrm{fr}})^{(0)} = 2\mu(\mathrm{Def} \, \mathbf{v}^{\sharp g})^{(0)}, $$

where all the coefficients may depend on $(s, \{n_A\})$. The first linear relation describes the vectorial phenomena of heat conduction (Fourier law), diffusion (Fick law) and their cross effects (Soret and Dufour effects), while the second relation describes the scalar processes of bulk viscosity and chemistry and their possible cross-phenomena. The associated friction stress reads

$$ \boldsymbol{\sigma}^{\mathrm{fr}} = 2\mu \mathrm{Def} \, \mathbf{v} + \left( \frac{1}{9} \mathcal{L}_{00} - \frac{2}{3}\mu \right) (\mathrm{div} \, \mathbf{v}) g^{\sharp} + \frac{1}{3} \mathcal{L}_{0b} A^b g^{\sharp}, $$

(compare with (3.7)). The condition $M^A \mathbf{j}_A = 0$ is satisfied if $M^A \mathcal{L}_{AS} = M^A \mathcal{L}_{AB} = 0$.

All these phenomenological considerations take place in the phenomenological constraint (4.13) or (4.2) and the associated variational constraints (4.15) or (4.4), but they are not involved in the variational condition (4.12) or (4.1). Note that our variational formulation holds independently on the linear character of the phenomenological laws.

**Remark 4.8** (Analogy between thermodynamics and mechanics). In our approach, we have rewritten the thermodynamic power $J_\alpha X^\alpha$ associated to an irreversible process $\alpha$ by introducing the thermodynamic displacement $\Lambda^\alpha$ such that $X^\alpha = \dot{\Lambda}^\alpha$. In this way, the power $J_\alpha X^\alpha = J_\alpha \dot{\Lambda}^\alpha$ takes a similar form with the mechanical power $\langle F^{\mathrm{fr}}, \dot{q} \rangle$. By employing this analogy with mechanics, the thermodynamic affinities $X^\alpha = \dot{\Lambda}^\alpha$, such as $\dot{\varphi}$, $\dot{\Gamma}$, $\dot{W}^A$, $\dot{v}^a$, may be interpreted as velocities, while the thermodynamic fluxes $J_\alpha$, such as $\mathbf{P}^{\mathrm{fr}}$, $\mathbf{J}_S$, $\mathbf{J}_A$, $J_a$, as friction forces paired with these velocities.

# 5 Conclusions

In this paper, we have established a Lagrangian variational formulation for the nonequilibrium thermodynamics of continuum systems by extending the formulation of discrete
systems presented in Part I of this paper. From a mathematical point of view, this variational formulation is an extension of the standard Lagrange-d'Alembert principle used in nonholonomic mechanics. In this extension, the nonholonomic constraint is nonlinear and is given by the expression of the entropy production associated to all the irreversible processes involved.

To achieve this goal, we have employed an analogy between thermodynamics and mechanics, in which the thermodynamic affinities are regarded as a rate of the thermodynamic displacement $\Lambda$, (i.e., $X^{\alpha} = \dot{\Lambda}^{\alpha}$), associated to each irreversible process. This allows us to formulate the associated variational constraint in a systematic way, namely, by replacing all the velocities by their corresponding virtual displacement $\delta\Lambda^{\alpha}$ and by removing the effect of the exterior of the system:

$$J_{\alpha}\dot{\Lambda}^{\alpha} + P^{\text{ext}} \rightsquigarrow J_{\alpha}\delta\Lambda^{\alpha}.$$

Our variational formulation has thus a clear and systematic structure that appears to be common for the macroscopic description of the nonequilibrium thermodynamics of physical systems. In particular, it applies to both discrete systems (i.e., systems with finite degrees of freedom) and continuum systems (i.e., systems with infinite degrees of freedom). It has been illustrated in Part II with the examples of a viscous heat conducting fluid and its multicomponent extension including chemical reactions and mass transfer.

**Acknowledgements.** The authors thank C. Gruber for extremely helpful discussions. F.G.B. is partially supported by the ANR project GEOMFLUID, ANR-14-CE23-0002-01; H.Y. is partially supported by JSPS JSPS (Grant-in-Aid for Scientific Research 26400408, Grant-in-Aid for Scientific Research 16KT0024), JST (CREST), Waseda University (SR 2014B-162, SR 2015B-183), the IRSES project "Geomech" (246981) within the 7th European Community Framework Programme, and the MEXT "Top Global University Project" at Waseda University.

## References

Bretherton, F. P. [1970], A note on Hamilton's principle for perfect fluids, *J. Fluid Mech.*, **44**, 19-31.

de Groot, S. R and P. Mazur [1969], *Nonequilibrium Thermodynamics*, North-Holland.

Eckart, C. [1960], Variation principles of hydrodynamics, *Phys. Fluids*, **3**, 421-427.

Fukagawa, H. and Y. Fujitani [2012], A variational principle for dissipative fluid dynamics, *Prog. Theor. Phys.* **127**(5), 921-935.

Gay-Balmaz, F., J. E. Marsden, and T. S. Ratiu [2012], Reduced variational formulations in free boundary continuum mechanics. *J. Nonlinear Sc.* **22**, 553-597.

Gay-Balmaz, F. and H. Yoshimura [2015], Dirac reduction for nonholonomic mechanical systems and semidirect products, *Advances in Applied Mathematics*, **63**, 131-213.

Herivel, J. W. [1955], The derivation of the equations of motion of an ideal fluid by Hamilton's principle, *Proc. Cambridge Philos. Soc.* **51**, 344-349.

Holm, D. D., J. E. Marsden and T. S. Ratiu [1998], The Euler-Poincaré equations and semidirect products with applications to continuum theories, *Adv. in Math.* **137**, 1-81.

Kondepudi, D. and I. Prigogine [1998], *Modern Thermodynamics*, John Wiley & Sons.
Lavenda, B. H. [1978], *Thermodynamics of Irreversible Processes*, Macmillan, London.

Lin, C. C. [1963], *Liquid Helium*, Proc. Int. School of Physics, Course XXI. New-York: Academic Press.

Marsden, J. E. and T. J. R. Hughes [1983], *Mathematical Foundations of Elasticity* (Prentice Hall, New York, 1983) (reprinted by Dover, New York, 1994).

Onsager, L. [1931], *Reciprocal relations in irreversible processes I*, Phys. Rev. **37**, 405-426; *Reciprocal relations in irreversible processes II*, Phys. Rev. **38**, 2265-2279.

Oster, G. F., A. S. Perelson, A. Katchalsky [1973], *Network thermodynamics: dynamic modelling of biophysical systems*, Quarterly Reviews of Biophysics, **6**(1), 1-134.

Seliger, R. L. and G. B. Whitham [1968], *Variational principles in continuum mechanics*, Proc. Roy. Soc. A. **305**, 1-25.

Serrin, J. [1959], *Mathematical principles of classical fluid mechanics*, Handbuch der Physik VIII-I, 125-263, Berlin, Springer-Verlag.

Simo, J. C., J. E. Marsden and P. S. Krishnaprasad [1988], *The Hamiltonian structure of nonlinear elasticity: The material, spatial and convective representations of solids, rods and plates*, Arch. Rational Mech. Anal., **104**, 125-183.

Truesdell, C. and R. Toupin [1960], *The classical field theories*, Handbuch der Physik III-I, 226-790, Berlin, Springer-Verlag.

Woods, L. C. [1975], *The Thermodynamics of Fluid Systems*, Clarendon Press Oxford 1975.