Skip to content

Reapply GK passive advection work (PR #1084) - #1102

Merged
Antoinehoff merged 20 commits into
mainfrom
restore_gk_passive_1084
Sep 2, 2026
Merged

Reapply GK passive advection work (PR #1084)#1102
Antoinehoff merged 20 commits into
mainfrom
restore_gk_passive_1084

Conversation

@Antoinehoff

@Antoinehoff Antoinehoff commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

This reverts commit dbc4aba that cancelled PR #1084. My mistake sorry...
This was done by cherry picking the commits that were removed. This should preserve authorship AND git blame. This dark magit was done with Claude opus 5.

We also put back #1095 that was also removed.

@Antoinehoff
Antoinehoff marked this pull request as ready for review September 1, 2026 14:31
manauref and others added 20 commits September 1, 2026 15:25
… given in the input file. Add sample regression test (gkylcas 16cfe76398a327fa8617ed162509585f0c6c6f47).

(cherry picked from commit 771c19a)
…up. We should make it so that omega_H is only computed if the field evolves. Passive eqn object is clearly not ready as the result is not as expected.

(cherry picked from commit 1056915)
…x2v passive advection reg test. Tried using TS BCs in passive advection but I think there's a memory bug, need to switch to cluster with valgrind.

(cherry picked from commit 9aff987)
…oken its use in bc_twistshift. Also, I think there was a bug in find_cell all along, though I don't know if it was ever triggered. Fix this bug, and adjust a tolerance in twistshift to make it work with the recently added epsilon in rect_grid_find_cell. Unit tests pass. There's still an issue with passive advection using TS BCs because the solution quickly becomes NaNs.

(cherry picked from commit b3601fd)
… show that the shift at the lower boundary is OK, but the shift at the upper boundary (which -1 times the lower shift) produces NaNs.

(cherry picked from commit fa5ca03)
… integrals of bc_twistshift, it was causing NaNs in the fig14 scenario. Fix boundary kernel selection in gk_collisionless_passive_flux. Now the passive advection test with TS BCs looks as expected.

(cherry picked from commit 965ca1a)
…uadratic q has issues near the upper radial boundary. We'll examine this in a unit test setting, and try it with TCV geo.

(cherry picked from commit 5af001f)
… delete or simplify this in the future, but it already reproduces the checkerboard pattern seen in the simulation.

(cherry picked from commit ce9b41d)
…in the shift across a single cell is equal or greater to the length of the domain along y. I tried to add support for this sort of scenario but didn't succeed. I'll try again in the future. For now we must increase resolution along y, reduce shear or increase Ly so this doesn't happen. Add accepted results to CBC unit test.

(cherry picked from commit 9473d77)
…n TS BC updater. The previous approach looked in periodic copies of the domain independently for each point, but this could give different periodic copies for 2-4 points that are meant to define a subcell integral, leading to error. So now we look for the correct periodic copy only once (for a given donor-target pair) and pass that to be used for looking for intersections. This fixes some checkerboarding seen in the CBC geo with Nx cells. All other unit tests continue to pass (I had to generate new cbc accepted results, but I confirmed visually that for Nx=32 the difference was machine precision.

(cherry picked from commit f4a9122)
…eger. This explains a mysterious shift we were seeing when structures crossed the IMP.

(cherry picked from commit c289cd3)
…ew, so we can call it from python.

(cherry picked from commit b6cac76)
…ddress, this makes it easier to call it from python. Rename num_cell_ variables in tcv reg tests so that they use Nx like all other reg tests (makes it easier to automate changes to them).

(cherry picked from commit ce4c128)
…ased in its local scope.

(cherry picked from commit 7545225)
…n't run at too low a res because of constraints on TS BCs. Increase tolerance in unit test to 1e-8 so it passes on Perlmutter.

(cherry picked from commit 4ebcbc8)
…compilers/libraries being used/linked.

(cherry picked from commit 520e8b7)
@Antoinehoff
Antoinehoff force-pushed the restore_gk_passive_1084 branch from fd4b8c8 to 3933c44 Compare September 1, 2026 19:34

@Maxwell-Rosen Maxwell-Rosen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Antoine explained this to me. It seems he accidently reverted these commits in a branch and they were intended to be merged.

@Antoinehoff

Copy link
Copy Markdown
Collaborator Author

Yes, let's just wait for @manauref because its his work I messed up with 😬

@Antoinehoff
Antoinehoff merged commit c6be0d5 into main Sep 2, 2026
1 check passed
@Antoinehoff
Antoinehoff deleted the restore_gk_passive_1084 branch September 2, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants