1 Introduction

Numerous finite element methods for the incompressible Navier–Stokes equations result in approximate velocity fields that are not pointwise divergence-free. This lack of pointwise satisfaction of the continuity equation typically leads to violation of conservation laws beyond just mass conservation, such as conservation of energy. A key issue is that, in the absence of a pointwise solenoidal velocity field, the conservative and advective format of the Navier–Stokes equations are not equivalent. The review paper by John et al. [14] presents cases for the Stokes limit where the lack of pointwise enforcement of the continuity equation can lead to large solution errors. Elements that are stable (in sense of the inf-sup condition), but do not enforce the continuity equation pointwise, such as the Taylor–Hood, Crouzeix–Raviart, and MINI elements, can suffer from large errors in the pressure, which in turn can pollute the velocity approximation. The concept of ‘pressure-robustness’ to explain the aforementioned issues is discussed by John et al. [14]. A second issue is when a computed velocity field that is not pointwise divergence-free is used as the advective velocity in a transport solver. The lack of pointwise incompressibility can lead to spurious results and can compromise stability of the transport equation.

Discontinuous Galerkin (DG) finite element methods provide a natural framework for handling the advective term in the Navier–Stokes equations, and have been studied extensively in this context, e.g. [1, 8, 11, 12, 28, 31]. A difficulty in the construction of DG methods for the Navier–Stokes equations is that it is not possible to have both an energy-stable and locally momentum conserving method unless the approximate velocity is exactly divergence-free [8, p. 1068]. To overcome this problem, a post-processing operator was introduced by Cockburn et al. [8]. The operator, which is a slight modification of the Brezzi–Douglas–Marini interpolation operator (see e.g. [2]), applied to the DG approximate velocity field generates a post-processed velocity that is pointwise divergence-free. Key to the operator is that it can be applied element-wise and is therefore inexpensive to apply. A second issue with DG methods, and a common criticism, is that the number of degrees-of-freedom on a given mesh is considerably larger than for a conforming method. This is especially the case in three spatial dimensions.

An approach to representing pointwise divergence-free velocity fields is to use a \(H(\mathrm{div})\)-conforming velocity field, in which the normal component of the velocity is continuous across facets, together with a discontinuous pressure field from an appropriate space. Such a velocity space can be constructed by using a \(H(\mathrm{div})\)-conforming finite element space, or by enforcing the desired continuity via hybridization [2]. However, construction of \(H(\mathrm{div})\)-conforming methods for the Navier–Stokes (and Stokes) equations is not straightforward as the tangential components of the viscous stress on cell facets must be appropriately handled. Moreover, for advection dominated flows it is not immediately clear how the advective terms can be appropriately stabilized. Examples of hybridization for the Stokes equations can be found in [3, 5, 6], and for the Navier–Stokes equations in [19].

A synthesis of discontinuous Galerkin and hybridized methods has lead to the development of hybridizable discontinuous Galerkin (HDG) finite element methods [9, 16]. These methods were introduced with the purpose of reducing the computational cost of DG methods on a given mesh, while retaining the attractive conservation and stability properties of DG methods. This is achieved as follows. The governing equations are posed cell-wise in terms of the approximate fields on a cell and numerical fluxes, in which the latter depends on traces of the approximate fields and fields that are defined only on facets. Fields defined on a cell are not coupled directly to fields on neighboring cells, but ‘communicate’ only via the fields that are defined on facets. By coupling degrees of freedom on a cell only to degrees of freedom of the facet functions, cell degrees of freedom can be eliminated in favor of facet degrees of freedom only. The result is that the HDG global system of algebraic equations is significantly smaller than those obtained using DG.

It has been shown that, after post-processing, solutions obtained by HDG methods may show super-convergence results for elliptic problems (for polynomial approximations of order k, the order of accuracy is order \(k+2\) in the \(L^{2}\)-norm). This property has been exploited also in the context of the Navier–Stokes equations by, e.g., [4, 23]. Although the velocity field is not automatically pointwise divergence-free, a post-processing is applied that results in an approximate velocity field that is exactly divergence-free and \(H(\mathrm{div})\)-conforming and super-converges for low Reynolds number flows. Super-convergence is, however, lost when the flow is convection dominated.

We use the HDG approach to construct a simple discretization of the Navier–Stokes equations in which the computed velocity field is \(H(\mathrm{div})\)-conforming and pointwise divergence-free. To achieve this, we first note that unlike many other HDG methods for incompressible flows [4, 7, 10, 19, 22,23,24], the HDG methods of Labeur and Wells [17] and Rhebergen and Cockburn [25] involve facet unknowns for the pressure. The pressure field on a cell plays the role of cell-wise Lagrange multiplier to enforce the continuity equation, whereas the facet pressure unknowns play the role of Lagrange multipliers enforcing continuity of the normal component of the velocity across cell boundaries [26]. It was shown already in [17] that if the polynomial approximation of the element pressure on simplices is one order lower than the polynomial approximation of the velocity that the approximate velocity field is exactly divergence-free on cells. However, the method in [17] could not simultaneously satisfy mass conservation, momentum conservation and energy stability. This shortcoming is due to the computed velocity field for the method in [17] not being \(H(\mathrm{div})\)-conforming. We note that fast solvers for the Stokes part of the problem are developed and analysed in [27].

In this paper we show that if the facet pressure space is chosen appropriately, we obtain approximate velocity fields that are \(H(\mathrm{div})\)-conforming and pointwise divergence-free. We are guided in this by the stability analysis in [26] for the Stokes problem, which provides guidance on the permissible function spaces. The consequences of this modification of the method of [17] are profound: the method proposed in this work results in a scheme that is both mass and momentum conserving (locally and globally), energy stable and pressure-robust. We summarize properties of the proposed method and those of [17] in Table 1.

Table 1 Summary of the properties of the method of [17] and the proposed method of this paper. The skew-symmetric and divergence forms refer to different formulations of the momentum equation. In [17] both an equal- and mixed-order velocity–pressure approximation are introduced

The remainder of this paper is organized as follows. Section 2 briefly introduces the Navier–Stokes problem, which is followed by the main result of this paper in Sect. 3; a momentum conserving and energy stable HDG method for the Navier–Stokes equations with pointwise solenoidal and \(H(\mathrm{div})\)-conforming velocity field. Numerical results are presented in Sect. 4 and conclusions are drawn in Sect. 5.

2 Incompressible Navier–Stokes Problem

Let \(\varOmega \subset \mathbb {R}^d\) be a polygonal (\(d = 2\)) or polyhedral (\(d = 3\)) domain with boundary outward unit normal n, and let the time interval of interest be given by \(I = (0,t_N]\). Given the kinematic viscosity \(\nu \in \mathbb {R}^+\) and forcing term \(f : \varOmega \times I \rightarrow \mathbb {R}^d\), the Navier–Stokes equations for the velocity field \(u : \varOmega \times I \rightarrow \mathbb {R}^d\) and kinematic pressure field \(p : \varOmega \times I \rightarrow \mathbb {R}\) are given by

$$\begin{aligned} \partial _t u + \nabla \cdot \sigma&= f&\text{ in } \ \varOmega \times I, \end{aligned}$$
(1a)
$$\begin{aligned} \nabla \cdot u&= 0&\text{ in } \ \varOmega \times I, \end{aligned}$$
(1b)

where \(\sigma \) is the momentum flux:

$$\begin{aligned} \sigma := \sigma _a +\sigma _d \quad \text{ with } \quad \sigma _a := u \otimes u \quad \text{ and } \quad \sigma _d := p \mathbb {I} - \nu \nabla u, \end{aligned}$$
(2)

and \(\mathbb {I}\) is the identity tensor and \((a \otimes b)_{ij} = a_i b_j\).

We partition the boundary of \(\varOmega \) such that \(\partial \varOmega = \varGamma _D \cup \varGamma _N\) and \(\varGamma _D \cap \varGamma _N = \emptyset \). Given \(h : \varGamma _N \times I \rightarrow \mathbb {R}^d\) and a solenoidal initial velocity field \(u_0 : \varOmega \rightarrow \mathbb {R}^d\), we prescribe the following boundary and initial conditions:

$$\begin{aligned} u= & {} 0 \quad \quad \qquad \text{ on } \ \varGamma _D \times I,\end{aligned}$$
(3a)
$$\begin{aligned} \sigma \cdot n - \max \left( u \cdot n, 0\right) {u}= & {} h \quad \quad \qquad \text{ on } \ \varGamma _N\times I, \end{aligned}$$
(3b)
$$\begin{aligned} u(x, 0)= & {} u_0(x) \qquad \text{ in } \ \varOmega . \end{aligned}$$
(3c)

On inflow parts of \(\varGamma _{N}\) (\(u \cdot n < 0\)) we impose the total momentum flux, i.e., \(\sigma \cdot n = h\). On outflow parts of \(\varGamma _N\) (\( u \cdot n \ge 0\)), only the diffusive part of the momentum flux is prescribed, i.e., \(\sigma _d \cdot n = h\).

Equation (1a) is the conservative form of the Navier–Stokes equation. With satisfaction of the incompressibility constraint, Eq. (1b), the momentum equation (1a) can be equivalently expressed as:

$$\begin{aligned} \partial _t u + (1 - \chi ) u \cdot \nabla u + \chi \nabla \cdot \sigma _a + \nabla \cdot \sigma _d = f, \end{aligned}$$
(4)

where \(\chi \in [0, 1]\). For numerous finite element methods, the approximate velocity field is not pointwise or locally (in a weak sense) solenoidal. In such cases, it can be shown that momentum is conserved if \(\chi = 1\), while energy stability can be proven if \(\chi = 1/2\). For stabilized finite element methods in which the continuity equation is not satisfied locally, manipulations of the advective term can be applied to achieve momentum conservation [13].

The mass conserving (mixed-order) hybridizable discontinuous Galerkin method of Labeur and Well [17] is based on a weak formulation of Eq. (4). It was proven to be locally momentum conserving for \(\chi = 1\) and energy stable for \(\chi = 1/2\), but in their analysis both properties could not be satisfied simultaneously. We will prove how the method can be formulated such that mass and momentum conservation, and energy stability can be satisfied simultaneously, and the method be made invariant with respect to \(\chi \).

3 A Hybridizable Discontinuous Galerkin Method

We present a hybridizable discontinuous Galerkin method for the Navier–Stokes problem for which the approximate velocity field is pointwise divergence-free.

3.1 Preliminaries

Let \(\mathcal {T} := \left\{ K\right\} \) be a triangulation of the domain \(\varOmega \) into non-overlapping simplex cells K. The boundary of a cell is denoted by \(\partial K\) and the outward unit normal vector on \(\partial K\) by n. Two adjacent cells \(K^+\) and \(K^-\) share an interior facet \(F := \partial K^+ \cap \partial K^-\). A facet of \(\partial K\) that lies on the boundary of the domain \(\partial \varOmega \) is called a boundary facet. The sets of interior and boundary facets are denoted by \(\mathcal {F}_I\) and \(\mathcal {F}_B\), respectively. The set of all facets is denoted by \(\mathcal {F} := \mathcal {F}_I \cup \mathcal {F}_B\).

3.2 Semi-discrete Formulation

Consider the following finite element spaces:

$$\begin{aligned} V_h&:= \left\{ v_h \in \left[ L^2(\mathcal {T})\right] ^d, \ v_h \in \left[ P_k(K)\right] ^d \forall K \in \mathcal {T}\right\} ,\end{aligned}$$
(5a)
$$\begin{aligned} \bar{V}_h&:= \left\{ \bar{v}_h \in \left[ L^2(\mathcal {F})\right] ^d, \ \bar{v}_h \in \left[ P_k(F)\right] ^d \forall F \in \mathcal {F},\bar{v}_h = 0 \ \text{ on } \ \varGamma _D\right\} ,\end{aligned}$$
(5b)
$$\begin{aligned} Q_h&:= \left\{ q_h \in L^2(\mathcal {T}),\ q_h \in P_{k-1}(K)\ \forall K\in \mathcal {T}\right\} ,\end{aligned}$$
(5c)
$$\begin{aligned} \bar{Q}_h&:= \left\{ \bar{q}_h \in L^2(\mathcal {F}),\ \bar{q}_h \in P_{k}(F) \forall F\in \mathcal {F}\right\} , \end{aligned}$$
(5d)

where \(P_l(D)\) denotes the space of polynomials of degree \(l > 0\) on a domain D. Note that the spaces \(V_{h}\) and \(Q_{h}\) are defined on the whole domain \(\mathcal {T}\), whereas the spaces \(\bar{V}_{h}\) and \(\bar{Q}_{h}\) are defined only on facets of the triangulation.

The spaces \(V_h\) and \(Q_h\) are discontinuous across cell boundaries, hence the trace of a function \(a \in V_h\) may be double-valued on cell boundaries. At an interior facet, F, we denote the traces of \(a \in V_{h}\) by \(a^+\) and \(a^-\). We introduce the jump operator \([[ {a}]]:= a^+ \cdot n^+ + a^- \cdot n^-\), where \(n^{\pm }\) the outward unit normal on \(\partial K^{\pm }\).

We now state the weak formulation of the proposed method: given a forcing term \(f \in [{L^2(\varOmega )}]^d,\) boundary condition \(h \in [{L^2(\varGamma _N)}]^d\) and viscosity \(\nu \), find \(u_h, \bar{u}_h, p_h,\bar{p}_h \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) such that:

$$\begin{aligned} 0 =&\sum _K\int _K u_h \cdot \nabla q_h \mathrm{d}x - \sum _K \int _{\partial K} u_h\cdot n \, q_h \mathrm{d}s \quad \forall q_{h} \in Q_{h},\end{aligned}$$
(6a)
$$\begin{aligned} 0 =&\sum _K\int _{\partial K} u_h\cdot n \, \bar{q}_h \mathrm{d}s - \int _{\partial \varOmega } \bar{u}_h\cdot n \, \bar{q}_h \mathrm{d}s \quad \forall \bar{q}_{h} \in \bar{Q}_{h}, \end{aligned}$$
(6b)

and

$$\begin{aligned} \int _{\varOmega } f \cdot v_h \mathrm{d}x= & {} \int _{\varOmega } \partial _t u_h \cdot v _h \mathrm{d}x -\sum _K \int _K \sigma _{h} : \nabla v_h \mathrm{d}x +\sum _K \int _{\partial K} \hat{\sigma }_{h} : \left( v_h\otimes n\right) \mathrm{d}s\nonumber \\&+\, \sum _K\int _{\partial K}\nu \left( \left( \bar{u}_h - u_h\right) \otimes n\right) : \nabla v_h\mathrm{d}s \quad \forall v_{h} \in V_{h}, \end{aligned}$$
(6c)
$$\begin{aligned} \int _{\varGamma _N} h \cdot \bar{v}_h\mathrm{d}s= & {} \sum _K\int _{\partial K} \hat{\sigma }_{h} : \left( \bar{v}_h \otimes n\right) \mathrm{d}s \nonumber \\&-\, \int _{\varGamma _N} \left( 1 - \lambda \right) \left( \bar{u}_h \cdot n\right) \bar{u}_h \cdot \bar{v}_h\mathrm{d}s \quad \forall \bar{v}_{h} \in \bar{V}_{h}, \end{aligned}$$
(6d)

where \(\hat{\sigma }_h := \hat{\sigma }_{a,h} + \hat{\sigma }_{d,h}\) is the ‘numerical flux’ on cell facets. The advective part of the numerical flux is given by:

$$\begin{aligned} \hat{\sigma }_{a,h} := \sigma _{a,h} + \left( \bar{u}_h - u_h\right) \otimes \lambda u_h, \end{aligned}$$
(7)

where \(\lambda \) is an indicator function that takes on a value of unity on inflow cell boundaries (where \(u_h \cdot n < 0\)) and a value of zero on outflow cell facets (where \(u_h \cdot n \ge 0\)). This definition of the numerical flux provides upwinding of the advective component of the flux. The diffusive part of the numerical flux is defined as

$$\begin{aligned} \hat{\sigma }_{d,h} := \bar{p}_h \mathbb {I} - \nu \nabla u_h - \frac{\nu \alpha }{h_K} \left( \bar{u}_h - u_h\right) \otimes n, \end{aligned}$$
(8)

where \(\alpha > 0\) is a penalty parameter as is typical of Nitsche and interior penalty methods. It is proven in [26, 32] that \(\alpha \) needs to be sufficiently large to ensure stability.

A key feature of this formulation, and what distinguishes it from standard discontinuous Galerkin methods, is that functions on cells (functions in \(V_h\) and \(Q_h\)) are not coupled across facets directly via the numerical flux. Rather, fields on neighboring cells are coupled via the facet functions \(\bar{u}_{h}\) and \(\bar{p}_{h}\). The fields \(u_{h}\) and \(p_{h}\) can therefore be eliminated locally via static condensation, resulting in a global system of equations in terms of the facet functions only. This substantially reduces the size of the global systems compared to a standard discontinuous Galerkin method on the same mesh, yet still permits the natural incorporation of upwinding and cell-wise balances.

The weak formulation presented here is the weak formulation of Labeur and Wells [17] with conservative form of the advection term \(\chi = 1\) in Eq. 4). The key difference is that we have been more prescriptive on the relationships between the finite element spaces in Eq. (5), and we will prove that this leads to some appealing properties. In particular, the spaces in Eq. (5) are such that: for \(u_h \in {[P_k(K)]}^d\), \(\nabla \cdot u_h \in P_{k-1}(K)\) and \(u_h \cdot n \in P_{k}(F)\); and for \(\bar{u}_h \in {[P_{k}(F)]}^d\), \(\bar{u}_h\cdot n \in P_{k}(F)\). Furthermore, the function spaces have been chosen such that the resulting method is inf-sup stable, see [26]. The resulting weak formulation can be shown to be equivalent to a weak formulation in which the approximate velocity field lies in the Brezzi–Douglas–Marini (BDM) finite element space [26, Section 3.4]. Hybridization of other \(H(\mathrm{div})\) conforming finite element spaces, see e.g. [2], are also possible.

Proposition 1

(Mass conservation) If \(u_h \in V_h\) and \(\bar{u}_h \in \bar{V}_h\) satisfy Eq. (6), with \(V_h\) and \(\bar{V}_h\) defined in Eq. (5), then

$$\begin{aligned} \nabla \cdot u_h = 0 \qquad \forall x \in K,\ \forall K \in \mathcal {T}, \end{aligned}$$
(9)

and

$$\begin{aligned}{}[[ {u_{h} }]]= & {} 0 \, \quad \qquad \qquad \forall x \in F,\ \forall F\in \mathcal {F}_I,\end{aligned}$$
(10a)
$$\begin{aligned} u_h \cdot n= & {} \bar{u}_h \cdot n \quad \qquad \forall x \in F,\ \forall F\in \mathcal {F}_B. \end{aligned}$$
(10b)

Proof

Applying integration-by-parts to Eq. (6a):

$$\begin{aligned} 0= \int _K q_h \nabla \cdot u_h \mathrm{d}x \qquad \forall q_{h} \in P_{k-1}(K), \ \forall K \in \mathcal {T}. \end{aligned}$$
(11)

Since \(q_{h}\), \(\nabla \cdot u_h \in P_{k-1}(K)\), pointwise satisfaction of the continuity equation, Eq. (9), follows.

It follows from Eq. (6b) that:

$$\begin{aligned} 0 = \sum _{F\in \mathcal {F}_I} \int _{F}[[ {u_{h} }]]\bar{q}_h \mathrm{d}s + \sum _{F\in \mathcal {F}_B} \int _{F} \left( u_h - \bar{u}_h \right) \cdot n \bar{q}_h \mathrm{d}s \quad \forall \bar{q}_{h} \in \bar{Q}_{h}. \end{aligned}$$
(12)

Since \(\bar{q}_{h}\), \(u_h \cdot n\), \(\bar{u}_h \cdot n \in P_{k}(F)\), Eq. (10) follows. \(\square \)

Proposition 1 is a stronger statement of mass conservation than in Labeur and Wells [17, Proposition 4.2], in which mass conservation for the mixed-order case was proved locally (cell-wise) in an integral sense only. Under certain conditions, implementations in [17] satisfy Eq. (9), but not Eq. (10). We will show that this difference is critical for the formulation in this work as it allows simultaneous satisfaction of momentum conservation and energy stability.

We next show momentum conservation for the semi-discrete weak formulation in terms of the numerical flux.

Proposition 2

(Momentum conservation) Let \(u_h, \bar{u}_h, p_h, \bar{p}_h \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) satisfy Eq. (6). Then,

(13)

Furthermore, if \(\varGamma _D = \emptyset \),

(14)

Proof

In Eq. (6c), set \(v_h = e_j\) on K, where \(e_j\) is a canonical unit basis vector, and set \(v_h = 0\) on \(\mathcal {T} \backslash K\) in Eq. (6c):

(15)

which proves Eq. (13). Equation (14) follows immediately by setting \(v_h = e_j\) in Eq. (6c), \(\bar{v}_h = - \,e_j\) in Eq. (6d) and summing the two results. \(\square \)

We next prove that the method is also globally energy stable.

Proposition 3

(Global energy stability) If \(u_h, \bar{u}_h, p_h, \bar{p}_h \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) satisfy Eq. (6), for homogeneous boundary conditions, \(f = 0\) and for a suitably large \(\alpha \):

(16)

Proof

Setting \(q_h = -p_h\), \(\bar{q}_h = -\bar{p}_h\), \(v_h = u_h\) and \(\bar{v}_h = -\,\bar{u}_h\) in Eqs. (6a)–(6d) and inserting the expressions for the numerical fluxes (Eqs. (2), (7) and (8)), and summing:

$$\begin{aligned}&\sum _K \frac{1}{2} \int _K \partial _t \left| u_h\right| ^2 \mathrm{d}x + \sum _K \frac{1}{2} \int _{\partial K} \left( u_{h} \cdot n\right) \left| u_h\right| ^{2} \mathrm{d}s\nonumber \\&\quad - \sum _K \frac{1}{2} \int _{\partial K} \left( u_{h} \cdot n\right) \left| \bar{u}_h\right| ^{2} \mathrm{d}s + \sum _K \frac{1}{2} \int _{\partial K} \left| u_h \cdot n\right| \left| u_h - \bar{u}_h\right| ^2 \mathrm{d}s\nonumber \\&\quad + \sum _K \int _K \nu \left| \nabla u_h\right| ^2 \mathrm{d}x + \sum _K \int _{\partial K} \frac{\nu \alpha }{h_K} \left| \bar{u}_h - u_h\right| ^2 \mathrm{d}s\nonumber \\&\quad + \, 2\sum _K \int _{\partial K} \nu \left( \nabla u_h \cdot n\right) \cdot \left( \bar{u}_h - u_h\right) \mathrm{d}s + \int _{\varGamma _N} (1-\lambda )(\bar{u}_h \cdot n) \left| \bar{u}_h\right| ^2 \mathrm{d}s\nonumber \\&\quad - \sum _K \int _K \left( u_h \otimes u_h\right) : \nabla u_h \mathrm{d}x = 0, \end{aligned}$$
(17)

where we have used that \(\lambda u_{h} \cdot n = \left( u_{h} \cdot n - |u_{h} \cdot n|\right) /2\), and applied integration-by-parts to the pressure gradient terms. Since \(\bar{u}_h\) is single-valued on facets, the normal component of \(u_h\) is continuous across facets and \(\bar{u}_h \cdot n = u_{h} \cdot n\) on the domain boundary (see Proposition 1), the third integral on the left-hand side of Eq. (17) can be simplified:

$$\begin{aligned} - \sum _K \frac{1}{2} \int _{\partial K} \left( u_{h} \cdot n\right) \left| \bar{u}_h\right| ^{2} \mathrm{d}s = - \frac{1}{2} \int _{\varGamma _N} \left( \bar{u}_h \cdot n\right) \left| \bar{u}_h\right| ^{2} \mathrm{d}s. \end{aligned}$$
(18)

We consider now the last term on the left-hand side of Eq. (17). On each cell K it holds that \(-\,u_h \otimes u_h : \nabla u_h = (\nabla \cdot u_h)(u_h \cdot u_h)/2 - \nabla \cdot ((u_h \otimes u_h) \cdot u_h)/2 = -\, \nabla \cdot ((u_h \otimes u_h) \cdot u_h)/2\), since \(\nabla \cdot u_h = 0\) (by Proposition 1). It follows that

$$\begin{aligned} - \sum _K \int _K \left( u_h \otimes u_h\right) : \nabla u_h \mathrm{d}x = -\frac{1}{2} \sum _K \int _{\partial K} \left( u_{h} \cdot n\right) \left| u_{h}\right| ^{2} \mathrm{d}s. \end{aligned}$$
(19)

Combining Eqs. (17)–(19),

$$\begin{aligned} \frac{1}{2} \sum _K \int _K \partial _t \left| u_h\right| ^2 \mathrm{d}x= & {} -\frac{1}{2}\sum _K \int _{\partial K} \left| u_h \cdot n\right| \left| u_h - \bar{u}_h\right| ^2 \mathrm{d}s\nonumber \\&-\sum _K \int _K \nu \left| \nabla u_h\right| ^2 \mathrm{d}x - \sum _K \int _{\partial K} \frac{\nu \alpha }{h_K} \left| \bar{u}_h - u_h\right| ^2 \mathrm{d}s\nonumber \\&- \,2 \sum _K \int _{\partial K} \nu \left( \nabla u_h n\right) \cdot \left( \bar{u}_h - u_h\right) \mathrm{d}s\nonumber \\&- \frac{1}{2} \int _{\varGamma _N} \left| \bar{u}_h \cdot n\right| \left| \bar{u}_h\right| ^2 \mathrm{d}s, \end{aligned}$$
(20)

where we have used that

$$\begin{aligned} \int _{\varGamma _N} (1 - \lambda )(\bar{u}_h \cdot n) \left| \bar{u}_h\right| ^2 \mathrm{d}s - \frac{1}{2} \int _{\varGamma _N} \left( \bar{u}_h \cdot n\right) \left| \bar{u}_h\right| ^{2} \mathrm{d}s = \frac{1}{2} \int _{\varGamma _N} \left| \bar{u}_h \cdot n\right| \left| \bar{u}_h\right| ^2 \mathrm{d}s. \end{aligned}$$
(21)

