1 Introduction

Cavitation is a phenomenon that involves the transition from liquid to vapour due to a decrease in pressure, leading to the formation of vapour bubbles within the liquid. This phenomenon occurs in many hydrodynamic machines, where the collapse of cavitation bubbles can generate high pressure and high temperature, resulting in noise, vibration, and erosion. However, cavitation can be leveraged to enhance heat transfer and for applications such as drilling petroleum wells, where micro-jets induced by the collapse of bubbles play a crucial role [1].

Numerous numerical attempts have been made to simulate cavitation bubbles using traditional macroscopic methods based on the Navier-Stokes equation [2,3,4]. In addition, due to its advantages in simulating multiphase models, Lattice Boltzmann Method (LBM) has also been applied to bubble simulation [5,6,7]. Within the LBM framework, at least four different approaches are known: (i) colour-gradient model; (ii) free energy model; (iii) phase-field model; and (iv) Shan-Chen model. Colour gradient model is popular when it comes to immiscible flow [8,9,10,11]. Free energy model and phase filed model usually comes with Cahn-Hilliard equation [12] and Allen-Cahn equation [13] for tracking the interface and they are popular in cases such as Rayleigh-Taylor instability [14,15,16].

Among these approaches, the Shan-Chen model has gained popularity due to its simplicity and effectiveness in simulating bubble dynamics. This model employs a potential to mimic the interaction between particles, adding force to the velocity to trigger phase separation [17]. For instance, numerous articles focus on studying a single bubble near a solid wall based on the Shan-Chen model [18,19,20]. Furthermore, simulations of a bubble near a concave wall and a bubble near a solid particle [5] have also been conducted. The advantages of the Shan-Chen model include its ability to easily incorporate the equation of state and facilitate the automatic separation of phases and components.

In articles studying bubble dynamics based on the Shan-Chen model, the validation of bubble growth or collapse was conducted by comparing the Rayleigh-Plesset (R-P) equation with LBM simulation results. Shi et al. [21] compared the R-P equation with LBM simulation results for a bubble radius of 20 lattice units, focusing on growth and collapse. The simulation domain size was 2000x2000x1000, but the article did not provide a detailed analysis of the influence of the boundary effect. Ezzatneshan and Vaseghnia [22] also validated LBM results for the same radius against the R-P equation under different pressures, determining the critical pressure for bubble growth or collapse. However, their study considered solely a radius of 15 lattice units, and the influence of different radii was not explored. Visual observation of the reported results suggests discrepancies between predictions of the LBM and R-P equation, especially in the case of collapsing bubbles near the end of the simulation time when the bubble radii become comparable to the lattice size. However, it remains unclear when such effects start to become significant.

Peng et al. [1] compared LBM results with variable boundary pressure against the relevant R-P equation, demonstrating good agreement with slight deviations at the beginning. This suggests that initial conditions significantly influence the results. In another study, Peng et al. [23] investigated LBM results with different pressure differences and radii against the R-P equation. While results were satisfactory in certain iterations, small deviations were observed.

Based on the aforementioned studies, it is clear that there is a lack of quantitative understanding regarding the impact of simulation parameters on the predicted bubble dynamics trends. It is also crucial to recognize that the LBM and the R-P equation provide solutions to the same physical problem in different mathematical frameworks. The two methods have a different set of input parameters and a different set of output variables which make fair comparison challenging. To the authors’ knowledge, a detailed description has not been provided to date on how to address this challenge and how it impacts the outcome of the comparison. Specifically, there is a lack of comprehensive analyses regarding the influence of different bubble radii, and detailed investigations into the effects of initial conditions and domain size on LBM simulations in the context of bubble dynamics based on the Shan-Chen model. In addition, previous studies are challenging to reproduce because of the lack of publicly available repositories of the LBM with cavitation modelling.

The primary aim of this article is to undertake a critical assessment of the lattice Boltzmann method concerning its application to single bubble dynamics and, in turn, to establish a foundational framework for the simulation of bubble clusters. To realize this aim, the article is structured as follows. In section two, the mathematical frameworks underpinning the simulations are outlined, encompassing relevant equations and providing details of the problem statement and configuration. This section also describes the three investigated test cases: Laplace’s law validation, Maxwell’s area construction validation, and R-P equation validation. Section three presents the results of the validation cases alongside a discussion regarding the impact of various parameters. Finally, conclusions are summarised in section four. Additionally, this study addresses a notable gap by publicly releasing a 2D repository

