From 392ed3f3e0f9fa41705cecd7062b2b3ec235ed50 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Sep 2026 16:28:27 +0100 Subject: [PATCH 01/12] Add IonTemperatureProfile class to represent ion temperature profiles scaled from electron temperature profiles --- process/models/physics/profiles.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/process/models/physics/profiles.py b/process/models/physics/profiles.py index 66ddbbd637..d878a861da 100644 --- a/process/models/physics/profiles.py +++ b/process/models/physics/profiles.py @@ -625,3 +625,32 @@ def calculate_vol_avg_of_profile( x=profile_x, dx=profile_dx if profile_dx is not None else profile_x[1] - profile_x[0], ) + + +class IonTemperatureProfile(Profile): + """Ion temperature (Tᵢ) profile class. Represents the same profile shape as an + [`ElectronTemperatureProfile`] + """ + + def __init__(self, electron_temperature_profile: ElectronTemperatureProfile): + """ + Parameters + ---------- + electron_temperature_profile : + The electron temperature profile whose shape is scaled to produce the ion + temperature profile. + """ + super().__init__() + self.electron_temperature_profile = electron_temperature_profile + + def run(self): + """Scale the electron temperature profile by the ion-to-electron + volume-averaged temperature ratio to obtain the ion temperature profile. + """ + self.profile_x = self.electron_temperature_profile.profile_x + self.profile_dx = self.electron_temperature_profile.profile_dx + self.profile_y = ( + self.electron_temperature_profile.profile_y + * self.data.physics.f_temp_plasma_ion_electron + ) + self.integrate_profile_y() From 54c627f4107f0b95a86bdd2459cfee3305a4086f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Sep 2026 16:45:41 +0100 Subject: [PATCH 02/12] Integrate IonTemperatureProfile into PlasmaProfile and update initialization parameters --- process/main.py | 10 ++++++++- process/models/physics/plasma_profiles.py | 26 +++++++++++++++++------ process/models/physics/profiles.py | 8 ++++++- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/process/main.py b/process/main.py index ad22d34ad5..afbfedbc2f 100644 --- a/process/main.py +++ b/process/main.py @@ -102,6 +102,7 @@ from process.models.physics.profiles import ( ElectronDensityProfile, ElectronTemperatureProfile, + IonTemperatureProfile, ) from process.models.physics.scrape_off_layer import ScrapeOffLayer from process.models.power import Power @@ -669,7 +670,14 @@ def __init__(self, data: DataStructure): self.ife = IFE(availability=self.availability, costs=self.costs) self.ne_profile = ElectronDensityProfile() self.te_profile = ElectronTemperatureProfile() - self.plasma_profile = PlasmaProfile(self.ne_profile, self.te_profile) + self.ti_profile = IonTemperatureProfile( + electron_temperature_profile=self.te_profile + ) + self.plasma_profile = PlasmaProfile( + ne_profile=self.ne_profile, + te_profile=self.te_profile, + ti_profile=self.ti_profile, + ) self.fw = FirstWall() self.blanket_library = BlanketLibrary(fw=self.fw) self.ccfe_hcpb = CCFE_HCPB(fw=self.fw) diff --git a/process/models/physics/plasma_profiles.py b/process/models/physics/plasma_profiles.py index 095a39da3b..0b5848dc69 100644 --- a/process/models/physics/plasma_profiles.py +++ b/process/models/physics/plasma_profiles.py @@ -12,7 +12,12 @@ from process.core import constants from process.core.exceptions import ProcessValueError from process.core.model import Model -from process.models.physics.profiles import PlasmaProfileShapeType +from process.models.physics.profiles import ( + ElectronDensityProfile, + ElectronTemperatureProfile, + IonTemperatureProfile, + PlasmaProfileShapeType, +) logger = logging.getLogger(__name__) @@ -22,23 +27,30 @@ class PlasmaProfile(Model): profiles and handles the required physics variables. """ - def __init__(self, ne_profile, te_profile): + def __init__( + self, + ne_profile: ElectronDensityProfile, + te_profile: ElectronTemperatureProfile, + ti_profile: IonTemperatureProfile, + ): """ Initialize the PlasmaProfile class. Args: - profile_size (int): The size of the plasma profile. - outfile (str): The output file path. - neprofile (ElectronDensityProfile): An instance of the ElectronDensityProfile - class. - teprofile (ElectronTemperatureProfile): An instance of the + ne_profile (ElectronDensityProfile): An instance of the + ElectronDensityProfile class. + te_profile (ElectronTemperatureProfile): An instance of the ElectronTemperatureProfile class. + ti_profile (IonTemperatureProfile): An instance of the + IonTemperatureProfile class. + """ # Default profile_size = 201, but it's possible to experiment with this value. # See `n_plasma_profile_elements` self.outfile = constants.NOUT self.neprofile = ne_profile self.teprofile = te_profile + self.tiprofile = ti_profile def run(self): """Subroutine to execute PlasmaProfile functions. diff --git a/process/models/physics/profiles.py b/process/models/physics/profiles.py index d878a861da..4857425e2b 100644 --- a/process/models/physics/profiles.py +++ b/process/models/physics/profiles.py @@ -649,8 +649,14 @@ def run(self): """ self.profile_x = self.electron_temperature_profile.profile_x self.profile_dx = self.electron_temperature_profile.profile_dx + self.calculate_profile_y() + self.integrate_profile_y() + + def calculate_profile_y(self): + """Calculate the ion temperature profile based on the electron temperature + profile and the ion-to-electron volume-averaged temperature ratio. + """ self.profile_y = ( self.electron_temperature_profile.profile_y * self.data.physics.f_temp_plasma_ion_electron ) - self.integrate_profile_y() From 6491aad0d94513f80a768c31778797df2d98c5d2 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Sep 2026 17:00:14 +0100 Subject: [PATCH 03/12] Add ti_profile handling in PlasmaProfile for ion temperature calculations --- process/main.py | 1 + process/models/physics/plasma_profiles.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/process/main.py b/process/main.py index afbfedbc2f..e9cac14af1 100644 --- a/process/main.py +++ b/process/main.py @@ -825,6 +825,7 @@ def models(self) -> tuple[Model, ...]: self.plasma_inductance, self.ne_profile, self.te_profile, + self.ti_profile, self.plasma_fields, self.sauter_bootstrap_current, self.plasma_transition, diff --git a/process/models/physics/plasma_profiles.py b/process/models/physics/plasma_profiles.py index 0b5848dc69..5d56062c27 100644 --- a/process/models/physics/plasma_profiles.py +++ b/process/models/physics/plasma_profiles.py @@ -133,6 +133,7 @@ def parabolic_parameterisation(self): # Re-calculate core and profile values self.teprofile.run() self.neprofile.run() + self.tiprofile.run() # Profile factor; ratio of density-weighted to volume-averaged # temperature @@ -213,6 +214,7 @@ def pedestal_parameterisation(self): # Re-calculate core and profile values self.teprofile.run() + self.tiprofile.run() self.neprofile.run() # Perform integrations to calculate ratio of density-weighted From 6c81464968ea320c8dc1865825ed0c10f49e0b39 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Sep 2026 17:07:20 +0100 Subject: [PATCH 04/12] Refactor ion temperature profile calculations in FusionReactionRate class --- process/models/physics/fusion_reactions.py | 29 ++++------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/process/models/physics/fusion_reactions.py b/process/models/physics/fusion_reactions.py index 7fb0f79b96..f2841d9645 100644 --- a/process/models/physics/fusion_reactions.py +++ b/process/models/physics/fusion_reactions.py @@ -193,14 +193,10 @@ def dt_reaction(self): # Initialize Bosch-Hale constants for the D-T reaction dt = BoschHaleConstants(**REACTION_CONSTANTS_DT) - ion_temperature_profile = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - ) * self.plasma_profile.teprofile.profile_y - # Velocity-space average reactivity D-T profile [m³/s] sigma_v_profile = bosch_hale_reactivity( - ion_temperature_profile=ion_temperature_profile, reaction_constants=dt + ion_temperature_profile=self.plasma_profile.tiprofile.profile_y, + reaction_constants=dt, ) # Full fusion reaction rate density profile for the D-T reaction [reactions/m³/s] @@ -275,14 +271,9 @@ def dhe3_reaction(self): # Initialize Bosch-Hale constants for the D-3He reaction dhe3 = BoschHaleConstants(**REACTION_CONSTANTS_DHE3) - ion_temperature_profile = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - ) * self.plasma_profile.teprofile.profile_y - # Velocity-space average reactivity D-3He profile [m³/s] sigma_v_profile = bosch_hale_reactivity( - ion_temperature_profile=ion_temperature_profile, + ion_temperature_profile=self.plasma_profile.tiprofile.profile_y, reaction_constants=dhe3, ) @@ -358,14 +349,9 @@ def dd_helion_reaction(self): # Initialize Bosch-Hale constants for the D-D reaction dd1 = BoschHaleConstants(**REACTION_CONSTANTS_DD1) - ion_temperature_profile = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - ) * self.plasma_profile.teprofile.profile_y - # Velocity-space average reactivity D-D -> 3He + n profile [m³/s] sigma_v_profile = bosch_hale_reactivity( - ion_temperature_profile=ion_temperature_profile, + ion_temperature_profile=self.plasma_profile.tiprofile.profile_y, reaction_constants=dd1, ) @@ -449,14 +435,9 @@ def dd_triton_reaction(self): # Initialize Bosch-Hale constants for the D-D reaction dd2 = BoschHaleConstants(**REACTION_CONSTANTS_DD2) - ion_temperature_profile = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - ) * self.plasma_profile.teprofile.profile_y - # Velocity-space average reactivity for the D-D -> T + p reaction sigma_v_profile = bosch_hale_reactivity( - ion_temperature_profile=ion_temperature_profile, + ion_temperature_profile=self.plasma_profile.tiprofile.profile_y, reaction_constants=dd2, ) From b5ae4249ecdcd2c2ffc80972979c1b6cbd0cb98f Mon Sep 17 00:00:00 2001 From: mn3981 Date: Fri, 11 Sep 2026 17:18:08 +0100 Subject: [PATCH 05/12] Update particle speed calculations to use ion temperature profiles --- process/models/physics/physics.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index 2961e820a4..d67e88be2d 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -5121,54 +5121,48 @@ def run(self): self.data.physics.vel_plasma_deuteron_profile = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.plasma_profile.teprofile.profile_y - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.plasma_profile.tiprofile.profile_y + * constants.KILOELECTRON_VOLT, mass=constants.DEUTERON_MASS, ) ) self.data.physics.vel_plasma_deuteron_vol_avg = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.data.physics.temp_plasma_electron_vol_avg_kev - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.data.physics.temp_plasma_ion_vol_avg_kev + * constants.KILOELECTRON_VOLT, mass=constants.DEUTERON_MASS, ) ) self.data.physics.vel_plasma_triton_profile = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.plasma_profile.teprofile.profile_y - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.plasma_profile.tiprofile.profile_y + * constants.KILOELECTRON_VOLT, mass=constants.TRITON_MASS, ) ) self.data.physics.vel_plasma_triton_vol_avg = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.data.physics.temp_plasma_electron_vol_avg_kev - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.data.physics.temp_plasma_ion_vol_avg_kev + * constants.KILOELECTRON_VOLT, mass=constants.TRITON_MASS, ) ) self.data.physics.vel_plasma_alpha_thermal_profile = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.plasma_profile.teprofile.profile_y - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.plasma_profile.tiprofile.profile_y + * constants.KILOELECTRON_VOLT, mass=constants.ALPHA_MASS, ) ) self.data.physics.vel_plasma_alpha_thermal_vol_avg = ( self.calculate_relativistic_particle_speed( - e_kinetic=self.data.physics.temp_plasma_electron_vol_avg_kev - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron, + e_kinetic=self.data.physics.temp_plasma_ion_vol_avg_kev + * constants.KILOELECTRON_VOLT, mass=constants.ALPHA_MASS, ) ) From 94473d247fa325298de0c8ea2f0c3a78e030a1e9 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Mon, 14 Sep 2026 13:33:17 +0100 Subject: [PATCH 06/12] Refactor plasma temperature profile calculations to utilize IonTemperatureProfile in BootstrapCurrent and PlasmaProfile classes --- process/models/physics/bootstrap_current.py | 5 +---- process/models/physics/plasma_profiles.py | 12 ++---------- tests/unit/models/physics/test_physics.py | 2 ++ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/process/models/physics/bootstrap_current.py b/process/models/physics/bootstrap_current.py index 03d1887a52..dbeab5397c 100644 --- a/process/models/physics/bootstrap_current.py +++ b/process/models/physics/bootstrap_current.py @@ -1506,10 +1506,7 @@ def bootstrap_fraction_sauter(self, plasma_profile: PlasmaProfile) -> float: # Calculate electron and ion temperature profiles tempe = plasma_profile.teprofile.profile_y - tempi = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - ) * tempe + tempi = plasma_profile.tiprofile.profile_y # Flat Zeff profile assumed # Return tempi like array object filled with zeff diff --git a/process/models/physics/plasma_profiles.py b/process/models/physics/plasma_profiles.py index 5d56062c27..d7d594e0a9 100644 --- a/process/models/physics/plasma_profiles.py +++ b/process/models/physics/plasma_profiles.py @@ -298,11 +298,7 @@ def calculate_profile_factors(self): self.data.physics.pres_plasma_ion_total_profile = ( self.data.physics.nd_plasma_ions_total_vol_avg * (self.neprofile.profile_y / self.data.physics.nd_plasma_electrons_vol_avg) - ) * ( - self.teprofile.profile_y - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron - ) + ) * (self.tiprofile.profile_y * constants.KILOELECTRON_VOLT) # Total pressure profile (Pa) self.data.physics.pres_plasma_thermal_total_profile = ( @@ -341,11 +337,7 @@ def calculate_profile_factors(self): self.data.physics.pres_plasma_fuel_profile = ( self.data.physics.nd_plasma_fuel_ions_vol_avg * (self.neprofile.profile_y / self.data.physics.nd_plasma_electrons_vol_avg) - ) * ( - self.teprofile.profile_y - * constants.KILOELECTRON_VOLT - * self.data.physics.f_temp_plasma_ion_electron - ) + ) * (self.tiprofile.profile_y * constants.KILOELECTRON_VOLT) # Pressure profile index (only true for a parabolic profile) # N.B. pres_plasma_thermal_on_axis is NOT equal to

* (1 + alphap), diff --git a/tests/unit/models/physics/test_physics.py b/tests/unit/models/physics/test_physics.py index 9e3aa6f47b..4682d83180 100644 --- a/tests/unit/models/physics/test_physics.py +++ b/tests/unit/models/physics/test_physics.py @@ -3458,6 +3458,8 @@ def test_detailed_physics_run_computes_profiles(monkeypatch, physics, process_mo plasma.teprofile.profile_y = np.array([1.0, 2.0, 3.0]) # keV plasma.neprofile.profile_x = plasma.teprofile.profile_x plasma.neprofile.profile_y = np.array([1.0e19, 2.0e19, 3.0e19]) # m^-3 + plasma.tiprofile.profile_x = plasma.teprofile.profile_x + plasma.tiprofile.profile_y = np.array([1.0, 2.0, 3.0]) # keV monkeypatch.setattr( physics.data.physics, From 95393ed5ae712e15ca6caf50aa78bb391b85e261 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 17 Sep 2026 09:44:50 +0100 Subject: [PATCH 07/12] Add ion temperature on-axis calculation to IonTemperatureProfile class --- process/models/physics/profiles.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/process/models/physics/profiles.py b/process/models/physics/profiles.py index 4857425e2b..30c8e2b474 100644 --- a/process/models/physics/profiles.py +++ b/process/models/physics/profiles.py @@ -567,12 +567,6 @@ def set_physics_variables(self): tbeta=self.data.physics.tbeta, ) - self.data.physics.temp_plasma_ion_on_axis_kev = ( - self.data.physics.temp_plasma_ion_vol_avg_kev - / self.data.physics.temp_plasma_electron_vol_avg_kev - * self.data.physics.temp_plasma_electron_on_axis_kev - ) - def calculate_vol_avg_of_profile( profile_x: np.ndarray, profile_y: np.ndarray, profile_dx: float | None = None @@ -651,6 +645,12 @@ def run(self): self.profile_dx = self.electron_temperature_profile.profile_dx self.calculate_profile_y() self.integrate_profile_y() + + self.data.physics.temp_plasma_ion_on_axis_kev = ( + self.data.physics.temp_plasma_ion_vol_avg_kev + / self.data.physics.temp_plasma_electron_vol_avg_kev + * self.data.physics.temp_plasma_electron_on_axis_kev + ) def calculate_profile_y(self): """Calculate the ion temperature profile based on the electron temperature From 87850c7ff3f903f3d9a27ab0b758cde2b65a3a05 Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 17 Sep 2026 09:49:09 +0100 Subject: [PATCH 08/12] - Updated all instances of `temp_plasma_pedestal_kev` to `temp_plasma_pedestal_electron_kev` across various files including documentation, input files, and code logic. --- .../profiles/plasma_profiles.md | 4 +- .../profiles/plasma_temperature_profile.md | 81 ++++++++++++++++++- examples/data/large_tokamak_eval_IN.DAT | 2 +- ...rge_tokamak_varied_min_net_electric_IN.DAT | 2 +- examples/data/large_tokamak_varyrun_IN.DAT | 2 +- process/core/data_structure/obsolete_vars.py | 2 +- process/core/init.py | 28 ++++--- process/core/input.py | 4 +- process/core/io/mfile/comparison.py | 2 +- process/core/io/plot/summary.py | 26 +++--- process/data_structure/physics_variables.py | 2 +- process/models/physics/bootstrap_current.py | 8 +- process/models/physics/current_drive.py | 6 +- process/models/physics/physics.py | 4 +- process/models/physics/plasma_profiles.py | 7 +- process/models/physics/profiles.py | 6 +- .../data/large_tokamak_eval.IN.DAT | 2 +- .../input_files/large_tokamak_eval.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- .../input_files/low_aspect_ratio_DEMO.IN.DAT | 2 +- .../input_files/spherical_tokamak_eval.IN.DAT | 2 +- .../input_files/st_regression.IN.DAT | 2 +- tests/unit/models/physics/test_physics.py | 18 ++--- .../models/physics/test_plasma_profiles.py | 14 ++-- tracking/tracking_data.py | 2 +- 25 files changed, 160 insertions(+), 72 deletions(-) diff --git a/documentation/source/physics-models/profiles/plasma_profiles.md b/documentation/source/physics-models/profiles/plasma_profiles.md index 39498e0717..bdc5884d60 100644 --- a/documentation/source/physics-models/profiles/plasma_profiles.md +++ b/documentation/source/physics-models/profiles/plasma_profiles.md @@ -141,7 +141,7 @@ $\alpha_T$ as well as the second exponent $\beta_T$ (input parameter `tbeta`, not to be confused with the plasma beta) in the temperature profile can be chosen by the user, as can the pedestal heights and the values at the separatrix (`nd_plasma_pedestal_electron, nd_plasma_separatrix_electron` for the electron density, and -`temp_plasma_pedestal_kev, temp_plasma_separatrix_kev` for the electron temperature); the ion equivalents are +`temp_plasma_pedestal_electron_kev, temp_plasma_separatrix_kev` for the electron temperature); the ion equivalents are scaled from the electron values by the ratio of the volume-averaged values). !!! note "$\beta_T$ setting" @@ -158,7 +158,7 @@ A table of the the associated variables can be seen below |----------------------------------|-----------|-------------| | Pedestal radius (r/a) | `radius_plasma_pedestal_density_norm`, $\rho_{\text{ped},n}$ | `radius_plasma_pedestal_temp_norm`, $\rho_{\text{ped},T}$ | | Plasma centre value | `nd_plasma_electron_on_axis`, $n_0$ | `temp_plasma_electron_on_axis_kev`, $T_0$ | -| Pedestal value | `nd_plasma_pedestal_electron`, $n_{\text{ped}}$ | `temp_plasma_pedestal_kev`, $T_{\text{ped}}$ | +| Pedestal value | `nd_plasma_pedestal_electron`, $n_{\text{ped}}$ | `temp_plasma_pedestal_electron_kev`, $T_{\text{ped}}$ | | Separatrix value | `nd_plasma_separatrix_electron`, $n_{\text{sep}}$ | `temp_plasma_separatrix_kev`, $T_{\text{sep}}$ | | Profile index/ peaking parameter | `alphan`, $\alpha_n$ | `alphat`, $\alpha_T$ | | Profile index $\beta$ | | `tbeta`, $\beta_T$ | diff --git a/documentation/source/physics-models/profiles/plasma_temperature_profile.md b/documentation/source/physics-models/profiles/plasma_temperature_profile.md index 70450da94c..1baf011d51 100644 --- a/documentation/source/physics-models/profiles/plasma_temperature_profile.md +++ b/documentation/source/physics-models/profiles/plasma_temperature_profile.md @@ -1,3 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # Temperature Profile | `ElectronTemperatureProfile(Profile)` The temperature profile class is organised around a central runner function that is called each time the plasma is parameterised by the parent [`PlasmaProfile()`](plasma_profiles.md#plasma-profile-class-plasmaprofile) class. It is called by [`pedestal_parameterisation()`](plasma_profiles.md#pedestal_parameterisation) and [`parabolic parameterisation()`](plasma_profiles.md#parabolic_parameterisation). The sequence of the runner function can be seen below along with explanation of the following calculations. @@ -21,7 +98,7 @@ A list of input parameters for calculating the core plasma temperature can be fo | Profile parameter / Input | Temperature | |----------------------------------|-----------| | Pedestal radius (r/a) | `radius_plasma_pedestal_temp_norm`, $\rho_{\text{ped,T}}$ | -| Pedestal value | `temp_plasma_pedestal_kev`, $T_{\text{ped}}$ | +| Pedestal value | `temp_plasma_pedestal_electron_kev`, $T_{\text{ped}}$ | | Separatrix value | `temp_plasma_separatrix_kev`, $T_{\text{sep}}$ | | Average temperature | `temp_vol_avg_kev`, $\langle T \rangle$ | | Profile index/ peaking parameter | `alphat`, $\alpha_T$ | @@ -193,7 +270,7 @@ A table of the input variables can be found below | Normalised plasma radii | `profile_x` | | Pedestal radius (r/a) | `radius_plasma_pedestal_temp_norm`, $\rho_{\text{ped,T}}$ | | Core temperature | `temp_plasma_electron_on_axis_kev`, $T_{\text{e0}}$ | -| Pedestal value | `temp_plasma_pedestal_kev`, $T_{\text{ped}}$ | +| Pedestal value | `temp_plasma_pedestal_electron_kev`, $T_{\text{ped}}$ | | Separatrix value | `temp_plasma_separatrix_kev`, $T_{\text{sep}}$ | | Profile index/ peaking parameter | `alphat`, $\alpha_T$ | | 2nd profile index/ peaking parameter | `tbeta`, $\beta_T$ | diff --git a/examples/data/large_tokamak_eval_IN.DAT b/examples/data/large_tokamak_eval_IN.DAT index f92b56ea19..965dcc64f2 100644 --- a/examples/data/large_tokamak_eval_IN.DAT +++ b/examples/data/large_tokamak_eval_IN.DAT @@ -294,7 +294,7 @@ plasma_res_factor = 0.7 * plasma resistivity pre-factor radius_plasma_pedestal_density_norm = 0.94 * r/a of density pedestal (`i_plasma_pedestal==1`) radius_plasma_pedestal_temp_norm = 0.94 * r/a of temperature pedestal (`i_plasma_pedestal==1`) tbeta = 2.0 * temperature profile index beta (`i_plasma_pedestal==1) -temp_plasma_pedestal_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') +temp_plasma_pedestal_electron_kevctron_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') temp_plasma_separatrix_kev = 0.1 * electron temperature at separatrix (keV) (`i_plasma_pedestal==1`) calculated if reinke i_confinement_time = 34 * switch for energy confinement time scaling law (see description in `tauscl`) i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation; diff --git a/examples/data/large_tokamak_varied_min_net_electric_IN.DAT b/examples/data/large_tokamak_varied_min_net_electric_IN.DAT index 0e6abd3b44..1887a1e346 100644 --- a/examples/data/large_tokamak_varied_min_net_electric_IN.DAT +++ b/examples/data/large_tokamak_varied_min_net_electric_IN.DAT @@ -376,7 +376,7 @@ radius_plasma_pedestal_temp_norm = 0.94 tbeta = 2.0 * Electron temperature of pedestal (kev) (i_plasma_pedestal=1) -temp_plasma_pedestal_kev = 5.5 +temp_plasma_pedestal_electron_kevctron_kev = 5.5 * Electron temperature at separatrix (kev) (i_plasma_pedestal=1) temp_plasma_separatrix_kev = 0.1 diff --git a/examples/data/large_tokamak_varyrun_IN.DAT b/examples/data/large_tokamak_varyrun_IN.DAT index 9f0c33f3eb..f8694040f2 100644 --- a/examples/data/large_tokamak_varyrun_IN.DAT +++ b/examples/data/large_tokamak_varyrun_IN.DAT @@ -376,7 +376,7 @@ radius_plasma_pedestal_temp_norm = 0.94 tbeta = 2.0 * Electron temperature of pedestal (kev) (i_plasma_pedestal=1) -temp_plasma_pedestal_kev = 5.5 +temp_plasma_pedestal_electron_kevctron_kev = 5.5 * Electron temperature at separatrix (kev) (i_plasma_pedestal=1) temp_plasma_separatrix_kev = 0.1 diff --git a/process/core/data_structure/obsolete_vars.py b/process/core/data_structure/obsolete_vars.py index a9734f8f13..96baa20921 100644 --- a/process/core/data_structure/obsolete_vars.py +++ b/process/core/data_structure/obsolete_vars.py @@ -410,7 +410,7 @@ "rhopedt": "radius_plasma_pedestal_temp_norm", "taumax": "t_plasma_energy_confinement_max", "te": "temp_plasma_electron_vol_avg_kev", - "teped": "temp_plasma_pedestal_kev", + "teped": "temp_plasma_pedestal_electron_kev", "tesep": "temp_plasma_separatrix_kev", "ti": "temp_plasma_ion_vol_avg_kev", "tratio": "f_temp_plasma_ion_electron", diff --git a/process/core/init.py b/process/core/init.py index de40dd0d64..36a02c7802 100644 --- a/process/core/init.py +++ b/process/core/init.py @@ -430,25 +430,26 @@ def check_process(inputs, data): # noqa: ARG001 if data.ife.ife != 1 and data.physics.i_plasma_pedestal == 1: # Temperature checks if ( - data.physics.temp_plasma_pedestal_kev + data.physics.temp_plasma_pedestal_electron_kev < data.physics.temp_plasma_separatrix_kev ): raise ProcessValidationError( "Pedestal temperature is lower than separatrix temperature", - temp_plasma_pedestal_kev=data.physics.temp_plasma_pedestal_kev, + temp_plasma_pedestal_electron_kev=data.physics.temp_plasma_pedestal_electron_kev, temp_plasma_separatrix_kev=data.physics.temp_plasma_separatrix_kev, ) if (abs(data.physics.radius_plasma_pedestal_temp_norm - 1.0) <= 1e-7) and ( ( - data.physics.temp_plasma_pedestal_kev + data.physics.temp_plasma_pedestal_electron_kev - data.physics.temp_plasma_separatrix_kev ) >= 1e-7 ): logger.warning( - f"Temperature pedestal is at plasma edge, but temp_plasma_pedestal_kev " - f"({data.physics.temp_plasma_pedestal_kev}) differs from" + f"Temperature pedestal is at plasma edge, " + "but temp_plasma_pedestal_electron_kev " + f"({data.physics.temp_plasma_pedestal_electron_kev}) differs from" " temp_plasma_separatrix_kev" f" ({data.physics.temp_plasma_separatrix_kev})", stacklevel=2, @@ -461,32 +462,35 @@ def check_process(inputs, data): # noqa: ARG001 # (which will only have an effect if this is an optimisation run) if ( data.physics.temp_plasma_electron_vol_avg_kev - <= data.physics.temp_plasma_pedestal_kev + <= data.physics.temp_plasma_pedestal_electron_kev ): logger.warning( f"Volume-averaged temperature ({data.physics.te}) has been " "forced to exceed input pedestal height" - f" ({data.physics.temp_plasma_pedestal_kev}). " - "Changing to te = temp_plasma_pedestal_kev*1.001", + f" ({data.physics.temp_plasma_pedestal_electron_kev}). " + "Changing to te = temp_plasma_pedestal_electron_kev*1.001", stacklevel=2, ) data.physics.temp_plasma_electron_vol_avg_kev = ( - data.physics.temp_plasma_pedestal_kev * 1.001 + data.physics.temp_plasma_pedestal_electron_kev * 1.001 ) if ( data.numerics.i_process_run_mode == PROCESSRunMode.OPTIMISATION and (data.numerics.ixc[: data.numerics.n_iteration_variables] == 4).any() - and data.numerics.boundl[3] < data.physics.temp_plasma_pedestal_kev * 1.001 + and data.numerics.boundl[3] + < data.physics.temp_plasma_pedestal_electron_kev * 1.001 ): logger.warning( "Lower limit of volume averaged electron temperature" " (temp_plasma_electron_vol_avg_kev)" " has been raised to ensure" - " temp_plasma_electron_vol_avg_kev > temp_plasma_pedestal_kev", + " temp_plasma_electron_vol_avg_kev > temp_plasma_pedestal_electron_kev", stacklevel=2, ) - data.numerics.boundl[3] = data.physics.temp_plasma_pedestal_kev * 1.001 + data.numerics.boundl[3] = ( + data.physics.temp_plasma_pedestal_electron_kev * 1.001 + ) data.numerics.boundu[3] = max( data.numerics.boundu[3], data.numerics.boundl[3] ) diff --git a/process/core/input.py b/process/core/input.py index 98d2ce0f09..66350d05f0 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -825,7 +825,9 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]: "temp_fw_coolant_in": InputVariable("fwbs", float, range=(300.0, 1500.0)), "temp_fw_coolant_out": InputVariable("fwbs", float, range=(300.0, 1500.0)), "temp_fw_max": InputVariable("fwbs", float, range=(500.0, 2000.0)), - "temp_plasma_pedestal_kev": InputVariable("physics", float, range=(0.0, 20.0)), + "temp_plasma_pedestal_electron_kev": InputVariable( + "physics", float, range=(0.0, 20.0) + ), "temp_plasma_separatrix_kev": InputVariable("physics", float, range=(0.0, 20.0)), "tfcbv": InputVariable("buildings", float, range=(10000.0, 1000000.0)), "dx_tf_wp_insertion_gap": InputVariable("tfcoil", float, range=(1e-10, 0.1)), diff --git a/process/core/io/mfile/comparison.py b/process/core/io/mfile/comparison.py index 94ac8e318a..1954f31bcb 100644 --- a/process/core/io/mfile/comparison.py +++ b/process/core/io/mfile/comparison.py @@ -120,7 +120,7 @@ "f_nd_plasma_greenwald", "temp_plasma_separatrix_kev", "nd_plasma_separatrix_electron", - "temp_plasma_pedestal_kev", + "temp_plasma_pedestal_electron_kev", "nd_plasma_pedestal_electron", "n_charge_plasma_effective_vol_avg", "nd_plasma_impurities_vol_avg", diff --git a/process/core/io/plot/summary.py b/process/core/io/plot/summary.py index b0b15ea7d6..59e573f5cc 100644 --- a/process/core/io/plot/summary.py +++ b/process/core/io/plot/summary.py @@ -4278,7 +4278,9 @@ def plot_t_profiles(prof, demo_ranges: bool, mfile: MFile, scan: int): n_plasma_profile_elements = int(mfile.get("n_plasma_profile_elements", scan=scan)) i_plasma_pedestal = mfile.get("i_plasma_pedestal", scan=scan) rho = np.linspace(0, 1.0, n_plasma_profile_elements) - temp_plasma_pedestal_kev = mfile.get("temp_plasma_pedestal_kev", scan=scan) + temp_plasma_pedestal_electron_kev = mfile.get( + "temp_plasma_pedestal_electron_kev", scan=scan + ) temp_plasma_separatrix_kev = mfile.get("temp_plasma_separatrix_kev", scan=scan) f_temp_plasma_ion_electron = mfile.get("f_temp_plasma_ion_electron", scan=scan) tbeta = mfile.get("tbeta", scan=scan) @@ -4287,14 +4289,14 @@ def plot_t_profiles(prof, demo_ranges: bool, mfile: MFile, scan: int): if i_plasma_pedestal == 1: rhocore = np.linspace(0.0, radius_plasma_pedestal_temp_norm) tcore = ( - temp_plasma_pedestal_kev - + (te0 - temp_plasma_pedestal_kev) + temp_plasma_pedestal_electron_kev + + (te0 - temp_plasma_pedestal_electron_kev) * (1 - (rhocore / radius_plasma_pedestal_temp_norm) ** tbeta) ** alphat ) rhosep = np.linspace(radius_plasma_pedestal_temp_norm, 1) tsep = temp_plasma_separatrix_kev + ( - temp_plasma_pedestal_kev - temp_plasma_separatrix_kev + temp_plasma_pedestal_electron_kev - temp_plasma_separatrix_kev ) * (1 - rhosep) / (1 - min(0.9999, radius_plasma_pedestal_temp_norm)) rho = np.append(rhocore, rhosep) @@ -4322,7 +4324,7 @@ def plot_t_profiles(prof, demo_ranges: bool, mfile: MFile, scan: int): if i_plasma_pedestal != 0: # Plot pedestal lines prof.axhline( - y=temp_plasma_pedestal_kev, + y=temp_plasma_pedestal_electron_kev, xmax=radius_plasma_pedestal_temp_norm, color="r", linestyle="-", @@ -4332,7 +4334,7 @@ def plot_t_profiles(prof, demo_ranges: bool, mfile: MFile, scan: int): prof.vlines( x=radius_plasma_pedestal_temp_norm, ymin=0.0, - ymax=temp_plasma_pedestal_kev, + ymax=temp_plasma_pedestal_electron_kev, color="r", linestyle="-", linewidth=0.4, @@ -4353,7 +4355,7 @@ def plot_t_profiles(prof, demo_ranges: bool, mfile: MFile, scan: int): rf"$\hspace{{2}} \alpha_{{\text{{T}}}}$: {alphat:.3f}" ), ( - rf"$T_{{\text{{e,ped}}}}$: {temp_plasma_pedestal_kev:.3f} keV" + rf"$T_{{\text{{e,ped}}}}$: {temp_plasma_pedestal_electron_kev:.3f} keV" r"$ \hspace{3} \frac{\langle T_i \rangle}{\langle T_e \rangle}$: " f"{f_temp_plasma_ion_electron:.3f}" ), @@ -4530,7 +4532,9 @@ def profiles_with_pedestal(mfile, scan: int): ne0 = mfile.get("nd_plasma_electron_on_axis", scan=scan) rho = np.linspace(0, 1.0, n_plasma_profile_elements) nd_plasma_separatrix_electron = mfile.get("nd_plasma_separatrix_electron", scan=scan) - temp_plasma_pedestal_kev = mfile.get("temp_plasma_pedestal_kev", scan=scan) + temp_plasma_pedestal_electron_kev = mfile.get( + "temp_plasma_pedestal_electron_kev", scan=scan + ) temp_plasma_separatrix_kev = mfile.get("temp_plasma_separatrix_kev", scan=scan) tbeta = mfile.get("tbeta", scan=scan) te0 = mfile.get("temp_plasma_electron_on_axis_kev", scan=scan) @@ -4569,15 +4573,15 @@ def profiles_with_pedestal(mfile, scan: int): # Core temperature region if rho[q] <= radius_plasma_pedestal_temp_norm: te[q] = ( - temp_plasma_pedestal_kev - + (te0 - temp_plasma_pedestal_kev) + temp_plasma_pedestal_electron_kev + + (te0 - temp_plasma_pedestal_electron_kev) * (1 - (rho[q] / radius_plasma_pedestal_temp_norm) ** tbeta) ** alphat ) else: # Pedestal temperature region te[q] = temp_plasma_separatrix_kev + ( - temp_plasma_pedestal_kev - temp_plasma_separatrix_kev + temp_plasma_pedestal_electron_kev - temp_plasma_separatrix_kev ) * (1 - rho[q]) / (1 - radius_plasma_pedestal_temp_norm) return rho, ne, te diff --git a/process/data_structure/physics_variables.py b/process/data_structure/physics_variables.py index 83409542c1..ccc93fa4b8 100644 --- a/process/data_structure/physics_variables.py +++ b/process/data_structure/physics_variables.py @@ -1054,7 +1054,7 @@ class PhysicsData: tbeta: float = 2.0 """Plasma temperature profile index beta (βₜ) (`i_plasma_pedestal==1)""" - temp_plasma_pedestal_kev: float = 1.0 + temp_plasma_pedestal_electron_kev: float = 1.0 """Plasma electron temperature of pedestal (Tₑ,pedestal) [keV] (`i_plasma_pedestal==1`)""" temp_plasma_separatrix_kev: float = 0.1 diff --git a/process/models/physics/bootstrap_current.py b/process/models/physics/bootstrap_current.py index dbeab5397c..77d8ee784a 100644 --- a/process/models/physics/bootstrap_current.py +++ b/process/models/physics/bootstrap_current.py @@ -244,7 +244,7 @@ def run(self) -> None: radius_plasma_pedestal_density_norm=self.data.physics.radius_plasma_pedestal_density_norm, nd_plasma_pedestal_electron=self.data.physics.nd_plasma_pedestal_electron, n_greenwald=self.data.physics.nd_plasma_electron_max_array[6], - temp_plasma_pedestal_kev=self.data.physics.temp_plasma_pedestal_kev, + temp_plasma_pedestal_electron_kev=self.data.physics.temp_plasma_pedestal_electron_kev, ) ) @@ -1203,7 +1203,7 @@ def bootstrap_fraction_sugiyama_h_mode( radius_plasma_pedestal_density_norm: float, nd_plasma_pedestal_electron: float, n_greenwald: float, - temp_plasma_pedestal_kev: float, + temp_plasma_pedestal_electron_kev: float, ) -> float: """Calculate the bootstrap fraction using the H-mode scaling from the Sugiyama et al formula. @@ -1232,7 +1232,7 @@ def bootstrap_fraction_sugiyama_h_mode( Electron number density at the pedestal [m⁻³]. n_greenwald : float Greenwald density limit [m⁻³]. - temp_plasma_pedestal_kev : float + temp_plasma_pedestal_electron_kev : float Electron temperature at the pedestal [keV]. Returns @@ -1266,7 +1266,7 @@ def bootstrap_fraction_sugiyama_h_mode( * (q95 / q0) ** -0.103 * radius_plasma_pedestal_density_norm**0.367 * (nd_plasma_pedestal_electron / n_greenwald) ** -0.174 - * temp_plasma_pedestal_kev**0.0552 + * temp_plasma_pedestal_electron_kev**0.0552 ) def output(self): diff --git a/process/models/physics/current_drive.py b/process/models/physics/current_drive.py index 554fbc4893..4afe820b7e 100644 --- a/process/models/physics/current_drive.py +++ b/process/models/physics/current_drive.py @@ -853,7 +853,7 @@ def culecd(self) -> float: rrr, self.data.physics.radius_plasma_pedestal_temp_norm, self.data.physics.temp_plasma_electron_on_axis_kev, - self.data.physics.temp_plasma_pedestal_kev, + self.data.physics.temp_plasma_pedestal_electron_kev, self.data.physics.temp_plasma_separatrix_kev, self.data.physics.alphat, self.data.physics.tbeta, @@ -1402,7 +1402,7 @@ def cullhy(self) -> float: rratio, self.data.physics.radius_plasma_pedestal_temp_norm, self.data.physics.temp_plasma_electron_on_axis_kev, - self.data.physics.temp_plasma_pedestal_kev, + self.data.physics.temp_plasma_pedestal_electron_kev, self.data.physics.temp_plasma_separatrix_kev, self.data.physics.alphat, self.data.physics.tbeta, @@ -1557,7 +1557,7 @@ def lheval(self, drfind: float, rratio: float) -> float: rratio, self.data.physics.radius_plasma_pedestal_temp_norm, self.data.physics.temp_plasma_electron_on_axis_kev, - self.data.physics.temp_plasma_pedestal_kev, + self.data.physics.temp_plasma_pedestal_electron_kev, self.data.physics.temp_plasma_separatrix_kev, self.data.physics.alphat, self.data.physics.tbeta, diff --git a/process/models/physics/physics.py b/process/models/physics/physics.py index d67e88be2d..7fc95bfabf 100644 --- a/process/models/physics/physics.py +++ b/process/models/physics/physics.py @@ -2818,8 +2818,8 @@ def output_temperature_density_profile_info(self) -> None: po.ovarre( self.outfile, "Electron temperature pedestal height (Tₑ,pedestal) (keV)", - "(temp_plasma_pedestal_kev)", - self.data.physics.temp_plasma_pedestal_kev, + "(temp_plasma_pedestal_electron_kev)", + self.data.physics.temp_plasma_pedestal_electron_kev, ) if 78 in self.data.numerics.icc: po.ovarre( diff --git a/process/models/physics/plasma_profiles.py b/process/models/physics/plasma_profiles.py index d7d594e0a9..21075a986e 100644 --- a/process/models/physics/plasma_profiles.py +++ b/process/models/physics/plasma_profiles.py @@ -106,7 +106,7 @@ def parabolic_parameterisation(self): if ( self.data.physics.radius_plasma_pedestal_temp_norm != 1.0 or self.data.physics.radius_plasma_pedestal_density_norm != 1.0 - or self.data.physics.temp_plasma_pedestal_kev != 0.0 + or self.data.physics.temp_plasma_pedestal_electron_kev != 0.0 or self.data.physics.temp_plasma_separatrix_kev != 0.0 or self.data.physics.nd_plasma_pedestal_electron != 0.0 or self.data.physics.nd_plasma_separatrix_electron != 0.0 @@ -116,7 +116,8 @@ def parabolic_parameterisation(self): "Parabolic plasma profiles is used for an L-Mode plasma, " "but the physics variables do not describe an L-Mode plasma. " "'radius_plasma_pedestal_temp_norm', " - "'radius_plasma_pedestal_density_norm', 'temp_plasma_pedestal_kev', " + "'radius_plasma_pedestal_density_norm', " + "'temp_plasma_pedestal_electron_kev', " "'temp_plasma_separatrix_kev', 'nd_plasma_pedestal_electron', " "'nd_plasma_separatrix_electron', " "and 'tbeta' have all been reset to L-Mode appropriate values" @@ -124,7 +125,7 @@ def parabolic_parameterisation(self): self.data.physics.radius_plasma_pedestal_temp_norm = 1.0e0 self.data.physics.radius_plasma_pedestal_density_norm = 1.0e0 - self.data.physics.temp_plasma_pedestal_kev = 0.0e0 + self.data.physics.temp_plasma_pedestal_electron_kev = 0.0e0 self.data.physics.temp_plasma_separatrix_kev = 0.0e0 self.data.physics.nd_plasma_pedestal_electron = 0.0e0 self.data.physics.nd_plasma_separatrix_electron = 0.0e0 diff --git a/process/models/physics/profiles.py b/process/models/physics/profiles.py index 30c8e2b474..f55e68786e 100644 --- a/process/models/physics/profiles.py +++ b/process/models/physics/profiles.py @@ -389,7 +389,7 @@ def run(self): rho=self.profile_x, radius_plasma_pedestal_temp_norm=self.data.physics.radius_plasma_pedestal_temp_norm, temp_on_axis_kev=self.data.physics.temp_plasma_electron_on_axis_kev, - temp_pedestal_kev=self.data.physics.temp_plasma_pedestal_kev, + temp_pedestal_kev=self.data.physics.temp_plasma_pedestal_electron_kev, temp_separatrix_kev=self.data.physics.temp_plasma_separatrix_kev, alphat=self.data.physics.alphat, tbeta=self.data.physics.tbeta, @@ -560,7 +560,7 @@ def set_physics_variables(self): case PlasmaProfileShapeType.PEDESTAL_PROFILE: self.data.physics.temp_plasma_electron_on_axis_kev = self.calculate_pedestal_profile_on_axis_temperature( # noqa: E501 radius_plasma_pedestal_temp_norm=self.data.physics.radius_plasma_pedestal_temp_norm, - temp_pedestal_kev=self.data.physics.temp_plasma_pedestal_kev, + temp_pedestal_kev=self.data.physics.temp_plasma_pedestal_electron_kev, temp_separatrix_kev=self.data.physics.temp_plasma_separatrix_kev, temp_vol_avg_kev=self.data.physics.temp_plasma_electron_vol_avg_kev, alphat=self.data.physics.alphat, @@ -645,7 +645,7 @@ def run(self): self.profile_dx = self.electron_temperature_profile.profile_dx self.calculate_profile_y() self.integrate_profile_y() - + self.data.physics.temp_plasma_ion_on_axis_kev = ( self.data.physics.temp_plasma_ion_vol_avg_kev / self.data.physics.temp_plasma_electron_vol_avg_kev diff --git a/tests/integration/data/large_tokamak_eval.IN.DAT b/tests/integration/data/large_tokamak_eval.IN.DAT index 5c60b545d2..e6d685d6b6 100644 --- a/tests/integration/data/large_tokamak_eval.IN.DAT +++ b/tests/integration/data/large_tokamak_eval.IN.DAT @@ -294,7 +294,7 @@ plasma_res_factor = 0.7 * plasma resistivity pre-factor radius_plasma_pedestal_density_norm = 0.94 * r/a of density pedestal (`i_plasma_pedestal==1`) radius_plasma_pedestal_temp_norm = 0.94 * r/a of temperature pedestal (`i_plasma_pedestal==1`) tbeta = 2.0 * temperature profile index beta (`i_plasma_pedestal==1) -temp_plasma_pedestal_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') +temp_plasma_pedestal_electron_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') temp_plasma_separatrix_kev = 0.1 * electron temperature at separatrix (keV) (`i_plasma_pedestal==1`) calculated if reinke i_confinement_time = 34 * switch for energy confinement time scaling law (see description in `labels_confinement_scalings`) i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation; diff --git a/tests/regression/input_files/large_tokamak_eval.IN.DAT b/tests/regression/input_files/large_tokamak_eval.IN.DAT index efc4c37dd2..a21942b459 100644 --- a/tests/regression/input_files/large_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/large_tokamak_eval.IN.DAT @@ -295,7 +295,7 @@ plasma_res_factor = 0.7 * plasma resistivity pre-factor radius_plasma_pedestal_density_norm = 0.94 * r/a of density pedestal (`i_plasma_pedestal==1`) radius_plasma_pedestal_temp_norm = 0.94 * r/a of temperature pedestal (`i_plasma_pedestal==1`) tbeta = 2.0 * temperature profile index beta (`i_plasma_pedestal==1) -temp_plasma_pedestal_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') +temp_plasma_pedestal_electron_kev = 5.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1') temp_plasma_separatrix_kev = 0.1 * electron temperature at separatrix (keV) (`i_plasma_pedestal==1`) calculated if reinke i_confinement_time = 34 * switch for energy confinement time scaling law (see description in `labels_confinement_scalings`) i_plasma_geometry = 0 * switch for plasma cross-sectional shape calculation; diff --git a/tests/regression/input_files/large_tokamak_nof.IN.DAT b/tests/regression/input_files/large_tokamak_nof.IN.DAT index 828a3a6e34..9c83374ce7 100644 --- a/tests/regression/input_files/large_tokamak_nof.IN.DAT +++ b/tests/regression/input_files/large_tokamak_nof.IN.DAT @@ -387,7 +387,7 @@ radius_plasma_pedestal_temp_norm = 0.94 tbeta = 2.0 * Electron temperature of pedestal (kev) (i_plasma_pedestal=1) -temp_plasma_pedestal_kev = 5.5 +temp_plasma_pedestal_electron_kev = 5.5 * Electron temperature at separatrix (kev) (i_plasma_pedestal=1) temp_plasma_separatrix_kev = 0.1 diff --git a/tests/regression/input_files/low_aspect_ratio_DEMO.IN.DAT b/tests/regression/input_files/low_aspect_ratio_DEMO.IN.DAT index c509d2339d..2fd57cdc27 100644 --- a/tests/regression/input_files/low_aspect_ratio_DEMO.IN.DAT +++ b/tests/regression/input_files/low_aspect_ratio_DEMO.IN.DAT @@ -440,7 +440,7 @@ tbeta = 2.0 * DESCRIPTION: Temperature profile index beta * JUSTIFICATION: -temp_plasma_pedestal_kev = 4.199 +temp_plasma_pedestal_electron_kev = 4.199 * DESCRIPTION: Electron temperature of pedestal (kev) * JUSTIFICATION: Initial value - then over written by ieped=1 scaling diff --git a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT index b3e92c2df9..a6c74da828 100644 --- a/tests/regression/input_files/spherical_tokamak_eval.IN.DAT +++ b/tests/regression/input_files/spherical_tokamak_eval.IN.DAT @@ -277,7 +277,7 @@ i_pfirsch_schluter_current = 1 * switch for Pfirsch-Schlüter current scaling (i radius_plasma_pedestal_density_norm = 0.95 * r/a of density pedestal (`i_plasma_pedestal==1`) radius_plasma_pedestal_temp_norm = 0.925 * r/a of temperature pedestal (`i_plasma_pedestal==1`) tbeta = 2.0 * temperature profile index beta (`i_plasma_pedestal==1) -temp_plasma_pedestal_kev = 4.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1`) +temp_plasma_pedestal_electron_kev = 4.5 * electron temperature of pedestal (keV) (`i_plasma_pedestal==1`) temp_plasma_separatrix_kev = 0.125 * electron temperature at separatrix (keV) (`i_plasma_pedestal==1`) calculated if reinke i_plasma_geometry = 0 * switch for plasma elongation and triangularity calculations; itart = 1 * switch for spherical tokamak (ST) models; diff --git a/tests/regression/input_files/st_regression.IN.DAT b/tests/regression/input_files/st_regression.IN.DAT index 2a346db5ac..a8a4d51f68 100644 --- a/tests/regression/input_files/st_regression.IN.DAT +++ b/tests/regression/input_files/st_regression.IN.DAT @@ -502,7 +502,7 @@ tbeta = 2.0 * DESCRIPTION: Temperature Profile Index Beta * JUSTIFICATION: -temp_plasma_pedestal_kev = 4.5 +temp_plasma_pedestal_electron_kev = 4.5 * DESCRIPTION: Electron Temperature of Pedestal top (keV) * JUSTIFICATION: diff --git a/tests/unit/models/physics/test_physics.py b/tests/unit/models/physics/test_physics.py index 4682d83180..c8424a93d5 100644 --- a/tests/unit/models/physics/test_physics.py +++ b/tests/unit/models/physics/test_physics.py @@ -344,7 +344,7 @@ class BootstrapFractionSauterParam(NamedTuple): f_plasma_fuel_helium3: Any = None - temp_plasma_pedestal_kev: Any = None + temp_plasma_pedestal_electron_kev: Any = None nd_plasma_electrons_vol_avg: Any = None @@ -392,7 +392,7 @@ class BootstrapFractionSauterParam(NamedTuple): plasma_current=16528278.760008096, a_plasma_poloidal=38.39822223637151, f_plasma_fuel_helium3=0, - temp_plasma_pedestal_kev=5.5, + temp_plasma_pedestal_electron_kev=5.5, nd_plasma_electrons_vol_avg=8.016748468651018e19, temp_plasma_electron_vol_avg_kev=12.570861186498382, rmajor=8, @@ -438,7 +438,7 @@ def test_bootstrap_fraction_sauter(bootstrapfractionsauterparam, monkeypatch, ph "plasma_current", "a_plasma_poloidal", "f_plasma_fuel_helium3", - "temp_plasma_pedestal_kev", + "temp_plasma_pedestal_electron_kev", "nd_plasma_electrons_vol_avg", "temp_plasma_electron_vol_avg_kev", "rmajor", @@ -901,7 +901,7 @@ class BootstrapFractionSugiyamaHModeParam(NamedTuple): radius_plasma_pedestal_density_norm: Any = None nd_plasma_pedestal_electron: Any = None n_greenwald: Any = None - temp_plasma_pedestal_kev: Any = None + temp_plasma_pedestal_electron_kev: Any = None expected_bfs: Any = None @@ -920,7 +920,7 @@ class BootstrapFractionSugiyamaHModeParam(NamedTuple): radius_plasma_pedestal_density_norm=0.9, nd_plasma_pedestal_electron=6.0e19, n_greenwald=8.0e19, - temp_plasma_pedestal_kev=5.0, + temp_plasma_pedestal_electron_kev=5.0, expected_bfs=0.5875359328840783, ), BootstrapFractionSugiyamaHModeParam( @@ -935,7 +935,7 @@ class BootstrapFractionSugiyamaHModeParam(NamedTuple): radius_plasma_pedestal_density_norm=0.85, nd_plasma_pedestal_electron=5.5e19, n_greenwald=7.5e19, - temp_plasma_pedestal_kev=4.5, + temp_plasma_pedestal_electron_kev=4.5, expected_bfs=0.40154857221044604, ), # JA-DEMO steady state case from the paper @@ -951,7 +951,7 @@ class BootstrapFractionSugiyamaHModeParam(NamedTuple): radius_plasma_pedestal_density_norm=0.91, nd_plasma_pedestal_electron=0.98e20, n_greenwald=1e20, - temp_plasma_pedestal_kev=6.0, + temp_plasma_pedestal_electron_kev=6.0, expected_bfs=0.5634482876932788, ), # ITER 15MA case from the paper @@ -967,7 +967,7 @@ class BootstrapFractionSugiyamaHModeParam(NamedTuple): radius_plasma_pedestal_density_norm=0.93, nd_plasma_pedestal_electron=0.75e20, n_greenwald=1e20, - temp_plasma_pedestal_kev=6.0, + temp_plasma_pedestal_electron_kev=6.0, expected_bfs=0.2770187998673241, ), ], @@ -994,7 +994,7 @@ def test_bootstrap_fraction_sugiyama_h_mode(bootstrapfractionsugiyamahparam, phy radius_plasma_pedestal_density_norm=bootstrapfractionsugiyamahparam.radius_plasma_pedestal_density_norm, nd_plasma_pedestal_electron=bootstrapfractionsugiyamahparam.nd_plasma_pedestal_electron, n_greenwald=bootstrapfractionsugiyamahparam.n_greenwald, - temp_plasma_pedestal_kev=bootstrapfractionsugiyamahparam.temp_plasma_pedestal_kev, + temp_plasma_pedestal_electron_kev=bootstrapfractionsugiyamahparam.temp_plasma_pedestal_electron_kev, ) assert bfs == pytest.approx(bootstrapfractionsugiyamahparam.expected_bfs) diff --git a/tests/unit/models/physics/test_plasma_profiles.py b/tests/unit/models/physics/test_plasma_profiles.py index 4a8343e2f3..90793daab9 100644 --- a/tests/unit/models/physics/test_plasma_profiles.py +++ b/tests/unit/models/physics/test_plasma_profiles.py @@ -95,7 +95,7 @@ class TeProfileParam(NamedTuple): temp_plasma_separatrix_kev: float = 0.0 i_plasma_pedestal: float = 0.0 alphat: float = 0.0 - temp_plasma_pedestal_kev: float = 0.0 + temp_plasma_pedestal_electron_kev: float = 0.0 expected_teprofile: Any = np.array @@ -108,7 +108,7 @@ class TeProfileParam(NamedTuple): temp_plasma_separatrix_kev=0.10000000000000001, i_plasma_pedestal=1, alphat=1.45, - temp_plasma_pedestal_kev=5.5, + temp_plasma_pedestal_electron_kev=5.5, expected_teprofile=[ 18.85, 18.739472621498333, @@ -208,7 +208,7 @@ class PlasmaProfilesParam(NamedTuple): nd_plasma_electrons_vol_avg: float = 0.0 - temp_plasma_pedestal_kev: float = 0.0 + temp_plasma_pedestal_electron_kev: float = 0.0 alphan: float = 0.0 @@ -278,7 +278,7 @@ class PlasmaProfilesParam(NamedTuple): temp_plasma_ion_vol_avg_kev=12.9, radius_plasma_pedestal_density_norm=0.94000000000000006, nd_plasma_electrons_vol_avg=7.983e19, - temp_plasma_pedestal_kev=5.5, + temp_plasma_pedestal_electron_kev=5.5, alphan=1, te=13.07, rho_ne_max=0.0, @@ -324,7 +324,7 @@ class PlasmaProfilesParam(NamedTuple): temp_plasma_ion_vol_avg_kev=13.07, radius_plasma_pedestal_density_norm=0.94000000000000006, nd_plasma_electrons_vol_avg=7.983e19, - temp_plasma_pedestal_kev=5.5, + temp_plasma_pedestal_electron_kev=5.5, alphan=1, te=13.07, rho_ne_max=0.0, @@ -485,8 +485,8 @@ def test_plasma_profiles(plasmaprofilesparam, monkeypatch, plasmaprofile): monkeypatch.setattr( plasmaprofile.data.physics, - "temp_plasma_pedestal_kev", - plasmaprofilesparam.temp_plasma_pedestal_kev, + "temp_plasma_pedestal_electron_kev", + plasmaprofilesparam.temp_plasma_pedestal_electron_kev, ) monkeypatch.setattr(plasmaprofile.data.physics, "alphan", plasmaprofilesparam.alphan) diff --git a/tracking/tracking_data.py b/tracking/tracking_data.py index 9877d4d482..acf76e4ba0 100644 --- a/tracking/tracking_data.py +++ b/tracking/tracking_data.py @@ -120,7 +120,7 @@ "Physics.hfact", "Physics.kappa", "Physics.p_fusion_total_mw", - "Physics.temp_plasma_pedestal_kev", + "Physics.temp_plasma_pedestal_electron_kev", "Physics.p_plasma_loss_mw", "Physics.kappa95", "Physics.nd_plasma_pedestal_electron", From b487ae00747cd8e3140fd1b924f09815c8f8d14a Mon Sep 17 00:00:00 2001 From: mn3981 Date: Thu, 17 Sep 2026 09:52:16 +0100 Subject: [PATCH 09/12] - Updated variable names from `temp_plasma_separatrix_kev` to `temp_plasma_separatrix_electron_kev` across multiple files, including documentation, input files, and code logic. --- .../profiles/plasma_profiles.md | 6 +++--- .../profiles/plasma_temperature_profile.md | 4 ++-- examples/data/large_tokamak_eval_IN.DAT | 2 +- ...rge_tokamak_varied_min_net_electric_IN.DAT | 2 +- examples/data/large_tokamak_varyrun_IN.DAT | 2 +- process/core/data_structure/obsolete_vars.py | 4 +++- process/core/init.py | 18 +++++++++--------- process/core/input.py | 4 +++- process/core/io/mfile/comparison.py | 2 +- process/core/io/plot/summary.py | 19 ++++++++++++------- process/core/solver/iteration_variables.py | 2 +- process/data_structure/numerics.py | 4 ++-- process/data_structure/physics_variables.py | 2 +- process/models/physics/current_drive.py | 6 +++--- process/models/physics/physics.py | 12 ++++++------ process/models/physics/plasma_profiles.py | 6 +++--- process/models/physics/profiles.py | 4 ++-- .../data/large_tokamak_eval.IN.DAT | 2 +- .../input_files/large_tokamak_eval.IN.DAT | 2 +- .../input_files/large_tokamak_nof.IN.DAT | 2 +- .../input_files/low_aspect_ratio_DEMO.IN.DAT | 2 +- .../input_files/spherical_tokamak_eval.IN.DAT | 2 +- .../input_files/st_regression.IN.DAT | 2 +- tests/unit/models/physics/test_physics.py | 6 +++--- .../models/physics/test_plasma_profiles.py | 14 +++++++------- tracking/tracking_data.py | 2 +- 26 files changed, 71 insertions(+), 62 deletions(-) diff --git a/documentation/source/physics-models/profiles/plasma_profiles.md b/documentation/source/physics-models/profiles/plasma_profiles.md index bdc5884d60..00166a8fda 100644 --- a/documentation/source/physics-models/profiles/plasma_profiles.md +++ b/documentation/source/physics-models/profiles/plasma_profiles.md @@ -141,7 +141,7 @@ $\alpha_T$ as well as the second exponent $\beta_T$ (input parameter `tbeta`, not to be confused with the plasma beta) in the temperature profile can be chosen by the user, as can the pedestal heights and the values at the separatrix (`nd_plasma_pedestal_electron, nd_plasma_separatrix_electron` for the electron density, and -`temp_plasma_pedestal_electron_kev, temp_plasma_separatrix_kev` for the electron temperature); the ion equivalents are +`temp_plasma_pedestal_electron_kev, temp_plasma_separatrix_electron_kev` for the electron temperature); the ion equivalents are scaled from the electron values by the ratio of the volume-averaged values). !!! note "$\beta_T$ setting" @@ -159,7 +159,7 @@ A table of the the associated variables can be seen below | Pedestal radius (r/a) | `radius_plasma_pedestal_density_norm`, $\rho_{\text{ped},n}$ | `radius_plasma_pedestal_temp_norm`, $\rho_{\text{ped},T}$ | | Plasma centre value | `nd_plasma_electron_on_axis`, $n_0$ | `temp_plasma_electron_on_axis_kev`, $T_0$ | | Pedestal value | `nd_plasma_pedestal_electron`, $n_{\text{ped}}$ | `temp_plasma_pedestal_electron_kev`, $T_{\text{ped}}$ | -| Separatrix value | `nd_plasma_separatrix_electron`, $n_{\text{sep}}$ | `temp_plasma_separatrix_kev`, $T_{\text{sep}}$ | +| Separatrix value | `nd_plasma_separatrix_electron`, $n_{\text{sep}}$ | `temp_plasma_separatrix_electron_kev`, $T_{\text{sep}}$ | | Profile index/ peaking parameter | `alphan`, $\alpha_n$ | `alphat`, $\alpha_T$ | | Profile index $\beta$ | | `tbeta`, $\beta_T$ | @@ -190,7 +190,7 @@ The graph below is for a standard pedestal profile. You can vary its attributes