CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Mesh Quality Dict and Layer Addition (https://www.cfd-online.com/Forums/openfoam/252729-mesh-quality-dict-layer-addition.html)

enrin November 1, 2023 15:34

Mesh Quality Dict and Layer Addition
 
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

Yann November 2, 2023 04:57

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

enrin November 3, 2023 06:22

Quote:

Originally Posted by Yann (Post 859342)
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. :)


All times are GMT -4. The time now is 00:41.