Pressure lost due to a saturated island#239
Conversation
…land at each rational surface
|
@priyanshlunia there is some bug in that last commit but it should be clear what I am trying to do. Can you fix it and plot the modified pressure profile from saturated islands? Post a screenshot when you do! TY |
|
any progress @priyanshlunia? |
Fixes three bugs in the p_mod (modified pressure profile) code in gpout_singfld that made the WIP output unusable: 1. Grid/size mismatch: p_mod was built on the equilibrium grid sq%xs(0:mpsi) but written to the psi_n NetCDF variable, which has length mstep on the psifac grid. Now dimensioned (mstep) and evaluated on psifac(1:mstep). 2. astat collision: an inserted nf90_inq_dimid(...,"psi_n",...) clobbered the astat used to guard the area_rational write, leaving area_rational as fill values. p_mod is now defined/written unconditionally (psi_n always exists) and astat is left untouched. 3. Integration sign: the inward trapezoidal reconstruction added instead of subtracted dP/dpsi, making pressure decrease toward the core. Now subtracts. Also reverts a stray debug edit to the DIII-D example coil currents (1e3 -> 1e5/1e6) back to the baseline 1 kA. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Went through the WIP commit ( BackgroundThe goal of the WIP commit is a full radial pressure profile Bug 1 — grid/size mismatch (the crash)
Fix: declare ! before
REAL(r8), DIMENSION(0:mpsi) :: p_mod
...
DO ipsi=0,mpsi
CALL spline_eval(spl,sq%xs(ipsi),0)
p_mod(ipsi) = spl%f(1)
ENDDO
! after
REAL(r8), DIMENSION(mstep) :: p_mod
...
DO ipsi=1,mstep
CALL spline_eval(spl,psifac(ipsi),0)
p_mod(ipsi) = spl%f(1)
ENDDOBug 2 —
|
|
@claude review this PR |
|
Claude finished @logan-nc's task in 8m 4s —— View job Review: Pressure lost due to a saturated islandReviewed Bug: ASCII output format descriptor mismatch (
|
|
@priyanshlunia please address the review comments above, including the minor ones which all seem like good changes to me. So now there is a |

This PR adds a simple estimate of the pressure lost when an RMP driven island saturates to the saturated width predicted by Callen's model.
This can be used to compare to EPED to predict if an RMP island is expected to decrease the pedestal pressure enough to stabilize ELMs. It can also be benchmarked by comparing to TM1 results.
Example output when I boost the DIII-D ideal example to 1e6 amp I-coils:
In other words, that huge of an RMP would be expected to clobber the pedestal completely.
I like printing dP/P because it allows the user to eyeball if say ~10% of the pressure is eaten by an island at the pedestal top.
The netcdf saves both
dPandPseparately.A known issue with the implementation is that each island is currently treated as perturbing the original pressure profile. When islands overlap, this is an over estimate. We should really work our way from the edge inwards and modify the pressure profile successively.