# Zone Patches disappear when creating .vtu solution file

**URL:** <https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747>\
**Category:** Cases\
**Created:** [6 February 2023 20:11 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747 "2023-02-06T20:11:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [6 February 2023 20:11 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/1 "2023-02-06T20:11:03Z")

</div>

Hi,

I’m having issues when exporting my solution to .vtu to visualize the physical zones I’ve defined in my mesh (i.e. wall, inlet, outlet, periodic\_1\_l,periodic\_1\_r) these seems to disappear and I only have informations about the whole flow field. This makes post processing very hard (i.e. plotting quantities over specifical physical zones)

I’m exporting solution as:

```auto
pyfr export -d 4 dummy.pyfrm dummy.pyfrs dummy.vtu

```

Any idea?

Sincerely

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [6 February 2023 22:05 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/2 "2023-02-06T22:05:21Z")

</div>

You can use the `region` support in the file writer plugin to only output elements adjacent to a boundary. This should make it substantially easier to extract quantities of interest. This can be combined with the “Extract surface” filter in ParaView to extract just the surface data.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 12:06 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/3 "2023-02-07T12:06:59Z")

</div>

I was already to extract the airfoil surface from my unstructured data set to plot Cp over airfoil surface. I was following the procedure given in:

> **[Compute pressure coefficient on the cylinder surface](https://discourse.paraview.org/t/compute-pressure-coefficient-on-the-cylinder-surface/9185/6)**
>
> I assume the “cylinder wall” you want is the circular boundary of the hole in the middle of your dataset. For your particular dataset, you can do that with the following sequence of filters. I’ll give an explanation of what each one does and why...

but when I select boundary edges and then I try to extract cells by region none of the edges is recognized.

My case is unstructured and 3D whilst the case given in the topic is 2D

Any idea on how to solve it? I think that the issue may be related to the way pyFR exports solution because I’ve tested pyvista as well but boundary edges are not recognized either  
Is there any other option which I have to use given that my case is 3D?

Moreover, is there any possibility to modify the source code such that these patches are retained when exporting solutions? This would make post-processing much easier

Sincerely

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [7 February 2023 13:22 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/4 "2023-02-07T13:22:23Z")

</div>

Clean To Grid followed by Extract Surface will do the job perfectly here (although it _must_ be those filters in that order and not anything which sounds similar).

If you end up with unwanted side walls in addition to your surface, the Clip filter with the crinkle clip option can be used to cull them.

 ![Screenshot_20230207_072057](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/2b1efb9b2596eb2405957e0b3e57519f372a4e28.png)

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 13:45 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/5 "2023-02-07T13:45:20Z")

</div>

Thanks a lot for the help Freddie,

I think that I’m almost there:

 ![Screenshot 2023-02-07 at 14.43.04](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/98e372e4c9db42d9e22e9a7a2fcc316d2e8af892.jpeg)

I have only to deal with the outer sporious cells that have appeared due to the way I’ve created my mesh. Do you have any idea on how to filter them out so that I can have only the wall surface?

Sincerely

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [7 February 2023 13:53 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/6 "2023-02-07T13:53:06Z")

</div>

You can try playing with the tolerance on the Clean to Grid filter. It appears to not be catching some faces, which is confusing the surface extraction filter.

Beyond that, ParaView has a Connectivity filter which should be able to give each surface its own region ID. Then it is just a case of finding out what region corresponds to the aerofoil and going with it.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 14:34 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/7 "2023-02-07T14:34:03Z")

</div>

I’ll try and let you know as soon as I can

Sincerely

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [7 February 2023 14:34 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/8 "2023-02-07T14:34:58Z")

</div>

You can use the clip filter in Paraview to slice off the bits you don’t want. This is what I’ve done in the past when I don’t have the Pointwise file.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 15:28 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/9 "2023-02-07T15:28:23Z")

</div>

I’ll leave the solution here in case someone will need:

In the `Clean to Grid` filter set tolerance to absolute and use a value which is smaller than the smallest element in mesh. The result is:

 ![Screenshot 2023-02-07 at 16.27.47](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/10a76d18eed64b1f1bdc4ae94f462377f2c82ed0.png)

Once again, very thankful for the help both of you provided…

Sincerely

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 17:10 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/10 "2023-02-07T17:10:06Z")

</div>

@fdw @WillT  
One last question regarding this aspect: are you aware of a quick way to spanwise average values? Such as Cp?

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [7 February 2023 17:58 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/11 "2023-02-07T17:58:51Z")

</div>

In the past when I’ve done similar things I’ve resampled it to an image, write it out to csv, and then averaged it in a python script. However the curved geometry might make this difficult.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [7 February 2023 19:39 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/12 "2023-02-07T19:39:26Z")

</div>

I do agree, the geometry is pretty complicated to use such approach

May Freddie has another hint

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [7 February 2023 20:14 UTC](https://pyfr.discourse.group/t/zone-patches-disappear-when-creating-vtu-solution-file/747/13 "2023-02-07T20:14:18Z")

</div>

I do not think that there is anything in ParaView which is capable of this. However, it is likely possible using the Python API. Probably a worthwhile feature request on the ParaView side.

Regards, Freddie.
