CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing Format & General Technical

binary or ascii stl?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 24, 2010, 07:15
Default binary or ascii stl?
  #1
New Member
 
Calobra's Avatar
 
Ruben Wetind
Join Date: Dec 2009
Location: Alnö Sweden
Posts: 6
Rep Power: 7
Calobra is on a distinguished road
Just received a stl file produced with ProE.
I loaded it to ParaFOAM and the geometry was nicely reproduced.
Now my plan was to follow the motorcycle tutorials but with my geometry instead.
When running surfaceCheck only mishmash comes out.
I guess my stl is binary. Do I need a new stl or how can I use the one that I have?
------------------
ruben@ruben-desktop:~/OpenFOAM/ruben-1.6.x/run/KFA/constant/triSurface$ surfaceCheck KFA.stl > log.surfacecheck
word::stripInvalid() called for word ��tC�U�C
For debug level (= 2) > 1 this is considered fatal
Aborted
Calobra is offline   Reply With Quote

Old   February 25, 2010, 04:00
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by Calobra View Post
I guess my stl is binary. Do I need a new stl or how can I use the one that I have?
------------------
ruben@ruben-desktop:~/OpenFOAM/ruben-1.6.x/run/KFA/constant/triSurface$ surfaceCheck KFA.stl > log.surfacecheck
If it is binary, try renaming to *.stlb so that OpenFOAM knows to treat it as a binary STL.
olesen is offline   Reply With Quote

Old   August 31, 2010, 08:38
Default
  #3
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 577
Blog Entries: 5
Rep Power: 13
elvis is on a distinguished road
Hi,

If you have the Package "python-vtk" (as is called for debian) installed. You can convert your ASCII-type STL into a BINARY-Type STL file or vice versa.


PHP Code:
#!/usr/bin/env python
import vtk
reader = vtk.vtkSTLReader()
# path to binary or ascii stl file to be converted
reader.SetFileName("~/OpenFOAM/ruben-1.6.x/run/KFA/constant/triSurface/KFA.stl")
reader.Update()
write = vtk.vtkSTLWriter()
#uncomment unnecessary 2Ascii or 2Binary
write.SetFileTypeToASCII()
#write.SetFileTypeToBinary()


write.SetInput(reader.GetOutput())
# path to
write.SetFileName("~/OpenFOAM/ruben-1.6.x/run/KFA/constant/triSurface/KFAascii.stl")
write.Write()


this script converts Binary.STL -> ASCII.STL
and ASCII.STL-> Binary.STL

greets

elvis
elvis is offline   Reply With Quote

Old   December 1, 2011, 07:28
Question stl giving error in FOAM
  #4
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Hello everyone,

I am trying to go for a snappyHexMesh for my own STL file. Like Calobra said, I can also see my file in paraView too. blockMesh is running fine but "snappyHexMesh" is giving error. I have attached the error clip in attachment. Can anyone help me please where I am wrong.

I followed the below steps as given in the userguide.

1. I have put the file in the "trisurface" folder located below. $run.../.../incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/trisurface.

2. Changed the old filename to new (i.e. test.stl) inside the "snappyHexMeshDict" within "system" folder.

Please help...
Attached Images
File Type: jpg Screenshot.jpg (43.8 KB, 45 views)
anjansir is offline   Reply With Quote

Old   December 2, 2011, 05:09
Default
  #5
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
it is a little bit hard to tell what is wrong in particular, but the error message
looks to me like you eventually forgot a bracket or a semicolon, but it is easier
to say if you attach your sHMD file so we can have a look at it.

And since you didn't mention it specifically: you have a blockMesh background mesh?

regards
Colin
colinB is offline   Reply With Quote

Old   December 6, 2011, 02:01
Default stl giving error in FOAM
  #6
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Hi colinB,

Yes, I used a blockMesh background.

I could not understand what is sHMD file ? Can you help me how to get it ?

thanks, anjansir.
anjansir is offline   Reply With Quote

Old   December 6, 2011, 03:49
Default
  #7
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
sHMD = snappyHexMeshDict

likewise there is

bMD for blockMeshDict and so on
colinB is offline   Reply With Quote

Old   December 6, 2011, 04:29
Default stl giving error in FOAM
  #8
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Oh thanks. I attached the two files i.e. both sHMD and bMD.

Thanks, Anjan.
Attached Files
File Type: gz sHMD & bMD.tar.gz (3.9 KB, 8 views)
anjansir is offline   Reply With Quote

Old   December 6, 2011, 05:06
Default
  #9
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
Hi

I just had a look at it and found the failure:

you wrote:

test.stl
{
type triSurfaceMesh;
}

but it has to be written like this:

test.stl
{
type triSurfaceMesh;
name ******;
}


instead of the stars you put the name of the solid of your .stl file which looks like:

Code:
 solid any_object

facet normal -0.52733372213947194 0.7512430031456685 0.39692958534128875 
    outer loop
      vertex 234.52195739746094 -0.67765188217163086 19.251394271850586
      vertex 234.73222351074219 -0.53262174129486084 19.256250381469727
      vertex 234.39920043945313 -0.48949074745178223 18.732187271118164
    endloop
  endfacet
