Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
7f695be
Add PlasmaBeta class and integrate into Physics initialization
chris-ashe Jan 20, 2026
0f83486
Refactor beta normalization calculations to use PlasmaBeta class methods
chris-ashe Jan 20, 2026
dac541f
Add static method to PlasmaBeta for calculating normalized beta
chris-ashe Jan 20, 2026
4e188d9
Refactor beta information output to PlasmaBeta class for improved org…
chris-ashe Jan 20, 2026
ce7c700
Move total normalised beta calc to outside of calculate_plasma_current
chris-ashe Jan 20, 2026
3037090
Add static method to PlasmaBeta for calculating plasma energy from beta
chris-ashe Jan 20, 2026
54fd070
Refactor plasma energy calculations to use PlasmaBeta methods for imp…
chris-ashe Jan 20, 2026
108a973
Refactor fast alpha beta calculation into PlasmaBeta class and remove…
chris-ashe Jan 20, 2026
ec47444
Refactor beta limit calculation into PlasmaBeta class and remove redu…
chris-ashe Jan 21, 2026
8aac633
Refactor poloidal beta calculation to use PlasmaBeta class methods an…
chris-ashe Jan 21, 2026
3479671
Refactor thermal beta normalization calculation to use PlasmaBeta cla…
chris-ashe Jan 21, 2026
434b971
Refactor beta norm max calculation to use PlasmaBeta class property f…
chris-ashe Jan 21, 2026
8003b11
Refactor beta norm max calculation to use BetaNormMaxModel Enum metho…
chris-ashe Jan 21, 2026
0917629
Update plasma beta documentation to include function references for W…
chris-ashe Jan 28, 2026
cab4522
Refactor plasma current documentation for clarity and consistency in …
chris-ashe Jan 28, 2026
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
23 changes: 17 additions & 6 deletions documentation/physics-models/plasma_beta/plasma_beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ beta_norm_max = 3.0

---------

#### Wesson Relation
#### Wesson Relation | `calculate_beta_norm_max_wesson()`

This can be activated by stating `i_beta_norm_max = 1` in the input file.

Expand All @@ -188,7 +188,7 @@ This is only recommended for high aspect ratio tokamaks[^3].

---------

#### Original Scaling Law
#### Original Scaling Law | `calculate_beta_norm_max_original()`

This can be activated by stating `i_beta_norm_max = 2` in the input file.

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

---------

#### Menard Beta Relation
#### Menard Beta Relation | `calculate_beta_norm_max_menard()`

This can be activated by stating `i_beta_norm_max = 3` in the input file.

Expand Down Expand Up @@ -345,7 +345,7 @@ Found as a reasonable fit to the computed no wall limit at $f_{\text{BS}} \appro

---------

#### Tholerus Relation
#### Tholerus Relation | `calculate_beta_norm_max_thloreus()`

This can be activated by stating `i_beta_norm_max = 4` in the input file.

Expand All @@ -362,7 +362,7 @@ where $F_p$ is the pressure peaking, $F_p = p_{\text{ax}} / \langle p \rangle$ a

-------------

#### Stambaugh Relation
#### Stambaugh Relation | `calculate_beta_norm_max_stambaugh()`

This can be activated by stating `i_beta_norm_max = 5` in the input file.

Expand All @@ -377,13 +377,24 @@ This fit was done for $A = 1.2 -7.0, \kappa = 1.5-6.0$ with $\delta = 0.5$ for n

---------

## Stored energy | `calculate_plasma_energy_from_beta()`

As the $\beta$ metric is simply the ratio between the kinetic pressure of the plasma and the magnetic pressure, $\beta$ can be used to get the total kinetic energy of the plasma (assuming the total $\beta$ is used).


$$
E_{\text{plasma}} \approx \frac{3}{2}\frac{\beta B^2}{2\mu_0}V_{\text{plasma}}
$$

---------------

## Key Constraints

### Beta consistency

This constraint can be activated by stating `icc = 1` in the input file.

Ensures the relationship between $\beta$, density, temperature and total magnetic field is withheld by checking the fixed input or iteration variable $\mathtt{beta}$ is consistent in value with the rest of the physics parameters
Ensures the relationship between $\beta$, density, temperature and total magnetic field is withheld by checking the fixed input or iteration variable $\texttt{beta}$ is consistent in value with the rest of the physics parameters

$$
\texttt{beta_total_vol_avg} \equiv \frac{2\mu_0 \langle n_{\text{e}}T_{\text{e}}+n_{\text{i}}T_{\text{i}}\rangle}{B^2} + \beta_{\alpha} + \beta_{\text{beam}}
Expand Down
18 changes: 4 additions & 14 deletions documentation/physics-models/plasma_current/plasma_current.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Instead of $q_a$, $q_{95}$ is used as in plasma configurations with divertors th

## Plasma Current Calculation | `calculate_plasma_current()`

This function calculates the plasma current shaping factor ($f_q$), plasma current ($I_{\text{p}}$), qstar ($q^*$), normalized beta ($\beta_{\text{N}}$) and then poloidal field and the profile settings for $\mathtt{alphaj}$ ($\alpha_J$) and $\mathtt{ind_plasma_internal_norm}$ ($l_{\mathtt{i}}$). This is done in 5 separate steps which are shown in the following numbered sections.
This function calculates the plasma current shaping factor ($f_q$), plasma current ($I_{\text{p}}$), qstar ($q^*$) and then poloidal field and the profile settings for $\texttt{alphaj}$ ($\alpha_J$) and $\texttt{ind_plasma_internal_norm}$ ($l_{\text{i}}$). This is done in 5 separate steps which are shown in the following numbered sections.


$$\begin{aligned}
Expand All @@ -118,7 +118,7 @@ The formula for calculating `fq` is:

$$f_q = \left(\frac{{1.22 - 0.68 \epsilon}}{{(1.0 - \epsilon^2)^2}}\right) \left(\frac{L_{\text{poloidal}}}{2\pi a}\right)^2$$

Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\mathtt{eps}$) and $L_{\text{poloidal}}$ is the poloidal perimeter of the plasma.
Where $\epsilon$ is the inverse [aspect ratio](../plasma_geometry.md) ($\texttt{eps}$) and $L_{\text{poloidal}}$ is the poloidal perimeter of the plasma.

-----------

Expand Down Expand Up @@ -523,23 +523,13 @@ $$

--------------

### 3. Calculate the normalized beta

The total normalized beta is calculated as per:

$$
\beta_N = \beta\frac{1\times10^8 a B_{\text{T}}}{I_{\text{P}}}
$$


-----------------

### 4. Plasma Current Poloidal Field
### 3. Plasma Current Poloidal Field

For calculating the poloidal magnetic field created due to the presence of the plasma current, [Ampere's law](https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law) can be used. In this case the poloidal field is simply returned as:

$$
B_{\text{p}} = \frac{\mu_0 I_{\text{p}}}{\mathtt{len_plasma_poloidal}}
B_{\text{p}} = \frac{\mu_0 I_{\text{p}}}{\texttt{len_plasma_poloidal}}
$$

Where `len_plasma_poloidal` is the plasma poloidal perimeter calculated [here](../plasma_geometry.md#poloidal-perimeter).
Expand Down
8 changes: 6 additions & 2 deletions process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
)
from process.log import logging_model_handler, show_errors
from process.pfcoil import PFCoil
from process.physics import DetailedPhysics, Physics
from process.physics import DetailedPhysics, Physics, PlasmaBeta
from process.plasma_geometry import PlasmaGeom
from process.plasma_profiles import PlasmaProfile
from process.power import Power
Expand Down Expand Up @@ -682,8 +682,11 @@ def __init__(self):
neutral_beam=NeutralBeam(plasma_profile=self.plasma_profile),
electron_bernstein=ElectronBernstein(plasma_profile=self.plasma_profile),
)
self.plasma_beta = PlasmaBeta()
self.physics = Physics(
plasma_profile=self.plasma_profile, current_drive=self.current_drive
plasma_profile=self.plasma_profile,
current_drive=self.current_drive,
plasma_beta=self.plasma_beta,
)
self.physics_detailed = DetailedPhysics(
plasma_profile=self.plasma_profile,
Expand All @@ -700,6 +703,7 @@ def __init__(self):
current_drive=self.current_drive,
physics=self.physics,
neoclassics=self.neoclassics,
plasma_beta=self.plasma_beta,
)
self.dcll = DCLL(fw=self.fw)

Expand Down
Loading