A Unified Handling of Immiscible and Miscible
Fluids
Jinho Park∗ Younghwi Kim∗ Daehyeon Wi∗ Nahyup Kang†
Sung Yong Shin† Junyong Noh∗
∗
Graduate School of Culture Technology, Korea Advanced Institute of Science and Technology (KAIST)
†
Division of Computer Science, KAIST
Abstract
Conventional level set based approaches have an inherent difficulty in tracking miscible fluids due to its discrete treatment for interface. This paper proposes a unified
framework to efficiently handle both miscible and immiscible fluid simulations. Based
on the chemical potential energy, our method describes the evolution of multiple fluids
as time varying concentration fields. Handling of multiple fluids is straightforward and,
unlike level set methods, ad-hoc reinitialization or fictitious particle deployment is not
necessary. For numerical computation of the Navier-Stokes equations, we adopt advanced lattice Boltzmann methods for computational efficiency. The experiments show
1
that our approach works well with immiscible fluids, miscible fluids, and interaction
with objects.
Keywords: multiple fluids, lattice Boltzmann method, Cahn-Hilliard equation
2
Introduction
Many liquid simulation techniques have been recently developed and successfully utilized
in visual effects making. Most methods focus on immiscible fluids such as water and air to
capture a sharp interface defined by two disparate mediums [1]. Recently, some researchers
proposed interface treatment methods of miscible fluids [2, 3]. There is little work, however, on multiple fluids with diverse miscibility relations known to the computer graphics
community. A naive combination of existing techniques can hardly represent complex fluid
behaviors such as interaction among oil, clear water, and color pigments all in the same
scene. In this paper, we scrutinize the miscibility of fluids and introduce a unified interface
handling method for miscible as well as immiscible fluids.
We propose to use the phase field method (PFM) [4] to effectively handle the interface
problem occurring in both miscible and immiscible fluid simulations. How to define an
interface between miscible fluids is not clear. Continuously changing mixture of fluid cannot
be represented by a single discrete interface. Instead, we focus on fluid concentration at
a point in the simulation domain. A concentration is a density fraction whose value lies
between 0 and 1. The concentration field evolves reflecting the miscibility of fluids. The
evolution is governed by the Cahn-Hilliard equation [5] with the steady decrease of the
free energy of miscibility. The Cahn-Hilliard equation guarantees the conservation of total
concentration. This property displays a great contrast with numerical calculation of level set
advection subject to a mass loss problem.
3
While we believe that grid based methods should work well with the Cahn-Hilliard equations, in this paper, we adopt a lattice Boltzmann method (LBM) [6] for computational
efficiency. LBMs have drawn great attention recently in computational physics and have
emerged as promising tools for simulating complex fluid flows. In LBMs, a fluid is modeled
as a finite number of fictive particles which evolve with consecutive propagation and collision processes over a lattice grid. Due to its particulate nature and local dynamics, LBMs
do not require global operations leading to considerable speedups.
The use of LBM easily facilitates parallel computation. Many visual effects studios are
equipped with a render farm for rendering high quality imagery in parallel. The render
farm can also be utilized for general purpose parallel computation. Unlike a hardly scalable
grid based approach that requires a global projection,the local causality of LBM allows
easy implementations on networked computers. The resolution of the simulation domain is
no longer limited to the memory belonging to single CPU and can be increased arbitrarily
high. The speedup achieved by parallel computation brings early feedback on experiments
resulting in the development time reduction.
Our numerical method has several advantages over conventional LBMs. We combine
the advanced techniques developed in computational physics. Entropic LBM based on the
second law of thermodynamics improves the numerical stability of simulation with low
viscosity. The Navier-Stokes equations with force are exactly recovered from our lattice
Boltzmann formulation. Our method can be applied to various boundary conditions: no-slip
and free-slip for arbitrary-shaped static and dynamic objects.
4
The contributions of this paper are summarized as follow. First, we propose a unified
framework to perform both immiscible and miscible fluid simulations. Second, our method
respects the physically meaningful free energy and guarantees concentration conservation.
Third, the recent findings in computational physics are adopted to enhance the LBM commonly used in computer graphics. Finally, easy implementation on massively parallel machines allows an arbitrarily high domain resolution as well as speed gain.
Related work
Level set methods [7] have been widely used for capturing the interface between water and
air. Foster et al. [8] proposed a particle level set method to alleviate the mass loss problem observed in pure level set methods. Enright et al. [9] improved the particle level set
method to accurately represent the water surface. However, the fictitious particles have to
be distributed properly over the simulation domain. It is also time-consuming to reinitialize distance functions once in a certain time interval. Most of all, level set methods have
difficulty in handling miscible fluids.
PFMs are an increasingly popular choice for modeling the motion of multiphase fluids in computational physics. The evolution of an interface between fluids is governed
by the Cahn-Hilliard equation [5]. To investigate the phase separation of a binary fluid
mixture, several authors [10, 11] presented lattice Boltzmann formulations for the CahnHilliard equation. However, the Cahn-Hilliard equation cannot be recovered precisely from
5
these formulations. Takada et al. [12] presented a finite difference method, named NS-PFM,
combining Navier-Stokes equations with a phase-field model. Zheng et al. [13] proposed a
modified LBM of the Cahn-Hilliard equation for a binary fluid, which completely recovers
the Cahn-Hilliard equation.
Conventional fluid simulation techniques [14, 8, 9] require heavy computations. Various approaches have been introduced to make simulation efficient. Losasso et al. [15]
presented a method for simulating water and smoke with an octree data structure, exploiting
mesh refinement techniques to capture small-scale visual details. Their approximation to
the Poisson equation is a little tricky while the resulting linear system is symmetric and positive definite. By combining 2D and 3D simulation techniques, Irving et al. [16] presented
a method to simulate large bodies of water. The bulk of the water volume is represented
with tall cells and the surface layer of water is simulated with a full 3D Navier-Stokes free
surface solver.
LBMs have been used to simulate quasi-incompressible viscous flows in computational
fluid dynamics. Bhatnagar et al. [17] approximated the collision operator in the Boltzmann
equation with the Bhatnagar-Gross-Krook (BGK) model. The BGK model is easy to implement and makes simulation much efficient. He et al. [18] analytically solved the lattice
Boltzmann BGK equation for several simple flows. Guo et al. [19] showed that their lattice
Boltzmann formulation can be exactly reduced to the Navier-Stokes equations with body
forces. We use Guo et al.’s formulation to incorporate gravity.
The LBM becomes an emerging simulation technique for fluid animation in computer
6
graphics. By adopting the BGK model, Wei et al. [20] introduced a LBM for simulating
gaseous phenomena. Chu and Tai [21] presented a paint system, named MoXi. They used
the 2D LBM for simulating ink dispersion in absorbent paper for art creation purposes. In
[22], a simplified LBM is presented for animating fluids with free surfaces. Zhu et al. [3]
adopted a two-fluid lattice Boltzmann method (TFLBM) to simulate the dynamics of miscible fluid. They focused only on binary miscible fluid simulation which can be also handled
by an advection-diffusion scheme for a color value.
Surface tracking methods [23, 24] were presented to enable tracking of surface characteristics, such as color and texture coordinates. Mullen et al. [2] proposed an Eulerian
approach for geometry processing of surfaces. Their approach is similar in spirit to our
method: isosurfaces are evolved in order to minimize a given functional. They commented
PFM presupposes the profile of the smeared interface, requiring very fine grids to obtain detailed results. To resolve the inevitable smearing of an interface, they resharpen the interface
over time by maximizing a deviation functional. In PFM, bulk energy prevents excessive
smearing in immiscible fluids without any additional procedure. In contrast, note that miscible fluids require smearing leading to zero bulk energy as discussed in section . While
their method concentrates on a binary fluid, our method is much more scalable to deal with
a large number of multiple fluids and interfacial tension of miscible fluids.
7
Overview
Figure 1 shows the overall structure of our method. Motion of fluids is governed by the
Navier-Stokes equations which describe the time-varying hydrodynamic quantities such as
density, pressure, and velocity. The evolution of the concentration field is traced based on
the Cahn-Hilliard equation. We use the LBM to numerically solve both the Navier-Stokes
and Cahn-Hilliard equations.
The fluid flow is described by the Navier-Stokes equations:
ρt + ∇ · ρu = 0.
(1)
(ρu)t + ∇ · (ρuu) = −∇ · P + ν∇2 u + F.
(2)
where u represents the velocity, P the pressure tensor, ρ the density, ν a kinematic viscosity, and F
the force including gravity and surface tension.
In level set methods, a signed distance function is advected by the velocity field. In PFMs,
however, a concentration field replaces the signed distance function and is evolved with the velocity
field and chemical potential. In the next section, we will explain the chemical potential in detail.
Phase field method
Binary fluid
Each fluid has its own property of how miscible it is with others. For example, water is immiscible
with oil, and more miscible with methanol than blood. To simulate the evolution of multiple fluids,
8
we need a tool for guiding the evolution according to the miscibility of the fluids. The concentration
field is a scalar function of space that represents how much of a substance exists at a given point. Only
one concentration field c is sufficient to describe binary fluid α and β since the sum of concentrations
equals to 1, α = c and β = 1 − c. If the binary fluid is immiscible and fully mixed (c = 0.5) as
an initial condition, the fluid tends to evolve in the direction of separation, making c zero and one,
respectively. In this case, the mixed state (c = 0.5) can be interpreted as having higher potential
energy than the pure states (c = 0 and c = 1).
In PFM, a phase state of multiple fluids defines a potential energy called free energy. The phase
state evolves to minimize the free energy. The free energy for binary fluid is defined as a functional
of concentration field c [4]:
Z
F (c) =
[B(c(x, t)) + I(c(x, t))] dx,
Ω
where Ω is the spatial region of the system. I = 21 κ|∇c(x, t)|2 is the interfacial energy with a constant κ which controls the speed of diffusion. Since the concentration field evolves toward minimizing the free energy, this interfacial energy makes an effort to reduce the gradient of the concentration.
The interfacial energy prevents the excessive oscillation of concentration field near interface formed
by an immiscible binary fluid. Bulk energy B determines how the participating fluids chemically
interact with the others. A suitable choice of bulk energy produces desired effects. A double-well,
B = c2 (1 − c)2 , works well with immiscible binary fluids. This function has minima at c = 0 and
c = 1 indicating a pure state of the fluids. Isosurface {x | c(x, t) = 0.5} represents the interface
between fluids. Miscible fluids have zero bulk energy since the interfacial energy is sufficient for
diffusion effect.
9
Concentration field c(x, t) is described as
Dc
= −M δS F,
Dt
where
D
Dt
=
∂
∂t
(3)
+ u · ∇ is the convectional derivative and δS the variational derivative operator over a
function space S. A commonly used variational derivative is δL2 F = B 0 (c) − κ4c over a L2 space.
With this derivative, the free energy decreases as time elapses. However, it is not clear if the total
mass conservation is guaranteed with this formulation. In contrast, over a Hilbert space H −1 , we
have δH −1 F = −4B 0 (c) + 42 c [25]. Then, equation 3 becomes
Dc
= −M δH −1 F = M 4µ,
Dt
(4)
where µ = δL2 F = B 0 (c) − κ4c is the chemical potential. When no-flux boundary condition
n · ∇µ = 0 with the unit normal n is imposed, we have
D
Dt
R
Ωc
= 0 by the divergence theorem.
In other words, the total mass of fluids is conserved when the concentration field follows equation 4
with no-flux boundary condition. Equation 4 is called the Cahn-Hilliard equation and originally used
for phase separation in chemical engineering [5]. Instead of equation 4, a simple advection-diffusion
equation
Dc
Dt
= κ4c with a boundary condition n · c = 0 can also be used for binary miscible fluid
simulation. This advection-diffusion equation holds when S = L2 in equation 3. The conservation
of concentration is verified by the divergence theorem and the condition n · c = 0.
Multiple fluids
One of the merits of PFM is that one can easily increase the number of participating fluids as many as
desired. It is simply achieved by defining the miscibility of pairs of partaking fluids since miscibility
10
arises between two fluids. Free energy for n fluids is defined as
Z
[B(C) + I(C)] dx,
F(C) =
(5)
Ω
where C = (c1 , c2 , · · · , cn ) and ci is the concentration of ith fluid. I(C) =
1
2
P
2
i κi |∇ci |
is the
interfacial energy. Bulk energy B(C) is defined according to the miscibility of each pair of fluids:
B(C) =
P
i,j,i6=j
b(ci , cj ) where b(ci , cj ) = c2i c2j for immiscible fluids i and j, zero for miscible. We
tested a convex function −ci cj as proposed by [26] for bulk energy in the miscible case. Although it
worked with binary fluids, the convex function failed with higher number of fluids. We observed a
disturbing artifact of non-zero concentration at an arbitrary position. Our setting of zero bulk energy
eliminated the problem.
We have the following system of the Cahn-Hilliard equations for n fluids
DC
= M 4Υ,
Dt
where Υ = (µ1 , µ2 , . . . , µn ). The chemical potential for ith fluid µi =
the variational derivative over L2 . Since
P
δF
δci
=
∂B
∂ci
− κi 4ci using
ci = 1 by the definition of concentration, the last con-
centration cn is represented by the preceding concentrations: cn = 1 −
P
i6=n ci .
We solve n − 1
Cahn-Hilliard equations for n fluids.
Surface tension
The surface tension is caused by the attraction between liquid molecules. Each molecule in the bulk
of the liquid is pulled equally in all directions by adjoining molecules, resulting in net zero force.
The molecules at the surface are also pulled by inner molecules and neighboring medium. However,
the net attraction force in the bulk of a mixture varies from position to position. A scheme on surface
11
tension explored in [27] assumes a sharp interface. This scheme is only applicable to the immiscible
case due to the discontinuous treatment of the interface.
Various PFM based surface tension models have been presented [28]. The force µ∇c is used
successfully for expressing surface tension of binary fluid in [13]. The implementation is easy with
simple additional calculation of ∇c. The force is highly influential in the region of large concentration variation. The magnitude of the force decreases as mixing progresses (∇c → 0). To compute
the surface tension contributed by multiple fluids, we simply sum up the forces
P
i µi ∇ci .
While
Kim [29] presented a elaborate surface tension model for multiple fluids, the results in section
demonstrates the accumulated force is gratifying for graphical purposes.
Numerical method
Solving for the Poisson equation for pressure is typically a bottleneck in a conventional grid based
global projection method. While LBM is weakly compressible approximations of the incompressible
Navier-Stokes equations, it provides a considerable speedup for its local operation. Furthermore,
local causality of LBM becomes exceptionally useful when a number of computers are available for
simulation. Unlike a global projection method which is hard to implement on parallel machines,
local operations of LBM makes the simulation resolution virtually limitless. Considering thousands
of CPU nodes available in the render farm in visual effects studios, we believe our approach is very
instrumental for practical use producing extremely high resolution simulations required by movie
productions.
12
LBM for Navier-Stokes equations
The Boltzmann equation describes the evolution of distribution function f (x, e, t), where x, e, and t
are position, velocity, and time, respectively. For simulating a Newtonian flow, LBM solves the discrete Boltzmann equation instead of the Navier-Stokes equations. The LBM discretizes the physical
space into a grid and velocity space into a set of discrete velocities, respectively. The mesh-centered
grid is used for spatial discretization, where the data values such as density, velocity, and distribution
functions are stored at the corner of each grid cell. For the discrete velocities ci , D2Q9 and D3Q19
are commonly used for the 2D and 3D simulations, respectively (figure 2). The D2Q9 is a 2D discretized velocity model with 9 velocity directions on a 2D square lattice. Similarly, the D3Q19 is a
3D model with 19 directions on a cubic lattice.
Lattice Boltzmann formulation with DaQb for equations 1 and 2 has the following form:
fi (x + ei dt, t + dt) − fi (x, t) = Ωρi + Fi ,
(6)
where 0 ≤ i ≤ b − 1, x ∈ Ra , and ei is the discrete velocity. fi is a distribution function of
particles with ei . The macroscopic quantities ρ and u in equation 2 are given by the zeroth and first
moments of distribution functions: ρ =
P
fi and ρu =
P
fi ei + mFdt, where F is the force in
equation 2 and m is a constant to be determined. Collision operator Ωρi describes the interaction
between fluid particles. The nonlinear integral collision operator is often approximated by a simple
(eq)
BGK model (fi
− fi )/τρ [17]. Relaxation time τρ is related with viscosity ν in equation 2 as
ν ∝ (τρ − 0.5). For n fluids with different viscosities, ν =
P
i νi ci ,
given viscosity νi of ith fluid.
The equilibrium distribution function f (eq) represents the equilibrium state unaffected by particle
collisions. The equilibrium distribution in the BGK model is defined as a polynomial of density
13
and velocity [6]. The forcing term Fi reflects the effects of the surface tension and the external
force. Continuous equations 1 and 2 are recovered from lattice boltzmann equation 6 by applying
a multiscaling expansion called Chapman-Enskog expansion [30]. To match up equation 6 with the
Navier-Stokes equations, we use Fi = (1 − 1/(2τρ ))ωi [3(ei − u) + 9(ei · u)ei ] · F, where ωi is
the weight for each direction i. We omit detailed derivations and refer readers to [19] for further
information. We note that a naive forcing term ei · F in [22] leads to undesirable terms such as ∇ · F
and
δF
δt ,
which are not a part of Navier-Stokes equations. These terms are allowable for static gravity.
However, they are troublesome with spatio-temporal varying force such as surface tension.
LBM with BGK model is not without limitation. It causes numerical instability with low viscosity (i.e., τρ ∼ 0.5). Entropic LBM [31] allows zero viscosity by imposing the second law
of thermodynamics: the entropy of a system not in equilibrium will monotonically increase over
time, approaching a maximum value at equilibrium. The entropy is proportional to H-function
H=−
P
fi ln fi . To make our LBM satisfy the law of increasing entropy, we modify BGK collision
operator Ωρi as follows:
Ωρi = α
(eq)
fi
− fi
2τρ
where α > 0 is the nontrivial root of H(f + α(f (eq) − f ) = H(f ). Since H is a convex function, the
(eq)
entropy of updated distribution state must increase. fi
is a maximizer of H since the entropy must
(eq)
have a maximum value at equilibrium. Refer to [31] for the detailed computation of α and fi
.
LBM for Cahn-Hilliard equation
Similar to the Navier-Stokes equations, our system treats the Cahn-Hilliard equation in a LBM framework for efficiency. Note that the Cahn-Hilliard equation can be easily incorporated with conven-
14
tional finite difference-based methods for liquid simulation. A multigrid method for computing the
Navier-Stokes and Cahn-Hilliard equations has been developed in computational physics [32]. The
lattice Boltzmann formulation for the Cahn-Hilliard equation [13] is given as follows:
gi (x + ci dt, t + dt) − gi (x, t) = (1 − q)[gi (x + ci dt, t) − gi (x, t)] + Ωci
Here, gi is the distribution function for concentration c and Ωci denotes the standard BGK collision
(eq)
operator Ωci = (gi
−gi )/τc . Coefficient q is given by 1/(τc +0.5). Similar to density, concentration
c is the zeroth moment of distribution functions: c =
P
i gi .
Velocity u in the Cahn-Hilliard equation
is given as the velocity calculated in the Navier-Stokes equations.
By setting
P
(eq)
ei ei
i gi
(eq)
tion functions gi
= ΓµI for coefficient Γ and the identity matrix I, equilibrium distribu-
can be derived from the Maxwell-Boltzmann distribution [33]:
c − 2Γµ
i=0
(eq)
D2Q5 : gi =
c
i 6= 0
Γµ
2 + 2q (ei · u)
c − 3Γµ
i=0
(eq)
D3Q7 : gi =
c
i 6= 0
Γµ
2 + 2q (ei · u)
We use the D2Q5 and D3Q7 models for velocity space discretization in order to improve time and
space efficiencies (figure 3). These discretization models do not reduce the quality of simulation
results [13]. The right-hand side of equation 4 includes the fourth derivative of c, and such higher
derivatives might cause the numerical diffusion in common finite difference schemes. On the other
hand, LB formulation for the Cahn-Hilliard equation involves only second derivative of c.
15
Iterative steps
The LBM consists of four consecutive steps: macroscopic computation, collision, boundary satisfaction, and propagation (figure 4). The initial density distribution fi is set to equilibrium with the given
density and velocity. The initial concentration distribution gi is similarly set to equilibrium with the
given concentration and velocity. In the computation step, density ρ, velocity u, and concentration c
are calculated from the distribution functions. In the collision step, interactions between the distribution functions are taken into account to update the current distribution functions. The postcollision
distribution fi∗ and gi∗ are evaluated as follow:
fi∗ (x, t) = fi (x, t) + Ωρi + Fi
gi∗ (x, t) = gi (x, t)
+(1 − q) [gi (x + ei dt, t) − gi (x, t)] + Ωci
In the boundary satisfaction step, the boundary conditions are applied to the postcollision distributions. In LBM, bounce-back and specular reflection are common tools for enforcing a no-slip and
free-slip boundary condition, respectively [6]. However, the standard specular reflection rule works
only when the boundary is aligned with grid directions [34]. To handle no-slip condition for a nonplanar moving boundary, Ladd and Verberg [35] presented a link-bounce-back rule. Yin et al. [34]
improved the link-bounce-back rule to satisfy the free-slip condition for arbitrary-shaped surfaces.
We combine the two methods [35, 34] to handle various boundary conditions.
In the propagation step, the postcollision distributions move to neighboring cells along the discrete velocities and become the precollision distributions at the next time step. fi (x + ei dt, t + dt)
16
and gi (x + ei dt, t + dt) are updated by the following procedure
fi (x + ei dt, t + dt) = fi∗ (x, t)
gi (x + ei dt, t + dt) = gi∗ (x, t)
Parallel computing
To take advantage of straightforward parallel computation granted by LBM, we utilize MPICH2 [36],
a widely used implementation of the Message Passing Interface (MPI). Our implementation is similar
to [37]. There are various domain decomposition strategies. Depending on the number of slicing,
the decomposition can be categorized as 1D, 2D, or 3D (figure 5). A functional decomposition [38]
is also possible for more sophisticated cases differentiating the area with more fluid volume from
less. Figuring out the optimal domain decomposition is beyond the scope of this paper. We adopt the
simplest case of 1D decomposition for our implementation.
In 1D decomposition, the domain is sliced in one direction allocating the same portion of subdomain to each processor. Due to the local causality of LBM, only the boundary cells of the subdomain need to exchange the most up-to-date information between adjacent processors. The results
are tabulated in table 1. The test was performed on the small scale of 8 node render farm with total
64 cores. As the table evidently indicates, the size of 2003 simulation becomes possible utilizing
8 nodes. We did not perform higher resolution test due to the memory limitation. Incorporation
of octree structure [15] would definitely further increase the simulation size. The speed gain is
also observed by involving multiple processors despite the high latency occurred through network
communications. Parallel computing of LBM is more attractive for high domain resolution where a
17
ratio of data communication to computation time becomes low.
Results
To demonstrate the usefulness of our approach, we performed various simulations on two Xeonnodes with total 8 cores (3.3 GHz CPU and 2GB RAM). Mental ray in MAYA was used for rendering
3D scenes. We modified a volume shader in mental ray to handle the time-varying concentration
data. We rendered an image every 60 simulation steps. The interface between immiscible fluids was
extracted using a marching cube algorithm [39]. For all experiments, we set the time step and the
grid size to 1. The lattice Boltzmann related parameters were tuned around the following values:
τc = 1, τρ = 0.51 ∼ 0.55, κ = 4, and Γ = 10−3 .
Figure 6 shows a behavior of immiscible fluids. Two liquids have the same volume. Since the
transparent liquid is heavier than the green one, the transparent encroaches on the green (right top in
figure 6). For each liquid, the isosurface with a specific value (0.5 in our case) indicates the surface
of the liquid. This example shows our system can handle the multiple interacting liquids as in [1].
Figure 7 shows another interesting example. Red liquid blobs from the teapot interact with the
transparent liquid at the bottom. The red is miscible with the transparent. We make the beak of the
teapot a source of the red. Density and concentration distributions at the source are set to equilibrium
with the given velocity. The teapot serves the multiple purposes. Initially, it works as a solid object.
After a certain time interval, it becomes liquid. The teapot falls into the mixture of the red and
the transparent. Teapot-shaped orange liquid is immiscible with the mixture. The mixing speed is
controlled by the mobility coefficient M in equation 4. In the lattice Boltzmann formulation, M is
18
related with Γ and τφ as M = q(τc q − 0.5)Γ [13].
Figure 8 shows multiple fluids with various miscibility relations. The number of participating
fluids is four: the blue and red liquids, transparent liquid, and air. We solve three Cahn-Hilliard
equations. As an initial condition, we set c = 1 and c = 0 inside and outside of each fluid, respectively. The upper row of the figure shows the evolution of four immiscible fluids. The red is lighter
than the transparent. The blue is heavier than the transparent. Eventually, the three liquids form
three layers. This example shows our system can handle the multiple immiscible liquids as in [1].
The isosurface with a specific value indicates the surface of the liquid. The lower row shows the
fluid evolution with various miscibility conditions. The blue and red are miscible and lighter than
the transparent. They are immiscible with the transparent. We applied the RGB, an additive color
model to represent the mixed color clearly. A mixture of the red and blue is expressed in magenta.
The color tone of the mixture would have been darker with a subtractive model. The number can be
easily increased to as many as desired as long as the mutual miscibility relations are specified using
equation 5. Computation time increases linearly with the number because each fluid solves its own
Cahn-Hilliard equation. The locality of LBM, which approximates the global incompressibility with
local operations, causes small oscillation as shown in animation.
Figure 9 shows multiple fluids interacting with a rotating rod. A free slip boundary condition was
applied to the rod. As mentioned in section , the standard specular reflection rule cannot be applied
to an arbitrary shaped boundary not aligned with grid directions. With the adopted technique [34],
liquids in the results flow freely on the surface of the rod. Green and dark red liquids are ejected
from both sides of the rod, respectively. The green is immiscible(miscible) with the red and transparent (the yellow). Similarly, the dark red is immiscible(miscible) with the yellow and transparent (the
19
red). Since the rod is not thick, the effect of pushing the fluid away is not salient.
Discussions
The propagation in LBM is similar to the semi-Lagrangian advection in [14]. Both update the velocity field through backtracking the flow trajectory along the current velocity having the first order
accuracy. This low order advection procedure makes our results diffusive. We plan to incorporate
less diffusive methods [40, 41] into our LBM framework.
The motivation of our work is a realistic ink simulation diffused in the water. We employed a
PFM to handle both the separate and mixed states. However, our experiment results do not produce
the detailed smearing of real ink, yet. An adaptive grid method such as [15] may be a remedy for
reproducing this small-scale phenomena.
LBM consumes a large amount of memory compared to common finite difference-based methods. While finite difference methods store just macroscopic quantities such as velocity, pressure,
and density, LBM also needs to store distribution values. For example, 100*100*100 resolution grid
in our code occupies main memory of about 600MB to store the previous and current states. This
memory requirement is a victim of computational efficiency. However, LBM allows trivial straightforward implementation for high resolution simulation. More sophisticated domain decomposition
would improve the speed gain from the parallel computation. We are currently investigating a 3D
domain decomposition and domain overlapping to minimize the data exchange between adjacent
computers (see section ).
20
Conclusion
Based on a PFM originated from chemical engineering, we propose a unified framework to effectively simulate both miscible and immiscible fluids. Our LBM handles fluids with very low viscosity
and exactly restores the governing equations. The experiments show our system provides a unified
interface capturing device for any combination of arbitrary fluids. Clearly, our examples can hardly
be generated by naive applications of previous interface processing techniques [1, 2]. This paper is
the first attempt in computer graphics to simulate miscible fluids utilizing PFM. We believe that our
work opens up further research in this direction as discussed in section .
Acknowledgments
We appreciate the anonymous reviewers for their constructive comments and suggestions. Park, Kim,
Wi, and Noh were supported by the Institute for Information and Technology Advancement (IITA)
(No. ITAA1100070400010001000300200). Kang and Shin were supported by the Korea Science
and Engineering Foundation (KOSEF) grant funded by the Korea government(MEST) (No. R012008-000-11404-0).
References
[1] F. Losasso, T. Shinar, A. Selle, and R. Fedkiw. Multiple interacting liquids. In Proc. SIGGRAPH ’06, pages 812–819, 2006.
21
[2] P. Mullen, A. McKenzie, Y. Tong, and M. Desbrun. A variational approach to eulerian geometry
processing. In Proc. SIGGRAPH ’07, 2007.
[3] H. Zhu, K. Bao, E. Wu, and X. Liu. Stable and efficient miscible liquid-liquid interactions.
Virtual reality software and technology, pages 55–64, 2007.
[4] D. M. Anderson, G. B. McFadden, and A. A. Wheeler. Diffuse-interface methods in fluid
mechanics. Anuual Review of Fluid Mechanics, 30:139–165, 1998.
[5] J. W. Cahn and J. E. Hilliard. Free energy of a nonuniform system. i. interfacial free energy.
Journal of Chemical Physics, 28(2):258–267, Feb 1958.
[6] S. Succi. The Lattice Boltzmann Equation for Fluid Dynamics and Beyond. Oxford University
Press, 2001.
[7] J. A. Sethian. Level Set Methods and Fast Marching Methods. Cambridge Monographs on
Applied and Computational Mathematics, 1999.
[8] N. Forster and R. Fedkiw. Practical animation of liquids. In Proc. SIGGRAPH ’01, pages
23–30, 2001.
[9] D. Enright, S. Marschner, and R. Fedkiw. Animation and rendering of complex water surfaces.
In Proc. SIGGRAPH ’02, pages 736–744, 2002.
[10] A. Lamura and G. Gonnella. Lattice boltzmann simulations of segregating binary fluid mixtures
in shear flow. Physica A, 294(3):295–312, May 2001.
[11] M. R. Swift, W. R. Osborn, and J.M. Yeomans. Lattice boltzmann simulation of liquid-gas and
binary fluid systems. Physical Review E, 54(5):5041–5052, 1996.
22
[12] N. Takada, M. Misawa, and A. Tomiyama. A phase-field method for interface-tracking simulation of two-phase flows. In Proc. FEDSM2005(ASME Fluids Engineering Division Summer
Meeting and Exhibition), Jun 2005.
[13] H. W. Zheng, C. Shu, and Y. T. Chew. A lattice boltzmann model for multiphase flows with
large density ratio. Journal of Computational Physics, 218(1):353–371, 2006.
[14] J. Stam. Stable fluids. In Proc. SIGGRAPH ’99, pages 121–128, 1999.
[15] F. Losasso, F. Gibou, and R. Fedkiw. Simulating water and smoke with an octree data structure.
In Proc. SIGGRAPH ’04, pages 457–462, 2004.
[16] G. Irving, E. Guendelman, F. Losasso, and R. Fedkiw. Efficient simulation of large bodies
of water by coupling two and three dimensional techniques. In Proc. SIGGRAPH ’06, pages
805–811, 2006.
[17] P. L. Bhatnagar, E. P. Grossa, and M. Krook. A model for collision processes in gases. i.
small amplitude processes in charged and neutral one-component systems. Physical Review,
94(3):511–525, May 1954.
[18] X. He, Q. Zou, L. S. Luo, and M. Dembo. Analytic solutions of simple flows and analysis of
nonslip boundary conditions for the lattice boltzmann bgk model. Journal of Statistical Physics,
87(1-2):115–136, 1997.
[19] Z. Guo, C. Zheng, and B. Shi. Discrete lattice effects on the forcing term in the lattice boltzmann method. Physical Review E, 65(4), Apr 2002.
23
[20] X. Wei, W. Li, K. Mueller, and A. E. Kaufmann. The lattice-boltzmann method for simulating
gaseous phenomena. IEEE Transactions on Visualization and Computer Graphics, 10(2), Mar
2004.
[21] N. Chu and C. L. Tai. Moxi: real-time ink dispersion in absorbent paper. In Proc. SIGGRAPH
’05, pages 504–511, 2005.
[22] N. Thurey and U. Rude. Free surface lattice-boltzmann fluid simulations with and without level
sets. In Workshop on Vision, Modeling, Visualization(VMV) ’06, pages 199–208, 2004.
[23] A. W. Bargteil, T.G. Goktekin, J. F. O’brien, and J. A. Strain. A semi-lagrangian contouring
method for fluid simulation. ACM Transactions on Graphics, 25:19–38, 2006.
[24] V. Mihalef, D. Metaxas, and M. Sussman. Textured liquids based on the marker level set.
Eurographics 2007.
[25] C. Cowan. The cahn-hilliard equation as a gradient flow. M. Sc. Thesis, Dept. of Math., Simon
Fraser Univ., 2005.
[26] J. Kim. Modeling and simulation of multi-component, multi-phase fluid flows. Ph.D. Thesis,
University of Minnesota, 2002.
[27] J. M. Hong and C. H. Kim. Discontinuous fluids. In Proc. SIGGRAPH ’05, pages 915–920,
2005.
[28] J. Kim. A continuous surface tension force formulation for diffuse-interface models. Journal
of Computatioinal Physics, 204:784–804, 2005.
24
[29] J. Kim. Phase field computations for ternary fluid flows. Computer Methods in Applied Mechanics and Engineering, 196:4779–4788, 2007.
[30] J. M. Buick and C. A. Greated. Gravity in a lattice boltzmann model. Physical Review E,
61:5307–5320, May 2000.
[31] S. S. Chikatamarla, S. Ansumali, and I. V. Karlin. Entropic lattice boltzmann models for hydrodynamics in three dimensions. Physical Review Letters, 97(1), July 2006.
[32] J. Kim, K. Kang, and J. Lowengrub. Conservative multigrid methods for cahn-hilliard fluids.
Journal of Computational Physics, 193:511–543, 2004.
[33] B. Widom. Statistical Mechanics: a concise introduction for chemists. Cambridge University
Press, 2002.
[34] X. Yin, D. Koch, and R. Verberg. Lattice-boltzmann method for simulating spherical bubbles
with no tangential stress boundary conditions. Physical Review E, 73(2), 2006.
[35] A. J. C. Ladd and R. Verberg. Lattice-boltzmann simulations of particle-fluid suspensions.
Journal of Statistical Physics, 104(5-6):1191–1251, Sep 2001.
[36] http://www.mcs.anl.gov/research/projects/mpich2.
[37] N. Thurey, T. Pohl, and U. Rude. Hybrid parallelization techniques for lattice boltzmann free
surface flows. Parallel CFD 2007, 2007.
[38] I.
Forster.
Designing
and
Building
unix.mcs.anl.gov/dbpp/(online book), 1995.
25
Parallel
Programs.
http://www-
[39] W. E. Lorensen and H. E. Cline. Marching cubes: A high resolution 3d surface construction
algorithm. In Proc. SIGGRAPH ’87, pages 163–169, 1987.
[40] B. Kim, Y. Liu, I. Llamas, X. Jiao, and J. Rossignac. Simulation of bubbles in foam with the
volume control method. In Proc. SIGGRAPH ’07, 2007.
[41] D. Enright, R. Fedkiw, J. Ferziger, and I. Mitchell. A hybrid particle level set method for
improved interface capturing. Journal of Computational Physics, 183(1):83–116, 2002.
26
Figure 1: Overall structure of our method
27
Figure 2: Spacial discretization
28
Figure 3: D2Q5 and D3Q7
29
Figure 4: Iterative steps of fluid simulation
30
Figure 5: Domain decomposition
31
PP
PP
resolution
PP
# of nodes
PP
1
2
4
8
1003
37.5
20.3
20.5
32.0
1203
60.0
34.9
28.5
33.4
1503
126.5∗
66.6
47.9
35.7
1753
200.9∗
108.7∗
77.4
62.2
2003
300.0∗
162.4∗
90.1
70.6
PP
P
P
*: simulation impossible, time estimated from 1003 case
Table 1: Parallel computation time (secs)
32
Figure 6: Immiscible fluids (100 × 50 × 50 grid, 1.1 secs per step)
33
Figure 7: Red liquid comes out from the beak of a teapot. After a certain time, teapot-shaped liquid
falls down (140 × 70 × 80 grid, 3.3 secs per step, 4 phases).
34
Figure 8: (upper row) All participating fluids are immiscible. (lower row) The blue and red are
miscible. They are immiscible with the transparent liquid. (80 × 100 × 80 grid, 3.0 secs per step, 4
phases)
35
Figure 9: Multiple fluids are interacting with a rotating rod. Green and dark red liquids ejected
from a rod are interacting with three layers. Rotating rod generates complex flows (100 × 110 × 10
grid, 1.1 secs per step, 6 phases)
36
© Copyright 2026 Paperzz