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

slight face-centered velocity inconsistency when AMR subcycling #902

Open
BenWibking opened this issue Feb 23, 2025 · 0 comments
Open

slight face-centered velocity inconsistency when AMR subcycling #902

BenWibking opened this issue Feb 23, 2025 · 0 comments
Labels

Comments

@BenWibking
Copy link
Collaborator

BenWibking commented Feb 23, 2025

Describe the bug
The face-centered velocity is inconsistent by a half-timestep at the coarse-fine boundary when doing AMR subcycling. (This is because the face-centered velocity values are averaged over the timestep, but the AMR interpolator assumes they are at the end of the timestep, and they are interpolated from the coarser level onto the finer level at a different time.)

This causes a very slight inconsistency in the trajectories of tracer particles at the coarse-fine AMR boundary. If the face-centered velocities are also used for the MHD emf update, then there is also an inconsistency there.

Two possible fixes:

  • advect the tracer particles using the velocities at the beginning of the timestep and then advect them again at the end of the timestep (e.g., the RK2 method used in FLASH for passive tracers). This also has the advantage that the time integration can be made exactly consistent with that used for hydro. Then we never need to deal with time-centered velocity fields. However, this can't be done with the built-in AMReX tracer particle advection code.
  • change the AMR interpolation code so that it knows that the coarse-level face-centered velocities should be treated as time-centered. (This should be easy once we have add MultiFabRegister / ParticleContainerRegister classes #748 implemented.)

To Reproduce
Steps to reproduce the behavior:

  1. Run a problem with tracer particles and AMR subcycling
  2. Examine face-centered velocity field at coarse-fine interface

Additional context
This problem arises because we use the face-centered marker-and-cell (MAC) advection method from AMReX, which requires velocities that are averaged over the timestep. Most other AMReX codes use cell-centered velocities to advect the tracer particles, where this problem doesn't arise in the same way.

@BenWibking BenWibking changed the title tracer particle velocity inconsistency when AMR subcycling small tracer particle inconsistency when AMR subcycling Feb 23, 2025
@BenWibking BenWibking changed the title small tracer particle inconsistency when AMR subcycling slight tracer particle inconsistency when AMR subcycling Feb 23, 2025
@BenWibking BenWibking changed the title slight tracer particle inconsistency when AMR subcycling slight face-centered velocity inconsistency when AMR subcycling Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant