M.Sc Thesis

M.Sc StudentRaz Saar
SubjectReal-Time Simulation of Viscous Thin-Films
DepartmentDepartment of Computer Science
Supervisor ASSOCIATE PROF. Mirela Ben-Chen
Full Thesis textFull thesis text - English Version


The intricate behavior of viscous thin films has fascinated physicists, mathematicians and engineers for many years; stable discrete schemes for simulation of the effect have been proposed, yet with the advent of mobile devices and graphics hardware the question of the feasibility of a real-time simulation of the effect arises. In our research we explore novel formulations and discrete schemes and attempt to simulate this effect at real-time rates while preserving physical fidelity; we propose a novel discrete scheme for simulating the effect on planar 2D surfaces: our scheme is based on a new formulation of the gradient flow approach, that leads to a discretization based on local stencils that are easily computable on the GPU. Our 2D approach has physical fidelity, as the total mass is guaranteed to be preserved, an appropriate discrete energy is controlled, and the film height is guaranteed to be non-negative at all times. In addition, it is fast enough to allow realtime interaction with the flow, for designing initial conditions and controlling the forces during the simulation. We also explore and show initial results using a discrete scheme derived from a novel formulation of the effect on curved surfaces, which allows simulating thin-films on curved 3D surfaces at real-time speeds with preserved visual fidelity.

Our main contribution is a numerical scheme for viscous thin film simulation that is defined via local operations, and is thus highly efficient and easy to implement as a shader, is derived using a local gradient flow formulation that guarantees important theoretical properties, namely mass preservation, non-negativity of the solution and control of a suitable discrete energy and can be implemented on mobile devices with responsive user interaction via accelerometer (to change the direction of gravity) or a touch interface (to add fluid or place obstacles).

We also provide a simplified numerical scheme for viscous thin film simulation on curved domains, which shows significant performance benefits over previous methods while preserving visual fidelity.

One approach to deriving discrete schemes for a wide range of evolution equations, that include the thin film equation, is to take advantage of their gradient flow structure, i.e. the fact that they can be seen in a certain sense as a steepest gradient

descent for a suitable energy functional. We utilize this approach to reach a discretization which retains important properties such as mass conservation, non-negativity and energy reduction, and by combining it with the fractional step approach, we are able to parallelize the scheme on the GPU, achieving real-time performance on flat, 2D domains.

For curved 3D domains, we set out to reformulate a simplified version of the general flux-based thin-film equation on surfaces. We simplify the equations in a manner that preserves visual fidelity. We show how our simplification, combined with using an iterative solver with a constant no. of iterations and other optimizations, can operate at real-time speeds, and how it can be configured to satisfy the user’s fidelity-performance trade-off needs.