Add pressure peaking fraction value - #4483
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4483 +/- ##
==========================================
+ Coverage 48.67% 48.72% +0.04%
==========================================
Files 151 151
Lines 29734 29778 +44
==========================================
+ Hits 14474 14508 +34
- Misses 15260 15270 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c0cd8b3 to
542e0ed
Compare
| pres_plasma_thermal_on_axis: float = 0.0 | ||
| """Plasma central thermal pressure (p₀) (no fast ions or beam pressure) [Pa]""" | ||
|
|
||
| f_pres_plasma_thermal_on_axis_vol_avg: float = 0.0 |
There was a problem hiding this comment.
Maybe this is a real nit-pick but if it's a ratio should we use the "fraction" prefix for the variable name?
There was a problem hiding this comment.
We dont really have anything else in the style guide that fits the bill. f_ still represents a dimensionless unit that is the portion of something else
|
Hi Chris, Could you quote the actual equations from Johner that you have used, or your own derivations? For example in |
| mask = np.zeros_like(rho, dtype=bool) | ||
| mask[closest_idx:] = True | ||
| dpres_drho_pedestal = dpres_drho[mask] | ||
| max_grad_idx_pedestal = np.argmax(dpres_drho_pedestal) |
There was a problem hiding this comment.
Should this use np.argmin? Since the pressure decreases with increasing radius, the steepest pedestal gradient should be the most negative value
There was a problem hiding this comment.
I found that using np.argmin gets you closer to the pedestal in the large tokamak case as it plateus very quickly before the pedestal point. If you go for the max at the pedestal drop their is about a 10kPa difference. I do worry that this will break if a very flat profile is used so the pressure profile is practically vertical before the pedestal point
Hi @mkovari if this is for the pedestal pressure I have done a very quick estimate via the first derivative at the pedestal point which is normally the local minimum. Though I am thinking if we are able to just take the arithmetic mean of the two pedestal positions for density and temperature and then take a value at that index of the pedestal profile. Though I am open to sugestions on how to calculate. An analytical expression would always be better in this case |
This pull request introduces several enhancements to how plasma pressure and temperature profiles are calculated, stored, and reported, particularly improving the handling of pedestal profile cases. The main changes include adding new derived quantities (such as central-to-volume-averaged ratios), calculating and outputting pedestal and separatrix pressures, and updating the summary plots and output files to reflect these new metrics.
Enhancements to plasma profile calculations:
Added calculation and storage of the ratio of central to volume-averaged plasma electron temperature (
f_temp_plasma_electron_on_axis_vol_avg) and plasma thermal pressure (f_pres_plasma_thermal_on_axis_vol_avg). These are now computed in both parabolic and pedestal parameterisations, and in the profile factors calculation.For pedestal profile cases, the code now calculates and stores the plasma thermal pressure at the pedestal (
pres_plasma_pedestal_thermal) and at the separatrix (pres_plasma_separatrix_thermal).Output and reporting improvements:
The output file generation now includes the new ratio quantities and, for pedestal profiles, the pedestal and separatrix pressures.
🐛 Fixed units in the output for plasma thermal energies from
[W]to[J]for clarity and correctness.Plotting and summary display updates:
Codebase and import updates:
PlasmaProfileShapeTypeto support the new logic for pedestal profile handling.These changes improve the physical fidelity and reporting of plasma profile data, especially for cases with pedestal structure, and enhance the usability of the output for analysis and validation.## Description
Checklist
I confirm that I have completed the following checks: