🎨 Pressure profile plot_proc#3870
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3870 +/- ##
==========================================
- Coverage 46.45% 45.46% -0.99%
==========================================
Files 123 123
Lines 28050 28875 +825
==========================================
+ Hits 13030 13129 +99
- Misses 15020 15746 +726 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
24ee174 to
1d29150
Compare
78acd11 to
b129e9f
Compare
b129e9f to
408148a
Compare
|
@chris-ashe can you fix the integration test failures please? |
…physics_variables function
…plotting functionality
dbcd067 to
3f6b0aa
Compare
|
|
||
|
|
||
| def plot_plasma_pressure_profiles(axis, mfile_data, scan): | ||
| # Plot the plasma pressure profiles on the given axis |
There was a problem hiding this comment.
Docstring with types please.
| # Plot the plasma pressure profiles on the given axis | ||
| pres_plasma_profile = [ | ||
| mfile_data.data[f"pres_plasma_electron_profile{i}"].get_scan(scan) | ||
| for i in range(500) |
There was a problem hiding this comment.
Remove hardcoded list length please.
| plot_33 = fig18.add_subplot(111, aspect="equal") | ||
| plot_main_power_flow(plot_33, m_file_data, scan, fig18) | ||
|
|
||
| plot_34 = fig19.add_subplot(122) |
There was a problem hiding this comment.
I really don't like this hardcoding of pages, plots and figures: changing anything results in a huge amount of churn. Can you make an issue to turn this into a list and tag me in it?
| "OP ", | ||
| ) | ||
|
|
||
| for i in range(len(physics_variables.pres_plasma_electron_profile)): |
There was a problem hiding this comment.
Can you document somewhere that each element of the profile is actually a separate variable at this stage, rather than an array?
| """ | ||
| # Default profile_size = 501, but it's possible to experiment with this value. | ||
| self.profile_size = 501 | ||
| physics_variables.n_plasma_profile_elements = self.profile_size |
There was a problem hiding this comment.
What is the point of this being stored on the class instance as well as an output variable? Does it need to be an output var?
There was a problem hiding this comment.
It was originally just a class variable so that it could do its own array calc withing the class. I added it as an output to standardise our profile size and so we aren't hardcoding array sizes in the plotting scripts
| pres_plasma_profile_total = [ | ||
| mfile_data.data[f"pres_plasma_total_profile{i}"].get_scan(scan) | ||
| for i in range(n_plasma_profile_elements) | ||
| ] |
There was a problem hiding this comment.
Seems like a fair bit of duplication for the 4 profiles now. Could you put all of this into a single function or loop?
| physics_variables.pres_plasma_ion_total_profile = ( | ||
| physics_variables.nd_ions_total | ||
| * (self.neprofile.profile_y / physics_variables.dene) | ||
| * (self.neprofile.profile_y / physics_variables.nd_plasma_electrons_vol_avg) |
There was a problem hiding this comment.
Please fixup this commit: rebase conflicts not resolve correctly.
| pres_plasma_fuel_profile = [] | ||
| j_plasma_on_axis = 0.0 | ||
| n_plasma_profile_elements = 0 | ||
| n_plasma_profile_elements = 500 |
There was a problem hiding this comment.
I think this is duplicated in the profile class.
| R._Stambaugh_normalised_beta_upper_limit_________________________________ (beta_norm_max_stambaugh)______ 2.06087953258754553e+00 OP | ||
| Plasma_thermal_energy_derived_from_thermal_beta_(J)______________________ (e_plasma_beta_thermal)________ 9.66355464245535374e+08 OP | ||
| Plasma_thermal_energy_derived_from_the_total_beta_(J)____________________ (e_plasma_beta)________________ 1.10779607068200541e+09 OP | ||
| Number_of_radial_points_in_plasma_profiles_______________________________ (n_plasma_profile_elements)____ 501 |
There was a problem hiding this comment.
I don't think these numbers should disagree.
f76ce88 to
24d344f
Compare
…mproved performance and update related output handling
24d344f to
cc23e47
Compare
|
@jonmaddock Have added docstring and explanation to the 1D interpolation |
This pull request introduces enhancements to the handling and reporting of plasma pressure profiles in the codebase. The main focus is on adding support for electron, ion, and fuel pressure profiles, ensuring these are properly calculated, initialized, and outputted. Additionally, the number of elements in plasma profiles is now tracked and reported.
❇️ New variables
pres_plasma_electron_profilepres_plasma_ion_total_profilepres_plasma_total_profilepres_plasma_fuel_profilen_plasma_profile_elementsPlasma pressure profile support:
physics_variables.pyfor storing electron, ion total, and fuel pressure profiles (pres_plasma_electron_profile,pres_plasma_ion_total_profile,pres_plasma_fuel_profile) and the number of profile elements (n_plasma_profile_elements). These are initialized in both the variable declarations and theinit_physics_variablesfunction.plasma_profiles.py, setn_plasma_profile_elementstoprofile_sizeduring initialization, and calculated the electron, ion, and fuel pressure profiles incalculate_profile_factors.Output improvements:
physics.pyto output the number of plasma profile elements and to iterate over and report each value in the electron, ion total, and fuel pressure profiles.The plasma contour plot only works currently for the plasma shape selected with
i_plasma_shape=1as it is a continuous closed boundry`Checklist
I confirm that I have completed the following checks: