• No results found

Velocity Interpolation

4.4 Capabilities Required for Simulation

4.4.1 Velocity Interpolation

The fluid state location scheme we use describes the fluid velocity field using only the component of velocity normal to the face. For both the semi-Lagrangian velocity advection step and to advect smoke particles or the liquid surface, a full velocity vector must be found at any arbitrary position in the mesh. We interpolate velocity vectors from face normal velocities using the two-step method developed by Elcott et al. [16]. First, a velocity vector utis computed at each tetrahedron circumcenter, then we interpolate within Voronoi cells using ut values at the Voronoi cell vertices.

Velocity utfor tetrahedron t is found by first considering a face of the tetrahedron, face i, to have a normal velocity that is the projection of ut onto the face normal,

nTi ut= zi.

Then a small linear system,

Ntut= zt

accounts for all faces of the tetrahedra simultaneously. Here Ntis a 4× 3 matrix containing 4 rows of the face normals of t and ztis a vector concatenation of the 4 face normal velocities associated with tetrahedra t. This system can be solved in a least squares sense to find ut. In general, this system is overconstrained and the recovered velocity vector will not exactly satisfy the linear system, but it will minimize the squared error. If u is divergence-free field, the linear system is obeyed exactly due to the additional mass conservation constraint on

u

t

n

i

,z

i

u

t

c

t

x

Figure 4.1: Two-dimensional representation of velocity interpolation. A velocity vector is computed for each tetrahedron from the face normal velocities. These velocities are at the vertices of the Voronoi cell. The velocity at some arbitrary location x can be computed by interpolating the Voronoi cell.

the face normal velocities.

To find a velocity at an arbitrary point we interpolate within the Voronoi cell using the tetrahedra velocities ut which are located at the Voronoi cells’ vertices (the tetrahedra circumcenters). Voronoi cell interpolation uses generalized barycentric coordinates of convex polytopes from the paper of Warren et al. [68]. This paper presents barycentric interpolation within general convex polytopes. They interpolate the value at the point x as a weighted sum of the polytope’s vertices values. Vertex t’s unnormalized weight is computed as

wt(x) =  |Nt|

f ∈σtnf · x + df

. (4.6)

Here, σtis the set of polytope faces that adjoin vertex t. The denominator is the product of

distances from x to the faces in σt computed using the face normals, nf, and plane offsets,

df. |Nt| is the determinant of a matrix of unit face normals in σt. The denominator is a

product of the distance from the evaluation point to each of the faces in σt. Weights from all

To simplify this computation we take advantage of the fact that we are interpo- lating a particular convex polytope, the Voronoi cell of a Delaunay mesh. There are two important properties of these cells: 1) in a Delaunay mesh, edges are in the direction of the Voronoi cell’s face normals, and 2) the volume of tetrahedron t is|Et|/6 where Etis a matrix formed from the three vectors of edges, e1, e2, e3 emanating from a common node of t. By using these properties, Equation (4.6) can be manipulated into a much more convenient form: wt(x) =  |Nt| f ∈σtnf · x + df (4.7) =  |Nt| f ∈σtnf · (ct− x) (4.8) = 6 1 6|e1| |e2| |e3| |Nt|  f ∈σt|ef|nf · (ct− x) (4.9) =  6Vol(t) f ∈σtef · (ct− x) (4.10)

where wt(x) is the weight associated with the node at tetrahedra t’s circumcenter, Vol(t) is the volume of tetrahedron t, ef is vector of the edge from the node associated with the Voronoi cell to the other vertices of t, ct the circumcenter of t, and x the interpolation position. The advantage here is that all terms appearing in Equation (4.10) are properties of the mesh, either available, or quickly computable. The terms in Equation (4.6), involve more complex terms that would require either substantially more storage or computation. With this simplification velocity interpolation is substantially more practical.

Finally, letting d denote the set of tetrahedra adjoining the vertex belonging to the Voronoi cell that contains point x, the velocity at x is

u(x) = 1 n d  t=1 wt(x)ut (4.11)

where n =dt=1wt(x).

For the semi-Lagrangian velocity advection step it is important to use as accurate an interpolation method as is possible. This is because this step uses the interpolation to update the velocity field itself. Therefore, any error in interpolation is accumulated over every time step. For situations where error is not cumulative such as when advecting visu- alization particles we employ a quicker (albeit less accurate) method. First, as a preprocess, velocities at the vertices of all tetrahedra for the new time step are found by interpolating using Equation (4.10). Interpolation at a vertex is a special case of Equation (4.10) and can be simplified to

wt(x) = 6Vol(t)3

i=1|ei|2

. (4.12)

Then interpolation of the velocity at any point inside the mesh can interpolated from these vertex velocities using standard barycentric coordinates,

u(x)

4



i=1

bi(x)ui.

Here biare the barycentric coordinates of x in the tetrahedra that contains x and ui are the velocities at that tetrahedron’s vertices found using Equation (4.11) with weights computed by Equation (4.12).

Related documents