MODIFICATION OF A FINITE VOLUME SCHEME

0 downloads 0 Views 304KB Size Report
c 2001 Society for Industrial and Applied Mathematics. Vol. 23, No. .... equation with Dirichlet boundary conditions in the unit square ¯Ω: ∆u(x, y) ≡. ∂2u(x, y) ... the following problem: For arbitrary triangulation T, find a control volume VL which ... volume VL, the difference ni+1/2 ni1/2 gives a vector, normal to dual edge ei.
SIAM J. SCI. COMPUT. Vol. 23, No. 3, pp. 891–909

c 2001 Society for Industrial and Applied Mathematics 

MODIFICATION OF A FINITE VOLUME SCHEME FOR LAPLACE’S EQUATION∗ N. B. PETROVSKAYA† Abstract. For Laplace’s equation, we discuss whether it is possible to construct a linear positive finite volume (FV) scheme on arbitrary unstructured grids. Dealing with the arbitrary grids, we state a control volume which guarantees a positive FV scheme with linear reconstruction of the solution. The control volume is defined by a property of the analytical solution to the equation and does not depend on the grid geometry. For those problems where the choice of the control volume is prescribed a priori, we demonstrate how to improve positivity of the linear FV scheme by using corrected reconstruction stencils. The difficulties arising when grids with no geometric restrictions are used for the discretization are discussed. Numerical examples illustrating the developed approach to the stencil correction are given. Key words. Laplace’s equation, finite volume scheme, positivity, stencil correction AMS subject classifications. 65N12, 74S10, 35J05 PII. S1064827500368925

1. Introduction. A discrete Laplace operator is often considered to be a good model for investigating a discretization of partial differential equations which contain diffusion operator ∇·(D∇). Two important examples are given by convection-diffusion equations and Navier–Stokes equations with possible applications that include the problems of fluid dynamics, chemical engineering, and environmental pollution. For the numerical solution of these equations, what is desirable are discretization schemes which satisfy a discrete maximum principle (monotone schemes); otherwise one can expect strong oscillations or even divergency of the solution. There are two possible approaches for development of monotone schemes on unstructured grids. The first approach is to use the grids with some geometric constraints on the triangulation. It is well known that triangulations with no obtuse triangles allow us to construct monotone schemes. The relevant examples are given in [6, 11]. However, nonobtuse triangulations can be used on very few practical problems. In the process of the grid generation it is often required to resolve some complicated features of the problem geometry that makes strict angle control to be difficult. Looking for a wider class of triangulations, in the two-dimensional case a Delaunay triangulation [10] is very attractive. For Laplace’s equation, in the two-dimensional case the Delaunay triangulation provides positivity (that guarantees the discrete maximum principle) of the linear finite element/finite volume scheme (Barth [3]). This important property may be applied for the solution of a wide range of problems, even more general than discretization of the Laplace equation. For instance, Xu and Zikatanov [17] developed a linear monotone finite element scheme for convectiondiffusion equations in any spatial dimension. To obtain a positive discretization of the diffusion operator they assumed the restrictive geometrical conditions which in the two-dimensional case mean that the triangulation is a Delaunay triangulation. ∗ Received

by the editors March 15, 2000; accepted for publication (in revised form) April 23, 2001; published electronically August 29, 2001. This research was supported by the Boeing Company under contract 104R and Russian Foundation for Basic Research grant N 01-01-06273. http://www.siam.org/journals/sisc/23-3/36892.html † Keldysh Institute of Applied Mathematics/Boeing Operations International, Inc., Gazetny per., 17/9, Moscow, 103009, Russia ([email protected]). 891

892

N. B. PETROVSKAYA

Sakovich [16] used a Delaunay triangulation to control the grid quality for the construction of the monotone scheme for the system of two-dimensional conservation laws. In [16] the Laplace equation has been discretized first on the Delaunay grid. The coefficients of this discretization have then been exploited to obtain grid quality functional for the unstructured grids considered in the work. Although giving us all advantages of using monotone schemes, for many complex geometries (e.g., multicomponent airfoil configuration) the Delaunay triangulation does not provide grids optimal in the sense of the accuracy of the solution. In particular, the Delaunay triangulation does not control the maximum angle, so that nearly collapsed triangles may appear as the result of grid generation (Barth [4]). On the other hand, for the equations mentioned above, grid adaptation to the solution usually results in non-Delaunay meshes, while fully automatic generation of adapted Delaunay grids is a technically difficult task for many practical applications. That is why another approach appears, where the grids with no geometric restrictions are allowed for the discretization. In the present work, an effort has been made to investigate whether it is possible to construct a linear positive finite volume (FV) scheme for the Laplace equation on arbitrary unstructured grids. We demonstrate the impact of grid geometry on the quality of the FV scheme and discuss to what extent arbitrary grids are good for the positive discretization. When dealing with the arbitrary grid cells, it has been shown many times that for linear FV schemes a proper choice of the control volume allows us to improve the results of the discretization both on the structured and unstructured grids. Barth and Linton [5] successfully used the containment dual volume instead of the median dual on stretched triangulated quadrilateral grids to compute viscous flows. Having applied the viscous term discretization to the Laplace operator, Delanaye et al. [8] showed that a correction of the diamond-shaped control volume on Cartesian grids leads to the more positive scheme and obtained a robust discretization of the viscous terms in Navier–Stokes equations. Putti and Cordes [13] have proposed a modification of the control volume that allowed them to obtain the positive discretization of the Laplace equation on three-dimensional Delaunay meshes. In all these cases the choice of the control volume has been dictated by the geometry of grid cells. In the present paper we show that it is possible to derive a convex control volume which guarantees a positive FV scheme for the Laplace equation and does not depend on the grid geometry. A property of the analytical solution to the equation is taken into account for the construction of the control volume. Since a maximum principle is exploited to obtain the solution on the central node of a cell, the produced FV scheme is entirely positive on any two-dimensional unstructured mesh. For those practical applications where the geometry of the control volume is prescribed by some a priori conditions, we discuss how to improve the measures of positivity of the linear FV scheme on non-Delaunay meshes. Based on the analysis of the grid cell geometry, the stencils used for the linear reconstruction are corrected to obtain a more positive scheme. For some triangles, additional nodes of the triangulation are included into the stencils, while “far” stencil nodes generating negative scheme coefficients are eliminated from the discretization. This correction technique gives good results, producing a linear “quasipositive” FV scheme on the arbitrary meshes. The results obtained in the work lead us to a better understanding of the difficulties one may expect discretizing the Laplace equation on arbitrary meshes. The limits of using grids with no geometric restrictions for the positive discretization are

MODIFIED FINITE VOLUME SCHEME

893

T e VL 0

n

i+1/2

i+1/2

ti

CR

Fig. 1. The geometry of an FV scheme for Laplace’s equation.

discussed in the conclusions. 2. Control volume for the discrete Laplace operator. We consider Laplace’s ¯ equation with Dirichlet boundary conditions in the unit square Ω: (1)

∆u(x, y) ≡

∂ 2 u(x, y) ∂ 2 u(x, y) + = 0, (x, y) ∈ Ω = (0, 1) × (0, 1), ∂x2 ∂y 2 u(x, y) = g(x, y), (x, y) ∈ ∂Ω.

Let a triangulation T be the union of all triangles ti , i = 1, . . . , N, incident to a central node 0 (see Figure 1). To obtain an FV discretization of (1) on node 0, the contour integral  ∂u(x, y) (2) dl = 0 ∂n ∂Vdual is calculated over the edges of a control volume Vdual according to Green–Gauss theorem. For calculating ∂u(x,y) =(∇u, n) in (2) a linear reconstruction of the solution ∂n u(x, y) in each triangle ti is used: (3)

ui (x, y) = ai0 + ai1 x + ai2 y.

A standard stencil for the linear reconstruction in triangle ti includes three nodes of the triangle. Expansion coefficients aik , k = 0, 1, 2, in triangle ti are calculated by the condition ui (xk , yk ) = u(xk , yk ) ≡ uk . After calculation ∂u(x,y) and summation over all dual edges, the discrete Laplace ∂n operator on central node 0 is written as a weighted sum of nodal values un of the solution u(x, y): (4)

L(u) ≡

NT  n=0

ωn un = 0,

894

N. B. PETROVSKAYA

where NT is the number of the nodes of the triangulation. The requirement of nonnegativity ω0 < 0,

(5)

ωn ≥ 0,

n = 1, . . . , NT ,

NT 

ωn = 0

n=0

guarantees a maximum principle, which must hold for the discrete Laplacean (4) to provide stability and uniform convergence. For the standard FV scheme (4) coefficients ωn depend on what control volume Vdual is used for the discretization. A possible choice is a median dual or a centroid dual. The discretizations obtained over these control volumes are consistent and conservative, but they are not positive on arbitrary triangulations. Below we consider the following problem: For arbitrary triangulation T , find a control volume VL which provides conditions (5) for the scheme (4). Let r0 = (x0 , y0 ) be a radius-vector of central node 0: u(r0 ) = u0 . An analytical expression for the solution to the Laplace equation in point r0 is  1 u(r0 ) = (6) u(x, y)dl, 2πR CR where CR is the circumference of radius R, the circle center being point r0 . Since triangulation T may contain boundary edges, the value R is restricted by the requirement CR ⊂ T to provide u(x, y) being a harmonic function inside the circle CR . Note that formula (6) expresses a maximum principle for Laplace’s equation. We calculate integral (6) assuming the linear reconstruction (3) of the solution. Substituting (3) into (6) and integrating over a circle arc Ai , we obtain the integral term for triangle ti :   1 1 u(x, y)dl = (ai + ai1 x + ai2 y)dl 2πR Ai 2πR Ai 0  φi2 1 = (ai + ai1 x0 + ai2 y0 + ai1 R cos φ + ai2 R sin φ)Rdφ 2πR φi1 0 R i δφi + = u0 [a (sin φi2 − sin φi1 ) − ai2 (cos φi2 − cos φi1 )], 2π 2π 1 where φi1 and φi2 are the arc angles and δφi = φi2 − φi1 . The summation over all triangles yields u0 =

N N u0  R  i δφi + [a (sin φi2 − sin φi1 ) − ai2 (cos φi2 − cos φi1 )]. 2π i=1 2π i=1 1

N Noting that i=1 δφi = 2π, the following condition for a discrete Laplace operator with the linear reconstruction appears: N 

(7)

[ai1 (sin φi2 − sin φi1 ) − ai2 (cos φi2 − cos φi1 )] = 0.

i=1 i

(ai1 , ai2 )

Since ∇u = and ni+1/2 = (sin φi2 , − cos φi2 ), where ni+1/2 is the unit normal vector for an interior edge ei+1/2 , condition (7) takes the following form: (8)

N  i=1

(∇ui , ni+1/2 − ni−1/2 ) = 0.

MODIFIED FINITE VOLUME SCHEME

895

Now let us consider a control volume VL defined as a convex polygon created by connecting in every triangle ti the endpoints of arc Ai (see Figure 1). For control volume VL , the difference ni+1/2 − ni−1/2 gives a vector, normal to dual edge eiL . The unit outward normal vector ni to edge eiL is calculated as ni =

R (ni+1/2 − ni−1/2 ); |eiL |

