1 Introduction

The classical Rayleigh–Taylor Instability (RTI) occurs in a system of two horizontal fluid layers separated by an interface. The upper fluid is more dense than the lower one, so that the system is unstable. Any initial disturbance to the interface grows with time, giving rise to downward spikes of the heavier fluid alternating with upwardly-moving bubbles of the lower, lighter fluid. Eventually, nonlinear effects dominate the shape of the evolving interface and the two fluids exchange positions.

In the original analyses of Rayleigh and Taylor, fluid viscosity was ignored and it was assumed that the interface was an horizontal plane subject to small-amplitude disturbances. In that case, linearized theory can be brought to bear, assuming that the disturbances remain small. Linearization predicts that the amplitude of these disturbances grows exponentially with time if the upper fluid has greater density. If the lower fluid is more dense, however, the initial perturbation oscillates periodically with time and the overall flow is therefore neutrally stable. This classical result is explained in detail by Chandrasekhar [1, chapter 92, page 433].

In the unstable case in which the more dense fluid lies above the less dense one, linearized theory can only be valid for a finite time, since the rapid growth predicted for the waves at the interface soon invalidates the small-amplitude assumption upon which linearization is based. Andrews and Dalziel [2] suggest that Rayleigh–Taylor instability develops in three stages, the first of which is indeed the exponential growth at early times suggested by linearized theory. At slightly later times, the instability ‘saturates’ and nonlinear overturning occurs; finally, a self-similar mixing layer grows in the interfacial region. The RTI has been the subject of intense study, since it is now known to occur in a wide variety of applications, and in cylindrical and spherical geometry as well as in fully three-dimensional situations. Indeed, Rayleigh–Taylor flow has been documented over length scales ranging from microscopic up to astrophysical and galactic scales, as is discussed by Kelley et al. [3]. A review article by Zhou et al. [4] gives examples of RTI flows in astrophysics and industrial circumstances.

When viscosity is ignored in a model of the two-fluid RTI, with a single interface between the fluids, it is possible to account for nonlinear effects by expressing the fluid velocities and interface shape as perturbation expansions in powers of the amplitude \(\epsilon \) of the initial perturbation to the interface, which is taken to be an horizontal periodic wave. The linearized solution is obtained at the first order in \(\epsilon \), and higher-order terms introduce nonlinear effects. Such an expansion has been investigated recently by Liu et al. [5] who assumed a single-mode trigonometric function \(\epsilon \cos (kx)\) as their initial disturbance and then carried out a solution to order \(\epsilon ^3\). They showed that their weakly nonlinear third-order expression for the interface shape gave a better agreement with a numerical solution than the simple linearized solution. Nevertheless, when a purely inviscid model, in which there is a sharp interface between the two fluids, is solved to high accuracy (or equivalently, to very high order powers of \(\epsilon \)), it is found that the solution fails within finite time. This is due to the fact that an infinitesimally thin interface between the two fluids eventually develops a curvature singularity, due to the effects of nonlinearity. This was shown asymptotically by Moore [6]. He estimated the critical time at which the solution would fail, and he identified the source of this failure as the assumption that the interface between the two fluids would occur as an infinitesimally narrow vortex sheet instead of a vortex layer of finite width. To continue an inviscid model beyond the time at which curvature singularities and hence failure occur, it is therefore necessary to invoke an approach that models the interface as some zone of finite thickness between the fluids, across which tangential velocity components change rapidly but smoothly. This was accomplished by Krasny [7] who introduced a “vortex blob” technique, in which a numerical method that desingularizes a singular integral equation effectively smudges the interfacial vortex sheet across some numerically-generated finite vortex layer. Krasny showed that, with this technique, his inviscid equations could continue past Moore’s critical time and could produce the famous rolled-up “cat’s eyes” interfaces (see van Dyke [8, page 85]) associated with the Kelvin–Helmholtz instability he was investigating.

It is reasonable to suppose that the introduction of viscosity into these models of Rayleigh–Taylor Instability (RTI) might eliminate the possibility of singular behaviour at a sharp interface between the fluids, but this turns out not to be entirely correct. Forbes et al. [9] demonstrated a solution in slow viscous (Stokes) flow in which the interface developed points of arbitrarily large curvature. This was only overcome by allowing a finite-width interfacial zone between the two creeping fluids, much as advocated by Moore [6] for the purely inviscid situation. A similar type of interfacial singular behaviour was encountered by Forbes and Bassom [10] for a sharp interface between two viscous fluids inside two counter-rotating cylindrical drums.

It is evident, then, that the assumption of a sharp interface between the fluids is undesirable, both for inviscid and for viscous models of the fluids, at least when unstable growth of initial disturbances is to be expected. In the viscous case, imposing the exact boundary conditions (see Batchelor [11, page 150]) on an unknown sharp interface is a difficult task to accomplish, in any case, and so is best avoided. Forbes [12] treated the viscous Rayleigh–Taylor problem between two fluids by making use of the Boussinesq approximation, which is valid when the two fluids have very similar densities. In that viewpoint, the two fluids are treated as a single medium in which the density is a function of position; it has a different constant value in each fluid region, and it varies rapidly but smoothly between the fluids, so creating an effective mixing zone of finite width at the interface. Forbes found that, at the precise time and locations where the inviscid model created a curvature singularity at its sharp interface, the Boussinesq viscous model formed small patches of high vorticity, although the vorticity throughout the rest of the fluid domain remained very small. These small high-vorticity regions are responsible for overturning of the interface and the formation of mushroom-shaped regions.

Boussinesq theory offers a convenient method for including viscous effects, and it is straightforward to implement numerically. It works well when the density ratio between the fluids is approximately one, but it does not give reliable predictions at large ratios. In particular, Boussinesq theory predicts an interfacial zone that possesses a type of symmetry about its undisturbed height, so that the downward-moving spikes of the more dense fluid have precisely the same shape as the upward-moving bubbles of the lighter fluid. This is perhaps consistent with the findings of Clamond and Stepanyants [13] who showed that, when density stratification is ignored in the inertial term, the wave dispersion equation can only give a single mode, and is incapable of including the more detailed structure embodied in infinitely-many additional eigenfunctions (their Figures 2 and 5).

For larger density ratios, this symmetric behaviour predicted by Boussinesq theory is known to be incorrect. As examples, the experimental results of Morgan et al. [14] and Banerjee [15] show that the spikes of denser fluid develop into thin arrow-shaped fingers with tightly-constrained heads, whereas the upward-moving bubbles of lighter fluid become much broader. To account for these asymmetries, various authors have made use of phase-field approaches, in which quantities such as density (and perhaps viscosity) are assumed to be functions of some phase variable \(\phi \). To close the system of equations, it is then assumed that \(\phi \) satisfies some type of advection–diffusion equation in the fluid domain. Lee and Kim [16] used such a technique to extend Forbes’ [12] solutions to larger density ratios, and demonstrated the loss of symmetry between the downward spikes and upward bubbles, for larger density ratio. Their phase function \(\phi \) was taken to obey a Cahn–Hilliard equation. Recently, De Rosis and Enan [17] solved two and three-dimensional two-fluid problems using an Allen-Cahn equation for the phase function \(\phi \). Phase-field methods evidently perform well and are able to capture the important features of the downward spikes and upwardly-moving bubbles in Rayleigh–Taylor flow, although it is perhaps not entirely obvious what the phase function \(\phi \) represents, or precisely what equation it should satisfy. In an attempt to retain more closely a physical basis for these types of numerical methods, Forbes et al. [18] proposed an Extended Boussinesq approximation. This model does not approximate the density function in the Navier–Stokes equation, and so is more accurate than the simple Boussinesq approach, but it uses the hydrostatic approximation to eliminate the gradient of the pressure from the equation. Like Boussinesq theory, it is very straightforward to implement, and it gives a more accurate solution for moderate density ratios.

Very recently, Walters et al. [19] have developed an approach they have named the Completed Boussinesq model. They demonstrated that this new approach is able to give very accurate solutions for high density ratios. They compared their results with classical Boussinesq theory and the Extended Boussinesq approximation and also with the results of an SPH (smoothed particle hydrodynamics) code. At large density ratios, classical Boussinesq theory is unable to capture the asymmetry of the bubbles and spikes in RTI flow; in addition, it predicts the formation of florid vortices, which are not present in experimental observations. The Extended Boussinesq theory [18] suppresses this vortex formation to a large extent, but over-estimates the width of the downward-moving spikes of the heavier fluid. Walters et al. [19] demonstrated that their Completed Boussinesq model predicted all these features correctly, and was in close agreement with the SPH results.

The interest in this present paper concerns three-layer fluids, each of which may have a different density, and in which inversion may exist, so that a Rayleigh–Taylor instability will occur at least on one of the two interfaces separating the three fluids. Flows of this type are present in the ocean and the atmosphere, for example, and a detailed experimental study of a three-layer RTI has been presented by Jacobs and Dalziel [20] for the inversion-layer situation, in which the middle layer has a higher density than either the top or bottom ones. A linearized theory for three-layer RTI flows is discussed by Kull [21] for the simplifying case in which both the top and bottom layers are of infinite depth. Nevertheless, Kull shows that the addition of an extra fluid layer complicates the mathematical analysis very considerably. A similar linearized analysis (with infinitely deep top and bottom layers) has also been presented by Melikhov et al. [22], and those authors were concerned with a situation that may occur in reactors, in which the middle layer consists of steam. A problem of similar mathematical structure arises in geophysics, when a layer with different density and viscosity penetrates an otherwise uniform medium, and the linearized analysis in that situation is discussed by Wilcock and Whitehead [23]. In Sect. 3 of this present paper, we present the inviscid linearized solution for three-layer Rayleigh–Taylor flow in a finite-height channel, and although very complicated, it does provide a point of comparison for the nonlinear results.

