Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
акустика / bergman_dr_computational_acoustics_theory_and_implementation.pdf
Скачиваний:
163
Добавлен:
04.05.2023
Размер:
2.74 Mб
Скачать

The determinant in the expression is just the total volume of the hyper-parallelepiped with edges L j. The entries in the inverse matrix are cofactors Cij, developed by taking the determinant of the original matrix with the ith row and jth column removed. In lower dimensions these are the components of the lower-dimensional hypersurface areas. In three dimensions this is explicit, that is, the components of the inverse are row by row, the cross products of the edges.

10.5Expressing the Helmholtz Equation in the FEM Basis

This section applies the FEM paradigm with the Galerkin approach to the generalized Helmholtz equation. Attention is focused on defining the terms that will contribute to the matrix form of the equation. To illustrate the application of the method in general terms, it will be applied to the form of the wave equation in Chapter 3 with the right-hand side ignored. A generic source term is included. The pressure field is assumed to be the only relevant variable. It is also assumed that the background fields do not contain any time dependence. This can be considered an approximation for small values of fluid motion. The wave operator is presented here for convenience:

1

 

 

+ υ 0 p

υ 0

 

+ υ 0 p +

1

p

(10.65)

 

 

 

c2ρ

 

ρ

 

 

c2ρ t t

 

t

0

 

 

0

 

 

 

 

 

0

 

 

 

 

 

Assuming a time-independent environment and passing to the frequency domain via p = ux expiωt,

ω2

 

υ 0 u

+

 

υ 0u

 

υ 0

u 1

u

 

 

 

u + iω

 

 

 

 

iω

 

 

υ 0

 

 

 

+

 

(10.66)

2

ρ

2

ρ

 

 

2

ρ

2

ρ

 

ρ

c

 

c

0

 

 

 

c

 

c

0

 

 

 

 

0

 

 

 

 

 

 

 

0

 

 

 

 

0

 

 

Equation (10.66) is the second-order term in the wave equation derived in Chapter 3 in the frequency domain. In this representation, the coefficients are complex quantities, and the unknown field u is also represented as a complex quantity¸ u = uR + iuI . Equation (10.66) is linear and from this, equations for uR and uI are derived by separating the real and imaginary parts. The real and imaginary parts of (10.66) are provided separately in the following equations with terms grouped together according to independent field:

 

ω2uR

 

υ 0 υ 0

uR

uR

+ ω

υ 0

uI

+

 

υ 0uI

 

 

(10.67)

 

 

 

c2ρ

 

 

 

ρ

 

 

c2

ρ

 

c2ρ

 

 

 

 

 

c2ρ

0

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

ω

 

υ 0 uR

+

 

υ 0uR

 

+

ω2uI

υ 0 υ 0

 

uI

 

uI

(10.68)

2

ρ

2

ρ

 

2

ρ

 

 

2

ρ

 

 

 

 

ρ

 

 

 

 

 

c

 

 

c

 

 

c

0

 

 

 

c

0

 

 

 

 

 

0

 

 

 

 

 

 

0

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The real and imaginary parts are coupled. In the pair of equations, there are two distinct operators:

ω

υ 0 φ

+

υ 0φ

 

 

(10.69)

 

 

c2ρ

 

 

 

c2ρ

 

 

 

 

ω2φ

 

υ 0 υ 0 φ

φ

(10.70)

c2ρ

 

 

c2ρ

ρ

 

 

 

 

 

 

 

The Galerkin method is illustrated by application to these operators using linear basis elements. The following results ignore the boundary function φx introduced in (10.2). Neglecting the boundary function can be thought of as imposing Dirichlet boundary conditions. The reader can tackle the inclusion of this term as an exercise. The same set of basis functions is used to express both fields (uR, uI), but different coefficients will result for each. The single equation in a complex field is now expressed as an equation for a 2-dim vector field. The divergence in each operator is removed by integration by parts, leading to the following results for each:

 

 

 

ω

υ 0

β mbn bm β n

dTn

 

 

(10.71)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

c2ρ

 

 

 

 

 

 

 

 

 

 

 

 

 

ω

2

bnbm

dTn β n

β m

1

dTn +

υ 0

β n

υ 0 β m

dTn

(10.72)

 

 

 

 

 

 

 

 

 

 

 

c2ρ

ρ

 

c2

ρ

 

 

 

 

 

 

 

 

