GENERIC framework for reactive fluid flows

We describe reactive fluid flows in terms of the formalism General Equation for Non‐Equilibrium Reversible‐Irreversible Coupling also known as GENERIC. We present the thermodynamical and mechanical foundations for the treatment of fluid flows using GENERIC and present a framework for noninvertible transformations, that is in particular applied to transformations of variational approaches between Lagrangian and Eulerian coordinates. We bring the abstract framework to life by providing many physically relevant examples for reactive compressible fluid flows.

Here we follow the GENERIC approach [26][27][28][29] in order to provide a variational structure for the models under consideration. GENERIC, the acronym for General Equations of Non-Equilibrium Reversible Irreversible Coupling, characterizes the evolution of a thermodynamical system in terms of a state space, thermodynamical potentials such as total energy and entropy functionals, and geometric structures̄and̄which encode the reversible (Hamiltonian) or irreversible (Onsager) nature of a process. The evolution of a state vector̄∶ [0, ] → describing the mechanical and thermodynamical properties of the system is then given bȳ ( ) =̄(̄( ))D(̄( )) +̄(̄( ))D(̄( )).
( ) Compatibility with the laws of thermodynamics is encoded in the properties of̄and̄, and in combination with the noninteraction conditions (NIC)̄(̄)D(̄) ≡ 0 and̄(̄)D(̄) ≡ 0, which ensure conservation of the total energy and increase of the entropy for thermodynamically closed systems. GENERIC includes equilibrium thermodynamics as the set of stationary states. The aim of this work is to give a mathematically detailed and practically accessible presentation of the GENERIC formulation for reactive compressible flows in Lagrangian and Eulerian coordinates and to develop a general formalism for transformations T ∶ →  of GENERIC formulations between different sets of variables and coordinate systems by means of invertible and noninvertible transformations, that is, change of variables, change of coordinates, reductions, and extensions. While there exist many works on Eulerian descriptions for complex fluids, our fundamental work is the prerequisite to investigate fundamental aspects of complex Lagrangian descriptions and provides the toolset to explore model hierachies. A central theme of this work is the approach using integral functionals ∶ → ℝ defined using densitiess uch that(̄) = ∫Ω̄(̄(̄)) d̄.
In the following, the state space is understood as a subset of a Banach space, whose elements̄= (̄1,̄2, …) ∈ have components̄that are real scalar or vector-valued functions defined onΩ. Geometric approaches to variational problems sometimes formulate the equations for evolution in state spaces that are manifolds  =, for example, cf. [12,39], so that a distinction of manifold  and tangent spaces̄ at̄∈  becomes necessary. We avoid this by assuming to be a linear space and usē = {̄} × and *  = {̄} × * , and elaborate on this assumption where needed.
In this spirit, in Section 2 we first give a brief introduction to the thermomechanics of single-phase multicomponent systems in Lagrangian coordinates and to the kinematics of densities based on flow maps and their transformation to Eulerian coordinates. Details and the notation for thermodynamics will be briefly introduced in Section 2.1 and the kinematics of fields and transformations will be detailed in Section 2.2. Next, in Section 3 we will introduce basic ingredients for reversible Hamiltonian dynamics in Section 3.1 and for irreversible Onsager dynamics in Section 3.2. These are the building blocks of the coupled GENERIC formulation in Section 3.3. Invertible and noninvertible mappings of variational formulations, in particular the reduction formalism, will then be discussed in Section 3.4. For this, the validity of so-called closure conditions will be crucial for a transformed structure to posses the properties of a GENERIC structure again. All formal constructions are supplemented with finite-dimensional examples. Starting in Section 4, these concepts are applied to fluid dynamics. First, in Section 4.1 the Hamiltonian description of ideal fluids is provided and in Section 4.2 extended to the Navier-Stokes equations. In Section 4.3 we study the limit case of a quasi-stationary flow. Next, in Section 5 we introduce additional irreversible processes that should be coupled to the fluid flow. The Onsager structure for reaction kinetics with detailed balance is discussed in Section 5.1, heat conduction is presented in Section 5.2, multi-component diffusion processes are shown in Section 5.3, and cross-coupling effects shortly discussed in Section 5.4. In the final Section 6 we couple all the structures for viscous fluid flows and the additional irreversible processes to construct the GENERIC system for reactive compressible viscous flows. Therefore, in Section 6.1 the GENERIC structure and the equations are presented in Lagrangian and Eulerian form for internal energy, entropy, and temperature as variables. Then, in Section 6.2 we provide evolution equations in terms of pressure and temperature variables for the Darcy flow.
But first we provide a table introducing the most common symbols in the paper, a short definition and the location of their first appearance.

FUNDAMENTALS OF THERMOMECHANICS
In this section, we collect the main tools necessary to understand the GENERIC framework for reactive fluid flows: First, in Section 2.1 we review some generally known facts about equilibrium thermodynamics to introduce our notation and remind the reader of some key concepts. Subsequently, in Section 2.2 we combine the thermodynamical description with a Lagrangian formulation of continuum mechanics, focusing on the role of the kinematic relationships of deformations and densities as the basis for an operator approach to thermomechanics.

Equilibrium thermodynamics
In the following, we collect certain facts from equilibrium thermodynamics that will be useful for the GENERIC framework in Sections 2.2-6. GENERIC itself contains equilibrium thermodynamics as stationary states for time → ∞ (see maximum entropy principle, Thm. 3.5, iv). Continuum thermodynamics provides a description of many-particle systems, when individual particle trajectories become meaningless. Under certain homogeneity assumptions, one can define state variables for averaged macroscopic observables representing the thermodynamic state of a system. These variables can either measure a quality or quantity of the system and we distinguish the following two types of variables: a) Extensive state variables (quantity) behave additively when systems are brought into contact. Examples are the volumē∈ ℝ, the internal energȳ∈ ℝ, the entropȳ∈ ℝ, particle numbers̄∈ ℝ , or momentum̄∈ ℝ . In general we use capital roman letters to denote an extensive quantity, with the mass̄as the only exception from this convention. A general vector composed of extensive state variables is denoted bȳ. b) Intensive state variables (quality) remain constant when systems are brought into contact. Examples for such properties are the pressurē∈ ℝ, the temperaturē∈ ℝ, the chemical potential̄∈ ℝ , or the velocitȳ∈ ℝ . In general we use small Greek letters to denote intensive state variables. A general vector composed of intensive state variables is denoted bȳ. For notational simplicity, we use the same symbol to denote the state and the corresponding state function but add subscripts that emphasize that̄⋄ and̄⋄ are functions. The subscript on̄⋄ is the only exception from this convention. Since there can be multiple state functions̄⋄ for the same variablēdepending on different selections of state variables in̄⋄, we replace the subscript '⋄' by an index clarifying the selection, see Table 1. With this notation, extensive and intensive states and state functions are characterized by the following homogeneity properties. The microscopic assumptions in models from statistical physics that lead to the homogeneity properties (2.2) and also their limitations are rarely considered in detail, for example, see the discussion in [ [40], Section 5.5.1 and 5.5.2]. However, Axiom 2.1 and its foundation are crucial for the following construction and for the relation of extensive quantities in Lagrangian and Eulerian frames, that will be introduced later. Definition 2.2. Consider a thermodynamic system with extensive variables̄and intensive variables̄, and equations of state with homogeneity properties (2.1). Then, by choosing =̄, we define the following volume-specific state functions ⋄ ( , ) ∶=̄− 1̄⋄ (̄,̄), (2.3a) ⋄ ( , ) ∶=̄⋄(̄,̄), (2.3b) with corresponding volume-specific state variables =̄∕̄and =̄. Note that the volumēis no more contained in the volume-specific state vector and the new state functions. Similarly, other extensive variables can be used as a reference as well.
A thermodynamic state vector̄= (̄,̄) ∈ is assumed to be composed of a (possibly empty) vector of intensive state variables̄and a vector of (at least one) extensive state variables̄, which are independent and chosen such that, together with the equations of state, the thermodynamic state is fully characterized. Equivalently the system can be described in terms of the reduced variables = ( , ) ∈  and the reduced equations of state. In Section 2.2 we will see that the description in corresponds to the thermodynamic description in Lagrangian coordinates, whereas the Eulerian description will be formulated in .
For the characterization of thermodynamic equilibria, the entropȳand internal energȳplay a special role. For thermodynamically isolated systems, their critical points determine the thermodynamic equilibrium. For non-isolated systems, thermodynamic equilibria are characterized by corresponding Legendre transformations of̄and̄. In the following we give one possible characterization of a thermodynamic system based on a description using the extensive internal energȳ. We assume that the state vector̄̄is given by the extensive state variables̄∶ and ∈ ℕ the space dimension. In order to tie in with continuum mechanics, the units of all extensive thermodynamic variables are divided by the -dimensional volume, so that extensive variables indeed are densities. As already indicated in Def. 2.2 and will become important later, the role of the volume densitȳis special: It is used to define volume-specific variables and state functions in Eulerian coordinates and it connects thermodynamics to continuum mechanics, since the volumēis the determinant of the deformation gradient, for example, cf. [8,35]. Alternatively, it is also common to use mass-specific state variables and functions, in which case the (mass-)specific volume is = 1∕ , for example, cf. [4]. We now introduce the internal energy (internal energy per -dimensional unit volume) of the thermodynamical system in equilibrium as a state function depending on̄̄∶= (̄,̄,̄) ∈̄, that is, =̄̄(̄) the internal energy density , (2.4) and̄̄∶̄→ ℝ is a state function for the extensive internal energy. As a consequence of the first and second law of thermodynamics we have the fundamental relation that pairs the differential of each extensive variable with an intensive state function and gives rise to an internal energy differential. The pairs of extensive and intensive variables are also called conjugate variables. By (2.5), the intensive thermo- The most common Legendre transforms of the internal energȳare the enthalpȳ, the Helmholtz free energȳ, the Gibbs free energȳ, and the Landau free energy (also Grand potential)Φ G . Starting from the state equation (2.8a) for the entropy, Legendre transform results in thermodynamic potentials which are free entropies or Massieu-Planck potentials [42,43]. All the mentioned thermodynamic potentials are extensive quantities and more details are gathered in Table 2.
Assuming that the thermodynamic potentials from Table 2 are twice continuously differentiable, the calculation of the mixed second-order derivatives taking into account Schwartz's theorem provides the so-called Maxwell relations. This allows us to get a hold of changes in entropy by changes of directly measurable quantities and restricts the response functions, for example, heat capacities, expansion coefficients. In order the explore further aspects of these thermodynamic response functions, we use the reduced internal energy and entropy, and , introduced in Definition 2.2 with volume-specific extensive concentration =̄∕̄, entropy =̄∕̄, and internal energy =̄∕̄, and compute the second derivatives where the parameters ∈ ℝ × sym , ∈ ℝ, ∈ ℝ depend on̄̄= (̄,̄,̄). Similarly, by interchanging entropy and internal energy in (2.9a), we can introduce the capacities for the entropy defined by to relate the second derivatives 2̄̄∕̄̄e ncoded in̂,̂,̂to the second derivatives 2̄̄∕̄̄f rom (2.9a) encoded in , , . By taking derivatives of the identity ( , ( , )) = this giveŝ with = and the Boltzmann constant B = 1.3805 ⋅ 10 −23 J K −1 . Note that the normalization with the gas particle mass and the Planck's constant ℎ is based on quantum-statistical arguments and fixes the additive ambiguity of the entropy [44]. Gas particles in three spatial dimensions are characterized by the number of degrees of freedom per molecule ∈ ℕ. For a monoatomic ideal gas = 3, for diatomic molecules = 5, and for full three-dimensional molecules = 6.  . (2.14) These potentials are the basis for transformations to other thermodynamic potentials and variables. For a multicomponent ideal gas we allow the total particle number̄= ∑ =1̄t o be the sum of different constituents , each possibly having its own particle mass encoded in and its own number of degrees of freedom per molecule encoded in an internal energy densitȳ̄, (̄,̄,̄). It is assumed that the interaction between components leads to a temperature independent of , so that we can writē̄(̄,̄,̄) =̄, (̄,̄,̄) with the free energȳ, corresponding tō̄, .

