CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] snappyHexMesh - problem using *.obj file (https://www.cfd-online.com/Forums/openfoam-meshing/124358-snappyhexmesh-problem-using-obj-file.html)

inf.vish October 3, 2013 06:09

snappyHexMesh - problem using *.obj file
 
1 Attachment(s)
Hi all,

I am using a *.obj file as my geometry file instead of a *.stl file.
The problem is that stl files do not show curves whereas the curves on the geometry can be seen in *.obj file. Thus i am trying to use an obj file. The obj file i am trying to use has been generated using ProE wildfire 4. The geometry was exported in wavefront *.obj format.

The problem is that i cannot run surfaceFeatureExtract cause openFoam gives the following error -

Create time

Reading surfaceFeatureExtractDict

Surface : "pipe.obj"


Feature line extraction is only valid on closed manifold surfaces.

--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 0 the label 0

file: IStringStream.sourceFile at line 0.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting


Also if i do not run surfaceFeatureExtract and simply run snappyHexMesh -overwrite, i get the following errors -

Create time

Create mesh for time = 0

Read mesh in = 2.52 s

Overall mesh bounding box : (-51 -51 -1) (51 51 51)
Relative tolerance : 1e-06
Absolute matching distance : 0.00015333623

--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 0 the label 0

file: IStringStream.sourceFile at line 0.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

Can anyone explain what i am doing wrong? The obj file seems to work flawlessly with the motorbike tutorial.

I am attaching my SHMDict and obj files in this zip file - Attachment 25770

inf.vish October 4, 2013 01:06

[solved]
 
I solved the problem.

Just delet everything else in the *.obj file apart from
v
vn
vt
f

miro2000 October 6, 2013 17:00

Is there a way to convert it to .stl? I bet there is. Maybe surface convert can do that?

inf.vish October 6, 2013 23:20

Quote:

Originally Posted by miro2000 (Post 455372)
Is there a way to convert it to .stl? I bet there is. Maybe surface convert can do that?

Hey,

Yeah there is a way to convert it to .stl. It cannot be done directly though using surfaceConvert. You have to open the .obj file in paraview and then File> Save Data - save as .vtk . Go to the directory where the file is saved and perform surfaceConvert <vtk_file_name> <stl_file_name>.

miro2000 October 7, 2013 03:54

Nice. Anyway, maybe you can do that with foamToVTK?


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