Removing the internal cells from a CFD analysis

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 ?

please share your data

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


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

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

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

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

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

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'

# create a new OpenFOAMReader
pfoam = OpenFOAMReader(FileName=r'%(system/CasePath%)/pv.foam')
pfoam.CaseType = 'Decomposed Case'
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

# get animation scene
animationScene1 = GetAnimationScene()

# get the time-keeper
timeKeeper1 = GetTimeKeeper()

# update animation scene based on data timesteps

# update the view to ensure updated data information

Please try to reproduce by opening ParaView directly

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

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

You have some invalid/duplicated cells/points.

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

You should fix your mesh generation though.

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

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