Kinematics of flow maps and densities
In this section, we introduce the basic kinematic ingredients from continuum mechanics needed to incorporate equilibrium thermodynamics into a variational framework for compressible reactive fluid flows. The key idea is the consistent use of flow map ( ) and momentum̄( ) as elements of an abstract state space. Based on the definitions in Section 2.1, we additionally connect the concept of the motion of material by flow maps with the concept of extensive and intensive thermodynamic state variables as elements of the state space. This description will allow us to systematically relate quantities in the Lagrangian and the Eulerian frame. Therefore, we consider the motion of a material occupying at time ∈ [0, ], an open, bounded set Ω( ) ⊂ ℝ . At the initial time = 0, this domain is denoted byΩ ∶= Ω(0). We callΩ the reference or Lagrangian domain and Ω( ) the current or Eulerian domain for any ∈ (0, ]. As a special case, the Eulerian domain can be fixed Ω( ) ≡ Ω but in general it is timedependent. At any time, the letter denotes coordinates in the current domain ∈ Ω( ), whereas the letter̄represents coordinates in the reference domain̄∈Ω, cf. Figure 1.
In the same spirit, we indicate state variables or state functions̄,̄defined on the Lagrangian domainΩ with a bar and their Eulerian counterparts , defined on the current domain Ω( ) without a bar. This applies in particular to all thermodynamic state variables previously defined in Section 2.1, which for a non-equilibrium system depend both on time ∈ [0, ] and on Lagrangian coordinates̄∈Ω or Eulerian coordinates ∈ Ω. Accordingly, denotes the Lagrangian state space and  the Eulerian counterpart of these state variables (functions). Extensive quantities are denoted by capital roman letters and in general, the corresponding integrated quantity is always denoted with the same letter in calligraphic font, for example, see (2.18). This notation is applied in particular to the total energy , internal energy  , and the entropy  of a thermomechanical system. Moreover, when ambiguities are ruled out, we shall sometimes omit the dependence of a variable on time and space and writē=̄( ,̄) or̄=̄( ,̄) and similarly in Eulerian coordinates. Throughout this work we equivalently use the dot and to indicate partial derivatives with respect to time of state variables and functions, for example,̇=̄=̄( ,̄), for example, see (2.17h).
ii) the map is continuously differentiable for all̄∈Ω, iii) the map preserves orientation det∇ > 0.
We denote ∶= { ∶Ω → ℝ with properties i)-iii)} the set of deformations. A map ∶ [0, ] ×Ω → ℝ is called a flow map, if it satisfies the following properties: which is often called kinematic condition in the context of free boundary problems, for example, cf. [45].
While it is common to define these derivatives in Banach spaces, due to the preservation of orientation det∇ > 0, the space is a only a subset of a Banach space. This is similarly true for evolution of concentrations, which are only meaningful if they are non-negative. This issue can be overcome in the definition of derivatives by restricting to interior points̄and assuming ℎ sufficiently small so that̄+ ℎ̄̄∈. Other common conditions in mechanical problems, for example, incompressibility det∇ = 1, are usually not imposed on the state space but using Lagrange multipliers or by penalization in the problem statement.  In Figure 2 the workings of the map T LE is illustrated. Note that we also consider vector-valued extensive and intensive quantities, where then (2.19) applies to each component. For concise notation, we collect here our notation for vector-and tensor-valued functions, and the transformation rules for their gradients.
In the special cases wherēand̄do not depend on time, then (2.21a) becomes the transport equation and (2.21b) becomes the continuity equation. Using the nonlinear coordinate transformation T LE , from the evolution laws (2.21a) and (2.21b) one directly recovers the following formal relations between the partial time derivatives of the quantities in Lagrangian and Eulerian coordinates: Here, D̄T LE ( ;̄) denotes the Fréchet derivative of T LE with respect to , and D T LE ( ;̄) with similar meaning. Thus, in general (2.22) provides an affine relation between the Eulerian partial time derivativėand its Lagrangian counterparṫ̄.
Accordingly, in case that also is part of the state vector, the Fréchet derivative DT LE even gives a linear relation, as will be seen in Lemma 3.13. This property will be crucial throughout Section 3-6 for the Lagrangian-Eulerian reduction of GENERIC systems.
As a direct consequence of (2.21b) one finds the following definition of locally conserved quantitites. For single-phase flows, the mass density is locally conserved and therefore satisfies the continuity equation The corresponding Lagrangian mass density is defined bȳ wherē∈ ℝ is the vector of particle densities and = ( ) =1… ∈ ℝ is the constant mass per particle. Note thatb eing independent of time sets an essential and nontrivial constraint on the values of̄and their evolution. The mass densitȳis an extensive quantity resulting in the total mass  = ∫Ω̄d̄. (2.23c) We also point out that for reversible (isentropic) Hamiltonian dynamics the entropȳis locally conserved and in the absence of diffusion and reactions the particle concentrations̄are locally conserved.

THERMOMECHANICAL MODELLING VIA GENERIC
We present a variational framework that allows us to connect the thermodynamics of Section 2.1 with the kinematic description of continuum mechanics of Section 2.2 and to treat isolated systems outside equilibrium. This is related to the formulation of evolution laws using conservation laws that should be satisfied by a thermomechanical system. From a thermodynamical point of view this concerns the first and the second law of thermodynamics, that is, the conservation of total energy for the reversible dynamics and the increase of entropy for the dissipative dynamics. Additionally, we need to ensure the conservation of mass and from the mechanical point of view also the conservation of linear momentum has to be taken into account. The GENERIC approach is closely related to the notion of metriplectic systems [48].
It is the aim of this section to introduce the building blocks of the GENERIC framework and its general properties: The triple (,,̄) for reversible dynamics in Section 3.1 and the triple (,,̄) for dissipative dynamics in Section 3.2, which are coupled in a GENERIC system as a quintuple (,,,̄,̄) under the constraint of a so-called non-interaction condition or degeneracy condition [26][27][28]49] in Section 3.3. Transformations of these structures between different Lagrangian and Eulerian coordinates and between different sets of variables will be considered in Section 3.4.

3.1
Hamiltonian systems (,,̄) (,,̄) (,,̄) for reversible dynamics The evolution of conservative systems is governed by reversible processes. The driving potential for reversible dynamics is the total energy functional of the system ∶ → ℝ, defined on a suitable state space. In our applications usually is a Banach space with dual space * and the dual pairing ⟨⋅, ⋅⟩ ∶ * × → ℝ. We denote the set of infinitely-often Fréchet-differentiable functionals mapping from the state space to ℝ bȳ This includes but is not restricted to linear functionals. In particular it is assumed that ∈. The geometric structure associated with reversible dynamics is generated by a Poisson bracket which is a skewsymmetric bilinear form, that is, that satisfies Jacobi's identity, that is, for all , ∈ and̄∈. Then, the skewsymmetry of the Poisson bracket (3.2b) translates into the skewsymmetry of (̄) ∶ * →, that is,̄(̄) Here, the operator̄ * ∶ * → * * denotes the adjoint of the linear operator̄and * * is the bidual of. The Leibniz rule (3.2d) for the bracket (3.3a) follows from the product rule for the Fréchet derivative. Instead, Jacobi's identity (3.2c) for state-dependent̄(̄) states an additional, nontrivial constraint [26,27] that generalizes the commutation law for partial derivatives [50] and that needs to be verified for the bracket (3.3a), see also Remark 3.2.
In view of the above properties of a Poisson bracket, we call the operator̄with properties (3.3) a Poisson structure or Poisson operator [26][27][28]51]. We remark that̄is also called a cosymplectic structure or cosymplectic operator [8,51]. Since this is the geometric structure underlying Hamiltonian mechanics together with the energy functional ∶ → ℝ (Hamiltonian) defined on an appropriate state space, we call the triple (,,̄) a Hamiltonian system. Based on (,,̄), for̄∶ [0, ] → and ∈ [0, ], the equations of motion are given bȳ Assume now that is a reflexive Banach space so that * * ≡. Then, by the skewsymmetry of̄(̄) we have for all̄1,̄2 ∈ * , and therefore ⟨̄,̄(̄)̄⟩ = 0 for anȳ∈ * . Hence, by the chain rule and as a direct consequence of skewsymmetry, it follows for a Hamiltonian system (,,̄) that the total energy is conserved along a solution̄∶ [0, ] → of (3.4), that is, In order to have the expressions in (3.2c) well-defined, it has to be ensured that each of the three terms above to the right is an element of * , so that for all for all , ∈,̄∈ it is Examples for Hamiltonian systems are, for example, given in [8,52] for ideal fluids, in [53] for free boundary problems, in [54] for hyperbolic conservation laws, and in [55,56] for magnetohydrodynamics. for all smooth functions , ∶ → ℝ. Using (3.9) Jacobi's identity is directly confirmed. We introduce the Hamiltonian  ∶ → ℝ as follows with the conservative force being the gradient of the potential energȳp ot , i.e., (∇̄p ot ) =̄̄p ot , = 1, … , .

