Skip to content

Commit

Permalink
Rename betalim_lower to beta_limit_lower for consistency and clarity …
Browse files Browse the repository at this point in the history
…across the codebase
  • Loading branch information
chris-ashe committed Nov 8, 2024
1 parent 605b29f commit 7906aa9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions source/fortran/constraint_equations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3130,16 +3130,16 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
!! author: J Lion, IPP Greifswald
!! args : output structure : residual error; constraint value;
!! residual error in physical units; output string; units string
!! (beta-beta_fast_alpha) > betalim_lower
!! (beta-beta_fast_alpha) > beta_limit_lower
!! #=# physics
!! #=#=# beta_fast_alpha, beta, fbetatry_lower
!! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
!! fbetatry_lower : input real : f-value for constraint beta-beta_fast_alpha > betalim_lower
!! betalim_lower : input real : Lower limit for beta
!! fbetatry_lower : input real : f-value for constraint beta-beta_fast_alpha > beta_limit_lower
!! beta_limit_lower : input real : Lower limit for beta
!! beta : input real : plasma beta
!! beta_fast_alpha : input real : Alpha particle beta

use physics_variables, only: betalim_lower, beta, beta_fast_alpha
use physics_variables, only: beta_limit_lower, beta, beta_fast_alpha
use constraint_variables, only: fbetatry_lower
implicit none
real(dp), intent(out) :: tmp_cc
Expand All @@ -3149,8 +3149,8 @@ subroutine constraint_eqn_084(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
character(len=10), intent(out) :: tmp_units


tmp_cc = 1.0D0 - fbetatry_lower * (beta-beta_fast_alpha)/betalim_lower
tmp_con = betalim_lower * (1.0D0 - tmp_cc)
tmp_cc = 1.0D0 - fbetatry_lower * (beta-beta_fast_alpha)/beta_limit_lower
tmp_con = beta_limit_lower * (1.0D0 - tmp_cc)
tmp_err = (beta-beta_fast_alpha) * tmp_cc
tmp_symbol = '>'
tmp_units = ''
Expand Down
6 changes: 3 additions & 3 deletions source/fortran/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ subroutine parse_input_file(in_file,out_file,show_changes)
itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, &
teped, f_helium3, iwalld, gamma, f_alpha_plasma, fgwped, tbeta, i_bootstrap_current, &
iradloss, te, alphan, rmajor, kappa, iinvqd, fkzohm, beamfus0, &
tauratio, idensl, bt, iscrp, ipnlaws, beta_limit_upper, betalim_lower, &
tauratio, idensl, bt, iscrp, ipnlaws, beta_limit_upper, beta_limit_lower, &
i_diamagnetic_current, i_pfirsch_schluter_current, m_s_limit, burnup_in
use pf_power_variables, only: iscenr, maxpoloidalpower
use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp
Expand Down Expand Up @@ -533,8 +533,8 @@ subroutine parse_input_file(in_file,out_file,show_changes)
case ('beta_limit_upper')
call parse_real_variable('beta_limit_upper', beta_limit_upper, 0.0D0, 1.0D0, &
'Plasma beta upper limit')
case ('betalim_lower')
call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, &
case ('beta_limit_lower')
call parse_real_variable('beta_limit_lower', beta_limit_lower, 0.0D0, 1.0D0, &
'Plasma beta lower limit')
case ('betbm0')
call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, &
Expand Down
2 changes: 1 addition & 1 deletion source/fortran/numerics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ subroutine init_numerics()
'ne0 > neped ', &
'toroidalgap > tftort ', &
'available_space > required_space ', &
'beta > betalim_lower ', &
'beta > beta_limit_lower ', &
'CP lifetime ', &
'TFC turn dimension ', &
'Cryogenic plant power ', &
Expand Down
4 changes: 2 additions & 2 deletions source/fortran/physics_variables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module physics_variables
real(dp) :: beta_limit_upper
!! Max allowable beta

real(dp) :: betalim_lower
real(dp) :: beta_limit_lower
!! allowable lower beta

real(dp) :: beta_beam
Expand Down Expand Up @@ -915,7 +915,7 @@ subroutine init_physics_variables
beta = 0.042D0
beta_fast_alpha = 0.0D0
beta_limit_upper = 0.0D0
betalim_lower = 0.0D0
beta_limit_lower = 0.0D0
beta_beam = 0.0D0
betap = 0.0D0
normalised_total_beta = 0.0D0
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/ref_dicts.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"beta_fast_alpha": 0.0,
"betai": 1.0,
"beta_limit_upper": 0.0,
"betalim_lower": 0.0,
"beta_limit_lower": 0.0,
"beta_beam": 0.0,
"betao": 1.0,
"betap": 0.0,
Expand Down Expand Up @@ -2973,7 +2973,7 @@
"ne0>neped",
"toroidalgap>tftort",
"available_space>required_space",
"beta>betalim_lower",
"beta>beta_limit_lower",
"CPlifetime",
"TFCturndimension",
"Cryogenicplantpower",
Expand Down Expand Up @@ -8865,7 +8865,7 @@
"beta_fast_alpha": "fast alpha beta component",
"betai": "poloidal plane angle between divertor plate and leg, inboard (rad)",
"beta_limit_upper": "allowable beta",
"betalim_lower": "allowable lower beta",
"beta_limit_lower": "allowable lower beta",
"beta_beam": "neutral beam beta component",
"betao": "poloidal plane angle between divertor plate and leg, outboard (rad)",
"betap": "poloidal beta",
Expand Down Expand Up @@ -11670,7 +11670,7 @@
"lb": 0.0,
"ub": 1.0
},
"betalim_lower": {
"beta_limit_lower": {
"lb": 0.0,
"ub": 1.0
},
Expand Down Expand Up @@ -19055,7 +19055,7 @@
"beta",
"beta_fast_alpha",
"beta_limit_upper",
"betalim_lower",
"beta_limit_lower",
"beta_beam",
"betap",
"normalised_total_beta",
Expand Down Expand Up @@ -20015,7 +20015,7 @@
"beta": "real_variable",
"betai": "real_variable",
"beta_limit_upper": "real_variable",
"betalim_lower": "real_variable",
"beta_limit_lower": "real_variable",
"betao": "real_variable",
"betbm0": "real_variable",
"betpmx": "real_variable",
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/input_files/st_regression.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ dnbeta = 5.0
*icc = 84
* DESCRIPTION: Constraint equation for lower limit of beta
* JUSTIFICATION: Turned off, do not require a beta lower limit
* VARIABLES: betalim_lower (Lower limit for beta). beta,betaft calculated in-situ
* VARIABLES: beta_limit_lower (Lower limit for beta). beta,betaft calculated in-situ

*betalim_lower =
*beta_limit_lower =
* DESCRIPTION: Plasma beta lower limit
* JUSTIFICATION: Turned off, not in use, Used with icc=84 to enforce beta limit

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/stellarator.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fptfnuc = 1 *f-value neutron heating
*----------------Physics Variables-----------------*

beta_limit_upper = 0.06 * upper beta limit
betalim_lower = 0.01 * lower beta limit
beta_limit_lower = 0.01 * lower beta limit
bigqmin = 1 * Minimal BigQ

powfmax = 500. *Maximal Fusion Power
Expand Down

0 comments on commit 7906aa9

Please sign in to comment.