Graphics Reference
In-Depth Information
-2-
Overview of
Numerical Simulation
Now that we know and understand the basic equations, how do we discretize
them to numerically simulate fluids using the computer? There are an awful
lot of choices for how to do this, and people are continuing to invent new
ways; we won't be able to cover even a fraction of them but will instead
focus on one high-quality approach that works very well for graphics.
2.1 Splitting
The approach works on the basis of something called splitting : we split
up a complicated equation into its component parts and solve each one
separately in turn. If we say that the rate of change of one quantity is
the sum of several terms, we can numerically update it by computing each
term and adding them in one by one.
Let's make that clearer with an incredibly simple “toy” example, a
single ordinary differential equation:
dq
dt
=1+2 .
You of course already know that the answer is q ( t )=3 t + q (0), but let's
work out a numerical method based on splitting. We'll split it into two
steps, each one of which looks like a simple forward Euler update (if you
want to remind yourself what forward Euler is, refer to Appendix A):
q = q n +1Δ t,
(2.1)
q n +1 = q +2Δ t.
(2.2)
17
Search WWH ::




Custom Search