Gradient systems (,,̄) (,,̄) (,,̄) for irreversible dynamics
Gradient systems describe the dynamics of irreversible, dissipative effects. Like Hamiltonian systems for conservative dynamics, also gradient systems are characterized by a triple (,,̄) given by a state space, a driving functional ∶  → ℝ, and a geometric structurē∶ * →. Based on (,,̄) the evolution equation for the state vector̄∶ [0, ] →  reads̄( Again, is a Banach space with dual space * and ⟨⋅, ⋅⟩ the dual pairing. The driving functional is either the entropȳ  or a free energy functional, and the geometric structure is imposed by an operator̄(̄) ∶ * → with the following properties for all̄∈: The symmetry property (3.13a) of̄is a generalization of Onsager's reciprocity principle [13], which provides reciprocal relations between rates and their thermodynamically conjugate forces in certain thermodynamical non-equilibrium systems. The positive semidefiniteness (3.13b) is a manifestation of the second law of thermodynamics. In other words, the positive semidefiniteness of̄ensures the increase of entropy: In the light of Onsager's reciprocity principle, we call the operator̄that contributes the geometric structure to a gradient system (,,̄) by properties (3.13) an Onsager operator. In the same way as̄generates a Poisson bracket for reversible dynamics with the aid of the dual pairing, cf. (3.3a), the Onsager operator̄generates a dissipative bracket [26,27,35,48] [⋅, ⋅] ∶ × → defined as for all , ∈ and anȳ∈.
The irreversible dynamics also allows for an equivalent description [39] via the non-negative dual dissipation potential Ψ * ∶ × * → ℝΨ * (̄;̄) = 1 2 ⟨̄,̄(̄)̄⟩ , (3.16) which is quadratic in the thermodynamic driving forcē∈ * . More generally,Ψ * (̄; ⋅) can be non-quadratic, but nonnegative, convex, with the propertyΨ * (̄; 0) = 0 for anȳ∈. Then, the triple (,,Ψ * ) is a generalized gradient system and its evolution equation reads̄( The extension to nonquadratic dissipation potentials (3.17) is relevant, for example, for materials with a rate-independent hysteretic evolution of the internal variable [28] or for reactions with cosh-type dissipation potential motivated by largedeviation principles [57,58]. We point out that evolution equations (3.12) and (3.17) are rate equations, where the Onsager operator̄, or more generally, the non-linear operator D̄Ψ * (̄; ⋅) maps the thermodynamic driving force D(̄) ∈  * to a ratē∈. Other examples for gradient systems can be found for example in [12] for the porous medium equation, in [9,10] for complex fluids, in [39,[58][59][60] for (slow & fast) reaction-diffusion systems with detailed balance, in [61] for the Fokker-Planck equation, and in [62,63] in the context of large deviations. Mathematical properties of gradient flows are discussed in [11]. By exploiting the convexity of the dual dissipation potential one obtains via Legendre transform its convex conjugate, the dissipation potential Ψ ∶ × → ℝ. Based on Ψ(̄;̄), the evolution law (3.17) can be equivalently formulated as a force balance In comparison to force balance (3.18), the formulation of dissipative dynamics in terms of a rate equation (3.12), i.e., in terms of Onsager operators and dual dissipation potentials, has the advantage that different dissipative mechanisms related to one state variable can be included to the system simply by adding the corresponding dual dissipation potentials or equivalently by adding the Onsager operators. For example, for different dissipative effects ∈ {1, … , } related to the state vector̄described by dual dissipation potentials Ψ * and corresponding Onsager operators̄= D̄Ψ * (̄;̄), for example, ∈ {heat, viscosity, reaction, diffusion, …}, the dual dissipation potential describing the total, coupled dissipative dynamics is obtained as the sum of the relevant dissipative processes , i.e.,Ψ * tot (̄;̄) = ∑ =1Ψ * (̄;̄) and accordinglȳ . Instead, the corresponding formulation in terms of the total dissipation potential Ψ tot is less straight forward since the Legendre transform of the sumΨ * tot (̄;̄) = ∑ =1Ψ * (̄;̄) involves an inf-convolution. We exploit in Sections 5.4 and 6 the coupling of different dissipative effects by summing the different dual dissipation potentials, resp. their Onsager operators.

Example 3.4 (Viscous damped evolution)
. Consider the finite-dimensional state variablē≡̄= (̄1, … ,̄) ⊤ ∈ ℝ =  given by the position vector and a potential energy as the sole contribution to the free energy, which is the driving functional for isothermal systems, i.e., (̄) =̄p ot (̄). We introduce the state-dependent dual dissipation potentialΨ * ∶  × * → ℝ for viscous damping byΨ The properties of̄v d ensure that̄v d is a linear, symmetric, and positively semidefinite operator. The triple (, ,̄v d ) leads to the system of evolution equations where the Onsager operator̄v d transforms the force −D = −∇̄p ot into a ratē. Suppose now that̄v d (̄) =̄v d (̄) is even positively definite for all̄∈ ℝ . Then, the dissipation potential Ψ vd ∶ × → ℝ can be defined as with rates̄=̄, and the evolution can be equivalently rewritten as the force balance has a kernel, this results in algebraic constraints where either the rate or the force in this subspace vanishes at̄.
which we call degeneracy conditions, as in [26]. We will refer to (3.20a) as noninteraction conditions and to (3.20b) as conservation conditions. Then, the combined evolution equations have the form which clearly shows the reversible and the irreversible part of the dynamics. The noninteraction conditions (3.20a) ensure that the driving force of reversible dynamics D is in the kernel of the operator for irreversible dynamics and vice versa. Similar constraints for quantities that are conserved under reversible and irreversible processes are added to the formalism using (3.20b). Throughout this work we satisfy the conservation of total mass by construction using the constraint (2.23). Note that the degeneracy conditions (3.20) express that the operators̄and̄have a nontrivial kernel and have the following direct implications [26][27][28], see also Section B.1: i) In accordance with the first law of thermodynamics, the total energy is conserved: ii) In accordance with the second law of thermodynamics, the entropy is increasing: iii) The total mass is conserved: iv) Stationary states are governed by the maximum entropy principle, i.e., states̄ * that maximize the entropy under the constraint for any attainable 0 , 0 ∈ ℝ, are stationary.
Examples for GENERIC system from thermomechanics are discussed in [28,64], for complex fluids in [27,65] or with a similar formalism in [35], or for the Boltzmann equation in [66]. Examples for related port-Hamiltonian systems [30] are given in [67] for flows on networks or in [68] for control of power networks. Example 3.6 (GENERIC system). We now couple Example 3.3 of a finite-dimensional Hamiltonian system with Example 3.4 of a finite-dimensional gradient system to construct a GENERIC system. Now, the state variable is given by the vector̄̄= (̄,̄,̄) ∈̄= ℝ × ℝ × ℝ with̄the position vector,̄the linear momentum, and̄the entropy.
The driving functionals are the total energy for reversible and the entropy for dissipative processes where the internal energȳ̄contains thermal and mechanical contributions and̄k in = Using the equation of state for the ideal gas (2.14), we set̄̄(̄̄) Accordingly, the driving forces are with positive temperaturē̄=̄̄h eat =̄− 1̄h eat > 0. Embedding the canonical Poisson structure (3.10a) that generates Newtons laws into the Poisson operator bȳ̄(̄̄) ensures that the noninteraction condition̄̄D̄≡ 0 from (3.20a) is satisfied. The Poisson operator̄from (3.23a) is skewsymmetric and satisfies Jacobi's identity. However,̄is non-canonical and non-invertible due to the degeneracy in the last line and column. Moreover, similar to (3.19c) we reuse the Onsager operator The evolution equations (3.21) for the GENERIC system (̄,,,̄,̄v isc ) then read and an exemplarily solution in = 1 is shown in Figure 3. Alternatively, (3.24a) can be differentiated with respect to time and combined with (3.24b) to obtain the usual second-order rate equation as the momentum balance together with the entropy evolution (3.24c). Note that (3.24b), resp. (3.24b*), is a force balance whereas the corresponding evolution law (3.19c) for the pure gradient system is a rate equation. We obtain the same dynamics when neglecting inertiā= 0 and settinḡv isc (̄̄) =̄− 1 vd (̄). This is due to the fact that momentum balance (3.24b) decouples from the evolution law (3.24c).

Change of variables and coordinates in GENERIC
Next, we discuss transformations of the state variables T ∶ → involved in the GENERIC framework and how this affects the GENERIC evolution equation (3.21). In particular, we are answering the question, under what condition a transformed evolution is again generated by a GENERIC system so that this diagram commutes: where (̂) ∶= D̂T(̂) is the Fréchet derivative of T in̂. We consider two classes of transformations: The first one, denoted by T LE , accounts for a change of coordinates from the Lagrangian to the Eulerian frame, and the second one, denoted by T v , carries out a change of thermodynamic state variables. The coordinate transform T LE from the Lagrangian to the Eulerian frame involves the flow map and for each thermodynamic variable it is realized through the mappings introduced in Definition 2.7. In Section 3.4.1 we first explain the general strategy common to both types of transformations T LE and T v , and discuss the individual details separately in Section 3.4.2 and 3.4.3.

General transformations
Consider a transformation T ∶ → that is a continuously differentiable map from a Banach space to a Banach spacẽ . Let̃= T(̂) ∈ for an element̂∈. We point out that T need not to be invertible, which is in particular the case for transformations of the type T LE . Nevertheless, if T is invertible, transformed functionals ∶ → ℝ can always be defined by However, in order to well-define the mapping of the GENERIC system also for non-invertible transformations, one needs to impose certain closure conditions [8].
Definition 3.7 (Closure conditions). Consider a GENERIC system (,,,̂,̂) and let T ∶ → be a smooth map between Banach spaces and. We say that closure conditions (3.26) are satisfied, if there exist functionals, ∶ → ℝ and geometric structures̃(̃),̃(̃) ∶ * →, such that for all̂∈ there holds The closure condition also requires the validity of the chain rule for partial time derivatives with above , that is, for all Note that conditions (3.26) are straight-forward to satisfy if T is a diffeomorphism. For example, by (3.25) we automatically satisfy (3.26a). This is usually the case for a change of thermodynamic variables via T v , cf. Section 3.4.3. Instead, for a change of coordinates, in particular from the Lagrangian to Eulerian frame, cf. Section 3.4.2, the map T LE ∶ →  need not be invertible and then (3.26) provide a fundamental, nontrivial requirement. Here, w.r.t. the chain rule for time derivatives (3.27), note that partial time derivates are transformed according to (2.22), that is, with the expressions given in (2.21) for intensive and extensive variables. We point out that (3.28) results in a linear operator (̄( )) ∶ →  with respect tō( ) ∈, only if is a component of the state vector̄∈. Then, assuming (3.27) and with the corresponding adjoint operator * we define the transformed structures =̄ * and =̄ * , so that it remains to check the validity of the closure assumptions (3.26b) and (3.26c), that is, that the transformed operators only depend on the transformed state variables.
In the following we investigate how closure conditions (3.26) and (3.27) allow it to transform GENERIC systems into GENERIC systems, including their evolution equations (3.21). In fact, given the validity of condition (3.26a), by the chain rule and by the definition of the adjoint operator we identify the following transformation relation for the Fréchet derivatives of functionals and. Lemma 3.8. Let and be Banach spaces with dual spaces * , * , and ⟨⋅, ⋅⟩, resp. ⟨⋅, ⋅⟩ the dual pairing. Let T ∶ → be Fréchet-differentiable with D̂T(̂) ∶ → denoting its Fréchet derivative in̂∈. Furthermore, let ∶ T() ⊂ → ℝ be Fréchet-differentiable and related to ∶ → ℝ by (3.26a). Then, also is Fréchet-differentiable and for all̂∈ it is where D̂T(̂) * ∶ * → * denotes the adjoint of the linear operator D̂T(̂) ∶ →.
If a transformed system fails to be of GENERIC/Onsager/Hamiltonian structure, then usually this is because the closure conditions are not satisfied [69]. However, assuming the validity of the closure conditions (3.26b) and (3.26c) the properties of geometric structureŝ,̂carry over to the transformed structures̃,̃, see Lemmata 3.9 and 3.10. Note that the statements of Lemma 3.9 are valid in the range T() ⊂, since the transformation T might not to be surjective. In practice, this requires initial data for the evolution to reside in the range T() and the evolution also to remain in this set. Observe now that the smoothness of̃given by ( In addition, the following statements can be made with regard to the transformation of GENERIC systems. For simplicity we assume that T is surjective = T(). Theorem 3.11. Let the assumptions of Lemma 3.9 hold true for the state spaces, = T() and for the map T ∶ →. Denote by (̂) ∶= D̂T(̂) its Fréchet derivative in̂∈.
Proof. To 1.: Thanks to the smoothness of T, for all̂∈ the operator (̂) = D̂T(̂) ∶ → is a linear and continuous operator. Also thanks to the smoothness of̂,̃all statements of Lemmata 3.9 & 3.10 hold true.
To verify the degeneracy conditions (3.20) we make use of transformation relation (3.29) for the Fréchet derivatives of ,, and. In view of (3.26) we thus havẽ To 2.: In view of condition (3.27) for the partial time derivatives, to find relation (3.30b) from property (3.30a) we apply (̂( )) = D̂T(̂( )) to both sides of (3.30a) and use (3.29) to transform the Fréchet derivative of the functional. This results in (3.30b) and confirms the transformation relation (3.26b) & (3.26c) for the operatorŝ,̂. □ In Example 3.14 we will provide a transformation T ∶ ℝ 4 → ℝ 3 that is surjective but neither injective nor invertible. However, the assumptions of the reduction still apply and the reduced ODE is a non-canonical Hamiltonian structure.

Reduction and extension maps for GENERIC structures
We now discuss non-invertible transformations in more detail. Prototypes of non-invertible maps T are given by reductions and extensions defined as follows. The distinction of reduction and extension has its reason in the satisfiability of the closure condition. For invertible transformations the closure conditions (3.26) are satisfied uniquely, for example, (3.26a) is valid using (3.25). However, for the reduction the closure condition is a nontrivial constraint that needs to be confirmed. Nevertheless, we show in Example 3.14 that the reduction map is often motivated by symmetries and invariances that generate conservation laws and thereby motivate the closure condition. Instead, for extensions to a larger space the closure condition can sometimes even lead to an ambiguity. For example, if the extension contains the old state as a component̃∶= T(̂) = (̂,̃(̂)), then setting(̃) ∶=(̂) provides one possibility to satisfy the closure condition.
Different notions of reduction are considered in literature and the review by Morrison [8] gives a general introduction to the subject in the context of Hamiltonian descriptions of fluid flow. For fluids the reduction formalism was used in the derivation of the Euler equation from their Lagrangian formulation [6,8,70] and has also been extended to GENERIC structures [71]. Furthermore, given a solution of the Eulerian formulation of the fluid flow equations, one can recover the Lagrangian description as an application of an extension by integrating the Cauchy problem (2.15c) to reconstruct the flow map and similarly the Lagrangian momentum. While we use closure conditions to identify cases where exact model reductions are possible, in physics one frequently encounters situations where closure conditions such as Definition 3.7 do not hold exactly, but a model reduction to a variational structure is useful or desired nevertheless. Then, instead of using an exact closure condition, a similar property can be achieved in terms of an approximation, cf. for example [71][72][73]. For this purpose we now discuss the Lagrangian-Eulerian transformation of coordinates T = T LE ∶ →  as a special case of a reduction. Based on the previous considerations for the partial time derivative calculated by (3.28) in case that the flow map is an element of the state vector̄∈ we deduce the following transformation behavior .
and T LE ∶ →  the Lagrangian-Eulerian transformation given by (2.19a) for the scalar-valued extensive variablē(energy or entropy) or component-wise for vector-valued extensive variables̄(concentration or momentum) and by (2.19b) for the scalar-valued intensive variablē(temperature, pressure, or chemical potential). Then for all̄∈ the linear transformation operator (̄) ∶ →  in closure condition (3.26) is given by the Fréchet derivative (̄) = D̄T LE (̄) and takes the form

31)
and □ indicates where an argument has to be put. Moreover, also closure condition (3.27) for the partial time derivatives holds true and gives the transformation relations (2.21) for time derivatives from the Lagrangian to the Eulerian frame, that is, and spatial -derivatives also act on the -dependence of −1 .
Example 3.14 (Reduction in finite dimensions). In the following we discuss the reduction of the finite-dimensional Hamiltonian system from Ex. 3.3. Let now = 2, so that and consider an Hamiltonian of the form where the potential energȳp ot ∶ ℝ → ℝ depends only on the variable =̄1 −̄2. For the system (,,̄c an ) with̄c an from (3.10a) Hamilton's equations then arė̄1 Due to the symmetry of the energy we define the reduction map T∶ →  by and compute = DT(̄) ∈ ℝ 3×4 and * ∈ ℝ 4×3 as Via (3.26b) we obtain the non-canonical Poisson operator which could be further reduced by momentum conservatioṅ1 +̇2 = 0.

Change of thermodynamical variables and role of free energies and entropies as driving potentials
In the following we specialize the mapping to a transformation T v ∶ → that realizes a change of thermodynamical variables; again we writẽ= T v (̂) ∈ for̂∈. For Fréchet differentiable T v the transformation operator in the closure condition (3.26) is obtained assuming the chain rule (3.27), that is, for̂∶ As a characteristic property of a change of thermodynamic variables, we assume that T v is a diffeomorphism, that is, T v is a smooth, bijective map and also its inverse T v −1 is smooth. For shorter notation we writẽ With this notation the operator (̂) = D̂T v (̂) ∶ → from (3.33) takes the form (3.36a) and accordingly (̂) * ∶ * → * , ) .
Since T v is a diffeomorphism, by the rule for the derivative of the inverse function the transformation matrix can equivalently be expressed through the inverse mapT v from (3.35), that is, Then, the total energy of the system is given bȳ with T̄( ) = det(̄) =̄the volume density and̄=∇ as in (2.17b). We assume that the system is thermodynamically closed, so that all state variables satisfy homogeneous boundary conditions. Thus, by the chain rule, in view of (2.17d), and using integration by parts, the Fréchet derivative D̄(̄̄) is given by This produces as the linearization the operator using the derivatives of̄̄given above.

Special form of GENERIC byT v and thermodynamic driving forces
We discuss here the special form of GENERIC that directly ensures the validity of the noninteraction conditions (3.20). This special form makes use of changes of variables as discussed above, but separately for the reversible and the irreversible driving force of a GENERIC system. More precisely, for some vector-valued test function̄. Here we wrote □ in order to emphasize how the operator is applied to components of a vector, that is, □ has to be replaced by this component. Additionally, We refer to Section 4-6 for more details on the implementation of the conservation condition (3.20b).
This identification of the functional derivative D with̄relies on homogeneous boundary conditions.

APPLICATION TO FLUID DYNAMICS
In this section we combine the thermomechanical fundamentals introduced in Section 2 with the GENERIC framework presented in Section 3 in order to provide a variational approach to model compressible fluid flows in terms of GENERIC systems. In addition to the GENERIC structure and the resulting evolution equations, we will also discuss boundary conditions, conserved quantities, and transformations between different sets of variables and coordinates. Similar models for fluid flows as presented in the following sections but with different scope or based on other variational frameworks are discussed in [21,[35][36][37][38][74][75][76]. The theory of compressible flows is discussed in, for example, [77][78][79][80].
In Section 4.1 we provide the Hamiltonian system (,,̄) for the flow of an ideal compressible fluid in Lagrangian coordinates and carry out the formal transformation of the structure from the Lagrangian to Eulerian frame. Here we use the reduction approach introduced in Section 3.4.2 to obtain the corresponding Eulerian Hamiltonian system (, , ). Then, in Section 4.2 we discuss the GENERIC structure (,,,̄,̄) of the Navier-Stokes system. Finally, in Section 4.3 we derive the Onsager structure for a compressible Stokes flow as a formal asymptotic limit of the GENERIC system.
Throughout Section 4 we consider a single species, = 1, of concentration̄, which is locally conserved in the sense of Lemma 2.10 and again we shall assume that all quantities involved are sufficiently smooth. The only irreversible process will be viscous dissipation, whereas chemical reactions, heat conduction, and diffusion will be discussed in Section 5 and 6.

Hamiltonian description of ideal fluids
In the following, we provide the Hamiltonian description of reversible dynamics for the flow of an ideal fluid, that is, the compressible Euler equations. A complete description of the underlying geometrical structures is beyond the scope of this work and can be found in literature [8,35,52]. We consider an isentropic flow, that is, both the particle concentrationā nd the entropy densitȳare constant in time, that is, locally conserved. This reflects the reversible nature of the process.  We emphasize once more that̄=̄(̄) and̄=̄(̄) are not variables, as they are locally conserved quantities and therefore do not have an evolution in the Lagrangian frame. Instead, they can be understood as space-dependent parameters in the internal energȳ̄. System (4.5) is complemented with initial conditions̄(0) =̄0 ∈ and boundary conditions onΩ. Now, energy conservation can be shown by integratinḡ̄over the Lagrangian domain and using either i) or ii) as boundary conditions when applying Gauss's theorem. On the formal level, energy conservation already follows directly from the evolution equation using the chain rule and the skew-symmetry of̄(̄), cf. (3.6).
Next, we consider the transformation of the PDE-system (4.5) to the Eulerian frame of reference by exploiting transformation behavior (2.21b) of extensive quantities and of their derivatives as in (2.20g), (2.20i). This yields the common form of the compressible Euler equations with̄̄(̄,̄,̄) =̄( , ), =̄∕̄, and =̄∕̄. Note that now the continuity equation for the entropy (4.7c) has to be taken into account in order to be able to compute via (4.8). In order to transform the Hamiltonian triple (,,̄) generating (4.5) into the corresponding triple (, , ) in the Eulerian frame, the method of reduction by symmetry [8,81] explained in Section 3.4.2 will be applied. This provides an alternative approach to derive the Eulerian PDE-system (4.7). For this, we introduce the transformation T LE ∶ → ̄, where each of these extensive variables is defined on Ω and generated bȳaccording to relation (2.19a), that is, • =̄, (4.9b) • =̄, (4.9c) • =̄, (4.9d) keeping in mind that̄and̄are locally conserved, that is, parameters in the Lagrangian frame, but that the volumed epends on time. Note that T LE combines the aspect of a reduction and an extension, since we abandon and introduce , as state variables. In fact elements ( (̄),̄(̄)) ⊤ ∈ ℝ × are mapped into elements ( ( ), ( ), ( )) ⊤ ∈ ℝ +2 . In general such a transformation is not invertible. The transformation operator (̄) ∶ →  maps partial time derivatives of states in to partial time derivatives of states in  . According to Lemma 3.13 we have and indeed, this gives with the Eulerian gradient acting on the Lagrangian variables evaluated at̄= −1 ( ), so that equivalently (4.9) can be used. From (4.10) we calculate the adjoint operator (̄) * ∶  * → * for any smooth̄= (̄,̄̄) ∈ and = ( , , ) ∈  * via integration by parts ) .

(4.13)
With the transformation operators , * from (4.10)-(4.13) together with the Lagrangian Poisson structurēfrom (4.3a), the Eulerian Poisson structure is obtained by direct calculation and results in the corresponding Poisson bracket where the derivatives ∕ , ∕ are evaluated at ∈  . This form of the Poisson bracket is well-known in literature [8]. Note that this reduced Poisson operator satisfies closure condition (3.26b) and only depends on . Now consider the Eulerian energy  ∶  → ℝ with the Eulerian mass density = and the given, constant particle mass > 0. Notice the difference to the Lagrangian mass densitȳ=̄=̄. In accordance with closure condition (3.26a) we notice that indeed  ( ) =̄(̄) for any = T LE (̄) and̄∈ by the definition of the transformation (4.9), the change of coordinates formula (2.19a) for extensive quantities, and the transformation of integrals. Moreover, (4.15) yields the driving force for reversible dynamics With this one checks that the evolutioṅ= ( )D( ) of the Hamiltonian system (, , ) in Eulerian coordinates provided by (4.14) and (4.15) indeed leads to the compressible Euler equations (4.7). For this, one exploits the relation = and the definition of the pressure (4.8). Moreover, one makes use of the identity to cancel two terms emerging in the momentum balance from the entries and of ( ) in (4.14). Multiplying the mapping relation for the concentration rates in (4.11), resp. (4.7b), with the constant particle mass > 0, results in the continuity equation However, replacing (4.7b) with (4.17) in the Hamiltonian structure requires to define Eulerian extensive quantities to be mass-specific rather than volume-specific. We discuss this alternative in Example 4.2 and more general perspectives in Remark 4.3 below.    Introducing the Eulerian internal energy ̃with a mass-specific densitỹ̃as suggests the definition of a mass-specific integration measure d̃=̃d , so that and similarly for any other extensive variable.

Navier-Stokes equations as a GENERIC system
Next, we discuss the GENERIC description for a viscous fluid, that is, a thermodynamic description of the compressible Navier-Stokes equations. These differ from the Navier-Stokes-Fourier system in that heat conduction is not included. For this we couple a non-canonical version of the Poisson structure from Section 4.1 with an Onsager structure that accounts for irreversible processes due to changes of entropy and volume by shear and compression. Again we consider a single species = 1 which is locally conserved in the sense of Lemma 2.10 and assume that all quantities are smooth. We point out that the results of this section represent a generalization of the finite-dimensional mechanical system from Ex. 3.6. We start in the Lagrangian frame with reference configurationΩ ⊂ ℝ and the state vector̄= that is, compared to (4.2) the state vector is now augmented by the entropy densitȳ∶Ω → ℝ as an additional independent extensive state variable. The total energy and the total entropy of the system are given bȳ with the internal energy densitȳ̄in terms of its natural variables̄̄. Note that̄(̄̄) coincides with(̄) from (4.1) if we replace the locally conserved entropy with the entropy from̄̄. This property will be important in the upcoming discussion on changes of variables.

Reversible contribution to dynamics
In order to account for the additional dissipative state variablē, the canonical Poisson operator from (4.3a) is augmented by additional entries, leading to the non-canonical operator̄(̄̄) (4.21) In this form̄̄(̄̄) obviously satisfies the NIC (3.20a),̄(̄̄) for the entropy defined in (4.20b). Conservation of mass is ensured with the locally conserved particle densitȳ, hencē (̄) ≡̄(̄) with constant, specific particle mass > 0. Thus, D̄̄(̄̄) = 0 so that the conservation condition (3.20b) for the mass is trivially satisfied.
To simplify the coupling with irreversible dynamics later on, we carry out a change of variables as outlined in Section 3.4.3. Here we change from the entropy densitȳto the internal energy densitȳas a state variable. More precisely, we consider the mapping T v ∶̄→̄, where the entries have to be evaluated at̄̄and due to the closure relation (3.7) one has * ̄̄[̄̄] =∇⋅(̄̄̄̄Cof (̄)).
For the transformed total energy functional̄with densitȳ̄(̄̄) = 1 2̄|̄| 2 +̄the Fréchet derivative reads Recalling the results of Thm. 3.11 and (3.49) we conclude that the NIC (3.20a), that is,̄̄(̄̄)D̄(̄̄)=0 is satisfied also for the transformed system. This can also be directly checked taking into account that  This allows for a reduction if the closure condition  ext ( ) = ext (̄̄) is satisfied. Gravitational energies̄e xt =̄⋅ with gravitational acceleration vector ∈ ℝ can be reduced since ext ( ) = ⋅ for = ( , , ). In the presence of irreversible dynamics, when checking the NIC̄D = 0 the extra contribution from̄e xt needs to be taken into account. The reduction in the way explained before would fail for hyperelastic energies̄e xt ( ) = elast (∇ ), since the closure condition is not satisfied in general.

Dissipative contribution to dynamics
Now we construct the Onsager operator̄S for viscous flows in terms of a Stokes dissipation and we have to take care that the corresponding NIC (3.20a), that is,̄SD = 0 is satisfied. For the state vector̄= Note thatΨ * S and the Onsager operator̄S̄= D̄ξΨ * S depend on the statē̄through velocitȳ=̄∕̄, temperaturē̄, deformation gradient̄, and volumē= det̄. Additionally,Ψ * S only depends on̄̄and̄̄. Therefore, the Onsager operator has the form̄S̄=

GENERIC Lagrangian Navier-Stokes system
From the above considerations we conclude that the system (̄,̄,̄,̄̄,̄S̄) with the reversible and irreversible operators and driving forces introduced in (4.23)-(4.25) and (4.28) indeed provides a GENERIC system in Lagrangian coordinates. The evolution law̄̄=̄̄D̄+̄S̄D̄results in the PDE-system (4.29c) can be transformed to an evolution equation for̄with locally conserved̄as follows: which shows indeed a positive entropy production. Note that heat conduction is not yet considered here but will be included in Section 5. A more systematic change of variables for the GENERIC structure for reactive fluid flow based on the methods of Section 3.4 will be performed in Section 6.

