The Flow From Simulation To Reality: Comment

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Comment

https://doi.org/10.1038/s41567-022-01788-5

The flow from simulation to reality


Károly Zsolnai-Fehér Check for updates

Fluid simulations today are remarkably finer ones only in the regions where intricate details are likely to appear,
for example around an area with turbulent motion (Fig. 1a, light and
realistic. In this Comment I discuss some of the dark blue regions). This eases the computational burden a great deal
most striking results from the past 20 years with calmer regions requiring only a handful of grid points.
Another way to reduce computational cost is to simulate only (or
of computer graphics research that made this mostly) the surface of liquids6. This idea is based on the key observation
happen. that although the majority of the simulation domain is often within
the liquid, most of the fine details that are of interest for an animation
Growing up, I would often marvel at the smoke plumes ascending from appear on the surface. This approximation reduces the problem to
a chimney and the water flows in the wake of a ship and assume that two boundary integrals and eliminates the need to evaluate the full
the underlying rules that describe them must be unfathomably com- Navier–Stokes equations on a large volume. The extent of the simpli-
plex. Later, as a student, I was struck by the deceptive simplicity of the fication depends on the ratio of the volume to the surface of the fluid.
Navier–Stokes equations, which — using only three terms codifying Although it is helpful even in the case of a small droplet splashing into
advection, pressure and diffusion — could describe waterfalls, waves a thin sheet of water (Fig. 1b), the concept truly shines when simulating
around water droplets and turbulent smoke swirls. a large fluid body, such as an ocean.
Understandably, computer scientists have been eager to plug However, simulating oceans poses challenges beyond compu-
these equations into a computer and see the world come to life in their tational cost. For example, diffuse effects such as bubbles and foam
simulations. Unlike the computational fluid dynamics1 literature, which contribute a great deal to a realistic depiction. Unfortunately, adding
aims for rigorous and accurate results, computer graphics research these requires the introduction of surface tension calculations, which
typically focuses on greater efficiency and artistic control, which are can get prohibitively expensive. However, leaning on the observation
achievable with approximate solutions. These graphics solutions that bubbles and foam appear when air gets trapped within the fluid,
started appearing over 20 years ago2,3, but hundreds of papers on one can limit the problem to wave crests, which can be easily identified
this topic were still published in these 20 years — a testament to the by looking for regions where the curvature of the fluid geometry is high
complexity of the problem. and locally convex7. This is, of course, an approximate solution, but its
In the early days of computer graphics, simulations of liquids for advantage is that foam and bubbles can be added to a finished, already
animation and digital media involved evaluating the Navier–Stokes existing simulation (Fig. 2a). And with this simple idea, the realism of
equations on a moving set of measurement points represented by par- a previously unconvincing simulation can be improved in a matter of
ticles, or on a stationary Cartesian grid. However, neither are suitable to minutes, even on a commodity computer.
the increasingly complex demands of the modern-day animation and Today, one need not despair even if surface-tension-based effects
media industries because of the huge computational cost. The particle need to be included. A recent paper8 offers three key realizations that
technique requires too many particles to simulate detailed flows. The show how much graphics research has progressed over the past 20
grid, on the other hand, suffers from the curse of dimensionality: for a years. The first one is that, thanks to recent improvements in the effi-

Credits: a, reproduced from ref. 5, ACM; b, courtesy of Chris Wojtan and Eitan Grinspun.
detailed 3D scene, the grid points would have to be so finely laid out that ciency of surface tension calculations, it is now possible to produce a
even the most powerful supercomputer would be brought to its knees. realistic simulation of fluid phenomena as complex as cherries being
Fortunately, computer graphics researchers have come far in the past dropped in a liquid. One can replicate the cherries being held up by
20 years and a supercomputer is no longer required. Here, I describe buoyancy and capillary forces when dropped into water and getting
two of the community’s ingenious ideas that can produce realistic submerged when dropped into milk (Fig. 2b). The second observation
animations of intricate fluid phenomena at a low computational cost. is that even these advanced surface-tension-based effects are no longer
One commonly used technique is spatial adaptivity4. Modern too costly to simulate. A modern solver can handle the interaction of
implementations5 consider coarse grids for slow-moving waves and liquids, membranes and solids at the same time, and thus obtain each

Fig. 1 | Two optimizations for fluid


simulations. a, Spatial adaptivity is a
a b
simulation technique that allocates additional
computational resources to areas with more
complex flows, such as turbulent regions
(light and dark blue). b, Simulation cost can
be reduced by considering only the surface of
liquids where most of the fine details appear.

nature physics Volume 18 | November 2022 | 1260–1261 | 1260


