Graphics Reference
In-Depth Information
Now we'll take the same approach to discretizing the work as in dis-
cretizing the kinetic energy, introducing also the volume of fluid
V
i,j,k
in a
p
-cell, which is the usual grid cell with a pressure value at its center. The
discrete estimate of work is
Δ
t
i,j,k
p
i
+1
,j,k
−
p
i,j,k
u
solid
i
+1
/
2
,j,k
W
≈
V
i
+1
/
2
,j,k
Δ
x
+Δ
t
i,j,k
p
i,j
+1
,k
−
p
i,j,k
v
solid
i,j
+1
/
2
,k
V
i,j
+1
/
2
,k
Δ
x
+Δ
t
i,j,k
p
i,j,k
+1
−
p
i,j,k
w
solid
i,j,k
+1
/
2
V
i,j,k
+1
/
2
Δ
x
u
solid
+Δ
t
i,j,k
u
solid
i
+1
/
2
,j,k
+
v
solid
v
solid
i,j
+1
/
2
,k
i
+1
/
2
,j,k
−
i,j
+1
/
2
,k
−
V
i,j,k
p
i,j,k
Δ
x
w
solid
i,j,k
+1
/
2
−
w
solid
i,j,k
+1
/
2
+
.
Δ
x
(4.16)
With this we are set: just from the various cell volumes we have a good
discretization of the total change in energy of the system.
The next step, conceptually, is to take this change in energy as a func-
tion of the (still unknown) discrete pressure values and subsequently solve
for the discrete pressure that minimizes it. We are thus discretizing the
minimization form of the pressure projection, not the PDE form, and there-
fore needn't worry about the solid wall boundaries: they will take care of
themselves automatically!
It's not hard to see that pressure values appear only linearly in the work
W
, linearly in the updated fluid velocities, and thus quadratically in the dis-
crete kinetic energy—in fact, the discrete kinetic energy is just a weighted
sum of squares, and since the weights are non-negative (because the fluid
density and the cell volumes are non-negative), we expect the problem to
be well-posed—modulo the compatibility condition, that the integral of the
normal component of solid velocities should be zero in the absence of free
surfaces, which we will return to in the last section. To find the minimizing
pressure all we need do is take the gradient of the change in energy with
respect to the pressure values, set it to zero, and solve the resulting linear
system.