Skip to content

Commit

Permalink
🔄 Rename ifalphap to i_beta_fast_alpha for consistency across data fi…
Browse files Browse the repository at this point in the history
…les and scripts
  • Loading branch information
chris-ashe committed Dec 16, 2024
1 parent 3deffdb commit f79ed8f
Show file tree
Hide file tree
Showing 32 changed files with 46 additions and 46 deletions.
6 changes: 3 additions & 3 deletions documentation/proc-pages/physics-models/error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ 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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/data/large_tokamak_1_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_2_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_3_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_4_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion examples/data/scan_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -9242,7 +9242,7 @@ i_bootstrap_current = 4 * Switch for bootstrap current scaling;
i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24);
i_plasma_current = 4 * Switch for plasma current scaling to use;
idensl = 7 * Switch for density limit to enforce (constraint equation 5);
ifalphap = 1 * Switch for fast alpha pressure calculation;
i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation;
ifispact = 0 * Switch for neutronics calculations;
iinvqd = 1 * Switch for inverse quadrature in l-mode scaling laws 5 and 9;
ipedestal = 1 * Switch for pedestal profiles;
Expand Down
2 changes: 1 addition & 1 deletion process/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ def physics(self):
physics_variables.tin,
physics_variables.alpha_power_density_total,
physics_variables.alpha_power_density_plasma,
physics_variables.ifalphap,
physics_variables.i_beta_fast_alpha,
)

# Nominal mean neutron wall load on entire first wall area including divertor and beam holes
Expand Down
6 changes: 3 additions & 3 deletions process/physics_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def fast_alpha_beta(
tin: float,
alpha_power_density_total: float,
alpha_power_density_plasma: float,
ifalphap: int,
i_beta_fast_alpha: int,
) -> float:
"""
Calculate the fast alpha beta component.
Expand All @@ -950,7 +950,7 @@ def fast_alpha_beta(
tin (float): Density-weighted ion temperature (keV).
alpha_power_density_total (float): Alpha power per unit volume, from beams and plasma (MW/m^3).
alpha_power_density_plasma (float): Alpha power per unit volume just from plasma (MW/m^3).
ifalphap (int): Switch for fast alpha pressure method.
i_beta_fast_alpha (int): Switch for fast alpha pressure method.
Returns:
float: Fast alpha beta component.
Expand Down Expand Up @@ -982,7 +982,7 @@ def fast_alpha_beta(

# jlion: This "fact" model is heavily flawed for smaller temperatures! It is unphysical for a stellarator (high n low T)
# IPDG89 fast alpha scaling
if ifalphap == 0:
if i_beta_fast_alpha == 0:
fact = min(0.3, 0.29 * (deni / dene) ** 2 * ((ten + tin) / 20.0 - 0.37))

# Modified scaling, D J Ward
Expand Down
2 changes: 1 addition & 1 deletion process/stellarator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4247,7 +4247,7 @@ def stphys(self, output):
physics_variables.tin,
physics_variables.alpha_power_density_total,
physics_variables.alpha_power_density_plasma,
physics_variables.ifalphap,
physics_variables.i_beta_fast_alpha,
)

# Neutron wall load
Expand Down
6 changes: 3 additions & 3 deletions source/fortran/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ subroutine parse_input_file(in_file,out_file,show_changes)
fpdivlim, beta_poloidal_eps_max, isc, kappa95, aspect, cwrmax, nesep, c_beta, csawth, dene, &
ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, beta_norm_limit_upper, &
fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, f_tritium, &
ifalphap, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, &
i_beta_fast_alpha, tauee_in, alphaj, alphat, i_plasma_current, q, ti, tesep, rli, triang, &
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, &
Expand Down Expand Up @@ -635,8 +635,8 @@ subroutine parse_input_file(in_file,out_file,show_changes)
case ('i_diamagnetic_current')
call parse_int_variable('i_diamagnetic_current', i_diamagnetic_current, 0, 2, &
'Switch for diamagnetic scaling')
case ('ifalphap')
call parse_int_variable('ifalphap', ifalphap, 0, 1, &
case ('i_beta_fast_alpha')
call parse_int_variable('i_beta_fast_alpha', i_beta_fast_alpha, 0, 1, &
'Switch for fast alpha pressure fit')
case ('ignite')
call parse_int_variable('ignite', ignite, 0, 1, &
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 @@ -326,7 +326,7 @@ module physics_variables
integer :: idivrt
!! number of divertors (calculated from `i_single_null`)

integer :: ifalphap
integer :: i_beta_fast_alpha
!! switch for fast alpha pressure calculation
!!
!! - =0 ITER physics rules (Uckan) fit
Expand Down Expand Up @@ -1019,7 +1019,7 @@ subroutine init_physics_variables
i_diamagnetic_current = 0
idensl = 7
idivrt = 2
ifalphap = 1
i_beta_fast_alpha = 1
ignite = 0
iinvqd = 1
ipedestal = 1
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_1_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_2_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_3_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_4_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_once_through.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ i_bootstrap_current = 4 * switch for bootstrap current scaling
i_beta_component = 1 * switch for beta limit scaling (`constraint equation 24`)
i_plasma_current = 4 * switch for plasma current scaling to use
idensl = 7 * switch for density limit to enforce (`constraint equation 5`)
ifalphap = 1 * switch for fast alpha pressure calculation
i_beta_fast_alpha = 1 * switch for fast alpha pressure calculation
iinvqd = 1 * switch for inverse quadrature in L-mode scaling laws 5 and 9;
ipedestal = 1 * switch for pedestal profiles;
neped = 0.5e20 * electron density of pedestal [m-3] (`ipedestal==1)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/ref_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ i_bootstrap_current = 4 * Switch for bootstrap current scaling;
i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24);
i_plasma_current = 4 * Switch for plasma current scaling to use;
idensl = 7 * Switch for density limit to enforce (constraint equation 5);
ifalphap = 1 * Switch for fast alpha pressure calculation;
i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation;
ifispact = 0 * Switch for neutronics calculations;
iinvqd = 1 * Switch for inverse quadrature in l-mode scaling laws 5 and 9;
ipedestal = 1 * Switch for pedestal profiles;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/scan_2D_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -17860,7 +17860,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/integration/data/scan_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -9242,7 +9242,7 @@ i_bootstrap_current = 4 * Switch for bootstrap current scaling;
i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24);
i_plasma_current = 4 * Switch for plasma current scaling to use;
idensl = 7 * Switch for density limit to enforce (constraint equation 5);
ifalphap = 1 * Switch for fast alpha pressure calculation;
i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation;
ifispact = 0 * Switch for neutronics calculations;
iinvqd = 1 * Switch for inverse quadrature in l-mode scaling laws 5 and 9;
ipedestal = 1 * Switch for pedestal profiles;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/uncertainties_nonopt_ref_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ i_bootstrap_current = 4 * Switch for bootstrap current scaling;
i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24);
i_plasma_current = 4 * Switch for plasma current scaling to use;
idensl = 7 * Switch for density limit to enforce (constraint equation 5);
ifalphap = 1 * Switch for fast alpha pressure calculation;
i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation;
ifispact = 0 * Switch for neutronics calculations;
iinvqd = 1 * Switch for inverse quadrature in l-mode scaling laws 5 and 9;
ipedestal = 1 * Switch for pedestal profiles;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/uncertainties_ref_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ i_bootstrap_current = 4 * Switch for bootstrap current scaling;
i_beta_component = 1 * Switch for beta limit scaling (constraint equation 24);
i_plasma_current = 4 * Switch for plasma current scaling to use;
idensl = 7 * Switch for density limit to enforce (constraint equation 5);
ifalphap = 1 * Switch for fast alpha pressure calculation;
i_beta_fast_alpha = 1 * Switch for fast alpha pressure calculation;
ifispact = 0 * Switch for neutronics calculations;
iinvqd = 1 * Switch for inverse quadrature in l-mode scaling laws 5 and 9;
ipedestal = 1 * Switch for pedestal profiles;
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/ref_dicts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,7 @@
"idivrt": 2.0,
"iefrf": 5.0,
"iefrffix": 0.0,
"ifalphap": 1.0,
"i_beta_fast_alpha": 1.0,
"ife": 0.0,
"ifedrv": 2.0,
"ifetyp": 0.0,
Expand Down Expand Up @@ -9830,7 +9830,7 @@
"idivrt": "number of divertors (calculated from `i_single_null`)",
"iefrf": "Switch for current drive efficiency model:\n<ul>\n<li>=1 Fenstermacher Lower Hybrid</li>\n<li>=2 Ion Cyclotron current drive</li>\n<li>=3 Fenstermacher ECH</li>\n<li>=4 Ehst Lower Hybrid</li>\n<li>=5 ITER Neutral Beam</li>\n<li>=6 new Culham Lower Hybrid model</li>\n<li>=7 new Culham ECCD model</li>\n<li>=8 new Culham Neutral Beam model</li>\n<li>=9 RFP option removed in PROCESS (issue #508)</li>\n<li>=10 ECRH user input gamma</li>\n<li>=11 ECRH \"HARE\" model (E. Poli, Physics of Plasmas 2019)</li>\n<li>=12 EBW user scaling input. Scaling (S. Freethy)</li>\n</ul>",
"iefrffix": "Switch for 2nd current drive efficiency model:\n<ul>\n<li>=0 No fixed current drive</li>\n<li>=1 Fenstermacher Lower Hybrid</li>\n<li>=2 Ion Cyclotron current drive</li>\n<li>=3 Fenstermacher ECH</li>\n<li>=4 Ehst Lower Hybrid</li>\n<li>=5 ITER Neutral Beam</li>\n<li>=6 new Culham Lower Hybrid model</li>\n<li>=7 new Culham ECCD model</li>\n<li>=8 new Culham Neutral Beam model</li>\n<li>=9 RFP option removed in PROCESS (issue #508)</li>\n<li>=10 ECRH user input gamma</li>\n<li>=11 ECRH \"HARE\" model (E. Poli, Physics of Plasmas 2019)</li>\n<li>=12 EBW user scaling input. Scaling (S. Freethy)</li>\n</ul>",
"ifalphap": "switch for fast alpha pressure calculation\n<ul>\n<li>=0 ITER physics rules (Uckan) fit</li>\n<li>=1 Modified fit (D. Ward) - better at high temperature</li>\n</ul>",
"i_beta_fast_alpha": "switch for fast alpha pressure calculation\n<ul>\n<li>=0 ITER physics rules (Uckan) fit</li>\n<li>=1 Modified fit (D. Ward) - better at high temperature</li>\n</ul>",
"ife": "Switch for IFE option:\n<ul>\n<li>=0 use tokamak, RFP or stellarator model</li>\n<li>=1 use IFE model</li>\n</ul>",
"ifedrv": "Switch for type of IFE driver:\n<ul>\n<li>=-1 use gainve, etave for gain and driver efficiency</li>\n<li>=0 use tgain, drveff for gain and driver efficiency</li>\n<li>=1 use laser driver based on SOMBRERO design</li>\n<li>=2 use heavy ion beam driver based on OSIRIS</li>\n<li>=3 Input pfusife, rrin and drveff</li>\n</ul>",
"ifetyp": "Switch for type of IFE device build:\n<ul>\n<li>=0 generic (cylindrical) build</li>\n<li>=1 OSIRIS-like build</li>\n<li>=2 SOMBRERO-like build</li>\n<li>=3 HYLIFE-II-like build</li>\n<li>=4 2019 build</li>\n</ul>",
Expand Down Expand Up @@ -13361,7 +13361,7 @@
"lb": 0,
"ub": 12
},
"ifalphap": {
"i_beta_fast_alpha": {
"lb": 0,
"ub": 1
},
Expand Down Expand Up @@ -19141,7 +19141,7 @@
"i_diamagnetic_current",
"idensl",
"idivrt",
"ifalphap",
"i_beta_fast_alpha",
"igeom",
"ignite",
"iinvqd",
Expand Down Expand Up @@ -20469,7 +20469,7 @@
"i_diamagnetic_current": "int_variable",
"iefrf": "int_variable",
"iefrffix": "int_variable",
"ifalphap": "int_variable",
"i_beta_fast_alpha": "int_variable",
"ife": "int_variable",
"ifedrv": "int_variable",
"ifetyp": "int_variable",
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/large_tokamak.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/regression/input_files/large_tokamak_nof.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ i_plasma_current = 4
idensl = 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
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ i_bootstrap_current = 4 * switch for bootstrap current scaling
i_beta_component = 1 * switch for beta limit scaling (`constraint equation 24`)
i_plasma_current = 4 * switch for plasma current scaling to use
idensl = 7 * switch for density limit to enforce (`constraint equation 5`)
ifalphap = 1 * switch for fast alpha pressure calculation
i_beta_fast_alpha = 1 * switch for fast alpha pressure calculation
iinvqd = 1 * switch for inverse quadrature in L-mode scaling laws 5 and 9;
ipedestal = 1 * switch for pedestal profiles;
neped = 0.5e20 * electron density of pedestal [m-3] (`ipedestal==1)
Expand Down
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 @@ -371,7 +371,7 @@ beta_norm_limit_upper = 5.0

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*ifalphap =
*i_beta_fast_alpha =
* DESCRIPTION: Switch for fast alpha pressure calculation
* JUSTIFICATION: Not worried about alpha pressure, default =1, (modified fit)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/unit/data/large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ i_plasma_current = 4
idensl = 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
2 changes: 1 addition & 1 deletion tests/unit/test_physics_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SetFusionPowersParam(NamedTuple):

f_deuterium: Any = None

ifalphap: Any = None
i_beta_fast_alpha: Any = None

bp: Any = None

Expand Down

0 comments on commit f79ed8f

Please sign in to comment.