A variational principle for fluid sloshing with vorticity, dynamically coupled to vessel motion

A variational principle is derived for two-dimensional incompressible rotational fluid flow with a free surface in a moving vessel when both the vessel and fluid motion are to be determined. The fluid is represented by a stream function and the vessel motion is represented by a path in the planar Euclidean group. Novelties in the formulation include how the pressure boundary condition is treated, the introduction of a stream function into the Euler–Poincaré variations, the derivation of free surface variations and how the equations for the vessel path in the Euclidean group, coupled to the fluid motion, are generated automatically.


Introduction
Variational principles for fluid sloshing, that is free surface flow in an enclosed container, abound, having first been derived independently by Lukovsky [1] and Miles [2], based on Luke's variational principle [3]. analysis and modelling of fluid sloshing (e.g. Faltinsen & Timokha [4], ch. 2, 7 and references therein). However, in all this work the fluid motion is assumed to be irrotational. A variational principle for fluid sloshing with vorticity was first introduced by Timokha [5] using Clebsch variables to represent the velocity field. In two space dimensions, Clebsch variables represent the vorticity field exactly, but they are difficult to work with and have singularities in the potentials even when the velocity field is smooth (e.g. [6,7]).
In this paper, a new variational principle for fluid flow with a free surface and vorticity is obtained in two dimensions by representing the velocity field in terms of a stream function and using constrained variations. Moreover, the variational principle captures dynamic coupling with the vessel motion; that is, the variational principle produces both the exact fluid equations in a moving vessel, as well as coupling with the exact equations of motion for the vessel. The vessel motion is a path in the special Euclidean group, SE(2), consisting of rotations and translation in the plane.
Variational principles for the coupled motion have been given before, the first by Lukovsky (see [8] and references therein), for the fluid-vessel coupling, and more recently by Alemi Ardakani [9,10], which, in the latter case, includes coupling between the vessel and both interior and exterior fluid motion. However, in all these cases, the fluid motion is taken to be irrotational. Here the aim is to dynamically couple vessel motion to interior fluid flow with an exact and complete representation of the vorticity field.
Variational principles for Eulerian fluid motion with vorticity are notoriously difficult. On the other hand, variational principles in the Lagrangian particle path (LPP) formulation are the natural continuum versions of Hamilton's principle in classical mechanics and are therefore relatively straightforward. For example, Hsieh [11] presents a variational principle for the LPP formulation with a free surface, based on the kinetic minus the potential energy, which is used to model bubble dynamics, and no special constraints or constrained variations are required. Yamada [12] develops a numerical method, based on a Lagrangian variational principle, for sloshing in the LPP setting. However, in general the LPP formulation is not as useful in practice as the Eulerian fluid representation.
In the Eulerian representation, the fluid velocity u(x, t) is studied as a function of position and time. It is the observational approach and the most widely used representation in fluid dynamics. When forecasting the wind in a city, for example, one wants to predict the velocity at a fixed spatial position as a function of time. One is not normally interested in where the parcel of fluid was the day before or the week before. This latter view, where individual fluid parcels are followed for all time, is the LPP description. The position of a parcel of fluid is given by where τ = t is the representation of time in the Lagrangian setting. Here B ⊂ R n (spatial dimension n) is a fixed reference space that may be the initial configuration of the fluid, ϕ(a, 0) = a ∈ B. The Lagrangian velocity field follows a fluid particle: where the dot denotes differentiation with respect to τ (time derivative with a fixed). The two fields are related by In fact, this identity will be important in transforming natural variational principles in the LPP setting to a variational principle in the Eulerian setting. Natural variational principles, starting with the kinetic minus the potential energy, fail in the Eulerian setting. For example, take the two-dimensional fluid domain to be in the region 0 < y < h(x, t), where y = h(x, t) represents the free surface for 0 ≤ x ≤ L. Then the natural Lagrangian, based on the kinetic minus potential energy, when the velocity is represented by where ρ is the constant fluid density and g is the gravitational constant. Taking free variations with respect to h and ψ and setting δL/δψ and δL/δh to zero does not lead to the correct governing equations or boundary conditions. The reason being that ψ and h are not the Lagrangian variables of the problem, and hence the classical Hamilton principle with free variations does not apply when such variables are used. One thus needs to consider the constrained variations induced by the free variations of the Lagrangian variables. For fluids with a fixed boundary, this is known as the Euler-Poincaré framework (e.g. Holm et al. [13, ch. 11]). In the Euler-Poincaré framework, the constrained variation of the velocity field is given by where z is a vector-valued free variation, and [·, ·] is the Lie bracket of vector fields [13,14] (that is, [u, z] = u · ∇z − z · ∇u). However, we will need to introduce two extensions of this theory: firstly, inclusion of a free boundary h(x, t) and an appropriate variation δh, and, secondly, how to induce a constrained variation, δψ, for the stream function. The Euler-Poincaré framework was first extended to free boundary flows in Gay-Balmaz et al. [15] with a compressible fluid in the interior. The incompressible case can be obtained a posteriori by setting density to be constant. Here, the new strategy is to address the incompressible case directly by working with divergence-free vector fields from the start, parametrized with a stream function, then use (1.5) and a Lie algebra homomorphism to obtain δψ directly, where w(x, y, t) is scalar valued and a free variation, and {·, ·} is the standard (x, y)-Poisson bracket for scalar valued functions. This variation, and a reduction from the LPP setting to the Eulerian setting, induces a variation at the free surface The expressions for δψ and δh are proved in §6. They are derived from first principles using reduction from the LPP to Eulerian formulation and the formula (1.3). The difficulties with the free boundary are compounded by the use of a stream function formulation: the pressure no longer appears explicitly rendering the dynamic boundary condition at the free surface problematic. This problem is resolved in a novel way by showing that the pressure boundary condition is equivalent to the kinematic conservation law of Gavrilyuk et al. [16] (hereafter GKK conservation law), extended to the case of free surface flow relative to a moving frame. Then a key result of the variational construction is how the GKK conservation law emerges from the variational principle, justifying this new form for the pressure boundary condition.
The variational principle is useful for establishing structure, identifying conservation laws, constructing numerical schemes and developing approximate methods such as the multimodal expansion of solutions. Some implications and applications are discussed in §7.
An outline of the paper is as follows. Firstly, the governing equations for the coupled problem are written down in §2. Then a Lagrangian density is formulated based on the kinetic minus potential energy of the fluid and vessel motion, relative to a moving frame in §3. Variations are then taken in the directions δh, δψ, δq and δR, where q is the body translation vector in two dimensions and R is a rotation matrix in the plane representing the body orientation. Special cases of the resulting equations are given in §5. The justification of the expressions for the constrained variations is given in §6 based on reduction from the LPP setting to the Eulerian setting. In §7 and the concluding remarks section §8 some implications and potential extensions of the new variational formulation are discussed.

