GMSH: How to avoid creation of unwanted surfaces/1D elements in GMSH?

801 Views Asked by At

I need to mesh my domain in a way that I can have regular mesh with elements with 1:3 aspect ratio along the axis and the LHS wall and then coarser mesh everywhere else with aim of having around 600-800 elements in total (or of course if possible even less No of elements).The only way that I have so far managed to get my desired mesh was to introduce 3 extra lines parallel along the wall and the axis using transfinite mesh to help me achieve regular mesh in these areas.

While I have not assigned any physical entities to these supplementary lines but in order to use the transfinite I had to add elementary surfaces to the area bounded by these lines (However I did not assign any physical entities to these surfaces). The only physical entities created are for the boundaries of the domain (axis, outflow, inflow, wall).

The code I am using for DNS uses a python script to translate the Gmsh output file (.msh) to a readable format by the code and it creates surfaces from the 1D elements of the boundary so I can later on assign Boundary conditions to these elements, but unfortunately it creates extra surfaces for where elements edges meet along the extra lines I've created as well which should have no physical meaning.

It'd be a great help if you have any suggestion on how I can keep this mesh and get rid of the extra surfaces or if there's any other way that I can achieve similar mesh or better results without having to add the extra lines.

the photo below shows the lines I had to add for refining and keeping the mesh regular where I wanted,(extra lines inside the boundaries) enter image description here

the photo below shows the type of mesh i'm trying to achieve, enter image description here

the photo below shows the unwanted 1D elements created(inside the domain)

enter image description here

Thanks for your helps in advance. Ali

1

There are 1 best solutions below

1
On

Currently, you are assigning physical surfaces only to 1-D elements; however, you are trying to generate the 2-D mesh. The result of this in the generated MSH file will look, as follows:

  1. Lines that you designated as Physical Lines will appear in the mesh, while the rest would not.
  2. All surfaces together with the auxiliary ones will be included.

Resolution: mark everything you want to be in the MSH file as a physical element (lines, surfaces), while not assigning a Physical Surface to the auxiliary surfaces that you wish to avoid. In that case, you will get in the mesh only the entities you need.

This analogy can be extended to 3-D mesh creation.