2 Methods

2.1 Description of the lattice Boltzmann method

In this article, a two-dimensional D2Q9 model was implemented based on the Shan-Chen multiphase model. The additional force was considered through the velocity shifting method by modifying the equilibrium velocity, without any alteration to the lattice Boltzmann equation, expressed in [24] as

$$\begin{aligned} f_i\left( \varvec{x}+\varvec{e_i} \Delta t, t+\Delta t\right) -f_i(\varvec{x}, t)=-\frac{1}{\tau }\left[ f_i(\varvec{x}, t)-f_i^{e q}(\varvec{x}, t)\right] . \end{aligned}$$
(1)

Here, i represents one of the nine directions, f is the probability density function, \(\varvec{x}\) and t are the coordinates in space and time, \(\Delta t\) is the time step, \(\varvec{e_i}\) is the unit vector direction of the lattice, \(\tau\) is the relaxation time and \(f^{eq}\) is the equilibrium probability distribution function. The relation of relaxation frequency, lattice viscosity, and relaxation time is \(\omega =3\nu ^\textrm{LB}+0.5=1/\tau\) [25]. Numerical tests showed that a relaxation frequency of \(\omega =1\) provided acceptable stability and is chosen throughout this study. This setting is also found in the literature [1, 21, 23], further proving its justification. The “LB” and “RP” superscripts are used to distinguish quantities that appear in both the Lattice Boltzmann (LB) and Rayleigh-Plesset (RP) equations.

The equilibrium probability distribution function can be expressed as [25]

$$\begin{aligned} f_i^{e q}(\varvec{x}, t)=w_i \rho (\varvec{x})\left[ 1+\frac{3 \varvec{e_i} \cdot \varvec{u}}{c^2}+\frac{9\left( \varvec{e_i} \cdot \varvec{u}\right) ^2}{2 c^4}-\frac{3 \varvec{u}^2}{2 c^2}\right] , \end{aligned}$$
(2)

where the weights \(w_i\) are equal to 4/9 for \(i=0\), 1/9 for \(i=1\) to 4, and 1/36 for \(i=5\) to 9. The lattice speed is denoted by c, whereas \(\rho\) and \(\varvec{u}\) are the macroscopic density and the velocity vector. The unit vectors \(\varvec{e_i}\) correspond to the nine propagation directions.

According to Shan and Chen [26], the additional force required to describe multiphase flows can be expressed as

$$\begin{aligned} \varvec{F}(\varvec{x}, t)=-G \psi (\varvec{x}, t) \sum _{i=0}^8 \omega _i \psi \left( \varvec{x}+\varvec{e_i} t, t\right) \varvec{e_i}, \end{aligned}$$
(3)

where G denotes the interaction strength between particles, it is eliminated during the computations and therefore G does not affect the results [21]. And \(\psi\) represents the effective density. Additionally, the velocity shifting method was implemented to enhance stability [24] so that

$$\begin{aligned} \varvec{u^{\textrm{eq}}}=\frac{1}{\rho }\left( \sum _i f_i \varvec{c_i}+\tau \varvec{F}\right) , \end{aligned}$$
(4)

where \(\varvec{F}\) represents the Shan-Chen force vector and \(\varvec{u^{eq}}\) is the equilibrium velocity vector. Furthermore, the Carnahan-Starling (C-S) Equation of State (EOS) is incorporated by modifying the effective density [21] according to

$$\begin{aligned} \psi =\sqrt{\frac{2}{G c_s^2}\left( p-\rho c_s^2\right) }. \end{aligned}$$
(5)

Here, \(c_s\) denotes the speed of sound and p is the statics pressure [1] governed by the C-S EOS:

$$\begin{aligned} p=\rho R_c T \frac{1+b \rho / 4+(b \rho / 4)^2-(b \rho / 4)^3}{(1-b \rho / 4)^3}-a \rho ^2. \end{aligned}$$
(6)

The corresponding coefficients and the universal gas constant are chosen as \(a=1\), \(b=4\), and \(R_c=1\). The carried-out simulations rely on the assumption of isothermal flow condition. Unless stated otherwise, the critical temperature is \(T_c=0.09433\), and the ratio of the temperature and the critical temperature is set to \(T/T_c=0.75\). The same settings determined based on the critical pressure, density, and temperature were employed in several former studies [5, 21].

There are certain literature [5, 21, 23] that use the original Shan-Chen model, which is similar to the model in this article, and compare it with the R-P equation. An excellent agreement was found in all of their test cases. In addition, alternative models exist. For example, the Multi-Relaxation-Time model (MRT) was performed by Gai et al. [27] and by Ezzatneshan and Vaseghnia [28]. Furthermore, Peng et al. [1] proposed a two-layer lattice scheme for the interaction force. The advantage of the MRT model lies in its increased stability. In addition, the multi-range force model has a better gas-liquid density ratio [29]. However, these advantages appear to have little impact on the test cases considered in this study based on the existing literature [21, 28]. Considering bubble growth and collapse, excellent agreement was reported both with the original [5, 21, 23] and the enhanced [1] Shan-Chen models.

This study focuses solely on the two-dimensional LBM simulation so that the computational domain is rectangular in every case. The implementation was built upon a publicly available code detailed in [24].

2.2 Description of Rayleigh-Plesset equation

The R-P equation is provided in a cylindrical coordinate system to match the two-dimensional LBM configuration. Considering the incompressible continuity and momentum equations as discussed in [30], the R-P equation takes the form of

$$\begin{aligned} \begin{aligned} \ddot{R}^{\textrm{RP}} = \frac{1}{ \ln \left( R_{\infty }/R^{\textrm{RP}} \right) \cdot R^{\textrm{RP}} } \left[ \frac{p_g^{\textrm{RP}}-p_{\infty }}{\rho _l^{\textrm{RP}}}-\frac{\sigma ^{\textrm{RP}}}{\rho _l^{\textrm{RP}} R^{\textrm{RP}}} -\frac{2 \nu ^{\textrm{RP}}}{R^{\textrm{RP}}} \dot{R}^{\textrm{RP}} \right. \\ \left. +\frac{1 - \left( R^{\textrm{RP}}/R_{\infty }\right) ^2 -2\ln \left( R_{\infty }/R^{\textrm{RP}} \right) }{2} \left( \dot{R}^{\textrm{RP}}\right) ^2 \right] . \end{aligned} \end{aligned}$$
(7)

Here, \(R^{\textrm{RP}}\) is the bubble radius as a function of time which is the primary variable. \(\dot{R}^{\textrm{RP}}\) and \(\ddot{R}^{\textrm{RP}}\) are the first and second temporal derivatives of the radius, respectively. \(R_{\infty }\) is the distance between the centre of the circular bubble and a circular boundary where constant \(p_{\infty }\) pressure is assumed. The surface tension, kinematic viscosity, and liquid density are denoted by \(\sigma ^{\textrm{RP}}\), \(\nu ^{\textrm{RP}}\), and \(\rho _l^{\textrm{RP}}\), respectively. \(p_g^{\textrm{RP}}\) is the gas (vapour) pressure.

Numerical solutions of the Rayleigh-Plesset equation were obtained with MATLAB [31]. To this end, the Dormand-Prince method [32] was used as implemented in the “ode45” function which requires \(R^{\textrm{RP}}(t=0)\) and \(\dot{R}^{\textrm{RP}}(t=0)\) as initial conditions.

2.3 Comparison of the mathematical framework of the lattice Boltzmann and the Rayleigh-Plesset equations

Chapman-Enskog procedure [33] provides a bridge between the Boltzmann and Navier–Stokes equations by proving that the continuum formulation follows from the lattice Boltzmann equations. However, in the transition from non-dimensional to dimensional systems, mismatches often arise. This issue can be resolved based on similarity conditions [24]. In terms of cavitation flows, non-dimensional groups have been identified using Buckingham’s \(\pi\) theorem [34]. For example, \(\pi =\frac{\sqrt{\frac{p}{\rho }\cdot R}}{\nu }\) can be one of the dimensionless groups. However, in the literature [5, 23, 27, 28] investigating cavitation based on LBM, an alternative solution is used extensively where lattice units are substituted into the RP equation. For this reason, the same procedure was followed in this article. For future research, it would be beneficial to study physically realisable cases based on similarity conditions.

The lattice Boltzmann equation imposes a combined Initial Value Problem (IVP) and Boundary Value Problem (BVP) to cover flow physics in the domain of interest \(\Omega\) investigated in a rectangular coordinate system as shown in Fig. 1. From a macroscopic point of view, the initial conditions describe the density and velocity vector fields at the beginning of the observation. In the case of cavitation simulations, initial conditions are set based on the initial bubble radius, and liquid and gas (vapour) density. Boundary conditions require the prescription of the density and velocity vectors at every considered time instant at the domain boundary denoted by \(\partial \Omega\).

In the case of the LBM, the bubble radius \(R^\textrm{LB}\) can be estimated by assuming that the bubble surface is located where the density is equal to the average density of the liquid and gas phases \((\rho _l^\textrm{LB}+\rho _g^\textrm{LB})/2\). In the case of the LBM, liquid density \(\rho _l^\textrm{LB}\) is computed by averaging the macroscopic density at a significant distance from the bubble. The gas density \(\rho _g^\textrm{LB}\) is calculated as an average of the density values at the four central lattices inside the bubble. The liquid and gas pressures are determined following the same strategy.

By comparison, the Rayleigh-Plesset equation is an IVP describing bubble dynamics in a cylindrical coordinate system in this study. To ensure comparability between the solutions obtained from the LBM and the R-P equation, the parameters defining the two problems need to be matched as closely as possible. It is worth noting that because of the mismatching mathematical framework between the lattice Boltzmann and Rayleigh-Plesset equations, there can be multiple ways to match model parameters. Furthermore, it is important to highlight that the details of these calculations were consistently missing from previous publications [5, 23, 27, 28].

The parameters required to solve the R-P equation are obtained from the settings and results of LBM simulations as detailed below. Considering that the kinematic viscosity appears in both Eq. (7) and Eq. (1) (indirectly through the relaxation time), this parameter can be matched directly by setting \(\nu ^\textrm{RP}=\nu ^\textrm{LB}\). Furthermore, the liquid and gas densities and pressures can be matched once they are determined from the LBM simulation as described above: \(\rho _l^\textrm{RP}=\rho _l^\textrm{LB}\), \(\rho _g^\textrm{RP}=\rho _l^\textrm{LB}\), \(p_g^\textrm{RP}=p_g^\textrm{LB}\), \(p_{\infty }=p_l^\textrm{LB}\). Imposing initial conditions for the R-P equation is also relatively straightforward:

$$\begin{aligned} \begin{aligned} R^\textrm{RP}(t=0)=R^\textrm{LB}(t_\textrm{ex}),\\ \dot{R}^\textrm{RP}(t=0)=\dot{R}^\textrm{LB}(t_\textrm{ex}), \end{aligned} \end{aligned}$$
(8)

Here, \(t_\textrm{ex}\) is the time instant corresponding to information exchange from the LBM simulation to the R-P equation. The temporal derivative of the radius from the LBM (\(\dot{R}^\textrm{LB}\)) is calculated based on the first-order forward Euler scheme.

Calculating \(R_{\infty }\) is non-trivial because of the mismatching coordinate systems. Considering the square-shaped LBM domain shown in Fig. 1a, \(R_{\infty }\) can be estimated as the average distance between the boundary and the bubble centre:

$$\begin{aligned} R_{\infty }=\frac{1}{\pi /4} \int _{0}^{\pi /4} \left( \frac{0.5\cdot L_x}{\cos \alpha } \right) d\alpha = \frac{2L_x}{\pi }\log (\sqrt{2}+1). \end{aligned}$$
(9)

Finally, determining \(\sigma _{RP}\) is also non-trivial because the surface tension can be obtained from the LBM only after postprocessing. According to Laplace’s law [22, 35, 36], surface tension can be expressed as

$$\begin{aligned} \sigma ^\textrm{LB}=R^\textrm{LB}\cdot (p_l^\textrm{LB}-p_g^\textrm{LB}). \end{aligned}$$
(10)

Here, \(R^\textrm{LB}\), \(p_l^\textrm{LB}\), and \(p_g^\textrm{LB}\) correspond to a steady state solution of the LBM where the bubble reached equilibrium. Thereafter, \(\sigma ^{RP}=\sigma ^\textrm{LB}\) is set.

Table 1 lists the key differences between the LBM and the R-P equation. To compare the results obtained by these two methods, the relative radius difference is introduced as

$$\begin{aligned} \Delta R=\frac{R^\textrm{LB}-R^\textrm{RP}}{R^\textrm{RP}}. \end{aligned}$$
(11)

In the following sections, the results will be analysed to shed light on the key factors which cause differences between LBM and R-P equation predictions in terms of bubble dynamics. After matching the parameters of the two models, the first time point corresponding to \(\Delta R>5\%\) is identified to assess the interval within which predictions overlap relatively well.

Table 1 Comparison between the mathematical frameworks employed in the lattice Boltzmann method and the Rayleigh-Plesset equation

2.4 Problem statement and the test cases

LBM simulations take place in a two-dimensional rectangular domain denoted by \(\Omega\) bounded by the \(\partial \Omega\) curve as mentioned earlier. The domain size is determined by the x-directional and y-directional sizes \(L_x\) and \(L_y\). In the following, case descriptions are provided summarising the initial and boundary conditions for the macroscopic velocity \(\varvec{u}\) and density \(\rho\). This study uses periodic boundary conditions or boundary conditions with prescribed velocity and density based on the full-way bounce-back condition. The latter is established with a full-way bounce-back boundary condition [25] imposed on the probability density functions f. The EOS governed by Eq. (6) provides a unique relationship between density \(\rho\) and the pressure p, so that boundary conditions can be also formulated for p instead of \(\rho\).

Fig. 1
figure 1

Problem statement of the simulation a bubble simulation b flat interface simulation

2.4.1 Flat interface case

In the flat interface case, the width of the domain \(\Omega\), \(L_x\), is set to 20 (lattice length unit) l.u., and the height, \(L_y\), to 200 l.u. In the middle of the domain, a layer with gas phase is initialised with macroscopic density \(\rho _g^{LB}\). At the top and the bottom, the liquid phase is present, where initial density \(\rho _l^{LB}\) is implemented. In the flat interface simulations, periodic boundary conditions are enforced along the x and y directions at \(\partial \Omega\). In addition, the interface between the liquid and gas phases is smoothed following the configuration of Huang et al. [37] as

$$\begin{aligned} \rho (y)&= \rho _g^{LB}+\frac{\rho _l^{LB}-\rho _g^{LB}}{2} \times {\text {abs}}\left\{ \tanh \left[ \frac{2(y-50)}{5}\right] \right. \\ & \quad \left. -\tanh \left[ \frac{2(y-150)}{5}\right] \right\} , \end{aligned}$$
(12)

During this test case, the critical temperature is kept constant while the temperature is changed. After reaching the equilibrium state, the densities of liquid and gas were recorded for every temperature. The equilibrium state is defined as the condition when the change in density between two iterations is less than \(10^{-4}\) [\(\mathrm {m.u.\cdot l.u.^{-3}}\)]. To be more clear, the initial condition and boundary condition of this case is summarized as follows,

  • there are 2 liquid layers with a vapour layer between them as shown in Fig. 1.

  • The initial density is given by Eq. (12)

  • the initial velocity vector is \(\varvec{0}\)

  • periodic boundary conditions are imposed in both the x and the y directions

2.4.2 Bubble equilibrium case

In the bubble equilibrium case, \(L_x\) and \(L_y\) are equal, forming a square domain in region \(\Omega\). Inside the bubble, the gas pressure \(p_g^{LB}\) and the density of gas \(\rho _g^{LB}\) are set. Different bubble radii \(R^{LB}\) are set. In this case, a periodic boundary condition is enforced in both x and y direction and three radii of 20 [l.u.], 25 [l.u.], 30 [l.u.] with a domain size of 100 [l.u.] is set. An initial smooth interface with initial radius \(R_{init}^{LB}\) was implemented on the bubble interface with 5 lattices for better stability according to Peng et al. [1].

$$\begin{aligned} \begin{aligned} \rho (x,y)&=\frac{\rho _l^{LB}+\rho _g^{LB}}{2}+\frac{\rho _l^{LB}-\rho _g^{LB}}{2} \cdot \\&\tanh \left( \frac{2(\sqrt{(x-0.5\cdot L_x)^{2}+(y-0.5\cdot L_y)^{2}}-R_{init}^{LB})}{5}\right) \end{aligned} \end{aligned}$$
(13)

The initial and boundary conditions of Laplace’s law validation case are as follows,

  • The initial density is given by Eq. (13)

  • the initial velocity vector is \(\varvec{0}\)

  • periodic boundary conditions are imposed in both the x and the y directions

2.4.3 Bubble growth and collapse

In this case, a full-way bounce-back boundary condition with a constant pressure boundary condition was implemented to validate the R-P equation. A smooth interface was also implemented based on Eq. (13). The equilibrium densities of the liquid and gas, taken from Maxwell’s area construction based on the C-S EOS, are 0.33 and 0.011, respectively. To trigger the growth and collapse of the bubble, densities different from the equilibrium density of the liquid on the boundary were implemented, which are 0.34 for collapse and 0.31 for growth, respectively. Furthermore, 1000 time steps were simulated for a sufficiently long time for bubble growth and collapse. The domain size for the bubble simulation is set to be square, including 100 [l.u.], 200 [l.u.], 400 [l.u.] and 1000 [l.u.]. The initial \(\varvec{u}=\varvec{0}\) and boundary condition of bubble case with prescribed density boundary condition ( \(\rho\), also prescribed pressure p as dictated by the EOS presented in Eq.(6)) are as follows,

  • The initial density is given by Eq. (13)

  • the initial velocity vector is \(\varvec{0}\)

  • full-way bounce-back boundary conditions are imposed in both the x and the y directions

To analyse the impact of domain size, radius, and boundary condition in the bubble case with constant pressure boundary condition, different cases were tested as listed in Table 2.

Table 2 Parameters of the test cases conducted with the lattice Boltzmann method to investigate single bubble dynamics

3 Results and discussion

3.1 Maxwell’s area construction validation

To validate the thermodynamic consistency, the Maxwell’s Area construction was validated. For simplicity, the reference data were digitised from Peng et al. [1]. As can be seen from Fig. 2a, the LBM results are close to the reference data, which validates our code for thermodynamic consistency.

3.2 Laplace’s law validation

As can be seen from Fig. 2b, the bubble gradually evolves to the equilibrium state with periodic boundary conditions. As can be seen from Fig. 2c, the results from LBM are in satisfactory agreement with the Laplace’s law. The results also agree well with previous findings [27, 28]. As suggested by Equation (10), the slope of the line presented in Fig. 2c is used to obtain the surface tension from the LBM simulation. This parameter was then provided as input to simulations based on the R-P equation detailed in the next section.

Fig. 2
figure 2

Laplace’s law and Maxwell’s Area Construction, reference data from Peng et al. [1] a Maxwell’s area Construction b different bubble radius simulation c Laplace’s law validation

3.3 The impact of initial condition

Figure 3a and b state that the trends agree qualitatively well with previous observations regarding bubble growth and collapse in the case of the LBM [23, 28]. The outcomes obtained under distinct initial conditions of the R-P equation in Fig. 3c and d manifest a noteworthy influence on the validation of LBM against the R-P equation. Particularly in the case of collapse scenarios, the R-P equation with the initial condition of LBM at time zero exhibits deviation in the initial stages. The observed trend indicates that with an increase in the iterations from the initial condition in LBM, the difference between LBM and R-P diminishes. This phenomenon may be attributed to the need for fluid flow to develop inside the domain to ‘wash out’ the effect of the initial condition and thus reach a physically relevant state. It is worth recognising that the difference between R-P and LBM predictions is increasing monotonically as a function of time in every case. Notably, in the investigation conducted by Peng et al. [1], disparities are noted at the initial stages despite the implementation of variable pressure boundary conditions.

However, initializing the R-P equation with LBM conditions at \(t_{ex}\) = 100 [t.u.] and \(t_{ex}\) = 150 [t.u.] yields a considerably smaller difference. The marginal reduction in difference when moving from an initial condition at \(t_{ex}\) = 100 [t.u.] to \(t_{ex}\) = 150 [t.u.] suggests that \(t_{ex}\) = 100 [t.u.] is a sufficiently late time point for initializing the R-P equation for subsequent comparisons. This decision is supported by the minimal additional accuracy gain observed at \(t_{ex}\) = 150 [t.u.], indicating that \(t_{ex}\) = 100 [t.u.] serves as an appropriate and pragmatic choice for initial conditions in later comparative analyses. In the study conducted by Ezzatneshan and Vaseghnia [28], the graphical comparison between the LBM and the R-P equation, particularly in the context of minimal pressure differences, reveals a significant difference between the two methods during the initial stages, underscores a notable difference at the initial stages. This discrepancy clearly shows how initial conditions significantly impact the validation and accuracy of the LBM compared to the R-P equation, underlining their crucial role in computational modelling and method comparison.

Fig. 3
figure 3

The impact of initial condition. R-P equation with initial condition of LBM at time 0, 50, 100, 150 [t.u.]. Where \(R^{LB}\) is the radius of LBM results and \(R^{RP}(t_{ex}=0)\), \(R^{RP}(t_{ex}=50)\), \(R^{RP}(t_{ex}=100)\), \(R^{RP}(t_{ex}=150)\) are the initial radius of R-P equation with time instant (0, 50, 100, 150) [t.u.] which corresponding to information exchange from the LBM simulation to the R-P equation. \(|R^{RP}(t_{ex})-R_{LB}|\) denotes the absolute radius difference (\(\Delta R_{abs}\)) between LBM and R-P equation. a growth case b collapse case c absolute radius difference of growth case d absolute radius difference of collapse case

3.4 The impact of domain size

In the data delineated in Fig. 4, variations in domain size yield disparate results when compared with the R-P equation. Figure 4a–d present the outcomes associated with domain sizes of 100 [l.u.], 200 [l.u.], 400 [l.u.], and 1000 [l.u.], respectively. Specifically, we define a critical point for each domain size iteration: this is the juncture at which the relative difference of radius (\(\Delta R\)) between the R-P equation’s predictions and the LBM outcomes crosses a threshold of 5%. Notably, in the context of growth scenarios with the same \(R_{\infty }\) setting, the domain sizes of 400 [l.u.] and 100 [l.u.] exhibit inferior performance compared to those of 1000 [l.u.] and 200 [l.u.]. This outcome is unexpected and does not allow for the establishment of a clear relationship between the domain size and the overlap of the R-P and LBM simulations. Conversely, in collapse scenarios, a satisfactory match is observed only with the domain size of 100 [l.u.], suggesting that the radius is a primary influencing factor-a topic that warrants further investigation. For collapse cases, the influence of the boundary diminishes in larger domain sizes; hence, maintaining the same \(R_{\infty }\) setting leads to some discrepancies. Some previous publications reported similar discrepancies concerning the domain size [21] whereas others did not mention such issues [28]. In addition, a detailed rationale for this specific selection of domain dimensions was not provided. Furthermore, a comprehensive analysis of boundary effects was also not mentioned [1]. Nonetheless, this analysis underscores the necessity of careful consideration regarding the impact of boundaries, as their influence remains notable even in considerably large domains, particularly after a certain iteration threshold is surpassed.

Fig. 4
figure 4

The impact of domain size on growth and collapse case for radius 30 [l.u.]. a domain size=100 [l.u.], b domain size=200 [l.u.], c domain size=400 [l.u.]. For this case of growth, the 5% threshold that was defined previously is not reached at the end of the simulation. d domain size=1000 [l.u.]

Fig. 5
figure 5

density contour of the bubble with domain size 400 [l.u.] and initial radius=30 [l.u.]. a iteration=0 [t.u.], b iteration=100 [t.u.], c iteration=200 [t.u.], d iteration=500 [t.u.]

The discrepancy observed in the final stages of collapse can be attributed to significant diffusion effects, particularly when the bubble diminishes to a minimal size. As illustrated in Fig. 5d, which shows a close-up contour, pronounced diffusion is evident during the collapse phase of the bubble. Furthermore, the choice of pressure averaging strategy contributes marginally to the variations in outcomes. For this study, a centred-pressure averaging strategy was employed to maintain simplicity in methods. In the modified R-P equation, the parameter \(R_{\infty }\) is adjusted due to the original formulation’s assumption of an infinite boundary, which impacts the outcomes. It is conceivable that in existing literature [5, 23, 27, 28], this parameter has been fine-tuned to match the results of the R-P equation with those obtained from LBM simulations. However, no universally optimized parameter is applicable across all cases. The selection of the parameter in this article is based on an area-weighted length within a square domain.

3.5 The impact of radius