Lagrangian-Eulerian reduction of (4.29)
We consider the GENERIC system (̄,̄,̄,̄̄,̄S̄) and perform a change of coordinates from the Lagrangian to the Eulerian frame via reduction by symmetry, cf. Section 3.4.2. As in Section 4.1 we introduce a map with each of the above extensive variables transformed as in Definition 2.7, by Compared to the purely Hamiltonian case (4.9) now onlȳis locally conserved but both entropȳand internal energȳ are nontrivial state variables. In accordance with Lemma 3.13 and in particular with (4.10) we have the following transformation operator LE (̄̄) = DT LE (̄̄) ∶̄→  , The operator transforms rates (̇,̇,̇) ∈̄to rates (̇,̇,̇) ∈  as follows Adapting the calculation in (4.12), we determine the adjoint operator LE (̄̄) * ∶  * →  * ̄, This allows us to transform the Lagrangian Poisson operator̄̄from (4.23) to the Eulerian frame as follows Herein, the terms involving the pressure arise by the transformation of the Lagrangian terms according to the composition of the operators as follows: where we used (4.4b) and (4.4c) together with the transformation rules for derivatives (2.20g), (2.20i), and the Piola identity (2.17g). Note that̄̄= by (2.19b) is used to rewrite (4.34). Similarly, we transform the Onsager operator̄S̄for the Stokes problem from (4.28) corresponding to the Eulerian dual dissipation potential ) . (4.35e) The Eulerian driving functionals are with = the mass density. This results in the driving forces for reversible and irreversible dynamics and leads to the Eulerian Navier-Stokes systeṁ    ii) no condition on : If no (essential) boundary condition is specified for the velocity , then the boundary can move and a force balance holds. iii) natural boundary conditions: If the normal velocity is set by the impermeability condition, then the natural boundary condition imposed for all tangential vectors is that when integrating by parts the Stokes operator. If no essential boundary condition is specified for , then we additional get the normal force balance ⋅ visc = .
One might include into the Cauchy stress tensor. However, this obscures the different origin of being a thermodynamic driving force in contrast to the viscous stress visc generated by the Onsager operator. A more detailed discussion on the thermodynamics of the boundary can be found in [53] for the general reversible mechanics, in [64,85] for the thermomechanics of fluids and solids, and in [86] for reaction-diffusion problems.
Remark 4.7 (Galilean invariance). Galilean invariance is an essential symmetry and states that the laws of classical non-relativistic physics are invariant under changes of inertial frames, that is, relative motion̂= + with constant velocity ∈ ℝ . Maintaining this property for discrete solutions of hydrodynamic problems [87] or for reduced hydrodynamic problems [88] is highly desirable. It is easy to check that̂( , ) = ( , − ),̂( , ) = ( , − ) and ( , ) = ( , − ) + is also a solution of the Eulerian compressible Navier-Stokes problem (4.36) and thus Galilean invariance holds. Similarly, for the Lagrangian problem (4.29) we transform̄,̄intō+̄,̄+̄̄to verify Galilean invariance. This is particularly true for the GENERIC structure since the Eulerian operators and only depend on gradients of the velocity and flow map. While the kinetic energy changes by a Galilean transformation, conservation of total momentum implies that derivatives of the total energy and entropy are invariant. The integrand in a Darcy-type dissipation potential, as introduced later in (6.25) and (6.27), needs to transform into | − | 2 in order to maintain the Galilean invariance.

Onsager structure of compressible Stokes flows
Now we discuss the Onsager structure of the compressible Stokes equations, that is, the overdamped slow evolution of a compressible highly viscous fluid. In order to derive the model from the Lagrangian Navier-Stokes system (4.29), we formally introduce scaling assumptions for time , length and viscosity coefficients , such that with the internal energy̄(̄̄) with densitȳ̄(̄̄) =̄̄(̄,̄,̄) for̄̄= ( ,̄) and̄= det(∇ ). Then̄evolves according to equation (4.37) and clearly increases. If the viscosity coefficients , do not depend on temperature or for other reasons the dependence can be neglected, then the evolution of the system can be written in terms of the mechanical Onsager structure (4.38b).

Lagrangian-Eulerian reduction
The reduction from Lagrangian to Eulerian coordinates is performed analogously to the procedure for the Navier-Stokes equation. The driving potential now is the internal energy where the Eulerian variables and equation of state are defined as before by with̄= det(∇ ). This gives rise to the Eulerian Onsager operator , the Cauchy stress tensor By multiplying (4.39b) with the particle mass one finds the continuity equation for the (conserved) mass density.

