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

[snappyHexMesh] meshing with snappy: im a very beginner

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2010, 21:34
Default water flow into a tank in 3D
  #21
New Member
 
sesha
Join Date: Mar 2009
Posts: 23
Rep Power: 17
hamsadhwani8 is on a distinguished road
Hi,

I want to create a 3D mesh

Last edited by hamsadhwani8; February 23, 2010 at 08:32.
hamsadhwani8 is offline   Reply With Quote

Old   August 4, 2010, 22:27
Default
  #22
New Member
 
Lee
Join Date: Jul 2010
Posts: 7
Rep Power: 16
lcnmy is on a distinguished road
I am newbie in OPENFOAM too. While I run the execution with snappyHexMesh, it is fatal error,

cnlee@cnlee-desktop:~/OpenFOAM/cnlee-1.7.0/run/tutorials/mesh/snappyHexMesh/motorBike$ snappyHexMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.7.0-279cc8e8233b
Exec : snappyHexMesh
Date : Aug 05 2010
Time : 09:26:16
Host : cnlee-desktop
PID : 2511
Case : /home/cnlee/OpenFOAM/cnlee-1.7.0/run/tutorials/incompressible/simpleFoam/motorBike
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/cnlee/OpenFOAM/cnlee-1.7.0/run/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 61.

FOAM exiting

Anyone know what is my OpenFoam problem? Btw, I using OpenFOAM 1.7

Regards
Lee
lcnmy is offline   Reply With Quote

Old   August 5, 2010, 05:54
Default
  #23
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Lee,

snappyHexMesh cannot find the fvSolution file, did you copy the motorbike case directly from $FOAM_TUTORIALS without making any changes to it?

There should be a fvSolution file in the system folder in the motorbike case? Is this file (motorbike/system/fvSolution) there?

Philip
bigphil is offline   Reply With Quote

Old   August 5, 2010, 22:22
Default
  #24
New Member
 
Lee
Join Date: Jul 2010
Posts: 7
Rep Power: 16
lcnmy is on a distinguished road
Hi Philip,

It works for me now. Thanks a lot! May I ask you another question? If I want to do a snappyHexMesh for other stl file, what file need to make a change? Sorry, I am a newbie in OpenFOAM.

Regards
Lee
lcnmy is offline   Reply With Quote

Old   August 8, 2010, 10:52
Default
  #25
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Lee,


You can put your stl file (I think it should be a ASCII stl) in the "constant/triSurface" directory.
You then need to open the "system/snappyHexMeshDict" file and find where the stl file is specified and change motorbike.stl to the name of your stl.
You have to create your background mesh some how too, usually with blockMesh.

It is all explained well in the User Guide: http://www.openfoam.com/docs/user/snappyHexMesh.php


Philip C
bigphil is offline   Reply With Quote

Old   August 27, 2010, 02:35
Default Error during snappyHexMesh
  #26
New Member
 
hc
Join Date: May 2010
Location: Perth, Australia
Posts: 11
Rep Power: 16
watashiwa is on a distinguished road
Hi all,

(Motorbike)
I have no problem executing the blockMesh command. Then I execute, snappyHexMesh, the errors show below. It's freshly install openfoam. (ubuntu 9.10, OF 1.6.)

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6-53b7f692aa41
Exec : snappyHexMesh
Date : Aug 27 2010
Time : 13:19:42
Host : orange
PID : 2674
Case : /home/orange/OpenFOAM/orange-1.6/run/tutorials/incompressible/simpleFoam/motorBike
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 500

Read mesh in = 0.04 s

Overall mesh bounding box : (-5 -4 0) (15 4 8)
Relative tolerance : 1e-06
Absolute matching distance : 2.29783e-05

Reading refinement surfaces.
Read refinement surfaces in = 3.06 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.03 s


Determining initial surface intersections
-----------------------------------------

#0 Foam::error:rintStack(Foam::Ostream&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam:rimitiveMesh::cellEdges(int, Foam:ynamicList<int, 0u, 2u, 1u>&) const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam:rimitiveMesh::cellEdges(int) const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::hexRef8::getLevel0EdgeLength() const in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libdynamicMesh.so"
#6 Foam::hexRef8::hexRef8(Foam:olyMesh const&, Foam::List<int> const&, Foam::List<int> const&, Foam::refinementHistory const&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libdynamicMesh.so"
#7 Foam::meshRefinement::meshRefinement(Foam::fvMesh& , double, bool, Foam::refinementSurfaces const&, Foam::shellSurfaces const&) in "/home/orange/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libautoMesh.so"
#8 main in "/home/orange/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/snappyHexMesh"
#9 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#10 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/i386/elf/start.S:122
Segmentation fault


Any idea, what went wrong?

Thank you so much.

watashiwa newbie
watashiwa is offline   Reply With Quote

Old   August 27, 2010, 07:14
Default
  #27
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi watashiwa,


I am not sure what is causing your error, maybe someone else here has a better idea, but did you just install OpenFOAM or did you compile it too?

