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

[snappyHexMesh] SnappyHexMesh Troubles

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By Sumontro
  • 1 Post By louisgag
  • 2 Post By J-P
  • 1 Post By s.m
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2010, 16:27
Default SnappyHexMesh Troubles
  #1
New Member
 
Sumontro
Join Date: Jul 2009
Posts: 12
Rep Power: 16
Sumontro is on a distinguished road
I read the snappyHexMesh guide in the User Guide, but when I tried to run it, it gave me this error,

--> FOAM FATAL ERROR:
Cannot find triSurfaceMesh starting from "/home/sumontro/OpenFOAM/run/condorcfd/icoFoam/condor/constant/triSurface/Condor_CFD_Model.stl"

From function triSurfaceMesh::checkFile(const fileName&, const fileName&)
in file searchableSurface/triSurfaceMesh.C at line 117.

FOAM exiting


I saved the CAD model in STL format, but the file extension ending is .STL not .stl. I know linux is case sensitive, but I tried saved the CAD model in STL format, and the ending is not changing to lowercase .STL. I don't know what to do, can anyone help out?
sunshuai likes this.
Sumontro is offline   Reply With Quote

Old   May 18, 2010, 17:10
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hello again Sumontro

I believe you have at least three possible solutions:
  1. Rename the archive after exporting from the CAD software, like so:
    Code:
    cd /home/sumontro/OpenFOAM/run/condorcfd/icoFoam/condor/constant/triSurface/
    mv Condor_CFD_Model.STL Condor_CFD_Model.stl
  2. Or change the extension in the snappyHexMeshDict file, where you reference the STL file from Condor_CFD_Model.stl to Condor_CFD_Model.STL.
  3. Or (and this one is a bit overkill) you can still use the normal file name exported from the CAD Condor_CFD_Model.STL, but make a symbolic link to it with the desired name, like so:
    Code:
    cd  /home/sumontro/OpenFOAM/run/condorcfd/icoFoam/condor/constant/triSurface/
    ln -s Condor_CFD_Model.STL Condor_CFD_Model.stl

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 19, 2010, 00:44
Default
  #3
New Member
 
Sumontro
Join Date: Jul 2009
Posts: 12
Rep Power: 16
Sumontro is on a distinguished road
Thanks for the advice. I changed the file name to the lowercase STL. The file name change worked, but then I got this error when I tried running snappyHexMesh.

word::stripInvalid() called for word ��@��k(?VPA�!�@,B
For debug level (= 2) > 1 this is considered fatal
Aborted


I don't know how to fix this. What should I do?
Sumontro is offline   Reply With Quote

Old   May 19, 2010, 05:51
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Sumontro,

Simple, in your CAD software you have to export in ASCII STL and not Binary STL! Hopefully it will have such option.
If not, there should be free tools for converting from one type of STL to another, but right now I can't remember about any

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 19, 2010, 11:14
Default
  #5
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Quote:
there should be free tools for converting from one type of STL to another, but right now I can't remember about any
AdMesh should be able to do that.

something like
Code:
admesh --write-ascii=yourFile.stl
-Louis
sourav90 likes this.
louisgag is offline   Reply With Quote

Old   May 19, 2010, 14:21
Default How to Run Simulations after using snappyHexMesh
  #6
New Member
 
Sumontro
Join Date: Jul 2009
Posts: 12
Rep Power: 16
Sumontro is on a distinguished road
Thanks again for the help, it resolved the problem with the stl format. However, now I have a new one. When I tried to run icoFoam after using snappyHexMesh, I got this error.

--> FOAM FATAL IO ERROR:

patch type 'patch' not constraint type 'empty'
for patch frontAndBack of field p in file "/home/sumontro/OpenFOAM/run/condorcfd/icoFoam/condor/3/p"

file: /home/sumontro/OpenFOAM/run/condorcfd/icoFoam/condor/3/p::boundaryField::frontAndBack from line 35 to line 35.

From function emptyFvPatchField<Type>::emptyFvPatchField
(
const fvPatch& p,
const Field<Type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 101.

FOAM exiting


I think this means I haven't put the proper directories in the correct locations, but I am not sure. What should I do?
Sumontro is offline   Reply With Quote

Old   May 19, 2010, 16:21
Default
  #7
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
looks like a problem with your patch "empty".. Perhaps you should try running a few tutorials to get to know the basics.

Run these in a terminal

Code:
foam
cd tutorials
choose one that interests you

Code:
./Allrun
-Louis
louisgag is offline   Reply With Quote

Old   May 19, 2010, 17:17
Default
  #8
Member
 
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 16
AlanR is on a distinguished road
I think you have a 2D vs. 3D problem. If your CAD geometry is 3D, then you can't have patch type empty in your mesh or in /0/p. Empty patches are only for 2D simulations. The motorBike tutorial will show you how to set things up for 3D modeling. If you're doing 2D, then look at Cavity or pitzDaily. All of the files in the /0 directory must have the same patch names, consistent types (i.e. wall, patch, inlet), along with the correct data types for each patch. The patch names and types must be consistent with what you set up in blockMesh. Snappy may run with inconsistent patch types, but the solvers (icoFoam) will not. The p file is the first one that the solver opens.
I have geometry files with upper case characters in the extension - I just rename then with 'mv.'

Alan
AlanR is offline   Reply With Quote

Old   May 20, 2010, 13:27
Default
  #9
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 wyldckat View Post
Hi Sumontro,

Simple, in your CAD software you have to export in ASCII STL and not Binary STL! Hopefully it will have such option.
If not, there should be free tools for converting from one type of STL to another, but right now I can't remember about any

Best regards,
Bruno
Hi,

if you have package "python-vtk" and the other necessary vtk packages installed you can convert very easy with this python programm
Test it ;-)

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
just point path to your STL-file and don't forget to chmod a+x the python file

elvis
elvis is offline   Reply With Quote

Old   June 10, 2010, 09:24
Default
  #10
J-P
New Member
 
Jukka-Pekka Keskinen
Join Date: Dec 2009
Location: Helsinki
Posts: 3
Rep Power: 16
J-P is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Sumontro,

Simple, in your CAD software you have to export in ASCII STL and not Binary STL! Hopefully it will have such option.
If not, there should be free tools for converting from one type of STL to another, but right now I can't remember about any

Best regards,
Bruno
You can use paraview for this: Just click File -> Save Data and then choose ASCII when saving in stl-format. Nice and easy.
s.m and sourav90 like this.
J-P is offline   Reply With Quote

Old   October 15, 2013, 05:05
Default
  #11
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 14
s.m is on a distinguished road
Quote:
Originally Posted by J-P View Post
You can use paraview for this: Just click File -> Save Data and then choose ASCII when saving in stl-format. Nice and easy.
Dear J-P
we should first open our Binary stl file with paraview, then save it with *.stl file in paraview?
i do the steps that i said above, and when i want to save data of binary stl file, i din't see where we should choose ASCII before saving, would you please attach a picture for us?
Thank you very much
sourav90 likes this.
s.m is offline   Reply With Quote

Old   October 15, 2013, 16:44
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Quick answer: The option appears after you select the target file (i.e., after you choose the file name+location and click on the "Save" or "OK" button).
s.m and sourav90 like this.
__________________
wyldckat 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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 06:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 02:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 02:55
[snappyHexMesh] snappyhexmesh doesn't creat mesh in parallel issue? klausb OpenFOAM Meshing & Mesh Conversion 1 March 7, 2015 11:55
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 02:09


All times are GMT -4. The time now is 13:07.