CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Help with repairing geometry

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

Like Tree3Likes
  • 2 Post By student666
  • 1 Post By quarkz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2017, 14:40
Question Help with repairing geometry
  #1
Member
 
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 9
fedez91 is on a distinguished road
Hello everyone,

I am writing to ask for some help with geometry preparation in order to use it in snappyHexMesh

I've been following the recommendations made by Tobias Holzzman ((1),and (2)), but I am still having trouble ending with a closed STL.

Small edges, sharp faces, and probably other things that I am not aware of are always giving me problems.

For example, I've been trying to use the geometry of a submarine I got online (STEP file) and transform it into an STL. I put the STEP file in Salome, mesh it with the same size (following the procedure recommended in (2)), and then exported it to STL, but when I perform surfaceCheck I get the following message:

Quote:
Surface is not closed since not all edges connected to two faces:
connected to one face : 0
connected to >2 faces : 2
Conflicting face labels:8
Dumping conflicting face labels to "problemFaces"
Paste this into the input for surfaceSubset

Number of unconnected parts : 1

Number of zones (connected area with consistent normal) : 3
More than one normal orientation.
I would like to know if someone could help me improve this part of the pre-processing, maybe with some tutorials or something. I attach the STL and the STEP of the submarine.

Any help will be really appreciated!!!

Files: https://drive.google.com/open?id=0B4...3o0X3lMLVlucW8 (STL file is quite heavy)

(1): https://www.youtube.com/watch?v=RFJN...L3CN4WA&t=237s

(2): https://www.cfd-online.com/Forums/op...sh-salome.html
fedez91 is offline   Reply With Quote

Old   June 20, 2017, 13:21
Default
  #2
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
vatavuk is on a distinguished road
Hi Frederico,

You could try two programs: MeshMixer and MeshLab.
Perhaps one of them can repair your surface.

Best regards,
Paulo
vatavuk is offline   Reply With Quote

Old   June 20, 2017, 18:06
Default
  #3
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
Hi,

I recently encountered this problem, and the problem I had, I think it's the same as yours.
As you said you downloaded a file, you have to check that you have not any double edges defining your patches.