REACTIONS, DIFFUSION, HEAT TRANSPORT
In this section we provide a detailed description of dissipative reaction-diffusion processes and heat transport, for which dynamics is driven by the entropy as a function of the internal energy and particle number density. We assume that mechanics is in equilibrium, so that the pressure is constant and̄≡ 1. The coupling to mechanics can be achieved using, for example, the Stokes operator from Section 4.2. We introduce mass-action type reaction kinetics in Section 5.1. Next, we consider heat conduction without transport of matter in Section 5.2. In Section 5.3 we consider diffusion in a multicomponent system. In all these cases we focus on purely dissipative processes without cross coupling such that the degeneracy conditions (3.20)  This section presents pure Onsager systems in a way suitable for their coupling to reversible dynamics in a GENERIC system. Detailed description of the thermodynamic and geometric structure of reaction-diffusion processes can also be found in literature [21,38,76,86,[89][90][91].

Reaction kinetics
Similar to [86,91], consider̄̄= (̄,̄,̄) ∈̄with̄( ) ∶Ω → ℝ being the particle number densities of different chemical species 1 , … , that react according to For each reaction we have the vectors of stoichiometric coefficients , ∈ ℕ 0 , and the forward and backward reaction rates + , − ∶̄→ ℝ, cf. also Ex. 5.2. The positive rates depend on̄̄and we assume that all reactions are reversible, that is, ± > 0. The corresponding reaction kinetics is of mass-action type and given by the ODE-systeṁ̄= with the multi-index notation̄∶=̄1 1 ⋯̄. Furthermore, we assume a detailed balance condition, that is, there exists a steady statēr ef , such that for all = 1, … , . Under this condition, the reaction kinetics (5.2) can be written as an Onsager system. With the general entropy functional̄(̄̄) of a multicomponent system, in view of (2.8b), we have the driving force Dissipative dynamics is generated by the dual dissipation potentialΨ * reac (̄̄;̄) = (5.5e) While the possibility of non-zero componentsH̄̄,H̄̄of reactive nature cannot be excluded per se, it seems that these cross-coupling terms are of mechanical nature and would appear in a corresponding contribution to the dual dissipation potential. In the following we assumeH̄̄= 0,H̄̄= 0. The couplings to the internal energy are also assumed to be zero, that is,H̄̄=H̄̄=H̄̄= 0, in order to satisfy the noninteraction conditionH D̄= 0. The related Onsager operator for reactions̄r eac can be directly identified from (5.5a) as Due to this block structure, the absence of coupling tō̄, and the choice of variables, the noninteraction condition for the internal energy is automatically satisfied, that is,̄D̄, since D̄(̄̄) ≡ (0, 0, 1) ⊤ for all̄̄∈̄. Thus, the internal energy is locally conserved and here it also coincides with the total energy of the system. Applying Additionally, conservation of mass is ensured if the vector of particle masses = ( ) =1,…, is orthogonal to the linear space generated by stoichiometric coefficients for each reaction [21], that is, This is one of the main ingredients for stoichiometry. For the entropy evolution this implieṡ̄=̄̄(̄̄)

⋅̇=̄̄̄⋅H̄̄(̄̄)̄̄̄≥ 0.
Even though cross coupling is not included in our choice for̄r eac , nonethelessΨ * provides a general ansatz compatible with GENERIC. While linear operators̄r eac for reactions are applicable close to equilibrium, recently cosh-type dissipation potentials have been motivated by large deviation principles [57,58,92].  as an example for a single reaction with three species corresponding to water 1 =H 2 O, hydronium 2 =H 3 O + , and hydroxide 3 =OH − . The vector of masses is = (18.015, 19.02, 17.01)g mol −1 with stoichiometric coefficients = (2, 0, 0) and = (0, 1, 1). Note that conservation of mass is ensured by ⋅ ( − ) = 0. The Onsager operator for reactions,H will then result in the system of ODEs where the reaction rate and reference densities̄r ef depend on the state, for example, on temperature and pressure as in (5.9b) of Example 5.1.

Heat conduction
Heat conduction is the irreversible process of redistribution of internal energy inside a material. This process is neither diffusive nor convective in the sense that is does not involve diffusive or convective transport of particles or changes in the concentration due to reactions. For the mathematical description consider the Lagrangian domainΩ ⊂ ℝ and the state variables̄̄= (̄,̄,̄) ∈̄. Heat conduction is an irreversible process driven by the entropy̄(̄̄). We define the dual dissipation potential Ψ * heat ∶̄× * ̄→ ℝ, Ψ * heat (̄̄;̄) ∶= ∫Ω Also the noninteraction condition heat D̄≡ 0 is satisfied. With the driving forces where the positive coefficient function̄h eat =̄h eat (̄̄) is the thermal conductivity, relating temperature gradients and heat flux by Fourier's law, that is,̄h eat = −̄h eat∇̄. The temperature is expressed in terms of the other state variables using the state function̄− 1 =̄̄̄(̄̄) for the ideal gas, that is,̄̄=̄− 1̄. The transformation on the level of the Onsager structure in terms of a change of variables following Section 3.4 is accomplished with again using the relation̄̄(̄̄) = 1∕̄̄. This yields the transformed Onsager operator̄̄=̄(̄̄)̄= .

Example 5.4 (Entropy as the variable). The evolution of the entropy for heat conduction is given bȳ̄=̄̄(̄̄)̇̄=
This shows that the entropy is increasing in time, in case of natural boundary conditions̄⋅̄h eat∇̄= 0, that is, .
for the transformed Onsager operator.
Both Onsager systems, that is, for̄̄and̄̄, are generally valid for any chosen state function. With the natural boundary condition̄⋅̄h eat∇̄= 0 we make sure that the entropy is increasing. While the internal energy is not a locally conserved quantity, with the above natural boundary condition, we have

Diffusion processes
We consider diffusion of a multicomponent system as an irreversible process driven by entropy and with state variables̄= (̄,̄,̄) ∈̄. In conjunction with reactions, the same entropy expression serves as a driving functional for reac-tions and for diffusion of components. The standard form of single-component diffusion iṡ̄=∇ In what follows we set̄= 0 if , ∈ {̄,̄}, since these terms are rather of mechanical origin. Yet, these terms must not be excluded per se, but they are not connected to diffusion. In particular̄̄̄= 0 since it corresponds to heat conduction.
Let us discuss the conservation conditions (3.20b) for the total mass, that is, as it emerges from (2.23) and needs to be satisfied for the reaction-diffusion system +∇ ⋅̄=̄, = 1, … , .

Cross-coupling in Onsager systems
All the dissipative processes discussed in this section are driven by the same entropy functional̄(̄̄) and most constructions were performed for the state vector̄̄= (̄,̄,̄). For a thermodynamical system, where reactions, heat conduction, and diffusion occur simultaneously, then the coupled dynamics is̄=̄̄(̄̄) D̄(̄̄) , (5.18a) and, as discussed in Section 3.2, the Onsager operator̄now encodes all the processes according tō̄(̄̄) Here we assumed mechanical equilibrium, so that all coupling-and cross-coupling terms related to volume changes are neglected. Heat conduction is encoded in̄h eat̄a nd reactions based on detailed balance are encoded in̄r eac̄. Ex. 5.5 for diffusion only treated the scalar casē=̄. Above, the operator̄r eac̄i s not diagonal and its internal substructure is basically determined by the stoichiometric coefficients contributing tōin (5.5d). Diffusion̄d if f̄w ith off-diagonal contributions is generally known as cross-diffusion. This has been discussed in the context pattern formation in biological systems or for complex polymer systems [96,97]. These systems have been studied from an application and also mathematical point of view [98][99][100] and also more recently using energetic-variational mathematical methods [101]. For these considerations, the positivity of̄is essential and leads to the constraint on the cross-coupling |̄̄̄| 2 ≤̄̄̄̄̄̄. This is usually satisfied, if the Onsager operator̄is generated by a dual dissipation potentialΨ * . Cross-coupling effects in diffusion processes are, for example, due to the Soret effect [21,102] (thermodiffusion, thermophoresis), which describes diffusion caused by temperature gradients. The consistent cross-coupling due to Onsager's reciprocal relations is called the Dufour effect. The above ansatz leads to the reaction-diffusion-heat conduction systeṁ̄=  However, in the following we assume that (5.16b) is valid, so that these terms do not appear.

APPLICATION TO REACTIVE VISCOUS FLOWS
In this part we combine the variational approach for compressible viscous fluid flows presented in Section 4 with dissipative processes like reactions, diffusion, and heat conduction from Section 5. Therefore, we allow locally conserved quantities, with the exception of the total mass density, to change based on the reversible and irreversible processes of Sections 4 and 5 and deduce the corresponding Eulerian formulation using reduction and extension maps on a formal level. This differs from more classical derivations in [21,76] and is very similar to other variational approaches to reactive fluid flows based on flow maps in [38,103].
First, in Section 6.1 we present a GENERIC quintuple for reactive flows in Lagrangian coordinates and map the system to Eulerian coordinates for different sets of thermodynamic variables. In Section 6.2 we provide an alternative formulation using the pressure and the temperature as variables and combine reactive flows with a Darcy-type dissipation as an example.

GENERIC formulation of reactive fluid flows
To couple the Hamiltonian system for the compressible Euler equations from Section 4.1 with the Onsager systems from Section 5 we use the Lagrangian state vector̄̄= ith the placeholder̄∈ {̄,̄,̄} as in (3.41). Similar to Section 4.1 we carry out this coupling in the Lagrangian frame and then transform the obtained GENERIC system to its Eulerian version using the ideas of Section 3.4.2. Subsequently, we discuss the evolution of the Eulerian thermodynamic variable ∈ { , , } by performing changes of thermodynamic variables along the lines of Section 3.4.3.

Reversible contribution to dynamics
Consider the state vector̄̄∈̄, that is, now̄=̄. Compared to Section 4.1, where the flow of one single component with concentration̄was discussed, we now treat the flow of components with a vector of concentrations̄. This generalization of the Hamiltonian system is straight-forward when assuming that no reversible processes among the components of̄occur. Accordingly, the Poisson structure from (4.23) can be adapted as̄(̄̄) with̄̄(̄̄) and * ̄̄(̄̄) as in (4.4b) and (4.4c).

Dissipative contribution to dynamics
We now couple the Stokes flow from Section 4.2 with reaction-diffusion and heat conduction from Section 5. As discussed in Section 3.2, thanks to the additive nature of Onsager operators, the operator̄̄for the coupled processes is the sum of the operators for the single effects, that is,̄∶ ith̄h eat and̄̄=̄− ⊤∇̄̄a s in (5.10) as well as̄̄̄and̄̄=∇̄̄̄− 1 as in (5.14) with adjustments of derivatives as outlined in (5.1). Observe that there is no dissipative effect explicitly connected tō. We further point out that the Lagrangian potentials defined above have an explicit dependence on̄and on̄in the gradient terms. This choice is made such that the resulting Eulerian Onsager operators do not depend on̄and̄and thus satisfy closure condition (3.26c). Above considerations thus allow us to deduce that̄= with̄̄̄∶ =̄r eac̄+̄dif f̄, ∶=̄S̄̄+̄h eat̄.

(6.4)
Notice that the contributions for the reaction-diffusion process are slightly different compared to (5.18) because now we set̄̄̄= 0 and̄̄̄= 0 for the off-diagonal contributions, cf. also the discussion in Rem. 5.7 In addition̄= det(∇ ) is not constant anymore and terms involving pressure gradients may appear. The total energȳ ̄(̄̄) and total entropy̄(̄̄) of the system with densities̄̄(̄̄) = with the viscous stress tensor̄v isc from (4.29d). A similar set of PDEs with entropy as the thermodynamic variable has been constructed by using a more geometric approach by Gay-Balmaz and Yoshimura [38].

Lagrangian-Eulerian change of coordinates
Next, we perform a change to Eulerian coordinates based on the method developed in Section 3.4 and already applied in Section 4. This transforms Navier-Stokes-Fourier system for reactive flows (6.5) in Lagrangian coordinates to its more familiar Eulerian version. The reduction map T LE ∶̄→  from Lagrangian to Eulerian coordinates was introduced in (4.30) as The closure condition (3.26a) for the functionals  ( ) =̄(̄̄) and  ( ) =̄(̄̄) is apparently valid if we express̄̄= ,̄̄= . The derivative DT LE is similar to (4.31) but now̄is not locally conserved anymore, so that The adjoint * LE is computed using the duality product as in (4.12), where d =̄d̄is exploited, and reads Thus, the transformed Poisson operator = ( ) is   An analogous set of equations has been discussed by Bothe and Dreyer [76] in the context of class-I-II-III models. Continuity equation (2.23a) for the total mass density = ⋅ can be retrieved by multiplying (6.10b) by the vector of particle masses ,thus is conserved.
The evolution (6.10c) shows that the internal energy is a non-conserved quantity due to the reversible conversion of kinetic and internal energy and irreversible viscous dissipation. In order to see the evolution laws of further thermodynamic variables ∈ { , } we subsequently transform the GENERIC system ( ,  ,  , , ) via a change of thermodynamic variables according to Section 3.4.3. Analogous considerations as in Remark 4.1 show that the total energy  is conserved.

Change of variables ↦
We consider the transformation map T → ∶  →  , ↦ based on the Eulerian densities ( , ) and ( , ). In view of (3.36a) its Fréchet derivative DT → ( ) is given by It is used to transform from (6.8) into Accordingly, from (6.9) is transformed into The evolution laws (3.21) of the GENERIC system ( ,  ,  , , ) are then given by equations (6.10a), (6.10b) for and , and equation (6.10c) is replaced by the evolution of entropy where we have used the relation + = + ⋅ in order to rewrite the reversible term = −∇ ⋅ ( ). Entropy is shown explicitly for the operator ℍ for chemical reactions from (5.5) with (6.9e), that is, .
Due to the fact that the untransformed equations are driven by the same forces, that is, the evolution of and is again governed by equations (6.10a) and (6.10b). The temperature evolves according to with the reversible part where = ∕ and + ⋅ = Λ ∕ , and with the dissipative part Combining these terms ultimately results in Expression for the entropy of a multi-component ideal gas are given in the Appendix A.1.

Reactive fluid flows with pressure and temperature
In some applications pressure and temperature are the thermodynamic observables rather than volume and entropy. However, due to the special role of the volume as a dependent variablē= det(∇ ), this reformulation is somewhat tricky. This can be done, for example, using an extension mapping T ext ∶ → ext to a larger space, which contains additional thermodynamic variables explicitly, such as̄,̄or̄. We show this construction exemplarily for the with the transformation̄=̄̄=̄̄̄(̄,̄,̄) and̄=̄̄= −̄̄̄(̄,̄,̄) evaluated at̄= det ∇ and̄considered as a parameter. The closure relation for the extension T ext can be satisfied trivially using the original variables. The same strategy can be employed to introduce evolution laws of any other thermodynamic variable within the variational framework. In accordance with (3.36) it is where (̄)̄= (̄̄) Cof̄∶∇̄with its adjoint ( * ̄)̄= −∇ ⋅ ((̄̄)̄Cof̄) for ∈ {̄̄,̄̄}. To determine these expressions we note that T ext = T v •T • is the composition of the extension map T • (̄) = (̄,̄,̄) ⊤ and the change of variables T v ((̄,̄,̄) ⊤ ) = (̄,̄,̄) ⊤ . By (3.36a) the derivatives of these maps are given by where the partial derivatives in DT v can be expressed by the capacities from (2.9a) and with̄̄□ = Cof̄∶ ∇□ and̄□ =̄̄̄Cof̄∶ ∇□. In this way, the expressions in (6.14) are determined as DT ext = DT v DT • and DT * ext = DT * • DT * v . This transformation results in the extended Poisson operator ext (̄e xt ) = DT ext (̄)̄c an DT ext (̄) * = 16) and in the extended total energy ext (̄e xt ) with densitȳe xt (̄e xt ) = 1 2̄|̄| 2 +̄e xt (̄,̄,̄). Here it is assumed that the extended internal energȳe xt does not depend explicitly on the flow map but only on the variables (̄,̄,̄) with̄as a parameter. Thus, the driving force for the extended system is D ext = (0,̄∕̄,̄̄e xt ,̄̄e xt ) ⊤ . where we exploited that DT * ext̄e xt =̄in order to arrive at (6.18b). At this point we could use the definition of the capacities̄̄̄= − 2̄̄̄= −1̄̄,̄̄̄=̄̄̄= −Λ̄, from (2.10) to replace the partial derivatives in (6.18).
Lagrangian-Eulerian reduction and extension of (6.18) Next, the Lagrangian version (6.18) of the compressible Euler equations transformed to Eulerian coordinates. Specifically, we map̄e xt ∶Ω → ℝ 2 +2 to ∶ Ω → ℝ +2+ , which to some extent is a reduction since we abandon the flow map as a variable. However, we also introduce the locally conserved Eulerian concentration as a further variable by an extension, as this will be needed later. For this, we consider the transformation to Eulerian coordinates where the intensive pressure and temperature are defined by • =̄and • =̄. Using Lemma 3.13 we get and correspondingly have its adjoint where similar to (4.16) the derivative of the kinetic energy w.r.t. the concentration is cancelled in (6.24a).
Remark 6.1 (Role of pressure). The role of the pressure in system (6.24) is ambiguous: i) With the relation ⋅ + − = one can determine the pressure employing the equations of state ( , ), ( , ) for the state variables , . This allows one to drop the evolution equation (6.24c) for the pressure. ii) Alternatively, one could also drop the evolution equation (6.24d) for the temperature and evolve the pressure independently from the equation of state via (6.24c). The concentration is always needed for the closure relation in order to relate momentum and velocity through = ( ⋅ ) .

Darcy flow
In the following we indicate the main steps in the construction of the Onsager operator for Darcy flows either using a GENERIC or a gradient structure. We start this consideration with the Onsager operator using the total energy as variable, that is,̄D which satisfies the NIC̄D D̄= 0 by construction. The Darcy Onsager operator is purely multiplicative, that is,̄D̄=̄̄̄D with a symmetric, positively definite, state-dependent matrix̄D ∶̄→ ℝ × . Such a dissipative contribution is only material frame indifferent for multiphase flows, for example, mixtures. Nevertheless, this example is valueable to show how GENERIC can be extended systematically to reactive multiphase flows. The transformation map for the change of variables to internal energȳ=̄̄(̄̄) =̄− 1 2̄|̄| 2 reads for states̄̄= ( ,̄,̄) ⊤ ∈̄, so that we have the transformed Onsager operator̄D̄=̄D̄(̄̄), (6.26) now dependent on states̄̄= ( ,̄,̄) ⊤ ∈̄and again with̄D̄=̄̄̄̄D. Note that the form and the properties of D̄a re very similar to the operator (3.23b) from the finite-dimensional Example 3.6. Using the same reversible contribution as in Section 4.2, we get the same Lagrangian formulation as in (4.29) but with̄S̄replaced bȳD̄. Using T LE from (6.6) for the Lagrangian-Eulerian transformation of a multi-component system and with D =̄− 1̄D̄, we obtain the Eulerian multi-component Darcy floẇ+ where we multiplied the momentum balance by the velocity and used the resulting expression to replacē⊤̄D̄in the evolution equation for the internal energy density. In this overdamped evolution, both and the total energy  ( ) = ∫ Ω d are conserved.

Reactive multi-component Darcy flow
We now augment the Lagrangian Darcy operator̄D̄from (6.26) by chemical reactions of an -component system with concentrations̄∶Ω → ℝ . WithH̄̄for chemical reactions from (5.5), the Lagrangian Onsager operator for the reactive -component Darcy flow is given bȳr for a statē̄= ( ,̄,̄,̄) ⊤ ∈̄. Similar to the compressible Euler case we are interested in a formulation of the system in terms of pressure and temperature as additional variables. Hence, alike (6.13), we introduce the extension map T ext ∶̄→ ext , wherē̄= (̄̄̄) −1 and̄̄=̄̄̄̄̄, and with where the partial derivatives and the adjoint DT ext (̄̄) * are an adaption of (6.14) and (6.15). With the abbreviation ∶= ( ,̄,̄) this means in particular that the extension map T ext = T v •T • is the composition of the extension map T • ((̄,̄) ⊤ ) = (̄,̄,̄) ⊤ and the change of variables T v ((̄,̄,̄) ⊤ ) = (̄,̄,̄) ⊤ , with derivatives and with̄D̄□ ∶=̄̄̄D□ with̄D ∶ ext → ℝ × defined bȳD(̄e xt ) ∶=̄D(̄) for̄D ∶̄→ ℝ × symmetric and uniformly positively semidefinite for all̄∈ as in (6.26). In this way, closure condition (3.26c) is satisfied for the extended Darcy operator. Similarly, the operatorH̄̄for chemical reactions from (5.5) is defined for the extended states by stettinḡ ℍ(̄e xt ) ∶=H(̄), so that closure condition (3.26c) holds true. The total entropy ext (̄e xt ) of the extended system is obtained from an extended density that we define via the identitȳ ext (̄,̄̄(̄,̄,̄) ,̄̄(̄,̄,̄) ) ∶=̄̄(̄,̄,̄) (6.31) in order to satisfy closure condition (3.26a). The extended driving force is thus given by D ext = ( 0, 0,̄̄e xt ,̄̄e xt ,̄̄e xt ) ⊤ , where the components̄̄e xt ,̄̄e xt are obtained by solving DT v (̄e xt ) * ̄e xt (̄e xt ) =̄̄(̄̄). Combining the Onsager system ( ext , ext ,̄r D ext ) for the reactive Darcy flow with the Hamiltonian system ( ext , ext ,̄e xt ) for the extended compressible Euler system (6.18) we arrive at a GENERIC system ( ext , ext , ext ,̄e xt ,̄r Lagrangian-Eulerian reduction and extension of (6.32) We now transform the system ( ext , ext , ext ,̄e xt ,̄r D ext ) to the Eulerian frame using the map T LE ∶ ext →  , The intensive quantities pressure and temperature are mapped by • =̄and • =̄. In view of Lemma 3.13, the derivative of T LE is given by This is similar to (6.19a), but now̄is not locally conserved anymore. Yet, this has no influence on the form of the Poisson structure in Eulerian coordinates, that is, ( ) = DT LE (̄e xt )̄e xt DT LE (̄e xt ) * transformed by (6.33) coincides with from (6.20). Similarly, the Eulerian Onsager operator is obtained as Here we used the state functions ( , ) and ( , ), and in order to arrive at (6.36a) we exploited that̄̄̄̄= −1 . This is obtained from the definition of the heat capacity (2.10) and the relation (6.21). which can be inserted into (6.36). For dense systems, the assumptions leading to the ideal gas might be violated and more realistic equations of state, such as in A or volume exclusion as considered in [104], should be included in multicomponent diffusion models. As soon as the concentration of the diffusing particles is no longer small compared to the main species, this concentration has a significant influence on the viscosity of the liquid. This is observed in suspensions and for example described by the Krieger-Dougherty relation [105] or state-dependent nonsmooth dissipation [106].

CONCLUSION AND SUMMARY
We gave a detailed presentation for the GENERIC structure of fluid flows with a focus on the physical ingredients and the mathematical structures, that is, thermodynamics, continuum mechanics, functionals, and operators. Based on the functional derivatives of the energy D and of the entropy D as generalized driving forces and suitable geometric structures and for reversible and dissipative dynamics, we established the evolution laws of Hamiltonian and Onsager systems. Their coupling in GENERIC systems via the noninteraction conditions D = 0, D = 0 ensures the laws of thermodynamics by construction and leads to the evolutioṅ= D + D. We showed how a fundamental thermodynamical description of fluids in Lagrangian coordinates using homogeneity assumptions can be transfered to a description in Eulerian coordinates. On the level of abstract state spaces, this required the introduction of nonlinear mappings T ∶ →  between Banach spaces, of which the linearization = DT is used to transform the operators via =̄ * and =̄ * and functionals via •T = and •T =. We introduced a corresponding framework where, assuming closure conditions for these transformations, cf. Def. 3.7, we proved that this construction remains valid even for non-invertible mappings, for example, reductions and extensions, cf. L. 3.10 and Thm. 3.11. Making this connection between Lagrangian and Eulerian coordinates helps to reveal the origins and the assumptions behind certain thermodynamic relations in non-equilibrium thermodynamics, which usually stay hidden in resulting system of partial differential equations. For example, many ingredients of this construction rely on the assumption of homogeneity of extensive and intensive quantities, see Def. 2.1, L. 2.9, and L. 3.13.
We presented examples for the Hamiltonian description of the ideal fluid, the Navier-Stokes equations, the Navier-Stokes-Fourier system, the reactive Navier-Stokes-Fourier system, and the reactive Navier-Stokes-Fourier-Darcy system with different sets of variables. In each of these cases we presented the system of partial differential equations and the underlying systems (, , , , ) and discussed the validity of the noninteraction conditions. In particular the reactive Darcy flow shows how these structures can be extended to applications, for example, soft matter, geophysical flows in ground water, or biological flows in tissue. In these applications, the coupling hyperelasticity should be considered.
Extensions of GENERIC structures for complex fluids have already been established in literature [27]. However, extensions to non-quadratic dissipation potentials, multiphysics and multiphase descriptions, multiscale limits, fluid-structure interaction, and interfacial thermomechanics offer many interesting avenues for future research. In particular for the latter two, the Eulerian-Lagrangian approach related by noninvertable reduction maps is appropriate.

R E F E R E N C E S
where the empirical parameters , encode the particle interactions and excluded volume. The internal and free energy of the Van der Waals gas in natural variables arē̄= Properties i) and iii) are shown with similar arguments.