Governing equations
The fluid is incompressible and of constant density ρ. The fluid occupies the two-dimensional region D := {(x, y) ∈ R 2 : 0 < y < h(x, t) and 0 < x < L}, (2.1) for some L > 0 and y = h(x, t) is a graph representing the free surface, and it is to be determined. The fluid equations are relative to the body-fixed frame with coordinates x = (x, y) and its relation to the spatial frame is given below in (2.6). Upon denoting the velocity field by u = (u, v), the governing equations for the velocity and pressure, relative to the body frame, are where g > 0 is the gravitational constant and (Df /Dt) := (∂f /∂t) + u(∂f /∂x) + v(∂f /∂y). The functions (θ , q 1 , q 2 ) represent the orientation and translation of the body. These equations are derived in [9] and in §2 of [17]. Conservation of mass relative to the body frame is where p a (x, y, t) is a given external pressure field. The free-surface boundary condition on the pressure is obtained by assuming that surface tension effects are neglected and by requiring the pressure to be equal to external pressure field at the surface. The free surface equation for the height is the usual kinematic free surface boundary condition in the Eulerian setting. The body-fixed frame with coordinates x = (x, y) is related to the space-fixed frame with coordinates X = (X, Y) by X = R(t)x + q(t), (2.6) where q = (q 1 , q 2 ) represents uniform translation of the frame, and A schematic is shown in figure 1. When the axis of rotation is at another point other than the origin of the body axis then (2.6) is replaced by The theory will be developed for d = 0, to simplify notation, as the shift in axis of rotation can be added in a posteriori as required.

