The Rayleigh–Taylor instability in a porous medium

The classical Rayleigh–Taylor instability occurs when a heavy fluid overlies a lighter one, and the two fluids are separated by a horizontal interface. The configuration is unstable, and a small perturbation to the interface grows with time. Here, we consider such an arrangement for planar flow, but in a porous medium governed by Darcy’s law. First, the fully saturated situation is considered, where the two horizontal fluids are separated by a sharp interface. A classical linearized theory is reviewed, and the nonlinear model is solved numerically. It is shown that the solution is ultimately limited in time by the formation of a curvature singularity at the interface. A partially saturated Boussinesq theory is then presented, and its linearized approximation predicts a stable interface that merely diffuses. Nonlinear Boussinesq theory, however, allows the growth of drips and bubbles at the interface. These structures develop with no apparent overturning at their heads, unlike the corresponding flow for two free fluids.


Introduction
Lord Rayleigh [1] and later Sir G.I. Taylor [2] both considered the unstable fluid flow that now bears their names, in which two horizontal immiscible fluids, with a sharp interface separating them, lie horizontally with the heavier fluid above the lighter one. Gravity acts downward, and any small disturbance to the interface results in the unstable growth of fingers of the heavy fluid moving downward and bubbles of the lighter fluid penetrating upward. Rayleigh and Taylor considered planar flow and carried out linearized analyses, based on the assumption that the interface shape never varies greatly from a horizontal plane. Their analysis predicts, however, that perturbations to the interface must grow exponentially in time, whenever the heavier fluid is above the lighter one.
Since linearized Rayleigh-Taylor theory predicts exponential growth of the interface, the linearizing assumption itself becomes invalid within finite time, and nonlinear effects must be included. The difficult question of how nonlinearity affects the shapes of the growing droops and bubbles at the interface has consequently been of great interest and relevance. Earlier numerical solutions for free-flowing inviscid fluids separated by a sharp interface observed that there was a finite time at which the solution abruptly failed, and the review by Sharp [3] mentions this as something of a mystery. However, Moore [4] had shown, in the related Kelvin-Helmholtz instability, that the sharp interface develops a curvature singularity within finite time, and this is the reason for the sudden failure of the inviscid solution at this critical time. Cowley et al. [5] confirmed Moore's analysis with their own asymptotic theory, and Baker et al. [6] have shown that curvature singularities may also occur within finite time for the classical Rayleigh-Taylor problem.
It might be expected that the inclusion of viscosity in the fluids would avoid a curvature singularity from forming at the interface, but Forbes et al. [7] and Forbes and Bassom [8] have indicated that the situation is a little more nuanced than this. They showed that very large curvature spikes still form at the interface, even when viscosity is included, and to avoid them, a certain amount of fluid mixing is required, at an interface that must be of finite width. This explains why 'vortex blob' methods, introduced by Krasny [9] and used later by Baker and Pham [10], are able to continue an otherwise inviscid solution past the critical time at which curvature singularity would be expected, since they effectively replace the sharp interface with a diffuse vortex sheet of finite width.
The Rayleigh-Taylor problem has numerous applications, where it may help explain certain cloud formations in meteorology [11] and finger formation in astrophysics [12], and has thus been the subject of extensive research. A review by Kelley et al. [13] has emphasized the way in which Rayleigh-Taylor instability can occur over vast length scales, from the microscopic to the galactic. Furthermore, flows of this type are not just restricted to twodimensional planar geometry. They have been studied in cylindrical geometry by Forbes [14], corresponding to outflow from a line source, and recently by Zhao et al. [15]. These flows also occur in spherical-type outflow from a point source, (see Forbes [16,17]), where they have possible application to the formation of one-sided jet flows in astrophysics, observed by Gómez et al. [18]. The review article by Abarzhi [19] discusses Rayleigh-Taylor flows as mechanisms for fluid mixing, comparing and contrasting them with mixing due to turbulence.
Rayleigh-Taylor-type flows may also occur in porous media, perhaps in situations where leaching fluid is pumped into an ore-bearing rock, in an attempt to dissolve and extract the ore [20]. In such cases, the density difference between the two fluids present in the rock would occur as a result of the presence of dissolved minerals or leaching lixiviants. The presence of such minerals in each fluid of a two-fluid system was taken into account explicitly by Trevelyan et al. [21], in their study of fluid instabilities in porous media. They used a Boussinesq approach, combined with Darcy's law relating the fluid seepage velocity in the porous medium, the gradient of the fluid pore pressure and the fluid density, and they invoked a type of equation of state in which the density varied linearly with the concentrations of two different chemical species dissolved in the fluid. These concentrations followed prescribed convection-diffusion equations. They carried out detailed quasi-steady stability analyses of various scenarios and also obtained numerical solutions to the nonlinear equations, obtaining long unstable fingers of heavier fluid moving into the region formerly occupied by the lighter fluid. In a recent review article, Hewitt [22] discusses unstable fluid flows in porous media, under conditions where convection strongly dominates diffusion. A state equation is considered, in which the fluid density may depend upon both the concentration of a dissolved chemical species and the temperature.
The present paper considers first the instability of a sharp interface between two horizontal layers of immiscible fluid in porous material, when the medium is perfectly saturated. This is analogous to the classical Rayleigh-Taylor problem, and we briefly discuss a linearized solution before considering the fully nonlinear saturated problem. A Boussinesq model is also discussed, and a numerical spectral method is introduced that allows us to generate accurate solutions for the evolution of very large amplitude disturbances to an interfacial zone between two miscible fluids. Results of both models are presented in Sect. 4, and some concluding remarks are given in Sect. 5.

