1 Introduction
The interaction of waves with a mean flow is a fundamental and longstanding problem of fluid mechanics with numerous applications in geophysical fluids (see e.g. Mei, Stiassnie & Yue (Reference Mei, Stiassnie and Yue2005), Bühler (Reference Bühler2009) and references therein). Key to the study of such an interaction is scale separation, whereby the length and time scales of the waves are much shorter than those of the mean flow. In the case of small-amplitude linear waves considered here, the induced mean flow is negligible so the effectively external mean flow can be specified separately. See, for example, Peregrine (Reference Peregrine1976). The linearised dynamical equations exhibit variable coefficients due to the mean flow, mathematically equivalent to the dynamics of linear waves in non-uniform and unsteady media.
Due to the multi-scale character of wave–mean flow interaction, a natural mathematical framework for its description is Whitham modulation theory (Whitham Reference Whitham1965a , Reference Whitham1999). Although the initial motivation behind modulation theory was the study of finite-amplitude waves, it was recognised that the wave action equation that plays a fundamental role in Whitham theory (Hayes Reference Hayes1970) was also useful for the study of linearised waves on a mean flow, see e.g. Garrett (Reference Garrett1968) and Grimshaw (Reference Grimshaw1984). It was used in Bretherton (Reference Bretherton1968) and Bretherton & Garrett (Reference Bretherton and Garrett1968) to examine the interaction between short-scale, small-amplitude internal waves and a mean flow in inhomogeneous, moving media. The outcome of this pioneering work was the determination of the variations of the wavenumber, frequency and amplitude of the linearised wavetrain along group velocity lines. Subsequently, this work was extended in Grimshaw (Reference Grimshaw1975) to finite-amplitude waves, incorporating the perturbative effects of friction and compressibility, as well as the leading-order effect of rotation.
 The modulation theory of linear wavetrains in weakly non-homogeneous and weakly non-stationary media (where weakly is understood as slowly varying in time and/or space) was developed in Whitham (Reference Whitham1965a
            ), Bretherton & Garrett (Reference Bretherton and Garrett1968). It was shown that the modulation system for the wavenumber 
                $k$
            , the frequency
$k$
            , the frequency 
                $\unicode[STIX]{x1D714}$
             and the amplitude
$\unicode[STIX]{x1D714}$
             and the amplitude 
                $a$
             is generically composed of the conservation equations
$a$
             is generically composed of the conservation equations 
 $$\begin{eqnarray}\displaystyle k_{t}+\unicode[STIX]{x1D714}_{x}=0,\quad {\mathcal{A}}_{t}+(\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}{\mathcal{A}})_{x}=0, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle k_{t}+\unicode[STIX]{x1D714}_{x}=0,\quad {\mathcal{A}}_{t}+(\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}{\mathcal{A}})_{x}=0, & & \displaystyle\end{eqnarray}$$
             where the dispersion relation 
                $\unicode[STIX]{x1D714}(k;\unicode[STIX]{x1D736}(x,t))$
             and the wave action density
$\unicode[STIX]{x1D714}(k;\unicode[STIX]{x1D736}(x,t))$
             and the wave action density 
                ${\mathcal{A}}(a,k;\unicode[STIX]{x1D736}(x,t))$
             depend on the system under study with
${\mathcal{A}}(a,k;\unicode[STIX]{x1D736}(x,t))$
             depend on the system under study with 
                $\unicode[STIX]{x1D736}(x,t)$
             being a set of slowly varying coefficients describing non-homogeneous non-stationary media that include the effects of the prescribed mean flow, e.g. the current.
$\unicode[STIX]{x1D736}(x,t)$
             being a set of slowly varying coefficients describing non-homogeneous non-stationary media that include the effects of the prescribed mean flow, e.g. the current.
 Equations (1.1) were applied to the description of the interaction of water waves with a steady current in Longuet-Higgins & Stewart (Reference Longuet-Higgins and Stewart1961), Peregrine (Reference Peregrine1976), Phillips (Reference Phillips1980), Peregrine & Jonsson (Reference Peregrine and Jonsson1983), Whitham (Reference Whitham1999), Mei et al. (Reference Mei, Stiassnie and Yue2005), Bühler (Reference Bühler2009), Gallet & Young (Reference Gallet and Young2014). We briefly outline some classical results from the above references relevant to the developments in this paper. Consider a right-propagating surface wave interacting with a given non-uniform but steady current profile 
                $U(x)$
            . Assuming slow dependence of
$U(x)$
            . Assuming slow dependence of 
                $U$
             on
$U$
             on 
                $x$
            , the linear dispersion relation reads
$x$
            , the linear dispersion relation reads 
                $\unicode[STIX]{x1D714}=U(x)k+\unicode[STIX]{x1D70E}(k)$
             where
$\unicode[STIX]{x1D714}=U(x)k+\unicode[STIX]{x1D70E}(k)$
             where 
                $\unicode[STIX]{x1D70E}(k)=\sqrt{gk\tanh (kh)}$
             is the so-called intrinsic frequency, i.e. the frequency of the wave in the reference frame moving with the current
$\unicode[STIX]{x1D70E}(k)=\sqrt{gk\tanh (kh)}$
             is the so-called intrinsic frequency, i.e. the frequency of the wave in the reference frame moving with the current 
                $U$
            , and
$U$
            , and 
                $h$
             is the unperturbed water depth. The wave action density has the form
$h$
             is the unperturbed water depth. The wave action density has the form 
                ${\mathcal{A}}=\unicode[STIX]{x1D70C}ga^{2}/\unicode[STIX]{x1D70E}(k)$
            . Since
${\mathcal{A}}=\unicode[STIX]{x1D70C}ga^{2}/\unicode[STIX]{x1D70E}(k)$
            . Since 
                $U$
             only depends on
$U$
             only depends on 
                $x$
            , we look for a steady solution
$x$
            , we look for a steady solution 
                $k(x)$
             and
$k(x)$
             and 
                $a(x)$
             of the modulation equations (1.1), which yield
$a(x)$
             of the modulation equations (1.1), which yield 
                $\unicode[STIX]{x1D714}_{x}=0$
             and
$\unicode[STIX]{x1D714}_{x}=0$
             and 
                $(\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}{\mathcal{A}})_{x}=0$
            . Suppose further that
$(\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}{\mathcal{A}})_{x}=0$
            . Suppose further that 
                $U(x)$
             slowly varies between
$U(x)$
             slowly varies between 
                $U_{-}=0$
             and
$U_{-}=0$
             and 
                $U_{+}$
            . The wavenumber and the amplitude of the linear wave then slowly change from some
$U_{+}$
            . The wavenumber and the amplitude of the linear wave then slowly change from some 
                $k_{-},a_{-}$
             to
$k_{-},a_{-}$
             to 
                $k_{+},a_{+}$
            , and the conservation of the frequency and the wave action yield the following relations:
$k_{+},a_{+}$
            , and the conservation of the frequency and the wave action yield the following relations: 
 $$\begin{eqnarray}\displaystyle U_{+}k_{+}+\unicode[STIX]{x1D70E}(k_{+})=\unicode[STIX]{x1D70E}(k_{-}),\quad {\displaystyle \frac{U_{+}+\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{+})}{\unicode[STIX]{x1D70E}(k_{+})}}\,a_{+}^{2}={\displaystyle \frac{\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{-})}{\unicode[STIX]{x1D70E}(k_{-})}}\,a_{-}^{2}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle U_{+}k_{+}+\unicode[STIX]{x1D70E}(k_{+})=\unicode[STIX]{x1D70E}(k_{-}),\quad {\displaystyle \frac{U_{+}+\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{+})}{\unicode[STIX]{x1D70E}(k_{+})}}\,a_{+}^{2}={\displaystyle \frac{\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{-})}{\unicode[STIX]{x1D70E}(k_{-})}}\,a_{-}^{2}. & & \displaystyle\end{eqnarray}$$
             There is no analytical solution for (1.2) but one can check that 
                $k_{+}$
             and
$k_{+}$
             and 
                $a_{+}$
             are decreasing functions of
$a_{+}$
             are decreasing functions of 
                $U_{+}$
            . The relations (1.2) have been successfully verified experimentally, cf. for instance Brevik & Aas (Reference Brevik and Aas1980). In particular the linear wave shortens,
$U_{+}$
            . The relations (1.2) have been successfully verified experimentally, cf. for instance Brevik & Aas (Reference Brevik and Aas1980). In particular the linear wave shortens, 
                $k_{+}>k_{-}$
            , and its amplitude increases,
$k_{+}>k_{-}$
            , and its amplitude increases, 
                $a_{+}>a_{-}$
            , when it propagates against the current,
$a_{+}>a_{-}$
            , when it propagates against the current, 
                $U_{+}<0$
            . In this case, the group velocity
$U_{+}<0$
            . In this case, the group velocity 
                $\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}(k_{+})=U_{+}+\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{+})$
             vanishes for a sufficiently short wave, and no energy can propagate against the current, i.e. the wave is ‘stopped’, or ‘blocked’ by the current (Taylor Reference Taylor1955; Lai, Long & Huang Reference Lai, Long and Huang1989). Additionally the amplitude of the linear wave
$\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}(k_{+})=U_{+}+\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D70E}(k_{+})$
             vanishes for a sufficiently short wave, and no energy can propagate against the current, i.e. the wave is ‘stopped’, or ‘blocked’ by the current (Taylor Reference Taylor1955; Lai, Long & Huang Reference Lai, Long and Huang1989). Additionally the amplitude of the linear wave 
                $a_{+}$
             becomes extremely large and the wave breaks, cf. (1.2). As a matter of fact, the linear approximation fails to be valid for such waves. As noted in Peregrine (Reference Peregrine1976), ‘such a stopping velocity… leads to very rough water surfaces as the wave energy density increases substantially. Upstream of such points, especially if the current slackens, the surface of the water is especially smooth as all short waves are eliminated’. This phenomenon has been observed when the sea draws back at the ebb of the tide where an opposing current increases wave steepness and, as a result, wave breaking occurs (see for instance Johnson Reference Johnson1947). It also enters in some pneumatic and hydraulic breakwater scenarios (cf. Evans Reference Evans1955) where the injection of a local current destabilises the waves and prevents them from reaching the shore. More recently, wave blocking has been used to engineer the so-called white hole horizon for surface waves in the context of analogue gravity (Rousseaux et al. 
            Reference Rousseaux, Mathis, Maïssa, Philbin and Leonhardt2008, Reference Rousseaux, Maïssa, Mathis, Coullet, Philbin and Leonhardt2010). Finally it has been shown that rogue waves can be triggered when surface waves propagate against the current in the ocean (Onorato, Proment & Toffoli Reference Onorato, Proment and Toffoli2011).
$a_{+}$
             becomes extremely large and the wave breaks, cf. (1.2). As a matter of fact, the linear approximation fails to be valid for such waves. As noted in Peregrine (Reference Peregrine1976), ‘such a stopping velocity… leads to very rough water surfaces as the wave energy density increases substantially. Upstream of such points, especially if the current slackens, the surface of the water is especially smooth as all short waves are eliminated’. This phenomenon has been observed when the sea draws back at the ebb of the tide where an opposing current increases wave steepness and, as a result, wave breaking occurs (see for instance Johnson Reference Johnson1947). It also enters in some pneumatic and hydraulic breakwater scenarios (cf. Evans Reference Evans1955) where the injection of a local current destabilises the waves and prevents them from reaching the shore. More recently, wave blocking has been used to engineer the so-called white hole horizon for surface waves in the context of analogue gravity (Rousseaux et al. 
            Reference Rousseaux, Mathis, Maïssa, Philbin and Leonhardt2008, Reference Rousseaux, Maïssa, Mathis, Coullet, Philbin and Leonhardt2010). Finally it has been shown that rogue waves can be triggered when surface waves propagate against the current in the ocean (Onorato, Proment & Toffoli Reference Onorato, Proment and Toffoli2011).
Similar problems for a non-uniform and unsteady mean flow have also been studied. The necessity to consider the media unsteadiness was first recognised by Unna (Reference Unna1941), Barber (Reference Barber1949) and Longuet-Higgins & Stewart (Reference Longuet-Higgins and Stewart1960). Due to the non-stationary character of the problem, the frequency, as well as the wavenumber, are not constant. Various unsteady configurations have been studied with linear theory (1.1), such as the influence of an unsteady gravity constant on water waves (Irvine Reference Irvine, Toba and Mitsuyasu1985), the effect of internal waves on surface waves (Hughes Reference Hughes1978), the water wave–tidal wave interaction (Tolman Reference Tolman1990) and the influence of current standing waves on water waves (Haller & Tuba Özkan-Haller Reference Haller and Tuba Özkan-Haller2007).
In all described examples, the mean flow or the medium non-homogeneity were prescribed externally. This results in the simple modulation system (1.1), consisting of just two equations with variable coefficients, with several implications for the wave’s wavelength and amplitude as outlined above. In this work, we study a different kind of wave–mean flow interaction, where the mean flow dynamically evolves in space–time so that the variations of both the wavetrain and the mean flow are governed by the same nonlinear dispersive partial differential equation (PDE) but occur in differing amplitude–frequency domains. The dynamics of the small-amplitude, short-wavelength wave is dominated by dispersive effects while the large-scale mean flow variation is a nonlinear process. In this scenario, the modulation system (1.1) for the linear wave couples to an extra nonlinear evolution equation for the mean flow. The form of the mean flow equation depends on the nature of the large-scale unsteady fluid state involved in the interaction. For the simplest case of a smooth expansion (rarefaction) wave, the mean flow equation coincides with the long-wave, dispersionless, limit of the original dispersive PDE. However, if the large-scale, nonlinear state is oscillatory, as happens in a dispersive shock wave (undular bore), the derivation of the mean flow equation requires full nonlinear modulation analysis originally presented in Gurevich & Pitaevskii (Reference Gurevich and Pitaevskii1974) (see also El & Hoefer (Reference El and Hoefer2016) and references therein). We show that in both cases, the wave–mean flow interaction exhibits two adiabatic invariants of motion that govern the variations of the wavenumber and the amplitude in the linear wavetrain, and prescribe its transmission or trapping inside the hydrodynamic state: either a rarefaction wave (RW) or a dispersive shock wave (DSW). Trapping generalises the aforementioned discussion of blocking phenomena to time-dependent, nonlinear mean flows.
As a basic prototypical example, we consider dynamic wavepacket–mean flow interactions in the framework of the Korteweg–de Vries (KdV) equation for long shallow water gravity waves
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D702}_{t}+c\unicode[STIX]{x1D702}_{x}+{\displaystyle \frac{3}{2}}{\displaystyle \frac{c}{h}}\unicode[STIX]{x1D702}\unicode[STIX]{x1D702}_{x}+{\displaystyle \frac{h^{2}c}{6}}\unicode[STIX]{x1D702}_{xxx}=0, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D702}_{t}+c\unicode[STIX]{x1D702}_{x}+{\displaystyle \frac{3}{2}}{\displaystyle \frac{c}{h}}\unicode[STIX]{x1D702}\unicode[STIX]{x1D702}_{x}+{\displaystyle \frac{h^{2}c}{6}}\unicode[STIX]{x1D702}_{xxx}=0, & & \displaystyle\end{eqnarray}$$
             where 
                $h$
             is the unperturbed water depth,
$h$
             is the unperturbed water depth, 
                $\unicode[STIX]{x1D702}(x,t)$
             is the free surface elevation relative to
$\unicode[STIX]{x1D702}(x,t)$
             is the free surface elevation relative to 
                $h$
             and
$h$
             and 
                $c=\sqrt{gh}$
             the long-wave speed. Equation (1.3) exhibits the linear dispersion relation
$c=\sqrt{gh}$
             the long-wave speed. Equation (1.3) exhibits the linear dispersion relation 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D714}(k,\overline{\unicode[STIX]{x1D702}})=c\left(1+{\displaystyle \frac{3\overline{\unicode[STIX]{x1D702}}}{2h}}\right)k-{\displaystyle \frac{h^{2}c}{6}}k^{3}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D714}(k,\overline{\unicode[STIX]{x1D702}})=c\left(1+{\displaystyle \frac{3\overline{\unicode[STIX]{x1D702}}}{2h}}\right)k-{\displaystyle \frac{h^{2}c}{6}}k^{3}, & & \displaystyle\end{eqnarray}$$
             with frequency 
                $\unicode[STIX]{x1D714}$
             and wavenumber
$\unicode[STIX]{x1D714}$
             and wavenumber 
                $k$
            . The KdV equation describes uni-directional waves that exhibit a balance between weak nonlinear effects – characterised by the small dimensionless parameter
$k$
            . The KdV equation describes uni-directional waves that exhibit a balance between weak nonlinear effects – characterised by the small dimensionless parameter 
                $\unicode[STIX]{x1D702}_{0}/h\ll 1$
             where
$\unicode[STIX]{x1D702}_{0}/h\ll 1$
             where 
                $\unicode[STIX]{x1D702}_{0}$
             is the characteristic amplitude of the free surface displacement – and weak dispersive effects – characterised by
$\unicode[STIX]{x1D702}_{0}$
             is the characteristic amplitude of the free surface displacement – and weak dispersive effects – characterised by 
                $k_{0}h\ll 1$
             where
$k_{0}h\ll 1$
             where 
                $1/k_{0}$
             is a characteristic horizontal length scale of the perturbation. The balance leading to the KdV equation is
$1/k_{0}$
             is a characteristic horizontal length scale of the perturbation. The balance leading to the KdV equation is 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D702}_{0}/h\sim (k_{0}h)^{2}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D702}_{0}/h\sim (k_{0}h)^{2}, & & \displaystyle\end{eqnarray}$$
            (Hammack & Segur Reference Hammack and Segur1978b ). In particular (1.3) has proved effective in the quantitative description of surface waves in laboratory experiments (Zabusky & Galvin Reference Zabusky and Galvin1971; Hammack & Segur Reference Hammack and Segur1974, Reference Hammack and Segur1978a ; Trillo et al. Reference Trillo, Klein, Clauss and Onorato2016).
 By passing to a reference frame moving at the speed 
                $c$
             and normalising
$c$
             and normalising 
                $x$
             and
$x$
             and 
                $\unicode[STIX]{x1D702}$
             by the unperturbed depth
$\unicode[STIX]{x1D702}$
             by the unperturbed depth 
                $h$
            , and
$h$
            , and 
                $t$
             by the characteristic time
$t$
             by the characteristic time 
                $h/c$
$h/c$
             
            
 $$\begin{eqnarray}\displaystyle \tilde{x}={\displaystyle \frac{x-ct}{h}},\quad \tilde{t}=6{\displaystyle \frac{ct}{h}},\quad u={\displaystyle \frac{9\unicode[STIX]{x1D702}}{h}}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \tilde{x}={\displaystyle \frac{x-ct}{h}},\quad \tilde{t}=6{\displaystyle \frac{ct}{h}},\quad u={\displaystyle \frac{9\unicode[STIX]{x1D702}}{h}}, & & \displaystyle\end{eqnarray}$$
            the KdV equation (1.3) assumes its standard form
 $$\begin{eqnarray}\displaystyle u_{\tilde{t}}+uu_{\tilde{x}}+u_{\tilde{x}\tilde{x}\tilde{x}}=0. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle u_{\tilde{t}}+uu_{\tilde{x}}+u_{\tilde{x}\tilde{x}\tilde{x}}=0. & & \displaystyle\end{eqnarray}$$
             In what follows we shall drop tildes for independent variables and shall use the normalised equation (1.7) as our main mathematical model. All the results obtained in the framework of (1.7) can then be readily interpreted in terms of the physical variables using relations (1.6). The two basic settings we consider for (1.7) are illustrated in figure 1. The linear wavepacket propagating with group velocity 
                $-3k^{2}$
             relative to the background, say
