Graphics Reference
In-Depth Information
4.3 The Pressure Equations
We now have the two ingredients we will need to figure out incompress-
ibility: how to update velocities with the pressure gradient and how to
estimate the divergence.
Recall that we want the final velocity, u n +1 to be divergence-free inside
the fluid. To find the pressure that achieves this, we simply substitute
the pressure-update formulas for u n +1 , Equations (4.1) in 2D and (4.3) in
3D, into the divergence formula, Equation (4.7) in 2D and (4.8) in 3D.
This gives us a linear equation for each fluid grid cell (remember we only
evaluate divergence for a grid cell containing fluid), with the pressures as
unknowns. There are no equations for solid or air cells, even though we
may refer to pressures in them (but we know apriori what those pressures
are in terms of the fluid cell pressures).
Let's write this out explicitly in 2D for fluid grid cell ( i, j ):
u n +1
u n +1
i− 1 / 2 ,j
v n +1
v n +1
i,j− 1 / 2
i +1 / 2 ,j
i,j +1 / 2
+
=0 ,
Δ x
Δ x
u i +1 / 2 ,j
1
Δ x
Δ t 1
ρ
p i +1 ,j
p i,j
Δ x
u i− 1 / 2 ,j
Δ t 1
ρ
p i,j
p i− 1 ,j
Δ x
+ v i,j +1 / 2
Δ t 1
ρ
p i,j +1
p i,j
Δ x
v i,j− 1 / 2
=0 ,
Δ t 1
ρ
p i,j
p i,j− 1
Δ x
4 p i,j
=
Δ t
ρ
p i +1 ,j
p i,j +1
p i− 1 ,j
p i,j− 1
Δ x 2
u i +1 / 2 ,j
.
u i− 1 / 2 ,j
Δ x
+ v i,j +1 / 2
v i,j− 1 / 2
Δ x
(4.9)
Search WWH ::




Custom Search