AMReX-Fluids / AMReX-Hydro

AMReX-based hydro routines
https://amrex-fluids.github.io/amrex-hydro/docs_html
Other
13 stars 25 forks source link

Inflow at an angle with BDS #95

Closed marchdf closed 1 year ago

marchdf commented 2 years ago

Hi all,

I am observing the following in amr-wind with BDS and @esclapez is seeing the same in Pele, which is why I think this is a problem with the BDS implementation in AMReX-Hydro and not a problem with our codes/BCs.

Description of the problem:

We see corner effects that are not there with PPM/PLM. The flow should be constant everywhere but it is not and we see artifacts at the corners:

Screen Shot 2022-08-30 at 14 40 17

Lucas reports that it looks fine in 2D but not 3D in Pele.

ajnonaka commented 2 years ago

In IAMR/Exec/run3d I set up this same case (but with vel=(1,1,0)) and tested with this inputs file: https://github.com/ajnonaka/IAMR/blob/bds_diagonal/Exec/run3d/regtest.3d.traceradvect_bds You'll see there a Godunov_PPM and BDS option. The runs both give the same correct result (the velocity gets knocked off (1,1,0) in the 12th digit only in both options). I believe the BDS is being invoked because the plotfiles do diff differently (10^-27 in velocity, 10^-5 in the tracer). Is there an easy way to provide a broken setup?

marchdf commented 2 years ago

Thanks for helping us out @ajnonaka. I can provide an input file for amr-wind: freestream_godunov.inp.txt You can just build amr-wind and run the resulting executable on that.

But given the similarities of IAMR and PeleLM(eX) maybe it's best/easier for you to start there? @esclapez would have an input file for that.

ajnonaka commented 1 year ago

Ann and I were unable to reproduce this problem with IAMR. If somebody has an example they can point to (IAMR, PeleLM, amr-wind, etc.) please re-open the issue and provide details. @marchdf I was told to hold off on your amr-wind example for now, unless there have been developments since.

marchdf commented 1 year ago

Writing this for posterity.

After much digging around and comparisons between IAMR and amr-wind, I came to the conclusion (later verified through a conversation with @cgilet) that amr-wind was missing an assumption that the BDS code made. Namely, BDS assumes that umac has 1 filled ghost cell. IAMR and incflo both have a version of create_umac_grown that takes care of physical BCs. amr-wind wasn't doing this. I tried manually filling the umac ghost with what I expected and the corner issue goes away. My next task is to replace with an actual fillpatch (a-la IAMR/incflo) and I expect things to work after that.

@cgilet pointed out that missing this functionality for Godunov might be a problem in multilevel simulations but might only be visible in certain cases. TBD...