Near-wall particle tracking error when the contaning cell is unrefined
Summary
The error presents itself when using Adaptive Mesh Refinement along with Lagrangian particles. While 10787d7e fixes this problem for internal cells, this is not the case for cells with boundary faces. I have included two separate (but likely related) issues.
Issue 1 (isolated in the attached test case): Error message: Cell not found for particle position XXXXX. The error appears when a level 1 (or higher) cell containing a particle is unrefined. For the error to appear, the following must happen:
- the cell is part of a wall boundary.
- the cell has arcs between its boundary vertexes.
- the particle is close to the wall boundary.
The attached image below can give you an idea of the problem (figures to the left are before unrefinement). My guess is that when a cell with non-orthogonality > 0 is refined, the normal vectors of the newly obtained boundary faces are not equal to the normal vector to the boundary face of the original boundary face of the 0-level cell. Therefore, when the cell is unrefined, the particle is slightly outside of it, even when the sagitta of the arc tends to zero (almost as a straight line).
Steps to reproduce Issue 1:
The test case is attached here: aachenBomb.zip
- Create the mesh "blockMesh"
- run "sprayDyMFoam".
- The case will stop at time = 0.2. After it stops, open the controlDict and extend the endTime to 0.3. Also, open dynamicMeshDict and modify the lowerRefineLevel // unrefineLevel values to unrefine all cells.
- Run again sprayDyMFoam. If you want to test different arc configurations, I have left some ready in the blockMeshDict file.
Possible fixes
The main source of the way the mesh cutter/splitter algorithm works. However, I suppose an easier fix is repositioning the error particle to the nearest cell and leaving it near the wall. It would not be a perfect solution since we would be ignoring the position of the particle with respect to the wall before refinement. However, saving such information would imply the creation of barycentric coordinates for each refinement point.
Issue 2: Particle mapped to a location outside of the mesh (line 1232 of the modified particle.C file 10787d7e). This error is presented in a level 0-cell with boundary faces after the unrefinement process. It must be clarified that the error-reporting cell was not unrefined because it was already level 0. Therefore, when other cells are unrefined, the error-reporting cell incorrectly maps its containing particle to itself. As it can be seen, the particle is very close to the wall. See attached figure. The cell has a large aspect ratio.
I will work on producing a basic test case for this issue, as the error was presented in a relatively complex blockMeshDict geometry and not in the one that I have attached.