4.4 Test Programs
In this Section the subroutines AIBEM2, AIBEM3
and AIBEMA are demonstrated through invoking them
from a main program and
comparing the results with analytic solutions.
The corresponding
main programs are AIBEM2_T, AIBEM3_T and AIBEMA_T.
The main program AIBEM2_T tests module AIBEM2,
the subroutine for computing the solution of the
Helmholtz equation interior to a closed boundary
in a two-dimensional domain. In AIBEM2_T the domain
is the interior of a square of side 0.1m with the
boundary represented by 32 uniform elements. The representation
of the boundary is described fully
in Section 2.2 by the data structures VERTEX and
SELV, see Tables 2.A and 2.B.
Full results
are given in file AIBEM2.OUT.
The acoustic medium is air at 20 celcius and 1 atmosphere.
The speed of sound is assigned the value
c = 344m/s.
The chosen frequency of the test is 400Hz, hence
k = 7.31. The
velocity potential defined by
|
f(p) = sin( |
k
Ö2
|
p1) sin( |
k
Ö2
|
p2) |
|
is clearly a solution of the Helmholtz equation. The boundary
velocity is given by differentiating f with respect
to p1 on the lines p1 = 0 and p1 = 0.1 and with
respect to p2 on the lines p2 = 0, p2 = 0.1 and
taking into account the direction of the outward normal
on these boundary lines. This gives the following
surface velocities on each side of the square:
|
v(p) = |
ì ï ï ï ï ï í
ï ï ï ï ï î
|
| |
|
| |
| |
|
k
Ö2
|
cos( |
k
Ö2
|
0.1) sin( |
k
Ö2
|
p2) |
|
| |
|
k
Ö2
|
sin( |
k
Ö2
|
p1) cos( |
k
Ö2
|
0.1) |
|
|
| |
|
Two test problems are devised in which the boundary condition
|
a(p) f(p) +b(p) v(p) = f(p) |
|
are set up so that
a(p) = 1,
b(p) = 0,
f(p) = f(p) for p Î S,
the Dirichlet condition and
a(p) = 0,
b(p) = 1,
f(p) = v(p) for p Î S,
the Neumann condition.
The numerical solution is determined on the boundary
of the domain and
at the interior points (0.025,0.025),(0.075,0.025),
(0.075,0.025), (0.075,0.075), (0.05,0.05).
To test run the program, link the files AIBEM2_T.FOR,
AIBEM2.FOR, H2LC.FOR,
GEOM2D.FOR,
CGLS.FOR and the file FNHANK (or the equivalent).
The output file is AIBEM2.OUT.
The exact and numerical solutions at the selected interior
points are given in the Table 4.A.
|
Table 4.A: Results from AIBEM2_T
| point | exact solution | numerical solution | numerical solution
| | to Dirichlet condition | to Neumann condition
| (0.025,0.025) | 0.0166 | 0.0159 + i0.0001 | 0.0156 - i0.0012
| (0.075,0.025) | 0.0488 | 0.0482 - i0.0000 | 0.0480 - i0.0014
| (0.025,0.075) | 0.0488 | 0.0482 - i0.0000 | 0.0480 - i0.0014
| (0.075,0.075) | 0.1429 | 0.1434 - i0.0003 | 0.1398 - i0.0019
| (0.050,0.050) | 0.0653 | 0.0650 - i0.0000 | 0.0639 - i0.0015 | | | | | | | |
The main program AIBEM3_T tests module AIBEM3,
the subroutine for computing the solution of the
Helmholtz equation interior to a general closed surface
in a three-dimensional domain. In AIBEM3_T the domain
is the interior of a sphere of radius 1m with the
boundary represented by 36 elements. The representation
of the boundary is described fully
in Section 2.3 by the data structures VERTEX and
SELV, see Tables 2.C and 2.D.
Full results
are given in file AIBEM3.OUT.
The acoustic medium is air at 20 celcius and 1 atmosphere
so that the speed of sound is c = 344m/s.
The chosen frequency of the test is 20Hz, hence
k = 0.37. The
velocity potential defined by
is clearly a solution of the Helmholtz equation. The surface
velocity at a point p
is given by differentiating f with respect
the outward normal there, np, to give
|
|
¶f
¶np
|
= Ñ f. np = |
¶f
¶p3
|
n3 = k cos(k p3) n3 . |
|
where np = (n1,n2,n3).
Two test problems are devised in which the boundary condition
|
a(p) f(p) +b(p) v(p) = f(p) |
|
are set up so that
a(p) = 1,
b(p) = 0,
f(p) = f(p) for p Î S,
the Dirichlet condition and
a(p) = 0,
b(p) = 1,
f(p) = v(p) for p Î S,
the Neumann condition.
The numerical solution is determined on the boundary
of the domain and
at the interior points (0.5,0.0,0.0), (0.0,0.0,0.25),
(0.0,0.0,0.5),(0.0,0.0,0.75).
The sound pressure in this example is given by multiplying the
velocity potential by irw = 2 pi rf. In this
example r = 1.205 and f = 100Hz hence the sound pressure
is returned when the velocity potentials are multiplied by
i757.12;
The sound pressures corresponding to the
velocity potentials at each solution point are given in the
output file and some of the results are reproduced in Table 4.B.
|
Table 4.B: Results from AIBEM3_T
| point | exact solution | numerical solution | numerical solution
| | to Dirichlet condition | to Neumann condition
| (0.5, 0.0, 0.0) | 0.0000 | 0.0000 - i0.0000 | 0.0000 - i0.0000
| (0.0, 0.0, 0.25) | 0.0912 | 0.0889 - i0.0008 | 0.0800 + i0.0013
| (0.0, 0.0, 0.5) | 0.1816 | 0.1757 - i0.0015 | 0.1586 + i0.0025
| (0.0 ,0.0, 0.75) | 0.2706 | 0.2623 - i0.0020 | 0.2377 + i0.0035 | | | | | | |
In the final example
that of finding the velocity potential at points in the
domain of the sphere with the Neumann boundary condition
and with a point source at the centre of the sphere, giving the
incident field
The velocity potentials obtained at the interior points are summarised
in Table 4.C.
|
Table 4.C: Reseults from AIBEM3_T
| point | incident field | numerical solution
| (0.0, 0.0, 0.25) | 0.317 + i0.029 | -1.143 - i0.594
| (0.0, 0.0, 0.5) | 0.157 + i0.029 | -1.296 - i0.590
| (0.0 ,0.0, 0.75) | 0.102 + i0.029 | -1.372 - i0.599 | | | | |
The main program AIBEMA_T tests module AIBEMA.
In AIBEMA_T the acoustic domain is interior of a
sphere of unit radius. The surface is represented by
sixteen truncated conical elements, as described in 2.4.
Program AIBEM3_T runs three test problems.
In each test problem the frequency is 40Hz and the acoustic
medium is air at 20 celcius (c=344m/s).
Full results
are given in file AIBEMA.OUT.
For each test
the solution is listed on the surface.
In the first test problem the velocity potential on
the surface is determined by the field
and AIBEMA is used to determine f within the
domain. The results are given in Table 4.D.
|
Table 4.D: Results from AIBEMA_T
| point (r,z) | exact solution | numerical solution
| (0.0, 0.0) | 0.000 | 0.000 - i0.001
| (0.0, 0.5) | 0.357 | 0.357 + i0.004
| (0.0 , -0.5 ) | -0.357 | -0.357 - i0.004
| (0.5 , 0.0 ) | 0.000 | 0.000 - i0.000 | | | | | |
The second test problem has the same solution but in this case
the corresponding Neumann condition is applied at the
boundary. The corresponding solutions from this test
problem are given in Table 4.E.
|
Table 4.E: Results from AIBEMA_T
| point (r,z) | exact solution | numerical solution
| (0.0, 0.0) | 0.000 | 0.000 - i0.000
| (0.0, 0.5) | 0.357 | 0.354 - i0.001
| (0.0 , -0.5 ) | -0.357 | -0.354 - i0.001
| (0.5 , 0.0 ) | 0.000 | 0.000 - i0.000 | | | | | |
The third test problem is made up of a unit source at
(r,z) = (0.0,0.25). The Dirichlet boundary condition
is also given by the free-field velocity potential
that would arise from the same source. Hence the
exact solution for the whole field
is given by
The results from this test problem are given in Table 4.F.
|
Table 4.F: Results from AIBEMA_T
| point (r,z) | exact solution | numerical solution
| (0.0, 0.0) | 0.313 + i0.058 | 0.312 + i0.059
| (0.0, 0.5) | 0.313 + i0.058 | 0.312 + i0.059
| (0.0 , -0.5 ) | 0.091 + i0.055 | 0.090 + i0.056
| (0.5 , 0.0 ) | 0.131 + i0.057 | 0.130 + i0.058 | | | | | |
Return to boundary-element-method.com/acoustics
Return to boundary-element-method.com