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

Spurious currents created across coarse-fine boundary from hydrostatic pressure near air-water interface #1200

Open
4 of 13 tasks
mbkuhn opened this issue Aug 16, 2024 · 5 comments
Labels
bug:amr-wind Something isn't working

Comments

@mbkuhn
Copy link
Contributor

mbkuhn commented Aug 16, 2024

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:

  1. Compiler used
    • GCC
    • LLVM
    • oneapi (Intel)
    • nvcc (NVIDIA)
    • rocm (AMD)
    • with MPI
    • other: apple-clang
  2. Operating system
    • Linux
    • OSX
    • Windows
    • other (do tell ;)):
  3. Hardware:
    • CPU
    • GPU
  4. Machine details ():
basic amr-wind environment created using exawind-manager on my laptop
  1. Input file attachments
  2. Error (paste or attach):
<!-- error output -->
  1. If this is a segfault, a stack trace from a debug build (paste or attach):
<!-- stack trace -->

Expected behavior

Velocities to remain near 0.

AMR-Wind information

not a problem with a particular commit

==============================================================================
                AMR-Wind (https://github.com/exawind/amr-wind)

  AMR-Wind version :: v2.1.0-85-g741cb771
  AMR-Wind Git SHA :: 741cb77111da01fe7026512f0a0cfdb3b9072398
  AMReX version    :: 24.08-11-gb6ed5237987e

  Exec. time       :: Fri Aug 16 10:52:33 2024
  Build time       :: Aug 16 2024 10:51:55
  C++ compiler     :: AppleClang 14.0.3.14030022

  MPI              :: ON    (Num. ranks = 8)
  GPU              :: OFF
  OpenMP           :: OFF

  Enabled third-party libraries: 
    NetCDF    4.9.2
    HYPRE     2.31.0

           This software is released under the BSD 3-clause license.           
 See https://github.com/Exawind/amr-wind/blob/development/LICENSE for details. 
------------------------------------------------------------------------------

Additional context

see comments

@mbkuhn mbkuhn added the bug:amr-wind Something isn't working label Aug 16, 2024
@mbkuhn
Copy link
Contributor Author

mbkuhn commented Aug 16, 2024

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.
Screenshot 2024-08-16 at 11 05 02 AM
After 1 timestep, spurious currents show up near the interface
Screenshot 2024-08-16 at 10 54 30 AM
These occur alongside pressure gradient changes that also shouldn't be there
Screenshot 2024-08-16 at 10 53 13 AM
Screenshot 2024-08-16 at 10 52 59 AM

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Aug 16, 2024

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.

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Aug 16, 2024

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.

Copy link

This issue is stale because it has been open 30 days with no activity.

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Nov 14, 2024

this paper seems to address the problem directly: https://www.sciencedirect.com/science/article/pii/S0021999124007332#sec0003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:amr-wind Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant