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

SnappyHexMesh meshes inside and outside of an STL geometry

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 6, 2008, 07:08
Default Hello! I have created a sim
  #1
villier
Guest
 
Posts: n/a
Hello!

I have created a simple box, meshed with blockMesh, and placed another (quite simple) closed geometry from an STL file in this box using a modified snappyHexMeshDict from the motorbike tutorial.
I set the locationInMesh outside the STL geometry, and inside the surrounding box. snappyHexMesh works fine, but if I display the resulting mesh in paraFoam, I see that although the cells have snapped to the STL geometry, also the interior of this geometry is meshed. I assume it is no supposed to?

Did I forget some step to have only the outside of the STL geometry meshed as displayed in the "5.4 Mesh generation with the snappyHexMesh utility" chapter of the users guide ("cell removal" step)?

(If I set the locationInMesh inside the STL geometry, the resulting mesh is only the STL interior.)

Looking forward to your advice
Pierre
  Reply With Quote

Old   August 6, 2008, 07:53
Default Forget my question. I had offs
  #2
villier
Guest
 
Posts: n/a
Forget my question. I had offset the STL geometry by an unexpected value, and what I thought was the STL interior was in fact the effect of the STL geom on the outside mesh structure. Now I find the void space at the STL geometry as expected.

Nice tool!
  Reply With Quote

Old   August 23, 2008, 13:53
Default hello all, I am using reac
  #3
New Member
 
Vijayaratnam Piradeepan
Join Date: Mar 2009
Posts: 6
Rep Power: 8
piradeepan is on a distinguished road
hello all,

I am using reactingFoam in a simple geometry with 2 inlets and a outlet.I have manually edited all the files of U,O2,etc.. but on solving with reactingFoam , I get the following error:

#0 Foam::error::printStack(Foam:stream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 ??
#3 Foam::polyMesh::calcDirections() const
#4 Foam::polyMesh::directions() const
#5 Foam::fvMatrix<foam::vector<double> >::solve(Foam::Istream&)
#6 Foam::lduMatrix::solverPerformance Foam::solve<foam::vector<double> >(Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&)
#7 main
#8 __libc_start_main
#9 __gxx_personality_v0

What does this error mean?and how to resolve it?
I am using OF 1.5

Thanks.
Mayank.
piradeepan is offline   Reply With Quote

Old   April 28, 2009, 15:40
Default is my doing correctly in the process of snappyHexMesh?
  #4
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Hi, I am beginning to learn snappyHexMesh. I tried according to the tutorial. I typed bockmesh in the motorBike case directory, and then I viewed in paraFoam only a rectangle geometry, no any other shape inside. and then I typed snappyHexMesh. It executed and then I open paraFoam. The reaction is really slow that it can hardly show anything to me. I am wondering if there is something wrong in the process, for example, there should be a shape inside the box, Anybody can give me a hint or advice?
Thank you very much.

Wendy
wendywu is offline   Reply With Quote

Old   April 30, 2009, 06:03
Default
  #5
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
if there is a rectangle geometry inside only, this sounds like the "outline" display methode. just change the display methode of the geometrie to shape or shape and edges or mesh.

to view the motor bycicle unmark the min_y max_x etc.
wolle1982 is offline   Reply With Quote

Old   April 30, 2009, 10:49
Default I can see motorBike finally
  #6
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
wolle, Thank you for your reply. Yes, I saw the motorBike finally, But it is so small compared with the outside rectangle. I have to hide the rectangle and fit the window to see it and it is not located in the middle of the rectangle but at the side face. Is it because the unit of the motorBike is mm and the rectangle is m? I think the motorBike should be located in the middle of the rectangle and should have similar size.

Thank you.

Wendy
wendywu is offline   Reply With Quote

Old   May 4, 2009, 05:46
Default
  #7
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
i have no idea why it's so small, but your theory sounds plausible to me. however, i only started meshing without any change in the sHM-Dict. so no idea why in your case there is a divergence.
wolle1982 is offline   Reply With Quote

Old   May 4, 2009, 17:07
Default mesh for complex outer contour
  #8
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Thank you for your reply. I now have another question : If I need a flow area with complex shape in outer contour. It will be troublesome to create the blockMeshDict. So can I create mesh with snappyHexMesh utility for the outer contour or do I have to convert it from fluent or else?

thank you very much.

Wendy
wendywu is offline   Reply With Quote

Old   May 5, 2009, 03:45
Default
  #9
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
hi,

yes, snappyHexMesh is feasible for Meshing this kind of task you'd like to do.

just proceede like the tutorial, search this forum and try by yourself. It is handleable.

I once wrote a little manual how the mesh different reagion in different refinement grades.

Read http://www.cfd-online.com/Forums/ope...e-stlfile.html

You need the geometry as a STL-File. This can be created by most of the CAD programs. If not, use Salome to convert an imported STEP-File. Create a blockMeshDict around your geometry and then play around with the parameters.

You will achieve good results with the right parameters. however, there are still some major problems in snappyHexMesh (boundary layer, feature edge lines,....)

hope that helps.
wolle1982 is offline   Reply With Quote

Old   May 5, 2009, 10:18
Default method for creating blockMeshDict
  #10
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Thank you very much for your reply.
I have read that detailed tutorial and it really helped.
Now my question is another one.
In the first step I should use blockMesh to create the first mesh in the whole area according to the information in blockMeshDict. In the tutorial it is a rectangle block. Because it is 8 vertex block so it is easy to write the blockMeshDict by myself. But if now I want to create a more complex area for blockMeshing, it will be troublesome. Is there any method to create the blockMeshDict for complex shape geometry conveniently? Did I make sense?

