Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Coarsening of Local Mesh #13

Open
2022ZM opened this issue Oct 11, 2024 · 1 comment
Open

Incorrect Coarsening of Local Mesh #13

2022ZM opened this issue Oct 11, 2024 · 1 comment

Comments

@2022ZM
Copy link

2022ZM commented Oct 11, 2024

I discovered a bug: when using AMR/LB on a mesh that has been locally refined (refinebox), it will coarsens the local mesh. You can check the results of TScas3. However, OpenFOAM's official dynamicRefineFvMesh mechanism does not have the issue of coarsening local meshes; "It only refines or coarsens the mesh based on the field's range.

@FoamScience
Copy link
Collaborator

This somehow went under my radar for some time.

This is not a bug, it's either intended behavior, or a feature request, as I don't provide any special integration with any other refinement tool.

Explanation:

  • To track refinement/coarsening, blastAMR assigns refinement levels to cells and mesh vertices.
  • When you run the first updateMesh, the existing cells/points of the mesh are assumed to be at "level 0" unless mesh refinement history files are found (these are polyMesh/cellLevel and polyMesh/pointLevel)

so, if refineBox outputs polyMesh/cellLevel and polyMesh/pointLevel those will get picked up by blastAMR refinement routines. Otherwise, the starting mesh will be assigned a cell level of 0 everywhere.

so just remove cellLevel/pointLevel files before running the first updateMesh to get the effect you want.

It would be a feature request to "protect cell sets/zones" from refinement/coarsening, which would be nice to have but has low priority since it can be achieved easily with a coded refinement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants