CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Mesh Quality Dict and Layer Addition

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By enrin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2023, 16:34
Default Mesh Quality Dict and Layer Addition
  #1
New Member
 
Join Date: Jul 2023
Posts: 15
Rep Power: 3
enrin is on a distinguished road
Dear all,

I have a question concerning a topic that has been discussed a lot over the years. However, I was not able to find a complete answer to my doubts.

I have meshed a region of space using SHM and I have already simulated the flow behavior with an easy test case. The results are rough but satisfying. Then, I decided to add the layers to my mesh to simulate the boundary layer close to the object.
Firstly, I added the layers and nothing happened. Then, after a bit of deeper research I have found out in this blog that, "deactivating" the mesh controls, the added layers should appear. And it works!
By the way, this fact added (if possible) more confusion to me and, hence, I have several questions that I'm trying to summarize in some focal points here:

1) The fact that the layer addition, in my case, doesn't work with the "default mesh controls" means that my mesh is bad?

2) Why there are controls that impact more than others into the layer addition? Is it because my mesh is bad or is it because some parameters are "intrinsically less prone" than others to the layer addition?
(In my case the parameters that change the most the output of the boundary layer are: maxNonOrtho, minTetQuality and minTwist)

3) If the answer to 2) is the first one, how can I improve the quality of my mesh?

4) If the answer to 2) is the second one, do I have to use two separate SHM&qualityMesh dictionaries one for the snapping of the mesh and the other one for the layer addition?
In this second case, am I allowed to change the mesh control parameters deactivating them? Or is it a risky gamble that can change the physics and the results of the problem?

I am sorry if this thread is confusing but so I am. I have done my best to explain myself in the best way possible. If needed, I can add whatever content that can explain the problem better.
In the end, I think that my question can be summarized in the following one: "Which one is the correct procedure to set up a good (and physical) layer addition?"

Many thanks in advance to everyone that try to answer my question and to clarify my doubts.

Kind regards,
Enrin
enrin is offline   Reply With Quote

Old   November 2, 2023, 05:57
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Enrin,

I will try to give some insights, I hope others will also do the same.
  1. It means snappy cannot find a way to insert layers while respecting the mesh quality criteria. This can be due to a lot of things: complex geometry, bad layer definition... Without having a bad mesh, some things can help or make the job harder for snappy. Layer addition is probably the biggest weakness of snappyHexMesh.
  2. Two things happen during layer addition: snappy has to move the existing mesh away from the surface, which means morphing the mesh. This can lead to mesh quality issues. The inserted cells are based on the faces at the surface, and this can also lead to mesh quality issues depending on the faces shapes and the layer cells thicknesses. Some mesh quality criteria are more important than others and more prone to be not satisfied.
  3. Having a uniform refinement level on a surface usually helps for layer addition (snappy often struggles to insert layers around transitions zones between refinement levels). Mesh refinement around your object can also have an influence (it can makes the mesh morphing easier or harder)
  4. You can change mesh quality controls, but it will obviously have an influence on your mesh. Skewness errors are often not a big problem, but non-orthogonality errors can cause serious stability issues. Those choices are up to you and depends on your application and goals.

Additional advice: activate writeFlags at the end of snappyHexMeshDict to write fields to visualize cell levels and layer coverage:

Code:
writeFlags
(
    scalarLevels    // write volScalarField with cellLevel for postprocessing
    layerFields     // write volScalarField for layer coverage
);

Cheers,
Yann
AtoHM likes this.
Yann is offline   Reply With Quote

Old   November 3, 2023, 07:22
Default
  #3
New Member
 
Join Date: Jul 2023
Posts: 15
Rep Power: 3
enrin is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Enrin,

I will try to give some insights, I hope others will also do the same.
  1. It means snappy cannot find a way to insert layers while respecting the mesh quality criteria. This can be due to a lot of things: complex geometry, bad layer definition... Without having a bad mesh, some things can help or make the job harder for snappy. Layer addition is probably the biggest weakness of snappyHexMesh.
  2. Two things happen during layer addition: snappy has to move the existing mesh away from the surface, which means morphing the mesh. This can lead to mesh quality issues. The inserted cells are based on the faces at the surface, and this can also lead to mesh quality issues depending on the faces shapes and the layer cells thicknesses. Some mesh quality criteria are more important than others and more prone to be not satisfied.
  3. Having a uniform refinement level on a surface usually helps for layer addition (snappy often struggles to insert layers around transitions zones between refinement levels). Mesh refinement around your object can also have an influence (it can makes the mesh morphing easier or harder)
  4. You can change mesh quality controls, but it will obviously have an influence on your mesh. Skewness errors are often not a big problem, but non-orthogonality errors can cause serious stability issues. Those choices are up to you and depends on your application and goals.

Additional advice: activate writeFlags at the end of snappyHexMeshDict to write fields to visualize cell levels and layer coverage:

Code:
writeFlags
(
    scalarLevels    // write volScalarField with cellLevel for postprocessing
    layerFields     // write volScalarField for layer coverage
);
Cheers,
Yann
Thank you very much Yann. Now I know a little bit more on the layer addition. I think that is still a long way to go for me before to reach a good mesh with the boundary layer, but you gave me some precious advice.
Yann likes this.
enrin is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] No generation of layer onto zerothickness surface crubio.abujas OpenFOAM Meshing & Mesh Conversion 3 October 25, 2022 04:20
[snappyHexMesh] High quality mesh for wind in complex urban environment ziboaa OpenFOAM Meshing & Mesh Conversion 1 January 12, 2021 16:33
[snappyHexMesh] Multi Region Mesh of a car filter Zephiro88 OpenFOAM Meshing & Mesh Conversion 3 September 11, 2019 20:34
[snappyHexMesh] SHM problem : KVLCC2 with appendage mesh sc.park OpenFOAM Meshing & Mesh Conversion 1 March 13, 2016 14:28
[snappyHexMesh] Collapsing Layers Tim_Simon OpenFOAM Meshing & Mesh Conversion 5 August 2, 2015 23:51


All times are GMT -4. The time now is 21:27.