TL;DR
This paper introduces an energy conserving numerical method for the acoustic wave equation on curvilinear grids, utilizing covariant basis decomposition and high-order SBP operators to enhance accuracy and stability.
Contribution
The paper presents a novel covariant basis decomposition approach combined with SBP operators for energy conserving discretization on curvilinear grids, improving rotational invariance and stability.
Findings
Outperforms Cartesian basis on rotated grids
Provides a conditionally stable discretization method
Offers bounds for stability evaluation
Abstract
We develop a numerical method for solving the acoustic wave equation in covariant form on staggered curvilinear grids in an energy conserving manner. The use of a covariant basis decomposition leads to a rotationally invariant scheme that outperforms a Cartesian basis decomposition on rotated grids. The discretization is based on high order Summation-By-Parts (SBP) operators and preserves both symmetry and positive definiteness of the contravariant metric tensor. To improve accuracy and decrease computational cost, we also derive a modified discretization of the metric tensor that leads to a conditionally stable discretization. Bounds are derived that yield a point-wise condition that can be evaluated to check for stability of the modified discretization. This condition shows that the interpolation operators should be constructed such that their norm is close to one.
| N | ||||||||
|---|---|---|---|---|---|---|---|---|
| 16 | 2.49e-2 | 1.05e-1 | - | - | 2.44e-2 | 1.06e-1 | - | - |
| 32 | 2.88e-3 | 1.49e-2 | 3.11 | 2.81 | 2.00e-3 | 1.56e-2 | 3.61 | 2.76 |
| 64 | 4.03e-4 | 2.89e-3 | 2.84 | 2.37 | 2.31e-4 | 2.39e-3 | 3.11 | 2.70 |
| 128 | 6.32e-5 | 6.89e-4 | 2.67 | 2.07 | 3.59e-5 | 4.16e-4 | 2.69 | 2.52 |
| 256 | 1.06e-5 | 1.77e-4 | 2.58 | 1.96 | 6.24e-6 | 9.84e-5 | 2.53 | 2.08 |
| h | ||||||||
|---|---|---|---|---|---|---|---|---|
| 6.25e-2 | 3.81e-3 | 9.82e-3 | - | - | 9.73e-3 | 2.43e-2 | - | - |
| 3.12e-2 | 6.12e-4 | 1.27e-3 | 2.64 | 2.95 | 1.10e-3 | 4.27e-3 | 3.14 | 2.51 |
| 1.56e-2 | 9.49e-5 | 3.95e-4 | 2.69 | 1.69 | 1.15e-4 | 7.00e-4 | 3.26 | 2.61 |
| 7.81e-3 | 1.29e-5 | 1.14e-4 | 2.87 | 1.79 | 1.41e-5 | 1.17e-4 | 3.02 | 2.58 |
| 3.91e-3 | 2.31e-6 | 3.05e-5 | 2.48 | 1.90 | 2.04e-6 | 2.04e-5 | 2.80 | 2.52 |
| N | ||||||||
|---|---|---|---|---|---|---|---|---|
| 16 | 1.69e-2 | 4.78e-2 | - | - | 6.65e-2 | 2.71e-1 | - | - |
| 32 | 6.74e-4 | 2.43e-3 | 4.18 | 3.87 | 2.72e-3 | 1.28e-2 | 4.15 | 3.96 |
| 64 | 4.68e-5 | 3.29e-4 | 3.67 | 2.75 | 2.04e-4 | 1.41e-3 | 3.56 | 3.04 |
| 128 | 5.59e-6 | 6.67e-5 | 2.99 | 2.25 | 2.68e-5 | 3.20e-4 | 2.86 | 2.09 |
| 256 | 8.62e-7 | 1.55e-5 | 2.67 | 2.08 | 4.41e-6 | 7.87e-5 | 2.57 | 2.00 |
| 5 | 1.20e-01 | 2.75 | 9.93e-02 | 3.14 | 1.20e-01 | 2.77 |
| 10 | 6.32e-03 | 4.25 | 4.77e-03 | 4.38 | 6.40e-03 | 4.22 |
| 20 | 3.16e-04 | 4.32 | 2.52e-04 | 4.24 | 3.31e-04 | 4.28 |
| 40 | 1.64e-05 | 4.26 | 1.45e-05 | 4.12 | 1.77e-05 | 4.22 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Energy conservative SBP discretizations of the acoustic wave equation in covariant
form on staggered curvilinear grids
Ossian O’Reilly Southern California Earthquake Center, University of Southern California, Los Angles, CA 90089.
N. Anders Petersson Center for Applied Scientific Computing, Lawrence Livermore National Laboratory, L-561, PO Box 808, Livermore CA 94551.
Abstract
We develop a numerical method for solving the acoustic wave equation in covariant form on staggered curvilinear grids in an energy conserving manner. The use of a covariant basis decomposition leads to a rotationally invariant scheme that outperforms a Cartesian basis decomposition on rotated grids. The discretization is based on high order Summation-By-Parts (SBP) operators and preserves both symmetry and positive definiteness of the contravariant metric tensor. To improve accuracy and decrease computational cost, we also derive a modified discretization of the metric tensor that leads to a conditionally stable discretization. Bounds are derived that yield a point-wise condition that can be evaluated to check for stability of the modified discretization. This condition shows that the interpolation operators should be constructed such that their norm is close to one.
1 Introduction
Many applications featuring wave propagation require numerical methods capable of treating complex geometry. A popular approach for finite difference methods is to solve the governing equations on curvilinear grids. Typically, the governing equations are first formulated in terms of Cartesian vector components followed by transforming the spatial derivatives with respect to the curvilinear coordinates. An alternative approach utilizes the invariance of the governing equation with respect to the choice of coordinate basis. In this paper we develop a staggered grid discretization of the acoustic wave equation where the components of the velocity vector are expressed with respect to the covariant basis, which varies throughout space.
Discretization of wave equations on general staggered curvilinear grids is challenging due to the emergence of off-diagonal metric terms. On a Cartesian grid, all fields and their components can be positioned in the grid so that all of the terms can be discretized by staggered difference approximations. However, a curvilinear coordinate transformation introduces additional terms into the governing equations that cannot be discretized without interpolation. One can directly discretize these additional terms by collocating some of the components, but this collocation increases the computational cost and memory storage. Despite this increase in computational cost, the approach has been used in computational seismology for solving the elastic wave equation [2, 34, 23]. An alternative solution is to solve the covariant form of the governing equations on orthogonal grids. In this case, the metric tensor becomes diagonal. This approach has been used in computational electrodynamics for solving Maxwell’s equations in covariant form [37, 33]. Unfortunately, the generation of orthogonal grids is a non-trivial task, in particular for many practical applications that feature complex 3D geometries. A third solution is to use interpolation in the off-diagonal components. So far this approach has only been developed with one-dimensional low order interpolation [9, 10, 11], resulting in a scheme that may be susceptible to long-term instabilities, requiring ad-hoc stabilization [8]. In the present work, we develop a provable stable numerical method that solves the acoustic wave equation in covariant form on a general staggered curvilinear grids. The proposed scheme is high-order-accurate, energy conservative and preserves positive definiteness of the discretized metric tensor.
To obtain a provably stable method, we discretize the acoustic wave equation by applying the Summation-By-Parts (SBP) principle. The SBP principle provides a way to analyze and derive provably stable schemes by constructing energy estimates for semi-discrete approximations. SBP methods were originally designed to obtain provably stable high order finite difference approximations for first order hyperbolic systems on collocated grids [13, 32, 20, 21]. Since that time, there have been numerous developments that, for example, extend the SBP methodology to non-conforming grids [16, 25, 3] and to equations with second and higher order derivatives [31, 26, 15]. SBP methods have also been extend beyond finite differences, e.g., to finite volume, discontinuous Galerkin, and flux reconstruction schemes [18, 5, 29]. Methods have also been devised for coupling different SBP discretizations [19, 14, 12, 4].
Our proposed curvilinear staggered SBP discretization builds upon our previous work on staggered grid methods for wave equations in Cartesian geometries [22, 28, 17]. Our main theoretical result is that stability can be guaranteed on a curvilinear grid under two conditions. First, the interpolation operators must be compatible with the SBP norm weights such that the scalar product between a staggered and a node-centered grid function gives the same result, regardless of which function is being interpolated. Secondly, the discretization must preserve the positive definiteness of the metric tensor. The latter condition is essential because the velocity field is decomposed with respect to the covariant basis. As a result, the symmetric and positive definite covariant metric tensor appears in the kinetic energy term. The discretization of this tensor involves interpolation, which can destroy positive definiteness. We show how to preserve positive definiteness of this tensor in the discretized equations. While it is possible to preserve positive definiteness for any non singular curvilinear grid, such a discretization has to involve interpolation in the diagonal components of the contravariant metric tensor, which reduces accuracy and increases computational cost. By modifying the metric tensor discretization in its diagonal components, it is possible to overcome this reduction in accuracy and increase in computational cost. However, positive definiteness can no longer be guaranteed for all non singular grids. We derive a condition that can be checked in a point-wise manner to ensure positive definiteness of the metric tensor discretization. This condition shows that the interpolation operators should be constructed such that their norm is close to one.
The remainder of the paper is organized as follows. The covariant form of the acoustic wave equation and curvilinear mappings are reviewed in Section 2. In Section 3 we develop SBP finite difference for staggered grids, first in one dimension and then in two dimensions for the acoustic wave equation. In Section 4, we show that the discretization is energy conservative. Two alternative ways of discretizing the metric tensor such that the positive definiteness is preserved are presented in Section 5. In Section 6, we conduct numerical experiments. We first investigate the accuracy of the scheme for the two different metric tensor discretizations. We then demonstrate that the covariant formulation can outperform a Cartesian formulation due to the loss of rotational invariance in the latter. The section is concluded by demonstrating that the solution is free from numerical artifacts when the acoutic wave propagation is driven by a discretized point force applied to the boundary. Finally, in Section 7, the study is summarized and conclusions are drawn.
2 Problem formulation
Consider the 2-D acoustic wave equation in dimensionless form (all quantities are scaled, including space and time)
[TABLE]
posed on a 2-D bounded domain for . Here, is the pressure and is the velocity vector. We consider cases where the domain can be defined through a curvilinear mapping from the unit square in parameter space [35]. We define the curvilinear coordinates
[TABLE]
and the continuously differentiable mapping and between the curvilinear and Cartesian coordinates. We assume that the mapping is non singular. By differentiating the mapping with respect to the curvilinear coordinates, one obtains the covariant basis vectors,
[TABLE]
The corresponding covariant metric tensor is defined by . It is symmetric and positive definite.
The contravariant basis vectors and can be defined by the orthogonality condition
[TABLE]
The contravariant metric tensor satisfies . It is symmetric and positive definite, and the Jacobian of the curvilinear mapping, , is assumed to be bounded. Here, denotes the determinant of the tensor .
The velocity field is decomposed with respect to the covariant basis,
[TABLE]
where and are the contravariant velocity components. The contravariant metric tensor can be used to transform between covariant and contravariant velocity components,
[TABLE]
The inverse relationship is
[TABLE]
Contravariant quantities are always denoted by superscripts, whereas covariant quantities are always denoted by subscripts.
Next, we derive the covariant formulation of the acoustic wave equation. The divergence of the velocity vector field satisfies [35, 6]
[TABLE]
The pressure gradient satisfies
[TABLE]
By inserting (5) into (1) and (6) into (2), followed by taking the dot product of (2) with the contravariant basis, results in
[TABLE]
The total energy in the system is the sum of the acoustic and the kinetic energies
[TABLE]
The second integral expresses the kinetic energy as an invariant formed by contracting the covariant velocity components with the contravariant components. Alternately, the covariant velocity components can be transformed into the contravariant velocity components using (4), yielding
[TABLE]
In this form, we see that (10) is positive since the covariant metric tensor is symmetric and positive definite. By differentiating the energy (10) with respect to time and inserting the governing equations (7)-(8), we obtain the energy rate
[TABLE]
The terms in brackets on the right hand side must be bounded by imposing one boundary condition per side of the unit square in parameter space. With the homogeneous pressure boundary condition on all sides,
[TABLE]
As expected, the acoustic wave equation in covariant formulation conserves the total energy in the system.
3 SBP operators
Before we can present the numerical scheme, we need to introduce some definitions. First, we review SBP staggered grid finite difference methods in one spatial dimension, and then in two spatial dimensions [22]. The SBP operators form building blocks for constructing our provably stable staggered grid scheme. To make it easier to understand how the construction works, we share some of our codes in the repository github.com/ooreilly/sbp. In particular, this repository contains the SBP operators derived in this work and a prototype implementation of the scheme.
We introduce the grid vectors (node-centered) and (cell-centered) that discretize the unit interval using and grid points, respectively,
[TABLE]
The grid points are
[TABLE]
and is the grid spacing, see Figure 1. On the -grid, the function is approximated by grid function , where . Similarly, on the -grid, the function is approximated by the grid function , where .
We introduce the SBP staggered grid difference operators and that approximate the first derivative, see Figure 1. These operators are accurate to order in the interior and to order for a few points near each boundary. The operator approximates the derivative of a grid function on the -grid at the -grid. In contrast, the operator approximates the derivative of a grid function on the -grid at the -grid. For example, for all difference operators that are at least second order accurate on the boundary (), quadratic monomials and are differentiated exactly,
[TABLE]
Staggered SBP difference operators satisfy a summation by parts property, corresponding to integration by parts,
[TABLE]
The property (13) is key to proving energy stability of the semi-discrete approximation. The matrices and are positive definite diagonal matrices that define order accurate quadrature rules on the grids and , respectively. Since the grid points of the cell-centered and nodal grids overlap, the SBP property (13) gives boundary terms involving unknowns on the boundary. Alternate approaches that avoid overlapping boundary points either interpolates or extrapolates the numerical solution to the boundary [3], or strongly impose the boundary condition [28].
In addition to difference operators, we also need to define SBP staggered interpolation operators. These operators are order accurate in the interior and order accurate on the boundary. The interpolation operator interpolates a grid function on the -grid to the -grid, and the interpolation operator interpolates in the opposite direction. For example, if the interpolation operator is at least second order accurate on the boundary (), then
[TABLE]
The interpolation operators satisfy the SBP property
[TABLE]
for all grid functions and . The property (14) states that when evaluating the integral using the SBP quadrature, the result must be the same whether is interpolated to the -grid, or is interpolated to the -grid.
3.1 Two-dimensional SBP Operators
In two spatial dimensions, we introduce a staggered grid that discretizes the pressure field and the contravariant velocity components (, ). This grid is parameterized by the curvilinear coordinates and , see Figure 2.
On the staggered grid, pressure is located at cell-centers and the contravariant velocity components and are located on the edges with or , respectively.
Without loss of generality, we use the same number of cells (and grid spacing ) in both coordinate directions. We collect the spatial discretizations of the pressure and velocity component fields in the vectors , and . These column vectors are ordered as follows:
[TABLE]
where , , and . Furthermore, the length of each grid vector is, respectively,
[TABLE]
i.e., in this particular case.
We extend the differentiation and interpolation operators to two spatial dimensions by applying them in a line-by-line manner using Kronecker products. The difference operators become
[TABLE]
where is the identity matrix. In this notation, is a difference operator that acts on a cell-centered quantity and approximates the first derivative on the edge-1 grid, see Figure 3. We also introduce the following norm weight matrices,
[TABLE]
and interpolation operators
[TABLE]
The interpolation operator interpolates from the cell-centered grid to the edge-1 grid, and so forth. By applying the SBP interpolation property (14) to (15), we find
[TABLE]
The extension of the SBP property (13) to 2D becomes,
[TABLE]
where , contain the grid values of along the right, left, top, and bottom boundaries, respectively (and similarly for and ).
3.2 The semi-discrete approximation
After discretizing the spatial derivatives on the staggered grid, the semi-discretization of the pressure equation (7) becomes
[TABLE]
In (18), , , and are diagonal matrices that hold the Jacobian evaluated at the cell-centers and the edge grid points, respectively.
The semi-discrete approximation of the equations for the contravariant velocity components (8) become
[TABLE]
In (19), is the discrete approximation of the contravariant metric tensor . The explicit form of will be presented in the next section. Recall that the contravariant metric tensor gives the transformation from covariant to contravariant components. The discrete counterpart of (3) is
[TABLE]
Since the contravariant components and are associated with different locations of the staggered grid, must be constructed using interpolation, unless the curvilinear grid is orthogonal.
4 The energy method
In this section, we apply the energy method to show that the scheme (18)-(19) is stable. To simplify the presentation, we consider periodic boundary conditions and refer to Appendix A for a stability proof with weakly imposed boundary conditions using the SAT penalty method.
In the following, the matrix is obtained by inverting in (19). The matrix approximates the covariant metric tensor . In practice, we never have to explicitly compute the inverse. Consider the following discrete approximation of the energy (10), ,
[TABLE]
In (21), we have defined
[TABLE]
Recall that the first term on the right-hand side of (10) is the acoustic energy and the two remaining terms represent the kinetic energy. The discrete approximation of the acoustic energy, , defines a norm of since the matrices and are diagonal with positive entries. In order for the kinetic energy, , to be a norm, the matrix must be positive definite. Since , , , and are positive diagonal matrices, is a positive diagonal matrix. The construction of such that is symmetric and positive definite is discussed in the next section. Given such a , we obtain an energy stable scheme, as is shown in the following lemma.
Lemma 1**.**
Assume that the grid metric and solution is periodic in each direction. Then the energy (21) of the semi-discrete approximation (18)-(19) is conserved.
Proof.
Differentiating the acoustic energy in (21) with respect to time and inserting (18) into the result yields
[TABLE]
Similarly, differentiating the kinetic energy in (21) with respect to time and inserting (19), and assuming , yields
[TABLE]
The energy rate is the sum of (23) and (24),
[TABLE]
On a two dimensional periodic grid, the boundary terms in (17) cancel out and therefore the SBP property simplifies to and . Thus, the right-hand side of (25) is identically zero and the energy of the semi-discrete approximation is conserved. ∎
5 Discretization of the contravariant metric tensor
To define a norm for , note that the second matrix in (21) can be written as
[TABLE]
Because is diagonal and positive definite, it is sufficient to show that is symmetric and positive definite.
There are many ways to construct the matrix to form the approximation of the kinetic energy in (21), but care is needed to preserve energy positivity. What complicates matters is the fact that and are defined on different grids. Therefore, the construction of must involve interpolation operators at least in its off-diagonal blocks. However, as we will see in Section 5.2, positive definiteness may be lost when only the off-diagonal blocks are interpolated.
5.1 Unconditionally energy positivity preserving construction
To obtain a matrix that gives a positive definite , we evaluate the contravariant metric tensor and Jacobian at the cell-centered grid points, and then interpolate back and forth to each velocity grid. This approach results in
[TABLE]
The reason why appears in the construction of will become clear next. To show the following result, we first need to make an assumption.
Assumption 1**.**
The null-space of the SBP interpolation operators in (15) is empty.
We have verified this assumption through numerical experiments. We are now ready to state the following result.
Lemma 2**.**
Let be given by (21) and let be defined by (26). The matrix is positive definite if Assumption 1 holds, and is positive definite.
Proof.
Multiplying (26) by results in
[TABLE]
Using the SBP interpolation property (16),
[TABLE]
By factoring out the interpolation and norm operators as well as the Jacobians, we find
[TABLE]
This factorization relies on the fact that the matrices , , , , and are diagonal with positive entries, and hence commute. Next, we show that the matrix is positive definite. We can permute so that it consists of positive definite blocks, one per grid point. Let be a permutation matrix that is obtained by permuting the rows of the identity matrix. Then is the permutation of that consists of positive definite blocks. Each block holds the contravariant metric tensor corresponding to one grid point, which is non singular by assumption. Since permutation matrices satisfy , we have that is positive definite. If Assumption 1 holds, then is symmetric and positive definite. ∎
5.2 Conditionally energy positivity preserving
construction
While the particular choice of in (26) yields a positive kinetic energy for all non singular mappings, it may be undesirable to use this choice in practice. The reason is that blocks along the diagonal of contain interpolation operators that interpolate back and forth between two different grids. This interpolation adds extra computation and may also reduce the accuracy in the numerical solution. Next, we show that it is possible to avoid these extra computations and improve the accuracy. However, care has to be taken to ensure that the contravariant metric tensor is discretized such that it remains positive definite.
Consider the following discretization,
[TABLE]
This choice preserves the symmetry property , but may cause a loss of positive definiteness. To avoid having to perform expensive eigenvalue computations to assert whether is positive definite, we derive and analyze an approximate condition that can be evaluated in a point-wise manner.
Introduce the coefficients and . We use the SBP interpolation relations (16) to decompose the matrix (28) according to
[TABLE]
where
[TABLE]
and
[TABLE]
We can guarantee that is positive definite if the matrix is positive definite and is positive semi-definite. The matrix becomes indefinite if or . We must therefore assume that the coefficients and are positive. On the other hand, the matrix becomes indefinite if or are too large. Our strategy is therefore to first derive upper bounds on and that guarantee that is positive semi-definite. The definiteness of can then be verified by solving a eigenvalue problem at each cell center.
The matrix in (32) is clearly positive semi-definite if and are positive semi-definite, which can be guaranteed by bounding and as is shown in the following lemma.
Lemma 3**.**
The matrices and are positive definite if the coefficients and satisfy the bounds
[TABLE]
Here, and are the largest eigenvalues of the respective generalized eigenvalue problems,
[TABLE]
Proof.
Both bounds can be derived in the same fashion and we focus on the bound for . From the definitions above,
[TABLE]
The matrices and are real, symmetric and positive definite. All eigenvalues of the generalized eigenvalue problem (34) are therefore real and positive. Furthermore, the corresponding eigenvectors form a complete set and can be normalized such that
[TABLE]
Any vector can therefore be expanded according to
[TABLE]
Thus,
[TABLE]
The matrix is therefore positive semi-definite if
[TABLE]
The inequality must be satisfied for all eigenvalues . We have , which shows that is positive semi-definite as long as
[TABLE]
∎
In Appendix C we show how the above 2-D generalized eigenvalue problems decouples into a number of regular eigenvalue problems along each 1-D grid line.
When using the modified metric tensor discretization, the norm should be close to one to avoid instability. During the construction of the SBP interpolation operators, there can be undetermined coefficients remaining after satisfying the SBP property (14) and accuracy conditions. These coefficients can be determined by choosing an objective function that minimizes . In this work we optimize for accuracy and manually check that . Please see [22, 28] for further construction details.
To understand why is desirable, assume the mapping is linear. Then the metrics and are constant, and the generalized eigenvalue problem (34) simplifies to
[TABLE]
Thereafter, by applying the SBP property (16), we get
[TABLE]
By observing that and , we obtain an eigenvalue problem along a single grid line in the -direction, . The maximum eigenvalue satisfies . The lower bound comes from observing that the constant vector is interpolated exactly, and is therefore an eigenvector of .
To investigate how the size of influences the stability of the scheme, we construct one pair of interpolation operators with and another pair with . For the test, we consider an almost square domain where three sides are straight and the fourth side is a Gaussian hill,
[TABLE]
We increase the amplitude of the Gaussian hill and monitor the minimum eigenvalue of the symmetric matrix in the kinetic energy. This matrix must be positive definite to guarantee stability. We expect that for a sufficiently large amplitude of the Gaussian hill the minimum eigenvalue of becomes negative. In the test, the grids are coarse with grid points. Figure 4 show the grids at which become positive semi-definite for each set of interpolation operators. As can been seen, if , the grid can undergo significant deformation before becomes positive semi-definite (Figure 4a). On the other hand, if , the grid can only undergo small deformations before becomes positive semi-definite (Figure 4b).
Since it is computationally expensive to compute the minimum eigenvalue of , we demonstrate how to estimate using Lemma 3. Note that the constants and can be bounded using Lemma 3 without much computational work because these bounds only involve solving 1-D eigenvalue problems. Once and are bounded, the matrix in (29) can be evaluated in a point-wise manner. This approach provides an efficient way of estimating whether is positive definite. If is positive definite at all grid points, then is positive definite. However, if has a negative eigenvalue at any grid point, then the test for definiteness of is inconclusive.
Figure 5 shows how accurate the approximate method is at estimating if is positive definite by computing the minimum eigenvalue of for all grid points. In Figure 5a, the approximate method estimates that is positive definite for . (the actual amplitude at which becomes positive semi-definite is ). In Figure 5b, the approximate method estimates that is positive definite for amplitudes (the actual amplitude at which becomes positive semi-definite is ).
In conclusion, large values of can severely limit the amount of grid skewness that the scheme can tolerate without becoming unstable. This restriction may be so severe that stable computations on realistic grids become impossible. Therefore, if one wants to use the approximation (28) of the contravariant metric tensor, it is important to construct interpolation operators such that .
6 Numerical experiments
We use the method of manufactured solutions to conduct convergence rate studies [30]. The following manufactured solution is designed to satisfy the acoustic wave equation (1)-(2) in Cartesian velocity components (),
[TABLE]
To apply the manufactured solution, we impose the inhomogeneous pressure boundary condition, for all points on the boundary. We use the classical fourth order Runge-Kutta scheme to advance the solution in time. Since a naive implementation of time dependent boundary data reduces the convergence rate to second order for Runge-Kutta schemes, we apply the boundary correction procedure described in [1].
The error is the difference between the numerical and manufactured solution, and it is measured using either the discrete and (max) norm for each field. The errors are
[TABLE]
where we used grid function notation etc. The sum of errors for all fields is denoted by
[TABLE]
where (depending on the choice of norm). Let and denote the convergence rates in the and norms, respectively. In (37), the contravariant components of the manufactured solution are obtained by the formulas
[TABLE]
where and are the Cartesian basis vectors. In all numerical experiments, we use staggered SBP interpolation and differentiation operators having fourth order interior accuracy and second order boundary accuracy. To construct the metrics in the scheme, we use the same staggered SBP interpolation and differentiation operators for discretizing the covariant basis vectors and , Jacobian . The discretized contravariant basis vectors and are obtained from (2).
6.1 Comparison of metric tensors
As discussed in section 5, the discretization of the contravariant metric tensor in (26) results in a provably stable scheme. However, as we proceed to show, the modified discretization in (28) gives better accuracy.
For this test, we use linear transfinite interpolation [35] to define a mapping by specifying the following parameterization of the four boundary segments
[TABLE]
where , , .
Table 1 lists the errors and convergence rates for the energy positivity preserving discretization of in (26) and the modified in (28). In most cases, the error is smaller for the scheme using compared to . Note that the convergence rates for the velocity components on the finer grids seem to drop to order in .
6.2 Characteristic boundary error
In this section, we continue analyzing the error from the experiment in Section 6.1 with the modified metric tensor discretization (28). In particular, we observed that the convergence rate dropped to order in the norm on the finer grids. This convergence rate is consistent with the truncation error analysis using the energy method, see [36], and generalizes for higher order operators as where is the order of the truncation error of the SBP operator near the boundary. According to the general theory for SBP finite difference approximations of first order hyperbolic problems [7], the convergence rate is in many cases one order higher than the order of the truncation error at the boundary, measured in the norm. However, as is pointed out in [27], the general theory assumes a non-characteristic boundary. Since the acoustic wave equation contains zero-speed characteristic variables, the general theory does not apply.
In order to examine the error in more detail, we symmetrize and diagonalize the acoustic wave equation with respect to the direction normal to the boundary, see Appendix B. For the bottom boundary, we obtain the characteristic variables
[TABLE]
where . These variables correspond to the eigenvalues
[TABLE]
The characteristic variable corresponds to the positive eigenvalue and is ”incoming”, meaning that it propagates into the domain, whereas corresponds to the negative eigenvalue and is ”outgoing”, implying that it propagates out of the domain. However, the eigenvalue corresponding to the variable is zero, making it boundary characteristic, meaning that it does not propagate in the direction normal to the boundary. It is the presence of the boundary characteristic variable that violates the assumptions of the general theory [7].
To examine the error in the characteristic variables, we focus on a cross-section that starts in the middle of the bottom boundary () and extends into the domain, i.e., . We use the SBP interpolation operators to compute the incoming and outgoing characteristic variables at the cell-centers. Note that in (42), only the boundary characteristic variable depends on . For simplicity, we therefore define
[TABLE]
as the norm of the error in the characteristic and non-characteristic boundary variables, respectively.
Figure 6 shows the absolute value of the solution error at these grid points for the two finest grids in Table 1. Note that the solution error at the first four grid points is much larger than the error at the interior grid points. These four grid points correspond to the region in which the SBP operators have a second order accurate truncation error. Table 2 lists the errors in the norm and norm measured at these grid points for each grid. The convergence rates of the non-characteristic variables show close to third order convergence in , which is consistent with the standard theory [7]. The convergence rate of the boundary characteristic variable is reduced compared to the non-characteristic boundary variables. This drop in the convergence rate can also be seen in Figure 6.
6.3 Rotational invariance
A desirable property of the numerical scheme is that its accuracy and stability should not depend on the orientation of the coordinate system. Since we have chosen to decompose the velocity field with respect to the covariant basis, the discretization is local with respect to the orientation of the curved grid lines, and therefore rotationally invariant. If we instead the decompose the velocity field with respect to the Cartesian basis, the discretization does not preserve rotational invariance. In this section we compare the accuracy of these two approaches.
When the velocity is decomposed with respect to the Cartesian basis, the metric tensor that transforms from Cartesian components to contravariant components is defined by
[TABLE]
This transformation is explicitly given by
[TABLE]
When a grid is rotated with respect to the Cartesian basis vectors such that the vector pairs and become orthogonal, the diagonal entries in vanish and only off-diagonal entries remain. These off-diagonal entries must be treated using interpolation. It is therefore to be expected that the Cartesian formulation will suffer from accuracy degradation for such grids.
Before proceeding to the numerical experiment, we give some more details. When transformed to the Cartesian basis, the governing equations become
[TABLE]
The semi-discrete approximation (excluding SAT penalty terms) becomes
[TABLE]
When discretizing the block matrix in (46), it is necessary to use interpolation operators for the off-diagonal entries,
[TABLE]
where the diagonal matrix is obtained by discretizing entry in on the edge- grid. Here, the interpolation operators are and .
When the velocity field is decomposed with respect to the Cartesian basis, the mixed terms that arise in the acoustic wave equation depend on the angle between the contravariant basis and Cartesian basis vectors. Since the mixed terms must be discretized by a combination of interpolation and differentiation operators, the resulting operators become wide. These operators may be less accurate than the staggered difference operators used for the diagonal terms.
To test how the accuracy depends on these angles, we use the manufactured solution (37) for the following disc geometry with a cavity,
[TABLE]
where the radial coordinate is stretched using linear interpolation from the inner radius to the outer radius by the function
[TABLE]
The stretching parameter is taken to be ( is the number of cells in the angular, , direction). The inner and outer radii are set to and . Periodic boundary conditions are used in the angular direction and an offset is used to avoid aligning the periodic boundary with any of the Cartesian axes.
On the coarsest grid we use grid cells in the radial direction and grid cells in the angular direction. Finer grids are obtained by a factor of two grid refinement at each level. The solution is advanced in time until using the time step . The results in Table 3 show that the scheme using the covariant representation of the velocity field is always more accurate compared to the Cartesian basis decomposition.
6.4 Point source on the boundary
In computational acoustics, point sources are frequently used to model explosions. Spurious oscillation can arise when source terms are introduced in schemes discretized by central finite differences. The triggering of spurious oscillations can be avoided by using Cartesian staggered grids, or by smoothing out the source discretization by imposing smoothness conditions, see [24]. However, there is no guarantee that spurious oscillations are avoided in our curvilinear staggered scheme.
The point source we consider is placed on the boundary by enforcing the pressure boundary condition
[TABLE]
In the above, is the Dirac distribution, centered at the source location , and is a given source time function. For a detailed discussion on how to discretize the Dirac distribution for hyperbolic problems, see [24]. To place the source on the boundary, we treat (48) as a boundary condition and impose it using a SAT term, see [22] for details.
In this test, only the top boundary is curved, and its shape is given by the Gaussian hill,
[TABLE]
where . A 1-D coordinate stretching is defined to generate the mapping. The source is placed on the Gaussian hill at the location in parameter space, or in physical space, see Figure 7. The source time function is a Ricker wavelet, i.e.,
[TABLE]
where the time delay is , to prevent an abrupt startup. We define the minimum wavelength that must be resolved as , where is the minimum wave speed (here set to 1 due to solving the acoustic wave equation in dimensionless form) and . This estimate corresponds to the frequency where the Ricker wavelet reaches of the peak amplitude in the frequency domain.
Since we do not have an analytic solution for this test, we compare the numerical solutions against a reference solution that has been computed on a very fine mesh. When estimating convergence rates, we take into account that the reference solution itself contains an error. The resolution of the reference solution is grid points, which corresponds to grid points per shortest wavelength. The error is defined as the difference between the reference solution and a numerical solution measured in time at the interior receiver location , corresponding to . Since this point does not align with a grid point for each field, we use cubic interpolation of the neighboring values to estimate the solution.
We advance the solution in time using the time step (for the coarsest grid) until the final time . Figure 7 shows that there are no visible artifacts from placing a point source on the boundary when discretizing using the modified metric tensor (28). On the other hand, the provably stable metric tensor discretization (26) causes spurious oscillations. For the same simulation, we also show the pressure as function of time at the receiver location and the estimated error (Figure 8). The initial oscillations correspond to the direct arrival of the pressure wave from the source; oscillations at later times are due to reflections against the non-planar boundary.
To investigate the error in more detail, let denote the error in pressure measured in the norm over time at the fixed point , and let the two velocity components be defined in a similar manner. Table 4 lists the relative error and convergence rates for both pressure and velocity as well as an estimate of the number of grid points per shortest wavelength to obtain the desired error. We note that fourth order convergence rates are obtained for all components. In this case, we see no indication that the error due to the characteristic boundary variable has polluted the solution at this interior location.
6.5 Computational Efficiency
After having established that the staggered scheme with the modified metric tensor is capable of handling point sources on the boundary, we now investigate its computational performance and compare it to a collocated finite difference method. This test case is quite similar to the previous test, and can be reproduced by using the code found in the repository github.com/ooreilly/sbp/.
In the collocated scheme the governing equations are discretized using the classical fourth order SBP operators derived by B. Strand in [32]. One can convert the staggered scheme into a collocated scheme by replacing the interpolation operators with identity matrices and the derivatives with Strand’s SBP operators.
The primary difference in terms of computational work between the collocated and staggered scheme stems from the use of interpolation. In the interior of the staggered scheme, the use of interpolation operators in the velocity equations introduces two stencils with points, whereas the remaining terms involve only four stencils with points each. In contrast, the entire collocated scheme consists of only six stencils with 4 points each. Despite these large differences in computational work, the staggered scheme can outperform the collocated scheme when running on modern hardware.
The performance of each scheme can be highly dependent on the implementation. For prototyping purposes, it can be quite convenient to implement the schemes as sparse matrix and dense vector products. In this way, the implementation looks similar to the discretizations presented in Section 3. Unfortunately, this approach results in excessive computational overhead due explicitly storing the large sparse matrix that holds the spatial discretization. Instead, significant performance improvements can be achieved if the implementation is matrix-free, or stencil-based.
We measure the performance of the collocated and staggered scheme implemented in a stencil-based manner. Both these compute kernels are executed on a Nvidia Geforce RTX 2080 Ti card in single precision. In our timings, we only investigate the performance of the interior computation (in most practical cases, the boundary only consitutes a small fraction of the total cost). No particular effort has been invested into optimizing the kernels performance. Both kernels are memory bound, achieving of peak memory bandwidth (staggered) and of peak memory bandwidth (collocated). Compute utilization of the GPU streaming multiprocessors (SM)s reaches (staggered) and (collocated). This performance analysis was conducted using a grid size of 1024 x 512 grid points.
The solution is advanced in time using the same settings as before. Before the final time is reached, acoustic waves have reflected against the exterior boundaries and these reflections have reached the receiver location. As can be seen in Figure 9, the staggered scheme outperforms the collocated scheme on all grids tested, and its performance improves as the error levels decrease. On the finest grids, the difference in relative error approaches an order of magnitude.
7 Conclusions
We have shown how to construct a provably stable high order accurate finite difference approximation of the acoustic wave equation in covariant form on general curvilinear staggered grids. To obtain an energy conserving scheme, the discretization uses SBP interpolation and differentiation operators and imposes the boundary conditions weakly. After transforming the acoustic wave equation to curvilinear coordinates, the covariant metric tensor emerges in the kinetic energy. To make the scheme stable, the discretized kinetic energy must form a discrete norm of the dependent variables. The weights in the norm are represented by a symmetric matrix that depends on the discretization of the metric tensor. Stability follows if this matrix is positive definite. We offer two alternative ways of making this matrix positive definite. The first option uses interpolation of both the diagonal and off-diagonal terms in the metric tensor. While this approach leads to a stable scheme for all non singular meshes, it results in a slight degradation in accuracy and is more computationally expensive compared to our second alternative. In that approach, a modified discretization of the metric tensor is derived where only the off-diagonal elements are interpolated. Here, positive definiteness of the norm matrix depends on the mesh quality. Estimates are theoretically derived to efficiently determine if the discretization is stable for a given mesh. Numerical experiments illustrate the benefits of using interpolation operators with norms close to one and demonstrate the accuracy and stability of the proposed methodology.
While this work has focused on the acoustic wave equation in covariant form, future extensions to Maxwell’s equations or the elastic wave equation should also be possible. However, these extensions might be non-trivial and warrant further investigations. For Maxwell’s equations one must contend with the discretization of the curl operator in a stable and consistent manner. Some additional difficulties with solving the elastic wave equation in covariant form are the emergence of Christoffel symbols, and transformation of the stress tensor from covariant to contravariant form.
Acknowledgment
We would like to thank Dr. Martin Almquist for many fruitful discussions during the initial developments of this work, as well as his insightful comments and feedback on an early version of this manuscript.
This research was supported by the Southern California Earthquake Center (Contribution No. 9223), with contributions from NSF Cooperative Agreements EAR-1600087, USGS Cooperative Agreement G17AC00047, NSF-ACI Award 1450451, and Pacific Gas and Electric.
This work performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. This is contribution LLNL-JRNL-780017.
Appendix A Weakly imposed pressure boundary condition
Here, we demonstrate how to weakly impose the homogeneous pressure boundary condition method in the covariant formulation of our scheme. To simplify the analysis, we will only consider the left boundary (the other boundaries are treated in a analogous manner).
When the grid is not periodic, the SBP property (17) applied to the right-hand side of the energy rate (25) leads to
[TABLE]
where contains the values of the Jacobian along the edge-1 grid on left boundary, and the contributions from the other boundaries have been neglected. Unless a boundary condition is specified, the energy rate is indefinite. For simplicity, we impose the homogeneous boundary condition using the Simultaneous Approximation Term (SAT) penalty method.
Consider the velocity equations (19), augmented with a SAT penalty term on the right-hand side,
[TABLE]
The penalty vector restricts the pressure field to the left boundary, and can be written as
[TABLE]
where the matrix is defined such that , and is the boundary data. Since we focus on homogeneous boundary conditions, we set . When computing the energy rate including the penalty vector in (49), we find
[TABLE]
By repeating the same procedure for the remaining boundaries, the energy of the semi-discrete approximation is conserved.
Appendix B Symmetrization and diagonalization of the governing equations
We show that the 2D acoustic wave equation in covariant form (7)-(8) can be written as a symmetric hyperbolic system. Recall the governing equations,
[TABLE]
Multiplying (51) by the covariant metric tensor gives the system
[TABLE]
This system can be written in matrix form as
[TABLE]
where
[TABLE]
The matrices and are symmetric and is positive definite. Therefore, (52) is a symmetric hyperbolic system. The energy in the system is given by
[TABLE]
and is the same as the energy (10).
Next, we compute the characteristic variables for (52) with respect to the direction normal to the boundary. First, we apply a transform to remove in front of the time derivative term in (52). Note that since is positive definite, it can be factorized into using the Cholesky factorization. The matrix is the unique lower triangular matrix given by
[TABLE]
where ( is positive since the metric tensor is positive definite). By inserting , and , equation (52) is transformed to
[TABLE]
We introduce the definitions,
[TABLE]
where
[TABLE]
Then (55) becomes,
[TABLE]
By applying the product rule, we find
[TABLE]
To investigate boundary errors near the bottom boundary , where the normal is , we consider . Since is symmetric, it has the eigendecomposition , where is an orthonormal eigenvector basis, and is a diagonal matrix. This eigendecomposition is given by
[TABLE]
Finally, in the direction , the characteristic properties of (56) can be studied by the model problem,
[TABLE]
Because is constant, we can change variables to , which leads to the diagonal system
[TABLE]
The characteristic variables are
[TABLE]
Appendix C Solving the generalized eigenvalue problems for
The conditions for the matrix to be positive definite relies on the solution of two generalized eigenvalue problems (34) and (35), see Lemma 3. In this section we use Kronecker product identities to show how the eigenvalues of the generalized eigenvalue problems can be calculated by instead solving a number of decoupled 1-D eigenvalue problems.
Due to the ordering of the 2-D dependent variables and SBP operators, we can directly use Kronecker product identities to analyze the generalized eigenvalue problem (35). The analysis of (34) follows in a corresponding way after the dependent variables and SBP operators have been permuted.
For all matrices , , and where the sizes are such that the products and are well-defined, it is well-known that . Furthermore, for all matrices and , we have .
We proceed by analyzing the generalized eigenvalue problem (35). To simplify the notation in this section we drop the superscripts on the matrices and . Because the matrix is positive definite, the generalized eigenvalue problem
[TABLE]
has the same eigenvalues as
[TABLE]
and the eigenvectors are related by .
From the definitions of the 2-D SBP operators in Section 3.1,
[TABLE]
Denote the components of the norm weight matrix by . Furthermore, let the diagonal matrices and have the blocked matrix representations,
[TABLE]
In this case, is a diagonal matrix and is a diagonal matrix. They hold the values of the corresponding metric coefficients along a nodal or a cell-centered grid line in the -direction, with (cf. (12) for a definition of ).
From the definition of a Kronecker product,
[TABLE]
Therefore,
[TABLE]
In a similar way,
[TABLE]
and the above blocked representation of gives
[TABLE]
Note that is a positive definite diagonal matrix.
Because of the diagonal blocked structure of the matrices and , the eigenvalue problem (57) reduces to decoupled eigenvalue problems
[TABLE]
where,
[TABLE]
Note that and commute because they are both diagonal. To summarize, we have shown that the eigenvalues of the 2-D generalized eigenvalue problem (35) can be calculated by solving decoupled 1-D eigenvalue problems (58).
In a similar fashion, calculating the eigenvalues of the generalized eigenvalue problem (35) reduces to decoupled eigenvalue problems
[TABLE]
where,
[TABLE]
In this case, the diagonal matrices and are the blocks of the diagonal matrices
[TABLE]
Here, and hold the values of the corresponding metric coefficients along a nodal or cell-centered grid line in the -direction with .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] M. H. Carpenter, D. Gottlieb, S. Arbabanel, and W.-S. Don. The theoretical accuracy of Runge-Kutta time discretizations for the initial boundary value problem: A study of the boundary error. SIAM J. Sci. Comput. , 16:1241–1252, 1995.
- 2[2] Josep de la Puente, Miguel Ferrer, Mauricio Hanzich, José E Castillo, and José M Cela. Mimetic seismic wave modeling including topography on deformed staggered grids. Geophysics , 79(3):T 125–T 141, 2014.
- 3[3] Longfei Gao, David C Del Rey Fernández, Mark Carpenter, and David Keyes. Sbp–sat finite difference discretization of acoustic wave equations on staggered block-wise uniform grids. Journal of Computational and Applied Mathematics , 348:421–444, 2019.
- 4[4] Longfei Gao and David Keyes. Combining finite element and finite difference methods for isotropic elastic wave simulations in an energy-conserving manner. Journal of Computational Physics , 378:665–685, 2019.
- 5[5] Gregor J Gassner. A skew-symmetric discontinuous galerkin spectral element discretization and its relation to sbp-sat finite difference methods. SIAM Journal on Scientific Computing , 35(3):A 1233–A 1253, 2013.
- 6[6] Pavel Grinfeld. Introduction to tensor analysis and the calculus of moving surfaces . Springer, 2013.
- 7[7] B. Gustafsson. The convergence rate for difference approximations to mixed initial boundary value problems. Math. Comput. , 29(130):396–406, 1975.
- 8[8] Stig Hestholm. Elastic wave modeling with free surfaces: Stability of long simulations. GEOPHYSICS , 68(1):314–321, 2003.
