Skip to content

Complete OpenPOPCON Refactor#1

Merged
matt-pharr merged 33 commits intomainfrom
OpenPOPCON-Refactor
Aug 7, 2024
Merged

Complete OpenPOPCON Refactor#1
matt-pharr merged 33 commits intomainfrom
OpenPOPCON-Refactor

Conversation

@matt-pharr
Copy link
Collaborator

@matt-pharr matt-pharr commented Jul 10, 2024

Through the MANTA project, many updates were made to OpenPOPCON that make working with negative triangularity, as well as doing scans and tokamak scoping in general, quite more efficient/effective. These changes are somewhat disparate and sprawling across several different branches on the old repository. Therefore, I am working on a complete refactor of OpenPOPCON. By doing this, I plan to:

  • Rewrite all difficult to read code
  • Make all helper functions compatible with numba for just-in-time compile
  • Add quality of life items like dependency files
  • Eliminate the omfit-classes dependency
  • Add paper or book citations for all formulas
  • Consolidating all code into a main library, a support library, and a run script
  • Consolidating all features added in the past two years into one library with sensible settings so that no editing of the main codebase will be necessary to do flexible scoping
  • Revamped plotting interface with external options
  • Simple and encouraged interface for saving and loading the POPCON object as a result, along with all plots, and input files as a reference
  • Keep everything very pythonic

New features added by MANTA team members include:

  • Reading gEQDSK files for calculating flux surface volumes
  • Using input kinetic profiles instead of assumed parabolic profiles
  • Arbitrary impurity cocktails
  • User-defined scaling laws + H98/89 plotting
  • Constraining wall thickness and B_coil instead of B_0
  • Setting target Z_eff instead of impurities
  • Setting q instead of I_P
  • Using q profile from gEQDSK instead of 0D estimate
  • Saving and loading outputs
  • Important Bug fixes

The above items I intend to have completed by EOD July 31 for use in Columbia's new reactor design course.

Additional items I am considering implementing include:

  • Use of a multithreading library to run many of the (usually 40x40) grid points simultaneously
  • Writing a new guide
  • Try to make Jupyter friendly
  • Arbitrary fuel mixtures (including D-D for non-reactor tokamaks)

I will post commits here as I work on this project. Feel free to provide feedback, and I hope to request a merge sometime late this month after I post regression tests.

@matt-pharr matt-pharr self-assigned this Jul 10, 2024
@matt-pharr matt-pharr closed this Jul 10, 2024
@matt-pharr matt-pharr reopened this Jul 10, 2024
@matt-pharr
Copy link
Collaborator Author

Re: Close and reopen, it seems we are not eligible for draft pull requests as this is a private repository.

@matt-pharr matt-pharr force-pushed the OpenPOPCON-Refactor branch from 6d36666 to 4785e46 Compare July 17, 2024 22:05
class POPCON_settings:
"""
Settings for the POPCON.
"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This needs to be rewritten to reflect the latest settings. Also need to create a .yaml file for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will write documentation next pull request

@matt-pharr
Copy link
Collaborator Author

OpenPOPCON 2.0 beta is ready to merge! Will open issues for remaining improvements.

@matt-pharr matt-pharr merged commit c0c8551 into main Aug 7, 2024
@matt-pharr matt-pharr deleted the OpenPOPCON-Refactor branch August 7, 2024 04:32
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.

1 participant