Finite volume discretization of heat equation and compressible Navier–Stokes equations with weak Dirichlet boundary condition on triangular grids



A vertex-based finite volume method for Laplace operator on triangular grids is proposed in which Dirichlet boundary conditions are implemented weakly. The scheme satisfies a summation-by-parts (SBP) property including boundary conditions which can be used to prove energy stability of the scheme for the heat equation. A Nitsche-type penalty term is proposed which gives improved accuracy. The scheme exhibits second order convergence in numerical experiments. For the compressible Navier–Stokes equations we construct a finite volume scheme in which Dirichlet boundary conditions on the velocity and temperature are applied in a weak manner. Using the centered kinetic energy preserving flux, the scheme is shown to be consistent with the global kinetic energy equation. The SBP discretization of viscous and heat conduction terms together with penalty terms are combined with upwind fluxes in a Godunov-MUSCL scheme. Numerical results on some standard test cases for compressible flows are given to demonstrate the performance of the scheme.


Finite volume Triangular grids SBP Energy stability Compressible Navier–Stokes Kinetic energy preservation 

1 Introduction

Finite volume methods might be cell-centered or vertex-centered depending on the spatial location of the solution. In the latter case, a dual finite volume has to be constructed around each vertex, including vertices on the boundary. On triangular/tetrahedral grids, the vertex-based scheme has a flavour of finite element method using \(P_1\) basis functions, especially for the discretization of Laplacian term [1]. A difficulty that presents itself with vertex-centered scheme is the implementation of boundary conditions since there are degrees of freedom located on the boundaries. For the Poisson or heat equation, one can directly set the Dirichlet boundary condition for vertices on the boundary and update only the interior vertices using the finite volume method. This is the strong implementation of the boundary condition. For compressible Navier–Stokes equations, the no-slip boundary condition can be implemented strongly; but there are additional variables due to density and energy. The usual practice is to update all the quantities for a boundary vertex using the finite volume method and then reset the velocity to satisfy the no-slip condition. The degrees of freedom in a compressible model are the mass density, momentum density and energy density while boundary conditions are usually provided on velocity and temperature, which are not degrees of freedom but are derived quantities from the actual degrees of freedom.

In a weak implementation of Dirichlet boundary conditions, one updates boundary points also using the finite volume method which should implicitly account for the boundary conditions. The boundary vertex value is not reset to the boundary condition value as in the strong implementation, so that the solution on the boundary vertices do not exactly agree with the Dirichlet conditions. It is not necessary to exactly satisfy the boundary conditions since anyway the interior solution is only approximate. The error in the boundary solution should be acceptable as long as it is of the same order as the error of the interior solution and the global error converges at expected rates. It must also be remembered that the solution of a finite volume method denotes cell average values and not point values. The cell average value is a second order approximation to the solution at the centroid of the finite volume. For a dual cell around a boundary vertex, the cell lies only on one side of the boundary and the cell centroid does not lie on the boundary. The solution at a boundary vertex in a finite volume method thus represents the average value in the boundary cell and is not the value of the solution at the boundary vertex.

The guiding principle in the construction of a scheme with weakly implemented boundary conditions is the satisfaction of an energy estimate that is consistent with the energy estimate of the exact solution of the partial differential equation. Thus the boundary conditions are chosen so that the resulting scheme is stable in \(L_2\)-norm. At the mathematical level, energy stability is obtained by using integration by parts and its discrete counterpart is the summation-by-parts (SBP) property [2, 3]. This can also be characterized in terms of the skew-symmetry and symmetry properties of the difference approximations to convective (first order) and diffusive (second order) partial differential operators. In order to obtain energy stability in the presence of boundary conditions, the simultaneous approximation term (SAT) approach [4] has been used which imposes the boundary conditions in a weak manner. On Cartesian and structured grids, SBP-SAT schemes have been developed for hyperbolic and parabolic problems, including the Euler and Navier–Stokes equations [5, 6]. For a linear convection–diffusion equation, weak boundary conditions in a second order SBP-SAT scheme are found to give more accurate solutions on coarse meshes while on finer meshes, the strong implementation was more accurate [7] and similar behavior was observed for the solution of Navier–Stokes equations. Weak imposition of boundary conditions is found to lead to faster convergence of solutions to steady state problems while in the case of strong imposition, the residuals may not converge to machine precision [8].

Mimetic schemes [9] are constructed to satisfy the equations of integral calculus like divergence theorem and related identities, which endows them with SBP properties. Dirichlet boundary conditions have been implemented strongly in mimetic methods on logically rectangular grids for Poisson equation [10]. A kinetic energy preserving scheme for incompressible Navier–Stokes equations on logically rectangular grids is proposed in [11]. Stable SBP schemes on unstructured grids for hyperbolic problems using vertex-based finite volume method have been studied in [12] where boundary conditions are imposed weakly through the fluxes using a local characteristic decomposition that separates incoming and outgoing waves. Higher order mimetic methods which have SBP property have been developed in [13] for diffusion equation but boundary conditions and their influence on stability property was not analyzed. For the discretization of second order terms on unstructured grids, there are few works which have studied the energy stability property. Svard and Nordstrom [14, 15] study the vertex-based discretization of Laplacian on unstructured grids using an edge-based scheme which is shown to be stable since resulting matrix has negative eigenvalues. For boundary vertices, they construct two dual cells to obtain an estimate of the normal derivative of the solution which is used to compute the flux across the boundary faces. In numerical experiments they find that the scheme does not converge even on a uniform triangulated Cartesian grid, while convergence is obtained only with equilateral grids. An alternate approach to the edge-based scheme is to use a \(P_1\) Galerkin approximation on triangles that leads to a compact scheme for the Laplacian operator [1, 16]; it is exact for affine functions and leads to a convergent scheme for the Laplace operator on triangular grids. Consistency of the schemes with respect to energy evolution can be considered as a secondary conservation principle satisfied by the scheme. A recent review of discrete conservation principles on unstructured grids leading to second conservation properties can be found in [17].

In this work we restrict ourselves to triangular grids in two spatial dimensions and consider the vertex-based finite volume scheme. We construct a scheme for the Laplacian which is similar to the \(P_1\) Galerkin approach but we incorporate boundary conditions within the gradient approximations used for the Laplacian which implicitly accounts for an SAT approach. This allows us to show a SBP property for the Laplacian approximation including boundary conditions which also leads to a discrete energy equation for the solution of heat equation. We also propose the addition of a Nitsche-type penalty term [18] for Dirichlet boundary conditions which enhances the accuracy of the scheme; the penalty term is not necessary for the stability of the scheme. Through numerical experiments on the heat equation, we show that the solutions converge at a rate of \(O(h^2)\) where h is a typical size of the triangles. These ideas are extended to the compressible Navier–Stokes equations for the discretization of viscous terms and heat conduction terms appearing in the momentum and energy equation. No-slip and isothermal boundary conditions are implemented in a weak manner and Nitsche-type penalty terms are also used in the momentum and energy equations. Using a kinetic energy preserving central flux [19], we show that the scheme is consistent for the global kinetic energy evolution. The SBP discretizations of viscous and heat conduction terms are then combined with a numerical flux function in a Godunov finite volume scheme for which higher order accuracy can be obtained via the MUSCL approach. The discretization of diffusive terms can be implemented in existing finite volume codes with little extra modifications. The presented schemes can be naturally extended to three dimensions on tetrahedral grids. However it is not easy to develop similar methods for hybrid grids. In two dimensions we have only succeeded in constructing an SBP scheme on grids containing triangles and parallelograms.

The rest of the paper is organized as follows. Section 2 introduces the new SBP discretization for the Laplacian and shows the SBP property. Section 3 presents the finite volume scheme for Poisson equation and its solvability is shown. The scheme is then applied to heat equation in Sect. 4 and an energy equation is demonstrated for the semi-discrete scheme. Numerical experiments on steady and unsteady heat conduction problems are given to demonstrate the convergence properties. Section 5 discusses the application of the new scheme to the compressible Navier–Stokes equations for which a global kinetic energy balance equation is demonstrated which is consistent with the true balance equation. Then the SBP scheme is combined with a Godunov-MUSCL scheme. Finally, many numerical results are shown for compressible flows in two dimensions and for axisymmetric rotating flow.

2 Finite volume approximation of Laplacian

Consider a discretization of the domain \(\varOmega \) by triangles. The nodes of the triangles are denoted by the letters ijk etc. For each triangle we define the outward normal vectors as shown in Fig. 1 with the magnitude of the vector equal to the length of the corresponding edge; e.g., \({\mathbf {n}}_i^T\) denotes the outward normal to the face in triangle T which is opposite to the vertex i. We will distinguish between two types of triangles referred to as interior and boundary triangles. An interior triangle does not have any of its faces on the Dirichlet boundaries while a boundary triangle has atleast one face on some Dirichlet boundary. The derivative is approximated on a triangle by the Green–Gauss theorem
$$ \int _T \nabla u {\text{d}}x = \int _{\partial T} u {\mathbf {n}}{\text {d}}s = \sum _{e \in \partial T} \int _{e} u {\mathbf {n}}{\text {d}}s $$
The surface integral is approximated by the trapezoidal rule. Then for an interior triangle, the gradient approximation is given by
$$\begin{aligned} \nabla _h u^T & = \frac{1}{|T|}\left[ \frac{u_i + u_j}{2} {\mathbf {n}}_k^T + \frac{u_j + u_k}{2} {\mathbf {n}}_i^T + \frac{u_k + u_i}{2} {\mathbf {n}}_j^T \right] \end{aligned}$$
$$\begin{aligned} &= - \frac{1}{2|T|} \left[ u_i {\mathbf {n}}_i^T + u_j {\mathbf {n}}_j^T + u_k {\mathbf {n}}_k^T\right] \end{aligned}$$
The second expression follows from the fact that \({\mathbf {n}}_i^T+{\mathbf {n}}_j^T+{\mathbf {n}}_k^T=0\). The first form given by Eq. (2) is more fundamental since it is a direct consequence of the Green–Gauss theorem and will be useful for enforcing Dirichlet boundary conditions. If we construct the \(P_1\) interpolant on the triangle and take its gradient, then the result is identical to the above expressions. The gradient on a boundary triangle \(T_e\) adjacent to a boundary edge e, see Fig. 2, is given by Eq. (1) but we make use of the Dirichlet boundary condition for the integral on the boundary edge e; This leads to the following approximation for the gradient on \(T_e\)
$$ \nabla _h u^{T_e} = \frac{1}{|T_e|}\left[ \frac{f_i + f_j}{2} {\mathbf {n}}_k^{T_e} + \frac{u_j + u_k}{2} {\mathbf {n}}_i^{T_e} + \frac{u_k + u_i}{2} {\mathbf {n}}_j^{T_e} \right] $$
Note that we have used the Dirichlet boundary condition only for the integral on the boundary edge \({\mathbf {n}}_k^T\) in the Green–Gauss formula; for the other edges, the solution values \(u_i\), \(u_j\) are used. Since the boundary conditions are to be implemented weakly during the solution of the PDE, the solution values\(u_i,u_j\)need not exactly coincide with the boundary values\(f_i\), \(f_j\). This is an important point about the scheme we present and must be remembered when reading the rest of the paper. We make the following definitions
$$\begin{aligned} i \in T &= \{{\text {all}}\,{\text{vertices}} \,i\,{\text {belonging}}\,{\text {to}}\,{\text{triangle}}\,T\} \\ T \in i &= \{{\text{all}}\,{\text{triangles}}\,T\,{\text{having}}\,{\text{vertex}}\,i \} \\ \varGamma &= \{{\text {all}}\,{\text {boundary}}\,{\text {edges}} \} \\ \varGamma _i &= \{{\text{all}}\,{\text{boundary}}\,{\text{edges}}\,{\text {having}}\,{\text {vertex}}\,i\}\end{aligned}$$
For an interior vertex i the set \(\varGamma _i\) is empty. Around each vertex i, we construct the dual cell by joining the cell centroid to the mid-point of the edges, see Fig. 3a. For a boundary vertex, the cell is closed by the boundary edges as shown in Fig. 3b. Integrate the Laplacian over a dual cell \(A_i\) to obtain
$$\int _{A_i} \varDelta u {\text {d}}x = \int _{\partial A_i \setminus \varGamma } \frac{\partial u}{\partial n} {\text {d}}s + \int _{\partial A_i \cap \varGamma } \frac{\partial u}{\partial n} {\text {d}}s $$
The flux integral on the right involves contributions from the interior boundaries of the dual cell \(A_i\) and the boundaries of \(\varOmega \) if the dual cell is adjacent to the boundary. For the part of the boundary of \(A_i\) which is inside a triangle T, we estimate \(\nabla u \approx \nabla _h u^T\) while for a boundary edge integral on an edge e, the gradient from the adjacent triangle \(T_e\) is used. This leads to the following approximation to the Laplacian
$$ (\varDelta _h u)_i = \frac{1}{A_i} \left[ \frac{1}{2} \sum _{T \in i} \nabla _h u^T \cdot {\mathbf {n}}_i^T + \frac{1}{2} \sum _{e \in \varGamma _i} \nabla _h u^{T_e} \cdot {{\mathbf {n}}_e}\right]$$
For two functions uv defined on \(\varOmega \) with \(u=f\), \(v=g\) on \(\partial \varOmega \), we have the relation
$$\int _{\varOmega }v \varDelta u {\text {d}}x = - \int _{\varOmega } \nabla u \cdot \nabla v {\text {d}}x + \int _{\partial \varOmega } g \frac{\partial u}{\partial n} {\text {d}}s $$
We next show that the discrete approximation to the Laplacian given by Eq. (5) satisfies an analogous property which is usually called summation-by-parts property. This is also crucial for showing the existence of solution to Poisson problem and energy stability for the time dependent problem like heat equation.
Fig. 1

Definition of edge normals

Fig. 2

A boundary triangle

Fig. 3

Definition of dual finite volume for a interior vertex and b boundary vertex

Theorem 1

Letu, vbe two functions defined on\(\varOmega \)with\(u=f\), \(v=g\)on\(\partial \varOmega \). Then the discrete approximation given by Eq. (5) satisfies the summation-by-parts property
$$\sum _i v_i (\varDelta _h u)_i A_i = - \sum _T \left( \nabla _h u^T \cdot \nabla _h v^T\right) |T| + \sum _{e \in \varGamma } \left( \frac{g_i + g_j}{2}\right) \nabla _h u^{T_e} \cdot {{\mathbf {n}}_e}$$
where the verticesi, jform the boundary edgee.


Multiply Eq. (5) by \(v_i\) and sum over all vertices.
$$ \sum _i v_i (\varDelta _h u)_i A_i = \frac{1}{2} \sum _i \sum _{T \in i} v_i \nabla u^T \cdot {\mathbf {n}}_i^T + \frac{1}{2} \sum _i \sum _{e \in \varGamma _i} v_i \nabla u^{T_e} \cdot {{\mathbf {n}}_e}$$
Interchanging the order of the summation, we get
$$ \sum _i v_i (\varDelta _h u)_i A_i =\frac{1}{2} \sum _T \sum _{i \in T} v_i \nabla u^T \cdot {\mathbf {n}}_i^T + \sum _{e \in \varGamma } \left( \frac{v_i + v_j}{2}\right) \nabla u^{T_e} \cdot {{\mathbf {n}}_e}$$
The second term involves boundary contributions and we note that \(v_i\) need not be equal to the boundary value \(g_i\). We now consider the first term on the right hand side of Eq. (8). For an interior triangle T, we use the second form of the gradient formula, Eq. (3), to get
$$ \frac{1}{2} \sum _{i \in T} v_i \nabla _h u^T \cdot {\mathbf {n}}_i^T = \nabla _h u^T \cdot \frac{1}{2} \sum _{i \in T} v_i {\mathbf {n}}_i^T = - \nabla _h u^T \cdot \nabla _h v^T |T| $$
For a boundary triangle \(T_e\) adjacent to a boundary edge e, we need to account for the Dirichlet conditions. Assume that the edge e is bounded by the vertices ij while k is the third vertex of the triangle \(T_e\) so that \({{\mathbf {n}}_e}={\mathbf {n}}_k^{T_e}\), see Fig. 2; using the Eqs. (2), (3), (4) we obtain
$$ \frac{1}{2} \sum _{i \in T_e} v_i \nabla _h u^{T_e} \cdot {\mathbf {n}}_i^{T_e} =-\nabla _h u^{T_e} \cdot \left[ \frac{v_i + v_j}{2} {\mathbf {n}}_k^{T_e}+ \frac{v_j + v_k}{2} {\mathbf {n}}_i^{T_e} + \frac{v_k + v_i}{2} {\mathbf {n}}_j^{T_e} \right] |T_e| $$
Adding and subtracting Dirichlet boundary values, we can write the above formula as
$$\begin{aligned} \frac{1}{2} \sum _{i\in T_e}v_i\nabla _h u^{T_e}\cdot {\mathbf {n}}_i^{T_e} &= -\nabla _h u^{T_e}\cdot \left[ \frac{g_i + g_j}{2} {\mathbf {n}}_k^{T_e} + \frac{v_j + v_k}{2}{\mathbf {n}}_i^{T_e}+\frac{v_k+v_i}{2} {\mathbf {n}}_j^{T_e}\right] |T_e|\nonumber \\&-\nabla _h u^{T_e}\cdot \left[ \frac{v_i+v_j}{2} {\mathbf {n}}_k^{T_e}- \frac{g_i + g_j}{2}{\mathbf {n}}_k^{T_e}\right] \nonumber \\ &= -\nabla _h u^{T_e}\cdot \nabla _h v^{T_e}|T_e|-\nabla _h u^{T_e}\cdot \left[ \frac{v_i+v_j}{2}{{\mathbf {n}}_e}-\frac{g_i+g_j}{2} {{\mathbf {n}}_e}\right] \end{aligned}$$
Using (9) and (10) we have shown that
$$\begin{aligned} \frac{1}{2}\sum _{i\in T}v_i\nabla _h u^T\cdot {\mathbf {n}}_i^T &= -\sum _T \nabla _h u^T\cdot \nabla _h v^T |T|\nonumber \\&\quad -\sum _{e\in \varGamma }\nabla _h u^{T_e}\cdot \left[ \frac{v_i+v_j}{2}{{\mathbf {n}}_e}-\frac{g_i+g_j}{2} {{\mathbf {n}}_e}\right] \end{aligned}$$
From (8) and (11) we obtain the desired result and the proof is complete. Due to the incorporation of the boundary condition within the gradient approximation, we are able to replace the term \(\frac{v_i+v_j}{2}\) in Eq. (8) with the value \(\frac{g_i+g_j}{2}\) which is then consistent with the exact Eq. (6). \(\square \)


Interchanging the role of u and v, we obtain the following SBP formula
$$ \sum _i u_i(\varDelta _h v)_i A_i=-\sum _T\left( \nabla _h u^T\cdot \nabla _h v^T\right) |T|+\sum _{e\in \varGamma } \left( \frac{f_i+f_j}{2}\right) \nabla _h v^{T_e}\cdot {{\mathbf {n}}_e}$$
If both uv vanish on the boundary, i.e., \(f=g=0\), then
$$ \sum _i v_i (\varDelta _h u)_i A_i = \sum _i u_i (\varDelta _h v)_i A_i $$
which shows that the discrete Laplacian \(\varDelta _h\) is self adjoint. In the analysis of numerical schemes, this property is important to show optimal convergence rates of the error in \(L_2\) norm but we do not have a theoretical proof for the schemes presented here.


The use of the gradient approximation given by Eq. (4) was important in the above proof. If we use the second form of the gradient in Eq. (3) and strongly implement the boundary conditions, then the gradient for a boundary triangle would be
$$ \nabla u^{T_e} = - \frac{1}{2|T_e|} \left[ f_i {\mathbf {n}}_i^T + f_j {\mathbf {n}}_j^T + u_k {\mathbf {n}}_k^T \right]$$
But using this approximation does not lead to the summation by parts property as given in Eq. (7).

3 Finite volume method for Poisson equation

In this section we consider the Dirichlet problem for the Poisson equation
$$\begin{aligned} -\varDelta u &= s \quad {\text {in}} \quad \varOmega \\ u &= f \quad {\text {on}} \quad \partial \varOmega \end{aligned}$$
so that \(\varGamma = \partial \varOmega = \varGamma ^D\). We will use the finite volume approximation to the Laplacian given by Eq. (5) and in addition add a penalty term inspired by the Nitsche method and discontinuous Galerkin methods. The finite volume method is given by
$$ - A_i \varDelta _h u_i + \sum _{e \in \varGamma _i} \frac{C_p}{2 h_e} (u_i - f_i) |{{\mathbf {n}}_e}| = A_i s_i $$
where \(C_p\ge 0\) controls the penalty term and \(h_e\) is a mesh length associated with the edge e. In the computations, we take \(h_e\) to be the height of the triangle adjacent to the edge e, i.e.,
$$ h_e = \frac{2 |T_e|}{|{{\mathbf {n}}_e}|} $$
The penalty term does not destroy the consistency of the method since if we substitute the exact solution in (13) then the penalty term vanishes. Note that the scheme (13) includes the boundary conditions and is applied at all the vertices. We next state the existence and uniqueness of solution to the above finite volume scheme.

Theorem 2

