CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

Surface normals inverted in paraFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 25, 2011, 16:25
Default Surface normals inverted in paraFoam
  #1
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 91
Rep Power: 9
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, 04:34
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,926
Rep Power: 41
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, 11:52
Default
  #3
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 91
Rep Power: 9
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, 16:40
Default
  #4
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 91
Rep Power: 9
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 10:47.
cliffoi is offline   Reply With Quote

Old   September 21, 2011, 09:40
Default
  #5
New Member
 
Alistair Everett
Join Date: Aug 2011
Posts: 8
Rep Power: 7
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, 10:46
Default
  #6
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 91
Rep Power: 9
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, 7 views)
cliffoi is offline   Reply With Quote

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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 3 October 22, 2015 11:05
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 23 August 5, 2015 02:09
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 0 August 5, 2011 16:02
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


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