<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Won-Sook Lee</string-name>
          <email>wslee@uottawa.ca</email>
        </contrib>
      </contrib-group>
      <fpage>4</fpage>
      <lpage>5</lpage>
      <abstract>
        <p>We present our ongoing work on developing techniques for realtime simulation and visualization of fluids. We propose synthesizing fluid motion from simulation examples obtained with a full numerical solver. We segment our simulation data in order to capture the properties of local fluid behavior and apply statistical techniques to obtain the main modes of variation of the flow interacting with solid obstacles. Most research in fluid simulation has been focused on techniques for solving the NavierStokes equations for fluid motion, obtaining physically accurate simulations. We aim to obtain visually plausible flows by combining the results of physically accurate simulations preserving the general flow behavior. Our technique is suitable to be applied for visual effects design in movies as well as real-time applications such as videogames and virtual environments with haptic interaction, where efficient computations are required.</p>
      </abstract>
      <kwd-group>
        <kwd>Fluid simulation</kwd>
        <kwd>principal component analysis</kwd>
        <kwd>visualization</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>Simulating fluids remains one of the most challenging problems
in computer graphics. Recent advances in computer applications
demand more realism and interactivity. Several techniques have
been developed to provide accurate and realistic fluid simulations,
however, at a great computational cost. This is due to the interplay
of different complex phenomena involved, such as advection,
diffusion and turbulence, which are difficult to simulate. Fluid
behavior is characterized by the well known Navier-Stokes
equations which are a system of partial differential equations for
which no analytical solution is known.</p>
      <p>
        In computer graphics, the main goal is to achieve visual