If you compiled it then I would recommend to try re-compiling snappyHexMesh:
Code:
cd $FOAM_UTILITIES/mesh/generation/snappyHexMesh
wclean
wmake
or maybe try re-compiling the libraries mentioned in the error (libOpenFOAM.so, lipdynamicMesh.so).
Code:
cd $FOAM_SRC
wmake libso OpenFOAM
wmake libso dynamicMesh
If you just installed OpenFOAM and did not compile it then you will need to compile all of OpenFOAM which can be tricky but there are lots of really good guides and scripts on the forum.
BUT it might be over-kill compiling OpenFOAM,maybe someone else has an easier solution.


Philip
bigphil is offline   Reply With Quote

Old   August 27, 2010, 11:59
Default
  #28
New Member
 
hc
Join Date: May 2010
Location: Perth, Australia
Posts: 11
Rep Power: 16
watashiwa is on a distinguished road
Hi Phil,

I have just tried that out, same problem. No idea, what's wrong. what do you think if I replace the stl file which is related to my research, will snappyHexMesh solver is affected due to this error? I reckon installation should be no problem since I can use solidDisplacementFoam without any problem. Hmm...

Anyway I will try that out by replacing my stl file and see how it goes.

I hope someone can come out with this solution.
Thank you so much.

watashiwa is sad
watashiwa is offline   Reply With Quote

Old   September 10, 2010, 07:42
Default
  #29
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
Dear all.

Can snappyHexMesh generate meshes for the inner region of the triangulated surface geometries in Stereolithography (STL) format ?
awacs is offline   Reply With Quote

Old   September 10, 2010, 07:46
Default
  #30
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Quote:
Originally Posted by awacs View Post
Dear all.

Can snappyHexMesh generate meshes for the inner domain of the triangulated surface geometries in Stereolithography (STL) format ?
Hi,


Yes it can.

Just set the locationInMesh in the snappyHexMesh dictionary to be inside your STL geometry.


Philip
bigphil is offline   Reply With Quote

Old   September 11, 2010, 07:25
Default
  #31
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
Hi Philip ,

Thanks for your reply. As you suggested, internal meshes for the STL geometry can be generated by seting the locationInMesh in the snappyHexMesh dictionary to be inside the STL geometry. But there is only one patch named as the wall of the STL geometry.

My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?

Eugene suggested use separate STL surfaces for each region.
http://www.cfd-online.com/Forums/ope...pyhexmesh.html

And I do split my STL surfaces into three seperate regions : inlet, runner and cavity and get three STL files : "inlet.stl", "runner.stl" and "cavity.stl".



The corresponding patches are defined in the STL file as follows:
  • for inlet
solid inlet
...
endsolid inlet
  • for runner
solid runner

...
endsolid runner

  • for cavity
solid cavity

...
endsolid cavity


The following methods are used:
  1. using three STL files (in triSurface directory)
  2. using a combined STL file from above three files.
However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ?

Any suggestions will be highly appreciated.

Jitao
Attached Images
File Type: jpg filling.JPG (42.0 KB, 68 views)
awacs is offline   Reply With Quote

Old   September 13, 2010, 02:14
Default
  #32
New Member
 
amgode's Avatar
 
Amol
Join Date: Jul 2009
Location: Limerick, Ireland
Posts: 24
Blog Entries: 2
Rep Power: 17
amgode is on a distinguished road
Hi,


"My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?"

After the mesh generation (using snappyHexMesh) is complete you might want to use the
> autoPatch
utility for obtaining patches based on feature angle.
I have not used it though.


"However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. "

The only reason for this (as far as I know) is due to the individual stl's being closed.


"Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ? "

Though I am not the right person to answer this question; but then defining multiple points as locationInMesh is not available in snappyHexMesh.


Suggestions:

run
> surfaceCheck
on the individual stl files - to see if they are closed geometries.
And we don't want them to be closed.
The combined stl though needs to be closed geometry, if you wish to have a mesh inside the enclosed surface.

Hope it helps !

amgode is offline   Reply With Quote

Old   September 13, 2010, 05:46
Default
  #33
Super Moderator
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34
bigphil will become famous soon enoughbigphil will become famous soon enough
Quote:
Originally Posted by awacs View Post
My question is that how to seperate this patch into different patches (as noted in the enclosed picture ) ?
As amgode suggested, autopatch should work if your intended patches have well defined edges between them.
There is also a GUI tool called patchTool which was in OpenFOAM-1.4 where you could pick individual faces and add them to a patch, but I don't think there is any similar utility in the current version - you could try install the old version but the mesh formats are slightly different so this seems like a lot of work.


Quote:
Originally Posted by awacs View Post
However only one part of the three seperated regions can be meshed. It depends on where the point of locationInMesh is defined. Is it possible to define numbers of locationInMesh points in the snappyHexMesh dictionary ?
One idea is you could mesh each geometry individually (using different cases) and then merge the meshes (with mergeMeshes) and then stitch them together (with stitchMesh).


Hope it helps,
Philip
bigphil is offline   Reply With Quote