$-3k^{2}$
             relative to the background, say 
                $u=u_{0}$
            , is incident from the right upon an unsteady dispersive–hydrodynamic state: a RW or a DSW. We derive a system of modulation equations describing the coupling between the amplitude–frequency modulations in the linear wavepacket and the variations of the background mean flow and show that the linear wave is either transmitted through or trapped inside the unsteady hydrodynamic state. The transmission/trapping conditions are determined by two adiabatic invariants of motion that coincide with Riemann invariants of the modulation system on a certain integral surface.
$u=u_{0}$
            , is incident from the right upon an unsteady dispersive–hydrodynamic state: a RW or a DSW. We derive a system of modulation equations describing the coupling between the amplitude–frequency modulations in the linear wavepacket and the variations of the background mean flow and show that the linear wave is either transmitted through or trapped inside the unsteady hydrodynamic state. The transmission/trapping conditions are determined by two adiabatic invariants of motion that coincide with Riemann invariants of the modulation system on a certain integral surface.

Figure 1. Interaction of a linear wavepacket with nonlinear dispersive hydrodynamic states: a RW (a) and a DSW (b).
The mathematical approach to the description of dynamic wave–mean flow interaction that is developed in this paper is general and can be applied to other models for water waves (Lannes Reference Lannes2013), such as Boussinesq-type systems describing bidirectional propagation of nonlinear long waves (Serre Reference Serre1953; Bona, Chen & Saut Reference Bona, Chen and Saut2002; Bona, Chen & Saut Reference Bona, Chen and Saut2004), the models for short gravity surface waves (Whitham & Lighthill Reference Whitham and Lighthill1967; Trillo et al. Reference Trillo, Klein, Clauss and Onorato2016), gravity–capillary waves (Schneider & Wayne Reference Schneider and Wayne2002) and others.
The paper is organised as follows. In § 2, we introduce the mean field approximation and linear wave theory to derive the modulation system for the interaction of a linear modulated wave with a nonlinear dispersive hydrodynamic state: either a RW or DSW. This system consists of the two usual modulation equations (1.1) that describe conservation of wavenumber and wave action, which are coupled to the simple wave evolution equation describing mean flow variations in the RW/DSW. The obtained full modulation system, despite being non-strictly hyperbolic, is shown to possess a Riemann invariant associated with the linear group velocity characteristic. Moreover, we show that the wave action modulation equation can be written in diagonal form, effectively exhibiting an additional Riemann invariant on a certain integral surface.
In § 3, we consider the model problem of plane wave–mean flow interaction whereby the mean flow variations are initiated by Riemann step initial data. Within this framework, the Riemann invariants of the modulation system found in § 2 are shown to play the role of adiabatic invariants of motion that determine the transmission conditions through the RW. The transmission through a DSW is then determined by the same conditions as in the RW case by way of hydrodynamic reciprocity, a notion recently described in the context of soliton–mean flow interactions (Maiden et al. Reference Maiden, Anderson, Franco, El and Hoefer2018).
The results of § 3 are employed in § 4 to study the physically relevant case of the interaction of localised wavepackets with RWs and DSWs. A partial Riemann problem for wavepacket–RW interaction is used to show that the variation of the wavepacket’s dominant wavenumber is governed by the conservation of the adiabatic invariant identified in § 3 and thus yields the same transmission and trapping conditions for the wavepacket as in the full Riemann problem (plane wave–RW interaction). The same conditions are valid, via hydrodynamic reciprocity, for the wavepacket–DSW interaction case. Wavepacket trajectories inside the RW and the DSW are also determined analytically and compared with the results of numerical resolution of the corresponding partial Riemann problem. We obtain the speed and phase shifts of the wavepacket due to its interaction with a hydrodynamic state.
In § 5, we draw conclusions and identify applications and perspectives for further development of this work. Appendix A describes the numerical implementation of the partial Riemann problem employed in § 4.
2 Modulation dynamics of the linear wave–mean flow interaction
2.1 Mean field approximation and the modulation equations
In this section, we shall introduce the mean field approximation that enables a straightforward derivation of the modulation system describing linear wave–mean flow interaction. The full justification of this approximation for the case of the interaction with a RW can be done in the framework of standard multiple-scale analysis (Luke Reference Luke1966), equivalent to single-phase modulation theory (Whitham Reference Whitham1999). The justification for linear wave–DSW interaction is more subtle, requiring the derivation of multiphase (two-phase) nonlinear modulation equations (Ablowitz & Benney Reference Ablowitz and Benney1970) and making linearisation in one of the oscillatory phases. To avoid unnecessary technicalities, we simply postulate the approximation used and then justify its validity by comparison of the obtained results with direct numerical simulations of the KdV equation.
 To describe the interaction of a linear dispersive wave with an extended nonlinear dispersive–hydrodynamic state (RW or DSW), we represent the solution 
                   $u(x,t)$
                of the KdV equation (1.7) as a superposition
$u(x,t)$
                of the KdV equation (1.7) as a superposition 
 $$\begin{eqnarray}\displaystyle u(x,t)=u_{H.S.}(x,t)+\unicode[STIX]{x1D711}(x,t), & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle u(x,t)=u_{H.S.}(x,t)+\unicode[STIX]{x1D711}(x,t), & & \displaystyle\end{eqnarray}$$
                where 
                   $u_{H.S.}(x,t)$
                corresponds to the RW or DSW solution, and
$u_{H.S.}(x,t)$
                corresponds to the RW or DSW solution, and 
                   $\unicode[STIX]{x1D711}(x,t)$
                corresponds to a small-amplitude field describing the linear wave.
$\unicode[STIX]{x1D711}(x,t)$
                corresponds to a small-amplitude field describing the linear wave.
 In order to extract the dynamics of 
                   $\unicode[STIX]{x1D711}(x,t)$
               , we make the mean field (scale separation) approximation by assuming that
$\unicode[STIX]{x1D711}(x,t)$
               , we make the mean field (scale separation) approximation by assuming that 
                   $u_{H.S.}(x,t)$
                is locally (i.e. on the scale
$u_{H.S.}(x,t)$
                is locally (i.e. on the scale 
                   $\unicode[STIX]{x0394}x\sim \unicode[STIX]{x0394}t=O(1)$
               ) periodic and replace the dispersive hydrodynamic wave field
$\unicode[STIX]{x0394}x\sim \unicode[STIX]{x0394}t=O(1)$
               ) periodic and replace the dispersive hydrodynamic wave field 
                   $u_{H.S.}(x,t)$
                with its local mean (period average) value
$u_{H.S.}(x,t)$
                with its local mean (period average) value 
                   $\overline{u}(x,t)$
               . Within this substitution, the small-amplitude approximation and the mean field assumption read
$\overline{u}(x,t)$
               . Within this substitution, the small-amplitude approximation and the mean field assumption read 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}\ll \overline{u},\quad \overline{u}_{x}/\overline{u}\ll \unicode[STIX]{x1D711}_{x}/\unicode[STIX]{x1D711},\quad \overline{u}_{t}/\overline{u}\ll \unicode[STIX]{x1D711}_{t}/\unicode[STIX]{x1D711}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}\ll \overline{u},\quad \overline{u}_{x}/\overline{u}\ll \unicode[STIX]{x1D711}_{x}/\unicode[STIX]{x1D711},\quad \overline{u}_{t}/\overline{u}\ll \unicode[STIX]{x1D711}_{t}/\unicode[STIX]{x1D711}. & & \displaystyle\end{eqnarray}$$
                For a smooth, slowly varying hydrodynamic state (RW) such a replacement is natural since locally one has 
                   $u_{H.S.}=\overline{u}$
               , but for the oscillatory solutions describing slowly modulated nonlinear wavetrains in a DSW,
$u_{H.S.}=\overline{u}$
               , but for the oscillatory solutions describing slowly modulated nonlinear wavetrains in a DSW, 
                   $u_{H.S.}(x,t)\neq \overline{u}$
                so the mean field approximation would require justification via a careful multiple-scale analysis (Ablowitz & Benney Reference Ablowitz and Benney1970). In particular, a detailed analysis of possible resonances between the DSW and the wavepacket will be necessary (Dobrokhotov & Maslov Reference Dobrokhotov and Maslov1981). Such a mathematical justification will be the subject of a separate work, while here we shall postulate the outlined mean field approximation and show that it enables a remarkably accurate description of the linear field
$u_{H.S.}(x,t)\neq \overline{u}$
                so the mean field approximation would require justification via a careful multiple-scale analysis (Ablowitz & Benney Reference Ablowitz and Benney1970). In particular, a detailed analysis of possible resonances between the DSW and the wavepacket will be necessary (Dobrokhotov & Maslov Reference Dobrokhotov and Maslov1981). Such a mathematical justification will be the subject of a separate work, while here we shall postulate the outlined mean field approximation and show that it enables a remarkably accurate description of the linear field 
                   $\unicode[STIX]{x1D711}$
               , which can be thought of as propagating on top of the mean flow.
$\unicode[STIX]{x1D711}$
               , which can be thought of as propagating on top of the mean flow.
 Within the proposed mean field approximation, the small-amplitude wave field 
                   $\unicode[STIX]{x1D711}$
                satisfies the linearised, variable coefficient KdV equation
$\unicode[STIX]{x1D711}$
                satisfies the linearised, variable coefficient KdV equation 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}_{t}+\overline{u}(x,t)\unicode[STIX]{x1D711}_{x}+\unicode[STIX]{x1D711}_{xxx}=0, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}_{t}+\overline{u}(x,t)\unicode[STIX]{x1D711}_{x}+\unicode[STIX]{x1D711}_{xxx}=0, & & \displaystyle\end{eqnarray}$$
                where the mean flow 
                   $\overline{u}(x,t)$
                evolves according to
$\overline{u}(x,t)$
                evolves according to 
 $$\begin{eqnarray}\displaystyle \overline{u}_{t}+V(\overline{u})\,\overline{u}_{x}=0. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \overline{u}_{t}+V(\overline{u})\,\overline{u}_{x}=0. & & \displaystyle\end{eqnarray}$$
                For the case of linear wave–RW interaction, 
                   $V(\overline{u})=\overline{u}$
               ; and the corresponding simplification of (2.4), known as the Hopf equation, is obtained by averaging the KdV equation over linear waves for which
$V(\overline{u})=\overline{u}$
               ; and the corresponding simplification of (2.4), known as the Hopf equation, is obtained by averaging the KdV equation over linear waves for which 
                   $\overline{u^{2}}=\overline{u}^{2}$
                and
$\overline{u^{2}}=\overline{u}^{2}$
                and 
                   $\overline{u_{xxx}}=0$
                (El Reference El2005). For the linear wave–DSW interaction,
$\overline{u_{xxx}}=0$
                (El Reference El2005). For the linear wave–DSW interaction, 
                   $V(\overline{u})$
                is given parametrically by (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974)
$V(\overline{u})$
                is given parametrically by (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974) 
 $$\begin{eqnarray}\displaystyle \left.\begin{array}{@{}l@{}}V=\overline{u}_{+}+{\displaystyle \frac{1}{3}}(\overline{u}_{-}-\overline{u}_{+})\left(1+m-{\displaystyle \frac{2m(1-m)K(m)}{E(m)-(1-m)K(m)}}\right),\\[12.0pt] \overline{u}=2\overline{u}_{+}-\overline{u}_{-}+(\overline{u}_{-}-\overline{u}_{+})\left(m+2{\displaystyle \frac{E(m)}{K(m)}}\right),\end{array}\right\} & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \left.\begin{array}{@{}l@{}}V=\overline{u}_{+}+{\displaystyle \frac{1}{3}}(\overline{u}_{-}-\overline{u}_{+})\left(1+m-{\displaystyle \frac{2m(1-m)K(m)}{E(m)-(1-m)K(m)}}\right),\\[12.0pt] \overline{u}=2\overline{u}_{+}-\overline{u}_{-}+(\overline{u}_{-}-\overline{u}_{+})\left(m+2{\displaystyle \frac{E(m)}{K(m)}}\right),\end{array}\right\} & & \displaystyle\end{eqnarray}$$
                where 
                   $K(m)$
                and
$K(m)$
                and 
                   $E(m)$
                are the complete elliptic integrals of the first and the second kind respectively (Abramowitz & Stegun Reference Abramowitz and Stegun1972),
$E(m)$
                are the complete elliptic integrals of the first and the second kind respectively (Abramowitz & Stegun Reference Abramowitz and Stegun1972), 
                   $m\in [0,1]$
               , and
$m\in [0,1]$
               , and 
                   $\overline{u}_{-}>\overline{u}_{+}$
                are the values of
$\overline{u}_{-}>\overline{u}_{+}$
                are the values of 
                   $u$
                at the left and right constant states respectively, connected by the DSW. The parameter
$u$
                at the left and right constant states respectively, connected by the DSW. The parameter 
                   $m$
                is implicitly obtained as a self-similar solution with
$m$
                is implicitly obtained as a self-similar solution with 
                   $V=x/t$
               . Figure 2 displays the variation of the characteristic speed
$V=x/t$
               . Figure 2 displays the variation of the characteristic speed 
                   $V(\overline{u})$
                and the mean flow
$V(\overline{u})$
                and the mean flow 
                   $\overline{u}$
                for
$\overline{u}$
                for 
                   $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
               . Equations (2.4), (2.5) follow from the Whitham modulation system obtained by averaging the KdV equation over the family of nonlinear periodic (cnoidal wave) KdV solutions (Whitham Reference Whitham1965b
               ). This system consists of three hyperbolic equations that can be diagonalised in Riemann invariant form. The DSW modulation is a simple wave (more specifically, a 2-wave (El & Hoefer Reference El and Hoefer2016)) solution of the Whitham equations, in which two of the Riemann invariants are set constant to provide continuous matching with the external constant states
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
               . Equations (2.4), (2.5) follow from the Whitham modulation system obtained by averaging the KdV equation over the family of nonlinear periodic (cnoidal wave) KdV solutions (Whitham Reference Whitham1965b
               ). This system consists of three hyperbolic equations that can be diagonalised in Riemann invariant form. The DSW modulation is a simple wave (more specifically, a 2-wave (El & Hoefer Reference El and Hoefer2016)) solution of the Whitham equations, in which two of the Riemann invariants are set constant to provide continuous matching with the external constant states 
                   $u_{\pm }$
                (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974), see also Kamchatnov (Reference Kamchatnov2000). As we shall show, equations (2.3), (2.4), (2.5) provide an accurate description of the interaction between the linear wave and the DSW so that the dynamics of
$u_{\pm }$
                (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974), see also Kamchatnov (Reference Kamchatnov2000). As we shall show, equations (2.3), (2.4), (2.5) provide an accurate description of the interaction between the linear wave and the DSW so that the dynamics of 
                   $\unicode[STIX]{x1D711}(x,t)$
                is predominantly governed by the variations of the DSW mean value
$\unicode[STIX]{x1D711}(x,t)$
                is predominantly governed by the variations of the DSW mean value 
                   $\overline{u}(x,t)$
               . We note that a similar mean flow approach, in which the oscillatory DSW field was replaced by its mean
$\overline{u}(x,t)$
               . We note that a similar mean flow approach, in which the oscillatory DSW field was replaced by its mean 
                   $\overline{u}$
                has been recently successfully applied to the description of soliton–DSW interaction in Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018).
$\overline{u}$
                has been recently successfully applied to the description of soliton–DSW interaction in Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018).

Figure 2. (a) Variation of the characteristic speed of the Gurevich–Pitaevskii modulation (2.5) with 
                            $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . (b) Corresponding variation of the mean flow
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . (b) Corresponding variation of the mean flow 
                            $\overline{u}(x/t)$
                         inside a DSW. The dashed lines correspond to the DSW edges.
$\overline{u}(x/t)$
                         inside a DSW. The dashed lines correspond to the DSW edges.
 Equations (2.3), (2.4) form our basic mathematical model for linear wave–mean flow interaction. We shall proceed by constructing modulation equations for this system. One may question the wisdom of incorporating the decoupled mean flow equation (2.4) to (2.3) rather than simply prescribing an arbitrary mean flow externally as has been done in previous works (Bretherton Reference Bretherton1968; Bretherton & Garrett Reference Bretherton and Garrett1968). As we will see, the mathematical structure of (2.3), (2.4) enables a convenient solution that is not available for generic mean flows 
                   $\overline{u}(x,t)$
               . Moreover, equations (2.3), (2.4) transparently reveal the multi-scale structure of the dynamics: a fast equation (2.3) for the linear waves and a slow equation (2.4) for the mean flow.
$\overline{u}(x,t)$
               . Moreover, equations (2.3), (2.4) transparently reveal the multi-scale structure of the dynamics: a fast equation (2.3) for the linear waves and a slow equation (2.4) for the mean flow.
 Let 
                   $\unicode[STIX]{x1D711}(x,t)$
                describe a slowly varying wavepacket,
$\unicode[STIX]{x1D711}(x,t)$
                describe a slowly varying wavepacket, 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}(x,t)=a(x,t)\cos [\unicode[STIX]{x1D703}(x,t)],\quad \unicode[STIX]{x1D714}=-\unicode[STIX]{x1D703}_{t},\quad k=\unicode[STIX]{x1D703}_{x}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}(x,t)=a(x,t)\cos [\unicode[STIX]{x1D703}(x,t)],\quad \unicode[STIX]{x1D714}=-\unicode[STIX]{x1D703}_{t},\quad k=\unicode[STIX]{x1D703}_{x}, & & \displaystyle\end{eqnarray}$$
               where
 $$\begin{eqnarray}\displaystyle a_{x}/a\sim k_{x}/k\sim \unicode[STIX]{x1D714}_{x}/\unicode[STIX]{x1D714}\ll k,\quad a_{t}/a\sim k_{t}/k\sim \unicode[STIX]{x1D714}_{t}/\unicode[STIX]{x1D714}\ll \unicode[STIX]{x1D714}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle a_{x}/a\sim k_{x}/k\sim \unicode[STIX]{x1D714}_{x}/\unicode[STIX]{x1D714}\ll k,\quad a_{t}/a\sim k_{t}/k\sim \unicode[STIX]{x1D714}_{t}/\unicode[STIX]{x1D714}\ll \unicode[STIX]{x1D714}. & & \displaystyle\end{eqnarray}$$
                These are standard assumptions in modulation theory (Whitham Reference Whitham1965b
               , Reference Whitham1999), that can be conveniently formalised by introducing slow space and time variables 
                   $X=\unicode[STIX]{x1D700}t$
               ,
$X=\unicode[STIX]{x1D700}t$
               , 
                   $T=\unicode[STIX]{x1D700}t$
               , where
$T=\unicode[STIX]{x1D700}t$
               , where 
                   $\unicode[STIX]{x1D700}\ll 1$
                is a small parameter, and assuming that
$\unicode[STIX]{x1D700}\ll 1$
                is a small parameter, and assuming that 
                   $a=a(X,T)$
               ,
$a=a(X,T)$
               , 
                   $k=k(X,T)$
               ,
