Open mbkuhn opened 3 months ago
In this test case, the interface is placed 1 fine cell below z=0 and 0.5 coarse cell below z = 0, leading to the density distribution shown.
After 1 timestep, spurious currents show up near the interface
These occur alongside pressure gradient changes that also shouldn't be there
I went a bit deeper to isolate the problem more. It's not a problem with the fillpatch operations, changing them has no effect.
With this case beginning at rest, the only active term in the first time step is the gravity forcing. To simplify things a bit, I set the mac velocities to 0 to avoid having to look at both projections and to zero out the advection term. Diffusion is also inactive. After the explicit terms are added (rhs op), which includes the gravity term, the velocity fields are entirely uniform, with u = v = 0 and w = -g * dt. Then the algorithm goes to the projection. I also output the RHS of the projection, and the only nonzero divergence in the domain is at the top and bottom walls (as expected). After the nodal projection solve, the spurious currents arise. This has to do with how sigma is handled/interpolated across coarse-fine boundaries because, as mentioned in the description, if the interface is at z = 0, there is no problem, or if the density is uniform, there is no problem.
It's difficult to say much about the long-term behavior of the spurious velocities because the pressure solver really struggles with this case (and maybe multi-level hypre needs to be applied here). However, after 10 timesteps the convective CFL has risen about 5x compared to the first time step.
This issue is stale because it has been open 30 days with no activity.
this paper seems to address the problem directly: https://www.sciencedirect.com/science/article/pii/S0021999124007332#sec0003
Bug description
When the air-water interface crosses a coarse-fine boundary, a flat, quiescent interface leads to spurious velocities. This is likely due to the discretization of the pressure equation in amrex (MLMG), in particular its interpolation of sigma (1/rho). More detail will be in comments below. No spuriousness arises when the interface is perfectly aligned with the cell boundaries (because then there is no gradient of density) and likewise when the density ratio between phases is unity.
Steps to reproduce
Simple case that can be run in serial, only needs one time step to show up. flat-surface-inp.txt
Steps to reproduce the behavior:
Expected behavior
Velocities to remain near 0.
AMR-Wind information
not a problem with a particular commit
Additional context
see comments