The integration region is indexed to match the projection into the specific basis element. However, the basis elements, n and m, must share a common triangle for a nontrivial result so this can be ignored. The different index values refer to the distinct basis element containing the primary cell and hence refer to different vertices of the cell and different direction vectors β . The contribution from (10.71) vanishes for self-coupling since n = m. This term is nonzero when evaluated for n m. Evaluating these matrix elements will be the primary focus of the remaining part of this chapter. These results can be specialized for the case of no background flow υ 0 = 0. In this case the imaginary term in (10.66) is not present, and

the unknown field can be represented by a real function with a single operator:

 

 

2 bnbm

 

 

1

(10.73)

ω

 

 

dTn β n

β m

 

 

dTn

 

c2ρ

ρ

In general, these operators will not be diagonal due to the overlap of basis elements by individual triangles or tetrahedra, but they will be sparse since basis elements must share at least one patch to yield a nontrivial result.

Because basis elements overlap, they will be coupled to each other. The rooftop basis functions will couple the nearest neighbors. Consider a single point in the mesh. The boundary

points of this basis define the other basis functions that couple to this one. This will always be a finite number much smaller than the total number of points but will not be the same for every mesh. This can be verified by inspection of Figure 10.4. If a regular lattice is chosen, then the number of couplings can be the same for all interior points. In 1-dim there can only be two overlaps for every interior basis, for example, basis n will couple to n + 1 and n1. Including self-coupling gives a total of three entries for each row of B corresponding to an interior point. In 2-dim and 3-dim different meshes will produce different size rows. For example, in Figure 10.2 each interior point, not near the boundary, couples to six other basis elements. Interior points near the boundary will have fewer couplings. Inspection of Figure 10.4 shows that in this case some interior elements are coupled to as few as four neighbors and some to six. Despite irregularity, it is fairly straightforward to identify these couplings and keep track of them. It is useful to consider the number of basis elements that share a particular triangle, or tetrahedron. Since each point is a basis and a triangle (tetrahedron) has only three (four) points, this must be the number of elements that share that triangle (tetrahedron). One can evaluate the contributions to the operator matrix elements on a per triangle basis (different use of the word) and store these values. Evaluating the complete coupling amounts to picking and summing the correct precalculated values. The boundary conditions are already taken care of with the boundary function. A take-away is that the FEM matrix will be sparse but not necessary tri-diagonal.

10.6Numerical Integration over Triangular and Tetrahedral Domains

The remaining ingredient for completing the operator matrix elements is numerical integration over the basis elements. In the application of the Galerkin method, the original PDE was projectedonto the same set of functions used to expand the unknown field. The integral over the basis element is a sum of integrals over the triangles in the basis element. Due to the nature of the basis element, this projection will yield a nontrivial result only when the two basis elements in the integrand share common triangles, that is, when the two basis elements overlap:

bn L bm =

bnL bm dT

(10.74)

T I

T

 

In (10.74) T is a triangle, dT is a differential area element on the triangle, and the notation T I means sum over all triangles in the intersection of the two basis elements. For the source term the sum will be over all triangles in the basis bn. The good news is that these integrals are not likely to be poorly behaved. Despite this they are also not likely to be known in closed form in terms of ordinary, or special, functions. A numerical integration technique is needed for evaluating these integrals. Following the theme of this chapter, numerical integration will be introduced for 1-dim intervals. The generalization to integration over rectangular domains in 2-dim and 3-dim is immediate, but for integration over triangular and tetrahedral domains, some additional steps will be needed. The 1-dim treatment will not be comprehensive, defaulting to Gaussian quadrature. This will serve as the foundation to developing higher-dimensional integration, with the exception of a special technique for integration over triangles introduced by Dunavant.

10.6.1 Gaussian Quadrature

Gaussian quadrature is introduced here as a foundation for building up integration over triangular and tetrahedral domains. For a complete introduction to numerical integration, the reader is

referred to Ref. [2]. Classic numerical integration methods use evenly spaced samples of points on the interval [a, b], {xj}. Various methods of approximating the integral to a desired order lead to a choice of weighting factors {wj}, associated with each point. The integral of the function f(x), over the interval [a, b], is then approximated by

b

N

 

f x dx =

wj f xj

(10.75)

a

j = 1

 

Depending on the number of sample points taken, the approximation (10.75) will be exact for polynomials up to some order N. It often happens that one encounters integrands with an integrable singularity, expressed as W(x):

b

W x f x dx

(10.76)

a

Gaussian quadrature provides a procedure for choosing not only the weights but also the sample points {xj} using a set of orthogonal polynomial functions, Pn(x) with n = 0,1 2,, on (a, b). Rather than equally sampling the interval, the quadrature method takes these points to be the roots of an Nth-order polynomial from the set to construct an order integration scheme. Using an Nth-order polynomial yields an integration scheme that is exact for polynomials of degree less than or equal to 2N 1. Once the roots of the polynomial {xj} are found to a desired accuracy, the weights are given by

wj =

PN 1

PN 1

(10.77)

PN 1 xj

PN xj

 

 

The numerator in (10.77) is defined by the following:

b

 

PN 1 PN 1 = W x PN2 1 x dx

(10.78)

a

 

And in the denominator PN = dPNdx. The weights can be chosen to incorporate the function W(x).

10.6.2 Integration over Triangular Domains

In this section two standard approaches for numerical integration over triangles are presented. Consider numerical integration on a two-dimensional rectangular region, R =

x,yxa, yb:

b a

I =

dy

dxf x,y

(10.79)

b a

A 2-dim quadrature routine for (10.79) can be built from two sets of sample points and

weights for the x and y coordinates be xn,wnx , n = 1, , N, and ym,wmy , m = 1, , M, respectively. The value of the integral can be approximated by the following combination of two 1-dim integrations:

N

M

wnxwmy fnm

 

I

 

(10.80)

n = 1 m =

1

 

The function values at the sample points are denoted as fnm. Defining a single index for the points on the 2-dim grid, J(n, m), j = 1, , NM, and new weights, Wj = wnwm, (10.80) is written as a single sum:

J

 

I Wjfj

(10.81)

j = 1

Integrating over triangles is a little trickier. One technique is to map the triangle into a square and then perform the integration over the square (see Hussain et al. [3]). This is accomplished by mapping the triangle to an isosceles right triangle with unit length legs along the x and y axes, followed by a mapping of this triangle into a square region. Let the vertices of the triangle be given by the vectors V k, k = 1,2 3. A set of parameters ξi, called simplex coordinates, is defined. An arbitrary point in the triangle is expressed as a weighted sum of the vertices in these coordinates:

x ξ = ξ1V 1 + ξ2V 2 + ξ3V 3

(10.82)

Each parameter is constrained: 0 ξi 1, and ξ1 + ξ2 + ξ3 = 1. In this space all triangles are equilateral triangles with vertices, V i, at ξi = 1. The constraint can be used to eliminate a degree of freedom. For example, solving for ξ1, ξ1 = 1ξ2 ξ3, gives the following:

x ξ = V 1 + ξ2 V 2 V 1 + ξ3 V 3 V 1

(10.83)

From Figure 10.8 it is clear that this is a projection of the equilateral triangle onto the ξ2, ξ3 plane with the vertex V 1 mapped to the origin. In this representation, the standard triangle is

 

 

t

 

η

 

r

 

 

1

 

 

 

 

 

2

1

 

 

 

 

 

 

 

 

 

–1

ζ

 

 

 

1

 

 

 

s

–1

r

r

0

 

1

 

1

3

 

 

 

Figure 10.8 Mapping of a generic triangle (left) into the standard triangle (center) and to a square (right)

an isosceles right triangle. The procedure can be done for any pair of the three parameters. Without loss of generality, the original triangle is mapped into the x, y plane, and (10.83) maps this into the ξ2, ξ3 plane. A new set of parameters is defined, (s, t), to represent the two independent simplex coordinates. To express the integral in (s, t) space, the Jacobian of the coordinate transform x,ys,t is needed. It is straightforward to show that this transform gives

V 2 V 1 × V 3 V 1 = 2A

(10.84)

In (10.84) A is the area of the triangle. The next step is to define a map from a square to this right triangle. The square region is described by a new set of parameters (ζ, η),

ζ,ηζ, η1. These parameter transformations are illustrated in Figure 10.8. The simplex coordinates (s, t) are functions of these new parameters, (ζ, η):

 

s =

1 + ζ

 

(10.85)

 

 

 

 

2

 

 

t =

1ζ

1 + η

(10.86)

 

2

2

 

 

Along with the Jacobian for this transformation

J =

1ζ

(10.87)

 

8

 

the integration over a triangle is transformed as follows:

 

1

1s

 

1

1

 

I =

f x,y dxdy = 2A

 

s,t dtds = 2A