$k=k(X,T)$
               , 
                   $\unicode[STIX]{x1D714}=\unicode[STIX]{x1D714}(X,T)$
               . To describe the interaction of a linear wavepacket with a nonlinear hydrodynamic state, we require that the slow variations of the linear wave’s parameters and the variations of the mean flow occur on the same spatio-temporal scale, i.e.
$\unicode[STIX]{x1D714}=\unicode[STIX]{x1D714}(X,T)$
               . To describe the interaction of a linear wavepacket with a nonlinear hydrodynamic state, we require that the slow variations of the linear wave’s parameters and the variations of the mean flow occur on the same spatio-temporal scale, i.e. 
                   $\overline{u}=\overline{u}(X,T)$
               . Substituting (2.6) in (2.2), we reduce the scale separation conditions between the linear wave and the mean flow to
$\overline{u}=\overline{u}(X,T)$
               . Substituting (2.6) in (2.2), we reduce the scale separation conditions between the linear wave and the mean flow to 
 $$\begin{eqnarray}\displaystyle a\ll \overline{u},\quad \overline{u}_{x}/\overline{u}\ll k,\quad \overline{u}_{t}/\overline{u}\ll \unicode[STIX]{x1D714}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle a\ll \overline{u},\quad \overline{u}_{x}/\overline{u}\ll k,\quad \overline{u}_{t}/\overline{u}\ll \unicode[STIX]{x1D714}. & & \displaystyle\end{eqnarray}$$
               Conditions (2.7) and (2.8) are the main assumptions underlying the modulation theory of linear wave–mean flow interaction described here.
 The derivation of modulation equations for 
                   $a$
                and
$a$
                and 
                   $k$
                is then straightforward using Whitham’s variational approach (cf. for instance Whitham Reference Whitham1999, Ch. 11), and yields (1.1) with
$k$
                is then straightforward using Whitham’s variational approach (cf. for instance Whitham Reference Whitham1999, Ch. 11), and yields (1.1) with 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D714}=\overline{u}\,k-k^{3},\quad {\mathcal{A}}=a^{2}/k. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D714}=\overline{u}\,k-k^{3},\quad {\mathcal{A}}=a^{2}/k. & & \displaystyle\end{eqnarray}$$
                We also derive a useful consequence of the wave conservation law (cf. (1.1a
               )) for a wavepacket train consisting of a superposition of two slowly modulated plane waves with close wavenumbers 
                   $k$
                and
$k$
                and 
                   $k+\unicode[STIX]{x1D6FF}k$
                where
$k+\unicode[STIX]{x1D6FF}k$
                where 
                   $\unicode[STIX]{x1D6FF}k\ll k$
               , which corresponds to beating of the two waves. The conservation of waves for these two waves reads
$\unicode[STIX]{x1D6FF}k\ll k$
               , which corresponds to beating of the two waves. The conservation of waves for these two waves reads 
 $$\begin{eqnarray}\displaystyle k_{t}+\unicode[STIX]{x1D714}(k,\overline{u})_{x}=0,\quad (k+\unicode[STIX]{x1D6FF}k)_{t}+\unicode[STIX]{x1D714}(k+\unicode[STIX]{x1D6FF}k,\overline{u})_{x}=0. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle k_{t}+\unicode[STIX]{x1D714}(k,\overline{u})_{x}=0,\quad (k+\unicode[STIX]{x1D6FF}k)_{t}+\unicode[STIX]{x1D714}(k+\unicode[STIX]{x1D6FF}k,\overline{u})_{x}=0. & & \displaystyle\end{eqnarray}$$
                Hence, for 
                   $\unicode[STIX]{x1D6FF}k\ll k$
               , the subtraction of these two equations reduces to a conservation equation for
$\unicode[STIX]{x1D6FF}k\ll k$
               , the subtraction of these two equations reduces to a conservation equation for 
                   $\unicode[STIX]{x1D6FF}k$
                that is very similar to the conservation of wave action
$\unicode[STIX]{x1D6FF}k$
                that is very similar to the conservation of wave action 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6FF}k_{t}+(v_{g}(k;\overline{u})\unicode[STIX]{x1D6FF}k)_{x}=0. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6FF}k_{t}+(v_{g}(k;\overline{u})\unicode[STIX]{x1D6FF}k)_{x}=0. & & \displaystyle\end{eqnarray}$$
               Concluding this section, we note that the modulation system (1.1), (2.9) is quite simple and definitively not new. However, unlike in previous studies, it is now coupled to the mean field equation (2.4). As we shall show, the system consisting of (1.1), (2.4), (2.9) and (2.11) equipped with appropriate initial conditions, yields straightforward yet highly non-trivial implications, especially in the case of wavepacket–DSW interaction, which is very difficult to tackle using direct (non-modulation) analysis.
2.2 Riemann invariants
 In what follows, we shall use an abstract field 
                   $A(x,t)$
                representing either
$A(x,t)$
                representing either 
                   ${\mathcal{A}}(x,t)=a(x,t)^{2}/k(x,t)$
                or
${\mathcal{A}}(x,t)=a(x,t)^{2}/k(x,t)$
                or 
                   $\unicode[STIX]{x1D6FF}k(x,t)$
                such that the reduced modulation system composed of (1.1), (2.4), (2.9) and (2.11) can be cast in the general form
$\unicode[STIX]{x1D6FF}k(x,t)$
                such that the reduced modulation system composed of (1.1), (2.4), (2.9) and (2.11) can be cast in the general form 
 $$\begin{eqnarray}\displaystyle & \displaystyle \overline{u}_{t}+V(\overline{u})\overline{u}_{x}=0, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle \overline{u}_{t}+V(\overline{u})\overline{u}_{x}=0, & \displaystyle\end{eqnarray}$$
                   $$\begin{eqnarray}\displaystyle & \displaystyle k_{t}+v_{g}(k,\overline{u})k_{x}+\unicode[STIX]{x2202}_{\overline{u}}\,\unicode[STIX]{x1D714}(k,\overline{u})\,\overline{u}_{x}=0, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle k_{t}+v_{g}(k,\overline{u})k_{x}+\unicode[STIX]{x2202}_{\overline{u}}\,\unicode[STIX]{x1D714}(k,\overline{u})\,\overline{u}_{x}=0, & \displaystyle\end{eqnarray}$$
                   $$\begin{eqnarray}\displaystyle & \displaystyle A_{t}+(v_{g}(k,\overline{u})A)_{x}=0, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle A_{t}+(v_{g}(k,\overline{u})A)_{x}=0, & \displaystyle\end{eqnarray}$$
                   $v_{g}(k,\overline{u})=\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}=\overline{u}-3k^{2}$
               ,
$v_{g}(k,\overline{u})=\unicode[STIX]{x2202}_{k}\unicode[STIX]{x1D714}=\overline{u}-3k^{2}$
               , 
                   $\unicode[STIX]{x2202}_{\overline{u}}\unicode[STIX]{x1D714}=k$
                and
$\unicode[STIX]{x2202}_{\overline{u}}\unicode[STIX]{x1D714}=k$
                and 
                   $V(\overline{u})=\overline{u}$
                or that given in (2.5). We note that the system (2.12) has the double characteristic velocity
$V(\overline{u})=\overline{u}$
                or that given in (2.5). We note that the system (2.12) has the double characteristic velocity 
                   $v_{g}$
                and thus is not strictly hyperbolic. In fact, there are only two linearly independent characteristic eigenvectors associated with the modulation system (2.12), so this system of three equations is only weakly hyperbolic. The first two equations, (2.12a
               ) and (2.12b
               ), are decoupled and can always be diagonalised such that (2.12b
               ) takes the form
$v_{g}$
                and thus is not strictly hyperbolic. In fact, there are only two linearly independent characteristic eigenvectors associated with the modulation system (2.12), so this system of three equations is only weakly hyperbolic. The first two equations, (2.12a
               ) and (2.12b
               ), are decoupled and can always be diagonalised such that (2.12b
               ) takes the form  $$\begin{eqnarray}\displaystyle q_{t}+v_{g}(q,\overline{u})q_{x}=0, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle q_{t}+v_{g}(q,\overline{u})q_{x}=0, & & \displaystyle\end{eqnarray}$$
                for the Riemann invariant 
                   $q=Q(k,\overline{u})$
               . Generally, the Riemann invariant
$q=Q(k,\overline{u})$
               . Generally, the Riemann invariant 
                   $q$
                as a function of
$q$
                as a function of 
                   $\overline{u}$
                and
$\overline{u}$
                and 
                   $k$
                is found by integrating the characteristic differential form
$k$
                is found by integrating the characteristic differential form 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6EF}=[\unicode[STIX]{x1D714}_{k}(k,\overline{u})-V(\overline{u})]\,\text{d}k+\unicode[STIX]{x1D714}_{\overline{u}}(k,\overline{u})\,\text{d}\overline{u}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6EF}=[\unicode[STIX]{x1D714}_{k}(k,\overline{u})-V(\overline{u})]\,\text{d}k+\unicode[STIX]{x1D714}_{\overline{u}}(k,\overline{u})\,\text{d}\overline{u}. & & \displaystyle\end{eqnarray}$$
                For the case of linear wave–RW interaction, we have 
                   $V(\overline{u})=\overline{u}$
               , so
$V(\overline{u})=\overline{u}$
               , so 
                   $\unicode[STIX]{x1D6EF}=-3k^{2}\,\text{d}k+k\,\text{d}\overline{u}$
                which can be integrated after multiplying by the integrating factor
$\unicode[STIX]{x1D6EF}=-3k^{2}\,\text{d}k+k\,\text{d}\overline{u}$
                which can be integrated after multiplying by the integrating factor 
                   $1/k$
                to yield explicit expressions for the Riemann invariant
$1/k$
                to yield explicit expressions for the Riemann invariant 
                   $q$
                and the associated characteristic velocity
$q$
                and the associated characteristic velocity 
 $$\begin{eqnarray}\displaystyle q=Q(k,\overline{u})=\overline{u}-{\textstyle \frac{3}{2}}k^{2},\quad v_{g}(q,\overline{u})=2q-\overline{u}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle q=Q(k,\overline{u})=\overline{u}-{\textstyle \frac{3}{2}}k^{2},\quad v_{g}(q,\overline{u})=2q-\overline{u}. & & \displaystyle\end{eqnarray}$$
                It follows from (2.13) that 
                   $q=\text{const}\equiv q_{0}$
                along the double characteristic
$q=\text{const}\equiv q_{0}$
                along the double characteristic 
                   $\text{d}x/\text{d}t=v_{g}$
               , which enables one to manipulate (2.12c
               ) into the form
$\text{d}x/\text{d}t=v_{g}$
               , which enables one to manipulate (2.12c
               ) into the form 
 $$\begin{eqnarray}\displaystyle (pA)_{t}+v_{g}(q_{0},\overline{u})(pA)_{x}=0, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle (pA)_{t}+v_{g}(q_{0},\overline{u})(pA)_{x}=0, & & \displaystyle\end{eqnarray}$$
                valid along 
                   $\text{d}x/\text{d}t=v_{g}$
               , where
$\text{d}x/\text{d}t=v_{g}$
               , where 
 $$\begin{eqnarray}\displaystyle p=P(q_{0},\overline{u}),\quad P(q,\overline{u})=\exp \left(-\int _{\overline{u}_{0}}^{\overline{u}}{\displaystyle \frac{\unicode[STIX]{x2202}_{u}v_{g}(q,u)}{V(u)-v_{g}(q,u)}}\,\text{d}u\right), & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle p=P(q_{0},\overline{u}),\quad P(q,\overline{u})=\exp \left(-\int _{\overline{u}_{0}}^{\overline{u}}{\displaystyle \frac{\unicode[STIX]{x2202}_{u}v_{g}(q,u)}{V(u)-v_{g}(q,u)}}\,\text{d}u\right), & & \displaystyle\end{eqnarray}$$
                with 
                   $\overline{u}_{0}$
                a constant of integration. The quantity
$\overline{u}_{0}$
                a constant of integration. The quantity 
                   $pA$
                thus can be viewed as a Riemann invariant of the system (2.12) on the integral surface
$pA$
                thus can be viewed as a Riemann invariant of the system (2.12) on the integral surface 
                   $Q(k,\overline{u})=q_{0}$
                which will prove useful in the analysis that follows. We stress, however, that
$Q(k,\overline{u})=q_{0}$
                which will prove useful in the analysis that follows. We stress, however, that 
                   $pA$
                is not a Riemann invariant in the conventional sense since the system (2.12) does not have a full set of characteristic eigenvectors. See Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for a similar construction in the context of soliton–mean flow interaction.
$pA$
                is not a Riemann invariant in the conventional sense since the system (2.12) does not have a full set of characteristic eigenvectors. See Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for a similar construction in the context of soliton–mean flow interaction.
 For 
                   $V(\overline{u})=\overline{u}$
               , the integral in (2.17) is readily evaluated to give, taking into account (2.15),
$V(\overline{u})=\overline{u}$
               , the integral in (2.17) is readily evaluated to give, taking into account (2.15), 
 $$\begin{eqnarray}\displaystyle P(q,\overline{u})=\sqrt{{\displaystyle \frac{\overline{u}-q}{\overline{u}_{0}-q}}}=\sqrt{{\displaystyle \frac{3}{2}}}{\displaystyle \frac{k}{\sqrt{\overline{u}_{0}-q}}}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle P(q,\overline{u})=\sqrt{{\displaystyle \frac{\overline{u}-q}{\overline{u}_{0}-q}}}=\sqrt{{\displaystyle \frac{3}{2}}}{\displaystyle \frac{k}{\sqrt{\overline{u}_{0}-q}}}. & & \displaystyle\end{eqnarray}$$
                Note, that the described diagonalisation of the reduced modulation system (2.12) for the linear wave–mean flow interaction, unlike the existence of Riemann invariants of the general Whitham system for modulated cnoidal waves (Whitham Reference Whitham1965b
               ), does not rely on integrability of the KdV equation. In fact, the possibility of this diagonalisation is general and is a direct consequence of the absence of an induced mean flow for linearised waves, so that the dynamics of the wave parameters 
                   $(k,\unicode[STIX]{x1D714},a)$
                is decoupled from the dynamics of the mean flow
$(k,\unicode[STIX]{x1D714},a)$
                is decoupled from the dynamics of the mean flow 
                   $\overline{u}$
               . Here, we reap the benefits of jointly considering the evolution of the mean flow, wavenumber conservation and the field equation in (2.12) by recognising that they can be cast in diagonal, Riemann invariant form (2.12a
               ), (2.13) and (2.16) along
$\overline{u}$
               . Here, we reap the benefits of jointly considering the evolution of the mean flow, wavenumber conservation and the field equation in (2.12) by recognising that they can be cast in diagonal, Riemann invariant form (2.12a
               ), (2.13) and (2.16) along 
                   $Q(k,\overline{u})=q_{0}$
               .
$Q(k,\overline{u})=q_{0}$
               .
3 Plane wave–mean flow interaction: the generalised Riemann problem
3.1 Adiabatic invariants and transmission conditions
 Before studying the interaction of localised wavepackets with a mean flow in the framework of the basic system (2.3), (2.4), we consider a model problem of the unidirectional scattering of a linear plane wave (PW) by a nonlinear hydrodynamic state (RW or DSW) initiated by a step in 
                   $\overline{u}$
               . We denote the incident PW parameters at
$\overline{u}$
               . We denote the incident PW parameters at 
                   $x\rightarrow +\infty$
                as
$x\rightarrow +\infty$
                as 
                   $k_{+},a_{+}$
                and the transmitted PW parameters at
$k_{+},a_{+}$
                and the transmitted PW parameters at 
                   $x\rightarrow -\infty$
                as
$x\rightarrow -\infty$
                as 
                   $k_{-},a_{-}$
               . To find the transmission relations, we consider the generalised Riemann problem (see figure 3)
