A High-Efficiency Spectral Method for Two-Dimensional Ocean Acoustic Propagation Calculations

The accuracy and efficiency of sound field calculations highly concern issues of hydroacoustics. Recently, one-dimensional spectral methods have shown high-precision characteristics when solving the sound field but can solve only simplified models of underwater acoustic propagation, thus their application range is small. Therefore, it is necessary to directly calculate the two-dimensional Helmholtz equation of ocean acoustic propagation. Here, we use the Chebyshev–Galerkin and Chebyshev collocation methods to solve the two-dimensional Helmholtz model equation. Then, the Chebyshev collocation method is used to model ocean acoustic propagation because, unlike the Galerkin method, the collocation method does not need stringent boundary conditions. Compared with the mature Kraken program, the Chebyshev collocation method exhibits a higher numerical accuracy. However, the shortcoming of the collocation method is that the computational efficiency cannot satisfy the requirements of real-time applications due to the large number of calculations. Then, we implemented the parallel code of the collocation method, which could effectively improve calculation effectiveness.


Introduction
In recent years, underwater acoustic technology has been widely used to measure ocean characteristics [1], detect underwater targets [2], and implement wireless underwater communication systems [3]. Although the propagation of acoustic waves in the ocean is affected by both seawater and the ocean surface, acoustic waves of a fixed frequency can still be obtained after adding boundary conditions to constrain the elliptic partial differential Helmholtz equation [4]. Recently, our research group used the one-dimensional spectral method to correctly solve the normal modes in underwater sound propagation [5] and atmospheric acoustics [6], demonstrating that the spectral method has the advantages of fast convergence and high accuracy when solving the sound field. However, there are still some problems in this calculation process. For example, the aim of this approach is to solve the simplified parabolic model instead of the original Helmholtz equation, which narrows the scope of application and introduces model error. Currently, many simplified models of the Helmholtz equation have been developed, such as the parabolic equation model, normal mode model, and ray model. Each simplified model has its own applicable conditions; for instance, the parabolic equation model is suitable only for situations in which the physical parameters change slowly with the horizontal distance [7], while the normal mode model is appropriate only for cases in which the physical parameters are constant [8], and the ray model needs to be applied under high-frequency situations [9]. However, actual sound fields are relatively complex; hence, relatively few sound fields meet the constrained requirements of various models, making it difficult to calculate the ocean acoustic propagation through a simplified model. Therefore, it is necessary to develop a of two-dimensional ocean acoustic propagation. Comparing the numerical calculation results of the collocation method with those of Kraken reveals that the calculation accuracy of the collocation method is higher than that of Kraken. Then, we implement a parallel fortran code for solving two-dimensional partial differential equations using the spectral method, which effectively improves the speed of the program, greatly reducing the running time. Therefore, it is feasible to use the collocation method to directly solve two-dimensional ocean acoustic propagation problems. Furthermore, since spectral methods do not utilize simplified models, there are no model restrictions on the application conditions and the model does not introduce approximation errors. Hence, the proposed method has the advantages of a high calculation accuracy, a short computation time, and a wide application range.
The remainder of this paper is composed as follows. In Section 1, we introduce the current situation and the main problems of ocean acoustic field solutions. In Section 2, we apply the Chebyshev-Galerkin and Chebyshev collocation spectral methods to solve the Helmholtz equation, and then implement a parallel code for the method. We apply our spectral methods to the Helmholtz model equation and ocean acoustic program examples to verify the high accuracy and efficiency of the method in Section 3. Section 4 provides a summary of this research and the corresponding prospects of the approach presented herein.

Mathematical Process of Spectral Methods and Optimization of the Calculation Program
In this section, we mainly study how to use the Chebyshev-Galerkin and Chebyshev collocation spectral methods to directly solve the two-dimensional Helmholtz equation with Robin boundary conditions. Then, we use some serial and parallel optimization strategies to accelerate the program due to the large computational cost. The two-dimensional Helmholtz equation can be written as: where u(x, y) is the quantity to be solved and the other variables are known. When solving the above partial differential equations, it is first necessary to discretize the equations to form a linear equation group that can be solved by mature numerical calculation methods.
Here, we used the Chebyshev spectral method to discretize the original equation. The continuous and smooth functions u(x, y) and f (x, y) defined in the interval [−1, +1] in Equation (1) can be approximated by the linear combination of the orthogonal function cluster φ k,l (x, y): whereû k,l andf k,l are coefficients of u(x, y) and f (x, y), respectively, and the function cluster φ k,l (x, y) is a two-dimensional trial function. φ k,l (x, y) can be expressed as the product of two one-dimensional trial functions: In the Chebyshev-Galerkin and Chebyshev collocation spectral methods, the two onedimensional trial functions are both Chebyshev polynomials or their linear combinations.

Definition and Properties of a One-Dimensional Chebyshev Polynomial
The Chebyshev polynomials T k (x) defined in the interval [−1, +1] are: Definition 1 (inner product and orthogonality). The Chebyshev polynomials {T k (x)} satisfies the following (weighted) orthogonal relationship after introducing the following weighted inner product definition: where the weight function w(x) is: and the coefficient c k is defined as: For convenience, if the polynomials are, at most, of N-th degree, Equation (6) can be rewritten in matrix form as: where the matrix K is a diagonal matrix with dimensions of (N + 1) × (N + 1) and the diagonal element value is determined by c k in Equation (8).
Definition 2 (Chebyshev transform). The continuous smooth function v(x) defined in the interval [−1,+1] can be approximately expanded with T k (x) as follows: where N is the truncation order of the spectral method andv k is the Chebyshev expansion coefficient of function v. The expansion coefficient is: Equations (10) and (11) are called the inverse and forward Chebyshev transforms, respectively. If the effect of the truncation order is not taken into account, a one-to-one correspondence can be established between the original function v(x) and its Chebyshev expansion coefficient v k using this pair of transformations, and they are located in the original physical space and spectral space. Definition 3 (numerical integration method to calculate the spectral expansion coefficient). In the forward Chebyshev transform expressed as Equation (11), the Gauss-Lobatto integral is usually used to calculate the weighted integral formula: where N is the number of integration nodes, which is taken as the truncation order of the spectral method. The integration nodes and weights are defined as: Definition 4 (spectral coefficient of the derivative function). For any continuous smooth It can be proven that the expansion coefficientv k of the first derivative of v(x) and the expansion coefficientv k of the original function satisfy the following relationship [29]: where c k is defined in Equation (8). Equation (15) can then be rewritten in matrix form: wherev andv are 1 * (N + 1) respectively. The matrix D is an upper triangular square matrix with dimensions of (N + 1) × (N + 1). Similarly, the expansion coefficientv of the second derivative v (x) can be written as:

Chebyshev-Galerkin Trial Function Construction
In the one-dimensional Chebyshev-Galerkin spectral method, the construction of the trial function needs to satisfy not only the orthogonality described in Section 2.1 but also the boundary conditions of the equation to be solved. Therefore, in practice, the trial function φ k (x) is usually taken as the linear combination of the Chebyshev polynomials T k (x) and is called the Chebyshev-Galerkin trial function. Its general structure can be expressed as: where the undetermined combination coefficients a k and b k can be determined by specific boundary conditions. In matrix form, Equation (18) can be rewritten as: where the constant matrix S T x is a rectangular matrix with dimensions of (N − 1) × (N + 1).

Inner Product and Orthogonality
Similar to the previous section, a series of properties of the Chebyshev-Galerkin trial functions can be obtained. According to the orthogonality satisfied by the Chebyshev poly-nomials in Equations (6)- (9), the inner product of the Chebyshev-Galerkin trial functions can also be written in matrix form: where S x is the transpose of the matrix S T x . The inner product of the Chebyshev trial function and Galerkin trial function can be written as: Similarly, the inner product of the Galerkin trial function and its derivative function can be written as:

