Skip to content
Draft
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Density Profile | `NeProfile(Profile)`
# Density Profile | `ElectronDensityProfile(Profile)`

The density 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) 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.

Expand All @@ -19,7 +19,7 @@ $$
n_{\text{i0}} = \left(\frac{n_\text{i}}{n_\text{e}}\right)n_{\text{e0}}
$$

#### Electron core density of a pedestalised profile | `ncore()`
#### Electron core density of a pedestalised profile | `calculate_pedestal_profile_on_axis_density()`

This function calculates the core electron density for a pedestalsied profile (`i_plasma_pedestal == 1`). It takes in values of

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

In `PROCESS` the density, temperature and current profiles of the plasma for electrons and ions can take two forms depending on the switch value for `i_plasma_pedestal`. Either without a [pedestal](http://fusionwiki.ciemat.es/wiki/Pedestal), `i_plasma_pedestal == 0` or with a pedestal `i_plasma_pedestal == 1`. `i_plasma_pedestal == 0` is better suited for modelling L-mode plasmas, while `i_plasma_pedestal == 1` is better suited for modelling [H-mode](https://en.wikipedia.org/wiki/High-confinement_mode) plasmas.

The files responsible for calculating and storing the profiles are `plasma_profiles.py` and `profiles.py`. A central plasma profile object is created from the [`PlasmaProfile`](plasma_profiles.md#plasma-profile-class-plasmaprofile) class that contains attributes for the plasma density and temperature. The density and temperature profiles are in themselves objects of the [`Profile`](./plasma_profiles_abstract_class.md) abstract base class. [`Profile`](./plasma_profiles_abstract_class.md), [`NeProfile`](plasma_density_profile.md) and [`TeProfile`](./plasma_temperature_profile.md) are all defined in `profiles.py`. [`PlasmaProfile`](plasma_profiles.md#plasma-profile-class-plasmaprofile) is exclusively in `plasma_profiles.py`
The files responsible for calculating and storing the profiles are `plasma_profiles.py` and `profiles.py`. A central plasma profile object is created from the [`PlasmaProfile`](plasma_profiles.md#plasma-profile-class-plasmaprofile) class that contains attributes for the plasma density and temperature. The density and temperature profiles are in themselves objects of the [`Profile`](./plasma_profiles_abstract_class.md) abstract base class. [`Profile`](./plasma_profiles_abstract_class.md), [`ElectronDensityProfile`](plasma_density_profile.md) and [`ElectronTemperatureProfile`](./plasma_temperature_profile.md) are all defined in `profiles.py`. [`PlasmaProfile`](plasma_profiles.md#plasma-profile-class-plasmaprofile) is exclusively in `plasma_profiles.py`

<figure markdown>
![UML of profiles](./uml_classes_PlasmaProfile.png){height="1000px"}
Expand Down Expand Up @@ -238,7 +238,7 @@ The graph below is for a standard pedestal profile. You can vary its attributes

## Plasma Profile Class | `PlasmaProfile`
### Initialization | `__init__()`
The parent plasma profile class is `PlasmaProfile`. Initialization sets the profile class size and `neprofile` and `teprofile` to [`NeProfile`](plasma_density_profile.md) & [`TeProfile`](plasma_temperature_profile.md) objects from `profiles.py`
The parent plasma profile class is `PlasmaProfile`. Initialization sets the profile class size and `neprofile` and `teprofile` to [`ElectronDensityProfile`](plasma_density_profile.md) & [`ElectronTemperatureProfile`](plasma_temperature_profile.md) objects from `profiles.py`

???+ Note

Expand Down Expand Up @@ -266,7 +266,7 @@ Depending on the value of `i_plasma_pedestal` different functions will be ran, t

If pedestal profile values are set they are reset to have values that agree with the original form of the parabolic profiles. Such that $\rho_{\text{ped}} = 1$ and that pedestal and separatrix densities and temperatures are zero. This will then warn the user in the terminal.

The density and temperature profile runner function [`TeProfile/NeProfile.run()`](plasma_density_profile.md#runner-function-run) is then called to re-calculate the profile and core values.
The density and temperature profile runner function [`ElectronTemperatureProfile/ElectronDensityProfile.run()`](plasma_density_profile.md#runner-function-run) is then called to re-calculate the profile and core values.

Ratio of density-weighted to volume-averaged temperature factor is calculated:

Expand Down Expand Up @@ -593,7 +593,7 @@ $$

##### `pedestal_parameterisation()`

The density and temperature profile runner function [`TeProfile/NeProfile.run()`](plasma_density_profile.md#runner-function-run) is firstly called to re-calculate the profile and core values.
The density and temperature profile runner function [`ElectronTemperatureProfile/ElectronDensityProfile.run()`](plasma_density_profile.md#runner-function-run) is firstly called to re-calculate the profile and core values.

Perform integrations to calculate ratio of density-weighted to volume-averaged temperature, etc. Density-weighted temperature = $\frac{\int{nT \ dV}}{\int{n \ dV}}$, which is approximately equal to the ratio $\frac{\int{\rho \ n(\rho) T(\rho) \ d\rho}}{\int{\rho \ n(\rho) \ d\rho}}$

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Temperature Profile | `TeProfile(Profile)`
# 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.

Expand All @@ -14,7 +14,7 @@ The temperature profile class is organised around a central runner function that

The core electron temperature is calculated using the [`tcore`](plasma_temperature_profile.md#electron-core-density-of-a-pedestalised-profile--tcore) method.

#### Electron core density of a pedestalised profile | `tcore()`
#### Electron core density of a pedestalised profile | `calculate_pedestal_profile_on_axis_temperature()`

This function calculates the core electron density for a pedestalsied profile in $\text{keV}$. The inclusion of a new $\beta_T$ exponent term allows a more accurate description of temperature profiles with a triangular shape or a strong gradient near the pedestal (characteristic of regimes with an [internal transport barrier](https://wiki.fusion.ciemat.es/wiki/Internal_Transport_Barrier)).

Expand Down
9 changes: 6 additions & 3 deletions process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@
from process.models.physics.plasma_fields import PlasmaFields
from process.models.physics.plasma_geometry import PlasmaGeom
from process.models.physics.plasma_profiles import PlasmaProfile
from process.models.physics.profiles import NeProfile, TeProfile
from process.models.physics.profiles import (
ElectronDensityProfile,
ElectronTemperatureProfile,
)
from process.models.physics.scrape_off_layer import ScrapeOffLayer
from process.models.power import Power
from process.models.pulse import Pulse
Expand Down Expand Up @@ -664,8 +667,8 @@ def __init__(self, data: DataStructure):
self.pulse = Pulse()
self.shield = Shield()
self.ife = IFE(availability=self.availability, costs=self.costs)
self.ne_profile = NeProfile()
self.te_profile = TeProfile()
self.ne_profile = ElectronDensityProfile()
self.te_profile = ElectronTemperatureProfile()
self.plasma_profile = PlasmaProfile(self.ne_profile, self.te_profile)
self.fw = FirstWall()
self.blanket_library = BlanketLibrary(fw=self.fw)
Expand Down
7 changes: 4 additions & 3 deletions process/models/physics/plasma_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def __init__(self, ne_profile, te_profile):
Args:
profile_size (int): The size of the plasma profile.
outfile (str): The output file path.
neprofile (NeProfile): An instance of the NeProfile class.
teprofile (TeProfile): An instance of the TeProfile class.
neprofile (ElectronDensityProfile): An instance of the ElectronDensityProfile
class.
teprofile (ElectronTemperatureProfile): An instance of the ElectronTemperatureProfile class.
"""
# Default profile_size = 201, but it's possible to experiment with this value.
# See `n_plasma_profile_elements`
Expand Down Expand Up @@ -195,7 +196,7 @@ def pedestal_parameterisation(self):
`temp_plasma_electron_density_weighted_kev` and
`temp_plasma_ion_density_weighted_kev`.
"""
# Run TeProfile and NeProfile class methods:
# Run ElectronTemperatureProfile and ElectronDensityProfile class methods:
# Re-calculate core and profile values

self.teprofile.run()
Expand Down
Loading
Loading