Usenet.com

www.Usenet.com

Group Index

Sci Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: gradient field in 3D



Jesper Taxboel wrote:

|> I have also posted this question in comp.graphics.algorithms, but i thourght
|> this forum might be better
|> 
|> Im trying to implement  3D edition of Jos Stam's "Real-Time fluid
|> dynamics for games" 2D example.
|> 
|> In this paper it is described that mass conservation can be achieved by
|> using the Hodge decomposition. Something about saying that "every velocity
|> field is the sum of a mass conserving field and a gradient field".

What they really mean is "a solenoidal and a potential field".  The
first has a curl but is divergence free; the second has a divergence but
is curl free.

|> Anyways I need to find that gradient field so I can substract it from my
|> velocity field and thereby conserve mass. (when I conserve mass, I should
|> get the fluid like vortices.)
|> 
|> It is further mentioned that the computing gradient field is equivalent to
|> computing a height field. At least in 2D.
|> 
|> But how do I approach the problem in 3D?
|> 
|> I can imagine how to approach the problem in 2D. Just find the slope along
|> the 2 axis. But in 3d???

It is very different in 2D and 3D, due to the fact that in 2D you can
use the fact that the vorticity vector is perpendicular to the plane the
motion takes place in:

    v = z cross grad W + grad X

where W is the stream function for the solenoidal (shear) flow and X is
the potential for the compressional flow.  Here, both W and X are scalar
fields.  In 2D you isolate these pieces according to

    z dot curl v = Laplacian W

    div v = Laplacian X

and then you solve these Poisson equations for W and X.

In 3D you project the compressional piece away to find the solenoidal
piece:

    div v = Laplacian X

    find X

    v' = v - grad X

This is how Colella and coworkers do it in their 2D and 3D
incompressible CFD codes...

-- 
cu,
Bruce

drift wave turbulence:  http://www.rzg.mpg.de/~bds/




<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.