Old   September 13, 2010, 12:55
Default
  #34
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Awacs,

If all your stl files are enclosed in the blockMesh outer domain and your reference location point is well positioned then there should not be any problem. To be on the safe side I usually place the location point just inside one of the outer corners of the domain.

Now for having different patch names, just edit the individual stl files and add the patch name after the word solid which occurs at the very top of the stl file, and the word endsolid which occurs at the very bottom of the stl file. You also have to define the patch names as regions in the snappyHexMeshDict geometry section. Then you should use these patch names directly in the addLayersControls section. However, in the refinementSurfaces sections stick to the stl file name as defined in the geometry section. See the example below for the stl file of a geometry section from stl file Terrace.stl, called Terrace, and associated to patch name TERRACE.

ASCII stl file Terrace.stl:
Code:
solid TERRACE
 facet normal  0.000000e+00  1.000000e+00 -0.000000e+00
   outer loop
     vertex  3.600000e+00  3.950000e+00  1.670000e+01
.
.
.
     vertex  3.600000e+00  3.950000e+00  1.670000e+01
   endloop
 endfacet
endsolid TERRACE
geometry specification:
Code:
    Terrace.stl
    {
      type triSurfaceMesh;
      name Terrace;
      regions
      {
	TERRACE
	{
	  name TERRACE;
	}
      }
    }
refinementSurfaces specification:
Code:
        Terrace
        {
            level (2 2);
        }
addLayersControls specification:
Code:
        TERRACE
        {
            nSurfaceLayers 1;
        }
Hope this helps.
Ziad
ziad is offline   Reply With Quote

Old   September 15, 2010, 22:35
Smile
  #35
Member
 
Jitao Liu
Join Date: Mar 2009
Location: Jinan , China
Posts: 64
Rep Power: 17
awacs is on a distinguished road
Hi,

Many thanks to Amol, Philip and Ziad. I will try it out and feed back soon.
awacs is offline   Reply With Quote

Old   August 24, 2011, 12:37
Default
  #36
New Member
 
Join Date: Jun 2011
Posts: 3
Rep Power: 15
Hikachu is on a distinguished road
Hello, I'm also a beginner with paraFoam, and here is my (stupid) problem :

I'm on the motorbike case, and when I create the castellated mesh, I don't know how to display it on paraview.

When I open paraview, and tape I want to open the log.castellated file, it tells me :

" A reader for "/home/my_name/OpenFOAM/my_name-1.7.1/run/tutorials/incompressible/simpleFoam/motorBike could not be found, please choose one : "
and I have a list of programs I have to choose.

Do you know what to do??


Thx a lot!
Hikachu is offline   Reply With Quote

Old   August 25, 2011, 08:28
Default
  #37
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by Hikachu View Post
Hello, I'm also a beginner with paraFoam, and here is my (stupid) problem :

I'm on the motorbike case, and when I create the castellated mesh, I don't know how to display it on paraview.

When I open paraview, and tape I want to open the log.castellated file, it tells me :

" A reader for "/home/my_name/OpenFOAM/my_name-1.7.1/run/tutorials/incompressible/simpleFoam/motorBike could not be found, please choose one : "
and I have a list of programs I have to choose.

Do you know what to do??


Thx a lot!
You just open it with the command paraFoam from the case directory and then hit "Apply" in the panel on the left side. You should see a big block. If you only want to see the motorbike, deselect the internal mesh and select only the patches of the motorbike, you will then see the motorbike only.
__________________
~roman
romant is offline   Reply With Quote

Old   November 29, 2011, 05:51
Default
  #38
New Member
 
Rik
Join Date: Sep 2011
Location: Delft, the Netherlands
Posts: 2
Rep Power: 0
Rik_Tonnaer is on a distinguished road
Sorry, my post is now totally off topic. My reply was a response to a message from 2009. Didn`t notice the date

If you want to use paraFoam to see time step 3 you can do the following:

1) Make sure your terminal is in the main directory of the motorBike case ../motorbike.
2) run paraFoam
3) if paraFoam opens correctly, use the buttons at the top to go to time step 3. The buttons look like -> http://images.wikia.com/scivis/image...e_controls.png

It now should visualize timestep 3 and if your case ran correctly, time step three gives the fully castellated and snapped motorbike.

So for clarity, don`t run paraFoam from inside the folder named 3, just run it in the main folder and use the timecontroles inside paraView to change what you are looking at.
Rik_Tonnaer 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
[snappyHexMesh] snappyHexMesh stops meshing Tensian OpenFOAM Meshing & Mesh Conversion 2 January 26, 2014 10:54
Help me to choose between Ansys Meshing, Fluent Meshing or ICEM ? pipolaki ANSYS 0 December 6, 2013 09:12
[snappyHexMesh] Meshing NACA airFoil with snappy Paolo.F OpenFOAM Meshing & Mesh Conversion 6 October 8, 2013 05:52
Meshing locks workbench window. andy2o CFX 0 February 1, 2008 06:01


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