# ComputeDerivatives filter creates constant vorticity from velocity field - PLOT3D

**URL:** https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293
**Category:** ParaView Support
**Created:** [September 8, 2020, 5:34pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293 "2020-09-08T17:34:46Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 8, 2020, 5:34pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/1 "2020-09-08T17:34:46Z")

</div>

Hello!  
I have a plot3d grid file [plot3dg.bin.xyz](https://discourse.paraview.org/uploads/short-url/VWe0O5B5aBKw4d1phyXKDqQyI.xyz) (25.2 KB) and a plot3d q file [plot3dq.bin.q](https://discourse.paraview.org/uploads/short-url/miEIdqgUpW6LlfA5FiPEyJDYZiR.q) (33.6 KB). I tried to get the vorticity field using the ComputeDerivatives filter and the Gradient of Unstructured Dataset filter, but both result in a vorticity field which is constant or at least it appears constant as the same color is shown throughout the domain. Can anyone help me with what I am doing wrong?

Thank you

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 10, 2020, 10:30am UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/2 "2020-09-10T10:30:01Z")

</div>

Hello!  
Can anyone shed some light on the possible issues?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [September 10, 2020, 11:44am UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/3 "2020-09-10T11:44:14Z")

</div>

- Plot3D reader has option to compute vorticity. I used that and I get a Vorticity array generated without having to use any filter.
- Split view and create histogram view. Show the Plot3D data in this view and then under **Display** properties, choose **VorticityMagnitute**. You see something like this:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/de8cb464ace88547ff60ad7e3f6e5cb80f364479.png)

Most of the values are concentrated at the low end.

- To highlight the high-vorticity regions, use Find Data dialog with following setup:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/659e01135c20666c51ea6df8ab8ecf9b2c919fc0.png)

When you hit **Run Selection Query** , the render view will show a small sliver selected:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/1/111c207ca75b9e840cb1155905ccc687e4e622c8.png)

That’s the region greater than “mean” voritcity which is too small to show and interesting color variation.

Hope that helps.

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 11, 2020, 7:17am UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/4 "2020-09-11T07:17:51Z")

</div>

Thanks a lot for such a detailed answer!

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 11, 2020, 11:31am UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/5 "2020-09-11T11:31:52Z")

</div>

I tried to run a case where I do have an appreciable region of vorticity [plot3dg.bin.xyz](https://discourse.paraview.org/uploads/short-url/jxKOfsmB3Smvw44paEKZmm6SOkn.xyz) (620.6 KB),[plot3dq.bin.q](https://discourse.paraview.org/uploads/short-url/qamNDcOPMZfJpnMTeUZZWCLfPT2.q) (827.6 KB) and I tried your method and got this

 ![Screenshot from 2020-09-11 16-52-57](https://discourse.paraview.org/uploads/default/original/2X/2/2dfb834ac6d019f1f01194aafe5f59a24166e2da.png)

and this

 ![Screenshot from 2020-09-11 16-57-04](https://discourse.paraview.org/uploads/default/original/2X/7/76915fd53a163fa46d33cee8f6a49936156b0d18.png)

But, I should have appreciable vorticity as the correct result is

 ![vort_instant](https://discourse.paraview.org/uploads/default/original/2X/4/422e5b32920d6906f8d056fe01267c3ebccac4ca.gif)

but I get,

 ![Screenshot from 2020-09-11 17-47-42](https://discourse.paraview.org/uploads/default/original/2X/4/456b516475731838dd7a09074c677c5fac8f3a42.png)

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [September 11, 2020, 1:51pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/6 "2020-09-11T13:51:14Z")

</div>

cc: @berkgeveci, any ideas what’s going on? I am not sure if there’s a bug in the vorticity computation or something else.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [September 11, 2020, 2:04pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/7 "2020-09-11T14:04:35Z")

</div>

This could be a scaling issue. Perhaps there are parts of the mesh (like on boundaries and pinch points) where the Vorticity gets unnaturally big due to, say, a small or degenerate cell. Maybe the color bar needs to be scaled with the maximum more like 100 rather than 3000. Or maybe the colors need to have log scaling. It would help if @Sangeet’s correct example had a scalar bar to show the scaling used there.

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 11, 2020, 4:31pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/8 "2020-09-11T16:31:18Z")

</div>

I changed the upper limit to 1.00 instead of 3000. I do see some structure but why is this happening? I assumed that Paraview would automatically choose the appropriate min-max values.

 ![Screenshot from 2020-09-11 21-59-33](https://discourse.paraview.org/uploads/default/original/2X/a/acf0c77266fa749d0a09f4afe823af4375504bc6.png)

And it seems changing the min-max values greatly affects visualization, how should i decide on what values to choose?

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [September 11, 2020, 9:47pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/9 "2020-09-11T21:47:28Z")

</div>

ParaView simply finds the smallest number and the largest number in your field and uses that to scale. My guess is that there is a funny-shaped cell in your data that is throwing off the vortex calculation (with a divide by near-zero), which is creating an unrealistically large value.

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 12, 2020, 6:36am UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/10 "2020-09-12T06:36:07Z")

</div>

So, I tried to see if the max vorticity was due to a bad cell or not. I used “Find Data” to find the location of maximum vorticity magnitude.

 ![Screenshot from 2020-09-12 12-01-48](https://discourse.paraview.org/uploads/default/original/2X/d/d1f66052f2014abf004582f45c2d091d0317766c.png)

Then I got this

 ![Screenshot from 2020-09-12 12-02-04](https://discourse.paraview.org/uploads/default/original/2X/9/9aeb5bef3729bce3909e6c4d29c0e1d2e4ce675f.png)

But when I zoom in, with edges ON, I get

 ![Screenshot from 2020-09-12 12-02-47](https://discourse.paraview.org/uploads/default/original/2X/0/07c21379e9fb7e1826ec8e4ab138f0ccd1b91206.png)

This doesn’t seem like a bad cell to me.

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 12, 2020, 1:33pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/11 "2020-09-12T13:33:52Z")

</div>

I checked with others in my research group and they have the same problem. This grid is from NASA CFL3D website and my colleague generated his own grid from ICEM CFD, both are having this scaling problem for vorticity and the cells are all normal.

---

<div class="post-metadata">

### Author: ![Sangeet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sangeet/32/4859_2.png) [@Sangeet](https://discourse.paraview.org/u/Sangeet)
#### Post date: [September 15, 2020, 2:07pm UTC](https://discourse.paraview.org/t/computederivatives-filter-creates-constant-vorticity-from-velocity-field-plot3d/5293/12 "2020-09-15T14:07:39Z")

</div>

Could you confirm if this is indeed mesh issue or not?

Thank you
