Find answers, ask questions, and connect with our <br>community around the world.

Home Forums OpenFOAM Forum 2D mesh generation with SnappyHexMesh

  • 2D mesh generation with SnappyHexMesh

    Posted by Diego on November 6, 2023 at 2:46 pm

    Hi everyone! I am trying to model a complex 2D geometry, which should represent a series of intersected galleries with air flowing inside (image below). I tried to use SnappyHexMesh, as explained in the lectures of the course for beginners, but I encountered several problems. First of all, I did not understand if simply running snappyHexMesh is enough ot generate a 2D mesh. I checked online that it should be also defined an extrudeMesh dictionary. The second problem is that sometimes the point inside the .stl is recognized and sometimes not (without changing its coordinate, but only the parameters for the castellated control). I believe that the combination between cell size in blockMeshDict and the parameters selected in snappyHexMeshDict generates some sort of conflicts. And finally, may I ask you which kind of solvers you would use for modelling pressure and gravity-driven airflow inside galleries?
    Thank you in advance for your support!

    Barış Bicer replied 5 months, 1 week ago 2 Members · 5 Replies
  • 5 Replies
  • Barış Bicer

    November 7, 2023 at 9:22 pm

    Hi Diego,

    I didnt hear so far that someone can create 2D mesh with snappyHexMesh utility. Snappy can be used for complex 3D geometries. But as you said that I saw some case using extrudeMesh to create 2D mesh.

  • Diego

    November 8, 2023 at 8:29 am

    Hi Bariş,

    Thank you very much for your reply.

    Finally, I was able to convert this 3D geometry into a 2D geometry by using ExtrudeMesh. Unfortunately, this geometry is so big (-540 m < x < 300m; -125 < y < 4; 0 < z < 5) that the snapping procedure does not reconstruct edges very well, especially in the oblique section (see image attached). I know that the problem might be the refinement settings, but if I increase them too much, the number of cells increases a lot and the computation time is too long (if not killed before).

    Do you have any suggestion when dealing with complex and big models?

    I could also copy paste the setup used for this model, to help you have a better idea.

    In alternative, do you think that SALOME could be the best open source alternative for complex 2D geometries?

  • Barış Bicer

    November 8, 2023 at 11:06 pm

    Hi Diego,

    I worked before with the big scale ships simulations where I always did scale-down of real-size model. After CFD calculations, I used a non-dimensional coefficient to switch to real-size models. Maybe you can follow this kind of way if possible for your case.

    As another way, just run the case as it is and at least obtained a result. After that slightly improve the mesh and map the first results into new improved mesh that will speed-up most probably your run-time. Of course, also you can try Salome unstructured mesh for 2D meshing and then easily you can convert it into openfoam.

    For your information.


  • Diego

    November 9, 2023 at 8:15 am

    Hi Barış,

    Thank you again for your reply.

    The scale down process was something that I was looking for indeed. It’s nice to know that you have already applied this technique for big models with great results. I read on various forums that it was not adviced to proceed in that way, that’s way I gave up.

    Anyway, I finally solved all the issues connected with my model and now I am able to run a simulation. The problem was simple, but yet complicated to find among all the parameters. To be sure that the mesh properly follows my .stl file, I had to select the feature snapping as follows:

    nFeatureSnapIter 10;

    implicitFeatureSnap false;

    explicitFeatureSnap true;

    multiRegionFeatureSnap true;

    The result is now what I wanted, with the model that is properly snapped along the edges (figure attached).

    Thank you again for your answer and support.

  • Barış Bicer

    November 12, 2023 at 7:35 pm

    hi Diego,

    I am happy to hear that you have solved your problem.

    Good luck…


Log in to reply.

error: Content is protected !!