dη

dζJ ζ f ζ,η

(10.88)

T

0

0

 

1

1

 

It is understood that the function dependence in each new coordinate comes about

through the coordinate functions:

 

 

 

f

s,t = f

x s,t ,y s,t

(10.89)

f ζ,η = f x

s ζ,η ,t

ζ,η ,y s ζ,η ,t ζ,η

(10.90)

In this form 1-dim quadrature can be applied to each of the parameters (ζ, η):

 

 

 

NM

 

 

I = 2A

WjJjfj

(10.91)

 

 

j = 1

 

It is sometimes customary to absorb the Jacobian into the definition of the weight Wj WjJj. Better still developing a set of quadrature points and weights that incorporates the Jacobian

should lead to better precision and less processing time when used in numerical integration routines.

This quadrature technique works well but it tends to cluster points in one corner of the triangle, creating an asymmetric sampling that oversamples one part of the triangle and undersamples other parts. An alternate quadrature is provided by Dunavant [4]. This approach samples the standard triangle in simplex space in a manner that is symmetric with respect to vertex exchange. The resulting quadrature points and weights provide high fidelity numerical integration with much fewer points than the previous technique requires. The theoretical details regarding the technique are beyond the scope of this text. The interested reader is referred to Ref. [5] for details. The original reference provides tables with quadrature points and weights up to order 20, a complete description of the algorithm, and sample code, for evaluating higher orders. Points occur in groups of either 1, 3, or 6, with each member of the group having the same weight and the coordinates of each related by a permutation. The unique parameter values are presented as rows of a matrix of this text, along with the weights as a column vector. An example is provided as follows for p = 6 in [5]:

0 2492867

0 2492867

0 501427

 

P = 0 0630890

0 0630890

0 8738220

(10.92)

0 3103525

0 6365025

0 0531450

 

 

0 1167863

 

 

w =

0 0508449

 

(10.93)

 

0 0828511

 

 

The results of Dunavant are rounded to seven decimal places. A single row of P is a unique (ξ1, ξ2, ξ3). There are 12 points in all. They are generated by taking all unique permutations of these values. The first two rows each have a repeated value. There are only three unique permutations of these. The last point has three independent values for (ξ1, ξ2, ξ3) and produces a total of six integration points. The weights are ordered to match the rows of P. All points generated by permutation have the same weight as the original point. Figure 10.9 provides an

Figure 10.9 Example of Dunavant quadrature points in simplex space, order = 12

illustration of the Dunavant integration points on the triangle in simplex space for the numerical example given previously.

10.6.3 Integration over Tetrahedral Domains

Points in a tetrahedral region, T, in 3-dim can be described by three independent coordinates [6], four parameters, ξi, with i = 1 2,3 4, 0 ξi 1, and the following constraint equation:

4

 

ξi = 1

(10.94)

i = 1

 

Points in T are written as a weighted sum of the four vertices:

 

x ξ = ξ1V 1 + ξ2V 2 + ξ3V 3 + ξ4V 4

(10.95)

Any tetrahedron can be mapped into a standard tetrahedron with vertices at (0, 0, 0), (1, 0, 0), (0, 1, 0), and (0, 0, 1), and the integral of a function over this standard tetrahedron can be expressed in volume coordinates as follows:

f r d3 r =

1

1ξ1

1ξ1 ξ2

 

dξ1

dξ2

dξ3 Jf ξ1,ξ2,ξ3

(10.96)

T

0

0

0

 

The factor of J in (10.96) is the Jacobian of the transformation from r to (ξ1, ξ2, ξ3). This coordinate transformation is performed by choosing one vertex of the tetrahedron, say, V 1, and writing the position vector as

r = V 1 + V 2 V 1ξ2 + V 3 V 1ξ3 + V 4 V 1ξ4

The difference vectors define edges of the tetrahedron, E i = V i V 1 , with common vertex V 1. Any of the four vertices can be chosen for this. Calculating the Jacobian gives volume of the parallelepiped with edges E i and is equal to or six times the volume of the tetrahedron:

J = E 2 E 3 × E 4

(10.97)

Ignoring the Jacobian factor for now, the integral over the simplex parameters can be transformed into a triple integral over a unit cube by a second change of variables. A new set of parameters is defined, η1,η2,η30 ηi 1. The transformation ξi ηj is defined as follows:

ξ1 = η1η2η3

(10.98)

ξ2 = η1η2 1η3

(10.99)