$k_{-},a_{-}$
               . To find the transmission relations, we consider the generalised Riemann problem (see figure 3) 
 $$\begin{eqnarray}\displaystyle \overline{u}(x,0),k(x,0),a(x,0)=\left\{\begin{array}{@{}ll@{}}\overline{u}_{-},k_{-},a_{-}\quad & \text{if }x<0\\ \overline{u}_{+},k_{+},a_{+}\quad & \text{if }x>0.\end{array}\right. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \overline{u}(x,0),k(x,0),a(x,0)=\left\{\begin{array}{@{}ll@{}}\overline{u}_{-},k_{-},a_{-}\quad & \text{if }x<0\\ \overline{u}_{+},k_{+},a_{+}\quad & \text{if }x>0.\end{array}\right. & & \displaystyle\end{eqnarray}$$
               We call this Riemann problem generalised as it is formulated for the modulation system (2.12) rather than for the original dispersive model (2.3), (2.4).

Figure 3. Schematic of the initial conditions for the interaction between a plane wave and a hydrodynamic state.
 In the interaction of a PW with both a RW and a DSW, the evolution of 
                   $\overline{u}(x,t)$
                is described by the self-similar expansion fan solution of the mean flow equation (2.12a
               )
$\overline{u}(x,t)$
                is described by the self-similar expansion fan solution of the mean flow equation (2.12a
               ) 
 $$\begin{eqnarray}\displaystyle \overline{u}(x,t)=\left\{\begin{array}{@{}ll@{}}\overline{u}_{-}\quad & \text{if }x/t<V(\overline{u}_{-})\\ V^{-1}(x/t)\quad & \text{if }V(\overline{u}_{-})\leqslant x/t<V(\overline{u}_{+})\\ \overline{u}_{+}\quad & \text{if }x/t\geqslant V(\overline{u}_{+}),\end{array}\right. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \overline{u}(x,t)=\left\{\begin{array}{@{}ll@{}}\overline{u}_{-}\quad & \text{if }x/t<V(\overline{u}_{-})\\ V^{-1}(x/t)\quad & \text{if }V(\overline{u}_{-})\leqslant x/t<V(\overline{u}_{+})\\ \overline{u}_{+}\quad & \text{if }x/t\geqslant V(\overline{u}_{+}),\end{array}\right. & & \displaystyle\end{eqnarray}$$
                while the Riemann invariants 
                   $q$
                and
$q$
                and 
                   $pA$
                are constant throughout, implying the relations
$pA$
                are constant throughout, implying the relations 
 $$\begin{eqnarray}\displaystyle & \displaystyle q=Q(k,\overline{u})=Q(k_{-},\overline{u}_{-})=Q(k_{+},\overline{u}_{+}), & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle q=Q(k,\overline{u})=Q(k_{-},\overline{u}_{-})=Q(k_{+},\overline{u}_{+}), & \displaystyle\end{eqnarray}$$
                $$\begin{eqnarray}\displaystyle & \displaystyle pA=P(k,\overline{u})A=P(k_{-},\overline{u}_{-})A_{-}=P(k_{+},\overline{u}_{+})A_{+}, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle pA=P(k,\overline{u})A=P(k_{-},\overline{u}_{-})A_{-}=P(k_{+},\overline{u}_{+})A_{+}, & \displaystyle\end{eqnarray}$$
                where 
                   $A_{\pm }=a_{\pm }^{2}/k_{\pm }$
               . These conserved quantities generalise the conservation of wave frequency and wave action, equation (1.2), for steady mean flows to the unsteady case. The expressions for
$A_{\pm }=a_{\pm }^{2}/k_{\pm }$
               . These conserved quantities generalise the conservation of wave frequency and wave action, equation (1.2), for steady mean flows to the unsteady case. The expressions for 
                   $Q(k,\overline{u})$
                and
$Q(k,\overline{u})$
                and 
                   $P(k,\overline{u})$
                in the PW–RW interactions for KdV are given by (2.15) and (2.18), respectively. For PW–DSW interaction, when
$P(k,\overline{u})$
                in the PW–RW interactions for KdV are given by (2.15) and (2.18), respectively. For PW–DSW interaction, when 
                   $V(\overline{u})$
                is given by (2.5), simple explicit expressions for
$V(\overline{u})$
                is given by (2.5), simple explicit expressions for 
                   $Q$
                and
$Q$
                and 
                   $P$
                in terms of
$P$
                in terms of 
                   $k$
                and
$k$
                and 
                   $\overline{u}$
                are not available. However, they can be obtained by integrating (2.14) and evaluating (2.17), e.g. numerically. The edge speeds of the expansion fan (3.2) are given by
$\overline{u}$
                are not available. However, they can be obtained by integrating (2.14) and evaluating (2.17), e.g. numerically. The edge speeds of the expansion fan (3.2) are given by 
 $$\begin{eqnarray}\displaystyle \text{RW}: & & \displaystyle V(\overline{u}_{\pm })=\overline{u}_{\pm },\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \text{RW}: & & \displaystyle V(\overline{u}_{\pm })=\overline{u}_{\pm },\end{eqnarray}$$
                $$\begin{eqnarray}\displaystyle \text{DSW}: & & \displaystyle V(\overline{u}_{-})=2\overline{u}_{+}-\overline{u}_{-},\quad V(\overline{u}_{+})={\textstyle \frac{1}{3}}(\overline{u}_{+}+2\overline{u}_{-}).\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \text{DSW}: & & \displaystyle V(\overline{u}_{-})=2\overline{u}_{+}-\overline{u}_{-},\quad V(\overline{u}_{+})={\textstyle \frac{1}{3}}(\overline{u}_{+}+2\overline{u}_{-}).\end{eqnarray}$$
                Expressions (3.6) follow from (2.5) upon taking 
                   $m\rightarrow 0^{+}$
                and
$m\rightarrow 0^{+}$
                and 
                   $m\rightarrow 1^{-}$
                for the trailing and the leading DSW edge respectively, see Gurevich & Pitaevskii (Reference Gurevich and Pitaevskii1974).
$m\rightarrow 1^{-}$
                for the trailing and the leading DSW edge respectively, see Gurevich & Pitaevskii (Reference Gurevich and Pitaevskii1974).
 Given 
                   $\overline{u}(x,t)$
                described by (3.2), the conservation of
$\overline{u}(x,t)$
                described by (3.2), the conservation of 
                   $q$
                and
$q$
                and 
                   $pA$
                in (3.3), (3.4) yields not only the PW transmission relations but also the slow variations of the PW parameters
$pA$
                in (3.3), (3.4) yields not only the PW transmission relations but also the slow variations of the PW parameters 
                   $k(x/t)$
                and
$k(x/t)$
                and 
                   $a(x/t)$
                due to the interaction with the mean flow in the hydrodynamic state. Constant
$a(x/t)$
                due to the interaction with the mean flow in the hydrodynamic state. Constant 
                   $q$
                and
$q$
                and 
                   $pA$
                can thus be seen as adiabatic invariants of the PW–mean flow interaction.
$pA$
                can thus be seen as adiabatic invariants of the PW–mean flow interaction.
 The conservation relations (3.3), (3.4) also describe wave–mean flow interaction for a system of two beating, superposed slowly modulated plane waves with close wavenumbers 
                   $k$
                and
$k$
                and 
                   $k+\unicode[STIX]{x1D6FF}k$
                interacting with a RW (cf. § 2.1). In this case, the adiabatic variation of
$k+\unicode[STIX]{x1D6FF}k$
                interacting with a RW (cf. § 2.1). In this case, the adiabatic variation of 
                   $k$
                and
$k$
                and 
                   $\unicode[STIX]{x1D6FF}k$
                are described respectively by (3.3) and (3.4) where
$\unicode[STIX]{x1D6FF}k$
                are described respectively by (3.3) and (3.4) where 
                   $A$
                corresponds now to
$A$
                corresponds now to 
                   $\unicode[STIX]{x1D6FF}k$
               .
$\unicode[STIX]{x1D6FF}k$
               .
 As we already mentioned, relations (3.2), (3.3) and (3.4) are valid for both PW–RW (
                   $\overline{u}_{-}<\overline{u}_{+}$
               ) and PW–DSW (
$\overline{u}_{-}<\overline{u}_{+}$
               ) and PW–DSW (
                   $\overline{u}_{-}>\overline{u}_{+}$
               ) interactions. We now consider these two cases in more detail.
$\overline{u}_{-}>\overline{u}_{+}$
               ) interactions. We now consider these two cases in more detail.
3.2 Plane wave–rarefaction wave interaction
 A RW is generated when 
                   $\overline{u}_{-}<\overline{u}_{+}$
               , and the resulting mean flow variation is described by (3.2) with characteristic velocity
$\overline{u}_{-}<\overline{u}_{+}$
               , and the resulting mean flow variation is described by (3.2) with characteristic velocity 
                   $V(\overline{u})=\overline{u}$
               . In this case, explicit expressions for the adiabatic invariants
$V(\overline{u})=\overline{u}$
               . In this case, explicit expressions for the adiabatic invariants 
                   $q$
                and
$q$
                and 
                   $pA$
                can be obtained using (2.15) and (2.18). The conservation relations (3.3), (3.4) then yield
$pA$
                can be obtained using (2.15) and (2.18). The conservation relations (3.3), (3.4) then yield 
 $$\begin{eqnarray}\displaystyle & \displaystyle \overline{u}_{-}-{\textstyle \frac{3}{2}}k_{-}^{2}=\overline{u}_{+}-{\textstyle \frac{3}{2}}k_{+}^{2}, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle \overline{u}_{-}-{\textstyle \frac{3}{2}}k_{-}^{2}=\overline{u}_{+}-{\textstyle \frac{3}{2}}k_{+}^{2}, & \displaystyle\end{eqnarray}$$
                $$\begin{eqnarray}\displaystyle & \displaystyle a_{-}=a_{+}, & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle & \displaystyle a_{-}=a_{+}, & \displaystyle\end{eqnarray}$$
                where the second condition was obtained by using 
                   $A_{\pm }=a_{\pm }^{2}/k_{\pm }$
               . It is surprising that the interaction of a PW with a non-uniform, unsteady hydrodynamic state does not change the PW amplitude, which is in sharp contrast with the classical case of the interaction of a surface water wave with a counter-propagating steady current where the amplitude varies following the inhomogeneities of the current in (1.2). In this latter case, the wave amplitude can become extremely large during the interaction with the mean flow (and hence the wave is no longer described by linear theory) while (3.8) describing dynamic wave–mean flow interaction ensures that the PW remains a small-amplitude linear wave regardless of its wavenumber. In particular no wave breaking occurs during the interaction with a RW.
$A_{\pm }=a_{\pm }^{2}/k_{\pm }$
               . It is surprising that the interaction of a PW with a non-uniform, unsteady hydrodynamic state does not change the PW amplitude, which is in sharp contrast with the classical case of the interaction of a surface water wave with a counter-propagating steady current where the amplitude varies following the inhomogeneities of the current in (1.2). In this latter case, the wave amplitude can become extremely large during the interaction with the mean flow (and hence the wave is no longer described by linear theory) while (3.8) describing dynamic wave–mean flow interaction ensures that the PW remains a small-amplitude linear wave regardless of its wavenumber. In particular no wave breaking occurs during the interaction with a RW.

Figure 4. Hydrodynamic reciprocity of plane wave–RW and plane wave–DSW interactions: conservation of 
                            $Q(k,\overline{u})$
                         and
$Q(k,\overline{u})$
                         and 
                            $a$
                         in (3.7) and (3.8). (a) Modulated plane wave
$a$
                         in (3.7) and (3.8). (a) Modulated plane wave 
                            $\unicode[STIX]{x1D711}=a\cos \unicode[STIX]{x1D703}$
                        ,
$\unicode[STIX]{x1D711}=a\cos \unicode[STIX]{x1D703}$
                        , 
                            $\unicode[STIX]{x1D703}_{x}=k$
                        ,
$\unicode[STIX]{x1D703}_{x}=k$
                        , 
                            $\unicode[STIX]{x1D703}_{t}=-\unicode[STIX]{x1D714}(k,\overline{u})$
                        , outside of the domain of interaction with the hydrodynamic state, where
$\unicode[STIX]{x1D703}_{t}=-\unicode[STIX]{x1D714}(k,\overline{u})$
                        , outside of the domain of interaction with the hydrodynamic state, where 
                            $\overline{u}_{-}>\overline{u}_{+}$
                        , describing PW–DSW interaction for
$\overline{u}_{-}>\overline{u}_{+}$
                        , describing PW–DSW interaction for 
                            $t>0$
                         and PW–RW interaction for
$t>0$
                         and PW–RW interaction for 
                            $t<0$
                        . (b) The relationship between the dominant wavenumbers of incident and transmitted wavepackets with
$t<0$
                        . (b) The relationship between the dominant wavenumbers of incident and transmitted wavepackets with 
                            $a_{0}=0.01$
                        . The solid line corresponds to the analytical relation (3.7) when
$a_{0}=0.01$
                        . The solid line corresponds to the analytical relation (3.7) when 
                            $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . The crosses (+) and circles (○) are identified with PW–RW and PW–DSW interaction, respectively. The relation between
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . The crosses (+) and circles (○) are identified with PW–RW and PW–DSW interaction, respectively. The relation between 
                            $k_{-}$
                         and
$k_{-}$
                         and 
                            $k_{+}$
                         is independent of the nature of the hydrodynamic state.
$k_{+}$
                         is independent of the nature of the hydrodynamic state.
 Figure 4 displays the comparison between the relation (3.7) and the wavenumbers obtained in numerical simulations of linear wave–mean flow interaction. In numerical simulations, we employed the more adequate partial Riemann problem defined in § 4.1 for which we will show that the relation (3.7) remains valid. One can see that (3.7) yields the transmission condition: the transmitted PW exists if its wavenumber 
                   $k_{-}$
                is a real number. This requirement reduces to the following condition for transmission of the incident PW with wavenumber
$k_{-}$
                is a real number. This requirement reduces to the following condition for transmission of the incident PW with wavenumber 
                   $k_{+}$
                as
$k_{+}$
                as 
 $$\begin{eqnarray}\displaystyle k_{+}>k_{c}=\sqrt{{\displaystyle \frac{2}{3}}|\overline{u}_{+}-\overline{u}_{-}|}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle k_{+}>k_{c}=\sqrt{{\displaystyle \frac{2}{3}}|\overline{u}_{+}-\overline{u}_{-}|}. & & \displaystyle\end{eqnarray}$$
                The case 
                   $k_{+}<k_{c}$
                will receive further interpretation in § 4 in the context of the interaction of a localised wavepacket with a RW as wave trapping inside the hydrodynamic state.
$k_{+}<k_{c}$
                will receive further interpretation in § 4 in the context of the interaction of a localised wavepacket with a RW as wave trapping inside the hydrodynamic state.
 One can also consider the interaction between two beating superposed PWs and a RW (see the discussion in § 2.1) where the conservation of the adiabatic invariant 
                   $p(k,\overline{u})A$
                with
$p(k,\overline{u})A$
                with 
                   $A=\unicode[STIX]{x1D6FF}k$
                yields
$A=\unicode[STIX]{x1D6FF}k$
                yields 
 $$\begin{eqnarray}\displaystyle k_{-}\unicode[STIX]{x1D6FF}k_{-}=k_{+}\unicode[STIX]{x1D6FF}k_{+}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle k_{-}\unicode[STIX]{x1D6FF}k_{-}=k_{+}\unicode[STIX]{x1D6FF}k_{+}. & & \displaystyle\end{eqnarray}$$
                As was mentioned in the previous section, the beating pattern created by the superposition of two PWs with close wavenumbers (
                   $\unicode[STIX]{x1D6FF}k\ll k$
               ) can be seen as a wavepacket train of period
$\unicode[STIX]{x1D6FF}k\ll k$
               ) can be seen as a wavepacket train of period 
                   $L=4\unicode[STIX]{x03C0}/\unicode[STIX]{x1D6FF}k$
               . Thus (3.10) provides the relation between the wavelength of the incident train
$L=4\unicode[STIX]{x03C0}/\unicode[STIX]{x1D6FF}k$
               . Thus (3.10) provides the relation between the wavelength of the incident train 
                   $L_{+}$
                and the transmitted train
$L_{+}$
                and the transmitted train 
                   $L_{-}$
               . The difference
$L_{-}$
               . The difference 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6E5}_{-}=L_{-}-L_{+}=L_{+}\left({\displaystyle \frac{k_{-}}{k_{+}}}-1\right) & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D6E5}_{-}=L_{-}-L_{+}=L_{+}\left({\displaystyle \frac{k_{-}}{k_{+}}}-1\right) & & \displaystyle\end{eqnarray}$$
                can be interpreted as the phase shift between the incident and the transmitted wavepackets. Similarly, one can interpret 
                   $L_{\pm }$
                as the widths of the wavepackets before and after transmission. Their relation is then given by
$L_{\pm }$
                as the widths of the wavepackets before and after transmission. Their relation is then given by 
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{k_{-}}{L_{-}}}={\displaystyle \frac{k_{+}}{L_{+}}}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{k_{-}}{L_{-}}}={\displaystyle \frac{k_{+}}{L_{+}}}. & & \displaystyle\end{eqnarray}$$
               3.3 Plane wave–dispersive shock wave interaction: hydrodynamic reciprocity
 We now consider the initial condition (3.1) with 
                   $\overline{u}_{-}>\overline{u}_{+}$
                that resolves into a DSW. In this case, the modulation of the mean flow is described by the simple wave equation (2.5), (3.2) and the expressions for the adiabatic invariants
$\overline{u}_{-}>\overline{u}_{+}$
                that resolves into a DSW. In this case, the modulation of the mean flow is described by the simple wave equation (2.5), (3.2) and the expressions for the adiabatic invariants 
                   $q$
                and
$q$
                and 
                   $pA$
                differ from (2.15), (2.18) obtained for PW–RW interaction. As a result, the conditions (3.3), (3.4) for the conservation of
$pA$
                differ from (2.15), (2.18) obtained for PW–RW interaction. As a result, the conditions (3.3), (3.4) for the conservation of 
                   $q$
                and
$q$
                and 
                   $pA$
                describe a very different adiabatic evolution of the PW parameters inside the dispersive hydrodynamic state. We shall consider this evolution later in § 4.4, while here we describe a very general property of PW interaction with dispersive hydrodynamic states termed hydrodynamic reciprocity, that was initially formulated in Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for mean field interaction of solitons with dispersive hydrodynamic states.
$pA$
                describe a very different adiabatic evolution of the PW parameters inside the dispersive hydrodynamic state. We shall consider this evolution later in § 4.4, while here we describe a very general property of PW interaction with dispersive hydrodynamic states termed hydrodynamic reciprocity, that was initially formulated in Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for mean field interaction of solitons with dispersive hydrodynamic states.
 When 
                   $\overline{u}_{-}>\overline{u}_{+}$
               , we observe that the PW–DSW and PW–RW interactions in the mean flow approximation are described by the solutions of the same Riemann problem considered for the
$\overline{u}_{-}>\overline{u}_{+}$
               , we observe that the PW–DSW and PW–RW interactions in the mean flow approximation are described by the solutions of the same Riemann problem considered for the 
                   $t>0$
                and
$t>0$
                and 
                   $t<0$
                half-planes, respectively. Then, continuity of the simple wave modulation solution for all
$t<0$
                half-planes, respectively. Then, continuity of the simple wave modulation solution for all 
                   $(x,t)$
                (illustrated by figure 4
               a), except at the origin
$(x,t)$
                (illustrated by figure 4
               a), except at the origin 
                   $(x,t)=(0,0)$
               , implies that the transition relations (3.7) and (3.8) derived for the PW–RW interaction (
$(x,t)=(0,0)$
               , implies that the transition relations (3.7) and (3.8) derived for the PW–RW interaction (
                   $t<0$
               ) must also hold for
$t<0$
               ) must also hold for 
                   $t>0$
               , i.e. for the PW–DSW interaction. This hydrodynamic reciprocity is verified in figure 4(b), where we compare the relations between
$t>0$
               , i.e. for the PW–DSW interaction. This hydrodynamic reciprocity is verified in figure 4(b), where we compare the relations between 
                   $k_{-}$
                and
$k_{-}$
                and 
                   $k_{+}$
                obtained numerically for the evolution of PW–RW and PW–DSW interactions in the full KdV equation. The agreement confirms that relation (3.7), as well as the transmission condition (3.9), indeed hold for PW interaction with both nonlinear dispersive hydrodynamic states: RW and DSW.
$k_{+}$
                obtained numerically for the evolution of PW–RW and PW–DSW interactions in the full KdV equation. The agreement confirms that relation (3.7), as well as the transmission condition (3.9), indeed hold for PW interaction with both nonlinear dispersive hydrodynamic states: RW and DSW.
 The agreement between relation (3.7) and the numerical solution of the Riemann problem in figure 4 also confirms the mean field hypothesis underlying the basic mathematical model (2.3) of this paper. Although the mean field assumption is arguably intuitive for PW–RW interaction where the hydrodynamic state solution 
                   $u_{H.S.}$
               , up to small dispersive corrections at the RW corners, coincides with the solution of (2.4) for mean flow evolution
$u_{H.S.}$
               , up to small dispersive corrections at the RW corners, coincides with the solution of (2.4) for mean flow evolution 
                   $\overline{u}=V(\overline{u})$
               , it is no longer so for the highly non-trivial PW–DSW interaction where
$\overline{u}=V(\overline{u})$
               , it is no longer so for the highly non-trivial PW–DSW interaction where 
                   $u_{H.S.}$
                describes a rapidly oscillating structure, which is radically different from its slowly varying mean flow
$u_{H.S.}$
                describes a rapidly oscillating structure, which is radically different from its slowly varying mean flow 
                   $\overline{u}$
                satisfying the equations (2.4), (2.5).
$\overline{u}$
                satisfying the equations (2.4), (2.5).
 The relative difference between the numerically observed wavenumber 
                   $k_{-}^{num}$
                and the predicted wavenumber
$k_{-}^{num}$
                and the predicted wavenumber 
                   $k_{-}$
                for transmitted wavepackets through RWs and DSWs is shown in figure 5. While the relative error in the small-amplitude regime reported in figure 4 is of the order of
$k_{-}$
                for transmitted wavepackets through RWs and DSWs is shown in figure 5. While the relative error in the small-amplitude regime reported in figure 4 is of the order of 
                   $10^{-3}$
               , it is surprising that the wavenumber prediction from linear theory holds equally as well for wavepackets with order-one amplitudes.
$10^{-3}$
               , it is surprising that the wavenumber prediction from linear theory holds equally as well for wavepackets with order-one amplitudes.

Figure 5. Relative error 
                            $k_{-}^{num}/k_{-}-1$
                         where
$k_{-}^{num}/k_{-}-1$
                         where 
                            $k_{-}^{num}$
                         is obtained numerically and
$k_{-}^{num}$
                         is obtained numerically and 
                            $k_{-}$
                         satisfies (3.7) with
$k_{-}$
                         satisfies (3.7) with 
                            $k_{+}=0.88$
                         and
$k_{+}=0.88$
                         and 
                            $(\overline{u}_{-},\overline{u}_{+})=(0,1)$
                         (PW–RW) or
