Graphics Reference
In-Depth Information
However, it's still dicult to solve since the location at which we are ap-
plying the free surface boundary condition moves according to the solution
of h . Assuming that the waves aren't too large, i.e., h is small, we can
cheat and instead put the boundary condition at y = 0, leading to a new
simplified problem:
∇·∇
φ =0
for
H
y
0 ,
∂φ
∂y
=0
at y =
H,
∂φ
∂t
= −gh ( x, z )
t y =0 ,
∂h
∂t
= ∂φ
∂y
at y =0 .
H
y
This now is a perfectly linear PDE on a simple slab
0. (We also
swapped in ∂φ/∂y for v , to make it clear how h and φ are coupled.) One
of the great properties we now have is that we can add (superimpose) two
solutions to get another solution, which we'll exploit to write the general
exact solution as a linear combination of simpler solutions.
We haven't yet touched on boundary conditions along x and z :we've
implicitly assumed so far that the ocean is infinite, stretching out forever
horizontally. We can actually solve this analytically, using Fourier integrals,
but clearly this raises some problems when it comes to implementation on
a finite computer. Instead we will assume the ocean is periodic in x and z ,
with some suitably large length L being the period. From a graphics stand-
point, L should be large enough that the periodicity is inconspicuous—an
L
L ocean “tile” should probably fill a reasonable fraction of the screen.
(We'll later discuss a few other tricks to further obscure periodicity.) Any
reasonable periodic function can be represented as a Fourier series, which
for computer implementation we'll simply truncate to a finite number of
terms.
Before jumping to the full Fourier series, let's take a look at a single
Fourier mode. Though it may be a little mind-bending to try and visualize
it, we'll actually use a complex exponential for this: ultimately this is more
convenient mathematically and corresponds best to what a typical Fast
Fourier transform library offers in its API, even though the PDE as we
have written it only involves real numbers.
Let's start with a generic Fourier component of the height field:
×
h ( x, z, t )= h ij ( t ) e 12 π ( ix + jz ) /L .
Search WWH ::




Custom Search