Thank you very much.

Wendy
wendywu is offline   Reply With Quote

Old   May 5, 2009, 11:17
Default
  #11
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
hi,

as i understand, you'd like to simulate a free stream flow. ..? you want to mesh a complex geometry and the initial Mesh should also be complex..

why would you want to have that? could you tell, what exactly it should look like?!

the only way i could think of doing that would be to create the inside geometry and the outside geometry as ONE closed stl-file and then put a rectangle mesh over it and pointInMesh the space between inside and outside geometry.

maybe you can add a little sketch or something.
wolle1982 is offline   Reply With Quote

Old   May 6, 2009, 14:44
Default
  #12
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Dear Wolfgang,

Thank you so much for your patience.
I understand your suggestion now. I will try as you suggested right after. What I am going to simulate is aluminum extrusion. My final goal is to simulate the hollow profile extrusion process. The initial material is a round stick,it will be extruded by a ram at the one end, and the material will be pushed to go through several seperate holes and then meet together in a chamber and then go out of the die with a core to form the inner shape. so the inside and outside geometry both are not regular shape. And the boundary is moving(ram pushing). Next step I will have to know how to do it with moving boundary and then I will have to know how to do it in the outlet to describe the free surface after the material is pushed out the die.
Could you also give me some advice about that?
Thank you again.
Have a nice day!

Wendy
wendywu is offline   Reply With Quote

Old   May 7, 2009, 03:28
Default
  #13
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
hi,

no sorry, never worked with dynamic mesh before. and what you want to do sounds very difficult to me.

i would suggest to mesh the inside where the aluminum is flowing. this would be an inside mesh of a shape. dont work with moving mesh. better make the aluminum flow in constantly. so create the geometry of your severel forms the aluminum will be pushed through. your inlet should then be round (like the initila shape) and your outlet has to have the final shape of your profile.
create the initial rectangle mesh with blockmesh around the geometry in that way, that the inlet is exactly fitting your blockmesh grid-end (or create the geometry a little longer, so it stands out of the blockmesh grid). the outlet then should be the same with your final shape.
meshing it with sHM then will creat you a mesh that is only the flowarea with round inlet and shaped outlet. as solver you a non-newtonian one (see user-guide). at the inlet then let your aluminum flow in a a certain speed. since it is not compressible it is the speed of your pushing advice.

so make an easy flow-simulation out of it without any moving mesh.

maybe you really post a sketch of your simulation

good luck.

Last edited by wolle1982; May 7, 2009 at 04:56.
wolle1982 is offline   Reply With Quote

Old   May 7, 2009, 12:45
Default
  #14
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Hi, Thank you. I think you are understanding aluminum extrusion process well. I am considering to do it according to your suggestion.
The attachment is my simple geometry about the flow field.
My constitutive model is viscoplastic model.
I can also attach it to you,. I have not think out how to modify the code yet. Could you give me some advice about that? I think I have to understand the solver well before I can do it.


Thank you so much, I really appreciate it.

Wendy
Attached Images
File Type: gif aluminum flow2.GIF (50.7 KB, 107 views)
Attached Files
File Type: doc constitve equations.doc (45.5 KB, 48 views)
wendywu is offline   Reply With Quote

Old   May 11, 2009, 05:51
Default
  #15
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
hi wendywu,

i don't know nothing about solver-variation....sorry.

but for meshing your geometry, sHM is perfect. Take your geometry put it inside a larger blockMesh-Mesh and set locationInMesh point inside geometry. check that the inlet-outlet boundaries are exactly on blockmesh-mesh boundary.

your geometry can also be easily meshed with the progtramm engrid by engits. it's a great tool for solving geometries like yours. I am using the comparing-cheap CastNet.

greets.
wolle1982 is offline   Reply With Quote

Old   May 11, 2009, 17:40
Default can Engrid create
  #16
Member
 
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 8
wendywu is on a distinguished road
Hi,

Thank you for your reply always. I have succesfully finished meshing with sHM after enough trying. I think the mesh is perfect. I created separate stl files for each small face (in CAD software) and then added them together to form one stl file. I think if I can export one whole stl once in one step from CAD and then in meshing to designate inlet and outlet patches ( for applying boundary conditions in OpenFOAM) I can save a lot of time. Can Engrid do that? Thank you.

Best,

Xianghong
wendywu is offline   Reply With Quote

Old   May 12, 2009, 05:20
Default
  #17
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 8
wolle1982 is on a distinguished road
hello,

yes ui think engrid can do this. if you have separated patches you can separatly mesh them.... just try.
wolle1982 is offline   Reply With Quote

Old   June 15, 2010, 19:51
Default tutorial one more to check it out
  #18
New Member
 
Join Date: Sep 2009
Posts: 17
Rep Power: 7
tachyon_me is on a distinguished road
http://www.opencfd.uphero.com/foam_meshing.htm
tachyon_me 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
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Native Meshers: snappyHexMesh and Others 17 May 8, 2013 17:04
SnappyHexMesh Point is not inside Mesh but it is wolle1982 OpenFOAM Mesh Utilities 6 September 3, 2010 08:59
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Mesh Utilities 0 August 31, 2008 23:50
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Mesh Utilities 0 August 31, 2008 23:44
ICEM meshes inside my wing LBRS Main CFD Forum 6 February 21, 2008 10:09


All times are GMT -4. The time now is 18:02.