plausibility, even at the cost of physical accuracy. Several
approximations to fluid behavior have been developed, including
particle-based simulations [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and height field approximations for
liquid surfaces [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Applications of fluid simulations include
visual effects in movies and videogames, as well as real-time
interaction with virtual environments [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        We propose a different method to efficiently obtain visually
plausible simulations using fluid motion examples. These
examples are obtained by running a standard fluid simulation
under different flow conditions and the resulting motion data is
spatially partitioned into different fragments. We apply principal
component analysis (PCA) on the fragments and we employ this
information to synthesize new fluid motion. Fluid motion
databases have been used in the past for computing fluid forces on
immersed solid objects [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], however we focus on visualizing the
fluid behavior in real-time. Composing fluid behavior from a set
of simulation components or tiles has been applied with model
reduction [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Here each component contains a base of possible
fluid velocities. In our scenario, we do not use model reduction
for our simulations, but synthesize motion from examples
obtained by numerically solving the Navier-Stokes equations.
      </p>
    </sec>
    <sec id="sec-2">
      <title>METHODOLOGY</title>
      <p>
        In this section we discuss the two stages of our simulation
framework: the construction of the examples database and the
synthesis of new fluid motion from these examples. We represent
the fluid using an Eulerian approach, both in the preprocessing
and motion synthesis stages. The simulation space is divided into
a regular grid of cells. In each cell the fluid velocity and pressure
are stored. Solid objects are assumed to be static and they are
voxelized as in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], conforming to the simulation space
configuration. In the preprocessing stage simulation examples are
produced and analyzed. In the synthesis stage we find velocity
values for each grid cell to approximate fluid behavior by
combining the flow information from the simulation examples. A
schema of our approach is shown in Figure 1.
2.1
      </p>
    </sec>
    <sec id="sec-3">
      <title>Database construction</title>
      <p>
        Fluid flow examples are obtained from simulating the fluid on the
grid in the pre-processing stage. For simulating the fluid we
employ a finite difference method based on operator splitting and
semi-Lagrangian advection [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. We run several simulation rounds
for different solid configurations in order to have a rich set of
fluid motion examples. In a simulation round the obstacle
geometry is defined, and the fluid is simulated under different
flow conditions, varying the direction and magnitude of the fluid
velocity. Velocity values for each time step of simulation are
stored for segmenting and statistical analysis.
      </p>
      <p>Once the examples have been obtained, the results of each time
step are segmented in fragments of equal size. A fragment
consists on several grid cells, each storing velocity and pressure
values. For each fragment we keep track of its neighboring
fragments as well as the corresponding fragment in the next time
step. As we consider only the case of static solids, the velocities in
the grid cells occupied by a solid are zero. An example of the fluid
examples generated and its fragments is shown in Figure 2.</p>
      <p>We apply PCA on the fragments to capture the main modes of
variation of the fluid velocity. We construct a covariance matrix
from the fluid velocity data in each fragment and we obtain the
eigenvectors and eigenvalues of this matrix. Then we transform
our simulation data into the PCA space, this is, we represent the
data in terms of the principal components, which are the
eigenvectors with highest eigenvalues associated. The fragments
spatial and temporal associations are stored, enabling to quickly
determine the local evolution of the fluid for a specific fragment.</p>
    </sec>
    <sec id="sec-4">
      <title>Flow synthesis</title>
      <p>Synthesizing new fluid motion in the simulation grid is performed
using the data from the examples and the current velocity in the
grid. A specific velocity field may be defined by the user as initial
conditions for the simulation, or as result of real-time interaction.
The new simulation data is segmented into fragments the same
way as the examples and the velocity data for each fragment is
translated into the PCA space. For fragments that contain solid
cells, or that share a boundary with a solid, a pattern matching
step is performed in order to determine the best example
fragments that resemble the specific local solid geometry.</p>
      <p>Let f be a fragment in the new simulation and S the set of
example fragments that are geometrically compatible with f. The
fluid velocity in f is determined by finding a combination of
examples such that it matches the behavior observed in f.
Formally, let e1, e2,,…,en be the first n principal components
derived from the examples, and let B=[b1, b2,…bn]T be the vector
of coefficients corresponding to f in the PCA space. For each
example si∈S, let Ci=[ci1,…, cin]T be the vector of coefficients in
the PCA space. Then synthesizing new motion reduces to solving
the following system:
[C1 L C k ]⋅ x = B
(1)</p>
      <p>The coefficients of vector x indicate how the samples must be
combined to match the current motion in the current time step. As
the matrix in equation (1) may not be square, the system may have
to be solved in the least squares sense. If no external force is
added by the user, then solving the fluid velocity in f for the next
time step consists on finding the corresponding fragments in S for
the next time step and combining them using the coefficients in x.
When an external force is added, it is necessary to solve the
system in equation (1) as the fluid motion may have drastically
changed. Notice that as we assume the solid objects are static,
determining the set S of geometrically compatible fragment
examples for each new fragment is performed just once at the
beginning of the simulation. Using this simple technique we can
simulate fluids interacting with static rigid solids.
3</p>
    </sec>
    <sec id="sec-5">
      <title>DISCUSSION</title>
      <p>Our approach may be used to simulate fluids at different detail
scales, depending on the size of the simulation fragments. Smaller
fragments will provide more detailed information, at a higher
computational cost. We must note that the flow results in general
will not be mass-conserving in the strict sense. The mass
conservation principle expresses that any change in fluid mass in a
region depends only on the net flux of mass in that region. This is
usually enforced as an additional constraint when solving the
Navier-Stokes equations. Although the examples used to construct
our database are mass-conserving, linear combinations of these
examples may not. While this is not a big problem when
simulating a gas, care must be taken when simulating liquids
using our technique. Liquid simulation requires the proper
definition of a free surface. A non-mass conserving fluid will
appear as evaporating, hence losing mass. To properly simulate
liquids using our technique, examples of the free surface have to
be generated and statistically analyzed as well.</p>
      <p>We note as well that the different visual effects that can be
obtained by this technique are limited to the fluid motion
variations in the database. Extending the examples database
would allow simulating more diverse solid-fluid interactions.</p>
    </sec>
    <sec id="sec-6">
      <title>CONCLUSION</title>
      <p>We present an approach to synthesize fluid motion from
examples. Statistical analysis is performed on the examples and
they are combined in order to approximate fluid behavior. This
approach is suitable to be used for real-time applications such as
videogames and interaction with virtual environments. In the
future we aim to extend our method to properly simulate fluid
interaction with moving solids. Also we aim to provide more
animation control by allowing the user to specify the velocity in
specific fragments in different locations and times, so fluid motion
must be synthesized to match the user constraints.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Dobashi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Sato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Hasegawa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Yamamoto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kato</surname>
          </string-name>
          and
          <string-name>
            <given-names>T.</given-names>
            <surname>Nishita</surname>
          </string-name>
          .
          <article-title>A fluid resistance map method for real-time haptic interaction with fluids</article-title>
          .
          <source>In Proceedings of the ACM Symposium on Virtual Reality Software and Technology VRST'06 (Limassol, Cyuprus, November 1-3</source>
          ,
          <year>2006</year>
          ), pages
          <fpage>91</fpage>
          -
          <lpage>99</lpage>
          ,
          <year>November 2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Foster</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Metaxas</surname>
          </string-name>
          .
          <article-title>Realistic animation of liquids</article-title>
          .
          <source>In Graphical Models and Image Processing</source>
          , volume
          <volume>58</volume>
          , issue 5, pages
          <fpage>471</fpage>
          -
          <lpage>483</lpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Kass</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Miller</surname>
          </string-name>
          .
          <article-title>Rapid, stable fluid dynamics for computer graphics</article-title>
          .
          <source>In ACM SIGGRAPH Computer Graphics</source>
          , volume
          <volume>24</volume>
          , issue 4, pages.
          <fpage>49</fpage>
          -
          <lpage>57</lpage>
          ,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Müller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Charypar</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Gross</surname>
          </string-name>
          .
          <article-title>Particle-Based Fluid Simulation for Interactive Applications</article-title>
          .
          <source>in Proceedings of ACM SIGGRAPH Symposium on Computer Animation (SCA)</source>
          <year>2003</year>
          , pages
          <fpage>154</fpage>
          -
          <lpage>159</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Stam</surname>
          </string-name>
          .
          <article-title>Stable fluids</article-title>
          .
          <source>In Proceedings of the 26th annual conference on Computer Graphics and Interactive Techniques SIGGRAPH '99</source>
          , pages
          <fpage>121</fpage>
          -
          <lpage>128</lpage>
          . ACM Press/Addison-Wesley Publishing Co.
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Treuille</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Lewis</surname>
          </string-name>
          and
          <string-name>
            <given-names>Z.</given-names>
            <surname>Popović</surname>
          </string-name>
          .
          <article-title>Model reduction for real-time fluids</article-title>
          .
          <source>In Transactions on Graphics</source>
          , volume
          <volume>25</volume>
          , issue 3, pages
          <fpage>826</fpage>
          -
          <lpage>834</lpage>
          . ACM Press,
          <year>July 2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Vines</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mora</surname>
          </string-name>
          and
          <string-name>
            <given-names>W.-S.</given-names>
            <surname>Lee</surname>
          </string-name>
          .
          <article-title>Haptic Display of 3D Liquids for Interactive Applications</article-title>
          .
          <source>In IEEE Consumer Electronics Games Innovation Conference ICE-GIC 2009 (London, United Kingdom from August 25-28)</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>