Graphics Reference
In-Depth Information
2 ρw 2 , can be similarly approximated
using the fluid volumes V i,j +1 / 2 ,k and V i,j,k +1 / 2 and average densities in
the similarly defined v -and w -cells. Just as with the finite volume dis-
cretization, the new kinetic energy, based on the updated velocities every-
where the cell volumes are non-zero, will probably involve pressures inside
solids.
While the cell volumes entirely in the interior of the fluid are exactly
Δ x 3 (and are zero when entirely outside of the fluid), they pose an inter-
esting problem where solids cut through the grid. Exact clipping formulas
for polyhedra are available, though devilishly hard to get right. However,
it is not essential that the answers are exact: as will become obvious below,
the voxelized discretization that began the chapter corresponds to choosing
either 0 or Δ x 3 as the weight in a binary fashion. Anything more accurate—
even just using the same binary decisions but summed over a 2
1
2 ρv 2
1
The other integrals, of
and
2super-
sampling of each cell—will help significantly, and extremely high accuracy
may be pointless as other errors in the discretization will dominate. Later in
Chapter 6, when we cover signed distance functions, we will find some par-
ticular simple approximations that nevertheless can be quite accurate for
smooth geometry.
Continuing on, let's turn to the work exchanged with solids. Presented
above it is a surface integral, which is a bit clumsy to discretize on a volume
grid. Therefore, we change it to a volume integral with the divergence
theorem:
×
2
×
W =
S
Δ tu solid t
pn
·
Ω ∇·
( pu solid ) .
This may appear strange at first sight: the solid velocity isn't defined in
the fluid! However, the theorem holds true for any reasonable extrapola-
tion of solid velocity into the fluid and poses no diculty for numerical
implementation: either the velocity is naturally defined everywhere, as is
the case for rigid motions, or can be extrapolated as the velocity on the
closest point of the object's surface. This volume integral still isn't quite
in a convenient form, since on the MAC grid we store pressures at different
locations than velocity. Thus we use the product rule of differentiation to
get
u solid t
Ω
W t
Ω
p
·
p
∇·
u solid .
It should be pointed out that the second integral, involving the divergence
of solid velocity, is exactly zero for rigid-body motions.
Search WWH ::




Custom Search