Closed AstroBarker closed 7 months ago
re: tests failing, I had some old testing code in radiation_advection
and radiation_equilibration
problems that didn't work with tracers disabled. I've just reverted those files to pre-tracers, and will put tracers in the fluid advection problem.
Some updates:
- u^0 h - 1
to tracer output.In the advection test, relative errors on tracer positions was ~ 1e-14 or lower after one period. I also ran a 3D, non-magnetized torus to see tracer orbits (notes: below only goes to t=500.. longer is running. And this was before the upgrade to RK2)
Looks awesome! When do you think you'll be ready to remove the WIP markings? :)
One last change: I've moved the FillTracers
call from PostFillDerivedBlock
into UserWorkBeforeOutput
. To accommodate this, I created phoebus::UserWorkBeforeOutput
in the driver and registered it in main. At present it just unpacks MeshBlockData
and calls FillTracers
, but it could accommodate extension in the future. Should cut down on unnecessary work. Let me know how this bit looks @Yurlungur.
(Also fixed something I forgot to commit in the torus init..).
Actually @AstroBarker before merge, please correct the missing metric factor in the volumes in the torus calculation.
Since @brryan never had a chance to look. I'm going to click the button. Ben whenever you get the chance, I'd still like your thoughts.
Also thanks for all your hard work on this @AstroBarker !
I believe that the tracer treatment is now mature enough to have more eyes on it. It's a pretty big PR and has been awhile coming, so interact in whatever level you feel.
Summary
Here I add tracer particle support in phoebus. We create a tracer package that, if enabled, registers the appropriate swarm variables. See
src/tracers/tracers.cpp
. At present, the tracers are coupled in first order operator split, though in the future I'd like to explore improving this, after some phoebus task list refactoring. Tracers are advected inAdvectTracers(...)
, interpolating the appropriate quantities to the tracer positions and then pushing (with RK2). The "filling" of the tracers is handled inFillTracers
registered withUserWorkBeforeOutput
. To enable this, I addedphoebus::UserWorkBeforeOutput
to the driver. It's a lot of quantities.. and may desire to shorten later, or otherwise make what is stored runtime modular?To deal with black hole accretion, when FMKS geometry is enabled, we use
PurgeParticles
insrc/fixup/fixup_particles.cpp
If FMKS is not enabled, theconstexpr if
resolves to a no op. In principle, here, future "purge particles if.." conditions can be supplied.At present, I have implemented tracers in the
torus
andadvection
pgens. The advection test yields relative errors on tracer positions of ~ 1e-14 after one period. Tracer orbits in a non-magnetized torus work as desired.To run with tracers (when the pgen supports it), simply
TODO:
cc: @bprather