CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Meshing a circle (cylinder) (

bunni May 27, 2010 15:03

Meshing a circle (cylinder)
1 Attachment(s)
Hi all,

I apologize for a question which has probably been answered before, but in my search here, I wasn't able to find the answer. I want to do a simulation which has is a cylinder with an outlet to atmosphere in the centre of one of the circles, and some nozzles jetting in liquid along the cylinder. A similar example was done for a wedge-shape in multiphase/interFoam/nozzleFlow2D. I thought I'd try with a quarter-circle. My problem is that I can't quite make a (2-d) mesh where the elements are not either wedges or rectangles. So that, on the circular part, if I want (say) 150 points on the outside of my circle, I end up with 150 pts at the center of my cylindrical bit.

Clearly, I'm new to meshing with openfoam, and have worked through the tutorials. I haven't found an example in the tutorial section. The examples I've found have been of meshes with the cylindrical bit cut out, and therefore a (logically) rectangular mesh.

I've attached the blockMeshDict (*gz) of the mesh I did make. It's clear that near the center I've got way too many wedge-shaped elements, but I don't know how to make the proper number of elements near the edge of my cylinder.

Any ideas and pointers to other examples greatly appreciated. Thanks

lfbarcelo May 27, 2010 15:27

I am not sure if I understand what you are trying to do.

The mesh you uploaded is not a 2d mesh clearly. Why don't you try a 2d mesh consisting on a 5 wedge mesh with only one element width?. For doing this you must define front and back of the wedge as wedge type patches. (OpenFOAM understands that as an axisymmetric domain)

Check the UserGuide, page U-104, where it describes how to mesh a wedge.

Otherwise, If you want to work with a 3d mesh, you can't just mesh a quarter-tank, you should work with half a tank and define the symmetry wall as type symmetryPlane.

Doing this mesh with blockMesh will always generate the problem of high number of elements (probably highly skewed elements) in the axis, I recomend you try working with snappyHexMesh for this kind of meshes.

bunni May 27, 2010 15:33

I don't want a 2-d mesh, I want a 3-d cylinder, or quarter cylinder. I've already done wedges, but for my purposes it didn't work. A wedge is 5', thus giving 72-fold symmetry. I want much less symmetry than that. I'll need to do quarter/half/full circle to capture the symmetry (or lack!). The tutorial with snappy hex mesh also has circles cut *out* of the mesh, it also requires files to be in STL format. I was presuming that there might be an alternative to learning two other meshing systems, (stl, and snappyhexmesh)

lfbarcelo May 27, 2010 15:47

I strongly recommend you start working with snappyHexMesh, i'm working with tanks nowadays and snappy really suits my needs. You can try to fool around with various blocks in blockMesh in order to get a fair mesh but you will always find that same problem in the axis because blockMesh puts out an structured mesh.

STL meshing is quite simple with any cad software, and any questions about snappy, just ask, we've been working with it for several months now. You can also try thetraedral mesh generators such as netgen.

best regards.

lfbarcelo May 27, 2010 16:07

1 Attachment(s)
perhaps you can try this kind of block distribution in blockMesh

bunni May 27, 2010 17:20

I'll try the geometry you've demonstrated, it looks like it might do the trick.As for meshers, I've contacted GridGen for a quote, but they haven't got back to me. We don't have any CAD software on-site. The other CFD person wrote his own meshers/cfd code, but he's left .

wyldckat May 27, 2010 20:49

Greetings to all,

Might I suggest Discretizer:
It has a good user interface and hooks up with various meshers. Personally I haven't used it yet, but it seems pretty good :) And I believe it allows to draw the geometry directly in it, but I'm not sure of it either :(

Best regards,

cedric_duprat May 28, 2010 04:06

Hi Bunni,

If you feel more confortable with blockMesh, you can have a look there:

You will find an axisymetric diffuser test case (with or without pipe) and its mesh using a O-grid blockMesh (as lfbarcelo advice). The mesh as been parametrized using m4.
Thanks to the Sig Turbomachinery, you can get the mesh and play with it easily.

I hope this will help you

PS: same thing here thank to Hakan Nilsson

thekay May 28, 2010 07:43

What lfbarcelo is what I would recommend as well. It is pretty much the standard with cylindrical meshes and provides you with flexibility. You can have for instance, very fine mesh inside the square and move on with a less fine mesh to the edges that reach the arcs.

bunni May 28, 2010 15:11

thanks for your feedback. As a first approach to the problem, I think it's good. I also like that you can vary the density of the mesh.

nimasam May 31, 2010 08:13

hi dears
i tried to use discretizer to model a cylinder or a pipe but its not as simple as it seems, any idea?

wyldckat May 31, 2010 10:11

Greetings nimasam,


Originally Posted by nimasam (Post 261001)
hi dears
i tried to use discretizer to model a cylinder or a pipe but its not as simple as it seems, any idea?

I forgot to mention the thread for it :( The thread that is sort of dedicated to Discretizer is this one: Discretizer, a free mesh program for CFD
You can try there, since the developer himself can answer you ;)

Best regards,

All times are GMT -4. The time now is 12:03.