How to create 2D meshes for CFD analysis (1 Element across thickness)

Greetings to all !

I wish to recreate the results from the 2D zero pressure gradient flat plate case described here. I am using OpenFOAM as my solver and thus I have to create a mesh that has 1 cell across the thickness in order to simulate a 2D case. However I am not able to do this in salome. I have tried automatic hypothesis for tetrahedrals and hexahedrals and in both I end up with multiple cells across the thickness. I am really stuck on how to apply one cell restriction across the thickness of the domain. I would really like to get some clarity/tips on this.

I have currently no Salome available, hence I can only roughly describe the procedure.

First, create the geometry. Let’s refer to it as the slab, since it will be quite thin in thickness direction.
Create a group (surface) from the slab, which represents the 2D geometry. Then create another group (edges) which contain all edges in thickness direction.
Furthermore, create surface-groups for inlet, outlet, symmetry and walls as is proper. You won’t need them for mesh creation; however, they will form the patches of the resulting mesh.

Secondly, create a mesh from the slab. Select Extrusion3D as the meshing hypothesis and nothing else.
Then, create a SubMesh by selecting the group of edges. Select a 1D hypothesis that results in only one cell in thickness direction.
Then, create a SubMesh from the slab’s face, i.e., your 2D geometry. Here you can use Netgen or something else.

Now, you should be done. The SubMesh on the edges will guide the 3D-extrusion into the thickness direction; and the SubMesh on the slab’s face, will provide the necessary 2D mesh.

You may need to delete the Group_of_edges from the mesh prior to exporting, some OpenFOAM converters do not like edge-groups.

This should give you a rough idea. The important bit is to extrude in thickness-direction.

You can also abuse OpenFOAM itself to provide you with the proper 2D mesh from an inproper one.
Here, the trick is to use OpenFOAM’s extrudeMesh, to create a cell layer of only one cell thickness from your improper mesh and discarding the improper mesh.

1 Like

Thank you for your response. I will look into this. Meanwhile I found a tutorial which roughly does the same as your explanation. [1][2]