code-saturne / code_saturne

code_saturne public mirror
https://www.code-saturne.org
GNU General Public License v2.0
223 stars 82 forks source link

Issues when creating wall layers with user coding #7

Closed nicolastonello closed 5 years ago

nicolastonello commented 6 years ago

Depending on the geometry and the settings, the wall layer algorithm can create interpenetrating cells, resulting in meshes unsuitable for calculations.

YvanFournier commented 6 years ago

To avoid this, computing a local hydraulic diameter should allow setting a limit on the extrusion distance, and is expected to solve this.

YvanFournier commented 5 years ago

Issue as analyzed on a small mesh

For example, given the following mesh (viewed as a cut in "crinkly" mode:

bl_limit_ref

Inserting 2 layers with a relative thickness (and expansion factor 0.8) leads to the following issue:

bl_limit_r_pb

Viewed in from another angle with transparency and negative-volume cells in red:

bl_limit_r_pb_t

Using a fixed thickness of 0.05, results are even worse on this case:

bl_limit_f_pb bl_limit_f_pb_t

Proposed solution

A solution (commit 726394e76) is to test for negative volumes while deforming the mesh, and locally limit the extrusion on adjacent boundaries (removing one extrusion layer at vertices of those cells). This is done iteratively until no negative volume cells are produced.

This method also allows flattening cells beyond a given threshold relative to their initial volume.

Using a volume ratio limit of 0.15, we obtain the following mesh using the relative boundary layer thickness:

bl_limit_r_ok

With the fixed thickness:

bl_limit_f_ok

Using a negative minimum volume factor, no limiter is used, and we revert to the previous behavior.