1 Introduction

The dynamics of shallow water wave equations can be modeled by the nonlinear dispersive wave equation, for example, the nonlinear Korteweg–de Vries (KdV) equation

$$\begin{aligned} u_t+u_x+u_{xxx}+uu_x=0, \end{aligned}$$

which has been used in a wide range of applications [1]. In 1972, Benjamin et al. [2] proposed an improved version of the KdV equation that also models long shallow water waves of small amplitude, known as the Benjamin–Bona–Mahony (BBM) equation

$$\begin{aligned} u_t+u_x-u_{xxt}+uu_x=0. \end{aligned}$$

The BBM equation is obtained by replacing the third-order term \(u_{xxx}\) in the KdV equation with a mixed derivative term \(u_{xxt}\), and demonstrates some attractive features that the KdV equation lacks, one specific example being better dispersion properties resulting in improved stability of the high wavenumber components. The BBM equation describes the unidirectional propagation of surface water in a nonlinear dispersive medium with small amplitude and long wave [2], and has been used in the analysis of hydromagnetic waves in cold plasma, acoustic-gravity waves in compressible fluids and acoustic waves in harmonic crystals [3]. Due to its wide applications and rich dynamics, researchers have developed many different forms of BBM equations which are usually called generalized BBM equations, see [4, 5] and the references therein.

In this paper, we consider the BBM equation taking the form of

$$\begin{aligned} u_t-\varepsilon u_{xxt}+uu_x=0, \end{aligned}$$
(1.1)

on the interval \(I=[x_l,x_r]\), with the periodic boundary condition

$$\begin{aligned} u(x_l,t)=u(x_r,t), \end{aligned}$$
(1.2)

and the initial condition

$$\begin{aligned} u(x,0)=u_0(x), \end{aligned}$$
(1.3)

where \(\varepsilon >0\) is a given real number. The BBM equation possesses the cnoidal-wave solutions of the form

$$\begin{aligned} u(x,t;C,D,m)=\frac{3m C}{(2m-1)} cn^2\left( \frac{1}{2\sqrt{(2m-1)\varepsilon }} (x-C t-D);m\right) \end{aligned}$$
(1.4)

where \({{\,\mathrm{cn}\,}}(z;m)\) is the Jacobi elliptic function with modulus \(m\in (0,1)\) (see [6]). \(C>0\) is the speed of propagation of the solitary wave, and D is an arbitrary, real translation. The period of cnoidal-wave solutions is 2K(m)/B, where K(m) is the complete elliptic integral of the first kind and \(B= \frac{1}{2\sqrt{(2m-1)\varepsilon }}\). It is well known that the BBM equation possesses two invariant quantities: the mass M(t) and energy E(t), defined by

$$\begin{aligned} M(t):= \int _I u(x,t) dx, \end{aligned}$$
(1.5)

and

$$\begin{aligned} E(t):=\int _I \left( u^2(x,t)+\varepsilon u_x^2(x,t)\right) dx. \end{aligned}$$
(1.6)

There have been a wide range of theoretical work available for the BBM equation. Here we briefly review a few of them. The global existence, uniqueness and stability of the solutions of one-dimensional BBM equation were studied in [2]. The result was extended in [7, 8] to multi-dimensional cases. The existence and uniqueness of the periodic solutions was discussed in [9], and that of the solitary wave solutions was studied in [10]. Numerical solutions of the BBM equation have been studied by many researchers. We refer to [5, 11, 12] for the studies of the convergence analysis of various finite difference and finite element methods proposed for the BBM equation. High order scheme based on the local discontinuous Galerkin (LDG) finite element method has been presented in [13, 14] for one class of Sobolev equations which includes the BBM equation. Numerical stability, as well as the optimal error estimate when upwind nonlinear numerical flux was used, were studied in these papers. Another set of LDG method was proposed in [15] for the KdV–BBM equation. In [16], LDG methods with two different sets of numerical fluxes to either preserve or dissipate energy was proposed for the Boussinesq coupled BBM system, and optimal error estimate was provided for the linearized equations.

We confine our discussion on the high order discontinuous Galerkin (DG) method [17,18,19,20,21] in this paper. It is a class of finite element methods using completely discontinuous piecewise polynomial basis functions, and inherits the benefits of both finite element and finite volume methods. Advantages of DG methods are many, including the flexibility for hp-adaptivity, efficient parallel implementation, the local conservativity, the ability for easy handling of complicated geometries and boundary conditions, and easy coordination with finite volume techniques, making the methods very attractive in a wide range of applications. The LDG methods were proposed by Cockburn and Shu in [22] to numerically solve partial differential equations (PDEs) containing high order spatial derivatives terms, and we refer to the review paper [23] for the development of LDG methods. Recently, there have been many studies in designing DG and LDG methods which can conserve the energy or Hamiltonian structure of the model in the discrete level. Energy conserving LDG methods have been designed for the generalized KdV equation [24,25,26,27], the second order wave equation [28, 29], the two-way wave equation [30], the Camassa–Holm equation [31], the Degasperis-Procesi equation [32], the nonlinear Schrödinger equation [33, 34] and the improved Boussinesq equation [35].

In this paper, we develop, analyze and numerically validate two classes of LDG methods for solving the nonlinear BBM equation. By introducing one auxiliary variable, and with appropriately chosen numerical fluxes, the conventional LDG methods can be shown to preserve the discrete version of mass, and either preserve or dissipate the discrete version of energy of the continuous solution, up to the round-off level, which leads to the numerical stability automatically. The proposed LDG method takes a different formulation from that in [13], where three auxiliary variables were introduced for discretize the high order derivative term. Our method is closer to the one in [15], but with a wide choice of numerical fluxes to derive both energy conserving and dissipative methods. One main contribution of this paper is to provide an optimal a priori error estimate for both the semi-discrete energy conserving and energy dissipative methods applied to the nonlinear BBM equation. In [13, 15], optimal error estimate has been obtained for the upwind nonlinear numerical fluxes only, and the same analysis cannot be extended to the energy conserving methods presented here. Few work has been done in the literature on providing optimal error estimate for the energy conserving methods applied to nonlinear equations. To achieve this goal, we discover the connection between the error of the auxiliary and primary variables, and use this connection to bound the nonlinear term by the auxiliary variable. Fully discrete methods can be derived by coupling with energy-conserving implicit midpoint temporal discretization. Numerical experiments confirm the optimal rates of convergence, as well as the mass and energy conserving/dissipative property. The comparison of the long time behavior of the energy conserving and energy dissipative methods are also provided, to show that the energy conserving method produces a better approximation to the exact solution, especially for long time simulation and when polynomial degree k is small.

Recently, based on the idea of doubling the unknown functions via introducing auxiliary zero functions, optimal energy conserving DG methods have been presented for linear symmetric hyperbolic systems by Fu and Shu in [36]. The same idea has been extended in [37] to provide an energy conserving ultra-weak DG method for the KdV equation, where comparison with existing energy conserving or dissipative DG methods have been provided to demonstrate the better performance of the new developed optimal energy conserving DG methods. At the end of the paper, another class of energy conserving LDG methods, based on this doubling-the-unknowns technique in [36], is also constructed for the nonlinear BBM equation. We investigate their energy conservation property and optimal convergence rate via a special constructed numerical projection. We also provide a comparison of these two types of energy conserving LDG methods presented in this paper, and under the same setup of computational elements, the latter method is shown to have a smaller numerical error with only slightly longer computational time.

Another motivation of the study of the energy conserving methods for the BBM equation originates from our recent work in [31], where the energy conserving LDG method for the Camassa–Holm equation was investigated. In [31, Figure 2], the comparison of numerical solutions by the energy conserving and dissipative methods with the exact solution is provided, where we can observe a smaller phase error of the energy conserving methods, but the improvement in terms of the phase error is not as good as that for the KdV [24] and Degasperis-Procesi [32] equations. This phenomenon was also mentioned in [31]. We expect this study of energy conserving methods for the simpler BBM equation provides us some insights on this matter, and we will discuss our observation in the numerical experiment section.

The organization of the paper is as follows. In Sect. 2, we present the LDG method for the nonlinear BBM equation, and show that energy conserving or dissipative methods can be obtained by choosing appropriate parameters and fluxes. The optimal error estimate of the proposed methods is provided. Energy conserving temporal discretization is presented to obtain fully discrete methods, which are shown to preserve the discrete version of mass, and either preserve or dissipate the discrete version of energy of the continuous solution, up to the round-off level. Numerical results are provided in Sect. 3 to show the order of accuracy, the mass and energy conservation property and long time behavior of the LDG numerical solutions. In Sect. 4, we introduce another class of energy conserving LDG methods based on doubling-the-unknowns technique, recently proposed in [36]. Energy conserving property and optimal error estimate of these methods have been studied. In Sect. 5, numerical tests are provided to show the performance of the second class of energy conserving method, as well as the numerical comparison of these two classes of LDG methods. Conclusion remarks are presented in Sect. 6.

2 The LDG Method

In this section, we start by applying the conventional LDG method to the BBM equation, and show that the energy conserving/dissipative methods can be achieved with suitable choices of numerical fluxes. The proof of optimal error estimate for the proposed energy conserving/dissipative LDG method applied to the nonlinear BBM equation is also provided, and we end the section by presenting the temporal discretization which is also energy conserving.

2.1 Notations

We divide the computational domain \(I=[x_l,x_r]\) into J subintervals and denote the cells by \(I_j=[x_{j-\frac{1}{2}},x_{j+\frac{1}{2}}]\) for \(j=1,2,\ldots ,J\). The center of each cell is \(x_j=\frac{1}{2}(x_{j+\frac{1}{2}}+x_{j-\frac{1}{2}})\), and the mesh size is denoted by \(h_j=x_{j+\frac{1}{2}}-x_{j-\frac{1}{2}}\) with \(h=\max h_j\) for \(j=1,2,\ldots ,J\) being the maximal mesh size. We assume that the mesh is regular, namely, the ratio between the maximal and the minimal mesh sizes stays bounded during mesh refinement. The piecewise polynomial space \(V_h^k\) is defined as the space of polynomials of degree up to k in each cell \(I_j\), that is,

$$\begin{aligned} V_h^k=\{v:v|_{I_j}\in P^k(I_j), j=1,2,\ldots ,J\}. \end{aligned}$$

The solution of the numerical scheme is denoted by \(u_h\), which belongs to the finite element space \(V^k_h\). We denote by \((u_h)^+_{j+\frac{1}{2}}\) and \((u_h)^-_{j+\frac{1}{2}}\) the limit values of \(u_h\) at \(x_{j+\frac{1}{2}}\) from the right cell \(I_{j+1}\) and from the left cell \(I_{j}\), respectively. We use the usual notations

$$\begin{aligned}{}[u_h]=u^+_h-u^-_h, \quad \{u_h\}=\frac{1}{2}(u^+_h+u^-_h) \end{aligned}$$

to respectively represent the jump and the mean of the function \(u_h\) at the element interfaces, for which we have the following equalities summarized in the lemma.

Lemma 2.1

Assuming \(u_h\), \(v_h\)\(\in V_h^k\), we have the equalities

$$\begin{aligned}{}[u_hv_h]_{j+\frac{1}{2}}= \left\{ \begin{aligned}&\left( u_h^+[v_h]+[u_h]v_h^-\right) _{j+\frac{1}{2}}, \\&\left( u_h^-[v_h]+[u_h]v_h^+\right) _{j+\frac{1}{2}},\\&\left( \{u_h\}[v_h]+[u_h]\{v_h\}\right) _{j+\frac{1}{2}}. \end{aligned} \right. \end{aligned}$$

If u is continuous at the point \(x_{j+\frac{1}{2}}\), we have \(\{u\}_{j+\frac{1}{2}}=u_{j+\frac{1}{2}}\), \([u]_{j+\frac{1}{2}}=0\), and the above equality reduces to

$$\begin{aligned}{}[uv_h]_{j+\frac{1}{2}}=(u[v_h])_{j+\frac{1}{2}}. \end{aligned}$$

For a shorthand notation, the inner product is denoted by \((w,v)_j = \int _{I_j} wvdx\) for the scalar variables wv. Finally, we provide the definition of various norms that will be used in the rest of the paper.

  • \(\Vert v\Vert \): the \(L^2\) norm of a function \(v \in L^2(I)\);

  • \(\Vert v\Vert _{\infty }\): the \(L^{\infty }\) norm of a function \(v \in L^2(I)\);

  • \(\Vert v\Vert _{\Gamma _h}=\sqrt{\sum \nolimits _{j=1}^J\left( v^2(x^+_{j+\frac{1}{2}})+v^2(x^-_{j+\frac{1}{2}})\right) }\): the norm defined on the element interfaces;

  • \(|[v]|=\sqrt{\sum \nolimits _{j=1}^J[v]^2_{j-\frac{1}{2}}}\): the so called “jump semi-norm”.

2.2 The Semi-discrete LDG Method

To derive the LDG discretization of the BBM Eq. (1.1), we introduce the auxiliary variable \(v=u_x\) and rewrite the equation as

$$\begin{aligned} \left\{ \begin{aligned}&u_t-\varepsilon v_{xt}+f(u)_x=0,\\&v=u_x, \end{aligned} \right. \end{aligned}$$
(2.1)

where \(f(u)=u^2/2\) is the flux term. The LDG spatial discretization of the system (2.1) is given as follows: we seek \(u_h\) and \(v_h\): \([0,T]\rightarrow V^k_h\), the numerical approximations of u and v, such that the variation forms

$$\begin{aligned}&(u_{h,t},\phi _1)_j+\varepsilon \mathcal {H}_j^*(v_{h,t},\phi _1;\widehat{v_{h,t}})-\mathcal {F}_j^*(u_h,\phi _1;{\widehat{f}}\,)=0, \end{aligned}$$
(2.2a)
$$\begin{aligned}&(v_h,\phi _2)_j+\mathcal {H}_j^*(u_h,\phi _2;\widehat{u_h})=0, \end{aligned}$$
(2.2b)

hold in each cell \(I_j\), \(j=1,2,\ldots ,J\), for any test function \(\phi _1, \phi _2\in V^k_h\). The bilinear forms in the Eq. (2.2) are defined as

$$\begin{aligned}&\mathcal {H}_j^*(\varphi ,\psi ;{\widehat{\varphi }})=(\varphi ,\psi _x)_j-({\widehat{\varphi }}\psi ^-)_{j+\frac{1}{2}}+({\widehat{\varphi }}\psi ^+)_{j-\frac{1}{2}}, \end{aligned}$$
(2.3)
$$\begin{aligned}&\mathcal {F}_j^*(\varphi ,\psi ;{\widehat{f}})=(f(\varphi ),\psi _x)_j-({\widehat{f}}\psi ^-)_{j+\frac{1}{2}}+({\widehat{f}}\psi ^+)_{j-\frac{1}{2}}, \end{aligned}$$
(2.4)

where the hatted terms, \(\widehat{u_h}\), \({\widehat{f}}\) and \(\widehat{v_{h,t}}\) in the Eq. (2.2), are the so-called numerical fluxes, defined on the numerical solutions values at the element interfaces. We will specify how to choose these numerical fluxes later. For the bilinear forms \(\mathcal {H}_j^*\), we have following observations:

Lemma 2.2

Assuming \(\varphi \), \(\psi \)\(\in V_h^k\) are both periodic functions, the following equalities hold

$$\begin{aligned} \sum _{j=1}^J \mathcal {H}_j^*(\varphi ,\psi ;{\widehat{\varphi }})_j=\sum _{j=1}^J (\varphi ,\psi _x)_j+\sum _{j=1}^J ({\widehat{\varphi }}[\psi ])_{j-\frac{1}{2}}, \end{aligned}$$
(2.5)

and

$$\begin{aligned} \sum _{j=1}^J \left( \mathcal {H}_j^*(\varphi ,\psi ;{\widehat{\varphi }})_j+\mathcal {H}_j^*(\psi ,\varphi ;{\widehat{\psi }}\,)_j\right) = \left\{ \begin{aligned}&\sum _{j=1}^J \left( ({\widehat{\varphi }}-\varphi ^+)[\psi ]+({\widehat{\psi }}-\psi ^-)[\varphi ]\right) _{j-\frac{1}{2}},\\&\sum _{j=1}^J \left( ({\widehat{\varphi }}-\varphi ^-)[\psi ]+({\widehat{\psi }}-\psi ^+)[\varphi ]\right) _{j-\frac{1}{2}},\\&\sum _{j=1}^J \left( ({\widehat{\varphi }}-\{\varphi \})[\psi ]+({\widehat{\psi }}-\{\psi \})[\varphi ]\right) _{j-\frac{1}{2}}. \end{aligned} \right. \end{aligned}$$
(2.6)

Proof

The Eq. (2.5) follows directly from the definition (2.3) and the periodicity of \(\varphi \), \(\psi \). From the integration by parts and the periodicity, we have

$$\begin{aligned} \sum _{j=1}^J(\varphi ,\psi _x)_j=-\sum _{j=1}^J(\varphi _x,\psi )_j-\sum _{j=1}^J[\varphi \psi ]_{j-\frac{1}{2}}. \end{aligned}$$
(2.7)

Therefore, the Eq. (2.6) can be obtained from the combination of the Eqs. (2.5), (2.7) and Lemma 2.1. \(\square \)

The next theorem shows that the LDG methods (2.2) ensure the conservation of the total mass.

Theorem 2.1

Let \(u_h\), \(v_h\) be the solutions of scheme (2.2) with any choice of consistent numerical fluxes, and define the discrete mass as

$$\begin{aligned} M_h(t)=\sum _{j=1}^{J}\int _{I_j}u_hdx, \end{aligned}$$

then we have

$$\begin{aligned} M_h(t)=M_h(0). \end{aligned}$$

Proof

By taking the test function \(\phi _1=1\) in the first equation of (2.2) and summing up over all cells, we have

$$\begin{aligned}&\sum _{j=1}^{J}(u_{h,t},1)_j+\varepsilon \sum _{j=1}^{J}\mathcal {H}_j^*(v_{h,t},1;\widehat{v_{h,t}})-\sum _{j=1}^{J}\mathcal {F}_j^*(u_h,1;{\widehat{f}})=0. \end{aligned}$$

It is easy to see that

$$\begin{aligned} \sum _{j=1}^{J}(u_{h,t},1)_j&=\frac{1}{2} \frac{d}{dt} M_h(t),\\ \sum _{j=1}^{J}\mathcal {H}_j^*(v_{h,t},1;\widehat{v_{h,t}})&=\sum _{j=1}^{J}(v_{h,t}, 0)_j+\sum _{j=1}^J ({\widehat{v}}_{h,t}[1])_{j-\frac{1}{2}}=0, \\ \sum _{j=1}^{J}\mathcal {F}_j^*(u_h,1;{\widehat{f}}\,)&=\sum _{j=1}^{J}(f(u_{h}), 0)_j+\sum _{j=1}^J ({\widehat{f}}[1])_{j-\frac{1}{2}}=0. \end{aligned}$$

Therefore we obtain

$$\begin{aligned} \frac{d}{dt} M_h(t)=0. \end{aligned}$$

which leads to \(M_h(t)=M_h(0)\). \(\square \)

In order to find numerical fluxes that conserve or dissipate the total energy E(t) at the semi-discrete level, we start with the following result:

Lemma 2.3

Let \(u_h\), \(v_h\) be the numerical solutions of the LDG methods (2.2), the following energy equation holds

$$\begin{aligned} \begin{aligned}&\frac{1}{2}\frac{d}{dt}\sum _{j=1}^{J}\int _{I_j}\left( u_h^2+\varepsilon v_h^2\right) dx+\sum _{j=1}^{J}\left( [F(u_h)]-{\widehat{f}}[u_h]\right) _{j-\frac{1}{2}}\\&\qquad +\varepsilon \sum _{j=1}^{J} \left( (\widehat{v_{h,t}}-v^*_{h,t})[u_h]+(\widehat{u_{h}}-u^*_{h})[v_{h,t}]\right) _{j-\frac{1}{2}}=0, \end{aligned} \end{aligned}$$
(2.8)

where \(F(u)=\int ^u f(s) ds\) and the pair \(\langle u^*_{h},v^*_{h,t} \rangle _{j-\frac{1}{2}}\) can be any choice from the sets \(\langle u^+_{h},v^-_{h,t}\rangle _{j-\frac{1}{2}}\), \(\langle u^-_{h},v^+_{h,t}\rangle _{j-\frac{1}{2}}\) and \(\langle \{u_{h}\},\{v_{h,t}\}\rangle _{j-\frac{1}{2}}\) for any j.

Proof

By taking \(\phi _1=u_h\) and \(\phi _2=\varepsilon v_{h,t}\) in (2.2), adding those two equations and then summing up over all cells, we have

$$\begin{aligned} \begin{aligned}&\sum _{j=1}^{J}\left( (u_{h,t},u_h)_j+\varepsilon (v_h,v_{h,t})_j\right) - \sum _{j=1}^{J}\mathcal {F}_j^*(u_h,u_h;{\widehat{f}})\\&\qquad +\varepsilon \sum _{j=1}^{J}\left( \mathcal {H}_j^*(v_{h,t},u_h;\widehat{v_{h,t}})+\mathcal {H}_j^*(u_h,v_{h,t};\widehat{u_h}) \right) =0. \end{aligned} \end{aligned}$$

The first two terms can be rewritten as

$$\begin{aligned} \sum _{j=1}^{J}\left( (u_{h,t},u_h)_j+\varepsilon (v_h,v_{h,t})_j\right) =\frac{1}{2}\frac{d}{dt}\sum _{j=1}^{J}\int _{I_j}\left( u_h^2+\varepsilon v_h^2\right) dx. \end{aligned}$$

By applying Lemma 2.2, we can obtain

$$\begin{aligned} \begin{aligned}&\sum _{j=1}^{J}\left( \mathcal {H}_j^*(v_{h,t},u_h;\widehat{v_{h,t}})+\mathcal {H}_j^*(u_h,v_{h,t};\widehat{u_h})\right) \\&\quad =\sum _{j=1}^{J}\int _{I_j}\left( (\widehat{v_{h,t}}-v^*_{h,t})[u_h]+(\widehat{u_{h}}-u^*_{h})[v_{h,t}]\right) _{j+\frac{1}{2}}, \end{aligned} \end{aligned}$$

with the choice of the pair \(\langle u^*_{h},v^*_{h,t} \rangle _{j-\frac{1}{2}}\) stated in the theorem, and

$$\begin{aligned} \begin{aligned}&\sum _{j=1}^{J}\mathcal {F}_j^*(u_h,u_h;{\widehat{f}}(u_h))=\sum _{j=1}^J (f(u_h),u_{h,x})_j+\sum _{j=1}^J ({\widehat{f}}\,[u_h])_{j-\frac{1}{2}}\\&\qquad =\sum _{j=1}^J F(u_h)\big |_{\partial I_j}+\sum _{j=1}^J ({\widehat{f}}\,[u_h])_{j-\frac{1}{2}} =-\sum _{j=1}^{J}\left( [F(u_h)]-{\widehat{f}}\,[u_h]\right) _{j+\frac{1}{2}}. \end{aligned} \end{aligned}$$

The combination of all these equations above leads to the energy Eq. (2.8). \(\square \)

Motivated by this lemma, the following choices of numerical fluxes have been investigated in this paper. For the pair of the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\), we choose them to be

$$\begin{aligned} \left\{ \begin{aligned}&\widehat{v_{h,t}}=v^*_{h,t}+c_u[u_h],\\&\widehat{u_{h}}=u^*_{h}, \end{aligned} \right. \end{aligned}$$
(2.9)

where \(c_u\ge 0\) and \(( u^*_{h}, v^*_{h,t} )\) can be either \(( \cdot ^+,\cdot ^- )\) or \(( \cdot ^-,\cdot ^+ )\). Recently, there have been some studies on upwind-biased fluxes for approximating the first order derivative term [38], and generalized alternating numerical fluxes [39] for approximating the diffusion term. The term \(( u^*_{h}, v^*_{h,t} )\) can also be extended to the generalized alternating numerical fluxes in the form of

$$\begin{aligned} \left( \{u_h\}-\alpha [u_h],\{v_{h,t}\} +\alpha [v_{h,t}]\right) , \end{aligned}$$
(2.10)

which won’t affect the energy conserving/dissipative property of the resulting methods. For the nonlinear advection term \(f(u)=\frac{1}{2}u^2\), we can choose either the conservative flux

$$\begin{aligned} {\widehat{f}}(u^-,u^+)=\frac{1}{u^+-u^-}\int _{u^-}^{u^+}f(s)ds=\frac{1}{6}\left( (u^+)^2+(u^-)^2+{u^+}{u^-}\right) , \end{aligned}$$
(2.11)

or the standard local Lax-Friedrichs flux

$$\begin{aligned} {\widehat{f}}(u^-,u^+)=\frac{(u^+)^2+(u^-)^2}{4}-\frac{\max (|u^+|,|u^-|)}{2}[u]. \end{aligned}$$
(2.12)

It is easy to observe that the conservative flux (2.11) satisfies

$$\begin{aligned} {\widehat{f}}(u,u)=f(u)=\frac{1}{2}u^2, \qquad \sum _{j=1}^{J}\left( [F(u_h)]-{\widehat{f}}(u_h)[u_h]\right) _{j+\frac{1}{2}}=0, \end{aligned}$$

where \(F(u)=u^3/6\). The Lax-Friedrichs flux (2.12) is a nondecreasing function of its first argument, and a nonincreasing function of its second argument, and satisfies

$$\begin{aligned} {\widehat{f}}(u,u)=f(u)=\frac{1}{2}u^2, \qquad \sum _{j=1}^{J}\left( [F(u_h)]-{\widehat{f}}(u_h)[u_h]\right) _{j+\frac{1}{2}}\ge 0. \end{aligned}$$

With these choices of numerical fluxes, the following observation on energy conservation or energy dissipation holds, as a result of Lemma 2.3.

Theorem 2.2

Let \(u_h\), \(v_h\) be the numerical solutions of LDG scheme (2.2), with the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) chosen as (2.9) with \(c_u=0\), and the numerical flux of the nonlinear term \({\widehat{f}}\) chosen as (2.11). The following energy conservation property holds

$$\begin{aligned} E_{h}(t)\doteq \int _I \left( u_h^2(x,t)+\varepsilon v_{h}^2(x,t)\right) dx =E_{h}(0). \end{aligned}$$

Theorem 2.3

Let \(u_h\), \(v_h\) be the numerical solutions of LDG scheme (2.2), with the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) chosen as (2.9) with \(c_u\ge 0\), and the numerical flux of the nonlinear term \({\widehat{f}}\) chosen as either (2.11) or (2.12). The following energy dissipative property holds

$$\begin{aligned} E_{h}(t_1) \le E_{h}(t_2) \le E_{h}(0), \quad \forall \ t_1\ge t_2 \ge 0. \end{aligned}$$
(2.13)

Remark 2.1

Another popular choice of energy conserving numerical fluxes is the central flux, that can be define as

$$\begin{aligned} \widehat{v_{h}}=\{v_{h}\}, \qquad \widehat{u_{h}}=\{u_{h}\}, \qquad {\widehat{f}}(u^-,u^+) \text { chosen as } 2.11. \end{aligned}$$

The LDG scheme (2.2) combined with this set of numerical fluxes exhibit suboptimal convergence rate, which will be observed in the accuracy numerical tests.

Remark 2.2

In [13], LDG methods are derived for the BBM Eq. (1.1) based on an equivalent formulation

$$\begin{aligned} \left\{ \begin{aligned}&u_t=w,\\&w+\left( f(u)-\varepsilon p\right) _x=0,\\&p-w_x=0, \end{aligned} \right. \end{aligned}$$
(2.14)

with two auxiliary variables w and p. Its difference to our approach lies in the discretization of the term \(u_{xxt}\) which is linear. Therefore, if the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) take the same form as \((\widehat{w_h}, \widehat{p_{h}})\) [in the discretization of (2.14)], and the same nonlinear numerical flux \({\widehat{f}}\) is used, these two LDG methods can be shown to be equivalent, after all these auxiliary variables are eliminated and only one final equation to update \(u_h\) is obtained. Energy dissipative methods have been discussed in [13]. More choices of numerical fluxes, leading to energy conserving or dissipative methods, are discussed in this paper, as well as the optimal error estimate for these fluxes which requires some new analytical tools to be discussed in the following section.

2.3 Optimal Error Estimate

In this section, we derive the optimal error estimate for the LDG scheme (2.2), with the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) chosen as (2.9) with \(c_u\ge 0\), and the numerical flux of the nonlinear term \({\widehat{f}}(u^-,u^+)\) chosen as either (2.11) or (2.12). In other words, optimal error estimate will be provided for both energy conserving and energy dissipative LDG methods.

We start by defining the following errors associated with a function f

$$\begin{aligned} e_f =f - f_h=\eta _f-\xi _f, \qquad \eta _f = f - \pi ^f f, \qquad \xi _f =f_h - \pi ^f f , \end{aligned}$$

which from left to right, denote the error between the exact solution f and the numerical solution \(f_h\), the projection error between f and a particular projection \(\pi ^f\) of f, and the error between the numerical solution and the projection of f, respectively.

Some projection operators considered in this paper are defined as follows. We use \(\pi \) to denote the standard \(L^2\) projection of a function \(\omega \) into the space \(V_h^k\), satisfying

$$\begin{aligned} (\pi \omega , \phi )_j = (\omega , \phi )_j, \quad \forall \phi \in P^{k}(I_j). \end{aligned}$$

We use \(\pi ^-\) to denote the Radau projection of \(\omega \) into the space \(V_h^k\), satisfying

$$\begin{aligned} (\pi ^-\omega , \phi )_j&= (\omega , \phi )_j, \quad \forall \phi \in P^{k-1}(I_j),\\ (\pi ^-\omega )^-&= \omega ^-, \quad \text {at }x_{j+\frac{1}{2}}. \end{aligned}$$

Similarly, the projection \(\pi ^+\) of \(\omega \) is defined as:

$$\begin{aligned} (\pi ^+\omega , \phi )_j&= (\omega , \phi )_j, \quad \forall \phi \in P^{k-1}(I_j),\\ (\pi ^+\omega )^+&= \omega ^+, \quad \text {at }x_{j-\frac{1}{2}}. \end{aligned}$$

For these three projections, we have the following approximation property [28, 40]:

$$\begin{aligned} \Vert \pi ^f f - f\Vert ^2+h \Vert \pi ^f f - f\Vert _{\Gamma _h}^2 + h^2 \Vert \pi ^f f - f\Vert _{\infty }^2 \le Ch^{2k+2}, \end{aligned}$$
(2.15)

where \(\pi ^f=\pi \), \(\pi ^\pm \) and the constant C depends on f but is independent of h. For our problem, we choose the projections of the solutions u and v to be:

$$\begin{aligned} \pi ^v=\pi , \qquad \pi ^u= \left\{ \begin{array}{ll} \pi ^+, &{}\quad \text {if}\ \widehat{{u_h}}=u_h^+,\\ \pi ^-, &{}\quad \text {if}\ \widehat{{u_h}}=u_h^-. \end{array} \right. \end{aligned}$$
(2.16)

Moreover, for all \(v\in V_h^k\) the following inverse inequalities holds

$$\begin{aligned}&\Vert v_x\Vert \le C h^{-1} \Vert v\Vert , \end{aligned}$$
(2.17)
$$\begin{aligned}&\Vert v\Vert _{\Gamma _h}\le C h^{-1/2} \Vert v\Vert , \end{aligned}$$
(2.18)
$$\begin{aligned}&\Vert v\Vert _{\infty }\le C h^{-1/2} \Vert v\Vert . \end{aligned}$$
(2.19)

Before we present the main result on the optimal error estimate of the LDG scheme, let us start by providing some useful lemmas.

Lemma 2.4

Suppose \((u_h,v_h)\in V_h^k\times V_h^k\) satisfy the Eq. (2.2b) with the flux \(\widehat{u_h}=u_h^-\) or \(\widehat{u_h}=u_h^+\), and the projections (2.16) are used, then there exists a positive constant C independent of h such that

$$\begin{aligned} \Vert \xi _{u,x}\Vert +h^{-1/2}|[\xi _u]|\le C\Vert \xi _v\Vert . \end{aligned}$$
(2.20)

Remark 2.3

This Lemma provides an important relationship between the error of the auxiliary variable and the primary variable. In [41, Lemma 2.4], similar result on the variable instead of the error

$$\begin{aligned} \Vert u_{h,x}\Vert +h^{-1/2}|[u_h]|\le C\Vert v_h\Vert , \end{aligned}$$

has been obtained, and the main body of our proof follows that in [41].

Proof

Without loss of generality, we assume \(\widehat{u_h}=u_h^+\), and the proof of the other case \(\widehat{u_h}=u_h^-\) follows the same idea. From (2.2b) and (2.3), we have

$$\begin{aligned} -(v_h,\phi )_j=\mathcal {H}_j^*(u_h,\phi ;\widehat{u_h})=(u_h,\phi _x)_j-(\widehat{u_h}\phi ^-)_{j+\frac{1}{2}}+(\widehat{u_h}\phi ^+)_{j-\frac{1}{2}}, \end{aligned}$$

and the same equation is satisfied by the exact solutions u and v. Taking the difference yields the error equation

$$\begin{aligned} \begin{aligned} -(e_v,\phi )_j=-(\xi _v+\eta _v,\phi )_j&=(e_u,\phi _x)_j-(\widehat{e_u}\phi ^-)_{j+\frac{1}{2}}+(\widehat{e_u}\phi ^+)_{j-\frac{1}{2}} \\&=(\xi _u+\eta _u,\phi _x)_j-\big ((\widehat{\xi _u}+\widehat{\eta _u})\phi ^-\big )_{j+\frac{1}{2}}+\big ((\widehat{\xi _u}+\widehat{\eta _u})\phi ^+\big )_{j-\frac{1}{2}}. \end{aligned} \end{aligned}$$

By utilizing the definition of the projections \(\pi \) and \(\pi ^\pm \), we have

$$\begin{aligned} \begin{aligned} -(\xi _v,\phi )_j&=(\xi _u,\phi _x)_j-\big (\widehat{\xi _u}\phi ^-\big )_{j+\frac{1}{2}}+\big (\widehat{\xi _u}\phi ^+\big )_{j-\frac{1}{2}} \\&=-(\xi _{u,x},\phi )_j+\big (\xi _u^--\widehat{\xi _u}\big )\phi ^-\big |_{j+\frac{1}{2}}-\big (\xi _u^+-\widehat{\xi _u}\big )\phi ^+\big |_{j-\frac{1}{2}}\\&=-(\xi _{u,x},\phi )_j-[\xi _u]\phi ^-\big |_{j+\frac{1}{2}}, \end{aligned} \end{aligned}$$
(2.21)

where the integration by parts and \(\widehat{\xi _u}=\xi _u^+\) are used.

The rest of the proof follows that of [41, Lemma 2.4], and we only sketch the main idea below. Let \(L_k\) be the standard Legendre polynomial of degree k in \([-1,1]\), we have \(L_k(1)=1\) and \(L_k\) is orthogonal to any polynomials with degree less or equal to \(k-1\). First, we take the test function \(\phi \) as

$$\begin{aligned} \phi (x)\big |_{I_j}=\xi _{u,x}(x)- \xi _{u,x}(x^-_{j+\frac{1}{2}})L_k(\theta ), \end{aligned}$$

with \(\theta =2(x-x_j)/h_j\). Therefore, the Eq. (2.21) reduces to

$$\begin{aligned} \begin{aligned} \Vert \xi _{u,x}\Vert _{I_j}^2\doteq (\xi _{u,x},\xi _{u,x})_j&= -(\xi _{u,x},\phi )_j-[\xi _u]\phi ^-\big |_{j+\frac{1}{2}}\\&=-(\xi _v,\phi )_j\le \Vert \xi _v\Vert _{I_j}\Vert \phi \Vert _{I_j} \le C \Vert \xi _v\Vert _{I_j}\Vert \xi _{u,x}\Vert _{I_j}, \end{aligned} \end{aligned}$$

which leads to

$$\begin{aligned} \Vert \xi _{u,x}\Vert _{I_j}\le C \Vert \xi _v\Vert _{I_j}. \end{aligned}$$
(2.22)

Next, we take \(\phi =1\) in (2.21) to obtain

$$\begin{aligned} h^{-\frac{1}{2}}{[\xi _u]}_{j+\frac{1}{2}}=h^{-\frac{1}{2}}\left( (\xi _v,1)_j-(\xi _{u,x},1)_j\right) \le h^{-\frac{1}{2}}\Vert 1\Vert _{I_j}(\Vert \xi _v\Vert _{I_j}+\Vert \xi _{u,x}\Vert _{I_j})\le C\Vert \xi _v\Vert _{I_j},\nonumber \\ \end{aligned}$$
(2.23)

by the Cauchy–Schwarz inequality and (2.22). Finally, by summing up (2.22) and (2.23) over all elements, we get the desired result (2.20). \(\square \)

Remark 2.4

To deal with the nonlinear term, we would like to make an a priori error estimate assumption between numerical solution \(u_h\) and exact solution u

$$\begin{aligned} \left\Vert u-u_h\right\Vert \le h, \end{aligned}$$

following the setup in [40, 42], where the same technique is used to treat the nonlinearity in the KdV and Keller–Segel models. This assumption can be easily verified, and we refer to [40, 42] for the detailed explanation and proof. Easy to observe that this assumption implies

$$\begin{aligned} \left\Vert u-u_h\right\Vert _\infty \le \left\Vert u-\pi u\right\Vert _\infty + \left\Vert \pi u-u_h\right\Vert _\infty \le C, \end{aligned}$$
(2.24)

following the inverse inequality (2.19).

Lemma 2.5

Let \(u_h\), \(v_h\) be the numerical solutions of the LDG scheme (2.2) with the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) chosen as (2.9) with \(c_u\ge 0\), and the numerical flux of the nonlinear term \({\widehat{f}}(u^-,u^+)\) chosen as either (2.11) or (2.12). Assume that u is the exact solution of the problem (1.1) and is sufficiently smooth, then there holds the following inequality

$$\begin{aligned} \begin{aligned}&\left| \sum ^J_{j=1}\mathcal {F}^*_j(u_h,\xi _u;{\widehat{f}}(u^-_h,u^+_h))-\sum ^J_{j=1}\mathcal {F}^*_j(u,\xi _u;f(u))\right| \\&\quad \le C\Vert \xi _u\Vert ^2 +C\left( \Vert \partial _x \xi _u\Vert ^2+h^{-1}|[\xi _u]|^2\right) +Ch^{2k+2}. \end{aligned} \end{aligned}$$
(2.25)

Proof

We start by showing that both u and \(u_h\) are bounded. The exact solution u satisfies the energy invariant property (1.6), hence, we have

$$\begin{aligned} E(t)=\Vert u(x,t)\Vert ^2+\varepsilon \Vert u_x(x,t)\Vert ^2=E(0). \end{aligned}$$

By Trace inequality, one can obtain that \(\Vert u(x,t)\Vert _\infty < C\) for any t, where C depends only on the initial condition \(u_0(x)\) and the domain I. Combining this with (2.24) leads to \(\Vert u_h\Vert _\infty < C\) as well.

To prove the estimate (2.25), we separate the left hand side into two terms as follows:

$$\begin{aligned} \begin{aligned}&\sum ^J_{j=1}\bigg |\mathcal {F}^*_j(u_h,\xi _u;{\widehat{f}}(u^-_h,u^+_h))-\mathcal {F}^*_j(u,\xi _u;f(u))\bigg |\\&\quad =\sum ^J_{j=1}\bigg |(f(u_h)-f(u),\partial _x \xi _u)_j+\left( {\widehat{f}}(u^-_h,u^+_h)-f(u)\right) _{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\bigg | :=\sum ^J_{j=1}\bigg |\theta ^1_j+\theta ^2_j\bigg |. \end{aligned} \end{aligned}$$
(2.26)

Since \(f(u)=\frac{1}{2}u^2\), it follows from the Cauchy-Schwarz inequality, the inverse inequality and projection error bound (2.15) that

$$\begin{aligned} \begin{aligned} \sum ^J_{j=1}|\theta ^1_j|&=\sum ^J_{j=1}\left| \left( \frac{1}{2}(u_h+u)(u_h-u),\partial _x \xi _u\right) _j\right| \le C\Vert u_h-u\Vert \Vert \partial _x \xi _u\Vert \\&=C\Vert \xi _u-\eta _u\Vert \Vert \partial _x \xi _u\Vert \le C\Vert \xi _u\Vert ^2 +C\Vert \partial _x \xi _u\Vert ^2 +Ch^{2k+2}. \end{aligned} \end{aligned}$$
(2.27)

The estimation of the second term \(\theta ^2_j\) will be treated differently, depending on the different choices of the numerical fluxes \({\widehat{f}}(u^-_h,u^+_h)\). If the conservative flux (2.11) is used, by applying the mean-value theorem, we can get

$$\begin{aligned} \sum ^J_{j=1}|\theta ^2_j|= & {} \sum ^J_{j=1}\Big |({\widehat{f}}(u^-_h,u^+_h)-f(u))_{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\Big | =\sum ^J_{j=1}\Big |({\widehat{f}}(u^-_h,u^+_h)-{\widehat{f}}(u,u))_{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\Big |\nonumber \\\le & {} \sum ^J_{j=1}\left( \bigg |\frac{\partial {\widehat{f}}}{\partial u^-}(\sigma _{1,j},\sigma _{2,j})\bigg ||u_h^--u|+\bigg |\frac{\partial {\widehat{f}}}{\partial u^+}(\sigma _{1,j},\sigma _{2,j})\bigg ||u_h^+-u|\right) _{j-\frac{1}{2}}\Big |[\xi _u]_{j-\frac{1}{2}}\Big |\nonumber \\= & {} \frac{1}{6}\sum ^J_{j=1}\left( |2\sigma _{1,j}+\sigma _{2,j}||u_h^--u|+|\sigma _{1,j}+2\sigma _{2,j}||u_h^+-u|\right) _{j-\frac{1}{2}}\Big |[\xi _u]_{j-\frac{1}{2}}\Big |\nonumber \\\le & {} C\sum ^J_{j=1}\left( |u_h^--u|+|u_h^+-u|\right) _{j-\frac{1}{2}}\Big |[\xi _u]_{j-\frac{1}{2}}\Big |, \end{aligned}$$
(2.28)

where \(\sigma _{1,j}=(\alpha _{1,j} u^-_h+(1-\alpha _{1,j})u)_{j-\frac{1}{2}}\) and \(\sigma _{2,j}=(\alpha _{2,j} u^+_h+(1-\alpha _{2,j})u)_{j-\frac{1}{2}}\) for some \(\alpha _{1,j}, \alpha _{2,j}\in [0,1]\), and the last inequality follows from

$$\begin{aligned} \bigg |\frac{\partial {\widehat{f}}}{\partial u^-}(\sigma _{1,j},\sigma _{2,j})\bigg | =\frac{1}{6}\big |2\sigma _{1,j}+\sigma _{2,j}\big |\le C, \qquad \bigg |\frac{\partial {\widehat{f}}}{\partial u^+}(\sigma _{1,j},\sigma _{2,j})\bigg |=\frac{1}{6}\big |\sigma _{1,j}+2\sigma _{2,j}\big | \le C, \end{aligned}$$

since \(\Vert u\Vert _\infty < C\) and \(\Vert u_h\Vert _\infty < C\). When \({\widehat{f}}(u^-_h,u^+_h)\) is chosen as the Lax-Friedrichs flux (2.12), we have

$$\begin{aligned} \sum ^J_{j=1}|\theta ^2_j|= & {} \sum ^J_{j=1}\Big |({\widehat{f}}(u^-_h,u^+_h)-f(u))_{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\Big | \nonumber \\= & {} \sum ^J_{j=1}\bigg |\left( \frac{1}{4}\left( (u_h^+)^2+(u_h^-)^2+2\max (|u_h^+|,|u_h^-|)(u_h^+-u_h^-)\right) -\frac{1}{2}u^2\right) _{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\bigg |\nonumber \\\le & {} \frac{1}{4}\sum ^J_{j=1}\bigg |\left( (u_h^++u)(u_h^+-u)+(u_h^-+u)(u_h^--u)\right) _{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\bigg |\nonumber \\&+\frac{1}{2}\sum ^J_{j=1}\bigg |\left( \max (|u_h^+|,|u_h^-|)((u_h^+-u)-(u_h^--u))\right) _{j-\frac{1}{2}}[\xi _u]_{j-\frac{1}{2}}\bigg |\nonumber \\\le & {} C\sum ^J_{j=1}\left( |u_h^--u|+|u_h^+-u|\right) _{j-\frac{1}{2}}\Big |[\xi _u]_{j-\frac{1}{2}}\Big |. \end{aligned}$$
(2.29)

Therefore, it follows from (2.28) and (2.29) that, for either choice of the nonlinear flux \({\widehat{f}}(u^-_h,u^+_h)\),

$$\begin{aligned} \sum ^J_{j=1}|\theta ^2_j|\le & {} C\sum ^J_{j=1}\left( |u_h^--u|+|u_h^+-u|\right) _{j-\frac{1}{2}}\Big |[\xi _u]_{j-\frac{1}{2}}\Big | \nonumber \\\le & {} C\sum ^J_{j=1}h^{\frac{1}{2}}\left( |\xi _u^--\eta _u^-|+|\xi _u^+-\eta _u^+|\right) _{j-\frac{1}{2}}\left( h^{-\frac{1}{2}}\big |[\xi _u]_{j-\frac{1}{2}}\big |\right) \nonumber \\\le & {} C\left( h\Vert \eta _u\Vert ^2_{\Gamma _h}+h\Vert \xi _u\Vert ^2_{\Gamma _h}+h^{-1}|[\xi _u]|^2\right) \nonumber \\\le & {} C\left( \Vert \xi _u\Vert ^2+h^{-1}|[\xi _u]|^2+h^{2k+2}\right) . \end{aligned}$$
(2.30)

The combination of the Eqs. (2.26), (2.27) and (2.30) leads to the desired result (2.25), and this finishes the proof. \(\square \)

Remark 2.5

The above lemma to bound the error in approximating the nonlinear term is one of the key ideas to derive the optimal error estimate. In this paper, we consider the nonlinear BBM equation with \(f(u)=\frac{1}{2} u^2\). For the general flux f(u), the lemma also holds, if the numerical flux \({\widehat{f}}(u^-,u^+)\) is a monotone numerical flux consistent with f. Therefore, the optimal error estimate result in Theorem 2.4 holds for the LDG methods applied to the general equation of the form \(u_t+f(u)_x-\epsilon u_{xxt}=0\).

Remark 2.6

The initial condition of the LDG scheme (2.2) is chosen as

$$\begin{aligned} u_h(x,0)=\pi ^uu_0(x) \end{aligned}$$
(2.31)

and \(v_h(x,0)\) is calculated by (2.2b). With the choice of \(\pi ^u\) defined in (2.16), one can follow the proof in [28] to show the following estimate:

$$\begin{aligned} \left\Vert \xi _u(0)\right\Vert =0, \quad \left\Vert \xi _v(0)\right\Vert \le Ch^{k+1}. \end{aligned}$$
(2.32)

Now, we can present and prove the main optimal error estimate result for both energy conserving and energy dissipative LDG methods.

Theorem 2.4

Let \(u_h\) and \(v_h\) be the numerical solutions of LDG scheme (2.2) with the numerical fluxes \((\widehat{u_h}, \widehat{v_{h,t}})\) chosen as (2.9) with \(c_u\ge 0\), and the numerical flux of the nonlinear term \({\widehat{f}}(u^-,u^+)\) chosen as either (2.11) or (2.12). Assuming u is the exact solution of the problem (1.1) which is sufficiently smooth, and \(v=u_x\). For small h and all \(t\in [0,T]\), the optimal error estimate

$$\begin{aligned} \Vert e_u\Vert \le C h^{k+1}, \quad \Vert e_v\Vert \le C h^{k+1}, \end{aligned}$$
(2.33)

holds, where the constant C may depend on T, k, the length of the domain I, and some Sobolev norms of the exact solution u up to time T, but is independent of h.

Proof

The numerical solutions \(u_h\), \(v_h\) satisfy the LDG scheme (2.2)–(2.2b), which are also satisfied by the exact solutions u and v. The difference of these equations yields the error equations

$$\begin{aligned}&(\xi _{u_t},\phi _1)_j+\varepsilon \mathcal {H}_j^*(\xi _{v_t},\phi _1;\widehat{\xi _{v_t}})-\mathcal {F}_j^*(u_h,\phi _1;{\widehat{f}}(u_h^-,u_h^+)) \nonumber \\&\quad =(\eta _{u_t},\phi _1)_j+\varepsilon \mathcal {H}_j^*(\eta _{v_t},\phi _1;\widehat{\eta _{v_t}})-\mathcal {F}_j^*(u,\phi _1;f(u)), \end{aligned}$$
(2.34)
$$\begin{aligned}&(\xi _v,\phi _2)_j+\mathcal {H}_j^*(\xi _u,\phi _2;\widehat{\xi _u})=(\eta _v,\phi _2)_j+\mathcal {H}_j^*(\eta _u,\phi _2;\widehat{\eta _u}). \end{aligned}$$
(2.35)

By taking the test functions \(\phi _1=\xi _u\) in (2.34), \(\phi _2=\varepsilon \xi _{v_t}\) in (2.35), and summing those equations, we have

$$\begin{aligned}&\sum _{j=1}^J\big ((\xi _{u_t},\xi _{u})_j+\varepsilon (\xi _{v},\xi _{v_t})_j \big ) +\varepsilon \sum _{j=1}^J\left( \mathcal {H}_j^*(\xi _{v_t},\xi _u;\widehat{\xi _{v_t}})+\mathcal {H}_j^*(\xi _u,\xi _{v_t};\widehat{\xi _u})\right) \nonumber \\&\quad =\sum _{j=1}^J\big ((\eta _{u_t},\xi _{u})_j+\varepsilon (\eta _{v},\xi _{v_t})_j \big ) +\sum _{j=1}^J\left( \mathcal {F}_j^*(u_h,\xi _u;{\widehat{f}}(u_h^-,u_h^+))-\mathcal {F}_j^*(u,\xi _u;f(u))\right) \nonumber \\&\qquad +\varepsilon \sum _{j=1}^J\left( \mathcal {H}_j^*(\eta _{v_t},\xi _u;\widehat{\eta _{v_t}})+\mathcal {H}_j^*(\eta _u,\xi _{v_t};\widehat{\eta _u})\right) . \end{aligned}$$
(2.36)

Following the property of the operator \(\mathcal {H}_j\) in (2.6) and the selection of numerical flux in (2.9), we can obtain

$$\begin{aligned} \begin{aligned} \varepsilon \sum _{j=1}^J\left( \mathcal {H}_j^*(\xi _{v_t},\xi _u;\widehat{\xi _{v_t}})+\mathcal {H}_j^*(\xi _u,\xi _{v_t};\widehat{\xi _u})\right) =\varepsilon \sum _{j=1}^Jc_u [\xi _u]^2_{j-\frac{1}{2}}. \end{aligned} \end{aligned}$$

The other property (2.5) of the operator \(\mathcal {H}_j\) leads to

$$\begin{aligned} \begin{aligned}&\varepsilon \sum _{j=1}^J\left( \mathcal {H}_j^*(\eta _{v_t},\xi _u;\widehat{\eta _{v_t}})+\mathcal {H}_j^*(\eta _u,\xi _{v_t};\widehat{\eta _u})\right) \\&\quad =\varepsilon \sum _{j=1}^J\big ((\eta _{v_t},\partial _x \xi _u)_j+(\eta _u, \partial _x \xi _{v_t})_j\big ) +\varepsilon \sum _{j=1}^J\big (\widehat{\eta _{{v_t}}}[\xi _u]+\widehat{\eta _{{u}}}[\xi _{v_t}] \big )_{j-\frac{1}{2}}. \end{aligned} \end{aligned}$$

Therefore, the Eq. (2.36) can be rewritten as

$$\begin{aligned} \begin{aligned}&\frac{1}{2}\frac{d}{dt}\left( \Vert \xi _{u}\Vert ^2+\varepsilon \Vert \xi _{v}\Vert ^2 \right) =-\varepsilon c_u |[\xi _{u}]|^2 +\sum _{j=1}^J(\eta _{u_t},\xi _{u})_j+\varepsilon \sum _{j=1}^J(\eta _{v},\xi _{v_t})_j\\&\quad +\sum _{j=1}^J\left( \mathcal {F}_j^*(u_h,\xi _u;{\widehat{f}}(u_h^-,u_h^+))-\mathcal {F}_j^*(u,\xi _u;f(u))\right) \\&\quad +\varepsilon \sum _{j=1}^J\big ((\eta _{v_t},\partial _x \xi _u)_j+(\eta _u, \partial _x \xi _{v_t})_j\big ) +\varepsilon \sum _{j=1}^J\big (\widehat{\eta _{{v_t}}}[\xi _u]+\widehat{\eta _{{u}}}[\xi _{v_t}]\big )_{j-\frac{1}{2}}. \end{aligned} \end{aligned}$$
(2.37)

From the choice (2.16) of our projections of u and v, it follows that

$$\begin{aligned} \varepsilon \sum _{j=1}^J(\eta _{v},\xi _{v_t})_j=0, \quad \sum _{j=1}^J\widehat{\eta _{{u}}}[\xi _{v_t}]_{j-\frac{1}{2}}=0, \end{aligned}$$
(2.38)

and

$$\begin{aligned} \varepsilon \sum _{j=1}^J\left( (\eta _{v_t},\partial _x \xi _u)_j+(\eta _u, \partial _x \xi _{v_t})_j\right) =0. \end{aligned}$$
(2.39)

By the properties (2.15) of projection error and Young’s inequality, we have

$$\begin{aligned} \sum _{j=1}^J(\eta _{u_t},\xi _{u})_j \le \Vert \eta _{u_t}\Vert ^2+\Vert \xi _{u}\Vert ^2\le Ch^{2k+2}+\Vert \xi _{u}\Vert ^2. \end{aligned}$$
(2.40)

The combination of the inequality (2.25) in Lemma 2.5 and the inequality (2.20) in Lemma 2.4 yields

$$\begin{aligned} \left| \sum ^J_{j=1}\mathcal {F}^*_j(u_h,\xi _u;{\widehat{f}}(u_h^-,u_h^+))-\sum ^J_{j=1}\mathcal {F}^*_j(u,\xi _u;f(u))\right| \le C \left( \Vert \xi _u\Vert ^2 +\Vert \xi _v\Vert ^2\right) +Ch^{2k+2}.\nonumber \\ \end{aligned}$$
(2.41)

The definition of \(\widehat{\eta _{v_t}}\) in (2.9) leads to

$$\begin{aligned} \begin{aligned} \varepsilon \sum _{j=1}^J\big (\widehat{\eta _{{v_t}}}[\xi _u]\big )_{j-\frac{1}{2}}&=\varepsilon \sum _{j=1}^J\big ((\eta ^*_{v_t}+c_u [\eta _u])[\xi _u]\big )_{j-\frac{1}{2}} \\&\le \frac{\varepsilon }{2}\sum _{j=1}^J\left( h (\eta _{v_t}^*)^2+h[\eta _u]^2+(c_u^2+1)h^{-1}[\xi _u]^2\right) _{j-\frac{1}{2}} \\&\le \frac{\varepsilon }{2}h\Vert \eta _{v_t}\Vert ^2_{\Gamma _h} +\frac{\varepsilon }{2} h\Vert \eta _{u}\Vert ^2_{\Gamma _h}+ \frac{\varepsilon (c_u^2+1)}{2} h^{-1}|[\xi _u]|^2 \\&\le Ch^{2k+2}+C\Vert \xi _v\Vert ^2, \end{aligned} \end{aligned}$$
(2.42)

where the assumption \(c_u\ge 0\) is used, and the last inequality follows from the projection error bound (2.15) and Lemma 2.4. By combining (2.38)–(2.42), one can rewrite Eq. (2.37) as

$$\begin{aligned} \frac{d}{dt}\left( \Vert \xi _{u}\Vert ^2+\varepsilon \Vert \xi _{v}\Vert ^2\right) \le C\left( \Vert \xi _{u}\Vert ^2+\varepsilon \Vert \xi _{v}\Vert ^2\right) +Ch^{2k+2}. \end{aligned}$$

The optimal error estimate of \(\xi _u\), \(\xi _v\)

$$\begin{aligned} \Vert \xi _u\Vert +\varepsilon \Vert \xi _v\Vert \le C h^{k+1}, \end{aligned}$$
(2.43)

follows from the Gronwall’s inequality and the error of the initial condition in Remark 2.6. Combined with the optimal projection error of \(\eta _u\), \(\eta _v\), this leads to the optimal error estimate of \(e_u\), \(e_v\) in (2.33). \(\square \)

2.4 Temporal Discretization

In this subsection, we present the fully discrete LDG methods. The implicit midpoint temporal discretization will be used to ensure that the fully discrete methods maintain the mass and energy conserving property. If the energy dissipative method [i.e., \(c_u>0\) or \({\widehat{f}}\) chosen as (2.12)] is used, the total variation diminishing (TVD) Runge–Kutta method can be used to provide high order accurate temporal approximation.

Let \(0 = t_0< t_1< \cdots < t_N = T \) be a partition of the interval [0, T] with time step \(\Delta t_n=t_{n+1}- t_n\). The following notations

$$\begin{aligned}&u^n_h = u_h(\,\cdot \,, t_n), \qquad u_h^{n+\frac{1}{2}}=\frac{1}{2}(u_h^{n+1}+u_h^n), \qquad \delta ^+_t u_h^n=\frac{u_h^{n+1}-u_h^{n}}{\Delta t_n}, \end{aligned}$$

are introduced to ease the presentation.

The fully discrete implicit midpoint rule with local discontinuous Galerkin scheme takes the following form: we are looking for the solutions \(u^{n+1}_h\), \(v^{n+1}_h\), for \(n=1,2,\ldots ,N-1\), such that

$$\begin{aligned} \left\{ \begin{aligned}&(\delta ^+_tu^n_{h},\phi _1)_j+\varepsilon \mathcal {H}_j^*(\delta ^+_tv^n_{h},\phi _1;\widehat{\delta ^+_tv_{h}^n})-\mathcal {F}_j^*(u^{n+\frac{1}{2}}_h,\phi _1;{\widehat{f}}^{n+\frac{1}{2}})=0\\&(v^{n+\frac{1}{2}}_h,\phi _2)_j+\mathcal {H}_j^*(u^{n+\frac{1}{2}}_h,\phi _2;(\widehat{u_h})^{n+\frac{1}{2}})=0\\ \end{aligned} \right. \end{aligned}$$
(2.44)

hold for all test functions \(\phi _1\), \(\phi _2\in V^k\) on every cell \(I_j\). Here the nonlinear numerical flux \({\widehat{f}}^{n+\frac{1}{2}}={\widehat{f}}\big (u^{n+\frac{1}{2},-}_h,u^{n+\frac{1}{2},+}_h\big )\) can be chosen as (2.11) or (2.12), and the set of numerical fluxes \((\widehat{\delta ^+_tv_{h}^n}, (\widehat{u_h})^{n+\frac{1}{2}} )\) takes the similar form as (2.9)

$$\begin{aligned} \left\{ \begin{aligned}&\widehat{\delta ^+_tv_{h}^n}=\delta ^+_t(v^*_{h})^n+c_u\big [u^{n+\frac{1}{2}}_h\big ],\\&(\widehat{u_{h}})^{n+\frac{1}{2}}=(u^*_{h})^{n+\frac{1}{2}}, \end{aligned} \right. \end{aligned}$$
(2.45)

where \(c_u\ge 0\) and \((u^*_{h}, v^*_{h})\) can be either \(( \cdot ^+,\cdot ^- )\), \(( \cdot ^-,\cdot ^+ )\) or the generalized form in (2.10). Easy to verify that the implicit midpoint rule method is second order accurate in time.

Remark 2.7

Since different choices of the numerical fluxes will be tested in the numerical examples section, we name the fully discrete schemes as “C/D-C/D-LDG”, where “C” and “D” stands for “conservative” and “dissipative” respectively, and the detailed explanation can be found in Table 1. The “Central-LDG” method, as explained in Remark 2.1, is also included for comparison. Note that the optimal error estimate proof does not apply to the “Central-LDG” method.

Table 1 The explanation of the numerical methods “C/D-C/D-LDG”

The conservation of continuous mass and energy of the semi-discrete LDG methods are shown in Sect. 2.2. For the fully discrete methods, we have the following results.

Theorem 2.5

Let \(u_h^n\) and \(v_h^n\) be the numerical solutions of the fully discrete LDG methods (2.44). With the discrete mass and energy defined as

$$\begin{aligned} M^n_h=\int _I u^n_h dx, \qquad E^n_{h}=\int _I \big ( (u^n_h)^2+\varepsilon (v^n_{h})^2 \big ) dx, \end{aligned}$$
(2.46)

the following mass conservation and energy dissipative property holds

$$\begin{aligned} M^n_h=M^0_h, \qquad E^n_{h}\le E^{n-1} \le \cdots \le E^0_h, \end{aligned}$$
(2.47)

for any n and all the LDG schemes in Table 1. More specifically, C-C-LDG and Central-LDG methods can preserve the energy conservation, that means \(E^n_h=E^0_h\).

The proof of this theorem is similar to that of Theorems 2.1 and 2.2, and is omitted here.

Remark 2.8

Note that the implicit midpoint rule method is introduced here, mainly for the purpose of conserving the energy at the discrete level. If one’s purpose is to design energy dissipative methods, the explicit TVD Runge-Kutta methods should be used for simplicity.

At the end of this section, we provide some details related to the implementation of the fully discrete methods (2.44). Let \(U_h\) be the vectors containing the degree of freedom for the piecewise polynomial solution \(u_h\), and denote \(U^n_h=U_h(t_n)\). Similarly, we can define \(V^n_h\). The fully discrete methods (2.44) can be rewritten in the matrix form as

$$\begin{aligned} \left\{ \begin{aligned}&AU^{n+\frac{1}{2}}_h+\varepsilon B V^{n+\frac{1}{2}}_h+D_{1}V^{n+\frac{1}{2}}_h+ \frac{\Delta t_n}{2} \left( D_{2}U^{n+\frac{1}{2}}_h+f_s\left( U^{n+\frac{1}{2}}_h\right) \right) \\&\quad =AU^{n}_h+\varepsilon B V^{n}_h+D_{1}V^{n}_h, \\&AV^{n+\frac{1}{2}}_h+BU^{n+\frac{1}{2}}_h+D_3U^{n+\frac{1}{2}}_h=0, \end{aligned} \right. \end{aligned}$$
(2.48)

where A and B are matrices depending on the polynomial basis functions and the terms \(D_{1}V^{n+\frac{1}{2}}_h\), \(D_{2}U^{n+\frac{1}{2}}_h\) and \(D_3U^{n+\frac{1}{2}}_h\) come from the choices of the numerical fluxes \(\widehat{\delta ^+_tv_{h}^n}\), \((\widehat{u_{h}})^{n+\frac{1}{2}}\). The nonlinear function \(f_s\) denotes the discretization of the nonlinear term. The second equation of (2.48) leads to the following relation between \(V_h\) and \(U_h\):

$$\begin{aligned} V^{n+\frac{1}{2}}_h=K_{uv}U^{n+\frac{1}{2}}_h, \end{aligned}$$
(2.49)

where \(K_{uv}=-A^{-1}(B+D_3)\). Therefore, the system (2.48) can be reduced to

$$\begin{aligned}&U^{n+\frac{1}{2}}_h=g_s\left( U^{n+\frac{1}{2}}_h\right) +L\left( U^{n}_h,V^{n}_h\right) , \end{aligned}$$
(2.50)

where \(g_s\) is a nonlinear function and L is a linear function. To solve the nonlinear system (2.50), one could use Newton’s method or other iterative methods. A stopping criteria of \(\Vert (U^{n+\frac{1}{2}}_h)^{(k)}-(U^{n+\frac{1}{2}}_h)^{(k-1)}\Vert \le \varepsilon \) is used in the numerical implementation, where \(\varepsilon \) is the control error and is taken as \(10^{-15}\) in our tests. With the solution \(U^{n+\frac{1}{2}}_h\) available, one could use (2.49) to evaluate \(V^{n+\frac{1}{2}}_h\) if needed.

3 Numerical Experiments of the LDG Methods

In this section, we provide some numerical results of the proposed LDG methods with implicit midpoint rule temporal discretization. When the case \(c_u>0\) is considered in (2.45), we always choose \(c_u=1\) in our tests. We first perform the accuracy tests on the LDG methods to verify the optimal convergence rate. We also test different initial projections and different fluxes, and observe how these affect the order of accuracy. Mass conservation and energy conservation/dissipation property of the proposed methods will also be verified numerically. At the end, the long time behavior of the LDG methods is studied.

3.1 Accuracy Test

The cnoidal-wave solution (1.4), with the following parameters

$$\begin{aligned} m=0.9,\quad C=\frac{2m-1}{3m}=0.2963,\quad D=0,\quad \varepsilon =10^{-2},\quad x_l=0,\quad x_r=\frac{2K(m)}{B}=0.9224,\nonumber \\ \end{aligned}$$
(3.1)

is used in this section to check the convergence rate of the proposed LDG methods. The initial conditions \(u_0(x)\) is obtained by setting \(t = 0\), and the numerical error are computed at the stopping time \(T=1\).

Since the second order implicit midpoint temporal discretizations is employed and our interest is in the effect of various spatial discretizations, we set the time step as \(\tau =0.5877h^2\) (such that \(N=2J^2\)). Tables 23,  456 and 7 present the numerical order of accuracy for the LDG methods with \(P^0\), \(P^1\), \(P^2\) and \(P^3\) basis, and with different choices of projections in evaluating the numerical initial conditions.

As seen in Table 2 and Table 4, optimal order of accuracy of \(u_h\) and \(v_h\) are obtained for both C-C-LDG and D-D-LDG methods, when \(( u^*_{h}, v^*_{h,t})\) is chosen as \(( u^+_{h}, v^-_{h,t} )\) in fluxes (2.9) and projection \(\pi ^+\) is applied to obtain the initial conditions of \(u_h\). These results agree well with the error estimate in Theorem 2.4. It’s worth mentioning that, when \(L^2\) projections is used to obtain the initial conditions of \(u_h\), only kth order accuracy of \(v_h\) can be obtained with basis functions in \(P^k\) for \(k = 1, 2, 3\) for C-C-LDG scheme (see Table 3) and D-D-LDG scheme (see Table 5). In spite of this, optimal order of accuracy of \(u_h\) still can be obtained with basis functions in \(P^k\) for \(k = 1, 2, 3\). The impact of different numerical initial conditions of the LDG methods towards the convergence rate has also been observed by us in [28, 29, 35]. The performance of the C-D-LDG and D-C-LDG methods is similar and is not presented here to save space. With the other choice of numerical fluxes \(( u^*_{h}, v^*_{h,t})=( u^-_{h}, v^+_{h,t} )\), the same numerical results are observed, and are omitted here.

The convergence rate of the Central-LDG method is shown in Table 6. Only kth order accuracy in \(u_h\) and \(v_h\) are obtained for odd k, which is consistent with our impression that even-odd phenomenon of the central flux. Note that the optimal error estimate result in Theorem 2.4 does not hold for the central flux, as one of the key inequality (2.20) cannot be proven. If the energy dissipative terms are added to the Central-LDG method [i.e., taking \(c_u=1\) and \({\widehat{f}}\) chosen as (2.12)], the accuracy improves a little for odd k, as seen in Table 7, but optimal convergence still cannot be obtained.

Table 2 Numerical error and convergence rates of C-C-LDG scheme in the cnoidal-wave example
Table 3 Numerical error and convergence rates of C-C-LDG scheme in the cnoidal-wave example
Table 4 Numerical error and convergence rates of D-D-LDG scheme in the cnoidal-wave example
Table 5 Numerical error and convergence rates of D-D-LDG scheme in the cnoidal-wave example
Table 6 Numerical error and convergence rates of Central-LDG scheme in the cnoidal-wave example
Table 7 Numerical error and convergence orders of u and v of Central-LDG scheme with dissipative term added in the cnoidal-wave example

3.2 Mass, Energy Conservation and the Long Time Behavior

In this subsection we study the mass, energy conservation property and the long time behavior of the proposed LDG methods.

We consider the cnoidal-wave solution (1.4) of BBM Eq. (1.1) with the parameters specified in (3.1). First, we plot the time history of the error of mass and energy (i.e., \(M_h^N-M_h^0\) and \(E_h^N-E_h^0\)) of C-C-LDG methods in Fig. 1, with \(J=10\), \(T=250\) and \(N=2480\). Easy to observe that the mass and energy are both exactly preserved by our methods up to the machine error at the level of \(10^{-14}\).

Fig. 1
figure 1

Errors of mass (left) and energy (right) of C-C-LDG scheme in Sect. 3.2, with \(J=10\), \(T=250\), \(N=2480\) and \(P^2\) polynomial basis

Fig. 2
figure 2

Time history of the numerical errors of \(u_h\) in \(L^2\) norm with \(J=10\), \(N=20{,}480\) and \(T=30\) of C-C-LDG, C-D-LDG, D-C-LDG and D-D-LDG methods in Sect. 3.2, with \(P^0\) (top left), \(P^1\) (top right), \(P^2\) (bottom left) and \(P^3\) (bottom right) polynomial basis

Figure 2 plots \(\Vert e_u\Vert \), the time history of \(L^2\) norm of numerical error, of different LDG methods, for the cnoidal-wave example with \(J=10\), \(N=20480\), \(T=30\) and various \(P^k\) polynomial basis. We can observe that the \(L^2\) errors of D-C-LDG and D-D-LDG methods are similar and those of C-C-LDG and C-D-LDG methods are similar. The \(L^2\) error of D-D-LDG is growing faster than C-C-LDG method. This means that the influence of term \(c_u[u_h]\) in flux \(\widehat{v_{h,t}}\) is not as obvious as the nonlinear term flux \({\widehat{f}}\), and in general, the conserved C-C-LDG scheme performs better. From the bottom of Fig. 2, we can see the the errors of the C-C-LDG scheme do not grow significantly in time due to the energy conserving property.

Next we focus on C-C-LDG and D-D-LDG methods, and provide a thorough comparison of them by Figs. 3, 4 and 5 with the explanations below. In the top of Fig. 3, we show the time history of the numerical errors of \(u_h\) in \(L^\infty \) norm with uniform time steps \(\tau =0.0323\) (top left), \(\tau =0.0161\) (top right) and \(P^0\) polynomial basis. It can be observed that the errors of different time step sizes are similar, which means the numerical error is dominated by the spatial discretization. Also, the numerical error of energy conserving scheme is smaller. The middle and bottom of Fig. 3 provide the comparison of numerical solutions with the exact solution at different stopping times, and the time history of \(u(x_m,t)\) with \(x_m=(x_l+x_r)/2\), uniform spatial cells \(J=40\) and the time step \(\tau =0.161\). It is very easy to observe that, the D-D-LDG scheme has a larger phase error, which makes the solution very inaccurate in the long time simulation. On the other hand, C-C-LDG scheme demonstrate a good approximation to the exact solution. When \(P^2\) and \(P^3\) polynomial basis are used, the same numerical results can be observed in Figs.  4 and 5, respectively. The C-C-LDG scheme demonstrates a better approximation to the exact solution than the D-D-LDG scheme. In addition, we can see the difference between C-C-LDG and D-D-LDG becomes less obvious, as the polynomial degree k increases.

Fig. 3
figure 3

Time history of the numerical errors of \(u_h\) in \(L^\infty \) norm with uniform time cells \(N=1240\) (top left) and 2480 (top right) at \(t=40\), waveform at \(t=4\) (middle left), \(t=20\) (middle right) and \(t=40\) (bottom left) and time history of \(u(x_m,t)\) (bottom right) of C-C-LDG and D-D-LDG methods in the cnoidal-wave example with uniform spatial cells \(J=40\), \(x_m=(x_l+x_r)/2\) and \(P^0\) polynomial basis

Fig. 4
figure 4

Time history of the numerical errors of \(u_h\) in \(L^\infty \) norm with uniform time cells \(N=10{,}240\) (top left) and \(N=20{,}480\) (top right ) for \(T=70\), waveform at \(t=7\) (middle left), \(t=50\) (middle right) and \(t=70\) (bottom left) and time history of \(u(x_m,t)\) (bottom right) of C-C-LDG and D-D-LDG methods in the cnoidal-wave example with uniform spatial cells \(J=10\), \(x_m=(x_l+x_r)/2\) and \(P^2\) polynomial basis

Fig. 5
figure 5

Time history of the numerical errors of \(u_h\) in \(L^\infty \) norm with uniform time cells \(N=20{,}480\) (top left) and \(N=40{,}960\) (top right ) for \(T=70\), waveform at \(t=7\) (middle left), \(t=50\) (middle right) and \(t=70\) (bottom left) and time history of \(u(x_m,t)\) (bottom right) of C-C-LDG and D-D-LDG methods in the cnoidal-wave example with uniform spatial cells \(J=10\), \(x_m=(x_l+x_r)/2\) and \(P^3\) polynomial basis

Figure 6 shows the comparison of the waveform of C-C-LDG and D-D-LDG methods at different times \(T=70\), 200, 250 and 290. Significant phase error can be observed for the D-D-LDG methods, while the C-C-LDG methods can capture the wave well. At time \(T=290\), the solution of D-D-LDG methods seems to match well with the exact solution, but this is because the phase error has accumulated and the wave is now one period behind (with periodic boundary condition used). Also, the magnitude of the numerical solution of the C-C-LDG scheme (red line) stays as 1, while the amplitude of D-D-LDG result (blue line) decreases gradually over time.

In [31], energy conserving LDG method for the Camassa–Holm equation is investigated and tested. One question about [31, Figure 2] remains unanswered in that paper. A smaller phase error of the energy conserving methods was observed for that numerical test, but the improvement in terms of the phase error is not as good as that for the KdV [24] and Degasperis-Procesi [32] equations. We revisited this issue for this simpler BBM equation. Figure 7, the left column, reproduces similar observation as in [31, Figure 2], and one can observe obvious phase error of both C-C-LDG and D-D-LDG methods, although C-C-LDG method has a smaller phase error. The right column of Fig. 7 provide the numerical results with a half time step size while keeping all the other parameters. After reducing \(\Delta t\), the numerical error of energy conserving C-C-LDG methods decreases significantly, leading to a much smaller phase error, but the error of the energy dissipative D-D-LDG methods does not change much. Therefore, the large phase error of energy conserving methods in Fig. 7 (the left column) is mainly due to the temporal discretization error.

Fig. 6
figure 6

The comparison of the waveform of C-C-LDG and D-D-LDG methods at different times \(t=70, 200, 250, 290\) in the cnoidal-wave example with uniform spatial cells \(J=10\), \(\tau =0.015736\) and \(P^2\) polynomial basis

Fig. 7
figure 7

The comparison of the waveform of C-C-LDG and D-D-LDG methods at different times \(t=40\) (top), \(t=70\) (middle), \(t=150\) (bottom) with time step \( \tau =0.063004\) (left) and \(\tau =0.031502\) (right), in the cnoidal-wave example with uniform spatial cells \(J=10\) and \(P^2\) polynomial basis

3.3 Non-uniform Meshes

In this subsection, numerical results of the proposed methods on non-uniform spatial meshes are provided. Both the accuracy and long time behavior are tested. The non-uniform meshes are taken of the style \(\{h,2h,3h,h,2h,3h,\ldots \}\), and J again stands for the total number of cells.

We consider the cnoidal-wave solution (1.4) of BBM Eq. (1.1) with the parameters specified in (3.1). In the first accuracy test, we set the time step as \(\tau =2.3508h^2\) (such that \(N=2J^2\)). \(( u^*_{h}, v^*_{h,t})\) is chosen as \(( u^+_{h}, v^-_{h,t} )\) in the fluxes (2.9), and projection \(\pi ^+\) is applied to obtain the initial conditions of \(u_h\). Tables 8 and  9 present the accuracy test of C-C-LDG and D-D-LDG methods on non-uniform meshes, respectively. We can observe that both methods demonstrate an optimal order of convergence rate on \(u_h\) and \(v_h\).

Both C-C-LDG and D-D-LDG methods are simulated for this cnoidal-wave example, on non-uniform meshes using \(P^0\) (with \(J=40\)) and \(P^3\) (with \(J=10\)) polynomial basis. Figure 8 shows the time history of their numerical errors of \(u_h\) in \(L^\infty \) norm. Comparing with the top right of Figs. 3 and 5, we observe that non-uniform spatial meshes lead to larger numerical error with the same J, and the C-C-LDG scheme demonstrates a better approximation to the exact solution than the D-D-LDG scheme.

Figure 9 shows the comparison of the waveform of C-C-LDG and D-D-LDG methods at different times \(T=50\), 100, 140 and 150, on non-uniform meshes (\(J=10\)) for \(P^2\) polynomial basis. We can obtain the same conclusion as observed in Fig. 6 for the tests with uniform meshes, namely the C-C-LDG methods have smaller phase and amplitude error than D-D-LDG methods. Comparing with Fig. 6, we can observe, under non-uniform meshes, the phase error of the D-D-LDG methods accumulates faster: the peak of the wave lag one period behind around \(t=150\), while the same phenomenon occurs around \(t=290\) with uniform spatial meshes.

4 Energy Conserving LDG Method Via Doubling-the-Unknowns

Optimal energy conserving DG methods have been presented for linear symmetric hyperbolic systems by Fu and Shu in [36], based on the doubling-the-unknowns idea to introduce an auxiliary zero unknown equation. The same idea has been extended in [37] to provide an energy conserving ultra-weak DG method for the KdV equation, where comparison with existing energy conserving or dissipative DG methods have been provided to demonstrate the better performance of this optimal energy conserving DG method. In this section, we will extend the same idea to the BBM equation to derive and analyze optimal energy conserving LDG method with double unknowns (named as dLDG), and the main focus is two-folds: first, we want to show that the suboptimal Central-LDG method can be extended to be optimal in this framework; second, the comparison of dLDG methods with the energy conserving methods presented in Sect. 2 will be presented.

We start by doubling the unknown functions with the introduction of an auxiliary zero function g(xt), and consider the following system

$$\begin{aligned} \left\{ \begin{aligned}&u_t-\varepsilon u_{xxt}+uu_x=0,\\&g_{t}-\varepsilon g_{xxt}=0, \end{aligned} \right. \end{aligned}$$
(4.1)

with initial condition \(u(x,0)=u_0(x)\) and \(g(x,0)=0\). As explained in [37], one could add the nonlinear term \(gg_x\) to the second equation to obtain the dLDG method, but it is not found to be beneficial, therefore, to save computational cost, this nonlinear term is not included. Analytically, g(xt) should stay as 0 for any t, but this will not be the case numerically, due to our choice of the numerical fluxes to couple u and g togther.

Table 8 Accuracy test on non-uniform meshes: numerical error and convergence rates of C-C-LDG scheme in the cnoidal-wave example
Table 9 Accuracy test on non-uniform meshes: numerical error and convergence rates of D-D-LDG scheme in the cnoidal-wave example
Fig. 8
figure 8

Non-uniform meshes: time history of the numerical errors of \(u_h\) in \(L^\infty \) norm of C-C-LDG and D-D-LDG methods on non-uniform meshes, using \(P^0\) (left, \(J=40\)) and \(P^3\) (right, \(J=10\)) polynomial basis

Fig. 9
figure 9

Non-uniform meshes: the comparison of the waveform of C-C-LDG and D-D-LDG methods at different times \(t=50, 100, 140, 150\) in the cnoidal-wave example, with \(\tau =0.015736\), non-uniform spatial cells \(J=10\) and \(P^2\) polynomial basis

The equations can be rewritten into a first order system by substituting \(u_x\) with variable v and \(g_x\) with variable w:

$$\begin{aligned} \left\{ \begin{aligned}&u_{t}-\varepsilon v_{xt}+f(u)_x=0, \\&v=u_x,\\&g_{t}-\varepsilon w_{xt}=0, \\&w=g_x, \end{aligned} \right. \end{aligned}$$
(4.2)

where \(f(u)= u^2/2\). The semi-discrete dLDG methods for the system (4.2) are defined as follows: find \(u_h\), \(v_h\), \(g_h\), and \(w_h\)\(\in V^k_h\), such that for all test functions \(\phi _1, \phi _2, \phi _3, \phi _4 \in V^k_h\) it holds that

$$\begin{aligned} \left\{ \begin{aligned}&(u_{h,t},\phi _1)_j+\varepsilon \mathcal {H}_j^*(v_{h,t},\phi _1;\widehat{v_{h,t}})-\mathcal {F}_j^*(u_h,\phi _1;{\widehat{f}})=0,\\&(v_h,\phi _2)_j+\mathcal {H}_j^*(u_h,\phi _2;\widehat{u_h})=0,\\&(g_{h,t},\phi _3)_j+\varepsilon \mathcal {H}_j^*(w_{h,t},\phi _3;\widehat{w_{h,t}})=0,\\&(w_h,\phi _4)_j+\mathcal {H}_j^*(g_h,\phi _4;\widehat{g_h})=0, \end{aligned} \right. \end{aligned}$$
(4.3)

where the numerical flux of the nonlinear term \({\widehat{f}}\) can be chosen as the conservative flux (2.11) and the hatted numerical fluxes \(\widehat{u_h}\), \(\widehat{v_{h,t}}\), \(\widehat{g_h}\) and \(\widehat{w_{h,t}}\) are chosen as:

$$\begin{aligned} \left\{ \begin{aligned}&\widehat{v_{h,t}}=\{v_{h,t}\}+k_1[w_{h,t}],\\&\widehat{u_{h}}=\{u_{h}\}+k_2[g_h],\\&\widehat{w_{h,t}}=\{w_{h,t}\}-k_2[v_{h,t}],\\&\widehat{g_{h}}=\{g_{h}\}-k_1[u_h],\\ \end{aligned} \right. \end{aligned}$$
(4.4)

and the parameters \(k_1\), \(k_2\) satisfies \(k_1k_2=-1/4\). The average \(\{\cdot \}\) in (4.4) can also be replaced by the generalized alternating numerical flux (2.10). Optimal error estimate cannot be obtained for the LDG method in Sect. 2 when average is used (i.e., Central-LDG method), and we will show that by this doubling-the-unknowns technique, one could recover the optimal error estimate.

4.1 Energy Conservation Property

In this subsection we present the energy conservation property of the dLDG scheme. The equations of \(u_h\), \(v_h\) in the dLDG method (4.3) are the same as in the LDG method (2.2)–(2.2b), except the definition of the numerical fluxes are different. Therefore, Theorem 2.1 (mass conservation property) and Lemma 2.3 still hold, with the new definition of these fluxes. For the new variables \(g_h\) and \(w_h\), we have the following lemma:

Lemma 4.1

Let \(g_h\), \(w_h\) be the solutions of dLDG scheme (4.3), the following result hold

$$\begin{aligned} \frac{1}{2}\frac{d}{dt}\int _{I}\left( g_h^2+\varepsilon w_h^2\right) dx +\varepsilon \sum _j\left( (\widehat{w_{h,t}}-\{w_{h,t}\})[g_h]+(\widehat{g_{h}}-\{g_{h}\})[w_{h,t}]\right) _{j+\frac{1}{2}}=0. \end{aligned}$$

The proof of this Lemma follows that of Lemma 2.3, and is omitted here. Therefore, we have the following properties.

Theorem 4.1

Let \(u_h\), \(v_h\), \(g_h\) and \(w_h\) be the solutions of dLDG scheme (4.3), with the numerical fluxes chosen as (4.4) and (2.11). The following energy conservation property holds

$$\begin{aligned} dE_{h}(t):=\int _I \left( u_h^2(x,t)+\varepsilon v_{h}^2(x,t)+g_h^2(x,t)+\varepsilon w_{h}^2(x,t)\right) dx =dE_{h}(0). \end{aligned}$$
(4.5)

Remark 4.1

Due to the introduction of auxiliary zero function g, the energy of dLDG method in (4.5) now include both \(u_h\), \(v_h\), and \(g_h\), \(w_h\), which is different from the conventional LDG method. This should be an approximate of the energy, because \(g_h\) and \(w_h\) are numerical approximation of zero functions, and we refer to [36] for more discussions on this matter.

4.2 Optimal Error Estimate

To derive the error estimate, the standard \(L^2\) projections of the solutions v, w

$$\begin{aligned} \pi ^v v = \pi v, \qquad \pi ^w w = \pi w, \end{aligned}$$
(4.6)

and the following coupled projections \(\langle \pi ^u , \pi ^g \rangle \) of u and g

$$\begin{aligned} \left\{ \begin{aligned}&(\pi ^u u, \phi )_j = (u, \phi )_j, \quad \forall \phi \in P^{k-1}(I_j),\\&(\pi ^g g, \phi )_j = (g, \phi )_j, \quad \forall \phi \in P^{k-1}(I_j),\\&\left( \{\pi ^u u\}+k_2[\pi ^g g]\right) _{j-\frac{1}{2}}= u(x_{j-\frac{1}{2}}),\\&\left( \{\pi ^g g\}-k_1[\pi ^u u]\right) _{j-\frac{1}{2}}= g(x_{j-\frac{1}{2}}), \end{aligned} \right. \end{aligned}$$
(4.7)

are defined for all \(j=1,2,\ldots ,J\), where \(k_1k_2=-1/4\) is assumed. At a first glance, the projections (4.7) seem to be globally coupled over all the element \(I_j\), due to the appearance of \(\{\cdot \}\) and \([\cdot ]\) in the definition of the cell boundary terms. The following Lemma, following similar result in [36], shows that they are actually local projections with optimal projection errors.

Lemma 4.2

The projections in (4.7) are well-defined, and they satisfy

$$\begin{aligned} \left\{ \begin{aligned}&\pi ^uu=\frac{1}{2}\pi ^+( u+ 2k_2g)+\frac{1}{2}\pi ^-(u- 2k_2g),\\&\pi ^gg=\frac{1}{4k_2}\pi ^+( u+ 2k_2g)-\frac{1}{4k_2}\pi ^-(u- 2k_2g). \end{aligned} \right. \end{aligned}$$
(4.8)

In particular,

$$\begin{aligned} \Vert \pi ^u u-u\Vert _0 \le Ch^{k+1} \quad \text {and} \quad \Vert \pi ^g g-g\Vert _0\le Ch^{k+1}. \end{aligned}$$
(4.9)

Proof

From the definition of the coupled projections (4.7), we know that for any \(\alpha \) and \(\beta \)

$$\begin{aligned} \begin{aligned}&(\alpha \pi ^u u+\beta \pi ^g g, \phi )_j = (\alpha u+\beta g, \phi )_j, \qquad \qquad \forall \phi \in P^{k-1}(I_j),\\&\quad \left( \{\alpha \pi ^u u+\beta \pi ^g g\} +\frac{1}{2}[2\alpha k_2 \pi ^g g-2\beta k_1\pi ^u u]\right) \bigg |_{j-\frac{1}{2}}=\alpha u(x_{j-\frac{1}{2}})+ \beta g(x_{j-\frac{1}{2}}). \end{aligned} \end{aligned}$$
(4.10)

We can choose \(\alpha =1\), \(\beta =2k_2\) such that \(2\alpha k_2=\beta \), \(-2\beta k_1=\alpha \), since \(k_1k_2=-1/4\). Note that for any \(w\in V_h^k\) it holds \(\{w\}+\frac{1}{2}[w]=w^+\), then the Eq. (4.10) leads to

$$\begin{aligned} \pi ^u u+2k_2\pi ^g g=\pi ^+(u+2k_2g). \end{aligned}$$
(4.11)

Similarly we can choose \(\alpha =1\), \(\beta =-2k_2\) to derive

$$\begin{aligned} \pi ^u u-2k_2\pi ^g g=\pi ^+(u-2k_2g). \end{aligned}$$
(4.12)

The conclusion (4.8) follows from (4.11) and (4.12), and the error estimate (4.9) is the direct consequence of applying the error estimate (2.15) to \(\pi ^{\pm }\). \(\square \)

The following lemma is the analogue of Lemma 2.4.

Lemma 4.3

Suppose \((u_h,v_h), (g_h,w_h)\in V_h^k\times V_h^k\) are the solutions of the dLDG methods (4.3) with the numerical fluxes (4.4), and the projections (4.6) and (4.7) are used, then there exists a positive constant C, which is independent of h, such that

$$\begin{aligned}&\Vert \xi _{u,x}\Vert _0+h^{-1/2}|[\xi _u]|\le C\left( \Vert \xi _v\Vert _0+\Vert \xi _w\Vert _0\right) , \end{aligned}$$
(4.13)
$$\begin{aligned}&\Vert \xi _{g,x}\Vert _0+h^{-1/2}|[\xi _g]|\le C\left( \Vert \xi _v\Vert _0+\Vert \xi _w\Vert _0\right) . \end{aligned}$$
(4.14)

Proof

From the second and fourth equations of (4.3), we can obtain

$$\begin{aligned}&(v_h+ 2k_2 w_h,\phi )_j+\mathcal {H}_j^*(u_h+2k_2 g_h,\phi ;\widehat{u_h}+2k_2 \widehat{g_h})=0, \\&(v_h- 2k_2 w_h,\phi )_j+\mathcal {H}_j^*(u_h-2k_2 g_h,\phi ;\widehat{u_h}-2k_2 \widehat{g_h})=0, \end{aligned}$$

with the fluxes satisfying

$$\begin{aligned}&\widehat{u_{h}}+2k_2\widehat{g_{h}}=(u_h+2k_2g_h)^{+}, \qquad \widehat{u_{h}}-2k_2\widehat{g_{h}}=(u_h-2k_2g_h)^{-}. \end{aligned}$$

Therefore, \(\langle u_h+2k_2g_h, v_h+ 2k_2 w_h \rangle \) and \(\langle u_h-2k_2g_h, v_h- 2k_2 w_h \rangle \) satisfy the assumptions of Lemma 2.4, and we have

$$\begin{aligned}&\Vert \xi _{u,x}+2k_2\xi _{g,x}\Vert _0+h^{-1/2}|[\xi _u+2k_2\xi _g]|\le C\Vert \xi _v+2k_2\xi _w\Vert _0\le C\left( \Vert \xi _v\Vert _0+\Vert \xi _w\Vert _0\right) , \end{aligned}$$
(4.15)
$$\begin{aligned}&\Vert \xi _{u,x}-2k_2\xi _{g,x}\Vert _0+h^{-1/2}|[\xi _u-2k_2\xi _g]|\le C\Vert \xi _v-2k_2\xi _w\Vert _0\le C\left( \Vert \xi _v\Vert _0+\Vert \xi _w\Vert _0\right) , \end{aligned}$$
(4.16)

and the results (4.13) and (4.14) follow from the fact that \(\xi _u=\frac{1}{2}(\xi _u+2k_2\xi _g)+\frac{1}{2}(\xi _u-2k_2\xi _g)\) and \(\xi _g=\frac{1}{4k_2}(\xi _u+2k_2\xi _g)-\frac{1}{4k_2}(\xi _u-2k_2\xi _g)\). \(\square \)

Theorem 4.2

Let \(u_h\), \(v_h\), \(g_h\) and \(w_h\) be the numerical solutions of dLDG scheme (4.3) with the numerical fluxes (4.4), and the numerical flux of the nonlinear term \({\widehat{f}}(u^-,u^+)\) chosen as (2.11). Let u, v, g and w be the exact solution of the problem (4.2) which are sufficiently smooth. For small h and all \(t\in [0,T]\), it holds that

$$\begin{aligned} \Vert e_u\Vert \le C h^{k+1}, \quad \Vert e_v\Vert \le C h^{k+1}, \quad \Vert e_g\Vert \le C h^{k+1}, \quad \Vert e_w\Vert \le C h^{k+1}. \end{aligned}$$
(4.17)

where the constant C may depend on T, k, the length of the domain I and some Sobolev norms of the exact solutions up to time T, but is independent of h.

The proof follows the same line as that of Theorem 2.4, and is skipped to save space.

4.3 Temporal Discretization

The fully discrete dLDG methods, coupled with the implicit midpoint temporal discretization, will be discussed in this section. They take the following form: we are looking for the solutions \(u^{n+1}_h\), \(v^{n+1}_h\), \(g^{n+1}_h\) and \(w^{n+1}_h\) for \(n=1,2,\ldots ,N-1\), such that

$$\begin{aligned} \left\{ \begin{aligned}&(\delta ^+_tu^n_{h},\phi _1)_j+\varepsilon \mathcal {H}_j^*(\delta ^+_tv^n_{h},\phi _1;\widehat{\delta ^+_tv_{h}^n})-\mathcal {F}_j^*(u^{n+\frac{1}{2}}_h,\phi _1;{\widehat{f}}^{n+\frac{1}{2}})=0,\\&(v^{n+\frac{1}{2}}_h,\phi _2)_j+\mathcal {H}_j^*(u^{n+\frac{1}{2}}_h,\phi _2;(\widehat{u_h})^{n+\frac{1}{2}})=0,\\&(\delta ^+_tg^n_{h},\phi _3)_j+\varepsilon \mathcal {H}_j^*(\delta ^+_tw^n_{h},\phi _3;\widehat{\delta ^+_tw^n_{h}})=0,\\&(w^{n+\frac{1}{2}}_h,\phi _4)_j+\mathcal {H}_j^*(g^{n+\frac{1}{2}}_h,\phi _4;(\widehat{g_h})^{n+\frac{1}{2}})=0, \end{aligned} \right. \end{aligned}$$
(4.18)

hold for all test functions \(\phi _1\), \(\phi _2\), \(\phi _3\) and \(\phi _4\)\(\in V^k\) on every cell \(I_j\). Here the nonlinear numerical flux \({\widehat{f}}^{n+\frac{1}{2}}\) can be chosen as (2.11), and the other numerical fluxes \(\widehat{\delta ^+_tv_{h}^n}, (\widehat{u_h})^{n+\frac{1}{2}}, \widehat{\delta ^+_tw_{h}^n}\), \(\widehat{(g_{h})}^{n+\frac{1}{2}}\) take the similar form as (4.4)

$$\begin{aligned} \left\{ \begin{aligned}&\widehat{\delta ^+_tv_{h}^n}=\{\delta ^+_tv_{h}^n\}+k_1[\delta ^+_tw^n_{h}],\\&(\widehat{u_{h}})^{n+\frac{1}{2}}=\{u_{h}^{n+\frac{1}{2}}\}+k_2[g^{n+\frac{1}{2}}_h],\\&\widehat{\delta ^+_tw_{h}^n}=\{\delta ^+_tw^n_{h}\}-k_2[\delta ^+_tv_{h}^n],\\&\widehat{(g_{h})}^{n+\frac{1}{2}}=\{g^{n+\frac{1}{2}}_{h}\}-k_1[u^{n+\frac{1}{2}}_h], \end{aligned} \right. \end{aligned}$$
(4.19)

where \(k_1k_2=-1/4\).

The mass and energy conservation property of the fully discrete dLDG methods is summarized below.

Theorem 4.3

Let \(u_h^n\), \(v_h^n\), \(g_h^n\) and \(w_h^n\) be the solutions of the fully discrete dLDG methods (4.18). With the discrete mass and energy defined as

$$\begin{aligned} M^n_h=\int _I u^n_h dx, \qquad E^n_{h}=\int _I \left( (u^n_h)^2+\varepsilon (v^n_{h})^2+(g^n_h)^2+\varepsilon (w^n_{h})^2\right) dx, \end{aligned}$$
(4.20)

the following mass conservation and energy dissipative property holds for any n

$$\begin{aligned} M^n_h=M^0_h, \qquad E^n_{h} = E^0_h. \end{aligned}$$
(4.21)

The implementation of the fully discrete dLDG methods (4.18) is similar to that of the LDG methods as discussed at the end of Sect. 2.4. The two additional equations are both linear. As the implicit temporal discretization is used, most of the computational time is spent on the nonlinear equation, therefore the computational cost of the dLDG method is not significantly more than that of the LDG method, which will be discussed in the numerical example section.

5 Numerical Experiments of the dLDG Methods

In this section, we provide some numerical results of the proposed dLDG methods with implicit midpoint temporal discretization. The accuracy test and the comparison of the dLDG and LDG methods will be studied. \(k_1=1/2\) and \(k_2=-1/2\) are chosen in the numerical experiments.

5.1 Accuracy Test

The same cnoidal-wave solution (1.4), studied in Sect. 3.1, is considered here to verify the convergence rate. The numerical error are computed at the stopping time \(T=1\). Similarly, we set the time-step as \(\tau =0.5877h^2\). Numerical order of accuracy of the dLDG method is given in Tables 10 and 11. Optimal order of accuracy of \(u_h, g_h, v_h, w_h\) can be observed with \(P^k\), \(k = 1, 2, 3\), basis functions, when the coupled projections \(\langle \pi ^u, \pi ^g\rangle \) are chosen to evaluate the numerical initial conditions. When \(L^2\) projection is used, optimal order of accuracy of \(u_h\) and \(g_h\) still can be observed, while the accuracy of \(v_h\) and \(w_h\) are not optimal any more (see Table 11). Note that the Central-LDG method delivers suboptimal error estimate of \(u_h\), and by doubling the unknowns, the proposed dLDG method gives optimal convergence rate. We have also tested other choices of \(k_1\), \(k_2\) (satisfying \(k_1k_2=-1/4\)), and observe the same behavior.

Figure 10 shows the time history of the error of mass and energy (i.e., \(M_h^N-M_h^0\) and \(E_h^N-E_h^0\)) of the dLDG methods, where we can see that the mass and energy are both exactly preserved to the machine error at the level of \(10^{-14}\).

Table 10 Numerical error and convergence orders of u, v, g and w of dLDG scheme in the cnoidal-wave example
Table 11 Numerical error and convergence orders of u, v, g and w of dLDG scheme in the cnoidal-wave example

5.2 Comparison of the dLDG and LDG Methods

Both the dLDG and C-C-LDG methods are optimal energy conserving methods for the BBM equation. A numerical comparison of these two methods is conducted in this section.

To provide a fair comparison, we provide the numerical results of the dLDG method with J elements, as well as the C-C-LDG methods with both J and 2J elements. In Fig. 11, we plot the time history of the \(L^2\) errors of \(u_h\) of C-C-LDG (\(J=10\) and \(J=20\)) and dLDG (\(J=10\)) methods with various \(P^k\) basis, for the same cnoidal-wave example. The stopping time is set as \(T=10\) with \(N=5120\) uniform time steps. We can see the \(L^2\) error of the dLDG (\(J=10\)) methods is between those of the C-C-LDG (\(J=10\)) and C-C-LDG (\(J=20\)) methods, for all of \(P^1\), \(P^2\) and \(P^3\) spaces. For \(P^2\) and \(P^3\) case, the growth rate of \(L^2\) error of the dLDG (\(J=10\)) method is similar to that of the C-C-LDG (\(J=20\)), while the initial error of the dLDG method at \(t=0\) is larger since less elements are used. It’s worth noting that for \(P^0\) case the \(L^2\) error of dLDG (\(J=10\)) and C-C-LDG (\(J=10\)) methods are the same, because one can actually show that with \(P^0\) basis the dLDG scheme simply reduces to the C-C-LDG scheme.

Fig. 10
figure 10

Errors of mass (left) and energy (right) of the dLDG method in Sect. 5.1 with \(J=10\), \(T=100\), \(N=2480\) and \(P^3\) polynomial basis

Fig. 11
figure 11

Time history of the numerical errors of \(u_h\) in \(L^2\) norm with uniform time cells \(N=4960\) for \(T=10\) of C-C-LDG (\(J=10\) and \(J=20\)) and dLDG (\(J=10\)) methods in the cnoidal-wave example with \(P^0\) (top left), \(P^1\) (top right), \(P^2\) (bottom left) and \(P^3\) (bottom right) polynomial basis

Table 12 Average computational times (in seconds) of 20 runs of C-C-LDG and dLDG method with \(N=5120\), \(T=10\), \(x_l=0\), \(x_r=0.92237\) and different J in the cnoidal-wave example

In Table 12, we list the average computational times (by taking the average of 20 runs) of C-C-LDG and dLDG methods with different J and various \(P^k\) basis. It can be observed that, with the same number of elements and \(P^k\) basis, the computational times of C-C-LDG and dLDG method are almost the same, since most of the computation is spent on solving the nonlinear equation when the implicit temporal discretization is used. In general, our computational tests suggest that, with the same number of elements, the dLDG method provides a smaller error than the LDG method, while maintaining slightly larger computational cost.

6 Conclusion Remarks

In this paper, we develop, analyze and numerically validate two classes of LDG methods for solving the nonlinear BBM equation. By introducing one auxiliary variable, and with appropriately chosen numerical fluxes, the conventional LDG methods can be shown to preserve the discrete version of mass, and either preserve or dissipate the discrete version of energy of the continuous solution, up to the round-off level. One contribution of the paper is to provide an optimal a priori error estimate for both the semi-discrete energy conserving and energy dissipative methods applied to the nonlinear BBM equation. To achieve this goal, we discover the connection between the error of the auxiliary and primary variables, and use it to bound the nonlinear term by the auxiliary variable. Fully discrete methods can be derived by coupled with energy-conserving implicit midpoint temporal discretization. Numerical experiments confirm the optimal rates of convergence, and the advantage of energy conserving method for long time simulation. We also present another class of energy conserving LDG methods for the nonlinear BBM equation, based on the doubling-the-unknowns technique in [36]. We investigate their energy conservation property, optimal convergence rate, and numerical comparison of these two energy conserving LDG methods.