Skip to content

Add check for Flux conservation#45

Closed
dschwoerer wants to merge 28 commits intomasterfrom
more-6-check-flux
Closed

Add check for Flux conservation#45
dschwoerer wants to merge 28 commits intomasterfrom
more-6-check-flux

Conversation

@dschwoerer
Copy link
Copy Markdown
Collaborator

This adds a check that B*J/sqrt(g_22) stays constant along the traced flux tube.

@dschwoerer dschwoerer requested a review from ZedThree October 22, 2025 09:46
@ZedThree
Copy link
Copy Markdown
Member

Probably useful to have an input option for the tolerance on this to automatically fail if it's too large.

The plotting should also be user controllable, rather than unconditional

@dschwoerer
Copy link
Copy Markdown
Collaborator Author

I have removed the plotting, and only print the error. I do not see how we manage to get this reliably small enough without some fudging, which I think is probably better done in BOUT++, to ensure things are consistent. Maybe we should completely remove the check, i.e. not add this PR.

Other things in this PR:

  • EMC3 field + FieldTracing
  • Add check for swapping inner and outer RZline (causes perfectly valid grids, but then the normal input files are not-matching)
  • Add check for finite data for stored data
  • store parallel magnetic field - this is needed for parallel derivatives to replace the current, problematic method using parallel metric coefficients or rather fudging them up to match the value based on B.

@ZedThree I can separate them, if you think that makes sense.

@ZedThree
Copy link
Copy Markdown
Member

Yes please, smaller PRs are just easier to look over :)

Base automatically changed from more-6 to master November 24, 2025 11:30
@dschwoerer
Copy link
Copy Markdown
Collaborator Author

Splitted up 🎉
There should be only one merge conflict between #49 and #48 - but that should be trivial.

@dschwoerer dschwoerer closed this Nov 24, 2025
@dschwoerer dschwoerer deleted the more-6-check-flux branch December 2, 2025 09:31
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.

2 participants