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

SnappyHexMesh Troubles

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

Like Tree3Likes
  • 1 Post By Sumontro
  • 1 Post By J-P
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   May 18, 2010, 16:27
Default SnappyHexMesh Troubles
  #1
New Member
 
Sumontro
Join Date: Jul 2009
Posts: 12
Rep Power: 7
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,122
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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: 7
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,122
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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: Québec, QC, Canada
Posts: 169
Rep Power: 7
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
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: 7
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: Québec, QC, Canada
Posts: 169
Rep Power: 7
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: 7
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: 517
Blog Entries: 4
Rep Power: 12
elvis 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
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: 2
Rep Power: 0
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 likes 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: 5
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
s.m is offline   Reply With Quote

Old   October 15, 2013, 16:44
Default
  #12
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,122
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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 likes this.
wyldckat 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
stitchMesh and snappyHexMesh gdbaldw OpenFOAM 0 December 23, 2009 02:09
SnappyHexMesh samiam1000 OpenFOAM 0 October 5, 2009 10:32
Problem with snappyHexMesh samiam1000 OpenFOAM 0 October 3, 2009 05:08
Parallel case setup boundry conditions snappyhexmesh oskar OpenFOAM Pre-Processing 5 September 11, 2009 01:12
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 09:49.