Skip to content

Commit

Permalink
🔄 Rename fbeta to fbeta_poloidal_eps for consistency across the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ashe committed Dec 19, 2024
1 parent 9510a25 commit 63850d5
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion documentation/proc-pages/physics-models/error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ 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{beta_poloidal_eps_max}.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ $$

This constraint can be activated by stating `icc = 6` in the input file [^6].

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

The scaling value `fbeta_poloidal_eps` can be varied also.

!!! note "Origin of the $\epsilon\beta_p$ limit"

Expand Down
1 change: 1 addition & 0 deletions process/io/obsolete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"ifalphap": "i_beta_fast_alpha",
"betalim": "beta_max",
"betalim_lower": "beta_min",
"fbeta": "fbeta_poloidal_eps",
}

OBS_VARS_HELP = {
Expand Down
8 changes: 4 additions & 4 deletions source/fortran/constraint_equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -670,23 +670,23 @@ subroutine constraint_eqn_006(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
!! residual error in physical units; output string; units string
!! Equation for epsilon beta-poloidal upper limit
!! #=# physics
!! #=#=# fbeta, beta_poloidal_eps_max
!! #=#=# fbeta_poloidal_eps, beta_poloidal_eps_max
!! and hence also optional here.
!! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
!! fbeta : input real : f-value for epsilon beta-poloidal
!! fbeta_poloidal_eps : input real : f-value for epsilon beta-poloidal
!! beta_poloidal_eps_max : input real : maximum (eps*beta_poloidal)
!! eps : input real : inverse aspect ratio
!! beta_poloidal : input real : poloidal beta
use physics_variables, only: beta_poloidal_eps_max, eps, beta_poloidal
use constraint_variables, only: fbeta, fbeta
use constraint_variables, only: fbeta_poloidal_eps
implicit none
real(dp), intent(out) :: tmp_cc
real(dp), intent(out) :: tmp_con
real(dp), intent(out) :: tmp_err
character(len=1), intent(out) :: tmp_symbol
character(len=10), intent(out) :: tmp_units

tmp_cc = 1.0D0 - fbeta * beta_poloidal_eps_max/(eps*beta_poloidal)
tmp_cc = 1.0D0 - fbeta_poloidal_eps * beta_poloidal_eps_max/(eps*beta_poloidal)
tmp_con = beta_poloidal_eps_max * (1.0D0 - tmp_cc)
tmp_err = (eps*beta_poloidal) * tmp_cc
tmp_symbol = '<'
Expand Down
4 changes: 2 additions & 2 deletions source/fortran/constraint_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module constraint_variables
real(dp) :: fauxmn
!! f-value for minimum auxiliary power (`constraint equation 40`, `iteration variable 64`)

real(dp) :: fbeta
real(dp) :: fbeta_poloidal_eps
!! f-value for epsilon beta-poloidal (`constraint equation 6`, `iteration variable 8`)

real(dp) :: fbeta_poloidal
Expand Down Expand Up @@ -317,7 +317,7 @@ subroutine init_constraint_variables
bigqmin = 10.0D0
bmxlim = 12.0D0
fauxmn = 1.0D0
fbeta = 1.0D0
fbeta_poloidal_eps = 1.0D0
fbeta_poloidal = 1.0D0
fbeta_max = 1.0D0
fbeta_min = 1.0D0
Expand Down
6 changes: 3 additions & 3 deletions source/fortran/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ subroutine parse_input_file(in_file,out_file,show_changes)
ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, &
fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, &
ft_current_ramp_up, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, &
fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbeta_poloidal, fbeta, fjohc, &
fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbeta_poloidal, fbeta_poloidal_eps, fjohc, &
fflutf, bmxlim, t_burn_min, fbeta_min, fecrh_ignition, fstr_wp, fncycle
use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, &
cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, &
Expand Down Expand Up @@ -789,8 +789,8 @@ subroutine parse_input_file(in_file,out_file,show_changes)
case ('fauxmn')
call parse_real_variable('fauxmn', fauxmn, 0.001D0, 10.0D0, &
'F-value for minimum auxiliary power')
case ('fbeta')
call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, &
case ('fbeta_poloidal_eps')
call parse_real_variable('fbeta_poloidal_eps', fbeta_poloidal_eps, 0.001D0, 10.0D0, &
'F-value for eps.beta_poloidal beta limit')
case ('fbeta_poloidal')
call parse_real_variable('fbeta_poloidal', fbeta_poloidal, 0.001D0, 10.0D0, &
Expand Down
12 changes: 6 additions & 6 deletions source/fortran/iteration_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,25 @@ end subroutine set_itv_7
!---------------------------------

subroutine init_itv_8
!! <LI> ( 8) fbeta (f-value for equation 6)
!! <LI> ( 8) fbeta_poloidal_eps (f-value for equation 6)
use numerics, only: lablxc, boundl, boundu
implicit none
lablxc(8) = 'fbeta '
lablxc(8) = 'fbeta_poloidal_eps '
boundl(8) = 0.001D0
boundu(8) = 1.000D0
end subroutine init_itv_8

real(kind(1.d0)) function itv_8()
use constraint_variables, only: fbeta
use constraint_variables, only: fbeta_poloidal_eps
implicit none
itv_8 = fbeta
itv_8 = fbeta_poloidal_eps
end function itv_8

subroutine set_itv_8(ratio)
use constraint_variables, only: fbeta
use constraint_variables, only: fbeta_poloidal_eps
implicit none
real(kind(1.d0)) :: ratio
fbeta = ratio
fbeta_poloidal_eps = ratio
end subroutine set_itv_8

!---------------------------------
Expand Down
4 changes: 2 additions & 2 deletions source/fortran/numerics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ module numerics
!! <LI> ( 5) beta
!! <LI> ( 6) dene
!! <LI> ( 7) rnbeam
!! <LI> ( 8) fbeta (f-value for equation 6)
!! <LI> ( 8) fbeta_poloidal_eps (f-value for equation 6)
!! <LI> ( 9) fdene (f-value for equation 5)
!! <LI> (10) hfact
!! <LI> (11) pheat
Expand Down Expand Up @@ -538,7 +538,7 @@ subroutine init_numerics()
'ne0 > neped ', &
'toroidalgap > tftort ', &
'available_space > required_space ', &
'beta > beta_min ', &
'beta > beta_min ', &
'CP lifetime ', &
'TFC turn dimension ', &
'Cryogenic plant power ', &
Expand Down
24 changes: 12 additions & 12 deletions tests/integration/ref_dicts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/regression/input_files/st_regression.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ tratio = 1.0
*icc = 6
* DESCRIPTION: Equation for epsilon beta-poloidal upper limit
* JUSTIFICATION: Turned off, not in use
* VARIABLES: eps,fbeta Rest calculated in-situ
* VARIABLES: eps,fbeta_poloidal_eps Rest calculated in-situ

*beta_poloidal_eps_max
* DESCRIPTION: Max epsilon*beta value
Expand Down

0 comments on commit 63850d5

Please sign in to comment.