CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Surface normals inverted in paraFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2011, 17:25
Default Surface normals inverted in paraFoam
  #1
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
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.



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
cliffoi is offline   Reply With Quote

Old   August 26, 2011, 05:34
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by cliffoi View Post
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
gschaider is offline   Reply With Quote

Old   August 26, 2011, 12:52
Default
  #3
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
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 is offline   Reply With Quote

Old   August 31, 2011, 17:40
Default
  #4
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
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.

Last edited by cliffoi; September 21, 2011 at 11:47.
cliffoi is offline   Reply With Quote

Old   September 21, 2011, 10:40
Default
  #5
New Member
 
Alistair Everett
Join Date: Aug 2011
Posts: 8
Rep Power: 15
Alistair is on a distinguished road
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
Alistair is offline   Reply With Quote

Old   September 21, 2011, 11:46
Default
  #6
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
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.
Attached Files
File Type: patch vtkPV3FoamMeshVolume.patch (2.9 KB, 11 views)
cliffoi is offline   Reply With Quote

Old   September 21, 2011, 12:46
Default
  #7
New Member
 
Alistair Everett
Join Date: Aug 2011
Posts: 8
Rep Power: 15
Alistair is on a distinguished road
Thanks Ivor, I'll give it a whirl!
Alistair is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scale Surface CellZone OpenFOAM Post-Processing 1 September 2, 2016 09:29
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 12:05
[ICEM] Automatic mesh generation script surface intersection problem stuart23 ANSYS Meshing & Geometry 0 May 13, 2011 02:10
solid edge problem....can you help? cindy Main CFD Forum 3 April 5, 2004 14:43
free convection heat transfer from a heated horizontal surface through a liquid to a thin cooled fin Kaushik FLUENT 1 May 8, 2000 07:47


All times are GMT -4. The time now is 02:50.