Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions process/models/physics/plasma_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,23 +319,17 @@ def calculate_profile_factors(self):
PlasmaProfileShapeType(self.data.physics.i_plasma_pedestal)
== PlasmaProfileShapeType.PEDESTAL_PROFILE
):
# Pedestal pressure is the profile value where gradient is maximum
# (i.e the smallest negative value)
# Pedestal pressure is taken at the lower of the temperature and
# density normalised pedestal radii
rho = self.neprofile.profile_x
pres_profile = self.data.physics.pres_plasma_thermal_total_profile
dpres_drho = np.gradient(pres_profile, rho)
# Find rho index closest to the normalized pedestal positions
pedestal_rho = np.min([
pedestal_rho = min(
self.data.physics.radius_plasma_pedestal_temp_norm,
self.data.physics.radius_plasma_pedestal_density_norm,
])
)
closest_idx = np.argmin(np.abs(rho - pedestal_rho))
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)
max_grad_idx = np.where(mask)[0][max_grad_idx_pedestal]
self.data.physics.pres_plasma_pedestal_thermal = pres_profile[max_grad_idx]
self.data.physics.pres_plasma_pedestal_thermal = (
self.data.physics.pres_plasma_thermal_total_profile[closest_idx]
)

self.data.physics.pres_plasma_separatrix_thermal = (
self.data.physics.pres_plasma_thermal_total_profile[-1]
Expand Down
Loading