Advances in Mathematical Physics

Volume 2016 (2016), Article ID 7528625, 7 pages

http://dx.doi.org/10.1155/2016/7528625

## Adaptive Finite Volume Method for the Shallow Water Equations on Triangular Grids

Department of Mathematics, Faculty of Science and Technology, Sanata Dharma University, Mrican, Tromol Pos 29, Yogyakarta 55002, Indonesia

Received 31 March 2016; Revised 21 August 2016; Accepted 5 September 2016

Academic Editor: Soheil Salahshour

Copyright © 2016 Sudi Mungkasi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

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.

#### 1. 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 be the number of vertices and be the number of elements, where the elements are triangles. A two-dimensional triangulation is represented by the matrices node and elem. The th row of the matrix node represents the coordinates of the th node. The th row of the matrix elem stores the three nodes (global indices of vertices) of the th 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 is called shape-regular if there exists a constant such thatfor all triangles in , where 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 are given by elem. The newest-vertex of the triangle is set as elem and the refinement edge is elem. That is, if we label vertices of the parent as , , and and the new node relating to a refinement of is , then the children of have vertices , , and and , , and . The first child called the LEFT (L) child occupies the location used by . 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 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 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 cutEdgecutEdge. The rule which enforces conformity is that if cutEdge is bisected, then cutEdge 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 . Triangle is bisected with respect to the longest edge of , as shown in Figure 1(b), leading to a nonconforming triangulation because a hanging node occurs. The neighbour of having the common edge of that is bisected is triangle . Then triangle is bisected with respect to the longest edge of , 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 , which leads to a fine conforming triangulation.