Graphics Reference
In-Depth Information
The easier pressure boundary condition is at a free surface, as in water
simulation. Here we assume that the pressure is simply zero outside the
fluid: in our update formulas we replace the p i,j,k 's that lie in air cells with
zero. This is called a Dirichlet boundary condition if you're interested in
the technical lingo: Dirichlet means we're directly specifying the value of
the quantity at the boundary.
The more dicult pressure boundary condition is at solid walls. Since
the solid-wall boundaries line up with the grid cell faces, the component
of velocity that we store on those faces is in fact u
n . In this case, sub-
tracting the pressure gradient there should enforce the boundary condition
u n +1
·
n . This works out to be a specification of the normal
derivative of pressure (which technically is known as a Neumann boundary
condition). By substituting in the pressure update this turns into a simple
linear equation to solve for the pressure inside the solid wall. For example,
supposing grid cell ( i, j ) was fluid and grid cell ( i +1 ,j ) was solid, we would
update u i +1 / 2 ,j with
·
n = u solid ·
Δ t 1
ρ
p i +1 ,j
p i,j
u n +1
i +1 / 2 ,j = u i +1 / 2 ,j
,
Δ x
and we know that u n +1
i +1 / 2 ,j actually is u solid . Rearranging the update equa-
tion gives
Δ t u i +1 / 2 ,j
u solid .
p i +1 ,j = p i,j + ρ Δ x
(4.6)
When we actually update the velocity in the code, rather than bothering to
substitute in this pressure, we can simply set velocities on solid-boundary
faces equal to the solid normal velocity. However, Equation (4.6) will be
necessary in deriving the equations that define pressure in the interior.
An odd point about the boundary conditions that needs to be men-
tioned here is that we typically figure out the solid grid cell pressure for
each boundary face independently . That is, if a solid grid cell has two or
more faces adjacent to fluid cells, we are going to calculate two or more com-
pletely independent pressure values for the cell! If this seems weird just
remember that properly speaking, at the continuum level, fluid pressure
isn't defined in the interior of the solid: we just have the pressure gradient
at the boundary of the solid. Numerically it's convenient to express that
as a finite difference (it fits in with all the other formulas) but the pressure
we talk about inside that solid grid cell is really just a convenient figment
of our mathematical imagination: in fact, they are sometimes called ghost
values . All that counts is the pressure difference on the boundary faces.
Therefore we don't store pressure explicitly inside the solid grid cell (since
Search WWH ::




Custom Search