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

setting eb2.small_volfrac can introduce inconsistencies in EB data #1450

Open
darylbond opened this issue Oct 13, 2020 · 2 comments
Open

setting eb2.small_volfrac can introduce inconsistencies in EB data #1450

darylbond opened this issue Oct 13, 2020 · 2 comments

Comments

@darylbond
Copy link
Contributor

In my implementation, setting eb2.small_volfrac triggered a situation where the boundary normal provided by ebfactory->getBndryNormal() did not correspond with the associated face area fractions given by ebfactory->getAreaFrac(). This lead to non-conservative flux calculation when the area fraction was used to calculate the cell divergence while the boundary flux was calculated using the provided boundary normal. This situation can obviously be avoided by calculating the boundary normal from the area fractions.

@asalmgren
Copy link
Member

Thank you for pointing this out!

PR #1451 should fix this -- if you have a chance could you check that it fixes the case you have observed?

WeiqunZhang pushed a commit that referenced this issue Oct 14, 2020
#1451)

Fix when small_volfrac is used -- we need to adjust the data in cut cell neighbors as well as regular neighbors

This addresses  issue #1450

## Checklist

The proposed changes:
- [X] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
@darylbond
Copy link
Contributor Author

darylbond commented Oct 26, 2020

I have found another inconsistency, this time between volume fraction and isCovered(). I was able to fix this by performing a check on volfrac after every call to set_eb_data such that the covered status is consistent with whatever was just calculated. However, with further testing, it appears this approach leads to floating-point errors in EB2::coarsen_from_fine() so not such a good idea after all.

Edit: removed a bunch of code that didn't work.

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