CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] SnappyHexMesh .stl

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2010, 04:34
Default SnappyHexMesh .stl
  #1
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 16
Jochem is on a distinguished road
Hi,

I am a new user of OpenFoam. I've runned the motorBike tutorial without any problems. For my case i can use this tutorial just using an other .stl file. I've tried to do this but there are some problems that occur.

When i do a blockMesh there are some errors, but it seems to work :

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Creating block mesh from
********/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 0
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 1
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 2
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 3
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 4
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 129
zero or negative pyramid volume: -333333 for face 5
--> FOAM Warning :
From function blockMesh::createTopology(IOdictionary&)
in file createTopology.C at line 398
negative volume block : 0, probably defined inside-out

Default patch type set to empty

Check block mesh topology

Basic statistics
Number of internal faces : 0
Number of boundary faces : 6
Number of defined boundary faces : 6
Number of undefined boundary faces : 0

Checking patch -> block consistency

Creating block offsets

Creating merge list .

Creating points with scale 1

Creating cells

Creating patches

Creating mesh from block mesh

Default patch type set to empty

There are no merge patch pairs edges

Writing polyMesh

End


When i do the snappyHexMesh there are some fatal errors that occur :

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Read mesh in = 126.09 s

Overall mesh bounding box : (-100 -50 0) (100 200 40)
Relative tolerance : 1e-06
Absolute matching distance : 0.000322645

Reading refinement surfaces.
Read refinement surfaces in = 0 s

Reading refinement shells.
Refinement level 4 for all cells inside refinementBox
Read refinement shells in = 0 s

Setting refinement level of surface to be consistent with shells.
Checked shell refinement in = 0 s


Determining initial surface intersections
-----------------------------------------

Edge intersection testing:
Number of edges : 48272000
Number of edges to retest : 48272000
Number of intersected edges : 11148
Calculated surface intersections in = 98.93 s

Initial mesh : cells:16000000 faces:48272000 points:16272981
Cells per refinement level:
0 16000000

Adding patches for surface regions
----------------------------------

Patch Region
----- ------
ErasmusSketch2:

5 ErasmusSketch2_ascii

Added patches in = 1.17 s

Selecting decompositionMethod hierarchical

Refinement phase
----------------



--> FOAM FATAL ERROR:
Point (3 3 0.43) is not inside the mesh or on a face or edge.
Bounding box of the mesh-100 -50 0) (100 200 40)

From function refinementParameters::findCells(const polyMesh&) const
in file autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C at line 122.

FOAM exiting


Maybe there is some problem with my .stl file, i've used inventor to make this file. But i've runned a surfaceCheck and there were no 'illegal triangles'.

Another thing i wonder is that i don't see the .stl file in Paraview. I guess you normally can see the file without doing a block or snappyHexMesh, or can't you do this?

Can someone help me?

Regards,

Jochem

Last edited by Jochem; June 3, 2010 at 03:33.
Jochem is offline   Reply With Quote

Old   June 2, 2010, 10:17
Default
  #2
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Quote:
Originally Posted by Jochem View Post
Another thing i wonder is that i don't see the .stl file in Paraview. I guess you normally can see the file without doing a block or snappyHexMesh, or can't you do this?

Can someone help me?
I have a workaround for your Paraview problem.

Convert your ASCII-type STL into a BINARY-Type STL file this helps me.

PHP Code:
#!/usr/bin/env python
import vtk
reader 
vtk.vtkSTLReader()
# path to binary or ascii stl file to be converted
reader.SetFileName("/home/elvis/motorBike.stl")
reader.Update()
write vtk.vtkSTLWriter()
#uncomment unnecessary 2Ascii or 2Binary 
#write.SetFileTypeToASCII()
write.SetFileTypeToBinary()
 
write.SetInput(reader.GetOutput())
# path to 
write.SetFileName("/home/elvis/my_ascii_or_binary.stl")
write.Write() 
this script converts Binary.STL -> ASCII.STL
and ASCII.STL-> Binary.STL
it really worked in both directions for me
But you need "python-vtk" on your computer (apt-get install python-vtk) for debianbased distributions

So put the python code in a "file", edit the input and output path, do not forget "chmod a+x file"
and run ./file

now paraview or meshlab should show the Binary-STL-File.

elvis

elvis
elvis is offline   Reply With Quote

Old   June 2, 2010, 12:24
Default
  #3
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 16
Jochem is on a distinguished road
Hi Elvis,

Thanks a lot for the help, i will try to use your "workaround" to solve my problem. I will let you know when i've succeed in solving my problem.

Regards,

Jochem
Jochem is offline   Reply With Quote

Old   June 2, 2010, 14:20
Default
  #4
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Jochem,

Could you post your blockMeshDict too?
Having negative volume cells is not a good thing, and could cause many problems.

Philip C

Last edited by bigphil; June 3, 2010 at 07:11.
bigphil is offline   Reply With Quote

Old   June 2, 2010, 17:24
Default
  #5
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 16
Jochem is on a distinguished road
Hi,

I've been abled to find a solution for my problem. The dimension of my .stl file where to large. The convertion from mm in inventor to meters gave the error. The .stl file was bigger then the blockMesh i did, i guess that's why i have some negative values.

Another issue was that i've saved the .stl file using another name. I thoughtthat i've change this trough all files of the case but apparently this was not so. So i've saved my .stl file to motorBike.stl.

Anyway thanks for the quick responses and the help.

Regards,

Jochem
Jochem is offline   Reply With Quote

Old   August 3, 2012, 05:29
Default
  #6
New Member
 
Roman Gášpár
Join Date: Apr 2012
Posts: 8
Rep Power: 14
roman.gaspar is on a distinguished road
Hello guys. I have similar problem.
I make a cube with blockMeshDict (check it->Mesh OK) and I open it in ParaFoam. After that i open my .stl file (see pic.)


It seem to be everithing fine. In next step I make a surfaceCheck and there are no illegal triangles.

I run the snappyHexMesh and...

Refinement phase
----------------
--> FOAM FATAL ERROR:
Point (3 3 0.43) is not inside the mesh or on a face or edge.
Bounding box of the mesh-0.5 -0.4 -0.5) (1.5 0.4 0.5)


no other errors...

BUT!!!! in .stl file is no coordinate (3 3 0.43)

do you have any suggestions?

thanks a lot for reading my reply
Roman
roman.gaspar is offline   Reply With Quote

Old   August 3, 2012, 06:25
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Roman and welcome to the forum!

Try this coordinate: (3.2412 3.25345 0.431351234)
This way it's a lot harder to fall right on top of a cell face or edge!

Best regards,
Bruno
__________________

Last edited by wyldckat; August 3, 2012 at 06:25. Reason: edge, not vertex
wyldckat is offline   Reply With Quote

Old   August 3, 2012, 07:20
Default
  #8
New Member
 
Roman Gášpár
Join Date: Apr 2012
Posts: 8
Rep Power: 14
roman.gaspar is on a distinguished road
Thanks for help and welcome but I solved the problem by myself
in "snappyHexMeshDict" is a part

// Mesh selection
// ~~~~~~~~~~~~~~

// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.

locationInMesh (0 0 0)
; <---- Here is default (3 3 0.43) and you must use coordinates which are inside your cube (in my case is (0 0 0) ) !!!! and it will works

Last edited by roman.gaspar; August 9, 2012 at 03:50.
roman.gaspar is offline   Reply With Quote

Old   September 21, 2016, 11:31
Default Point is not inside the mesh
  #9
New Member
 
Mauricio
Join Date: May 2015
Posts: 3
Rep Power: 11
mauri_tano is on a distinguished road
Hello guys and gals,

Coming back to this old thread, I was playing a bit with snappyHexMesh and I got the popular error:

'Point (0.002131 0.001123 0.082321) is not inside the mesh or on a face or edge.
Bounding box of the mesh-0.03 -0.03 -0.01) (0.03 0.03 0.17)'.

I am trying to use snappyHexMesh for meshing a counter flow heat exchanger to validate a conjugate heat transfer solver.

Attached go my blockMesh and my SnappyHexMesh Dicts.
blockMeshDict.txt
snappyHexMeshDict.txt


Looking at the geometry everything seems fine, the STL bodies inside the box: photoSnappy.png

So far I have tried to:
-> Try with different points inside the bounding box and geometry.
-> Make the bounding box bigger
-> translate the STL files so that all points are positive: surfaceTransformPoints -translate '(x x x)' ...
-> pass the STL files to binary: http://www.cfd-online.com/Forums/ope...tml#post261388 response #2.

However I seem not to be able to overcome the error. Any ideas?

Thanks in advance!

Mauricio.

Last edited by mauri_tano; September 22, 2016 at 06:46.
mauri_tano is offline   Reply With Quote

Old   September 22, 2016, 22:01
Default
  #10
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

When you create your blockMesh, are there negative volume cells? Are some faces/cells twisted inside out? (This would be output in the log for blockMesh as a warning).

If you have tried multiple locationInMesh points all of which are within your bounding box and you still have this issue, then I am tempted to think that it is the above mentioned point.

Check your blockMesh log to confirm. If it is indeed the case that you have that inside-out twisted cells/faces, then you will need to reorder the vertices making up the blockMesh to avoid this.

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   September 23, 2016, 05:26
Default Careful with the negative volumes in blockMesh when using snappyHexMesh
  #11
New Member
 
Mauricio
Join Date: May 2015
Posts: 3
Rep Power: 11
mauri_tano is on a distinguished road
Hello Antimony,

Thanks for your response, indeed I had inside-out twisted cells. As a matter of fact my whole domain was twisted inside out . I've totally passed this over, my bad.

Thanks again!

Mauricio.
mauri_tano 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
[Gmsh] .stl from GMSH in SnappyHexMesh vainilreb OpenFOAM Meshing & Mesh Conversion 7 March 19, 2020 09:54
[snappyHexMesh] snappyHexMesh .stl generate extra boundary gsq OpenFOAM Meshing & Mesh Conversion 0 April 21, 2018 07:03
[snappyHexMesh] SnappyHexMesh fails to create patches of .stl files WernerW OpenFOAM Meshing & Mesh Conversion 4 September 26, 2017 01:59
[snappyHexMesh] snappyHexMesh does not create boundary patches from .stl files bug_or_feature OpenFOAM Meshing & Mesh Conversion 7 August 30, 2016 20:18
multiple .stl in snappyHexMesh jki OpenFOAM Pre-Processing 1 August 2, 2014 14:07


All times are GMT -4. The time now is 08:55.