therefore, a flux Φi across edge eiL is Φi = |eiL |(∇ui , ni ) = R(∇ui , ni+1/2 − ni−1/2 ). Multiplying by R and taking into account that in the case of linear reconstruction (3) the sum (8) is the result of the exact integration, formula (8) transforms into the following:  ∂u(x, y) (9) dl = 0. ∂n ∂VL The above results show us that the calculation of the solution on the central node of the triangulation by using formula (6) with condition (3) is equivalent to the linear FV discretization over control volume VL . For the discretization over VL , maximum principle (6) holds; therefore, scheme (4) is entirely positive on any two-dimensional unstructured mesh. 3. Correction of the stencils used for linear reconstruction. The construction of control volume VL provides us with the positive discretization. However, on arbitrary grids the convex dual VL is not consistent with the grid cell geometry, since gaps (or overlappings) appear in a convex dual mesh when stretched grid cells are considered. Concerning the issue of positivity, our next purpose is to discuss how far the geometry of the grid cells impacts on the discretization and whether it is possible to obtain the positive discretization (4) over the given control volume which completely covers domain Ω. For the prescribed geometry of dual cell Vdual , the only way to render the fluxes in (2) closer to those in (9) is to change the approximation of the gradients. The following example illustrates the situation. Suppose a flux Φ1 obtained as a result of the discretization on control volume VL in triangle ti is given as follows (index i is omitted): Φ1 = (a1 n1 + a2 n2 )|eL |. Now consider a control volume Vdual different from VL . Provided the same reconstruction (a1 , a2 ) of the gradient is used, the discretization on control volume Vdual results in a flux Φ2 : Φ2 = (a1 ndual + a2 ndual )|edual |, 1 2 where ndual = (ndual , ndual ) is the unit vector, normal to control volume edge edual in 1 2 triangle ti . Evidently, if it is possible to find in every triangle ti the new approximation of the gradient a ¯k = ak

nk |eL | dual nk |edual |

k = 1, 2,

896

N. B. PETROVSKAYA

0 ti

T

nc

Fig. 2. The Delaunay correction: implementation of a circumcircle test to include close nodes into the reconstruction stencil.

then the positive scheme is guaranteed. Below we consider modifications of a standard FV scheme obtained by including other nodes of the triangulation into the reconstruction stencils. In this case the following least squares problem is solved to calculate expansion coefficients ai in triangle ti : (10)

Ns 

(ui (xl , yl ) − u(xl , yl ))2 = min,

l=0

where Ns is the number of stencil nodes, Ns > 3. Using extended stencils, it is possible to change the values of ai in (2) and improve the discretization as a result. The crucial question for such a correction of the reconstruction stencils is how to select additional nodes. Since a Delaunay triangulation provides a positive discretization on a dual cell different from VL , the choice of convex polygon VL as a control volume is not a necessary condition for the positive discretization. On the other hand, a simple linear search of the triangulation nodes shows that for many triangulations there is a variety of extended stencils providing a positive scheme. These facts allow us to suggest an existence of a more than one way for the stencil correction. Unlike the linear reconstruction on a 3-point stencil, where it is possible to state exact conditions of positivity (cf. [3]), a strict geometric analysis of the scheme coefficients in the case of using the least squares method is very laborious and can hardly lead to production a fast and cheap algorithm for getting a positive scheme. That is why our present intention is not to obtain a rigorous mathematical formulation but to develop a reliable empirical approach to the selection of stencils. The first possible way of stencil correction is based on the following hypothesis. Consider triangulation T shown in Figure 2. Since it is intuitively clear that it would be reasonable to include the closest to triangle ti node nc into the reconstruction stencil in the triangle, the following question arises: Given triangulation T , differential operator L[u], and polynomial basis set {Ψ} for a linear reconstruction, what is measure M (T, L[u], {Ψ}) of proximity of stencil nodes? In other words, what nodes can be considered as being close to reconstruction stencil ti ?

MODIFIED FINITE VOLUME SCHEME

897

Based on the theorem (Barth [3]), which states positivity of an FV scheme with a linear reconstruction on Delaunay triangulations, we suggest that for the Laplace operator the right answer to the above question is given by a circumcircle criterion which is the unique characterization of the Delaunay triangulation (Joe [10]). Namely, if node nc belonging to T lies inside the circumcircle of given triangle ti , it is considered as being close to the given triangle and should be included into reconstruction stencil ti . In the general case, if the number k of triangulation nodes lie inside the circumcircle, they are included into the stencil for the reconstruction in triangle ti by using the least squares method. This way of the stencil selection we call the Delaunay correction (DC). For each grid node where the standard FV scheme is nonpositive, the algorithm for the Delaunay correction may be written as follows: 1. Define triangulation T as a the union of all triangles ti , i = 1, . . . , N, incident to the central node, and put all nodes of the triangulation (except of the central one) into array T− nodes. 2. For each triangle ti ⊂ T , Do: 2.1. Define the reconstruction stencil Si as a set of triangle’s vertices. 2.2. Define circumcircle Ci . 2.3. Form array marked− nodes as a subset of the set T− nodes: – For each node nk , 1 ≤ k ≤ NT , from the array T− nodes Do: / Si Then: – If the circumcircle Ci contains the node nk And the node nk ∈ – Add nk to the array marked− nodes. – EndDo 2.4. Include all nodes from the array marked− nodes into the reconstruction stencil Si by using the least squares method. 3. EndDo Now let us discuss another type of the grid cell geometry. For triangulation T shown in Figure 3, there are no nodes obviously close to triangle ti . On the contrary, node nf is so far from others that if we were allowed to reconnect the nodes of the triangulation, it would be natural to connect node ni with node nl and remove nf from T . Thus, another important for a proper correction of stencils question may be formulated as follows: Given triangulation T , differential operator L[u], and basis set {Ψ} for a linear reconstruction , what nodes have no effect on a discretization of L[u]? In other words, what nodes in ti can be considered as being far from any other reconstruction stencil? To answer this question (“inverse” to the previous one), again consider formula (6) for solution u0 on central node 0. We define the value Rmax as the maximum radius which holds the requirement CR ⊂ T stated in the previous section (see Figure 3). Evidently, only those R which satisfy (11)

R ≤ Rmax

should be considered in (6). Due to inequality (11) we conclude that for the discretization of the Laplace operator a characteristic size of the triangulation is not the maximum edge length but radius Rmax . To make certain that far node nf with the edge length |ef |  Rmax is odd for the scheme on node 0, let us consider standard FV scheme (4) on a median dual. According to [3], the coefficient ωnf corresponding to node nf is calculated as   sin(αi + αl ) 1 (12) , ω nf = 2 sin(αi ) sin(αl )

898

N. B. PETROVSKAYA

Fig. 3. The gradient correction: elimination of a “far” node from the reconstruction stencil.

where angles αi and αl are depicted in Figure 3. It can be seen from the figure that the more distant node nf is from the central node of the triangulation, the more obtuse are the angles αi and αl . Obviously, the condition αi + αl ≤ π, necessary for positive ωnf , fails for far node nf . To develop a correction technique for the stencils which contain node nf , consider linear reconstruction (3) on a median control volume in triangle ti . Since the gradient ∂u is constant in triangle ti , the value of ∂n in (2) is also constant at any point inside the given control volume in ti (13)

∂u ≈ ai1 ni1 + ai2 ni2 = const = C i , ∂n

where ni = (ni1 , ni2 ) is the unit vector, normal to a control volume edge ei . On the other hand, by definition, u(r0 + ∆tn) − u(r0 ) ∂u = lim , ∂n ∆t→0 ∆t and we approximately calculate

∂u ∂n

(14)

u(r∗ ) − u(r0 ) ∂u ≈ , ∂n |r∗ − r0 |

at point r0 ∈ ti as

MODIFIED FINITE VOLUME SCHEME

899

where r∗ = (x∗ , y ∗ ) is an interior point of triangulation T , point r∗ belongs to the line, normal to edge ei , and u(r0 ) = u0 . The linear reconstruction at point r∗ yields (15)

u(r∗ ) − u(r0 ) = a∗0 + a∗1 x∗ + a∗2 y ∗ − u0 = a∗1 (x∗ − x0 ) + a∗2 (y ∗ − y0 ).

Since the components of the normal vector may be calculated as ni1 =

x∗ − x0 , |r∗ − r0 |

ni2 =

y ∗ − y0 , |r∗ − r0 |

we obtain from (14) and (15) ∂u ≈ a∗1 ni1 + a∗2 ni2 = const = C ∗ . ∂n

(16)

In “nice” triangle ti point r∗ ∈ ti ; therefore, a∗1 = a∗1 (u0 , ui1 , ui2 ) = ai1 ,

a∗2 = a∗2 (u0 , ui1 , ui2 ) = ai2 ,

and the values C i and C ∗ are the same. In “bad” triangle ti point r∗ belongs to another triangle tj (see Figure 3), where the gradient depends on the values uj1 and uj2 : a∗ = (a∗1 , a∗2 ) = a∗ (u0 , uj1 , uj2 ) = aj = ai . In this case, when formula (13) is used ∂u for calculating ∂n , a nonphysical flux across edge ei appears: 

∂u ∂n



= C ∗ − C i = (a∗1 ni1 + a∗2 ni2 ) − (ai1 ni1 + ai2 ni2 ) = (aj1 − ai1 )ni1 + (aj2 − ai2 )ni2

f alse

= (∇uf alse , ni ), where the false gradient (∇u)f alse is defined as the difference between the gradients in triangles tj and ti , respectively. To improve the situation when false gradients appear, we suggest in “bad” triangle ti to include stencil tj into the reconstruction in ti by using the least squares method. Another even more radical way is to change the stencil ti by stencil tj . These corrections change the value of the gradient in triangle ti that may decrease the nonphysical flux. We refer to such a correction technique as the gradient correction (GC). Numerical experiments show that for geometry T from Figure 3 the gradient correction results in the positive scheme when the stencil points from triangles tj and tm are captured to form extended stencils for triangles ti and tl , respectively. The idea of GC correction leads us to the following algorithm. 1. Define triangulation T and all control volume edges ei , i = 1, . . . , N.1 2. For each triangle ti ⊂ T , Do: 2.1 Define the reconstruction stencil Si as a set of triangle’s vertices. 2.2 Define point r∗ as a point of intersection between the line ei and the perpendicular dropped to the line ei from the central node of the triangulation. 2.3 Find a triangle tj point r∗ belongs to. 2.4 If j = i, include nodes of the triangle tj into the reconstruction stencil Si by using the least squares method. 3. EndDo 1 According to Green–Gauss theorem, it is possible to consider a segment e created by connection i of the edge midpoints (see Figure 3) instead of treating two median segments in each triangle.

900

N. B. PETROVSKAYA