$(\overline{u}_{-},\overline{u}_{+})=(0,1)$
                         (PW–RW) or 
                            $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                         (PW–DSW). The numerical results are obtained for different amplitudes
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                         (PW–DSW). The numerical results are obtained for different amplitudes 
                            $a_{0}$
                         of the incident wavepacket. The crosses (+) and circles (○) correspond to the interaction with a RW and DSW, respectively.
$a_{0}$
                         of the incident wavepacket. The crosses (+) and circles (○) correspond to the interaction with a RW and DSW, respectively.
4 Interaction of linear wavepackets with unsteady hydrodynamic states
4.1 Partial Riemann problem
Having considered the model case of PW interaction with dispersive hydrodynamic states, we now proceed with a more physically relevant example of a similar interaction involving localised linear wavepackets instead of PWs. To model such an interaction, the Riemann problem (2.12), (3.1) must be modified to take into account the localised nature of the wavepacket. To this end, we introduce the partial Riemann problem
 $$\begin{eqnarray}\displaystyle (\overline{u},k)=\left\{\begin{array}{@{}ll@{}}(\overline{u}_{-},k_{-})\quad & \text{if }x<0\\ (\overline{u}_{+},k_{+})\quad & \text{if }x>0\end{array}\right.,\quad a(x,0)=a_{0}f(x-X_{0}), & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle (\overline{u},k)=\left\{\begin{array}{@{}ll@{}}(\overline{u}_{-},k_{-})\quad & \text{if }x<0\\ (\overline{u}_{+},k_{+})\quad & \text{if }x>0\end{array}\right.,\quad a(x,0)=a_{0}f(x-X_{0}), & & \displaystyle\end{eqnarray}$$
                where the amplitude profile is localised and centred at 
                   $x=X_{0}$
               . We take a Gaussian
$x=X_{0}$
               . We take a Gaussian 
                   $f(y)=\text{e}^{-y^{2}/L_{0}^{2}}$
                with width
$f(y)=\text{e}^{-y^{2}/L_{0}^{2}}$
                with width 
                   $L_{0}$
               . In what follows, the position of the wavepacket, defined as a group velocity line, is denoted by
$L_{0}$
               . In what follows, the position of the wavepacket, defined as a group velocity line, is denoted by 
                   $X(t)$
               , so that according to (4.1),
$X(t)$
               , so that according to (4.1), 
                   $X(0)=X_{0}$
               . While the wavepacket is localised, we consider a sufficiently broad initial amplitude distribution that does not vary significantly over one period
$X(0)=X_{0}$
               . While the wavepacket is localised, we consider a sufficiently broad initial amplitude distribution that does not vary significantly over one period 
                   $2\unicode[STIX]{x03C0}/k$
                of the oscillation of the carrier wave,
$2\unicode[STIX]{x03C0}/k$
                of the oscillation of the carrier wave, 
                   $L_{0}\gg 2\unicode[STIX]{x03C0}/k_{\pm }$
               , such that the amplitude modulation is well described by (2.12c
               ), see conditions (2.7). We also require
$L_{0}\gg 2\unicode[STIX]{x03C0}/k_{\pm }$
               , such that the amplitude modulation is well described by (2.12c
               ), see conditions (2.7). We also require 
                   $|X_{0}|\gg L_{0}$
                so that the initial wavepacket is well separated from the initial step in the mean flow at the origin.
$|X_{0}|\gg L_{0}$
                so that the initial wavepacket is well separated from the initial step in the mean flow at the origin.
 The quantities 
                   $k_{+}$
                and
$k_{+}$
                and 
                   $k_{-}$
                here denote the dominant wavenumbers of the wavepackets for
$k_{-}$
                here denote the dominant wavenumbers of the wavepackets for 
                   $x>0$
                and
$x>0$
                and 
                   $x<0$
                respectively. Note that, although the wavepacket dominant wavenumber is defined only along the group velocity line, we treat it here as a spatio-temporal field
$x<0$
                respectively. Note that, although the wavepacket dominant wavenumber is defined only along the group velocity line, we treat it here as a spatio-temporal field 
                   $k(x,t)$
               , and the formulation (4.1a
               ) assumes the simultaneous presence of two wavepackets at
$k(x,t)$
               , and the formulation (4.1a
               ) assumes the simultaneous presence of two wavepackets at 
                   $t=0$
                with dominant wavenumbers
$t=0$
                with dominant wavenumbers 
                   $k_{-}$
                and
$k_{-}$
                and 
                   $k_{+}$
               . Still only one of them – we shall call it the incident wavepacket – is physically realised due to the localised nature of the amplitude distribution. The additional, fictitious wavepacket yields all the transmission, trapping information of the incident wavepacket. See Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for a similar extension made to define a soliton amplitude field in the context of the soliton–mean flow interaction problem.
$k_{+}$
               . Still only one of them – we shall call it the incident wavepacket – is physically realised due to the localised nature of the amplitude distribution. The additional, fictitious wavepacket yields all the transmission, trapping information of the incident wavepacket. See Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018) for a similar extension made to define a soliton amplitude field in the context of the soliton–mean flow interaction problem.
 The partial Riemann problem (2.12), (4.1) implies two possible interaction scenarios: (i) a right-incident interaction where a wavepacket, initially placed at 
                   $X_{0}>0$
               , propagates with group velocity
$X_{0}>0$
               , propagates with group velocity 
                   $v_{g}^{+}=\overline{u}_{+}-3k_{+}^{2}$
                and enters either an expanding hydrodynamic structure whose leading edge velocity is
$v_{g}^{+}=\overline{u}_{+}-3k_{+}^{2}$
                and enters either an expanding hydrodynamic structure whose leading edge velocity is 
                   $V(\overline{u}_{+})>v_{g}^{+}$
                (see (3.5), (3.6)); (ii) a left-incident interaction, where the wavepacket is initially placed at
$V(\overline{u}_{+})>v_{g}^{+}$
                (see (3.5), (3.6)); (ii) a left-incident interaction, where the wavepacket is initially placed at 
                   $X_{0}<0$
                so that the interaction only occurs if
$X_{0}<0$
                so that the interaction only occurs if 
                   $V(\overline{u}_{-})<v_{g}^{-}=\overline{u}_{-}-3k_{-}^{2}$
               . It follows from (3.5), (3.6) that this can happen only for a DSW but not for a RW.
$V(\overline{u}_{-})<v_{g}^{-}=\overline{u}_{-}-3k_{-}^{2}$
               . It follows from (3.5), (3.6) that this can happen only for a DSW but not for a RW.
 The subsystem (2.12a
               ), (2.12b
               ) and (4.1a
               ) for 
                   $\overline{u}$
                and
$\overline{u}$
                and 
                   $k$
                has already been solved in the previous section. The simple wave solution of this problem is given by (3.2) and (3.3), and thus the relation between
$k$
                has already been solved in the previous section. The simple wave solution of this problem is given by (3.2) and (3.3), and thus the relation between 
                   $k_{-}$
                and
$k_{-}$
                and 
                   $k_{+}$
                (3.7) obtained for PWs, holds for the wavepacket–mean flow interaction. As a consequence, the wavepacket is subject to the transmission condition (3.9). The possible interaction configurations are summarised in table 1. The partial Riemann problem (1.7), (4.1) was solved numerically to verify the relation (3.7) in figure 4. Its numerical implementation is detailed in appendix A.
$k_{+}$
                (3.7) obtained for PWs, holds for the wavepacket–mean flow interaction. As a consequence, the wavepacket is subject to the transmission condition (3.9). The possible interaction configurations are summarised in table 1. The partial Riemann problem (1.7), (4.1) was solved numerically to verify the relation (3.7) in figure 4. Its numerical implementation is detailed in appendix A.
Table 1. Configuration classification for wavepacket–hydrodynamic state interaction.

4.2 Conservation of the integral of wave action
 We now proceed with the determination of the wavepacket amplitude variation resulting from the interaction with dispersive hydrodynamic states. It is well known that KdV dispersion leads to wavepacket broadening so that the amplitude 
                   $a(x,t)$
                decreases during propagation on a constant mean flow
$a(x,t)$
                decreases during propagation on a constant mean flow 
                   $\overline{u}_{-}$
                or
$\overline{u}_{-}$
                or 
                   $\overline{u}_{+}$
                in order to conserve the integral
$\overline{u}_{+}$
                in order to conserve the integral 
                   $\int _{-\infty }^{\infty }a^{2}\,\text{d}x$
               , which leads to the standard dispersive decay estimate
$\int _{-\infty }^{\infty }a^{2}\,\text{d}x$
               , which leads to the standard dispersive decay estimate 
                   $a\sim t^{-1/2}$
                for
$a\sim t^{-1/2}$
                for 
                   $t\gg 1$
                (Whitham Reference Whitham1999). Thus, we cannot expect the amplitude transmission relation (3.8) derived for PWs to remain valid for localised wavepackets. To address this issue, instead of considering the amplitude of the wave, we consider the integral of wave action
$t\gg 1$
                (Whitham Reference Whitham1999). Thus, we cannot expect the amplitude transmission relation (3.8) derived for PWs to remain valid for localised wavepackets. To address this issue, instead of considering the amplitude of the wave, we consider the integral of wave action 
 $$\begin{eqnarray}\displaystyle E(t)=\int _{X_{1}(t)}^{X_{2}(t)}{\displaystyle \frac{a(x,t)^{2}}{k(x,t)}}\,\text{d}x, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle E(t)=\int _{X_{1}(t)}^{X_{2}(t)}{\displaystyle \frac{a(x,t)^{2}}{k(x,t)}}\,\text{d}x, & & \displaystyle\end{eqnarray}$$
                between two group lines 
                   $\text{d}X_{1,2}/\text{d}t=v_{g}(k(x,t),\overline{u}(x,t))|_{x=X_{1,2}(t)}$
               . It then follows from (1.1b
               ) and (2.9b
               ) that the integral (4.2) is conserved during linear wavepacket propagation through a hydrodynamic state with varying mean flow
$\text{d}X_{1,2}/\text{d}t=v_{g}(k(x,t),\overline{u}(x,t))|_{x=X_{1,2}(t)}$
               . It then follows from (1.1b
               ) and (2.9b
               ) that the integral (4.2) is conserved during linear wavepacket propagation through a hydrodynamic state with varying mean flow 
                   $\overline{u}(x,t)$
                (Whitham Reference Whitham1965a
               ; Bretherton & Garrett Reference Bretherton and Garrett1968).
$\overline{u}(x,t)$
                (Whitham Reference Whitham1965a
               ; Bretherton & Garrett Reference Bretherton and Garrett1968).
 If the incident wavepacket is transmitted and remains localised, we can evaluate the integral (4.2) before 
                   $(t<t_{+})$
                and after (
$(t<t_{+})$
                and after (
                   $t>t_{-}$
               ) the interaction when the wave is localised at the right or the left of the hydrodynamic state, respectively, and where the wavenumber field is uniform
$t>t_{-}$
               ) the interaction when the wave is localised at the right or the left of the hydrodynamic state, respectively, and where the wavenumber field is uniform 
                   $k(x,t)=k_{+}$
                for
$k(x,t)=k_{+}$
                for 
                   $t<t_{+}$
                or
$t<t_{+}$
                or 
                   $k(x,t)=k_{-}$
                for
$k(x,t)=k_{-}$
                for 
                   $t>t_{-}$
                where
$t>t_{-}$
                where 
                   $a(x,t)\neq 0$
               . Thus, the conservation of the integral of wave action
$a(x,t)\neq 0$
               . Thus, the conservation of the integral of wave action 
                   $E(t_{-})=E(t_{+})$
                yields
$E(t_{-})=E(t_{+})$
                yields 
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{1}{k_{-}}}\int _{-\infty }^{+\infty }a(x,t_{-})^{2}\,\text{d}x={\displaystyle \frac{1}{k_{+}}}\int _{-\infty }^{+\infty }a(x,t_{+})^{2}\,\text{d}x, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{1}{k_{-}}}\int _{-\infty }^{+\infty }a(x,t_{-})^{2}\,\text{d}x={\displaystyle \frac{1}{k_{+}}}\int _{-\infty }^{+\infty }a(x,t_{+})^{2}\,\text{d}x, & & \displaystyle\end{eqnarray}$$
                where we replace the limits of integration 
                   $X_{1}$
                and
$X_{1}$
                and 
                   $X_{2}$
                by
$X_{2}$
                by 
                   $-\infty$
                and
$-\infty$
                and 
                   $+\infty$
                since the wavepacket is localised in space. The relation (4.3) is valid in both linear wavepacket-RW and -DSW interactions, as illustrated in figure 6. Similar to the relation between
$+\infty$
                since the wavepacket is localised in space. The relation (4.3) is valid in both linear wavepacket-RW and -DSW interactions, as illustrated in figure 6. Similar to the relation between 
                   $k_{-}$
                and
$k_{-}$
                and 
                   $k_{+}$
                (3.7), equation (4.3) holds beyond the small-amplitude limit of the wavepacket as displayed by the right plot in figure 6.
$k_{+}$
                (3.7), equation (4.3) holds beyond the small-amplitude limit of the wavepacket as displayed by the right plot in figure 6.
In the case of a broad wavepacket of almost constant amplitude, we have the following approximation:
 $$\begin{eqnarray}\displaystyle \int _{-\infty }^{+\infty }a(x,t_{\pm })^{2}\,\text{d}x\approx a_{\pm }^{2}L_{\pm }, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \int _{-\infty }^{+\infty }a(x,t_{\pm })^{2}\,\text{d}x\approx a_{\pm }^{2}L_{\pm }, & & \displaystyle\end{eqnarray}$$
                where 
                   $a_{\pm }$
                and
$a_{\pm }$
                and 
                   $L_{\pm }$
                are, respectively, the constant amplitude and width of the wavepacket before and after interaction with a hydrodynamic state. It follows from the wave conservation law that the widths
$L_{\pm }$
                are, respectively, the constant amplitude and width of the wavepacket before and after interaction with a hydrodynamic state. It follows from the wave conservation law that the widths 
                   $L_{\pm }$
                of the wavepackets on both sides of the hydrodynamic state satisfy
$L_{\pm }$
                of the wavepackets on both sides of the hydrodynamic state satisfy 
                   $L_{-}/k_{-}=L_{+}/k_{+}$
                (see (3.12)) so that (4.3) and (4.4) yield the approximate conservation of amplitude
$L_{-}/k_{-}=L_{+}/k_{+}$
                (see (3.12)) so that (4.3) and (4.4) yield the approximate conservation of amplitude 
                   $a_{-}\approx a_{+}$
               , which agrees with (3.8) obtained for the limiting case of PW–mean flow interaction.
$a_{-}\approx a_{+}$
               , which agrees with (3.8) obtained for the limiting case of PW–mean flow interaction.

Figure 6. (a) Comparison between the integral of wave action computed before (
                            $t=t_{+}$
                        ), and after (
$t=t_{+}$
                        ), and after (
                            $t=t_{-}$
                        ), the transmission of the wavepacket:
$t=t_{-}$
                        ), the transmission of the wavepacket: 
                            $E_{\pm }=(\int _{-\infty }^{+\infty }a(x,t_{\pm })^{2}\,\text{d}x)/k_{\pm }$
                         for the Riemann problem depicted in figure 4. The solid line (——) corresponds to (4.3) and the crosses (+) or circles (○) are obtained numerically from linear wavepacket-RW or -DSW interaction, respectively with
$E_{\pm }=(\int _{-\infty }^{+\infty }a(x,t_{\pm })^{2}\,\text{d}x)/k_{\pm }$
                         for the Riemann problem depicted in figure 4. The solid line (——) corresponds to (4.3) and the crosses (+) or circles (○) are obtained numerically from linear wavepacket-RW or -DSW interaction, respectively with 
                            $a_{0}=0.01$
                         and variable
$a_{0}=0.01$
                         and variable 
                            $k_{+}$
                        . (b) Relative error
$k_{+}$
                        . (b) Relative error 
                            $E_{-}/E_{+}-1$
                         for
$E_{-}/E_{+}-1$
                         for 
                            $k_{+}=0.88$
                         and different amplitudes
$k_{+}=0.88$
                         and different amplitudes 
                            $a_{0}$
                         of the initial wavepacket.
$a_{0}$
                         of the initial wavepacket.
4.3 Wavepacket–rarefaction wave interaction
 In this section, we consider in detail the interaction between a wavepacket and a RW; as we already mentioned, the linear wavepacket interacts with the RW only if initially 
                   $x=X_{0}>0$
                (see table 1). The fields
$x=X_{0}>0$
                (see table 1). The fields 
                   $\overline{u}$
                and
$\overline{u}$
                and 
                   $k$
                are the solution of the Riemann problem studied in § 3.2. The variation of
$k$
                are the solution of the Riemann problem studied in § 3.2. The variation of 
                   $\overline{u}(x,t)$
                is described by the relation (3.2) with
$\overline{u}(x,t)$
                is described by the relation (3.2) with 
                   $V(\overline{u})=\overline{u}$
               , and the variation of
$V(\overline{u})=\overline{u}$
               , and the variation of 
                   $k(x,t)$
                is given by
$k(x,t)$
                is given by 
 $$\begin{eqnarray}\displaystyle k(x,t)=\sqrt{k_{+}^{2}-2/3(\overline{u}_{+}-\overline{u}(x,t))}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle k(x,t)=\sqrt{k_{+}^{2}-2/3(\overline{u}_{+}-\overline{u}(x,t))}, & & \displaystyle\end{eqnarray}$$
                obtained through the conservation of the adiabatic invariant (2.15). The identification of a dominant wavenumber when the wavepacket propagates inside the hydrodynamic state implies that 
                   $k(x,t)$
               , or similarly
$k(x,t)$
               , or similarly 
                   $\overline{u}(x,t)$
               , is almost constant across the wavepacket. This latter condition is readily satisfied for sufficiently large
$\overline{u}(x,t)$
               , is almost constant across the wavepacket. This latter condition is readily satisfied for sufficiently large 
                   $t$
                as the RW mean flow satisfies
$t$
                as the RW mean flow satisfies 
                   $\overline{u}_{x}=1/t$
               .
$\overline{u}_{x}=1/t$
               .
 Since the wavepacket propagates with the group velocity 
                   $v_{g}(k,\overline{u})=\overline{u}-3k^{2}$
               , its position
$v_{g}(k,\overline{u})=\overline{u}-3k^{2}$
               , its position 
                   $X(t)$
                satisfies the characteristic equation
$X(t)$
                satisfies the characteristic equation 
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}X}{\text{d}t}}=v_{g}(k(X,t),\overline{u}(X,t)),\quad X(0)=X_{0}>0. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}X}{\text{d}t}}=v_{g}(k(X,t),\overline{u}(X,t)),\quad X(0)=X_{0}>0. & & \displaystyle\end{eqnarray}$$
               The integration of (4.6) yields
 $$\begin{eqnarray}\displaystyle X(t)=\left\{\begin{array}{@{}ll@{}}v_{g}(k_{+},\overline{u}_{+})\,t+X_{0}\quad & \text{for }0\leqslant t\leqslant t_{+}\\ \left(\overline{u}_{+}-{\textstyle \frac{3}{2}}k_{+}^{2}\right)t+X_{0}t_{+}/(2t)\quad & \text{for }t_{+}\leqslant t\leqslant t_{-}\\ v_{g}(k_{-},\overline{u}_{-})\,t+3k_{-}^{2}t_{-}\quad & \text{for }t_{-}\leqslant t\end{array}\right., & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle X(t)=\left\{\begin{array}{@{}ll@{}}v_{g}(k_{+},\overline{u}_{+})\,t+X_{0}\quad & \text{for }0\leqslant t\leqslant t_{+}\\ \left(\overline{u}_{+}-{\textstyle \frac{3}{2}}k_{+}^{2}\right)t+X_{0}t_{+}/(2t)\quad & \text{for }t_{+}\leqslant t\leqslant t_{-}\\ v_{g}(k_{-},\overline{u}_{-})\,t+3k_{-}^{2}t_{-}\quad & \text{for }t_{-}\leqslant t\end{array}\right., & & \displaystyle\end{eqnarray}$$
                where 
                   $t_{+}=X_{0}/(3k_{+}^{2})$
                and
$t_{+}=X_{0}/(3k_{+}^{2})$
                and 
                   $t_{-}=X_{0}/(3k_{+}k_{-})$
               . Hence, during the interaction with the RW, the temporal variation of the dominant wavepacket wavenumber
$t_{-}=X_{0}/(3k_{+}k_{-})$
               . Hence, during the interaction with the RW, the temporal variation of the dominant wavepacket wavenumber 
                   $K(t)$
                along the group velocity line is given by
$K(t)$
                along the group velocity line is given by 
 $$\begin{eqnarray}\displaystyle K(t)=k(X(t),t)=k_{+}t_{+}/t. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle K(t)=k(X(t),t)=k_{+}t_{+}/t. & & \displaystyle\end{eqnarray}$$
                The wavepacket trajectory described by (4.7) is compared with the numerically observed trajectory in figure 7 for two different configurations: transmission (
                   $k_{+}>k_{c}$
               , cf. (3.9)) and trapping (
$k_{+}>k_{c}$
               , cf. (3.9)) and trapping (
                   $k_{+}<k_{c}$
               ). Snapshots of the envelope
$k_{+}<k_{c}$
               ). Snapshots of the envelope 
                   $a(x,t)$
                of the wavepacket field
$a(x,t)$
                of the wavepacket field 
                   $\unicode[STIX]{x1D711}(x,t)$
                and the absolute value of its Fourier transform
$\unicode[STIX]{x1D711}(x,t)$
                and the absolute value of its Fourier transform 
                   $|\tilde{\unicode[STIX]{x1D711}}(k,t)|$
                are presented in figure 8. The numerical procedure implemented to extract
$|\tilde{\unicode[STIX]{x1D711}}(k,t)|$
                are presented in figure 8. The numerical procedure implemented to extract 
                   $\unicode[STIX]{x1D711}(x,t)$
                from the full numerical solution of (1.7) is explained in appendix A.
$\unicode[STIX]{x1D711}(x,t)$
                from the full numerical solution of (1.7) is explained in appendix A.
 In figure 8, the wavepacket shape in Fourier space slightly deviates from Gaussian when it enters the leading RW edge at 
                   $t=500$
               . However, the wavepacket recovers its Gaussian form when it is fully inside the RW and after exiting the RW.
$t=500$
               . However, the wavepacket recovers its Gaussian form when it is fully inside the RW and after exiting the RW.

Figure 7. (a) Trajectories of wavepacket–RW interaction. Solid lines correspond to the solution (4.7) and markers to the numerical trajectory. The triangles (▴▴) correspond to the transmission configuration for 
                            $k_{+}=1$
                         and the dots (
$k_{+}=1$
                         and the dots (
                            $\bullet \bullet$
                        ) correspond to the trapping configuration when
$\bullet \bullet$
                        ) correspond to the trapping configuration when 
                            $k_{+}=0.7$
                        . The RW edges
$k_{+}=0.7$
                        . The RW edges 
                            $x=\overline{u}_{\pm }t$
                         are represented by dotted lines (- - -). (b) The corresponding temporal variation of the wavepacket wavenumber. Solid lines correspond to the solution (4.8) and markers to the numerical result.
$x=\overline{u}_{\pm }t$
                         are represented by dotted lines (- - -). (b) The corresponding temporal variation of the wavepacket wavenumber. Solid lines correspond to the solution (4.8) and markers to the numerical result.

Figure 8. Numerical evolution of wavepacket–RW interaction in the case of transmission (a) and trapping (b). The first column displays the extracted wavepacket envelope 
                            $a(x,t)$
                        . The positions of the RW edges are shown by dotted lines (- - -). The second column displays the amplitude of the wavepacket’s Fourier transform, denoted
$a(x,t)$
                        . The positions of the RW edges are shown by dotted lines (- - -). The second column displays the amplitude of the wavepacket’s Fourier transform, denoted 
                            $\tilde{\unicode[STIX]{x1D711}}$
                        .
$\tilde{\unicode[STIX]{x1D711}}$
                        .
 While the wavepacket propagates at constant velocity over a non-modulated mean flow 
                   $\overline{u}(x,t)=\overline{u}_{+}$
                or
$\overline{u}(x,t)=\overline{u}_{+}$
                or 
                   $\overline{u}(x,t)=\overline{u}_{-}$
               , the wavepacket decelerates during the propagation inside the RW for
$\overline{u}(x,t)=\overline{u}_{-}$
               , the wavepacket decelerates during the propagation inside the RW for 
                   $t_{+}<t<t_{-}$
               . Note that acceleration/deceleration here is understood as the increasing/decreasing of the group speed
$t_{+}<t<t_{-}$
               . Note that acceleration/deceleration here is understood as the increasing/decreasing of the group speed 
                   $|v_{g}(X,t)|$
               . If the transmission condition (3.9) is not satisfied,
$|v_{g}(X,t)|$
               . If the transmission condition (3.9) is not satisfied, 
                   $\lim _{t\rightarrow \infty }K(t)=0$
               , and the incident wavepacket gets trapped inside the RW as its velocity
$\lim _{t\rightarrow \infty }K(t)=0$
               , and the incident wavepacket gets trapped inside the RW as its velocity 
                   $v_{g}=\overline{u}-3K^{2}$
                converges asymptotically to the local background velocity
$v_{g}=\overline{u}-3K^{2}$
                converges asymptotically to the local background velocity 
                   $\overline{u}$
               . Moreover, the wavepacket amplitude decays indefinitely, following the conservation of wave action (4.2), and the wavepacket eventually gets absorbed by the RW (see figure 8
               b).
$\overline{u}$
               . Moreover, the wavepacket amplitude decays indefinitely, following the conservation of wave action (4.2), and the wavepacket eventually gets absorbed by the RW (see figure 8
               b).
 We now draw certain parallels between the trapping of linear waves in RWs and the effect of so-called wave blocking in counter-propagating, inhomogeneous steady currents 
                   $U(x)<0$
               , where the wavenumber
$U(x)<0$
               , where the wavenumber 
                   $k(x)$
                also varies following the inhomogeneities of the current (recall the discussion in § 1). In this case, the adiabatic variation of the wavenumber is simply described by the conservation of the frequency
$k(x)$
                also varies following the inhomogeneities of the current (recall the discussion in § 1). In this case, the adiabatic variation of the wavenumber is simply described by the conservation of the frequency 
                   $\unicode[STIX]{x1D714}(k(x);U(x))=\text{const}$
               . In contrast to wave trapping due to wavepacket–RW interaction considered here, wave blocking in the counter-propagating current is accompanied by a decrease in wavepacket wavelength and an increase in amplitude, until it reaches the stopping velocity
$\unicode[STIX]{x1D714}(k(x);U(x))=\text{const}$
               . In contrast to wave trapping due to wavepacket–RW interaction considered here, wave blocking in the counter-propagating current is accompanied by a decrease in wavepacket wavelength and an increase in amplitude, until it reaches the stopping velocity 
                   $v_{g}=0$
                at some finite wavenumber.
$v_{g}=0$
                at some finite wavenumber.
 The trajectory of the wavepacket displayed in figure 7(a) shows that the wavepacket undergoes refraction due to its interaction with the RW. In the transmission configuration, this results in both a speed shift and a phase shift of the transmitted wavepacket. The phase of the wave after its transmission is equal to 
                   $X_{-}=3k_{-}^{2}t_{-}\neq X_{0}$
                (cf. (4.7) for
$X_{-}=3k_{-}^{2}t_{-}\neq X_{0}$
                (cf. (4.7) for 
                   $t>t_{-}$
               ), so that the phase shift
$t>t_{-}$
               ), so that the phase shift 
                   $\unicode[STIX]{x1D6E5}_{-}=X_{-}-X_{0}$
                is
$\unicode[STIX]{x1D6E5}_{-}=X_{-}-X_{0}$
                is 
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{\unicode[STIX]{x1D6E5}_{-}}{X_{0}}}={\displaystyle \frac{k_{-}}{k_{+}}}-1. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{\unicode[STIX]{x1D6E5}_{-}}{X_{0}}}={\displaystyle \frac{k_{-}}{k_{+}}}-1. & & \displaystyle\end{eqnarray}$$
                This result can also be obtained from the second adiabatic invariant 
                   $pA$
                in (3.4) where
$pA$
                in (3.4) where 
                   $A=\unicode[STIX]{x1D6FF}k$
                as in (3.10). Viewing the wavepacket as part of a fictitious periodic train of wavepackets, we recognise that the relative position of the wavepackets post (
$A=\unicode[STIX]{x1D6FF}k$
                as in (3.10). Viewing the wavepacket as part of a fictitious periodic train of wavepackets, we recognise that the relative position of the wavepackets post (
                   $x=X_{-}$
               ) and pre (
$x=X_{-}$
               ) and pre (
                   $x=X_{0}$
               ) interaction is inverse to the relative beating wavenumber shift
$x=X_{0}$
               ) interaction is inverse to the relative beating wavenumber shift 
                   $X_{-}/X_{0}=\unicode[STIX]{x1D6FF}k_{+}/\unicode[STIX]{x1D6FF}k_{-}=k_{-}/k_{+}$
               . Since
$X_{-}/X_{0}=\unicode[STIX]{x1D6FF}k_{+}/\unicode[STIX]{x1D6FF}k_{-}=k_{-}/k_{+}$
               . Since 
                   $k_{-}<k_{+}$
               , the phase shift is negative in the considered situation. The formula (4.9) is precisely (3.11) when we identify
$k_{-}<k_{+}$
               , the phase shift is negative in the considered situation. The formula (4.9) is precisely (3.11) when we identify 
                   $L_{+}$
                with
$L_{+}$
                with 
                   $X_{0}$
               , using the second adiabatic invariant
$X_{0}$
               , using the second adiabatic invariant 
                   $p\unicode[STIX]{x1D6FF}k$
               . Figure 9(a) displays the phase shift computed numerically for different wavenumbers
$p\unicode[STIX]{x1D6FF}k$
               . Figure 9(a) displays the phase shift computed numerically for different wavenumbers 
                   $k_{+}$
               , which agrees with relation (4.9). In addition, the relation (4.9) holds for large-amplitude wavepackets, just as the relations (3.7) and (4.3) do.
$k_{+}$
               , which agrees with relation (4.9). In addition, the relation (4.9) holds for large-amplitude wavepackets, just as the relations (3.7) and (4.3) do.

Figure 9. Numerical determination of the normalised phase shift 
                            $\unicode[STIX]{x1D6E5}_{-}/X_{0}$
                         for wavepacket–RW interaction (a) and wavepacket–DSW interaction (b). In the two plots, the markers (pluses + for the RW interaction and circles ○ for the DSW interaction) correspond to the numerical simulation and the solid line to the analytical prediction (4.9). The inset plots correspond to the relative error
$\unicode[STIX]{x1D6E5}_{-}/X_{0}$
                         for wavepacket–RW interaction (a) and wavepacket–DSW interaction (b). In the two plots, the markers (pluses + for the RW interaction and circles ○ for the DSW interaction) correspond to the numerical simulation and the solid line to the analytical prediction (4.9). The inset plots correspond to the relative error 
                            $\unicode[STIX]{x1D6E5}_{-}^{num.}/\unicode[STIX]{x1D6E5}_{-}-1$
                         between
$\unicode[STIX]{x1D6E5}_{-}^{num.}/\unicode[STIX]{x1D6E5}_{-}-1$
                         between 
                            $\unicode[STIX]{x1D6E5}_{-}^{num.}$
                         determined numerically and
$\unicode[STIX]{x1D6E5}_{-}^{num.}$
                         determined numerically and 
                            $\unicode[STIX]{x1D6E5}_{-}$
                         given by the relation (4.9).
$\unicode[STIX]{x1D6E5}_{-}$
                         given by the relation (4.9). 
                            $\unicode[STIX]{x1D6E5}_{-}^{num.}$
                         is obtained for different initial wavepacket amplitudes
$\unicode[STIX]{x1D6E5}_{-}^{num.}$
                         is obtained for different initial wavepacket amplitudes 
                            $a_{0}$
                        ,
$a_{0}$
                        , 
                            $k_{+}=1.2$
                         for wavepacket–RW interaction (+) and
$k_{+}=1.2$
                         for wavepacket–RW interaction (+) and 
                            $k_{+}=0.88$
                         for wavepacket–DSW interaction (○).
$k_{+}=0.88$
                         for wavepacket–DSW interaction (○).
4.4 Wavepacket–DSW interaction
 We now consider the more complex case of wavepacket–DSW interaction. Such an interaction is generally described by two-phase KdV modulation theory, which is quite technical, with modulation equations given in terms of hyperelliptic integrals (Flaschka, Forest & McLaughlin Reference Flaschka, Forest and McLaughlin1980). The mean field approach adopted here enables us to circumvent these technicalities by employing the approximate modulation system (2.12) that yields simple and transparent analytic results that, as we will show, agree extremely well with direct numerical simulations. More broadly, the notion of hydrodynamic reciprocity described in § 3.3 can be utilised without approximation to make specific predictions for wavepacket–DSW interaction for 
                   $t>0$
                based on wavepacket–RW interaction for
$t>0$
                based on wavepacket–RW interaction for 
                   $t<0$
               .
$t<0$
               .
 As already mentioned, wavepacket–DSW interaction admits two basic configurations (see table 1): the transmission configuration, arising when 
                   $X_{0}>0$
                and applicable to any incident wavenumber
$X_{0}>0$
                and applicable to any incident wavenumber 
                   $k_{+}>0$
               , and the trapping configuration, when
$k_{+}>0$
               , and the trapping configuration, when 
                   $X_{0}<0$
                and the incident wavenumber
$X_{0}<0$
                and the incident wavenumber 
                   $k_{-}>0$
                is sufficiently small. The variation of
$k_{-}>0$
                is sufficiently small. The variation of 
                   $\overline{u}(x,t)$
                inside the DSW is given by
$\overline{u}(x,t)$
                inside the DSW is given by 
                   $\overline{u}=V^{-1}(x/t)$
                (see (3.2)) where the characteristic velocity
$\overline{u}=V^{-1}(x/t)$
                (see (3.2)) where the characteristic velocity 
                   $V(\overline{u})$
                is defined by (2.5).
$V(\overline{u})$
                is defined by (2.5).
 The variation of the wavepacket’s wavenumber field 
                   $k(x,t)$
                is given by the adiabatic invariant
$k(x,t)$
                is given by the adiabatic invariant 
                   $q$
               , which can be obtained by integrating the differential form
$q$
               , which can be obtained by integrating the differential form 
                   $\unicode[STIX]{x1D6EF}$
                in (2.14). This differential form vanishes on the group velocity characteristic
$\unicode[STIX]{x1D6EF}$
                in (2.14). This differential form vanishes on the group velocity characteristic 
                   $\text{d}x/\text{d}t=v_{g}$
               , yielding a relation between
$\text{d}x/\text{d}t=v_{g}$
               , yielding a relation between 
                   $k$
                and
$k$
                and 
                   $\overline{u}$
                specified by the ordinary differential equation (ODE)
$\overline{u}$
                specified by the ordinary differential equation (ODE)
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}k}{\text{d}\overline{u}}}={\displaystyle \frac{\unicode[STIX]{x1D714}_{\overline{u}}(k,\overline{u})}{V(\overline{u})-\unicode[STIX]{x1D714}_{k}(k,\overline{u})}}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}k}{\text{d}\overline{u}}}={\displaystyle \frac{\unicode[STIX]{x1D714}_{\overline{u}}(k,\overline{u})}{V(\overline{u})-\unicode[STIX]{x1D714}_{k}(k,\overline{u})}}, & & \displaystyle\end{eqnarray}$$
                with the boundary condition 
                   $k(\overline{u}_{+})=k_{+}$
                if
$k(\overline{u}_{+})=k_{+}$
                if 
                   $X_{0}>0$
                or
$X_{0}>0$
                or 
                   $k(\overline{u}_{-})=k_{-}$
                if
$k(\overline{u}_{-})=k_{-}$
                if 
                   $X_{0}<0$
               . Note that (4.10) for
$X_{0}<0$
               . Note that (4.10) for 
                   $V(\overline{u})=\overline{u}$
                arises in the DSW fitting method where it determines the locus of the KdV DSW harmonic edge, see El (Reference El2005), El & Hoefer (Reference El and Hoefer2016). Here, it has a different meaning and does not appear to be amenable to analytical solution because of the presence of elliptic integrals in the function
$V(\overline{u})=\overline{u}$
                arises in the DSW fitting method where it determines the locus of the KdV DSW harmonic edge, see El (Reference El2005), El & Hoefer (Reference El and Hoefer2016). Here, it has a different meaning and does not appear to be amenable to analytical solution because of the presence of elliptic integrals in the function 
                   $V(\overline{u})$
               . We therefore solve (4.10) numerically. Once the relation
$V(\overline{u})$
               . We therefore solve (4.10) numerically. Once the relation 
                   $k(\overline{u})$
                has been determined, the
$k(\overline{u})$
                has been determined, the 
                   $(x,t)$
               -dependence of the wavenumber inside the DSW is
$(x,t)$
               -dependence of the wavenumber inside the DSW is 
                   $k=k(\overline{u}(x,t))=k(V^{-1}(x/t))$
               . The wavepacket trajectory in the
$k=k(\overline{u}(x,t))=k(V^{-1}(x/t))$
               . The wavepacket trajectory in the 
                   $(x,t)$
               -plane is obtained by solving (4.6) with the already determined
$(x,t)$
               -plane is obtained by solving (4.6) with the already determined 
                   $\overline{u}(x,t)$
                and
$\overline{u}(x,t)$
                and 
                   $k(x,t)$
               . The results of our semi-analytical computations are presented in figures 10 and 11.
$k(x,t)$
               . The results of our semi-analytical computations are presented in figures 10 and 11.

Figure 10. (a) Wave curves for wavepacket–DSW interaction obtained by numerical integration of (4.10) with 
                            $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . Solid curves (——) correspond to transmission configurations (
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                        . Solid curves (——) correspond to transmission configurations (
                            $k(\overline{u}_{-})>\sqrt{2/3}$
                        ), dashed curves (– –) to trapped configurations (
$k(\overline{u}_{-})>\sqrt{2/3}$
                        ), dashed curves (– –) to trapped configurations (
                            $k(\overline{u}_{-})<\sqrt{2/3}$
                        ) and the dash-dotted curve (— -) to the limiting case
$k(\overline{u}_{-})<\sqrt{2/3}$
                        ) and the dash-dotted curve (— -) to the limiting case 
                            $k(\overline{u}_{-})\simeq \sqrt{2/3}$
                        . The arrows correspond to the direction associated with propagation of the wavepacket. (b) Deviation of the predicted transmitted wavenumber