Possibly the earliest numerical solution for large-amplitude three-layer Rayleigh–Taylor flow is that presented by Baker et al. [24], computed using a vortex method which might be regarded as a precursor to the de-singularized scheme of Krasny [7]. They found that there are regions along the wave at which the middle fluid is “squeezed” by the two outer fluids. In a study concerned with Rayleigh–Taylor mixing as a precursor to turbulence, Youngs [25] considers four test problems using direct numerical simulation and compares the results against a large-eddy simulation code. One of the test problems considered is a three-layer compressible Rayleigh–Taylor flow, and Youngs shows results at a time when self-similar mixing has been attained. The relevance of this problem to inertial confinement fusion experiments is discussed. A similar type of study has been presented recently by Garoosi and Mahdi [26], who were concerned with the ability of a volume-of-fluid method to solve some canonical problems with multi-phase fluids, and one of these was a three-layer Rayleigh–Taylor flow. With three-phase systems, there are two independent types of periodic initial disturbances to consider, since the two interfaces could start in-phase (sinuous), or opposing each other in an anti-phase configuration (varicose). Garoosi and Mahdi [26] present three-layer RTI results for several different times, for the sinuous case as well as for varicose-type flows. Their varicose solutions, in particular, show how the middle fluid layer can become “squeezed” between the top and bottom layers, and, since its mass must be conserved, it develops very slender sections alternating with large “blobs”. This is at least qualitatively consistent with the early results of Baker et al. [24].

We present the governing equations for our three-layer Rayleigh–Taylor configuration in Sect. 2. This is followed by Sect. 3, where the linearized solution for the inviscid model is discussed, assuming that the two interfaces are infinitesimally thin vortex sheets. A spectral method for solving this three-layer RTI problem is introduced in Sect. 4. This uses the Completed Boussinesq model of Walters et al. [19] to express the density perturbation and the streamfunction as double Fourier series in space, with time-dependent coefficients that are found as the solution to a large system of ordinary differential equations. A very large linear matrix equation must be solved for the time-derivatives of the coefficients of the streamfunction, at each new time step, and this is achieved here using a pre-conditioned iteration scheme that significantly accelerates the simple fixed-point iteration that was used by Walters et al.. Details are given in Sect. 4. Results of extensive computation are discussed in Sect. 5, and these are validated by careful comparison with the linearized solution of Sect. 3 as well as results obtained from an independent smoothed-particle hydrodynamics (SPH) code. Some concluding remarks are given in Sect. 6.

2 The Governing Equations

We suppose a system of three horizontal fluids is confined between lower and upper horizontal walls. A Cartesian coordinate system is defined so that the x-axis points horizontally and the y-axis is vertical. Unit vectors \({\textbf{i}}\) and \({\textbf{j}}\) point in the positive x- and y-directions, respectively; thus the gravitational body force per mass is \(- g {\textbf{j}}\) in which g is the acceleration of gravity The lower wall lies along \(y = -H_1\) and the upper wall is at \(y = H_2\). When undisturbed, the lowest fluid (labelled “fluid 1”) occupies the region \(- H_1< y < - H_1 + p_0 \left( H_1 + H_2 \right) \), the middle fluid (fluid 2) is located over \(- H_1 + p_0 \left( H_1 + H_2 \right)< y < - H_1 + q_0 \left( H_1 + H_2 \right) \) and the top fluid (fluid 3) lies in \(- H_1 + q_0 \left( H_1 + H_2 \right)< y < H_2\). Here, the two constants \(p_0\) and \(q_0\) are dimensionless parameters that define the locations of the two interfaces between the three fluids, so that it is required to impose the condition \(0< p_0< q_0 < 1\).

Each of the three fluids has the same dynamic viscosity \(\mu \). However, their densities differ and are denoted \(\rho _1\), \(\rho _2\) and \(\rho _3\) for fluids 1, 2 and 3 respectively. If a sharp interface is present between bottom fluid 1 and middle fluid 2, it will be represented mathematically as \(y = \eta _2 (x,t)\) and similarly the interface between middle fluid 2 and top fluid 3 is \(y = \eta _3 (x,t)\), in which t denotes time. In each layer there is a fluid velocity vector \({\textbf{q}} = u{\textbf{i}} + v{\textbf{j}}\) with velocity components u(xyt) and v(xyt) in the x- and y-directions, respectively, for this vertical planar flow. A periodic disturbance is made to this system at the initial time \(t=0\), and the axes are arranged so that the disturbance is symmetric about the vertical y-axis. For a disturbance of wavelength \(\lambda \), a complete period is therefore located over the horizontal interval \(- \lambda / 2< x < \lambda / 2\). Conservation of mass in each fluid is expressed by the usual continuity equation

$$\begin{aligned} \frac{\partial \rho }{\partial t} + \varvec{\nabla \cdot } \left( \rho {\textbf{q}} \right) = 0, \end{aligned}$$
(1)

whereas the Navier–Stokes equation

$$\begin{aligned} \rho \left[ \frac{\partial {\textbf{q}}}{\partial t} + \left( {\textbf{q}} \varvec{\cdot \nabla } \right) {\textbf{q}} \right] + \varvec{\nabla } p = - \rho g {\textbf{j}} + \mu \nabla ^2 {\textbf{q}} \end{aligned}$$
(2)

expresses conservation of linear momentum in the fluid.

In a recently published paper, Walters et al. [19] developed a new technique for computing solutions to problems in interfacial fluid mechanics. They named their method the “Completed Boussinesq Approximation”, and their intention was to retain the full accuracy of the exact Navier–Stokes equation (2) without approximation. However, they also wanted to exploit a very powerful simplifying approximation inherent in Boussinesq theory. In the Boussinesq philosophy, the three different fluids with densities \(\rho _1\), \(\rho _2\), \(\rho _3\) and the two sharp interfaces \(y=\eta _2\), \(y=\eta _3\) are all replaced with a single fluid, with a density \(\rho (x,y,t)\) that changes smoothly but rapidly across narrow interfacial zones centred at \(y=\eta _2\) and \(y=\eta _3\). This has the enormous advantage that difficult nonlinear boundary conditions (see Batchelor [11, page 150]) on interfaces of unknown location no longer need to be imposed explicitly; this allows overturning interfaces to be considered, or even situations in which a portion of an interface detaches entirely. This variable density will be written here as \(\rho = \rho _1 + {\overline{\rho }}\), in which \(\rho _1\) is the density of bottom fluid 1, as above. Boussinesq theory then substitutes this form of the density into the continuity equation (1), which is then “split” into an incompressible equation (for the constant density component \(\rho _1\)) plus a “weakly compressible” equation for the transport of the extra density component \({\overline{\rho }}\). This additional function \({\overline{\rho }}\) is considered to be small relative to \(\rho _1\) and so it is then ignored in the Navier–Stokes equation (2), except in the buoyancy term \(- \rho g {\textbf{j}}\) on the right-hand side. This approach was retained by Walters et al. [19] except that they retained the exact form of the density in the momentum equation (2).

We follow [19] and non-dimensionalize this three-layer Rayleigh–Taylor problem using \(\lambda / (2\pi )\) as the scale for all lengths and \(\sqrt{ \lambda / (2\pi g)}\) as the reference for time. Speeds are then scaled relative to the quantity \(\sqrt{ g\lambda / (2\pi )}\). The density \(\rho _1\) of the bottom fluid is used as the reference density, so that pressure is made dimensionless relative to \(\rho _1 g \lambda / (2\pi )\). In these dimensionless variables, the Navier–Stokes equation (2) becomes

$$\begin{aligned} \left( 1 + {\overline{\rho }} \right) \left[ \frac{\partial {\textbf{q}}}{\partial t} + \left( {\textbf{q}} \varvec{\cdot \nabla } \right) {\textbf{q}} \right] + \varvec{\nabla } p = - \left( 1 + {\overline{\rho }} \right) {\textbf{j}} + \frac{1}{R_e} \nabla ^2 {\textbf{q}}. \end{aligned}$$
(3)

The continuity equation (1) is also non-dimensionalized, and then “split” into an incompressible part

$$\begin{aligned} \varvec{\nabla \cdot } {\textbf{q}} = 0 \end{aligned}$$
(4)

along with an additional transport equation

$$\begin{aligned} \frac{\partial {\overline{\rho }}}{\partial t} + \left( {\textbf{q}} \varvec{\cdot \nabla } \right) {\overline{\rho }} = \sigma \nabla ^2 {\overline{\rho }} \end{aligned}$$
(5)

for the perturbation density function \({\overline{\rho }} (x,y,t)\). Initially, the system is started from rest, and we consider a perturbation to each interface consisting of a single Fourier cosine mode. Thus the initial condition for the density perturbation function is

$$\begin{aligned} {\overline{\rho }} (x,y,0) = {\left\{ \begin{array}{ll} 0, \quad &{} -h_1< y< -h_1 + \Pi _0 + \epsilon _1 \cos x \\ D_2 - 1 \quad &{} -h_1 + \Pi _0 + \epsilon _1 \cos x< y< -h_1 + \Lambda _0 + \epsilon _2 \cos x \\ D_3 - 1 \quad &{} -h_1 + \Lambda _0 + \epsilon _2 \cos x< y < h_2 \end{array}\right. } \end{aligned}$$
(6)

In the numerical scheme of Sect. 4, this discontinuous initial condition (6) will be smoothed to create a continuous differentiable function, but this condition serves to illustrate the locations of interfaces \(\eta _2\) and \(\eta _3\) at which density would jump discontinuously, and so it will be used in the inviscid linearized solution of Sect. 3.

These dimensionless equations (3)–(6) involve six dimensionless constants, in addition to the two parameters \(p_0\) and \(q_0\) introduced above to specify the unperturbed locations of the two interfaces. These are

$$\begin{aligned}{} & {} h_1 = \frac{2\pi H_1}{\lambda } \quad \text {;}\quad h_2 = \frac{2\pi H_2}{\lambda } \quad \text {;}\quad D_2 = \frac{\rho _2}{\rho _1} \quad \text {;}\quad D_3 = \frac{\rho _3}{\rho _1} \nonumber \\{} & {} \frac{1}{R_e} = \frac{\mu }{\rho _1} \sqrt{ \frac{1}{g} \left( \frac{2\pi }{\lambda } \right) ^3 } \quad \text {;}\quad \sigma = K \sqrt{ \frac{1}{g} \left( \frac{2\pi }{\lambda } \right) ^3 }. \end{aligned}$$
(7)

We observe that an additional diffusion term has been added to the right-hand side of the transport Eq. (5), with dimensionless diffusion coefficient \(\sigma \) and therefore a corresponding dimensional molecular diffusion constant K appearing in (7). A further discussion of this diffusion term is given by Farrow and Hocking [27]. In addition, it will prove convenient to define the three constants

$$\begin{aligned} \Pi _0= & {} p_0 \left( h_1 + h_2 \right) \nonumber \\ \Lambda _0= & {} q_0 \left( h_1 + h_2 \right) \nonumber \\ \Gamma _0= & {} \left( 1 - q_0 \right) \left( h_1 + h_2 \right) , \end{aligned}$$
(8)

two of which have already appeared in (6). As defined above, the two dimensionless numbers \(p_0\) and \(q_0\) both lie between 0 and 1, and give the mean locations of the two interfaces as fractions of the total fluid depth from the bottom. (For example, \(p_0 = 0.2\) would indicate that the undisturbed lower interface lies one fifth of the distance up the channel). In this non-dimensionalization, the channel occupies the region \(-h_1< y < h_2\) and the density ratios of the upper two fluids relative to the bottom fluid are \(D_2\) and \(D_3\) as defined in (7). The Reynolds number is \(R_e\) and the effective dimensionless viscosity is \(1 / R_e\). A sketch of the dimensionless system is given in Fig. 1.

Fig. 1
figure 1

Schematic diagram for the three-layer Rayleigh–Taylor fluid system in dimensionless coordinates

3 Linearized Inviscid Solution

In this section, a linearized solution is derived for this three-layer Rayleigh–Taylor instability in the confined channel \(-h_1< y < h_2\) under the assumptions that the disturbing amplitudes \(\epsilon _1\) and \(\epsilon _2\) in the initial condition (6) are small, and that the effects of viscosity can be ignored. This is an obvious extension of the classical solution of Rayleigh and Taylor (see Drazin and Reid [28, page 19]) and presented for a two-layer system in a channel by Forbes [12]. Nevertheless, it will be seen that the three-layer problem with two interfaces is very substantially more complicated than its two-layer counterpart.

If viscosity may be ignored, then the fluid in each layer may be assumed to flow irrotationally. Then in each layer, the fluid velocity vector \({\textbf{q}}_j\) may be written as the gradient of a scalar velocity potential \(\Phi _j\) according to \({\textbf{q}}_j = \varvec{\nabla } \Phi _j\), \(j = 1,2,3\). Further, since the fluid in each layer is incompressible, then the momentum equation (3) can simply be replaced by Laplace’s equation

$$\begin{aligned} \nabla ^2 \Phi _j = 0, \quad j = 1, 2, 3, \end{aligned}$$
(9)

in which the pressure is obtained from Bernoulli’s equation

$$\begin{aligned} D_j \left[ \frac{\partial \Phi _j}{\partial t} + \frac{1}{2} \Vert {\textbf{q}}_j \Vert ^2 \right] + p_j = - D_j y + C_j (t) \quad j = 1, 2, 3. \end{aligned}$$
(10)

Here, we have written \(D_1 = 1\) for convenience, and \(D_2\), \(D_3\) are the two density ratios defined in (7). The three functions \(C_j (t)\), \(j = 1, 2, 3\) are time-dependent Bernoulli functions. On the lower interface there are two kinematic boundary conditions

$$\begin{aligned} v_j = \frac{\partial \eta _2}{\partial t} + u_j \frac{\partial \eta _2}{\partial x} \quad j = 1, 2 \quad {\text {on }} y = \eta _2, (x,t) \end{aligned}$$
(11)

and on the upper interface

$$\begin{aligned} v_j = \frac{\partial \eta _3}{\partial t} + u_j \frac{\partial \eta _3}{\partial x} \quad j = 2, 3 \quad {\text {on }} y = \eta _3. (x,t). \end{aligned}$$
(12)

These conditions (11), (12) state that none of the fluids involved may cross over their confining interfaces. The two dynamic boundary conditions

$$\begin{aligned} p_1= & {} p_2 \quad {\text {on }} y = \eta _2 (x,t) \nonumber \\ p_2= & {} p_3 \quad {\text {on }} y = \eta _3 (x,t) \end{aligned}$$
(13)

ensure continuity of the normal stress at each interface. Since these inviscid equations (9)–(13) must also hold true when all the fluids are at rest and the interfaces are both flat at their unperturbed heights \(\eta _2 = - h_1 + \Pi _0\) and \(\eta _3 = -h_1 + \Lambda _0\), with \(\Pi _0\) and \(\Lambda _0\) defined in (8), then it follows from (13) that

$$\begin{aligned} C_2 (t)= & {} C_1 (t) + \left( D_2 - 1 \right) \left( -h_1 + \Pi _0 \right) \nonumber \\ C_3 (t)= & {} C_2 (t) + \left( D_3 - D_2 \right) \left( -h_1 + \Lambda _0 \right) \end{aligned}$$
(14)

in the Bernoulli equations (10).

Linearization proceeds on the assumption that only small perturbations are made to the trivial rest state with flat interfaces. This is equivalent to requiring both perturbation amplitudes in the initial condition (6) to be small, and this is satisfied by setting

$$\begin{aligned} \epsilon _1= & {} \epsilon \alpha _1 \nonumber \\ \epsilon _2= & {} \epsilon \alpha _2 \end{aligned}$$
(15)

for some small parameter \(\epsilon \). The three velocity potentials in (9) are now expanded as perturbation series of the form

$$\begin{aligned} \Phi _j (x,y,t) = \epsilon \Phi _j^L (x,y,t) + {\mathcal {O}} \left( \epsilon ^2 \right) , \quad j = 1, 2, 3 \end{aligned}$$
(16)

and the interface locations are

$$\begin{aligned} \eta _2 (x,t)= & {} -h_1 + \Pi _0 + \epsilon \eta _2^L (x,t) + {\mathcal {O}} \left( \epsilon ^2 \right) \nonumber \\ \eta _3 (x,t)= & {} -h_1 + \Lambda _0 + \epsilon \eta _3^L (x,t) + {\mathcal {O}} \left( \epsilon ^2 \right) . \end{aligned}$$
(17)

These expansions (16), (17) are substituted into the governing equations, and the linearized system is obtained when only terms of the first order in parameter \(\epsilon \) are retained.

At the first order in \(\epsilon \), each velocity potential satisfies Laplace’s equation in its linearized domain in which the interfaces are projected onto their unperturbed heights \(-h_1 + \Pi _0\) and \(-h_1 + \Lambda _0\). The three sets of linearized velocity components are obtained from the gradients of the three velocity potentials, so that

$$\begin{aligned} u_j^L = \frac{\partial \Phi _j}{\partial x} \quad \text {;} \quad v_j^L = \frac{\partial \Phi _j}{\partial y} \quad j = 1, 2, 3. \end{aligned}$$
(18)

The linearized forms of the kinematic boundary conditions (11) and (12) are

$$\begin{aligned} v_j^L = \frac{\partial \eta _2^L}{\partial t} \quad j = 1, 2 \quad {\text {on }} y = -h_1 + \Pi _0 \end{aligned}$$
(19)

and

$$\begin{aligned} v_j^L = \frac{\partial \eta _3^L}{\partial t} \quad j = 2, 3 \quad {\text {on }} y = -h_1 + \Lambda _0, \end{aligned}$$
(20)

and the dynamic boundary conditions (13), combined with the Bernoulli equations (10) and (14), take the linearized forms

$$\begin{aligned} \left( D_2 - 1 \right) \eta _2^L - \frac{\partial \Phi _1^L}{\partial t} = - D_2 \frac{\partial \Phi _2^L}{\partial t}{} & {} \quad {\text {on }} y = -h_1 + \Pi _0 \end{aligned}$$
(21)
$$\begin{aligned} \left( D_3 - D_2 \right) \eta _3^L - D_2 \frac{\partial \Phi _2^L}{\partial t} = - D_3 \frac{\partial \Phi _3^L}{\partial t}{} & {} \quad {\text {on }} y = -h_1 + \Lambda _0. \end{aligned}$$
(22)

On the bottom and top walls of the channel, the fluids can slip horizontally but are not free to move vertically, so that

$$\begin{aligned} v_1^L = 0{} & {} \quad {\text {on }} y = -h_1 \end{aligned}$$
(23)
$$\begin{aligned} v_3^L = 0{} & {} \quad {\text {on }} y = h_2. \end{aligned}$$
(24)

The linearized system of equations is closed by requiring

$$\begin{aligned} \eta _2^L (x,0)= & {} \alpha _1 \cos x \nonumber \\ \eta _3^L (x,0)= & {} \alpha _2 \cos x \end{aligned}$$
(25)

as initial conditions deriving from the full system (6). We note that the constants \(\alpha _1\), \(\alpha _2\) can be either positive or negative, giving rise either to disturbances that are in phase (sinuous) or of opposing phase (varicose).

It is straightforward to write the formal solutions for Laplace’s equation in each of the three linearized fluid domains, subject to the bottom condition (23) and top condition (24). We obtain

$$\begin{aligned} \Phi _1^L (x,y,t) = A_1^L (t) \cosh \left( y + h_1 \right) \cos x \quad {\text {in }} -h_1< y < -h_1 + \Pi _0 \end{aligned}$$
(26)

in bottom fluid 1,

$$\begin{aligned} \Phi _2^L (x,y,t)= & {} \left[ A_2^L (t) \cosh y + B_2^L (t) \sinh y \right] \cos x \nonumber \\{} & {} \quad {\text {in }} -h_1 + \Pi _0< y < -h_1 + \Lambda _0 \end{aligned}$$
(27)

in the middle layer for fluid 2, and

$$\begin{aligned} \Phi _3^L (x,y,t) = A_3^L (t) \cosh \left( y - h_2 \right) \cos x \quad {\text {in }} -h_1 + \Lambda _0< y < h_2 \end{aligned}$$
(28)

in top-most fluid 3. It remains to calculate the functions \(A_1^L (t)\), \(A_2^L (t)\), \(B_2^L (t)\) and \(A_3^L (t)\) in this solution, along with the two linearized interface shape functions \(\eta _2^L (x,t)\) and \(\eta _3^L (x,t)\). These can be obtained from the six boundary conditions (19)–(22) on the two interfaces.

The two linearized kinematic conditions (19) on the lower interface show that

$$\begin{aligned} \frac{\partial \eta _2^L}{\partial t} = A_1^L (t) \sinh \Pi _0 \cos x \end{aligned}$$
(29)

with

$$\begin{aligned} A_1^L (t) \sinh \Pi _0 = A_2^L (t) \sinh \left( -h_1 + \Pi _0 \right) + B_2^L (t) \cosh \left( -h_1 + \Pi _0 \right) . \end{aligned}$$
(30)

Similarly, the kinematic conditions (20) at the upper interface give its shape function to be

$$\begin{aligned} \frac{\partial \eta _3^L}{\partial t} = - A_3^L (t) \sinh \Gamma _0 \cos x, \end{aligned}$$
(31)

where the constant \(\Gamma _0\) is defined in (8). The function \(A_3^L (t)\) is found from the condition

$$\begin{aligned} - A_3^L (t) \sinh \Gamma _0 = A_2^L (t) \sinh \left( -h_1 + \Lambda _0 \right) + B_2^L (t) \cosh \left( -h_1 + \Lambda _0 \right) . \end{aligned}$$
(32)

It is at this point that the task of finding the remaining functions \(A_2^L\), \(B_2^L\), \(\eta _2^L\) and \(\eta _3^L\) becomes extremely cumbersome, and so it becomes necessary to introduce additional intermediate constants, in order to keep the algebra tractable. We define

$$\begin{aligned} C^{\Pi }= & {} \cosh \left( -h_1 + \Pi _0 \right) \quad \text {;} \quad S^{\Pi } = \sinh \left( -h_1 + \Pi _0 \right) \nonumber \\ C^{\Lambda }= & {} \cosh \left( -h_1 + \Lambda _0 \right) \quad \text {;} \quad S^{\Lambda } = \sinh \left( -h_1 + \Lambda _0 \right) \end{aligned}$$
(33)

and then it follows from the two dynamic conditions (21) and (22) that

$$\begin{aligned}{} & {} \left( D_2 - 1 \right) \eta _2^L (x,t) - \frac{\text {d} A_1^L}{\text {d} t} \cosh \Pi _0 \cos x \\{} & {} \qquad = - D_2 \left[ \frac{\text {d} A_2^L}{\text {d} t} C^{\Pi } + \frac{\text {d} B_2^L}{\text {d} t} S^{\Pi } \right] \cos x \end{aligned}$$

and

$$\begin{aligned}{} & {} \left( D_3 - D_2 \right) \eta _3^L (x,t) + D_3 \frac{\text {d} A_3^L}{\text {d} t} \cosh \Gamma _0 \cos x \\{} & {} \qquad = D_2 \left[ \frac{\text {d} A_2^L}{\text {d} t} C^{\Lambda } + \frac{\text {d} B_2^L}{\text {d} t} S^{\Lambda } \right] \cos x. \end{aligned}$$

These two conditions are differentiated with respect to time, and combined with the kinematic conditions (29) and (31), to give the coupled system of ordinary differential equations

$$\begin{aligned} \left( D_2 - 1 \right) \left[ S^{\Pi } A_2^L (t) + C^{\Pi } B_2^L (t) \right]= & {} F^A \frac{\text {d}^2 A_2^L}{\text {d} t^2} + F^B \frac{\text {d}^2 B_2^L}{\text {d} t^2} \nonumber \\ \left( D_3 - D_2 \right) \left[ S^{\Lambda } A_2^L (t) + C^{\Lambda } B_2^L (t) \right]= & {} G^A \frac{\text {d}^2 A_2^L}{\text {d} t^2} + G^B \frac{\text {d}^2 B_2^L}{\text {d} t^2}. \end{aligned}$$
(34)

In these expressions, a further set of four additional constants

$$\begin{aligned} F_A= & {} S^{\Pi } \coth \Pi _0 - D_2 C^{\Pi } \nonumber \\ F_B= & {} C^{\Pi } \coth \Pi _0 - D_2 S^{\Pi } \nonumber \\ G_A= & {} D_3 S^{\Lambda } \coth \Gamma _0 + D_2 C^{\Lambda } \nonumber \\ G_B= & {} D_3 C^{\Lambda } \coth \Gamma _0 + D_2 S^{\Lambda } \end{aligned}$$
(35)

has been defined, again for convenience.

The two equations in (34) are now solved to give

$$\begin{aligned} A_2^L (t)= & {} \frac{1}{\Delta } \left( P^A \frac{\text {d}^2 A_2^L}{\text {d} t^2} + P^B \frac{\text {d}^2 B_2^L}{\text {d} t^2} \right) \nonumber \\ B_2^L (t)= & {} \frac{1}{\Delta } \left( Q^A \frac{\text {d}^2 A_2^L}{\text {d} t^2} + Q^B \frac{\text {d}^2 B_2^L}{\text {d} t^2} \right) . \end{aligned}$$
(36)

Here, the additional constants

$$\begin{aligned} P^A= & {} \left( D_3 - D_2 \right) C^{\Lambda } F^A - \left( D_2 - 1 \right) C^{\Pi } G^A \nonumber \\ P^B= & {} \left( D_3 - D_2 \right) C^{\Lambda } F^B - \left( D_2 - 1 \right) C^{\Pi } G^B \nonumber \\ Q^A= & {} - \left( D_3 - D_2 \right) S^{\Lambda } F^A + \left( D_2 - 1 \right) S^{\Pi } G^A \nonumber \\ Q^B= & {} - \left( D_3 - D_2 \right) S^{\Lambda } F^B + \left( D_2 - 1 \right) S^{\Pi } G^B \end{aligned}$$
(37)

have been defined, along with the determinant of the system (34)

$$\begin{aligned} \Delta= & {} \left( D_3 - D_2 \right) \left( D_2 - 1 \right) \left( S^{\Pi } C^{\Lambda } - S^{\Lambda } C^{\Pi } \right) \nonumber \\= & {} - \left( D_3 - D_2 \right) \left( D_2 - 1 \right) \sinh \left( \Lambda _0 - \Pi _0 \right) . \end{aligned}$$
(38)

It is now straightforward to derive a fourth-order differential equation for \(A_2^L (t)\) from this system (36). We obtain

$$\begin{aligned} \left( P^A Q^B - Q^A P^B \right) \frac{\text {d}^4 A_2^L}{\text {d} t^4} - \Delta \left( P^A + Q^B \right) \frac{\text {d}^2 A_2^L}{\text {d} t^2} + \Delta ^2 A_2^L = 0. \end{aligned}$$
(39)

This differential equation is able to be simplified somewhat by virtue of the relations (33) and (37) which show that

$$\begin{aligned} P^A Q^B - Q^A P^B = \Delta \left( F^A G^B - G^A F^B \right) . \end{aligned}$$

The two functions \(A_2^L (t)\) and \(B_2^L (t)\) now both have solutions in terms of exponentials, so that

$$\begin{aligned} A_2^L (t)= & {} K_1 \textrm{e}^{\xi _1 t} + K_2 \textrm{e}^{\xi _2 t} + K_3 \textrm{e}^{\xi _3 t} + K_4 \textrm{e}^{\xi _4 t} \nonumber \\ B_2^L (t)= & {} \frac{1}{P_B} \left[ K_1 T_1 \textrm{e}^{\xi _1 t} + K_2 T_2 \textrm{e}^{\xi _2 t} + K_3 T_3 \textrm{e}^{\xi _3 t} + K_4 T_4 \textrm{e}^{\xi _4 t} \right] \end{aligned}$$
(40)

in which the additional four constants are

$$\begin{aligned} T_j = \Delta / \xi _j^2 - P^A, \quad j = 1, 2, 3, 4 \end{aligned}$$
(41)

and the four eigenvalues

$$\begin{aligned} \xi _1= & {} \sqrt{ \frac{1}{2\Gamma _{AB}^2} \left[ - \left( P^A + Q^B \right) + \sqrt{ \left( P^A + Q^B \right) ^2 + 4\Delta \Gamma _{AB}^2} \right] } = - \xi _2 \nonumber \\ \xi _3= & {} \sqrt{ \frac{1}{2\Gamma _{AB}^2} \left[ - \left( P^A + Q^B \right) - \sqrt{ \left( P^A + Q^B \right) ^2 + 4\Delta \Gamma _{AB}^2} \right] } = - \xi _4 \end{aligned}$$
(42)

are obtained from the fourth-order differential equation (39). Here we have used the short-hand notation

$$\begin{aligned} F^A G^B - G^A F^B \equiv - \Gamma _{AB}^2 \end{aligned}$$

since this quantity can be shown to be negative.

It remains to determine the four constants \(K_1\), \(K_2 = - K_1\), \(K_3\), and \(K_4 = - K_3\) in these solutions (40). These are determined from initial conditions. Since the system starts from rest, it follows from (29) and (31) that

$$\begin{aligned} A_2^L (0) = 0;\quad B_2^L (0) = 0. \end{aligned}$$

In addition, the initial condition (25) must also be satisfied. After a very substantial amount of algebra, the solution for the two linearized wave-shape functions in (17) is

$$\begin{aligned} \eta _2^L (x,t)= & {} \biggl [ \frac{2K_1}{\xi _1} \left( S^{\Pi } + C^{\Pi } T_1 / P^B \right) \cosh \left( \xi _1 t \right) \nonumber \\{} & {} \quad + \frac{2K_3}{\xi _3} \left( S^{\Pi } + C^{\Pi } T_3 / P^B \right) \cosh \left( \xi _3 t \right) \biggr ] \cos x \end{aligned}$$
(43)
$$\begin{aligned} \eta _3^L (x,t)= & {} \biggl [ \frac{2K_1}{\xi _1} \left( S^{\Lambda } + C^{\Lambda } T_1 / P^B \right) \cosh \left( \xi _1 t \right) \nonumber \\{} & {} \quad + \frac{2K_3}{\xi _3} \left( S^{\Lambda } + C^{\Lambda } T_3 / P^B \right) \cosh \left( \xi _3 t \right) \biggr ] \cos x, \end{aligned}$$
(44)

where use has been made of the constants in (33), (37) as needed, and

$$\begin{aligned} \frac{2K_1}{\xi _1}= & {} \frac{- {\mathcal {R}}_5 + T_3 {\mathcal {R}}_6}{T_3 - T_1} \nonumber \\ \frac{2K_3}{\xi _3}= & {} \frac{{\mathcal {R}}_5 - T_1 {\mathcal {R}}_6}{T_3 - T_1}. \end{aligned}$$
(45)

The constants \(T_1\) and \(T_3\) in these expressions are as defined in (41). The two additional constants

$$\begin{aligned} {\mathcal {R}}_5= & {} - \frac{ P^B \left( S^{\Pi } \alpha _2 - S^{\Lambda } \alpha _1 \right) }{\sinh \left( \Lambda _0 - \Pi _0 \right) } \nonumber \\ {\mathcal {R}}_6= & {} \frac{ C^{\Pi } \alpha _2 - C^{\Lambda } \alpha _1}{\sinh \left( \Lambda _0 - \Pi _0 \right) } \end{aligned}$$
(46)

arise from the two inhomogeneous initial conditions (25).

The closed-form solution to this linearized inviscid model therefore involves the two interface shapes (43), (44) with constants (45) and (46). The three linearized velocity potentials in (26)–(28) can likewise be constructed using the eigenvalues (42) along with (45), but these are not shown here. This linearized solution also determines the stability or otherwise of the system, since (43), (44) show that the interfacial waves will grow with time, and hence be unstable, if either of the two eigenvalues \(\xi _1\) or \(\xi _3\) in (42) is real. However, these eigenvalues are complicated functions of the two density ratios \(D_2\) and \(D_3\) as well as the relative depths of the fluid layers, determined by the two parameters \(p_0\) and \(q_0\). It is therefore difficult to make many general observations about stability, which must usually be determined on a case-by-case basis instead. Nevertheless, it can be observed that, in the stably stratified case \(D_3< D_2 < 1\), the parameter \(\Delta \) in (38) is negative, so that both \(\xi _1\) and \(\xi _3\) are purely imaginary; in that case the interface does not grow with time, so that the solution is stable, as expected.

4 Spectral Numerical Solution

For an unstable three-layer flow, it might be expected that the linearized solution of Sect. 3 would give a reasonable approximation to the interface shapes in early stages of the flow, but would become progressively less accurate as time increases and the amplitudes of the waves at the interfaces grow. Nonlinear effects start to dominate as the solution develops, and numerical techniques are needed. Here, we are concerned with solving the governing equations (3), (4) and (5) for the Completed Boussinesq Model, to see the later stages of the flow. The Completed Boussinesq model, developed by Walters et al. [19], allows the use of density ratios \(D_2\) and \(D_3\) that are significantly higher than could be justified for the standard Boussinesq approach. Accordingly, the results presented later in this paper have density ratios of two and three.

As in Walters et al. [19], we make use of a vorticity-streamfunction formulation for this problem. Firstly, a streamfunction \(\Psi (x,y,t)\) is introduced, from which the two velocity components may be calculated according to the formulae

$$\begin{aligned} u = \frac{\partial \Psi }{\partial y}; \quad v = - \frac{\partial \Psi }{\partial x}. \end{aligned}$$
(47)

These ensure that the mass continuity equation (4) is satisfied identically for incompressible fluids. Next, the pressure p is eliminated from the Navier–Stokes equation (3) by taking the vector curl of this expression. In this planar problem, the vorticity vector is \(\varvec{\zeta } = \omega {\textbf{k}}\), in which \({\textbf{k}}\) is the unit vector pointing out of the (vertical) \(x-y\) plane, and the single vorticity component is

$$\begin{aligned} \omega = \frac{\partial v}{\partial x} - \frac{\partial u}{\partial y} = - \nabla ^2 \Psi . \end{aligned}$$
(48)

Now the curl of the momentum equation (3) gives rise to a type of vorticity equation

$$\begin{aligned} \left( 1 + {\overline{\rho }} \right) \frac{\partial \omega }{\partial t} - \frac{\partial {\overline{\rho }}}{\partial y} \frac{\partial u}{\partial t} + \frac{\partial {\overline{\rho }}}{\partial x} \frac{\partial v}{\partial t} = \frac{1}{R_e} \nabla ^2 \omega + {\mathcal {H}}_N - \frac{\partial {\overline{\rho }}}{\partial x}. \end{aligned}$$
(49)

Here, the nonlinear convection behaviour has been collected into the single term

$$\begin{aligned} {\mathcal {H}}_N \equiv - u \left[ \frac{\partial {\overline{\rho }}}{\partial x} \frac{\partial v}{\partial x} + \frac{\partial {\overline{\rho }}}{\partial y} \frac{\partial v}{\partial y} \right] + v \left[ \frac{\partial {\overline{\rho }}}{\partial x} \frac{\partial u}{\partial x} + \frac{\partial {\overline{\rho }}}{\partial y} \frac{\partial u}{\partial y} \right] - \left( 1 + {\overline{\rho }} \right) \left[ u \frac{\partial \omega }{\partial x} + v \frac{\partial \omega }{\partial y} \right] . \nonumber \\ \end{aligned}$$
(50)

As discussed by Walters et al. [19], this formulation (49) presents a particular challenge for any numerical method. This is because there are three time-derivative terms on the left-hand side of the equation, and each is multiplied by the density or one of its derivatives; these functions are themselves to be found as part of the solution, and they change with time.

For convenience in this paper (and to reduce computer execution time), we have chosen to restrict the examples presented here to ones in which the density profiles are left-right symmetric. This allows the unknown streamfunction to be odd in x and the density perturbation to be even. Then, as in [19], we use spectral representations of these variables in the forms

$$\begin{aligned} \Psi (x,y,t)= & {} \sum _{m=1}^M \sum _{n=1}^N A_{m,n} (t) \sin (mx) \sin \left( \beta _n (y + h_1 ) \right) \end{aligned}$$
(51)
$$\begin{aligned} {\overline{\rho }} (x,y,t)= & {} \sum _{m=0}^M \sum _{n=0}^N C_{m,n} (t) \cos (mx) \cos \left( \beta _n (y + h_1 ) \right) . \end{aligned}$$
(52)

These expressions involve the constants

$$\begin{aligned} \beta _n = n \pi / \left( h_1 + h_2 \right) . \end{aligned}$$

The two velocity components u and v are likewise represented spectrally, and are obtained at once by direct differentiation of (51), following the relations (47). The result is

$$\begin{aligned} u (x,y,t)= & {} \sum _{m=1}^M \sum _{n=1}^N \beta _n A_{m,n} (t) \sin (mx) \cos \left( \beta _n (y + h_1 ) \right) \nonumber \\ v (x,y,t)= & {} - \sum _{m=1}^M \sum _{n=1}^N m A_{m,n} (t) \cos (mx) \sin \left( \beta _n (y + h_1 ) \right) . \end{aligned}$$
(53)

These, in turn, are differentiated to give the spectral form

$$\begin{aligned} \omega (x,y,t) = \sum _{m=1}^M \sum _{n=1}^N \Delta _{m,n}^2 A_{m,n} (t) \sin (mx) \sin \left( \beta _n (y + h_1 ) \right) \end{aligned}$$
(54)

for the vorticity, from the definition (48). Here, we have introduced the constants

$$\begin{aligned} \Delta _{m,n}^2 = m^2 + \beta _n^2 \end{aligned}$$
(55)

as in Walters et al. [19].

The transport equation (5) is now decomposed spectrally, to give a system of ordinary differential equations for the coefficients \(C_{m,n} (t)\) in the representation (52) for the density perturbation function. The equation is multiplied by a typical basis function \(\cos (kx) \cos \left( \beta _{\ell } (y + h_1 ) \right) \), \(k = 0, 1, 2, \dots , M\), \(\ell = 0, 1, 2, \dots , N\) and integrated over the fluid domain \(-\pi< x < \pi \), \(h_1< y < h_2\). Because these trigonometric functions are orthogonal, this process gives rise to a fairly straightforward system

$$\begin{aligned} \frac{\textrm{d} C_{k,\ell } (t)}{\textrm{d} t}{} & {} = - \sigma \Delta _{k,\ell }^2 C_{k,\ell } (t) \nonumber \\{} & {} \quad - \frac{2}{\pi \left( h_1 + h_2 \right) \theta _{k,\ell }} \int _{-\pi }^{\pi } \int _{- h_1}^{h_2} \left( u \frac{\partial {\overline{\rho }}}{\partial x} + v \frac{\partial {\overline{\rho }}}{\partial y} \right) \cos (kx) \,\nonumber \\{} & {} \quad \cos \left( \beta _{\ell } (y + h_1 ) \right) \textrm{d}y \, \textrm{d}x, k = 0, 1, 2, \dots , M \quad \text {;}\quad \ell = 0, 1, 2, \ldots , N, \nonumber \\ \end{aligned}$$
(56)

which is suitable for integrating forward in time using standard software. Here, the constants \(\Delta _{k,\ell }^2\) are as defined in (55). The additional constants

$$\begin{aligned} \theta _{k,\ell } = \left( 1 + \delta _{k,0} \right) \left( 1 + \delta _{0,\ell } \right) , \end{aligned}$$

have been defined for convenience; the quantity \(\delta _{p,q}\) is the usual Kronecker delta symbol which has the value one if \(p=q\) but is zero otherwise.

In this Completed Boussinesq approximation, the treatment of the vorticity equation (49) presents the biggest difficulty. It is similarly subject to Fourier decomposition, by multiplying by a typical basis function \(\sin (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \), \(k = 1, 2, \dots , M\), \(\ell = 1, 2, \dots , N\) and integrating over the fluid domain. As in the recent paper [19], integration by parts is then used to convert terms in the integrand, involving the derivatives \(\partial {\overline{\rho }} / \partial x\) and \(\partial {\overline{\rho }} / \partial y\), into expressions involving \({\overline{\rho }}\) only. This gives a matrix equation for the time-derivatives of the Fourier coefficients \(A_{m,n} (t)\) in the representation (51) for the streamfunction, which may be written as

$$\begin{aligned}{} & {} \frac{\textrm{d} A_{k,\ell } (t)}{\textrm{d} t} \pi \frac{1}{2} \left( h_1 + h_2 \right) \Delta _{k,\ell }^2 \nonumber \\{} & {} \qquad + \sum _{m=1}^M \sum _{n=1}^N \frac{\textrm{d} A_{m,n} (t)}{\textrm{d} t} \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} {\overline{\rho }} (x,y,t) {\mathcal {K}}_{m,k,n,\ell } (x,y) \, \textrm{d}y \, \textrm{d}x \nonumber \\{} & {} \quad = - \frac{1}{R_e} \Delta _{k,\ell }^4 A_{k,\ell } (t) \pi \frac{1}{2} \left( h_1 + h_2 \right) \nonumber \\{} & {} \qquad + \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\mathcal {H}}_N - \frac{\partial {\overline{\rho }}}{\partial x} \right] \sin (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x, \end{aligned}$$
(57)

in which the constants \(\Delta _{k,\ell }^2\) may be obtained from (55) and where it has also been convenient to define the four-subscripted kernel function

$$\begin{aligned} {\mathcal {K}}_{m,k,n,\ell } (x,y)= & {} m k \cos (mx) \cos (kx) \sin \left( \beta _n (y + h_1 ) \right) \sin \left( \beta _{\ell } (y + h_1 ) \right) \nonumber \\{} & {} + \beta _n \beta _{\ell } \sin (mx) \sin (kx) \cos \left( \beta _n (y + h_1 ) \right) \cos \left( \beta _{\ell } (y + h_1 ) \right) . \nonumber \\ \end{aligned}$$
(58)

This system (57) is a linear matrix equation to be solved for the time-derivatives of the Fourier coefficients \(A_{m,n}\). Then, the two sets of ordinary differential equations (56) and (57) are integrated forward in time.

The difficulty with (57) is that it is too large to be solved exactly using Gauss elimination, and consequently, approximate iterative methods are needed instead. In Walters et al. [19] this was done using a simple fixed-point approach, in which an initial guess was made for the \(MN \times 1\) vector of the derivatives \(\textrm{d} A_{m,n} / \textrm{d} t\) and substituted into the integral term, so that a new estimate was provided by the single term \(\textrm{d} A_{k,\ell } / \textrm{d} t\). This new iterate was substituted into the integral and the process repeated iteratively until an acceptable convergence was observed.

More generally, it is possible to pre-condition the matrix equation (57) by re-writing it as

$$\begin{aligned}{} & {} \frac{\textrm{d} A_{k,\ell }^{(q+1)} (t)}{\textrm{d} t} \pi \frac{1}{2} \left( h_1 + h_2 \right) \Delta _{k,\ell }^2 + \sum _{m=1}^M \sum _{n=1}^N {\mathcal {M}}_{m,k,n,\ell } (t) \frac{\textrm{d} A_{m,n}^{(q+1)} (t)}{\textrm{d} t} \nonumber \\{} & {} \quad = - \sum _{m=1}^M \sum _{n=1}^N \frac{\textrm{d} A_{m,n}^{(q)} (t)}{\textrm{d} t} \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\overline{\rho }} (x,y,t) - {\overline{\rho }}_{PC} (x,y,t) \right] {\mathcal {K}}_{m,k,n,\ell } (x,y) \, \textrm{d}y \, \textrm{d}x \nonumber \\{} & {} \quad = - \frac{1}{R_e} \Delta _{k,\ell }^4 A_{k,\ell } (t) \pi \frac{1}{2} \left( h_1 + h_2 \right) \nonumber \\{} & {} \qquad + \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\mathcal {H}}_N - \frac{\partial {\overline{\rho }}}{\partial x} \right] \sin (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x. \end{aligned}$$
(59)

In this formulation, the pre-conditioning function \({\overline{\rho }}_{PC} (x,y,t)\) is some known quantity, chosen to mimic the expected behaviour of the unknown density perturbation function \({\overline{\rho }}\), so that the functions

$$\begin{aligned} {\mathcal {M}}_{m,k,n,\ell } (t) = \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} {\overline{\rho }}_{PC} (x,y,t) {\mathcal {K}}_{m,k,n,\ell } (x,y) \, \textrm{d}y \, \textrm{d}x \end{aligned}$$
(60)

are likewise known in advance. As indicated in (59), values of the derivatives of \(A_{k,\ell }\) at new iteration number \(q+1\) can be obtained from values at current iteration number q according to the generalized fixed-point type scheme shown. Nevertheless, this pre-conditioned iteration scheme will only be of any practical value if the size of the matrix equation to be solved at each iteration is very greatly reduced from the size of the original (57), which means that the functions \({\mathcal {M}}_{m,k,n,\ell }\) must be strongly diagonal.

A possible choice for the pre-conditioning term in (59) is suggested by the fact that, in each spatial period \(-\pi< x < \pi \), the mass is constant with time, since there is no flow of material in or out of this section. As a pre-conditioner, we have therefore made use of the average density perturbation

$$\begin{aligned} {\overline{\rho }}_{PC}\equiv & {} {\overline{\rho }}_{\text {av}} = \frac{\int \int {\overline{\rho }} \, \textrm{d}y \, \textrm{d}x}{\int \int \textrm{d}y \, \textrm{d}x} \nonumber \\= & {} p_0 + D_2 \left( q_0 - p_0 \right) + D_3 \left( 1 - q_0 \right) - 1. \end{aligned}$$
(61)

This has been calculated from the initial condition (6), and persists as an invariant of the flow. Here, constants \(p_0\) and \(q_0\) are used to specify the heights of the two interfaces when undisturbed, as used previously in (8) for example. With this choice (61), the pre-conditioned system (59) now produces the iteration scheme

$$\begin{aligned}{} & {} \frac{\textrm{d} A_{k,\ell }^{(q+1)} (t)}{\textrm{d} t} = - \frac{1}{R_e} \frac{\Delta _{k,\ell }^2}{\left( 1 + {\overline{\rho }}_{\text {av}} \right) } A_{k,\ell } (t) \nonumber \\{} & {} \quad - \Omega _{k,\ell } \sum _{m=1}^M \sum _{n=1}^N \frac{\textrm{d} A_{m,n}^{(q)} (t)}{\textrm{d} t} \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\overline{\rho }} (x,y,t) - {\overline{\rho }}_{\text {av}} \right] {\mathcal {K}}_{m,k,n,\ell } (x,y) \, \textrm{d}y \, \textrm{d}x \nonumber \\{} & {} \quad + \Omega _{k,\ell } \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\mathcal {H}}_N - \frac{\partial {\overline{\rho }}}{\partial x} \right] \sin (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x, \end{aligned}$$
(62)

where constants

$$\begin{aligned} \Omega _{k,\ell } = \frac{2}{\left( 1 + {\overline{\rho }}_{\text {av}} \right) \left( h_1 + h_2 \right) \pi \Delta _{k,\ell }^2} \end{aligned}$$

have been defined. The nonlinear convection terms in (62) have all been collected together in the single quantity \({\mathcal {H}}_N\) as defined in (50). We have found that this simple pre-conditioning strategy in (62) gives substantially faster convergence of the iterates \(\textrm{d} A_{k,\ell }^{(q)} / \textrm{d} t\) than the simpler fixed-point scheme used in [19], particularly at higher density ratios.

In order to enable our numerical algorithm to run in parallel, and so to reduce computer run-time very substantially, it is preferable to avoid the four-subscripted kernel \({\mathcal {K}}_{m,k,n,\ell } (x,y)\) in the iteration scheme (62). To do this, the sums and integrals in the first term on the right-hand side of (62) are interchanged, from which it then becomes apparent that the time-derivatives of the two velocity components in (53) can be used, to give

$$\begin{aligned}{} & {} \frac{\textrm{d} A_{k,\ell }^{(q+1)} (t)}{\textrm{d} t} = - \frac{1}{R_e} \frac{\Delta _{k,\ell }^2}{\left( 1 + {\overline{\rho }}_{\text {av}} \right) } A_{k,\ell } (t) \nonumber \\{} & {} \quad + k \Omega _{k,\ell } \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\overline{\rho }} (x,y,t) - {\overline{\rho }}_{\text {av}} \right] \frac{\partial v^{(q)}}{\partial t} \cos (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x \nonumber \\{} & {} \quad - \beta _{\ell } \Omega _{k,\ell } \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\overline{\rho }} (x,y,t) - {\overline{\rho }}_{\text {av}} \right] \frac{\partial u^{(q)}}{\partial t} \sin (kx) \cos \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x \nonumber \\{} & {} \quad + \Omega _{k,\ell } \int _{-\pi }^{\pi } \int _{-h_1}^{h_2} \left[ {\mathcal {H}}_N - \frac{\partial {\overline{\rho }}}{\partial x} \right] \sin (kx) \sin \left( \beta _{\ell } (y + h_1 ) \right) \, \textrm{d}y \, \textrm{d}x. \end{aligned}$$
(63)

This is the final form of the iteration scheme for calculating the derivatives \(\textrm{d} A_{m,n} (t) / \textrm{d} t\) needed in this numerical scheme. Once these have been obtained, the two sets of equations (56) and (63) result in a (large) system of \(2MN + M + N + 1\) ordinary differential equations for the coefficients \(C_{m,n}\) and \(A_{m,n}\). These are integrated forward in time using a fifth-order Runge–Kutta method, with adaptive time-stepping.

In practice, in order to avoid excessive oscillations due to Gibb’s phenomenon, the sharp interfaces between the fluids are blurred slightly, by defining the initial continuous density variation throughout the fluid as

$$\begin{aligned} {\overline{\rho }}= & {} (D_3-D_2)/\left( 1 + \exp \left[ 57 \left( \eta _3(x,0)-y \right) \right] \right) \\{} & {} + D_2/\left( 1 + \exp \left[ 57 \left( \eta _2(x,0)-y \right) \right] \right) , \end{aligned}$$

rather than a discontinuous profile such as (6). This produces steep but smooth transitions between the densities of the three fluids.

5 Presentation of Results

We begin this section by comparing the linearized solution of Sect. 3 against the predictions of the Completed Boussinesq model based on the nonlinear algorithm described in Sect. 4. At early times, when perturbation amplitudes are still small, the two theories ought to agree closely, and so this forms one important method for verifying the nonlinear solution technique.

Fig. 2
figure 2

Comparison of linearized and nonlinear interfacial profiles, for a varicose mode solution for channel width determined by \(h_1 = h_2 = 1.5\), with Reynolds number \(R_e = 10^5\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 1.1\) and \(D_3 = 1.2\). The undisturbed interface positions were determined by \(\Pi _0 = 1, \Lambda _0 = 2\), corresponding to \(y = -0.5\) and \(y = 0.5\). The two initial perturbation amplitudes were \(\epsilon _1 = -0.1\) and \(\epsilon _2 = 0.1\). The linearized solution is drawn with smooth lines and the nonlinear one with dotted lines. Results are shown at times \(t = 3\) and 12 and 15 (red online)

In Fig. 2, we illustrate a comparison of the shapes of the interfaces predicted by the linearized theory of Sect. 3 with the nonlinear solution computed with the algorithm of Sect. 4. In this example, each fluid layer is more dense than the one immediately below it, and the two density ratios are \(D_2 = 1.1\) and \(D_3 = 1.2\). This is clearly a solution of varicose type, and it was started with initial amplitudes \(\epsilon _1 = - 0.1\) and \(\epsilon _2 = 0.1\) in the initial condition (6). The lower and upper channel walls are at heights \(y = - h_1 = - 1.5\) and \(y = h_2 = 1.5\), respectively, and the unperturbed initial interface locations were \(y = - h_1 + \Pi _0 = - 0.5\) and \(y = - h_1 + \Lambda _0 = 0.5\). Solutions are shown for the three separate times \(t = 3\), 12 and 15. The two linearized interface shapes are drawn with solid lines, and were obtained from (43) and (44). The location of the “interfaces” for the nonlinear solution are taken from contours of the density perturbation function \({\overline{\rho }}\) at the two mid-point values \(\left( D_2 - 1 \right) / 2\) and \(\left( D_3 - D_2 \right) / 2\), and are sketched with dotted lines in Fig. 2.

There is excellent agreement between the two solutions at the earliest time \(t = 3\) shown in Fig. 2, confirming the reliability of the nonlinear solution algorithm at early times. As time increases, however, the linearized solution of Sect. 3 is only able to increase exponentially, to a point where it becomes unphysical, whereas the nonlinear interface shape saturates at later times, and the unstable interfacial waves do not continue to grow indefinitely. Thus, in Fig. 2, while there is broadly still good agreement between the linearized and nonlinear solutions at time \(t = 12\), the nonlinear profiles are nevertheless becoming more “pinched” inwards at about the half-wavelength locations \(x = \,\pm \pi / 2 \approx \,\pm 1.57\) for this varicose-mode wave. At the last time \(t = 15\) shown (in red online), the linearized solution maintains its cosinusoidal shape, but has now increased in amplitude to the extent that the two linearized interfaces intersect each other at about \(x = \,\pm 2.6\), giving rise to an unphysical situation. By contrast the nonlinear profile, while still agreeing quite well with the linearized solution at \(x = 0\), develops a sharply pinched section at about the half-wavelength locations, and then becomes almost horizontal over the outer portions of the wave.

To test the reliability of our Completed Boussinesq approximation at moderate wave amplitudes, we have also undertaken a comparison of our results with the predictions of a smoothed-particle hydrodynamics (SPH) code. Overall, the code here is reasonably similar to that used recently in Walters et al. [19], but some improvements are made to handle interfaces with a non-constant spatial separation. The initial particle locations in SPH simulations are typically set to a Cartesian grid; however, this results in a gently curved interface appearing to be locally flat or stepped, when the smoothing kernel used in the SPH technique has radius much smaller than the wavelength of the interface. This leads to rapid growth of Rayleigh–Taylor instabilities at the artificial steps in the discretized interface, and is generally avoided by using a large smoothing kernel. Walters et al. [19] overcame this instead by transforming the coordinate system such that the initial particle locations follow the curvature of the interface, permitting a significantly smaller SPH kernel. This reduces computation time while also capturing fine-scale detail at later times. In this work, the two interfaces may not be separated by an integer number of particles along their entire surface, and thus we need to modify the approach in [19]. Here, we again set the initial conditions of the particles in the fluid below the bottom interface and above the top interface to follow the curvature of the respective interface. However, the particle locations of the fluid lying between the two interfaces are determined by finding the equilibrium positions of these particles after some time by running an SPH simulation. These locations are then taken as the initial conditions for this middle fluid, although the fluid velocities generated by the SPH simulation are ignored.

Fig. 3
figure 3

Comparison of nonlinear interfacial profiles with results obtained from an SPH code, for a Sinuous mode (\(\epsilon _1 = \epsilon _2 = 0.2\)), and b Varicose mode solutions (\(\epsilon _1 = - 0.2\), \(\epsilon _2 = 0.2\)). Here \(h_1 = h_2 = 4\), with Reynolds number \(R_e = 10^5\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 1.1\) and \(D_3 = 1.2\). The undisturbed interface positions were \(y = -0.5\) (\(\Pi _0 = 3.5\)) and \(y = 0.5\) (\(\Lambda _0 = 4.5\)). Results are shown at times \(t = 6\), 8 and 10. The heavy dotted lines are obtained from the Completed Boussinesq model

A sample result is shown in Fig. 3, with the sinuous mode presented in part (a) and the varicose wave type in part (b). The unperturbed bottom layer (yellow online) would have occupied the portion \(- h_1 = -4< y < -0.5\) and has perturbation density \({\overline{\rho }} = 0\), the middle layer (green online) undisturbed would occupy \(-0.5< y < 0.5\) (density \({\overline{\rho }} = 0.1\)), and the top layer (blue online) with perturbation density \({\overline{\rho }} = 0.2\) would lie in the region \(0.5< y < h_2 = 4\). The instability was triggered by perturbations to the interfaces with amplitudes 0.2, giving the growing wave patterns seen in Fig. 3 in each case. These shaded regions are as calculated using the SPH algorithm. The heavy dotted lines (black online) superposed on these regions were computed from the Completed Boussinesq theory outlined in Sect. 4.

It is evident that there is very close agreement between the results obtained with the Completed Boussinesq theory and the predictions of the SPH code, for both the sinuous wave type in part (a) and the varicose mode in part (b), at the earliest time \(t = 6\) shown in Fig. 3. This confirms the accuracy of the Completed Boussinesq theory developed here, and is in accord with the findings of Walters et al. [19] for this model. The agreement between the two models continues to be good at the next time \(t = 8\) for both wave types. At the last time \(t = 10\) shown, some small discrepancies have begun to appear, between the results of the Completed Boussinesq theory and those predicted by the SPH code. In particular, an asymmetry between the upper and lower interfaces has begun to become evident, by time \(t = 10\), in the result calculated using the Completed Boussinesq approximation, and it may be seen that the lower interface has moved downwards to a greater extent than the top one. Nevertheless, the shapes adopted by the interfaces remain very similar between the SPH and Complete Boussinesq models of the flow. This minor discrepancy involves a number of factors, which can be summarized in the observation that the two approximations are each solving slightly different problems. In the Completed Boussinesq model, the flow is genuinely periodic (with period \(2\pi \)) in the horizontal x-direction, whereas the SPH approximation necessarily places vertical walls at some upstream and downstream locations, on which boundary conditions of zero fluid motion must be imposed. This introduces a minor change to the flow, and we have experimented with moving these vertical walls further away from the region of interest \(-\pi< x < \pi \), although this comes at a greatly increased computational cost. In addition, the Completed Boussinesq model does not deal explicitly with interfaces, as discussed in Sect. 2, and so the heavy dotted lines in Fig. 3 represent density contours taken at the midpoint values \(\rho = 1.05\) and \(\rho = 1.15\). Nevertheless, the agreement with the SPH results at least at earlier times serves further to validate the Completed Boussinesq approach, which is also likely to be better suited to modelling this periodic flow.

Fig. 4
figure 4

Nonlinear solutions for an intrusion flow forming an inversion layer, for a Sinuous mode (\(\epsilon _1 = \epsilon _2 = 0.1\)), and b Varicose mode solutions (\(\epsilon _1 = - 0.1\), \(\epsilon _2 = 0.1\)) solutions. Here \(h_1 = h_2 = 4\) with Reynolds number \(R_e = 10^5\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 1.5\) and \(D_3 = 1\). The undisturbed interface positions were \(y = -0.5\) (\(\Pi _0 = 3.5\)) and \(y = 0.5\) (\(\Lambda _0 = 4.5\)). Results are shown at times \(t = 6\), 8 and 10

Longer-time simulations will now be shown using only the Completed Boussinesq model [19]. This technique allows us to carry out these calculations within manageable computational times, whereas the simple SPH model we have implemented for comparative purposes in this paper does not. Two large-amplitude inversion-layer type flows are shown in Fig. 4, for both the sinuous and varicose wave types in part (a) and (b) respectively, at the three times \(t = 6\), 8 and 10. The bottom and top fluids both have the same fluid density \(\rho = 1\) but the middle fluid is more dense, with \(\rho = 1.5\). The two wave amplitudes at \(t = 0\) were both 0.1. This solution was computed using \((M,N) = (320, 640)\) Fourier modes and five times the number of points in xy to ensure accurate integration of the spatial variables. Because the middle layer is more dense than either the layer above or below it, after a sufficient time has elapsed both interfaces eventually droop downwards under gravity, in spite of the fact that the top interface for the sinuous case in part (a) initially had a wave crest at \(x = 0\). In view of this fact, it is therefore perhaps not surprising that both the sinuous case in (a) and the varicose mode in part (b) both appear to become more similar as time progresses, as the denser middle layer falls under gravity. By (dimensionless) time \(t = 10\), the middle fluid in either case has essentially coalesced into a large central blob moving downwards, and it is interesting that it nevertheless remains connected across periods by slender strands. Delicate spiral-shaped wisps of the middle fluid also form either side of the large central blob, in both the sinuous and varicose flow modes.