In the analysis of radius-related outcomes depicted in Fig. 6, a discernible trend is observed, whereby an increase in the radius correlates with a rise in the specific iterations required to achieve a 5% discrepancy of \(\Delta R\). This pattern is particularly pronounced when comparing a radius of 350 [l.u.] with one of 35 [l.u.], where the iterations necessary to reach the 5% difference threshold are significantly more extended for the larger radius. Notably, the relationship between the radius and the number of iterations appears to be almost linear. Furthermore, toward the end of the simulation, the radius difference consistently remains substantial, potentially attributable to the inadequate resolution when dealing with smaller bubbles. This observation underscores the pivotal role of radius in impacting the outcomes of simulations. This conclusion is in concordance with the findings presented by Ezzatneshan and Vaseghnia [22], who reported a decreasing discrepancy with increasing radius in the initial phases of their study. Similarly, the research by Peng et al. [1] on a growth case showed a marked deviation towards the end of the simulation, especially pronounced at smaller radii. In addition, at the end of the simulation, there is always a discrepancy, and this discrepancy increases with the number of iterations, regardless of the bubble’s radius. The reason for this is partly because diffusion occurs at the end of the simulation, as shown in Fig. 5d.

Another reason for that is that this is a nonlinear phenomenon and initial differences are being amplified as time passes. The rapidly growing difference between the LBM and R-P predictions is clearly observable in Fig. 3c, d. It remains unclear to what extent this increasing difference is caused by the diffusing interface in the case of the LBM and other factors, such as the presence of weakly compressible effects in LBM. Furthermore, the study conducted by Gai et al. [27] also provides empirical evidence in support of this observation. Their findings, particularly in the context of the collapse case simulations, reveal discernible discrepancies between the results obtained from the LBM and those predicted by the R-P equation toward the end of the simulation. Additionally, the research conducted by Peng et al. [23] provides further evidence of this phenomenon. Particularly in the collapse case simulations, their findings exhibit certain discrepancies.

Fig. 6
figure 6

The impact of radius with domain size \(L_x=L_y=1000\) [l.u.] and initial condition from LBM at time 100 [t.u.] a radius from 20 to 35 [l.u.], b log-log plot of radius including 20, 25, 30, 35, 350 [l.u.]

4 Conclusions

This article performed the LBM simulation of a single bubble based on the Shan-Chen Model. Then validate the results against Laplace’s law, Maxwell’s area construction, and R-P equation. Based on the provided results and discussion, the following conclusion can be drawn,

  • Good agreements were found in Laplace’s law and Maxwell’s area construction benchmark cases but not in the R-P equation case.

  • Integrating initial conditions from the LBM into the R-P equation at time zero (t=0 t.u.) shows a notable discrepancy between the models, highlighting the R-P equation’s sensitivity to initial states from LBM simulations. However, using initial conditions from LBM at time 100 [t.u.] significantly improves model alignment, whereas starting from time 150 [t.u.] offers minimal additional benefit. This indicates that while using later initial conditions from LBM reduces discrepancies with the R-P equation, the improvement plateaus, making the initial condition at time 100 [t.u.] optimal for balancing model agreement and efficiency.

  • The domain size and the parameter \(R_{\infty }\) play pivotal roles in aligning the results between the LBM and the R-P equation. The parameter \(R_{\infty }\) defines the distance from the center of the bubble to the domain boundary. Notably, in LBM, the domain is square, whereas it is cylindrical in the context of the R-P equation. This discrepancy leads to a difference in the influence of the boundary of the domain between LBM and the R-P equation. However, there are no established methods for determining the optimal value of \(R_{\infty }\). It has been observed that there is no universally optimal \(R_{\infty }\) that is applicable across all domain sizes, as each domain size uniquely influences the outcomes. The literature suggests that authors may fine-tune \(R_{\infty }\) to achieve congruence between the LBM and R-P equation results.

  • An analysis of the simulation data reveals an approximately linear relationship between the radius and the iteration at which the difference between the LBM and the R-P equation reaches a 5% threshold. Furthermore, a consistent observation towards the end of the simulation is the presence of a significant discrepancy. This is partly attributed to the insufficient resolution within the bubble when it becomes exceedingly small. However, bubble diffusion at small radii does not explain the discrepancies which are growing rapidly as a function of time even in the case of large bubbles

This study serves as a foundational exploration preceding future endeavours in simulating bubble cluster dynamics.