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

SnappyHexMesh .stl

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 2, 2010, 03:34
Default SnappyHexMesh .stl
  #1
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 7
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 02:33.
Jochem is offline   Reply With Quote

Old   June 2, 2010, 09:17
Default
  #2
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 577
Blog Entries: 5
Rep Power: 13
elvis is on a distinguished road
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, 11:24
Default
  #3
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 7
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, 13:20
Default
  #4
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 565
Rep Power: 19
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 06:11.
bigphil is offline   Reply With Quote

Old   June 2, 2010, 16:24
Default
  #5
New Member
 
Jochem
Join Date: May 2010
Posts: 28
Rep Power: 7
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, 04:29
Default
  #6
New Member
 
Roman Gášpár
Join Date: Apr 2012
Posts: 6
Rep Power: 5
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, 05:25
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,253
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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 05:25. Reason: edge, not vertex
wyldckat is offline   Reply With Quote

Old   August 3, 2012, 06:20
Default
  #8
New Member
 
Roman Gášpár
Join Date: Apr 2012
Posts: 6
Rep Power: 5
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 02:50.
roman.gaspar 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
SnappyHexMesh howto assign boundary patches linnemann OpenFOAM Mesh Utilities 17 May 18, 2012 01:10
engrid -> save as .stl with boundarie codes Zymon enGrid 31 August 29, 2011 13:40
stitchMesh and snappyHexMesh gdbaldw OpenFOAM 0 December 23, 2009 03:09
Problem with snappyHexMesh samiam1000 OpenFOAM 0 October 3, 2009 05:08
SnappyHexMesh not generate mesh first time mavimo OpenFOAM Mesh Utilities 4 August 26, 2008 07:08


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