Fig. 5
figure 5

Nonlinear solutions for three-layer Rayleigh–Taylor flow, for a sinuous initial condition. Density maps are shown at the eight times a \(t = 2.4\), 4.8, 6.6 and 7.2 and b \(t = 7.8\), 8.4, 9 and 9.6. The initial amplitudes were \(\epsilon _1 = \epsilon _2 = - 0.1\). Here \(h_1 = h_2 = 4\) with Reynolds number \(R_e = 10^3\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 2\) and \(D_3 = 3\). The undisturbed interface positions were \(y = 0.5\) (\(\Pi _0 = 4.5\)) and \(y = 1\) (\(\Lambda _0 = 5\))

The large amount of computing power currently available to us has enabled an exploration of more severely nonlinear flow patterns for these three-layer Rayleigh–Taylor instabilities, and one such case is presented in Fig. 5. For illustrative purposes in this (and later) longer-time simulations, we have set the Reynolds number to \(R_e = 1000\), since larger values require significantly more Fourier modes with smaller time steps, resulting in longer computer run-times. The flow in Fig. 5 was initially caused by a sinuous disturbance to the system, with amplitudes \(\epsilon _1 = \epsilon _2 = - 0.1\), and the three fluids have densities \(\rho = 1\), 2 and 3 from bottom to top. The evolution of the sinuous wave pattern is illustrated in Fig. 5 at the eight different times shown. At the earliest time \(t = 2.4\), the arrangement of the three fluids is as might be expected, with each fluid forming a near-horizontal layer perturbed by the initial disturbance. As the Rayleigh–Taylor instability develops, however, the upper two denser layers begin to form a downward-facing spike, so that the bottom fluid (yellow online) creates upward-moving bubbles with overturning mushroom-shaped heads, at the sides of each image presented.

As time continues, the three-layer RTI evolves into more and more extremely nonlinear configurations, as may be seen in the later four times presented in Fig. 5b. The middle fluid (green online), in the portion occupied by the upward-moving bubbles of the (lightest) bottom fluid, is squeezed into a progressively narrow layer so that, by about time \(t = 8.4\), it has almost vanished at either side of the image. Instead, middle fluid 2 is concentrated almost entirely near the overturning head of the downward-moving spike of the top fluid (blue online). There, it develops delicate spirals, and at later times such as the last two shown in Fig. 5b, it continues to roll up into elaborate mixing patterns.

Fig. 6
figure 6

Nonlinear solutions for three-layer Rayleigh–Taylor flow, for a varicose initial condition. Density maps are shown at the eight times a \(t = 3\), 6, 9 and 9.6 and b \(t = 10.2\), 10.8, 11.4 and 12. The initial amplitudes were \(\epsilon _1 = -0.1\) and \(\epsilon _2 = 0.1\). Here \(h_1 = h_2 = 4\) with Reynolds number \(R_e = 10^3\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 2\) and \(D_3 = 3\). The undisturbed interface positions were \(y = -1\) (\(\Pi _0 = 3\)) and \(y = 1\) (\(\Lambda _0 = 5\))

Figure 6 shows the same situation at the same parameters as in Fig. 5, with the only difference being the fact that the initial condition in this case was a varicose mode, with \(\epsilon _1 = -0.1\) and \(\epsilon _2 = 0.1\). The evolution of the unstable flow is illustrated at eight different times, as indicated in the figure, so that extremely nonlinear flow patterns may again be examined. Convergence of the numerical results was assessed by increasing the numbers of Fourier modes and mesh points until the results were essentially unchanged, and in order to produce the accurate results in Fig. 6, the number of Fourier modes was increased to \((M,N) = (512, 1024)\) with five times that number of mesh points in x and y.

At the earliest time \(t = 3\) shown, the three fluid layers form a typical varicose mode, symmetrically arranged about the centre line \(y = 0\). As time progresses, however, a strong asymmetry develops, in which the lower interface moves deeply into the bottom fluid but the upper interface only rises slightly. This has already been discussed briefly in the context of Fig. 3, and is to be expected since the density of each layer is greater than that of the layer immediately below it. As the middle fluid continues to descend into the bottom fluid, it forms a spiral overturning region, and for the more extremely nonlinear flows at the later times shown in Fig. 6b, a portion of the middle layer has reached the bottom of the container at \(h = - h_1 = -4\) and started to move laterally along the bottom. Some of the middle layer of fluid is also entrained into an upward-moving jet that contains bottom fluid 1, and this may be seen at the edges of each figure.

Fig. 7
figure 7

Nonlinear solutions for three-layer Rayleigh–Taylor flow, for the partial varicose initial condition. Density maps are shown at the eight times a \(t = 2.4\), 4.8, 6 and 7.2 and b \(t = 7.8\), 8.4, 9 and 9.6. The initial amplitudes were \(\epsilon _1 = -0.1\) and \(\epsilon _2 = 0.1\). Here \(h_1 = h_2 = 3\) with Reynolds number \(R_e = 10^3\), diffusion \(\sigma = 10^{-5}\). The two density ratios are \(D_2 = 2\) and \(D_3 = 3\). The undisturbed interface positions were \(y = -0.5\) (\(\Pi _0 = 2.5\)) and \(y = 0.5\) (\(\Lambda _0 = 3.5\))

It is also of interest to consider a more complicated initial disturbance, and we have chosen to do that here by replacing the two effective interfaces

$$\begin{aligned} y = \eta _2 (x,0)= & {} - h_1 + \Pi _0 + \epsilon _1 \cos x \nonumber \\ y = \eta _3 (x,0)= & {} - h_1 + \Lambda _0 + \epsilon _2 \cos x, \end{aligned}$$

in the initial condition (6) with the half-cosine profiles

$$\begin{aligned} y = \eta _2 (x,0) = {\left\{ \begin{array}{ll} - h_1 + \Pi _0 + \epsilon _1 \left( 1 + \cos 2x \right) , &{} \quad - \pi / 2< x < \pi / 2 \\ - h_1 + \Pi _0, &{} \quad |x |> \pi / 2, \end{array}\right. } \end{aligned}$$
(64)

and

$$\begin{aligned} y = \eta _3 (x,0) = {\left\{ \begin{array}{ll} - h_1 + \Lambda _0 + \epsilon _2 \left( 1 + \cos 2x \right) , &{} \quad - \pi / 2< x < \pi / 2 \\ - h_1 + \Lambda _0, &{} \quad |x |> \pi / 2, \end{array}\right. } \end{aligned}$$
(65)

(see Fig. 1). These curves are flat for \(|x |> \pi / 2\) but have a single hump inside that region centred on \(x = 0\). This initial condition has continuous first derivatives, but discontinuities in the second derivative at \(x = \pm \pi / 2\).

Figure 7 illustrates the evolution of the three-layer RTI from this new initial condition, at eight different times. Here, in order to maintain accuracy in the Fourier-series solution, the channel width has been reduced to \(h_1 = h_2 = 3\), and the algorithm has been run with \((M,N) = (640,640)\) Fourier modes. The solution at the earliest time \(t = 2.4\) shown in Fig. 7a demonstrates the slight change brought about by these new initial conditions, since the two interfacial regions are still flat at each edge of the diagram but experience a more narrowly pinched section at the centre. In addition, small bulges have developed near the points \(x = \,\pm \pi / 2\) at which the second derivatives of the interface curves in (64), (65) are discontinuous. These bulges then serve as sites from which additional plumes may grow and evolve as time progresses, and this is already evident in the solution at the next time \(t = 4.8\) shown in Fig. 7a. Once again, there are segments in the flow where the middle fluid layer becomes so thin that it nearly vanishes. The additional four flow snapshots presented at later times in part (b) demonstrate the formation of elaborate overturning plumes into which all three fluids are entrained. It is beyond the capability even of our current computing facilities to continue to much greater times than those shown in Fig. 7b, but these profiles are likely to represent the beginning of chaotic mixing of the three fluids in the middle zone.

6 Conclusion

In this paper, we have considered the two-dimensional Rayleigh–Taylor Instability (RTI) in a horizontal channel of finite overall width \(h_1 + h_2\), within which there are three fluids each of different density, separated by two interfacial regions. A linearized solution has been presented in the simplifying case in which viscosity is ignored for each fluid and the interfaces are assumed to be infinitesimally thin. The solution is very considerably more complicated than its famous two-fluid counterpart, and it is found that the solution becomes unstable, so that small perturbations to either interface grow with time, if any of the four eigenvalues in (42) is positive. This occurs, as expected, in any situation in which a more dense fluid overlies a less dense one.

The nonlinear viscous flow problem has been solved using the Completed Boussinesq approach published recently by Walters et al. [19]. This method seeks to combine the computational advantages of Boussinesq theory with the modelling accuracy of using the full Navier–Stokes equation of viscous fluid flow. In Boussinesq theory, the interface(s) within a multi-fluid system need not be treated explicitly, but instead appear implicitly within the flow as smooth but rapid transitions from one density zone to another. This represents an enormous simplification of a viscous interfacial flow problem with infinitesimally thin interfaces at which the difficult viscous boundary conditions outlined in Batchelor [11, page 150] would need to be applied. Nevertheless, Boussinesq theory makes the further approximation that the density differences within the fluids can all be ignored in the momentum-conservation equation, except in the buoyancy term, and such an assumption introduces large modelling errors when significant density differences are in fact present. The Completed Boussinesq theory overcomes this drawback by retaining the exact Navier–Stokes momentum equation, but does so at the considerable cost of having to solve a very large matrix system of equations at each new time step. A new pre-conditioned iterative scheme has been developed here, which enables this task to be carried out with improved efficiency over the original approach in [19].

We have verified the accuracy of the numerical results by careful comparison with the linearized theory at early times, and with the output from an SPH code at moderate times. At much later times, the powerful computational resources at our disposal have enabled an exploration of the ways in which the interface shapes are dominated by nonlinear effects. They show the formation of complex and delicate overturning plumes, sometimes entraining all three fluids. In future work, the techniques developed here should allow additional physical quantities, such as both density and viscosity, to vary from fluid to fluid, and their effects on flow morphology and interface stability to be studied.