Blood Flow Aneurysm Tutorial Vector Field Visualization

Revision as of 21:47, 9 November 2015 by Cyrus (talk | contribs)

Simulation Data

This tutorial uses the aneurysm dataset -- available at: http://www.visitusers.org/index.php?title=Tutorial_Data

To begin:

  • Launch VisIt
  • In VisIt's GUI, under the [Sources] section, click Open
  • Navigate your file system to select the aneurysm.visit file.

Visualizing the Velocity Vector Field

This section of the tutorial outlines using Glyphs, Streamlines, and Pathlines to visualize the velocity vector field from the simulation.

This section follows the Initial Dataset Exploration Tutorial section. To create the reference blue semi-transparent plot of the simulation mesh, review the Blood_Flow_Aneurysm_Tutorial_Dataset_Exploration#Creating_a_Semi-Transparent_Exterior_Mesh_Plot content.

Plotting the Vector Field Directly with Glyphs

VisIt's vector plot renders a vector field at each time step as a collection of Arrow Glyphs. This allows us to see the direction of the vectors as well as their magnitude. We will create a vector plot to directly view the simulated velocity vector field.


  • Add a Vector Plot of velocity
    • [Plot List] Add->Vector->velocity
  • Open the Vector Plot Attributes Window
    • In the Vectors tab
      • Set Stride to 5
    • In the Data tab, Color section
      • Change the color table to Spectral, and check the Invert option
    • In the Glyphs tab:
      • Under the Scale section, set the scale to 0.5
      • Under the Style section, chance the Arrow body to Cylinder
      • Under the Rendering section, set Geometry Quality to High
    • Click Apply and dismiss the window.
  • Click Draw and use the Play button to animate

Bflow tutorial vel vec plot.png

Examining features of the Flow Field with Streamlines

To explore the flow field further we will seed and advect a set of streamlines near the inflow of the artery. Streamlines show the path massless tracer particles would take if advected by a static vector field. To construct Streamlines, the first step is selecting a set of spatial locations that can serve as the initial seed points.

We want to center our seed points around the peak velocity value on a slice near the inflow of the artery. To find this location, we query a sliced pseudocolor plot of the velocity_magnitude.

  • Add a Pseudocolor Plot of velocity_magnitude
    • [Plot List] Add->Pseudocolor->velocity_magnitude
    • Open Pseudocolor Plot Attributes Window and set the color table options as before.
  • Add a Slice Operator near the inlet
    • [Plot List] Operators->Slicing->Slice
  • Open the Slice Operator Attributes Window
    • Under the Normal Section
      • Set Orthogonal to Y Axis
    • Under the Origin Section
      • Select Point and set the value to 3 3 3
    • Under the Up Axis Section
      • Uncheck Project to 2D
    • Click Apply and dismiss the window.
  • [Plot List] Click Draw

Bflow tutorial vel mag slice plot.png

Query to find the Maximum Velocity on the Slice

  • [Plot list] Click to make sure the Pseudocolor plot of your velocity_magnitude slice is active
  • [Controls Menu]->Query
    • Select Max
    • Select Actual Data
    • Click Query

This will give you the maximum scalar value on the slice and the x,y,z coordinates of the element associated with this value. We will use the x,y,z coordinates of this element to seed a set of streamlines.

Bflow tutorial vel mag slice max query.png


  • Add a Streamline Plot of velocity
    • [Plot List] Add->Streamline->velocity
  • Open the Streamline Plot Attributes Window
  • In the Streamlines tab
    • Under the Source section
      • Set the Source type to Circle
      • Set the Origin to the value returned from the max query: 3.45115 3.0 5.54927
        • (Exclude any commas in the input text box)
      • Set the Normal to the y-axis: 0 1 0
      • Set the Up axis to the z-axis: 0 0 1
      • Set the Radius to 0.12
    • Under the Sampling section
      • Set Sampling along: to Boundary
      • Set Samples in Theta to 12

Bflow tutorial vel streamline atts source .png


  • In the Appearance tab
    • Under the Color section,
      • Change the Color table to Reds
    • Under the Display section
      • Change Draw as to Tubes
      • Check the Show heads check box, and set Display as to Cone
      • Set the Display quality to High

Bflow tutorial vel streamline atts display .png


  • In the Advanced tab:
    • Under the Warnings section, uncheck all of the warning checkboxes
  • Click Apply and dismiss the Streamline plot attributes window.
  • Click Draw and use the [Time Slider] Control to view a few time steps.

Bflow tutorial vel streamline view.png

Examining features of the Flow Field with Pathlines

Finally, to explore the time varying behavior of the flow field we will use Pathlines. Pathlines show the path massless tracer particles would take if advected by the vector field at each timestep of the simulation.

We will modify our previous Streamline plot to create Pathlines.

  • Set the [Time Slider] Control to the first timestep.
  • Open the Streamline Plot Attributes Window
    • Under the Advanced tab
      • In the Streamlines vs Pathlines section
        • Select Pathline
        • In the Pathlines Options section
          • Set How to perform interpolation over time to Mesh is static over time

Bflow tutorial vel pathline settings.png

  • Click Apply and dismiss the window.

This will process all 200 files in the dataset and construct the Pathlines that originate at our seed points.

Bflow tutorial vel pathline final.png

After this calculation is done, we can animate the Pathlines by cropping away portions of the curves based on advection time.


  • Open the Commands Window
    • [Controls Menu]->Command
  • Find an empty tab
  • Paste the following Python snipper into this tab
# Animate our pathlines by cropping based on time
satts = StreamlineAttributes()
satts.referenceTypeForDisplay = satts.Time
satts.displayEndFlag = 1

nsteps = 100 # Number of steps
final_time = .995
for i in range(nsteps+1):
  satts.displayEnd = final_time * i /nsteps
  SetPlotOptions(satts)
  • Click Execute

Bflow tutorial vel pathline anim.gif

Next: Sharing the pathline animation on the web using SeedMe.org

Aneurysm Tutorial Index