It can be proven that there exists an \(\alpha > 0\), independent of \(h_K\), such that

$$\begin{aligned}&\sum _K \int _K \nu \left| \nabla u_h\right| ^2 \mathrm{d}x + \sum _K \int _{\partial K} \frac{\nu \alpha }{h_K} \left| \bar{u}_h - u_h\right| ^2 \mathrm{d}s\nonumber \\&\quad \ge 2 \left| \sum _K \int _{\partial K} \nu \left( \nabla u_h \cdot n\right) \cdot \left( \bar{u}_h - u_h\right) \mathrm{d}s\right| , \end{aligned}$$
(22)

(see [32, Lemma 5.2] and [26, Lemma 4.2]). Therefore, the right-hand side of Eq. (20) is non-positive, proving Eq. (16). \(\square \)

The key results that enable us to prove global energy stability for this conservative form of the Navier–Stokes equations are: (a) the pointwise solenoidal velocity field; and (b) continuity of the normal component of the velocity field across facets. The latter point is not fulfilled by the method in [17].

3.3 A Fully-Discrete Weak Formulation

We now consider a fully-discrete formulation. We partition the time interval I into an ordered series of time levels \(0 = t^0< t^1< \cdots < t^N\). The difference between each time level is denoted by \(\varDelta t^n = t^{n+1} - t^{n}\). To discretize in time, we consider the \(\theta \)-method and denote midpoint values of a function y by \(y^{n + \theta } := (1-\theta )y^n + \theta y^{n+1}\). Following Labeur and Wells [17], the convective velocity will be evaluated at the current time \(t^n\), thereby linearizing the problem, i.e.:

$$\begin{aligned} \sigma _{h}^{n + \theta } = \sigma _{a,h}^{n+\theta } + \sigma _{d,h}^{n + \theta } \qquad \text{ where } \qquad \sigma _{a,h}^{n + \theta } = u_h^{n+\theta } \otimes u_h^n, \end{aligned}$$
(23)

and

$$\begin{aligned} \hat{\sigma }_{h}^{n + \theta } = \hat{\sigma }_{a,h}^{n + \theta } + \hat{\sigma }_{d,h}^{n+\theta } \qquad \text{ where } \qquad \hat{\sigma }_{a,h}^{n+\theta } = \sigma _{a,h}^{n + \theta } + \left( \bar{u}_h^{n+\theta } - u_h^{n+\theta }\right) \otimes \lambda u_h^n. \end{aligned}$$
(24)

The time-discrete counterpart of Eq. (6) is: given \(u_{h}^n, \bar{u}_{h}^n, p_{h}^n, \bar{p}_{h}^n \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) at time \(t^n\), the forcing term \(f^{n+\theta } \in {[L^2(\varOmega )]}^d,\) the boundary condition \(h^{n+\theta } \in {[L^2(\varGamma _N)]}^d,\) and the viscosity \(\nu \), find \(u_{h}^{n+1}, \bar{u}_{h}^{n+1}, p_{h}^{n+1}, \bar{p}_{h}^{n+1} \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) such that mass conservation,

$$\begin{aligned} 0 =&\sum _K \int _K u_{h}^{n+1} \cdot \nabla q_h \mathrm{d}x - \sum _K\int _{\partial K} u_{h}^{n+1} \cdot n \, q_h \mathrm{d}s,\end{aligned}$$
(25a)
$$\begin{aligned} 0 =&\sum _K\int _{\partial K} u_{h}^{n+1} \cdot n \, \bar{q}_h \mathrm{d}s - \int _{\partial \varOmega } \bar{u}_{h}^{n+1} \cdot n \, \bar{q}_h \mathrm{d}s, \end{aligned}$$
(25b)

and momentum conservation,

$$\begin{aligned} \int _{\varOmega } f^{n + \theta } \cdot v_h \mathrm{d}x= & {} \int _{\varOmega } \frac{u_{h}^{n+1} - u_{h}^{n}}{\varDelta t^n} \cdot v_h \mathrm{d}x -\sum _K \int _K \sigma _{h}^{n+\theta } : \nabla v_h \mathrm{d}x \nonumber \\&+\sum _K \int _{\partial K} \hat{\sigma }_{h}^{n+\theta } : v_h\otimes n \mathrm{d}s\nonumber \\&+ \sum _K \int _{\partial K} \nu \left( \left( \bar{u}_{h}^{n+\theta } - u_{h}^{n+\theta }\right) \otimes n\right) : \nabla v_h\mathrm{d}s, \end{aligned}$$
(25c)
$$\begin{aligned} \int _{\varGamma _N} h^{n+\theta } \cdot \bar{v}_h\mathrm{d}s= & {} \sum _K \int _{\partial K} \hat{\sigma }_{h}^{n+\theta } : \bar{v}_h \otimes n \mathrm{d}s \nonumber \\&- \int _{\varGamma _N} \left( 1 - \lambda \right) \left( \bar{u}_{h}^{n} \cdot n\right) \bar{u}_{h}^{n+\theta } \cdot \bar{v}_h\mathrm{d}s, \end{aligned}$$
(25d)

are satisfied for all \(v_h, \bar{v}_h, q_h, \bar{q}_h \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\). Here \(\lambda \) is evaluated using the known velocity field at time \(t^n\).

In Sect. 3.2 we proved that the semi-discrete formulation Eq. (6) is momentum conserving, energy stable and exactly mass conserving when using the function spaces given by Eq. (5). We show next that the fully-discrete formulation given by Eq. (25) inherits these properties.

Proposition 4

(Fully-discrete mass conservation) If \(u_{h}^{n+1} \in V_h\) and \(\bar{u}_{h}^{n+1} \in \bar{V}_h\) satisfy Eq. (25), then

$$\begin{aligned} \nabla \cdot u_{h}^{n+1} = 0 \qquad \forall x \in K,\ \forall K\in \mathcal {T}, \end{aligned}$$
(26)

and

$$\begin{aligned} {[[ {u_{h}^{n+1}}]]}= & {} 0 \, \ \qquad \qquad \qquad \forall x \in \mathcal {F},\ \forall \mathcal {F} \in \mathcal {F}_I,\end{aligned}$$
(27a)
$$\begin{aligned} u_{h}^{n+1} \cdot n= & {} \bar{u}_{h}^{n+1} \cdot n \quad \quad \quad \forall x \in \mathcal {F},\ \forall \mathcal {F} \in \mathcal {F}_B. \end{aligned}$$
(27b)

Proof

The proof is similar to that of Proposition 1 and therefore omitted. \(\square \)

Proposition 5

