This paper presents a numerical entropy production (NEP) scheme for two-dimensional shallow water equations on unstructured triangular grids. We implement NEP as the error indicator for adaptive mesh refinement or coarsening in solving the shallow water equations using a finite volume method. Numerical simulations show that NEP is successful to be a refinement/coarsening indicator in the adaptive mesh finite volume method, as the method refines the mesh or grids around nonsmooth regions and coarsens them around smooth regions.
Australian National UniversitySanata Dharma University1. Introduction
The numerical entropy production (NEP) has been implemented successfully as smoothness indicator (error indicator) in adaptive finite volume methods used to solve compressible fluid problems [1–4]. In the work of Mungkasi and Roberts [5, 6], NEP was used for solving the one-dimensional shallow water equations. We note that two-dimensional problems are more complex and more applicable in real situations but challenging to solve.
The goal of this paper is to implement the NEP into an adaptive mesh finite volume method used to solve the two-dimensional shallow water equations on unstructured triangular grids. Recall that NEP diverges under grid refinement on nonsmooth regions, while it has the same order of magnitude of the local error on smooth ones [4]. The difference between the degrees of accuracy between smooth and nonsmooth regions makes the NEP able to detect the smoothness of the numerical solution. Therefore, we are confident here to implement the NEP as smoothness indicator into the adaptive mesh finite volume method.
Our adaptive mesh finite volume method uses iFEM as the underlying data structure, an integrated finite element methods package in MATLAB. We note that iFEM and its data structure are not of our work, but they were developed by Chen [7]. Even though iFEM was originally developed for finite element methods, we can still use it to achieve our goal for finite volume methods. This is because what we need is actually the data structure of iFEM. Therefore, we can adapt the original iFEM into our finite volume problems.
This paper is organised as follows. Section 2 summarises the iFEM data structure for triangulations to assist mesh refinement and coarsening techniques in the finite volume method. In Section 3, we recall the two-dimensional shallow water equations and present the scheme for the numerical entropy production. Some simulation results are reported in Section 4. Finally, we draw concluding remarks in Section 5.
2. Data Structure for Triangulations
We implement two-dimensional mesh triangulations of iFEM. In this section, we summarise the iFEM data structure for triangulations to assist mesh adaptation (refinement or coarsening) techniques in our finite volume method. More detailed explanations can be found in a technical report written by Chen [7] and a paper by Chen and Zhang [8]. Note that in our work the spatial dimension is two.
Let N be the number of vertices and NT be the number of elements, where the elements are triangles. A two-dimensional triangulation is represented by the matrices node(1:N,1:2) and elem(1:NT,1:3). The ith row of the matrix node represents the (x,y) coordinates of the ith node. The ith row of the matrix elem stores the three nodes (global indices of vertices) of the ith element. The three nodes are stored counterclockwise.
Two conditions on triangulations are imposed. The first condition is that a triangulation must be conforming. That is, the intersection of any two simplexes in the triangulation is either empty or a common lower dimensional simplex. The second condition is that all triangulations must be shape-regular. A triangulation T is called shape-regular if there exists a constant c0 such that(1)maxτ∈Tdiamτ2τ≤c0for all triangles T in T, where diam(τ) is the diameter of τ and |τ| is the measure of τ.
2.1. Refinement: The Bisection Method
A newest-vertex bisection method is implemented for grid refinement, but in the initial triangulation the longest edge is assigned as the refinement edge of each triangle. The function bisect refines a given triangulation by bisecting marked elements and minimal neighbouring elements to get a conforming and shape-regular triangulation. This means that a triangle is bisected based on the newest-vertex appearing on that triangle. In other words, the newest-vertex appearing on that triangle is used as the reference for the triangular bisection.
A triangulation is labeled as follows. Note that global indices of three vertices of a triangle t are given by elem(t,{1,2,3}). The newest-vertex of the triangle t is set as elem(t,1) and the refinement edge is elem(t,{2,3}). That is, if we label vertices of the parent t as p1, p2, and p3 and the new node relating to a refinement of t is p4, then the children of t have vertices p4, p1, and p2 and p4, p3, and p1. The first child called the LEFT (L) child occupies the location used by t. The second child called the RIGHT (R) child is appended as a new element to elem matrix. To be specific, the first (L) child is stored prior to the second (R) child in elem matrix. We call this storing technique the (L,R) positioning.
Bisections over a collection of elements could result in a nonconforming triangulation. To enforce that we get a conforming triangulation, we do the following. Let cutEdge(τ) be the refinement edge of τ and F(τ) be the refinement neighbour of τ. The refinement neighbour means the neighbour sharing the refinement edge of τ. We note that a triangle τ has at most three neighbours and we may have that cutEdge(τ)≠cutEdge(F(τ)). The rule which enforces conformity is that if cutEdge(τ) is bisected, then cutEdge(F(τ)) must also be bisected. In iFEM, this rule is implemented in a loop and the loop terminates in a finite number of steps producing a conforming triangulation.
An example of the refinement procedure is illustrated in Figure 1. Let us consider an initial triangulation, as shown in Figure 1(a). Suppose that we want to refine triangle T1. Triangle T1 is bisected with respect to the longest edge of T1, as shown in Figure 1(b), leading to a nonconforming triangulation because a hanging node occurs. The neighbour of T1 having the common edge of T1 that is bisected is triangle T2. Then triangle T2 is bisected with respect to the longest edge of T2, as shown in Figure 1(c), leading to another nonconforming triangulation because the hanging node still occurs. Finally the hanging node is used as a reference for bisecting triangle T2.2, which leads to a fine conforming triangulation.
Illustration of the refinement procedure.
Initial triangles
After a triangle is bisected
Hanging node still occurs
Conforming triangles
2.2. Coarsening: A Nodal-Wise Algorithm
A nodal-wise coarsening algorithm is used for adaptive grids obtained from newest-vertex bisections, with a note that the algorithm enforces not to coarsen the grids in the initial triangulation. A coarsening process is thought as the inverse of a conforming bisection and restricted to a conforming star. A conforming bisection means a bisection which results in a conforming triangulation, and a conforming star means a star-shaped domain consisting of some conforming triangles.
A node p is called a good-for-coarsening node or a good node in short if there exists a conforming bisection be such that p is the middle point of e, where be bisects
two conforming triangles into four conforming triangles if e is an interior edge or
one triangle into two conforming triangles if e is a boundary edge.
Finding good nodes can be described as follows. Let T and T0 be conforming triangulations, where T can be found by refinement of some triangles of T0. A node of T is a good node if and only if
it is not a vertex of T0,
it is the newest-vertex of all elements in the star of the node,
the number of elements in the star is four if the node is an interior node or two otherwise (a boundary node).
Therefore, if some triangles of T are marked to be coarsened, then we check the newest vertices, which satisfies the three conditions, of the marked elements.
After good nodes are identified, coarsening of conforming stars can be done by considering the (L,R) type of positioning. If a good node is an interior node, then four conforming triangles are coarsened into two conforming ones. If a good node is a boundary node, then two conforming triangles are coarsened into one triangle.
An example of the coarsening procedure is illustrated in Figure 2. Let us consider the triangulation in Figure 1(d). Suppose that we want to coarsen the triangles T1.1 and T1.2. Coarsening these two triangles results in a nonconforming triangulation, because a hanging node occurs, as shown in Figure 2(a). Then the two triangles T2.2.1 and T2.2.2 sharing the same hanging node are coarsened, which leads to a coarse conforming triangulation, as shown in Figure 2(b).
Illustration of the coarsening procedure.
After two triangles are coarsened
Conforming triangles
2.3. Conserved Quantities in Finite Volume Methods
The data structure for conserved quantities follows from the structure for triangulations. In addition, if a parent-cell is bisected, then we do a quantitative splitting of the amount of the conserved quantity of the parent-cell into two parts for the resulting child-cells. If two conforming child-cells are coarsened then we do a quantitative averaging of the amount of the conserved quantity of the child-cells for the resulting parent-cell. The splitting and averaging are done in a proportional weight with respect to the areas of the base child-cells.
Remark 1.
In the refinement and coarsening processes of iFEM, the longest edge is assigned as the refinement edge of each triangle in the initial triangulation T0. In iFEM, the subroutine label is needed only for the initial triangulation. Therefore, the subroutine label is called outside of the function bisect. This procedure leads to a shape-regular triangulation and so prevents the formation of triangles with very small angles (see Chen [7] for more details on this data structure of iFEM).
3. Numerical Entropy Production
Recall the two-dimensional shallow water (wave) equations(2)qt+fqx+gqy=s,where q=hhuhvT is the vector of conserved quantities consisting of water depth h, x-momentum hu, and y-momentum hv. Here, u and v are velocities in the x- and y-direction; f(q) and g(q) are flux functions in the x- and y-direction given by(3)fq=huhu2+12gh2huv,gq=hvhuvhv2+12gh2;the source term is(4)s=0-ghzx-ghzy,where z(x,y) is the bed topography. The stage (absolute water level) is given by w≔z+h. The constant g is the acceleration due to gravity. The free variables are the spaces x and y as well as time t. More explanation about the shallow water equations can be found in the literature, such as Akyildiz [9], Peng [10], and Yue et al. [11].
The entropy inequality is [12](5)ηt+ψx+ϕy≤0,where the entropy is(6)ηqx,y,t,zx,y=12hu2+v2+12gh2+ghz,and entropy fluxes are(7)ψqx,y,t,zx,y=12hu2+v2+gh2+ghzu,ϕqx,y,t,zx,y=12hu2+v2+gh2+ghzv.
We solve the two-dimensional shallow water equations using a finite volume method described by Mungkasi and Roberts [13], but in the present paper, we improve the method adaptively. The finite volume method itself has been used to solve one-dimensional problems successfully [14–16].
For a smooth solution, (5) becomes an equality and is called entropy equation. To compute the NEP we need to evolve numerically the entropy based on the entropy residual, given by the discretisation of the left hand side of (5). This evolution is done together with the evolution of the conserved quantities. We may discretise the spatial domain into arbitrary polygonal cells, but in this paper we focus our work on triangular grids. Then for an arbitrary cell i, we have a semidiscrete scheme for the entropy evolution(8)dΘidt+1Ai∑j∈NiΨijlij≲0.The notation ij is the edge (interface) between the i and j cells. Here Θi is an approximation of the averaged entropy over the i cell, Ψij is the outward normal entropy flux across the edge ij, and lij is the length of the edge ij. In addition, N(i) is the set of three neighbouring cells of the i cell and Ai is the area of the i cell. The flux Ψij is evaluated using a consistent numerical flux function Ψ(·,·) such that for all values of Θ(9)ΨΘ,Θ=ψΘ.Furthermore,(10)Ψij=ΨΘimij,Θjmij,where mij is the midpoint of the ij edge.
Note that in (8) we have used the sign “≲.” With this sign, we mean that it is not guaranteed that inequality “<” in (8) holds. Note also that it has been proven that the entropy production, which is the left hand side of (8), is negative definite only for some cases. In general, the entropy production may have positive overshoots. More details can be found in the work of Puppo and Semplice [4].
Recall that, in evolving the conserved quantities [13], we employ rotations from global coordinates into local coordinates in order to compute the conserved quantity fluxes. The rotations are needed because the conserved quantities are vector-valued. However, unlike the conserved quantities, the entropy is scalar-valued. Therefore, in evolving the entropy numerically we do not need to do any rotation but directly compute the edge-flux at each interface between cells.
The NEP is formulated as(11)Ein=1ΔtηQin-Θin.In (11), Θin is found from the numerical entropy scheme (8) with ηQn-1 as the input; Qin is found from the finite volume scheme with Qn-1 as the input; and Δt is the time step used in those two schemes. Following Puppo and Semplice [4], the NEP formula is expressed as (12)Ein=1ΔtηQin-ηQin-1+1Ai∑j∈NiΨijlij.
Remark 2.
The left hand side of (8) is not zero. It defines the entropy residual (in semidiscrete form), from which we then derive Ein in (11) and (12). The left hand side of (8) in fact is not exactly zero, even on smooth flows, because we have discretised the entropy relation in space. More discussions about entropy and related schemes are given comprehensively by a number of researchers, such as Tadmor et al. [17–21].
4. Numerical Simulations
In this section, we present two simulations to show the performance of the NEP as smoothness indicator in the adaptive mesh finite volume methods. The two simulations are planar and radial dam-break problems. A first-order method is used. Quantities are measured in SI units. The numerical flux due to Kurganov, Noelle, and Petrova (KNP) [22] is used. The acceleration due to gravity is taken as g=9.81.
4.1. Planar Dam-Break Problem
We consider a spatial domain defined by (x,y)∈[-1,1]×[-1,1]. The domain is discretised into 2048 triangular cells initially. The initial condition is(13)ux,y,0=0,vx,y,0=0,wx,y,0=0.5,if x<0,0.2,if otherwise.The bottom topography is z(x,y)=0 for all x and y. We take fixed time step Δt=0.002 with 100 iterations. The maximum level of refinement/coarsening is 2 at each iteration. That is, a triangular cell can be refined or coarsened up to two levels finer or two levels coarser at each iteration. However, we restrict our refinement/coarsening only up to 8 levels of triangles from the smallest to the largest. The NEP tolerance is NEPtol=0.25maxNEP. That is, if the NEP is larger than the tolerance, then the corresponding cell is refined in order to get more accurate results. After the refinement procedure if the NEP is lower than the tolerance, then the corresponding cell is coarsened in order to get faster computation.
Representatives of simulation results are shown in Figures 3 and 4. We see that fine grids occur around shock and rarefaction regions in order to get accurate solutions at those regions. Coarser grids occur in smooth regions having flat water surface in this case. This means that the adaptive finite volume method works well as we expect and is consistent with the behaviour for the one-dimensional problems as in our Ph.D. thesis [23]. At this time (t=0.2) the number of cells is 1544, which is a smaller number than 2048, the initial number of cells.
The water surface of the planar dam-break problem at t=0.2 using the adaptive method. The base plane is the xy-plane.
The mesh of the planar dam-break problem at t=0.2 using the adaptive method. The x-axis is horizontal. The y-axis is vertical.
4.2. Radial Dam-Break Problem
We consider a spatial domain defined by (x,y)∈[-1,1]×[-1,1]. The initial condition is(14)ux,y,0=0,vx,y,0=0,wx,y,0=1,if x2+y2<0.25,0.5,if otherwise.The bottom topography is z(x,y)=0 for all x and y.
The domain is discretised into 2048 triangular cells initially. We take fixed time step Δt=0.002 with 25 iterations. The maximum level of refinement/coarsening is 2 at each iteration, so that a triangular cell can be refined or coarsened up to two levels finer or two levels coarser at each iteration. Again, we restrict our refinement/coarsening only up to 8 levels of triangles from the smallest to the largest. The NEP tolerance is NEPtol=0.25maxNEP. Cells having absolute NEP larger than NEPtol are candidates for refinement, while otherwise they are candidates for coarsening.
Representatives of simulation results are shown in Figures 5 and 6. Similar to the previous simulation, we see that the grids are small around the shock and rarefaction in order to get accurate solutions and large at flat water surface in order to reduce the computational cost. At this time (t=0.05), the number of cells is 1968.
The water surface of the radial dam-break problem at t=0.05 using the adaptive method. The base plane is the xy-plane.
The mesh of the radial dam-break problem at t=0.05 using the adaptive method. The x-axis is horizontal. The y-axis is vertical.
Remark 3.
In our simulations above, we have specified intuitively the criterion for choosing the NEP threshold (tolerance) used to trigger grid refinement and coarsening. Obviously the tolerance should be between zero and the maximum value of the absolute NEP. If the tolerance is too large, then the grids will be too coarse so the wave will be too diffusive and inaccurate. If the tolerance is too small, then the grids will be too fine; that is, the computation will be very expensive even though the solution is accurate. This trade-off could be studied further but is out of the scope of this paper.
5. Conclusions
Numerical entropy production has been implemented into an adaptive mesh finite volume method used to solve the two-dimensional shallow water equations. The implementation is successful, as the method does refinement around nonsmooth regions and coarsening around smooth regions. Future work will focus on the error analysis and investigate the rate of convergence of the adaptive method.
Disclosure
Some parts of this work were conducted and written as a portion of the author’s Ph.D. thesis at the Australian National University. Other parts were conducted and written at Sanata Dharma University after the author received the Ph.D. degree.
Competing Interests
The author declares that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This work was financially supported by the Australian National University (ANU), Canberra, Australia, and Sanata Dharma University, Yogyakarta, Indonesia. The author thanks Professor Stephen Gwyn Roberts at the Mathematical Sciences Institute of the ANU for the advice and discussions.
GolayF.Numerical entropy production and error indicator for compressible flows2009337423323710.1016/j.crme.2009.04.0042-s2.0-67649213954PuppoG.Numerical entropy production on shocks and smooth transitions200217263271PuppoG.Numerical entropy production for central schemes20032541382141510.1137/s1064827502386712MR20450612-s2.0-4043092683PuppoG.SempliceM.Numerical entropy and adaptivity for finite volume schemes20111051132116010.4208/cicp.250909.210111aMR28308422-s2.0-80051762746MungkasiS.RobertsS. G.Numerical entropy production for shallow water flows201052C1C17MR2836500MungkasiS.RobertsS. G.Behaviour of the numerical entropy production of the one-and-a-half-dimensional shallow water equations201254C18C33MR3062615ChenL.iFEM: an integrated finite element methods package in MATLAB2009Irvine, Calif, USAUniversity of CaliforniaChenL.ZhangC.A coarsening algorithm on adaptive grids by newest vertex bisection and its applications201028676778910.4208/jcm.1004.m3172MR27659152-s2.0-78650181994AkyildizY.The shallow water equations: conservation laws and symplectic geometry198710355756210.1155/s016117128700067xMR896611PengS.-H.1D and 2D numerical modeling for solving dam-break flow problems using finite volume method201220121448926910.1155/2012/489269MR29157202-s2.0-84861060012YueZ.LiuH.LiY.HuP.ZhangY.A well-balanced and fully coupled noncapacity model for dam-break flooding201520151361385310.1155/2015/613853MR33420832-s2.0-84929377462BouchutF.ZeitlinV.Efficient numerical finite volume schemes for shallow water models20072chapter 4Elsevier189256Edited Series on Advances in Nonlinear Science and Complexity10.1016/S1574-6909(06)02004-1MungkasiS.RobertsS. G.A finite volume method for shallow water flows on triangular computational gridsProceedings of the International Conference on Advanced Computer Science and Information Systems (ICACSIS '11)December 2011Jakarta, Indonesia79842-s2.0-84857278147MungkasiS.RobertsS. G.On the best quantity reconstructions for a well balanced finite volume method used to solve the shallow water wave equations with a wet/dry interface200951C48C65MR2641109BiS.ZhouJ.LiuY.SongL.A finite volume method for modeling shallow flows with wet-dry fronts on adaptive Cartesian grids201420142020956210.1155/2014/209562MR32329632-s2.0-84904606015VosoughifarH. R.DolatshahA.ShokouhiS. K. S.Discretization of multidimensional mathematical equations of dam break phenomena using a novel approach of finite volume method201320131264248510.1155/2013/6424852-s2.0-84876551749TadmorE.Numerical viscosity and the entropy condition for conservative difference schemes19844316836938110.2307/2008282MR758189PerthameB.TadmorE.A kinetic equation with kinetic entropy functions for scalar conservation laws1991136350151710.1007/BF02099071MR10996932-s2.0-0000741448TadmorE.Entropy stability theory for difference approximations of nonlinear conservation laws and related time-dependent problems20031245151210.1017/S0962492902000156MR22491602-s2.0-24644493466FjordholmU. S.KäppeliR.MishraS.TadmorE.Construction of approximate entropy measure-valued solutions for hyperbolic systems of conservation lawsIn press10.1007/s10208-015-9299-z2-s2.0-84951822643TadmorE.Perfect derivatives, conservative differences and entropy stable computation of hyperbolic conservation laws20163684579459810.3934/dcds.2016.36.4579MR3479528KurganovA.NoelleS.PetrovaG.Semidiscrete central-upwind schemes for hyperbolic conservation laws and Hamilton-Jacobi equations200123370774010.1137/s1064827500373413MR18609612-s2.0-0036288577MungkasiS.A study of well-balanced finite volume methods and refinement indicators for the shallow water equations201388351352(PhD thesis, Australian National University, Canberra, 2012)