# Visual Simulation of Turbulent Foams by Incorporating the Angular Momentum of Foam Particles into the Projective Framework

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

#### Problem Statement

- Foam patterns are generated only by the depth-based curvature difference, not by water flow.
- While this does not appear to be a mask map, it is difficult to depict detailed foam motion for reasons (1).
- It’s particularly challenging to convey the complexity of foam, which is largely dependent on water velocity, such as the movement of a bubble being drawn in.

- Calculation of angular momentum from water particles. Tuning the motion of the underlying fluids whenever controlling the foam effects is a very cumbersome task, and as a result, it becomes difficult to model the scene in the manner in which the user desires. Therefore, we calculate the angular momentum to advect the foam particles without affecting the position of the water particles.
- Advection of foam particles reflecting angular momentum. We reliably advect the foam particles using the angular momentum calculated from the water particle.
- Integration with existing foam effects techniques. Foam particles with angular momentum are integrated into the foam generation framework of existing techniques.

## 2. Related Work

#### 2.1. Physically-Based Foam Modeling Approaches

#### 2.2. Screen-Space Foam Modeling Approaches

## 3. Proposed Framework

- Water particles advected using FLIP are projected onto screen-space through a projection matrix. Acceleration and depth values, which are physical quantities of water particles, are projected at the projected location.
- The angular momentum is calculated from the water particles. In general particle-based simulation, since particles do not have volume or directionality, changes in angular momentum due to torque are not considered. We model this force and use it to advect the foam particles.
- Using the projected acceleration map, the place where the foam particles will be generated is quickly searched in 2D screen-space.
- Through inverse transformation from screen-space to 3D space, foam particles are generated in 3D space and advected based on angular velocity.
- Some foam particles are removed based on their lifespan or momentum.

#### 3.1. Foam Effects Based on Projective-Space

#### 3.1.1. Projection Map Generation from Fluid Particles

#### 3.1.2. Foam Particle Generation

#### 3.2. Angular Momentum of Water Particle and Advection of Foam Particle

- The force calculated by the neighbor water particles is converted into a torque acting on the particles. The calculated rotation momentum is integrated with time to maintain rotation.
- The rotation momentum of the water particles is applied to the force of the foam particles and incorporated into the advection process.

#### 3.2.1. Angular Momentum Calculation in Fluid Particles

#### 3.2.2. Angular Momentum Transfer to Foam Particles

#### 3.2.3. Dissolution

## 4. Implementation

## 5. Results and Discussion

#### 5.1. Validation Test for Angular Momentum

#### 5.2. Foam Effects with Angular Momentum

## 6. Conclusions

## Supplementary Materials

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Stomakhin, A.; Schroeder, C.; Chai, L.; Teran, J.; Selle, A. A material point method for snow simulation. ACM Trans. Graph. (TOG)
**2013**, 32, 1–10. [Google Scholar] [CrossRef] - Yue, Y.; Smith, B.; Batty, C.; Zheng, C.; Grinspun, E. Continuum foam: A material point method for shear-dependent flows. ACM Trans. Graph. (TOG)
**2015**, 34, 1–20. [Google Scholar] [CrossRef] - Zhu, Y.; Bridson, R. Animating sand as a fluid. ACM Trans. Graph. (TOG)
**2005**, 24, 965–972. [Google Scholar] [CrossRef] - Sato, T.; Wojtan, C.; Thuerey, N.; Igarashi, T.; Ando, R. Extended narrow band FLIP for liquid simulations. In Computer Graphics Forum; Wiley Online Library: Malden, MA, USA, 2018; Volume 37, pp. 169–177. [Google Scholar]
- Nielsen, M.B.; Bridson, R. Spatially adaptive FLIP fluid simulations in bifrost. In ACM SIGGRAPH 2016 Talks; Association for Computing Machinery: New York, NY, USA, 2016; pp. 1–2. [Google Scholar]
- Jiang, C.; Schroeder, C.; Selle, A.; Teran, J.; Stomakhin, A. The affine particle-in-cell method. ACM Trans. Graph. (TOG)
**2015**, 34, 1–10. [Google Scholar] [CrossRef] - Ding, O.; Shinar, T.; Schroeder, C. Affine particle in cell method for MAC grids and fluid simulation. J. Comput. Phys.
**2020**, 408, 109311. [Google Scholar] [CrossRef] - Fu, C.; Guo, Q.; Gast, T.; Jiang, C.; Teran, J. A polynomial particle-in-cell method. ACM Trans. Graph. (TOG)
**2017**, 36, 1–12. [Google Scholar] [CrossRef][Green Version] - Müller, M.; Charypar, D.; Gross, M.H. Particle-based fluid simulation for interactive applications. In Proceedings of the 2003 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, San Diego, CA, USA, 26–27 July 2003; pp. 154–159. [Google Scholar]
- Becker, M.; Teschner, M. Weakly compressible SPH for free surface flows. In Proceedings of the 2007 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, San Diego, CA, USA, 2–4 August 2007; pp. 209–217. [Google Scholar]
- Macklin, M.; Müller, M. Position based fluids. ACM Trans. Graph. (TOG)
**2013**, 32, 1–12. [Google Scholar] [CrossRef] - Chen, F.; Zhao, Y.; Yuan, Z. Langevin Particle: A Self-Adaptive Lagrangian Primitive for Flow Simulation Enhancement. In Computer Graphics Forum; Blackwell Publishing Ltd.: Oxford, UK, 2011; Volume 30, pp. 435–444. [Google Scholar]
- Zhao, Y.; Yuan, Z.; Chen, F. Enhancing Fluid Animation with Adaptive, Controllable and Intermittent Turbulence. In Symposium on Computer Animation; Eurographics Association: Madrid, Spain, 2010; pp. 75–84. [Google Scholar]
- Yoon, J.C.; Kam, H.R.; Hong, J.M.; Kang, S.J.; Kim, C.H. Procedural synthesis using vortex particle method for fluid simulation. In Computer Graphics Forum; Blackwell Publishing Ltd.: Oxford, UK, 2009; Volume 28, pp. 1853–1859. [Google Scholar]
- Weißmann, S.; Pinkall, U. Filament-based smoke with vortex shedding and variational reconnection. In ACM SIGGRAPH 2010 Papers; Association for Computing Machinery: New York, NY, USA, 2010; pp. 1–12. [Google Scholar]
- Barnat, A.; Pollard, N.S. Smoke sheets for graph-structured vortex filaments. In Proceedings of the 11th ACM SIGGRAPH/Eurographics Conference on Computer Animation, Lausanne, Switzerland, 29–31 July 2012; pp. 77–86. [Google Scholar]
- Kim, D.; Lee, S.W.; Song, O.y.; Ko, H.S. Baroclinic turbulence with varying density and temperature. IEEE Trans. Vis. Comput. Graph.
**2011**, 18, 1488–1495. [Google Scholar] - Hong, J.M.; Shinar, T.; Fedkiw, R. Wrinkled flames and cellular patterns. ACM Trans. Graph. (TOG)
**2007**, 26, 47-es. [Google Scholar] [CrossRef] - Kim, D.; Song, O.Y.; Ko, H.S. Stretching and wiggling liquids. In ACM SIGGRAPH Asia 2009 Papers; Association for Computing Machinery: New York, NY, USA, 2009; pp. 1–7. [Google Scholar]
- Mercier, O.; Beauchemin, C.; Thuerey, N.; Kim, T.; Nowrouzezahrai, D. Surface turbulence for particle-based liquid simulations. ACM Trans. Graph. (TOG)
**2015**, 34, 1–10. [Google Scholar] [CrossRef] - Pfaff, T.; Thuerey, N.; Gross, M. Lagrangian vortex sheets for animating fluids. ACM Trans. Graph. (TOG)
**2012**, 31, 1–8. [Google Scholar] [CrossRef] - Pfaff, T.; Thuerey, N.; Cohen, J.; Tariq, S.; Gross, M. Scalable fluid simulation using anisotropic turbulence particles. In ACM SIGGRAPH Asia 2010 Papers; Association for Computing Machinery: New York, NY, USA, 2010; pp. 1–8. [Google Scholar]
- Kim, T.; Thürey, N.; James, D.; Gross, M. Wavelet turbulence for fluid simulation. ACM Trans. Graph. (TOG)
**2008**, 27, 1–6. [Google Scholar] - Pfaff, T.; Thuerey, N.; Selle, A.; Gross, M. Synthetic turbulence using artificial boundary layers. In ACM SIGGRAPH Asia 2009 Papers; Association for Computing Machinery: New York, NY, USA, 2009; pp. 1–10. [Google Scholar]
- Ihmsen, M.; Akinci, N.; Akinci, G.; Teschner, M. Unified spray, foam and air bubbles for particle-based fluids. Vis. Comput.
**2012**, 28, 669–677. [Google Scholar] [CrossRef] - Kim, J.H.; Lee, J. Synthesizing Large-Scale Fluid Simulations with Surface and Wave Foams via Sharp Wave Pattern and Cloudy Foam. Comput. Animat. Virtual Worlds
**2021**, 32, e1984. [Google Scholar] [CrossRef] - Kim, J.H.; Lee, J.; Cha, S.; Kim, C.H. Efficient representation of detailed foam waves by incorporating projective space. IEEE Trans. Vis. Comput. Graph.
**2016**, 23, 2056–2068. [Google Scholar] [CrossRef] [PubMed] - Takahashi, T.; Fujii, H.; Kunimatsu, A.; Hiwada, K.; Saito, T.; Tanaka, K.; Ueki, H. Realistic animation of fluid with splash and foam. In Computer Graphics Forum; Blackwell Publishing Ltd.: Oxford, UK, 2003; Volume 22, pp. 391–400. [Google Scholar]
- Geiger, W.; Leo, M.; Rasmussen, N.; Losasso, F.; Fedkiw, R. So real it’ll make you wet. In ACM SIGGRAPH 2006 Sketches; Association for Computing Machinery: New York, NY, USA, 2006; p. 20-es. [Google Scholar]
- Hieber, S.E.; Koumoutsakos, P. A Lagrangian particle level set method. J. Comput. Phys.
**2005**, 210, 342–367. [Google Scholar] [CrossRef] - Nishida, T.; Sugihara, K.; Kimura, M. Stable marker-particle method for the Voronoi diagram in a flow field. J. Comput. Appl. Math.
**2007**, 202, 377–391. [Google Scholar] [CrossRef][Green Version] - Kim, J.; Cha, D.; Chang, B.; Koo, B.; Ihm, I. Practical animation of turbulent splashing water. In Symposium on Computer Animation; A K Peters/CRC Press: Natick, MA, USA, 2006; pp. 335–344. [Google Scholar]
- Losasso, F.; Talton, J.; Kwatra, N.; Fedkiw, R. Two-way coupled SPH and particle level set fluid simulation. IEEE Trans. Vis. Comput. Graph.
**2008**, 14, 797–804. [Google Scholar] [CrossRef] - Mihalef, V.; Metaxas, D.; Sussman, M. Simulation of two-phase flow with sub-scale droplet and bubble effects. In Computer Graphics Forum; Blackwell Publishing Ltd.: Oxford, UK, 2009; Volume 28, pp. 229–238. [Google Scholar]
- Wang, C.b.; Zhang, Q.; Kong, F.l.; Qin, H. Hybrid particle–grid fluid animation with enhanced details. Vis. Comput.
**2013**, 29, 937–947. [Google Scholar] [CrossRef] - van der Laan, W.J.; Green, S.; Sainz, M. Screen space fluid rendering with curvature flow. In Proceedings of the 2009 Symposium on Interactive 3D Graphics and Games; Association for Computing Machinery: New York, NY, USA, 2009; pp. 91–98. [Google Scholar]
- Bagar, F.; Scherzer, D.; Wimmer, M. A layered particle-based fluid model for real-time rendering of water. In Computer Graphics Forum; Blackwell Publishing Ltd.: Oxford, UK, 2010; Volume 29, pp. 1383–1389. [Google Scholar]
- Müller, M.; Schirm, S.; Duthaler, S. Screen space meshes. In Proceedings of the 2007 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, San Diego, CA, USA, 2–4 August 2007; pp. 9–15. [Google Scholar]
- Harlow, F.H.; Welch, J.E. Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface. Phys. Fluids
**1965**, 8, 2182–2189. [Google Scholar] [CrossRef] - Akinci, N.; Cornelis, J.; Akinci, G.; Teschner, M. Coupling elastic solids with smoothed particle hydrodynamics fluids. Comput. Animat. Virtual Worlds
**2013**, 24, 195–203. [Google Scholar] [CrossRef]