(Fully-discrete momentum conservation) If \(u_{h}^{n}, \bar{u}_{h}^{n}, p_{h}^{n}, \bar{p}_{h}^{n} \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) and \(u_{h}^{n+1}, \bar{u}_{h}^{n+1}, p_{h}^{n+1}, \bar{p}_{h}^{n+1} \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) satisfy Eq. (25), then

$$\begin{aligned} \int _K \frac{u_{h}^{n+1} - u_{h}^{n}}{\varDelta t^{n}} \mathrm{d}x = \int _K f^{n + \theta } \mathrm{d}x - \int _{\partial K}\hat{\sigma }_{h}^{n + \theta } n \mathrm{d}s \quad \forall K \in \mathcal {T}. \end{aligned}$$
(28)

Furthermore, if \(\varGamma _D = \emptyset \),

$$\begin{aligned} \sum _K \int _K \frac{u_{h}^{n + 1} - u_{h}^{n}}{\varDelta t^{n}} \mathrm{d}x= & {} \sum _K \int _K f^{n+\theta } \mathrm{d}x - \int _{\partial \varOmega } (1 - \lambda )(\bar{u}_{h}^{n} \cdot n) \bar{u}_{h}^{n + \theta } \mathrm{d}s \nonumber \\&- \int _{\partial \varOmega } h^{n + \theta } \mathrm{d}s. \end{aligned}$$
(29)

Proof

The proof is similar to that of Proposition 2 and therefore omitted. \(\square \)

Proposition 6

(Fully-discrete energy stability) If \(u_{h}^{n}, \bar{u}_{h}^{n}, p_{h}^{n}, \bar{p}_{h}^{n} \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) and \(u_{h}^{n+1}, \bar{u}_{h}^{n+1}, p_{h}^{n+1}, \bar{p}_{h}^{n+1} \in V_h \times \bar{V}_h \times Q_h \times \bar{Q}_h\) satisfy Eq. (25), then with homogeneous boundary conditions, no forcing terms, for suitably large \(\alpha \), and \(\theta \ge 1/2\),

$$\begin{aligned} \sum _K \int _K \left| u_{h}^{n+1}\right| ^2 \mathrm{d}x \le \sum _K \int _K \left| u_{h}^{n}\right| ^2 \mathrm{d}x. \end{aligned}$$
(30)

Proof

Setting \(q_h = -\,\theta p_{h}^{n+\theta }\), \(\bar{q}_h = -\,\theta \bar{p}_{h}^{n + \theta }\), \(v_h = u _{h}^{n + \theta }\) and \(\bar{v}_h = -\,\bar{u}_{h}^{n + \theta }\), in Eqs. (25a)–(25d), adding the results, using the expressions for the diffusive fluxes, given by Eqs. (2) and (8), partial integration of the pressure gradient terms and using that \(\nabla \cdot u_{h}^{n} = 0\) by Proposition 4, we obtain, using the same steps as in the proof of Proposition 3,

$$\begin{aligned}&\int _{\varOmega } \frac{u_{h}^{n+1} - u_{h}^{n}}{\varDelta t^n} \cdot u_{h}^{n+\theta } \mathrm{d}x + \sum _K \frac{1}{2} \int _{\partial K} \left| u_{h}^{n} \cdot n\right| \left| u_{h}^{n+\theta } - \bar{u}_{h}^{n+\theta }\right| ^2 \mathrm{d}s\nonumber \\&\quad +\sum _K \int _K \nu \left| \nabla u_{h}^{n+\theta }\right| ^2 \mathrm{d}x +\sum _K \int _{\partial K} \frac{\nu \alpha }{h_K} \left| \bar{u}_{h}^{n+\theta } - u_{h}^{n+\theta }\right| ^2 \mathrm{d}s\nonumber \\&\quad + \, 2\sum _K \int _{\partial K} \nu \left( \nabla u_{h}^{n+\theta } \cdot n\right) \left( \bar{u}_{h}^{n+\theta } - u_{h}^{n+\theta }\right) \mathrm{d}s\nonumber \\&\quad +\, \frac{1}{2} \int _{\varGamma _N} \left| \bar{u}_{h}^{n} \cdot n\right| \left| \bar{u}_{h}^{n+\theta }\right| ^2 \mathrm{d}s = 0. \end{aligned}$$
(31)

The first term on the left-hand side of Eq. (31) can be reformulated as

$$\begin{aligned}&\int _{\varOmega } \frac{u_{h}^{n+1} - u_{h}^{n}}{\varDelta t^n} \cdot u_{h}^{n+\theta } \mathrm{d}x = \left( \theta - \frac{1}{2}\right) \int _{\varOmega } \frac{\left| u_{h}^{n+1} - u_{h}^{n}\right| ^2}{\varDelta t^n} \mathrm{d}x \nonumber \\&\quad + \frac{1}{2} \int _{\varOmega } \frac{\left| u_{h}^{n+1}\right| ^2}{\varDelta t^n} \mathrm{d}x - \frac{1}{2} \int _{\varOmega } \frac{\left| u_{h}^{n}\right| ^2}{\varDelta t^n} \mathrm{d}x. \end{aligned}$$
(32)

Inserting this expression into Eq. (31):

$$\begin{aligned}&\frac{1}{2} \int _{\varOmega } \frac{\left| u_{h}^{n+1}\right| ^2}{\varDelta t^n} \mathrm{d}x - \frac{1}{2} \int _{\varOmega } \frac{\left| u_{h}^{n}\right| ^2}{\varDelta t^n} \mathrm{d}x = -\left( \theta - \frac{1}{2}\right) \int _{\varOmega } \frac{\left| u_{h}^{n+1} - u_{h}^{n}\right| ^2}{\varDelta t^n} \mathrm{d}x\nonumber \\&\quad -\sum _K \frac{1}{2} \int _{\partial K} \left| u_{h}^{n} \cdot n\right| \left| u_{h}^{n+\theta } - \bar{u}_{h}^{n+\theta }\right| ^2 \mathrm{d}s\nonumber \\&\quad - \,2\sum _K \int _{\partial K} \nu \left( \nabla u_{h}^{n+\theta } \cdot n\right) \left( \bar{u}_{h}^{n+\theta } - u_{h}^{n+\theta }\right) \mathrm{d}s\nonumber \\&\quad -\sum _K \int _{\partial K} \frac{\nu \alpha }{h_K} \left| \bar{u}_{h}^{n+\theta } - u_{h}^{n+\theta }\right| ^2\mathrm{d}s\nonumber \\&\quad - \frac{1}{2} \int _{\varGamma _N} \left| \bar{u}_{h}^{n} \cdot n\right| \left| \bar{u}_{h}^{n+\theta } \right| ^2 \mathrm{d}s - \sum _K \int _K \nu \left| \nabla u_{h}^{n+\theta }\right| ^2 \mathrm{d}x. \end{aligned}$$
(33)

As in Proposition 3, there exists an \(\alpha > 0\), independent of \(h_K\), such that the right hand side of Eq. (33) is non-positive. The result follows. \(\square \)

4 Numerical Examples

We now demonstrate the performance of the method for a selection of numerical examples, paying close attention to mass and momentum conservation, and energy stability.

For all stationary examples considered, exact solutions are known. For the stationary examples we use a fixed-point iteration with stopping criterion \(|e_p^{i+1} - e_p^{i}|/(e_p^{i+1} + e_p^{i}) \le \mathrm{TOL}\), where \(e_p^i\) is the pressure error in the \(L^2\) norm at the ith iterate, and \(\mathrm{TOL}\) is a given tolerance that we set to \(10^{-4}\). All unsteady examples use \(\theta = 1\). In all examples we set the penalty parameter to be \(\alpha = 6k^2\).

In the implementation we apply cell-wise static condensation such that only the degrees-of-freedom associated with the facet spaces appear in the global system. Compared to standard discontinuous Galerkin methods, this significantly reduces the size of the global system. We could eliminate the facet pressure field and use a BDM element, see [19], and the BDM normal velocity in place of \(\bar{u}_{h} \cdot n\). However, we feel that handling all fields in a hybridized framework offers some simplicity.

Examples have been implemented using the NGSolve finite element library [30]. All examples use unstructured simplicial meshes.

4.1 Kovasznay Flow

We consider the steady, two-dimensional analytical solution of the Navier–Stokes equations from Kovasznay [15] on a domain \(\varOmega = \left( -\,0.5, 1\right) \times \left( -\,0.5, 1.5\right) \). For a Reynolds number \( Re \), let the viscosity be given by \(\nu = 1 / Re \). The solution to the Kovasznay problem is:

$$\begin{aligned} u_x&= 1 - e^{\lambda x_{1}} \cos (2 \pi x_{2}), \quad \end{aligned}$$
(34a)
$$\begin{aligned} u_y&= \frac{\lambda }{2 \pi } e^{\lambda x_{1}} \sin (2\pi x_{2}), \quad \end{aligned}$$
(34b)
$$\begin{aligned} p&= \frac{1}{2} \left( 1 - e^{2\lambda x_{1}}\right) + C, \end{aligned}$$
(34c)

where C is an arbitrary constant, and where

$$\begin{aligned} \lambda = \frac{ Re }{2} - \left( \frac{ Re ^2}{4} + 4 \pi ^2\right) ^{1/2} \end{aligned}$$
(35)

We choose C such that the mean pressure on \(\varOmega \) is zero. The Kovasznay flow solution in Eq. (34) is used to set Dirichlet boundary conditions for the velocity on \(\partial \varOmega \).

The \(L^2\)-error and rates of convergence are presented in Table 2 for \( Re = 40\) using a series of refined meshes. Optimal rates of convergence are observed for both the velocity field (order \(k + 1\)) and pressure field (order k). The divergence of the approximate velocity field is of machine precision in all cases.

Table 2 Computed velocity, pressure and divergence errors in the \(L^2\) norm for the HDG method applied to the Kovasznay problem

4.2 Position-Dependent Coriolis Force

We now consider the test case from [20, Section 3.2]. In particular, we consider on the unit square \((0, 1) \times (0, 1)\) the steady Navier–Stokes equations augmented with a position-dependent Coriolis force: \(\nabla \cdot \sigma + 2C \times u = 0\) and \(\nabla \cdot u = 0\), where we set \(2 C \times u = -\, 2 x_{2} (-\,u_2, u_1)\). On boundaries we set \(u = (1, 0)\). The exact solution to this problem is given by \(p = x_{2}^2 - 1/3\) and \(u = (1, 0)\).

It was shown in [20] that the Scott–Vogelius finite element, in which the velocity is approximated in divergence-free function spaces, is able to produce the exact velocity field while the velocity computed using a Taylor–Hood finite element method is polluted by the pressure error, in part due to the approximate velocity field not being exactly divergence-free. Furthermore, it is shown in [20] that as \(\nu \rightarrow 0\), the velocity error increases for the Taylor–Hood finite element method.

In Table 3 we show the results obtained using the HDG method presented in Sect. 3 for \(k = 2\). It shows the computed error in the \(L^2\) norm for the velocity, pressure and divergence errors. Errors in the velocity and velocity divergence are of machine precision, regardless of \(\nu \). The HDG method therefore obtains the same quality of solution as produced using the Scott–Vogelius finite element in [20]. We do not consider the \(k = 3\) case because for this discretization the pressure is approximated by quadratic polynomials and so the pressure error is also of machine precision.

Table 3 Computed errors in the \(L^2\) norm for the HDG method with the position-dependent Coriolis forcing term with different viscosity values. Note that the pressure error does not depend on the viscosity

4.3 Pressure-Robustness

We next demonstrate that our method is pressure-robust and compare the results with those obtained using the method of [17]. For this we use a test case proposed in [18, Section 6.1]. On the unit square \((0,1)\times (0,1)\) we consider the steady Navier–Stokes equations where the boundary conditions and source terms are such that the exact solution is given by \(u = \mathrm {curl} \zeta \), with \(\zeta = x_{1}^2 (x_{1} - 1)^2 x_{2}^2 (x_{2} - 1)^2\) and \(p = x_{1}^7 + x_{2}^7 - 1/4\). We choose \(k = 3\) and vary the viscosity \(\nu \).

For a mixed velocity-pressure approximation, it can be proven that the method of [17] results in an approximate velocity field that is pointwise divergence free, but not \(H(\mathrm{div})\)-conforming. As such, the method of [17] cannot be shown to be pressure-robust. This is confirmed by the results presented in Table 4. For the method of [17] it is observed that the error in the velocity field depends on \(\nu ^{-1}\Vert p_h - p\Vert \), while the proposed method is pressure robust. The velocity error does not change with viscosity in Table 4.

Table 4 Computed errors in the \(L^2\) norm for the HDG method with different viscosity values. A comparison of the proposed method with the method of [17]. Note that the errors in the velocity for the proposed method do not depend on \(\nu \), in contrast with the method of [17]

4.4 Transient Higher-Order Potential Flow

In this test, taken from [21, Section 6.6], we solve the time dependent Navier–Stokes equations Eq. (1) on the domain \(\varOmega = [-1, 1]^2\). This test case studies the time-dependent exact velocity \(u(t) = \min (t, 1) \nabla \chi \) where \(\chi \) is a smooth harmonic potential given by \(\chi = x_{1}^3 x_{2} - x_{2}^3 x_{1}\). The pressure gradient then satisfies \(\nabla p = -\, \nabla \left| u\right| ^2/2 - \partial _t \left( \min (t, 1) \nabla \chi \right) \). We impose the exact velocity solution as Dirichlet boundary condition on all of \(\partial \varOmega \).

