CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Paraview - 2d vector glyphs colored by vector direction & magnitude (http://www.cfd-online.com/Forums/openfoam/95479-paraview-2d-vector-glyphs-colored-vector-direction-magnitude.html)

newOFuser December 19, 2011 18:22

Paraview - 2d vector glyphs colored by vector direction & magnitude
 
Hi All

I have a plot of 2D vector glyphs for the velocity on a slice along the axis of a cylindrical chamber. I want to color the glyphs in such a way that the velocity vectors in the -ve direction (in the recirculation zone) are colored blue (with the shade deepening as the magnitude increases), and the velocity vectors pointing in the +ve direction are colored red.

Can this be done in paraview? Or can we only color the glyphs based on velocity magnitude?

Many thanks,
AK

mturcios777 December 19, 2011 19:34

You can color glyphs using any variable you want. After some quick experimenting with filters, it seems like you might be able to get the result you want by:

1. Creating a glyph field from velocity
2. Applying a Calculator filter that returns the axial component of the velocity (use a dot product)
3. Apply a threshold filter that selects only positive values of component field
4. This should give you only the velocity glyphs that have a positive axial component. Change the colorbar to RBG and move the color extremes to suit your needs.

The downside to this approach is that you can only get one component (negative or positive) with this approach per dataset. If you want to show both positive and negative, components you will need to load a duplicate dataset and perform the same operations with the threshold changed to capture the opposite axial direction (or just create a second calculator attach the filters, I haven't tried this). Good luck


All times are GMT -4. The time now is 15:12.