.
.
.
.

endsolid any_object
then the stars after name would be named any_object

Note that you have to specify the solids name elsewhere in the sHMD as well
see therefore also the motorbike tutorial and compare there the stl file and the sHM which helps quite a lot for understanding sHM

I hope I explained everything well

regards
Colin
colinB is offline   Reply With Quote

Old   December 6, 2011, 08:03
Default STL Error corrected
  #10
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Thanks a lot Colin for your help. The model is now recognized perfectly by OpenFOAM. The mesh looks pretty interesting now..

Regards, Anjan.
anjansir is offline   Reply With Quote

Old   December 8, 2011, 07:58
Default blockMesh editing
  #11
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Hi Colin,

I am trying to change the vertices inside the blockMesh file. I am trying to generate a cube having all sides equal. The changed vertices are as below.

vertices
(
(-2 -2 0)
(2 -2 0)
(2 2 0)
(-2 2 0)
(-2 -2 4)
(2 -2 4)
(2 2 4)
(-2 2 4)
);

Now as per my knowledge it should create a cubical domain having all sides equal but when I am running blockMesh it is generating the default geometry which it was generating before editing the file. I have attached the snapshot in the attachment after opening the domain in paraFoam. Can you please help where I am mistaken.
Attached Images
File Type: png Screenshot-1.png (3.1 KB, 7 views)
anjansir is offline   Reply With Quote

Old   December 8, 2011, 08:29
Default
  #12
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
try deleting all contents of the polyMesh folder except the bMD file and then
run blockMesh again.
this should work
colinB is offline   Reply With Quote

Old   December 9, 2011, 06:21
Default blockMesh editing
  #13
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Hi Colin,

I had done exactly as you said but I got no improvement in the model. It is as like before.

Regards, Anjan.
anjansir is offline   Reply With Quote

Old   December 9, 2011, 08:13
Default selection for motorBike solver
  #14
New Member
 
bubuncfd
Join Date: Nov 2011
Posts: 9
Rep Power: 5
anjansir is on a distinguished road
Hi Colin,

I could run the motorbike mesh successfully and can see it in paraFoam. But I am confused while I am putting the solver to run. I first selected "MRFSimpleFoam" but it is giving some error. Then I selected "icoFoam", but still it is giving error. Please see the error snapshot attached below. Can you suggest a suitable solver.

Thanks, Anjan.
Attached Images
File Type: jpg Screenshot-2.jpg (41.1 KB, 10 views)
anjansir is offline   Reply With Quote

Old   December 9, 2011, 09:05
Default
  #15
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
Hi there,

a general thing concerning the forum:

there are different sections for different topics, for a particular reason:

people encountering a similar problem can easily find a topic where their
problems are eventually already discussed!


so the last two posts of you clearly don't match with the ascii or binary stl file for a sHMD anymore and should be in the

blockMesh forum

and the solving forum


Another note:

Generally speaking there are no things like stupid questions, but I guess most of the users are not willing to do once home work:

An error message like:

/***************************************\
FOAM Fatal Error: cannot find file
.
.
.
.
file .../project/0/p

is missing
\***************************************/

is more or less self explaining.

concerning your blockMesh problem:

it is handy to have both files to understand why there are / should be differences.

So Bottom line if a problem occurs:

- read error message
- think
- if problem not solved read error message again

- think again

- if it is still not solved ask google or the forum search for the answer

- if they don't have it formulate your problem and gather all data you might
think are important

- think again

- make a forum post

- read the post and think again

- push the review post button

- then think again

- if everything is now well documented and well formulated and the problem
still hasn't solved push the submit button

This rough check list usually works out fine for me, it doesn't always keep me from asking obvious things, but keeps it to a minimum

I hope the above text is of assistance

regards
colinB is offline   Reply With Quote

Old   February 10, 2012, 11:59
Default
  #16
Member
 
Aqua
Join Date: Oct 2011
Posts: 96
Rep Power: 5
aqua is on a distinguished road
Quote:
Originally Posted by anjansir View Post
Thanks a lot Colin for your help. The model is now recognized perfectly by OpenFOAM. The mesh looks pretty interesting now..

Regards, Anjan.
Hello, Anjan,
I tried to use stl file created form proE, but OF didn't recognize it, after snappyHexMesh, in boundary file, nfaces is 0 for my test.stl.

So I wonder, your stl file is from Proe or what software?

thank you so much!
Aqua
aqua 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
How to make boundary patches in STL file nzy102 OpenFOAM Mesh Utilities 3 January 8, 2015 08:56
SnappyHexMesh plane surface bounding box podallaire OpenFOAM Bugs 22 August 26, 2009 07:34
binary heavier than ascii Schag OpenFOAM 2 July 22, 2009 08:38
Error to re-open fluent case file J.Gimbun FLUENT 0 April 27, 2006 08:42
Sliding mesh error Karl Kevala FLUENT 4 February 21, 2001 16:52


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