$k(\overline{u}_{-})\simeq \sqrt{2/3}$
                        . The arrows correspond to the direction associated with propagation of the wavepacket. (b) Deviation of the predicted transmitted wavenumber 
                            $k(\overline{u}_{-})$
                         from the actual value
$k(\overline{u}_{-})$
                         from the actual value 
                            $k_{-}$
                         obtained from (3.7) and hydrodynamic reciprocity, as a function of
$k_{-}$
                         obtained from (3.7) and hydrodynamic reciprocity, as a function of 
                            $k_{-}$
                         with
$k_{-}$
                         with 
                            $\overline{u}_{-}=1$
                        ,
$\overline{u}_{-}=1$
                        , 
                            $\overline{u}_{+}=0$
                        . The vertical dash-dotted line is the minimum transmitted wavenumber
$\overline{u}_{+}=0$
                        . The vertical dash-dotted line is the minimum transmitted wavenumber 
                            $k_{-}=\sqrt{2/3}$
                        .
$k_{-}=\sqrt{2/3}$
                        .
 Figure 10(a) displays the wave curves 
                   $k(\overline{u})$
                obtained from the numerical integration of (4.10), that can be interpreted as wavepacket trajectories in the parameter space
$k(\overline{u})$
                obtained from the numerical integration of (4.10), that can be interpreted as wavepacket trajectories in the parameter space 
                   $(\overline{u},k)$
               . The evolution of the wavepacket’s wavenumber
$(\overline{u},k)$
               . The evolution of the wavepacket’s wavenumber 
                   $K(t)=k(\overline{u}(X/t))$
                along a wave curve is then described by an ODE
$K(t)=k(\overline{u}(X/t))$
                along a wave curve is then described by an ODE 
 $$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}K}{\text{d}t}}={\displaystyle \frac{-K}{V^{\prime }(\overline{u})t}}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle {\displaystyle \frac{\text{d}K}{\text{d}t}}={\displaystyle \frac{-K}{V^{\prime }(\overline{u})t}}, & & \displaystyle\end{eqnarray}$$
                obtained by combining 
                   $\overline{u}=V^{-1}(X/t)$
               , equations (4.6) and (4.10). Since the characteristic speed
$\overline{u}=V^{-1}(X/t)$
               , equations (4.6) and (4.10). Since the characteristic speed 
                   $V(\overline{u})$
                (2.4) of the Gurevich–Pitaevskii modulation equation is a decreasing function of
$V(\overline{u})$
                (2.4) of the Gurevich–Pitaevskii modulation equation is a decreasing function of 
                   $\overline{u}$
                (cf. figure 2), equation (4.11) shows that the wavepacket’s wavenumber is increasing during its propagation inside the DSW, in contrast to wavepacket–RW interaction for which
$\overline{u}$
                (cf. figure 2), equation (4.11) shows that the wavepacket’s wavenumber is increasing during its propagation inside the DSW, in contrast to wavepacket–RW interaction for which 
                   $V^{\prime }(\overline{u})=1>0$
               .
$V^{\prime }(\overline{u})=1>0$
               .

Figure 11. (a) Trajectories of wavepacket–DSW interaction. Solid lines correspond to semi-analytical solutions obtained by solving (4.6), (4.10) and markers to the numerical resolution of the corresponding Riemann problem. The triangles (▴▴) correspond to the transmission configuration (left-propagating wavepacket with 
                            $k_{+}=1$
                        ) and the dots (
$k_{+}=1$
                        ) and the dots (
                            $\bullet \bullet$
                        ) correspond to the trapping configuration (right-propagating wavepackets with
$\bullet \bullet$
                        ) correspond to the trapping configuration (right-propagating wavepackets with 
                            $k_{-}=0.4$
                        ). The DSW edge trajectories
$k_{-}=0.4$
                        ). The DSW edge trajectories 
                            $x=s_{-}t$
                         and
$x=s_{-}t$
                         and 
                            $x=s_{+}t$
                         are displayed as dotted lines (- - -), in both cases, we set
$x=s_{+}t$
                         are displayed as dotted lines (- - -), in both cases, we set 
                            $\overline{u}_{-}=1$
                         and
$\overline{u}_{-}=1$
                         and 
                            $\overline{u}_{+}=0$
                        . (b) Corresponding temporal variation of the wavenumbers along the wavepacket trajectories. Solid lines correspond to the semi-analytical solution
$\overline{u}_{+}=0$
                        . (b) Corresponding temporal variation of the wavenumbers along the wavepacket trajectories. Solid lines correspond to the semi-analytical solution 
                            $K(t)=k(\overline{u}(X(t),t))$
                         where
$K(t)=k(\overline{u}(X(t),t))$
                         where 
                            $k(\overline{u})$
                         has been determined by solving (4.10) numerically.
$k(\overline{u})$
                         has been determined by solving (4.10) numerically.
 We now verify that the obtained integral curves for wavepacket–DSW interaction are consistent with the transmission relation (3.7) for PW–RW interaction, as required by hydrodynamic reciprocity. In the transmission configuration, where 
                   $k(\overline{u}_{-})>k_{c}=\sqrt{(2/3)(\overline{u}_{-}-\overline{u}_{+})}$
                (see (3.9)), the wave curve
$k(\overline{u}_{-})>k_{c}=\sqrt{(2/3)(\overline{u}_{-}-\overline{u}_{+})}$
                (see (3.9)), the wave curve 
                   $k(\overline{u})$
                is represented by a solid curve in figure 10(a) that connects
$k(\overline{u})$
                is represented by a solid curve in figure 10(a) that connects 
                   $\overline{u}=\overline{u}_{+}$
                to
$\overline{u}=\overline{u}_{+}$
                to 
                   $\overline{u}=\overline{u}_{-}$
                and, for a given incident wavenumber
$\overline{u}=\overline{u}_{-}$
                and, for a given incident wavenumber 
                   $k_{+}$
               , the transmitted wavenumber is obtained by evaluating
$k_{+}$
               , the transmitted wavenumber is obtained by evaluating 
                   $k(\overline{u}_{-})$
               . Figure 10(b) shows the comparison of the transmitted wavenumber
$k(\overline{u}_{-})$
               . Figure 10(b) shows the comparison of the transmitted wavenumber 
                   $k(\overline{u}_{-})$
                evaluated by the above semi-analytical procedure with the value
$k(\overline{u}_{-})$
                evaluated by the above semi-analytical procedure with the value 
                   $k_{-}=\sqrt{k_{+}^{2}+(2/3)(\overline{u}_{-}-\overline{u}_{+})}$
                obtained from the wavepacket–RW transmission condition (3.7) by invoking hydrodynamic reciprocity. The agreement confirms the validity of the mean field approximation and its consistency with hydrodynamic reciprocity.
$k_{-}=\sqrt{k_{+}^{2}+(2/3)(\overline{u}_{-}-\overline{u}_{+})}$
                obtained from the wavepacket–RW transmission condition (3.7) by invoking hydrodynamic reciprocity. The agreement confirms the validity of the mean field approximation and its consistency with hydrodynamic reciprocity.
 As expected, the behaviour of wave curves 
                   $k(\overline{u})$
                is drastically different for the trapping configuration, when
$k(\overline{u})$
                is drastically different for the trapping configuration, when 
                   $k(\overline{u}_{-})<k_{c}$
               . In this case, the curves
$k(\overline{u}_{-})<k_{c}$
               . In this case, the curves 
                   $k(\overline{u})$
                (represented by dashed curves in figure 10
               a) do not connect
$k(\overline{u})$
                (represented by dashed curves in figure 10
               a) do not connect 
                   $\overline{u}=\overline{u}_{-}$
                to
$\overline{u}=\overline{u}_{-}$
                to 
                   $\overline{u}=\overline{u}_{+}$
                anymore, implying that the wavepacket initially placed at
$\overline{u}=\overline{u}_{+}$
                anymore, implying that the wavepacket initially placed at 
                   $x=X_{0}<0$
                cannot reach the mean flow
$x=X_{0}<0$
                cannot reach the mean flow 
                   $\overline{u}=\overline{u}_{+}$
                (trapping). Interestingly, these trapping wave curves
$\overline{u}=\overline{u}_{+}$
                (trapping). Interestingly, these trapping wave curves 
                   $k(\overline{u})$
                are multi-valued, which implies that wavepackets with initial parameters
$k(\overline{u})$
                are multi-valued, which implies that wavepackets with initial parameters 
                   $\overline{u}=\overline{u}_{-},k<k_{c}$
                will return, asymptotically as
$\overline{u}=\overline{u}_{-},k<k_{c}$
                will return, asymptotically as 
                   $t\rightarrow \infty$
               , to the DSW harmonic edge where
$t\rightarrow \infty$
               , to the DSW harmonic edge where 
                   $\overline{u}=\overline{u}_{-}$
               . More specifically, the point
$\overline{u}=\overline{u}_{-}$
               . More specifically, the point 
                   $\overline{u}=\overline{u}_{-},k=k_{c}$
                plays the role of an attractor in the parameter space for trapping configurations, such that all the trapped wavepackets’ wavenumbers converge to the same value
$\overline{u}=\overline{u}_{-},k=k_{c}$
                plays the role of an attractor in the parameter space for trapping configurations, such that all the trapped wavepackets’ wavenumbers converge to the same value 
                   $k_{c}$
                with time. This filtering behaviour is unusual and drastically different from wavepacket–RW trapping (see § 4.3), where the wavepacket trajectory is single valued and
$k_{c}$
                with time. This filtering behaviour is unusual and drastically different from wavepacket–RW trapping (see § 4.3), where the wavepacket trajectory is single valued and 
                   $k\rightarrow 0$
                as
$k\rightarrow 0$
                as 
                   $t\rightarrow \infty$
               .
$t\rightarrow \infty$
               .
 We now compare the wavepacket dynamics obtained through our modulation analysis with the numerical solution of the KdV equation with initial conditions given by the partial Riemann data (4.1) (see appendix A for details of the numerical procedure employed to trace the dynamics of a wavepacket inside a DSW). Figure 11 displays trajectories for the transmitted and trapped wavepacket configurations, and snapshots of the envelope 
                   $a(x,t)$
                and the Fourier transform of
$a(x,t)$
                and the Fourier transform of 
                   $\unicode[STIX]{x1D711}(x,t)$
                for the corresponding numerical simulation are presented in figure 12. The agreement of the numerical simulations with the analytical predictions in figure 11 represents a further confirmation of the mean field approximation employed in the derivation of the basic ODE (4.10).
$\unicode[STIX]{x1D711}(x,t)$
                for the corresponding numerical simulation are presented in figure 12. The agreement of the numerical simulations with the analytical predictions in figure 11 represents a further confirmation of the mean field approximation employed in the derivation of the basic ODE (4.10).
 Similar to the interaction with a RW, the group velocity of the linear wavepacket is not constant inside the DSW – but now the wavepacket accelerates in the transmission case and simultaneously experiences a wavenumber increase. Here, however, the determination of the wavenumber 
                   $K(t)$
                is not everywhere possible in the numerical simulation, see figure 11(b). This becomes obvious when one follows the evolution of the amplitude of the Fourier transform
$K(t)$
                is not everywhere possible in the numerical simulation, see figure 11(b). This becomes obvious when one follows the evolution of the amplitude of the Fourier transform 
                   $|\tilde{\unicode[STIX]{x1D711}}(k,t)|$
                of the linear field
$|\tilde{\unicode[STIX]{x1D711}}(k,t)|$
                of the linear field 
                   $\unicode[STIX]{x1D711}(x,t)$
                along with the envelope
$\unicode[STIX]{x1D711}(x,t)$
                along with the envelope 
                   $a(x,t)$
                of the field itself (cf. figure 12). Initially in our simulations, both distributions have a Gaussian shape, but the Fourier transform of the amplitude distribution loses its unimodality when the wavepacket initially interacts with the leading, soliton, edge of the DSW (see figure 12
               a at
$a(x,t)$
                of the field itself (cf. figure 12). Initially in our simulations, both distributions have a Gaussian shape, but the Fourier transform of the amplitude distribution loses its unimodality when the wavepacket initially interacts with the leading, soliton, edge of the DSW (see figure 12
               a at 
                   $t=1000$
               ). In fact, close to the soliton edge the mean flow gradient
$t=1000$
               ). In fact, close to the soliton edge the mean flow gradient 
                   $\overline{u}_{x}$
                is logarithmically singular (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974; El Reference El2005), see figure 2, and the wavenumber field
$\overline{u}_{x}$
                is logarithmically singular (Gurevich & Pitaevskii Reference Gurevich and Pitaevskii1974; El Reference El2005), see figure 2, and the wavenumber field 
                   $k(x,t)$
                varies significantly over the extent of the wavepacket. As a result, we are no longer in a position to define a nearly monochromatic carrier wave in the wavepacket. Figure 12 shows that the quasi-monochromatic wavepacket structure is recovered when the interaction with the DSW edge is over. Its wavenumber is still described by the adiabatic analytical result while the wavepacket propagates in the region where
$k(x,t)$
                varies significantly over the extent of the wavepacket. As a result, we are no longer in a position to define a nearly monochromatic carrier wave in the wavepacket. Figure 12 shows that the quasi-monochromatic wavepacket structure is recovered when the interaction with the DSW edge is over. Its wavenumber is still described by the adiabatic analytical result while the wavepacket propagates in the region where 
                   $\overline{u}$
                is almost constant over the wavepacket extension. Ultimately
$\overline{u}$
                is almost constant over the wavepacket extension. Ultimately 
                   $K=k_{-}$
               , where
$K=k_{-}$
               , where 
                   $k_{-}$
                is given by the relation (3.7), when the wavepacket is no longer interacting with the DSW due to hydrodynamic reciprocity.
$k_{-}$
                is given by the relation (3.7), when the wavepacket is no longer interacting with the DSW due to hydrodynamic reciprocity.
 The above described logarithmic divergence of the mean field gradient is absent in wavepacket–RW interactions considered in the previous section, where 
                   $\overline{u}=x/t$
                inside the hydrodynamic state such that
$\overline{u}=x/t$
                inside the hydrodynamic state such that 
                   $k_{x}\propto \overline{u}_{x}$
                remains finite but exhibits a discontinuity. We still observe a similar, slight deviation from monochromaticity in wavepacket–RW interaction at the initial stage, cf. figure 8
$k_{x}\propto \overline{u}_{x}$
                remains finite but exhibits a discontinuity. We still observe a similar, slight deviation from monochromaticity in wavepacket–RW interaction at the initial stage, cf. figure 8 
                   $t=500$
               , with
$t=500$
               , with 
                   $\overline{u}$
                varying significantly along the extension of the wavepacket. This behaviour, expectedly, does not appear in the wavepacket–DSW trapping interaction (see figure 12
               b), where the wavepacket, coming from the left of the hydrodynamic state, only interacts with the slowly varying part of the mean flow.
$\overline{u}$
                varying significantly along the extension of the wavepacket. This behaviour, expectedly, does not appear in the wavepacket–DSW trapping interaction (see figure 12
               b), where the wavepacket, coming from the left of the hydrodynamic state, only interacts with the slowly varying part of the mean flow.

Figure 12. Numerical evolution of wavepacket–DSW interaction, in the transmitted configuration (a) and in the trapped configuration (b). The first column displays the wavepacket’s envelope amplitude 
                            $a(x,t)$
                         and the positions of the RW edges are indicated by dotted lines (- - -). The second column displays the amplitude of the wavepacket’s Fourier transform.
$a(x,t)$
                         and the positions of the RW edges are indicated by dotted lines (- - -). The second column displays the amplitude of the wavepacket’s Fourier transform.
Similar to wavepacket–RW interaction, we consider the phase shift of the wavepacket transmitted through the DSW. The numerical results are presented in figure 9(b) and are in agreement with the value predicted analytically in (4.9) via hydrodynamic reciprocity.
We note in conclusion that the trapping configuration is somewhat more difficult to treat analytically using the mean field approach employed in other cases. Although the trajectory, as well as the dominant wavenumber of the wavepacket, can be approximately described by our theory for short time evolution (see figure 11), we numerically observe that the dynamics of the DSW is no longer decoupled from the dynamics of the linear wave, and the distinction between the two structures becomes less and less pronounced after a sufficiently long time.
5 Conclusions and outlook
In the context of shallow water theory, we have introduced a general mathematical framework in which to study the interaction of linear wavepackets with unsteady nonlinear dispersive hydrodynamic states: rarefaction waves (RWs) and dispersive shock waves (DSWs) or undular bores. We use a combination of classical Whitham modulation theory and the mean field approximation to derive a new, extended modulation system that describes the dispersive dynamics of a linear wavepacket coupled to the nonlinear, long-wave dynamics of the mean flow in the hydrodynamic state. The mean field equation coincides with the long-wave limit of the original dispersive equation when the hydrodynamic state is slowly varying (RW) but has a more complicated structure for rapidly oscillating states (DSWs). We show that the extended modulation system admits a convenient, general diagonalisation procedure that reveals conserved adiabatic invariants during wavepacket evolution through a slowly evolving mean flow. These adiabatic invariants predict transmission relations and trapping conditions for the incident wavepacket. They also imply the hydrodynamic reciprocity property whereby wavepacket interactions with RWs and DSWs exhibit the same transmission/trapping conditions. This enables the circumvention of the complicated analysis of DSW mean field behaviour in order to take advantage of the available wavepacket–RW relations to describe the transmission through a DSW or predict wavepacket trapping inside a DSW. This study has been performed using the KdV equation as a prototypical example, although the integrability properties of the KdV equation were not invoked. The developed theory can be extended to other models supporting multi-scale nonlinear dispersive wave propagation.
 While the modulation equations (2.12) are formally valid only in the limit of vanishingly small-amplitude waves, 
                $\unicode[STIX]{x1D711}\ll \max (\overline{u})-\min (\overline{u})$
            , the numerical simulations demonstrated that the resulting transmission relation (3.7) between
$\unicode[STIX]{x1D711}\ll \max (\overline{u})-\min (\overline{u})$
            , the numerical simulations demonstrated that the resulting transmission relation (3.7) between 
                $k_{+}$
             and
$k_{+}$
             and 
                $k_{-}$
             also holds for waves of moderate amplitudes
$k_{-}$
             also holds for waves of moderate amplitudes 
                $a\sim |\overline{u}_{+}-\overline{u}_{-}|$
            . This becomes important for establishing the applicability of the transmission relation (3.7) to the actual water wave system modelled by the KdV equation for long surface waves in shallow water. In the context of the full water wave model, the KdV equation describes the propagation of weakly nonlinear perturbations to the water surface, so the field
$a\sim |\overline{u}_{+}-\overline{u}_{-}|$
            . This becomes important for establishing the applicability of the transmission relation (3.7) to the actual water wave system modelled by the KdV equation for long surface waves in shallow water. In the context of the full water wave model, the KdV equation describes the propagation of weakly nonlinear perturbations to the water surface, so the field 
                $u(x,t)$
             already constitutes a small quantity compared to the total depth. Then, considering linearised waves within the KdV approximation would trim the small-amplitude limit even further. The robustness of the linear modulation theory results for larger-amplitude waves ensures here that the relation (3.7) remains valid for realistic physical situations where the incident and transmitted waves do not necessarily have small amplitudes within the KdV approximation, but are of the same order