Fully Saturated Flows
In this section, we consider two unbounded fluids in a porous medium such that a sharp interface y = (x, t) separates an upper heavier Fluid 1, in y > , from a lighter Fluid 2 in the lower region y < . A Cartesian coordinate system is present, with its y-axis pointing vertically as in Fig. 1, and the acceleration g of gravity is directed downward. Each fluid is presumed to have the same viscosity, but the pore pressure and fluid density in upper Fluid 1 are p 1 and 1 , respectively, while in lower Fluid 2 the pressure is p 2 and density is 2 . Each density is constant throughout its entire fluid domain,   [23, page 16], the fluid seepage velocities 1 and 2 in the two fluid regions are found from 1 = −K ∇ 1 and 2 = −K ∇ 2 , where 1 = p 1 + 1 gy and 2 = p 2 + 2 gy are the total hydraulic pressure heads in the two fluid domains. The constant K is an hydraulic conductivity and is sometimes expressed in the form K = A∕ , in which is the dynamic viscosity of the fluid and A can be thought of as the cross-sectional area of a column of the porous medium through which the fluid percolates. For a fully saturated medium, the fluid incompressibility condition gives ∇ ⋅ j = 0 , j = 1, 2 , with the result that the hydraulic heads j satisfy Laplace's equation ∇ 2 j = 0 , j = 1, 2 , in their respective fluid domains. The dynamic condition that the fluid pore pressure must be continuous at the fluid interface gives rise to the simple condition 1 = 2 + 1 − 2 g on the interface y = (x, t).
Dimensionless variables are now introduced. If a periodic disturbance of fundamental wavelength is made to the interface, then ∕(2 ) is taken to be the length scale from now on. Speeds are referred to the quantity 2 gK , and then time is made dimensionless using the scale ∕ 2 2 gK . Pressures and the hydraulic heads are scaled with respect to the quantity 2 g ∕(2 ).
In these nondimensional quantities, Darcy's law in lower fluid 2 becomes and in upper fluid 1 it takes the form The continuity condition for fully saturated rock gives Laplace's equations in each layer. There is only the one dimensionless constant D = 1 ∕ 2 appearing in (2). On each side of the interface, each fluid must obey its own kinematic condition representing the fact that neither fluid is able to cross this boundary. In addition, there is also a dynamic condition, corresponding to the fact that the pore pressures either side of the interface must be equal. In dimensionless form, this becomes where the constant D = 1 ∕ 2 is the ratio of densities, as previously.

Linearized saturated solution
A linearized solution to the governing equations (1)- (5) can be obtained in a straightforward manner using classical methods. Accordingly, only a brief overview will be given here. If the interface (x, t) is initially horizontal, but then subjected to a perturbation of small amplitude , it is appropriate to seek a solution in the form The true location y = (x, t) of the interface is projected onto the undisturbed plane y = 0 , and as a result, conditions (3) are now approximated with The two kinematic conditions (4) at the interface become approximately and the dynamic condition retains its same form (5), but now holds on the approximate plane y = 0 and involves the linearized functions introduced in (6). For simplicity, we suppose that the initial perturbation to the interface was in the form of a simple cosine function, of period 2 . Then, the appropriate linearized solutions to the Laplace equations (7) are Now the two kinematic conditions (8) and the corresponding linearized form of the dynamic condition (5) allow the unknown functions Q 1 (t) and Q 2 (t) in (9) to be determined, and a form for the linearized interface perturbation elevation L (x, t) to be obtained. Combining this information with the expansion (6) therefore yields

Nonlinear saturated solution
Equations (1)-(5) state the nonlinear mathematical problem to be solved, for the Rayleigh-Taylor instability in a completely saturated medium where a sharp interface is present between two immiscible fluids. Periodicity is again assumed in the x-coordinate, and so from (3), we seek nonlinear solutions These expressions (11) become exact as the number N of Fourier modes becomes infinite, and in the numerical work to follow it will be necessary to take N as large as possible. Clearly, (11) satisfy Laplace's equations (3) identically and represent the generalization of (10) to account for nonlinearity at the interface. The three sets of coefficients A n (t) , B n (t) and H n (t) in the assumed form (11) of the solution are to be found from the kinematic and dynamic conditions at the interface. The spectral method proposed by Forbes et al. [24] is chosen for this purpose, and we use here only the simpler of their two approaches.
To begin, the kinematic condition (4) is taken with j = 1 , representing the upper fluid in y > . The fluid velocity components u 1 and v 1 in the x-and y-directions, respectively, are found directly from 1 in (11) by differentiation, according to (2). Thus, nA n (t)e −ny cos (nx).
When these two series (12) are substituted into the first kinematic condition (4) with j = 1 , the use of the product rule enables this equation to be cast in the form Following [24], it follows at once from this relation that

Theorem 1 The average interface elevation does not change with time.
Proof We wish to show that To do this, it is only required to integrate (13) over a single period − < x < , giving immediately the result H � 0 (t) = 0 . Thus, the average interface elevation av = H 0 is constant, and the statement in (14) is proved. ◻ Equation (13) is also Fourier analyzed with respect to the th mode, = 1, 2, … , N , by multiplying by the basis function cos ( x) and integrating over a single period. Integration by parts gives the expression for the derivative of the th Fourier coefficient in the expression for the interface shape.
These calculations may all be repeated for the second kinematic equation, obtained from (4) with j = 2 . Velocity components in lower fluid 2 are obtained by differentiation of the series for 2 in (11), similarly to (12), and are obtained in the forms These velocity components (16) are substituted into the second kinematic condition at the interface, to give a result analogous to (13). The = 0 Fourier mode once again confirms Theorem 1, and the higher modes = 1, 2, … , N give analogous to the result (15) for the upper fluid.
,n (t)B n (t), Similar Fourier analysis is applied to the dynamic condition (5). The series (11) are substituted directly into the condition, which is then evaluated at the interface y = (x, t) . The expression is multiplied by the basis function cos ( x) , = 1, 2, … , N and integrated over a complete period in x. This gives In these expressions (15), (17) and (18), it has proven convenient to define to simplify the notation.
The governing equations to be solved for the three sets of Fourier coefficients A n , B n and H n are (15), (17) and (18). However, these form a differential-algebraic inclusion and are not convenient for numerical solution in this present form. We adapt the approach of Forbes et al. [24] and differentiate both the second and third of these equations, to give a simple algebraic system of equations for the derivatives A � n (t) , B � n (t) , H � n (t) of these coefficients. These are then solved, and the entire system of 3N ordinary differential equations is integrated forward in time using standard software.
The second kinematic condition (17) is subtracted from the first condition (15), and the resulting expression is differentiated in time. After a little algebra, this yields The dynamic condition (18) is similarly differentiated in time and so gives an expression in the form Now the three sets of equations (15), (20) and (21) represent a system of 3N ordinary differential equations for the derivatives of the Fourier coefficients, and we integrate these forward in time using the MATLAB routine for adaptive fourth-fifth-order Runge-Kutta integration. With N = 61 Fourier modes, this runs quickly on a quad-core desktop computer and is straightforward to implement and code.

Partially saturated Boussinesq model
If the medium is not fully saturated, and there is in addition a degree of mixing of the fluid in upper layer 1 with that in lower layer 2, then the assumption of a sharp interface between them, as in Sect. 2, may not be appropriate. In that case, the simplest approach is the Boussinesq approximation, in which the fluid density is regarded as a continuously varying function that changes smoothly but rapidly across an interfacial zone of narrow but finite width. Returning briefly to dimensional variables, the density (x, y, t) varies from its value 2 in lower layer 2 continuously to the value 1 in upper layer 1, as y increases from a large negative value to a large positive one. Following Trevelyan et al. [21] and the recent article by De Paoli et al. [25], we regard the larger density 1 of the upper layer as being due to the presence of some additional solute in that upper layer, having concentration [C](x, y, t) such that [C] → C 0 as y → ∞ . This is therefore relevant to a mineral leaching scenario similar to that envisioned by Forbes [20], for example, in which a mineral of interest is dissolved in situ by a leaching lixiviant. It is assumed here that the fluid density is related to the concentration of the dissolved solute according to the law and that the solute itself obeys the convection-diffusion equation Here, the constant D is a diffusion coefficient for the solute. The quantity is the porosity of the material and is a dimensionless constant corresponding to a wetted fraction in the medium. The fluid seepage velocity vector is found from Darcy's law in the form replacing the earlier forms (1), (2) for the fully saturated model. As previously, the continuity equation still holds true, for the fluid in the porous medium.
We return now to dimensionless variables, as previously, and these will be used from now on. As in Sect. 2, all lengths are referred to ∕(2 ) , where is the wavelength of a periodic disturbance made to the interface. Speeds are again nondimensionalized by reference to 2 gK , but now it is convenient to make time dimensionless relative to the timescale ∕ 2 2 gK , so as to absorb the porosity . The density function is referred to the density 2 of the lower fluid, and the pore pressure p is scaled with respect to the quantity 2 g ∕(2 ) . The concentration [C] of the solute is scaled relative to its value C 0 in layer 1 far from the interface, and the new dimensionless concentration is written simply as C(x, y, t) . In these nondimensional variables, the 'state' equation (22) becomes simply and the solute concentration satisfies obtained from (23). Darcy's law (24) becomes simply These equations (26)-(28) now involve the two dimensionless parameters The first of these is the density ratio, as before, and the second is a dimensionless diffusion constant for the chemical solute.
From the continuity equation (25), it follows that a streamfunction (x, y, t) exists, such that It then follows from Darcy's law (28) and the state equation (26) that The mathematical task is therefore to solve the convection-diffusion equation (27) coupled with (31), for the two functions C(x, y, t) and (x, y, t) . The fluid density is then recovered from the state law (26).  .

Linearized Boussinesq model
The Boussinesq approximation is predicated on the assumption that the density function (x, y, t) does not change much across the different fluid regions. Accordingly, the appropriate small parameter here is the (dimensionless) density difference (D − 1) between the top and bottom levels of the fluid. We therefore postulate When these approximations are substituted into the governing equations (27) where the additional constants have been defined for convenience. Following Daripa and Hua [26], we observe that an initial condition in which only a single Fourier mode is perturbed continues to involve only that one mode for all later times in the linearized fully saturated model (10). In the Boussinesq model, however, even the linearized solution (35) involves an infinite but discrete spectrum of Fourier modes, when the finitewidth computational window −H < y < H is imposed; this (33) would, in fact, become a continuous spectrum of modes if H were allowed to become infinite (as is the case for the previous linearized solution in Sect. 2.1). The linearized streamfunction is now obtained from the second of the equations in (33) and becomes The coefficients A m,n in these solutions (35), (37) are obtained from initial conditions, and these are now discussed.
Consistent with the linearized saturated solution (10) in Sect. 2.1, we consider the discontinuous initial function where we have chosen the initial interface shape to be Fourier analysis of (35) gives the coefficients to be It turns out that the integrals in these expressions can be evaluated in closed form, taking real and imaginary parts of the identity given in Abramowitz and Stegun [27, page 360, formula 9.1.21]. After some algebra, we obtain where J k (z) denotes the Bessel function of the first kind of order k.
From the numerical point of view, the use of the discontinuous initial concentration profile (38), with the cosinusoidal profile (39) is undesirable because it gives Fourier coefficients (41) that decay as A k, ∼ 1∕ for large . Consequently, Gibbs' phenomenon [28] means that the Fourier series (35) cannot recreate the initial profile (38). Instead, it replaces the discontinuity with a region (37) cos (kx) sin 2H (y + H) dy dx. (41) containing small-amplitude oscillations. To avoid this difficulty, we use Lanczos smoothing of the Fourier coefficients (41), replacing them with new coefficients The Lanczos parameter is a small positive constant, and we have taken it to be = 0.05 here. This process (42) can be shown to be equivalent to replacing the point value of the initial function (38) with a moving average over a window of width 2 centered at that point. Thus, the discontinuous initial condition (38) is replaced by a smoothed, continuous function. This is illustrated in Fig. 2, for an initial profile with K A = −0.2 and using M = N = 101 modes in each coordinate. The density has been generated from the state law (26) with D = 1.2 , and as is evident from the diagram, a smooth but rapid transition from = 1 to = D is obtained near the interfacial region. A careful examination shows that small wavelets of Gibbs type are still present near the interface, but are too small to be of concern. They can be eliminated entirely by increasing slightly, although at the cost of diffusing the interfacial zone still further. Figure 3 illustrates the linearized solution with concentration C L (x, y, t) calculated from (35) and then density obtained from the state law (26). The solution was evaluated using M = N = 151 Fourier modes on a grid of 601 × 601 points over the computational domain − < x < , −H < y < H with H = 6 . Contours of the density are shown at the four times t = 4 , 16, 28 and 40. In the first two diagrams, there are still some very small wavelets present, as a remnant of Gibbs' phenomenon present in the choice of initial condition illustrated in Fig. 2; these (42) A m,n = A m,n sin (n ) n .

Fig. 2
Initial density profile, reconstructed from the Fourier series (35) with smoothed coefficients (42). The density function is then formed from the state equation (26). Here, K A = −0.2 and the density ratio is D = 1.2 have no effect upon the solution, although the contouring routine in the graphics package nevertheless detects these small ripples and displays them as the fine corrugations visible at the first two times shown. It is evident from Fig. 3 that the interfacial zone essentially does not move at all, but remains in place and diffuses slightly due to the effect of the parameter in equation (33). This is as expected, since the process (32) of linearization results in the (nonlinear) self-convection terms being removed, in the linearized approximation (33) for the concentration function C L and hence the density . As a result, the linearized Boussinesq theory in this section is possibly of only limited interest, and the nonlinear theory is now considered.

Nonlinear Boussinesq model
We now consider extending the mathematical structure revealed by the linearized solution (35), (37) to the full nonlinear equations (26)-(28), thus creating a spectral semi-numerical solution process. An appropriate form for the nonlinear concentration function is and the streamfunction is represented in the form In these representations (43), (44) of the nonlinear solution, the integers M and N denote the numbers of Fourier modes able to be kept in a numerical implementation of these series; an 'exact' solution would require these numbers to become infinite. The constants 2 m,n are as defined in (36). Form (44) has been chosen because it automatically satisfies the (linear) Poisson-type equation (31).
It merely remains to determine the coefficient functions A m,n (t) so as to satisfy the nonlinear convection-diffusion equation (27). The series (43), (44) are substituted in, and the resulting equation is subjected to standard Fourier analysis. After some algebra, this yields the system of nonlinear ordinary differential equations To begin the computation, initial values A 0, (0) and A k, (0) are chosen, and in fact the values given in (41) are sufficient to generate the initial profile in Fig. 2. This system (45) of nonlinear differential equations is then integrated forward in time using the explicit adaptive Runge-Kutta-Fehlberg routine ode45 in the MATLAB programming environment. The integrals on the right-hand sides of (45) are performed using the Gaussian quadrature package lgwt.m written by von Winckel [29] which, with the number of mesh-points used here, is effectively exact. The two velocity components u and v in the integrands are evaluated directly by differentiation of the streamfunction (44) using the results (30). Although MATLAB is not a particularly fast package, we nevertheless find that we are able to generate highly converged numerical results with M = N = 101 Fourier coefficients, and a numerical grid of 501 × 501 points over the computational domain, in about 21 hours run-time on a modest quad-core desktop computer. We have performed careful convergence tests using 51 and 81 Fourier modes and find that there are no significant differences between results with M = N = 81 and M = N = 101. (45)