Chebyshev-Galerkin Spectral Method for Solving the Two-Dimensional Helmholtz Equation
We first determined the two-dimensional Chebyshev-Galerkin trial function using Equations (4) and (18), and then discussed how to discretize Equation (1). According to the principle of the method of weighted residuals (MWR), it is necessary to approximate the value of the function u to be solved using the Chebyshev-Galerkin trial function for a finite N-term expansion and then to make the residual of the equation orthogonal to the space of the test function; that is, the weighted inner products of the residual and each test function are zero. According to Equation (1), we can obtain: where ϕ k,l represents the two-dimensional test function. According to the different methods used in the test function, the spectral method discussed in this paper can be further divided into the Chebyshev-Galerkin spectral method and the Chebyshev collocation spectral method. (25) In the Chebyshev-Galerkin spectral method, the test function is taken as the Chebyshev-Galerkin trial function. Therefore, each item in Equation (25) can be expressed in a concise matrix form. For instance, the inner product of the second-derivative term is:

Calculate the LHS of Equation
Similarly: The inner product of the first-derivative term can be rewritten as: Similarly: The inner product of the original function term can be rewritten as:

Calculate the RHS of Equation (25)
wheref is the spectral expansion coefficient of the known function f under the Chebyshev trial function in Equation (1) and U is the spectral expansion coefficient of the unsolved quantity u(x, y) under the Galerkin trial function.

Calculate the Helmholtz Equation
Substituting Equations (26)-(31) into Equation (25) gives: To solve U conveniently, the two-dimensional matrices U andf are compressed into onedimensional vectors by columns, which are denoted asū andf, respectively. Equation (32) can be rewritten as: where ⊗ is the Kronecker product. This is a linear equation system for the unknown vectorū and can be solved by using standard numerical methods to obtain the expansion coefficientū of the function u(x, y). Then, we can obtain the value of the function u(x, y) according to Equation (2).

Definition of the Test Function and Derivation Matrix
In Equation (25), if the test function cluster is selected as the following special function, it is called the Chebyshev collocation spectral method. Taking the x direction as an example, specific (N + 1) points x j N j=0 in the solution domain are selected as collocation points and the δ function (δ(x) = 0, (x = 0)) is used as the weight function: According to the principle of the MWR, the residual is required to be zero at the (N + 1) collocation points, which means that the differential equation is strictly established at the (N + 1) collocation points.
It is still possible to discretize a system of equations in the spectral space, as discussed in Section 2.2, and then transform them back into the physical space to obtain approximate solutions of the original equations. However, due to the features of the test function, the Chebyshev collocation spectral method can directly form a system of equations in the original physical space without having to resort to utilizing the spectral space. Due to this feature, the collocation-type spectral method can easily address variable coefficients and non-linear problems. We next discuss this method and solution in detail.
The calculation of the collocation-type spectral method is carried out mainly in the grid-point space and the calculation accuracy is related to the selection of the collocation points. Thus, the number of collocation points has an important influence on the accuracy of numerical calculations but the calculation time will be longer as the number of collocation points increases. For convenience, the Gauss-Lobatto node is selected as the grid collocation point and the detailed definition is shown in Equation (13). First, we constructed the Chebyshev derivation matrix. At each discrete point, x is used to represent the (N + 1)dimensional vector composed of discrete point coordinates and u is used to represent the (N + 1)-dimensional vector composed of the function values at these points. Then, the (N + 1) × (N + 1) Chebyshev derivation matrix D satisfies: Similarly, the second-order derivation matrix is D 2 .

Calculate the Helmholtz Equation
The function u in Equation (1) is discretized at the collocation points. Similar to the solution process of the Galerkin method, if the function u is compressed into a onedimensional vector in columns, Equation (1) on the left-hand side can be rewritten as: where the number of discrete points in the x direction is (N + 1); that in the y direction is (M + 1); and I M is an M-order identity matrix. Matrix forms of the boundary conditions R x and R y are as follows: The rows of the matrices R x and R y corresponding to the boundaries |x| = 1 and |y| = 1 are placed into the corresponding positions in matrix L (Equation (43)).
The symbol "-" above L indicates the modified matrix operator. Then, Equation (44) is solved to obtain u: where the vector f is a discretized description of f (x, y). f is modified as follows: the elements at the boundaries |x| = 1 and |y| = 1 are taken as zero (according to the boundary conditions of Equation (1)).

A Parallel Code for the Spectral Method
After the above-mentioned rigorous mathematical derivation and analysis, the next step is to write code to realize the calculation. As mentioned in Section 2.4, the collocation method calculation has the characteristics of high precision, but its calculation time will gradually become longer with the increase of the number of collocation points. Thus, it is very important to write well-structured code with fast calculation speed.
First, in the process of writing code, pay attention to the consistency of the computer architecture. For example, we use the fortran language to write code and the data is stored in the order of columns. In the process of reading data, it reads according to the principle of storage to improve the performance of the program. Furthermore, we make full use of the already defined arrays, which could reduce the use of new arrays to reduce memory usage. In addition, the calculation time can be shortened by reducing unnecessary calculations and reducing branch judgment statements.
When a certain step of the program contains a large number of data calculations, in most cases, parallel calculation is the most effective speedup method. The core of the program is to calculate a large system of linear equations, which accounts for about 95.5% of the total execution time because it contains a large number of loops and data calculations. Therefore, the code of solving linear equations is a highly active segment that can be calculated in parallel.
In the process of solving a system of linear equations, the iterative method approximates the exact solution through a finite-step iteration, while the direct method directly solves the solution of the matrix with a higher calculation accuracy. In the process of solving linear equations by the direct method, LU factorization is used to triangulate the matrix. The equation Ax = b is to be solved and the matrix A is decomposed into A = LU, where L is the unit lower triangular matrix and U is the upper triangular matrix.
LU factorization of a matrix means that the row and column elements of the diagonal elements A 11 , A 22 ... are transformed in sequence. However, there is no relationship between the row and column elements of each diagonal element in the transformation process, but the subsequent diagonal element rows and columns are dependent on the data. OpenMP is used to perform parallel calculations on the row and column of a specific diagonal element; then, each row and each column are divided into blocks, where the number of elements in each block is n (n is the number of elements after each row of diagonal elements is divided by the number of threads).
In addition, the process of solving linear equations can be replaced by Intel Math Kernel Library (MKL) to simplify the program structure. Moreover, MKL supports OpenMP, which can be accelerated in parallel by calling OpenMP to increase the calculation speed. Therefore, this paper mainly uses the OpenMP scheme, which provides a shared storage, to accomplish parallel computing.

Test Results and Analysis
In this section, we first apply the Chebyshev-Galerkin and Chebyshev collocation spectral methods to solve the two-dimensional model Helmholtz equation and then compare both the results and computation times of the two numerical calculations. Since the Chebyshev collocation spectral method has a wide range of applications and does not require strict boundary conditions, this method is applied to solve actual ocean acoustic calculation examples and analytical solutions are used to verify the correctness of the numerical results. Comparing the numerical calculation results of the collocation method with those of Kraken confirms the high calculation accuracy of the collocation method. In order to effectively solve the problem of large amounts of calculation and long running times of the program, we designed the parallel program. The test results show that after parallel optimization, the efficiency of the program is greatly improved. In addition, the truncation order N is not required to be the same in both directions; however, to facilitate this test, the N values in the two directions are assumed to be the same in the numerical experiments. In the following section, N refers to the truncation order in one direction unless otherwise specified.

Two-Dimensional Model Helmholtz Equation
In this section, we take the solution of the following model equation as an example for numerical testing and analysis. The numerical calculation program is written in Fortran code and the test platform is a Dell XPS8930 desktop computer equipped with an Intel i7-8700K CPU and 32 GB of memory.
f (x, y) = −5π 2 + 1 sin 2πx + π 4 sin πy + π 4 + πsin 2πx + π 4 cos πy + π 4 The exact solution of Equation (45) is u = sin (2πx + π 4 ) sin πy + π 4 . Equation (45) is solved by the Chebyshev-Galerkin and Chebyshev collocation spectral methods, and the approximate solution obtained are presented in Figure 1. The accuracy is determined by the relative L 2 -norm of the error between the numerical solution and the exact solution: where · 2 represents the L 2 -norm of the error, u represents the numerical result, and u ana represents the exact solution.  Figure 1 shows the images of the exact solution and the numerical solutions of the two methods. This function exhibits good smoothness and symmetry but the image is more complex and the gradient changes greatly. It can be clearly seen that the Chebyshev-Galerkin and Chebyshev collocation methods can solve the equation correctly and effectively. Table 1 demonstrates that the two spectral methods show a similar accuracy until N = 24, indicating that the approximation accuracy of both numerical methods increases rapidly with increasing truncation order. These two methods can obtain high-precision approximate solutions when the truncation order N is small, which verifies the high precision of the spectral method approximations. For almost every increase in the truncation order, the accuracy of the numerical solution increases by an order of magnitude, which verifies the rapid convergence of the spectral methods. The Galerkin method achieves the highest accuracy at N = 30 when the error magnitude is 10 −14 and the collocation method achieves the highest accuracy at N = 24 when the error magnitude is 10 −12 . Although the two spectral methods are both high-precision calculation methods, the collocation method requires a smaller truncation order to achieve the highest accuracy and can effectively reduce the computation time when solving both complex and large-scale problems.

Ocean Acoustic Propagation Example Test
The test in Section 3.1 verifies that the Chebyshev collocation spectral method can directly solve the two-dimensional Helmholtz model equation with high accuracy and fast convergence. Therefore, here, we apply the Chebyshev collocation spectral method to solve the two-dimensional ocean acoustic propagation equation. The collocation method can effectively solve the situation in which the sound speed changes continuously in the solution area. At present, the lower boundary of the solution area is a horizontal layer and the physical quantity changes continuously in each layer. More complex calculation scenarios are still being calculated. Two ocean acoustic propagation examples involving ideal fluid waveguides and spherical waves with analytical solutions are selected to verify the effectiveness of the Chebyshev collocation method in solving the ocean acoustic field.
When the ocean topography and ocean environment parameters are axisymmetric, the circumferential guide number in the cylindrical coordinate system is zero, that is, where P is the sound pressure, ρ is the density, k is the wavenumber, r is the horizontal axis, and z is the vertical axis. The boundary conditions are also required to obtain the specific sound pressure distribution. To simulate the sound field characteristics of a real large-scale sea area, it is often necessary to set the radiation boundary conditions, that is, the conditions that the solution of the wave equation needs to meet at infinity (the sound propagation direction at infinity can be only outward). The Sommerfeld radiation condition expression is: This condition indicates that on the virtual boundary far from the sound source point, the sound pressure method guide number and the sound pressure itself satisfy Equation (48).
The premise of the radiation boundary conditions is that they correspond to an infinite distance from the sound source point. However, because the calculation area is limited, an "absorption layer" needs to be set at the boundary to avoid false reflections of the sound field by the radiation boundary conditions. The inner side of the absorption layer is connected to the sound field and the radiation boundary condition is set on the outer side. The absorption coefficient of the absorption layer increases rapidly with increasing coordinate values; as a result, the sound pressure rapidly weakens over a short distance. The wavenumber expression in the absorption layer is: where the coefficient µ is usually zero; γ r represents the change coefficient of the absorption layer in the horizontal direction; γ z represents the change coefficient of the absorption layer in the vertical direction; L represents the horizontal coordinate of the inner side of the absorption layer in the horizontal direction; and H represents the vertical coordinate of the inner side of the absorption layer in the vertical direction. To simulate real ocean conditions, the absorption coefficient β is zero.
To illustrate the calculation results of the sound field, the transmission loss (TL) of the sound pressure is defined as: where P 0 refers to the sound pressure 1 m from the sound source. The TL is commonly used to display sound field results and is expressed in units of decibels (dB).

