Graphics Reference
In-Depth Information
where x i , y j and z k give the coordinates of the center of grid cell ( i, j, k ).
From this we see that the fourth row of J is given by
Z ) V i,j +1 / 2 ,k
V i,j− 1 / 2 ,k
Δ x
Y ) V i,j,k +1 / 2
V i,j,k− 1 / 2
Δ x
J 4 , ( i,j,k ) =
( z k
+( y j
.
Similarly, the last two rows of J , corresponding to the second and third
components of net torque, are
X ) V i,j,k +1 / 2
V i,j,k− 1 / 2
Δ x
J 5 , ( i,j,k ) =
( x i
Z ) V i +1 / 2 ,j,k
V i− 1 / 2 ,j,k
Δ x
+( z k
,
Y ) V i +1 / 2 ,j,k
V i− 1 / 2 ,j,k
Δ x
J 6 , ( i,j,k ) =
( y j
X ) V i,j +1 / 2 ,k
V i,j− 1 / 2 ,k
Δ x
+( x i
.
Note that away from the boundary of the solid, all of these volume differ-
ences are just zero, so J is quite sparse: it has non-zero columns only for
cells near the boundary of the solid.
To be perfectly consistent, and thus be able to get exact hydrostatic
rest for neutrally buoyant bodies fully immersed in fluid, we can also use
the same volumes to approximate the rigid body's inertia tensor—however,
outside of this particular scenario this is probably unnecessary work and
thus we leave it to the reader to derive it if interested.
For notational convenience, we'll put the rigid body's translational ve-
locity V and angular velocity Ω together into one six-dimensional vector
U . Similarly we can construct a 6
×
6 mass matrix M from the mass and
inertia tensor:
000
m
0
0
m
0
M =
.
0
00 m
0
0
0
I
2 U T M U and the pressure update
1
Then the kinetic energy of the body is
is U n +1 = U tM 1 Jp .
Finally, we are ready for the discrete minimization. Taking the gradient
of the new kinetic energy with respect to pressure gives
2 U tM 1 Jp T M U tM 1 Jp =
∂p
Δ t 2 J T M 1 Jp tJ T U.
Search WWH ::




Custom Search