For the simulations we used a grid with 2048 cells, set the time step equal to \(\varDelta t = 0.01\) and compute the solution on the time interval [0, 2]. Figure 1 shows the velocity and pressure errors as a function of time. We used both \(k = 2\) and \(k = 3\), and consider \(\nu = 1/500\) and \(\nu = 1/2000\). We observe that the error in pressure and velocity is more or less the same regardless of \(\nu \).

Over the computational time interval, using \(k = 2\) or \(k = 3\) on a mesh with 2048 cells, for either \(\nu = 1/500\) and \(\nu = 1/2000\), the \(L^2\)-norm of the divergence reaches \(1.4 \times 10^{-10}\) in one point but is otherwise always of the order \(10^{-11}\). The momentum balance, in absolute value, never exceeds \(3.4 \times 10^{-12}\).

Fig. 1
figure 1

Velocity and pressure errors in the \(L^2\) norm for the transient higher-order potential flow test case. Approximations were obtained using \(k = 2\) and \(k = 3\) on a mesh with 2048 cells

4.5 Two-Dimensional Flow Past a Circular Obstacle

In this test case we consider flow past a circular obstacle (see e.g. [19, 29]). The domain is a rectangular channel, \([0, 2.2] \times [0, 0.41]\), with a circular obstacle of radius \(r = 0.05\) centered at (0.2, 0.2). On the inflow boundary (\(x_{1} = 0\)) we prescribe the \(x_{1}\)-component of the velocity to be \(u_1 = 6 x_{2} (0.41 - x_{2})/0.41^2\). The \(x_{2}\)-component of the velocity is prescribed as \(u_2 = 0\). Homogeneous Dirichlet boundary conditions are applied on the walls (\(x_{2} = 0\) and \(x_{2} = 0.41\)), and on the obstacle. On the outflow boundary (\(x_{1} = 2.2\)) we prescribe \(\sigma _d \cdot n = 0\). The viscosity is set as \(\nu = 10^{-3}\). We choose \(k = 3\) and set \(\varDelta t = 5 \times 10^{-5}\) so that the spatial discretization error dominates the temporal discretization error. For the initial condition, we impose the steady Stokes solution of this problem. The mesh of the domain has 6784 cells and we consider the time interval [0, 5].

At each time step we compute the drag and lift coefficients, which are defined as

$$\begin{aligned} C_D = -\frac{1}{r}\int _{\varGamma _c} \left( \sigma _d \cdot n\right) \cdot e_1 \mathrm{d}s, \qquad C_L = -\frac{1}{r}\int _{\varGamma _c} \left( \sigma _d \cdot n\right) \cdot e_2 \mathrm{d}s, \end{aligned}$$
(36)

where \(e_{1}\) and \(e_{2}\) are unit vectors in the \(x_{1}\) and \(x_{2}\) directions, respectively, and \(\varGamma _C\) is the surface of the circular object. We compute a maximum drag coefficient of \(C_D = 3.23232\) and minimum drag coefficient of \(C_D = 3.16583\). The maximum and minimum lift coefficients we compute are, respectively, \(C_L = 0.98251\) and \(C_L = -\,1.02246\). These are comparable to those found in literature [19, 29]. The velocity magnitude at \(t = 5\) is shown Fig. 2.

Fig. 2
figure 2

Two-dimensional flow past a cylinder test case: velocity magnitude past a two-dimensional circular object in a channel at \(t = 5\). Approximations were obtained using \(k = 3\) on a mesh with 6784 cells

4.6 Three-Dimensional Flow Past a Cylinder

In this test case we consider three-dimensional flow past a cylinder (see e.g. [19, 29]) with a time dependent inflow velocity. The domain is a cuboid shaped channel \([0, 2.5] \times [0, 0.41] \times [0, 0.41]\) with a cylinder of radius \(r_\mathrm{cyl} = 0.05\) around the \(x_{3}\)-axis centered at \((x_{1}, x_{2}) = (0.5, 0.2)\). On the inflow boundary (\(x_{1} = 0\)) we prescribe the \(x_{1}\)-component of the velocity to be \(u_1 = 36 \sin (\pi t/ 8) x_{2} x_{3}(0.41 - x_{2})(0.41 - x_{3})/0.41^4\). The \(x_{2}\)- and \(x_{3}\)-components of the velocity are prescribed as \(u_2 = 0\) and \(u_{3} = 0\). We impose homogeneous Dirichlet boundary conditions on the walls (\(x_{2} = 0\), \(x_{2} = 0.41\), \(x_{3} = 0\) and \(x_{3} = 0.41\)) and on the cylinder. On the outflow boundary (\(x_{1} = 2.5\)) we prescribe \(\sigma _d \cdot n = 0\). The viscosity is set as \(\nu = 10^{-3}\).

Fig. 3
figure 3

Three-dimensional flow past a cylinder test: slice through a 3D channel showing the 3D velocity magnitude past a cylinder in a channel at \(t = 4\). Approximations were obtained using \(k = 3\) on a mesh with 4091 cells

We choose \(k = 3\) and set \(\varDelta t = 5 \times 10^{-4}\) so that the spatial discretization error dominates the temporal discretization error. The initial condition is the Stokes solution to this problem. The mesh has 4091 cells and we compute on the time interval [0, 8]. At each time step we compute the drag and lift coefficients, defined by Eq. (36), where \(r = 0.41 r_\mathrm{cyl}\) and \(\varGamma _C\) is the surface of the cylinder. We compute maximum drag and lift coefficients of \(C_D = 2.98815\) and \(C_L = 0.00348\), respectively. Compared to Schäfer et al. [29], in which the maximum drag and lift coefficients lie in the intervals \(C_D \in [3.2000, 3.3000]\) and \(C_L \in [0.0020, 0.0040]\), we slightly under-predict the drag coefficient, but the lift coefficient lies within the same interval. Figure 3 shows the velocity magnitude at \(t = 4\).

5 Conclusions

We have introduced a formulation of a hybridizable discontinuous Galerkin method for the incompressible Navier–Stokes equations that computes velocity fields that are pointwise divergence-free. The construction of solenoidal velocity fields does not require post-processing or the use of finite dimensional spaces of divergence-free functions. The pointwise satisfaction of the continuity equation and the continuity of the normal component of the velocity field across cell facets allows us to prove that the method conserves momentum locally (cell-wise) and is energy stable. This is in contrast with the closely related method in Labeur and Wells [17] which when satisfying the continuity equation pointwise can satisfy local momentum conservation or global energy stability, but not both simultaneously. The analysis that we present is supported by a range of numerical examples in two and three dimensions.