Repository navigation
🐛 Fix core-edge rad split - #4665
chris-ashe wants to merge 25 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4665 +/- ##
==========================================
- Coverage 49.96% 49.91% -0.06%
==========================================
Files 151 151
Lines 30127 30178 +51
==========================================
+ Hits 15054 15063 +9
- Misses 15073 15115 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
394df47 to
ba19cc7
Compare
grmtrkngtn
left a comment
There was a problem hiding this comment.
The modelling changes here have been well discussed on #4536, and are fairly straightforward corrections to mistakes in the code. The implementation here looks good with updated variable names particularly useful to avoid future confusion!
timothy-nunn
left a comment
There was a problem hiding this comment.
Just a few code quality comments. Happy with code changes if Graeme agrees with the model changes.
There was a problem hiding this comment.
Need these two mappings too
p_plasma_inner_rad_mw -> p_plasma_core_rad_reduced_mw
p_plasma_outer_rad_mw -> p_plasma_edge_rad_mw
There was a problem hiding this comment.
im just wondering if the original entries of these in obsolete vars is wrong as neither of these are input variables
There was a problem hiding this comment.
Oh it will be incorrect then if they cannot be input anymore then they should map to None
…rray and correcting profile reference
…on_loss_profiles and update its functionality to compute plasma volume averaged power density for impurity profiles
…edge_profiles and update its functionality to compute impurity radiation for core and edge profiles
…_radiation_loss_profiles for clarity and efficiency
… power density variables
…te total radiation consistency
…nsity variables and improve documentation
… for consistency across modules
…sistency and update related calculations across models
…` for consistency and update related calculations in radiation power modules
…ncy across models and update related calculations
…sModel` and update related calculations in the confinement time model for consistency
…er and update documentation
…e related calculations across multiple modules for consistency
…volume averaged radiation calculations
2a6566f to
5d665e0
Compare
This pull request standardizes and clarifies the naming and handling of plasma radiation variables throughout the codebase, with a focus on distinguishing "reduced core" and "edge" radiation power and their volume-averaged forms. It updates variable names, docstrings, and logic to consistently use the new terminology, and refactors related model logic and outputs to match. These changes improve code clarity and maintainability, especially regarding how radiation losses are modeled and reported.
Spin out of and will close #4536
🐛 Bugs FIxes
Variable Renaming and Standardization
Anoyingly the value for the reduced core impurity radiation was being passed around as
p_plasma_inner_rad_mw, I have renamed this to ``p_plasma_core_rad_reduced_mwin-situ and then created a newp_plasma_core_rad_mw` which represents the full power.p_plasma_inner_rad_mw->p_plasma_core_rad_reduced_mwpden_plasma_core_rad_mw->pden_plasma_core_rad_reduced_vol_avg_mwp_plasma_outer_rad_mw->p_plasma_edge_rad_mwpden_plasma_outer_rad_mw->pden_plasma_edge_rad_vol_avg_mwpden_plasma_rad_mw->pden_plasma_rad_vol_avg_mwpden_plasma_sync_mw->pden_plasma_sync_vol_avg_mwp_plasma_inner_rad_mwtop_plasma_core_rad_reduced_mwandp_plasma_outer_rad_mwtop_plasma_edge_rad_mwthroughout the codebase for clarity.pden_plasma_core_rad_mwwithpden_plasma_core_rad_reduced_vol_avg_mw, andpden_plasma_rad_mwwithpden_plasma_rad_vol_avg_mw.Model and Logic Updates
confinement_time.pyandconstraints.pyto use the new reduced core and volume-averaged variables, ensuring calculations and outputs reflect the updated model.ConfinementRadiationLossModelenum and related logic to renameCORE_ONLYtoREDUCED_CORE_ONLY, reflecting the new terminology.Data Structure and IO Changes
PhysicsDataclass to add new variables for reduced core and edge radiation (both total and volume-averaged), and deprecated or clarified old ones.Imports and Minor Refactoring
scipy.integrate) and added a new import forcalculate_vol_avg_of_profileinimpurity_radiation.py.These changes collectively improve the clarity, maintainability, and correctness of how plasma radiation power is represented and used throughout the codebase.
✍🏻 Output updates
New
Old
Checklist
I confirm that I have completed the following checks: