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

Reverse-Mode Differentiable Ideal-Ballooning Stability Solver #1170

Merged
merged 272 commits into from
Sep 27, 2024

Conversation

rahulgaur104
Copy link
Collaborator

@rahulgaur104 rahulgaur104 commented Aug 8, 2024

Infinite-n ideal MHD ballooning modes are of significant interest to both the tokamak and the stellarator community.
These instabilities are also related to smaller-scale kinetic instabilities, which cause significant heat loss from fusion reactors.
This commit adds the ability to both analyze and optimize MHD equilibria against the ideal ballooning mode.

An adjoint implementation of an ideal ballooning solver has only been successfully demonstrated previously on a much smaller scale. If this commit works, it would be at least an order of magnitude faster than the linked code.

Here are the tasks:

  • Add geometry coefficients
  • Test geometric coefficients. Maybe compare it with Patrick's fork in DESC. Add a test
  • Compare results with each other (ideal_ball_gamma1, ideal_ball_gamma2, Newcomb_metric) and with my older finite-difference solver
  • Eigendecomposition and adjoint of the matrices. Wrap the routine in DESC magic.
  • Compare results for the HELIOTRON case with COBRAVMEC
  • Write a test for HELIOTRON comparison with COBRAVMEC
  • Write a test for the Newcomb metric
  • Add a tutorial notebook explaining ideal ballooning and Newcomb calculations

rahulgaur104 and others added 30 commits September 30, 2023 11:20
unalmis
unalmis previously approved these changes Sep 25, 2024
unalmis
unalmis previously approved these changes Sep 25, 2024
unalmis
unalmis previously approved these changes Sep 25, 2024
Copy link
Collaborator

@dpanici dpanici left a comment

Choose a reason for hiding this comment

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

some very small changes. I will review again once re-requested

CHANGELOG.md Outdated Show resolved Hide resolved
desc/objectives/_stability.py Show resolved Hide resolved
desc/objectives/_stability.py Show resolved Hide resolved
desc/objectives/_stability.py Show resolved Hide resolved
nturns=3,
nzetaperturn=200,
zeta0=None,
lam0=0.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I second this, it would also match the paper notation better

desc/objectives/_stability.py Outdated Show resolved Hide resolved
tests/test_stability_funs.py Show resolved Hide resolved
tests/test_stability_funs.py Outdated Show resolved Hide resolved
tests/test_stability_funs.py Show resolved Hide resolved
unalmis
unalmis previously approved these changes Sep 26, 2024
@rahulgaur104
Copy link
Collaborator Author

Merging this branch as I have two approvals.

@rahulgaur104 rahulgaur104 merged commit 32e4197 into master Sep 27, 2024
24 checks passed
@rahulgaur104 rahulgaur104 deleted the rg/adjoint_ballooning branch September 27, 2024 00:05
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.

5 participants