Consider the finite volume scheme given by Eq. (13).
  1. 1.

    If\(C_p> 0\), then it has a unique solution.

  2. 2.

    If\(C_p=0\)and if all boundary vertices belong to at atleast one interior triangle, then it has a unique solution.

  3. 3.

    If\(C_p=0\)and if at least one boundary vertex belongs to at atleast one interior triangle, then it has a unique solution.



Equation (13) is a linear equation for the \(u_i\) and it will have a unique solution if we can show that in the case of the homogeneous problem \(f=s=0\), the only solution is the zero solution. Hence assuming homogeneous data, multiply Eq. (13) by \(u_i\) and sum over all vertices
$$ -\sum _i A_i u_i \varDelta _h u_i + \sum _i \sum _{e \in \varGamma _i} \frac{C_p}{2 h_e} u_i^2 |{{\mathbf {n}}_e}| = 0 $$
Using the summation by parts property (7), this equation becomes
$$ \sum _T \Vert \nabla _h u^T\Vert ^2 |T| + \sum _{e \in \varGamma } \frac{C_p}{2 h_e} \left( u_i^2 + u_j^2\right) |{{\mathbf {n}}_e}| = 0 $$
We now consider different cases in the theorem.
  1. 1.
    Assume that \(C_p> 0\). Then
    $$\nabla _h u^T = 0 \quad \forall \quad T \qquad {\text {and}} \qquad u_i = 0 \quad \forall \quad i \in \varGamma $$
    On an interior triangle T we have
    $$ \nabla _h u^T = -\frac{1}{2|T|}\left[ (u_j-u_i){\mathbf {n}}_j^T+(u_k-u_i){\mathbf {n}}_k^T\right] =0 $$
    and since \({\mathbf {n}}_j^T\), \({\mathbf {n}}_k^T\) are linearly independent, we conclude that \(u_i = u_j = u_k\). On a boundary triangle \(T_e\) adjacent to a boundary edge e as in Fig. 2 we have from Eq. (4)
    $$ \nabla _h u^{T_e} = \frac{1}{|T|}\left[ \frac{0 + 0}{2} {\mathbf {n}}_k^T + \frac{0 + u_k}{2} {\mathbf {n}}_i^T + \frac{u_k + 0}{2} {\mathbf {n}}_j^T \right] = -\frac{u_k}{2|T|} {\mathbf {n}}_k^T = 0$$
    which implies that \(u_k = 0\). These two facts are enough to conclude that \(u_i = 0 \ \forall \ i.\)
  2. 2.
    Assume that \(C_p=0\). Then we can only conclude that
    $$ \nabla u^T = 0 \quad \forall \quad T $$
    For an interior triangle we again obtain that all the three vertex values are equal. Consider a boundary vertex i which belongs to an interior triangle \(T_1\) and a boundary triangle \(T_e\) as shown in Fig. 4. Since \(T_1\) is an interior triangle, from the condition \(\nabla _h u^{T_1}=0\) we conclude that \(u_i = u_k\) while from \(\nabla _h u^{T_e}=0\), i.e.,
    $$ \nabla _h u^{T_e} = \frac{1}{|T|}\left[ \frac{0 + 0}{2} {\mathbf {n}}_k^T + \frac{u_j + u_k}{2} {\mathbf {n}}_i^T + \frac{u_k + u_i}{2} {\mathbf {n}}_j^T \right] = 0 $$
    we conclude that \(u_i + u_k = 0\) which together imply that \(u_i = 0\). Hence we can conclude that \(u_i = 0 \ \forall \ i\).
  3. 3.
    Assume that \(C_p=0\). Then we can only conclude that
    $$\nabla u^T = 0 \quad \forall \quad T $$
    For an interior triangle we again obtain that all the three vertex values are equal. Now consider a boundary vertex i that belongs to only boundary triangles and does not belong to any interior triangle, as in Fig. 5. From \(\nabla _h u^{T_e}=0\), we can conclude that \(u_i + u_k = 0\) and \(u_j + u_k=0\) which implies that \(u_i = u_j = -u_k\). Similarly from \(\nabla _h u^{T_1}=0\) we conclude that \(u_i = u_r = -u_k\). But since \(T_2\) is an interior triangle, \(\nabla _h u^{T_2}=0\) implies \(u_r = u_k\) and hence we obtain \(u_i = u_j = u_r = 0\). From this we can conclude that \(u_i = 0\), \(\forall \,i\).\(\square \)


We see that the addition of a penalty term leads to a simple proof of existence. However if \(C_p=0\), the difficulty in the proof is in case (3) where a vertex i belongs to only boundary triangles. However, geometrically it is not possible that all boundary vertices belong to only boundary triangles. For example, in Fig. 5 the vertex r will belong to an interior triangle and the proof can be completed by connecting vertex i to vertex r by moving along boundary edges.

Fig. 4

Example of boundary vertex i belonging to an interior triangle \(T_1\)

Fig. 5

Example of a boundary vertex i belonging to only boundary triangles

4 Discretization of heat equation

We consider the heat equation
$$\begin{aligned} \begin{aligned}&u_t = \ \nabla \cdot (\mu \nabla u) \quad {\text {in}} \quad \varOmega \\&u = \ f \quad {\text {on}} \quad \varGamma ^D \\&\mu \frac{\partial u}{\partial n} = g \quad {\text {on}} \quad \varGamma ^N \\&\mu \frac{\partial u}{\partial n} + \alpha u = h \quad {\text {on}} \quad \varGamma ^R \\ \end{aligned} \end{aligned}$$
with \(\mu > 0\) and \(\alpha \ge 0\). Here the boundary is composed of three parts corresponding to Dirichlet \((\varGamma ^D)\), Neumann \((\varGamma ^N)\) and mixed \((\varGamma ^R)\) boundary conditions. Multiplying the above equation by u and integration over \(\varOmega \) gives the energy equation
$$ \frac{{\text {d}}}{{\text {d}}t} \int _\varOmega \frac{1}{2} u^2 {\text {d}}x = -\int _{\varOmega } \mu |\nabla u|^2 {\text {d}}x + \int _{\varGamma ^D} \mu f \frac{\partial u}{\partial n} {\text {d}}s + \int _{\varGamma ^N} u g {\text {d}}s + \int _{\varGamma ^R} (uh - \alpha u^2) {\text {d}}s $$
Note that we have to use the integration by parts rule to arrive at the above result. In the case of homogeneous boundary conditions, \(f=g=h=0\), we obtain
$$\frac{{\text {d}}}{{\text {d}}t} \int _\varOmega \frac{1}{2} u^2 {\text {d}}x = -\int _{\varOmega } \mu |\nabla u|^2 {\text {d}}x - \int _{\varGamma ^R} \alpha u^2 {\text {d}}s \le 0 $$
which shows the well-posedness of the problem.

4.1 Finite volume method

We now consider the discretization of the operator appearing in Eq. (14). Define the operator
$$ Lu = \nabla \cdot (\mu \nabla u) $$
By performing an integration over the dual volume \(A_i\) and using the boundary conditions on u we obtain
$$ \int \limits _{A_i} (Lu) {\text {d}}x = \int \limits _{\partial A_i} \mu \nabla u \cdot {\mathbf {n}}{\text {d}}s + \int \limits _{\partial A_i \cap \varGamma ^D} \mu \nabla u \cdot {\mathbf {n}}{\text {d}}s + \int \limits _{\partial A_i \cap \varGamma ^N} g {\text {d}}s + \int \limits _{\partial A_i \cap \varGamma ^R} (h - \alpha u) {\text {d}}s $$
The finite volume approximation of this operator is given by
$$\begin{aligned} A_i (L_h u)_i &= \frac{1}{2} \sum _{T \in i} \mu ^T \nabla _h u^T \cdot {\mathbf {n}}_i^T + \frac{1}{2} \sum _{e \in \varGamma _i^D} \mu ^{T_e} \nabla _h u^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\&\quad + \frac{1}{2} \sum _{e \in \varGamma _i^N} g_i |{\mathbf {n}}_e| + \frac{1}{2} \sum _{e \in \varGamma _i^R} \left( h_i - \alpha u_i \right) |{\mathbf {n}}_e| \end{aligned}$$
where the term \(\nabla _h u^{T_e}\) for a triangle \(T_e\) adjacent to a Dirichlet boundary edge e is computed using the approximation given by Eq. (4) while for a boundary triangle adjacent to any other type of boundary, the gradient is computed from Eq. (3). Using the above approximation, we formulate the finite volume scheme including a Nitsche type penalty term for Dirichlet boundary condition as
$$ A_i \frac{{\text {d}}u_i}{{\text {d}}t} = A_i (L_h u)_i - \sum _{e \in \varGamma _i^D} \frac{C_p\mu ^{T_e}}{2 h_e} (u_i - f_i) |{{\mathbf {n}}_e}| $$
To derive the energy equation, we multiply the above equation by \(u_i\) and sum over all vertices to obtain
$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t}\sum _i \frac{1}{2}u_i^2 A_i &= - \sum _T \mu ^T \Vert \nabla _h u^T \Vert ^2 |T| + \sum _{e \in \varGamma ^D} \left( \frac{f_i + f_j}{2}\right) \mu ^{T_e} \nabla _h u^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\&\quad + \sum _{e \in \varGamma ^N} \left( \frac{u_i g_i + u_j g_j}{2}\right) |{\mathbf {n}}_e| + \sum _{e \in \varGamma ^R} \left[ \left( \frac{u_i h_i + u_j h_j}{2}\right) - \alpha \left( \frac{u_i^2 + u_j^2}{2}\right) \right] |{\mathbf {n}}_e| \nonumber \\&\quad - \sum _{e \in \varGamma ^D} \frac{C_p\mu ^{T_e}}{2 h_e} [ u_i(u_i - f_i) + u_j(u_j-f_j)] \end{aligned}$$
The last term in the above equation is due to the Dirichlet penalty terms which does not destroy the consistency of the method while the remaining terms are consistent with the continuous energy Eq. (15).

Theorem 3

Assume that atleast one of\(\varGamma ^D\), \(\varGamma ^R\)is non-empty. Then under homogeneous data\(f=g=h=0\), the semi-discrete finite volume scheme given by (17) is stable in the energy norm.


In the case of homogeneous data, the energy Eq. (18) becomes
$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t}\sum _i \frac{1}{2}u_i^2 A_i &= - \sum _T \mu ^T \Vert \nabla _h u^T \Vert ^2 |T| - \sum _{e \in \varGamma ^D} \frac{C_p\mu ^{T_e}}{2 h_e} (u_i^2 + u_j^2) |{{\mathbf {n}}_e}| \\&-\sum _{e \in \varGamma ^R} \alpha \left( \frac{u_i^2 + u_j^2}{2}\right) |{\mathbf {n}}_e| \le 0 \end{aligned}$$
Moreover, using the condition that at least one of \(\varGamma ^D\) or \(\varGamma ^R\) is non-empty, it is easy to check that the right hand side in the above equation is zero if and only if \(u_i=0\)\(\forall \,i\) and hence the scheme is stable.

4.2 Need for penalty term

The Laplace equation was shown to have a unique solution even in the absence of penalty term. For the heat equation however, one can converge to wrong solution in some cases in the absence of penalty term. Consider the following problem
$$\begin{aligned} u_t &= \varDelta u, \quad {\text {in}} \quad \varOmega \\ u(x,0) &= 0, \quad {\text {in}} \quad \varOmega \\ u(x,t) &= 1, \quad {\text {on}} \quad \partial \varOmega \end{aligned}$$
The time asymptotic value of the solution to the above problem reaches the constant value of unity. Consider a grid where the corner boundary vertex i belongs to a single boundary triangle as shown in Fig. 6. We start the computations by setting the initial value to be zero at all the vertices. Then the equation for the corner point is
$$ A_i \frac{{\text {d}}u_i}{{\text {d}}t} = \frac{1}{2} \nabla _h u^T \cdot \left( {\mathbf {n}}_i^T+{\mathbf {n}}_j^T+{\mathbf {n}}_k^T\right) = 0 $$
and the solution at vertex i remains zero for all future times while the exact solution tends to unity. The addition of a penalty term will avoid this situation since the penalty term drives the solution at all boundary points towards the correct boundary value. It is of course possible to avoid such situations by re-triangulating the grid but the penalty term gives a simpler solution without changing the grid.
Fig. 6

Corner cell

4.3 Other type of dual cells

The most common type of dual cell which we have described here is obtained by joining the cell centroid to the edge midpoints. However there are other ways to construct the dual cell. In the containment dual or voronoi approach [20], the circumcenter of the triangles is joined to the edge midpoints. If the circumcenter lies outside the triangle, as can happen for an obtuse angled triangle, the midpoint of the largest side is used. For a right-angled triangle, the circumcenter lies at the midpoint of the hypotenuse, which is the largest side of the right-angled triangle. In the case of stretched triangle as would result in boundary layer meshes, the voronoi dual cell becomes a quadrilateral or close to a rectangle. Such cells have edges aligned with the flow and are advantageous in boundary layers where the streamwise gradients are smaller compared to the wall normal gradients [21]. No matter which point inside the triangle is used to form the dual cells, we always have the following identity satisfied
$$ {\mathbf {n}}_{ij}^T + {\mathbf {n}}_{ik}^T = \frac{1}{2} {\mathbf {n}}_i^T $$
due to which all of our results on summation by parts and energy stability still hold. The area of the dual cells \(\{A_i\}\) has to be appropriately computed based on how the dual cell was constructed.

4.4 Numerical implementation

The numerical implementation of the above schemes can be achieved by looping over all the edges in the triangulation and accumulating the contribution of the edge to the adjacent triangles. For boundary edges, the boundary condition can be implemented based on the type of boundary and the contribution added to the adjacent triangle. The gradient Eq. (2) is used for every triangle except for a triangle adjacent to a Dirichlet boundary for which Eq. (4) is used. Note that this allows the boundary condition to be discontinuous across the boundary edges. For example, in the situation depicted in Fig. 7 the Dirichlet boundary condition is discontinuous at the corner; for the two edges \(e_1\) and \(e_2\), the contributions to the corresponding triangles are computed as
$$ \nabla u^{T_1} = \nabla u^{T_1} + \frac{1+1}{2} {{{\mathbf {n}}_e}}_1 \qquad {\text {and}} \qquad \nabla u^{T_2} = \nabla u^{T_2} + \frac{0+0}{2} {{{\mathbf {n}}_e}}_2 $$
which are the integrals over the edges, and the integrals make sense even if the boundary condition is discontinuous. In the case of strongly implemented boundary conditions, there is ambiguity on what value to use for the corner point, which does not arise in our scheme. Other boundary integrals in Eq. (16) are similarly computed which allows the Neumann and mixed boundary conditions gh to be also discontinuous across the boundary edges.
Fig. 7

Example of discontinuous boundary condition

4.5 Test I: smooth solution

We consider the heat equation on the unit square with homogeneous Dirichlet boundary conditions and initial condition given by
$$ u(x,y,0) = \sin (2\pi x) \sin (2\pi y) + \sin (4\pi x) \sin (4 \pi y) $$
whose exact solution is
$$ u(x,y,t) = e^{-8 \pi ^2 t} \sin (2\pi x) \sin (2\pi y) + e^{-32\pi ^2 t} \sin (4\pi x) \sin (4 \pi y) $$
The numerical solution is computed up to the time \(t=0.05\) and the errors in maximum norm and \(L_2\) norm at the final time are computed. At this final time, the maximum value of the solution has decreased by about a factor of about 100. For the \(L_2\) norm we use the definition
$$ \Vert u\Vert _2 = \sqrt{\sum _i [u_i - u(x_i,y_i)]^2 A_i} $$
where \(u_i\) is the numerical solution in dual cell \(A_i\) and \(u(x_i,y_i,t)\) is the exact solution evaluated at the vertex \((x_i,y_i)\). Three types of grids are considered as shown in Fig. 8; the grids in the figures may be refered to as uniform, quasi-uniform and non-uniform respectively. Note that the quasi-uniform and non-uniform grids are randomly generated. Grids are generated with \(10, 15, \ldots , 50\) points on each side of the unit square for studying the convergence of errors. Figure 9 shows the convergence of the solution error with mesh size on the uniform and non-uniform meshes. In all the cases, the error decreases at a rate close to \(O(h^2)\) indicating second order accuracy. The errors are smaller in the case of uniform grids and the convergence is monotonic while in the case of the quasi-uniform grids, the error converges in a non-monotonic manner, though asymptotically, the convergence seems to be atleast \(O(h^2)\). On the quasi-uniform grids, as the grid becomes finer, the errors are smaller than in the case of non-uniform grids, which indicated some cancellation mechanism due to the more regular structure of the quasi-uniform grids as compared to non-uniform grids. Since the boundary conditions are exactly enforced, the strong boundary condition shows better accuracy in \(L_\infty \) on the uniform grids, while the \(L_2\) error norms are nearly same indicating that the average error is similar in both cases. On the quasi-uniform and non-uniform grids, both strong and weak implementations show similar error levels in both norms.
Fig. 8

Grids used for Test I: a uniform grid, b quasi-uniform grid, c non-uniform grid

Fig. 9

Error convergence for Test I: a Uniform grid, b quasi-uniform grids, c non-uniform grid

4.6 Test II: discontinuous diffusivity

