CS530 - Fall 2015
Project 4 - Vector Field Visualization

Key Dates

Handed out: October 28, 2015

Due: November 11, 2015 before 8:00 am

Objective

The topic of this assignment is vector field / flow visualization. You will study a delta wing dataset similar to the one you visualized in the second part of project 3. This time, you will visualize the velocity information using vector field visualization techniques. Your objective will be to show the major flow structures present in the dataset (primary and secondary vortices and recirculation bubble on each side of the wing). Note that this project contains an optional Part 2 that counts toward extra credit and for which a separate deadline exists. Refer to the corresponding instructions below.

Part 1 [100%]

Task 1: Glyphs [20%]

Your first task consists in using a cutting plane to probe the vector values. Specifically, I am asking you to create a plane orthogonal to the X axis of the volume and to sample the velocity vector field on that plane. You will need to follow an approach similar to what is demonstrated in Graphics/Testing/Tcl/probe.tcl for that purpose. To represent individual vectors as arrows, you will use vtkArrowSource and use it as the source of a vtkGlyph3D filter. Use 3 plane at 3 different locations along the X axis (with normal pointing along the X direction) to capture the structures mentioned above. Show the delta wing geometry in each image for context (the corresponding geometry is provided as vtkUnstructuredGrid in a separate file).

Deliverables: Create an executable named three_planes[.py] that contains the (hardcoded) information needed to visualize the vector glyphs on the 3 planes that you have selected. Your executable should receive the names of two files from the command line, namely the CFD file containing the vector field information and the file containing the geometry of the delta wing.

> three_planes <tdelta.vtk> <wing.vtk>

Report: Explain in the report how you selected the planes used in your implementation and comment on the properties of the flow that you can discern in your visualization. Include pictures showing each cutting plane individually (along with the associated glyphs) as well as other images showing all planes and the wing together.

Task 2: Streamlines, Stream Tubes and Stream Surfaces [40%]

Task 1 should provide you with a general sense of the location of interesting structures in the flow volume. Your second task now consists in using streamlines, stream tubes and stream surfaces as demonstrated in Examples/VisualizationAlgorithms/*/officeTube.* and Examples/VisualizationAlgorithms/*/streamSurface.* to show how the flow swirls around the vortices present in the data.

Deliverables: You will construct 3 visualizations for this task.

In each case, the seeding locations and the other parameters of the technique must be hardcoded in your program. You must choose parameter values that produce good quality results and capture the behavior of the flow around the vortices on each side of the wing. Note that each visualization should represent the velocity magnitude using color coding and the corresponding color scale should be provided for reference. Show the delta wing geometry in each image for context.

> streamlines <tdelta.vtk> <wing.vtk>
> streamtubes <tdelta.vtk> <wing.vtk>
> streamsurfaces <tdelta.vtk> <wing.vtk>

Report: Explain in the report how the seeding locations were chosen for each of these three techniques and how they relate to the observations made in Task 1.

Task 3: Combining Scalar and Vector Visualization [20%]

The scalar and vector information available for this dataset provide two complementary perspectives on the properties of the flow. For the third task of this assignment, you will combine isosurfaces of vorticity magnitude with streamlines to visualize the relationship between the streamlines’ geometry and the shape of the isosurfaces. Create visualizations in which the streamline seeds and the isovalues of the isosurface are chosen in such a way as to best illustrate the correlation between the two kinds of object.

Deliverables: Create and executable named combined[.py] that produces a visualization of the CFD dataset, combining isosurfaces of the vorticity magnitude, streamlines of the velocity vector field, and geometry of the delta wing. The various parameters needed to create the visualization must be hardcoded in the program. Your executable should receive from the command line the names of the three files needed to create the visualization: velocity dataset, vorticity dataset, and wing geometry description.

> combined <tdelta.vtk> <vorticity.vtk> <wing.vtk>

Report: Describe in the report the things you tried before arriving at the proposed solution and explain why your final selection is a good one. Show the delta wing geometry in each image for context.

Task 4: Analysis [20%]

Considering your results in Task 1 and Task 2 of the assignment, comment on the effectiveness of the resulting visualizations for your understanding of this dataset. What were the pros and cons of each technique? Comment on the results you were able to achieve in Task 3 by integrating isosurfacing and vector visualization. Did you find this combination beneficial? Provide a justified answer to each of these questions in the report.

Part 2: High-Quality Stream Surface Computation [100%]