To explain what I'm saying, load into salome the following dumpFile (copy and paste into a new file and save it with .py extension)
Code:
import sys
import salome
salome.salome_init()
theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.NoteBook(theStudy)
sys.path.insert( 0, r'/home/winuntu/Desktop')
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
geompy = geomBuilder.New(theStudy)
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
Vertex_2 = geompy.MakeVertex(0.77, 0, 0)
Vertex_3 = geompy.MakeVertex(1, 0, 0)
Vertex_4 = geompy.MakeVertex(1, 1, 0)
Vertex_5 = geompy.MakeVertex(0, 1, 0)
Vertex_6 = geompy.MakeVertex(0, -1, 0)
Vertex_7 = geompy.MakeVertex(1, -1, 0)
Line_1 = geompy.MakeLineTwoPnt(Vertex_6, Vertex_1)
Line_2 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_2)
Line_3 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_3)
Line_4 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_7)
Line_1_vertex_2 = geompy.GetSubShape(Line_1, [2])
Line_5 = geompy.MakeLineTwoPnt(Vertex_7, Line_1_vertex_2)
Face_1 = geompy.MakeFaceWires([Line_1, Line_2, Line_3, Line_4, Line_5], 1)
Line_6 = geompy.MakeLineTwoPnt(Vertex_1, Vertex_5)
Line_7 = geompy.MakeLineTwoPnt(Vertex_5, Vertex_4)
Line_8 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_3)
Line_9 = geompy.MakeLineTwoPnt(Vertex_3, Vertex_1)
Face_2 = geompy.MakeFaceWires([Line_6, Line_7, Line_8, Line_9], 1)
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Vertex_5, 'Vertex_5' )
geompy.addToStudy( Vertex_6, 'Vertex_6' )
geompy.addToStudy( Vertex_7, 'Vertex_7' )
geompy.addToStudy( Line_1, 'Line_1' )
geompy.addToStudy( Line_2, 'Line_2' )
geompy.addToStudy( Line_3, 'Line_3' )
geompy.addToStudy( Line_4, 'Line_4' )
geompy.addToStudyInFather( Line_1, Line_1_vertex_2, 'Line_1:vertex_2' )
geompy.addToStudy( Line_5, 'Line_5' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( Line_6, 'Line_6' )
geompy.addToStudy( Line_7, 'Line_7' )
geompy.addToStudy( Line_8, 'Line_8' )
geompy.addToStudy( Line_9, 'Line_9' )
geompy.addToStudy( Face_2, 'Face_2' )
import  SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(theStudy)
Face_1_1 = smesh.Mesh(Face_1)
Regular_1D = Face_1_1.Segment()
Local_Length_1 = Regular_1D.LocalLength(0.05,None,1e-07)
NETGEN_2D_ONLY = Face_1_1.Triangle(algo=smeshBuilder.NETGEN_2D)
Face_2_1 = smesh.Mesh(Face_2)
status = Face_2_1.AddHypothesis(Local_Length_1)
Regular_1D_1 = Face_2_1.Segment()
NETGEN_2D_ONLY_1 = Face_2_1.Triangle(algo=smeshBuilder.NETGEN_2D)
isDone = Face_1_1.Compute()
isDone = Face_2_1.Compute()
## Set names of Mesh objects
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(NETGEN_2D_ONLY.GetAlgorithm(), 'NETGEN_2D_ONLY')
smesh.SetName(Local_Length_1, 'Local Length_1')
smesh.SetName(Face_1_1.GetMesh(), 'Face_1')
smesh.SetName(Face_2_1.GetMesh(), 'Face_2')

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(1)
, it's just an example, but as you may see even if the two faces has same dimension (1x1x0) face1 has been defined by 5 edges while face2 with 4 edges (this is correct).
Even If I set the same local lenght hypotesis, point of the triangles are not matching, where ONE edge of face2 is matching TWO edges of face1.

If you want find out where these "not matching" triangles are, you can use surfaceSubsetDict.

Cheers
Attached Images
File Type: jpg Screenshot_2017-06-20_23-00-36.jpg (178.1 KB, 65 views)
student666 is offline   Reply With Quote

Old   June 20, 2017, 18:14
Default
  #4
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
There's also a poor-man way to look for faces that give you problem.
Open the problemFaces file.
Top number is total number of faces, other numbers are numbered faces of the mesh.
Now run paraview and import your stl file. Open on the side a spreadsheet view and select to look for cellData, scroll to your faces and use filter extract selections.
This will produce an extraction of the problemFaces.

I attach a picture.

Cheers
Attached Images
File Type: jpg Screenshot_2017-06-20_23-10-14.jpg (110.4 KB, 132 views)
student666 is offline   Reply With Quote

Old   June 27, 2017, 15:49
Default
  #5
Member
 
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 9
fedez91 is on a distinguished road
Thank you all for your suggestions.

I've followed your advice and I found that the problem are a few small faces that are giving me trouble.

The problem I am having right now is that if I remove them, then my solid will not be closed, but if I try to mesh them, salome gives me an error.

Then.. how can I do to deal with this?

Thanks in advance!!
fedez91 is offline   Reply With Quote

Old   June 28, 2017, 01:02
Default
  #6
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 16
student666 is on a distinguished road
Hi,

I make you note that your problem can be threated as symmetric, so you should mesh half of the volume...you will considerably reduce your computational effort.

Further more, I have not run surfaceCheck but you should reconsider your starting geometry, as you may remove your capital letters USBN 70 and there are many small fillets (slivering faces?) I think you can remove (see example in picture), these are quite hard to be captured by SHM.

I haven't try to reproduce your errors in Salome, maybe try to post the faces you would to remove and let's see if for my above suggestions these are needed or not.

Regards
Attached Images
File Type: jpg Screenshot_2017-06-28_06-00-18.jpg (79.5 KB, 59 views)
student666 is offline   Reply With Quote

Old   August 8, 2019, 06:07
Default
  #7
New Member
 
Pavlos Semelides
Join Date: Jul 2019
Posts: 5
Rep Power: 6
pavlossemelides is on a distinguished road
Quote:
Originally Posted by student666 View Post
There's also a poor-man way to look for faces that give you problem.
Open the problemFaces file.
Top number is total number of faces, other numbers are numbered faces of the mesh.
Now run paraview and import your stl file. Open on the side a spreadsheet view and select to look for cellData, scroll to your faces and use filter extract selections.
This will produce an extraction of the problemFaces.

I attach a picture.

Cheers
I was having the same issue as the poster.
I used this method and was able to identify the problem faces. I then went back to CAD and filleted the edges of the problem faces. Problem solved!
pavlossemelides is offline   Reply With Quote

Old   August 22, 2020, 22:06
Default
  #8
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 400
Rep Power: 19
quarkz is on a distinguished road
Hi, I think you can try 3D builder in the windows store. It's a 1 click repair which works for my case. Note that your output may be shifted after that, if it lies in the negative coordinates.
fedez91 likes this.
quarkz is offline   Reply With Quote

Reply

Tags
geometry, openfoam, salome, snappyhexmesh

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Volume Meshing Problem; YOUR GEOMETRY HAS A HOLE mariachi ANSYS Meshing & Geometry 5 May 30, 2018 03:52
Question about Geometry vs. Meshes EphemeralMemory ANSYS Meshing & Geometry 2 December 8, 2016 14:02
How to scale and translate the grid of particle data and STL geometry Saidul Tecplot 1 January 11, 2015 22:15
Running CFD parallel. There is no geometry file! CrashLaker SU2 6 April 10, 2014 04:08
[CAD formats] translating geometry from Abaqus to OpenFOAM skuznet OpenFOAM Meshing & Mesh Conversion 3 January 10, 2014 14:49


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