#### 2.1. General Grids

Within an enclosure, the dynamics of an acoustic field is governed by the following two basic equations [

23].

Here,

$P$ and

$u$ are the pressure and particle velocity, respectively; both are functions of time and a spatial coordinate. The physical constants

$\rho $ and

$c$ are the air density and wave speed in air, respectively,

$\nabla $ and

$\nabla \u2022$ are the three-dimensional gradient and divergence operations. The differential wave equation (Equation (3)) may be derived by inserting Equation (2) into Equation (1) and eliminating the particle velocity.

where

${\nabla}^{2}=\frac{{\partial}^{2}}{\partial {x}^{2}}+\frac{{\partial}^{2}}{\partial {y}^{2}}+\frac{{\partial}^{2}}{\partial {z}^{2}}$ is the Laplacian operator in 3D sound spaces. Then, the wave equation in a 3D sound space can be described by the time domain formulation in Equation (4)

By applying the center differential method in Equation (4), and letting

$\Delta x=\Delta y=\Delta z=\Delta l$, the discretion of Equation (4) yields Equation (5).

where

$\chi =c\Delta t/\Delta l$ represents the Courant number, and n is a discretized time step. In general,

$\chi \le 1/\sqrt{3}$ for a three-dimensional sound space. Equation (5) indicates that three multiplications, six additions, and one subtraction are needed to calculate sound pressure of a grid. When it is implemented by hardware, at least two multipliers, six adders, and one subtractor are required. In order to reduce the multiplication operations, which need more clock cycles and hardware resources,

$\chi $ is assumed to be

$1/2$, and Equation (5) is rewritten as [

18]

In Equation (6), multipliers are replaced by right and left shifters in hardware to save hardware resources and improve system timing performance. In principle, Equation (6) is a seven-point stencil wave equation in which to calculate sound pressure of a grid needs the sound pressures of its six neighbors at previous time step.

#### 2.2. Boundary Condition

A reflective boundary can be modeled as a locally reacting surface by assuming that a wave does not propagate along with the boundary surface, and the acoustical behavior is affected by the sound pressure and particle velocity perpendicular to the boundary surface. If a sound wave travels in a positive axis

$(x,y,z)$ direction, the boundary impedance

$Z$ is represented by the sound pressure and the particle vibration through Equation (7) [

23,

24].

Here,

$U$ is the particle velocity component perpendicular to the boundary. Differentiating both sides of Equation (7) and substituting

$U$ by the momentum conservation equation of wave propagation, the boundary conditions are obtained in terms of sound pressure [

25].

where

$\xi =Z/\rho c$ is the normalized boundary impedance. For a rectangular sound space, boundary grids are classified into interior grids of a boundary, edges, and corners according to their position. Different formulas are applied to update sound pressures of different types of boundary grids because their conditions are different. For example, for the interior grids of right boundary, Equation (9) is derived by applying the centered finite difference method on Equation (8) and assuming the normalized boundary impedances of all boundaries are

$\xi $.

By rearranging the terms in Equation (9) and introducing the parameter

$\chi $, Equation (10) is derived to express a virtual point

${P}_{}^{n}(i+1,j,k)$, which lies outside of the sound space [

25].

Substituting the related items in Equation (5) by Equation (10), then

If the reflection factor

$R$ is defined as

$(\xi -1)/(\xi +1)$ and

$\chi $ is assumed to be

$1/2$, Equation (11) is changed to

Equation (12) consists of two parts, one is the sum associated with the sound pressures of a grid and its neighbor grids at the time step $n$, and another corresponds to the sound pressure of a grid at the time step $n-1$. Compared with Equation (6), except the multiplicands, Equation (12) only replaces the sound pressure of the virtual grid ${P}_{}^{n}(i+1,j,k)$ by the sound pressure of the neighbor grid ${P}_{}^{n}(i-1,j,k)$ in the sum part. Moreover, for the interior grids on other boundaries, the multiplicands of two parts are the same while just substituting the sound pressure of the virtual grid by the sound pressure of the related neighbor grid in the summation. For example, when a grid is on the interior of the left boundary, the updated equation is achieved through substituting the sound pressure of the virtual grid ${P}_{}^{n}(i-1,j,k)$ with the sound pressure of the neighbor grid ${P}_{}^{n}(i+1,j,k)$ in Equation (12). The sum part is, therefore, changed from $(2{P}_{}^{n}(i-1,j,k)+{P}_{}^{n}(i,j+1,k)+{P}_{}^{n}(i,j-1,k)+{P}_{}^{n}(i,j,k+1)+{P}_{}^{n}(i,j,k-1)+2{P}_{}^{n}(i,j,k))$ to $(2{P}_{}^{n}(i+1,j,k)+{P}_{}^{n}(i,j+1,k)+{P}_{}^{n}(i,j-1,k)+{P}_{}^{n}(i,j,k+1)+{P}_{}^{n}(i,j,k-1)+2{P}_{}^{n}(i,j,k))$. The similar derivation procedure can be applied to edges and corners by using different boundary conditions. For example, when grids are on edges, which are intersections of two boundary planes, two boundary conditions are satisfied simultaneously. Expressions for two virtual points are consequently required to be derived.

Equations (6) and (12) indicate that the sound pressures of grids are calculated by the sound pressure of their neighbors at previous time steps, and no data dependency exists during computation. Hence, the equation may be implemented through pipelining to improve performance in hardware. We observe that Equations (6) and (12) consist of the sum of the sound pressures of a grid and its neighbors at the time step

$n$, and the sound pressure of a grid at the time step

$n-1$. For different types of grids, the updated equations have similar formats except for the multiplicands for the sum and

${P}_{}^{n-1}(i,j,k)$. Thus, a uniform updated Equation (13) can be derived.

The D1 and D2 are shown in

Table 1. It is worth noting that the part of summing in Equation (13) is changed according to grid positions. For grids on boundaries, the sound pressures of the virtual grids are replaced by those of the related neighbor grids.