**Figure 2.**Curvature values at the evaluation region (see red line in Figure 1a).

**Figure 4.**Acceleration map projected onto screen-space (red: fast acceleration, blue: slow acceleration, inset image: simulation view) (

**a**) Frame 115. (

**b**) Frame 243.

**Figure 5.**Angular momentum in the process of rotation. The related video has been submitted as Supplementary Material. (

**a**) With angular momentum (our method). (

**b**) Without angular momentum.

**Figure 6.**Two-dimensional water particle simulation with our method. The related video has been submitted as Supplementary Material.

**Figure 7.**Comparison of close-up views in Figure 6. The related video has been submitted as Supplementary Material. (

**a**) Our method. (

**b**) Without angular momentum.

**Figure 8.**Comparison of 2D particle-based smoke simulation results. The related video has been submitted as Supplementary Material. (

**a**) Our method. (

**b**) Without angular momentum.

**Figure 9.**Comparison of movement and pattern change of foam particles. The related video has been submitted as Supplementary Material. (

**a**) Our method. (

**b**) Without angular momentum.

**Figure 10.**Comparison of the rotating-emitter scene in water simulation. The related video has been submitted as Supplementary Material. (

**a**) Our method. (

**b**) Kim and Lee [26].

**Figure 12.**Rotating two boxes in water simulation. The related video has been submitted as Supplementary Material. (

**a**) Our method (inset image: simulation view). (

**b**) Kim and Lee [26].

