## 2 Materials and Methods  
In this section, we describe the model used in this work to study the ultrasonic field within a cavity of length \(L\) filled with a bubbly liquid. Two kinds of cavities are taken into account in the following study, which aims at designing the optimization of the bubbly medium in different configurations, given the wavelength \(\lambda\) at the source: a free-walled resonator for which \(L=\lambda/4\) with a pressure source at one side and a null pressure at the other one; an open-field cavity for which \(L=16\lambda\) with a pressure source at one side and an open-field condition at the other one. We assume an homogeneous distribution of spherical gas bubbles of the same size in a liquid. We also consider that: these bubbles are the only source of attenuation, nonlinearity, and dispersion; they are monodisperse and oscillate at their first radial mode; the surface tension is neglected; the bubble collapse is not modeled; buoyancy, Bjerknes and viscous drag forces are not considered [1; 14; 15]. Our model does not include inertial cavitation bubbles [16], for which the dispersion law for nonlinear attenuation and sound speed can be found in [17; 18]. It must be noted that, since bubble-bubble interactions are not included here, their influence when void fraction is varied, which is described in [17; 19; 20], is neglected in the following Sections 3.1.3 and 3.2.3. The nonlinear interaction between bubble vibrations and ultrasound is modeled by the following differential system that couples the acoustic pressure \(p(x,t)\) (wave equation, Equation (1)) and the bubble volume variation \(v(x,t)=V(x,t)-v_{0g}\) (Rayleigh-Plesset equation, Equation (2)),  
\[\frac{\partial^{2}p}{\partial x^{2}}-\frac{1}{c_{0l}^{2}}\frac{\partial^{2}p }{\partial t^{2}}=-\rho_{0l}N_{g}\frac{\partial^{2}v}{\partial t^{2}},\ (x,t)\in(0,L)\times(0,T_{t}), \tag{1}\]  
\[\frac{\partial^{2}p}{\partial t^{2}}+\delta\omega_{0}\frac{\partial p}{ \partial t}+\omega_{0g}^{2}v+\eta p=av^{2}+b\Bigg{(}2v\frac{\partial^{2}p}{ \partial t^{2}}+\left(\frac{\partial^{2}p}{\partial t^{2}}\right)^{2}\Bigg{)},\ (x,t)\in[0,L]\times(0,T_{t}), \tag{2}\]where \(V(x,t)\) is the current bubble volume, \(v_{0g}=4\pi R_{0g}^{3}/3\) is the initial bubble volume, \(R_{0g}\) is its initial radius, \(x\) is the one-dimensional space coordinate, and \(t\) is the time. The resonator is excited by a pressure source placed at \(x=0\) from time \(t=0\) up to \(t=T_{t}\). In Equation (1), the sound speed and the density at the equilibrium state of the liquid are \(c_{0l}\) and \(\rho_{0l}\), and the bubble density in the liquid is \(N_{g}\). In Equation (2), the viscous damping coefficient of the bubbly fluid is \(\delta=4v_{l}/\omega_{0}R_{0g}^{2}\), in which \(v_{l}\) is the cinematic viscosity of the liquid, \(\omega_{0}=2\pi f_{0}=\sqrt{3\gamma_{g}p_{0g}/\rho_{0l}R_{0g}^{2}}\) is the resonance frequency of the bubbles, in which \(\gamma_{g}\) is the specific heats ratio of the gas, \(p_{0g}=\rho_{0g}c_{0g}^{2}/\gamma_{g}\) is its atmospheric pressure, \(\rho_{0g}\) and \(c_{0g}\) are the density and sound speed at the equilibrium state of the gas. The other parameters involved in the differential system are \(\eta=4\pi R_{0g}/\rho_{0l}\), \(a=(\gamma_{g}+1)\omega_{0g}^{2}/2v_{0g}\), and \(b=1/6\omega_{0g}\).