Concerning practical realization of the suggested correction technique, there are still some open questions. Thus for the Delaunay correction, it is unclear whether or not the nodes which lie on a circumcircle boundary should be included into the reconstruction. Similar questions arise in the implementation of the GC. For instance, in the case when point r∗ comes to an edge of the triangulation it is possible to include either one of the adjacent triangles or both of them into the stencil. Also, point r∗ ¯ may coincide with a grid node ng or lay outside domain Ω. Since there is no strict mathematical foundation of the suggested algorithms, only practical recommendations can be given for correct treatment of these cases. One may find extended discussion based on our numerical experience with the correction algorithms in [12]. To conclude this section, let us make some remarks on the possible implementation of the suggested algorithms. Considering the discretization of a given differential operator on unstructured grids where stretched cells can appear, a most important problem is how to indicate cells which are “bad” for the discretization. Although the strict mathematical conditions based on error estimation are obtained for some important cases (Babuˇska and Aziz [1]), and stretched triangular cells proved to not always be bad (Rippa [14]), the general concept of “bad” or “nice” triangles requires further analysis, its formulation depending upon what differential operator is considered and what discretization method is used. For the FV discretization of the Laplace equation, the developed technique provides us with a kind of an empirical indicator of the “bad”/“nice” triangle, as those triangles where the stencil correction is needed may be considered as the “bad” ones. 4. Numerical results. The aim of this section is to present numerical validation of the suggested ways of the stencil correction. Unfortunately, by now we are not able to formulate precisely under what conditions each correction algorithm should be implemented. That is why a combined approach is used to correct scheme stencils. For those nodes where the standard FV scheme (4) is nonpositive, both DC and GC scheme stencils are constructed. Then the stencil providing the least nonpositive scheme is selected. This procedure may appear rather costly, but keeping in mind our present purpose we do not discuss here a computational efficiency of the developed algorithm. To assess nonpositivity of the scheme coefficients we use a simple criterion taken from the work (Coirier [7]). Let us rewrite (4) as u0 =

NT 

αn un ,

n=1

where αn = −ωn /ω0 . Then the value αmin (17)

αmin =

min1≤n≤NT (αn , 0)  2 NT αn n=0 NT

is a measure of positivity2 of the scheme coefficients for the given node u0 . For the nonpositive function αmin defined on the grid nodes we introduce the following 2 The definition of α min formally misses the case when ωn < 0 ∀n = 0, ω0 > 0. In practice, this case should be treated separately as it indicates strong degeneration of an FV volume cell. The consideration of this situation is beyond the scope of the paper.

MODIFIED FINITE VOLUME SCHEME

901

Table 1 Positivity measures for standard (F V S) and corrected (CS) FV schemes with linear reconstruction. Grid G1 G2 G3 G4 G5 G6

FV S −0.191 −0.126 −0.437 −0.188 −0.416 −0.485

1 αL min

αC min FV S CS −1.355 −0.354 −3.593 −0.411 −1.696 −0.377 −1.587 −0.241 −1.438 −0.412 −1.602 −0.286

CS −9.6 · 10−3 −6.9 · 10−3 −2.42 · 10−2 −4.2 · 10−3 −3.45 · 10−2 −7.2 · 10−3

quantity: L1 αmin

=

Ng

m=0

m αmin

Ng

,

L1 C , as well as αmin , where where Ng is the number of mesh nodes. The value αmin C m αmin = min{αmin }, m

are used to estimate nonpositivity of the discretization over the whole mesh. EviL1 = 0 for an entirely positive scheme. dently, αmin What are reasonable values for the parameter αmin ? Coirier [7] has investigated a number of different stencils for an FV discretization of the Laplace equation on adaptive Cartesian grids for further implementing to the Navier–Stokes equations. It L1 was found that schemes with αmin ∼ −10−1 ÷ −10−2 are acceptable for calculating a L1 low Reynolds number laminar flow. At the same time the discretization with αmin ∼ −1.0 proved to be divergent. Delanaye et al. [8] have also considered a discrete L1 Laplacean on Cartesian meshes. They discovered that the value αmin = −1.62 leads L1 to the loss of the scheme stability. After stencil correction a new value αmin = −0.366 provided convergence to the solution. Based on these results, in our work we consider L1 stencils with αmin ∼ −1.0 to be strongly nonpositive. Our first numerical experiment is to verify that the corrected scheme exhibits better measures of positivity. A number of grids with various geometries of grid cells have been generated to test suggested correction algorithms. Generating these “bad” grids, the main requirement was to produce the most possible number of non-Delaunay cells, where a standard FV scheme is nonpositive. The grids are shown in Figures 4 and 5. To calculate the positivity measures, the Laplace equation is discretized in the unit square with the following boundary conditions: (18)

u(x, 0) = x2 ,

u(0, y) = y 2 ,

u(x, 1) = x2 − 1,

u(1, y) = 1 − y 2 .

L1 C The values of αmin and αmin for the standard FV scheme and the corrected scheme calculated on the generated grids are shown in Table 1. It can be seen from the table that the corrected scheme is much more positive than the standard one. Examples of function αmin (xi , yi ) for the standard and the corrected schemes on some of generated grids are shown in Figure 5. Grid G2 (see Figure 4) gives us a nice example of how the GC algorithm treats stretched cells. Fans on the grid are generated using the “torture test” idea (GGNS

902

N. B. PETROVSKAYA

Fig. 4. Examples of “bad” grids used to estimate positivity measures of the corrected FV scheme; Ng is the number of the grid nodes, φmax is the maximum grid angle (in degrees).

Fig. 5. Function αmin (x, y) for (A) the standard and (B) the corrected FV scheme with the linear reconstruction.

MODIFIED FINITE VOLUME SCHEME

903

team [9]). In this test the following procedure has been implemented to generate a grid with large angles. At each step of the grid generation, the boundary problem (e.g., the convection-diffusion equation with Dirichlet boundary conditions in the considered example) is solved numerically. Given the numerical solution, a new grid node is always placed in the cell with the maximum solution error and the old triangle is subdivided into three triangles to increase the maximum angle in the new triangles. Then the boundary problem is solved again over the new grid, and the above procedure is repeated until the required value of the maximum angle is reached. As a result of the grid generation, each of the triangulations with central nodes A and B shown in Figure 4 comprises 85 nodes. The standard FV discretization of the boundary problem (18) on median control volume produces the extremely nonpositive scheme on nodes A and B : αmin (A) = −3.498, αmin (B) = −3.593. For triangulations A and B, the gradient correction not only renders the scheme positive (αmin (A) = αmin (B) = 0.0) but also crucially transforms the scheme stencils NsA and NsB . New stencil NsA for the scheme in node A includes seven nodes while new stencil NsB includes only five nodes. Our next test is to compare convergence to the exact solution for the standard and the corrected schemes. Due to the strong distortion of the finite volume cells the “bad” grids generated in the previous test exhibit poor approximation properties that makes it difficult to assess the convergence rate. That is why for the convergence test we generate a sequence of model meshes as follows. First, cells of a uniform Cartesian grid are cut by two diagonals. Then, the central node in each Cartesian cell is moved down vertically to increase the angle φmax corresponding to the central node. Thus a parametric family of meshes with different geometry of stencils can be obtained, the maximum grid angle φmax (π/2 ≤ φmax < π) being a controlling parameter. The angle φmax = π/2 determines the standard grid considered in the previous test and provides positive standard FV discretization. For any angle φmax > π/2 the standard FV scheme is nonpositive. For the convergence test we solve the following boundary problem in the unit square: u(x, 0) = cos(ωx), u(0, y) = exp(ωy), u(x, 1) = cos(ωx) exp(ω), u(1, y) = cos(ω) exp(ωy). (19) The analytical solution to the problem is (20)

