Hasegawa (1979) Figure 3#

In this example we recreate Figure 3 from Hasegawa’s 1979 paper.

First, we need to get an instance of our solution class. In this case osaft.hasegawa1969.ARF(). The steps are the same as in the earlier examples. Note that we set N_max = 12. N_max is the highest vibration mode of the sphere still considered in the computation. In this example we need to consider many modes since the wavelength is of similar length as the particle diameter. This is usually not the case and the default value of N_max = 5 is more than sufficient to get an accurate value for the ARF.

17 import matplotlib.pyplot as plt
18 import numpy as np
19
20 import osaft
21
22 # --------
23 # Geometry
24 # --------
25 # Radius
26 R_0 = 1e-6  # [m]
27
28 # ----------------------------
29 # Properties of Brass Particle
30 # ----------------------------
31 rho_s = 8100  # [kg/m^3]
32 E_s = 88e9  # [Pa]
33 nu_s = 0.301  # [-]
34 # -------------------
35 # Properties of Water
36 # -------------------
37 rho_f = 1000  # [kg/m^3]
38 c_f = 1500  # [m/s]
39
40 # --------------------------------
41 # Properties of the Acoustic Field
42 # --------------------------------
43 pos = osaft.pi / 4
44 f = 1e6
45 p_0 = 1e5
46 wave_type = osaft.WaveType.STANDING
47 N_max = 12
48
49 hasegawa = osaft.hasegawa1969.ARF(
50     rho_s=rho_s,
51     E_s=E_s,
52     nu_s=nu_s,
53     rho_f=rho_f,
54     c_f=c_f,
55     position=pos,
56     f=f,
57     R_0=R_0,
58     p_0=p_0,
59     wave_type=wave_type,
60     N_max=N_max,
61 )

We need to plot the ARF over a range of values of \(k_f R_0\). For this we are changing the radius \(R_0\) while keeping all other parameters constant.

68 N = 100
69 R_min = 1e-6
70 R_max = 10 / hasegawa.k_f
71 R0_values = np.linspace(R_min, R_max, N)
72 kr_values = hasegawa.k_f * R0_values

Here we initiate the plot and add the solution. In the first argument (x_values) we define the values for which the second argument (attr_name) should be evaluated.

79 arf_plot = osaft.ARFPlot(x_values=R0_values, attr_name="R_0")
80 arf_plot.add_solutions(hasegawa)

In his article Hasegawa does not plot the ARF itself but normalized it w.r.t. to the acoustic energy density and the cross-sectional area of the sphere.

\[Y_\text{ST} = (F^\text{rad} / \pi R_0^2 E_\text{ac})\]

We therefore define a normalization function that depends on our variable R_0 that we are going to plot the ARF over and we will later pass it to plot_solutions. Note that the factor of 1/2 stems from the fact that Hasegawa has defined the energy w.r.t. to a single propagating wave and not the overall pressure amplitude of the standing wave.

98 def normalization(radius):
99     return 1 / 2 * hasegawa.field.E_ac * osaft.pi * radius**2

Finally, we plot the figure. Here we use plt.subplots() to get a figure with the correct aspect ratio and pass the Axes instance ax to plot_solutions. We can directly pass display_values to the plot_solutions method, in order to plot over the values of \(k_f R_0\) instead of the radius.

109 fig, ax = plt.subplots(figsize=(3, 5))
110 arf_plot.plot_solutions(
111     ax=ax,
112     display_values=kr_values,
113     color="black",
114     normalization=normalization,
115 )
116 ax.set_xlabel(r"$ka$")
117 ax.set_ylabel("$Y_{ST}$")
118 ax.axhline(0, color="k")
119 ax.set_xlim(left=0, right=10)
120 ax.set_ylim(bottom=-1, top=3.5)
121 ax.set_xticks([0, 2, 4, 6, 8])
122 ax.set_yticks([-1, 0, 1, 2, 3])
123 ax.legend(["Brass"])
124 fig.tight_layout()
125 plt.show()
example hasegawa brass sphere

Total running time of the script: ( 0 minutes 1.864 seconds)

Estimated memory usage: 9 MB

Gallery generated by Sphinx-Gallery