A Parallel 2D Finite Volume Scheme for Solving Systems of Balance Laws
Total Page:16
File Type:pdf, Size:1020Kb
Comput. Methods Appl. Mech. Engrg. 195 (2006) 2788–2815 www.elsevier.com/locate/cma A parallel 2d finite volume scheme for solving systems of balance laws with nonconservative products: Application to shallow flows M.J. Castro a,*, J.A. Garcı´a-Rodrı´guez a, J.M. Gonza´lez-Vida b, C. Pare´s a a Dpto. de Ana´lisis Matema´tico, Universidad de Ma´laga, Campus Teatinos s/n, 29071 Ma´laga, Spain b Dpto. de Matema´tica Aplicada, Universidad de Ma´laga, Spain Received 20 January 2005; received in revised form 1 July 2005; accepted 5 July 2005 Abstract The goal of this paper is to construct parallel solvers for 2d hyperbolic systems of conservation laws with source terms and nonconservative products. More precisely, finite volumes solvers on nonstructured grids are considered. The method of lines is applied: at every intercell a projected Riemann problem along the normal direction is considered which is discretized by means of the numerical schemes presented in [M.J. Castro, J. Macı´as, C. Pare´s. A Q-scheme for a class of systems of coupled conservation laws with source term. Application to a two-layer 1-D shallow water system, ESAIM: M2AN 35 (1) (2001) 107–127]. The resulting 2d numerical schemes are explicit and first order accurate. The solver is next parallelized by a domain decomposition technique. The specific application of the scheme to one- and two- layer shallow water systems has been implemented on a PCÕs cluster. An efficient data structure based on OOMPI (C++ object oriented extension of MPI) has been developed to optimize the data exchange among the processors. Some numerical tests are next presented to validate the solver and the performance of its parallel implementation. Finally the two-layer shallow water model is applied to the simulation of the steady exchange through the Strait of Gibraltar. Ó 2005 Elsevier B.V. All rights reserved. Keywords: Parallelization; Domain decomposition; Finite volume schemes; Conservation laws; Source terms; Nonconservative products; Shallow water systems; Two-layer problems; Geophysical flows; Strait of Gibraltar * Corresponding author. E-mail address: [email protected] (M.J. Castro). 0045-7825/$ - see front matter Ó 2005 Elsevier B.V. All rights reserved. doi:10.1016/j.cma.2005.07.007 M.J. Castro et al. / Comput. Methods Appl. Mech. Engrg. 195 (2006) 2788–2815 2789 1. Introduction This article deals with the discretization of 2d hyperbolic systems of conservation laws with source terms and nonconservative products by means of finite volume solvers on nonstructured grids. Problems of this nature arise in computational fluid dynamics. We are concerned in particular with the simulation of free- surface waves in shallow layers of homogeneous fluids or internal waves in stratified fluids composed by two shallow layers of immiscible liquids. The motion of a layer of homogeneous fluid is supposed here to be governed by the shallow water system, formulated under the form of a conservation law with source terms or balance law. In the stratified case, the flow is supposed to be governed by a system composed by two coupled shallow water systems. The global system can be formulated under the form of two coupled balance laws, the coupling terms having the form of nonconservative products. We are mainly interested in the application of these systems to geophysical flows: models based on shal- low water systems are useful for the simulation of rivers, channels, dambreak problems, etc. Stratified fluids are ubiquitous in nature: they appear in atmospheric flows, ocean currents, estuarine systems, etc. This is the situation, for instance, in the Strait of Gibraltar, where surface water from the Atlantic inflows over saltier westward-flowing Mediterranean water. It is well known that numerical methods that are suitable for solving conservation laws can fail in solving systems of balance laws, specially when approaching equilibria or near to equilibria solutions. Bermu´dez and Va´zquez-Cendo´n have shown in [29,3] that methods based on RoeÕs discretization of the flux terms and upwinding the source terms suitably solve these difficulties. For the particular case of the shallow water system, these authors introduced the condition called conservation property or C-property: a first order scheme is said to satisfy this condition if it solves, exactly or up to the second order, the steady state solu- tions corresponding to water at rest. The idea of constructing numerical schemes that preserve some equi- libria, which are called in general well-balanced schemes, has been extended in different ways: see [4] and the references therein, [18,13–15,20]. The presence of nonconservative products add more difficulties: in [12] it was shown that standard meth- ods for conservation laws can fail to convergence when they are applied to coupled systems of conservation or balance laws. In this latter article, some stable numerical schemes for 1d coupled systems of balance laws generalizing those introduced in [29,30,3] were presented. In the particular case of the two-layer shallow water system, the well-balance property required to the numerical schemes was the natural extension of the C-property: equilibria corresponding to water at rest had to be preserved. In [10] this work has been extended to the more complex system corresponding to 1d two-layer shallow water models in symmetric channels with irregular geometries. Besides the difficulties related to source terms and nonconservative products, some specific problems ap- pear in the particular case of shallow water systems like the numerical simulation of wet/dry fronts appear- ing when the thickness of the water layer vanishes. This difficulty also arises in two-layer fluids when the thickness of at least one of the layers vanishes. In real flows these situations appear in coastal simulations, upwelling events, etc. In [21,8,11] some modifications of the numerical scheme presented in [12] were pro- posed to handle with this difficulty. A specific difficulty related to the two-layer shallow water system is the appearance of Kelvin–Helmholtz instabilities due to the destabilizing effect of shear, which may overcome the stabilizing effects of stratifica- tion. When these instabilities develop, the P.D.E. system loses its hyperbolic character and the numerical scheme becomes unstable due to the appearance of complex eigenvalues. In this case, the assumptions of the two-layer model considered here are no longer valid: the interface becomes a rolled-up layer which can- not be represented as the graph of a function. Nevertheless, the model can be useful to simulate flows where Kelvin–Helmholtz instabilities are expected to appear only in a sporadic and local way. In this case a cor- rection has to be added to the numerical scheme to support instability episodes. In [18] a numerical 2790 M.J. Castro et al. / Comput. Methods Appl. Mech. Engrg. 195 (2006) 2788–2815 treatment was proposed consisting in adding locally an extra friction term when complex eigenvalues ap- pear. This extra amount of friction is intended to simulate the loss of momentum induced by the instabil- ities in real flows. The goal of this work is to obtain a first order explicit well-balanced numerical scheme for a general sys- tem of balance laws with nonconservative products generalizing the 1d solver presented in [12] for coupled systems of balance laws. Moreover, this numerical scheme has to be able to handle with wet/dry fronts and Kelvin–Helmholtz instabilities. The construction of such a numerical scheme will be based on the method of lines: following the procedure used in [18] for 2d balance laws, at every edge of the finite volume mesh a projected Riemann problem along the normal direction is considered which is discretized by means of a 1d numerical scheme. Discontinuous Galerkin methods offer an alternative way of building 2d schemes from 1d solvers (see [17] for a recent application to shallow water systems). The 2d solver presented here is original for problems with source terms and nonconservative products, but its application to the particular case of systems of balance laws recovers some known schemes: it coin- cides with the numerical scheme proposed in [29] for the 2d shallow water system and with a particular case of the family of numerical schemes for 2d systems of balance laws introduced in [18]. Due to the first order accuracy of the numerical scheme and to the fact that the space and/or the time scales are frequently very large, the realistic simulation of geophysical flows with the resulting solver can be highly CPU time consuming. Therefore, we study also its parallelization by means of a decomposition do- main technique. In order to minimize the computational time, data exchange among processors has to be minimized. The organization of the article is as follows: in Section 2, we present the general formulation of systems of balance laws with nonconservative products and source terms in 2d domains, and the particular cases corresponding to the one- and two-layer shallow water systems. Next, the construction of the numerical scheme is presented for the general case. Section 4 is devoted to the description of the domain decompo- sition technique used to parallelize the numerical scheme. The application to the one and the two-layer shal- low water systems is presented in Section 5, together with the study of the well-balance properties of the resulting schemes. Some notes about the practical implementation of the numerical scheme are presented in Section 6.We describe briefly the PCÕs cluster used, the finite volume chosen, the mesh partitioner considered and the data structure implemented in OOMPI (a C++ object oriented extension of MPI) in order to optimize the com- munications among processors. Finally, some numerical experiments are presented in order to validate the solver and to assess the per- formance of the one-layer and the two-layer shallow water models.