# Displaying magnitude of in-plane vector components.

Hello,

I am re-posting this topic as I have not had a response in three days. If my query below is not clear, please advise and I will re-word. Otherwise, if someone knows the answer, please provide a response. Very much appreciated!

I want to make an in-plane cut through a 3D computational domain (CFD/OpenFoam) and visualize velocity vectors. Let’s say the plane we are talking about is the Y-Z plane and the cut is at X=0. How can I instruct Paraview (version 5.6.0) to calculate the magnitude of just the in-plane vectors, i.e. sqrt(V_Y^2 + V_Z^2) so that I can visualize the in-plane vector plot overlayed with the color of the newly created Y-Z veocity magnitude?

Sound like a standard usage of the slice filter.

Filters -> Alphabetical -> Slice.

Hi,

Thanks for your response. Right now, after reading in the data from an OpenFoam calculation, Paraview shows the available fields for visualization as ‘p’ and ‘U’. The latter appears to be the magnitude of the velocity vector. But, how can I tell Paraview that I specifically want the magnitude of just two components of the velocity vector. I am a complete novice with Paraview and I cannot determine how “Filters -> Alphabetical -> Slice” can generate the set of in-plane magnitudes I am interested in.

Let me get this straigth, you have a “U” field that is a three component vector, but you want to show the magnitude as if it was a two component vector ?

If that’s a yes, then :
Filters -> Alphabetical -> Calculator
`U_X*iHat + U_Y*jHat`

Should do the trick

Hello,

Yes, that is a yes. If you are looking at data in a plane slice, out of plane components only confound what you are trying to analyze and interpret. So, you need to have access to the in-plane magnitudes too. I am assuming the vectorial notation you provided “U_XiHat + U_YjHat” ensures that the scalar components U_X and U_Y are appropriately squared, added and subsequently the square root is taken too. Can you please confirm? Intuitively I would have written sqrt(U_X^2 + U_Y^2). I guess the result would have been the same.

Also, do I need to perform this Filters -> Alphabetical -> Calculator step after creating a slice? I am noting that the newly created 2-component (in-plane) magnitude I have defined (U_ZiHat + U_YjHat) for the Z-Y plane (see embedded image) is not available for access in Slice1 which is for the plane X=0.

Many thanks!

I was suggesting a way to create a two component vector, the magnitude computation is then automatic when needed. You can compute it if you want as well.

For your reference, a great place to learn more about features available in ParaView is the getting started guide and the examples visualization in the welcome dialog

Good luck with your research !

Hello,

I am interested in reviving this topic. The original intention was to look at velocity vectors (glyphs) which are not orientated according to the 3D velocity field but are just the 2D components. In the response provdied by Mathieu, I can clearly obtain the 2D component of interest.

So, we create a new reduced vector Uxz = U_XiHat + U_zkHat as part of Calculator filter. And I can visualize the in-plane (X-Z) vector field in the Glyph filter. However, the magntiude of Uxz is not available in order to color in the newly created in-plane field. The coloring only includes the original velocity field. Why is the magntidue information for Uxz not being propogated down to the available glyph coloring as an availble option?

I should add that my pipeline constitutes a calculator -> slice -> clip -> glyph. The calculator computes the vector shown above. Its result is available in the slice and clip, but not the glyph where I need it. The slice and clip are there to ensure I can isolate a physical section of the slice where I am interested in results.

New note: I found a workaround. By adding an additional calculator filter which computes sqrt(U_X^2 + U_Z^2) in the pipline as follows: calculator1 -> calculator2 -> slice -> clip -> glyph. In this pipeline, calculator 1 computes Uxz = U_XiHat + U_zkHat and calculator 2 sqrt(U_X^2 + U_Z^2). The result of calculator 2 is then available to the glyph filter. But, it seems redundant to do this. So, my original question still stands: Why is the magntidue information for Uxz not being propogated down to the available glyph coloring as an availble option?