**Figure 13.**Tornado scene. The related video has been submitted as Supplementary Material. (

**a**) Our method. (

**b**) Kim and Lee [26].

**Figure 14.**Foam effects by fluid–solid interaction using our method as the water flows along the U-shaped corridor (blue: no angular momentum, green to red: stronger angular momentum). The related video has been submitted as Supplementary Material.

**Figure 15.**Motion difference with (white) or without (red) angular momentum-based advection. The related video has been submitted as Supplementary Material.

Name | Description | Value |
---|---|---|

r | Radius of water particle | – |

$\mathbf{Z}$ | Depth map | – |

$\mathbf{D}$ | Acceleration map | – |

$\mathbf{P}$ | Projection matrix | – |

$\mathbf{Q}$ | Inverse projection matrix | – |

${x}_{p},{y}_{p},{z}_{p}$ | Projected coordinate | – |

${r}_{x},{r}_{y},{r}_{z}$ | Projected radius | – |

${d}_{p}$ | Projected acceleration | – |

$\mathbf{C}$ | Candidate region in 2D | – |

${\mathbf{C}}^{*}$ | Final candidate region in 2D | – |

$\mathbf{F}$ | Depth map based curvature | – |

${\tau}_{p}$ | Torque of water particle | – |

${\mathbf{L}}_{p}$ | Angular momentum of water particle | – |

${\mathsf{\omega}}_{p}$ | Angular velocity of water particle | – |

${I}_{p}$ | Scalar inertia moment of water particle | – |

${\mathsf{\omega}}_{pf}$ | Relative angular velocity of water and foam particles | – |

${H}^{*}$ | Mean curvature of the depth map | – |

$\Delta $ t | Time-step | 0.006 |

$\alpha $ | Angular momentum transfer | 10.0 |

$\beta $ | Curvature threshold | 0.1 |

k | Weight for inertia moment | $\frac{1}{30}$ |

h | Projective spacing | 2.0 |

${N}_{x}\times {N}_{y}$ | Projective space res. | 400 × 300 |

**Table 2.**Size of our example scene (Water: water particles, Foam: foam particles, Solid: triangles of the solid, Grid res.: grid resolution).

Figures | Water | Foam | Solid | Grid Res. | Projective Space Res. | Projective Spacing |
---|---|---|---|---|---|---|

Figure 5 | 1 k | – | – | – | – | – |

Figure 6 | 3 k | – | – | – | – | – |

Figure 8 | 45 k | – | – | – | – | – |

Figure 9 | 100 | 5000 | – | – | – | – |

Figure 10 | 2.5 m | 3.1 m | – | ${150}^{3}$ | 400 × 300 | 2.0 |

Figure 12 | 1.7 m | 1.2 m | 48 | ${150}^{3}$ | 400 × 300 | 2.0 |

Figure 13 | 1.7 m | 3.5 m | – | ${150}^{3}$ | 400 × 300 | 2.0 |

Figure 14 | 1.2 m | 3.3 m | 70 | ${150}^{3}$ | 400 × 300 | 2.0 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Kim, K.-H.; Lee, J.; Kim, C.-H.; Kim, J.-H. Visual Simulation of Turbulent Foams by Incorporating the Angular Momentum of Foam Particles into the Projective Framework. *Appl. Sci.* **2022**, *12*, 133.
https://doi.org/10.3390/app12010133

**AMA Style**

Kim K-H, Lee J, Kim C-H, Kim J-H. Visual Simulation of Turbulent Foams by Incorporating the Angular Momentum of Foam Particles into the Projective Framework. *Applied Sciences*. 2022; 12(1):133.
https://doi.org/10.3390/app12010133

**Chicago/Turabian Style**

Kim, Ki-Hoon, Jung Lee, Chang-Hun Kim, and Jong-Hyun Kim. 2022. "Visual Simulation of Turbulent Foams by Incorporating the Angular Momentum of Foam Particles into the Projective Framework" *Applied Sciences* 12, no. 1: 133.
https://doi.org/10.3390/app12010133