(a) Stream function and vorticity
In two-dimensional divergence free vector fields in D can be parametrized by a stream function, The vorticity V is the relative vorticity; that is, relative to the body frame. The absolute vorticity is V + 2θ . Substitute the stream function into the free surface boundary condition (2.5),

Conservation of mass (2.3) is satisfied exactly and the vorticity V is defined by
giving the following form for the kinematic free surface boundary condition: At this point, a difficulty emerges with the pressure boundary condition, p = p a at y = h, since pressure does not appear in the vorticity-stream function formulation. However, the Euler equations have a gauge symmetry in that an arbitrary function of time can be added to the pressure field without changing the dynamics. Hence the more general boundary condition for the pressure is p − p a = 0 modulo an arbitrary function of time, or Substituting for p x and p y from (2.2) then gives at y = h(x, t). Although this boundary condition looks complicated it has an elegant and simple form and flux function The conservation law (2.15) is a generalization of the GKK conservation law [16] to the case of free boundary flow relative to a moving frame. When θ =θ = v 1 = v 2 = 0 and p a = 0 the above conservation law reduces to which is the form of the kinematic conservation law given in eqn (14) of [16].

(b) Summary of the fluid equations
In summary, in the vorticity-stream function formulation, the governing equations (2.2) are replaced by The boundary conditions at the solid walls are The boundary conditions at the free surface are with K and Ξ given in (2.16) and (2.17), respectively, with u, v replaced by their stream function representation. The aim is the show that these governing equations for the fluid follow from a variational principle.

(c) Summary of the vessel equations
The fluid equations in §2b are dynamically coupled to the vessel motion. The vessel position and orientation are given in terms of θ(t) and q(t) and they are coupled to the fluid motion. Governing equations for (θ (t), q(t)) can be deduced from Newton's Law for the total linear and angular momentum. The translation of the vessel follows from the conservation of total linear momentum d dt The orientation of the vessel follows from the conservation of total angular momentum d dt In these equations, that is the body angular velocity Ω equals the space angular velocity ω. The basis for the spatial frame is denoted by (E 1 , E 2 , E 3 ) and the basis for the body frame is denoted by (e 1 , e 2 , e 3 ). The fluid velocities U and u in the spatial and body frame, respectively, are related by

Lagrangian of the coupled system
The proposed variational principle is where the Lagrangian is the kinetic minus potential energy where the superscript f indicates fluid and v the vessel. These energies are formulated as follows.
The energy densities of the fluid are The vessel position and velocity and the gravity vector are represented relative to the body frame.
With these definitions, the kinetic and potential energies are R-invariant, and there is no explicit dependence on the group action. Re-introducing integration, the fluid kinetic energy takes the form In the two-dimensional case considered here the moment of inertia term reduces to The potential energy density for the fluid is and so, adding in the external pressure field, A similar construction gives the kinetic and potential energies of the vessel where ρ v is the density of the vessel material, where V (·)dx dy is the integral over the vessel volume, and The full combined Lagrangian, When the fluid is neglected and Γ is set to zero the Lagrangian density (3.8) reduces to the standard form for a Lagrangian that is left-invariant with respect to the special Euclidean group SE(2), which generates the equations for rigid-body motion undergoing rotation and translation in the plane; see [18], ch. 7 for the theory of SE(n)-invariant Lagrangians.

Variations
In deducing the variational principle in the Eulerian setting, the starting point is the natural variational principle in the LPP setting. In the LPP setting, the principle fluid unknown is the particle position ϕ(a, t) as defined in (1.1) and its velocityφ defined in (1.2). In the coupled problem, the orientation R and position q are also treated as Lagrangian variables.
The variational principle in the Lagrangian path formulation is therefore However, setting each of these functional derivatives to zero does not recover the governing equations, since the variations are not free. In this section, the variations needed are recorded and they are justified from the Lagrangian particle path formulation (4.1) in §6. The required fluid variations are where w(x, y, t) is a free variation in the interior with w y = 0 at x = 0, L; w = 0 at y = 0; w = 0 at t = t 1 , t 2 , and W(x, t) = w(x, h(x, t), t) is the restriction of w to the free surface. As it should, these variations are compatible with the free surface boundary condition (2.12). Indeed, we have The vessel variations are where Λ and λ depend on time only and are free variations vanishing at t = t 1 , t 2 . Substitute these variations into (4.2) noting that Ω × Λ = 0 in the two-dimensional case, Substituting these expressions into the δΛ and δλ equations gives the equations for the vessel coupled to the fluid motion, and they recover exactly the conservation of total linear and angular momentum in §2c. Here the governing equation for v is expanded

Special cases of governing equations
When the vessel motion vanishes and p a = 0, the Lagrangian When the fluid motion vanishes, the vessel motion equations reduce to These equations are similar to Kirchoff's equations for a rigid body in moving in 3D (see Lamb [19, ch. 6] and Holm [18, §7.2]). The latter view of the equations (5.1) is that they are the Euler-Poincaré equations for a Lagrangian that is left-invariant with respect to the group SE(2), the special Euclidean group in the plane, although here there is the additional term due to gravity and represented by the vector Γ . In two dimensions, these equations are just the governing equations of a compound pendulum in the plane with translating pivot point (figure 2), or more generally a rigid body moving in the plane subject to a gravitational field. In two dimensions, the first equation of (5.1) has only one non-zero component and the second has only two non-zero components.

Justifying constrained variations via reduction
The natural variational principle in fluid mechanics is Hamilton's principle in the LPP setting. Natural because the density is the kinetic minus potential energy and the variations are free.
In the LPP setting, the position of particles is determined by a mapping ϕ : and D is the current fluid configuration (2.1). The position and velocity of a fluid particle at any time τ in the LPP setting from (1.1) and (1.3) are recorded here, x = ϕ(a, τ ) and u Lag (a, τ ) =φ(a, τ ). (6.1) τ = t but the distinction is maintained as ∂ τ is taken with a fixed and ∂ t is taken with x fixed. The LPP Lagrangian variational principle for the fluid only is then with respect to arbitrary variations δϕ vanishing at τ = τ 1 , τ 2 . To be precise the configuration manifold is an appropriate subset of the manifold of volume-preserving embeddings (e.g. [15,20,21] and references therein) but this level of detail will not be needed here. The free surface is the image of the upper edge of the reference space Σ s = {(x, y) ∈ R 2 : x = ϕ 1 (a 1 , 1, τ ) and y = ϕ 2 (a 1 , 1, τ )} ⊂ ∂D. (6.3) Variation of L in (3.8) will require variations in the Eulerian setting. The transformation from the LPP description to the Eulerian description is a form of reduction, obtained by factoring out the particle relabelling group (cf. §11.1 of [13,15] when a free boundary is included). This reduction converts free variations in the LPP setting to constrained variations in the Eulerian setting.
The Lagrangian and Eulerian velocity fields are related by ϕ(a, τ ), τ ), (6.4) and u is a divergence-free vector field on D, parallel to rigid boundaries but not parallel to Σ s . Let δϕ(a, τ ) be a free variation of the fluid displacement in the LPP setting and let z(x, t) be its representation in the Eulerian setting, The field z is an arbitrary divergence-free vector field on D, parallel to rigid boundaries but not parallel to Σ s . To derive (1.5) vary (6.4), Now differentiating (6.5) with respect to t gives δφ(a, τ ) = z t (ϕ(a, τ ), τ ) +φ(a, τ ) · ∇z(ϕ(a, τ ), τ ). (6.7) Combining these two expressions then gives δu = z t + [u, z] with [u, z] := u · ∇z − z · ∇u. (6.8) In forming this equation, a is replaced by a = ϕ −1 (x, t) rendering it a purely Eulerian expression. The identity (6.8) is one of the most important, but unheralded, identities in fluid mechanics as it relates small changes in the Eulerian velocity field to small changes in the Lagrangian velocity field, all viewed from the Eulerian perspective. Further detail on this identity, its history, abstraction and generalization can be found in [13,14] and references therein. The two new results on Eulerian variations needed in this paper are the implications for (6.8) when the velocity field is represented by a stream function, and the induced free surface variation when the surface Σ s is represented by a graph.

(a) Stream function variations
The aim is to reduce δu = z t + [u, z] to δψ = w t + {w, z}. The w stream function is obtained from a given z by integrating dw = −z 2 dx + z 1 dy, along a curve in D. By choosing a reference value of w, e.g. fixing w on rigid boundaries w(x, 0, t) = w(0, y, t) = w(L, y, t) = 0, (6.11) the w stream function is unique. This condition mirrors the condition on ψ in (3.11).
Inserting the velocity representation u = J T ∇ψ and (6.10) into the first expression in (6.9) gives A direct computation then shows that [J T ∇ψ, J T ∇w] = J T ∇{w, ψ}, and so (6.12) yields where f (t) is in general arbitrary. However, evaluating (6.13) at y = 0 and using the normalization (6.11) gives f (t)=0. This confirms the form for δψ in the second expression in (6.9).
In Eulerian variables, the right-hand side is Substitution into (6.15) and mapping δh to Eulerian variables then gives confirming the expression in (4.3).

(c) Variation of vessel parameters
The variations of Ω, r, v and Γ in (4.4) arise in rigid body motion and the details can be found in [13]. Here, just a sketch of the basic idea is given. A detailed derivation of δΩ is given on pages 249-250 of [13] withΛ := R T δR, whereΛ is the representation of the vector Λ in terms of a 3 × 3 skew-symmetric matrix. Let λ = R T δq then A similar argument gives the expression for δv in (4.4). For the gravity vector confirming the fourth equation in (4.4).

Implications and applications
The existence of a variational principle for sloshing with vorticity gives added value to the analysis of the governing equations in various directions. For example, the importance of variational principles in the design of robust numerical schemes is now well established (e.g. [22,23]). In fluid dynamics, the development of numerical methods from variational principles with constrained variations, as in the Euler-Poincaré framework, is a burgeoning research area (cf. Pavlov et al. [24] and its citation trail). For this development, the understanding of the Eulerian variational principle as a consequence of the LPP is of fundamental importance. The variational framework in the present paper is a candidate for adapting these variational numerical methods to the case of free surface flows. A canonical problem in the study of dynamic coupling between sloshing and vessel motion is the 'pendulum-slosh' problem, illustrated in figure 3, where q = 0 and the only vessel degree of freedom is rotation. The irrotational case has been studied in Turner et al. [25]. Vorticity will change the resonance structure, affect the energy budget and interact with the vorticity induced by vessel rotation. An analysis of this problem is outside the scope of this paper, but some indication of the implication of vorticity on sloshing can be given using an exact solution.
There is an exact solution of the sloshing problem with vorticity and a stationary vessel. Suppose the external pressure field evaluated on the free surface has the form non-zero kinetic energy in the initial data when vorticity is present. The kinetic energy of the fluid in this case is The flowfield has a cellular structure with n cells in the x-direction and m cells in the y-direction. An example of the stream function contours in the case n = 2, m = 1 is shown in figure 4. Although the flow is stationary, the formula (7.2) shows that the kinetic energy increases with granularity of the vorticity. This cellular structure is a model for the vorticity generated when baffles are introduced. Adding a perturbation to this exact solution, and using it as initial data, is a mechanism for generating a non-trivial sloshing flow field with time-dependent vorticity. Some experiments show evidence of vorticity. In a viscous fluid, vorticity can be generated by boundary layers and vortex shedding. For short times, it is the vorticity in initial data that will dominate. Many sloshing experiments start with a quiescent fluid (e.g. [26]), generating an irrotational flow until viscosity influences the vorticity field. However, there are some interesting experiments of Herczyńiski & Weidman [27], which introduce non-zero kinetic energy into the initial data. In [27], they were interested in the induced motion of the vessel due to the fluid. The fluid was set in motion and transients eliminated before recording, thereby ensuring non-trivial kinetic energy in the initial data. Vorticity was not measured and the experiments were compared with irrotational theory, but the experiment shows that it is possible to generate initial conditions with vorticity in a sloshing experiment. Another approach to generating strong vorticity in the initial data is to insert a baffle to generate vortex shedding before starting the experimental record.

