CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Paraview & paraFoam (http://www.cfd-online.com/Forums/openfoam-paraview/)
-   -   Surface normals inverted in paraFoam (http://www.cfd-online.com/Forums/openfoam-paraview/91894-surface-normals-inverted-parafoam.html)

cliffoi August 25, 2011 16:25

Surface normals inverted in paraFoam
 
Hi all,
I am trying to use paraFoam to view some simulation results and have noticed that the lighting on many of the faces is wrong. After playing with the backface culling options and applying the Normals Glyphs filter I realized that the surface normals have somehow been inverted on at least half of the faces resulting in very bad looking renderings.

http://img52.imageshack.us/img52/8963/screenshotqhs.png

I do not get this problem with the native paraview reader, only with paraFoam... and I need this to extract cellZones correctly.
Does anyone have any suggestions? I'm guessing this has something to do with the triangular mesh decomposition that happens internally in the vtkPV3Foam reader.

Thanks in advance
Ivor

gschaider August 26, 2011 04:34

Quote:

Originally Posted by cliffoi (Post 321651)
Hi all,
I am trying to use paraFoam to view some simulation results and have noticed that the lighting on many of the faces is wrong. After playing with the backface culling options and applying the Normals Glyphs filter I realized that the surface normals have somehow been inverted on at least half of the faces resulting in very bad looking renderings.

do not get this problem with the native paraview reader, only with paraFoam... and I need this to extract cellZones correctly.
Does anyone have any suggestions? I'm guessing this has something to do with the triangular mesh decomposition that happens internally in the vtkPV3Foam reader.

Thanks in advance
Ivor

Hi Ivor!

Can't help you with the immidiate problem. Two hints:
- have you tried foamToVTK to just write the zones (I think it can do that. at least it can do sets)
- one other thing: is it possible that this is a "the boundary of the internal field and the cellZone are in the same place. Sometimes the numerics favours one and then the other"-problem? I found that "Extract Block" the cellZone and then going to the Display tab and scaling it a little bit (1.0001 or so) helps

Bernhard

cliffoi August 26, 2011 11:52

Thanks for the hints Bernhard. I also thought it might be overlapping models but I'm pretty certain this is not the case. It only happens for polyhedral cells, so I went into the source for both the native paraview reader and paraFoam. The native reader, when decomposing polyhedral cells, reverses the node ordering depending on whether the face is the owner or not. ParaFoam doesn't do this so I went ahead and made changes to the source code and it fixed the problem... sort of. It works fine on the original model, but as soon as I apply any clip, extract region or cutplane filter, the problem reappears.
Quote:

- have you tried foamToVTK to just write the zones (I think it can do that. at least it can do sets)
I have tried both the native paraview reader and foamToVTK and both give similar behaviour when extracting zones and/or cellSets. They extract the cells fine but for some reason the field data doesn't get extracted at the same time. ParaFoam seems to be only only one that allows me to extract these cells and then display field data.

cliffoi August 31, 2011 16:40

If anyone is interested, I've found a workaround to this problem. Use paraFoam to import the data from the case and then export it from paraview in .vtm (VTK multiblock data) format. The windows version of Paraview will read and display these files without any problems. You will lose the names of the meshes, patches, sets and zones though.

Alistair September 21, 2011 09:40

Hi Ivor,

I'm having a similar problem to you, I tried the solution you mentioned ie. exporting to .vtm, as you say when I reopen the file I lose the names of patches etc but the same faces are still lit incorrectly. Did you do anything else? Or am I missing something?

I posted some screen shots of the problems I'm having here. It looks pretty similar to yours.

Thanks in advance for your help!

Alistair

cliffoi September 21, 2011 10:46

1 Attachment(s)
Hi Alistair,
I forgot to mention in my last post that I made changes to one of the paraFoam source files as well (see my 2nd post).
Quote:

so I went ahead and made changes to the source code and it fixed the problem... sort of
I have attached a patch based on OpenFOAM-1.6-ext. This fixes the orientation of the surface faces for polyhedral meshes, but when you cut through the mesh the problem reappears. If I export a .vtm file and import it in the windows version of ParaView I can then make cuts, etc.
Not ideal but it worked in my case.

Alistair September 21, 2011 11:46

Thanks Ivor, I'll give it a whirl!


All times are GMT -4. The time now is 19:16.