The smoothness of surface shape is one of the key issues to simulate coalescence of underwater bubbles. In this paper, B-spline closed curve is used to realize the visual simulation of multibubble coalescence. The main idea of the proposed algorithm is to construct a continuous bubble deformation which is guided by the normal direction of each control point and weighted by the distance from the point to the geometry center of the contour. The advantages of this algorithm include the smoothness of the bubble contour in the processing of deformation and the randomness of dynamic process and coalescence process. Experiment results show that the simulation algorithm works well and can be used in 3D computer games and animations.
National Natural Science Foundation of China516720281. Introduction
The bubble phenomenon is a common natural phenomenon that occurs in carbonated drinks, waste water, the breath of fish in the water, etc. It is widely considered in various disciplines and industries. Here are three classical applications and literatures.
In the petrochemical industry, during oil production and transmission, artificial injection bubbles can carry heavy oil from the ground to the surface [4]; the secondary-metallurgical treatment of the liquid steel relies on the injection of purge gas for improving the steel cleanliness [19]. In addition, liquid gas reactors depend on the interaction of bubbles to change the contact area of different phases [16].
In materials science, due to the different mechanical properties of nitrogen bubbles with different diameters on metals, the mechanical effects of nitrogen bubbles and their polymerization behavior on HCP rep-Zr alloy were studied [24]. The stability of bubbles and the potential effects of their interactions are also studied [30]. The interaction between bubbles in liquid affects the mass transfer performance of bubbles [2].
In movies and games, bubble simulation is a common material, as shown in Figure 1. It enhances the user experience in entertainment systems [5, 25, 29] and the reality visualization effect [33]. Kakuta et al. proposed a mixed reality application for enjoying playing with soap bubbles [17]. Jeong-Mo applied bubble research to animation and game creation based on bubble simulation [15]. Urikovic took a complete computer simulation of a soap bubble from a dynamics perspective and discusses the animation of bubbles [31]. Kunimatsu et al. used computer graphics to animate the phenomenon of throwing the jar into the sink, and the resulting individual bubbles move through the tank [22].
Bubbles are used in 3D games. The image is a screen shot of a frame from the mobile game, Feeding frenzy, https://apps.apple.com/cn/app/id1295428885.
As we often encounter multiple bubbles or groups of bubbles in these practices, it is important to fully understand the interaction and binding of bubbles in a fluid [13, 32]. Coalescence is one key behavior of bubbles and simulated in many literatures [6–8, 14]. These literatures focus on the effects of initial bubble spacing, size and arrangement angle on the coalescence process, the changes in contour [20], the rise velocity and shape of bubbles in pure water [9], the pressure field around the bubble [7, 14], and so on.
In general, coalescence of two bubbles takes place in three main steps: bubble collision and deformation, film drainage, and film rupture [19]. Kee and Chhabra [18] observed the bubble shape and coalescence behavior by using high-speed camera technology and investigate the effects of rheological properties and surface tension on bubble properties and coalescence. Li et al. [28] numerically simulates the interaction of bubbles online to obtain the effect of dimensionless distance on the coalescence of bubbles.
For a long time, many scholars have conducted extensive research on bubble behavior [26] and established a relatively sound theoretical basis. However, existing methods mainly study behaviors of one or two bubbles and pay a little attention on the smoothness of the contour of bubbles after coalescence. In the view of computer games, visual effects and the game experience in some cases are more important than physics demands [29]. We in this paper emphasize on the smoothness of the contour and the visualization of multibubble coalescence phenomenon, which results in solving issues as follows:
Multibubble coalescence rules and deformation rule are built to guide the implementation of the visualization algorithm
The contour in 2D and the surface in 3D of a bubble should be C1-continuous, so the smoothness of the bubble contour in the processing of deformation is kept
The multibubble coalescence algorithm is developed
2. Method
For visualizing the process of multibubble coalescence, the surface model, the continuous deformation, and rules of motion should be addressed in advance.
2.1. Modeling Surface of a Bubble
For the case of small size bubble, its shape can be represented by a sphere [3] or an ellipsoid [1, 12]. However, in most cases, the contour of a bubble is not a simple sphere or a circle, and it can be approximated by a Fourier series [10, 11] or other functions. Given the coalescence of two bubbles from any directions, methods that use x-axis or y-axis as symmetry axis to model contour and surface are not ideal. Given the closed B-spline shows the advantage of the design deformability and flexibility [35], we here use the closed B-spline method to model the contour of a bubble.
Let Pi, i=1,2,⋯,n, be the control points which denote a sequence of ordered data points on the bubble curve. Let
(1)Cu=∑i=0nNi,puPi,denote a B-Spline curve to be determined to approximate the bubble curve. In formula (1), Ni,pu are the B-spline basis functions of a certain order and can be expressed as follows:
(2)Ni,0u=1,ui≤u≤ui+10,otherwise,Ni,pu=u−uiui+p−uiNi,p−1u+ui+p+1−uui+p+1−ui+1Ni+1,p−1u.
We illustrate the calculation of the contour after coalescence of two bubbles in two-dimensional (2D) case. Let a bubble be displayed by a circle or a set of contour points which are ordered and represent discrete closed curve before coalescence. When two bubbles are too closed, the coalescence occurs due to interbubble attraction, as shown in Figure 2(a). For obtaining the new contour of the bubble, we at first find the intersection points (points A and B, denoted by red points) of two curves with Little’s method [23]. Then, those inner points (P1, P2, Q1, and Q2) are detected with Kpalma’s method [21] and removed. Finally, we fit those contour points by the closed B-spline method, as shown in Figure 2(b).
Fit the contour of two coalesced bubbles using B-spline curves. (a) Find intersection points and detect contour points. (b) Remove points that are located in the inner area, and fit those contour points by the closed B-spline method.
For building the 3D surface of bubble, the surface can be obtained as an axis-symmetric surface of rotation. In our experiments, the perpendicular bisector of the line segment AB in Figure 2(a) is used as the axis of symmetry. Figure 3(a) shows another contour with the axis of symmetry. Figure 3(b) is the surface that generated by axis-symmetric surface of rotation using the contour points of Figure 3(a).
From contour to 3D surface using axis-symmetric surface of rotation. (a) Contour of bubble and the axis of symmetry. (b) The generated 3D surface.
2.2. Continuous Deformation
After coalescence, the contour of two coalesced bubbles will continuously deform over time due to the combined effects of multiple forces, including surface tension and water pressure. Then, a method of contour deformation guided by the normal direction and weighted by the distance from the point to the geometry center of the contour is proposed. Let Pi, i=1,2,⋯,n, be the control points located on the contour, n→i be the unit normal direction of Pi, and di be the Euclidean distance from Pi to the geometry center point C of the contour, as shown in Figure 4.
Deformation of the contour after coalescence.
At first, we calculate the average distance d¯ from contour to the bubble center. There are two cases. The first case occurs when two bubbles coalesce.
(3)d¯=r12+r221/2,where r1 and r2 are the radii of two bubbles before coalescence. Accordingly, if the simulating is experimented in 3D space, the average distance d¯ from contour to the bubble center is calculated with the following formula.
(4)d¯=r13+r231/3.
Formulas (3) and (4) are, respectively, used for keeping the area and volume unchanged after coalescence.
The second case is for the deformation of one bubble that changes with time.
(5)d¯=1n∑i=1ndi.
Then, the moving step τiof the control point Pi is
(6)τi=ηdi−d¯dmax−dmin,dmax>dmin,0,dmax=dmin,where η is a positive number specified by user, and
(7)dmax=maxdj,j=1,2,⋯,n,dmin=mindj,j=1,2,⋯,n.
The control point Pi moves to the new position Pi′, as
(8)Pi′=Pi−τin→i,i=1,2,⋯,n.
When all control points move to the new positions, the contour can be updated with the closed B-spline fitting.
Note that:
The parameter η is used to adjust the speed of deformation
If the contour is a circle, then dmax=dmin, and the contour keeps the same shape. Therefore, the end shape of the contour is a circle or a sphere
In our experiment, the normal direction of control point is away from the center point C. If τi>0, i.e., di>d¯, the control point Pi moves towards to the center point C, and vice versa
These proposed formulas can be applied to a three-dimensional (3D) coalescence simulation
2.3. Rules of Motion
In this paper, motion features of bubbles include rising speed, small random swing, and coalescence.
In still water, the rising speed vt of a bubble is related to its volume V, the height H from the bubble to the water surface.
(9)vt=fV,H.
When both H and the change of bubble shape are small, fV,H can be a linear function, which is easy to calculate and real time in computer games. So, the contour points rise according to the formula
(10)Pi′=Pi+vt,i=1,2,⋯,n.
Adding small random swing to the rising bubbles can improve the effect of coalescence and reality. In our experiment, the direction of rising of a bubble is with random disturbance.
(11)Pi′=Pi+ε,i=1,2,⋯,n,where ε~N0,σ2 and σ is specified by user.
In summary, according to formulas (10), (11), and (8), the moving of a bubble is
(12)Pi′=Pi−τin→i+vt+ε,i=1,2,⋯,n.
As for coalescence of two bubbles, if the bubbles are spherical [14], then we can use the bubble radii and the distance between sphere centers to determine whether the two bubbles are intersected or compatible; if the contour of at least one bubble is represented by discrete points, we use with Little’s method [23] to determine whether the two bubbles are intersected and get the intersect points if there are.
2.4. Algorithm of Coalescence
In this subsection, we summarize the algorithm for simulating the process of multiple bubble coalescence.
Let the number of bubbles is N, the coordinates of control points of the kth bubble be Pik, where k=1,2,⋯,N; i=1,2,⋯,nk. The simulation time T is represented by the number of iterates Ic, the still rising speed is v, and the random factor is σ.
Since the deformation of contour is guided by both the normal direction and the distance of contour point to the center of bubble, the proposed algorithm of bubble coalescence is named NDgBCA (Algorithm 1).
Algorithm 1: NDgBCA.
Input: the number of bubbles N; the coordinates Pik of bubble contour control points; the number of iterates Ic and the still rising speed v; the random factorσ.
Output: the updated contour control points of bubbles Pik.
Step 1: The current bubble number N′←N.
Step 2: while Ic>0.
Step 3: All bubbles rising according formula (12).
Step 4: For each bubble, fit those contour points by the closed B-spline method [35].
Step 5: Detect whether there are coalescence occurring in the new positions.
Step 6: If there are coalescence,
Step 7: Find the intersection points using Little’s method [23].
Step 8: Detect and remove the inner points using Kpalma’ method [21];
Step 9: Fit those contour points by the closed B-spline method [35];
Step 10: Update the contour points and the current bubbles number N′.
Step 11: End If
Step 12: Ic=Ic−1.
Step 13: End while.
returnPik,k=1,2,⋯,N′.
According to Algorithm 1, the time complexity is ON2×Ic, because we use enumerate method to detect the coalescence between any two bubbles in Step 4.
3. Experiments
All experiments are done on a laptop computer, with an Intel Core i7-4710MQ CPU@2.50 GHz processor and 4.0 G memory. Our algorithm is implemented in Matlab (2012 version) language. We test our algorithm (NDgBCA) with several experiments: two bubbles in the horizontal line, coalescence occurs from any direction, multiple bubble coalescence, and summary of the information of bubbles after coalescence.
3.1. Two Bubbles in the Horizontal Line
Many papers focus on the case, coalescence of two 2D bubbles in horizontal direction [11, 14]. Bubbles are generated with mathematical method. In this experiment, r1=r2=0.6, the centers of two circles are (-0.5, -1.8) and (0.5, -1.8). H=40 is the final height of rising. vx=0, which means that the bubble does not move in the horizontal direction. vy=H/f, where f is the number of simulation steps and also represents the number of iterates in simulation process. In this experiment, f=10, and ten key frames captured from the simulation of the coalescence process are shown in Figure 5.
Coalescence of two 2D bubbles in horizontal direction.
t=0.1
t=0.2
t=0.3
t=0.4
t=0.5
t=0.6
t=0.7
t=0.8
t=0.9
t=1.0
3.2. Coalescence from Any Direction
Only small ratio of literature studies the case about coalescence of two 2D bubbles which occurs in any direction. In our experiment, bubbles are represented by circles and generated with mathematical method. Let r1=0.5163 and r2=0.64798, the centers of two circles are (-0.62034, -1.56054) and (0.2911, -1.9122). H=40, vx=0. The bubble does not move in the horizontal direction. vy=H/f. Ten key frames (f=10) captured from the simulation of the coalescence process are shown in Figure 6.
Coalescence of two 2D bubbles in nonhorizontal direction.
t=0.1
t=0.2
t=0.3
t=0.4
t=0.5
t=0.6
t=0.7
t=0.8
t=0.9
t=1.0
3.3. Multiple Bubble Coalescence
The coalescence of several bubbles is simulated with two experiments: bubbles with constant rising speed or with variable speed.
For the case of constant rising speed, i.e., vy=H/f, we assume
The number of initial bubbles is 6
In the horizontal direction allowing the random swing, vx≠0. The swing distance τx abides the scaled standard normal distribution N (0, 1) with limited bound σ
(13)τx=−0.1σ,τ<−σ,0.1τ,−σ≤τ≤σ,0.1σ,τ>σ,where τ abides standard normal distribution N (0, 1), and σ is specified by user. In our experiment, σ=0.8.
The radius ri of each bubble abides by uniform distribution U [0.30, 0.70]
The center position (xi,yi) of each bubble is randomly in the rectangle −3,3×−3,−1
The simulation results are shown in Figure 7(a). From bottom to top, 6 bubbles coalesce and become 5 bubbles at last.
Coalescence of multiple 2D bubbles. (a) 6 bubbles with constant speed (dvy/dt=0). (b) 5 bubbles with variable speed (dvy/dt≠0).
For the case of variable rising speed, i.e., dvy/dt≠0, referring that the trailing bubble has the higher acceleration [19], we assume that the rising speed vy is inverse to the distance from current position (Ho) to the top (H) of water surface, which can be calculated with formula (14).
(14)vy=Hf1+ζ1−HoH,where parameter ζ is a positive number and specified by user. Under this assumption, the trailing bubble has a chance to be coalesced to the former bubble.
We conduct a simulation experiment using 5 initial bubbles and the assumption. The simulation results are shown in Figure 7(b). From bottom to top, 5 bubbles coalesce and become 3 bubbles at last. The coalescence of two bubbles on the left illustrates the coalescence effect of formula (14).
3.4. Visualization with 3D Surface
In order to enrich a real environment with virtual information, we can use axial symmetry technology to generate 3D surface of bubble (Figure 3) and merge these 3D bubbles into an underwater image, as shown in Figure 8. From the bottom to the top in the figure, it can be found that after coalescence, the bubble gradually develops into an ellipsoid or a sphere, which is the same as the statement in other literatures [19]. From this example, it is obvious that our method can be used to add bubbles in some computer games and improve the visual effect.
Coalescence of multiple 3D bubbles merging to an underwater image.
3.5. Performance Analysis
This subsection discusses the performance of the proposed algorithm (NDgBCA). All these data are illustrated with the data from the last experiment, i.e., Figure 8.
The model complexity is represented by the number of points of a curve or the number of polygons of a mesh surface. In this experiment, the number of bubbles is 5. For each bubble, its radius is in [0.40, 0.80], and the number of points that represent the contour is 90. After axial symmetry rotation, the numbers of vertices and polygons of each 3D bubble are 1622 and 3240, respectively.
The time complexity is represented by running time of each step of the coalescence processing. In Figure 9, the blue curve is the running time in each step. The average time of each step is 0.10 seconds. The first step is to generate 5 bubble contour points, and the other steps are corresponding to the proposed algorithm that detect coalescing or not and update the contour if coalescence cost only 5% of whole time. Most of the time is spent in calculating continuous deformation and generating 3D mesh bubbles.
Time consumption in each step of the coalescence processing.
The orange curve is the cumulative time, and it shows a liner curve, which means that the algorithm is stable in the simulation iteration processing.
4. Discussion
The behavior of underwater bubbles is very complex. Our method emphasizes on visual effects of bubble coalescence and pays little attention on the physical theory. As mentioned in [29], creating the underwater feeling is a tricky balance between reality and game experience. So, our method is particularly suited for visualizing bubble coalescence in the underwater computer games.
Although particle system gets good performance when simulating small particle motion, fire and liquid [27], for example, literature [29] uses particle system to create bubbles uniformly; some parameters of particle systems are not open and cannot be dynamically adjusted during operation. Therefore, its performance is limited. Our method is easy to use because there are only a few parameters, including initial radii and the number and locations of bubbles, which are set at the beginning of the NDgBCA. In addition, our method also shows more details of bubble coalescence process and achieves better visualization effect.
Comparing to the method of using fitting curves [34] to visualize the bubble coalescence process in horizontal direction, the proposed method shows an advantage of displaying the coalescence process of two bubbles in any direction. If a bubble pair coalesces in the vertical direction, the coalescence effect visualized with our method is in line with the results from the experimental investigation of bubble coalescence [19], as shown in Figure 10, and numerical simulation [36]. Figure 10(a) displays their sequence of key frames acquired by a high-speed video camera and one of the bubble coalescence processes is marked by a yellow arrow [19]. Figure 10(b) shows our simulation results. In the simulation experiment, we adopt an assumption that for two bubbles on the vertical line, the trailing bubble is accelerated to approach the leading bubble, resulting in the coalescence of the two bubbles [36].
Comparing coalescence process of 3D bubbles in vertical direction to photo (from literatures [19]).
Image from literatures [19], and coalescence events are marked by yellow arrows
Sequence of key frames are captured using our method
It is interesting that the phenomenon of droplets has a similar coalescing process [26], which means that the proposed method can be used to visualize droplet coalescence with minor modifications based on the force analysis of droplets.
5. Conclusions
In this paper, a novel algorithm (NDgBCA) is proposed for simulating the multiple bubble coalescence. In the simulating, the continuous bubble deformation process is guided by the normal direction of each control point and weighted by the distance from the geometry center of the contour. The advantages of this algorithm include two aspects. The one is that the contour surface is uniform and smooth. The other is that it can simulate the coalescence of bubbles of different sizes from any angle and direction.
Data Availability
The data used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This work is supported by the National Natural Science Foundation of China under grant no. 51672028.
AbbasF. I.Al-ZukyA. A. D.Al-TaweelR. S. H.Mathematical models for movement bubble in the water based on the capture images using SONY camera20154333343AboulhasanzadehB.TryggvasonG.Effect of bubble interactions on mass transfer in bubbly flow20147939039610.1016/j.ijheatmasstransfer.2014.08.0272-s2.0-84906840606AganinA. A.KosolapovaL. A.MalakhovV. G.Numerical simulation of the evolution of a gas bubble in a liquid near a wall2018101899810.1134/S20700482180100272-s2.0-85042560815BandaraU. C.YapaP. D.Bubble sizes, breakup, and coalescence in deepwater gas/oil plumes2011137772973810.1061/(ASCE)HY.1943-7900.00003802-s2.0-79960135202BernhauptR.PirkerM.DesnosA.The bubble user interface: a tangible representation of information to enhance the user experience in iptv systemsProceedings of the 2014 companion publication on Designing interactive systems - DIS Companion '142014New York, NY, USA858810.1145/2598784.26027892-s2.0-84904466728BusaryevO.DeyT. K.WangH.RenZ.Animating bubble interactions in a liquid foam20123141810.1145/2185520.21855592-s2.0-84871739814ChenR.YuH. W.ZhuL.PatilR. M.LeeT.Spatial and temporal scaling of unequal microbubble coalescence20176341441145010.1002/aic.155042-s2.0-85028247392CliftR.GraceJ. R.WeberM. E.1978New YorkAcademic PressDuanG.KoshizukaS.ChenB.A contoured continuum surface force model for particle methods201529828030410.1016/j.jcp.2015.06.0042-s2.0-84942085724DuineveldP. C.The rise velocity and shape of bubbles in pure water at high Reynolds number199529232533210.1017/S00221120950015462-s2.0-0029310890DuineveldP. C.BiesheuvelA.HeijstG. F.vanBouncing and coalescence of bubble pairs rising at high Reynolds number in pure water or aqueous surfactant solutions199845DordrechtSpringer409439Fluid Mechanics and its Applications10.1007/978-94-011-4986-0_21EllingsenK.RISSOF.On the rise of an ellipsoidal bubble in water: oscillatory paths and liquid-induced velocity200144023526810.1017/S00221120010047612-s2.0-0035839242FANW.MAY.LIX.LIH.Study on the flow field around two parallel moving bubbles and interaction between bubbles rising in CMC solutions by PIV200917690491310.1016/S1004-9541(08)60295-52-s2.0-73149115312HanR.LiS.ZhangA. M.WangQ. X.Modelling for three dimensional coalescence of two bubbles2016286, article 06210410.1063/1.49531752-s2.0-84973573547HongJ. M.KimC.-H.Animation of bubbles in liquid200322325326210.1111/1467-8659.006722-s2.0-0141504436JainD.LauY. M.KuipersJ.DeenN. G.Discrete bubble modeling for a micro-structured bubble column201310049650510.1016/j.ces.2013.02.0602-s2.0-84880698242KakutaH.OkunoY.AsaiK.TakayamaT.Jellyfish party: blowing soap bubbles in mixed reality spaceThe Second IEEE and ACM International Symposium on Mixed and Augmented Reality, 2003. Proceedings2003Tokyo, Japan, Japan35810.1109/ismar.2003.12407592-s2.0-84911389705de KeeD.ChhabraR.A photographic study of shapes of bubbles and coalescence in non-Newtonian polymer solutions198827665666010.1007/BF013374622-s2.0-13144305145KeplingerO.ShevchenkoN.EckertS.Visualization of bubble coalescence in bubble chains rising in a liquid metal201810515916910.1016/j.ijmultiphaseflow.2018.04.0012-s2.0-85046799538KimN.OhS.ParkK.Giant soap bubble creation model2015263-444545510.1002/cav.16402-s2.0-84929153751KpalmaK.YangM.Polygon interior point query and applications2011 IEEE 13th International Conference on Communication Technology2011Jinan, China81481810.1109/icct.2011.61579912-s2.0-84858165538KunimatsuA.WatanabeY.FujiiH.SaitoT.HiwadaK.TakahashiT.UekiH.Fast simulation and rendering techniques for fluid objects2001203576610.1111/1467-8659.00498LittleJ.PeuckerT.A recursive procedure for finding the intersection of two digital curves197910215917110.1016/0146-664X(79)90048-02-s2.0-0018654721LiuS.-M.LiS.-H.HanW.-Z.Effect of ordered helium bubbles on deformation and fracture behavior of α-Zr20193571466147210.1016/j.jmst.2019.03.0152-s2.0-85063905929NakamuraM.InabaG.TamaokiJ.ShiratoriK.HoshinoJ.Mounting and application of bubble display system: bubble cosmosProceedings of the 2006 ACM SIGCHI International Conference on Advances in Computer Entertainment Technology - ACE '062006Hollywood, CA, USA4710.1145/1178823.11788792-s2.0-34547181787QuinnJ. J.FinchJ. A.On the origin of bimodal bubble size distributions in the absence of frother201236-3823724110.1016/j.mineng.2012.04.0012-s2.0-84867744651SchroederD.HamiltonH. J.Desirable elements for a particle system interface2014201421262380910.1155/2014/6238092-s2.0-84893182921LiS.XuS.FanJ.HuangS.Numerical simulation of interaction between in-line two bubbles in nonnewtonian fluids2017346368SuojanenJ.2013Tampere University of Applied SciencesTanS. Y.AtaS.WanlessE. J.Direct observation of individual particle armored bubble interaction, stability, and coalescence dynamics2013117288579858810.1021/jp402052f2-s2.0-8488056886123796213ĎurikovičR.Animation of soap bubble dynamics, cluster formation and collision2001203677610.1111/1467-8659.00499XueT.QuL.WuB.Matching and 3-d reconstruction of multi-bubbles based on virtual stereo vision201463616391647YanaiK.MakinoM.A particle-based real-time cg rendering of carbonated water with automatic release of bubbles2015 International Conference on Cyberworlds (CW)2015Visby, Sweden37537810.1109/cw.2015.622-s2.0-84964239468ZhangF.LiH.Visualization of coalescence behavior of two bubbles with smoothness constraint202023347549010.1007/s12650-020-00641-2ZhangW.ZhaoL.GaoT.CaiS.Topology optimization with closed b-splines and boolean operations201731565267010.1016/j.cma.2016.11.0152-s2.0-85002715437ZhuC.LiS.FuT.MaY.Velocity evolution for the coalescence of two in-line bubbles rising in nonnewtonian fluids201852345946410.1134/S00405795180301932-s2.0-85048669079