# Removing the internal cells from a CFD analysis

**URL:** https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645
**Category:** ParaView Support
**Created:** [December 17, 2021, 3:25pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645 "2021-12-17T15:25:59Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 17, 2021, 3:25pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/1 "2021-12-17T15:25:59Z")

</div>

Hi  
I’ve done a simple simulation in openFoam via FreeCad using the cfdOF plugin of an airplane wing which has nicely captured the tip vortex. Looking at the results in Paraview I have a small problem. If I set the opacity to a low level so that I can see the internal data for the domain most of the mesh cell walls disappear, but not all. I’ve used the Stream Tracer to visualise the flow, which it does extremely well but the remaining visible cell walls spoil the visualisation. If I turn off the internal mesh in Mesh Regions the streams disappear as well. So how am I able to see the stream lines, the wing at without seeing the mesh cells ?

---

<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 17, 2021, 3:51pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/2 "2021-12-17T15:51:59Z")

</div>

please share your data

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 17, 2021, 4:45pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/3 "2021-12-17T16:45:07Z")

</div>

Here’s a link to the openFoam data. I’m not that familiar with how Paraview opens and uses it. I just press the Paraview button on the Freecad cfdOF workbench and it opens the data for me. The file is 1.6Gb

[data](https://1drv.ms/u/s!An8DqnlVVWPzhxu5vqlGHpGvsdce?e=Im32sn)

---

<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 27, 2021, 3:33pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/4 "2021-12-27T15:33:28Z")

</div>

Im able to manipulate your data without issue, could you share a screenshot or a state file showing the issue ?

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 28, 2021, 12:38pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/5 "2021-12-28T12:38:26Z")

</div>

Thank you for taking the time to look at this. Here’s a screen shot with internal mesh selected and opacity at 0.34

 ![Screenshot_20211228_123435](https://discourse.paraview.org/uploads/default/original/2X/f/fc3d91184c964b46a39a7610af7b6f4c4d1a0945.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 28, 2021, 1:08pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/6 "2021-12-28T13:08:21Z")

</div>

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

No issues here, however there is no such “p” field in the data. Please provide precise steps to reproduce the issue.

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 28, 2021, 2:30pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/7 "2021-12-28T14:30:12Z")

</div>

Hi Mathieu  
I hope this is enough information. Basically all I am doing is opening Paraview from Freecad and setting the opacity to around 0.3. Here’s a full list of settings, all but the opacity are set when Paraview opens. All I do is set the opacity.

Open Paraview using the Paraview button on the cfdOF workbench under the Analysis Control tab  
OpenFOAMReader1 is now the active data set  
The following are automatically selected  
Skip Zero Time is checked  
Case Type is Decomposed Case  
Label Size 32-bit  
Scalar Size 64-bit DIP)  
Create Cell to Pointed filtered data is checked  
Mesh Regions : internalMesh is checked  
All Cell Arrays are checked  
Coloring is P  
It opens with opacity set at 1. Setting it to a lower value shows (0.3 for example) shows the results I posted

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 28, 2021, 2:36pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/8 "2021-12-28T14:36:46Z")

</div>

I think that this is the script that gets called when you press the ParaView button in FreeCad cfdOF workbench

```auto
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new OpenFOAMReader
pfoam = OpenFOAMReader(FileName=r'%(system/CasePath%)/pv.foam')
%{%(solver/Parallel%)
%:True
pfoam.CaseType = 'Decomposed Case'
%:False
pfoam.CaseType = 'Reconstructed Case'
%}
pfoam.Decomposepolyhedra = 0

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')

# get color transfer function/color map for 'p'
pLUT = GetColorTransferFunction('p')

# show data in view
pfoamDisplay = Show(pfoam, renderView1)
# trace defaults for the display properties.
pfoamDisplay.ColorArrayName = ['CELLS', 'p']
pfoamDisplay.LookupTable = pLUT
pfoamDisplay.EdgeColor = [0.0, 0.0, 0.5]
pfoamDisplay.ScalarOpacityUnitDistance = 0.05

# reset view to fit data
renderView1.ResetCamera()

# get animation scene
animationScene1 = GetAnimationScene()

# get the time-keeper
timeKeeper1 = GetTimeKeeper()

# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()

# update the view to ensure updated data information
renderView1.Update()

```

---

<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 28, 2021, 2:48pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/9 "2021-12-28T14:48:18Z")

</div>

> [@TimScottz8](#):
>
> opening Paraview from Freecad

Please try to reproduce by opening ParaView directly

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 28, 2021, 8:08pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/10 "2021-12-28T20:08:11Z")

</div>

Thanks Mathieu. These are the steps to reproduce without going through FreeCad

Open the pv.foam file in Paraview  
Select Case Type : Decomposed Case  
Select Coloring to P  
Select Styling Opacity to 0.3

P is only selectable after Decomposed Case is selected

Here’s a screen shot of the result with the internal mesh showing

 ![Screenshot_20211228_200621](https://discourse.paraview.org/uploads/default/original/2X/4/4673b0e372c44e78421c354832afa5c1cb7be740.png)

---

<div class="post-metadata">

### Author: ![ssss](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ssss/32/2358_2.png) [@ssss](https://discourse.paraview.org/u/ssss)
#### Post date: [December 29, 2021, 2:39pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/11 "2021-12-29T14:39:15Z")

</div>

This seems to be related to the ghost cells. What happens if you apply the ghost cells generator filter to your pipeline?

---

<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 29, 2021, 2:46pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/12 "2021-12-29T14:46:00Z")

</div>

You have some invalid/duplicated cells/points.

You can try to clean it up with Clean filter, although it is not perfect:

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

You should fix your mesh generation though.

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 29, 2021, 7:09pm UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/13 "2021-12-29T19:09:11Z")

</div>

Thank you. That gives me a clue as to where to start 🙂 . I have been struggling to generate decent meshes, but then I’m just starting out and it’s a steep learning curve.

---

<div class="post-metadata">

### Author: ![TimScottz8](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/d26b3c/32.png) [@TimScottz8](https://discourse.paraview.org/u/TimScottz8)
#### Post date: [December 31, 2021, 9:50am UTC](https://discourse.paraview.org/t/removing-the-internal-cells-from-a-cfd-analysis/8645/14 "2021-12-31T09:50:22Z")

</div>

After a lot of fiddling I used reconstructPar and the artefact disappeared. Several mistakes I made in trying to use reconstructPar.

1. I had a space in a a folder name in the folder tree
2. There was too much nesting of folders, but after moving the containing folder to my Home folder it all worked.

Thanks for the clues to fix the problem

Tim