Comment

a b These technical advances come at a price. More complex systems


don’t map well to existing hardware and their code base is more difficult
to maintain and troubleshoot over time. Striking the right trade-off
remains a key challenge when developing new simulation algorithms.
However, this is also what makes this area a fertile ground for new ideas,
where a small, but well-chosen compromise can introduce an order
of magnitude increase in efficiency: those are the landmark papers in
computer graphics.
On the other hand, neural-network-based learning approaches
can generate increasingly convincing physics simulations more and
more efficiently with each passing year13. Over time, they may even
Fig. 2 | Advanced fluid simulation effects. a, The addition of diffuse effects, such surpass conventional simulation methods. However, creating a uni-
as bubbles and foam, enhances the realism of a liquid simulation. b, Including fied system that can accommodate our appetite for realism and leave
advanced surface-tension-based effects can produce a realistic simulation of how space for artistic directability, and do so efficiently enough to fulfil
buoyancy and capillary forces hold up or sink cherries dropped into different the requirements of modern artistic workflows, remains a challenge.
liquids, such as water and milk. I would like to think that I have a vivid imagination, but after seeing
all this progress I wonder what else we will be capable of 20 years and a
image in seconds. The third one is perhaps the most striking: when few more papers down the line.
combined with a modern light transport simulator, the appearance of
these simulations is now so convincing, they are almost indistinguish- Károly Zsolnai-Fehér
able from real-world photos. Two Minute Papers, Pécs, Hungary.
Even with these improvements, it always seemed that in computer e-mail: karoly@twominutepapers.com
graphics, this realism is only there for looks — and I never expected
these simulations to have any predictive power. But today, this prospect Published online: 3 October 2022
is becoming more and more likely. For decades, physics simulations for
digital media were considered acceptable if they looked convincing to References
the human eye, and were nowhere near accurate enough for engineers 1. Harlow, F. & Welch, J. E. Phys. Fluids 8, 2182–2189 (1965).
2. Foster, N. & Metaxas, D. Graph. Models Im. Proc. 58, 471–483 (1996).
to verify, for example, whether a new wind turbine design really does 3. Stam, J. Stable fluids. In SIGGRAPH ‘99: Proc. 26th Conference on Computer Graphics and
work correctly. Interactive Techniques 121–128 (ACM, 1999).
4. Berger, M. J. & Colella, P. J. Comput. Phys. 82, 64–84 (1984).
However, the computational cost of existing methods has
5. Ando, R., Thürey, N. & Wojtan, C. ACM Trans. Graph. 32, 103 (2013).
decreased four-fold in just one year due to simpler, more efficient 6. Da, F., Hahn, D., Batty, C., Wojtan, C. & Grinspun, E. ACM Trans. Graph. 35, 78 (2016).
geometric approximation schemes that map more easily to existing 7. Ihmsen, M., Akinci, N., Akinci, G. & Teschner, M. Visual Comput. 28, 669–677 (2012).
8. Ruan, L. et al. ACM Trans. Graph. 40, 120 (2021).
graphics cards. With this, one can now simulate the airflow within a
9. Lyu, C., Li, W., Desbrun, M. & Liu, X. ACM Trans. Graph. 40, 201 (2021).
city block or create predictive wind tunnel tests for aircraft wing design 10. Huang, L., Hädrich, T. & Michels, D. L. ACM Trans. Graph. 38, 93 (2019).
with each second of animation taking only a few minutes to compute9. 11. Fei, Y., Maia, H. T., Batty, C., Zheng, C. & Grinspun, E. ACM Trans. Graph. 36, 56
(2017).
Simulations that are both real-time and predictive are within arm’s
12. Takahashi, T. & Lin, M. C. ACM Trans. Graph. 38, 237 (2019).
reach — we might soon enter a world where an engineer is able to test 13. Sanchez-Gonzalez, A. et al. Learning to simulate complex physics with graph networks.
new ideas in aircraft design every few minutes. Proc. 37th International Conference on Machine Learning 119, 8459–8468 (2020).
There are many more techniques that enable the simulation of
Acknowledgements
intricate fluid phenomena such as the mesmerizing phenomenon of I thank C. Batty who graciously provided constructive feedback.

Credits: a, The FLIP Fluids Addon Development Team; b, reproduced from ref. 8, ACM.
a ferrofluid climbing up a steel helix10 or liquid–hair interactions11. It
is also possible to extract the physical properties of a viscous material Competing interests
from a video recording of its dynamics12. The author declares no competing interests.

nature physics Volume 18 | November 2022 | 1260–1261 | 1261

You might also like