Concluding remarks
In this paper, a new variational principle has been introduced for two-dimensional inviscid incompressible fluid flow in a moving vessel with coupling to the vessel motion. It is a starting point for new applications and new directions (three-dimensionality, other geometries, multi-valued free surface and effects such as surface tension).
The representation of the surface as a graph, y = h(x, t) simplified the analysis, but the variational principle can be generalized to the case where the surface is represented parametrically, x = X(s, t) and y = Y(s, t), for 0 < s < L, thereby allowing for overhanging and a multi-valued free surface. Coupling with elastic vessel motion or elastic pendulum rod is also a potential generalization. Sloshing in microgravity can be modelled by introducing surface tension which fits neatly into the variational framework since surface tension is intrinsically linked to the variational derivative of the free surface mean curvature.
The Lagrangian variational principle here opens the door to generating a Hamiltonian formulation with a Lie-Poisson structure, extending the theory in Lewis et al. [28] (for incompressible free surface flows) and Mazer & Ratiu [29] (for compressible free surface flows) to the dynamically coupled problem.
In the formulation presented here, there were hints about the structure of the problem in 3D. However there are still technical difficulties in extending the fluid part to 3D. Firstly, a parametrization of divergence-free vector fields is required. The preferred option is a vector stream function, but the pressure boundary condition then presents challenges. The tangential derivative of pressure has two components and the extension of the GKK theory to 3D does not result in a conservation law (see [16] for the GKK theory in 3D without rotation). On the other hand, the extension of the vessel motion to 3D is straightforward.
Three-dimensional cylindrical geometry has many applications. Timokha [5] discusses vorticity in sloshing, and comments on the 'glass-wine' paradox, whereby a steady-state swirl motion in a vessel generates a vortex by conversion of the wave angular momentum to the vortex angular momentum. Modelling propellant sloshing in rockets also requires cylindrical geometry in 3D. Another interesting application of cylindrical geometry is the ignoble problem of 'walking with coffee' (cf. Mayer & Krechetnikov [30]). In [30], a simple mechanical model is developed for the interaction between sloshing coffee and the cup's dynamics and they comment on the possibility of designing a flexible container to suppress the sloshing. In addition to flexibility, it may be that swirl or vorticity or the variational structure also play a role.
Data accessibility. This article has no additional data. Authors' contributions. The construction of the paper involved formulation, discussions, derivations, blending and writing. Tasks circulated generating various twists and turns and re-formulations. On balance the five authors made equivalent contributions. All authors reviewed the final form manuscript.
Competing interests. We declare we have no competing interests. This confirms the variational derivatives (4.5) and the first of (4.6). Now keep all other variations fixed, and vary with respect to h, Rearranging and substituting the above expressions which confirms the second of (4.6) using (2.17).