Results
When the fully saturated, nonlinear model of Sect. 2.2 is investigated, it is soon found that a disturbance to the interface initially grows rapidly, as predicted by the linearized saturated solution in Sect. 2.1, but then fails abruptly at some finite time. As observed by Sharp [3] for the traditional Rayleigh-Taylor instability, there does not appear to be anything pathological about the nonlinear interface profile at the time at which it fails, and it is only upon an examination of the interfacial curvature that a singularity is revealed, like that first predicted for the Kelvin-Helmholtz instability by Moore [4]. For density ratio D = 1.2 and the initial cosinusoidal disturbance (39) with amplitude parameter K A = −0.2 , the fully saturated nonlinear solution is able to progress up until about t = 1.2 , after which a singularity forms abruptly in the curvature, and the saturated solution fails. We show in Fig. 4 the nonlinear interface at that last time t = 1.2 , where it is sketched using a heavy dashed line. By way of comparison, we have overlaid this dashed curve on a field of contours of the density function (x, y, t) obtained for the nonlinear Boussinesq model and computed from equations (43) and (26), with the same parameter values and the smoothed initial condition in Fig. 2. The agreement between the results of these two different models is very good, and the interface curve for the fully saturated case lies precisely along the mid-density contour = (1 + D)∕2 obtained with the Boussinesq model. Nevertheless, the fully saturated results cannot continue significantly past this early time t = 1.2 . This could no doubt be addressed using a 'vortex blob' approximation [9], which effectively smears the exact interface over a finite-width zone. It may also be possible to avoid singularity formation at the interface by adding extra viscous fluid layers there, as has been suggested by Daripa [30]. Such an approach is possibly equivalent to a 'vortex blob' method, to the extent that it effectively makes the interfacial zone of finite width, but might be more difficult to implement in a nonlinear problem. Alternatively, filtering methods and regularization techniques can be used to suppress singularity formation, and an excellent discussion of these is presented by Daripa and Hua [26]; regularization by apodization was in fact used in a viscous interface computation by Forbes et al. [7]. In this paper, however, we continue to later times using the Boussinesq model in Sect. 3.
A nonlinear Boussinesq solution is illustrated in Fig. 5, at the four dimensionless times t = 4 , 16, 28 and 40 (as for the linearized solution in Fig. 3). Contours of the density  are shown in part (a) and were computed from (43) and (26) using M = N = 101 Fourier modes with 501 × 501 mesh points over the computational domain. The lower limit of the computational window was set to y = −H = −6 . As for the linearized solution shown in Fig. 3, the density ratio is D = 1.2 , the diffusion coefficient = 0.001 and the initial wave amplitude is K A = −0.2 . The initial condition was the smoothed profile illustrated in Fig. 2. Contours of the streamfunction are illustrated in Fig. 5b; since this is an unsteady problem, there is no guarantee that these contours match exactly to the streamlines, but they do serve at least as a guide as to how the fluid velocity patterns develop.
At very early times, the nonlinear solution matches closely to the linearized solution of Sect. 3.1. However, the process (32) of linearization removes the self-convection terms in (27), so that the linearized interface profile then merely remains in about its original position, as seen in Fig. 3. However, the nonlinear interface profiles shown in Fig. 5a exhibit a large-amplitude downward-moving tongue of the heavier fluid from upper layer 1, and to compensate, two bubbles of lighter fluid 2 moving upward either side of it. This is qualitatively similar to nonlinear interfacial behavior in the conventional Rayleigh-Taylor instability [31], except that in the porous medium considered here, there is no pronounced overturning of the tongue near its tip. Some evidence of the very small amplitude ripples from the initial density profile sketched in Fig. 2 is still visible in Fig. 5a, and their appearance has been enhanced somewhat by the contouring routine. They are very small and have no effect on the numerical results.
Contours of for this same solution are drawn for the same four times in part(b). We shall refer to these as 'streamlines' subsequently, although this may not be exactly true for these unsteady flows. Clearly, this entire flow comes about as a result of the nonlinear convection terms in (27), and it can be seen from part (b) that the unstably growing tongue and bubbles in part (a) are associated with the formation of a pair of vortices in the flow. The strength of these vortices increases with time, as the unstable interface develops perturbations of larger amplitude.
In Fig. 6, we increase the density ratio to the value D So far, the initial condition (38) with the interface shape (39) has involved a single-mode perturbation. For interest, we consider now a multimode disturbance as the initial perturbation, and we choose to replace the simple cosinusoidal shape (39) with the triangular initial perturbation in which the constant q lies in the interval 0 < q < 1 . The triangular shape (46) is repeated periodically every 2 units along the x-axis. Admittedly, this periodic triangular initial perturbation (46) is somewhat unrealistic from a physical point of view, but it is multimodal and does also allow the coefficients of the initial Fourier representation to be calculated in closed form using (40). After some algebra, the coefficients in the representation (43) at t = 0 are determined to be Once again, these coefficients (47) are smoothed using (42), giving a smoothed initial profile and minimizing the effects of Gibbs' phenomenon.
The triangular-shaped initial condition (47) with amplitude K A = 0.2 is used in Fig. 7 to generate porous Rayleigh-Taylor solutions for density ratio D = 1.2 , and some results are shown at the four times t = 4 , 16, 28 and 40. Figure 7a presents contours of the density and part (b) illustrates some streamlines at the different times. At the earliest time t = 4 shown, the triangular perturbation shape to the interface is still visible, but as time progresses, it develops into a long finger extending downward. As previously, two upward-moving bubbles of the lighter lower fluid 2 are formed either side of it, so that the average interface location remains approximately constant; this is broadly consistent with Theorem 1, even in spite of the fact that the theorem was derived for the previous fully saturated model. The streamline patterns in Fig. 7b are similar to those obtained using the cosinusoidal initial condition (39) at earlier times, illustrated in Fig. 5b. The downward-moving spike is enabled by the formation of two vortices in the flow, as can be seen at the first two times t = 4 and t = 16 . However, at later times, each vortex further splits into two, giving a system of four vortices, associated with both the spike of heavy fluid moving down as well as the two bubbles moving up. These are visible in the last two frames in Fig. 7b. For interest, we also include in Fig. 8 the similar solution to Fig. 7, except that now the density ratio has been increased here to the value D = 1.5 . Density contours are again shown in part(a) and streamlines are drawn in part (b), for the same four times t = 4 , 16, 28 and 40 as previously. As a result of the increased density ratio, the instability at the interface develops more rapidly, to the extent that the downward-moving spike has already reached the bottom of the computational region y = −H = −6 by time t = 28 . This is essentially a porous Rayleigh-Taylor flow in a confined region −H < y < H with an impermeable lower boundary at x = −H , although there is a very narrow boundary layer near both the top and the bottom of the region y = ±H where the solution reverses rapidly to its initial boundary conditions C = 0 at y = −H and C = 1 at y = H , since these are demanded by the form of the solution (43). Thus, the solutions at the last two times t = 28 and t = 40 will not correspond exactly to unstable flow in a confined region because of the presence of these boundary layers at top and bottom, although the other flow features are correct.
We show in Fig. 9 some contours of the density function for the same solution as in Fig. 8, but now at the time t = 24 . The scale on the horizontal and vertical axes is the same, so that this droplet is as it would actually appear. This is close to the time at which the downward-moving spike of heavier fluid meets the bottom of the enclosure (or else the bottom y = −H of the computational domain), and it shows how additional, secondary droplets have formed either side of the main spike and are also being convected downward. Two bubbles of lower lighter fluid 2 have also moved deeply up into the above heavier layer 1.

