Nov 7, 1997 - 3-D logically cuboid (i + 1=2; j + 1=2; k + 1=2) cell (a prism) with unit ... stability and accuracy of SOM methods for all classical types of boundary conditions. 5 ..... prism with unit height and with a 2-D quadrilateral cell as its base .... Page 16 .... The operators S11 and S22 are diagonal, and the stencils for the ...
The Approxoimation of Boundary Conditions for Mimetic Finite Dierence Methods. James M. Hyman and Mikhail Shashkov Los Alamos National Laboratory T-7, MS-B284 Los Alamos NM 87545 November 7, 1997
1
Abstract
We describe how to incorporate boundary conditions into nite dierence methods so the resulting approximations mimic the identities between the dierential operators of vector and tensor calculus. The approach is valid for wide class of partial dierential equations of mathematical physics and is described for Poisson's equation with Dirichlet, Neumann and Robin boundary conditions. These approximations preserve the main properties of original dierential problems. In particular, the discrete approximation is symmetric and positive de nite. The results obtained in this paper are important for proving convergence theorems in framework of the energy metho. The properties of the discrte operators make possible to use eective iteration methods to solve system of linear equations.
2
Contents
1 Introduction 2 The Properties of the Continuum Problem
2.1 Dirichlet Boundary Value Problem . . . . . . 2.2 Neumann Boundary Value Problem . . . . . 2.2.1 The modi ed inner product approach 2.2.2 The ux form approach . . . . . . . . 2.3 Robin Boundary Value Problem . . . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
5 6
. 6 . 8 . 8 . 9 . 10
3 Spaces of Discrete Functions
11
4 Discrete Analogs of div and grad 4.1 The Natural Operator DIV . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Adjoint Operator GRAD . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Discrete Dirichlet Boundary Value Problem
19 20
6 Discrete Neumann Boundary Value Problem 7 Discrete Robin Boundary Value Problem 8 Conclusion
23 25 25
3.1 Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2 Discrete Scalar and Vector Functions . . . . . . . . . . . . . . . . . . . . 13 3.3 Discrete Inner Products . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 19 19
5.1 Finite Dierence Method in Operator Form . . . . . . . . . . . . . . . . 20 5.2 Solving System of Equations with Non-local Stencil . . . . . . . . . . . . 22
3
List of Figures
3.1 Cell-centered discretization of scalar (HC ) on logically rectangular grid. 3.2 (a) { The (i + 1=2; j + 1=2) cell in a logically rectangular grid has area V Ci+1=2;j+1=2 and sides Si;j+1=2, Si+1=2;j , Si+1;j+1=2, and Si+1=2;j+1. =2;j +1=2; (b) The interior angle between Si+1=2;j and Si+1;j +1=2 is 'ii+1 +1;j { The 2-D (i + 1=2; j + 1=2) cell (z = 0) is interpreted as the base of a 3-D logically cuboid (i + 1=2; j + 1=2; k + 1=2) cell (a prism) with unit height. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 (a) HS discretization of a vector in three dimensions is de ned at the center of the faces of the prism; (b) 2-D interpretation of the HS discretization of a vector results in the face vectors being de ned perpendicular to the cell sides and the vertical vectors being de ned at cell centres perpendicular to the plane. . . . . . . . . . . . . . . . . . . . . 3.4 The grid lines (; ) form a local nonorthogonal coordinate system with unit vectors l~; l~ and corresponding unit normals to these directions, ~ and nS ~ . In this basis, the components (WS; WS) are orthogonS nal projections to normal directions. . . . . . . . . . . . . . . . . . . . . 3.5 The stencils of the components S12 and S21 of the symmetric positive operator S that connects the natural and formal inner products ~ B~ )HS = [S A; ~ B~ ]HS . . . . . . . . . . . . . . . . . . . . . . . . . . . . (A;
4
12
12
14 15 18
1 Introduction We have developed a discrete analog of vector and tensor calculus that can be used to accurately approximate continuum models for a wide range of physical processes [1, 2, 3]. In this paper, we describe how to encorporate general types of boundary condition into the discrete approximation and preserve the main properties of the original dierential equations. We demonstrate the main ideas by costructing a nite dierence method that preserves the symmetry and positive de nitness of the stationary heat equation ?div grad u = f ; (x; y) 2 V : (1.1) This equation arises in solving for the pressure in the incompressible ow equations, in solving for the temperature in the steady state heat equation and in solvingf for mass concentration in steady state diusion equation. Here V is a two dimensional region, div is the divergence, grad is the gradient, and f = f (x; y) is a given right-hand side or forcing function. The boundary conditions may be general Robin (or mixed): (grad u; ~n) + u = ; (x; y ) 2 @V ; (1.2) where ~n is vector of unit outward normal to the boundary @V , and and are functions given on @V . These boundary conditions include the Neumann bounadry condition (grad u; ~n) = ; (x; y ) 2 @V ; (1.3) when is zero. We will consider the Dirichlet boundary conditions when the solution u(x; y) is given on the boundary u(x; y) = (x; y) ; (x; y) 2 @V : (1.4) The boundary conditions 1.2 and 1.3 are natural boundary condition in sence that they can be taken into account by changing de nition of the inner product in the functional spaces without imposing the boundary conditions on the solution u(x; y ). The Dirichlet bounday condition 1.4 called an essential boundary condition and has to be explicitly imposed on function space on which we are looking for the solution. The nite dierence methods are constructed by extending the support-operators method initially developed in [9] by Samarskii, Tishkin, Favorskii, and Shashkov and is fully described in [12] . The support-operators method constructs discrete analogs of invariant dierential operators div and grad, which satisfy discrete analogs of the integral identities responsible for the conservative properties of the continuum model. In this paper we extend these methods by describing how to preserve these properties whe incorporating the boundary conditions on non-smooth logically-rectangular grids. The main idea is to de ne an inner product in the space of discrete scalar functions which includes a discrete analog of boundary integral for general Robin boundary conditions. The results in this paper are important because they allow us to to investigate the stability and accuracy of SOM methods for all classical types of boundary conditions
5
using the energy method in an approach similar to what has been used in [4], [7], [8] for rectangular grids. The fact that discrte operators are symmetric and positive de nite (positive for Neumann boundary condition) allows us to use eective iteration methods to solve discrete problems [6]. We rst review the continuum boundary value problem to illuminate the properties of the operators that we wish to preserve in the discrete case. We inroduce the appropriate inner-products on the space of scalar discrete functions for each type of boundary condition. For Robin boundary conditions, the inner product includes boundary integral. Next, we describe the grid, the discretizations of scalar and vector functions, and the discrete inner products. Following the support-operators method, we describe the approximations for div and grad and provide a detailed analysis of how to approximate Dirichlet, Neumann and Robin boundary conditions to preserve the main properties of continuum problem. Finally, we included explicit formulas for discrete equations on rectangular grid.
2 The Properties of the Continuum Problem Mimetic nite dierence methods retain or mimic the main properties of the continuum problem. We begin by analyzing the continuum problem for Poisson's equation with Dirichlet, Neumann, and Robin boundary conditions and emphasize the properties of dierential operators which we want to retain in discrete case.
2.1 Dirichlet Boundary Value Problem
The Dirichlet boundary value problem
?div grad u = f ; (x; y) 2 V ; u(x; y) = (x; y) ; (x; y) 2 @V ;
(2.1)
can be transformed into an equivalent problem with zero boundary conditions if we assume that the shape of the domain satis es the extendability or continuability condition [5]. Then there is a smooth function (x; y ) which coincides with (x; y ) on the boundary, (x; y ) = (x; y ); (x; y ) 2 @V . We introduce the new unknown function
u~(x; y) = u(x; y) ? (x; y) ;
(2.2)
and reformulate 2.1 as
?div grad u~ = f~; (x; y) 2 V ; u~(x; y) = 0 ; (x; y) 2 @V ;
6
(2.3)
where
f~ = f + div grad :
(2.4) This transformed problem has zero Dirichlet boundary conditions and a modi ed righthand side. We now restate this problem in operator notation by introducing the space of scalar functions which ara equal to zero on the boundary,
H = fv(x; y) 2 H; v(x; y) = 0 2 @V g ; 0
with following inner product
Z
(u; v ) 0 = H
V
u v dV :
(2.5) (2.6)
The problem now is to nd u~ 2H which satis es the equation Au~ = f;~ A = ?div grad ; 0
(2.7)
where the operator grad is de ned on subspace H of space H . To show that the operator A is symmetric and positive, we note that the identity 0
Z
reduces to
Z
V
div w~ dV + (w~ ; grad ) dV = V
Z V
Z
I
S
(w~ ;~n) dS ;
div w~ dV + (w~ ; grad ) dV = 0 V
(2.8) (2.9)
0
for scalar functions in H . Also,
(2.10)
(A u; v ) 0 = (u; A v ) 0 ; (A u; u) 0 > 0 :
(2.11)
H
and hence
Z
div grad u v dV = (grad u; gradv ) dV ; V
(A u; v ) 0 = ?
Z
H
V
H
H
If we introduce the inner product in space of vector functions H as
Z
~ B~ )H = (A; ~ B~ ) dV ; (A;
(2.12)
~ u) 0 = (A; ~ grad u)H ; (div A;
(2.13)
V
then the identity 2.9 implies H
and the operators div and ?grad are adjoint to each in these function spaces,
div = ?grad : 7
(2.14)
2.2 Neumann Boundary Value Problem
The Neumann boundary value problem is de ned as
?div grad u = f ; (x; y) 2 V ; (grad u;~n)j(x;y) = (x; y ) ; (x; y ) 2 @V :
(2.15)
where ~n is unit outward normal to @V . The divergence theorem
Z
I
~ ~n) dS ; div W~ dV = (W;
V
(2.16)
requires the compatibility condition
Z I ? f dV = V
V
dS ;
(2.17)
for the Neumann problem to have a unique solution (up to constant). We analyze the Neumann problem from two dierent approaches: the modi ed inner product approach (where we imbed the boundary integral in inner product space), and ux form approach (used for the Dirichlet boundary conditions).
2.2.1 The modi ed inner product approach
In the modi ed inner product approach, we rewrite 2.15 in operator form as where and
Au = F ;
(2.18)
div grad u ; (x; y) 2 V ; A u = ?(grad u;~n) (x; y) 2 @V ;
(2.19)
(
F=
(
f ; (x; y) 2 V ; ; (x; y) 2 @V :
(2.20)
Next we introduce an inner product in the space of scalar functions which includes the boundary integral Z I (u; v )H = u v dV + u v dS ; (2.21) V
V
and leave the values of u(x; y ) unrestricted on the boundary. In this inner product, the Neumann problem is symmetric and non-negative because (A u; v )H = ?
Z
div grad u v dV + = (grad u; grad v ) dV : V Z
V
I
@V
(grad u; v ) dS (2.22)
The Neumann boundary conditions are called natural boundary conditions in this approach because they can be imbedded in a natural way in the de nition of the
8
inner product, or in nite element methods, by changing the variational functional or variational identity. If we extend the divergence operator to the boundary and de ne the operator d : H ! H as +div w~ ; (x; y) 2 V ; (2.23) dw~ = ?(w~ ;~n) ; (x; y) 2 @V ; we can express 2.19, in compact form,
A = ?d grad ;
(2.24)
and 2.15 can be written as the rst order system
d w~ = F ; w~ = ?grad u : (2.25) From the de nition of operator d, the de nition 2.21 for the inner product in the
space H , and integral identity 2.8 we have (d w~ ; u)H =
Z
u div w~ dV ?
VZ
I @V
u (w~ ; ~n) dS
= ? (w~ ; gradu) dV V = (w~ ; ?grad u)H : or
(2.26)
d = ?grad :
(2.27) This is a crucial relationship which we must retain in our discrete approximation. An immediate bene ts of 2.27 is that the operator A
A = ?d grad = d d
(2.28)
is symmetric and positive.
2.2.2 The ux form approach
In the ux form approach we rst rewrite problem 2.15 in ux or mixed form as rst order system
div W~ = f ; (x; y) 2 V W~ = ?grad u ; (x; y) 2 V
?(W~ ; ~n)j x;y = (x; y) ; (x; y) 2 V ; (
)
(2.29-a) (2.29-b) (2.29-c)
~ is ux. where W If we assume that we can nd a scalar function where (grad ;~n)j(x;y) = (x; y ) ; (x; y ) 2 @V ;
9
(2.30)
then we can reformulate problem 2.29-a, 2.29-b, 2.29-c as div W~~ = f~; (x; y) 2 V ; W~~ = ?grad u~ ; (x; y) 2 V ; ?(W~ ; ~n)j(x;y) = 0 ; (x; y) 2 V ; where u~ = u ? ; W~~ = W~ ? ~ ; ~ = grad f~ = f ? div ~ :
(2.31-a) (2.31-b) (2.31-c)
(2.32)
We now need only consider the problem 2.31-a, 2.31-b in space H H, where 0
~ ~n)j x;y = 0; (x; y) 2 @V g : H= fW~ 2 H; (W; 0
(
)
That is, in the ux formulation, the Neumann boundary condition is an essential boundary condition, that must be imposed on the solution. 0 The operator div, de ned on subspace H, satis es div = ?grad ; R in the inner product V u v dV : in the space H . That is, both when we consider grad 0 0 on subspace H , and div on subspace H, then div = ?grad in an inner product which does not the include boundary integral, 2.8. This boundary integral no longer contributes to the inner product since the problem has been reformulated in subspaces where the boundary integral vanishes.
2.3 Robin Boundary Value Problem
The Robin boundary value problem can be formulated as ?div grad u = f ; (x; y) 2 V : (grad u; ~n) + u = ; (x; y ) 2 @V ; > 0 ;
or in operator form as
Au = F:
(2.34)
div grad u ; (x; y) 2 V A : H ! H ; Au = ?(grad u; ~n) + u ; (x; y) 2 @V
(2.35)
Here A is de ned by and
(2.33)
F = f ;; ((x;x; yy)) 22 V@V : 10
(2.36)
It is easy to prove that A is symmetric and positive (Au; v )H = (u; Av )H ; (Au; u)H > 0 ;
(2.37)
with a proof similar to the one for Neumann boundary conditions and using the identity
Z
I
div grad u v dV + @V (grad u; v) dS + V Z I = (grad u; grad v ) dV + u v dS : V @V
(A u; v )H = ?
I
@V
u v dS (2.38)
The operator A can be represented in the form
A = ? d grad ; where the operator d was de ned by 2.23 and : H ! H is de ned as 0 ; (x; y) 2 V ;
u = u ; (x; y) 2 @V :
(2.39) (2.40)
It can be useful to formulate problem 2.33 in terms of rst-order operators as
div w~ = f ; (x; y) 2 V ; w~ = ? grad u ; (x; y) 2 V ;
?(w~ ;~n) + u =
; (x; y) 2 @V ;
(2.41)
or in terms of rst order operators as
u + d w~ = F ; w~ = ?grad u : (2.42) Because A = + d d, and = 0, the properties (2.37) follow from the properties of the operators , d and ?grad. Note that the boundary conditions are included in de nitions of operators and spaces of functions in a natural way.
3 Spaces of Discrete Functions
3.1 Grid
We index the nodes of a logically rectangular grid using (i; j ), where 1 i M and 1 j N (see Figure 3.1). The quadrilateral de ned by the nodes (i; j ), (i + 1; j ), (i + 1; j + 1), and (i; j + 1) is called the (i + 1=2; j + 1=2) cell (see Figure 3.2 (a)). The area of the (i + 1=2; j + 1=2) cell is denoted by V Ci+1=2;j +1=2, the length of the side that connects the vertices (i; j ) and (i; j + 1) is denoted by Si;j +1=2, and the length of the side that connects the vertices (i; j ) and (i + 1; j ) is denoted by Si+1=2;j . The angle between any twoadjacent sides of cell (i; j ) that meet at node (k; l) is denoted by i+1=2;j +1=2. 'k;l When de ning discrete dierential operators, such as CURL, it is convinient to consider a 2-D grid as the projection of a 3-D grid. This approach simpli es the
11
(1,N) i,N
Ui+1/2,N
(M,N)
j Ui+1/2,j+1/2 U1,j+1/2
UM,j+1/2 M,j
i,j 1,j
(M,1) i,1
Ui+1/2,1
(1,1)
i
Figure 3.1: Cell-centered discretization of scalar (HC ) on logically rectangular grid.
z ( i+1,j+1 )
i,j+1,k+1
i+1,j+1,k+1
i,j,k+1 i+1,j,k+1
( i,j+1 ) y i,j+1,k
Sξ i,j+1/2
VCi+1/2,j+1/2 ϕ
i+1/2,j+1/2
i,j,k
i+1,j+1,k
i+1,j
( i,j )
Sη i+1/2,j
( i+1,j )
i+1,j,k
x
a
b
Figure 3.2: (a) { The (i+1=2; j +1=2) cell in a logically rectangular grid has area V Ci = ;j = and sides Si;j = , Si = ;j , Si ;j = , and Si = ;j . The interior angle between Si = ;j and Si ;j = is 'ii ;j= ;j = ; (b) { The 2-D (i + 1=2; j + 1=2) cell (z = 0) is interpreted as the base of a 3-D logically cuboid (i + 1=2; j + 1=2; k + 1=2) cell (a prism) with unit height.
+1 2 +1 2
+1 2
+1 +1 2
+1 2 +1 2 +1 2 +1
+1 +1 2
+1 2 +1
12
+1 2
notation and generalizing nite-dierence methods to three dimensions. In this paper we consider functions of the coordinates x and y and extend the grid into a third dimension, z , by extending a grid line of unit length into the z direction to form a prism with unit height and with a 2-D quadrilateral cell as its base (see Figure 3.2 (b)). Sometimes it is useful to interpret the grid as being formed by intersections of broken lines that approximate the coordinate curves of some underlying curvilinear coordinate system ( , , ). The , or coordinate corresponds to the grid line where the index i, j or k is changing, respectively. Using this analogy we denote the length of the edge (i; j; k)?(i+1; j; k) by li+1=2;j;k, the length of the edge (i; j; k) ? (i; j + 1; k) by li;j +1=2;k , and the length of the edge (i; j; k) ? (i; j; k + 1) by li;j;k+1=2 (which we have chosen to be equal to 1). The area of the surface (i; j; k) ? (i; j +1; k) ? (i; j; k +1) ? (i; j +1; k +1) denoted by Si;j +1=2;k+1=2, is the analog of the element of the coordinate surface dS . Similarly, the area of surface (i; j; k) ? (i + 1; j; k) ? (i; j; k + 1) ? (i + 1; j; k + 1) is denoted by Si+1=2;j;k+1=2. We use the notation Si+1=2;j +1=2;k for the area of the 2-D cell (i + 1=2; j + 1=2), that is, Si+1=2;j+1=2;k = V Ci+1=2;j+1=2. Because the arti cially constructed 3-D cell is a right prism with unit height, we have
Si;j+1=2;k+1=2 = li;j+1=2;k li;j;k+1=2 = li;j+1=2;k ; and
Si+1=2;j;k+1=2 = li+1=2;j;k li;j;k+1=2 = li+1=2;j;k : With this 3-D interpretation, the 2-D notations Si;j +1=2 and Si+1=2;j are not ambiguous because the 3-D surface (i; j; k); (i; j + 1; k); (i; j; k + 1); (i; j + 1; k + 1) corresponds to an element of the coordinate surface S and, since the prism has unit height, the length of the side (i; j ) ? (i; j + 1) is equal to the area of the element of this coordinate surface.
3.2 Discrete Scalar and Vector Functions
In a cell-centered discretization, the discrete scalar function Ui+1=2;j +1=2 is de ned in the space HC and is given by its values in the cells [see Figure 3.1 (a)], except at the boundary cells. The treatment of the boundary conditions requires introducing scalar function values at the centers of the boundary segments: U(1;j +1=2); U(M;j +1=2), where j = 1; : : :; N ? 1, and U(i+1=2;1); U(i+1=2;N ), where i = 1; : : :; M ? 1 . In three dimensions, the cell-centered scalar functions are de ned in the centers of the 3-D prisms, except in the boundary cells where they are de ned on the boundary faces. The 2-D case can be considered a projection of these values onto the 2-D cells and midpoints of the boundary segments. 0 We de ne the subspace HC of HC to be the scalar functions which are zero on the boundary:
U(1;j+1=2) = 0 ; U(M;j+1=2) = 0 ; j = 1; : : :; N ? 1 ; U(i+1=2;1) = 0 ; U(i+1=2;N ) = 0 ; i = 1; : : :; M ? 1 :
13
(3.1) (3.2)
z
i,j+1,k+1
i+1,j+1,k+1
i,j,k+1
WS ξ i,j+1/2,k+1/2
WSηi+1/2,j+1
i+1,j,k+1
( i+1,j+1 )
( i,j+1 )
i,j+1,k
y
WSη i+1/2,j,k+1/2 WSζ i+1/2,j+1/2,k
i,j,k
WSξ
WSξ WS ζ i+1/2,j+1/2
i+1,j+1,k
i+1,j,k
x
i+1,j+1/2
i,j+1/2
( i,j )
a
WSηi+1/2,j
( i+1,j )
b
Figure 3.3: (a) HS discretization of a vector in three dimensions is de ned at the center of the faces of the prism; (b) 2-D interpretation of the HS discretization of a vector results in the face vectors being de ned perpendicular to the cell sides and the vertical vectors being de ned at cell centres perpendicular to the plane. The vectors can have three components, but in our 2-D analysis, the components depend on only two spatial coordinates, x and y . The HS space [see Figure 3.3 (a) ], where the vector components are de ned perpendicular to the cell faces, is the natural space when the approximations are based on Gauss' divergence theorem. The projection of the 3-D HS vector space into two dimensions results in the face vectors being de ned perpendicular to the quadrilateral cell sides and cell-centered vertical vector perpendicular to 2-D plane [see Figure 3.3 (b)]. We use the notation
WS(i;j+1=2) : i = 1; : : :; M ; j = 1; : : :; N ? 1 for the vector component at the center of face S(i;j +1=2) (side l(i;j +1=2)), the notation WS(i+1=2;j) : i = 1; : : :; M ? 1 ; j = 1; : : :; N for the vector component at the center of face S(i+1=2;j ) (side l(i+1=2;j )), and the notation
WS(i+1=2;j+1=2) : i = 1; : : :; M ? 1 ; j = 1; : : :; N ? 1 for the component at the center of face S(i+1=2;j +1=2) (2-D cell Vi+1=2;j +1=2).
In this paper we will consider two dimensional vector functions which have only the WS ; WS components.
14
η
nS η
lη
W WSη
ϕ
ξ
lξ
WSξ nS ξ
Figure 3.4: The grid lines (; ) form a local nonorthogonal coordinate system with unit ~ and nS ~ . In this vectors l~; l~ and corresponding unit normals to these directions, nS basis, the components (WS; WS) are orthogonal projections to normal directions.
3.3 Discrete Inner Products
In the space of discrete scalar functions de ned in the cell centers, HC , the natural inner product corresponding to the continuous inner product 2.21 is (U; V )HC = + +
?1 MX ?1 NX
U(i+1=2;j+1=2) V(i+1=2;j+1=2) V C(i+1=2;j+1=2) i=1 j =1 NX ?1 MX ?1 (3.3) U(i+1=2;1) V(i+1=2;1) S(i+1=2;1) + U(M;j+1=2) V(M;j+1=2) S(M;j+1 =2) j =1 i=1 NX ?1 MX ?1 U(i+1=2;N ) V(i+1=2;N ) S(i+1=2;N ) U(1;j+1=2) V(1;j+1=2) S(1;j+1=2) : j =1 i=1 0
The inner product in HC (U; V )
0
HC
=
?1 MX ?1 NX i=1 j =1
U(i+1=2;j+1=2) V(i+1=2;j+1=2) V C(i+1=2;j+1=2) ;
(3.4)
is analogous to the continuous inner product 2.6 for (u; v ) 0 . H In the space of vector functions HS , the natural inner product corresponding to the continuous inner product 2.12 is
~ B~ )HS = (A;
?1 MX ?1 NX i=1 j =1
~ B~ )(i+1=2;j+1=2) V C(i+1=2;j+1=2) ; (A;
15
(3.5)
~ B~ ) is the dot product of two vectors. The dot product must be de ned for where (A; vectors in HS (see Figure 3.4). Suppose the axes and form a nonorthogonal basis ~ and and ' is the angle between these axes. If the unit normals to the axes are nS ~ ~ nS, then the components of the vector W in this basis are the orthogonal projections WS and WS of W~ onto the normal vectors. The expression for the dot product of A~ = (AS; AS) and B~ = (BS; BS), is BS + AS BS) cos ' : ~ B~ ) = AS BS + AS BS + (AS (A; (3.6) 2 sin ' From this expression, the dot product in the cell is approximated by 1 V((ii++1k;j=+2;jl)+1=2) X ~ ~ (3.7) (A; B )(i+1=2;j +1=2) = 2 (i+1=2;j +1=2) k;l=0 sin '(i+k;j +l) h AS(i+k;j+1=2) BS(i+k;j+1=2) + AS(i+1=2;j+l) BS(i+1=2;j+l) +(?1)k+l AS (i+k;j +1=2) BS (i+1=2;j +l) =2)i ; + AS(i+1=2;j +l) BS (i+k;j +1=2) cos '((ii++1k;j=2+;jl+1 )
where the weights V((ii++1k;j=+2;jl)+1=2) satisfy
V((ii++1k;j=+2;jl)+1=2) 0 ;
X 1
k;l=0
V((ii++1k;j=+2;jl)+1=2) = 1 :
(3.8)
In this formula, each index (k; l) corresponds to one of the vertices of the (i+1=2; j +1=2) cell, and notations for weights are the same as for angles between the cell edges. 0 The inner product in HS is de ned by the same equations as the inner product in 0 HS if we eliminate WS(i;j+1=2) ; WS(i+1=2;j) (which are equal to zero in HS ). When computing the adjoint relationships between the discrete operators, it is helpful to introduce the formal inner products, (which we denote by square brackets [; ]), in the spaces of scalar and vector functions. [U; V ]HC = +
NX ?1 j =1
?1 MX ?1 NX i=1 j =1
U(i+1=2;j+1=2) V(i+1=2;j+1=2) +
U(M;j+1=2) V(M;j+1=2) +
MX ?1 i=1
MX ?1 i=1
U(i+1=2;1) V(i+1=2;1)
U(i+1=2;N ) V(i+1=2;N ) +
NX ?1 j =1
U(1;j+1=2) V(1;j+1=2) ;
0
in HC the formal inner product is [U; V ]
0
HC
=
?1 MX ?1 NX i=1 j =1
U(i+1=2;j+1=2) V(i+1=2;j+1=2) ;
16
(3.9)
and in HS the formal inner product is in HS , the formal inner product is
?1 M NX N MX ?1 X X ~ ~ [A; B ]HS = AS(i;j+1=2) BS(i;j+1=2) + AS(i+1=2;j) BS(i+1=2;j) : i=1 j =1
i=1 j =1
The formal inner product in HC corresponds to the usual dot product of two vectors in 0 ;
(3.12)
and therefore (C U )(i+1=2;j +1=2) = V C(i+1=2;j +1=2) U(i+1=2;j +1=2) ; i = 1; ; M ? 1 ; j = 1; ; N ? 1 ; (C U )(i;j +1=2) = S(i;j +1=2) U(i;j +1=2) ; i = 1 and i = M ; j = 1; ; N ? 1 ; (C U )(i+1=2;j ) = S(i+1=2;j ) U(i+1=2;j ) ; i = 1; ; M ? 1 ; j = 1 and j = N : The operator S can be written in block form,
S A~ =
S11 S12 S21 S22
!
AS AS
!
=
S11 AS + S12 AS S21 AS + S22 AS
!
;
(3.13)
and is symmetric and positive in the formal inner product
~ B~ ]HS = [A; ~ S B~ ]HS ; [S A; ~ A~ ]HS > 0 : [S A;
(3.14)
By comparing the formal and natural inner products
~ B~ )HS = [S A; ~ B~ ]HS = X X [(S11 AS)(i;j+1=2) + (S12 AS)(i;j+1=2)] BS(i;j+1=2) (A; M N ?1
+
N MX ?1 X i=1 j =1
i=1 j =1
[(S21 AS )(i+1=2;j ) + (S22 AS )(i+1=2;j )] BS(i+1=2;j )
17
(3.15)
i,j+1 i+1,j i,j
i,j
Stencil for operator S
Stencil for operator S
12
21
Figure 3.5: The stencils of the components S and S of the symmetric positive operator S that connects the natural and formal inner products (A;~ B~ )HS = [S A;~ B~ ]HS . 12
we can derive the explicit formulas for S :
0 X =@
21
1
V((i;ji++k;jl) +1=2) A (S11 AS )(i;j +1=2) AS(i;j+1=2) ; 2 (i+k;j +1=2) k= 12 ; l=0;1 sin '(i;j +l) V (i+k;j+1=2) X i+k;j +1=2) AS (S12 AS )(i;j +1=2) = (?1)k+ 21 +l 2(i;j(+i+l)k;j +1=2) cos '((i;j (i+k;j +l) ; +l) 1 sin ' k= 2 ;l=0;1 (i;j +l)
(3.16)
V ii l;j= ;j k X =2;j +k) AS k + 21 +l (S21 AS )(i+1=2;j ) = cos '((ii+1 (?1) (i+l;j +k ) ; +l;j ) 2 (i+1=2;j +k ) sin '(i+l;j ) k= 12 ; l=0;1 0 1 (i+1=2;j +k ) V X (i+l;j ) A AS(i+1=2;j) : (S22 AS )(i+1=2;j ) = @ 2 (i+1=2;j +k ) k= 12 ; l=0;1 sin '(i+l;j ) ( +1 2 + ) ( + )
The operators S11 and S22 are diagonal, and the stencils for the operators S12 and S21 are shown on Figure 3.5. These formulas are valid only for the sides of the grid cells interior to the domain. They can be applied at the domain boundary if the grid and discrete functions are rst extended to a row of points outside the domain by using the appropriate boundary conditions. These discrete inner products satisfy axioms of inner products, (A; B)Hh = (B; A)Hh ; ( A; B)Hh = (A; B)Hh ; (for all real numbers ) (A1 + A2; B)Hh = (A1 B)Hh + (A2 B)Hh ; (A; A)Hh 0 and (A; A)Hh = 0 if and only if A = 0 : In these axioms A and B are either discrete scalar or discrete vector functions and (; )Hh is the appropriate discrete inner product. Therefore the discrete inner products are true inner products, as well as approximations for continuous inner products, and the discrete spaces are Euclidean spaces.
18
4 Discrete Analogs of div and grad 4.1 The Natural Operator DIV
The coordinate invariant de nition of the div operator is based on Gauss' divergence theorem: H (W;~ @V ~ n) dS ; ~ div W = Vlim (4.1) !0
V where ~n is a unit outward normal to boundary @V .
The natural de nition of the discrete divergence operator is
DIV : HS ! HC ;
(4.2)
where
~ )(i+1=2;j+1=2) = (DIV W (4.3) n 1 V C(i;j) WS(i+1;j+1=2) S(i+1;j+1=2) ? WS(i;j+1=2) S(i;j+1=2) +
WS(i+1=2;j+1) S(i+1=2;j+1) ? WS(i+1=2;j) S(i+1=2;j)
o
:
The extended divergence operator d de ned by 2.23 is approximated by the dis~ )(i+1=2;j+1=2) = crete operator D coinciding with DIV on the internal cells, (D W ~ )(i+1=2;j+1=2) ; and de ned by (DIV W
~ )(i+1=2;1) = ?WS(i+1=2;1) ; i = 1; ; M ? 1 ; (D W ~ )(i+1=2;N ) = +WS(i+1=2;N ) ; i = 1; ; M ? 1 ; (D W ~ )(1;j+1=2) = ?WS(1;j+1=2) ; j = 1; ; N ? 1 ; (D W ~ )(M;j+1=2) = +WS(M;j+1=2) ; j = 1; ; N ? 1 : (D W
(4.4)
on the boundary.
4.2 Adjoint Operator GRAD
Operator grad is the negative adjoint of d, in inner products 2.21, 2.12,
grad = ?d :; follows from the identity 2.8 (w~ ; grad u)H =
Z
(w~ ; gradu) dV
VZ
(4.5)
I
u div w~ dV ? u (w~ ; ~n) dS = ? V @V = (?d w~ ; u)H :
19
(4.6)
We de ne the derived discrete operator GRAD as the negative adjoint of D
GRAD def = ?D ;
(4.7)
(from here on, we will use the notation def = when we de ne a new object). Because D : HS ! HC , the adjoint operator GRAD : HC ! HS is de ned in terms of the inner products ~ U )HC = (W; ~ DU )HS ; (D W; (4.8) which can be translated to the formal inner products as ~ C U ]HC = [W; ~ S D U ]HS : [D W; (4.9) The formal adjoint Dy of D is de ned to be the adjoint in the formal inner product, ~ Dy C U ]HS = [W; ~ S D U ]HS : [W; (4.10) ~ and U , so Dy C = S D or D = S ?1 Dy C ; This relationship must be true for all W and therefore GRAD = ?D = ?S ?1 Dy C : (4.11) ? 1 Because the operator S is banded on nonorthogonal grids, its inverse S is full, consequently, GRAD has a nonlocal stencil. The discrete ux, ~ = ?GRAD U = S ?1 Dy C U ; W is obtained by solving the banded linear system (recall that C , S , and D are local operators) S W~ = Dy C U ; (4.12) where the right-hand side, F = (FS; FS ) = Dy C U , is FSi;j+1=2 = ?Si;j+1=2 (Ui+1=2;j+1=2 ? Ui?1=2;j+1=2) ; (4.13) FSi+1=2;j = ?Si+1=2;j (Ui+1=2;j+1=2 ? Ui+1=2;j?1=2) : The discrete operator S is symmetric positive de nite, and can be represented as matrix with ve nonzero elements in each row (see, equation 3.16 and Figure 3.5).
5 Discrete Dirichlet Boundary Value Problem
5.1 Finite Dierence Method in Operator Form
The discrete problem for Dirichlet boundary conditions is formulated as DIV W~ = F ; W~ = ?GRAD U ;
U1;j+1=2 = Ui+1=2;1 =
;j = ; UM;j +1=2 = M;j +1=2 ; i+1=2;1 ; Ui+1=2;N = i+1=2;N ; 1 +1 2
20
j = 1; : : :; N ? 1; i = 1; : : :; M ? 1 ;
(5.1)
where F = ffi+1=2;j +1=2 ; i = 1; : : :; M ? 1; j = 1; : : :; N ? 1g, and fi+1=2;j +1=2 is an approximation of the right-hand side f (x; y ) in the cell. The function k;l approximates (x; y ) determining Dirichlet boundary conditions. To transform 5.2 into a problem with zero Dirichlet boundary conditions, we introduce the discrete function 2 HC , which is equal to zero in inerior cells and which values on the boundary coincide with corresponding values of . and de ne a new unknown function U~ as U~ = U ? ; (5.2) satisfying the equations
DIV W~~ = F~ ; F~ = F + DIV GRAD W~ = ?GRAD U~ ;
U~1;j+1=2 = 0 ; U~ M;j+1=2 = 0 ; j = 1; : : :; N ? 1; U~i+1=2;1 = 0 ; U~i+1=2;N = 0 ; i = 1; : : :; M ? 1 : 0
We will use the ~notations to denote functions and operators that are de ned in H . g as a restriction of GRAD to subspace H0 Therefore we de ne the operator GRAD by dropping terms in GRAD that vanish on the boundary. Problem 5.3 can now be stated as (5.3-a) DIV W~~ = F~ ; ~W~ = ?GRAD g U~ : (5.3-b)
g are adjoint to each other in the By de nition, the operators DIV and ?GRAD ~ B~ )HS and (U ; V ) 0 ; inner products (A; H
g = DIV = DIVy C : ?GRAD
(5.4)
Also, in the subspace H , the operator DIVy C simpli es on the boundary. For example, for i = 1 we get (5.5) (DIVy C ) U (1;j +1=2) = ?S1;j +1=2 U1;j +1=2 0
~~ can be eliminated in 5.3-a to give the explicit operator form of equations The ux W 5.3-b; A~ U = DIV S ?1 DIVy C U~ = F~ : (5.6) 0 The operator A~ is symmetric and positive de nite in the space HC ; (A~ U; V )
0
HC
= (U; A~ V )
0
HC
; (A~ U; U )
In terms of the formal inner products we have [C A~ U; V ] 0 = [U; C A~ V ] 0 ; [C A~ U; U ] HC
HC
21
> 0:
0
HC
0
HC
> 0:
(5.7) (5.8)
Therefore, the discrete operator A = C A~ will be symmetric and positive de nite in the formal inner product. To obtain corresponding system of linear equations with symmetric positive discrete operator, we apply C to both sides of 5.6 A U = C DIV S ?1 DIVy C U~ = C F~ : (5.9) Because the operator S ?1 has a non-local stencil for general grids equation 5.9 is interesting primarily from a theoretical point of view and is not explicitly constructed when de ning nite dierence method. Later in this Section we will explain how to formulate these equations so they can be eectively solved.
5.2 Solving System of Equations with Non-local Stencil
In this Subsection we describe an approach to solve 5.6, where operator S is local, but opearator S ?1 has non-local stencil. The equations will be formulated so that algorithms, such as preconditioned conjugate gradient methods, requiring only a multiplication of a vector by A can be used. Given U , A U can be computed eciently ~ = DIVy C U , for W~ and evaluating A U = DIVW~ . Note that by solving (4.12) S W ~ = DIVy C U , we need to use the appropriate formulas, when solving the system S W like 5.5, on the boundary. Because S is a positive de nite symmetric local operator, ~ can be solved eciently with iterative methods. the equation for W Other ecient algorithms to solve this system include the family of two-level gradient methods, including the minimal residual method, the minimal correction method, and the minimal error method. All these methods can be written as
B U (s+1) = B U (s) + s (F ? A U (s) ) ;
(5.10)
where U (s) is an approximate solution to U on iteration number s, s some iteration parameter, and the operator B is a preconditioner. A family of three-level iteration methods, which require only the computation of A U include the three-level conjugate-direction methods, like the conjugate gradient method. All these methods can be written as
B U (s+1) = s+1 (B ? s+1 A) U (s) + (1 ? s+1 ) B U (s?1) + s+1 s+1 F ; B U (1) = (B ? 1 A) U (0) + 1 F : The appropriate inner product which to compute the parameters s ; s is the natural inner product, where operator A is symmetric and positive de nite. The eectiveness of these methods strongly depends on the choice of the preconditioner. The simplest Jacobi type preconditioner approximates S by its diagonal blocks. This is exact for orthogonal grids and produces a ve-cell symmetric positive-de nite operator corresponding to removing the mixed derivatives from the variable-coecient Laplacian on non-orthogonal grids. Some details can be found in [13].
22
6 Discrete Neumann Boundary Value Problem Following the continuous case in Section 2.2, we consider both the modi ed inner product and ux form approaches. The discrete analog of 2.18 is
A U = ?D GRAD U = F ;
(6.1)
where the operator GRAD is de ned on the space HC including the boundary faces, F includes the approximation of on the boundary, and is de ned similar to F in 2.18. The operator GRAD = ?D , in the HC inner product (which includes boundary terms), and therefore A = D D ; A = A 0 : In [3] we proved the solution of this problem is unique solution up to a constant if the compatibility condition, ?1 MX ?1 NX i=1 j =1
fi+1=2;j+1=2 V Ci+1=2;j+1=2 = +
MX ?1 i=1 NX ?1 j =1
M;j +1=2 SM;j +1=2 ?
1;j +1=2 S1;j +1=2
i+1=2;N Si+1=2;N ? i+1=2;0 Si+1=2;1
:
is satis ed. The explicit operator form of 6.1 is similar to 5.9, and can be written as
C D S ? Dy C U = F :
(6.2)
1
The ux form of 6.1 is
DIV G~ = fi;j! for all cells, GS = ?GRAD U ; for all faces; G~ = GS GS1;j+1=2 =
1 +1 2
GSi+1=2;1 =
i+1=2;1 ; GSi+1=2;N = i+1=2;N ;
;j =
; GSM;j+1=2 =
M;j +1=2 ;
(6.3-a) (6.3-b)
j = 1; : : :; N ? 1 ; i = 1; : : :; M ? 1 :
(6.3-c)
To construct the discrete analog of the ux form 2.31-a- 2.31-c we start with a discrete analog of 2.29-a
~ )i+1=2;j+1=2 = (DIV W
(6.4)
h
WSi+1;j+1=2 Si+1;j+1=2 ? WSi;j+1=2 Si;j+1=2 i. +WSi+1=2;j +1 Si+1=2;j +1 ? WSi+1=2;j Si+1=2;j V Ci+1=2;j +1=2 = fi+1=2;j +1=2 ;
23
and a discrete analog of the boundary conditions 2.29-c WS1;j+1=2 = 1;j+1=2 ; WSM;j+1=2 = M;j+1=2 ; j = 1; : : :; N ? 1 ;
WSi+1=2;1 =
i+1=2;1 ; WSi+1=2;N = i+1=2;N ;
i = 1; : : :; M ? 1 :
(6.5)
If we eliminate the known boundary uxes from equation 6.4, we obtain equations g which is the restriction of DIV on the subspace of de ning discrete operator DIV vector functions with zero normal component on the boundary and of the modi ed g , and f~ coincide with DIV, f respectively. right-hand side f~. In interior operator DIV Here we present formulas for modi ed discrete divergence and right-hand side at leftbottom corner cell, and for bottom row of cells g W~ )3=2;3=2 = WS2;3=2 S2;3=2 + WS3=2;2 S3=2;2 (DIV VC =;=
3 23 2
S S (6.6) = f~3=2;3=2 = f3=2;3=2 + 1V;3C=2 1;3=2 + 3V=2C;1 3=2;1 ; 3=2;3=2 3=2;3=2 g W~ )3=2;j+1=2 = WS2;j+1=2 S2;j+1=2 + WS3=2;j+1 S3=2;j+1 ? WS3=2;j S3=2;j (DIV V C3=2;j+1=2
S = f~3=2;j +1=2 = f3=2;j +1=2 + 1;jV+1C=2 1;j +1=2 ; j = 2; : : :N ? 2 ; 3=2;j +1=2 Formulas for other corner cells and cells adjacent to boundary are similar. g, We de ne the discrete analog of the operator grad as the negative adjoint of DIV using the relationship that operator grad is adjoint to restriction of div de ned on vector functions with zero normal components on the boundary. In the discrete case this means that the inner product for the space of scalar functions does not include boundary terms. Therefore we de ne GRAD only on the interior faces, and this de nition does not include the values of U on the boundary. The discrete analog of 2.31-a, 2.31-b is g W~ ) = f~; in all cells, (DIV (6.7) ~W = ?GRAD U ; in internal facesf~; (6.8) where all values of scalar function U are unknown in the cells, and the components of W~ = fWSi;j ; WSg are unknown only on the internal faces. The known boundary values of WSi;j ; WS have been taken into account in de nition of f~. Equations 6.8 are de ned only for internal faces and do not contain U on the boundary. Furthermore, the right-hand sides of these equations contain only dierences Ui;j in the cells. Therefore, the values of U on the boundary do not participate in equations 6.7, 6.8. This is the main dierence between approach based on ux formulation and modi ed inner product approach. We can solve for the values of U on the boundary in terms of internal U and the
uxes by using equations like 6.3-b, 6.3-c, written in form S G~ = Dy C U ; (6.9)
24
after solving the system 6.7, 6.8. The relations 6.9 are explicit because right-hand side of each equation in 6.9 contains only dierences between one value of U in internal cell and one value of U on the boundary.
7 Discrete Robin Boundary Value Problem We follow the approach used in the continuous case to de ne discrete analogs of the operators d, grad, and for Robin boundary conditions. The discrete analogs of rst two operators are de ned by 4.3, 4.4, 4.11. The discrete analog of , (2.40), is de ned by ( the interior ; (7.1) ( U )(k;l) = U 0 ;; in on the boundary, k;l)
(
k;l)
(
where k ; l corresponding indicies. The discrete analog of the continuum system (2.42) is ~ = F ; W~ = G U :
U + DW (7.2) The operator equation (2.39) is given by
A U = ( + D G ) U = F ;
(7.3)
and the explicit form of 7.2 is
DIV G~ = fi;j!; for all cells, GS = ?GRAD U ; for all faces, G~ = GS
(7.4-a) (7.4-b)
?GS ;j
= + 1;j +1=2 U1;j +1=2 = 1;j +1=2 ; j = 1; ; N ? 1 ; +GSM;j +1=2 + M;j +1=2 UM;j +1=2 = M;j +1=2 ; j = 1; ; N ? 1 ; ?GSi+1=2;1 + i+1=2;1 Ui+1=2;1 = i+1=2;1 ; i = 1; ; M ? 1 ; +GSi+1=2;N + i+1=2;N Ui+1=2;N = i+1=2;N ; i = 1; ; M ? 1 : 1 +1 2
In this system, the uxes are de ned on all the faces and unknowns U include the values on the boundary faces. These equations are formally equivalent to equation 7.3, which contains only U . By construction, operator of this equation is self-adjoint and positive de nite.
8 Conclusion We have described an approach of consistent approximation of Dirichlet, Neumann and Robin boundary conditions into mimetic nite dierence methods for solving Poisson equation. The procedure leads to a discrete problems with self-adjoint positive-de nite operators, exactly as it is in continuous case. Some practical applications of the approach can be found in [12, 13].
25
Acknowledgment This work was performed under the auspices of the US Department of Energy (DOE) contract W-7405-ENG-36 and the DOE/BES (Bureau of Energy Sciences) Program in the Applied Mathematical Sciences contract KC-07-01-01. The authors are thankful to S. Steinberg for many fruitful discussions.
26
References [1] J. M. Hyman and M. Shashkov, Natural Discretizations for the Divergence, Gradient, and Curl on Logically Rectangular Grids, International Journal Computers & Mathematics with Applications, Vol. 33, No. 4, 1997, pp. 81-104. [2] J. M. Hyman and M. Shashkov, The Adjoint Operators for the Natural Discretizations for the Divergence, Gradient, and Curl on Logically Rectangular Grids, An IMACS Journal of Applied Numerical Mathematics, 25 (1997), p. XXXX. [3] J. M. Hyman and M. Shashkov, The Orthogonal Decomposition Theorems for Mimetic Finite Dierence Methods, Report of Los Alamos National Laboratory, LA-UR-96-4735, submitted to SIAM Journal on Numerical Analysis. [4] B. Gustafsson, H.-O. Kreiss and J. Oliger, Time Dependent Problems and Dierence Methods, A Wiley-Interscience Publication, John Wiley & Sons, Inc., 1995. Chapter 11., pp. 445{495. [5] S. G. Mikhlin, Linear Equations of Mathematical Physics, New York, Holt, Rinehart and Winston, 1967. [6] J. E. Morel, R. M. Roberts, and M. J. Shashkov, A Local Support-Operator Diusion Discretization Scheme for Qudrilateral R-Z Meshes, LA-UR-97-577, Report of Los Alamos National Laboratory, Los Alamos, New Mexico, Submitted to Journal of Computational Physics. [7] P. Olsson, Summation by parts, Projections, and Stability. 1., Math. Comput., 64 (1995), pp. 1035{1065. [8] P. Olsson, Summation by parts, Projections, and Stability. 2., Math. Comput., 64 (1995), pp. 1473{1493. [9] A. A. Samarskii, V.F. Tishkin, A. P. Favorskii, and M. Yu. Shashkov, Operational Finite-Dierence Schemes, Di. Eqns., 17, (1981), pp. 854-862. [10] M. Shashkov, Conservative Finite-Dierence Schemes on General Grids, CRC Press, Boca Raton, Florida, 1995. [11] M. Shashkov, and S. Steinberg, Support-Operator Finite-Dierence Algorithms for General Elliptic Problems, Journal of Computational Physics, 118, (1995) pp. 131-151. [12] M. Shashkov, and S. Steinberg, Solving Diusion Equations with Rough Coecients in Rough Grids, Journal of Computational Physics, 129, (1996) pp. 383-405. [13] J. Hyman, M. Shashkov, and S. Steinberg, The Numerical Solution of Diusion Problems in Strongly Heterogeneous Non-Isotropic Materials, Journal of Computational Physics, 132, (1997) pp. 130-148. [14] A. N. Tikhonov and A. A. Samarskii, Equations of Mathematical Physics, A Pergamon Press Book, The Macmillan Company, New York, 1963.
27