$u(x,t)$
             already constitutes a small quantity compared to the total depth. Then, considering linearised waves within the KdV approximation would trim the small-amplitude limit even further. The robustness of the linear modulation theory results for larger-amplitude waves ensures here that the relation (3.7) remains valid for realistic physical situations where the incident and transmitted waves do not necessarily have small amplitudes within the KdV approximation, but are of the same order 
                $O(\overline{u}_{+}-\overline{u}_{-})$
             as the nonlinear hydrodynamic states described by KdV.
$O(\overline{u}_{+}-\overline{u}_{-})$
             as the nonlinear hydrodynamic states described by KdV.
The developed modulation theory of linear wave–mean flow interactions could be applied to the interaction of wind-generated short waves with shallow water undular bores in coastal ocean environments. This scenario could readily be tested in wave tank experiments (Hammack & Segur Reference Hammack and Segur1974; Treske Reference Treske1994; Frazao & Zech Reference Frazao and Zech2002; Rousseaux et al. Reference Rousseaux, Mougenot, Chatellier, David and Calluaud2016; Trillo et al. Reference Trillo, Klein, Clauss and Onorato2016) where slowly varying mean flows and undular bores have been generated. Another promising application area is to the interaction of small-amplitude short waves with rising and ebbing tide generated mean flows in internal ocean waves. For example, the observed physical parameters pertaining to large-scale undular bores and the Brunt–Väisälä linear dispersion relation in Scotti et al. (Reference Scotti, Beardsley, Butman and Pineda2008) conform to the assumptions underlying the analysis presented in this paper. The KdV equation can only describe weakly nonlinear internal waves (Helfrich & Melville Reference Helfrich and Melville2006). Nevertheless, the theory developed here can readily be generalised to models that capture strongly nonlinear phenomena occurring in a variety of coastal areas (Scotti et al. Reference Scotti, Beardsley, Butman and Pineda2008; Harris & Decker Reference Harris and Decker2017; Li, Pawlowicz & Wang Reference Li, Pawlowicz and Wang2018).
This theory can also be utilised in many physical contexts beyond classical fluid mechanics. In particular, similar to the soliton–mean flow interaction theory very recently developed in Maiden et al. (Reference Maiden, Anderson, Franco, El and Hoefer2018), it can be applied to a broad range of dispersive hydrodynamic systems describing wave propagation in nonlinear optics and condensed matter physics, opening perspectives for experimental observation of the various interaction scenarios studied here. In fact, the linear wavepacket transmission and trapping configurations can be interpreted as hydrodynamic wavepacket scattering, a dispersive wave counterpart of hydrodynamic soliton tunnelling (Maiden et al. Reference Maiden, Anderson, Franco, El and Hoefer2018; Sprenger, Hoefer & El Reference Sprenger, Hoefer and El2018). In both cases, the role of a barrier or a scatterer is played by a large-scale, evolving hydrodynamic state that satisfies the same equation as the soliton (wavepacket). Finally, we mention the actively developing field of analogue gravity (see Barceló, Liberati & Visser (Reference Barceló, Liberati and Visser2011) and references therein), where the effects of dispersive wave trapping studied here may find interesting interpretations.
A major challenge for the modern theory of dispersive hydrodynamics is to develop a stability theory for dispersive shock waves. The linearisation about a DSW involves a differential operator with both spatially and temporally varying coefficients, presenting significant challenges for its further analysis. The work presented here suggests that perturbations involving sufficiently short wavelengths can be successfully described via wave–mean flow interaction, thus greatly simplifying the stability analysis in this regime.
The developed theory admits generalisations and opens interesting perspectives. It can be extended to physically relevant systems of ‘KdV type’, such as the asymptotically equivalent, long wave Benjamin–Bona–Mahony equation, the Gardner equation for internal waves, the Kawahara equation for capillary–gravity waves or the viscous fluid conduit equation. Extensions to systems with a non-convex hyperbolic flux or non-convex linear dispersion relation may prove fruitful because non-convexity is known to lead to profound effects in dispersive hydrodynamics: undercompressive and contact DSWs (El, Hoefer & Shearer Reference El, Hoefer and Shearer2017), expansion shocks (El, Hoefer & Shearer Reference El, Hoefer and Shearer2016), DSW implosion (Lowman & Hoefer Reference Lowman and Hoefer2013) and the existence of resonant and travelling DSWs (Sprenger & Hoefer Reference Sprenger and Hoefer2017). Another natural extension of this work is to the study of linear wave–mean flow interaction in the framework of integrable and non-integrable bidirectional systems such as the defocusing nonlinear Schrödinger equation, the Serre system for fully nonlinear shallow water waves (Serre Reference Serre1953) and the Choi–Camassa system for fully nonlinear internal waves (Choi & Camassa Reference Choi and Camassa1999).
The abstract, basic modulation system (1.1) has been extensively used in the theory of phase modulations that reveal dispersive deformations arising near coalescing characteristics (see Ratliff & Bridges (Reference Ratliff and Bridges2016), Bridges (Reference Bridges2017) and references therein). At present, this theory does not include variations of the mean flow. The modulation system that couples modulations of the wavepacket to mean field variations studied here could also be useful for further development of phase modulation theory.
Finally we mention one more area where an appropriate extension of the developed modulation theory could prove useful. It is related to the fundamental problem of mean flow–turbulence interaction (see, e.g. Falkovich (Reference Falkovich2016) and references therein). A possible connection between weak limits of nonlinear dispersive waves and turbulence theories was conjectured by Lax (Reference Lax1991). Extensions of the modulation theory approach described here to multi-dimensional linear and weakly nonlinear waves provides a plausible entry into this connection.
Acknowledgements
The work of T.C. and G.A.E. was partially supported by the EPSRC grant EP/R00515X/1. The work of M.A.H. was partially supported by NSF grants CAREER DMS-1255422 and DMS-1816934. Authors gratefully acknowledge valuable discussions with N. Pavloff, R. Grimshaw and S. Benzoni-Gavage. Authors also thank Laboratoire de Physique Théorique et Modèles Statistiques (Université Paris-Saclay) where this work was initiated.
Appendix A. Wavepacket–DSW interaction: numerical resolution
The initial step (4.1) of the partial Riemann problem is implemented numerically by the function
 $$\begin{eqnarray}\displaystyle u(x,t=0)=\overline{u}_{0}(x)+\unicode[STIX]{x1D711}_{0}(x), & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle u(x,t=0)=\overline{u}_{0}(x)+\unicode[STIX]{x1D711}_{0}(x), & & \displaystyle\end{eqnarray}$$
               with
 $$\begin{eqnarray}\displaystyle \left.\begin{array}{@{}l@{}}\overline{u}_{0}(x)={\displaystyle \frac{\overline{u}_{+}-\overline{u}_{-}}{2}}\tanh \left({\displaystyle \frac{x}{\unicode[STIX]{x1D709}}}\right)+{\displaystyle \frac{\overline{u}_{+}+\overline{u}_{-}}{2}},\\[12.0pt] \unicode[STIX]{x1D711}_{0}(x)=a_{0}\exp \left(-{\displaystyle \frac{(x-X_{0})^{2}}{L_{0}^{2}}}\right)\cos [k_{\pm }(x-X_{0})],\end{array}\right\} & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \left.\begin{array}{@{}l@{}}\overline{u}_{0}(x)={\displaystyle \frac{\overline{u}_{+}-\overline{u}_{-}}{2}}\tanh \left({\displaystyle \frac{x}{\unicode[STIX]{x1D709}}}\right)+{\displaystyle \frac{\overline{u}_{+}+\overline{u}_{-}}{2}},\\[12.0pt] \unicode[STIX]{x1D711}_{0}(x)=a_{0}\exp \left(-{\displaystyle \frac{(x-X_{0})^{2}}{L_{0}^{2}}}\right)\cos [k_{\pm }(x-X_{0})],\end{array}\right\} & & \displaystyle\end{eqnarray}$$
                where we set 
                   $\unicode[STIX]{x1D709}=5$
               ,
$\unicode[STIX]{x1D709}=5$
               , 
                   $L_{0}=120/k_{\pm }$
                and, except where otherwise stated,
$L_{0}=120/k_{\pm }$
                and, except where otherwise stated, 
                   $a_{0}=0.01$
               . The values for
$a_{0}=0.01$
               . The values for 
                   $a_{0}$
                and
$a_{0}$
                and 
                   $L_{0}$
                are chosen such that
$L_{0}$
                are chosen such that 
                   $\unicode[STIX]{x1D711}_{0}$
                has small amplitude and is a sufficiently broad wavepacket. The problem (1.7), (A 1), (A 2) is then solved numerically with homogeneous Neumann boundary conditions. The numerical scheme adopted here to solve the KdV equation is explicit, where the space derivatives are approximated using centred finite differences and the time integration is performed with the fourth-order Runge–Kutta method. Note that to solve (1.7), (A 1), (A 2) with
$\unicode[STIX]{x1D711}_{0}$
                has small amplitude and is a sufficiently broad wavepacket. The problem (1.7), (A 1), (A 2) is then solved numerically with homogeneous Neumann boundary conditions. The numerical scheme adopted here to solve the KdV equation is explicit, where the space derivatives are approximated using centred finite differences and the time integration is performed with the fourth-order Runge–Kutta method. Note that to solve (1.7), (A 1), (A 2) with 
                   $(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                for
$(\overline{u}_{-},\overline{u}_{+})=(1,0)$
                for 
                   $t<0$
                in figure 4, we solve the equivalent problem with
$t<0$
                in figure 4, we solve the equivalent problem with 
                   $(\overline{u}_{-},\overline{u}_{+})=(0,1)$
                for
$(\overline{u}_{-},\overline{u}_{+})=(0,1)$
                for 
                   $t>0$
               .
$t>0$
               .
 In order to determine the variations of the wavepacket 
                   $\unicode[STIX]{x1D711}(x,t)$
               , we also numerically solve the Riemann problem with the initial condition
$\unicode[STIX]{x1D711}(x,t)$
               , we also numerically solve the Riemann problem with the initial condition 
                   $u(x,t=0)=\overline{u}_{0}(x)$
                such that we obtain for
$u(x,t=0)=\overline{u}_{0}(x)$
                such that we obtain for 
                   $t>0$
               ,
$t>0$
               , 
                   $u(x,t)=u_{H.S.}(x,t)$
               . Thus, supposing that the numerical solution
$u(x,t)=u_{H.S.}(x,t)$
               . Thus, supposing that the numerical solution 
                   $u(x,t)$
                of (1.7), (A 1), (A 2) can be put in the form (2.1), we obtain the variations of the wavepacket
$u(x,t)$
                of (1.7), (A 1), (A 2) can be put in the form (2.1), we obtain the variations of the wavepacket 
                   $\unicode[STIX]{x1D711}(x,t)$
                by evaluating the difference
$\unicode[STIX]{x1D711}(x,t)$
                by evaluating the difference 
 $$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}(x,t)=u(x,t)-u_{H.S.}(x,t). & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle \unicode[STIX]{x1D711}(x,t)=u(x,t)-u_{H.S.}(x,t). & & \displaystyle\end{eqnarray}$$
                We then extract from the wavepacket amplitude 
                   $a(x,t)$
               , the position of the wavepacket
$a(x,t)$
               , the position of the wavepacket 
 $$\begin{eqnarray}\displaystyle X(t)={\displaystyle \frac{\displaystyle \int _{-\infty }^{+\infty }\,a^{2}(x,t)\,x\,\text{d}x}{\displaystyle \int _{-\infty }^{+\infty }a^{2}(x,t)\,\text{d}x}}, & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle X(t)={\displaystyle \frac{\displaystyle \int _{-\infty }^{+\infty }\,a^{2}(x,t)\,x\,\text{d}x}{\displaystyle \int _{-\infty }^{+\infty }a^{2}(x,t)\,\text{d}x}}, & & \displaystyle\end{eqnarray}$$
                and from the spatial Fourier transform 
                   $\tilde{\unicode[STIX]{x1D711}}(k,t)={\mathcal{F}}[\unicode[STIX]{x1D711}(x,t)]$
               , the wavepacket dominant wavenumber
$\tilde{\unicode[STIX]{x1D711}}(k,t)={\mathcal{F}}[\unicode[STIX]{x1D711}(x,t)]$
               , the wavepacket dominant wavenumber 
 $$\begin{eqnarray}\displaystyle K(t)={\displaystyle \frac{\displaystyle \int _{-\infty }^{+\infty }|\tilde{\unicode[STIX]{x1D711}}(k,t)|^{2}\,k\,\text{d}k}{\displaystyle \int _{-\infty }^{+\infty }|\tilde{\unicode[STIX]{x1D711}}(k,t)|^{2}\,\text{d}k}}. & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle K(t)={\displaystyle \frac{\displaystyle \int _{-\infty }^{+\infty }|\tilde{\unicode[STIX]{x1D711}}(k,t)|^{2}\,k\,\text{d}k}{\displaystyle \int _{-\infty }^{+\infty }|\tilde{\unicode[STIX]{x1D711}}(k,t)|^{2}\,\text{d}k}}. & & \displaystyle\end{eqnarray}$$
                Note that here, the position (A 4) and the dominant wavenumber (A 5) correspond to average quantities instead of the pointwise maxima of 
                   $a(k,t)$
                and
$a(k,t)$
                and 
                   $\tilde{\unicode[STIX]{x1D711}}(k,t)$
               , respectively, which are not uniquely defined in some situations. When the wavepacket is Gaussian, the quantities (A 4), (A 5) are equivalent to the conventional definitions of the wavepacket position and dominant wavenumber.
$\tilde{\unicode[STIX]{x1D711}}(k,t)$
               , respectively, which are not uniquely defined in some situations. When the wavepacket is Gaussian, the quantities (A 4), (A 5) are equivalent to the conventional definitions of the wavepacket position and dominant wavenumber.
 The ansatz (2.1) proves to be inadequate to describe the variations of 
                   $u(x,t)$
                in the trapping interaction with a DSW. We observe that the field
$u(x,t)$
                in the trapping interaction with a DSW. We observe that the field 
                   $u(x,t)-u_{H.S.}(x,t)$
                no longer corresponds to a quasi-monochromatic wavepacket, and exhibits additional small harmonic excitations as in figure 13. We identify this deviation from unimodality as a local phase shift of the DSW. Indeed, it is known that a soliton interacting with a dispersive wavetrain is phase shifted with respect to its free propagation (Ablowitz & Kodama Reference Ablowitz and Kodama1982), and a similar phenomenon could happen for DSWs which are approximately rank-ordered soliton trains. Thus, a schematic solution of the Riemann problem should read
$u(x,t)-u_{H.S.}(x,t)$
                no longer corresponds to a quasi-monochromatic wavepacket, and exhibits additional small harmonic excitations as in figure 13. We identify this deviation from unimodality as a local phase shift of the DSW. Indeed, it is known that a soliton interacting with a dispersive wavetrain is phase shifted with respect to its free propagation (Ablowitz & Kodama Reference Ablowitz and Kodama1982), and a similar phenomenon could happen for DSWs which are approximately rank-ordered soliton trains. Thus, a schematic solution of the Riemann problem should read 
 $$\begin{eqnarray}\displaystyle u(x,t)=u_{H.S.}(x-\unicode[STIX]{x1D6FF}(x,t),t)+\unicode[STIX]{x1D711}(x,t), & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle u(x,t)=u_{H.S.}(x-\unicode[STIX]{x1D6FF}(x,t),t)+\unicode[STIX]{x1D711}(x,t), & & \displaystyle\end{eqnarray}$$
                where 
                   $\unicode[STIX]{x1D6FF}(x,t)\ll 1$
                corresponds to the small phase shift induced by the wavepacket–DSW interaction. Yet we determine
$\unicode[STIX]{x1D6FF}(x,t)\ll 1$
                corresponds to the small phase shift induced by the wavepacket–DSW interaction. Yet we determine 
                   $\unicode[STIX]{x1D711}(x,t)$
                numerically by computing the difference
$\unicode[STIX]{x1D711}(x,t)$
                numerically by computing the difference 
                   $u(x,t)-u_{H.S.}(x,t)$
                such that
$u(x,t)-u_{H.S.}(x,t)$
                such that 
 $$\begin{eqnarray}\displaystyle u(x,t)-u_{H.S.}(x,t)\approx \unicode[STIX]{x1D711}(x,t)-{\displaystyle \frac{\unicode[STIX]{x2202}u_{H.S.}(x,t)}{\unicode[STIX]{x2202}x}}\unicode[STIX]{x1D6FF}(x,t). & & \displaystyle\end{eqnarray}$$
$$\begin{eqnarray}\displaystyle u(x,t)-u_{H.S.}(x,t)\approx \unicode[STIX]{x1D711}(x,t)-{\displaystyle \frac{\unicode[STIX]{x2202}u_{H.S.}(x,t)}{\unicode[STIX]{x2202}x}}\unicode[STIX]{x1D6FF}(x,t). & & \displaystyle\end{eqnarray}$$
                The shape of the oscillations of this new linear structure seems to correspond qualitatively to 
                   $\unicode[STIX]{x2202}_{x}u_{H.S.}(x,t)$
               , cf. figure 13.
$\unicode[STIX]{x2202}_{x}u_{H.S.}(x,t)$
               , cf. figure 13.

Figure 13. (a) Numerical evolution of the field 
                            $u-u_{H.S.}$
                         and its spatial Fourier transform wavepacket in the trapping interaction with a DSW. (b) The line (——) corresponds to a zoom in of the oscillation emerging to the right of the wavepacket at
$u-u_{H.S.}$
                         and its spatial Fourier transform wavepacket in the trapping interaction with a DSW. (b) The line (——) corresponds to a zoom in of the oscillation emerging to the right of the wavepacket at 
                            $t=1800$
                        . The dots (
$t=1800$
                        . The dots (
                            $\bullet \bullet$
                        ) correspond to the derivative
$\bullet \bullet$
                        ) correspond to the derivative 
                            $\unicode[STIX]{x2202}_{x}u_{H.S.}(x,t)$
                        , rescaled in order to compare with
$\unicode[STIX]{x2202}_{x}u_{H.S.}(x,t)$
                        , rescaled in order to compare with 
                            $u-u_{H.S.}$
                        .
$u-u_{H.S.}$
                        .
The evolution of the wavepacket 
                   $\unicode[STIX]{x1D711}$
                is recovered numerically by eliminating the term corresponding to the DSW phase shift in (A 7). This phase shift contribution can be clearly identified at an early stage of the evolution (
$\unicode[STIX]{x1D711}$
                is recovered numerically by eliminating the term corresponding to the DSW phase shift in (A 7). This phase shift contribution can be clearly identified at an early stage of the evolution (
                   $t\sim 10^{-3}$
               ) as the non-adiabatic generation of harmonic excitations in the spatial Fourier transform of
$t\sim 10^{-3}$
               ) as the non-adiabatic generation of harmonic excitations in the spatial Fourier transform of 
                   $u-u_{H.S.}$
               . The filtered signal of figure 13 is displayed in figure 12. It is surprising that, even if the DSW dynamics is slightly perturbed by the wavepacket’s propagation, the wavepacket dynamics is well described by the theory developed here, which confirms, once again, the mean field assumption for wavepacket–DSW interaction.
$u-u_{H.S.}$
               . The filtered signal of figure 13 is displayed in figure 12. It is surprising that, even if the DSW dynamics is slightly perturbed by the wavepacket’s propagation, the wavepacket dynamics is well described by the theory developed here, which confirms, once again, the mean field assumption for wavepacket–DSW interaction.
 
 