We saw in class that stream surfaces possess a natural two-dimensional parameterization whereby one dimension corresponds to the parameterization of the initial (seeding) curve and the other dimension corresponds to the integration time. These concepts are illustrated below. The left image shows a stream surface (seed curve in blue), the right image shows its corresponding 2D parameterization (seed curve parameterization from 0 to 1, time axis parameterization from T0 to Tmax).

Your task in Part 2 of this project is to design and implement an algorithm that leverages the correspondence between 2D parameterization and surface in 3D to progressively refine an initially coarse stream surface until a high-quality approximation is achieved. In this framework, the stream surface is a function of two variables that associates every position in the parameter domain with the corresponding 3D position on the stream surface:

$$\begin{array}{rcl} \mathrm{f}\,:\, [0,\,1]\,\times\,[T_0,\,T_{max}]&\rightarrow&{\mathrm{I\!R}}^{3}\\ (s,\,t)&\mapsto&\left(x(s,t),\, y(s,t),\, z(s,t)\right) \end{array}$$

Each streamline integrated from the seed curve provides a set of points of constant s coordinate, where s is the parameter with the start location of the streamline on the seed curve. The solution that VTK implements to create a stream surface from those points consists in triangulating the space separating consecutive streamlines (i.e., creating ribbons). See image below on the left. The problem with this strategy as we saw in class is that the proximity of points in the parameter domain does by no means guarantee that their associated 3D coordinates are close as well. Connecting them with triangles amounts to interpolating the space between them linearly, which is a poor approximation of the actual shape of the stream surface if it is curved. If neighboring streamlines drift away from each other, additional points are needed in the space that separates them to improve the quality of the stream surface approximation through triangles. This situation is illustrated below on the right where the triangulation shown previously has been refined through the insertion of two additional streamlines between existing streamlines (gray edges correspond to the coarse triangulation while black edges are part of the finer triangulation).

Similarly, additional points are needed if neighboring triangles form a sharp angle along their common edge. See below.

In both cases, the addition of new points to the triangulation of the parameter space requires the computation of additional streamlines from the seed curve. In summary, the successful implementation of this method requires that you come up with a way to monitor the size in 3D of the triangles that connect your points in parameter space as well as the angles that these triangles form along their edges. If these quantities exceed pre-defined thresholds (that you will need to experiment with), your algorithm should then add streamlines starting from your seed curve and re-triangulate the portion of the parameter space crossed by those new streamlines (see red region in the illustration above). Note that the triangulation in parameter space can be carried out using either a ribbon approach (see vtkRuledSurfaceFilter) or a more general 2D Delaunay strategy (see vtkDelaunay2D). Either way, the triangulation problem is a 2D one, since the connectivity between points (stored in vtkCellArray) can be established in parameter space and then applied to the 3D point set.

Implement a stream surface computation technique that follows this basic idea and apply it to the delta wing velocity dataset described below. Your results should clearly document the visual quality that your method can achieve. Your executable (hqstreamsurface[.py]) should support following API:


> hqstreamsurface[.py] <filename> <x0> <y0> <z0> <x1> <y1> <z1> <tmax>

where (x0,y0,z0) and (x1,y1,z1) are the coordinates of the end points of the seeding segment and tmax prescribes the length of the integration.

Relevant literature

Data Sets

As stated above, the CFD dataset used in this project is very similar to the one you visualized in the previous assignment. The data is available in high and low resolution versions. In each case, the information available corresponds to the velocity (vector field) and the vorticity magnitude (a scalar field). A file describing the geometry of the delta wing is also available. Note that while the CFD simulation that produced this dataset was computed over an unstructured grid, all the datasets included in this project are of type vtkStructuredPoints with float precision, at the exception of the wing (vtkUnstructuredGrid).

Submission

Submit your solution for Part 1 of this project before November 11, 2015 at 8:00 am. If you decide to complete Part 2, submit your solution for Part 2 before November 30, 2015 at 8:00 am. Refer to the instructions below.

After logging into data.cs.purdue.edu, submit your assignment as follows:

> turnin -c cs530 -p project4 <dir_name>

> turnin -c cs530 -p project4_extra <dir_name>

where <dir_name> is the name of the corresponding directory containing all your submission material.

Keep in mind that old submissions are overwritten by new ones whenever you execute this command. You can verify the contents of your submission by executing the following command:

> turnin -v -c cs530 -p project4

> turnin -v -c cs530 -p project4_extra

Do not forget the -v flag here, as otherwise your submission would be replaced by an empty one.