We consider the Laplace equation with spatially varying diffusion coefficient [13] as in Eq. (14) on a unit square with
$$\begin{aligned} \mu = {\left\{ \begin{array}{ll} \mu _1 & x < \frac{1}{2} \\ \mu _2 & x > \frac{1}{2} \end{array}\right. } \end{aligned}$$
Dirichlet boundary conditions are applied on the left and right boundaries while zero Neumann conditions are prescribed on the bottom and top boundaries. The exact solution is given by
$$\begin{aligned} u={\left\{ \begin{array}{ll} \frac{\mu _2 x + 2 \mu _1 \mu _2}{\frac{1}{2}(\mu _1 + \mu _2) + 4 \mu _1 \mu _2} & 0 \le x \le \frac{1}{2} \\ \frac{\mu _1 x + 2 \mu _1 \mu _2 + \frac{1}{2}(\mu _2 - \mu _1)}{\frac{1}{2}(\mu _1 + \mu _2) + 4 \mu _1 \mu _2} & \frac{1}{2} \le x \le 1 \end{array}\right. } \end{aligned}$$
which is continuous across the material discontinuity surface \(x=\frac{1}{2}\) but the derivatives are discontinuous. In the numerical computations, we use \(\mu _1 = 1\) and \(\mu _2 = 4\). The Dirichlet boundary condition is obtained from the above exact solution. The grid is constructed so that there are grid points located along \(x=\frac{1}{2}\) and the grid edges of the primary grid do not cross this discontinuity line. The results are shown in Fig. 10a and the scheme recovers the exact solution (upto machine precision) on any such grid because the approximation of the Laplacian is exact for any affine function. Even though the coefficient is discontinuous, the solution is continuous and the vertex-centered methods can satisfy this continuity condition due to the presence of degrees of freedom located on the discontinuity surface which is not the case with cell centered methods.
Fig. 10

Problem with discontinuous coefficient: a Test II b Test III

4.7 Test III: discontinuous diffusivity

We again consider the Laplace equation with the same distribution of diffusivity coefficient as the previous problem. The exact solution is chosen to be
$$\begin{aligned} u = {\left\{ \begin{array}{ll} a + bx + cy & 0 \le x \le \frac{1}{2} \\ a - b\frac{\mu _1 - \mu _2}{2\mu _2} + b\frac{\mu _1}{\mu _2} x + cy & \frac{1}{2} \le x \le 1 \end{array}\right. } \end{aligned}$$
In this case, the tangential flux is discontinuous across the material interface and many methods which assume continuity of the tangential flux give wrong results [13]. In the vertex-centered method developed here, the material discontinuity is not a finite volume face and we do not have to compute the flux across the material interface. The Dirichlet conditions are taken from the exact solution and applied on all the four sides of the unit square domain. For the computations, we take \(a=b=c=1\), \(\mu _1=1\) and \(\mu _2=4\). The scheme is able to recover the exact solution as shown in Fig. 10b.

5 Compressible Navier–Stokes equations

We next extend the ideas presented till now to the case of compressible flows. The compressible Navier–Stokes equations represent the conservation laws for mass, momentum and energy, and can be written as
$$ \frac{\partial U}{\partial t} + \nabla \cdot F = \nabla \cdot G $$
where U is the vector of conserved variables, F are the inviscid fluxes and G are viscous fluxes
$$\begin{aligned} U = \begin{bmatrix} \rho \\ \mathbf {m}\\ E \end{bmatrix}=\begin{bmatrix} \rho \\ \rho {\mathbf {u}}\\ E \end{bmatrix}, \quad F = \begin{bmatrix} \rho {\mathbf {u}}\\ p I + \rho {\mathbf {u}}\otimes {\mathbf {u}}\\ (E+p) {\mathbf {u}}\end{bmatrix}, \quad G = \begin{bmatrix} 0 \\ \sigma \\ \sigma \cdot {\mathbf {u}}- {\mathbf {q}}\end{bmatrix} \end{aligned}$$
In the above equations \(\rho \) is the density, \({\mathbf {u}}\) is velocity, p is the pressure, E is total energy per unit volume, while \(\sigma \) and \({\mathbf {q}}\) are the shear stress tensor and heat flux vector respectively. The pressure is related to the other quantities through perfect gas relation and takes the form
$$ E = \frac{p}{\gamma -1} + \frac{1}{2} \rho |{\mathbf {u}}|^2 $$
while the shear stress and heat flux are given by the Newtonian and Fourier constitutive laws, respectively.
$$ \sigma = \frac{1}{2}\mu ( \nabla {\mathbf {u}}+ (\nabla {\mathbf {u}})^\top ) - \frac{2}{3}\mu (\nabla \cdot {\mathbf {u}}) {\mathcal {I}}, \qquad {\mathbf {q}}= - \kappa \nabla T $$
where \({\mathcal {I}}\) is the unit tensor.

5.1 Kinetic energy equation

We will assume Dirichlet boundary conditions on the velocity over the whole boundary. Thus the boundary conditions on the velocity are
$$ {\mathbf {u}}= {\mathbf {f}}\quad {\text {on}} \quad \varGamma $$
In practice, the normal velocity \({\mathbf {f}}\cdot {\mathbf {n}}\) would be zero representing a stationary wall, while the tangential velocity could have a non-zero component which would model a sliding wall or a rotating wall for axisymmetric rotating flows. The kinetic energy per unit volume is \(k=\frac{1}{2}\rho |{\mathbf {u}}|^2\); the evolution of the total kinetic energy is given by
$$ \frac{{\text {d}}}{{\text {d}}t} \int _\varOmega k {\text {d}}x = - \int _{\varGamma } [(p+k) ({\mathbf {f}}\cdot {\mathbf {n}}) - {\mathbf {f}}\cdot \sigma \cdot {\mathbf {n}}] {\text {d}}s + \int _{\varOmega } \left[ p (\nabla \cdot {\mathbf {u}}) - \sigma : \nabla {\mathbf {u}}\right] {\text {d}}x $$
It can be shown that for Newtonian fluid [22], the last term in the above equation destroys kinetic energy, i.e.,
$$ - \sigma : \nabla {\mathbf {u}}\le 0 $$
In the case of homogeneous boundary conditions \({\mathbf {f}}=0\), we have the following stability estimate for the kinetic energy
$$ \frac{{\text {d}}}{{\text {d}}t} \int _\varOmega k {\text {d}}x \le \int _{\varOmega } p (\nabla \cdot {\mathbf {u}}) {\text {d}}x $$
The kinetic energy can change due to change of internal energy by the compression/expansion of the fluid and vice versa but the viscous terms always lead to destruction of kinetic energy. If the compressibility effect is negligible then the total kinetic energy decreases with time due to viscous dissipation.

5.2 Finite volume method

Consider a division of the domain by triangles and around each vertex, construct the dual finite volume as described in Sect. 2. For each dual cell, the inviscid and viscous fluxes must be computed on the faces of the dual cell. For the viscous fluxes which require derivatives of velocity and temperature, we use a scheme similar to the heat equation, i.e., the viscous fluxes are computed triangle-wise. The inviscid fluxes are computed edge-wise using the solution at the vertices forming the edge. Apart from the notations introduced in Sect. 2, we introduce the notation \(j \in i\) to denote the set of all vertices \(\{j\}\) which are connected to vertex i by an edge. Integrating the conservation law over a dual cell, we get1
$$\begin{aligned} A_i \frac{{\text {d}}U_i}{{\text {d}}t} &= -\sum _{j \in i} \int \limits _{\partial A_i \cap \partial A_j} F \cdot {\mathbf {n}}{\text {d}}s + \sum _{T \in i} \int \limits _{\partial A_i \cap T} G \cdot {\mathbf {n}}{\text {d}}s - \int \limits _{\partial A_i \cap \varGamma } F \cdot {\mathbf {n}}{\text {d}}s + \int \limits _{\partial A_i \cap \varGamma } G \cdot {\mathbf {n}}{\text {d}}s\\ &\approx -\sum _{j \in i} F_{ij} \cdot \int \limits _{\partial A_i \cap \partial A_j} {\mathbf {n}}{\text {d}}s + \sum _{T \in i} G^T \cdot \int \limits _{\partial A_i \cap T} {\mathbf {n}}{\text {d}}s\\&\quad - \sum _{e \in \varGamma _i} \int \limits _{e \cap \partial A_i} F \cdot {\mathbf {n}}{\text {d}}s + \sum _{e \in \varGamma _i} \int \limits _{e \cap \partial A_i} G \cdot {\mathbf {n}}{\text {d}}s\\= & -\sum _{j \in i} F_{ij} \cdot {\mathbf {n}}_{ij} + \frac{1}{2} \sum _{T \in i} G^T \cdot {\mathbf {n}}_i^T - \sum _{e \in \varGamma _i} F_{i,e} \cdot \frac{{{\mathbf {n}}_e}}{2} + \sum _{e \in \varGamma _i} G^{T_e} \cdot \frac{{{\mathbf {n}}_e}}{2} \end{aligned}$$
The normal vectors \({\mathbf {n}}_{ij}\), \({\mathbf {n}}_i^T\), etc. have dimensions of length. The quantity \(F_{ij} \cdot {\mathbf {n}}_{ij}\) is the flux across the face common to the cells \(A_i\) and \(A_j\). Writing the above scheme for the mass, momentum and energy equations, we obtain the finite volume discretization as follows
$$ A_i \frac{{\text {d}}\rho _i}{{\text {d}}t} = -\sum _{j \in i} F^{\rho }_{ij} - \sum _{e \in \varGamma _i} F^{\rho }_{i,e} $$
$$ A_i \frac{{\text {d}}\mathbf {m}_i}{{\text {d}}t} = -\sum _{j \in i} {\mathbf {F}}^{m}_{ij} - \sum _{e \in \varGamma _i} {\mathbf {F}}^{m}_{i,e} + \frac{1}{2} \sum _{T \in i} \sigma ^T \cdot {\mathbf {n}}_i^T + \frac{1}{2} \sum _{e \in \varGamma _i} \sigma ^{T_e} \cdot {{\mathbf {n}}_e}$$
$$\begin{aligned} A_i \frac{{\text {d}}E_i}{{\text {d}}t} &= -\sum _{j \in i} F^E_{ij} - \sum _{e \in \varGamma _i} F^E_{i,e} + \frac{1}{2} \sum _{T \in i} {\mathbf {u}}^T \cdot \sigma ^T \cdot {\mathbf {n}}_i^T \nonumber \\&\quad + \frac{1}{2} \sum _{e \in \varGamma _i} {\mathbf {f}}_i \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}- \frac{1}{2} \sum _{T \in i} {\mathbf {q}}^T \cdot {\mathbf {n}}_i^T - \frac{1}{2} \sum _{e \in \varGamma _i} {\mathbf {q}}^{T_e} \cdot {{\mathbf {n}}_e}\end{aligned}$$
Here \(F^{\rho }_{ij}, {\mathbf {F}}^{m}_{ij},F^E_{ij}\) are the inviscid fluxes of mass, momentum and energy across interior faces of the dual finite volume while \(F^{\rho }_{i,e}, {\mathbf {F}}^{m}_{i,e}, F^E_{i,e}\) are the inviscid fluxes across the boundary edges, all of which are yet to be specified. The length of the cell faces has been absorbed inside the definition of the fluxes. The viscous fluxes are computed for each triangle; for this, the derivatives of velocity and temperature are computed on each triangle using the scheme given for heat equation, while applying Dirichlet boundary condition for boundary triangles. For an interior triangle, the velocity gradient is given by
$$ \nabla _h {\mathbf {u}}^T = \frac{1}{|T|} \left[ \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2} \otimes {\mathbf {n}}_k^T + \frac{{\mathbf {u}}_j + {\mathbf {u}}_k}{2} \otimes {\mathbf {n}}_i^T + \frac{{\mathbf {u}}_k + {\mathbf {u}}_i}{2} \otimes {\mathbf {n}}_j^T \right] $$
while for a triangle adjacent to a Dirichlet boundary edge e whose vertices are ij, the gradient is given by
$$ \nabla _h {\mathbf {u}}^{T_e} = \frac{1}{|T_e|} \left[ \frac{{\mathbf {f}}_i + {\mathbf {f}}_j}{2} \otimes {\mathbf {n}}_k^{T_e} + \frac{{\mathbf {u}}_j + {\mathbf {u}}_k}{2} \otimes {\mathbf {n}}_i^{T_e} + \frac{{\mathbf {u}}_k + {\mathbf {u}}_i}{2} \otimes {\mathbf {n}}_j^{T_e} \right] $$
The notation \({\mathbf {u}}\otimes \mathbf {v}\) denotes the dyadic product whose components are \(({\mathbf {u}}\otimes \mathbf {v})_{ij}=u_i v_j\). The coefficient of thermal viscosity and conductivity are averaged on each triangle; then the shear stress \(\sigma ^T\) and heat flux \({\mathbf {q}}^T\) can be computed on each triangle from the constitutive laws of Newton and Fourier
$$ \sigma ^T = \mu ^T \left[ \frac{\nabla _h {\mathbf {u}}^T + (\nabla _h {\mathbf {u}}^T)^\top }{2} - \frac{2}{3} (\nabla _h \cdot {\mathbf {u}}^T) {\mathcal {I}}\right] , \qquad {\mathbf {q}}^T = -\kappa ^T \nabla _h T^T $$

5.3 Discrete kinetic energy balance

The time derivative of kinetic energy can be written in terms of density and momentum derivatives as
$$ \frac{{\text {d}}k_i}{{\text {d}}t} = -\frac{|{\mathbf {u}}_i|^2}{2} \frac{{\text {d}}\rho _i}{{\text {d}}t} + {\mathbf {u}}_i \cdot \frac{{\text {d}}\mathbf {m}_i}{{\text {d}}t} $$
The energy equation is not necessary to derive the kinetic energy equation. Using these equations, we can derive the discrete global kinetic energy balance equation by summing up over all the vertices. We first notice that \(F^{\rho }_{ij}=-F^{\rho }_{ji}\) and \({\mathbf {F}}^{m}_{ij} =-{\mathbf {F}}^{m}_{ji}\). We also introduce the symbol \(\varGamma _a\) to denote all the edges in the grid. The global kinetic energy equation is derived in several steps below. We begin by adding up the kinetic energy equation from all the cells.
$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t} \sum _i k_i A_i &= -\sum _i \sum _{j \in i} \left( {\mathbf {u}}_i \cdot {\mathbf {F}}^{m}_{ij} - \frac{|{\mathbf {u}}_i|^2}{2} F^{\rho }_{ij}\right) -\sum _i \sum _{e \in \varGamma _i} \left( {\mathbf {u}}_i \cdot {\mathbf {F}}^{m}_{i,e} - \frac{|{\mathbf {u}}_i|^2}{2} F^{\rho }_{i,e}\right) \nonumber \\&\quad + \frac{1}{2} \sum _i \sum _{T \in i} {\mathbf {u}}_i \cdot \sigma ^T \cdot {\mathbf {n}}_i^T + \frac{1}{2} \sum _i \sum _{e \in \varGamma _i} {\mathbf {u}}_i \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\ &= -\sum _{e \in \varGamma _a} \left[ ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {F}}^{m}_{ij} - \frac{|{\mathbf {u}}_i|^2-|{\mathbf {u}}_j|^2}{2} F^{\rho }_{ij}\right] \nonumber \\&\quad -\sum _{e \in \varGamma } \left[ {\mathbf {u}}_i \cdot {\mathbf {F}}^{m}_{i,e} + {\mathbf {u}}_j \cdot {\mathbf {F}}^{m}_{j,e} - \frac{|{\mathbf {u}}_i|^2}{2} F^{\rho }_{i,e} - \frac{|{\mathbf {u}}_j|^2}{2} F^{\rho }_{j,e}\right] \nonumber \\&\quad + \frac{1}{2} \sum _T \sum _{i \in T} {\mathbf {u}}_i \cdot \sigma ^T \cdot {\mathbf {n}}_i^T + \sum _{e \in \varGamma } \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2} \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\ &= I + II + III \end{aligned}$$
where the last two terms have been denoted as III. Let \(F^{\rho }_{ij}\) be any consistent mass flux; then the momentum flux is taken to be of the form [19]
$$ {\mathbf {F}}^{m}_{ij} = p_{ij} {\mathbf {n}}_{ij} + {\mathbf {u}}_{ij} F^{\rho }_{ij}, \qquad {\mathbf {u}}_{ij} = \frac{1}{2}({\mathbf {u}}_i + {\mathbf {u}}_j) $$
The first term in the right hand side of Eq. (32) can be written as
$$ ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {F}}^{m}_{ij} - \frac{|{\mathbf {u}}_i|^2-|{\mathbf {u}}_j|^2}{2} F^{\rho }_{ij} =({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot \left[ {\mathbf {F}}^{m}_{ij} - \frac{{\mathbf {u}}_i+{\mathbf {u}}_j}{2} F^{\rho }_{ij} \right] = p_{ij} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} $$
For the pressure we assume \(p_{ij} = \frac{1}{2}(p_i + p_j)\); the pressure terms can be rewritten as
$$\begin{aligned} -\sum _{e \in \varGamma _a} p_{ij}({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} &= -\sum _{e \in \varGamma _a} \left[ \frac{p_i}{2}({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} + \frac{p_j}{2}({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} \right] \\ &= -\sum _i \frac{1}{2}p_i \sum _{j \in i} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} \end{aligned}$$
where ij are the two vertices of the edge e.
Case 1 (Interior vertex) For an interior vertex i we collect all the terms containing \(p_i\) and add \(p_i {\mathbf {u}}_i \cdot \sum _{j\in i} {\mathbf {n}}_{ij}\) which is zero since \(\sum _{j\in i} {\mathbf {n}}_{ij} = 0\).
$$\begin{aligned} -\frac{1}{2}p_i \sum _{j \in i} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} &= -\frac{1}{2}p_i \sum _{j \in i} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} + p_i {\mathbf {u}}_i \cdot \sum _{j\in i} {\mathbf {n}}_{ij}\\ &= p_i \sum _{j \in i} \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2} \cdot {\mathbf {n}}_{ij} = p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i \end{aligned}$$
The last step provides an approximation to the divergence at vertex i by Green’s theorem which is denoted as \((\tilde{\nabla }_h \cdot {\mathbf {u}})_i\).
Case 2 (Boundary vertex) Now we consider a boundary vertex i as shown in Fig. 11.
$$\begin{aligned}&-\frac{1}{2}p_i \sum _{j \in i} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} \nonumber \\&\quad = -\frac{1}{2}p_i \sum _{j \in i} ({\mathbf {u}}_i - {\mathbf {u}}_j) \cdot {\mathbf {n}}_{ij} + p_i {\mathbf {u}}_i \cdot \underbrace{\left( \sum _{j\in i} {\mathbf {n}}_{ij} + \frac{1}{2}{{\mathbf {n}}_e}_1 + \frac{1}{2}{{\mathbf {n}}_e}_2 \right) }_{=0} \nonumber \\&\quad = p_i \sum _{j \in i} \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2} \cdot {\mathbf {n}}_{ij} + \frac{1}{2} p_i {\mathbf {u}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) \nonumber \\&\quad = p_i \left[ \sum _{j \in i} \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2} \cdot {\mathbf {n}}_{ij} + \frac{1}{2} {\mathbf {f}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) \right] + \frac{1}{2} p_i {\mathbf {u}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) \nonumber \\&\qquad -\frac{1}{2} p_i {\mathbf {f}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) \nonumber \\&\quad = p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i + \frac{1}{2} p_i {\mathbf {u}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) - \frac{1}{2} p_i {\mathbf {f}}_i \cdot ({{\mathbf {n}}_e}_1 + {{\mathbf {n}}_e}_2) \end{aligned}$$
The term inside the square brackets in the penultimate step gives an approximation to the divergence \((\tilde{\nabla }_h \cdot {\mathbf {u}})_i\) at the boundary vertex i via Green’s theorem. Hence we obtain
$$ I = \sum _i p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i + \sum _{e \in \varGamma } \frac{1}{2}(p_i {\mathbf {u}}_i + p_j {\mathbf {u}}_j) \cdot {{\mathbf {n}}_e}- \sum _{e \in \varGamma } \frac{1}{2}(p_i {\mathbf {f}}_i + p_j {\mathbf {f}}_j) \cdot {{\mathbf {n}}_e} $$
The above equation suggests that for a boundary edge e, the contributions of the momentum flux to the two vertices i and j should be of the form
$$\begin{aligned} &{\mathbf {F}}^{m}_{i,e} = \frac{1}{2} p_i {{\mathbf {n}}_e}+ \frac{1}{2}\rho _i {\mathbf {u}}_i ({\mathbf {f}}_i \cdot {{\mathbf {n}}_e}),&\quad F^{\rho }_{i,e} = \frac{1}{2} \rho _i ({\mathbf {f}}_i \cdot {{\mathbf {n}}_e}) \\&{\mathbf {F}}^{m}_{j,e} = \frac{1}{2} p_j {{\mathbf {n}}_e}+ \frac{1}{2}\rho _j {\mathbf {u}}_j ({\mathbf {f}}_j \cdot {{\mathbf {n}}_e}),&\quad F^{\rho }_{j,e} = \frac{1}{2} \rho _j ({\mathbf {f}}_j \cdot {{\mathbf {n}}_e}) \end{aligned} $$
In the momentum flux, notice that the Dirichlet condition is used only for the normal velocity \({\mathbf {f}}_i \cdot {{\mathbf {n}}_e}\) and \({\mathbf {f}}_j \cdot {{\mathbf {n}}_e}\) while the momentum is still evaluated with the solution values \({\mathbf {u}}_i\), \({\mathbf {u}}_j\) which is necessary to obtain the correct kinetic energy equation. Then
$$ II = -\sum _{e \in \varGamma } \frac{1}{2}(p_i {\mathbf {u}}_i + p_j {\mathbf {u}}_j) \cdot {{\mathbf {n}}_e} $$
The last two terms in Eq. (32) can be manipulated similar to the heat equation case to obtain
$$\begin{aligned} III &= \frac{1}{2} \sum _T \sum _{i \in T} {\mathbf {u}}_i \cdot \sigma ^T \cdot {\mathbf {n}}_i^T + \sum _{e \in \varGamma } \left( \frac{{\mathbf {u}}_i + {\mathbf {u}}_j}{2}\right) \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\ &= -\sum _T (\sigma ^T : \nabla _h {\mathbf {u}}^T) |T| + \sum _{e \in \varGamma } \left( \frac{{\mathbf {f}}_i + {\mathbf {f}}_j}{2}\right) \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}\end{aligned}$$
Using (35), (37), (38), the discrete kinetic energy Eq. (32) leads to
$$\begin{aligned} \frac{{\text {d}}}{{\text {d}}t} \sum _i k_i A_i &= - \sum _{e \in \varGamma } \left[ \frac{(k_i + p_i) {\mathbf {f}}_i + (k_j + p_j) {\mathbf {f}}_j}{2} \right] \cdot {{\mathbf {n}}_e}+ \sum _{e \in \varGamma } \left( \frac{{\mathbf {f}}_i + {\mathbf {f}}_j}{2}\right) \cdot \sigma ^{T_e} \cdot {{\mathbf {n}}_e}\nonumber \\&\quad + \sum _i p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i - \sum _T (\sigma ^T : \nabla _h {\mathbf {u}}^T) |T| \end{aligned}$$
This equation is consistent with the continuous kinetic energy Eq. (25). In the case of homogeneous velocity conditions \({\mathbf {f}}_i \equiv 0\), we obtain
$$ \frac{{\text {d}}}{{\text {d}}t} \sum _i k_i A_i = \sum _i p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i - \sum _T (\sigma ^T : \nabla {\mathbf {u}}^T) |T| \le \sum _i p_i (\tilde{\nabla }_h \cdot {\mathbf {u}})_i A_i $$
which is again consistent with the exact solution and shows a non-linear stability property of the scheme in terms of a bound on the growth of kinetic energy.

5.4 Godunov-MUSCL finite volume scheme

The central scheme discussed in the previous section is useful when performing DNS of compressible flows where the mesh is sufficiently fine to have a stable scheme without additional dissipation [19]. This can also be characterised in terms of the local mesh Peclet number being of order unity. For unresolved simulations where the Peclet number would be large, and also for simulating Euler equations which do not contain any physical viscosity, some numerical dissipation is necessary to stabilize the scheme. The inviscid flux \(F_{ij} \cdot {\mathbf {n}}_{ij}\) can be computed using a numerical flux function
$$ F_{ij} \cdot {\mathbf {n}}_{ij} = \begin{bmatrix} F^{\rho }_{ij} \\ {\mathbf {F}}^{m}_{ij} \\ F^E_{ij} \end{bmatrix} = F(U_i, U_j, {\mathbf {n}}_{ij}) $$
which includes explicit or implicit numerical dissipation. There is a wide choice of flux functions that are available based on central or upwind principles [23]. We will combine such a numerical flux together with the SBP discretization of viscous and heat conduction terms in the momentum and energy equations and penalty terms for the Dirichlet boundary conditions for the velocity and temperature. The semi-discrete scheme then has the following form where the usual flux contributions are not indicated but can be seen in (26), (27), (28)
$$\begin{aligned} A_i \frac{{\text {d}}\rho _i}{{\text {d}}t} &= \cdots \\ A_i \frac{{\text {d}}\mathbf {m}_i}{{\text {d}}t} &= \cdots + \sum _{e \in \varGamma _i^{ns}} \frac{C_p\mu ^{T_e}}{2 h_e} ({\mathbf {f}}_i - {\mathbf {u}}_i) |{{\mathbf {n}}_e}|\\ A_i \frac{{\text {d}}E_i}{{\text {d}}t} &= \cdots + \sum _{e \in \varGamma _i^{isot}} \frac{C_p\kappa ^{T_e}}{2 h_e} (T_{w,i} - T_i) |{{\mathbf {n}}_e}| \end{aligned}$$
We have added penalty terms into the momentum and energy equations for no-slip \(\varGamma ^{ns}\) and isothermal \(\varGamma ^{isot}\) boundaries. To achieve higher order accuracy the MUSCL approach [24] is used in which the numerical flux is calculated as
$$ F_{ij} \cdot {\mathbf {n}}_{ij} = F(V_{ij}, V_{ji}, {\mathbf {n}}_{ij}) $$
where we have written the flux in terms of the primitive variables
$$ V = [p, \quad {\mathbf {u}}, \quad T]^\top $$
The quantities \(V_{ij}\), \(V_{ji}\) are the reconstructed values of V from i and j to the mid-point of the edge ij. We perform the reconstruction in terms of the primitive variables since it is easier to enforce positivity of pressure and temperature in the reconstructed values \(V_{ij}\), \(V_{ji}\). It is also useful for implementing boundary conditions involving pressure or temperature, which are the more common type of boundary conditions that one encounters in practice. The interface values \(V_{ij}\) are obtained using a MUSCL-type edge-based reconstruction which can be written as [25]
$$ V_{ij} = V_i + \frac{s_{ij}}{4}[ (1 - \kappa s_{ij}) \varDelta ^- V_{ij} + (1 + \kappa s_{ij}) \varDelta ^+ V_{ij}] $$
$$ \varDelta ^- V_{ij} = 2(\nabla _h V)_i \cdot \mathbf {r}_{ij} - (V_j - V_i), \qquad \varDelta ^+ V_{ij} = V_j - V_i, \qquad \mathbf {r}_{ij} = \mathbf {r}_j - \mathbf {r}_i $$
The gradients of primitive variables at the vertices \((\nabla _h V)_i\) are computed using
$$ (\nabla _h V)_i = \frac{1}{A_i} \sum _{T \in i} (\nabla _h V^T) |T| $$
The triangle gradients \(\nabla _h V^T\) are evaluated using formulae like (2), (4) for scalar quantities like pressure and temperature, and (29), (30) for the velocity vector; note that these approximations incorporate the boundary conditions if specified on any portion of the boundary. The triangle gradients for velocity and temperature are anyway required for the viscous terms and we use them to compute the vertex gradients with only a little additional work. The quantity \(s_{ij}\) is a limiter which enforces monotonicity of the reconstruction by reducing it to first order in the presence of shocks or steep gradients. In the computations, we use the van Albada limiter which is given by
$$ s_{ij} = L(\varDelta ^- V_{ij}, \varDelta ^+ V_{ij}), \quad L(a,b) = \max \left( 0, \frac{2ab+\varepsilon }{a^2 + b^2 + \varepsilon } \right) , \quad 0 < \varepsilon \ll 1 $$
An alternate is to use a multi-dimensional reconstruction approach [26] which can be written as
$$ V_{ij} = V_i + \frac{\phi _i}{2} (\nabla _h V)_i \cdot \mathbf {r}_{ij} $$
where the limiter function \(\phi _i\) is evaluated using the min–max or Barth–Jespersen limiter, see [27] or the more differentiable limiter of Venkatakrishnan [28].

5.5 Numerical results

In the previous sections, the finite volume scheme was presented in a semi-discrete form where time was still continuous, leading to a system of ODEs in time. In the computations below, we use the three stage strong stability preserving Runge–Kutta scheme of Shu–Osher [29] to advance the solution in time. For steady state problems, a matrix-free LUSGS scheme is used to achieve faster convergence.

5.5.1 Plane Couette flow

The domain consists of \([0,5] \times [0,1]\) and the top surface \(y=1\) is moved with a velocity of (1, 0). Isothermal conditions are applied on the top and bottom surfaces. At the left domain, the velocity is specified as \(u=y\). At the outlet a constant pressure boundary condition is applied through the numerical fluxes. The Roe flux is used for convective flux and the penalty parameter in case of weak boundary conditions is \(C_p=10\). The exact incompressible solution is \(u=y\) but we solve this problem using our compressible solver at an inlet Mach number of 0.1. A uniform mesh of \(25 \times 25\) which is triangulated shown in Fig. 12. The initial condition is taken to be zero velocity so that solution evolves due to the boundary conditions. The maximum error in the velocity at the walls is of the order of \(10^{-6}-10^{-5}\). While the velocity on the boundary is not exactly equal to the boundary velocity in the case of weak implementation, the \(L_2\) norm of the error in the velocity is \(4.44\times 10^{-5}\) while in the case of strong boundary condition it is \(6.38\times 10^{-5}\). The convergence of the residual is shown in Fig. 13; the strong case does not converge below \(10^{-6}\) while the weak case without penalty also saturates but at a lower residual while the addition of penalty term leads to full convergence.
Fig. 11

Dual cell around a boundary vertex

Fig. 12

Grid used for Couette flow and plane Poiseille flow

Fig. 13

Convergence of residual for Couette flow: a strong, b weak without penalty c weak with penalty

5.5.2 Plane Poiseille flow

This problem involves flow between two parallel plates driven by a constant pressure gradient for which an exact incompressible solution is available which is a parabolic velocity profile. Again we cannot exactly approach this solution since we are using a compressible solver. The domain, mesh and numerical parameters are identical to the plane couette flow problem. A pressure difference is specified between the inlet and outlet boundaries while the top and bottom boundaries have no-slip and isothermal conditions. The \(L_2\) norm of the error in the velocity is \(5.91\times 10^{-4}\) and \(7.10\times 10^{-4}\) in the case of weak and strong implementations respectively. If the weak conditions are used without the Nitsche penalty the error is \(4.31\times 10^{-3}\) which shows the necessity of using a penalty term. The residuals converge to machine precision for the weak case with penalty term, while full convergence is not obtained in the strong case and even for the weak case when the penalty terms are not used.

5.5.3 Lid-driven cavity

The lid driven cavity is a classic test case for incompressible Navier–Stokes equations. The cavity is a unit square with the top surface being moved at a constant velocity of (1, 0) while the other sides are stationary. The central kinetic energy preserving flux [19] is used without any dissipation in the flux. We use conditions corresponding to a mach number of less than 0.1 in our compressible code and the Reynolds number is 1000. Isothermal boundary conditions are imposed on all the four sides of the cavity. A uniform triangular grid with 128 nodes on each side of the cavity and a total of 21180 nodes is used. The velocity magnitude and velocity vectors are shown in Fig. 14 near the top right corner of the cavity. The horizontal and vertical velocity profiles along the vertical and horizontal centerlines are shown in Fig. 15 and are compared with solution from [30]. The temperature should remain constant while in the numerical solution the maximum variation in temperature is 0.3 % in the whole domain; the variation in temperature is larger in this case due to compressibility effects at the top corner points where the velocity is discontinuous. The strong implementation of the boundary conditions leads to similar results (not shown) but the residuals do not converge while they converge for the weak implementation.
Fig. 14

Lid drivern cavity at \(Re=1000\) and weak boundary conditions: velocity magnitude and velocity vectors

Fig. 15

Lid drivern cavity at \(Re=1000\) using weak boundary conditions and central KEP flux: a x velocity, b y velocity

5.5.4 Laminar boundary layer

This problem corresponds to viscous flow over a flat plate which leads to the development of a boundary layer near the plate surface. The Reynolds number corresponding to the plate length is \(10^5\) while the Mach number of the incoming flow is taken to be 0.1. The computation domain is rectangular as shown in Fig. 16 which also shows the grid used for the computations. There is an initial inlet portion of the domain on which slip boundary condition is imposed followed by the no-slip boundary corresponding to the flat plate. Adiabatic conditions are used on the flat plate boundary. At the top and outlet, the free-stream pressure is specified while at the inlet the free-stream values are used together with the numerical flux function to compute the flux. The initial condition corresponds to uniform flow of \((u_\infty ,0)\) which does not satisfy the no-slip condition on the flat plate. Once steady state solution is obtained, the maximum variation in temperature is 0.17 % in the whole computational domain. We compare the numerical solution of the velocities with the blasius semi-analytical solution in Fig. 17 in the standard non-dimensional units. These results are taken from the center point of the plate in the downstream direction. It is clear that the solutions agree very well with the analytical solutions and the weak implementation of the boundary conditions is able to drive the flow towards the no-slip condition.
Fig. 16

Domain and grid for laminar boundary layer problem

Fig. 17

Laminar boundary layer with weak boundary conditions: a x velocity b y velocity

5.5.5 Flow over NACA0012 airfoil

We consider laminar flow over the standard NACA0012 airfoil at a freestream Reynolds number of 500, Mach number of 0.8° and 10° angle of attack. The grid consists of 10,458 vertices with 198 vertices on the airfoil surface. Figure 18 shows the comparison of velocity vectors near the leading edge of the airfoil for strong and weak boundary conditions. The two solutions are nearly identical and the weak boundary conditions are effective in enforcing the no-slip condition. Figure 19a shows the contours of Mach number for the weak case which shows the wake arising due to separation of the flow. Figure 19b shows the comparison of the skin friction coefficient for the two different boundary conditions which also compares well with published literature.2 Laminar flow a Reynolds number of 5000° and 0° angle of attack is also computed using the two boundary conditions. Figure 20a shows the velocity vectors near the leading edge of the airfoil indicating a more prominent boundary layer than the previous case, and the satisfaction of the no-slip condition to good accuracy. The skin friction coefficient is compared for the two boundary conditions which also compare favourably with published results.
Fig. 18

Laminar flow past NACA-0012 airfoil, \(Re=500\), \(\alpha =10\)°: velocity vectors for a strong and b weak boundary conditions

Fig. 19

Laminar flow past NACA-0012 airfoil, \(Re=500\), \(\alpha =10\,^\circ\): a Mach number for weak BC case b skin friction

Fig. 20

Laminar flow past NACA-0012 airfoil at \(Re=5000\), \(\alpha =0^{\circ}\): a velocity vectors for weak boundary conditions b skin friction

5.5.6 Axisymmetric rotating flow inside an annulus

This test case involves an annulus filled with Argon gas (\(\gamma =0.67\), \(Pr=0.668\), \(R=208\) J/(kg K), \(\mu =2.273\times 10^{-5}\)  kg/(m s)) and rotating at a high speed of 3140 radians/s which is approximately 1000 revolutions/s. The inner and outer radii are 0.1 and 0.2 m respectively while the height of the cylinder is 0.1 m. A triangular grid with 100 points on each side and a total of 10,000 points is used. The temperature boundary conditions are shown in Fig. 21a. There are five equations to be solved since the swirl velocity is also a function of radial and axial coordinates. The equations can be written in conservation form and look similar to the two dimensional equations except that the radial coordinate is present in all the terms of the equation. Dirichlet conditions on all the three velocity components and the temperature are imposed weakly together with penalty terms. The KFVS scheme [31] is used for the numerical flux function which is known to be robust in terms of positivity preservation. For the second order reconstruction, the min–max limiter is used wich ensures positivity of reconstructed pressure and temperature. The strong implementation could not succeed due to loss of positivity property of density/pressure near the corners of the annulus. For the weak implementation, the temperature solution is shown in Fig. 21b which indicates that the isothermal conditions have been well approximated by the weak scheme, while the density is shown in Fig. 22b. There is a large nearly exponential radial gradient in density and pressure due to the high speed rotation and the density is very small near the inner cylinder. The non-uniform temperature of the walls sets up a weak secondary flow which is shown in Fig. 22a.
Fig. 21

High speed rotating annulus: a domain and temperature boundary conditions, b temperature

Fig. 22

High speed rotating annulus: a secondary flow streamlines b density

6 Summary and conclusions

We have proposed a novel method for finite volume approximation of Laplace operator on triangular grids which has the summation-by-parts property on triangular grids in two dimensions with proper consideration of Dirichlet boundary conditions. The new scheme implements Dirichlet boundary conditions in a weak manner and leads to an energy stability property for the time dependent heat equation. We also propose the use of a Nitsche-type penalty term which is found to improve the accuracy of the scheme. The weak implementation gives solutions which are as accurate as the strong boundary conditions. The general idea for the approximation of Laplacian type operator as presented here can be used in other problems also. These ideas are extended to the compressible Navier–Stokes equations and we prove kinetic energy stability property of the finite volume scheme. Such schemes can be useful for DNS of compressible flows where kinetic energy consistency plays an important role in correctly capturing the energy cascade mechanism. For unresolved simulations, the scheme needs to contain some explicit or implicit numerical dissipation. We use the SBP discretization of viscous and heat transfer terms in combination with a numerical flux function for the inviscid fluxes and show that this leads to accurate solutions on many standard test problems. The weak implementation of the boundary conditions on velocity and temperature also promotes better iterative convergence for steady state problems which is not the case with strong boundary conditions. These schemes can be extended to tetrahedral grids in three dimensions.


  1. 1.

    The notation \(\partial A_i \cap T\) denotes the portion of the boundary \(\partial A_i\) which is inside T.

  2. 2.

    B. Fortunato and M. Vinicio, In Proceedings of 14th ICNMFD, Lecture Notes in Physics, Springer-Verlag, Berlin, 1995, pp. 259.



The author was supported by the Airbus Chair on Mathematics of Complex Systems at TIFR-CAM, Bangalore, in carrying out this work.


  1. 1.
    Barth, T.J.: Numerical aspects of computing high Reynolds number flow on unstructured meshes. In: 29th AIAA Aerospace Science Meeting. AIAA Paper 91-0721 (1991)Google Scholar
  2. 2.
    Kreiss, H.-O., Scherer, G.: Finite element and finite difference methods for hyperbolic partial differential equations. In: Mathematical Aspects of Finite Elements in Partial Differential Equations, pp. 195–212. Academic Press, New York (1974) Google Scholar
  3. 3.
    Strand, B.: Summation by parts for finite difference approximations for d/dx. J. Comput. Phys. 110(1), 47–67 (1994). doi:10.1006/jcph.1994.1005 MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Carpenter, M.H., Gottlieb, D., Abarbanel, S.: Stable and accurate boundary treatments for compact, high-order finite-difference schemes. Appl. Numer. Math. 12(1–3), 55–87 (1993). doi:10.1016/0168-9274(93)90112-5 MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Nordstrom, J., Bjorck, M.: Finite volume approximations and strict stability for hyperbolic problems. Appl. Numer. Math. 38(3), 237–255 (2001). doi:10.1016/S0168-9274(01)00027-7 MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Svard, M., Carpenter, M.H., Nordstrom, J.: A stable high-order finite difference scheme for the compressible Navier–Stokes equations, far-field boundary conditions. J. Comput. Phys. 225(1), 1020–1038 (2007). doi:10.1016/ MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Abbas, Q., Nordstrom, J.: Weak versus strong no-slip boundary conditions for the Navier–Stokes equations. Eng. Appl. Comput. Fluid Mech. 4(1), 29–38 (2010)Google Scholar
  8. 8.
    Nordström, J., Eriksson, S., Eliasson, P.: Weak and strong wall boundary procedures and convergence to steady-state of the Navier–Stokes equations. J. Comput. Phys. 231(14), 4867–4884 (2012). doi:10.1016/ MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    Shashkov, M., Steinberg, S.: Support-operator finite-difference algorithms for general elliptic problems. J. Comput. Phys. 118(1), 131–151 (1995). doi:10.1006/jcph.1995.1085 MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Hyman, J., Shashkov, M.: Approximation of boundary conditions for mimetic finite-difference methods. Comput. Math. Appl. 36(5), 79–99 (1998). doi:10.1016/S0898-1221(98)00152-7 MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Verstappen, R., Veldman, A.: Symmetry-preserving discretization of turbulent flow. J. Comput. Phys. 187(1), 343–368 (2003). doi:10.1016/S0021-9991(03)00126-8 MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Nordstrom, J., Forsberg, K., Adamsson, C., Eliasson, P.: Finite volume methods, unstructured meshes and strict stability for hyperbolic problems. Appl. Numer. Math. 45(4), 453–473 (2003). doi:10.1016/S0168-9274(02)00239-8 MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Subramanian, V., Perot, J.: Higher-order mimetic methods for unstructured meshes. J. Comput. Phys. 219(1), 68–85 (2006)CrossRefMATHGoogle Scholar
  14. 14.
    Svard, M., Nordstrom, J.: Stability of finite volume approximations for the Laplacian operator on quadrilateral and triangular grids. Appl. Numer. Math. 51(1), 101–125 (2004). doi:10.1016/j.apnum.2004.02.001 MathSciNetCrossRefMATHGoogle Scholar
  15. 15.
    Svard, M., Gong, J., Nordstrom, J.: An accuracy evaluation of unstructured node-centred finite volume methods. Appl. Numer. Math. 58(8), 1142–1158 (2008). doi:10.1016/j.apnum.2007.05.002 MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Diskin, B., Nishikawa, H., White, J.A.: Comparison of node-centered and cell-centered unstructured finite-volume discretizations: viscous fluxes. AIAA J. 48(7), 1326–1338 (2010) CrossRefGoogle Scholar
  17. 17.
    Perot, J.B.: Discrete conservation properties of unstructured mesh schemes. In: Davis, S.H., Moin, P. (eds.) Annual Review of Fluid Mechanics, vol. 43, pp. 299–318 (2011). doi:10.1146/annurev-fluid-122109-160645
  18. 18.
    Nitsche, J.: Über ein Variationsprinzip zur Lösung von Dirichlet-Problemen bei Verwendung von Teilräumen, die keinen Randbedingungen unterworfen sind. Abh. Math. Sem. Univ. Hamb. 36, 9–15 (1971). (collection of articles dedicated to Lothar Collatz on his sixtieth birthday)MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    Jameson, A.: Formulation of kinetic energy preserving conservative schemes for gas dynamics and direct numerical simulation of one-dimensional viscous compressible flow in a shock tube using entropy and kinetic energy preserving schemes. J. Sci. Comput. 34(2), 188–208 (2008). doi:10.1007/s10915-007-9172-6 MathSciNetCrossRefMATHGoogle Scholar
  20. 20.
    Barth, T.J.: Parallel CFD algorithms on unstructured meshes. In: Special Course on Parallel Computing in CFD, no. 807. AGARD (1995)Google Scholar
  21. 21.
    Mavriplis, D.J.: Unstructured mesh discretizations and solvers for computational aerodynamics. AIAA J. 46(6), 1281–1298 (2008)Google Scholar
  22. 22.
    Batchelor, G.K.: An Introduction to Fluid Dynamics. Cambridge University Press, Cambridge (2000)CrossRefMATHGoogle Scholar
  23. 23.
    Toro, E.F.: Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction. Springer, New York (1999)CrossRefMATHGoogle Scholar
  24. 24.
    van Leer, B.: Towards the ultimate conservative difference scheme. V. A second-order sequel to Godunov’s method. J. Comput. Phys. 32(1), 101–136 (1979). doi:10.1016/0021-9991(79)90145-1 CrossRefGoogle Scholar
  25. 25.
    Lohner, R.: Applied CFD Techniques: An Introduction Based on Finite Element Methods. Wiley, New York (2001)MATHGoogle Scholar
  26. 26.
    Barth, T.J., Jespersen, D.C.: The design and analysis of upwind schemes on unstructured meshes. In: 27th Aerospace Sciences Meeting. no. AIAA-89-0366, Reno, NV (1989)Google Scholar
  27. 27.
    Barth, T., Ohlberger, M.: Finite volume methods: foundation and analysis. In: Stein, E., Borst, R.D., Hughes, T.J. (eds.) Encyclopedia of Computational Mechanics, vol. 1, Ch. 15. Wiley, New York (2004)Google Scholar
  28. 28.
    Venkatakrishnan, V.: Convergence to steady state solutions of the euler equations on unstructured grids with limiters. J. Comput. Phys. 118(1), 120–130 (1995). doi:10.1006/jcph.1995.1084 CrossRefMATHGoogle Scholar
  29. 29.
    Shu, C.-W., Osher, S.: Efficient implementation of essentially non-oscillatory shock-capturing schemes. J. Comput. Phys. 77(2), 439–471 (1988). doi:10.1016/0021-9991(88)90177-5 MathSciNetCrossRefMATHGoogle Scholar
  30. 30.
    Ghia, U., Ghia, K., Shin, C.: High-Re solutions for incompressible flow using the Navier–Stokes equations and a multigrid method. J. Comput. Phys. 48(3), 387–411 (1982). doi:10.1016/0021-9991(82)90058-4 CrossRefMATHGoogle Scholar
  31. 31.
    Mandal, J.C., Deshpande, S.M.: Kinetic flux vector splitting for Euler equations. Comput. Fluids 23(2), 447–478 (1994). doi:10.1016/0045-7930(94)90050-7 MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Indian Institute of Technology Madras 2016

Authors and Affiliations

  1. 1.TIFR Center for Applicable MathematicsBangaloreIndia

Personalised recommendations