u(x, y) = cos(ωx) exp(ωy).

The numerical solution is calculated for the value ω = −5.0. The convergence results for both the standard FV scheme (FVS) and the corrected scheme (CS) are plotted in Figure 6. The error measured in the L2 -norm is shown in the semilogarithmic scale. The value of φmax has been varied to study how the convergence rate depends on the maximum grid angle. Figure 6(a) shows the convergence history for the solution on grids with φmax ≡ φ1 = 23 π (curves I and I’ in the figure for the CS and FVS, respectively). Curves II and II’ in the figure present the convergence results for the value φmax ≡ φ2 = 56 π. In both cases the corrected scheme converges, although the rate of the convergence is slower in comparison with that for the standard scheme. Let us note that for the corrected scheme the approximation over nonsymmetric stencils may impact on the convergence rate as well as geometric degeneration of the finite volume cells. These two factors may slow down the convergence rate on the grids with large values of angle φmax .

904

N. B. PETROVSKAYA

I - CS,phi 1 I’ - FVS, phi 1 0.005

II - CS, phi 2

0.004

II’ - FVS, phi 2

0.003

0.002

log//error//L2

0.001

II I

II’ I’

1000

2000

3000

4000

N

(a)

I - CS, phi1 I’ - FVS, phi1

0.25

II - CS, phi2

0.2

II’ - FVS, phi2 0.15

|L2

0.1

0.05

I I’

1000

II

2000

3000

II’

4000

N

(b) Fig. 6. Convergence test problem (19), (20). The convergence history of (a) the solution and (b) the gradient for the corrected (curves I, II) and the standard (curves I’, II’) schemes.

905

MODIFIED FINITE VOLUME SCHEME

I - CS, phi 1 0.0006

I’ - FVS, phi 1

0.0005

II - CS, phi 2

0.0004

II’ - FVS, phi 2

log//error//L2

0.0003

0.0002

I I’

0.0001

II

II’

2000

4000

6000

N

Fig. 7. Convergence test problem with discontinous boundary conditions (21), (22). The convergence history of the solution for the corrected (curves I, II) and standard (curves I’, II’) schemes.

The convergence history for the gradient obtained on grids with the same values of φmax is shown in Figure 6(b). As can be seen from the figure, the gradient convergence results are almost the same for both schemes. For the function u(x, y) considered in the test, the effect of the triangle geometry on approximation is that increasing the angle φmax leads to the slower convergence rate for both standard and corrected schemes. In our numerical experiments we have obtained the slowest convergence rate for the extreme case of φmax = 0.99π. Now we consider the problem with discontinuous boundary conditions (21) u(x, 0) = 0,

u(0, y) = 0,

u(x, 1) = u0 ,

u(1, y) =

 π πy 2u0 arctg th tg . π 2 2

The analytical solution to the problem is given by function (22)

u(x, y) =

 πx πy 2u0 arctg th tg . π 2 2

Convergence to the exact solution for the FVS and the CS is shown in Figure 7. The plots are obtained for the same values of angle φ1 (curves I and I’ in the figure for the CS and FVS, respectively) and φ2 (curves II and II’), the parameter u0 = 0.1. As one can see from the figure, the convergence rate is slightly different for stencils with φmax = φ1 , while for φmax = φ2 the standard scheme converges noticeably better. The dependence of the convergence rate on the maximum grid angle is not so trivial as in the previous example; for a wide range of φmax the greater value of the maximum grid angle provides the better convergence for both schemes. However, for angles φmax close to π the degeneration of FV cells becomes as strong as to make the convergence rate slower.

906

N. B. PETROVSKAYA Table 2 GMRES convergence test for standard (F V S) and corrected (CS) FV schemes. N 181 685 2665

FV S 29 95 251

CS 14 28 69

Nst 181 761 3121

F V Sst 10 20 43

In our code we use GMRES algorithm (Saad [15]) to solve the algebraic system of equations obtained as a result of the discretization. The convergence of GMRES depends on the condition number of the system matrix A. A low rate of the convergence corresponds to a poorly conditioned matrix, while positive definite matrix A provides the best rate of convergence [15]. That is why the study of the convergence rate of GMRES may be considered as a stability test for the corrected scheme. To assess the GMRES convergence rate, the convergence test has been taken from the PETSc library (Balay et al. [2]). In this test the number of iterations necessary to meet the convergence is counted, the other GMRES parameters being fixed. The sequence of “bad” grids with the number N of grid nodes, where the standard scheme produces a poorly conditioned matrix A, is generated by isotropic refinement of grid G3 shown in Figure 4. For each “bad” grid, the standard grid with the similar number Nst of nodes, where the standard FV scheme produces the positive definite matrix A, is generated by cutting cells of a uniform Cartesian grid by two diagonals. The convergence rate of GMRES for both the standard (F V S) and the corrected (CS) schemes on “bad” grids is then compared with the results obtained for the FV scheme on the corresponding standard grid (F V Sst ). Table 2 reports the number of GMRES iterations needed for the convergence. The test matrix A is generated for the boundary problem (18). As one may expect, the “quasi-positive” corrected scheme produces a wellconditioned system matrix even on “bad” grids and, therefore, requires essentially fewer number of GMRES iterations than the standard scheme. The GMRES convergence rate for the corrected scheme is close to that obtained for the positive defined matrix A. 5. The three-dimensional case. In this section, we briefly discuss whether it is possible to extend the obtained results to the three-dimensional case. Let T be the volume formed by the union of all tetrahedra ti , i = 1, . . . , N, which have the central node 0 as a common vertex. Consider a sphere SR of radius R with the center at the point r0 . As in the two-dimensional case, it is possible to introduce a control volume VL as a convex polyhedron with faces created by setting in each tetrahedron ti the plane passing through the points of intersection between the sphere SR and the edges of the tetrahedron. Let us calculate the solution on the central node of the triangulation by using the formula   1 u(r0 ) = (23) u(x, y, z)ds. 4πR2 SR We assume the linear reconstruction of the solution in each tetrahedron ti : (24)

ui (x, y, z) = ai0 + ai1 x + ai2 y + ai3 z = ai0 + (∇ui , r). For integration over the sphere the vector r in (24) is

(25)

r(x, y, z) = r0 + Rns ,

MODIFIED FINITE VOLUME SCHEME

907

where ns is the unit vector normal to the sphere surface. Substitution of (24), (25) into (23) and summation over all tetrahedra yields   N  N 

i 1  1  i a0 + (∇u , r0 + Rns ) ds =u(r0 )+ (∇ui , ns )ds. u(r0 ) = 4πR2 i=1 SRi 4πR i=1 SRi (26) The equality (26) gives us the following condition which may be considered as a finite volume discretization of the Laplace equation over the sphere SR : N  

(27)

i=1

i SR



(∇ui , ns )ds = 0.

It can be seen from (23), (27) that the discretization over the sphere provides us with the positive scheme. The sufficient condition, which allows us to consider in (27) the polyhedron VL instead of the sphere SR as a control volume providing the positive scheme, is that     (∇ui , ns )ds ≡ (∇ui , ns )ds ∀i = 1, . . . , N, (28) i SR

VLi

where the face VLi of VL belongs to the tetrahedron ti . However, unlike the twodimensional case, this condition does not hold for the inscribed polyhedron VL . Let i Sside be the union of the three plane segments of the tetrahedron faces in the tetrahei dron ti , each segment being bounded by the edge of VLi , the circle arc of SR , and the i edges of ti . To estimate the integral over SR in (28), we consider for each tetrahedron i i which comprises Sside , the face VLi , and the part ti the auxiliary closed surface Saux i SR of the sphere. Since the gradient is a constant vector in each tetrahedron, the integral (28) may be transformed as

    i SR

(∇ui , ns )ds =

∇ui ,

i SR

ds ,

where a vector elemental area ds = ns ds. According to the gradient theorem,        ds + ds + ds = 0.  ds ≡ i Saux

i SR

VLi

i Sside

  It is not difficult to see that S i ds = 0; therefore, the weight coefficients of the side discretization over the control volume VL are different from those in (27). Thus, in the three-dimensional case the condition (28) sufficient for the positive discretization does not hold. Now we consider a discretization over the prescribed control volume Vdual defined as a polyhedron with faces ei constructed under some geometric conditions (i.e., median or centroid dual). As in the two-dimensional case, we suggest that including close nodes into the reconstruction stencil provides us with a more positive scheme. Since the results of [13] demonstrate that it is possible to obtain the positive scheme for the Laplace equation on three-dimensional Delaunay meshes, we believe that a circumsphere criterion may be used to find the nodes close to the given tetrahedron ti . If node nc belonging to T lies inside the circumsphere Si , it may be considered as being close to ti and included into the reconstruction stencil for the given tetrahedron.

908

N. B. PETROVSKAYA

To analyze the behavior of the fluxes in the three-dimensional case we calculate ∂u the directional derivative ∂n across the face ei in the given tetrahedron ti as ∂u u(r∗ ) − u(r0 ) ≈ , ∂n |r∗ − r0 |

(29)

where r∗ = (x∗ , y ∗ , z ∗ ) is defined as the point of intersection between the plane ei and the perpendicular dropped to this plane from the central node of the triangulation. Since the components of the unit vector normal to the plane ei may be calculated as ni1 =

x∗ − x0 , |r∗ − r0 |

ni2 =

y ∗ − y0 , |r∗ − r0 |

ni3 =

z ∗ − z0 , |r∗ − r0 |

the expression (29) is transformed as ∂u ≈ a∗1 ni1 + a∗2 ni2 + a∗3 ni3 = const = C ∗ , ∂n provided the linear reconstruction of the solution u(r∗ )−u(r0 ) = a∗1 (x∗ −x0 )+a∗2 (y ∗ − y0 ) + a∗3 (z ∗ − z0 ) is used. The result of calculation is then compared with the formula ∂u ≈ ai1 ni1 + ai2 ni2 + ai3 ni3 = const = C i . ∂n If the value C i is different from C ∗ , then we consider ti as the tetrahedron where the false gradient appears. In this case it is possible to include nodes of the tetrahedron tj which contains point r∗ into the reconstruction stencil for the given tetrahedron ti by using the least squares method. This correction may decrease the false gradient. 6. Conclusions. In the present work the analysis of how a discretization of Laplace’s equation depends on grid geometry has been made. We have demonstrated the way to construct a control volume for a positive FV scheme with a linear reconstruction on any two-dimensional unstructured grid. The important result obtained here is that on arbitrary grids the Laplace operator requires a convex control volume to provide a positive discretization. This result indicates that grids with highly stretched cells are not appropriate for constructing the positive scheme, since gaps (or overlappings) may appear in the convex dual mesh. For the prescribed geometry of the control volume, we have investigated whether it is possible to improve the positivity measures of the linear FV scheme on arbitrary grids by using extended stencils. Although having the empirical nature, the suggested approach to the stencil correction allows us to treat stretched cells effectively. Numerical experiments show that the developed technique produces a “quasi-positive” scheme. However, in spite of giving us all advantages of the positive discretization, the practical applicability of the corrected scheme is restricted. The produced stencils are nonsymmetric which may lead to the loss of conservativity of the scheme. The property of positivity is very important and can be considered as a criterion of a proper discretization of Laplace’s equation as it expresses a maximum principle which is an inherent feature of the Laplacean. On the other hand, being a natural property of FV schemes conservativity makes them attractive for many practical applications. The results obtained in this paper seem to indicate that the properties of positivity and conservativity are incompatible with each other on arbitrary grids. This fact demonstrates how far grid quality is crucial for the discretization.

MODIFIED FINITE VOLUME SCHEME

909

In our opinion, in order to overcome the incompatibility between these two basic requirements, one should admit that due to space isotropy of the Laplace equation its discretization needs the grid to be isotropic, in a certain sense. A mesh with all edges of the same length gives us the simplest example, while a Delaunay triangulation can be considered as a more general kind of grid with space isotropy. Grids with stretched cells are “alien” for the Laplace equation. For those problems, where stretched grids arise as a result of grid adaptation, it may be better to make a discretization of the full problem operator rather than discretize diffusion terms separately. Meanwhile, the further development of algorithms of fully automatic Delaunay grid generation is strongly needed to provide us with a positive discretization which holds the property of conservativity. Acknowledgments. The author is grateful to two anonymous referees for their valuable comments which helped to improve the paper. The author appreciates the help of colleagues from the BOIM CFD research team, especially A.A. Martynov, S. Yu. Medvedev, and A.M. Sorokin, who provided the grids used in the work. REFERENCES [1] I. Babuˇ ska and A.K. Aziz, On the angle condition in the finite element method, SIAM J. Numer. Anal., 13 (1976), pp. 214–226. [2] S. Balay, W. Gropp, L.C. McInnes, and D. Smith, PETSc 2.0 Users Manual, Tech. Report ANL 95/11, Argonne National Laboratory, Argonne, IL, 1997; also available online from http://www.mcs.anl.gov/petsc/petsc.html. [3] T.J. Barth, Numerical Aspects of Computing High-Reynolds Number Flows on Unstructured Meshes, AIAA Paper 91-0721, 29th Aerospace Science Meeting, Reno, NV, 1991. [4] T.J. Barth, Aspects of Unstructured Grids and Finite-Volume Solvers for the Euler and Navier-Stokes Equations, Computational Fluid Dynamics von Karman Lecture Series 199405, 1994. [5] T.J. Barth and S.W. Linton, An Unstructured Mesh Newton Solver for Compressible Turbulent Flows and Its Parallel Implementation, AIAA Paper 95-0221, 33rd Aerospace Science Meeting and Exhibit, Reno, NV, 1995. [6] F. Brezzi, L.D. Marini, and P. Pietra, Two-dimensional exponential fitting and applications to drift-diffusion models, SIAM J. Numer. Anal., 26 (1989), pp. 1342–1355. [7] W.J. Coirier, An Adaptively Refined, Cartesian, Cell-Based Scheme for the Euler and NavierStokes Equations, Ph.D. thesis, University of Michigan, Ann Arbor, MI, 1994. [8] M. Delanaye, M.J. Aftosmis, M.J. Berger, Y. Liu, and T.H. Pulliam, Automatic HybridCartesian Grid Generation for High-Reynolds Number Flows around Complex Geometries, AIAA Paper 99-0777, 37th Aerospace Science Meeting and Exhibit, Reno, NV, 1999. [9] GGNS Project Research Team, private communication, The Boeing Company, M/S 67-LF, Seattle, WA, 1999. [10] B. Joe, Delaunay triangular meshes in convex polygons, SIAM J. Sci. Statist. Comput., 7 (1986), pp. 514–539. [11] P. Markowich and M. Zlamal, Inverse-average-type finite element discretizations of selfadjoint second order elliptic problems, Math. Comp., 51 (1989), pp. 431–449. [12] N.B. Petrovskaya, Large Angle Tolerant Discretization, Boeing Tech. Report 104R, Boeing Operations International, Inc., Moscow, 1999. [13] M. Putti and C. Cordes, Finite element approximation of the diffusion operator on tetrahedra, SIAM J. Sci. Comput., 19 (1998), pp. 1154–1168. [14] S. Rippa, Long and thin triangles can be good for linear interpolation, SIAM J. Numer. Anal., 29 (1992), pp. 257–270. [15] Y. Saad, Iterative Methods for Sparse Linear Systems, PWS, Kent, UK, 1995. [16] V.S. Sakovich, Multiple-grid solution of Euler’s equations on unstructured grids, Comput. Math. Math. Phys., 34 (1994), pp. 1603–1616. [17] J. Xu and L. Zikatanov, A monotone finite element scheme for convection-diffusion equations, Math. Comp., 68 (1999), pp. 1429–1446.

Suggest Documents