# Visualising structures using Q-criterion in Paraview

**URL:** https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528
**Category:** ParaView Support
**Tags:** vtk
**Created:** [December 16, 2023, 9:51pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528 "2023-12-16T21:51:45Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 16, 2023, 9:51pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/1 "2023-12-16T21:51:46Z")

</div>

I have loaded a state file (.pvsm) of a turbulent channel flow solved using DNS and I want to visualise vortical structures using the Q-criterion but it’s not working out.  
I’m not sure what I’m missing because the tutorials seem straightforward.

The velocity components are all stored as points in 3 different arrays (u,v,w) but I can’t seem to be able to calculate the velocity magnitude with the Calculator filter. I use the equation Umag= sqrt(u^2+v^2+w^2) to find the velocity magnitude.

Any help will be appreciated and I am happy to give more information about the setup

Thanks!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 9:03am UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/2 "2023-12-18T09:03:25Z")

</div>

Please share your data and pvsm file

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 9:38am UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/3 "2023-12-18T09:38:14Z")

</div>

[flow\_field.zip](https://discourse.paraview.org/uploads/short-url/6bPS7e6oR4bd5Gz9NnydqgTCXmQ.zip) (58.3 KB)

I don’t know if you can or would like to open zip files.

the u, v and w velocity data are stored within .xmf files separate from the .pvsm file so I had to compress and zip them all together

thanls.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 11:16am UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/4 "2023-12-18T11:16:46Z")

</div>

HI @akintunde_akinneye

Please share the .h5 files too.

Best,

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 11:25am UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/5 "2023-12-18T11:25:19Z")

</div>

[grid3dc.h5sp](https://discourse.paraview.org/uploads/short-url/kEgN38UWTPTmEokSZnEO5ogNZsr.h5sp) (5.3 KB)

[grid3du.h5sp](https://discourse.paraview.org/uploads/short-url/yv7EJexxi1EPhYliDEzrDqFmOb2.h5sp) (5.3 KB)

[grid3dv.h5sp](https://discourse.paraview.org/uploads/short-url/iMQoF3j1PYuVCNEVtSLhH1o3G1R.h5sp) (5.3 KB)

[grid3dw.h5sp](https://discourse.paraview.org/uploads/short-url/4D7uO6S65rDaT5pAiYv5BmpJ4wn.h5sp) (5.3 KB)  
these are .h5sp files, I hope they are the same?  
Many thanks

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 12:14pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/6 "2023-12-18T12:14:34Z")

</div>

the files should be named `u.res.hdf5` or similar

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 12:21pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/7 "2023-12-18T12:21:53Z")

</div>

The files are quite heavy and for some reason I cannot upload them in this chatbox.

Is there any other way to send them to you or can something else be done?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 12:24pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/8 "2023-12-18T12:24:21Z")

</div>

> **[WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free](https://wetransfer.com)**
>
> WeTransfer is the simplest way to send your files around the world

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 12:31pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/9 "2023-12-18T12:31:07Z")

</div>

> **[hdf5 files.zip](https://wetransfer.com/downloads/189bbdb1e33227465c0d2209ac48876620231218122653/95477d)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

Many thanks!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 3:57pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/10 "2023-12-18T15:57:29Z")

</div>

> [@akintunde\_akinneye](#):
>
> sqrt(u^2+v^2+w^2)

Works fine here:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f3cbcc8195806bbaa7242690c7fdd995657b7012.jpeg)

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 4:43pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/11 "2023-12-18T16:43:51Z")

</div>

Yes I can visualise the results but I seem to be having trouble calculating the Q-criterion

if you were able to, could you provide a brief walkthrough of how you did it?

thanks

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 4:45pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/12 "2023-12-18T16:45:49Z")

</div>

> [@akintunde\_akinneye](#):
>
> I seem to be having trouble calculating the Q-criterion

How do you compute it ?

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 4:51pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/13 "2023-12-18T16:51:59Z")

</div>

Well, assuming the research I have made is correct, the first step is to create an array (Umag) with the three velocity components (u,v,w) using the calculator filter.

I have been struggling to do this, then you use the Gradient of Unstructured Dataset 1 filter to calculate vorticity and Q criterion.

So, while my main goal is to calculate the Q criterion I haven’t been lucky to find the Umag. I get a blank box when I apply the calculator filter as shown in the image below:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/5/53ba0026c5f76aa9d5eacd8b8e594db97c39d230.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2023, 4:58pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/14 "2023-12-18T16:58:35Z")

</div>

It is actually pretty simple.

> I get a blank box when I apply the calculator filter as shown in the image below:

This is an outline, switch representation to surface to see the surface instead of the outline

> the first step is to create an array (Umag) with the three velocity components (u,v,w) using the calculator filter.

The first step is to create a **Vector** with the three velocity components (u,v,w) using the calculator filter or the dedicated filter, **MergeVectorComponents**

Here is a state file: [3d\_visualisation\_kw.pvsm](https://discourse.paraview.org/uploads/short-url/6rtcKdHjU9TRmHo74SsY00Rv9rl.pvsm) (971.6 KB)

Here are the manual steps: -

- run ParaView
- open u.res.xmf, Apply
- open v.res.xmf, Apply
- open w.res.xmf, Apply
- select all three readers in the pipeline browser by keeping Ctrl pressed,
- Filters → AppendAttributes, Apply  
====== (new steps below)
- Filters → MergeVectorComponents, select u,v,w, Apply
- Filters → Gradient, Select “Vector”, show advanced options (cogwheel), check QCriterion, Apply
- Switch representation to surface, show QCriterion

 ![image](https://discourse.paraview.org/uploads/default/original/2X/e/e0f4699a4acc40d09a601dae5b1e4f62c37a8d4e.jpeg)

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 18, 2023, 5:56pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/15 "2023-12-18T17:56:29Z")

</div>

Thanks, I’ve been able to visualise the velocity magnitude

However, I don’t seem to have the Mergevectorcomponents filter. Perhaps it’s in a later release of Paraview?  
I’m currently using v5.4.1

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 19, 2023, 8:52am UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/16 "2023-12-19T08:52:16Z")

</div>

Yes, this is a recent filter. Please update your ParaView.

---

<div class="post-metadata">

### Author: ![akintunde\_akinneye](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akintunde_akinneye/32/13171_2.png) [@akintunde\_akinneye](https://discourse.paraview.org/u/akintunde_akinneye)
#### Post date: [December 19, 2023, 2:50pm UTC](https://discourse.paraview.org/t/visualising-structures-using-q-criterion-in-paraview/13528/17 "2023-12-19T14:50:36Z")

</div>

Many thanks!

It’s worked fine
