CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Mesh quality ideas needed (https://www.cfd-online.com/Forums/openfoam-meshing/182918-mesh-quality-ideas-needed.html)

Vignesh2508 January 22, 2017 08:42

Mesh quality ideas needed
 
4 Attachment(s)
Hi foamers,

Recently i was trying to mesh a car stl file using sHM. But it resulted in a mesh which looks pretty bad. I do not know the reason my mesh turned out like this. When i used 'checkMesh' it showed me that the mesh it OK. But I have attached some pictures with this thread. Please take a look and comment the reason for getting such a mesh.

I was wondering if this is a problem with my stl file because i was not able to get a perfect square cell near the surface of the car. My checkmesh showed the following results.

Code:

Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          154688
    faces:            414411
    internal faces:  382229
    cells:            130242
    faces per cell:  6.11661
    boundary patches: 9
    point zones:      0
    face zones:      0
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    121962
    prisms:        1958
    wedges:        0
    pyramids:      0
    tet wedges:    2
    tetrahedra:    0
    polyhedra:    6320
    Breakdown of polyhedra by number of faces:
        faces  number of cells
            4  42
            5  87
            6  1081
            7  14
            8  36
            9  4414
          12  616
          15  21
          18  9

Checking topology...
    Boundary definition OK.
 ***Total number of faces on empty patches is not divisible by the number of cells in the mesh. Hence this mesh is not 1D or 2D.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
                  Patch    Faces  Points                  Surface topology
              upperwall      36      74  ok (non-closed singly connected)
              lowerwall    2328    2545  ok (non-closed singly connected)
                  inlet      10      22  ok (non-closed singly connected)
                  outlet      10      22  ok (non-closed singly connected)
                  front    8638    9171  ok (non-closed singly connected)
                    back    8607    9142  ok (non-closed singly connected)
                    Body    4720    5080  ok (non-closed singly connected)
              UB_Smooth    4921    5161  ok (non-closed singly connected)
              notchback    2912    3086  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-16 0.2 -0.31) (20 0.3 10)
    Mesh has 2 geometric (non-empty/wedge) directions (1 0 1)
    Mesh has 2 solution (non-empty) directions (1 0 1)
 ***Number of edges not aligned with or perpendicular to non-empty directions: 56371
  <<Writing 74894 points on non-aligned edges to set nonAlignedEdges
    Boundary openness (-4.07173e-18 4.24743e-14 -2.39284e-17) OK.
    Max cell openness = 3.20275e-16 OK.
    Max aspect ratio = 10.4121 OK.
    Minimum face area = 3.98553e-06. Maximum face area = 1.031.  Face area magnitudes OK.
    Min volume = 1.99454e-08. Max volume = 0.1031.  Total volume = 36.6786.  Cell volumes OK.
    Mesh non-orthogonality Max: 81.0294 average: 6.17745
  *Number of severely non-orthogonal (> 70 degrees) faces: 292.
    Non-orthogonality check OK.
  <<Writing 292 non-orthogonal faces to set nonOrthoFaces
    Face pyramids OK.
    Max skewness = 3.48069 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

I will later extrude my mesh ( for doing a 2D simulation) , so i think i can ignore the first error. Please give ur view.

Thanks

Vicky

C-L January 23, 2017 09:12

Hi Vicky,

There are a couple of things that might cause this:
- When you view the mesh in paraview it can have issues dealing with polyhedron cells by default. There is a box you can tick that will help with the rendering: 'use VTKpolyhedron' underneath 'update GUI'.

-It also seems like the prism layers that you have added are very thin compared to the size of the cells close to the boundary; how are you defining them in the 'add layers' part of the SHM dict?

-Also, the checkMesh is highlighting 292 cells which are severely non-orthogonal (probably relating to the cells on the boundary). Play around with the 'add layers' parameters, such as reducing the number of layers and making them larger, to see if you get a more sensible mesh.

Charlie

Vignesh2508 January 23, 2017 10:24

Hi Charlie,

Thank you for your reply. The mesh images that i posted are the ones where i tried to add layers. This might be the problem. My stl file is a 3d model of a car. But I was trying to do a 2D simulation from that. My idea was to do a sHM on the model and then finally do an extrudeMesh to convert that to a 2D mesh. In my blockmesh file i tried to choose a domain of thickness 0.1m.

In this domain of 0.1m the model is not protruded straight but has an angle. This might be the reason why i got the problem on the interface between the surface and the mesh. Even if i add layers that is not properly applied on the surface.

Can you suggest me a method to do a 2D simulation of that without this problem?

Thanks

Vignesh2508 January 24, 2017 05:29

Charlie,

As you suggested i tried to modify the layers to eliminate the non orthogonal faces. But first i switched off the add layers option in the beginning. Even then the number of orthogonal faces did not seem to decrease. Is there any reason behind it.

Thanks

C-L January 24, 2017 06:49

The issue is likely due to how you are creating the '2D' slice - if there is variation in the third direction then the case isn't 2D and it sounds like that is the case. I recommend using a CAD package (SALOME might be able to do this) to take a slice through the car .stl file and then extruding that surface and saving it as a separate .stl.

There may be other ways to treat the CAD file using Snappy/blockMesh but I have not come across it myself!

Keep the 'add layers' function disabled for now until you can get a decent quality surface mesh.

Hope that helps!

C-L January 24, 2017 07:02

Hi Vickky,

I have just checked the CAD method in SALOME and it is fairly straight forward to create a 2D slice from and stl and then extrude it. SALOME is worth learning if you don't have access to commercial CAD software.

Vignesh2508 January 24, 2017 08:10

Charlie,

I will look into salome but are there are any learning materials available for that specifically.

And i wanted to tell that i increased the Max orthogonal value in the mesh quality control to 180 so that the sHM will ignore the non ortho faces and try to add layers. While doing that i was able to add layers and improve the mesh. I do not know if this is right.

Thanks

Vicky

elmo555 December 7, 2017 09:45

1 Attachment(s)
Quote:

Originally Posted by Vignesh2508 (Post 634269)
But it resulted in a mesh which looks pretty bad.

To view the inside of the mesh, I'd recommend you to clip it (instead of slicing), and then tick "crinkle clip". This way, cells that would be sliced will be displayed in 3D. Have a look the attached screenshot for an example.

Attachment 60065


All times are GMT -4. The time now is 10:15.