Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3388 update the beta limit section of the docs to be up to date and include all models #3389

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6f7fc48
Refactor culblm function to calculate_beta_limit with enhanced docume…
chris-ashe Nov 8, 2024
efed2dc
Update navigation structure in mkdocs.yml for Beta Limit section. Mov…
chris-ashe Nov 8, 2024
3cbbb23
Rename betaft to beta_fast_alpha across the codebase for consistency …
chris-ashe Nov 8, 2024
77a09f2
Rename switch variable iculbl to i_beta_component for clarity in beta…
chris-ashe Nov 8, 2024
605b29f
Rename betalim to beta_limit_upper for clarity and consistency across…
chris-ashe Nov 8, 2024
7906aa9
Rename betalim_lower to beta_limit_lower for consistency and clarity …
chris-ashe Nov 8, 2024
e5ef4fd
Initial input of beta type constraint equations to docs
chris-ashe Nov 8, 2024
d0b8d15
Rename betpmx to beta_poloidal_max for clarity and consistency across…
chris-ashe Nov 8, 2024
5eedafc
Rename fbetap to fbeta_poloidal for clarity and consistency across th…
chris-ashe Nov 8, 2024
480b79d
Rename betap to beta_poloidal for clarity and consistency across the …
chris-ashe Nov 8, 2024
9338af9
Rename betat to beta_toroidal and add it as a proper physics variable…
chris-ashe Nov 8, 2024
b9aa615
Add comment for normalised total beta calculation and update output l…
chris-ashe Nov 8, 2024
cbed206
Rename betath to beta_thermal and add it as a proper physics variable…
chris-ashe Nov 11, 2024
40eeb88
Add beta_thermal_poloidal and beta_thermal_toroidal variables for the…
chris-ashe Nov 11, 2024
84009f3
Add norm_beta_thermal variable and update output for normalised therm…
chris-ashe Nov 11, 2024
7b8f4cf
Rename normalised_total_beta to norm_beta_total and add norm_beta_tor…
chris-ashe Nov 11, 2024
f4eeaf4
Enhance plasma beta documentation and update fast alpha beta calculat…
chris-ashe Nov 11, 2024
85cc16b
Add more detail for the alpha beta second model and add graph
chris-ashe Nov 12, 2024
9cea2e0
Merge branch 'main' into 3388-update-the-beta-limit-section-of-the-do…
chris-ashe Nov 14, 2024
be43a4e
Rename 'betap' to 'beta_poloidal' in BootstrapFraction parameter clas…
chris-ashe Nov 14, 2024
d44c275
Merge branch 'main' into 3388-update-the-beta-limit-section-of-the-do…
chris-ashe Nov 26, 2024
6daf8c5
:memo: Update plasma beta documentation to clarify relationships and …
chris-ashe Nov 26, 2024
c429df2
Merge branch 'main' into 3388-update-the-beta-limit-section-of-the-do…
chris-ashe Dec 16, 2024
deb4580
Rename norm_beta_thermal to beta_norm_thermal in Python and Fortran f…
chris-ashe Dec 16, 2024
0c404a5
Rename norm_beta_toroidal to beta_norm_toroidal in Python and Fortran…
chris-ashe Dec 16, 2024
6ed6133
Rename norm_beta_poloidal to beta_norm_poloidal in Python and Fortran…
chris-ashe Dec 16, 2024
f1db19f
Rename norm_beta_total to beta_norm_total in Python and Fortran files…
chris-ashe Dec 16, 2024
2761fbe
🔄 Rename dnbeta to beta_norm_limit_upper for consistency across data …
chris-ashe Dec 16, 2024
fa1fc76
🔄 Rename gammaft to f_beta_alpha_beam_thermal for consistency in Fort…
chris-ashe Dec 16, 2024
a0cdf6b
🔄 Rename epbetmax to beta_poloidal_eps_max for consistency across fil…
chris-ashe Dec 16, 2024
b7fbabf
🔄 Add beta_poloidal_eps calculation and documentation for poloidal be…
chris-ashe Dec 16, 2024
3deffdb
🔄 Rename fbetatry to fbeta_max for consistency across data files and …
chris-ashe Dec 16, 2024
a3bc522
🔄 Rename ifalphap to i_beta_fast_alpha for consistency across data fi…
chris-ashe Dec 16, 2024
aee23af
🔄 Rename beta_limit_upper to beta_max for consistency across codebase…
chris-ashe Dec 19, 2024
2e12caf
🔄 Rename beta_norm_limit_upper to beta_norm_max for consistency acros…
chris-ashe Dec 19, 2024
be9b4c3
🔄 Update obsolete_vars.py to rename variables for consistency across …
chris-ashe Dec 19, 2024
3a629bf
🔄 Rename beta_limit_lower to beta_min for consistency across the code…
chris-ashe Dec 19, 2024
43eba4d
🔄 Rename fbetatry_lower to fbeta_min for consistency across the codebase
chris-ashe Dec 19, 2024
9510a25
:bug: Update minimum beta constraint to work on the total beta and no…
chris-ashe Dec 19, 2024
63850d5
🔄 Rename fbeta to fbeta_poloidal_eps for consistency across the codebase
chris-ashe Dec 19, 2024
df4e969
:art: Update plasma_beta.md for clarity and consistency in beta limit…
chris-ashe Dec 19, 2024
f0955d1
:bug: Fix Tholerus pressure peaking parameter and expand docs
chris-ashe Dec 19, 2024
906dddb
Merge branch 'main' into 3388-update-the-beta-limit-section-of-the-do…
chris-ashe Dec 19, 2024
1023e2d
Merge branch 'main' into 3388-update-the-beta-limit-section-of-the-do…
chris-ashe Jan 6, 2025
8a9f514
Add Menard normalized beta limit plotting script
chris-ashe Jan 6, 2025
6ba9406
Add original normalized beta limit plotting script and fix spacing in…
chris-ashe Jan 6, 2025
21bc7de
Add beta_poloidal_max and beta_min to the output file
chris-ashe Jan 6, 2025
d9132ae
:sparkle: Add calculation for plasma thermal energy derived from ther…
chris-ashe Jan 6, 2025
189fdef
Rename total_plasma_internal_energy to e_plasma_beta and update refer…
chris-ashe Jan 6, 2025
6093659
Update output descriptions for plasma thermal energy and total beta e…
chris-ashe Jan 6, 2025
8ec0907
:art: Refactor plasma thermal energy calculation and remove duplicate…
chris-ashe Jan 6, 2025
0f448c3
Update bokeh version requirement to 3.4.0 in development dependencies
chris-ashe Jan 7, 2025
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
4 changes: 2 additions & 2 deletions documentation/proc-pages/development/standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,15 @@ subroutine constraint_eqn_001(args)
!! - \( T_i \) -- density weighted average ion temperature [keV]
!! - \( B_{tot} \) -- total toroidal + poloidal field [T]

use physics_variables, only: betaft, beta_beam, dene, ten, dnitot, tin, btot, beta
use physics_variables, only: beta_fast_alpha, beta_beam, dene, ten, dnitot, tin, btot, beta
use constants, only: electron_charge,rmu0

implicit none

type(constraint_args_type), intent(out) :: args
!! constraint derived type

args%cc = 1.0D0 - (betaft + beta_beam + &
args%cc = 1.0D0 - (beta_fast_alpha + beta_beam + &
2.0D3*rmu0*electron_charge * (dene*ten + dnitot*tin)/btot**2 )/beta
args%con = beta * (1.0D0 - args%cc)
args%err = beta * args%cc
Expand Down
2 changes: 1 addition & 1 deletion documentation/proc-pages/fusion-devices/stellarator.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Stellarators try to achieve zero plasma current in order to allow safe divertor
### Beta limit

The stellarator version calculates the plasma beta based on the input parameter and it is thus not necessary to Differently to the tokamak version,
The beta limit is assumed to be 5%, based on 3-D MHD calculations[^7]. To apply the beta limit, constraint equation no. 24 should be turned on with iteration variable no. 36 (`fbetatry`).
The beta limit is assumed to be 5%, based on 3-D MHD calculations[^7]. To apply the beta limit, constraint equation no. 24 should be turned on with iteration variable no. 36 (`fbeta_max`).

### Density limit

Expand Down
18 changes: 9 additions & 9 deletions documentation/proc-pages/physics-models/error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ where \(B_0\) is the axial vacuum toroidal field, and \(\beta\) is
defined with respect to the total equilibrium \(\mathbf{B}\)-field
\footnote{T. C. Hender et al., `Physics Assessment for the European
Reactor Study', AEA Fusion Report AEA FUS 172 (1992)}. The beta
coefficient \(g\) is set using input parameter \texttt{dnbeta}. To apply
coefficient \(g\) is set using input parameter \texttt{beta_norm_max}. To apply
the beta limit, constraint equation no. 24 should be turned on with
iteration variable no. 36 (\texttt{fbetatry}). The limit can be applied
iteration variable no. 36 (\texttt{fbeta_max}). The limit can be applied
to either the total plasma beta, in which case switch \texttt{iculbl}
should be set to 0, to only the thermal component of the plasma beta, in
which case \texttt{iculbl} should be set to 1, or to the thermal plus
Expand All @@ -401,7 +401,7 @@ neutral beam components, in which case \texttt{iculbl} should be set to
coefficient}{Aspect ratio scaling of beta g coefficient}}\label{aspect-ratio-scaling-of-beta-g-coefficient}

Switch \texttt{gtscale} determines whether the beta \(g\) coefficient
\texttt{dnbeta} should scale with aspect ratio
\texttt{beta_norm_max} should scale with aspect ratio
(\(\mathtt{gtscale \not= 0}\)), or be fixed at the input value
(\texttt{gtscale\ =\ 0\}}). Note that \texttt{gtscale} is over-ridden if
\texttt{iprofile} = 1.
Expand All @@ -411,14 +411,14 @@ Switch \texttt{gtscale} determines whether the beta \(g\) coefficient

To apply a limit to the value of \(\epsilon.\beta_p\), where
\(\epsilon = a/R\) is the inverse aspect ratio, constraint equation no.
6 should be turned on with iteration variable no. 8 (\texttt{fbeta}).
6 should be turned on with iteration variable no. 8 (\texttt{fbeta_poloidal_eps}).
The limiting value of \(\epsilon.\beta_p\) should be set using input
parameter \texttt{epbetmax}.
parameter \texttt{beta_poloidal_eps_max}.

\subsection{Fast Alpha Pressure
Contribution}\label{fast-alpha-pressure-contribution}

Switch \texttt{ifalphap} may be used to select the model used to
Switch \texttt{i_beta_fast_alpha} may be used to select the model used to
calculate the pressure contribution from the fast alpha particles, there
are two options 1\footnote{N.A. Uckan and ITER Physics Group, `ITER
Physics Design Guidelines: 1989', ITER Documentation Series, No. 10,
Expand All @@ -428,10 +428,10 @@ are two options 1\footnote{N.A. Uckan and ITER Physics Group, `ITER
\[\begin{aligned}
\frac{\beta_{\alpha}}{\beta_{th}} & = 0.29 \, \left( \langle T_{10} \rangle -
0.37 \right) \, \left( \frac{n_{DT}}{n_e} \right)^2
\hspace{20mm} \mbox{ifalphap = 0} \\
\hspace{20mm} \mbox{i_beta_fast_alpha = 0} \\
\frac{\beta_{\alpha}}{\beta_{th}} & = 0.26 \, \left( \langle T_{10} \rangle -
0.65 \right)^{0.5} \, \left( \frac{n_{DT}}{n_e} \right)^2
\hspace{16mm} \mbox{ifalphap = 1 (default)}
\hspace{16mm} \mbox{i_beta_fast_alpha = 1 (default)}
\end{aligned}\]

The latter model is a better estimate at higher temperatures.
Expand Down Expand Up @@ -568,7 +568,7 @@ profile peaking factor \texttt{alphaj} is consistent with the input
values for the safety factor on axis and at the plasma edge (\texttt{q0}
and \texttt{q}, respectively), the plasma internal inductance \(l_i\) is
consistent with this \texttt{alphaj}, and the beta \(g\) coefficient
\texttt{dnbeta} scales with \(l_i\).
\texttt{beta_norm_max} scales with \(l_i\).

It is recommended that current scaling law \texttt{icurr\ =\ 4} is used
if \texttt{iprofile\ =\ 1}. Switch \texttt{gtscale} is over-ridden if
Expand Down
20 changes: 0 additions & 20 deletions documentation/proc-pages/physics-models/plasma_alpha.md

This file was deleted.

55 changes: 0 additions & 55 deletions documentation/proc-pages/physics-models/plasma_beta.md

This file was deleted.

Large diffs are not rendered by default.

413 changes: 413 additions & 0 deletions documentation/proc-pages/physics-models/plasma_beta/plasma_beta.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ $$

A limited degree of self-consistency between the plasma current profile and other parameters can be
enforced by setting switch `iprofile = 1`. This sets the current
profile peaking factor $\alpha_J$ (`alphaj`), the normalised internal inductance $l_i$ (`rli`) and beta limit $g$-factor (`dnbeta`) using the
profile peaking factor $\alpha_J$ (`alphaj`), the normalised internal inductance $l_i$ (`rli`) and beta limit $g$-factor (`beta_norm_max`) using the
safety factor on axis `q0` and the cylindrical safety factor $q_*$ (`qstar`):

$$\begin{aligned}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, output_file, save


x = np.linspace(1.0, 5, 500)
y = 3.12 + 3.5 * (1 / x) ** 1.7
source = ColumnDataSource(data=dict(x=x, y=y))

plot = figure(
x_range=(1, 5),
y_range=(2, 8),
width=400,
height=400,
title="Menard Normalized Beta Limit",
)
plot.xaxis.axis_label = r"Aspect ratio, \ $$[A]$$"
plot.yaxis.axis_label = r"Normalized beta limit, \ $$[\beta_N]$$"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure your labels are working?

image


plot.line("x", "y", source=source, line_width=3, line_alpha=0.6)

# Save the plot as HTML
output_file("menard_beta_norm.html", title="Menard Normalized Beta Limit")
save(plot)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, output_file, save


x = np.linspace(1.0, 5, 500)
y = 2.7 * (1 + 5 * (1 / x) ** 3.5)
source = ColumnDataSource(data=dict(x=x, y=y))

plot = figure(
x_range=(1, 5),
y_range=(2, 15),
width=400,
height=400,
title="Original Normalized Beta Limit",
)
plot.xaxis.axis_label = r"Aspect ratio, \ $$[A]$$"
plot.yaxis.axis_label = r"Normalized beta limit, \ $$[\beta_N]$$"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, labels are not rendering properly


plot.line("x", "y", source=source, line_width=3, line_alpha=0.6)

# Save the plot as HTML
output_file("original_beta_norm.html", title="Original Normalized Beta Limit")
save(plot)
18 changes: 9 additions & 9 deletions examples/data/csv_output_large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -343,23 +343,23 @@
Safety_factor_at_95%_flux_surface_______________________________________ (q95)_________________________ 3.4251E+00 ITV
Cylindrical_safety_factor_(qcyl)________________________________________ (qstar)_______________________ 2.8387E+00
Total_plasma_beta_______________________________________________________ (beta)________________________ 3.6055E-02 ITV
Total_poloidal_beta_____________________________________________________ (betap)_______________________ 1.2531E+00 OP
Total_poloidal_beta_____________________________________________________ (beta_poloidal)_______________________ 1.2531E+00 OP
Total_toroidal_beta_____________________________________________________ ______________________________ 3.7123E-02 OP
Fast_alpha_beta_________________________________________________________ (betaft)______________________ 4.4814E-03 OP
Beam_ion_beta___________________________________________________________ (betanb)______________________ 0.0000E+00 OP
(Fast_alpha_+_beam_beta)/(thermal_beta)_________________________________ (gammaft)_____________________ 1.4194E-01 OP
(Fast_alpha_+_beam_beta)/(thermal_beta)_________________________________ (f_beta_alpha_beam_thermal)_____________________ 1.4194E-01 OP
Thermal_beta____________________________________________________________ ______________________________ 3.1574E-02 OP
Thermal_poloidal_beta___________________________________________________ ______________________________ 1.0974E+00 OP
Thermal_toroidal_beta_(=_beta-exp)______________________________________ ______________________________ 3.2509E-02 OP
2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*betap)___________________ 4.1770E-01
2nd_stability_beta_upper_limit__________________________________________ (epbetmax)____________________ 1.3800E+00
Beta_g_coefficient______________________________________________________ (dnbeta)______________________ 4.7593E+00
2nd_stability_beta_:_beta_p_/_(R/a)_____________________________________ (eps*beta_poloidal)___________________ 4.1770E-01
2nd_stability_beta_upper_limit__________________________________________ (beta_poloidal_eps_max)____________________ 1.3800E+00
Beta_g_coefficient______________________________________________________ (beta_norm_max)______________________ 4.7593E+00
Normalised_thermal_beta_________________________________________________ ______________________________ 2.5527E+00
Normalised_total_beta___________________________________________________ ______________________________ 2.9150E+00
Normalised_toroidal_beta________________________________________________ (normalised_toroidal_beta)____ 3.0013E+00
Limit_on_thermal_beta___________________________________________________ (betalim)_____________________ 5.8867E-02
Plasma_thermal_energy_(J)_______________________________________________ ______________________________ 9.3900E+08 OP
Total_plasma_internal_energy_(J)________________________________________ (total_plasma_internal_energy) 1.0723E+09 OP
Total_plasma_internal_energy_(J)________________________________________ (e_plasma_beta) 1.0723E+09 OP
Electron_temperature_(keV)______________________________________________ (te)__________________________ 1.2238E+01 ITV
Electron_temperature_on_axis_(keV)______________________________________ (te0)_________________________ 2.5063E+01
Ion_temperature_(keV)___________________________________________________ (ti)__________________________ 1.2238E+01
Expand Down Expand Up @@ -1559,7 +1559,7 @@ alphan = 1.00
alphat = 1.45

* (troyon-like) coefficient for beta scaling
dnbeta = 3.0
beta_norm_max = 3.0

* Zohm elongation scaling adjustment factor (ishape=2; 3)
fkzohm = 1.02
Expand All @@ -1571,7 +1571,7 @@ gamma = 0.3
i_bootstrap_current = 4

* Switch for beta limit scaling
iculbl = 1
i_beta_component = 1

* Switch for plasma current scaling
i_plasma_current = 4
Expand All @@ -1580,7 +1580,7 @@ i_plasma_current = 4
i_density_limit = 7

* Switch for fast alpha pressure calculation
ifalphap = 1
i_beta_fast_alpha = 1

* Switch for inverse quadrature in l-mode scaling laws 5 and 9
iinvqd = 1
Expand Down
Loading
Loading