Conclusions
This paper is part of a special issue on the general topic 'Interfaces, Mixing and Non-Equilibrium Dynamics, ' and the authors are grateful for this opportunity to contribute. The Rayleigh-Taylor instability is one of the three most familiar instabilities that can occur at an interface and is known in many applications and over vastly differing length scales [13] (the other two are the Kelvin-Helmholtz and the Richtmyer-Meshkov flows). It is responsible for mixing of the two fluids, where it may eventually exhibit some similarities to turbulent mixing [19].
We have examined two models for Rayleigh-Taylor unstable flow in porous media, both in a linearized approximation in which disturbances to the otherwise horizontal interface are small, and in the fully nonlinear equations pertinent to that model. The first such model was one in which the medium was assumed to be fully saturated with the fluids, and there are strong similarities between that model and the classical Rayleigh-Taylor instability. The linearized theory in that case predicted an interface that is unstable for any density ratio D > 1 for which the upper  Density contours for the nonlinear Boussinesq solution, for density ratio D = 1.5 , with = 0.001 and initial amplitude K A = 0.2 , at dimensionless time t = 24 . The solution was started from the triangular initial pulse (46) with q = 1∕3 . The scale is the same on both axes fluid is heavier than the lower one, so that perturbations grow exponentially with time. The nonlinear results bear this out, but only for early times, since there is a finite time at which the interface develops a curvature singularity and the solution fails. This same behavior also occurs for the classical nonlinear Rayleigh-Taylor flow, as shown by Baker et al. [6].
The second model was one in which the rock is supposed to be only partially saturated, but that a dissolved chemical in the upper fluid was responsible for making it more dense than the lower fluid. This again leads to a Rayleigh-Taylor situation with a heavy fluid above a lighter one, and we used a Boussinesq approximation with an interfacial zone of finite width to continue the numerical solution out for times far later than the critical time at which the corresponding fully saturated model would have failed. Elongated spikes of heavier upper fluid are found to form, alternating with upwardly moving bubbles of the lighter fluid. Unlike the classical Rayleigh-Taylor flow in which the spikes and bubbles form into mushroomshaped regions with strongly overhanging heads [31], the analogous structures formed here do not possess similar overturning regions near their heads.
Availability of data and materials The methods, results and data for this paper are available to interested researchers.Code availability The MATLAB code used to generate all the material in this paper is available from the first-named author.

Compliance with ethical standards
Conflict of interest The authors declare that they have no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.