Ideal Fluid Waveguide
The density of the ocean is uniform at ρ(z) = 1 g/cm 3 , the speed of underwater sound propagation is constant at c = 1500 m/s, the sound source is at a depth of 36 m, and the frequency is 20 Hz. The upper and lower boundaries of the solved rectangular area are the pressure release boundary conditions, the left boundary is described by the analytical solution, and the right boundary is described by the radiation boundary condition. The range of the horizontal solution area is 1800 m and the thickness of the absorption layer is 200 m. Therefore, we analyze mainly the calculation area spanning 1600 m in the horizontal direction. A truncation order of N = 120 is considered and the results are shown in Figure 2.   Figure 3 plots the TL curves of the collocation method and analytical solution at a sound source depth of 36 m. The calculation results of the collocation method and the analytical solution are very similar, but there is a certain error in the sound shadow area. The sound shadow area is relatively complicated and thus the calculation is difficult, which leads to errors in the calculation of the collocation method. The analytical solution is used to analyze the accuracy of the numerical calculation in the non-absorbent layer and the results are shown in Table 2, indicating that the accuracy of the numerical calculation can reach 10 −4 when N increases to 80. This example is also solved by the classic Kraken program based on the finite difference algorithm. As shown in Table 2, due to the constraints of the normal wave calculation model and the finite difference discretization method, even if the number of discrete points is increased, the magnitude of the error remains 10 −1 , thus the improvement is no longer significant. Table 3 presents the errors of the two numerical calculation methods at a sound source depth of 36 m. The calculation accuracy of the collocation method is similar to that of Kraken when N < 120; however, at N = 120, the accuracy of the collocation method exceeds that of Kraken by approximately 10 −4 . A comparative analysis indicates that the accuracy of the Chebyshev collocation method is higher than that of Kraken, which verifies the high precision of the spectral method. However, the running time of the collocation method is longer than that of Kraken as a result of the large amount of calculations. Thus, we implement the parallel code to accelerate the program.

Spherical Wave
The density of the ocean is uniform at ρ(z) = 1 g/cm 3 , the speed of underwater sound propagation is constant at c = 1500 m/s, the sound source is set at the coordinate origin (0, 0), and the frequency is 150 Hz. To avoid singularities in the calculation area, the horizontal solution area is (1, 100) and the vertical solution area is (−50, 50). The analytical solution of the spherical wave is The left boundary is described by the analytical solution, whereas the upper, lower, and right boundaries of the solved rectangular area are all assigned radiation boundary conditions, and the thicknesses of the boundary absorption layers affect the calculation accuracy. The truncation order is taken as N = 100 and the thickness of the absorbing layer is tested at 5, 10, 15, and 20 m. The calculation results are displayed in Figure 4 and both the errors in the non-absorbent layer area and at the depth of the sound source are shown in Table 4.  Figure 4 shows that when the absorbing layer is thin, radiation boundary conditions produce false reflections in the sound field, which affect the calculation accuracy. With increasing thickness, the calculation results of the sound field significantly improve. Table 4 further demonstrates that as the absorbing layer thickens, the errors in the entire solution domain and at the sound source depth gradually decrease, while the calculation accuracy increases. Considering the size of the effective computing area and the utilization of computing resources, when the thickness of the absorbing layer reaches 20 m, the numerical calculation accuracy can be ensured and the numerical calculation resources can also be used efficiently. The TL curves at the sound source depth computed by the analytical method (red solid line) are basically identical to those computed by the collocation method (black dashed line) when the thickness of the absorbing layer is 20 m, as shown in Figure 5a.
In addition, Figure 5b plots the errors between the numerical solution and the analytical solution. Overall, Figure 5 indicates a slight difference in the calculation results of the collocation method beyond 60 m due to the reflection of the radiation boundary. Therefore, in the following test, we chose the thickness of the absorbing layer to be 20 m.  Table 5 shows the variations in the numerical errors throughout the entire solution domain (except the absorption layer) and at the depth of the sound source with the number of discrete points N. With increasing N, the calculation error of the Chebyshev collocation spectral method gradually decreases and the numerical calculation accuracy gradually improves. Considering the number of calculations and the required calculation accuracy, we set the truncation order to N = 100 for the calculation of spherical waves. However, the computational efficiency of this method cannot meet the requirements of real-time applications because of the excessively large computational load; thus, we utilize a variety of methods to enhance the overall performance in the next section.

A Parallel Code of the Collocation Method
In order to measure the improvement of the program performance by parallel algorithms more effectively, it is necessary to analyze and test on the same high-performance computing platform, namely the Tianhe-2 supercomputer. The configuration of the Tianhe-2 supercomputer is shown in detail in Table 6. For testing, we employed two compilers: gcc version 5.4.0 and Intel mkl-15. In the actual test process, five tests are performed for each optimization and the test time with the shortest time is regarded as the best time. We select the spherical wave for the test, wherein the thickness of the absorbing layer is 20 m and the truncation order N is 100 according to the error analysis in Section 3.2.2. We first write a program with good performance and then start the multi-threaded parallel optimization. The parallel acceleration effect follows the Amdahl speedup law, based on which the parallel effect can be predicted in advance. On a many-core platform, if the maximum number of threads that can be used is n and the percentage of the execution time of the parallel part of the program code is q, the ideal speedup is calculated as When the same program is executed serially on one node, the speedups present with different numbers of threads, as shown in Figure 6. As the number of threads increases, the computation time of the program (i.e., the running time) decreases dramatically. As shown in Figure 6, the total running time speedup is 14.55 when the number of threads is 24. However, when the number of threads exceeds 24, the speedup decreases; this is because multiple threads share the same processor core in this case and thus competition for resources causes the parallel speedup to diminish. In addition, the forking and joining of operations of too many threads also increase the computation time. When the number of threads is 24, the ideal speedup of the entire program is 19.19 and the actual parallel speedup is 14.55, which does not reach the ideal value. The parallel efficiency is not ideally likely because the system overhead and proportion of non-parallel regions of code both increase when more threads are employed. In comparing the calculation results before and after optimization, the maximum error at all collocation points in the entire calculation area is 10 −6 , which shows that optimizing the program does not affect the calculation accuracy.

Conclusions and Outlook
This paper uses the Chebyshev-Galerkin and Chebyshev collocation spectral methods to directly solve the two-dimensional Helmholtz model equation and uses an analytical solution to verify the correctness of the two methods. The Chebyshev-Galerkin spectral method first constructs a trial function that satisfies the boundary conditions; then, it implements interpolation at the Gauss-Lobatto node; forms a system of linear equations in the spectral space; and finally obtains the original function. However, the two-dimensional ocean acoustic propagation Helmholtz equation is relatively complicated due to the variable boundary conditions and the trial function is difficult to construct. Therefore, realistic ocean acoustic examples are solved by the more widely applicable Chebyshev collocation spectral method. The Chebyshev collocation spectral method approximates the function value at the Gauss-Lobatto node, interpolates physical quantities such as the boundary conditions and sound velocity to the Gauss-Lobatto node, and then directly solves the system of linear equations in the physical space to obtain the original function. The analytical solution is used to verify the correctness of the Chebyshev collocation method and compared with the classic Kraken program, the Chebyshev collocation method has a higher calculation accuracy. Hence, the Chebyshev collocation method can be used to directly solve the twodimensional underwater acoustic propagation Helmholtz equation without being restricted or constrained by other simplified model application conditions and does not introduce model errors. The Chebyshev collocation method has a wide range of applications and provides results with a high accuracy, which is of great significance in the calculation of realistic ocean sound fields. However, in the process of calculation, the collocation method requires a long running time due to the large amounts of calculation. Therefore, we try to use a parallel code to accelerate the efficiency of the code and achieve a good performance.
This paper is an exploration of solving the two-dimensional Helmholtz equation and mainly introduces the use of the Chebyshev collocation spectral method to solve relatively simple sound propagation problems in ocean media. The calculation of more complicated sound propagation examples in the actual ocean is the key issue of future research.