parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
105 stars 33 forks source link

VariableFluxPack for Face fields in 2D #1082

Closed acreyes closed 1 month ago

acreyes commented 1 month ago

When making a VariableFluxPack only the flux components up to the dimension of the mesh are filled. In 2D, for Metadata::Face fields I would expect the only edge flux that matters would be the X3DIR component.

This could be fixed by checking v->IsSet(Metadata::Edge) in FillFluxViews.

If this aligns with expected behavior I'm happy to open a PR to address it. I have a field loop advection example working in 2D/3D with this fix that may also be of interest. It solves the induction equation with a constant velocity field using constrained transport and divergence free prolongation from Balsara's method.

fieldloop0001 fieldloop0000

PS this library has been exceptional to work with, big thanks for all the hard work that has gone into this!

lroberts36 commented 1 month ago

@acreyes: Thanks for pointing that out. I agree that having access to the X3 edges in 2D is the desired behavior and it would be great to have a PR fixing the current behavior. The ability to define non-cell centered variables Metadata::WithFluxes is new in the last couple of weeks, so it is very possible that there are other kinks that will need to be worked out.

Glad to hear that you are enjoying Parthenon and the loop tests look good.