CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: blockMesh (
-   -   hole in a mesh (

wilker June 23, 2012 00:32

hole in a mesh
hello everyone,

i am learning CFD using openfoam, and i am at the basic yet. i learnt some cases from the tutorial, and built a laminar incompressible flow in a channel, to see the parabolic velocity profile.
Now, i want to add holes to the mesh and observe the flow behavior. i have a superficial idea how this could be done, but they are not good ideas. in the "platehole" tutorial i could understand how the hole in the plate was made, but doing something similar in my case would be unpractical. i have a rectangular block and would like to add some (maybe many) small other little blocks, so that from a 2D perspective i could approach it to a porous media.
i have been playing with edges, but when i generate the mesh, it isn't shown.
what i have done so far was creating a small block inside, setting boundary conditions there...but that does no changes in the flow.

i would appreciate any reply.

thanks in advance and kind regards

wilker June 23, 2012 11:52

seems like snappyhexmeshdict is the way to go.
i am testing a little sphere inside my rectangular block, but it lasts a while for building it, and it exits with different errors that i correct one by one, per time.
considering i have to set many very little spheres inside, is there a way to make it run faster?
there is no priority for refinement of the spheres or so, they may be rough...what matters is there being spheres. whatever mesh with holes inside would fit to my problem

wyldckat June 23, 2012 15:21

Greetings wilker and welcome to the forum!

There are two plugins for Blender that might interest you:
These give you the ability to manipulate the geometrical boundaries for "blockMeshDict" and "snappyHexMeshDict" directly in Blender as if it were yet another geometry!

And given the complexity of your geometries, this might be the best solution.

Best regards,

wilker June 23, 2012 15:45

Thank you Bruno, for your reply. Let me write a new detail before starting your suggested approach. Maybe i am half way or almost there...

i created a small sphere using meshlab, and according to:

there is shown an example, where its linked a .stl file to the snappyhexmeshdict file. i could check this procedure, by running the wigleyHull present in openFOAM 2.1.1 and noticed the "boat shell" is already there when i loaded the mesh.
i am trying to do something similar now.
i created a little sphere using meshlab software, and exported it as .stl. i linked it in my snappyhexmeshdict file this way:

type triSurfaceMesh;
name kugel;

and when i run blockMesh and snappyMesh i get no errors. when i open parafoam to view the results, my block is the same rectangular block as before. also, the sphere won't be shown.
If i manage to add one sphere there, i could write a simple code in c++ to generate random coordinates in the interval of my mesh, generating as much spheres as i want.

i am skipping a lot in the geometry part, but i don't know if i need these parts, and honestly i haven't understood their objectives:


              secondSolid            // Named region in the STL file
                  name mySecondPatch; // User-defined patch name
              }                      // otherwise given sphere.stl_secondSolid
      box1x1x1  // User defined region name
          type  searchableBox;      // region defined by bounding box
          min    (1.5 1 -0.5);
          max    (3.5 2 0.5);
      sphere2  // User defined region name
          type  searchableSphere;    // region defined by bounding sphere
          centre (1.5 1.5 1.5);
          radius 1.03;

wyldckat June 23, 2012 15:53

Hi Wilker,

I'm tired, weekend and all... so I'll simply point you to an old tutorial:

Happy reading!

All times are GMT -4. The time now is 14:32.